@idetik/core 0.13.1 → 0.13.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +6 -5
- package/dist/index.js +723 -708
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +28 -28
- package/dist/index.umd.cjs.map +1 -1
- package/dist/types/src/core/renderable_object.d.ts +1 -1
- package/dist/types/src/core/renderable_object.d.ts.map +1 -1
- package/dist/types/src/layers/volume_layer.d.ts +5 -4
- package/dist/types/src/layers/volume_layer.d.ts.map +1 -1
- package/dist/types/src/objects/renderable/volume_renderable.d.ts +1 -1
- package/dist/types/src/objects/renderable/volume_renderable.d.ts.map +1 -1
- package/dist/types/src/renderers/webgl_renderer.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -66,7 +66,7 @@ class l {
|
|
|
66
66
|
return I.length === 1 ? "0" + I : I;
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
|
-
class
|
|
69
|
+
class oC {
|
|
70
70
|
canvas_;
|
|
71
71
|
width_ = 0;
|
|
72
72
|
height_ = 0;
|
|
@@ -100,7 +100,7 @@ class sC {
|
|
|
100
100
|
this.backgroundColor_ = l.from(A);
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
|
-
var
|
|
103
|
+
var aC = `#version 300 es
|
|
104
104
|
|
|
105
105
|
const float PI = 3.14159265;
|
|
106
106
|
|
|
@@ -166,7 +166,7 @@ void main() {
|
|
|
166
166
|
|
|
167
167
|
|
|
168
168
|
gl_PointSize = 5.0;
|
|
169
|
-
}`,
|
|
169
|
+
}`, sC = `#version 300 es
|
|
170
170
|
|
|
171
171
|
precision mediump float;
|
|
172
172
|
|
|
@@ -190,7 +190,7 @@ out vec2 TexCoords;
|
|
|
190
190
|
void main() {
|
|
191
191
|
TexCoords = inUV;
|
|
192
192
|
gl_Position = Projection * ModelView * vec4(inPosition, 1.0);
|
|
193
|
-
}`,
|
|
193
|
+
}`, ZI = `#version 300 es
|
|
194
194
|
#pragma inject_defines
|
|
195
195
|
|
|
196
196
|
precision mediump float;
|
|
@@ -216,7 +216,7 @@ void main() {
|
|
|
216
216
|
float texel = float(texture(ImageSampler, TexCoords).r);
|
|
217
217
|
float value = (texel + ValueOffset) * ValueScale;
|
|
218
218
|
fragColor = vec4(value * Color, u_opacity);
|
|
219
|
-
}`,
|
|
219
|
+
}`, PI = `#version 300 es
|
|
220
220
|
#pragma inject_defines
|
|
221
221
|
|
|
222
222
|
precision mediump float;
|
|
@@ -253,7 +253,7 @@ void main() {
|
|
|
253
253
|
rgbColor += value * Color[i];
|
|
254
254
|
}
|
|
255
255
|
fragColor = vec4(rgbColor, u_opacity);
|
|
256
|
-
}`,
|
|
256
|
+
}`, DC = `#version 300 es
|
|
257
257
|
|
|
258
258
|
precision mediump float;
|
|
259
259
|
|
|
@@ -273,7 +273,7 @@ void main() {
|
|
|
273
273
|
gl_PointSize = inSize;
|
|
274
274
|
color = inColor;
|
|
275
275
|
marker = uint(inMarker);
|
|
276
|
-
}`,
|
|
276
|
+
}`, hC = `#version 300 es
|
|
277
277
|
|
|
278
278
|
precision mediump float;
|
|
279
279
|
|
|
@@ -293,7 +293,7 @@ void main() {
|
|
|
293
293
|
discard;
|
|
294
294
|
}
|
|
295
295
|
fragColor = vec4(color.rgb, u_opacity * alpha * color.a);
|
|
296
|
-
}`,
|
|
296
|
+
}`, tC = `#version 300 es
|
|
297
297
|
|
|
298
298
|
layout (location = 0) in vec3 inPosition;
|
|
299
299
|
layout (location = 1) in vec3 inNormal;
|
|
@@ -303,7 +303,7 @@ uniform mat4 ModelView;
|
|
|
303
303
|
|
|
304
304
|
void main() {
|
|
305
305
|
gl_Position = Projection * ModelView * vec4(inPosition, 1.0);
|
|
306
|
-
}`,
|
|
306
|
+
}`, yC = `#version 300 es
|
|
307
307
|
|
|
308
308
|
precision mediump float;
|
|
309
309
|
|
|
@@ -314,7 +314,7 @@ uniform vec3 u_color;
|
|
|
314
314
|
|
|
315
315
|
void main() {
|
|
316
316
|
fragColor = vec4(u_color, u_opacity);
|
|
317
|
-
}`,
|
|
317
|
+
}`, OI = `#version 300 es
|
|
318
318
|
|
|
319
319
|
precision highp float;
|
|
320
320
|
|
|
@@ -327,7 +327,7 @@ out highp vec3 PositionModel;
|
|
|
327
327
|
void main() {
|
|
328
328
|
PositionModel = inPosition;
|
|
329
329
|
gl_Position = Projection * ModelView * vec4(inPosition, 1.0);
|
|
330
|
-
}`,
|
|
330
|
+
}`, VI = `#version 300 es
|
|
331
331
|
#pragma inject_defines
|
|
332
332
|
precision highp float;
|
|
333
333
|
|
|
@@ -468,7 +468,7 @@ void main() {
|
|
|
468
468
|
}
|
|
469
469
|
|
|
470
470
|
fragColor = accumulatedColor;
|
|
471
|
-
}`,
|
|
471
|
+
}`, eC = `#version 300 es
|
|
472
472
|
|
|
473
473
|
precision mediump float;
|
|
474
474
|
precision highp int;
|
|
@@ -558,63 +558,63 @@ void main() {
|
|
|
558
558
|
|
|
559
559
|
fragColor = vec4(color.rgb, alpha);
|
|
560
560
|
}`;
|
|
561
|
-
const
|
|
561
|
+
const GC = {
|
|
562
562
|
projectedLine: {
|
|
563
|
+
vertex: aC,
|
|
564
|
+
fragment: sC
|
|
565
|
+
},
|
|
566
|
+
points: {
|
|
563
567
|
vertex: DC,
|
|
564
568
|
fragment: hC
|
|
565
569
|
},
|
|
566
|
-
|
|
570
|
+
wireframe: {
|
|
567
571
|
vertex: tC,
|
|
568
572
|
fragment: yC
|
|
569
573
|
},
|
|
570
|
-
wireframe: {
|
|
571
|
-
vertex: eC,
|
|
572
|
-
fragment: GC
|
|
573
|
-
},
|
|
574
574
|
floatScalarImage: {
|
|
575
575
|
vertex: rA,
|
|
576
|
-
fragment:
|
|
576
|
+
fragment: ZI
|
|
577
577
|
},
|
|
578
578
|
floatScalarImageArray: {
|
|
579
579
|
vertex: rA,
|
|
580
|
-
fragment:
|
|
580
|
+
fragment: PI
|
|
581
581
|
},
|
|
582
582
|
intScalarImage: {
|
|
583
583
|
vertex: rA,
|
|
584
|
-
fragment:
|
|
584
|
+
fragment: ZI,
|
|
585
585
|
fragmentDefines: /* @__PURE__ */ new Map([["TEXTURE_DATA_TYPE_INT", "1"]])
|
|
586
586
|
},
|
|
587
587
|
intScalarImageArray: {
|
|
588
588
|
vertex: rA,
|
|
589
|
-
fragment:
|
|
589
|
+
fragment: PI,
|
|
590
590
|
fragmentDefines: /* @__PURE__ */ new Map([["TEXTURE_DATA_TYPE_INT", "1"]])
|
|
591
591
|
},
|
|
592
592
|
uintScalarImage: {
|
|
593
593
|
vertex: rA,
|
|
594
|
-
fragment:
|
|
594
|
+
fragment: ZI,
|
|
595
595
|
fragmentDefines: /* @__PURE__ */ new Map([["TEXTURE_DATA_TYPE_UINT", "1"]])
|
|
596
596
|
},
|
|
597
597
|
uintScalarImageArray: {
|
|
598
598
|
vertex: rA,
|
|
599
|
-
fragment:
|
|
599
|
+
fragment: PI,
|
|
600
600
|
fragmentDefines: /* @__PURE__ */ new Map([["TEXTURE_DATA_TYPE_UINT", "1"]])
|
|
601
601
|
},
|
|
602
602
|
labelImage: {
|
|
603
603
|
vertex: rA,
|
|
604
|
-
fragment:
|
|
604
|
+
fragment: eC
|
|
605
605
|
},
|
|
606
606
|
floatVolume: {
|
|
607
|
-
vertex:
|
|
608
|
-
fragment:
|
|
607
|
+
vertex: OI,
|
|
608
|
+
fragment: VI
|
|
609
609
|
},
|
|
610
610
|
intVolume: {
|
|
611
|
-
vertex:
|
|
612
|
-
fragment:
|
|
611
|
+
vertex: OI,
|
|
612
|
+
fragment: VI,
|
|
613
613
|
fragmentDefines: /* @__PURE__ */ new Map([["TEXTURE_DATA_TYPE_INT", "1"]])
|
|
614
614
|
},
|
|
615
615
|
uintVolume: {
|
|
616
|
-
vertex:
|
|
617
|
-
fragment:
|
|
616
|
+
vertex: OI,
|
|
617
|
+
fragment: VI,
|
|
618
618
|
fragmentDefines: /* @__PURE__ */ new Map([["TEXTURE_DATA_TYPE_UINT", "1"]])
|
|
619
619
|
}
|
|
620
620
|
}, Zg = {
|
|
@@ -622,7 +622,7 @@ const wC = {
|
|
|
622
622
|
info: 20,
|
|
623
623
|
warn: 30,
|
|
624
624
|
error: 40
|
|
625
|
-
},
|
|
625
|
+
}, nC = {
|
|
626
626
|
debug: "\x1B[90m",
|
|
627
627
|
// gray
|
|
628
628
|
info: "\x1B[36m",
|
|
@@ -632,7 +632,7 @@ const wC = {
|
|
|
632
632
|
error: "\x1B[31m"
|
|
633
633
|
// red
|
|
634
634
|
};
|
|
635
|
-
function
|
|
635
|
+
function wC() {
|
|
636
636
|
const g = typeof process < "u" && typeof process.env?.NODE_ENV == "string" ? process.env.NODE_ENV : void 0;
|
|
637
637
|
if (g === "production" || g === "development" || g === "test")
|
|
638
638
|
return g;
|
|
@@ -644,7 +644,7 @@ function rC() {
|
|
|
644
644
|
return "development";
|
|
645
645
|
}
|
|
646
646
|
class U {
|
|
647
|
-
static logLevel_ =
|
|
647
|
+
static logLevel_ = wC() === "production" ? "warn" : "debug";
|
|
648
648
|
static setLogLevel(A) {
|
|
649
649
|
U.logLevel_ = A;
|
|
650
650
|
}
|
|
@@ -662,7 +662,7 @@ class U {
|
|
|
662
662
|
}
|
|
663
663
|
static log(A, I, B, ...C) {
|
|
664
664
|
if (Zg[A] < Zg[U.logLevel_]) return;
|
|
665
|
-
const Q = (/* @__PURE__ */ new Date()).toISOString(), E =
|
|
665
|
+
const Q = (/* @__PURE__ */ new Date()).toISOString(), E = nC[A], i = `[${Q}][${A.toUpperCase()}][${I}]`, o = [`${E}${i}`, B, ...C];
|
|
666
666
|
switch (A) {
|
|
667
667
|
case "debug":
|
|
668
668
|
console.debug(...o);
|
|
@@ -679,7 +679,7 @@ class U {
|
|
|
679
679
|
}
|
|
680
680
|
}
|
|
681
681
|
}
|
|
682
|
-
class
|
|
682
|
+
class FC {
|
|
683
683
|
gl_;
|
|
684
684
|
program_;
|
|
685
685
|
uniformInfo_ = /* @__PURE__ */ new Map();
|
|
@@ -761,7 +761,7 @@ class SC {
|
|
|
761
761
|
for (let I = 0; I < A; I++) {
|
|
762
762
|
const B = this.gl_.getActiveUniform(this.program_, I);
|
|
763
763
|
if (B) {
|
|
764
|
-
if (!
|
|
764
|
+
if (!SC.has(B.type))
|
|
765
765
|
throw new Error(
|
|
766
766
|
`Unsupported uniform type "${B.type}" (GLenum) found in shader program for uniform "${B.name}"`
|
|
767
767
|
);
|
|
@@ -802,7 +802,7 @@ class SC {
|
|
|
802
802
|
return Array.from(this.uniformInfo_.keys());
|
|
803
803
|
}
|
|
804
804
|
}
|
|
805
|
-
const
|
|
805
|
+
const rC = typeof window < "u" ? [
|
|
806
806
|
WebGL2RenderingContext.BOOL,
|
|
807
807
|
WebGL2RenderingContext.FLOAT,
|
|
808
808
|
WebGL2RenderingContext.INT,
|
|
@@ -827,10 +827,10 @@ const RC = typeof window < "u" ? [
|
|
|
827
827
|
WebGL2RenderingContext.UNSIGNED_INT_SAMPLER_3D,
|
|
828
828
|
WebGL2RenderingContext.UNSIGNED_INT_SAMPLER_CUBE,
|
|
829
829
|
WebGL2RenderingContext.UNSIGNED_INT_SAMPLER_2D_ARRAY
|
|
830
|
-
] : [],
|
|
831
|
-
|
|
832
|
-
),
|
|
833
|
-
class
|
|
830
|
+
] : [], SC = new Set(
|
|
831
|
+
rC
|
|
832
|
+
), vI = "#pragma inject_defines";
|
|
833
|
+
class RC {
|
|
834
834
|
gl_;
|
|
835
835
|
programs_ = /* @__PURE__ */ new Map();
|
|
836
836
|
constructor(A) {
|
|
@@ -839,14 +839,14 @@ class cC {
|
|
|
839
839
|
use(A) {
|
|
840
840
|
let I = this.programs_.get(A);
|
|
841
841
|
if (I === void 0) {
|
|
842
|
-
const B =
|
|
842
|
+
const B = GC[A], C = Pg(
|
|
843
843
|
B.vertex,
|
|
844
844
|
B.vertexDefines
|
|
845
845
|
), Q = Pg(
|
|
846
846
|
B.fragment,
|
|
847
847
|
B.fragmentDefines
|
|
848
848
|
);
|
|
849
|
-
I = new
|
|
849
|
+
I = new FC(
|
|
850
850
|
this.gl_,
|
|
851
851
|
C,
|
|
852
852
|
Q
|
|
@@ -862,14 +862,14 @@ class cC {
|
|
|
862
862
|
}
|
|
863
863
|
function Pg(g, A) {
|
|
864
864
|
if (A === void 0 || A.size == 0) return g;
|
|
865
|
-
if (!g.includes(
|
|
865
|
+
if (!g.includes(vI))
|
|
866
866
|
throw new Error(
|
|
867
|
-
`Shader source does not contain "${
|
|
867
|
+
`Shader source does not contain "${vI}" directive`
|
|
868
868
|
);
|
|
869
869
|
const I = Array(A.entries()).map(([E, i]) => `#define ${E} ${i}`).join(`
|
|
870
870
|
`), C = `#line __LINE__ + ${1 - A.size}`, Q = `${I}
|
|
871
871
|
${C}`;
|
|
872
|
-
return g.replace(
|
|
872
|
+
return g.replace(vI, Q);
|
|
873
873
|
}
|
|
874
874
|
const v = [
|
|
875
875
|
"00",
|
|
@@ -1129,34 +1129,34 @@ const v = [
|
|
|
1129
1129
|
"fe",
|
|
1130
1130
|
"ff"
|
|
1131
1131
|
];
|
|
1132
|
-
function
|
|
1132
|
+
function LB() {
|
|
1133
1133
|
const g = Math.random() * 4294967295 | 0, A = Math.random() * 4294967295 | 0, I = Math.random() * 4294967295 | 0, B = Math.random() * 4294967295 | 0;
|
|
1134
1134
|
return (v[g & 255] + v[g >> 8 & 255] + v[g >> 16 & 255] + v[g >> 24 & 255] + "-" + v[A & 255] + v[A >> 8 & 255] + "-" + v[A >> 16 & 15 | 64] + v[A >> 24 & 255] + "-" + v[I & 63 | 128] + v[I >> 8 & 255] + "-" + v[I >> 16 & 255] + v[I >> 24 & 255] + v[B & 255] + v[B >> 8 & 255] + v[B >> 16 & 255] + v[B >> 24 & 255]).toLowerCase();
|
|
1135
1135
|
}
|
|
1136
1136
|
class yg {
|
|
1137
|
-
uuid =
|
|
1137
|
+
uuid = LB();
|
|
1138
1138
|
}
|
|
1139
|
-
var p = 1e-6, b = typeof Float32Array < "u" ? Float32Array : Array,
|
|
1140
|
-
function
|
|
1141
|
-
return g *
|
|
1139
|
+
var p = 1e-6, b = typeof Float32Array < "u" ? Float32Array : Array, NC = Math.PI / 180;
|
|
1140
|
+
function cC(g) {
|
|
1141
|
+
return g * NC;
|
|
1142
1142
|
}
|
|
1143
1143
|
Math.hypot || (Math.hypot = function() {
|
|
1144
1144
|
for (var g = 0, A = arguments.length; A--; )
|
|
1145
1145
|
g += arguments[A] * arguments[A];
|
|
1146
1146
|
return Math.sqrt(g);
|
|
1147
1147
|
});
|
|
1148
|
-
function
|
|
1148
|
+
function JB() {
|
|
1149
1149
|
var g = new b(9);
|
|
1150
1150
|
return b != Float32Array && (g[1] = 0, g[2] = 0, g[3] = 0, g[5] = 0, g[6] = 0, g[7] = 0), g[0] = 1, g[4] = 1, g[8] = 1, g;
|
|
1151
1151
|
}
|
|
1152
|
-
function
|
|
1152
|
+
function UC(g, A) {
|
|
1153
1153
|
return g[0] = A[0], g[1] = A[1], g[2] = A[2], g[3] = A[4], g[4] = A[5], g[5] = A[6], g[6] = A[8], g[7] = A[9], g[8] = A[10], g;
|
|
1154
1154
|
}
|
|
1155
1155
|
function _() {
|
|
1156
1156
|
var g = new b(16);
|
|
1157
1157
|
return b != Float32Array && (g[1] = 0, g[2] = 0, g[3] = 0, g[4] = 0, g[6] = 0, g[7] = 0, g[8] = 0, g[9] = 0, g[11] = 0, g[12] = 0, g[13] = 0, g[14] = 0), g[0] = 1, g[5] = 1, g[10] = 1, g[15] = 1, g;
|
|
1158
1158
|
}
|
|
1159
|
-
function
|
|
1159
|
+
function mI(g, A) {
|
|
1160
1160
|
var I = A[0], B = A[1], C = A[2], Q = A[3], E = A[4], i = A[5], o = A[6], a = A[7], s = A[8], h = A[9], t = A[10], y = A[11], n = A[12], w = A[13], r = A[14], G = A[15], c = I * i - B * E, N = I * o - C * E, d = I * a - Q * E, L = B * o - C * i, k = B * a - Q * i, T = C * a - Q * o, P = s * w - h * n, O = s * r - t * n, Z = s * G - y * n, V = h * r - t * w, iA = h * G - y * w, oA = t * G - y * r, u = c * oA - N * iA + d * V + L * Z - k * O + T * P;
|
|
1161
1161
|
return u ? (u = 1 / u, g[0] = (i * oA - o * iA + a * V) * u, g[1] = (C * iA - B * oA - Q * V) * u, g[2] = (w * T - r * k + G * L) * u, g[3] = (t * k - h * T - y * L) * u, g[4] = (o * Z - E * oA - a * O) * u, g[5] = (I * oA - C * Z + Q * O) * u, g[6] = (r * d - n * T - G * N) * u, g[7] = (s * T - t * d + y * N) * u, g[8] = (E * iA - i * Z + a * P) * u, g[9] = (B * Z - I * iA - Q * P) * u, g[10] = (n * k - w * d + G * c) * u, g[11] = (h * d - s * k - y * c) * u, g[12] = (i * O - E * V - o * P) * u, g[13] = (I * V - B * O + C * P) * u, g[14] = (w * N - n * L - r * c) * u, g[15] = (s * L - h * N + t * c) * u, g) : null;
|
|
1162
1162
|
}
|
|
@@ -1164,30 +1164,30 @@ function zA(g, A, I) {
|
|
|
1164
1164
|
var B = A[0], C = A[1], Q = A[2], E = A[3], i = A[4], o = A[5], a = A[6], s = A[7], h = A[8], t = A[9], y = A[10], n = A[11], w = A[12], r = A[13], G = A[14], c = A[15], N = I[0], d = I[1], L = I[2], k = I[3];
|
|
1165
1165
|
return g[0] = N * B + d * i + L * h + k * w, g[1] = N * C + d * o + L * t + k * r, g[2] = N * Q + d * a + L * y + k * G, g[3] = N * E + d * s + L * n + k * c, N = I[4], d = I[5], L = I[6], k = I[7], g[4] = N * B + d * i + L * h + k * w, g[5] = N * C + d * o + L * t + k * r, g[6] = N * Q + d * a + L * y + k * G, g[7] = N * E + d * s + L * n + k * c, N = I[8], d = I[9], L = I[10], k = I[11], g[8] = N * B + d * i + L * h + k * w, g[9] = N * C + d * o + L * t + k * r, g[10] = N * Q + d * a + L * y + k * G, g[11] = N * E + d * s + L * n + k * c, N = I[12], d = I[13], L = I[14], k = I[15], g[12] = N * B + d * i + L * h + k * w, g[13] = N * C + d * o + L * t + k * r, g[14] = N * Q + d * a + L * y + k * G, g[15] = N * E + d * s + L * n + k * c, g;
|
|
1166
1166
|
}
|
|
1167
|
-
function
|
|
1167
|
+
function kC(g, A) {
|
|
1168
1168
|
return g[0] = A[0], g[1] = 0, g[2] = 0, g[3] = 0, g[4] = 0, g[5] = A[1], g[6] = 0, g[7] = 0, g[8] = 0, g[9] = 0, g[10] = A[2], g[11] = 0, g[12] = 0, g[13] = 0, g[14] = 0, g[15] = 1, g;
|
|
1169
1169
|
}
|
|
1170
|
-
function
|
|
1170
|
+
function LC(g, A, I, B) {
|
|
1171
1171
|
var C = A[0], Q = A[1], E = A[2], i = A[3], o = C + C, a = Q + Q, s = E + E, h = C * o, t = C * a, y = C * s, n = Q * a, w = Q * s, r = E * s, G = i * o, c = i * a, N = i * s, d = B[0], L = B[1], k = B[2];
|
|
1172
1172
|
return g[0] = (1 - (n + r)) * d, g[1] = (t + N) * d, g[2] = (y - c) * d, g[3] = 0, g[4] = (t - N) * L, g[5] = (1 - (h + r)) * L, g[6] = (w + G) * L, g[7] = 0, g[8] = (y + c) * k, g[9] = (w - G) * k, g[10] = (1 - (h + n)) * k, g[11] = 0, g[12] = I[0], g[13] = I[1], g[14] = I[2], g[15] = 1, g;
|
|
1173
1173
|
}
|
|
1174
|
-
function
|
|
1174
|
+
function JC(g, A, I, B, C) {
|
|
1175
1175
|
var Q = 1 / Math.tan(A / 2), E;
|
|
1176
1176
|
return g[0] = Q / I, g[1] = 0, g[2] = 0, g[3] = 0, g[4] = 0, g[5] = Q, g[6] = 0, g[7] = 0, g[8] = 0, g[9] = 0, g[11] = -1, g[12] = 0, g[13] = 0, g[15] = 0, C != null && C !== 1 / 0 ? (E = 1 / (B - C), g[10] = (C + B) * E, g[14] = 2 * C * B * E) : (g[10] = -1, g[14] = -2 * B), g;
|
|
1177
1177
|
}
|
|
1178
|
-
var
|
|
1179
|
-
function
|
|
1178
|
+
var YC = JC;
|
|
1179
|
+
function dC(g, A, I, B, C, Q, E) {
|
|
1180
1180
|
var i = 1 / (A - I), o = 1 / (B - C), a = 1 / (Q - E);
|
|
1181
1181
|
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] = (C + B) * o, g[14] = (E + Q) * a, g[15] = 1, g;
|
|
1182
1182
|
}
|
|
1183
|
-
var
|
|
1184
|
-
function
|
|
1183
|
+
var MC = dC;
|
|
1184
|
+
function KC(g, A, I, B) {
|
|
1185
1185
|
var C = A[0], Q = A[1], E = A[2], i = B[0], o = B[1], a = B[2], s = C - I[0], h = Q - I[1], t = E - I[2], y = s * s + h * h + t * t;
|
|
1186
1186
|
y > 0 && (y = 1 / Math.sqrt(y), s *= y, h *= y, t *= y);
|
|
1187
1187
|
var n = o * t - a * h, w = a * s - i * t, r = i * h - o * s;
|
|
1188
1188
|
return y = n * n + w * w + r * r, y > 0 && (y = 1 / Math.sqrt(y), n *= y, w *= y, r *= y), g[0] = n, g[1] = w, g[2] = r, g[3] = 0, g[4] = h * r - t * w, g[5] = t * n - s * r, g[6] = s * w - h * n, g[7] = 0, g[8] = s, g[9] = h, g[10] = t, g[11] = 0, g[12] = C, g[13] = Q, g[14] = E, g[15] = 1, g;
|
|
1189
1189
|
}
|
|
1190
|
-
function
|
|
1190
|
+
function HC(g, A) {
|
|
1191
1191
|
var I = g[0], B = g[1], C = g[2], Q = g[3], E = g[4], i = g[5], o = g[6], a = g[7], s = g[8], h = g[9], t = g[10], y = g[11], n = g[12], w = g[13], r = g[14], G = g[15], c = A[0], N = A[1], d = A[2], L = A[3], k = A[4], T = A[5], P = A[6], O = A[7], Z = A[8], V = A[9], iA = A[10], oA = A[11], u = A[12], xg = A[13], Wg = A[14], bg = A[15];
|
|
1192
1192
|
return Math.abs(I - c) <= p * Math.max(1, Math.abs(I), Math.abs(c)) && Math.abs(B - N) <= p * Math.max(1, Math.abs(B), Math.abs(N)) && Math.abs(C - d) <= p * Math.max(1, Math.abs(C), Math.abs(d)) && Math.abs(Q - L) <= p * Math.max(1, Math.abs(Q), Math.abs(L)) && Math.abs(E - k) <= p * Math.max(1, Math.abs(E), Math.abs(k)) && Math.abs(i - T) <= p * Math.max(1, Math.abs(i), Math.abs(T)) && Math.abs(o - P) <= p * Math.max(1, Math.abs(o), Math.abs(P)) && Math.abs(a - O) <= p * Math.max(1, Math.abs(a), Math.abs(O)) && Math.abs(s - Z) <= p * Math.max(1, Math.abs(s), Math.abs(Z)) && Math.abs(h - V) <= p * Math.max(1, Math.abs(h), Math.abs(V)) && Math.abs(t - iA) <= p * Math.max(1, Math.abs(t), Math.abs(iA)) && Math.abs(y - oA) <= p * Math.max(1, Math.abs(y), Math.abs(oA)) && Math.abs(n - u) <= p * Math.max(1, Math.abs(n), Math.abs(u)) && Math.abs(w - xg) <= p * Math.max(1, Math.abs(w), Math.abs(xg)) && Math.abs(r - Wg) <= p * Math.max(1, Math.abs(r), Math.abs(Wg)) && Math.abs(G - bg) <= p * Math.max(1, Math.abs(G), Math.abs(bg));
|
|
1193
1193
|
}
|
|
@@ -1216,10 +1216,10 @@ function SA(g, A, I, B) {
|
|
|
1216
1216
|
function lA(g, A, I) {
|
|
1217
1217
|
return g[0] = A[0] + I[0], g[1] = A[1] + I[1], g[2] = A[2] + I[2], g;
|
|
1218
1218
|
}
|
|
1219
|
-
function
|
|
1219
|
+
function qC(g, A, I) {
|
|
1220
1220
|
return g[0] = A[0] - I[0], g[1] = A[1] - I[1], g[2] = A[2] - I[2], g;
|
|
1221
1221
|
}
|
|
1222
|
-
function
|
|
1222
|
+
function lC(g, A, I) {
|
|
1223
1223
|
return g[0] = A[0] * I[0], g[1] = A[1] * I[1], g[2] = A[2] * I[2], g;
|
|
1224
1224
|
}
|
|
1225
1225
|
function fA(g, A, I) {
|
|
@@ -1236,33 +1236,33 @@ function Vg(g, A) {
|
|
|
1236
1236
|
var I = A[0] - g[0], B = A[1] - g[1], C = A[2] - g[2];
|
|
1237
1237
|
return I * I + B * B + C * C;
|
|
1238
1238
|
}
|
|
1239
|
-
function
|
|
1239
|
+
function fC(g, A) {
|
|
1240
1240
|
var I = A[0], B = A[1], C = A[2], Q = I * I + B * B + C * C;
|
|
1241
1241
|
return Q > 0 && (Q = 1 / Math.sqrt(Q)), g[0] = A[0] * Q, g[1] = A[1] * Q, g[2] = A[2] * Q, g;
|
|
1242
1242
|
}
|
|
1243
|
-
function
|
|
1243
|
+
function YB(g, A) {
|
|
1244
1244
|
return g[0] * A[0] + g[1] * A[1] + g[2] * A[2];
|
|
1245
1245
|
}
|
|
1246
|
-
function
|
|
1246
|
+
function XI(g, A, I) {
|
|
1247
1247
|
var B = A[0], C = A[1], Q = A[2], E = I[0], i = I[1], o = I[2];
|
|
1248
1248
|
return g[0] = C * o - Q * i, g[1] = Q * E - B * o, g[2] = B * i - C * E, g;
|
|
1249
1249
|
}
|
|
1250
|
-
function
|
|
1250
|
+
function pC(g, A, I, B, C, Q) {
|
|
1251
1251
|
var E = 1 - Q, i = E * E, o = Q * Q, a = i * E, s = 3 * Q * i, h = 3 * o * E, t = o * Q;
|
|
1252
1252
|
return g[0] = A[0] * a + I[0] * s + B[0] * h + C[0] * t, g[1] = A[1] * a + I[1] * s + B[1] * h + C[1] * t, g[2] = A[2] * a + I[2] * s + B[2] * h + C[2] * t, g;
|
|
1253
1253
|
}
|
|
1254
|
-
function
|
|
1254
|
+
function uI(g, A, I) {
|
|
1255
1255
|
var B = A[0], C = A[1], Q = A[2], E = I[3] * B + I[7] * C + I[11] * Q + I[15];
|
|
1256
1256
|
return E = E || 1, g[0] = (I[0] * B + I[4] * C + I[8] * Q + I[12]) / E, g[1] = (I[1] * B + I[5] * C + I[9] * Q + I[13]) / E, g[2] = (I[2] * B + I[6] * C + I[10] * Q + I[14]) / E, g;
|
|
1257
1257
|
}
|
|
1258
|
-
function
|
|
1258
|
+
function mC(g) {
|
|
1259
1259
|
return g[0] = 0, g[1] = 0, g[2] = 0, g;
|
|
1260
1260
|
}
|
|
1261
|
-
function
|
|
1261
|
+
function dB(g, A) {
|
|
1262
1262
|
var I = g[0], B = g[1], C = g[2], Q = A[0], E = A[1], i = A[2];
|
|
1263
1263
|
return Math.abs(I - Q) <= p * Math.max(1, Math.abs(I), Math.abs(Q)) && Math.abs(B - E) <= p * Math.max(1, Math.abs(B), Math.abs(E)) && Math.abs(C - i) <= p * Math.max(1, Math.abs(C), Math.abs(i));
|
|
1264
1264
|
}
|
|
1265
|
-
var UI =
|
|
1265
|
+
var UI = qC, uC = eg;
|
|
1266
1266
|
(function() {
|
|
1267
1267
|
var g = f();
|
|
1268
1268
|
return function(A, I, B, C, Q, E) {
|
|
@@ -1276,7 +1276,7 @@ function pA() {
|
|
|
1276
1276
|
var g = new b(4);
|
|
1277
1277
|
return b != Float32Array && (g[0] = 0, g[1] = 0, g[2] = 0, g[3] = 0), g;
|
|
1278
1278
|
}
|
|
1279
|
-
function
|
|
1279
|
+
function TC(g) {
|
|
1280
1280
|
var A = new b(4);
|
|
1281
1281
|
return A[0] = g[0], A[1] = g[1], A[2] = g[2], A[3] = g[3], A;
|
|
1282
1282
|
}
|
|
@@ -1284,13 +1284,13 @@ function kI(g, A, I, B) {
|
|
|
1284
1284
|
var C = new b(4);
|
|
1285
1285
|
return C[0] = g, C[1] = A, C[2] = I, C[3] = B, C;
|
|
1286
1286
|
}
|
|
1287
|
-
function
|
|
1287
|
+
function xC(g, A) {
|
|
1288
1288
|
return g[0] = A[0], g[1] = A[1], g[2] = A[2], g[3] = A[3], g;
|
|
1289
1289
|
}
|
|
1290
|
-
function
|
|
1290
|
+
function WC(g, A, I) {
|
|
1291
1291
|
return g[0] = A[0] * I, g[1] = A[1] * I, g[2] = A[2] * I, g[3] = A[3] * I, g;
|
|
1292
1292
|
}
|
|
1293
|
-
function
|
|
1293
|
+
function bC(g, A) {
|
|
1294
1294
|
var I = A[0], B = A[1], C = A[2], Q = A[3], E = I * I + B * B + C * C + Q * Q;
|
|
1295
1295
|
return E > 0 && (E = 1 / Math.sqrt(E)), g[0] = I * E, g[1] = B * E, g[2] = C * E, g[3] = Q * E, g;
|
|
1296
1296
|
}
|
|
@@ -1307,24 +1307,24 @@ function _A(g, A, I) {
|
|
|
1307
1307
|
return A;
|
|
1308
1308
|
};
|
|
1309
1309
|
})();
|
|
1310
|
-
function
|
|
1310
|
+
function Cg() {
|
|
1311
1311
|
var g = new b(4);
|
|
1312
1312
|
return b != Float32Array && (g[0] = 0, g[1] = 0, g[2] = 0), g[3] = 1, g;
|
|
1313
1313
|
}
|
|
1314
|
-
function
|
|
1314
|
+
function ZC(g, A, I) {
|
|
1315
1315
|
I = I * 0.5;
|
|
1316
1316
|
var B = Math.sin(I);
|
|
1317
1317
|
return g[0] = B * A[0], g[1] = B * A[1], g[2] = B * A[2], g[3] = Math.cos(I), g;
|
|
1318
1318
|
}
|
|
1319
|
-
function
|
|
1319
|
+
function PC(g, A, I) {
|
|
1320
1320
|
var B = A[0], C = A[1], Q = A[2], E = A[3], i = I[0], o = I[1], a = I[2], s = I[3];
|
|
1321
1321
|
return g[0] = B * s + E * i + C * a - Q * o, g[1] = C * s + E * o + Q * i - B * a, g[2] = Q * s + E * a + B * o - C * i, g[3] = E * s - B * i - C * o - Q * a, g;
|
|
1322
1322
|
}
|
|
1323
|
-
function
|
|
1323
|
+
function jI(g, A, I, B) {
|
|
1324
1324
|
var C = A[0], Q = A[1], E = A[2], i = A[3], o = I[0], a = I[1], s = I[2], h = I[3], t, y, n, w, r;
|
|
1325
1325
|
return y = C * o + Q * a + E * s + i * h, y < 0 && (y = -y, o = -o, a = -a, s = -s, h = -h), 1 - y > p ? (t = Math.acos(y), n = Math.sin(t), w = Math.sin((1 - B) * t) / n, r = Math.sin(B * t) / n) : (w = 1 - B, r = B), g[0] = w * C + r * o, g[1] = w * Q + r * a, g[2] = w * E + r * s, g[3] = w * i + r * h, g;
|
|
1326
1326
|
}
|
|
1327
|
-
function
|
|
1327
|
+
function MB(g, A) {
|
|
1328
1328
|
var I = A[0] + A[4] + A[8], B;
|
|
1329
1329
|
if (I > 0)
|
|
1330
1330
|
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;
|
|
@@ -1336,27 +1336,27 @@ function HB(g, A) {
|
|
|
1336
1336
|
}
|
|
1337
1337
|
return g;
|
|
1338
1338
|
}
|
|
1339
|
-
var
|
|
1339
|
+
var OC = TC, VC = xC, Gg = bC;
|
|
1340
1340
|
(function() {
|
|
1341
1341
|
var g = f(), A = q(1, 0, 0), I = q(0, 1, 0);
|
|
1342
1342
|
return function(B, C, Q) {
|
|
1343
|
-
var E =
|
|
1344
|
-
return E < -0.999999 ? (
|
|
1343
|
+
var E = YB(C, Q);
|
|
1344
|
+
return E < -0.999999 ? (XI(g, A, C), uC(g) < 1e-6 && XI(g, I, C), fC(g, g), ZC(B, g, Math.PI), B) : E > 0.999999 ? (B[0] = 0, B[1] = 0, B[2] = 0, B[3] = 1, B) : (XI(g, C, Q), B[0] = g[0], B[1] = g[1], B[2] = g[2], B[3] = 1 + E, Gg(B, B));
|
|
1345
1345
|
};
|
|
1346
1346
|
})();
|
|
1347
1347
|
(function() {
|
|
1348
|
-
var g =
|
|
1348
|
+
var g = Cg(), A = Cg();
|
|
1349
1349
|
return function(I, B, C, Q, E, i) {
|
|
1350
|
-
return
|
|
1350
|
+
return jI(g, B, E, i), jI(A, C, Q, i), jI(I, g, A, 2 * i * (1 - i)), I;
|
|
1351
1351
|
};
|
|
1352
1352
|
})();
|
|
1353
1353
|
(function() {
|
|
1354
|
-
var g =
|
|
1354
|
+
var g = JB();
|
|
1355
1355
|
return function(A, I, B, C) {
|
|
1356
|
-
return g[0] = B[0], g[3] = B[1], g[6] = B[2], g[1] = C[0], g[4] = C[1], g[7] = C[2], g[2] = -I[0], g[5] = -I[1], g[8] = -I[2], Gg(A,
|
|
1356
|
+
return g[0] = B[0], g[3] = B[1], g[6] = B[2], g[1] = C[0], g[4] = C[1], g[7] = C[2], g[2] = -I[0], g[5] = -I[1], g[8] = -I[2], Gg(A, MB(A, g));
|
|
1357
1357
|
};
|
|
1358
1358
|
})();
|
|
1359
|
-
function
|
|
1359
|
+
function KB() {
|
|
1360
1360
|
var g = new b(2);
|
|
1361
1361
|
return b != Float32Array && (g[0] = 0, g[1] = 0), g;
|
|
1362
1362
|
}
|
|
@@ -1368,27 +1368,27 @@ function W(g, A) {
|
|
|
1368
1368
|
var I = new b(2);
|
|
1369
1369
|
return I[0] = g, I[1] = A, I;
|
|
1370
1370
|
}
|
|
1371
|
-
function
|
|
1371
|
+
function vC(g, A) {
|
|
1372
1372
|
var I = A[0] - g[0], B = A[1] - g[1];
|
|
1373
1373
|
return Math.hypot(I, B);
|
|
1374
1374
|
}
|
|
1375
|
-
function
|
|
1375
|
+
function XC(g) {
|
|
1376
1376
|
var A = g[0], I = g[1];
|
|
1377
1377
|
return A * A + I * I;
|
|
1378
1378
|
}
|
|
1379
|
-
function
|
|
1379
|
+
function jC(g, A, I, B) {
|
|
1380
1380
|
var C = A[0], Q = A[1];
|
|
1381
1381
|
return g[0] = C + B * (I[0] - C), g[1] = Q + B * (I[1] - Q), g;
|
|
1382
1382
|
}
|
|
1383
1383
|
function Xg(g, A) {
|
|
1384
1384
|
return g[0] === A[0] && g[1] === A[1];
|
|
1385
1385
|
}
|
|
1386
|
-
function
|
|
1386
|
+
function zI(g, A) {
|
|
1387
1387
|
var I = g[0], B = g[1], C = A[0], Q = A[1];
|
|
1388
1388
|
return Math.abs(I - C) <= p * Math.max(1, Math.abs(I), Math.abs(C)) && Math.abs(B - Q) <= p * Math.max(1, Math.abs(B), Math.abs(Q));
|
|
1389
1389
|
}
|
|
1390
1390
|
(function() {
|
|
1391
|
-
var g =
|
|
1391
|
+
var g = KB();
|
|
1392
1392
|
return function(A, I, B, C, Q, E) {
|
|
1393
1393
|
var i, o;
|
|
1394
1394
|
for (I || (I = 2), B || (B = 0), C ? o = Math.min(C * I + B, A.length) : o = A.length, i = B; i < o; i += I)
|
|
@@ -1435,10 +1435,10 @@ class RA {
|
|
|
1435
1435
|
this.min = q(1 / 0, 1 / 0, 1 / 0), this.max = q(-1 / 0, -1 / 0, -1 / 0);
|
|
1436
1436
|
const Q = f();
|
|
1437
1437
|
for (const E of C)
|
|
1438
|
-
|
|
1438
|
+
uI(Q, E, A), this.expandWithPoint(Q);
|
|
1439
1439
|
}
|
|
1440
1440
|
}
|
|
1441
|
-
const
|
|
1441
|
+
const zC = {
|
|
1442
1442
|
position: 0,
|
|
1443
1443
|
normal: 1,
|
|
1444
1444
|
uv: 2,
|
|
@@ -1502,7 +1502,7 @@ class bA extends yg {
|
|
|
1502
1502
|
return this.attributes_.find((I) => I.type === A);
|
|
1503
1503
|
}
|
|
1504
1504
|
}
|
|
1505
|
-
class
|
|
1505
|
+
class _C {
|
|
1506
1506
|
gl_;
|
|
1507
1507
|
buffers_ = /* @__PURE__ */ new Map();
|
|
1508
1508
|
currentGeometry_ = null;
|
|
@@ -1538,7 +1538,7 @@ class AQ {
|
|
|
1538
1538
|
this.gl_.bindBuffer(C, Q), this.gl_.bufferData(C, B, this.gl_.STATIC_DRAW);
|
|
1539
1539
|
const { attributes: E, strideBytes: i } = A;
|
|
1540
1540
|
E.forEach((s) => {
|
|
1541
|
-
const h =
|
|
1541
|
+
const h = zC[s.type];
|
|
1542
1542
|
this.gl_.vertexAttribPointer(
|
|
1543
1543
|
h,
|
|
1544
1544
|
s.itemSize,
|
|
@@ -1557,7 +1557,7 @@ class AQ {
|
|
|
1557
1557
|
this.buffers_.set(A, o), this.gl_.bindVertexArray(null);
|
|
1558
1558
|
}
|
|
1559
1559
|
}
|
|
1560
|
-
class
|
|
1560
|
+
class $C {
|
|
1561
1561
|
gl_;
|
|
1562
1562
|
textures_ = /* @__PURE__ */ new Map();
|
|
1563
1563
|
currentTexture_ = null;
|
|
@@ -1837,7 +1837,7 @@ class AA {
|
|
|
1837
1837
|
return { x: A, y: I, width: B, height: C };
|
|
1838
1838
|
}
|
|
1839
1839
|
}
|
|
1840
|
-
class
|
|
1840
|
+
class AQ {
|
|
1841
1841
|
gl_;
|
|
1842
1842
|
enabledCapabilities_ = /* @__PURE__ */ new Map();
|
|
1843
1843
|
depthMaskEnabled_ = null;
|
|
@@ -1937,8 +1937,8 @@ class gQ {
|
|
|
1937
1937
|
A ? this.enable(this.gl_.STENCIL_TEST) : this.disable(this.gl_.STENCIL_TEST);
|
|
1938
1938
|
}
|
|
1939
1939
|
}
|
|
1940
|
-
const
|
|
1941
|
-
class
|
|
1940
|
+
const IQ = kC(_(), [1, -1, 1]);
|
|
1941
|
+
class gQ extends oC {
|
|
1942
1942
|
gl_;
|
|
1943
1943
|
programs_;
|
|
1944
1944
|
bindings_;
|
|
@@ -1957,7 +1957,7 @@ class CQ extends sC {
|
|
|
1957
1957
|
this.gl_ = I, U.info(
|
|
1958
1958
|
"WebGLRenderer",
|
|
1959
1959
|
`WebGL version ${I.getParameter(I.VERSION)}`
|
|
1960
|
-
), this.programs_ = new
|
|
1960
|
+
), this.programs_ = new RC(I), this.bindings_ = new _C(I), this.textures_ = new $C(I), this.state_ = new AQ(I), this.initStencil(), this.resize(this.canvas.width, this.canvas.height);
|
|
1961
1961
|
}
|
|
1962
1962
|
render(A) {
|
|
1963
1963
|
const I = A.getBoxRelativeTo(this.canvas), B = new AA(
|
|
@@ -2002,9 +2002,10 @@ class CQ extends sC {
|
|
|
2002
2002
|
}
|
|
2003
2003
|
renderObject(A, I, B) {
|
|
2004
2004
|
const C = A.objects[I];
|
|
2005
|
-
|
|
2005
|
+
if (C.popStaleTextures().forEach((E) => {
|
|
2006
2006
|
this.textures_.disposeTexture(E);
|
|
2007
|
-
}), C.
|
|
2007
|
+
}), !C.programName) return;
|
|
2008
|
+
this.state_.setCullFaceMode(C.cullFaceMode), this.state_.setDepthTesting(C.depthTest), this.state_.setDepthMask(C.depthTest), this.bindings_.bindGeometry(C.geometry), C.textures.forEach((E, i) => {
|
|
2008
2009
|
this.textures_.bindTexture(E, i);
|
|
2009
2010
|
});
|
|
2010
2011
|
const Q = this.programs_.use(C.programName);
|
|
@@ -2027,7 +2028,7 @@ class CQ extends sC {
|
|
|
2027
2028
|
I.transform.matrix
|
|
2028
2029
|
), i = zA(
|
|
2029
2030
|
_(),
|
|
2030
|
-
|
|
2031
|
+
IQ,
|
|
2031
2032
|
Q.projectionMatrix
|
|
2032
2033
|
), o = [this.canvas.width, this.canvas.height], a = I.getUniforms(), h = {
|
|
2033
2034
|
...B.getUniforms(),
|
|
@@ -2048,7 +2049,7 @@ class CQ extends sC {
|
|
|
2048
2049
|
C.setUniform(n, B.opacity);
|
|
2049
2050
|
break;
|
|
2050
2051
|
case "CameraPositionModel": {
|
|
2051
|
-
const w =
|
|
2052
|
+
const w = mI(_(), E), r = kI(0, 0, 0, 1), G = _A(
|
|
2052
2053
|
pA(),
|
|
2053
2054
|
r,
|
|
2054
2055
|
w
|
|
@@ -2094,12 +2095,12 @@ class CQ extends sC {
|
|
|
2094
2095
|
this.gl_.clearColor(...this.backgroundColor.rgba), this.gl_.clear(this.gl_.COLOR_BUFFER_BIT | this.gl_.DEPTH_BUFFER_BIT), this.state_.setDepthTesting(!0), this.gl_.depthFunc(this.gl_.LEQUAL);
|
|
2095
2096
|
}
|
|
2096
2097
|
}
|
|
2097
|
-
const
|
|
2098
|
-
class
|
|
2098
|
+
const BQ = 8;
|
|
2099
|
+
class CQ {
|
|
2099
2100
|
maxConcurrent_;
|
|
2100
2101
|
pending_ = [];
|
|
2101
2102
|
running_ = /* @__PURE__ */ new Map();
|
|
2102
|
-
constructor(A =
|
|
2103
|
+
constructor(A = BQ) {
|
|
2103
2104
|
this.maxConcurrent_ = Math.max(1, A);
|
|
2104
2105
|
}
|
|
2105
2106
|
enqueue(A, I) {
|
|
@@ -2165,17 +2166,17 @@ function zg(g) {
|
|
|
2165
2166
|
`Unsupported chunk data type: ${g}. Supported data types: ${A}`
|
|
2166
2167
|
), !1;
|
|
2167
2168
|
}
|
|
2168
|
-
function
|
|
2169
|
+
function QQ(g, A) {
|
|
2169
2170
|
return Math.round((A - g.translation) / g.scale);
|
|
2170
2171
|
}
|
|
2171
|
-
function
|
|
2172
|
+
function Qg(g, A, I = 1e-6) {
|
|
2172
2173
|
return Math.abs(g - A) <= I;
|
|
2173
2174
|
}
|
|
2174
2175
|
function cA(g, A, I) {
|
|
2175
2176
|
return Math.max(A, Math.min(I, g));
|
|
2176
2177
|
}
|
|
2177
2178
|
const ng = Symbol("INTERNAL_POLICY_KEY");
|
|
2178
|
-
class
|
|
2179
|
+
class EQ {
|
|
2179
2180
|
store_;
|
|
2180
2181
|
policy_;
|
|
2181
2182
|
policyChanged_ = !1;
|
|
@@ -2194,7 +2195,7 @@ class oQ {
|
|
|
2194
2195
|
this.policy_.profile
|
|
2195
2196
|
);
|
|
2196
2197
|
const B = this.store_.dimensions, C = B.x.lods[0], Q = B.y.lods[0];
|
|
2197
|
-
this.sourceMaxSquareDistance2D_ =
|
|
2198
|
+
this.sourceMaxSquareDistance2D_ = XC(
|
|
2198
2199
|
W(C.size * C.scale, Q.size * Q.scale)
|
|
2199
2200
|
);
|
|
2200
2201
|
}
|
|
@@ -2243,13 +2244,13 @@ class oQ {
|
|
|
2243
2244
|
), this.chunkViewStates_.clear();
|
|
2244
2245
|
return;
|
|
2245
2246
|
}
|
|
2246
|
-
const w =
|
|
2247
|
-
|
|
2247
|
+
const w = KB();
|
|
2248
|
+
jC(w, Q.min, Q.max, 0.5);
|
|
2248
2249
|
const [r, G] = this.getZBounds(A), c = new RA(
|
|
2249
2250
|
q(Q.min[0], Q.min[1], r),
|
|
2250
2251
|
q(Q.max[0], Q.max[1], G)
|
|
2251
2252
|
);
|
|
2252
|
-
this.chunkViewStates_.forEach(
|
|
2253
|
+
this.chunkViewStates_.forEach(_I), this.updateChunksAtTimeIndex(
|
|
2253
2254
|
y,
|
|
2254
2255
|
A,
|
|
2255
2256
|
c,
|
|
@@ -2276,7 +2277,7 @@ class oQ {
|
|
|
2276
2277
|
), this.chunkViewStates_.clear();
|
|
2277
2278
|
return;
|
|
2278
2279
|
}
|
|
2279
|
-
this.currentLOD_ = this.policy_.lod.min, this.chunkViewStates_.forEach(
|
|
2280
|
+
this.currentLOD_ = this.policy_.lod.min, this.chunkViewStates_.forEach(_I);
|
|
2280
2281
|
const i = this.fallbackLOD();
|
|
2281
2282
|
for (const o of E) {
|
|
2282
2283
|
const a = o.lod === this.currentLOD_, s = o.lod === i;
|
|
@@ -2313,7 +2314,7 @@ class oQ {
|
|
|
2313
2314
|
I && (I.visible || I.prefetch || I.priority !== null) || this.chunkViewStates_.delete(A);
|
|
2314
2315
|
}
|
|
2315
2316
|
dispose() {
|
|
2316
|
-
this.isDisposed_ = !0, this.chunkViewStates_.forEach(
|
|
2317
|
+
this.isDisposed_ = !0, this.chunkViewStates_.forEach(_I);
|
|
2317
2318
|
}
|
|
2318
2319
|
setImageSourcePolicy(A, I) {
|
|
2319
2320
|
if (I !== ng)
|
|
@@ -2439,13 +2440,13 @@ class oQ {
|
|
|
2439
2440
|
];
|
|
2440
2441
|
}
|
|
2441
2442
|
viewBounds2DChanged(A) {
|
|
2442
|
-
return this.lastViewBounds2D_ === null || !
|
|
2443
|
+
return this.lastViewBounds2D_ === null || !zI(this.lastViewBounds2D_.min, A.min) || !zI(this.lastViewBounds2D_.max, A.max);
|
|
2443
2444
|
}
|
|
2444
2445
|
hasViewProjectionChanged(A) {
|
|
2445
|
-
return this.lastViewProjection_ === null || !
|
|
2446
|
+
return this.lastViewProjection_ === null || !HC(this.lastViewProjection_, A);
|
|
2446
2447
|
}
|
|
2447
2448
|
zBoundsChanged(A) {
|
|
2448
|
-
return !this.lastZBounds_ || !
|
|
2449
|
+
return !this.lastZBounds_ || !zI(this.lastZBounds_, A);
|
|
2449
2450
|
}
|
|
2450
2451
|
getPaddedBounds(A) {
|
|
2451
2452
|
const I = this.store_.dimensions, B = I.x.lods[this.currentLOD_], C = I.y.lods[this.currentLOD_], Q = I.z?.lods[this.currentLOD_], E = B.chunkSize * B.scale * this.policy_.prefetch.x, i = C.chunkSize * C.scale * this.policy_.prefetch.y;
|
|
@@ -2471,10 +2472,10 @@ class oQ {
|
|
|
2471
2472
|
return C * C + Q * Q;
|
|
2472
2473
|
}
|
|
2473
2474
|
}
|
|
2474
|
-
function
|
|
2475
|
+
function _I(g) {
|
|
2475
2476
|
g.visible = !1, g.prefetch = !1, g.priority = null, g.orderKey = null;
|
|
2476
2477
|
}
|
|
2477
|
-
class
|
|
2478
|
+
class iQ {
|
|
2478
2479
|
chunks_;
|
|
2479
2480
|
loader_;
|
|
2480
2481
|
lowestResLOD_;
|
|
@@ -2532,7 +2533,7 @@ class aQ {
|
|
|
2532
2533
|
return this.chunks_[A];
|
|
2533
2534
|
}
|
|
2534
2535
|
getTimeIndex(A) {
|
|
2535
|
-
return A.t === void 0 || this.dimensions_.t === void 0 ? 0 :
|
|
2536
|
+
return A.t === void 0 || this.dimensions_.t === void 0 ? 0 : QQ(this.dimensions_.t.lods[0], A.t);
|
|
2536
2537
|
}
|
|
2537
2538
|
get lodCount() {
|
|
2538
2539
|
return this.lowestResLOD_ + 1;
|
|
@@ -2547,7 +2548,7 @@ class aQ {
|
|
|
2547
2548
|
return this.loader_.loadChunkData(A, I);
|
|
2548
2549
|
}
|
|
2549
2550
|
createView(A) {
|
|
2550
|
-
const I = new
|
|
2551
|
+
const I = new EQ(this, A);
|
|
2551
2552
|
return this.views_.push(I), this.hasHadViews_ = !0, I;
|
|
2552
2553
|
}
|
|
2553
2554
|
get views() {
|
|
@@ -2598,7 +2599,7 @@ class aQ {
|
|
|
2598
2599
|
const A = this.dimensions_.x, I = this.dimensions_.y;
|
|
2599
2600
|
for (let B = 1; B < this.dimensions_.numLods; B++) {
|
|
2600
2601
|
const C = A.lods[B].scale / A.lods[B - 1].scale, Q = I.lods[B].scale / I.lods[B - 1].scale;
|
|
2601
|
-
if (!
|
|
2602
|
+
if (!Qg(C, 2, 0.02) || !Qg(Q, 2, 0.02))
|
|
2602
2603
|
throw new Error(
|
|
2603
2604
|
`Invalid downsampling factor between levels ${B - 1} → ${B}: expected (2× in X and Y), but got (${C.toFixed(2)}×, ${Q.toFixed(2)}×) from scale [${A.lods[B - 1].scale}, ${I.lods[B - 1].scale}] → [${A.lods[B].scale}, ${I.lods[B].scale}]`
|
|
2604
2605
|
);
|
|
@@ -2649,10 +2650,10 @@ class aQ {
|
|
|
2649
2650
|
};
|
|
2650
2651
|
}
|
|
2651
2652
|
}
|
|
2652
|
-
class
|
|
2653
|
+
class oQ {
|
|
2653
2654
|
stores_ = /* @__PURE__ */ new Map();
|
|
2654
2655
|
pendingStores_ = /* @__PURE__ */ new Map();
|
|
2655
|
-
queue_ = new
|
|
2656
|
+
queue_ = new CQ();
|
|
2656
2657
|
async addView(A, I) {
|
|
2657
2658
|
return (await this.getOrCreateStore(A)).createView(I);
|
|
2658
2659
|
}
|
|
@@ -2665,7 +2666,7 @@ class sQ {
|
|
|
2665
2666
|
return B;
|
|
2666
2667
|
const Q = (async () => {
|
|
2667
2668
|
const i = await A.open();
|
|
2668
|
-
return new
|
|
2669
|
+
return new iQ(i);
|
|
2669
2670
|
})();
|
|
2670
2671
|
this.pendingStores_.set(A, Q);
|
|
2671
2672
|
const E = await Q;
|
|
@@ -2737,14 +2738,14 @@ XA.Panel = function(g, A, I, B) {
|
|
|
2737
2738
|
}
|
|
2738
2739
|
};
|
|
2739
2740
|
};
|
|
2740
|
-
function
|
|
2741
|
+
function aQ({ scale: g } = { scale: 1.5 }) {
|
|
2741
2742
|
const A = new XA(g);
|
|
2742
2743
|
return A.showPanel(
|
|
2743
2744
|
0
|
|
2744
2745
|
/* 0 = fps, 1 = ms, 2 = mb */
|
|
2745
2746
|
), document.body.appendChild(A.dom), A;
|
|
2746
2747
|
}
|
|
2747
|
-
class
|
|
2748
|
+
class sQ {
|
|
2748
2749
|
layers_ = [];
|
|
2749
2750
|
callbacks_ = [];
|
|
2750
2751
|
context_;
|
|
@@ -2794,17 +2795,17 @@ class hQ {
|
|
|
2794
2795
|
this.callbacks_.splice(I, 1);
|
|
2795
2796
|
}
|
|
2796
2797
|
}
|
|
2797
|
-
const
|
|
2798
|
+
const Eg = [
|
|
2798
2799
|
"pointerdown",
|
|
2799
2800
|
"pointermove",
|
|
2800
2801
|
"pointerup",
|
|
2801
2802
|
"pointercancel",
|
|
2802
2803
|
"wheel"
|
|
2803
2804
|
];
|
|
2804
|
-
function
|
|
2805
|
-
return
|
|
2805
|
+
function DQ(g) {
|
|
2806
|
+
return Eg.includes(g);
|
|
2806
2807
|
}
|
|
2807
|
-
class
|
|
2808
|
+
class hQ {
|
|
2808
2809
|
propagationStopped_ = !1;
|
|
2809
2810
|
type;
|
|
2810
2811
|
event;
|
|
@@ -2820,7 +2821,7 @@ class yQ {
|
|
|
2820
2821
|
this.propagationStopped_ = !0;
|
|
2821
2822
|
}
|
|
2822
2823
|
}
|
|
2823
|
-
class
|
|
2824
|
+
class tQ {
|
|
2824
2825
|
listeners_ = [];
|
|
2825
2826
|
element_;
|
|
2826
2827
|
isConnected_ = !1;
|
|
@@ -2839,7 +2840,7 @@ class eQ {
|
|
|
2839
2840
|
);
|
|
2840
2841
|
return;
|
|
2841
2842
|
}
|
|
2842
|
-
this.isConnected_ = !0,
|
|
2843
|
+
this.isConnected_ = !0, Eg.forEach((A) => {
|
|
2843
2844
|
this.element_.addEventListener(A, this.handleEvent, {
|
|
2844
2845
|
passive: !1
|
|
2845
2846
|
});
|
|
@@ -2854,21 +2855,21 @@ class eQ {
|
|
|
2854
2855
|
);
|
|
2855
2856
|
return;
|
|
2856
2857
|
}
|
|
2857
|
-
this.isConnected_ = !1,
|
|
2858
|
+
this.isConnected_ = !1, Eg.forEach((A) => {
|
|
2858
2859
|
this.element_.removeEventListener(A, this.handleEvent);
|
|
2859
2860
|
});
|
|
2860
2861
|
}
|
|
2861
2862
|
handleEvent = (A) => {
|
|
2862
|
-
if (!
|
|
2863
|
+
if (!DQ(A.type)) {
|
|
2863
2864
|
U.error("EventDispatcher", `Unsupported event type ${A.type}`);
|
|
2864
2865
|
return;
|
|
2865
2866
|
}
|
|
2866
|
-
const I = new
|
|
2867
|
+
const I = new hQ(A.type, A);
|
|
2867
2868
|
for (const B of this.listeners_)
|
|
2868
2869
|
if (B(I), I.propagationStopped) break;
|
|
2869
2870
|
};
|
|
2870
2871
|
}
|
|
2871
|
-
class
|
|
2872
|
+
class yQ {
|
|
2872
2873
|
id;
|
|
2873
2874
|
element;
|
|
2874
2875
|
camera;
|
|
@@ -2876,7 +2877,7 @@ class GQ {
|
|
|
2876
2877
|
events;
|
|
2877
2878
|
cameraControls;
|
|
2878
2879
|
constructor(A) {
|
|
2879
|
-
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
|
|
2880
|
+
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 tQ(this.element), this.events.addEventListener((I) => {
|
|
2880
2881
|
if (I.event instanceof PointerEvent || I.event instanceof WheelEvent) {
|
|
2881
2882
|
const { clientX: B, clientY: C } = I.event, Q = W(B, C);
|
|
2882
2883
|
I.clipPos = this.clientToClip(Q, 0), I.worldPos = this.camera.clipToWorld(I.clipPos);
|
|
@@ -2930,7 +2931,7 @@ class GQ {
|
|
|
2930
2931
|
this.camera.setAspectRatio(B);
|
|
2931
2932
|
}
|
|
2932
2933
|
}
|
|
2933
|
-
function
|
|
2934
|
+
function eQ(g) {
|
|
2934
2935
|
const A = /* @__PURE__ */ new Map(), I = /* @__PURE__ */ new Set();
|
|
2935
2936
|
for (const B of g) {
|
|
2936
2937
|
if (I.has(B.id))
|
|
@@ -2946,19 +2947,19 @@ function nQ(g) {
|
|
|
2946
2947
|
A.set(B.element, B.id);
|
|
2947
2948
|
}
|
|
2948
2949
|
}
|
|
2949
|
-
function
|
|
2950
|
+
function GQ(g, A, I) {
|
|
2950
2951
|
const B = g.map((C) => {
|
|
2951
2952
|
const Q = C.element ?? A;
|
|
2952
2953
|
return {
|
|
2953
2954
|
...C,
|
|
2954
2955
|
element: Q,
|
|
2955
|
-
id: C.id ?? Q.id ??
|
|
2956
|
-
layerManager: new
|
|
2956
|
+
id: C.id ?? Q.id ?? LB(),
|
|
2957
|
+
layerManager: new sQ(I)
|
|
2957
2958
|
};
|
|
2958
2959
|
});
|
|
2959
|
-
return
|
|
2960
|
+
return eQ(B), B.map((C) => new yQ(C));
|
|
2960
2961
|
}
|
|
2961
|
-
class
|
|
2962
|
+
class nQ {
|
|
2962
2963
|
elements_;
|
|
2963
2964
|
resizeObserver_;
|
|
2964
2965
|
mediaQuery_;
|
|
@@ -3002,7 +3003,7 @@ class FQ {
|
|
|
3002
3003
|
this.resizeObserver_?.disconnect(), this.mediaQuery_ && this.onMediaQueryChange_ && this.mediaQuery_.removeEventListener("change", this.onMediaQueryChange_);
|
|
3003
3004
|
}
|
|
3004
3005
|
}
|
|
3005
|
-
class
|
|
3006
|
+
class Ko {
|
|
3006
3007
|
chunkManager_;
|
|
3007
3008
|
context_;
|
|
3008
3009
|
renderer_;
|
|
@@ -3065,17 +3066,17 @@ class Yo {
|
|
|
3065
3066
|
constructor(A) {
|
|
3066
3067
|
if (this.canvas = A.canvas, A.viewports.length === 0)
|
|
3067
3068
|
throw new Error("At least one viewport config must be specified.");
|
|
3068
|
-
this.renderer_ = new
|
|
3069
|
+
this.renderer_ = new gQ(this.canvas), this.chunkManager_ = new oQ(), this.context_ = {
|
|
3069
3070
|
chunkManager: this.chunkManager_
|
|
3070
|
-
}, this.viewports_ =
|
|
3071
|
+
}, this.viewports_ = GQ(
|
|
3071
3072
|
A.viewports,
|
|
3072
3073
|
this.canvas,
|
|
3073
3074
|
this.context_
|
|
3074
|
-
), this.overlays = A.overlays ?? [], A.showStats && (this.stats_ =
|
|
3075
|
+
), this.overlays = A.overlays ?? [], A.showStats && (this.stats_ = aQ());
|
|
3075
3076
|
const I = [this.canvas];
|
|
3076
3077
|
for (const B of this.viewports_)
|
|
3077
3078
|
B.element !== this.canvas && I.push(B.element);
|
|
3078
|
-
this.sizeObserver_ = new
|
|
3079
|
+
this.sizeObserver_ = new nQ(I, () => {
|
|
3079
3080
|
this.renderer_.updateSize();
|
|
3080
3081
|
for (const B of this.viewports_)
|
|
3081
3082
|
B.updateSize(), this.renderer_.render(B);
|
|
@@ -3134,7 +3135,7 @@ class Yo {
|
|
|
3134
3135
|
}
|
|
3135
3136
|
}
|
|
3136
3137
|
}
|
|
3137
|
-
class
|
|
3138
|
+
class wQ extends bA {
|
|
3138
3139
|
constructor(A) {
|
|
3139
3140
|
if (super(), A.primitive != "triangles") {
|
|
3140
3141
|
U.warn("WireframeGeometry", "Only indexed geometries are supported");
|
|
@@ -3159,21 +3160,21 @@ class rQ extends bA {
|
|
|
3159
3160
|
this.indexData_ = new Uint32Array(B);
|
|
3160
3161
|
}
|
|
3161
3162
|
}
|
|
3162
|
-
const
|
|
3163
|
-
class
|
|
3163
|
+
const FQ = q(0, 1, 0);
|
|
3164
|
+
class rQ {
|
|
3164
3165
|
dirty_ = !0;
|
|
3165
3166
|
matrix_ = _();
|
|
3166
|
-
rotation_ =
|
|
3167
|
+
rotation_ = Cg();
|
|
3167
3168
|
translation_ = f();
|
|
3168
3169
|
scale_ = q(1, 1, 1);
|
|
3169
3170
|
addRotation(A) {
|
|
3170
|
-
|
|
3171
|
+
PC(this.rotation_, this.rotation_, A), this.dirty_ = !0;
|
|
3171
3172
|
}
|
|
3172
3173
|
setRotation(A) {
|
|
3173
|
-
|
|
3174
|
+
VC(this.rotation_, A), this.dirty_ = !0;
|
|
3174
3175
|
}
|
|
3175
3176
|
get rotation() {
|
|
3176
|
-
return
|
|
3177
|
+
return OC(this.rotation_);
|
|
3177
3178
|
}
|
|
3178
3179
|
addTranslation(A) {
|
|
3179
3180
|
lA(this.translation_, this.translation_, A), this.dirty_ = !0;
|
|
@@ -3185,15 +3186,15 @@ class RQ {
|
|
|
3185
3186
|
return BA(this.translation_);
|
|
3186
3187
|
}
|
|
3187
3188
|
addScale(A) {
|
|
3188
|
-
|
|
3189
|
+
lC(this.scale_, this.scale_, A), this.dirty_ = !0;
|
|
3189
3190
|
}
|
|
3190
3191
|
setScale(A) {
|
|
3191
3192
|
HA(this.scale_, A), this.dirty_ = !0;
|
|
3192
3193
|
}
|
|
3193
3194
|
targetTo(A) {
|
|
3194
|
-
|
|
3195
|
-
const I =
|
|
3196
|
-
|
|
3195
|
+
dB(this.translation_, A) && (A = BA(A), A[2] += p);
|
|
3196
|
+
const I = KC(_(), this.translation_, A, FQ), B = UC(JB(), I);
|
|
3197
|
+
MB(this.rotation_, B), Gg(this.rotation_, this.rotation_), this.dirty_ = !0;
|
|
3197
3198
|
}
|
|
3198
3199
|
get scale() {
|
|
3199
3200
|
return BA(this.scale_);
|
|
@@ -3202,10 +3203,10 @@ class RQ {
|
|
|
3202
3203
|
return this.dirty_ && (this.computeMatrix(), this.dirty_ = !1), this.matrix_;
|
|
3203
3204
|
}
|
|
3204
3205
|
get inverse() {
|
|
3205
|
-
return
|
|
3206
|
+
return mI(_(), this.matrix);
|
|
3206
3207
|
}
|
|
3207
3208
|
computeMatrix() {
|
|
3208
|
-
|
|
3209
|
+
LC(
|
|
3209
3210
|
this.matrix_,
|
|
3210
3211
|
this.rotation_,
|
|
3211
3212
|
this.translation_,
|
|
@@ -3219,7 +3220,7 @@ class ZA extends yg {
|
|
|
3219
3220
|
depthTest = !0;
|
|
3220
3221
|
textures_ = [];
|
|
3221
3222
|
staleTextures_ = [];
|
|
3222
|
-
transform_ = new
|
|
3223
|
+
transform_ = new rQ();
|
|
3223
3224
|
geometry_ = new bA();
|
|
3224
3225
|
wireframeGeometry_ = null;
|
|
3225
3226
|
programName_ = null;
|
|
@@ -3236,7 +3237,7 @@ class ZA extends yg {
|
|
|
3236
3237
|
return this.geometry_;
|
|
3237
3238
|
}
|
|
3238
3239
|
get wireframeGeometry() {
|
|
3239
|
-
return this.wireframeGeometry_ ??= new
|
|
3240
|
+
return this.wireframeGeometry_ ??= new wQ(this.geometry), this.wireframeGeometry_;
|
|
3240
3241
|
}
|
|
3241
3242
|
get textures() {
|
|
3242
3243
|
return this.textures_;
|
|
@@ -3248,8 +3249,6 @@ class ZA extends yg {
|
|
|
3248
3249
|
this.geometry_ = A, this.wireframeGeometry_ = null;
|
|
3249
3250
|
}
|
|
3250
3251
|
get programName() {
|
|
3251
|
-
if (this.programName_ === null)
|
|
3252
|
-
throw new Error("Program name not set");
|
|
3253
3252
|
return this.programName_;
|
|
3254
3253
|
}
|
|
3255
3254
|
get boundingBox() {
|
|
@@ -3283,7 +3282,7 @@ class dA {
|
|
|
3283
3282
|
this.normal = BA(A), this.signedDistance = I;
|
|
3284
3283
|
}
|
|
3285
3284
|
signedDistanceToPoint(A) {
|
|
3286
|
-
return
|
|
3285
|
+
return YB(this.normal, A) + this.signedDistance;
|
|
3287
3286
|
}
|
|
3288
3287
|
normalize() {
|
|
3289
3288
|
const A = eg(this.normal);
|
|
@@ -3293,7 +3292,7 @@ class dA {
|
|
|
3293
3292
|
}
|
|
3294
3293
|
}
|
|
3295
3294
|
}
|
|
3296
|
-
class
|
|
3295
|
+
class SQ {
|
|
3297
3296
|
planes_;
|
|
3298
3297
|
constructor(A) {
|
|
3299
3298
|
this.planes_ = [
|
|
@@ -3339,7 +3338,7 @@ class NQ {
|
|
|
3339
3338
|
return !0;
|
|
3340
3339
|
}
|
|
3341
3340
|
}
|
|
3342
|
-
class
|
|
3341
|
+
class HB extends ZA {
|
|
3343
3342
|
projectionMatrix_ = _();
|
|
3344
3343
|
near_ = 0;
|
|
3345
3344
|
far_ = 0;
|
|
@@ -3361,7 +3360,7 @@ class lB extends ZA {
|
|
|
3361
3360
|
return q(A[4], A[5], A[6]);
|
|
3362
3361
|
}
|
|
3363
3362
|
get frustum() {
|
|
3364
|
-
return new
|
|
3363
|
+
return new SQ(
|
|
3365
3364
|
zA(_(), this.projectionMatrix, this.viewMatrix)
|
|
3366
3365
|
);
|
|
3367
3366
|
}
|
|
@@ -3372,7 +3371,7 @@ class lB extends ZA {
|
|
|
3372
3371
|
return this.transform.translation;
|
|
3373
3372
|
}
|
|
3374
3373
|
clipToWorld(A) {
|
|
3375
|
-
const I = kI(A[0], A[1], A[2], 1), B =
|
|
3374
|
+
const I = kI(A[0], A[1], A[2], 1), B = mI(
|
|
3376
3375
|
_(),
|
|
3377
3376
|
this.projectionMatrix_
|
|
3378
3377
|
), C = _A(
|
|
@@ -3380,7 +3379,7 @@ class lB extends ZA {
|
|
|
3380
3379
|
I,
|
|
3381
3380
|
B
|
|
3382
3381
|
);
|
|
3383
|
-
|
|
3382
|
+
WC(C, C, 1 / C[3]);
|
|
3384
3383
|
const Q = _A(
|
|
3385
3384
|
pA(),
|
|
3386
3385
|
C,
|
|
@@ -3389,12 +3388,12 @@ class lB extends ZA {
|
|
|
3389
3388
|
return q(Q[0], Q[1], Q[2]);
|
|
3390
3389
|
}
|
|
3391
3390
|
}
|
|
3392
|
-
const
|
|
3393
|
-
class
|
|
3391
|
+
const qB = 1.77, _g = 128, $g = 128 / qB;
|
|
3392
|
+
class Ho extends HB {
|
|
3394
3393
|
// width_ and height_ should always be defined by constructor (see setFrame)
|
|
3395
3394
|
width_ = _g;
|
|
3396
3395
|
height_ = $g;
|
|
3397
|
-
viewportAspectRatio_ =
|
|
3396
|
+
viewportAspectRatio_ = qB;
|
|
3398
3397
|
viewportSize_ = [_g, $g];
|
|
3399
3398
|
constructor(A, I, B, C, Q = 0, E = 100) {
|
|
3400
3399
|
super(), this.near_ = Q, this.far_ = E, this.setFrame(A, I, C, B), this.updateProjectionMatrix();
|
|
@@ -3425,7 +3424,7 @@ class Mo extends lB {
|
|
|
3425
3424
|
_(),
|
|
3426
3425
|
this.projectionMatrix,
|
|
3427
3426
|
this.viewMatrix
|
|
3428
|
-
), C =
|
|
3427
|
+
), C = mI(_(), B);
|
|
3429
3428
|
return A = _A(pA(), A, C), I = _A(pA(), I, C), new AA(
|
|
3430
3429
|
W(A[0], A[1]),
|
|
3431
3430
|
W(I[0], I[1])
|
|
@@ -3434,7 +3433,7 @@ class Mo extends lB {
|
|
|
3434
3433
|
updateProjectionMatrix() {
|
|
3435
3434
|
const A = this.width_, I = this.height_, B = A / I;
|
|
3436
3435
|
let C = 0.5 * A, Q = 0.5 * I;
|
|
3437
|
-
this.viewportAspectRatio_ > B ? C *= this.viewportAspectRatio_ / B : Q *= B / this.viewportAspectRatio_, this.viewportSize_ = [2 * C, 2 * Q],
|
|
3436
|
+
this.viewportAspectRatio_ > B ? C *= this.viewportAspectRatio_ / B : Q *= B / this.viewportAspectRatio_, this.viewportSize_ = [2 * C, 2 * Q], MC(
|
|
3438
3437
|
this.projectionMatrix_,
|
|
3439
3438
|
-C,
|
|
3440
3439
|
C,
|
|
@@ -3445,21 +3444,21 @@ class Mo extends lB {
|
|
|
3445
3444
|
);
|
|
3446
3445
|
}
|
|
3447
3446
|
}
|
|
3448
|
-
const
|
|
3449
|
-
class
|
|
3447
|
+
const RQ = 60, NQ = 1.77, rI = 0.1, $I = 180 - rI;
|
|
3448
|
+
class qo extends HB {
|
|
3450
3449
|
fov_;
|
|
3451
3450
|
aspectRatio_;
|
|
3452
3451
|
constructor(A = {}) {
|
|
3453
3452
|
const {
|
|
3454
|
-
fov: I =
|
|
3455
|
-
aspectRatio: B =
|
|
3453
|
+
fov: I = RQ,
|
|
3454
|
+
aspectRatio: B = NQ,
|
|
3456
3455
|
near: C = 0.1,
|
|
3457
3456
|
far: Q = 1e4,
|
|
3458
3457
|
position: E = q(0, 0, 0)
|
|
3459
3458
|
} = A;
|
|
3460
|
-
if (I < rI || I >
|
|
3459
|
+
if (I < rI || I > $I)
|
|
3461
3460
|
throw new Error(
|
|
3462
|
-
`Invalid field of view: ${I}, must be in [${rI}, ${
|
|
3461
|
+
`Invalid field of view: ${I}, must be in [${rI}, ${$I}] degrees`
|
|
3463
3462
|
);
|
|
3464
3463
|
super(), this.fov_ = I, this.aspectRatio_ = B, this.near_ = C, this.far_ = Q, this.transform.setTranslation(E), this.updateProjectionMatrix();
|
|
3465
3464
|
}
|
|
@@ -3475,12 +3474,12 @@ class Ko extends lB {
|
|
|
3475
3474
|
zoom(A) {
|
|
3476
3475
|
if (A <= 0)
|
|
3477
3476
|
throw new Error(`Invalid zoom factor: ${A}`);
|
|
3478
|
-
this.fov_ = Math.max(rI, Math.min(
|
|
3477
|
+
this.fov_ = Math.max(rI, Math.min($I, this.fov_ / A)), this.updateProjectionMatrix();
|
|
3479
3478
|
}
|
|
3480
3479
|
updateProjectionMatrix() {
|
|
3481
|
-
|
|
3480
|
+
YC(
|
|
3482
3481
|
this.projectionMatrix_,
|
|
3483
|
-
|
|
3482
|
+
cC(this.fov),
|
|
3484
3483
|
this.aspectRatio_,
|
|
3485
3484
|
this.near_,
|
|
3486
3485
|
this.far_
|
|
@@ -3488,7 +3487,7 @@ class Ko extends lB {
|
|
|
3488
3487
|
}
|
|
3489
3488
|
}
|
|
3490
3489
|
const AB = 0;
|
|
3491
|
-
class
|
|
3490
|
+
class lo {
|
|
3492
3491
|
camera_;
|
|
3493
3492
|
dragActive_ = !1;
|
|
3494
3493
|
dragStart_ = f();
|
|
@@ -3556,22 +3555,22 @@ class IB {
|
|
|
3556
3555
|
);
|
|
3557
3556
|
}
|
|
3558
3557
|
}
|
|
3559
|
-
const
|
|
3560
|
-
class
|
|
3558
|
+
const Ag = -1, gB = 0, cQ = 1, BB = 9e-3, UQ = 1e-3, kQ = 9e-4, LQ = 0.5, JQ = 60;
|
|
3559
|
+
class fo {
|
|
3561
3560
|
camera_;
|
|
3562
3561
|
orbitVelocity_ = new IB(0, 0, 0);
|
|
3563
3562
|
panVelocity_ = f();
|
|
3564
3563
|
currPos_;
|
|
3565
3564
|
currCenter_ = f();
|
|
3566
3565
|
dampingFactor_;
|
|
3567
|
-
currMouseButton_ =
|
|
3566
|
+
currMouseButton_ = Ag;
|
|
3568
3567
|
constructor(A, I) {
|
|
3569
3568
|
this.camera_ = A, this.currPos_ = new IB(
|
|
3570
3569
|
I?.radius ?? 1,
|
|
3571
3570
|
I?.yaw ?? 0,
|
|
3572
3571
|
I?.pitch ?? 0
|
|
3573
3572
|
), I?.target && HA(this.currCenter_, I.target), this.dampingFactor_ = cA(
|
|
3574
|
-
I?.dampingFactor ??
|
|
3573
|
+
I?.dampingFactor ?? LQ,
|
|
3575
3574
|
0,
|
|
3576
3575
|
1
|
|
3577
3576
|
), this.updateCamera();
|
|
@@ -3597,12 +3596,12 @@ class qo {
|
|
|
3597
3596
|
}
|
|
3598
3597
|
}
|
|
3599
3598
|
onUpdate(A) {
|
|
3600
|
-
if (this.orbitVelocity_.phi === 0 && this.orbitVelocity_.theta === 0 && this.orbitVelocity_.radius === 0 &&
|
|
3599
|
+
if (this.orbitVelocity_.phi === 0 && this.orbitVelocity_.theta === 0 && this.orbitVelocity_.radius === 0 && dB(this.panVelocity_, q(0, 0, 0)))
|
|
3601
3600
|
return;
|
|
3602
3601
|
this.currPos_.phi += this.orbitVelocity_.phi, this.currPos_.theta += this.orbitVelocity_.theta, this.currPos_.radius += this.orbitVelocity_.radius * this.currPos_.radius, lA(this.currCenter_, this.currCenter_, this.panVelocity_);
|
|
3603
3602
|
const I = Math.PI / 2 - p;
|
|
3604
3603
|
this.currPos_.theta = cA(this.currPos_.theta, -I, I), this.currPos_.radius = Math.max(0.01, this.currPos_.radius), this.updateCamera();
|
|
3605
|
-
const B = Math.pow(1 - this.dampingFactor_, A *
|
|
3604
|
+
const B = Math.pow(1 - this.dampingFactor_, A * JQ);
|
|
3606
3605
|
this.orbitVelocity_.phi *= B, this.orbitVelocity_.theta *= B, this.orbitVelocity_.radius *= B, fA(this.panVelocity_, this.panVelocity_, B), this.cutoffLowVelocity();
|
|
3607
3606
|
}
|
|
3608
3607
|
onPointerDown(A) {
|
|
@@ -3610,8 +3609,8 @@ class qo {
|
|
|
3610
3609
|
this.currMouseButton_ = I.button, I.target?.setPointerCapture?.(I.pointerId);
|
|
3611
3610
|
}
|
|
3612
3611
|
onPointerMove(A) {
|
|
3613
|
-
if (this.currMouseButton_ ==
|
|
3614
|
-
const I = A.event, B = I.movementX ?? 0, C = I.movementY ?? 0, Q = this.currMouseButton_ === gB && !I.shiftKey, E = this.currMouseButton_ === gB && I.shiftKey || this.currMouseButton_ ===
|
|
3612
|
+
if (this.currMouseButton_ == Ag) return;
|
|
3613
|
+
const I = A.event, B = I.movementX ?? 0, C = I.movementY ?? 0, Q = this.currMouseButton_ === gB && !I.shiftKey, E = this.currMouseButton_ === gB && I.shiftKey || this.currMouseButton_ === cQ;
|
|
3615
3614
|
Q && this.orbit(B, C), E && this.pan(B, C);
|
|
3616
3615
|
}
|
|
3617
3616
|
onWheel(A) {
|
|
@@ -3621,7 +3620,7 @@ class qo {
|
|
|
3621
3620
|
this.zoom(B);
|
|
3622
3621
|
}
|
|
3623
3622
|
onPointerEnd(A) {
|
|
3624
|
-
this.currMouseButton_ =
|
|
3623
|
+
this.currMouseButton_ = Ag;
|
|
3625
3624
|
const I = A.event;
|
|
3626
3625
|
I.target?.releasePointerCapture?.(I.pointerId);
|
|
3627
3626
|
}
|
|
@@ -3629,18 +3628,18 @@ class qo {
|
|
|
3629
3628
|
this.orbitVelocity_.phi -= A * BB, this.orbitVelocity_.theta += I * BB;
|
|
3630
3629
|
}
|
|
3631
3630
|
pan(A, I) {
|
|
3632
|
-
const B = this.currPos_.radius *
|
|
3631
|
+
const B = this.currPos_.radius * UQ, C = f();
|
|
3633
3632
|
cI(C, C, this.camera_.right, A), cI(C, C, this.camera_.up, I), fA(C, C, B), UI(this.panVelocity_, this.panVelocity_, C);
|
|
3634
3633
|
}
|
|
3635
3634
|
zoom(A) {
|
|
3636
|
-
this.orbitVelocity_.radius += A *
|
|
3635
|
+
this.orbitVelocity_.radius += A * kQ;
|
|
3637
3636
|
}
|
|
3638
3637
|
updateCamera() {
|
|
3639
3638
|
const A = lA(f(), this.currCenter_, this.currPos_.toVec3());
|
|
3640
3639
|
this.camera_.transform.setTranslation(A), this.camera_.transform.targetTo(this.currCenter_);
|
|
3641
3640
|
}
|
|
3642
3641
|
cutoffLowVelocity() {
|
|
3643
|
-
Math.abs(this.orbitVelocity_.phi) < p && (this.orbitVelocity_.phi = 0), Math.abs(this.orbitVelocity_.theta) < p && (this.orbitVelocity_.theta = 0), Math.abs(this.orbitVelocity_.radius) < p && (this.orbitVelocity_.radius = 0), eg(this.panVelocity_) < p &&
|
|
3642
|
+
Math.abs(this.orbitVelocity_.phi) < p && (this.orbitVelocity_.phi = 0), Math.abs(this.orbitVelocity_.theta) < p && (this.orbitVelocity_.theta = 0), Math.abs(this.orbitVelocity_.radius) < p && (this.orbitVelocity_.radius = 0), eg(this.panVelocity_) < p && mC(this.panVelocity_);
|
|
3644
3643
|
}
|
|
3645
3644
|
}
|
|
3646
3645
|
class FA {
|
|
@@ -3825,25 +3824,25 @@ class wg extends ZA {
|
|
|
3825
3824
|
};
|
|
3826
3825
|
}
|
|
3827
3826
|
}
|
|
3828
|
-
class
|
|
3827
|
+
class po extends FA {
|
|
3829
3828
|
type = "AxesLayer";
|
|
3830
3829
|
constructor(A) {
|
|
3831
3830
|
super();
|
|
3832
3831
|
const { length: I, width: B } = A;
|
|
3833
3832
|
this.addObject(
|
|
3834
|
-
|
|
3833
|
+
Ig({
|
|
3835
3834
|
end: [I, 0, 0],
|
|
3836
3835
|
width: B,
|
|
3837
3836
|
color: [1, 0, 0]
|
|
3838
3837
|
})
|
|
3839
3838
|
), this.addObject(
|
|
3840
|
-
|
|
3839
|
+
Ig({
|
|
3841
3840
|
end: [0, I, 0],
|
|
3842
3841
|
width: B,
|
|
3843
3842
|
color: [0, 1, 0]
|
|
3844
3843
|
})
|
|
3845
3844
|
), this.addObject(
|
|
3846
|
-
|
|
3845
|
+
Ig({
|
|
3847
3846
|
end: [0, 0, I],
|
|
3848
3847
|
width: B,
|
|
3849
3848
|
color: [0, 0, 1]
|
|
@@ -3853,7 +3852,7 @@ class lo extends FA {
|
|
|
3853
3852
|
update() {
|
|
3854
3853
|
}
|
|
3855
3854
|
}
|
|
3856
|
-
function
|
|
3855
|
+
function Ig(g) {
|
|
3857
3856
|
const { end: A, width: I, color: B } = g, C = new LI([[0, 0, 0], A]);
|
|
3858
3857
|
return new wg({
|
|
3859
3858
|
geometry: C,
|
|
@@ -3861,7 +3860,7 @@ function gg(g) {
|
|
|
3861
3860
|
width: I
|
|
3862
3861
|
});
|
|
3863
3862
|
}
|
|
3864
|
-
class
|
|
3863
|
+
class mo extends FA {
|
|
3865
3864
|
type = "ProjectedLineLayer";
|
|
3866
3865
|
paths_ = [];
|
|
3867
3866
|
constructor(A = []) {
|
|
@@ -3878,10 +3877,10 @@ class fo extends FA {
|
|
|
3878
3877
|
// TODO: this is temporary - we may want to generalize this to all layers
|
|
3879
3878
|
// for now it is used to set the initial camera position to be centered on the tracks
|
|
3880
3879
|
get extent() {
|
|
3881
|
-
return
|
|
3880
|
+
return YQ(this.paths_.flat());
|
|
3882
3881
|
}
|
|
3883
3882
|
}
|
|
3884
|
-
function
|
|
3883
|
+
function YQ(g) {
|
|
3885
3884
|
function A(o) {
|
|
3886
3885
|
const a = g.map((s) => s[o]);
|
|
3887
3886
|
return [Math.min(...a), Math.max(...a)];
|
|
@@ -3889,7 +3888,7 @@ function MQ(g) {
|
|
|
3889
3888
|
const [I, B] = A(0), [C, Q] = A(1), [E, i] = A(2);
|
|
3890
3889
|
return { xMin: I, xMax: B, yMin: C, yMax: Q, zMin: E, zMax: i };
|
|
3891
3890
|
}
|
|
3892
|
-
class
|
|
3891
|
+
class uo extends FA {
|
|
3893
3892
|
type = "TracksLayer";
|
|
3894
3893
|
tracks_ = [];
|
|
3895
3894
|
constructor(A = []) {
|
|
@@ -3899,7 +3898,7 @@ class po extends FA {
|
|
|
3899
3898
|
this.tracks_.push(A);
|
|
3900
3899
|
let I;
|
|
3901
3900
|
if (A.interpolation) {
|
|
3902
|
-
const i =
|
|
3901
|
+
const i = MQ({
|
|
3903
3902
|
path: A.path,
|
|
3904
3903
|
pointsPerSegment: A.interpolation.pointsPerSegment,
|
|
3905
3904
|
tangentFactor: A.interpolation.tangentFactor
|
|
@@ -3930,10 +3929,10 @@ class po extends FA {
|
|
|
3930
3929
|
// for now it is used to set the initial camera position to be centered on the tracks
|
|
3931
3930
|
get extent() {
|
|
3932
3931
|
const A = this.tracks_.map((I) => I.path);
|
|
3933
|
-
return
|
|
3932
|
+
return dQ(A.flat());
|
|
3934
3933
|
}
|
|
3935
3934
|
}
|
|
3936
|
-
function
|
|
3935
|
+
function dQ(g) {
|
|
3937
3936
|
function A(o) {
|
|
3938
3937
|
const a = g.map((s) => s[o]);
|
|
3939
3938
|
return [Math.min(...a), Math.max(...a)];
|
|
@@ -3941,12 +3940,12 @@ function KQ(g) {
|
|
|
3941
3940
|
const [I, B] = A(0), [C, Q] = A(1), [E, i] = A(2);
|
|
3942
3941
|
return { xMin: I, xMax: B, yMin: C, yMax: Q, zMin: E, zMax: i };
|
|
3943
3942
|
}
|
|
3944
|
-
function
|
|
3943
|
+
function MQ({
|
|
3945
3944
|
path: g,
|
|
3946
3945
|
pointsPerSegment: A,
|
|
3947
3946
|
tangentFactor: I = 1 / 3
|
|
3948
3947
|
}) {
|
|
3949
|
-
const B =
|
|
3948
|
+
const B = KQ(g), C = Array((g.length - 1) * A);
|
|
3950
3949
|
for (let Q = 0; Q < g.length - 1; Q++) {
|
|
3951
3950
|
const E = g[Q], i = g[Q + 1], o = BA(B[Q]);
|
|
3952
3951
|
cI(o, E, o, I);
|
|
@@ -3954,12 +3953,12 @@ function HQ({
|
|
|
3954
3953
|
cI(a, i, a, -I);
|
|
3955
3954
|
for (let s = 0; s < A; s++) {
|
|
3956
3955
|
const h = s / A, t = C[Q * A + s] = f();
|
|
3957
|
-
|
|
3956
|
+
pC(t, E, o, a, i, h);
|
|
3958
3957
|
}
|
|
3959
3958
|
}
|
|
3960
3959
|
return C;
|
|
3961
3960
|
}
|
|
3962
|
-
function
|
|
3961
|
+
function KQ(g) {
|
|
3963
3962
|
if (g.length < 2)
|
|
3964
3963
|
throw new Error("Path must contain at least 2 points");
|
|
3965
3964
|
const A = Array(g.length), I = f(), B = f();
|
|
@@ -3969,7 +3968,7 @@ function qQ(g) {
|
|
|
3969
3968
|
}
|
|
3970
3969
|
return A;
|
|
3971
3970
|
}
|
|
3972
|
-
class
|
|
3971
|
+
class lB extends bA {
|
|
3973
3972
|
constructor(A, I, B, C) {
|
|
3974
3973
|
super();
|
|
3975
3974
|
const Q = [], E = [], i = B, o = C, a = i + 1, s = o + 1, h = A / i, t = I / o;
|
|
@@ -4020,7 +4019,7 @@ function mA(g) {
|
|
|
4020
4019
|
return "float";
|
|
4021
4020
|
throw new Error("Unsupported buffer type.");
|
|
4022
4021
|
}
|
|
4023
|
-
function
|
|
4022
|
+
function HQ(g) {
|
|
4024
4023
|
if (g.dataFormat === "rgb" || g.dataFormat === "rgba")
|
|
4025
4024
|
return [0, 1];
|
|
4026
4025
|
switch (g.dataType) {
|
|
@@ -4057,7 +4056,7 @@ class Fg extends yg {
|
|
|
4057
4056
|
}
|
|
4058
4057
|
const QB = 32;
|
|
4059
4058
|
function $A(g, { visible: A, color: I, contrastLimits: B }) {
|
|
4060
|
-
return A === void 0 && (A = !0), I === void 0 ? I = l.WHITE : I = l.from(I), g !== null ? B =
|
|
4059
|
+
return A === void 0 && (A = !0), I === void 0 ? I = l.WHITE : I = l.from(I), g !== null ? B = qQ(B, g) : B === void 0 && (U.debug(
|
|
4061
4060
|
"Channel",
|
|
4062
4061
|
"No texture provided, defaulting channel contrast limits to [0, 1]."
|
|
4063
4062
|
), B = [0, 1]), {
|
|
@@ -4066,7 +4065,7 @@ function $A(g, { visible: A, color: I, contrastLimits: B }) {
|
|
|
4066
4065
|
contrastLimits: B
|
|
4067
4066
|
};
|
|
4068
4067
|
}
|
|
4069
|
-
function
|
|
4068
|
+
function ig(g, A) {
|
|
4070
4069
|
if (A.length > QB)
|
|
4071
4070
|
throw new Error(`Maximum number of channels is ${QB}`);
|
|
4072
4071
|
if (g?.type === "Texture2DArray") {
|
|
@@ -4078,9 +4077,9 @@ function JI(g, A) {
|
|
|
4078
4077
|
}
|
|
4079
4078
|
return A.map((I) => $A(g, I));
|
|
4080
4079
|
}
|
|
4081
|
-
function
|
|
4080
|
+
function qQ(g, A) {
|
|
4082
4081
|
if (g === void 0)
|
|
4083
|
-
return
|
|
4082
|
+
return HQ(A);
|
|
4084
4083
|
if (g[1] <= g[0])
|
|
4085
4084
|
throw new Error(
|
|
4086
4085
|
`Contrast limits must be strictly increasing: ${g}.`
|
|
@@ -4090,13 +4089,13 @@ function fQ(g, A) {
|
|
|
4090
4089
|
class rg extends ZA {
|
|
4091
4090
|
channels_;
|
|
4092
4091
|
constructor(A, I, B, C = []) {
|
|
4093
|
-
super(), this.geometry = new
|
|
4092
|
+
super(), this.geometry = new lB(A, I, 1, 1), this.setTexture(0, B), this.channels_ = ig(B, C), this.programName = lQ(B);
|
|
4094
4093
|
}
|
|
4095
4094
|
get type() {
|
|
4096
4095
|
return "ImageRenderable";
|
|
4097
4096
|
}
|
|
4098
4097
|
setChannelProps(A) {
|
|
4099
|
-
this.channels_ =
|
|
4098
|
+
this.channels_ = ig(this.textures[0], A);
|
|
4100
4099
|
}
|
|
4101
4100
|
setChannelProperty(A, I, B) {
|
|
4102
4101
|
const C = $A(this.textures[0], {
|
|
@@ -4135,14 +4134,14 @@ class rg extends ZA {
|
|
|
4135
4134
|
}
|
|
4136
4135
|
}
|
|
4137
4136
|
}
|
|
4138
|
-
function
|
|
4137
|
+
function lQ(g) {
|
|
4139
4138
|
if (g.type === "Texture2D")
|
|
4140
|
-
return
|
|
4139
|
+
return fQ(g.dataType);
|
|
4141
4140
|
if (g.type === "Texture2DArray")
|
|
4142
|
-
return
|
|
4141
|
+
return pQ(g.dataType);
|
|
4143
4142
|
throw new Error(`Unsupported image texture type: ${g.type}`);
|
|
4144
4143
|
}
|
|
4145
|
-
function
|
|
4144
|
+
function fQ(g) {
|
|
4146
4145
|
switch (g) {
|
|
4147
4146
|
case "byte":
|
|
4148
4147
|
case "int":
|
|
@@ -4156,7 +4155,7 @@ function mQ(g) {
|
|
|
4156
4155
|
return "floatScalarImage";
|
|
4157
4156
|
}
|
|
4158
4157
|
}
|
|
4159
|
-
function
|
|
4158
|
+
function pQ(g) {
|
|
4160
4159
|
switch (g) {
|
|
4161
4160
|
case "byte":
|
|
4162
4161
|
case "int":
|
|
@@ -4227,7 +4226,7 @@ function Sg(g, A, I, B, C = 3) {
|
|
|
4227
4226
|
case "pointerup": {
|
|
4228
4227
|
if (!A) return A;
|
|
4229
4228
|
const Q = g.event, E = W(Q.clientX, Q.clientY);
|
|
4230
|
-
if (
|
|
4229
|
+
if (vC(A, E) < C) {
|
|
4231
4230
|
if (!B) return null;
|
|
4232
4231
|
const o = g.worldPos;
|
|
4233
4232
|
if (o) {
|
|
@@ -4244,7 +4243,7 @@ function Sg(g, A, I, B, C = 3) {
|
|
|
4244
4243
|
return A;
|
|
4245
4244
|
}
|
|
4246
4245
|
}
|
|
4247
|
-
class
|
|
4246
|
+
class fB {
|
|
4248
4247
|
bins_ = /* @__PURE__ */ new Map();
|
|
4249
4248
|
acquire(A) {
|
|
4250
4249
|
const B = this.bins_.get(A)?.pop();
|
|
@@ -4259,13 +4258,13 @@ class mB {
|
|
|
4259
4258
|
this.bins_.clear();
|
|
4260
4259
|
}
|
|
4261
4260
|
}
|
|
4262
|
-
class
|
|
4261
|
+
class pB extends FA {
|
|
4263
4262
|
type = "ChunkedImageLayer";
|
|
4264
4263
|
source_;
|
|
4265
4264
|
sliceCoords_;
|
|
4266
4265
|
onPickValue_;
|
|
4267
4266
|
visibleChunks_ = /* @__PURE__ */ new Map();
|
|
4268
|
-
pool_ = new
|
|
4267
|
+
pool_ = new fB();
|
|
4269
4268
|
initialChannelProps_;
|
|
4270
4269
|
channelChangeCallbacks_ = [];
|
|
4271
4270
|
policy_;
|
|
@@ -4335,7 +4334,7 @@ class uB extends FA {
|
|
|
4335
4334
|
return this.lastPresentationTimeCoord_;
|
|
4336
4335
|
}
|
|
4337
4336
|
isPresentationStale() {
|
|
4338
|
-
return this.lastPresentationTimeStamp_ === void 0 ? !1 : performance.now() - this.lastPresentationTimeStamp_ >
|
|
4337
|
+
return this.lastPresentationTimeStamp_ === void 0 ? !1 : performance.now() - this.lastPresentationTimeStamp_ > pB.STALE_PRESENTATION_MS_;
|
|
4339
4338
|
}
|
|
4340
4339
|
resliceIfZChanged() {
|
|
4341
4340
|
const A = this.sliceCoords_.z;
|
|
@@ -4378,7 +4377,7 @@ class uB extends FA {
|
|
|
4378
4377
|
slicePlane(A, I) {
|
|
4379
4378
|
if (!A.data) return;
|
|
4380
4379
|
const B = (I - A.offset.z) / A.scale.z, C = Math.round(B), Q = cA(C, 0, A.shape.z - 1);
|
|
4381
|
-
|
|
4380
|
+
Qg(B, Q, 1 + 1e-6) || U.error("ImageLayer", "slicePlane zValue outside extent");
|
|
4382
4381
|
const E = A.shape.x * A.shape.y, i = E * Q;
|
|
4383
4382
|
return A.data.slice(i, i + E);
|
|
4384
4383
|
}
|
|
@@ -4424,7 +4423,7 @@ class uB extends FA {
|
|
|
4424
4423
|
}
|
|
4425
4424
|
getValueFromChunk(A, I, B) {
|
|
4426
4425
|
if (!A.data) return null;
|
|
4427
|
-
const C =
|
|
4426
|
+
const C = uI(
|
|
4428
4427
|
f(),
|
|
4429
4428
|
B,
|
|
4430
4429
|
I.transform.inverse
|
|
@@ -4479,7 +4478,7 @@ function EB(g) {
|
|
|
4479
4478
|
`align${g.rowAlignmentBytes}`
|
|
4480
4479
|
].join(":");
|
|
4481
4480
|
}
|
|
4482
|
-
class
|
|
4481
|
+
class mQ extends bA {
|
|
4483
4482
|
constructor(A, I, B, C, Q, E) {
|
|
4484
4483
|
super();
|
|
4485
4484
|
const i = [], o = [], a = Math.floor(C), s = Math.floor(Q), h = Math.floor(E);
|
|
@@ -4579,13 +4578,13 @@ class jA extends Fg {
|
|
|
4579
4578
|
return B.unpackAlignment = A.rowAlignmentBytes, B;
|
|
4580
4579
|
}
|
|
4581
4580
|
}
|
|
4582
|
-
class
|
|
4581
|
+
class uQ extends ZA {
|
|
4583
4582
|
voxelScale = q(1, 1, 1);
|
|
4584
4583
|
channels_;
|
|
4585
4584
|
channelToTextureIndex_ = /* @__PURE__ */ new Map();
|
|
4586
4585
|
loadedChannels_ = /* @__PURE__ */ new Set();
|
|
4587
|
-
constructor(
|
|
4588
|
-
super(), this.geometry = new
|
|
4586
|
+
constructor() {
|
|
4587
|
+
super(), this.geometry = new mQ(1, 1, 1, 1, 1, 1), this.cullFaceMode = "front", this.depthTest = !1, this.channels_ = [];
|
|
4589
4588
|
}
|
|
4590
4589
|
get type() {
|
|
4591
4590
|
return "VolumeRenderable";
|
|
@@ -4596,7 +4595,13 @@ class xQ extends ZA {
|
|
|
4596
4595
|
}
|
|
4597
4596
|
addChannelTexture(A, I) {
|
|
4598
4597
|
const B = jA.createWithChunk(I), C = this.textures.length;
|
|
4599
|
-
this.setTexture(C, B), this.channelToTextureIndex_.set(A, C)
|
|
4598
|
+
this.setTexture(C, B), this.channelToTextureIndex_.set(A, C);
|
|
4599
|
+
const Q = TQ(B.dataType);
|
|
4600
|
+
if (this.programName && this.programName !== Q)
|
|
4601
|
+
throw new Error(
|
|
4602
|
+
`Volume renderable does not support multiple channels with different data types. Existing program: ${this.programName}, new channel data type: ${B.dataType} and program: ${Q}`
|
|
4603
|
+
);
|
|
4604
|
+
this.programName = Q;
|
|
4600
4605
|
}
|
|
4601
4606
|
updateChannelTexture(A, I) {
|
|
4602
4607
|
const B = this.textures[A];
|
|
@@ -4663,7 +4668,7 @@ class xQ extends ZA {
|
|
|
4663
4668
|
return I !== void 0 ? this.textures[I] : null;
|
|
4664
4669
|
}
|
|
4665
4670
|
setChannelProps(A) {
|
|
4666
|
-
this.channels_ =
|
|
4671
|
+
this.channels_ = ig(
|
|
4667
4672
|
this.getAvailableChannelTexture(),
|
|
4668
4673
|
A
|
|
4669
4674
|
);
|
|
@@ -4679,7 +4684,7 @@ class xQ extends ZA {
|
|
|
4679
4684
|
this.channels_[A] = C;
|
|
4680
4685
|
}
|
|
4681
4686
|
}
|
|
4682
|
-
function
|
|
4687
|
+
function TQ(g) {
|
|
4683
4688
|
switch (g) {
|
|
4684
4689
|
case "byte":
|
|
4685
4690
|
case "int":
|
|
@@ -4693,7 +4698,7 @@ function iB(g) {
|
|
|
4693
4698
|
return "floatVolume";
|
|
4694
4699
|
}
|
|
4695
4700
|
}
|
|
4696
|
-
function
|
|
4701
|
+
function xQ(g, A) {
|
|
4697
4702
|
const I = A.position, B = f(), C = f();
|
|
4698
4703
|
return g.sort((Q, E) => {
|
|
4699
4704
|
lA(B, Q.boundingBox.max, Q.boundingBox.min), fA(B, B, 0.5), lA(C, E.boundingBox.max, E.boundingBox.min), fA(C, C, 0.5);
|
|
@@ -4701,19 +4706,21 @@ function WQ(g, A) {
|
|
|
4701
4706
|
return i - o;
|
|
4702
4707
|
}), g;
|
|
4703
4708
|
}
|
|
4704
|
-
const
|
|
4705
|
-
class
|
|
4709
|
+
const WQ = 2;
|
|
4710
|
+
class To extends FA {
|
|
4706
4711
|
type = "VolumeLayer";
|
|
4707
4712
|
source_;
|
|
4708
4713
|
sliceCoords_;
|
|
4709
|
-
|
|
4710
|
-
|
|
4714
|
+
currentVolumes_ = /* @__PURE__ */ new Map();
|
|
4715
|
+
volumeToPoolKey_ = /* @__PURE__ */ new Map();
|
|
4716
|
+
pool_ = new fB();
|
|
4711
4717
|
initialChannelProps_;
|
|
4712
4718
|
channelChangeCallbacks_ = [];
|
|
4713
4719
|
sourcePolicy_;
|
|
4714
4720
|
chunkStoreView_;
|
|
4715
4721
|
channelProps_;
|
|
4716
4722
|
lastLoadedTime_ = void 0;
|
|
4723
|
+
lastNumRenderedChannelChunks_ = void 0;
|
|
4717
4724
|
interactiveStepSizeScale_ = 1;
|
|
4718
4725
|
// TODO: Make a debug config object to manage debug options
|
|
4719
4726
|
debugShowWireframes_ = !1;
|
|
@@ -4725,9 +4732,11 @@ class mo extends FA {
|
|
|
4725
4732
|
return this.debugShowWireframes_;
|
|
4726
4733
|
}
|
|
4727
4734
|
set debugShowWireframes(A) {
|
|
4728
|
-
this.debugShowWireframes_ !== A
|
|
4729
|
-
I
|
|
4730
|
-
|
|
4735
|
+
if (this.debugShowWireframes_ !== A) {
|
|
4736
|
+
for (const I of this.currentVolumes_.values())
|
|
4737
|
+
I.wireframeEnabled = A;
|
|
4738
|
+
this.debugShowWireframes_ = A;
|
|
4739
|
+
}
|
|
4731
4740
|
}
|
|
4732
4741
|
set sourcePolicy(A) {
|
|
4733
4742
|
this.sourcePolicy_ !== A && (this.sourcePolicy_ = A, this.chunkStoreView_ && this.chunkStoreView_.setImageSourcePolicy(
|
|
@@ -4736,9 +4745,10 @@ class mo extends FA {
|
|
|
4736
4745
|
));
|
|
4737
4746
|
}
|
|
4738
4747
|
setChannelProps(A) {
|
|
4739
|
-
this.channelProps_ = A
|
|
4748
|
+
this.channelProps_ = A;
|
|
4749
|
+
for (const I of this.currentVolumes_.values())
|
|
4740
4750
|
I.setChannelProps(A);
|
|
4741
|
-
|
|
4751
|
+
this.channelChangeCallbacks_.forEach((I) => {
|
|
4742
4752
|
I();
|
|
4743
4753
|
});
|
|
4744
4754
|
}
|
|
@@ -4757,20 +4767,19 @@ class mo extends FA {
|
|
|
4757
4767
|
throw new Error(`Callback to remove could not be found: ${A}`);
|
|
4758
4768
|
this.channelChangeCallbacks_.splice(I, 1);
|
|
4759
4769
|
}
|
|
4760
|
-
currentVolumes() {
|
|
4761
|
-
return new Set(this.currentChunks_.values());
|
|
4762
|
-
}
|
|
4763
4770
|
constructor({ source: A, sliceCoords: I, policy: B, channelProps: C }) {
|
|
4764
4771
|
super({ transparent: !0, blendMode: "premultiplied" }), this.source_ = A, this.sliceCoords_ = I, this.sourcePolicy_ = B, this.initialChannelProps_ = C, this.channelProps_ = C, this.setState("initialized");
|
|
4765
4772
|
}
|
|
4766
|
-
|
|
4767
|
-
const
|
|
4768
|
-
if (
|
|
4769
|
-
|
|
4770
|
-
|
|
4771
|
-
|
|
4772
|
-
|
|
4773
|
-
|
|
4773
|
+
getOrCreateVolume(A, I) {
|
|
4774
|
+
const B = this.currentVolumes_.get(A);
|
|
4775
|
+
if (B) {
|
|
4776
|
+
for (const E of I) B.updateVolumeWithChunk(E);
|
|
4777
|
+
return B;
|
|
4778
|
+
}
|
|
4779
|
+
const C = PQ(I[0]), Q = this.pool_.acquire(C) ?? new uQ();
|
|
4780
|
+
Q.setChannelProps(this.channelProps_ ?? []), this.volumeToPoolKey_.set(Q, C);
|
|
4781
|
+
for (const E of I) Q.updateVolumeWithChunk(E);
|
|
4782
|
+
return this.updateVolumeTransform(Q, I[0]), Q;
|
|
4774
4783
|
}
|
|
4775
4784
|
async onAttached(A) {
|
|
4776
4785
|
this.chunkStoreView_ = await A.chunkManager.addView(
|
|
@@ -4779,25 +4788,21 @@ class mo extends FA {
|
|
|
4779
4788
|
);
|
|
4780
4789
|
}
|
|
4781
4790
|
onDetached(A) {
|
|
4782
|
-
this.chunkStoreView_ && (this.
|
|
4791
|
+
this.chunkStoreView_ && (this.releaseAndRemoveVolumes(this.currentVolumes_.values()), this.clearObjects(), this.chunkStoreView_.dispose(), this.chunkStoreView_ = void 0);
|
|
4783
4792
|
}
|
|
4784
4793
|
updateChunks() {
|
|
4785
4794
|
if (!this.chunkStoreView_) return;
|
|
4786
4795
|
const A = this.chunkStoreView_.getChunksToRender(
|
|
4787
4796
|
this.sliceCoords_
|
|
4788
|
-
), I = this.sliceCoords_.t ?? -1;
|
|
4789
|
-
if (
|
|
4790
|
-
const
|
|
4791
|
-
|
|
4792
|
-
)
|
|
4793
|
-
|
|
4794
|
-
|
|
4795
|
-
const i = this.getVolumeForChunk(E);
|
|
4796
|
-
i.wireframeEnabled = this.debugShowWireframes, this.currentChunks_.set(E, i);
|
|
4797
|
+
), I = this.sliceCoords_.t ?? -1, B = ZQ(A), C = this.lastLoadedTime_ !== I || B.size !== this.currentVolumes_.size || this.lastNumRenderedChannelChunks_ !== A.length;
|
|
4798
|
+
if (this.lastNumRenderedChannelChunks_ = A.length, !C) return;
|
|
4799
|
+
const Q = Array.from(this.currentVolumes_.entries()).filter(([E]) => !B.has(E)).map(([, E]) => E);
|
|
4800
|
+
this.releaseAndRemoveVolumes(Q), this.currentVolumes_.clear(), this.clearObjects();
|
|
4801
|
+
for (const [E, i] of B) {
|
|
4802
|
+
const o = this.getOrCreateVolume(E, i);
|
|
4803
|
+
o.wireframeEnabled = this.debugShowWireframes, this.currentVolumes_.set(E, o), this.addObject(o);
|
|
4797
4804
|
}
|
|
4798
|
-
this.
|
|
4799
|
-
this.addObject(E);
|
|
4800
|
-
}), this.lastLoadedTime_ = I, this.state !== "ready" && this.setState("ready");
|
|
4805
|
+
this.lastLoadedTime_ = I, this.state !== "ready" && this.setState("ready");
|
|
4801
4806
|
}
|
|
4802
4807
|
updateVolumeTransform(A, I) {
|
|
4803
4808
|
const B = {
|
|
@@ -4817,12 +4822,9 @@ class mo extends FA {
|
|
|
4817
4822
|
I.offset.z + C.z
|
|
4818
4823
|
]);
|
|
4819
4824
|
}
|
|
4820
|
-
|
|
4821
|
-
const I
|
|
4822
|
-
|
|
4823
|
-
const C = this.currentChunks_.get(B);
|
|
4824
|
-
C && !I.has(C) && (C.clearLoadedChannels(), this.pool_.release(oB(B), C), I.add(C)), this.currentChunks_.delete(B);
|
|
4825
|
-
}
|
|
4825
|
+
releaseAndRemoveVolumes(A) {
|
|
4826
|
+
for (const I of A)
|
|
4827
|
+
I.clearLoadedChannels(), this.pool_.release(this.volumeToPoolKey_.get(I), I), this.volumeToPoolKey_.delete(I);
|
|
4826
4828
|
}
|
|
4827
4829
|
update(A) {
|
|
4828
4830
|
if (!this.chunkStoreView_) return;
|
|
@@ -4835,7 +4837,7 @@ class mo extends FA {
|
|
|
4835
4837
|
A.viewport
|
|
4836
4838
|
);
|
|
4837
4839
|
const I = A.viewport.cameraControls?.isMoving ?? !1;
|
|
4838
|
-
this.interactiveStepSizeScale_ = I ?
|
|
4840
|
+
this.interactiveStepSizeScale_ = I ? WQ : 1, this.updateChunks(), xQ(this.objects, A.viewport.camera);
|
|
4839
4841
|
}
|
|
4840
4842
|
getUniforms() {
|
|
4841
4843
|
return {
|
|
@@ -4846,14 +4848,27 @@ class mo extends FA {
|
|
|
4846
4848
|
};
|
|
4847
4849
|
}
|
|
4848
4850
|
}
|
|
4849
|
-
function
|
|
4851
|
+
function bQ(g) {
|
|
4852
|
+
const { x: A, y: I, z: B, t: C } = g.chunkIndex;
|
|
4853
|
+
return `${A}:${I}:${B}:${C}`;
|
|
4854
|
+
}
|
|
4855
|
+
function ZQ(g) {
|
|
4856
|
+
const A = /* @__PURE__ */ new Map();
|
|
4857
|
+
for (const I of g) {
|
|
4858
|
+
const B = bQ(I);
|
|
4859
|
+
let C = A.get(B);
|
|
4860
|
+
C || (C = [], A.set(B, C)), C.push(I);
|
|
4861
|
+
}
|
|
4862
|
+
return A;
|
|
4863
|
+
}
|
|
4864
|
+
function PQ(g) {
|
|
4850
4865
|
return [
|
|
4851
4866
|
`lod${g.lod}`,
|
|
4852
4867
|
`shape${g.shape.x}x${g.shape.y}x${g.shape.z}`,
|
|
4853
4868
|
`align${g.rowAlignmentBytes}`
|
|
4854
4869
|
].join(":");
|
|
4855
4870
|
}
|
|
4856
|
-
class
|
|
4871
|
+
class xo extends FA {
|
|
4857
4872
|
type = "ImageLayer";
|
|
4858
4873
|
source_;
|
|
4859
4874
|
region_;
|
|
@@ -4944,7 +4959,7 @@ class uo extends FA {
|
|
|
4944
4959
|
}
|
|
4945
4960
|
getValueAtWorld(A) {
|
|
4946
4961
|
if (!this.image_ || !this.chunk_?.data) return null;
|
|
4947
|
-
const I =
|
|
4962
|
+
const I = uI(
|
|
4948
4963
|
f(),
|
|
4949
4964
|
A,
|
|
4950
4965
|
this.image_.transform.inverse
|
|
@@ -5000,7 +5015,7 @@ class AI extends Fg {
|
|
|
5000
5015
|
return C.unpackAlignment = A.rowAlignmentBytes, C;
|
|
5001
5016
|
}
|
|
5002
5017
|
}
|
|
5003
|
-
const
|
|
5018
|
+
const OQ = [
|
|
5004
5019
|
[1, 0.5, 0.5],
|
|
5005
5020
|
[0.5, 1, 0.5],
|
|
5006
5021
|
[0.5, 0.5, 1],
|
|
@@ -5008,7 +5023,7 @@ const ZQ = [
|
|
|
5008
5023
|
[1, 0.5, 1],
|
|
5009
5024
|
[1, 1, 0.5]
|
|
5010
5025
|
];
|
|
5011
|
-
function
|
|
5026
|
+
function VQ(g) {
|
|
5012
5027
|
return g = g ?? /* @__PURE__ */ new Map(), new Map(
|
|
5013
5028
|
Array.from(g.entries()).map(([A, I]) => [
|
|
5014
5029
|
A,
|
|
@@ -5016,37 +5031,37 @@ function PQ(g) {
|
|
|
5016
5031
|
])
|
|
5017
5032
|
);
|
|
5018
5033
|
}
|
|
5019
|
-
function
|
|
5020
|
-
return g = g ??
|
|
5034
|
+
function vQ(g) {
|
|
5035
|
+
return g = g ?? OQ, g.map(l.from);
|
|
5021
5036
|
}
|
|
5022
|
-
class
|
|
5037
|
+
class iB {
|
|
5023
5038
|
lookupTable;
|
|
5024
5039
|
cycle;
|
|
5025
5040
|
constructor(A = {}) {
|
|
5026
|
-
this.lookupTable =
|
|
5041
|
+
this.lookupTable = VQ(A.lookupTable), this.cycle = vQ(A.cycle);
|
|
5027
5042
|
}
|
|
5028
5043
|
}
|
|
5029
|
-
const
|
|
5044
|
+
const XQ = /* @__PURE__ */ new Set([
|
|
5030
5045
|
"unsigned_byte",
|
|
5031
5046
|
"unsigned_short",
|
|
5032
5047
|
"unsigned_int"
|
|
5033
5048
|
]);
|
|
5034
|
-
function
|
|
5049
|
+
function jQ(g) {
|
|
5035
5050
|
if (g.dataFormat !== "scalar")
|
|
5036
5051
|
throw new Error(
|
|
5037
5052
|
`Image data format must be scalar, instead found: ${g.dataFormat}`
|
|
5038
5053
|
);
|
|
5039
|
-
if (!
|
|
5054
|
+
if (!XQ.has(g.dataType))
|
|
5040
5055
|
throw new Error(
|
|
5041
5056
|
`Image data type must be unsigned, instead found: ${g.dataType}`
|
|
5042
5057
|
);
|
|
5043
5058
|
return g;
|
|
5044
5059
|
}
|
|
5045
|
-
class
|
|
5060
|
+
class zQ extends ZA {
|
|
5046
5061
|
outlineSelected_;
|
|
5047
5062
|
selectedValue_;
|
|
5048
5063
|
constructor(A) {
|
|
5049
|
-
super(), this.geometry = new
|
|
5064
|
+
super(), this.geometry = new lB(A.width, A.height, 1, 1), this.setTexture(0, jQ(A.imageData));
|
|
5050
5065
|
const I = this.makeColorCycleTexture(A.colorMap.cycle);
|
|
5051
5066
|
this.setTexture(1, I);
|
|
5052
5067
|
const B = this.makeColorLookupTableTexture(
|
|
@@ -5084,7 +5099,7 @@ class XQ extends ZA {
|
|
|
5084
5099
|
return Q.set(I, 0), Q.set(B, C), new AI(Q, C, 2);
|
|
5085
5100
|
}
|
|
5086
5101
|
}
|
|
5087
|
-
class
|
|
5102
|
+
class Wo extends FA {
|
|
5088
5103
|
type = "LabelImageLayer";
|
|
5089
5104
|
source_;
|
|
5090
5105
|
region_;
|
|
@@ -5105,7 +5120,7 @@ class To extends FA {
|
|
|
5105
5120
|
outlineSelected: E = !1,
|
|
5106
5121
|
...i
|
|
5107
5122
|
}) {
|
|
5108
|
-
super(i), this.setState("initialized"), this.source_ = A, this.region_ = I, this.colorMap_ = new
|
|
5123
|
+
super(i), this.setState("initialized"), this.source_ = A, this.region_ = I, this.colorMap_ = new iB(B), this.onPickValue_ = C, this.lod_ = Q, this.outlineSelected_ = E;
|
|
5109
5124
|
}
|
|
5110
5125
|
update() {
|
|
5111
5126
|
switch (this.state) {
|
|
@@ -5125,7 +5140,7 @@ class To extends FA {
|
|
|
5125
5140
|
return this.colorMap_;
|
|
5126
5141
|
}
|
|
5127
5142
|
setColorMap(A) {
|
|
5128
|
-
this.colorMap_ = new
|
|
5143
|
+
this.colorMap_ = new iB(A), this.image_ && this.image_.setColorMap(this.colorMap_);
|
|
5129
5144
|
}
|
|
5130
5145
|
setSelectedValue(A) {
|
|
5131
5146
|
this.selectedValue_ = A, this.image_ && this.image_.setSelectedValue(this.selectedValue_);
|
|
@@ -5149,7 +5164,7 @@ class To extends FA {
|
|
|
5149
5164
|
}
|
|
5150
5165
|
createImage(A) {
|
|
5151
5166
|
this.imageChunk_ = A;
|
|
5152
|
-
const I = new
|
|
5167
|
+
const I = new zQ({
|
|
5153
5168
|
width: A.shape.x,
|
|
5154
5169
|
height: A.shape.y,
|
|
5155
5170
|
imageData: AI.createWithChunk(A),
|
|
@@ -5162,7 +5177,7 @@ class To extends FA {
|
|
|
5162
5177
|
getValueAtWorld(A) {
|
|
5163
5178
|
if (!this.image_ || !this.imageChunk_?.data)
|
|
5164
5179
|
return null;
|
|
5165
|
-
const I =
|
|
5180
|
+
const I = uI(
|
|
5166
5181
|
f(),
|
|
5167
5182
|
A,
|
|
5168
5183
|
this.image_.transform.inverse
|
|
@@ -5173,12 +5188,12 @@ class To extends FA {
|
|
|
5173
5188
|
return this.imageChunk_.data[Q];
|
|
5174
5189
|
}
|
|
5175
5190
|
}
|
|
5176
|
-
class
|
|
5191
|
+
class TI extends Error {
|
|
5177
5192
|
constructor(A) {
|
|
5178
|
-
super(A), this.name = "AbortError", Object.setPrototypeOf(this,
|
|
5193
|
+
super(A), this.name = "AbortError", Object.setPrototypeOf(this, TI.prototype);
|
|
5179
5194
|
}
|
|
5180
5195
|
}
|
|
5181
|
-
class
|
|
5196
|
+
class _Q {
|
|
5182
5197
|
maxConcurrent_;
|
|
5183
5198
|
pending_ = [];
|
|
5184
5199
|
abortController_ = new AbortController();
|
|
@@ -5213,7 +5228,7 @@ class jQ {
|
|
|
5213
5228
|
return this.abortController_.signal;
|
|
5214
5229
|
}
|
|
5215
5230
|
shutdown() {
|
|
5216
|
-
this.abortController_.abort(new
|
|
5231
|
+
this.abortController_.abort(new TI("shutdown"));
|
|
5217
5232
|
}
|
|
5218
5233
|
get numRunning() {
|
|
5219
5234
|
return this.numRunning_;
|
|
@@ -5222,12 +5237,12 @@ class jQ {
|
|
|
5222
5237
|
return this.pending_.length;
|
|
5223
5238
|
}
|
|
5224
5239
|
}
|
|
5225
|
-
class
|
|
5240
|
+
class $Q {
|
|
5226
5241
|
source_;
|
|
5227
5242
|
region_;
|
|
5228
5243
|
seriesDimensionName_;
|
|
5229
5244
|
seriesIndex_;
|
|
5230
|
-
scheduler_ = new
|
|
5245
|
+
scheduler_ = new _Q(16);
|
|
5231
5246
|
lod_;
|
|
5232
5247
|
loader_ = null;
|
|
5233
5248
|
seriesAttributes_;
|
|
@@ -5328,7 +5343,7 @@ class zQ {
|
|
|
5328
5343
|
const B = await Promise.allSettled(I);
|
|
5329
5344
|
for (const C of B)
|
|
5330
5345
|
if (C.status === "rejected") {
|
|
5331
|
-
if (C.reason instanceof
|
|
5346
|
+
if (C.reason instanceof TI)
|
|
5332
5347
|
return Promise.reject(C.reason);
|
|
5333
5348
|
U.error(
|
|
5334
5349
|
"ImageSeriesLoader",
|
|
@@ -5340,7 +5355,7 @@ class zQ {
|
|
|
5340
5355
|
return this.loader_ ??= await this.source_.open(), this.loader_;
|
|
5341
5356
|
}
|
|
5342
5357
|
}
|
|
5343
|
-
class
|
|
5358
|
+
class bo extends FA {
|
|
5344
5359
|
type = "ImageSeriesLayer";
|
|
5345
5360
|
seriesLoader_;
|
|
5346
5361
|
initialChannelProps_;
|
|
@@ -5357,7 +5372,7 @@ class xo extends FA {
|
|
|
5357
5372
|
lod: Q,
|
|
5358
5373
|
...E
|
|
5359
5374
|
}) {
|
|
5360
|
-
super(E), this.setState("initialized"), this.channelProps_ = C, this.initialChannelProps_ = C, this.seriesLoader_ = new
|
|
5375
|
+
super(E), this.setState("initialized"), this.channelProps_ = C, this.initialChannelProps_ = C, this.seriesLoader_ = new $Q({
|
|
5361
5376
|
source: A,
|
|
5362
5377
|
region: I,
|
|
5363
5378
|
seriesDimensionName: B,
|
|
@@ -5423,7 +5438,7 @@ class xo extends FA {
|
|
|
5423
5438
|
return C.transform.setScale([A.scale.x, A.scale.y, 1]), C.transform.setTranslation([A.offset.x, A.offset.y, 0]), C;
|
|
5424
5439
|
}
|
|
5425
5440
|
}
|
|
5426
|
-
function
|
|
5441
|
+
function mB(g, A, I, B = {}) {
|
|
5427
5442
|
return A !== void 0 && I !== void 0 && (B = {
|
|
5428
5443
|
...B,
|
|
5429
5444
|
headers: {
|
|
@@ -5432,7 +5447,7 @@ function TB(g, A, I, B = {}) {
|
|
|
5432
5447
|
}
|
|
5433
5448
|
}), fetch(g, B);
|
|
5434
5449
|
}
|
|
5435
|
-
function
|
|
5450
|
+
function AE(g, A) {
|
|
5436
5451
|
return {
|
|
5437
5452
|
...g,
|
|
5438
5453
|
...A,
|
|
@@ -5442,20 +5457,20 @@ function _Q(g, A) {
|
|
|
5442
5457
|
}
|
|
5443
5458
|
};
|
|
5444
5459
|
}
|
|
5445
|
-
function
|
|
5460
|
+
function oB(g, A) {
|
|
5446
5461
|
const I = typeof g == "string" ? new URL(g) : g;
|
|
5447
5462
|
I.pathname.endsWith("/") || (I.pathname += "/");
|
|
5448
5463
|
const B = new URL(A.slice(1), I);
|
|
5449
5464
|
return B.search = I.search, B;
|
|
5450
5465
|
}
|
|
5451
|
-
async function
|
|
5466
|
+
async function aB(g) {
|
|
5452
5467
|
if (g.status !== 404) {
|
|
5453
5468
|
if (g.status === 200 || g.status === 206)
|
|
5454
5469
|
return new Uint8Array(await g.arrayBuffer());
|
|
5455
5470
|
throw new Error(`Unexpected response status ${g.status} ${g.statusText}`);
|
|
5456
5471
|
}
|
|
5457
5472
|
}
|
|
5458
|
-
async function
|
|
5473
|
+
async function IE(g, A, I, B) {
|
|
5459
5474
|
if (B)
|
|
5460
5475
|
return fetch(g, {
|
|
5461
5476
|
...I,
|
|
@@ -5465,7 +5480,7 @@ async function $Q(g, A, I, B) {
|
|
|
5465
5480
|
if (!C.ok)
|
|
5466
5481
|
return C;
|
|
5467
5482
|
let Q = C.headers.get("Content-Length"), E = Number(Q);
|
|
5468
|
-
return
|
|
5483
|
+
return mB(g, E - A, E, I);
|
|
5469
5484
|
}
|
|
5470
5485
|
class PA {
|
|
5471
5486
|
url;
|
|
@@ -5475,18 +5490,18 @@ class PA {
|
|
|
5475
5490
|
this.url = A, this.#A = I.overrides ?? {}, this.#I = I.useSuffixRequest ?? !1;
|
|
5476
5491
|
}
|
|
5477
5492
|
#g(A) {
|
|
5478
|
-
return
|
|
5493
|
+
return AE(this.#A, A);
|
|
5479
5494
|
}
|
|
5480
5495
|
async get(A, I = {}) {
|
|
5481
|
-
let B =
|
|
5482
|
-
return
|
|
5496
|
+
let B = oB(this.url, A).href, C = await fetch(B, this.#g(I));
|
|
5497
|
+
return aB(C);
|
|
5483
5498
|
}
|
|
5484
5499
|
async getRange(A, I, B = {}) {
|
|
5485
|
-
let C =
|
|
5486
|
-
return "suffixLength" in I ? E = await
|
|
5500
|
+
let C = oB(this.url, A), Q = this.#g(B), E;
|
|
5501
|
+
return "suffixLength" in I ? E = await IE(C, I.suffixLength, Q, this.#I) : E = await mB(C, I.offset, I.length, Q), aB(E);
|
|
5487
5502
|
}
|
|
5488
5503
|
}
|
|
5489
|
-
class
|
|
5504
|
+
class uB {
|
|
5490
5505
|
#A;
|
|
5491
5506
|
constructor(A, I, B) {
|
|
5492
5507
|
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, (C) => C ? 1 : 0));
|
|
@@ -5629,14 +5644,14 @@ function GI(g) {
|
|
|
5629
5644
|
const A = new TextDecoder().decode(g);
|
|
5630
5645
|
return JSON.parse(A);
|
|
5631
5646
|
}
|
|
5632
|
-
function
|
|
5647
|
+
function sB(g, A) {
|
|
5633
5648
|
const I = A / 2, B = A - 1;
|
|
5634
5649
|
let C = 0;
|
|
5635
5650
|
for (let Q = 0; Q < g.length; Q += A)
|
|
5636
5651
|
for (let E = 0; E < I; E += 1)
|
|
5637
5652
|
C = g[Q + E], g[Q + E] = g[Q + B - E], g[Q + B - E] = C;
|
|
5638
5653
|
}
|
|
5639
|
-
function
|
|
5654
|
+
function TB(g) {
|
|
5640
5655
|
if (g === "v2:object")
|
|
5641
5656
|
return globalThis.Array;
|
|
5642
5657
|
let A = g.match(/v2:([US])(\d+)/);
|
|
@@ -5656,7 +5671,7 @@ function WB(g) {
|
|
|
5656
5671
|
float16: globalThis.Float16Array,
|
|
5657
5672
|
float32: Float32Array,
|
|
5658
5673
|
float64: Float64Array,
|
|
5659
|
-
bool:
|
|
5674
|
+
bool: uB
|
|
5660
5675
|
}[g];
|
|
5661
5676
|
return x(I, `Unknown or unsupported data_type: ${g}`), I;
|
|
5662
5677
|
}
|
|
@@ -5668,7 +5683,7 @@ function UA(g, A) {
|
|
|
5668
5683
|
C[A[Q]] = B, B *= g[A[Q]];
|
|
5669
5684
|
return C;
|
|
5670
5685
|
}
|
|
5671
|
-
function
|
|
5686
|
+
function gE({ name: g, configuration: A }) {
|
|
5672
5687
|
if (g === "default") {
|
|
5673
5688
|
const I = A?.separator ?? "/";
|
|
5674
5689
|
return (B) => ["c", ...B].join(I);
|
|
@@ -5679,7 +5694,7 @@ function AE({ name: g, configuration: A }) {
|
|
|
5679
5694
|
}
|
|
5680
5695
|
throw new Error(`Unknown chunk key encoding: ${g}`);
|
|
5681
5696
|
}
|
|
5682
|
-
function
|
|
5697
|
+
function BE(g) {
|
|
5683
5698
|
if (g === "|O")
|
|
5684
5699
|
return { data_type: "v2:object" };
|
|
5685
5700
|
let A = g.match(/^([<|>])(.*)$/);
|
|
@@ -5700,8 +5715,8 @@ function IE(g) {
|
|
|
5700
5715
|
}[B] ?? (B.startsWith("S") || B.startsWith("U") ? `v2:${B}` : void 0);
|
|
5701
5716
|
return x(C, `Unsupported or unknown dtype: ${g}`), I === "|" ? { data_type: C } : { data_type: C, endian: I === "<" ? "little" : "big" };
|
|
5702
5717
|
}
|
|
5703
|
-
function
|
|
5704
|
-
let I = [], B =
|
|
5718
|
+
function CE(g, A = {}) {
|
|
5719
|
+
let I = [], B = BE(g.dtype);
|
|
5705
5720
|
g.order === "F" && I.push({ name: "transpose", configuration: { order: "F" } }), "endian" in B && B.endian === "big" && I.push({ name: "bytes", configuration: { endian: "big" } });
|
|
5706
5721
|
for (let { id: C, ...Q } of g.filters ?? [])
|
|
5707
5722
|
I.push({ name: C, configuration: Q });
|
|
@@ -5731,14 +5746,14 @@ function gE(g, A = {}) {
|
|
|
5731
5746
|
attributes: A
|
|
5732
5747
|
};
|
|
5733
5748
|
}
|
|
5734
|
-
function
|
|
5749
|
+
function QE(g, A = {}) {
|
|
5735
5750
|
return {
|
|
5736
5751
|
zarr_format: 3,
|
|
5737
5752
|
node_type: "group",
|
|
5738
5753
|
attributes: A
|
|
5739
5754
|
};
|
|
5740
5755
|
}
|
|
5741
|
-
function
|
|
5756
|
+
function EE(g, A) {
|
|
5742
5757
|
if (A !== "number" && A !== "bigint" && A !== "boolean" && A !== "object" && A !== "string")
|
|
5743
5758
|
return g === A;
|
|
5744
5759
|
let I = g === "bool";
|
|
@@ -5753,13 +5768,13 @@ function CE(g, A) {
|
|
|
5753
5768
|
let Q = g === "v2:object";
|
|
5754
5769
|
return A === "object" ? Q : !B && !C && !I && !Q;
|
|
5755
5770
|
}
|
|
5756
|
-
function
|
|
5771
|
+
function iE(g) {
|
|
5757
5772
|
return g?.name === "sharding_indexed";
|
|
5758
5773
|
}
|
|
5759
|
-
function
|
|
5774
|
+
function xB(g) {
|
|
5760
5775
|
return (g.data_type === "uint64" || g.data_type === "int64") && g.fill_value != null ? BigInt(g.fill_value) : g.fill_value;
|
|
5761
5776
|
}
|
|
5762
|
-
function
|
|
5777
|
+
function WB(g, ...A) {
|
|
5763
5778
|
if (!A.some((I) => g instanceof I))
|
|
5764
5779
|
throw g;
|
|
5765
5780
|
}
|
|
@@ -5767,7 +5782,7 @@ function x(g, A = "") {
|
|
|
5767
5782
|
if (!g)
|
|
5768
5783
|
throw new Error(A);
|
|
5769
5784
|
}
|
|
5770
|
-
async function
|
|
5785
|
+
async function bB(g, { format: A, signal: I }) {
|
|
5771
5786
|
const B = g instanceof Response ? g : new Response(g);
|
|
5772
5787
|
x(B.body, "Response does not contain body.");
|
|
5773
5788
|
try {
|
|
@@ -5800,15 +5815,15 @@ class Ng {
|
|
|
5800
5815
|
return A;
|
|
5801
5816
|
}
|
|
5802
5817
|
}
|
|
5803
|
-
const
|
|
5804
|
-
function
|
|
5818
|
+
const DB = oE();
|
|
5819
|
+
function oE() {
|
|
5805
5820
|
const g = new Uint32Array([305419896]);
|
|
5806
5821
|
return new Uint8Array(g.buffer, g.byteOffset, g.byteLength)[0] !== 18;
|
|
5807
5822
|
}
|
|
5808
|
-
function
|
|
5823
|
+
function hB(g) {
|
|
5809
5824
|
return "BYTES_PER_ELEMENT" in g ? g.BYTES_PER_ELEMENT : 4;
|
|
5810
5825
|
}
|
|
5811
|
-
class
|
|
5826
|
+
class xI {
|
|
5812
5827
|
kind = "array_to_bytes";
|
|
5813
5828
|
#A;
|
|
5814
5829
|
#I;
|
|
@@ -5816,19 +5831,19 @@ class WI {
|
|
|
5816
5831
|
#C;
|
|
5817
5832
|
#B;
|
|
5818
5833
|
constructor(A, I) {
|
|
5819
|
-
this.#B = A?.endian, this.#I =
|
|
5834
|
+
this.#B = A?.endian, this.#I = TB(I.data_type), this.#C = I.shape, this.#A = UA(I.shape, "C");
|
|
5820
5835
|
const B = new this.#I(0);
|
|
5821
5836
|
this.#g = B.BYTES_PER_ELEMENT;
|
|
5822
5837
|
}
|
|
5823
5838
|
static fromConfig(A, I) {
|
|
5824
|
-
return new
|
|
5839
|
+
return new xI(A, I);
|
|
5825
5840
|
}
|
|
5826
5841
|
encode(A) {
|
|
5827
5842
|
let I = new Uint8Array(A.data.buffer);
|
|
5828
|
-
return
|
|
5843
|
+
return DB && this.#B === "big" && sB(I, hB(this.#I)), I;
|
|
5829
5844
|
}
|
|
5830
5845
|
decode(A) {
|
|
5831
|
-
return
|
|
5846
|
+
return DB && this.#B === "big" && sB(A, hB(this.#I)), {
|
|
5832
5847
|
data: new this.#I(A.buffer, A.byteOffset, A.byteLength / this.#g),
|
|
5833
5848
|
shape: this.#C,
|
|
5834
5849
|
stride: this.#A
|
|
@@ -5856,14 +5871,14 @@ class Ug {
|
|
|
5856
5871
|
throw new Error("Gzip encoding is not enabled by default. Please register a custom codec with `numcodecs/gzip`.");
|
|
5857
5872
|
}
|
|
5858
5873
|
async decode(A) {
|
|
5859
|
-
const I = await
|
|
5874
|
+
const I = await bB(A, { format: "gzip" });
|
|
5860
5875
|
return new Uint8Array(I);
|
|
5861
5876
|
}
|
|
5862
5877
|
}
|
|
5863
|
-
function
|
|
5878
|
+
function aE(g, A) {
|
|
5864
5879
|
return x(!Number.isNaN(A), "JsonCodec allow_nan is false but NaN was encountered during encoding."), x(A !== Number.POSITIVE_INFINITY, "JsonCodec allow_nan is false but Infinity was encountered during encoding."), x(A !== Number.NEGATIVE_INFINITY, "JsonCodec allow_nan is false but -Infinity was encountered during encoding."), A;
|
|
5865
5880
|
}
|
|
5866
|
-
function
|
|
5881
|
+
function sE(g, A) {
|
|
5867
5882
|
return A instanceof Object && !Array.isArray(A) ? Object.keys(A).sort().reduce((I, B) => (I[B] = A[B], I), {}) : A;
|
|
5868
5883
|
}
|
|
5869
5884
|
class kg {
|
|
@@ -5893,7 +5908,7 @@ class kg {
|
|
|
5893
5908
|
const { indent: I, encoding: B, ensure_ascii: C, check_circular: Q, allow_nan: E, sort_keys: i } = this.#A;
|
|
5894
5909
|
x(B === "utf-8", "JsonCodec does not yet support non-utf-8 encoding.");
|
|
5895
5910
|
const o = [];
|
|
5896
|
-
x(Q, "JsonCodec does not yet support skipping the check for circular references during encoding."), E || o.push(
|
|
5911
|
+
x(Q, "JsonCodec does not yet support skipping the check for circular references during encoding."), E || o.push(aE), i && o.push(sE);
|
|
5897
5912
|
const a = Array.from(A.data);
|
|
5898
5913
|
a.push("|O"), a.push(A.shape);
|
|
5899
5914
|
let s;
|
|
@@ -5918,8 +5933,8 @@ class kg {
|
|
|
5918
5933
|
return { data: B, shape: C, stride: Q };
|
|
5919
5934
|
}
|
|
5920
5935
|
}
|
|
5921
|
-
function
|
|
5922
|
-
return g instanceof
|
|
5936
|
+
function tB(g) {
|
|
5937
|
+
return g instanceof uB || g instanceof Rg || g instanceof eI ? new Proxy(g, {
|
|
5923
5938
|
get(I, B) {
|
|
5924
5939
|
return I.get(Number(B));
|
|
5925
5940
|
},
|
|
@@ -5928,7 +5943,7 @@ function eB(g) {
|
|
|
5928
5943
|
}
|
|
5929
5944
|
}) : g;
|
|
5930
5945
|
}
|
|
5931
|
-
function
|
|
5946
|
+
function DE(g, A) {
|
|
5932
5947
|
let I;
|
|
5933
5948
|
return g.data instanceof Rg || g.data instanceof eI ? I = new g.constructor(
|
|
5934
5949
|
// @ts-expect-error
|
|
@@ -5940,8 +5955,8 @@ function aE(g, A) {
|
|
|
5940
5955
|
stride: UA(g.shape, A)
|
|
5941
5956
|
};
|
|
5942
5957
|
}
|
|
5943
|
-
function
|
|
5944
|
-
let I =
|
|
5958
|
+
function hE(g, A) {
|
|
5959
|
+
let I = DE(g, A), B = g.shape.length, C = g.data.length, Q = Array(B).fill(0), E = tB(g.data), i = tB(I.data);
|
|
5945
5960
|
for (let o = 0; o < C; o++) {
|
|
5946
5961
|
let a = 0;
|
|
5947
5962
|
for (let s = 0; s < B; s++)
|
|
@@ -5956,12 +5971,12 @@ function sE(g, A) {
|
|
|
5956
5971
|
}
|
|
5957
5972
|
return I;
|
|
5958
5973
|
}
|
|
5959
|
-
function
|
|
5974
|
+
function tE(g) {
|
|
5960
5975
|
let A = g.shape.length;
|
|
5961
5976
|
return x(A === g.stride.length, "Shape and stride must have the same length."), g.stride.map((I, B) => ({ stride: I, index: B })).sort((I, B) => B.stride - I.stride).map((I) => I.index);
|
|
5962
5977
|
}
|
|
5963
|
-
function
|
|
5964
|
-
let I =
|
|
5978
|
+
function yE(g, A) {
|
|
5979
|
+
let I = tE(g);
|
|
5965
5980
|
return x(I.length === A.length, "Orders must match"), I.every((B, C) => B === A[C]);
|
|
5966
5981
|
}
|
|
5967
5982
|
class Lg {
|
|
@@ -5986,7 +6001,7 @@ class Lg {
|
|
|
5986
6001
|
return new Lg(A, I);
|
|
5987
6002
|
}
|
|
5988
6003
|
encode(A) {
|
|
5989
|
-
return
|
|
6004
|
+
return yE(A, this.#I) ? A : hE(A, this.#I);
|
|
5990
6005
|
}
|
|
5991
6006
|
decode(A) {
|
|
5992
6007
|
return {
|
|
@@ -6027,19 +6042,19 @@ class Yg {
|
|
|
6027
6042
|
throw new Error("Zlib encoding is not enabled by default. Please register a codec with `numcodecs/zlib`.");
|
|
6028
6043
|
}
|
|
6029
6044
|
async decode(A) {
|
|
6030
|
-
const I = await
|
|
6045
|
+
const I = await bB(A, { format: "deflate" });
|
|
6031
6046
|
return new Uint8Array(I);
|
|
6032
6047
|
}
|
|
6033
6048
|
}
|
|
6034
|
-
function
|
|
6035
|
-
return (/* @__PURE__ */ new Map()).set("blosc", () => import("./blosc-BOWv2fO7.js").then((g) => g.default)).set("lz4", () => import("./lz4-DUlZKApi.js").then((g) => g.default)).set("zstd", () => import("./zstd-DnzmycJs.js").then((g) => g.default)).set("gzip", () => Ug).set("zlib", () => Yg).set("transpose", () => Lg).set("bytes", () =>
|
|
6049
|
+
function eE() {
|
|
6050
|
+
return (/* @__PURE__ */ new Map()).set("blosc", () => import("./blosc-BOWv2fO7.js").then((g) => g.default)).set("lz4", () => import("./lz4-DUlZKApi.js").then((g) => g.default)).set("zstd", () => import("./zstd-DnzmycJs.js").then((g) => g.default)).set("gzip", () => Ug).set("zlib", () => Yg).set("transpose", () => Lg).set("bytes", () => xI).set("crc32c", () => cg).set("vlen-utf8", () => Jg).set("json2", () => kg).set("bitround", () => Ng);
|
|
6036
6051
|
}
|
|
6037
|
-
const
|
|
6052
|
+
const GE = eE();
|
|
6038
6053
|
function og(g) {
|
|
6039
6054
|
let A;
|
|
6040
6055
|
return {
|
|
6041
6056
|
async encode(I) {
|
|
6042
|
-
A || (A = await
|
|
6057
|
+
A || (A = await yB(g));
|
|
6043
6058
|
for (const C of A.array_to_array)
|
|
6044
6059
|
I = await C.encode(I);
|
|
6045
6060
|
let B = await A.array_to_bytes.encode(I);
|
|
@@ -6048,7 +6063,7 @@ function og(g) {
|
|
|
6048
6063
|
return B;
|
|
6049
6064
|
},
|
|
6050
6065
|
async decode(I) {
|
|
6051
|
-
A || (A = await
|
|
6066
|
+
A || (A = await yB(g));
|
|
6052
6067
|
for (let C = A.bytes_to_bytes.length - 1; C >= 0; C--)
|
|
6053
6068
|
I = await A.bytes_to_bytes[C].decode(I);
|
|
6054
6069
|
let B = await A.array_to_bytes.decode(I);
|
|
@@ -6058,9 +6073,9 @@ function og(g) {
|
|
|
6058
6073
|
}
|
|
6059
6074
|
};
|
|
6060
6075
|
}
|
|
6061
|
-
async function
|
|
6076
|
+
async function yB(g) {
|
|
6062
6077
|
let A = g.codecs.map(async (Q) => {
|
|
6063
|
-
let E = await
|
|
6078
|
+
let E = await GE.get(Q.name)?.();
|
|
6064
6079
|
return x(E, `Unknown codec: ${Q.name}`), { Codec: E, meta: Q };
|
|
6065
6080
|
}), I = [], B, C = [];
|
|
6066
6081
|
for await (let { Codec: Q, meta: E } of A) {
|
|
@@ -6076,9 +6091,9 @@ async function GB(g) {
|
|
|
6076
6091
|
C.push(i);
|
|
6077
6092
|
}
|
|
6078
6093
|
}
|
|
6079
|
-
return B || (x(
|
|
6094
|
+
return B || (x(nE(g), `Cannot encode ${g.data_type} to bytes without a codec`), B = xI.fromConfig({ endian: "little" }, g)), { array_to_array: I, array_to_bytes: B, bytes_to_bytes: C };
|
|
6080
6095
|
}
|
|
6081
|
-
function
|
|
6096
|
+
function nE(g) {
|
|
6082
6097
|
return g.data_type !== "v2:object";
|
|
6083
6098
|
}
|
|
6084
6099
|
class nI extends Error {
|
|
@@ -6091,8 +6106,8 @@ class dg extends Error {
|
|
|
6091
6106
|
super(`Missing key: ${A}`), this.name = "KeyError";
|
|
6092
6107
|
}
|
|
6093
6108
|
}
|
|
6094
|
-
const
|
|
6095
|
-
function
|
|
6109
|
+
const eB = 18446744073709551615n;
|
|
6110
|
+
function wE(g, A, I, B) {
|
|
6096
6111
|
x(g.store.getRange, "Store does not support range requests");
|
|
6097
6112
|
let C = g.store.getRange.bind(g.store), Q = A.map((o, a) => o / B.chunk_shape[a]), E = og({
|
|
6098
6113
|
data_type: "uint64",
|
|
@@ -6112,7 +6127,7 @@ function GE(g, A, I, B) {
|
|
|
6112
6127
|
if (h === null)
|
|
6113
6128
|
return;
|
|
6114
6129
|
let { data: t, shape: y, stride: n } = h, w = o.map((c, N) => c % y[N]).reduce((c, N, d) => c + N * n[d], 0), r = t[w], G = t[w + 1];
|
|
6115
|
-
if (!(r ===
|
|
6130
|
+
if (!(r === eB && G === eB))
|
|
6116
6131
|
return C(s, {
|
|
6117
6132
|
offset: Number(r),
|
|
6118
6133
|
length: Number(G)
|
|
@@ -6140,21 +6155,21 @@ class Mg extends z {
|
|
|
6140
6155
|
return this.#A.attributes;
|
|
6141
6156
|
}
|
|
6142
6157
|
}
|
|
6143
|
-
function
|
|
6158
|
+
function GB(g) {
|
|
6144
6159
|
return g.find((I) => I.name === "transpose")?.configuration?.order ?? "C";
|
|
6145
6160
|
}
|
|
6146
6161
|
const OA = Symbol("zarrita.context");
|
|
6147
|
-
function
|
|
6162
|
+
function FE(g) {
|
|
6148
6163
|
return g[OA];
|
|
6149
6164
|
}
|
|
6150
|
-
function
|
|
6151
|
-
let { configuration: I } = A.codecs.find(
|
|
6152
|
-
encode_chunk_key:
|
|
6153
|
-
TypedArray:
|
|
6165
|
+
function rE(g, A) {
|
|
6166
|
+
let { configuration: I } = A.codecs.find(iE) ?? {}, B = {
|
|
6167
|
+
encode_chunk_key: gE(A.chunk_key_encoding),
|
|
6168
|
+
TypedArray: TB(A.data_type),
|
|
6154
6169
|
fill_value: A.fill_value
|
|
6155
6170
|
};
|
|
6156
6171
|
if (I) {
|
|
6157
|
-
let Q =
|
|
6172
|
+
let Q = GB(I.codecs);
|
|
6158
6173
|
return {
|
|
6159
6174
|
...B,
|
|
6160
6175
|
kind: "sharded",
|
|
@@ -6167,10 +6182,10 @@ function wE(g, A) {
|
|
|
6167
6182
|
get_strides(E) {
|
|
6168
6183
|
return UA(E, Q);
|
|
6169
6184
|
},
|
|
6170
|
-
get_chunk_bytes:
|
|
6185
|
+
get_chunk_bytes: wE(g, A.chunk_grid.configuration.chunk_shape, B.encode_chunk_key, I)
|
|
6171
6186
|
};
|
|
6172
6187
|
}
|
|
6173
|
-
let C =
|
|
6188
|
+
let C = GB(A.codecs);
|
|
6174
6189
|
return {
|
|
6175
6190
|
...B,
|
|
6176
6191
|
kind: "regular",
|
|
@@ -6189,15 +6204,15 @@ function wE(g, A) {
|
|
|
6189
6204
|
}
|
|
6190
6205
|
};
|
|
6191
6206
|
}
|
|
6192
|
-
let
|
|
6207
|
+
let JI = class extends z {
|
|
6193
6208
|
kind = "array";
|
|
6194
6209
|
#A;
|
|
6195
6210
|
[OA];
|
|
6196
6211
|
constructor(A, I, B) {
|
|
6197
6212
|
super(A, I), this.#A = {
|
|
6198
6213
|
...B,
|
|
6199
|
-
fill_value:
|
|
6200
|
-
}, this[OA] =
|
|
6214
|
+
fill_value: xB(B)
|
|
6215
|
+
}, this[OA] = rE(this, B);
|
|
6201
6216
|
}
|
|
6202
6217
|
get attrs() {
|
|
6203
6218
|
return this.#A.attributes;
|
|
@@ -6241,15 +6256,15 @@ let YI = class extends z {
|
|
|
6241
6256
|
* ```
|
|
6242
6257
|
*/
|
|
6243
6258
|
is(A) {
|
|
6244
|
-
return
|
|
6259
|
+
return EE(this.dtype, A);
|
|
6245
6260
|
}
|
|
6246
6261
|
};
|
|
6247
|
-
function*
|
|
6262
|
+
function* SE(g, A, I = 1) {
|
|
6248
6263
|
A === void 0 && (A = g, g = 0);
|
|
6249
6264
|
for (let B = g; B < A; B += I)
|
|
6250
6265
|
yield B;
|
|
6251
6266
|
}
|
|
6252
|
-
function*
|
|
6267
|
+
function* RE(...g) {
|
|
6253
6268
|
if (g.length === 0)
|
|
6254
6269
|
return;
|
|
6255
6270
|
const A = g.map((B) => B[Symbol.iterator]()), I = A.map((B) => B.next());
|
|
@@ -6264,21 +6279,21 @@ function* rE(...g) {
|
|
|
6264
6279
|
I[B] = A[B].next();
|
|
6265
6280
|
}
|
|
6266
6281
|
}
|
|
6267
|
-
function
|
|
6282
|
+
function NE({ start: g, stop: A, step: I }, B) {
|
|
6268
6283
|
if (I === 0)
|
|
6269
6284
|
throw new Error("slice step cannot be zero");
|
|
6270
6285
|
I = I ?? 1;
|
|
6271
6286
|
const C = I < 0, [Q, E] = C ? [-1, B - 1] : [0, B];
|
|
6272
6287
|
return g === null ? g = C ? E : Q : g < 0 ? (g += B, g < Q && (g = Q)) : g > E && (g = E), A === null ? A = C ? Q : E : A < 0 ? (A += B, A < Q && (A = Q)) : A > E && (A = E), [g, A, I];
|
|
6273
6288
|
}
|
|
6274
|
-
function
|
|
6289
|
+
function YI(g, A, I = null) {
|
|
6275
6290
|
return A === void 0 && (A = g, g = null), {
|
|
6276
6291
|
start: g,
|
|
6277
6292
|
stop: A,
|
|
6278
6293
|
step: I
|
|
6279
6294
|
};
|
|
6280
6295
|
}
|
|
6281
|
-
function
|
|
6296
|
+
function cE() {
|
|
6282
6297
|
const g = [];
|
|
6283
6298
|
return {
|
|
6284
6299
|
add: (A) => g.push(A()),
|
|
@@ -6290,35 +6305,35 @@ class Kg extends Error {
|
|
|
6290
6305
|
super(A), this.name = "IndexError";
|
|
6291
6306
|
}
|
|
6292
6307
|
}
|
|
6293
|
-
function
|
|
6308
|
+
function UE(g, A) {
|
|
6294
6309
|
throw new Kg(`too many indicies for array; expected ${A.length}, got ${g.length}`);
|
|
6295
6310
|
}
|
|
6296
|
-
function
|
|
6311
|
+
function kE(g) {
|
|
6297
6312
|
throw new Kg(`index out of bounds for dimension with length ${g}`);
|
|
6298
6313
|
}
|
|
6299
|
-
function
|
|
6314
|
+
function LE() {
|
|
6300
6315
|
throw new Kg("only slices with step >= 1 are supported");
|
|
6301
6316
|
}
|
|
6302
|
-
function
|
|
6303
|
-
g.length > A.length &&
|
|
6317
|
+
function JE(g, A) {
|
|
6318
|
+
g.length > A.length && UE(g, A);
|
|
6304
6319
|
}
|
|
6305
|
-
function
|
|
6306
|
-
return g = Math.trunc(g), g < 0 && (g = A + g), (g >= A || g < 0) &&
|
|
6320
|
+
function YE(g, A) {
|
|
6321
|
+
return g = Math.trunc(g), g < 0 && (g = A + g), (g >= A || g < 0) && kE(A), g;
|
|
6307
6322
|
}
|
|
6308
|
-
class
|
|
6323
|
+
class dE {
|
|
6309
6324
|
dim_sel;
|
|
6310
6325
|
dim_len;
|
|
6311
6326
|
dim_chunk_len;
|
|
6312
6327
|
nitems;
|
|
6313
6328
|
constructor({ dim_sel: A, dim_len: I, dim_chunk_len: B }) {
|
|
6314
|
-
A =
|
|
6329
|
+
A = YE(A, I), this.dim_sel = A, this.dim_len = I, this.dim_chunk_len = B, this.nitems = 1;
|
|
6315
6330
|
}
|
|
6316
6331
|
*[Symbol.iterator]() {
|
|
6317
6332
|
const A = Math.floor(this.dim_sel / this.dim_chunk_len), I = A * this.dim_chunk_len, B = this.dim_sel - I;
|
|
6318
6333
|
yield { dim_chunk_ix: A, dim_chunk_sel: B };
|
|
6319
6334
|
}
|
|
6320
6335
|
}
|
|
6321
|
-
class
|
|
6336
|
+
class nB {
|
|
6322
6337
|
start;
|
|
6323
6338
|
stop;
|
|
6324
6339
|
step;
|
|
@@ -6327,12 +6342,12 @@ class FB {
|
|
|
6327
6342
|
nitems;
|
|
6328
6343
|
nchunks;
|
|
6329
6344
|
constructor({ dim_sel: A, dim_len: I, dim_chunk_len: B }) {
|
|
6330
|
-
const [C, Q, E] =
|
|
6331
|
-
this.start = C, this.stop = Q, this.step = E, this.step < 1 &&
|
|
6345
|
+
const [C, Q, E] = NE(A, I);
|
|
6346
|
+
this.start = C, this.stop = Q, this.step = E, this.step < 1 && LE(), 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);
|
|
6332
6347
|
}
|
|
6333
6348
|
*[Symbol.iterator]() {
|
|
6334
6349
|
const A = Math.floor(this.start / this.dim_chunk_len), I = Math.ceil(this.stop / this.dim_chunk_len);
|
|
6335
|
-
for (const B of
|
|
6350
|
+
for (const B of SE(A, I)) {
|
|
6336
6351
|
const C = B * this.dim_chunk_len, Q = Math.min(this.dim_len, (B + 1) * this.dim_chunk_len), E = Q - C;
|
|
6337
6352
|
let i = 0, o = 0;
|
|
6338
6353
|
if (this.start < C) {
|
|
@@ -6353,43 +6368,43 @@ class FB {
|
|
|
6353
6368
|
}
|
|
6354
6369
|
}
|
|
6355
6370
|
}
|
|
6356
|
-
function
|
|
6371
|
+
function ME(g, A) {
|
|
6357
6372
|
let I = [];
|
|
6358
|
-
return g === null ? I = A.map((B) =>
|
|
6373
|
+
return g === null ? I = A.map((B) => YI(null)) : Array.isArray(g) && (I = g.map((B) => B ?? YI(null))), JE(I, A), I;
|
|
6359
6374
|
}
|
|
6360
|
-
class
|
|
6375
|
+
class KE {
|
|
6361
6376
|
dim_indexers;
|
|
6362
6377
|
shape;
|
|
6363
6378
|
constructor({ selection: A, shape: I, chunk_shape: B }) {
|
|
6364
|
-
this.dim_indexers =
|
|
6379
|
+
this.dim_indexers = ME(A, I).map((C, Q) => new (typeof C == "number" ? dE : nB)({
|
|
6365
6380
|
// @ts-expect-error ts inference not strong enough to know correct chunk
|
|
6366
6381
|
dim_sel: C,
|
|
6367
6382
|
dim_len: I[Q],
|
|
6368
6383
|
dim_chunk_len: B[Q]
|
|
6369
|
-
})), this.shape = this.dim_indexers.filter((C) => C instanceof
|
|
6384
|
+
})), this.shape = this.dim_indexers.filter((C) => C instanceof nB).map((C) => C.nitems);
|
|
6370
6385
|
}
|
|
6371
6386
|
*[Symbol.iterator]() {
|
|
6372
|
-
for (const A of
|
|
6387
|
+
for (const A of RE(...this.dim_indexers)) {
|
|
6373
6388
|
const I = A.map((C) => C.dim_chunk_ix), B = A.map((C) => "dim_out_sel" in C ? { from: C.dim_chunk_sel, to: C.dim_out_sel } : { from: C.dim_chunk_sel, to: null });
|
|
6374
6389
|
yield { chunk_coords: I, mapping: B };
|
|
6375
6390
|
}
|
|
6376
6391
|
}
|
|
6377
6392
|
}
|
|
6378
|
-
function
|
|
6393
|
+
function HE(g, A) {
|
|
6379
6394
|
return "get" in g ? g.get(A) : g[A];
|
|
6380
6395
|
}
|
|
6381
|
-
async function
|
|
6382
|
-
let C =
|
|
6396
|
+
async function qE(g, A, I, B) {
|
|
6397
|
+
let C = FE(g), Q = new KE({
|
|
6383
6398
|
selection: A,
|
|
6384
6399
|
shape: g.shape,
|
|
6385
6400
|
chunk_shape: g.chunks
|
|
6386
|
-
}), E = B.prepare(new C.TypedArray(Q.shape.reduce((o, a) => o * a, 1)), Q.shape, C.get_strides(Q.shape)), i = I.create_queue?.() ??
|
|
6401
|
+
}), E = B.prepare(new C.TypedArray(Q.shape.reduce((o, a) => o * a, 1)), Q.shape, C.get_strides(Q.shape)), i = I.create_queue?.() ?? cE();
|
|
6387
6402
|
for (const { chunk_coords: o, mapping: a } of Q)
|
|
6388
6403
|
i.add(async () => {
|
|
6389
6404
|
let { data: s, shape: h, stride: t } = await g.getChunk(o, I.opts), y = B.prepare(s, h, t);
|
|
6390
6405
|
B.set_from_chunk(E, y, a);
|
|
6391
6406
|
});
|
|
6392
|
-
return await i.onIdle(), Q.shape.length === 0 ?
|
|
6407
|
+
return await i.onIdle(), Q.shape.length === 0 ? HE(E.data, 0) : E;
|
|
6393
6408
|
}
|
|
6394
6409
|
function Hg(g, A = 0, I) {
|
|
6395
6410
|
let B = I ?? g.length - A;
|
|
@@ -6407,7 +6422,7 @@ function Hg(g, A = 0, I) {
|
|
|
6407
6422
|
}
|
|
6408
6423
|
};
|
|
6409
6424
|
}
|
|
6410
|
-
function
|
|
6425
|
+
function gg(g) {
|
|
6411
6426
|
return globalThis.Array.isArray(g.data) ? {
|
|
6412
6427
|
// @ts-expect-error
|
|
6413
6428
|
data: Hg(g.data),
|
|
@@ -6419,32 +6434,32 @@ function Bg(g) {
|
|
|
6419
6434
|
bytes_per_element: g.data.BYTES_PER_ELEMENT
|
|
6420
6435
|
};
|
|
6421
6436
|
}
|
|
6422
|
-
function
|
|
6437
|
+
function lE(g) {
|
|
6423
6438
|
return "chars" in g ? g.constructor.bind(null, g.chars) : g.constructor;
|
|
6424
6439
|
}
|
|
6425
|
-
function
|
|
6440
|
+
function fE(g, A) {
|
|
6426
6441
|
if (globalThis.Array.isArray(g.data))
|
|
6427
6442
|
return Hg([A]);
|
|
6428
|
-
let I =
|
|
6443
|
+
let I = lE(g.data), B = new I([A]);
|
|
6429
6444
|
return new Uint8Array(B.buffer, B.byteOffset, B.byteLength);
|
|
6430
6445
|
}
|
|
6431
|
-
const
|
|
6446
|
+
const pE = {
|
|
6432
6447
|
prepare(g, A, I) {
|
|
6433
6448
|
return { data: g, shape: A, stride: I };
|
|
6434
6449
|
},
|
|
6435
6450
|
set_scalar(g, A, I) {
|
|
6436
|
-
let B =
|
|
6437
|
-
ag(B, A,
|
|
6451
|
+
let B = gg(g);
|
|
6452
|
+
ag(B, A, fE(g, I), B.bytes_per_element);
|
|
6438
6453
|
},
|
|
6439
6454
|
set_from_chunk(g, A, I) {
|
|
6440
|
-
let B =
|
|
6441
|
-
SI(B,
|
|
6455
|
+
let B = gg(g);
|
|
6456
|
+
SI(B, gg(A), B.bytes_per_element, I);
|
|
6442
6457
|
}
|
|
6443
6458
|
};
|
|
6444
|
-
async function
|
|
6445
|
-
return
|
|
6459
|
+
async function mE(g, A = null, I = {}) {
|
|
6460
|
+
return qE(g, A, I, pE);
|
|
6446
6461
|
}
|
|
6447
|
-
function
|
|
6462
|
+
function ZB(g, A, I) {
|
|
6448
6463
|
return I < 0 && A < g ? Math.floor((g - A - 1) / -I) + 1 : g < A ? Math.floor((A - g - 1) / I) + 1 : 0;
|
|
6449
6464
|
}
|
|
6450
6465
|
function ag(g, A, I, B) {
|
|
@@ -6458,7 +6473,7 @@ function ag(g, A, I, B) {
|
|
|
6458
6473
|
ag({ data: t, stride: i }, Q, I, B);
|
|
6459
6474
|
return;
|
|
6460
6475
|
}
|
|
6461
|
-
const [o, a, s] = C, h =
|
|
6476
|
+
const [o, a, s] = C, h = ZB(o, a, s);
|
|
6462
6477
|
if (Q.length === 0) {
|
|
6463
6478
|
for (let t = 0; t < h; t++)
|
|
6464
6479
|
g.data.set(I, E * (o + s * t) * B);
|
|
@@ -6494,7 +6509,7 @@ function SI(g, A, I, B) {
|
|
|
6494
6509
|
}, I, Q);
|
|
6495
6510
|
return;
|
|
6496
6511
|
}
|
|
6497
|
-
const [s, h, t] = C.to, [y, n, w] = C.from, r =
|
|
6512
|
+
const [s, h, t] = C.to, [y, n, w] = C.from, r = ZB(s, h, t);
|
|
6498
6513
|
if (Q.length === 0) {
|
|
6499
6514
|
if (t === 1 && w === 1 && E === 1 && o === 1) {
|
|
6500
6515
|
let G = y * I, c = r * I;
|
|
@@ -6516,8 +6531,8 @@ function SI(g, A, I, B) {
|
|
|
6516
6531
|
stride: a
|
|
6517
6532
|
}, I, Q);
|
|
6518
6533
|
}
|
|
6519
|
-
let
|
|
6520
|
-
function
|
|
6534
|
+
let WI = uE();
|
|
6535
|
+
function uE() {
|
|
6521
6536
|
let g = /* @__PURE__ */ new WeakMap();
|
|
6522
6537
|
function A(I) {
|
|
6523
6538
|
let B = g.get(I) ?? { v2: 0, v3: 0 };
|
|
@@ -6533,53 +6548,53 @@ function pE() {
|
|
|
6533
6548
|
}
|
|
6534
6549
|
};
|
|
6535
6550
|
}
|
|
6536
|
-
async function
|
|
6551
|
+
async function TE(g) {
|
|
6537
6552
|
let A = await g.store.get(g.resolve(".zattrs").path);
|
|
6538
6553
|
return A ? GI(A) : {};
|
|
6539
6554
|
}
|
|
6540
|
-
async function
|
|
6555
|
+
async function xE(g, A = {}) {
|
|
6541
6556
|
let I = "store" in g ? g : new z(g), B = {};
|
|
6542
|
-
return (A.attrs ?? !0) && (B = await
|
|
6557
|
+
return (A.attrs ?? !0) && (B = await TE(I)), A.kind === "array" ? wB(I, B) : A.kind === "group" ? FB(I, B) : wB(I, B).catch((C) => (WB(C, nI), FB(I, B)));
|
|
6543
6558
|
}
|
|
6544
|
-
async function
|
|
6559
|
+
async function wB(g, A) {
|
|
6545
6560
|
let { path: I } = g.resolve(".zarray"), B = await g.store.get(I);
|
|
6546
6561
|
if (!B)
|
|
6547
6562
|
throw new nI("v2 array", {
|
|
6548
6563
|
cause: new dg(I)
|
|
6549
6564
|
});
|
|
6550
|
-
return
|
|
6565
|
+
return WI.increment(g.store, "v2"), new JI(g.store, g.path, CE(GI(B), A));
|
|
6551
6566
|
}
|
|
6552
|
-
async function
|
|
6567
|
+
async function FB(g, A) {
|
|
6553
6568
|
let { path: I } = g.resolve(".zgroup"), B = await g.store.get(I);
|
|
6554
6569
|
if (!B)
|
|
6555
6570
|
throw new nI("v2 group", {
|
|
6556
6571
|
cause: new dg(I)
|
|
6557
6572
|
});
|
|
6558
|
-
return
|
|
6573
|
+
return WI.increment(g.store, "v2"), new Mg(g.store, g.path, QE(GI(B), A));
|
|
6559
6574
|
}
|
|
6560
|
-
async function
|
|
6575
|
+
async function WE(g) {
|
|
6561
6576
|
let { store: A, path: I } = g.resolve("zarr.json"), B = await g.store.get(I);
|
|
6562
6577
|
if (!B)
|
|
6563
6578
|
throw new nI("v3 array or group", {
|
|
6564
6579
|
cause: new dg(I)
|
|
6565
6580
|
});
|
|
6566
6581
|
let C = GI(B);
|
|
6567
|
-
return C.node_type === "array" && (C.fill_value =
|
|
6582
|
+
return C.node_type === "array" && (C.fill_value = xB(C)), C.node_type === "array" ? new JI(A, g.path, C) : new Mg(A, g.path, C);
|
|
6568
6583
|
}
|
|
6569
|
-
async function
|
|
6570
|
-
let I = "store" in g ? g : new z(g), B = await
|
|
6571
|
-
if (
|
|
6584
|
+
async function bE(g, A = {}) {
|
|
6585
|
+
let I = "store" in g ? g : new z(g), B = await WE(I);
|
|
6586
|
+
if (WI.increment(I.store, "v3"), A.kind === void 0 || A.kind === "array" && B instanceof JI || A.kind === "group" && B instanceof Mg)
|
|
6572
6587
|
return B;
|
|
6573
|
-
let C = B instanceof
|
|
6588
|
+
let C = B instanceof JI ? "array" : "group";
|
|
6574
6589
|
throw new Error(`Expected node of kind ${A.kind}, found ${C}.`);
|
|
6575
6590
|
}
|
|
6576
6591
|
async function IA(g, A = {}) {
|
|
6577
|
-
let I = "store" in g ? g.store : g, B =
|
|
6578
|
-
return C(g, A).catch((E) => (
|
|
6592
|
+
let I = "store" in g ? g.store : g, B = WI.version_max(I), C = B === "v2" ? IA.v2 : IA.v3, Q = B === "v2" ? IA.v3 : IA.v2;
|
|
6593
|
+
return C(g, A).catch((E) => (WB(E, nI), Q(g, A)));
|
|
6579
6594
|
}
|
|
6580
|
-
IA.v2 =
|
|
6581
|
-
IA.v3 =
|
|
6582
|
-
async function
|
|
6595
|
+
IA.v2 = xE;
|
|
6596
|
+
IA.v3 = bE;
|
|
6597
|
+
async function ZE(g, A) {
|
|
6583
6598
|
const I = A.split("/"), B = I.pop();
|
|
6584
6599
|
if (!B)
|
|
6585
6600
|
throw new Error("Invalid path");
|
|
@@ -6596,7 +6611,7 @@ class qg {
|
|
|
6596
6611
|
return this.#A;
|
|
6597
6612
|
}
|
|
6598
6613
|
async get(A) {
|
|
6599
|
-
const I = await
|
|
6614
|
+
const I = await ZE(this.#A, A.slice(1)).catch(
|
|
6600
6615
|
() => {
|
|
6601
6616
|
}
|
|
6602
6617
|
);
|
|
@@ -6606,7 +6621,7 @@ class qg {
|
|
|
6606
6621
|
return new Uint8Array(C);
|
|
6607
6622
|
}
|
|
6608
6623
|
}
|
|
6609
|
-
function
|
|
6624
|
+
function PE() {
|
|
6610
6625
|
if (typeof window > "u")
|
|
6611
6626
|
return;
|
|
6612
6627
|
const g = window.location.hostname;
|
|
@@ -6623,7 +6638,7 @@ class lg extends PA {
|
|
|
6623
6638
|
overrides;
|
|
6624
6639
|
useSuffixRequest;
|
|
6625
6640
|
constructor(A) {
|
|
6626
|
-
|
|
6641
|
+
PE(), super(A.url, {
|
|
6627
6642
|
overrides: A.overrides,
|
|
6628
6643
|
useSuffixRequest: A.useSuffixRequest
|
|
6629
6644
|
}), this.credentials = A.credentials, this.region = A.region, this.overrides = A.overrides, this.useSuffixRequest = A.useSuffixRequest;
|
|
@@ -6761,7 +6776,7 @@ async function wI(g, A) {
|
|
|
6761
6776
|
throw new Error(`Failed to open Zarr group at ${g}`);
|
|
6762
6777
|
}
|
|
6763
6778
|
}
|
|
6764
|
-
async function
|
|
6779
|
+
async function OE(g, A) {
|
|
6765
6780
|
if (A === "v2")
|
|
6766
6781
|
try {
|
|
6767
6782
|
return IA.v2(g, { kind: "array", attrs: !1 });
|
|
@@ -6780,7 +6795,7 @@ async function ZE(g, A) {
|
|
|
6780
6795
|
throw new Error(`Failed to open Zarr array at ${g}`);
|
|
6781
6796
|
}
|
|
6782
6797
|
}
|
|
6783
|
-
async function
|
|
6798
|
+
async function VE(g) {
|
|
6784
6799
|
let A;
|
|
6785
6800
|
switch (g.type) {
|
|
6786
6801
|
case "fetch": {
|
|
@@ -6806,9 +6821,9 @@ async function PE(g) {
|
|
|
6806
6821
|
}
|
|
6807
6822
|
}
|
|
6808
6823
|
const I = g.arrayPath ? A.resolve(g.arrayPath) : A;
|
|
6809
|
-
return
|
|
6824
|
+
return OE(I, g.zarrVersion);
|
|
6810
6825
|
}
|
|
6811
|
-
function
|
|
6826
|
+
function vE(g, A, I) {
|
|
6812
6827
|
if (g.store instanceof lg)
|
|
6813
6828
|
return {
|
|
6814
6829
|
type: "s3",
|
|
@@ -6839,7 +6854,7 @@ function OE(g, A, I) {
|
|
|
6839
6854
|
`Unsupported store type: ${g.store.constructor.name}`
|
|
6840
6855
|
);
|
|
6841
6856
|
}
|
|
6842
|
-
const
|
|
6857
|
+
const PB = `function Bg(i, A, g, E = {}) {
|
|
6843
6858
|
return A !== void 0 && g !== void 0 && (E = {
|
|
6844
6859
|
...E,
|
|
6845
6860
|
headers: {
|
|
@@ -9982,11 +9997,11 @@ return ret;
|
|
|
9982
9997
|
default: FB
|
|
9983
9998
|
});
|
|
9984
9999
|
//# sourceMappingURL=worker_kernel-uaRPnPAm.js.map
|
|
9985
|
-
`,
|
|
9986
|
-
function
|
|
10000
|
+
`, rB = typeof self < "u" && self.Blob && new Blob(["URL.revokeObjectURL(import.meta.url);", PB], { type: "text/javascript;charset=utf-8" });
|
|
10001
|
+
function XE(g) {
|
|
9987
10002
|
let A;
|
|
9988
10003
|
try {
|
|
9989
|
-
if (A =
|
|
10004
|
+
if (A = rB && (self.URL || self.webkitURL).createObjectURL(rB), !A) throw "";
|
|
9990
10005
|
const I = new Worker(A, {
|
|
9991
10006
|
type: "module",
|
|
9992
10007
|
name: g?.name
|
|
@@ -9996,7 +10011,7 @@ function VE(g) {
|
|
|
9996
10011
|
}), I;
|
|
9997
10012
|
} catch {
|
|
9998
10013
|
return new Worker(
|
|
9999
|
-
"data:text/javascript;charset=utf-8," + encodeURIComponent(
|
|
10014
|
+
"data:text/javascript;charset=utf-8," + encodeURIComponent(PB),
|
|
10000
10015
|
{
|
|
10001
10016
|
type: "module",
|
|
10002
10017
|
name: g?.name
|
|
@@ -10004,20 +10019,20 @@ function VE(g) {
|
|
|
10004
10019
|
);
|
|
10005
10020
|
}
|
|
10006
10021
|
}
|
|
10007
|
-
const
|
|
10008
|
-
let CA = [],
|
|
10009
|
-
const kA = /* @__PURE__ */ new Map(),
|
|
10010
|
-
function
|
|
10022
|
+
const jE = Math.min(navigator.hardwareConcurrency, 8);
|
|
10023
|
+
let CA = [], zE = 0, OB = 0;
|
|
10024
|
+
const kA = /* @__PURE__ */ new Map(), dI = /* @__PURE__ */ new Set();
|
|
10025
|
+
function VB(g) {
|
|
10011
10026
|
const A = CA.find((I) => I.worker === g);
|
|
10012
10027
|
return A || U.error(
|
|
10013
10028
|
"ZarrWorker",
|
|
10014
10029
|
"Worker not found in pool - this should not happen"
|
|
10015
10030
|
), A;
|
|
10016
10031
|
}
|
|
10017
|
-
function
|
|
10032
|
+
function _E(g, A) {
|
|
10018
10033
|
const { id: I, success: B } = g.data, C = kA.get(I);
|
|
10019
10034
|
if (!C) {
|
|
10020
|
-
|
|
10035
|
+
dI.has(I) ? dI.delete(I) : U.warn(
|
|
10021
10036
|
"ZarrWorker",
|
|
10022
10037
|
`Received response for unknown message ID ${I}:`,
|
|
10023
10038
|
g.data
|
|
@@ -10025,13 +10040,13 @@ function jE(g, A) {
|
|
|
10025
10040
|
return;
|
|
10026
10041
|
}
|
|
10027
10042
|
kA.delete(I), C.abortListener && C.abortSignal && C.abortSignal.removeEventListener("abort", C.abortListener);
|
|
10028
|
-
const Q =
|
|
10043
|
+
const Q = VB(A);
|
|
10029
10044
|
Q && Q.pendingCount > 0 ? Q.pendingCount-- : Q && U.error(
|
|
10030
10045
|
"ZarrWorker",
|
|
10031
10046
|
"Received message but no pending tasks - this should not happen"
|
|
10032
10047
|
), B && g.data.type === "getChunk" ? C.resolve(g.data.chunk) : B || C.reject(new Error(g.data.error || "Unknown worker error"));
|
|
10033
10048
|
}
|
|
10034
|
-
function
|
|
10049
|
+
function SB(g, A) {
|
|
10035
10050
|
if (g instanceof MessageEvent) {
|
|
10036
10051
|
U.error(
|
|
10037
10052
|
"ZarrWorker",
|
|
@@ -10044,7 +10059,7 @@ function NB(g, A) {
|
|
|
10044
10059
|
"Worker failed - replacing worker and canceling its in-flight messages",
|
|
10045
10060
|
g.message
|
|
10046
10061
|
);
|
|
10047
|
-
const I =
|
|
10062
|
+
const I = VB(A);
|
|
10048
10063
|
if (I) {
|
|
10049
10064
|
const C = CA.indexOf(I);
|
|
10050
10065
|
CA.splice(C, 1);
|
|
@@ -10054,31 +10069,31 @@ function NB(g, A) {
|
|
|
10054
10069
|
for (const [C, Q] of kA.entries())
|
|
10055
10070
|
Q.workerId === B && (Q.reject(new Error(`Worker error: ${g.message}`)), kA.delete(C));
|
|
10056
10071
|
try {
|
|
10057
|
-
const C =
|
|
10072
|
+
const C = vB();
|
|
10058
10073
|
CA.push({
|
|
10059
10074
|
worker: C,
|
|
10060
10075
|
pendingCount: 0,
|
|
10061
|
-
workerId:
|
|
10076
|
+
workerId: OB++
|
|
10062
10077
|
}), U.debug("ZarrWorker", "Replacement worker created successfully");
|
|
10063
10078
|
} catch (C) {
|
|
10064
10079
|
U.error("ZarrWorker", "Failed to create replacement worker", C);
|
|
10065
10080
|
}
|
|
10066
10081
|
}
|
|
10067
|
-
function
|
|
10068
|
-
const g = new
|
|
10069
|
-
return g.addEventListener("message", (A) =>
|
|
10082
|
+
function vB() {
|
|
10083
|
+
const g = new XE();
|
|
10084
|
+
return g.addEventListener("message", (A) => _E(A, g)), g.addEventListener("error", (A) => SB(A, g)), g.addEventListener(
|
|
10070
10085
|
"messageerror",
|
|
10071
|
-
(A) =>
|
|
10086
|
+
(A) => SB(A, g)
|
|
10072
10087
|
), g;
|
|
10073
10088
|
}
|
|
10074
|
-
function
|
|
10089
|
+
function $E() {
|
|
10075
10090
|
if (CA.length === 0)
|
|
10076
10091
|
throw new Error("Worker pool is not initialized");
|
|
10077
10092
|
return CA.sort((g, A) => g.pendingCount - A.pendingCount)[0];
|
|
10078
10093
|
}
|
|
10079
|
-
async function
|
|
10094
|
+
async function Ai(g, A, I) {
|
|
10080
10095
|
return new Promise((B, C) => {
|
|
10081
|
-
const Q =
|
|
10096
|
+
const Q = $E(), E = zE++, i = {
|
|
10082
10097
|
resolve: B,
|
|
10083
10098
|
reject: C,
|
|
10084
10099
|
workerId: Q.workerId
|
|
@@ -10088,10 +10103,10 @@ async function _E(g, A, I) {
|
|
|
10088
10103
|
Q.worker.postMessage({
|
|
10089
10104
|
id: E,
|
|
10090
10105
|
type: "cancel"
|
|
10091
|
-
}), kA.delete(E),
|
|
10106
|
+
}), kA.delete(E), dI.add(E), Q.pendingCount--, C(new DOMException("Operation was aborted", "AbortError"));
|
|
10092
10107
|
};
|
|
10093
10108
|
if (I.signal.aborted) {
|
|
10094
|
-
o(),
|
|
10109
|
+
o(), dI.delete(E);
|
|
10095
10110
|
return;
|
|
10096
10111
|
}
|
|
10097
10112
|
I.signal.addEventListener("abort", o, { once: !0 }), i.abortListener = o, i.abortSignal = I.signal;
|
|
@@ -10104,15 +10119,15 @@ async function _E(g, A, I) {
|
|
|
10104
10119
|
});
|
|
10105
10120
|
});
|
|
10106
10121
|
}
|
|
10107
|
-
function
|
|
10122
|
+
function Ii() {
|
|
10108
10123
|
if (!(CA.length > 0))
|
|
10109
10124
|
try {
|
|
10110
|
-
for (let g = 0; g <
|
|
10111
|
-
const A =
|
|
10125
|
+
for (let g = 0; g < jE; g++) {
|
|
10126
|
+
const A = vB();
|
|
10112
10127
|
CA.push({
|
|
10113
10128
|
worker: A,
|
|
10114
10129
|
pendingCount: 0,
|
|
10115
|
-
workerId:
|
|
10130
|
+
workerId: OB++
|
|
10116
10131
|
});
|
|
10117
10132
|
}
|
|
10118
10133
|
U.debug(
|
|
@@ -10120,26 +10135,26 @@ function $E() {
|
|
|
10120
10135
|
`Initialized worker pool with ${CA.length} workers`
|
|
10121
10136
|
);
|
|
10122
10137
|
} catch {
|
|
10123
|
-
U.warn("ZarrWorker", "Failed to create workers - clearing pool"),
|
|
10138
|
+
U.warn("ZarrWorker", "Failed to create workers - clearing pool"), Bi();
|
|
10124
10139
|
return;
|
|
10125
10140
|
}
|
|
10126
10141
|
}
|
|
10127
|
-
async function
|
|
10128
|
-
|
|
10142
|
+
async function gi(g, A, I, B) {
|
|
10143
|
+
Ii();
|
|
10129
10144
|
try {
|
|
10130
|
-
return await
|
|
10145
|
+
return await Ai(A, I, B);
|
|
10131
10146
|
} catch (C) {
|
|
10132
10147
|
if (C instanceof DOMException && C.name === "AbortError")
|
|
10133
10148
|
throw C;
|
|
10134
10149
|
return U.warn("ZarrWorker", "Falling back to main thread", C), await g.getChunk(I, B);
|
|
10135
10150
|
}
|
|
10136
10151
|
}
|
|
10137
|
-
function
|
|
10152
|
+
function Bi() {
|
|
10138
10153
|
for (const g of CA)
|
|
10139
10154
|
g.worker.terminate();
|
|
10140
10155
|
CA = [], kA.clear();
|
|
10141
10156
|
}
|
|
10142
|
-
class
|
|
10157
|
+
class Ci {
|
|
10143
10158
|
promises_ = [];
|
|
10144
10159
|
scheduler_;
|
|
10145
10160
|
constructor(A) {
|
|
@@ -10152,13 +10167,13 @@ class gi {
|
|
|
10152
10167
|
return Promise.all(this.promises_.map((A) => this.scheduler_.submit(A)));
|
|
10153
10168
|
}
|
|
10154
10169
|
}
|
|
10155
|
-
class
|
|
10170
|
+
class Qi {
|
|
10156
10171
|
metadata_;
|
|
10157
10172
|
arrays_;
|
|
10158
10173
|
arrayParams_;
|
|
10159
10174
|
dimensions_;
|
|
10160
10175
|
constructor(A) {
|
|
10161
|
-
this.metadata_ = A.metadata, this.arrays_ = A.arrays, this.arrayParams_ = A.arrayParams, this.dimensions_ =
|
|
10176
|
+
this.metadata_ = A.metadata, this.arrays_ = A.arrays, this.arrayParams_ = A.arrayParams, this.dimensions_ = Ei(this.metadata_, this.arrays_);
|
|
10162
10177
|
}
|
|
10163
10178
|
getSourceDimensionMap() {
|
|
10164
10179
|
return this.dimensions_;
|
|
@@ -10166,14 +10181,14 @@ class Bi {
|
|
|
10166
10181
|
async loadChunkData(A, I) {
|
|
10167
10182
|
const B = [];
|
|
10168
10183
|
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);
|
|
10169
|
-
const C = this.arrays_[A.lod], Q = this.arrayParams_[A.lod], E = await
|
|
10184
|
+
const C = this.arrays_[A.lod], Q = this.arrayParams_[A.lod], E = await gi(C, Q, B, {
|
|
10170
10185
|
signal: I
|
|
10171
10186
|
});
|
|
10172
10187
|
if (!zg(E.data))
|
|
10173
10188
|
throw new Error(
|
|
10174
10189
|
`Received chunk has an unsupported data type, data=${E.data.constructor.name}`
|
|
10175
10190
|
);
|
|
10176
|
-
|
|
10191
|
+
NB(E);
|
|
10177
10192
|
const i = {
|
|
10178
10193
|
x: E.shape[this.dimensions_.x.index],
|
|
10179
10194
|
y: E.shape[this.dimensions_.y.index],
|
|
@@ -10216,15 +10231,15 @@ class Bi {
|
|
|
10216
10231
|
const C = this.regionToIndices(A, I), Q = this.arrays_[I];
|
|
10217
10232
|
let E = {};
|
|
10218
10233
|
B !== void 0 && (E = {
|
|
10219
|
-
create_queue: () => new
|
|
10234
|
+
create_queue: () => new Ci(B),
|
|
10220
10235
|
opts: { signal: B.abortSignal }
|
|
10221
10236
|
});
|
|
10222
|
-
const i = await
|
|
10237
|
+
const i = await mE(Q, C, E);
|
|
10223
10238
|
if (!zg(i.data))
|
|
10224
10239
|
throw new Error(
|
|
10225
10240
|
`Subarray has an unsupported data type, data=${i.data.constructor.name}`
|
|
10226
10241
|
);
|
|
10227
|
-
if (
|
|
10242
|
+
if (NB(i), i.shape.length !== 2 && i.shape.length !== 3)
|
|
10228
10243
|
throw new Error(
|
|
10229
10244
|
`Expected to receive a 2D or 3D subarray. Instead chunk has shape ${i.shape}`
|
|
10230
10245
|
);
|
|
@@ -10267,13 +10282,13 @@ class Bi {
|
|
|
10267
10282
|
this.dimensions_.t
|
|
10268
10283
|
].filter((Q) => Q !== void 0).sort((Q, E) => Q.index - E.index), C = [];
|
|
10269
10284
|
for (const Q of B) {
|
|
10270
|
-
const E = A.find((s) =>
|
|
10285
|
+
const E = A.find((s) => XB(s.dimension, Q.name));
|
|
10271
10286
|
if (!E)
|
|
10272
10287
|
throw new Error(`Region does not contain a slice for ${Q.name}`);
|
|
10273
10288
|
const i = Q.lods[I];
|
|
10274
10289
|
let o;
|
|
10275
10290
|
const a = E.index;
|
|
10276
|
-
a.type === "full" ? o =
|
|
10291
|
+
a.type === "full" ? o = YI(null) : a.type === "point" ? o = Math.round((a.value - i.translation) / i.scale) : o = YI(
|
|
10277
10292
|
Math.floor((a.start - i.translation) / i.scale),
|
|
10278
10293
|
Math.ceil((a.stop - i.translation) / i.scale)
|
|
10279
10294
|
), C.push(o);
|
|
@@ -10281,8 +10296,8 @@ class Bi {
|
|
|
10281
10296
|
return C;
|
|
10282
10297
|
}
|
|
10283
10298
|
}
|
|
10284
|
-
function
|
|
10285
|
-
const I = g.axes.map((h) => h.name), B = g.axes.length, C =
|
|
10299
|
+
function Ei(g, A) {
|
|
10300
|
+
const I = g.axes.map((h) => h.name), B = g.axes.length, C = RB(I, "x"), Q = RB(I, "y"), E = (h, t) => {
|
|
10286
10301
|
const y = [];
|
|
10287
10302
|
for (let n = 0; n < g.datasets.length; n++) {
|
|
10288
10303
|
const w = g.datasets[n], r = A[n], G = w.coordinateTransformations[0].scale, c = w.coordinateTransformations.length === 2 ? w.coordinateTransformations[1].translation : new Array(B).fill(0);
|
|
@@ -10310,10 +10325,10 @@ function Ci(g, A) {
|
|
|
10310
10325
|
const s = RI(I, "t");
|
|
10311
10326
|
return s !== -1 && (i.t = E(I[s], s)), i;
|
|
10312
10327
|
}
|
|
10313
|
-
function
|
|
10328
|
+
function XB(g, A) {
|
|
10314
10329
|
return g.toLowerCase() === A.toLowerCase();
|
|
10315
10330
|
}
|
|
10316
|
-
function
|
|
10331
|
+
function RB(g, A) {
|
|
10317
10332
|
const I = RI(g, A);
|
|
10318
10333
|
if (I === -1)
|
|
10319
10334
|
throw new Error(
|
|
@@ -10322,9 +10337,9 @@ function cB(g, A) {
|
|
|
10322
10337
|
return I;
|
|
10323
10338
|
}
|
|
10324
10339
|
function RI(g, A) {
|
|
10325
|
-
return g.findIndex((I) =>
|
|
10340
|
+
return g.findIndex((I) => XB(I, A));
|
|
10326
10341
|
}
|
|
10327
|
-
function
|
|
10342
|
+
function NB(g) {
|
|
10328
10343
|
let A = 1;
|
|
10329
10344
|
for (let I = g.shape.length - 1; I >= 0; I--) {
|
|
10330
10345
|
if (g.stride[I] !== A)
|
|
@@ -10437,7 +10452,7 @@ const S = H.arrayToEnum([
|
|
|
10437
10452
|
"invalid_intersection_types",
|
|
10438
10453
|
"not_multiple_of",
|
|
10439
10454
|
"not_finite"
|
|
10440
|
-
]),
|
|
10455
|
+
]), ii = (g) => JSON.stringify(g, null, 2).replace(/"([^"]+)":/g, "$1:");
|
|
10441
10456
|
class $ extends Error {
|
|
10442
10457
|
get errors() {
|
|
10443
10458
|
return this.issues;
|
|
@@ -10554,14 +10569,14 @@ const uA = (g, A) => {
|
|
|
10554
10569
|
}
|
|
10555
10570
|
return { message: I };
|
|
10556
10571
|
};
|
|
10557
|
-
let
|
|
10558
|
-
function
|
|
10559
|
-
|
|
10572
|
+
let jB = uA;
|
|
10573
|
+
function oi(g) {
|
|
10574
|
+
jB = g;
|
|
10560
10575
|
}
|
|
10561
|
-
function
|
|
10562
|
-
return
|
|
10576
|
+
function MI() {
|
|
10577
|
+
return jB;
|
|
10563
10578
|
}
|
|
10564
|
-
const
|
|
10579
|
+
const KI = (g) => {
|
|
10565
10580
|
const { data: A, path: I, errorMaps: B, issueData: C } = g, Q = [...I, ...C.path || []], E = {
|
|
10566
10581
|
...C,
|
|
10567
10582
|
path: Q
|
|
@@ -10581,9 +10596,9 @@ const HI = (g) => {
|
|
|
10581
10596
|
path: Q,
|
|
10582
10597
|
message: i
|
|
10583
10598
|
};
|
|
10584
|
-
},
|
|
10599
|
+
}, ai = [];
|
|
10585
10600
|
function F(g, A) {
|
|
10586
|
-
const I =
|
|
10601
|
+
const I = MI(), B = KI({
|
|
10587
10602
|
issueData: A,
|
|
10588
10603
|
data: g.data,
|
|
10589
10604
|
path: g.path,
|
|
@@ -10644,11 +10659,11 @@ class X {
|
|
|
10644
10659
|
const Y = Object.freeze({
|
|
10645
10660
|
status: "aborted"
|
|
10646
10661
|
}), KA = (g) => ({ status: "dirty", value: g }), j = (g) => ({ status: "valid", value: g }), Dg = (g) => g.status === "aborted", hg = (g) => g.status === "dirty", LA = (g) => g.status === "valid", II = (g) => typeof Promise < "u" && g instanceof Promise;
|
|
10647
|
-
function
|
|
10662
|
+
function HI(g, A, I, B) {
|
|
10648
10663
|
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");
|
|
10649
10664
|
return A.get(g);
|
|
10650
10665
|
}
|
|
10651
|
-
function
|
|
10666
|
+
function zB(g, A, I, B, C) {
|
|
10652
10667
|
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");
|
|
10653
10668
|
return A.set(g, I), I;
|
|
10654
10669
|
}
|
|
@@ -10665,7 +10680,7 @@ class sA {
|
|
|
10665
10680
|
return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath;
|
|
10666
10681
|
}
|
|
10667
10682
|
}
|
|
10668
|
-
const
|
|
10683
|
+
const cB = (g, A) => {
|
|
10669
10684
|
if (LA(A))
|
|
10670
10685
|
return { success: !0, data: A.value };
|
|
10671
10686
|
if (!g.common.issues.length)
|
|
@@ -10752,7 +10767,7 @@ class K {
|
|
|
10752
10767
|
data: A,
|
|
10753
10768
|
parsedType: tA(A)
|
|
10754
10769
|
}, Q = this._parseSync({ data: A, path: C.path, parent: C });
|
|
10755
|
-
return
|
|
10770
|
+
return cB(C, Q);
|
|
10756
10771
|
}
|
|
10757
10772
|
"~validate"(A) {
|
|
10758
10773
|
var I, B;
|
|
@@ -10806,7 +10821,7 @@ class K {
|
|
|
10806
10821
|
data: A,
|
|
10807
10822
|
parsedType: tA(A)
|
|
10808
10823
|
}, C = this._parse({ data: A, path: B.path, parent: B }), Q = await (II(C) ? C : Promise.resolve(C));
|
|
10809
|
-
return
|
|
10824
|
+
return cB(B, Q);
|
|
10810
10825
|
}
|
|
10811
10826
|
refine(A, I) {
|
|
10812
10827
|
const B = (C) => typeof I == "string" || typeof I > "u" ? { message: I } : typeof I == "function" ? I(C) : I;
|
|
@@ -10912,26 +10927,26 @@ class K {
|
|
|
10912
10927
|
return this.safeParse(null).success;
|
|
10913
10928
|
}
|
|
10914
10929
|
}
|
|
10915
|
-
const
|
|
10916
|
-
let
|
|
10917
|
-
const
|
|
10918
|
-
function
|
|
10930
|
+
const si = /^c[^\s-]{8,}$/i, Di = /^[0-9a-z]+$/, hi = /^[0-9A-HJKMNP-TV-Z]{26}$/i, ti = /^[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, yi = /^[a-z0-9_-]{21}$/i, ei = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, Gi = /^[-+]?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)?)??$/, ni = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, wi = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
|
|
10931
|
+
let Bg;
|
|
10932
|
+
const Fi = /^(?:(?: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])$/, ri = /^(?:(?: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])$/, Si = /^(([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]))$/, Ri = /^(([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])$/, Ni = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, ci = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, _B = "((\\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])))", Ui = new RegExp(`^${_B}$`);
|
|
10933
|
+
function $B(g) {
|
|
10919
10934
|
let A = "([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";
|
|
10920
10935
|
return g.precision ? A = `${A}\\.\\d{${g.precision}}` : g.precision == null && (A = `${A}(\\.\\d+)?`), A;
|
|
10921
10936
|
}
|
|
10922
|
-
function
|
|
10923
|
-
return new RegExp(`^${
|
|
10937
|
+
function ki(g) {
|
|
10938
|
+
return new RegExp(`^${$B(g)}$`);
|
|
10924
10939
|
}
|
|
10925
|
-
function
|
|
10926
|
-
let A = `${
|
|
10940
|
+
function AC(g) {
|
|
10941
|
+
let A = `${_B}T${$B(g)}`;
|
|
10927
10942
|
const I = [];
|
|
10928
10943
|
return I.push(g.local ? "Z?" : "Z"), g.offset && I.push("([+-]\\d{2}:?\\d{2})"), A = `${A}(${I.join("|")})`, new RegExp(`^${A}$`);
|
|
10929
10944
|
}
|
|
10930
|
-
function
|
|
10931
|
-
return !!((A === "v4" || !A) &&
|
|
10945
|
+
function Li(g, A) {
|
|
10946
|
+
return !!((A === "v4" || !A) && Fi.test(g) || (A === "v6" || !A) && Si.test(g));
|
|
10932
10947
|
}
|
|
10933
|
-
function
|
|
10934
|
-
if (!
|
|
10948
|
+
function Ji(g, A) {
|
|
10949
|
+
if (!ei.test(g))
|
|
10935
10950
|
return !1;
|
|
10936
10951
|
try {
|
|
10937
10952
|
const [I] = g.split("."), B = I.replace(/-/g, "+").replace(/_/g, "/").padEnd(I.length + (4 - I.length % 4) % 4, "="), C = JSON.parse(atob(B));
|
|
@@ -10940,8 +10955,8 @@ function ki(g, A) {
|
|
|
10940
10955
|
return !1;
|
|
10941
10956
|
}
|
|
10942
10957
|
}
|
|
10943
|
-
function
|
|
10944
|
-
return !!((A === "v4" || !A) &&
|
|
10958
|
+
function Yi(g, A) {
|
|
10959
|
+
return !!((A === "v4" || !A) && ri.test(g) || (A === "v6" || !A) && Ri.test(g));
|
|
10945
10960
|
}
|
|
10946
10961
|
class gA extends K {
|
|
10947
10962
|
_parse(A) {
|
|
@@ -10992,43 +11007,43 @@ class gA extends K {
|
|
|
10992
11007
|
message: Q.message
|
|
10993
11008
|
}), B.dirty());
|
|
10994
11009
|
} else if (Q.kind === "email")
|
|
10995
|
-
|
|
11010
|
+
ni.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
|
|
10996
11011
|
validation: "email",
|
|
10997
11012
|
code: e.invalid_string,
|
|
10998
11013
|
message: Q.message
|
|
10999
11014
|
}), B.dirty());
|
|
11000
11015
|
else if (Q.kind === "emoji")
|
|
11001
|
-
|
|
11016
|
+
Bg || (Bg = new RegExp(wi, "u")), Bg.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
|
|
11002
11017
|
validation: "emoji",
|
|
11003
11018
|
code: e.invalid_string,
|
|
11004
11019
|
message: Q.message
|
|
11005
11020
|
}), B.dirty());
|
|
11006
11021
|
else if (Q.kind === "uuid")
|
|
11007
|
-
|
|
11022
|
+
ti.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
|
|
11008
11023
|
validation: "uuid",
|
|
11009
11024
|
code: e.invalid_string,
|
|
11010
11025
|
message: Q.message
|
|
11011
11026
|
}), B.dirty());
|
|
11012
11027
|
else if (Q.kind === "nanoid")
|
|
11013
|
-
|
|
11028
|
+
yi.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
|
|
11014
11029
|
validation: "nanoid",
|
|
11015
11030
|
code: e.invalid_string,
|
|
11016
11031
|
message: Q.message
|
|
11017
11032
|
}), B.dirty());
|
|
11018
11033
|
else if (Q.kind === "cuid")
|
|
11019
|
-
|
|
11034
|
+
si.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
|
|
11020
11035
|
validation: "cuid",
|
|
11021
11036
|
code: e.invalid_string,
|
|
11022
11037
|
message: Q.message
|
|
11023
11038
|
}), B.dirty());
|
|
11024
11039
|
else if (Q.kind === "cuid2")
|
|
11025
|
-
|
|
11040
|
+
Di.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
|
|
11026
11041
|
validation: "cuid2",
|
|
11027
11042
|
code: e.invalid_string,
|
|
11028
11043
|
message: Q.message
|
|
11029
11044
|
}), B.dirty());
|
|
11030
11045
|
else if (Q.kind === "ulid")
|
|
11031
|
-
|
|
11046
|
+
hi.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
|
|
11032
11047
|
validation: "ulid",
|
|
11033
11048
|
code: e.invalid_string,
|
|
11034
11049
|
message: Q.message
|
|
@@ -11059,39 +11074,39 @@ class gA extends K {
|
|
|
11059
11074
|
code: e.invalid_string,
|
|
11060
11075
|
validation: { endsWith: Q.value },
|
|
11061
11076
|
message: Q.message
|
|
11062
|
-
}), B.dirty()) : Q.kind === "datetime" ?
|
|
11077
|
+
}), B.dirty()) : Q.kind === "datetime" ? AC(Q).test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
|
|
11063
11078
|
code: e.invalid_string,
|
|
11064
11079
|
validation: "datetime",
|
|
11065
11080
|
message: Q.message
|
|
11066
|
-
}), B.dirty()) : Q.kind === "date" ?
|
|
11081
|
+
}), B.dirty()) : Q.kind === "date" ? Ui.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
|
|
11067
11082
|
code: e.invalid_string,
|
|
11068
11083
|
validation: "date",
|
|
11069
11084
|
message: Q.message
|
|
11070
|
-
}), B.dirty()) : Q.kind === "time" ?
|
|
11085
|
+
}), B.dirty()) : Q.kind === "time" ? ki(Q).test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
|
|
11071
11086
|
code: e.invalid_string,
|
|
11072
11087
|
validation: "time",
|
|
11073
11088
|
message: Q.message
|
|
11074
|
-
}), B.dirty()) : Q.kind === "duration" ?
|
|
11089
|
+
}), B.dirty()) : Q.kind === "duration" ? Gi.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
|
|
11075
11090
|
validation: "duration",
|
|
11076
11091
|
code: e.invalid_string,
|
|
11077
11092
|
message: Q.message
|
|
11078
|
-
}), B.dirty()) : Q.kind === "ip" ?
|
|
11093
|
+
}), B.dirty()) : Q.kind === "ip" ? Li(A.data, Q.version) || (C = this._getOrReturnCtx(A, C), F(C, {
|
|
11079
11094
|
validation: "ip",
|
|
11080
11095
|
code: e.invalid_string,
|
|
11081
11096
|
message: Q.message
|
|
11082
|
-
}), B.dirty()) : Q.kind === "jwt" ?
|
|
11097
|
+
}), B.dirty()) : Q.kind === "jwt" ? Ji(A.data, Q.alg) || (C = this._getOrReturnCtx(A, C), F(C, {
|
|
11083
11098
|
validation: "jwt",
|
|
11084
11099
|
code: e.invalid_string,
|
|
11085
11100
|
message: Q.message
|
|
11086
|
-
}), B.dirty()) : Q.kind === "cidr" ?
|
|
11101
|
+
}), B.dirty()) : Q.kind === "cidr" ? Yi(A.data, Q.version) || (C = this._getOrReturnCtx(A, C), F(C, {
|
|
11087
11102
|
validation: "cidr",
|
|
11088
11103
|
code: e.invalid_string,
|
|
11089
11104
|
message: Q.message
|
|
11090
|
-
}), B.dirty()) : Q.kind === "base64" ?
|
|
11105
|
+
}), B.dirty()) : Q.kind === "base64" ? Ni.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
|
|
11091
11106
|
validation: "base64",
|
|
11092
11107
|
code: e.invalid_string,
|
|
11093
11108
|
message: Q.message
|
|
11094
|
-
}), B.dirty()) : Q.kind === "base64url" ?
|
|
11109
|
+
}), B.dirty()) : Q.kind === "base64url" ? ci.test(A.data) || (C = this._getOrReturnCtx(A, C), F(C, {
|
|
11095
11110
|
validation: "base64url",
|
|
11096
11111
|
code: e.invalid_string,
|
|
11097
11112
|
message: Q.message
|
|
@@ -11330,7 +11345,7 @@ gA.create = (g) => {
|
|
|
11330
11345
|
...M(g)
|
|
11331
11346
|
});
|
|
11332
11347
|
};
|
|
11333
|
-
function
|
|
11348
|
+
function di(g, A) {
|
|
11334
11349
|
const I = (g.toString().split(".")[1] || "").length, B = (A.toString().split(".")[1] || "").length, C = I > B ? I : B, Q = parseInt(g.toFixed(C).replace(".", "")), E = parseInt(A.toFixed(C).replace(".", ""));
|
|
11335
11350
|
return Q % E / Math.pow(10, C);
|
|
11336
11351
|
}
|
|
@@ -11369,7 +11384,7 @@ class eA extends K {
|
|
|
11369
11384
|
inclusive: Q.inclusive,
|
|
11370
11385
|
exact: !1,
|
|
11371
11386
|
message: Q.message
|
|
11372
|
-
}), C.dirty()) : Q.kind === "multipleOf" ?
|
|
11387
|
+
}), C.dirty()) : Q.kind === "multipleOf" ? di(A.data, Q.value) !== 0 && (B = this._getOrReturnCtx(A, B), F(B, {
|
|
11373
11388
|
code: e.not_multiple_of,
|
|
11374
11389
|
multipleOf: Q.value,
|
|
11375
11390
|
message: Q.message
|
|
@@ -11738,7 +11753,7 @@ JA.create = (g) => new JA({
|
|
|
11738
11753
|
typeName: J.ZodDate,
|
|
11739
11754
|
...M(g)
|
|
11740
11755
|
});
|
|
11741
|
-
class
|
|
11756
|
+
class qI extends K {
|
|
11742
11757
|
_parse(A) {
|
|
11743
11758
|
if (this._getType(A) !== S.symbol) {
|
|
11744
11759
|
const B = this._getOrReturnCtx(A);
|
|
@@ -11751,7 +11766,7 @@ class lI extends K {
|
|
|
11751
11766
|
return j(A.data);
|
|
11752
11767
|
}
|
|
11753
11768
|
}
|
|
11754
|
-
|
|
11769
|
+
qI.create = (g) => new qI({
|
|
11755
11770
|
typeName: J.ZodSymbol,
|
|
11756
11771
|
...M(g)
|
|
11757
11772
|
});
|
|
@@ -11827,7 +11842,7 @@ yA.create = (g) => new yA({
|
|
|
11827
11842
|
typeName: J.ZodNever,
|
|
11828
11843
|
...M(g)
|
|
11829
11844
|
});
|
|
11830
|
-
class
|
|
11845
|
+
class lI extends K {
|
|
11831
11846
|
_parse(A) {
|
|
11832
11847
|
if (this._getType(A) !== S.undefined) {
|
|
11833
11848
|
const B = this._getOrReturnCtx(A);
|
|
@@ -11840,7 +11855,7 @@ class fI extends K {
|
|
|
11840
11855
|
return j(A.data);
|
|
11841
11856
|
}
|
|
11842
11857
|
}
|
|
11843
|
-
|
|
11858
|
+
lI.create = (g) => new lI({
|
|
11844
11859
|
typeName: J.ZodVoid,
|
|
11845
11860
|
...M(g)
|
|
11846
11861
|
});
|
|
@@ -12196,7 +12211,7 @@ class m extends K {
|
|
|
12196
12211
|
});
|
|
12197
12212
|
}
|
|
12198
12213
|
keyof() {
|
|
12199
|
-
return
|
|
12214
|
+
return IC(H.objectKeys(this.shape));
|
|
12200
12215
|
}
|
|
12201
12216
|
}
|
|
12202
12217
|
m.create = (g, A) => new m({
|
|
@@ -12294,7 +12309,7 @@ QI.create = (g, A) => new QI({
|
|
|
12294
12309
|
...M(A)
|
|
12295
12310
|
});
|
|
12296
12311
|
const hA = (g) => g instanceof oI ? hA(g.schema) : g instanceof EA ? hA(g.innerType()) : g instanceof aI ? [g.value] : g instanceof nA ? g.options : g instanceof sI ? H.objectValues(g.enum) : g instanceof DI ? hA(g._def.innerType) : g instanceof BI ? [void 0] : g instanceof CI ? [null] : g instanceof aA ? [void 0, ...hA(g.unwrap())] : g instanceof wA ? [null, ...hA(g.unwrap())] : g instanceof fg || g instanceof tI ? hA(g.unwrap()) : g instanceof hI ? hA(g._def.innerType) : [];
|
|
12297
|
-
class
|
|
12312
|
+
class bI extends K {
|
|
12298
12313
|
_parse(A) {
|
|
12299
12314
|
const { ctx: I } = this._processInputParams(A);
|
|
12300
12315
|
if (I.parsedType !== S.object)
|
|
@@ -12347,7 +12362,7 @@ class ZI extends K {
|
|
|
12347
12362
|
C.set(i, Q);
|
|
12348
12363
|
}
|
|
12349
12364
|
}
|
|
12350
|
-
return new
|
|
12365
|
+
return new bI({
|
|
12351
12366
|
typeName: J.ZodDiscriminatedUnion,
|
|
12352
12367
|
discriminator: A,
|
|
12353
12368
|
options: I,
|
|
@@ -12511,7 +12526,7 @@ class iI extends K {
|
|
|
12511
12526
|
});
|
|
12512
12527
|
}
|
|
12513
12528
|
}
|
|
12514
|
-
class
|
|
12529
|
+
class fI extends K {
|
|
12515
12530
|
get keySchema() {
|
|
12516
12531
|
return this._def.keyType;
|
|
12517
12532
|
}
|
|
@@ -12553,7 +12568,7 @@ class pI extends K {
|
|
|
12553
12568
|
}
|
|
12554
12569
|
}
|
|
12555
12570
|
}
|
|
12556
|
-
|
|
12571
|
+
fI.create = (g, A, I) => new fI({
|
|
12557
12572
|
valueType: A,
|
|
12558
12573
|
keyType: g,
|
|
12559
12574
|
typeName: J.ZodMap,
|
|
@@ -12636,13 +12651,13 @@ class qA extends K {
|
|
|
12636
12651
|
received: I.parsedType
|
|
12637
12652
|
}), Y;
|
|
12638
12653
|
function B(i, o) {
|
|
12639
|
-
return
|
|
12654
|
+
return KI({
|
|
12640
12655
|
data: i,
|
|
12641
12656
|
path: I.path,
|
|
12642
12657
|
errorMaps: [
|
|
12643
12658
|
I.common.contextualErrorMap,
|
|
12644
12659
|
I.schemaErrorMap,
|
|
12645
|
-
|
|
12660
|
+
MI(),
|
|
12646
12661
|
uA
|
|
12647
12662
|
].filter((a) => !!a),
|
|
12648
12663
|
issueData: {
|
|
@@ -12652,13 +12667,13 @@ class qA extends K {
|
|
|
12652
12667
|
});
|
|
12653
12668
|
}
|
|
12654
12669
|
function C(i, o) {
|
|
12655
|
-
return
|
|
12670
|
+
return KI({
|
|
12656
12671
|
data: i,
|
|
12657
12672
|
path: I.path,
|
|
12658
12673
|
errorMaps: [
|
|
12659
12674
|
I.common.contextualErrorMap,
|
|
12660
12675
|
I.schemaErrorMap,
|
|
12661
|
-
|
|
12676
|
+
MI(),
|
|
12662
12677
|
uA
|
|
12663
12678
|
].filter((a) => !!a),
|
|
12664
12679
|
issueData: {
|
|
@@ -12759,7 +12774,7 @@ aI.create = (g, A) => new aI({
|
|
|
12759
12774
|
typeName: J.ZodLiteral,
|
|
12760
12775
|
...M(A)
|
|
12761
12776
|
});
|
|
12762
|
-
function
|
|
12777
|
+
function IC(g, A) {
|
|
12763
12778
|
return new nA({
|
|
12764
12779
|
values: g,
|
|
12765
12780
|
typeName: J.ZodEnum,
|
|
@@ -12779,7 +12794,7 @@ class nA extends K {
|
|
|
12779
12794
|
code: e.invalid_type
|
|
12780
12795
|
}), Y;
|
|
12781
12796
|
}
|
|
12782
|
-
if (
|
|
12797
|
+
if (HI(this, VA) || zB(this, VA, new Set(this._def.values)), !HI(this, VA).has(A.data)) {
|
|
12783
12798
|
const I = this._getOrReturnCtx(A), B = this._def.values;
|
|
12784
12799
|
return F(I, {
|
|
12785
12800
|
received: I.data,
|
|
@@ -12824,7 +12839,7 @@ class nA extends K {
|
|
|
12824
12839
|
}
|
|
12825
12840
|
}
|
|
12826
12841
|
VA = /* @__PURE__ */ new WeakMap();
|
|
12827
|
-
nA.create =
|
|
12842
|
+
nA.create = IC;
|
|
12828
12843
|
class sI extends K {
|
|
12829
12844
|
constructor() {
|
|
12830
12845
|
super(...arguments), vA.set(this, void 0);
|
|
@@ -12839,7 +12854,7 @@ class sI extends K {
|
|
|
12839
12854
|
code: e.invalid_type
|
|
12840
12855
|
}), Y;
|
|
12841
12856
|
}
|
|
12842
|
-
if (
|
|
12857
|
+
if (HI(this, vA) || zB(this, vA, new Set(H.getValidEnumValues(this._def.values))), !HI(this, vA).has(A.data)) {
|
|
12843
12858
|
const C = H.objectValues(I);
|
|
12844
12859
|
return F(B, {
|
|
12845
12860
|
received: B.data,
|
|
@@ -13061,7 +13076,7 @@ hI.create = (g, A) => new hI({
|
|
|
13061
13076
|
catchValue: typeof A.catch == "function" ? A.catch : () => A.catch,
|
|
13062
13077
|
...M(A)
|
|
13063
13078
|
});
|
|
13064
|
-
class
|
|
13079
|
+
class pI extends K {
|
|
13065
13080
|
_parse(A) {
|
|
13066
13081
|
if (this._getType(A) !== S.nan) {
|
|
13067
13082
|
const B = this._getOrReturnCtx(A);
|
|
@@ -13074,11 +13089,11 @@ class mI extends K {
|
|
|
13074
13089
|
return { status: "valid", value: A.data };
|
|
13075
13090
|
}
|
|
13076
13091
|
}
|
|
13077
|
-
|
|
13092
|
+
pI.create = (g) => new pI({
|
|
13078
13093
|
typeName: J.ZodNaN,
|
|
13079
13094
|
...M(g)
|
|
13080
13095
|
});
|
|
13081
|
-
const
|
|
13096
|
+
const Mi = Symbol("zod_brand");
|
|
13082
13097
|
class fg extends K {
|
|
13083
13098
|
_parse(A) {
|
|
13084
13099
|
const { ctx: I } = this._processInputParams(A), B = I.data;
|
|
@@ -13146,11 +13161,11 @@ tI.create = (g, A) => new tI({
|
|
|
13146
13161
|
typeName: J.ZodReadonly,
|
|
13147
13162
|
...M(A)
|
|
13148
13163
|
});
|
|
13149
|
-
function
|
|
13164
|
+
function UB(g, A) {
|
|
13150
13165
|
const I = typeof g == "function" ? g(A) : typeof g == "string" ? { message: g } : g;
|
|
13151
13166
|
return typeof I == "string" ? { message: I } : I;
|
|
13152
13167
|
}
|
|
13153
|
-
function
|
|
13168
|
+
function gC(g, A = {}, I) {
|
|
13154
13169
|
return g ? TA.create().superRefine((B, C) => {
|
|
13155
13170
|
var Q, E;
|
|
13156
13171
|
const i = g(B);
|
|
@@ -13158,26 +13173,26 @@ function CC(g, A = {}, I) {
|
|
|
13158
13173
|
return i.then((o) => {
|
|
13159
13174
|
var a, s;
|
|
13160
13175
|
if (!o) {
|
|
13161
|
-
const h =
|
|
13176
|
+
const h = UB(A, B), t = (s = (a = h.fatal) !== null && a !== void 0 ? a : I) !== null && s !== void 0 ? s : !0;
|
|
13162
13177
|
C.addIssue({ code: "custom", ...h, fatal: t });
|
|
13163
13178
|
}
|
|
13164
13179
|
});
|
|
13165
13180
|
if (!i) {
|
|
13166
|
-
const o =
|
|
13181
|
+
const o = UB(A, B), a = (E = (Q = o.fatal) !== null && Q !== void 0 ? Q : I) !== null && E !== void 0 ? E : !0;
|
|
13167
13182
|
C.addIssue({ code: "custom", ...o, fatal: a });
|
|
13168
13183
|
}
|
|
13169
13184
|
}) : TA.create();
|
|
13170
13185
|
}
|
|
13171
|
-
const
|
|
13186
|
+
const Ki = {
|
|
13172
13187
|
object: m.lazycreate
|
|
13173
13188
|
};
|
|
13174
13189
|
var J;
|
|
13175
13190
|
(function(g) {
|
|
13176
13191
|
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";
|
|
13177
13192
|
})(J || (J = {}));
|
|
13178
|
-
const
|
|
13193
|
+
const Hi = (g, A = {
|
|
13179
13194
|
message: `Input not instance of ${g.name}`
|
|
13180
|
-
}) =>
|
|
13195
|
+
}) => gC((I) => I instanceof g, A), BC = gA.create, CC = eA.create, qi = pI.create, li = GA.create, QC = gI.create, fi = JA.create, pi = qI.create, mi = BI.create, ui = CI.create, Ti = TA.create, xi = NA.create, Wi = yA.create, bi = lI.create, Zi = QA.create, Pi = m.create, Oi = m.strictCreate, Vi = QI.create, vi = bI.create, Xi = EI.create, ji = DA.create, zi = iI.create, _i = fI.create, $i = YA.create, Ao = qA.create, Io = oI.create, go = aI.create, Bo = nA.create, Co = sI.create, Qo = xA.create, kB = EA.create, Eo = aA.create, io = wA.create, oo = EA.createWithPreprocess, ao = FI.create, so = () => BC().optional(), Do = () => CC().optional(), ho = () => QC().optional(), to = {
|
|
13181
13196
|
string: (g) => gA.create({ ...g, coerce: !0 }),
|
|
13182
13197
|
number: (g) => eA.create({ ...g, coerce: !0 }),
|
|
13183
13198
|
boolean: (g) => gI.create({
|
|
@@ -13186,14 +13201,14 @@ const Mi = (g, A = {
|
|
|
13186
13201
|
}),
|
|
13187
13202
|
bigint: (g) => GA.create({ ...g, coerce: !0 }),
|
|
13188
13203
|
date: (g) => JA.create({ ...g, coerce: !0 })
|
|
13189
|
-
},
|
|
13204
|
+
}, yo = Y;
|
|
13190
13205
|
var D = /* @__PURE__ */ Object.freeze({
|
|
13191
13206
|
__proto__: null,
|
|
13192
13207
|
defaultErrorMap: uA,
|
|
13193
|
-
setErrorMap:
|
|
13194
|
-
getErrorMap:
|
|
13195
|
-
makeIssue:
|
|
13196
|
-
EMPTY_PATH:
|
|
13208
|
+
setErrorMap: oi,
|
|
13209
|
+
getErrorMap: MI,
|
|
13210
|
+
makeIssue: KI,
|
|
13211
|
+
EMPTY_PATH: ai,
|
|
13197
13212
|
addIssueToContext: F,
|
|
13198
13213
|
ParseStatus: X,
|
|
13199
13214
|
INVALID: Y,
|
|
@@ -13212,27 +13227,27 @@ var D = /* @__PURE__ */ Object.freeze({
|
|
|
13212
13227
|
ZodParsedType: S,
|
|
13213
13228
|
getParsedType: tA,
|
|
13214
13229
|
ZodType: K,
|
|
13215
|
-
datetimeRegex:
|
|
13230
|
+
datetimeRegex: AC,
|
|
13216
13231
|
ZodString: gA,
|
|
13217
13232
|
ZodNumber: eA,
|
|
13218
13233
|
ZodBigInt: GA,
|
|
13219
13234
|
ZodBoolean: gI,
|
|
13220
13235
|
ZodDate: JA,
|
|
13221
|
-
ZodSymbol:
|
|
13236
|
+
ZodSymbol: qI,
|
|
13222
13237
|
ZodUndefined: BI,
|
|
13223
13238
|
ZodNull: CI,
|
|
13224
13239
|
ZodAny: TA,
|
|
13225
13240
|
ZodUnknown: NA,
|
|
13226
13241
|
ZodNever: yA,
|
|
13227
|
-
ZodVoid:
|
|
13242
|
+
ZodVoid: lI,
|
|
13228
13243
|
ZodArray: QA,
|
|
13229
13244
|
ZodObject: m,
|
|
13230
13245
|
ZodUnion: QI,
|
|
13231
|
-
ZodDiscriminatedUnion:
|
|
13246
|
+
ZodDiscriminatedUnion: bI,
|
|
13232
13247
|
ZodIntersection: EI,
|
|
13233
13248
|
ZodTuple: DA,
|
|
13234
13249
|
ZodRecord: iI,
|
|
13235
|
-
ZodMap:
|
|
13250
|
+
ZodMap: fI,
|
|
13236
13251
|
ZodSet: YA,
|
|
13237
13252
|
ZodFunction: qA,
|
|
13238
13253
|
ZodLazy: oI,
|
|
@@ -13246,64 +13261,64 @@ var D = /* @__PURE__ */ Object.freeze({
|
|
|
13246
13261
|
ZodNullable: wA,
|
|
13247
13262
|
ZodDefault: DI,
|
|
13248
13263
|
ZodCatch: hI,
|
|
13249
|
-
ZodNaN:
|
|
13250
|
-
BRAND:
|
|
13264
|
+
ZodNaN: pI,
|
|
13265
|
+
BRAND: Mi,
|
|
13251
13266
|
ZodBranded: fg,
|
|
13252
13267
|
ZodPipeline: FI,
|
|
13253
13268
|
ZodReadonly: tI,
|
|
13254
|
-
custom:
|
|
13269
|
+
custom: gC,
|
|
13255
13270
|
Schema: K,
|
|
13256
13271
|
ZodSchema: K,
|
|
13257
|
-
late:
|
|
13272
|
+
late: Ki,
|
|
13258
13273
|
get ZodFirstPartyTypeKind() {
|
|
13259
13274
|
return J;
|
|
13260
13275
|
},
|
|
13261
|
-
coerce:
|
|
13262
|
-
any:
|
|
13263
|
-
array:
|
|
13264
|
-
bigint:
|
|
13265
|
-
boolean:
|
|
13266
|
-
date:
|
|
13267
|
-
discriminatedUnion:
|
|
13268
|
-
effect:
|
|
13269
|
-
enum:
|
|
13270
|
-
function:
|
|
13271
|
-
instanceof:
|
|
13272
|
-
intersection:
|
|
13273
|
-
lazy:
|
|
13274
|
-
literal:
|
|
13275
|
-
map:
|
|
13276
|
-
nan:
|
|
13277
|
-
nativeEnum:
|
|
13278
|
-
never:
|
|
13279
|
-
null:
|
|
13280
|
-
nullable:
|
|
13281
|
-
number:
|
|
13282
|
-
object:
|
|
13283
|
-
oboolean:
|
|
13284
|
-
onumber:
|
|
13285
|
-
optional:
|
|
13286
|
-
ostring:
|
|
13287
|
-
pipeline:
|
|
13288
|
-
preprocess:
|
|
13289
|
-
promise:
|
|
13290
|
-
record:
|
|
13291
|
-
set:
|
|
13292
|
-
strictObject:
|
|
13293
|
-
string:
|
|
13294
|
-
symbol:
|
|
13295
|
-
transformer:
|
|
13296
|
-
tuple:
|
|
13297
|
-
undefined:
|
|
13298
|
-
union:
|
|
13299
|
-
unknown:
|
|
13300
|
-
void:
|
|
13301
|
-
NEVER:
|
|
13276
|
+
coerce: to,
|
|
13277
|
+
any: Ti,
|
|
13278
|
+
array: Zi,
|
|
13279
|
+
bigint: li,
|
|
13280
|
+
boolean: QC,
|
|
13281
|
+
date: fi,
|
|
13282
|
+
discriminatedUnion: vi,
|
|
13283
|
+
effect: kB,
|
|
13284
|
+
enum: Bo,
|
|
13285
|
+
function: Ao,
|
|
13286
|
+
instanceof: Hi,
|
|
13287
|
+
intersection: Xi,
|
|
13288
|
+
lazy: Io,
|
|
13289
|
+
literal: go,
|
|
13290
|
+
map: _i,
|
|
13291
|
+
nan: qi,
|
|
13292
|
+
nativeEnum: Co,
|
|
13293
|
+
never: Wi,
|
|
13294
|
+
null: ui,
|
|
13295
|
+
nullable: io,
|
|
13296
|
+
number: CC,
|
|
13297
|
+
object: Pi,
|
|
13298
|
+
oboolean: ho,
|
|
13299
|
+
onumber: Do,
|
|
13300
|
+
optional: Eo,
|
|
13301
|
+
ostring: so,
|
|
13302
|
+
pipeline: ao,
|
|
13303
|
+
preprocess: oo,
|
|
13304
|
+
promise: Qo,
|
|
13305
|
+
record: zi,
|
|
13306
|
+
set: $i,
|
|
13307
|
+
strictObject: Oi,
|
|
13308
|
+
string: BC,
|
|
13309
|
+
symbol: pi,
|
|
13310
|
+
transformer: kB,
|
|
13311
|
+
tuple: ji,
|
|
13312
|
+
undefined: mi,
|
|
13313
|
+
union: Vi,
|
|
13314
|
+
unknown: xi,
|
|
13315
|
+
void: bi,
|
|
13316
|
+
NEVER: yo,
|
|
13302
13317
|
ZodIssueCode: e,
|
|
13303
|
-
quotelessJson:
|
|
13318
|
+
quotelessJson: ii,
|
|
13304
13319
|
ZodError: $
|
|
13305
13320
|
});
|
|
13306
|
-
const
|
|
13321
|
+
const eo = D.object({
|
|
13307
13322
|
/**The multiscale datasets for this image*/
|
|
13308
13323
|
multiscales: D.array(
|
|
13309
13324
|
D.object({
|
|
@@ -13431,7 +13446,7 @@ const to = D.object({
|
|
|
13431
13446
|
projection: D.string().optional()
|
|
13432
13447
|
}).optional()
|
|
13433
13448
|
}).optional()
|
|
13434
|
-
}).describe("JSON from OME-NGFF .zattrs"),
|
|
13449
|
+
}).describe("JSON from OME-NGFF .zattrs"), Go = D.object({
|
|
13435
13450
|
plate: D.object({
|
|
13436
13451
|
/**The acquisitions for this plate*/
|
|
13437
13452
|
acquisitions: D.array(
|
|
@@ -13490,7 +13505,7 @@ const to = D.object({
|
|
|
13490
13505
|
})
|
|
13491
13506
|
).min(1).describe("The wells of the plate")
|
|
13492
13507
|
}).optional()
|
|
13493
|
-
}).describe("JSON from OME-NGFF .zattrs"),
|
|
13508
|
+
}).describe("JSON from OME-NGFF .zattrs"), no = D.object({
|
|
13494
13509
|
well: D.object({
|
|
13495
13510
|
/**The fields of view for this well*/
|
|
13496
13511
|
images: D.array(
|
|
@@ -13504,7 +13519,7 @@ const to = D.object({
|
|
|
13504
13519
|
/**The version of the specification*/
|
|
13505
13520
|
version: D.literal("0.4").describe("The version of the specification").optional()
|
|
13506
13521
|
}).optional()
|
|
13507
|
-
}).describe("JSON from OME-NGFF .zattrs"),
|
|
13522
|
+
}).describe("JSON from OME-NGFF .zattrs"), wo = D.object({
|
|
13508
13523
|
/**The versioned OME-Zarr Metadata namespace*/
|
|
13509
13524
|
ome: D.object({
|
|
13510
13525
|
/**The multiscale datasets for this image*/
|
|
@@ -13634,7 +13649,7 @@ const to = D.object({
|
|
|
13634
13649
|
/**The version of the OME-Zarr Metadata*/
|
|
13635
13650
|
version: D.literal("0.5").describe("The version of the OME-Zarr Metadata")
|
|
13636
13651
|
}).describe("The versioned OME-Zarr Metadata namespace")
|
|
13637
|
-
}).describe("The zarr.json attributes key"),
|
|
13652
|
+
}).describe("The zarr.json attributes key"), Fo = D.object({
|
|
13638
13653
|
/**The versioned OME-Zarr Metadata namespace*/
|
|
13639
13654
|
ome: D.object({
|
|
13640
13655
|
plate: D.object({
|
|
@@ -13696,7 +13711,7 @@ const to = D.object({
|
|
|
13696
13711
|
/**The version of the OME-Zarr Metadata*/
|
|
13697
13712
|
version: D.literal("0.5").describe("The version of the OME-Zarr Metadata")
|
|
13698
13713
|
}).describe("The versioned OME-Zarr Metadata namespace")
|
|
13699
|
-
}).describe("The zarr.json attributes key"),
|
|
13714
|
+
}).describe("The zarr.json attributes key"), ro = D.object({
|
|
13700
13715
|
/**The versioned OME-Zarr Metadata namespace*/
|
|
13701
13716
|
ome: D.object({
|
|
13702
13717
|
well: D.object({
|
|
@@ -13715,15 +13730,15 @@ const to = D.object({
|
|
|
13715
13730
|
/**The version of the OME-Zarr Metadata*/
|
|
13716
13731
|
version: D.literal("0.5").describe("The version of the OME-Zarr Metadata")
|
|
13717
13732
|
}).describe("The versioned OME-Zarr Metadata namespace")
|
|
13718
|
-
}).describe("JSON from OME-Zarr zarr.json"),
|
|
13719
|
-
function
|
|
13733
|
+
}).describe("JSON from OME-Zarr zarr.json"), So = ["0.4", "0.5"], Ro = new Set(So);
|
|
13734
|
+
function No(g) {
|
|
13720
13735
|
if (!("ome" in g) || !(g.ome instanceof Object)) return;
|
|
13721
13736
|
const A = g.ome;
|
|
13722
|
-
if ("version" in A && typeof A.version == "string" &&
|
|
13737
|
+
if ("version" in A && typeof A.version == "string" && Ro.has(A.version))
|
|
13723
13738
|
return A.version;
|
|
13724
13739
|
}
|
|
13725
13740
|
function pg(g) {
|
|
13726
|
-
const A =
|
|
13741
|
+
const A = No(g);
|
|
13727
13742
|
return A === void 0 ? "0.4" : A;
|
|
13728
13743
|
}
|
|
13729
13744
|
function WA(g) {
|
|
@@ -13735,14 +13750,14 @@ function WA(g) {
|
|
|
13735
13750
|
return "v3";
|
|
13736
13751
|
}
|
|
13737
13752
|
}
|
|
13738
|
-
function
|
|
13753
|
+
function EC(g, A) {
|
|
13739
13754
|
const I = { ...g };
|
|
13740
13755
|
return delete I[A], I;
|
|
13741
13756
|
}
|
|
13742
|
-
async function
|
|
13757
|
+
async function Po(g, A) {
|
|
13743
13758
|
const I = new PA(g), B = new z(I), C = WA(A), Q = await wI(B, C);
|
|
13744
13759
|
try {
|
|
13745
|
-
return
|
|
13760
|
+
return co(Q.attrs);
|
|
13746
13761
|
} catch {
|
|
13747
13762
|
throw Error(
|
|
13748
13763
|
`Failed to parse OME-Zarr plate:
|
|
@@ -13750,58 +13765,58 @@ ${JSON.stringify(Q.attrs)}`
|
|
|
13750
13765
|
);
|
|
13751
13766
|
}
|
|
13752
13767
|
}
|
|
13753
|
-
function
|
|
13768
|
+
function co(g) {
|
|
13754
13769
|
switch (pg(g)) {
|
|
13755
13770
|
case "0.5":
|
|
13756
13771
|
return {
|
|
13757
|
-
...
|
|
13772
|
+
...Fo.parse(g).ome,
|
|
13758
13773
|
originalVersion: "0.5"
|
|
13759
13774
|
};
|
|
13760
13775
|
case "0.4":
|
|
13761
13776
|
return {
|
|
13762
|
-
...
|
|
13777
|
+
...Uo(Go.parse(g)).ome,
|
|
13763
13778
|
originalVersion: "0.4"
|
|
13764
13779
|
};
|
|
13765
13780
|
}
|
|
13766
13781
|
}
|
|
13767
|
-
function
|
|
13782
|
+
function Uo(g) {
|
|
13768
13783
|
if (g.plate === void 0)
|
|
13769
13784
|
throw new Error("Plate metadata is missing in OME-Zarr v0.4 plate");
|
|
13770
13785
|
return {
|
|
13771
13786
|
ome: {
|
|
13772
|
-
plate:
|
|
13787
|
+
plate: EC(g.plate, "version"),
|
|
13773
13788
|
version: "0.5"
|
|
13774
13789
|
}
|
|
13775
13790
|
};
|
|
13776
13791
|
}
|
|
13777
|
-
function
|
|
13792
|
+
function ko(g) {
|
|
13778
13793
|
if (g.well === void 0)
|
|
13779
13794
|
throw new Error("Well metadata is missing in OME-Zarr v0.4 well");
|
|
13780
13795
|
return {
|
|
13781
13796
|
ome: {
|
|
13782
|
-
well:
|
|
13797
|
+
well: EC(g.well, "version"),
|
|
13783
13798
|
version: "0.5"
|
|
13784
13799
|
}
|
|
13785
13800
|
};
|
|
13786
13801
|
}
|
|
13787
|
-
function
|
|
13802
|
+
function Lo(g) {
|
|
13788
13803
|
switch (pg(g)) {
|
|
13789
13804
|
case "0.5":
|
|
13790
13805
|
return {
|
|
13791
|
-
...
|
|
13806
|
+
...ro.parse(g).ome,
|
|
13792
13807
|
originalVersion: "0.5"
|
|
13793
13808
|
};
|
|
13794
13809
|
case "0.4":
|
|
13795
13810
|
return {
|
|
13796
|
-
...
|
|
13811
|
+
...ko(no.parse(g)).ome,
|
|
13797
13812
|
originalVersion: "0.4"
|
|
13798
13813
|
};
|
|
13799
13814
|
}
|
|
13800
13815
|
}
|
|
13801
|
-
async function
|
|
13816
|
+
async function Oo(g, A, I) {
|
|
13802
13817
|
const B = g + "/" + A, C = new PA(B), Q = new z(C), E = WA(I), i = await wI(Q, E);
|
|
13803
13818
|
try {
|
|
13804
|
-
return
|
|
13819
|
+
return Lo(i.attrs);
|
|
13805
13820
|
} catch {
|
|
13806
13821
|
throw Error(
|
|
13807
13822
|
`Failed to parse OME-Zarr well:
|
|
@@ -13809,15 +13824,15 @@ ${JSON.stringify(i.attrs)}`
|
|
|
13809
13824
|
);
|
|
13810
13825
|
}
|
|
13811
13826
|
}
|
|
13812
|
-
async function
|
|
13827
|
+
async function Vo(g) {
|
|
13813
13828
|
const A = WA(g.version), I = await wI(g.location, A);
|
|
13814
13829
|
return mg(I.attrs).omero?.channels ?? [];
|
|
13815
13830
|
}
|
|
13816
|
-
async function
|
|
13831
|
+
async function vo(g) {
|
|
13817
13832
|
const A = WA(g.version), I = await wI(g.location, A);
|
|
13818
13833
|
return mg(I.attrs).omero?.rdefs;
|
|
13819
13834
|
}
|
|
13820
|
-
function
|
|
13835
|
+
function Jo(g) {
|
|
13821
13836
|
return {
|
|
13822
13837
|
ome: {
|
|
13823
13838
|
multiscales: g.multiscales,
|
|
@@ -13826,23 +13841,23 @@ function ko(g) {
|
|
|
13826
13841
|
}
|
|
13827
13842
|
};
|
|
13828
13843
|
}
|
|
13829
|
-
function
|
|
13844
|
+
function Yo(g) {
|
|
13830
13845
|
switch (pg(g)) {
|
|
13831
13846
|
case "0.5":
|
|
13832
13847
|
return {
|
|
13833
|
-
...
|
|
13848
|
+
...wo.parse(g).ome,
|
|
13834
13849
|
originalVersion: "0.5"
|
|
13835
13850
|
};
|
|
13836
13851
|
case "0.4":
|
|
13837
13852
|
return {
|
|
13838
|
-
...
|
|
13853
|
+
...Jo(eo.parse(g)).ome,
|
|
13839
13854
|
originalVersion: "0.4"
|
|
13840
13855
|
};
|
|
13841
13856
|
}
|
|
13842
13857
|
}
|
|
13843
13858
|
function mg(g) {
|
|
13844
13859
|
try {
|
|
13845
|
-
return
|
|
13860
|
+
return Yo(g);
|
|
13846
13861
|
} catch {
|
|
13847
13862
|
throw Error(`Failed to parse OME-Zarr image:
|
|
13848
13863
|
${JSON.stringify(g)}`);
|
|
@@ -13866,15 +13881,15 @@ class NI {
|
|
|
13866
13881
|
throw new Error("No datasets found in the multiscale image.");
|
|
13867
13882
|
A || (A = WA(B.originalVersion));
|
|
13868
13883
|
const E = Q.datasets.map(
|
|
13869
|
-
(s) =>
|
|
13884
|
+
(s) => vE(this.location, s.path, A)
|
|
13870
13885
|
), i = await Promise.all(
|
|
13871
|
-
E.map((s) =>
|
|
13886
|
+
E.map((s) => VE(s))
|
|
13872
13887
|
), o = i[0].shape, a = Q.axes;
|
|
13873
13888
|
if (a.length !== o.length)
|
|
13874
13889
|
throw new Error(
|
|
13875
13890
|
`Mismatch between number of axes (${a.length}) and array shape (${o.length})`
|
|
13876
13891
|
);
|
|
13877
|
-
return new
|
|
13892
|
+
return new Qi({
|
|
13878
13893
|
metadata: Q,
|
|
13879
13894
|
arrays: i,
|
|
13880
13895
|
arrayParams: E
|
|
@@ -13927,7 +13942,7 @@ class NI {
|
|
|
13927
13942
|
});
|
|
13928
13943
|
}
|
|
13929
13944
|
}
|
|
13930
|
-
const
|
|
13945
|
+
const iC = [
|
|
13931
13946
|
"fallbackVisible",
|
|
13932
13947
|
"prefetchTime",
|
|
13933
13948
|
"visibleCurrent",
|
|
@@ -13935,14 +13950,14 @@ const aC = [
|
|
|
13935
13950
|
"prefetchSpace"
|
|
13936
13951
|
];
|
|
13937
13952
|
function ug(g) {
|
|
13938
|
-
|
|
13953
|
+
Mo(g);
|
|
13939
13954
|
const A = {
|
|
13940
13955
|
x: g.prefetch.x,
|
|
13941
13956
|
y: g.prefetch.y,
|
|
13942
13957
|
z: g.prefetch.z ?? 0,
|
|
13943
13958
|
t: g.prefetch.t ?? 0
|
|
13944
13959
|
}, I = Object.freeze(
|
|
13945
|
-
|
|
13960
|
+
iC.reduce(
|
|
13946
13961
|
(Q, E) => {
|
|
13947
13962
|
const i = g.priorityOrder.indexOf(E);
|
|
13948
13963
|
return Q[E] = i, Q;
|
|
@@ -13962,7 +13977,7 @@ function ug(g) {
|
|
|
13962
13977
|
};
|
|
13963
13978
|
return Object.freeze(C);
|
|
13964
13979
|
}
|
|
13965
|
-
function
|
|
13980
|
+
function Xo(g = {}) {
|
|
13966
13981
|
return ug(Tg({
|
|
13967
13982
|
profile: "exploration",
|
|
13968
13983
|
prefetch: { x: 1, y: 1, z: 1, t: 0 },
|
|
@@ -13975,7 +13990,7 @@ function Vo(g = {}) {
|
|
|
13975
13990
|
]
|
|
13976
13991
|
}, g));
|
|
13977
13992
|
}
|
|
13978
|
-
function
|
|
13993
|
+
function jo(g = {}) {
|
|
13979
13994
|
return ug(Tg({
|
|
13980
13995
|
profile: "playback",
|
|
13981
13996
|
prefetch: { x: 0, y: 0, z: 0, t: 20 },
|
|
@@ -13988,7 +14003,7 @@ function vo(g = {}) {
|
|
|
13988
14003
|
]
|
|
13989
14004
|
}, g));
|
|
13990
14005
|
}
|
|
13991
|
-
function
|
|
14006
|
+
function zo(g = {}) {
|
|
13992
14007
|
return ug(Tg({
|
|
13993
14008
|
profile: "no-prefetch",
|
|
13994
14009
|
prefetch: { x: 0, y: 0, z: 0, t: 0 },
|
|
@@ -14001,7 +14016,7 @@ function Xo(g = {}) {
|
|
|
14001
14016
|
]
|
|
14002
14017
|
}, g));
|
|
14003
14018
|
}
|
|
14004
|
-
function
|
|
14019
|
+
function Mo(g) {
|
|
14005
14020
|
for (const [B, C] of Object.entries(g.prefetch))
|
|
14006
14021
|
if (C !== void 0 && C < 0)
|
|
14007
14022
|
throw new Error(`prefetch.${B} must be a non-negative number`);
|
|
@@ -14009,7 +14024,7 @@ function Jo(g) {
|
|
|
14009
14024
|
if (A?.min !== void 0 && A?.max !== void 0 && A.min > A.max)
|
|
14010
14025
|
throw new Error("lod.min must be <= lod.max");
|
|
14011
14026
|
const I = g.priorityOrder;
|
|
14012
|
-
if (I.length !==
|
|
14027
|
+
if (I.length !== iC.length || new Set(I).size !== I.length)
|
|
14013
14028
|
throw new Error("priorityOrder must include all categories exactly once");
|
|
14014
14029
|
}
|
|
14015
14030
|
function Tg(g, A = {}) {
|
|
@@ -14020,7 +14035,7 @@ function Tg(g, A = {}) {
|
|
|
14020
14035
|
priorityOrder: A.priorityOrder ?? g.priorityOrder
|
|
14021
14036
|
};
|
|
14022
14037
|
}
|
|
14023
|
-
class
|
|
14038
|
+
class _o extends ZA {
|
|
14024
14039
|
atlas_;
|
|
14025
14040
|
constructor(A, I) {
|
|
14026
14041
|
super(), this.programName = "points", this.atlas_ = I, A.forEach((Q) => {
|
|
@@ -14064,41 +14079,41 @@ class jo extends ZA {
|
|
|
14064
14079
|
}
|
|
14065
14080
|
}
|
|
14066
14081
|
export {
|
|
14067
|
-
|
|
14082
|
+
po as AxesLayer,
|
|
14068
14083
|
AA as Box2,
|
|
14069
14084
|
RA as Box3,
|
|
14070
|
-
|
|
14085
|
+
pB as ChunkedImageLayer,
|
|
14071
14086
|
l as Color,
|
|
14072
|
-
|
|
14073
|
-
|
|
14074
|
-
|
|
14075
|
-
|
|
14076
|
-
|
|
14087
|
+
SQ as Frustum,
|
|
14088
|
+
Ko as Idetik,
|
|
14089
|
+
xo as ImageLayer,
|
|
14090
|
+
bo as ImageSeriesLayer,
|
|
14091
|
+
Wo as LabelImageLayer,
|
|
14077
14092
|
FA as Layer,
|
|
14078
|
-
|
|
14093
|
+
sQ as LayerManager,
|
|
14079
14094
|
NI as OmeZarrImageSource,
|
|
14080
|
-
|
|
14081
|
-
|
|
14082
|
-
|
|
14083
|
-
|
|
14095
|
+
fo as OrbitControls,
|
|
14096
|
+
Ho as OrthographicCamera,
|
|
14097
|
+
lo as PanZoomControls,
|
|
14098
|
+
qo as PerspectiveCamera,
|
|
14084
14099
|
dA as Plane,
|
|
14085
|
-
|
|
14086
|
-
|
|
14100
|
+
_o as Points,
|
|
14101
|
+
mo as ProjectedLineLayer,
|
|
14087
14102
|
IB as Spherical,
|
|
14088
14103
|
yI as Texture2DArray,
|
|
14089
14104
|
jA as Texture3D,
|
|
14090
|
-
|
|
14091
|
-
|
|
14092
|
-
|
|
14093
|
-
|
|
14094
|
-
|
|
14105
|
+
uo as TracksLayer,
|
|
14106
|
+
yQ as Viewport,
|
|
14107
|
+
To as VolumeLayer,
|
|
14108
|
+
gQ as WebGLRenderer,
|
|
14109
|
+
Xo as createExplorationPolicy,
|
|
14095
14110
|
ug as createImageSourcePolicy,
|
|
14096
|
-
|
|
14097
|
-
|
|
14098
|
-
|
|
14099
|
-
|
|
14100
|
-
|
|
14101
|
-
|
|
14102
|
-
|
|
14111
|
+
zo as createNoPrefetchPolicy,
|
|
14112
|
+
jo as createPlaybackPolicy,
|
|
14113
|
+
Po as loadOmeZarrPlate,
|
|
14114
|
+
Oo as loadOmeZarrWell,
|
|
14115
|
+
Vo as loadOmeroChannels,
|
|
14116
|
+
vo as loadOmeroDefaults,
|
|
14117
|
+
GQ as parseViewportConfigs
|
|
14103
14118
|
};
|
|
14104
14119
|
//# sourceMappingURL=index.js.map
|