@fxi/zartigl 0.11.3 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -4
- package/dist/catalog.js +1 -1
- package/dist/{engine-BBxJ6x3s.js → engine-Bhb-WayM.js} +423 -370
- package/dist/engine.d.ts +25 -0
- package/dist/engine.js +17 -17
- package/dist/{index-DVXVRI3C.js → index-C-RZ2d8q.js} +1 -1
- package/dist/zartigl.d.ts +51 -13
- package/dist/zartigl.js +1761 -1675
- package/package.json +1 -1
|
@@ -1,45 +1,45 @@
|
|
|
1
1
|
import "./backdrop-Dceb4d8E.js";
|
|
2
|
-
const
|
|
3
|
-
thermal:
|
|
2
|
+
const we = { label: "Thermal", tags: ["sequential", "temperature"], colors: ["#042333", "#2c3395", "#744796", "#b15f82", "#eb7958", "#fbb43d", "#e8fa5b"] }, ye = { label: "Haline", tags: ["sequential", "salinity"], colors: ["#2a186c", "#17568b", "#1a7e8f", "#22a785", "#55c666", "#aadc32", "#fde333"] }, Re = { label: "Solar", tags: ["sequential", "irradiance"], colors: ["#330f0b", "#6b2313", "#a83c12", "#d6621a", "#f3951e", "#f7c741", "#f9f871"] }, _e = { label: "Ice", tags: ["sequential"], colors: ["#040d1a", "#123365", "#1c5f9e", "#2b8ece", "#62bde3", "#aaddf2", "#f2faff"] }, xe = { label: "Deep", tags: ["sequential", "depth"], colors: ["#fdfecc", "#c8e59b", "#74c8a3", "#3194b0", "#2a5b8e", "#281a5e", "#0c0820"] }, ve = { label: "RdYlBu", tags: ["diverging"], colors: ["#3288bd", "#66c2a5", "#abdda4", "#e6f598", "#fee08b", "#fdae61", "#f46d43", "#d53e4f"] }, Ae = { label: "Dense", tags: ["sequential"], colors: ["#e6f1f1", "#92c4ca", "#44929a", "#20627a", "#1a3c6a", "#211a50", "#0d0621"] }, ke = { label: "Algae", tags: ["sequential", "biology", "log"], colors: ["#d7f9d0", "#a2d595", "#64b463", "#129450", "#126e45", "#1a482f", "#122414"] }, Fe = { label: "Oxygen", tags: ["sequential", "biology", "hypoxia"], colors: ["#09060f", "#5b1028", "#d43d2f", "#f39b3d", "#f3e7b3", "#79cbd1", "#176b9c"] }, Se = { label: "Matter", tags: ["sequential", "biology"], colors: ["#fdfecc", "#f2c98a", "#e07c4e", "#bc3754", "#8d1a6d", "#51156b", "#1c0c3f"] }, Ue = { label: "Viridis", tags: ["sequential", "perceptual"], colors: ["#440154", "#443983", "#31688e", "#21918c", "#35b779", "#90d743", "#fde725"] }, Me = { label: "Plasma", tags: ["sequential", "perceptual"], colors: ["#0d0887", "#5e01a6", "#9c179e", "#cc4778", "#ed7953", "#fdb42f", "#f0f921"] }, De = { label: "Cyclic", tags: ["cyclic", "direction"], colors: ["#2e22ea", "#b541fb", "#fc93c0", "#f1ee35", "#77c80d", "#458776", "#2c24e9"] }, Pe = { label: "Tempo", tags: ["sequential"], colors: ["#fff6f4", "#c2d1b9", "#7db390", "#2a937f", "#156d73", "#1c455b", "#151d44"] }, Ne = { label: "Turbid", tags: ["sequential", "biology", "log"], colors: ["#e9f5a0", "#c8c86e", "#a09845", "#786031", "#533324", "#341423", "#150d17"] }, Ge = { label: "Speed", tags: ["sequential", "velocity"], colors: ["#fcfea4", "#d5e429", "#94c63e", "#52a657", "#2d8169", "#1d5b6d", "#0d3361"] }, Ie = { label: "Amp", tags: ["sequential"], colors: ["#f2f2f2", "#c0b8db", "#9180b6", "#6c4e9e", "#4e2e83", "#32185d", "#110a35"] }, Le = { label: "Heat", tags: ["sequential"], colors: ["#fde725", "#fde725", "#f8961e", "#e63946", "#9d0208", "#3a0007"] }, Ce = { label: "Balance", tags: ["diverging"], colors: ["#181c43", "#3066af", "#9bbcdd", "#f2f2f2", "#e07d53", "#b13626", "#2c0b0e"] }, Ve = { label: "Delta", tags: ["diverging"], colors: ["#0e3f31", "#20877b", "#99d4c1", "#f2f2f2", "#a1b0d4", "#3c5b9e", "#0d1938"] }, Oe = { label: "Curl", tags: ["diverging"], colors: ["#152237", "#2471b3", "#8dbac4", "#f2f2f2", "#c79f84", "#a63827", "#270b17"] }, Be = { label: "Gray", tags: ["sequential"], colors: ["#000000", "#252525", "#4d4d4d", "#7a7a7a", "#a8a8a8", "#d4d4d4", "#ffffff"] }, ue = {
|
|
3
|
+
thermal: we,
|
|
4
4
|
"thermal-alt": { label: "Thermal Alt", tags: ["sequential", "temperature"], colors: ["#176b9c", "#79cbd1", "#f3e7b3", "#f39b3d", "#d43d2f", "#5b1028", "#09060f"] },
|
|
5
|
-
haline:
|
|
6
|
-
solar:
|
|
7
|
-
ice:
|
|
8
|
-
deep:
|
|
9
|
-
rdylbu:
|
|
10
|
-
dense:
|
|
11
|
-
algae:
|
|
12
|
-
oxygen:
|
|
13
|
-
matter:
|
|
14
|
-
viridis:
|
|
15
|
-
plasma:
|
|
16
|
-
cyclic:
|
|
17
|
-
tempo:
|
|
18
|
-
turbid:
|
|
19
|
-
speed:
|
|
20
|
-
amp:
|
|
21
|
-
heat:
|
|
5
|
+
haline: ye,
|
|
6
|
+
solar: Re,
|
|
7
|
+
ice: _e,
|
|
8
|
+
deep: xe,
|
|
9
|
+
rdylbu: ve,
|
|
10
|
+
dense: Ae,
|
|
11
|
+
algae: ke,
|
|
12
|
+
oxygen: Fe,
|
|
13
|
+
matter: Se,
|
|
14
|
+
viridis: Ue,
|
|
15
|
+
plasma: Me,
|
|
16
|
+
cyclic: De,
|
|
17
|
+
tempo: Pe,
|
|
18
|
+
turbid: Ne,
|
|
19
|
+
speed: Ge,
|
|
20
|
+
amp: Ie,
|
|
21
|
+
heat: Le,
|
|
22
22
|
"heat-alert": { label: "Heat Alert", tags: ["sequential", "alpha", "deprecated"], colors: ["#fde72500", "#fde725cc", "#f8961e", "#e63946", "#9d0208", "#3a0007"] },
|
|
23
|
-
balance:
|
|
24
|
-
delta:
|
|
25
|
-
curl:
|
|
23
|
+
balance: Ce,
|
|
24
|
+
delta: Ve,
|
|
25
|
+
curl: Oe,
|
|
26
26
|
"mono-black": { label: "Black", tags: ["monochrome", "particles"], colors: ["#000000", "#000000"] },
|
|
27
27
|
"mono-white": { label: "White", tags: ["monochrome", "particles"], colors: ["#ffffff", "#ffffff"] },
|
|
28
28
|
"mono-pink": { label: "Pink", tags: ["monochrome", "particles"], colors: ["#ff2aa1", "#ff2aa1"] },
|
|
29
|
-
gray:
|
|
30
|
-
},
|
|
29
|
+
gray: Be
|
|
30
|
+
}, ne = 64, Xe = {
|
|
31
31
|
linear: (t) => t,
|
|
32
32
|
// Rises fast: values just inside the zone already show.
|
|
33
33
|
log: (t) => Math.log10(1 + 9 * t),
|
|
34
34
|
// Stays faint longer: codec noise at the end of the range stays hidden.
|
|
35
35
|
exp: (t) => (10 ** t - 1) / 9
|
|
36
36
|
};
|
|
37
|
-
function
|
|
38
|
-
const i =
|
|
37
|
+
function $e(t, e) {
|
|
38
|
+
const i = Xe[e.curve ?? "linear"], r = e.low ?? 0, n = e.high ?? 0;
|
|
39
39
|
let s = 1;
|
|
40
40
|
return r > 0 && t < r && (s = Math.min(s, i(Math.max(t, 0) / r))), n > 0 && t > 1 - n && (s = Math.min(s, i(Math.max(1 - t, 0) / n))), s;
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function qe(t) {
|
|
43
43
|
let e = t.replace("#", "");
|
|
44
44
|
(e.length === 3 || e.length === 4) && (e = [...e].map((r) => r + r).join(""));
|
|
45
45
|
const i = (r) => parseInt(e.slice(r, r + 2), 16);
|
|
@@ -50,46 +50,46 @@ function Xe(t) {
|
|
|
50
50
|
e.length === 8 ? i(6) : 255
|
|
51
51
|
];
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function We([t, e, i, r]) {
|
|
54
54
|
return `#${[t, e, i, r].map(
|
|
55
55
|
(n) => Math.round(Math.min(255, Math.max(0, n))).toString(16).padStart(2, "0")
|
|
56
56
|
).join("")}`;
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function He(t, e) {
|
|
59
59
|
if (e <= t[0][0])
|
|
60
60
|
return t[0][1];
|
|
61
61
|
for (let i = 1; i < t.length; i++) {
|
|
62
62
|
const [r, n] = t[i];
|
|
63
63
|
if (e <= r) {
|
|
64
64
|
const [s, o] = t[i - 1], a = r === s ? 1 : (e - s) / (r - s);
|
|
65
|
-
return o.map((
|
|
65
|
+
return o.map((c, l) => c + (n[l] - c) * a);
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
return t[t.length - 1][1];
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function ze(t, e) {
|
|
71
71
|
const i = Object.entries(t).map(
|
|
72
|
-
([n, s]) => [Number(n),
|
|
72
|
+
([n, s]) => [Number(n), qe(s)]
|
|
73
73
|
).sort((n, s) => n[0] - s[0]), r = {};
|
|
74
|
-
for (let n = 0; n <=
|
|
75
|
-
const s = n /
|
|
76
|
-
r[s] =
|
|
74
|
+
for (let n = 0; n <= ne; n++) {
|
|
75
|
+
const s = n / ne, [o, a, c, l] = He(i, s);
|
|
76
|
+
r[s] = We([o, a, c, l * $e(s, e)]);
|
|
77
77
|
}
|
|
78
78
|
return r;
|
|
79
79
|
}
|
|
80
|
-
const
|
|
81
|
-
function
|
|
80
|
+
const Ye = (t) => !!t && ((t.low ?? 0) > 0 || (t.high ?? 0) > 0);
|
|
81
|
+
function se(t) {
|
|
82
82
|
const e = {}, i = t.length - 1;
|
|
83
83
|
return t.forEach((r, n) => {
|
|
84
84
|
e[i === 0 ? 0 : n / i] = r;
|
|
85
85
|
}), e;
|
|
86
86
|
}
|
|
87
|
-
function
|
|
88
|
-
const i =
|
|
89
|
-
return
|
|
87
|
+
function je(t, e) {
|
|
88
|
+
const i = Ke(t, e?.reverse ?? !1);
|
|
89
|
+
return Ye(e?.alphaFade) ? ze(i, e.alphaFade) : i;
|
|
90
90
|
}
|
|
91
|
-
function
|
|
92
|
-
const i =
|
|
91
|
+
function Ke(t, e) {
|
|
92
|
+
const i = ue;
|
|
93
93
|
if (typeof t == "string") {
|
|
94
94
|
const r = i[t];
|
|
95
95
|
if (!r)
|
|
@@ -99,22 +99,22 @@ function Ye(t, e) {
|
|
|
99
99
|
).join(", ")}`
|
|
100
100
|
);
|
|
101
101
|
const n = e ? [...r.colors].reverse() : r.colors;
|
|
102
|
-
return
|
|
102
|
+
return se(n);
|
|
103
103
|
}
|
|
104
104
|
if (Array.isArray(t)) {
|
|
105
105
|
const r = e ? [...t].reverse() : t;
|
|
106
|
-
return
|
|
106
|
+
return se(r);
|
|
107
107
|
}
|
|
108
108
|
return e ? Object.fromEntries(
|
|
109
109
|
Object.entries(t).map(([r, n]) => [1 - Number(r), n])
|
|
110
110
|
) : t;
|
|
111
111
|
}
|
|
112
|
-
function
|
|
113
|
-
return Object.entries(
|
|
112
|
+
function Zt(t = {}) {
|
|
113
|
+
return Object.entries(ue).map(([i, r]) => ({ id: i, ...r })).filter(
|
|
114
114
|
(i) => t.includeDeprecated || !i.tags.includes("deprecated")
|
|
115
115
|
);
|
|
116
116
|
}
|
|
117
|
-
function
|
|
117
|
+
function ae(t, e, i) {
|
|
118
118
|
const r = t.createShader(e);
|
|
119
119
|
if (!r)
|
|
120
120
|
throw new Error("Failed to create shader");
|
|
@@ -124,18 +124,18 @@ function ne(t, e, i) {
|
|
|
124
124
|
}
|
|
125
125
|
return r;
|
|
126
126
|
}
|
|
127
|
-
function
|
|
127
|
+
function Jt(t, e, i) {
|
|
128
128
|
const r = t.createProgram();
|
|
129
129
|
if (!r)
|
|
130
130
|
throw new Error("Failed to create program");
|
|
131
|
-
const n =
|
|
131
|
+
const n = ae(t, t.VERTEX_SHADER, e), s = ae(t, t.FRAGMENT_SHADER, i);
|
|
132
132
|
if (t.attachShader(r, n), t.attachShader(r, s), t.linkProgram(r), !t.getProgramParameter(r, t.LINK_STATUS)) {
|
|
133
133
|
const o = t.getProgramInfoLog(r);
|
|
134
134
|
throw t.deleteProgram(r), new Error(`Program link error: ${o}`);
|
|
135
135
|
}
|
|
136
136
|
return t.deleteShader(n), t.deleteShader(s), r;
|
|
137
137
|
}
|
|
138
|
-
function
|
|
138
|
+
function ei(t, e, i, r, n) {
|
|
139
139
|
const s = t.createTexture();
|
|
140
140
|
if (!s)
|
|
141
141
|
throw new Error("Failed to create texture");
|
|
@@ -151,7 +151,7 @@ function Qt(t, e, i, r, n) {
|
|
|
151
151
|
i
|
|
152
152
|
), t.bindTexture(t.TEXTURE_2D, null), s;
|
|
153
153
|
}
|
|
154
|
-
function
|
|
154
|
+
function Qe(t, e, i) {
|
|
155
155
|
const r = t.getParameter(
|
|
156
156
|
t.TEXTURE_BINDING_2D
|
|
157
157
|
), n = t.getParameter(
|
|
@@ -183,19 +183,19 @@ function je(t, e, i) {
|
|
|
183
183
|
}
|
|
184
184
|
return a;
|
|
185
185
|
}
|
|
186
|
-
function
|
|
186
|
+
function Ze(t) {
|
|
187
187
|
return {
|
|
188
188
|
kind: "rgba8-packed",
|
|
189
189
|
internalFormat: t.RGBA,
|
|
190
190
|
type: t.UNSIGNED_BYTE
|
|
191
191
|
};
|
|
192
192
|
}
|
|
193
|
-
function
|
|
193
|
+
function ti(t) {
|
|
194
194
|
if (typeof WebGL2RenderingContext > "u" || !(t instanceof WebGL2RenderingContext))
|
|
195
195
|
throw new Error("zartigl requires WebGL2");
|
|
196
196
|
return t;
|
|
197
197
|
}
|
|
198
|
-
function
|
|
198
|
+
function ii(t) {
|
|
199
199
|
const e = [];
|
|
200
200
|
t.getExtension("EXT_color_buffer_float") ? e.push(
|
|
201
201
|
{ kind: "float32", internalFormat: t.RGBA32F, type: t.FLOAT },
|
|
@@ -206,15 +206,15 @@ function Jt(t) {
|
|
|
206
206
|
type: t.HALF_FLOAT
|
|
207
207
|
});
|
|
208
208
|
for (const i of e)
|
|
209
|
-
if (
|
|
209
|
+
if (Qe(
|
|
210
210
|
t,
|
|
211
211
|
i.internalFormat,
|
|
212
212
|
i.type
|
|
213
213
|
))
|
|
214
214
|
return i;
|
|
215
|
-
return
|
|
215
|
+
return Ze(t);
|
|
216
216
|
}
|
|
217
|
-
function
|
|
217
|
+
function ri(t, e, i, r, n, s, o) {
|
|
218
218
|
const a = t.createTexture();
|
|
219
219
|
if (!a)
|
|
220
220
|
throw new Error("Failed to create texture");
|
|
@@ -230,10 +230,10 @@ function ei(t, e, i, r, n, s, o) {
|
|
|
230
230
|
i
|
|
231
231
|
), t.bindTexture(t.TEXTURE_2D, null), a;
|
|
232
232
|
}
|
|
233
|
-
function
|
|
233
|
+
function ni(t, e, i) {
|
|
234
234
|
t.activeTexture(t.TEXTURE0 + i), t.bindTexture(t.TEXTURE_2D, e);
|
|
235
235
|
}
|
|
236
|
-
function
|
|
236
|
+
function si(t, e) {
|
|
237
237
|
const i = t.createFramebuffer();
|
|
238
238
|
if (!i)
|
|
239
239
|
throw new Error("Failed to create framebuffer");
|
|
@@ -245,7 +245,7 @@ function ii(t, e) {
|
|
|
245
245
|
0
|
|
246
246
|
), t.bindFramebuffer(t.FRAMEBUFFER, null), i;
|
|
247
247
|
}
|
|
248
|
-
function
|
|
248
|
+
function ai(t) {
|
|
249
249
|
const e = t.createBuffer();
|
|
250
250
|
if (!e)
|
|
251
251
|
throw new Error("Failed to create buffer");
|
|
@@ -255,7 +255,7 @@ function ri(t) {
|
|
|
255
255
|
t.STATIC_DRAW
|
|
256
256
|
), e;
|
|
257
257
|
}
|
|
258
|
-
const
|
|
258
|
+
const Je = {
|
|
259
259
|
0: "#3288bd",
|
|
260
260
|
0.1: "#66c2a5",
|
|
261
261
|
0.2: "#abdda4",
|
|
@@ -265,19 +265,19 @@ const Qe = {
|
|
|
265
265
|
0.6: "#f46d43",
|
|
266
266
|
1: "#d53e4f"
|
|
267
267
|
};
|
|
268
|
-
function
|
|
269
|
-
const r =
|
|
268
|
+
function oi(t, e, i) {
|
|
269
|
+
const r = je(e ?? Je, i), n = document.createElement("canvas");
|
|
270
270
|
n.width = 256, n.height = 1;
|
|
271
271
|
const s = n.getContext("2d"), o = s.createLinearGradient(0, 0, 256, 0);
|
|
272
|
-
for (const [
|
|
273
|
-
o.addColorStop(Number(
|
|
272
|
+
for (const [c, l] of Object.entries(r))
|
|
273
|
+
o.addColorStop(Number(c), l);
|
|
274
274
|
s.fillStyle = o, s.fillRect(0, 0, 256, 1);
|
|
275
275
|
const a = t.createTexture();
|
|
276
276
|
if (!a)
|
|
277
277
|
throw new Error("Failed to create color ramp texture");
|
|
278
278
|
return t.bindTexture(t.TEXTURE_2D, a), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_WRAP_S, t.CLAMP_TO_EDGE), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_WRAP_T, t.CLAMP_TO_EDGE), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_MIN_FILTER, t.LINEAR), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_MAG_FILTER, t.LINEAR), t.texImage2D(t.TEXTURE_2D, 0, t.RGBA, t.RGBA, t.UNSIGNED_BYTE, n), t.bindTexture(t.TEXTURE_2D, null), a;
|
|
279
279
|
}
|
|
280
|
-
function
|
|
280
|
+
function ci(t) {
|
|
281
281
|
const e = t.getExtension("WEBGL_debug_renderer_info");
|
|
282
282
|
return {
|
|
283
283
|
vendor: String(t.getParameter(t.VENDOR) ?? ""),
|
|
@@ -287,7 +287,7 @@ function si(t) {
|
|
|
287
287
|
version: String(t.getParameter(t.VERSION) ?? "")
|
|
288
288
|
};
|
|
289
289
|
}
|
|
290
|
-
function
|
|
290
|
+
function li(t) {
|
|
291
291
|
return {
|
|
292
292
|
program: t.getParameter(t.CURRENT_PROGRAM),
|
|
293
293
|
activeTexture: t.getParameter(t.ACTIVE_TEXTURE),
|
|
@@ -304,10 +304,10 @@ function ai(t) {
|
|
|
304
304
|
]
|
|
305
305
|
};
|
|
306
306
|
}
|
|
307
|
-
function
|
|
307
|
+
function di(t, e) {
|
|
308
308
|
t.useProgram(e.program), t.activeTexture(e.activeTexture), t.bindBuffer(t.ARRAY_BUFFER, e.arrayBuffer), t.bindBuffer(t.ELEMENT_ARRAY_BUFFER, e.elementBuffer), t.bindFramebuffer(t.FRAMEBUFFER, e.framebuffer), e.blend ? t.enable(t.BLEND) : t.disable(t.BLEND), e.depthTest ? t.enable(t.DEPTH_TEST) : t.disable(t.DEPTH_TEST), e.stencilTest ? t.enable(t.STENCIL_TEST) : t.disable(t.STENCIL_TEST), t.viewport(e.viewport[0], e.viewport[1], e.viewport[2], e.viewport[3]), t.blendFunc(e.blendFunc[0], e.blendFunc[1]);
|
|
309
309
|
}
|
|
310
|
-
const
|
|
310
|
+
const et = {
|
|
311
311
|
degrees_c: "°C",
|
|
312
312
|
degc: "°C",
|
|
313
313
|
degrees_celsius: "°C",
|
|
@@ -323,7 +323,7 @@ const Ze = {
|
|
|
323
323
|
"0.001": "PSU",
|
|
324
324
|
psu: "PSU",
|
|
325
325
|
stress_level: ""
|
|
326
|
-
},
|
|
326
|
+
}, tt = {
|
|
327
327
|
meter: "m",
|
|
328
328
|
meters: "m",
|
|
329
329
|
metre: "m",
|
|
@@ -346,12 +346,12 @@ const Ze = {
|
|
|
346
346
|
newton: "N",
|
|
347
347
|
pascal: "Pa",
|
|
348
348
|
kelvin: "K"
|
|
349
|
-
},
|
|
350
|
-
function
|
|
351
|
-
return t === 1 ? "" : [...String(t)].map((e) =>
|
|
349
|
+
}, it = "⁰¹²³⁴⁵⁶⁷⁸⁹";
|
|
350
|
+
function oe(t) {
|
|
351
|
+
return t === 1 ? "" : [...String(t)].map((e) => it[Number(e)]).join("");
|
|
352
352
|
}
|
|
353
|
-
function
|
|
354
|
-
const e = t?.trim() ?? "", i =
|
|
353
|
+
function hi(t) {
|
|
354
|
+
const e = t?.trim() ?? "", i = et[e.toLowerCase()];
|
|
355
355
|
if (i != null)
|
|
356
356
|
return i;
|
|
357
357
|
if (e.includes("/"))
|
|
@@ -361,21 +361,21 @@ function ci(t) {
|
|
|
361
361
|
const o = /^([A-Za-z]+)\^?(-?\d+)?$/.exec(s);
|
|
362
362
|
if (!o)
|
|
363
363
|
return e.replace(/_/g, " ");
|
|
364
|
-
const a =
|
|
365
|
-
|
|
364
|
+
const a = tt[o[1]] ?? o[1], c = Number(o[2] ?? 1);
|
|
365
|
+
c < 0 ? n.push(a + oe(-c)) : r.push(a + oe(c));
|
|
366
366
|
}
|
|
367
367
|
return [r.join(" ") || "1", ...n].join("/");
|
|
368
368
|
}
|
|
369
|
-
const
|
|
370
|
-
function
|
|
369
|
+
const ce = 20, rt = 600;
|
|
370
|
+
function nt(t) {
|
|
371
371
|
const e = Math.max(0, Math.min(1, t));
|
|
372
|
-
return
|
|
372
|
+
return ce * Math.pow(rt / ce, e);
|
|
373
373
|
}
|
|
374
|
-
function
|
|
375
|
-
return Math.exp(-1 /
|
|
374
|
+
function ui(t) {
|
|
375
|
+
return Math.exp(-1 / nt(t));
|
|
376
376
|
}
|
|
377
|
-
const
|
|
378
|
-
class
|
|
377
|
+
const st = 0.8, at = 120, ot = 300;
|
|
378
|
+
class fi {
|
|
379
379
|
constructor(e) {
|
|
380
380
|
this.base = e, this.moving = !1, this.start = 0, this.duration = 0, this.from = e, this.to = e;
|
|
381
381
|
}
|
|
@@ -384,7 +384,7 @@ class li {
|
|
|
384
384
|
this.base = e, this.moving || (this.from = e, this.to = e, this.duration = 0);
|
|
385
385
|
}
|
|
386
386
|
setMoving(e, i) {
|
|
387
|
-
e !== this.moving && (this.from = this.value(i), this.moving = e, this.to = e ?
|
|
387
|
+
e !== this.moving && (this.from = this.value(i), this.moving = e, this.to = e ? st : this.base, this.start = i, this.duration = e ? at : ot);
|
|
388
388
|
}
|
|
389
389
|
value(e) {
|
|
390
390
|
if (this.duration === 0)
|
|
@@ -393,7 +393,7 @@ class li {
|
|
|
393
393
|
return i === 1 ? (this.duration = 0, this.from = this.to, this.to) : this.from + (this.to - this.from) * i * i * (3 - 2 * i);
|
|
394
394
|
}
|
|
395
395
|
}
|
|
396
|
-
var
|
|
396
|
+
var ct = `vec3 velocityValue(vec4 texel, vec2 minimum, vec2 maximum, float physical) {
|
|
397
397
|
if (physical > 0.5) return texel.xyz;
|
|
398
398
|
return vec3(mix(minimum, maximum, texel.rg), texel.a);
|
|
399
399
|
}
|
|
@@ -401,7 +401,7 @@ var at = `vec3 velocityValue(vec4 texel, vec2 minimum, vec2 maximum, float physi
|
|
|
401
401
|
vec3 blendVelocity(vec3 a, vec3 b, float fraction) {
|
|
402
402
|
if (fraction <= 0.0) return a;
|
|
403
403
|
return mix(a, b, fraction);
|
|
404
|
-
}`,
|
|
404
|
+
}`, lt = `vec3 applyVibrance(vec3 c, float v) {
|
|
405
405
|
float mx = max(c.r, max(c.g, c.b));
|
|
406
406
|
float mn = min(c.r, min(c.g, c.b));
|
|
407
407
|
float boost = v * (1.0 - (mx - mn));
|
|
@@ -422,7 +422,7 @@ vec3 gradeColor(vec3 c, vec4 g) {
|
|
|
422
422
|
|
|
423
423
|
c = mix(c, c * c * (3.0 - 2.0 * c), g.y);
|
|
424
424
|
return clamp(applyVibrance(c, g.z), 0.0, 1.0);
|
|
425
|
-
}`,
|
|
425
|
+
}`, dt = `uniform vec2 u_code_range;
|
|
426
426
|
uniform vec2 u_value_range;
|
|
427
427
|
uniform float u_scalar_transfer;
|
|
428
428
|
|
|
@@ -434,7 +434,7 @@ float geoVideoScalarValue(float r) {
|
|
|
434
434
|
float code = geoVideoScalarCode(r);
|
|
435
435
|
float t = mix(code, (pow(10.0, code) - 1.0) / 9.0, u_scalar_transfer);
|
|
436
436
|
return mix(u_value_range.x, u_value_range.y, t);
|
|
437
|
-
}`,
|
|
437
|
+
}`, ht = `uint pcg(uint v) {
|
|
438
438
|
uint state = v * 747796405u + 2891336453u;
|
|
439
439
|
uint word = ((state >> ((state >> 28u) + 4u)) ^ state) * 277803737u;
|
|
440
440
|
return (word >> 22u) ^ word;
|
|
@@ -442,13 +442,13 @@ float geoVideoScalarValue(float r) {
|
|
|
442
442
|
|
|
443
443
|
float random(uvec3 v) {
|
|
444
444
|
return float(pcg(v.x ^ pcg(v.y ^ pcg(v.z))) >> 8u) * (1.0 / 16777216.0);
|
|
445
|
-
}`,
|
|
445
|
+
}`, ut = `vec3 applyVibrance(vec3 c, float v) {
|
|
446
446
|
float mx = max(c.r, max(c.g, c.b));
|
|
447
447
|
float mn = min(c.r, min(c.g, c.b));
|
|
448
448
|
float boost = v * (1.0 - (mx - mn));
|
|
449
449
|
float luma = dot(c, vec3(0.299, 0.587, 0.114));
|
|
450
450
|
return mix(vec3(luma), c, 1.0 + boost);
|
|
451
|
-
}`,
|
|
451
|
+
}`, ft = `#define GLOW_SCALE 4
|
|
452
452
|
|
|
453
453
|
vec4 glowGather(sampler2D trails, ivec2 texel) {
|
|
454
454
|
ivec2 last = textureSize(trails, 0) - 1;
|
|
@@ -476,8 +476,8 @@ vec4 addGlow(vec4 trail, sampler2D glowTex, vec2 uv, float gain) {
|
|
|
476
476
|
vec3 rgb = (trail.rgb * trail.a + glow.rgb * under) / max(alpha, 1e-4);
|
|
477
477
|
return vec4(rgb, alpha);
|
|
478
478
|
}`;
|
|
479
|
-
const
|
|
480
|
-
function
|
|
479
|
+
const mi = ut, pi = lt, Ei = ht, gi = dt, Ti = ct, bi = ft, wi = 4, yi = 1.2;
|
|
480
|
+
function Ri(t) {
|
|
481
481
|
if (t == null)
|
|
482
482
|
return null;
|
|
483
483
|
if (!Number.isFinite(t[0]) || !Number.isFinite(t[1]) || t[0] >= t[1])
|
|
@@ -499,12 +499,12 @@ function B(t, e) {
|
|
|
499
499
|
throw new Error(`Invalid GeoVideo manifest ${e}`);
|
|
500
500
|
return i;
|
|
501
501
|
}
|
|
502
|
-
function
|
|
502
|
+
function K(t) {
|
|
503
503
|
return typeof t == "string" && /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/.test(
|
|
504
504
|
t
|
|
505
505
|
);
|
|
506
506
|
}
|
|
507
|
-
function
|
|
507
|
+
function le(t) {
|
|
508
508
|
if (!t || typeof t != "object")
|
|
509
509
|
throw new Error("Invalid GeoVideo manifest");
|
|
510
510
|
const e = t;
|
|
@@ -530,21 +530,21 @@ function oe(t) {
|
|
|
530
530
|
const a = e.encoding;
|
|
531
531
|
if (!a || a.bits !== 8 || a.colorSpace !== "bt709" || a.colorRange !== "limited" && a.colorRange !== "full")
|
|
532
532
|
throw new Error("Invalid GeoVideo encoding");
|
|
533
|
-
const
|
|
534
|
-
if (
|
|
533
|
+
const c = x(a.codeMin, "encoding.codeMin"), l = x(a.codeMax, "encoding.codeMax");
|
|
534
|
+
if (c < 0 || l > 255 || c >= l)
|
|
535
535
|
throw new Error("Invalid GeoVideo code range");
|
|
536
|
-
let
|
|
536
|
+
let d = o.height;
|
|
537
537
|
if (a.kind === "scalar-luma") {
|
|
538
538
|
if (a.transfer !== "linear" && a.transfer !== "log10-1p9" || x(a.valueMin, "encoding.valueMin") >= x(a.valueMax, "encoding.valueMax"))
|
|
539
539
|
throw new Error("Invalid GeoVideo scalar-luma encoding");
|
|
540
540
|
} else if (a.kind === "vector-luma") {
|
|
541
541
|
if (a.transfer !== "linear" && a.transfer !== "sqrt" || a.layout !== "stacked-uv" || x(a.valueDomain, "encoding.valueDomain") <= 0 || o.height % 2 !== 0)
|
|
542
542
|
throw new Error("Invalid GeoVideo vector-luma encoding");
|
|
543
|
-
|
|
543
|
+
d = o.height / 2;
|
|
544
544
|
} else
|
|
545
545
|
throw new Error("Unsupported GeoVideo encoding");
|
|
546
546
|
const h = e.mask;
|
|
547
|
-
if (!h || h.kind !== "static-validity" || typeof h.url != "string" || !h.url || x(h.width, "mask.width") !== o.width || x(h.height, "mask.height") !==
|
|
547
|
+
if (!h || h.kind !== "static-validity" || typeof h.url != "string" || !h.url || x(h.width, "mask.width") !== o.width || x(h.height, "mask.height") !== d || x(h.threshold, "mask.threshold") < 0 || h.threshold > 1)
|
|
548
548
|
throw new Error("Invalid GeoVideo static mask");
|
|
549
549
|
if (e.timeline?.kind === "range") {
|
|
550
550
|
const m = B(e.timeline.dateStart, "timeline.dateStart");
|
|
@@ -569,19 +569,19 @@ function oe(t) {
|
|
|
569
569
|
const p = e.style?.colorDomain;
|
|
570
570
|
if (!Array.isArray(p) || p.length !== 2 || !p.every(Number.isFinite) || p[0] >= p[1])
|
|
571
571
|
throw new Error("Invalid GeoVideo color domain");
|
|
572
|
-
if (!
|
|
572
|
+
if (!K(e.id) || !e.provenance || !K(e.provenance.catalogEntryId) || !K(e.provenance.inputSourceId) || !Array.isArray(e.provenance.variables) || e.provenance.variables.length === 0)
|
|
573
573
|
throw new Error("Invalid GeoVideo provenance");
|
|
574
574
|
return { ...e, bounds: [i, r, n, s] };
|
|
575
575
|
}
|
|
576
|
-
async function
|
|
576
|
+
async function mt(t, e) {
|
|
577
577
|
if (typeof t != "string")
|
|
578
|
-
return
|
|
578
|
+
return le(t);
|
|
579
579
|
const i = await fetch(t, { signal: e });
|
|
580
580
|
if (!i.ok)
|
|
581
581
|
throw new Error(
|
|
582
582
|
`GeoVideo manifest request failed (${i.status}): ${t}`
|
|
583
583
|
);
|
|
584
|
-
const r = await i.json(), n =
|
|
584
|
+
const r = await i.json(), n = le(r), s = typeof document < "u" ? new URL(t, document.baseURI).href : t;
|
|
585
585
|
return {
|
|
586
586
|
...n,
|
|
587
587
|
media: { ...n.media, url: new URL(n.media.url, s).href },
|
|
@@ -602,40 +602,40 @@ function M(t) {
|
|
|
602
602
|
(n, s) => e + (i - e) * s / (r - 1)
|
|
603
603
|
);
|
|
604
604
|
}
|
|
605
|
-
function
|
|
605
|
+
function fe(t) {
|
|
606
606
|
return t.timeline.kind === "sample-sequence" ? t.timeline.values.length / t.media.durationSeconds : t.media.fps;
|
|
607
607
|
}
|
|
608
|
-
function
|
|
609
|
-
return e /
|
|
608
|
+
function _i(t, e) {
|
|
609
|
+
return e / fe(t);
|
|
610
610
|
}
|
|
611
|
-
function
|
|
611
|
+
function pt(t, e) {
|
|
612
612
|
if (t.timeline.kind === "snapshot-loop")
|
|
613
613
|
return 0;
|
|
614
614
|
if (t.timeline.kind === "sample-sequence") {
|
|
615
615
|
const s = M(t);
|
|
616
616
|
let o = 0;
|
|
617
|
-
for (let
|
|
618
|
-
Math.abs(s[
|
|
617
|
+
for (let c = 1; c < s.length; c += 1)
|
|
618
|
+
Math.abs(s[c] - e) < Math.abs(s[o] - e) && (o = c);
|
|
619
619
|
const a = t.media.durationSeconds / s.length;
|
|
620
620
|
return o * a + Math.min(a / 2, 0.5 / t.media.fps);
|
|
621
621
|
}
|
|
622
622
|
const i = new Date(t.timeline.dateStart).getTime(), r = new Date(t.timeline.dateEnd).getTime();
|
|
623
|
-
return Math.max(0, Math.min(1, (e - i) / (r - i))) *
|
|
623
|
+
return Math.max(0, Math.min(1, (e - i) / (r - i))) * me(t);
|
|
624
624
|
}
|
|
625
|
-
function
|
|
625
|
+
function xi(t, e) {
|
|
626
626
|
if (t.timeline.kind === "snapshot-loop")
|
|
627
627
|
return new Date(t.timeline.date).getTime();
|
|
628
628
|
if (t.timeline.kind === "sample-sequence") {
|
|
629
|
-
const o = M(t), a = t.media.durationSeconds / o.length,
|
|
630
|
-
return o[Math.max(0, Math.min(o.length - 1,
|
|
629
|
+
const o = M(t), a = t.media.durationSeconds / o.length, c = Math.floor((e + 0.25 / t.media.fps) / a);
|
|
630
|
+
return o[Math.max(0, Math.min(o.length - 1, c))];
|
|
631
631
|
}
|
|
632
|
-
const i = new Date(t.timeline.dateStart).getTime(), r = new Date(t.timeline.dateEnd).getTime(), n =
|
|
632
|
+
const i = new Date(t.timeline.dateStart).getTime(), r = new Date(t.timeline.dateEnd).getTime(), n = me(t), s = n > 0 ? Math.max(0, Math.min(1, e / n)) : 0;
|
|
633
633
|
return i + (r - i) * s;
|
|
634
634
|
}
|
|
635
|
-
function
|
|
635
|
+
function me(t) {
|
|
636
636
|
return Math.max(0, t.media.durationSeconds - 1 / t.media.fps);
|
|
637
637
|
}
|
|
638
|
-
function
|
|
638
|
+
function Et(t, e) {
|
|
639
639
|
const i = new Uint8Array(t.length / 4);
|
|
640
640
|
for (let r = 0; r < i.length; r++) {
|
|
641
641
|
const n = t[r * 4];
|
|
@@ -643,7 +643,7 @@ function mt(t, e) {
|
|
|
643
643
|
}
|
|
644
644
|
return i;
|
|
645
645
|
}
|
|
646
|
-
class
|
|
646
|
+
class gt {
|
|
647
647
|
constructor() {
|
|
648
648
|
this.gl = null, this.texture = null, this.framebuffer = null;
|
|
649
649
|
}
|
|
@@ -674,7 +674,7 @@ class pt {
|
|
|
674
674
|
return this.gl = r, this.texture = r.createTexture(), this.framebuffer = r.createFramebuffer(), r;
|
|
675
675
|
}
|
|
676
676
|
}
|
|
677
|
-
function
|
|
677
|
+
function de(t) {
|
|
678
678
|
const e = Math.max(4, Math.floor(t.length / 4 / 997) * 4);
|
|
679
679
|
for (let i = 3; i < t.length; i += e)
|
|
680
680
|
if (t[i] !== 0)
|
|
@@ -684,7 +684,7 @@ function ce(t) {
|
|
|
684
684
|
function g() {
|
|
685
685
|
return new DOMException("GeoVideo frame request was cancelled", "AbortError");
|
|
686
686
|
}
|
|
687
|
-
function
|
|
687
|
+
function N(t, e, i) {
|
|
688
688
|
return e ? e.aborted ? (t.catch(() => {
|
|
689
689
|
}), i?.(), Promise.reject(g())) : new Promise((r, n) => {
|
|
690
690
|
const s = () => {
|
|
@@ -695,23 +695,23 @@ function G(t, e, i) {
|
|
|
695
695
|
});
|
|
696
696
|
}) : t;
|
|
697
697
|
}
|
|
698
|
-
function
|
|
698
|
+
function Q(t, e) {
|
|
699
699
|
return new Promise(
|
|
700
700
|
(i) => t.addEventListener(e, () => i(), { once: !0 })
|
|
701
701
|
);
|
|
702
702
|
}
|
|
703
|
-
const
|
|
704
|
-
function
|
|
703
|
+
const Tt = 250;
|
|
704
|
+
function bt(t) {
|
|
705
705
|
return "requestVideoFrameCallback" in t ? Promise.race([
|
|
706
706
|
new Promise(
|
|
707
707
|
(e) => t.requestVideoFrameCallback(() => e())
|
|
708
708
|
),
|
|
709
|
-
new Promise((e) => setTimeout(e,
|
|
709
|
+
new Promise((e) => setTimeout(e, Tt))
|
|
710
710
|
]) : Promise.resolve();
|
|
711
711
|
}
|
|
712
|
-
class
|
|
712
|
+
class pe {
|
|
713
713
|
constructor(e, i, r = {}) {
|
|
714
|
-
this.reader = new
|
|
714
|
+
this.reader = new gt(), this.video = null, this.maskCodes = null, this.initPromise = null, this.presented = !1, this.primed = !1, this.queue = Promise.resolve(), this.frames = /* @__PURE__ */ new Map(), this.pending = /* @__PURE__ */ new Set(), this.manifest = e, this.planes = i, this.cacheSize = Math.max(1, r.cacheSize ?? 3), this.width = e.media.width, this.height = e.media.height / i, this.times = Float64Array.from(M(e));
|
|
715
715
|
}
|
|
716
716
|
/** Static validity, one 8-bit value per grid cell; null before init(). */
|
|
717
717
|
get mask() {
|
|
@@ -720,11 +720,11 @@ class me {
|
|
|
720
720
|
/** Luma codes of the presented frame, or null when it is blank. */
|
|
721
721
|
readCodes(e, i) {
|
|
722
722
|
const r = this.reader.read(e, this.width, i);
|
|
723
|
-
return
|
|
723
|
+
return de(r) ? null : Et(r, this.manifest.encoding.colorRange);
|
|
724
724
|
}
|
|
725
725
|
/** True when the decoder exposed no pixels; reads back one row only. */
|
|
726
726
|
isBlank(e) {
|
|
727
|
-
return
|
|
727
|
+
return de(this.reader.read(e, this.width, 1));
|
|
728
728
|
}
|
|
729
729
|
init() {
|
|
730
730
|
return this.initPromise ??= this.load().catch((e) => {
|
|
@@ -753,7 +753,7 @@ class me {
|
|
|
753
753
|
if (n ? (this.frames.delete(e), this.frames.set(e, n)) : n = this.enqueue(e), n.settled)
|
|
754
754
|
return n.promise;
|
|
755
755
|
const s = n;
|
|
756
|
-
return s.waiters++,
|
|
756
|
+
return s.waiters++, N(s.promise, r, () => this.leave(s));
|
|
757
757
|
}
|
|
758
758
|
enqueue(e) {
|
|
759
759
|
const i = new AbortController(), r = this.queue.then(
|
|
@@ -764,7 +764,7 @@ class me {
|
|
|
764
764
|
const n = {
|
|
765
765
|
index: e,
|
|
766
766
|
controller: i,
|
|
767
|
-
promise:
|
|
767
|
+
promise: N(r, i.signal),
|
|
768
768
|
waiters: 0,
|
|
769
769
|
settled: !1
|
|
770
770
|
};
|
|
@@ -831,8 +831,8 @@ class me {
|
|
|
831
831
|
async presentFrame(e, i) {
|
|
832
832
|
if (this.presented && Math.abs(e.currentTime - i) <= 1e-3 && !e.seeking)
|
|
833
833
|
return;
|
|
834
|
-
const r =
|
|
835
|
-
e.currentTime = i, await n, e.readyState < HTMLMediaElement.HAVE_CURRENT_DATA && await Promise.race([
|
|
834
|
+
const r = bt(e), n = Q(e, "seeked");
|
|
835
|
+
e.currentTime = i, await n, e.readyState < HTMLMediaElement.HAVE_CURRENT_DATA && await Promise.race([Q(e, "loadeddata"), Q(e, "canplay")]), await r, this.presented = !0;
|
|
836
836
|
}
|
|
837
837
|
/**
|
|
838
838
|
* Some mobile browsers expose no decoded pixels to WebGL until playback
|
|
@@ -849,7 +849,7 @@ class me {
|
|
|
849
849
|
}
|
|
850
850
|
/** Media time inside the video frame showing step `index`. */
|
|
851
851
|
stepSeconds(e) {
|
|
852
|
-
return this.manifest.timeline.kind === "snapshot-loop" ? e / this.manifest.media.fps :
|
|
852
|
+
return this.manifest.timeline.kind === "snapshot-loop" ? e / this.manifest.media.fps : pt(this.manifest, this.times[e]);
|
|
853
853
|
}
|
|
854
854
|
/**
|
|
855
855
|
* Seek and capture one step. `signal` aborts it between steps; a seek
|
|
@@ -877,14 +877,14 @@ class me {
|
|
|
877
877
|
return a;
|
|
878
878
|
}
|
|
879
879
|
}
|
|
880
|
-
function
|
|
880
|
+
function wt(t) {
|
|
881
881
|
return {
|
|
882
882
|
codeRange: [t.codeMin / 255, t.codeMax / 255],
|
|
883
883
|
valueRange: [t.valueMin, t.valueMax],
|
|
884
884
|
transfer: t.transfer === "log10-1p9" ? 1 : 0
|
|
885
885
|
};
|
|
886
886
|
}
|
|
887
|
-
class
|
|
887
|
+
class yt extends pe {
|
|
888
888
|
constructor(e, i = {}) {
|
|
889
889
|
if (e.encoding.kind !== "scalar-luma")
|
|
890
890
|
throw new Error("GeoVideoScalarSource requires a scalar-luma manifest");
|
|
@@ -910,15 +910,15 @@ function v(t, e) {
|
|
|
910
910
|
}
|
|
911
911
|
return { index: r, fraction: (e - t[r]) / (t[n] - t[r]) };
|
|
912
912
|
}
|
|
913
|
-
function
|
|
913
|
+
function Z(t, e) {
|
|
914
914
|
const { index: i, fraction: r } = v(t, e);
|
|
915
915
|
return i + r;
|
|
916
916
|
}
|
|
917
|
-
function
|
|
917
|
+
function Rt(t, e) {
|
|
918
918
|
const i = Math.max(0, Math.min(t.length - 1, Math.floor(e))), r = Math.min(i + 1, t.length - 1);
|
|
919
919
|
return t[i] + (t[r] - t[i]) * Math.max(0, e - i);
|
|
920
920
|
}
|
|
921
|
-
function
|
|
921
|
+
function W(t, e, i) {
|
|
922
922
|
const r = [];
|
|
923
923
|
let n = e;
|
|
924
924
|
for (; n + 8 <= i; ) {
|
|
@@ -937,7 +937,7 @@ function $(t, e, i) {
|
|
|
937
937
|
return r;
|
|
938
938
|
}
|
|
939
939
|
function b(t, e, i) {
|
|
940
|
-
const r =
|
|
940
|
+
const r = W(t, e.start, e.end).find(
|
|
941
941
|
(n) => n.type === i
|
|
942
942
|
);
|
|
943
943
|
if (!r)
|
|
@@ -945,21 +945,21 @@ function b(t, e, i) {
|
|
|
945
945
|
return r;
|
|
946
946
|
}
|
|
947
947
|
function V(t, e, i) {
|
|
948
|
-
return
|
|
948
|
+
return W(t, e.start, e.end).find((r) => r.type === i) ?? null;
|
|
949
949
|
}
|
|
950
|
-
function
|
|
950
|
+
function P(t, e) {
|
|
951
951
|
return { at: e.start + 8, count: t.getUint32(e.start + 4) };
|
|
952
952
|
}
|
|
953
|
-
function
|
|
953
|
+
function _t(t, e, i) {
|
|
954
954
|
const r = V(t, e, "edts"), n = r && V(t, r, "elst");
|
|
955
955
|
if (!n)
|
|
956
956
|
return;
|
|
957
|
-
const { at: s, count: o } =
|
|
957
|
+
const { at: s, count: o } = P(t, n), a = t.getUint8(n.start) === 1 ? Number(t.getBigInt64(s + 8)) : t.getInt32(s + 4);
|
|
958
958
|
if (o !== 1 || a !== i)
|
|
959
959
|
throw new Error("Unsupported MP4 edit list");
|
|
960
960
|
}
|
|
961
|
-
function
|
|
962
|
-
const e = new DataView(t), i = { type: "file", start: 0, end: t.byteLength }, r = b(e, i, "moov"), n =
|
|
961
|
+
function xt(t) {
|
|
962
|
+
const e = new DataView(t), i = { type: "file", start: 0, end: t.byteLength }, r = b(e, i, "moov"), n = W(e, r.start, r.end).find((f) => {
|
|
963
963
|
if (f.type !== "trak")
|
|
964
964
|
return !1;
|
|
965
965
|
const u = b(e, b(e, f, "mdia"), "hdlr");
|
|
@@ -971,67 +971,67 @@ function _t(t) {
|
|
|
971
971
|
e,
|
|
972
972
|
b(e, b(e, n, "mdia"), "minf"),
|
|
973
973
|
"stbl"
|
|
974
|
-
), o = b(e, s, "stsd"), [a] =
|
|
974
|
+
), o = b(e, s, "stsd"), [a] = W(e, o.start + 8, o.end);
|
|
975
975
|
if (!a || a.type !== "avc1" && a.type !== "avc3")
|
|
976
976
|
throw new Error(`Unsupported MP4 sample entry ${a?.type}`);
|
|
977
|
-
const
|
|
977
|
+
const c = e.getUint16(a.start + 24), l = e.getUint16(a.start + 26), d = b(e, { ...a, start: a.start + 78 }, "avcC"), h = new Uint8Array(t.slice(d.start, d.end)), p = (f) => h[f].toString(16).padStart(2, "0"), m = `avc1.${p(1)}${p(2)}${p(3)}`, E = b(e, s, "stsz"), w = e.getUint32(E.start + 4), y = e.getUint32(E.start + 8), k = Array.from(
|
|
978
978
|
{ length: y },
|
|
979
979
|
(f, u) => w || e.getUint32(E.start + 12 + u * 4)
|
|
980
|
-
),
|
|
980
|
+
), G = V(e, s, "co64"), O = G ?? b(e, s, "stco"), U = P(e, O), T = Array.from(
|
|
981
981
|
{ length: U.count },
|
|
982
|
-
(f, u) =>
|
|
983
|
-
),
|
|
984
|
-
for (let f = 0; f <
|
|
985
|
-
const u =
|
|
986
|
-
for (let L = I; L <
|
|
982
|
+
(f, u) => G ? Number(e.getBigUint64(U.at + u * 8)) : e.getUint32(U.at + u * 4)
|
|
983
|
+
), R = P(e, b(e, s, "stsc")), F = [];
|
|
984
|
+
for (let f = 0; f < R.count; f++) {
|
|
985
|
+
const u = R.at + f * 12, I = e.getUint32(u) - 1, _ = e.getUint32(u + 4), j = f + 1 < R.count ? e.getUint32(u + 12) - 1 : T.length;
|
|
986
|
+
for (let L = I; L < j; L++) {
|
|
987
987
|
let C = T[L];
|
|
988
|
-
for (let
|
|
989
|
-
F.push(C), C +=
|
|
988
|
+
for (let re = 0; re < _ && F.length < y; re++)
|
|
989
|
+
F.push(C), C += k[F.length - 1];
|
|
990
990
|
}
|
|
991
991
|
}
|
|
992
|
-
const S =
|
|
993
|
-
let
|
|
992
|
+
const S = P(e, b(e, s, "stts")), A = [];
|
|
993
|
+
let D = 0;
|
|
994
994
|
for (let f = 0; f < S.count; f++) {
|
|
995
995
|
const u = e.getUint32(S.at + f * 8), I = e.getUint32(S.at + f * 8 + 4);
|
|
996
|
-
for (let
|
|
997
|
-
|
|
996
|
+
for (let _ = 0; _ < u; _++)
|
|
997
|
+
A.push(D), D += I;
|
|
998
998
|
}
|
|
999
|
-
const
|
|
1000
|
-
if (
|
|
1001
|
-
const f = e.getUint8(
|
|
999
|
+
const z = V(e, s, "ctts");
|
|
1000
|
+
if (z) {
|
|
1001
|
+
const f = e.getUint8(z.start) === 1, u = P(e, z);
|
|
1002
1002
|
let I = 0;
|
|
1003
|
-
for (let
|
|
1004
|
-
const
|
|
1005
|
-
for (let C = 0; C <
|
|
1006
|
-
|
|
1003
|
+
for (let _ = 0; _ < u.count; _++) {
|
|
1004
|
+
const j = e.getUint32(u.at + _ * 8), L = f ? e.getInt32(u.at + _ * 8 + 4) : e.getUint32(u.at + _ * 8 + 4);
|
|
1005
|
+
for (let C = 0; C < j; C++)
|
|
1006
|
+
A[I++] += L;
|
|
1007
1007
|
}
|
|
1008
1008
|
}
|
|
1009
|
-
|
|
1010
|
-
const
|
|
1011
|
-
|
|
1012
|
-
const
|
|
1013
|
-
if (
|
|
1014
|
-
const f =
|
|
1009
|
+
_t(e, n, Math.min(...A.slice(0, y)));
|
|
1010
|
+
const be = A.slice(0, y).map((f, u) => [f, u]).sort((f, u) => f[0] - u[0]), te = new Array(y);
|
|
1011
|
+
be.forEach(([, f], u) => te[f] = u);
|
|
1012
|
+
const Y = V(e, s, "stss"), ie = /* @__PURE__ */ new Set();
|
|
1013
|
+
if (Y) {
|
|
1014
|
+
const f = P(e, Y);
|
|
1015
1015
|
for (let u = 0; u < f.count; u++)
|
|
1016
|
-
|
|
1016
|
+
ie.add(e.getUint32(f.at + u * 4) - 1);
|
|
1017
1017
|
}
|
|
1018
|
-
if (F.length !== y ||
|
|
1018
|
+
if (F.length !== y || A.length < y)
|
|
1019
1019
|
throw new Error("Inconsistent MP4 sample tables");
|
|
1020
1020
|
return {
|
|
1021
1021
|
codec: m,
|
|
1022
1022
|
description: h,
|
|
1023
|
-
width:
|
|
1024
|
-
height:
|
|
1025
|
-
samples:
|
|
1023
|
+
width: c,
|
|
1024
|
+
height: l,
|
|
1025
|
+
samples: k.map((f, u) => ({
|
|
1026
1026
|
offset: F[u],
|
|
1027
1027
|
size: f,
|
|
1028
|
-
frame:
|
|
1029
|
-
key:
|
|
1028
|
+
frame: te[u],
|
|
1029
|
+
key: Y ? ie.has(u) : !0
|
|
1030
1030
|
}))
|
|
1031
1031
|
};
|
|
1032
1032
|
}
|
|
1033
|
-
const
|
|
1034
|
-
class
|
|
1033
|
+
const vt = 50;
|
|
1034
|
+
class At extends yt {
|
|
1035
1035
|
constructor() {
|
|
1036
1036
|
super(...arguments), this.track = null, this.data = null, this.sampleOfFrame = [], this.decoder = null, this.fed = -1, this.taken = -1, this.outputs = /* @__PURE__ */ new Map(), this.progress = null, this.failure = null, this.loading = null;
|
|
1037
1037
|
}
|
|
@@ -1054,7 +1054,7 @@ class xt extends bt {
|
|
|
1054
1054
|
const r = await i.arrayBuffer();
|
|
1055
1055
|
let n;
|
|
1056
1056
|
try {
|
|
1057
|
-
n =
|
|
1057
|
+
n = xt(r);
|
|
1058
1058
|
} catch {
|
|
1059
1059
|
return this.loading === e ? super.loadMedia() : void 0;
|
|
1060
1060
|
}
|
|
@@ -1155,7 +1155,7 @@ class xt extends bt {
|
|
|
1155
1155
|
/** Next output, dequeue or error; a timer for decoders without events. */
|
|
1156
1156
|
waitProgress() {
|
|
1157
1157
|
return new Promise((e) => {
|
|
1158
|
-
const i = setTimeout(r,
|
|
1158
|
+
const i = setTimeout(r, vt);
|
|
1159
1159
|
function r() {
|
|
1160
1160
|
clearTimeout(i), e();
|
|
1161
1161
|
}
|
|
@@ -1173,42 +1173,42 @@ class xt extends bt {
|
|
|
1173
1173
|
this.outputs.clear();
|
|
1174
1174
|
}
|
|
1175
1175
|
}
|
|
1176
|
-
function
|
|
1176
|
+
function kt(t, e) {
|
|
1177
1177
|
let i = (t - e.codeMin) / (e.codeMax - e.codeMin) * 2 - 1;
|
|
1178
1178
|
return i = Math.max(-1, Math.min(1, i)), e.transfer === "sqrt" && (i = Math.sign(i) * i * i), i * e.valueDomain;
|
|
1179
1179
|
}
|
|
1180
|
-
function
|
|
1180
|
+
function Ft(t, e, i, r) {
|
|
1181
1181
|
const n = e.length;
|
|
1182
1182
|
if (t.length !== 2 * n)
|
|
1183
1183
|
throw new Error(
|
|
1184
1184
|
`GeoVideo vector frame has ${t.length} codes, expected ${2 * n}`
|
|
1185
1185
|
);
|
|
1186
1186
|
const s = new Float32Array(256);
|
|
1187
|
-
for (let
|
|
1188
|
-
s[
|
|
1189
|
-
const o = i * 255, a = new Float32Array(n),
|
|
1190
|
-
for (let
|
|
1191
|
-
const
|
|
1192
|
-
a[
|
|
1187
|
+
for (let l = 0; l < 256; l++)
|
|
1188
|
+
s[l] = kt(l, r);
|
|
1189
|
+
const o = i * 255, a = new Float32Array(n), c = new Float32Array(n);
|
|
1190
|
+
for (let l = 0; l < n; l++) {
|
|
1191
|
+
const d = e[l] >= o;
|
|
1192
|
+
a[l] = d ? s[t[l]] : NaN, c[l] = d ? s[t[n + l]] : NaN;
|
|
1193
1193
|
}
|
|
1194
|
-
return { u: a, v:
|
|
1194
|
+
return { u: a, v: c };
|
|
1195
1195
|
}
|
|
1196
|
-
class
|
|
1196
|
+
class St extends pe {
|
|
1197
1197
|
constructor(e, i = {}) {
|
|
1198
1198
|
if (e.encoding.kind !== "vector-luma")
|
|
1199
1199
|
throw new Error("GeoVideoVectorSource requires a vector-luma manifest");
|
|
1200
1200
|
super(e, 2, i), this.encoding = e.encoding;
|
|
1201
|
-
const [r, n, s, o] = e.bounds, a = (s - r) / this.width,
|
|
1201
|
+
const [r, n, s, o] = e.bounds, a = (s - r) / this.width, c = (o - n) / this.height;
|
|
1202
1202
|
this.coords = {
|
|
1203
1203
|
time: this.times,
|
|
1204
1204
|
vertical: new Float32Array([0]),
|
|
1205
1205
|
latitude: Float32Array.from(
|
|
1206
1206
|
{ length: this.height },
|
|
1207
|
-
(
|
|
1207
|
+
(l, d) => o - (d + 0.5) * c
|
|
1208
1208
|
),
|
|
1209
1209
|
longitude: Float32Array.from(
|
|
1210
1210
|
{ length: this.width },
|
|
1211
|
-
(
|
|
1211
|
+
(l, d) => r + (d + 0.5) * a
|
|
1212
1212
|
)
|
|
1213
1213
|
};
|
|
1214
1214
|
}
|
|
@@ -1260,7 +1260,7 @@ class At extends me {
|
|
|
1260
1260
|
/** u/v codes are written into luma: read back, then decoded on the CPU. */
|
|
1261
1261
|
async capture(e, i, r) {
|
|
1262
1262
|
const n = this.readCodes(e, i);
|
|
1263
|
-
return n ?
|
|
1263
|
+
return n ? Ft(
|
|
1264
1264
|
n,
|
|
1265
1265
|
r,
|
|
1266
1266
|
this.manifest.mask.threshold,
|
|
@@ -1268,15 +1268,15 @@ class At extends me {
|
|
|
1268
1268
|
) : null;
|
|
1269
1269
|
}
|
|
1270
1270
|
}
|
|
1271
|
-
function
|
|
1272
|
-
const [r, n] = i.range ?? [-1 / 0, 1 / 0], s = [...t].sort((a,
|
|
1271
|
+
function Ut(t, e, i = {}) {
|
|
1272
|
+
const [r, n] = i.range ?? [-1 / 0, 1 / 0], s = [...t].sort((a, c) => a.start - c.start), o = s.find(
|
|
1273
1273
|
(a) => a.start > e && a.start <= n
|
|
1274
1274
|
) ?? (i.loop ? s.find(
|
|
1275
1275
|
(a) => a.end >= r && a.start <= n
|
|
1276
1276
|
) : void 0);
|
|
1277
1277
|
return o ? { chunk: o, time: Math.max(o.start, r) } : null;
|
|
1278
1278
|
}
|
|
1279
|
-
function
|
|
1279
|
+
function Mt(t, e) {
|
|
1280
1280
|
let i = null, r = -1 / 0;
|
|
1281
1281
|
for (const n of e) {
|
|
1282
1282
|
const s = Math.min(t.end, n.end) - Math.max(t.start, n.start);
|
|
@@ -1284,7 +1284,7 @@ function St(t, e) {
|
|
|
1284
1284
|
}
|
|
1285
1285
|
return i;
|
|
1286
1286
|
}
|
|
1287
|
-
function
|
|
1287
|
+
function Dt(t) {
|
|
1288
1288
|
return {
|
|
1289
1289
|
width: t.mask.width,
|
|
1290
1290
|
height: t.mask.height,
|
|
@@ -1292,11 +1292,11 @@ function Ut(t) {
|
|
|
1292
1292
|
rowOrder: "north-to-south"
|
|
1293
1293
|
};
|
|
1294
1294
|
}
|
|
1295
|
-
function
|
|
1296
|
-
return t.encoding.kind === "vector-luma" ? new
|
|
1295
|
+
function Ee(t, e = {}) {
|
|
1296
|
+
return t.encoding.kind === "vector-luma" ? new St(t, e) : new At(t, e);
|
|
1297
1297
|
}
|
|
1298
|
-
const
|
|
1299
|
-
function
|
|
1298
|
+
const Pt = 3, Nt = 3, Gt = 0.6, It = 1.5;
|
|
1299
|
+
function Lt(t) {
|
|
1300
1300
|
const e = new AbortController();
|
|
1301
1301
|
if (!t)
|
|
1302
1302
|
return { controller: e, unlink: () => {
|
|
@@ -1307,14 +1307,14 @@ function Nt(t) {
|
|
|
1307
1307
|
unlink: () => t.removeEventListener("abort", i)
|
|
1308
1308
|
};
|
|
1309
1309
|
}
|
|
1310
|
-
class
|
|
1310
|
+
class vi {
|
|
1311
1311
|
constructor(e) {
|
|
1312
1312
|
this.manifests = /* @__PURE__ */ new Map(), this.open = /* @__PURE__ */ new Map(), this.id = e.id, this.chunks = e.chunks.filter(
|
|
1313
1313
|
(i) => Number.isFinite(i.start) && Number.isFinite(i.end) && i.end >= i.start
|
|
1314
|
-
).sort((i, r) => i.start - r.start), this.maxOpenChunks = Math.max(2, e.maxOpenChunks ??
|
|
1314
|
+
).sort((i, r) => i.start - r.start), this.maxOpenChunks = Math.max(2, e.maxOpenChunks ?? Pt), this.frameCacheSize = Math.max(
|
|
1315
1315
|
1,
|
|
1316
|
-
e.frameCacheSize ??
|
|
1317
|
-
), this.prefetchAt = e.prefetchAt ??
|
|
1316
|
+
e.frameCacheSize ?? Nt
|
|
1317
|
+
), this.prefetchAt = e.prefetchAt ?? Gt, this.maxGap = e.maxGap, this.loadManifest = e.loadManifest ?? mt, this.createFrameSource = e.createFrameSource ?? ((i, r) => Ee(
|
|
1318
1318
|
i,
|
|
1319
1319
|
r
|
|
1320
1320
|
));
|
|
@@ -1333,7 +1333,7 @@ class _i {
|
|
|
1333
1333
|
async steps(e = {}) {
|
|
1334
1334
|
if (e.signal?.aborted)
|
|
1335
1335
|
throw g();
|
|
1336
|
-
const i = await
|
|
1336
|
+
const i = await N(
|
|
1337
1337
|
Promise.all(this.chunks.map((r) => this.manifest(r))),
|
|
1338
1338
|
e.signal
|
|
1339
1339
|
);
|
|
@@ -1350,24 +1350,24 @@ class _i {
|
|
|
1350
1350
|
const s = this.chunkIndexAt(e);
|
|
1351
1351
|
if (s < 0)
|
|
1352
1352
|
return null;
|
|
1353
|
-
const o = [], { controller: a, unlink:
|
|
1353
|
+
const o = [], { controller: a, unlink: c } = Lt(r);
|
|
1354
1354
|
try {
|
|
1355
|
-
const
|
|
1355
|
+
const l = this.acquire(this.chunks[s], o), d = await N(l.ready, a.signal), { times: h } = d;
|
|
1356
1356
|
let p;
|
|
1357
1357
|
if (e <= h[h.length - 1]) {
|
|
1358
|
-
const { index: T, fraction:
|
|
1359
|
-
p = n === "discrete" ||
|
|
1358
|
+
const { index: T, fraction: R } = v(h, e);
|
|
1359
|
+
p = n === "discrete" || R === 0 ? [l, T, l, T, 0] : [l, T, l, T + 1, R];
|
|
1360
1360
|
} else {
|
|
1361
1361
|
const T = this.chunks[s + 1];
|
|
1362
1362
|
if (!T)
|
|
1363
1363
|
return null;
|
|
1364
|
-
const
|
|
1365
|
-
if (
|
|
1364
|
+
const R = this.acquire(T, o), F = await N(R.ready, a.signal), S = h.length - 1, A = h[S], D = F.times[0];
|
|
1365
|
+
if (D - A > this.gapLimit(h, F.times))
|
|
1366
1366
|
return null;
|
|
1367
|
-
p = n === "discrete" ? [
|
|
1367
|
+
p = n === "discrete" ? [l, S, l, S, 0] : e >= D ? [R, 0, R, 0, 0] : [l, S, R, 0, (e - A) / (D - A)];
|
|
1368
1368
|
}
|
|
1369
|
-
const [m, E, w, y,
|
|
1370
|
-
|
|
1369
|
+
const [m, E, w, y, k] = p, G = m === w && E === y, O = [this.frame(m, E, a.signal)];
|
|
1370
|
+
G || O.push(this.frame(w, y, a.signal));
|
|
1371
1371
|
let U;
|
|
1372
1372
|
try {
|
|
1373
1373
|
U = await Promise.all(O);
|
|
@@ -1377,13 +1377,13 @@ class _i {
|
|
|
1377
1377
|
return this.prefetchAfter(s, e), {
|
|
1378
1378
|
time: e,
|
|
1379
1379
|
a: U[0],
|
|
1380
|
-
b: U[
|
|
1381
|
-
mix:
|
|
1380
|
+
b: U[G ? 0 : 1],
|
|
1381
|
+
mix: k
|
|
1382
1382
|
};
|
|
1383
1383
|
} finally {
|
|
1384
|
-
|
|
1385
|
-
for (const
|
|
1386
|
-
|
|
1384
|
+
c();
|
|
1385
|
+
for (const l of o)
|
|
1386
|
+
l.users--;
|
|
1387
1387
|
this.trim();
|
|
1388
1388
|
}
|
|
1389
1389
|
}
|
|
@@ -1417,7 +1417,7 @@ class _i {
|
|
|
1417
1417
|
e.length > 1 ? e[e.length - 1] - e[e.length - 2] : 0,
|
|
1418
1418
|
i.length > 1 ? i[1] - i[0] : 0
|
|
1419
1419
|
], n = Math.max(...r);
|
|
1420
|
-
return n > 0 ? n *
|
|
1420
|
+
return n > 0 ? n * It : -1 / 0;
|
|
1421
1421
|
}
|
|
1422
1422
|
prefetchAfter(e, i) {
|
|
1423
1423
|
const r = this.chunks[e], n = this.chunks[e + 1], s = r.end - r.start, o = s > 0 ? (i - r.start) / s : 1;
|
|
@@ -1454,7 +1454,7 @@ class _i {
|
|
|
1454
1454
|
return r.opened = {
|
|
1455
1455
|
manifest: n,
|
|
1456
1456
|
times: Float64Array.from(M(n)),
|
|
1457
|
-
grid:
|
|
1457
|
+
grid: Dt(n),
|
|
1458
1458
|
source: this.createFrameSource(n, {
|
|
1459
1459
|
cacheSize: this.frameCacheSize
|
|
1460
1460
|
})
|
|
@@ -1466,19 +1466,19 @@ class _i {
|
|
|
1466
1466
|
return this.open.set(e.key, i), i;
|
|
1467
1467
|
}
|
|
1468
1468
|
async frame(e, i, r) {
|
|
1469
|
-
const { manifest: n, times: s, grid: o, source: a } = await
|
|
1469
|
+
const { manifest: n, times: s, grid: o, source: a } = await N(
|
|
1470
1470
|
e.ready,
|
|
1471
1471
|
r
|
|
1472
1472
|
);
|
|
1473
1473
|
if (e.released)
|
|
1474
1474
|
throw g();
|
|
1475
|
-
const
|
|
1475
|
+
const c = await a.frame(i, { signal: r });
|
|
1476
1476
|
return {
|
|
1477
1477
|
key: `${this.id}/${e.chunk.key}/${i}`,
|
|
1478
1478
|
chunk: e.chunk,
|
|
1479
1479
|
step: i,
|
|
1480
1480
|
time: s[i],
|
|
1481
|
-
data:
|
|
1481
|
+
data: c,
|
|
1482
1482
|
grid: o,
|
|
1483
1483
|
manifest: n
|
|
1484
1484
|
};
|
|
@@ -1496,18 +1496,18 @@ class _i {
|
|
|
1496
1496
|
e.released = !0, e.prefetch?.abort(), e.prefetch = null, e.opened?.source.release(), e.opened = null, this.open.get(e.chunk.key) === e && this.open.delete(e.chunk.key);
|
|
1497
1497
|
}
|
|
1498
1498
|
}
|
|
1499
|
-
const
|
|
1499
|
+
const Ct = {
|
|
1500
1500
|
a: "u_vel0",
|
|
1501
1501
|
b: "u_vel1",
|
|
1502
1502
|
mix: "u_vel_mix",
|
|
1503
1503
|
bounds: "u_bounds"
|
|
1504
|
-
},
|
|
1504
|
+
}, Vt = {
|
|
1505
1505
|
a: "u_tint0",
|
|
1506
1506
|
b: "u_tint1",
|
|
1507
1507
|
mix: "u_tint_mix",
|
|
1508
1508
|
bounds: "u_tint_bounds"
|
|
1509
1509
|
};
|
|
1510
|
-
function
|
|
1510
|
+
function Ot(t) {
|
|
1511
1511
|
const e = new Float32Array(t.u.length * 4);
|
|
1512
1512
|
for (let i = 0; i < t.u.length; i++) {
|
|
1513
1513
|
const r = t.u[i], n = t.v[i];
|
|
@@ -1515,9 +1515,9 @@ function Ct(t) {
|
|
|
1515
1515
|
}
|
|
1516
1516
|
return e;
|
|
1517
1517
|
}
|
|
1518
|
-
class
|
|
1518
|
+
class Bt {
|
|
1519
1519
|
constructor(e, i, r = {}) {
|
|
1520
|
-
this.gl = e, this.manifest = i, this.options = r, this.textures = /* @__PURE__ */ new Map(), this.pending = /* @__PURE__ */ new Map(), this.mask = null, this.pair = null, this.destroyed = !1, this.linearFilter = !0, this.uploadedFrames = 0, this.lastUploadDurationMs = 0, this.vector = i.encoding.kind === "vector-luma", this.source =
|
|
1520
|
+
this.gl = e, this.manifest = i, this.options = r, this.textures = /* @__PURE__ */ new Map(), this.pending = /* @__PURE__ */ new Map(), this.mask = null, this.pair = null, this.destroyed = !1, this.linearFilter = !0, this.uploadedFrames = 0, this.lastUploadDurationMs = 0, this.vector = i.encoding.kind === "vector-luma", this.source = Ee(i, { cacheSize: 2 }), this.uniforms = this.vector ? Ct : Vt;
|
|
1521
1521
|
const n = M(i);
|
|
1522
1522
|
this.times = r.animateSnapshot && i.timeline.kind === "snapshot-loop" ? Array.from(
|
|
1523
1523
|
{
|
|
@@ -1574,12 +1574,12 @@ class Vt {
|
|
|
1574
1574
|
*/
|
|
1575
1575
|
sample(e, i = !0) {
|
|
1576
1576
|
const { index: r, fraction: n } = v(this.times, e), s = Math.min(r + 1, this.times.length - 1);
|
|
1577
|
-
[...this.pending.keys()].some((
|
|
1578
|
-
for (const
|
|
1579
|
-
|
|
1577
|
+
[...this.pending.keys()].some((l) => l < r || l > s + 1) && (this.source.cancelAll(), this.pending.clear());
|
|
1578
|
+
for (const l of [r, s, s + 1])
|
|
1579
|
+
l < this.times.length && this.request(l).catch(() => {
|
|
1580
1580
|
});
|
|
1581
|
-
const o = this.textures.get(r), a = this.textures.get(s),
|
|
1582
|
-
return o && (
|
|
1581
|
+
const o = this.textures.get(r), a = this.textures.get(s), c = i ? n : 0;
|
|
1582
|
+
return o && (c === 0 || a) && (this.pair = [o, c === 0 ? o : a, c]), this.evict(r), this.pair;
|
|
1583
1583
|
}
|
|
1584
1584
|
/** Switch spatial filtering without changing the decoded-step cache. */
|
|
1585
1585
|
setFilter(e) {
|
|
@@ -1612,7 +1612,7 @@ class Vt {
|
|
|
1612
1612
|
return !1;
|
|
1613
1613
|
const n = this.uniforms;
|
|
1614
1614
|
if (e.texture(n.a, r, this.pair[0]), e.texture(n.b, r + 1, this.pair[1]), e.float(n.mix, this.pair[2]), e.vec4(n.bounds, this.bounds), this.mask && this.manifest.encoding.kind === "scalar-luma") {
|
|
1615
|
-
const { codeRange: s, valueRange: o, transfer: a } =
|
|
1615
|
+
const { codeRange: s, valueRange: o, transfer: a } = wt(
|
|
1616
1616
|
this.manifest.encoding
|
|
1617
1617
|
);
|
|
1618
1618
|
e.texture("u_tint_mask", r + 2, this.mask), e.vec2("u_code_range", ...s), e.vec2("u_value_range", ...o), e.float("u_scalar_transfer", a);
|
|
@@ -1669,7 +1669,7 @@ class Vt {
|
|
|
1669
1669
|
0,
|
|
1670
1670
|
i.RGBA,
|
|
1671
1671
|
i.FLOAT,
|
|
1672
|
-
|
|
1672
|
+
Ot(e)
|
|
1673
1673
|
) : (i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL, !1), i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !1), i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL, i.NONE), i.texImage2D(
|
|
1674
1674
|
i.TEXTURE_2D,
|
|
1675
1675
|
0,
|
|
@@ -1722,7 +1722,7 @@ class Vt {
|
|
|
1722
1722
|
}
|
|
1723
1723
|
}
|
|
1724
1724
|
}
|
|
1725
|
-
class
|
|
1725
|
+
class Xt {
|
|
1726
1726
|
constructor(e, i) {
|
|
1727
1727
|
this.onPlaying = i, this.time = 0, this.endFraction = 0, this.held = !1, this.playingValue = e;
|
|
1728
1728
|
}
|
|
@@ -1754,33 +1754,33 @@ class Ot {
|
|
|
1754
1754
|
advance(e, i, r, n = [i[0], i[i.length - 1]], s = !1, o = !1) {
|
|
1755
1755
|
if (!this.advancing || !i.length)
|
|
1756
1756
|
return !1;
|
|
1757
|
-
const a =
|
|
1758
|
-
let
|
|
1759
|
-
const h = o ?
|
|
1760
|
-
return h && s &&
|
|
1757
|
+
const a = Z(i, n[0]), c = Z(i, n[1]), l = c + (o ? 1 : 0);
|
|
1758
|
+
let d = Math.max(a, Z(i, this.ms) + this.endFraction) + Math.max(0, e) * r;
|
|
1759
|
+
const h = o ? d >= l : d > l;
|
|
1760
|
+
return h && s && l > a ? d = a + (d - a) % (l - a) : d = Math.min(l, d), this.time = Rt(i, Math.min(c, d)), this.endFraction = Math.max(0, d - c), h && !s;
|
|
1761
1761
|
}
|
|
1762
1762
|
}
|
|
1763
1763
|
function X(t) {
|
|
1764
1764
|
const e = M(t);
|
|
1765
1765
|
return [e[0], e[e.length - 1]];
|
|
1766
1766
|
}
|
|
1767
|
-
function
|
|
1767
|
+
function J(t, e) {
|
|
1768
1768
|
return e ? [Math.max(t[0], e[0]), Math.min(t[1], e[1])] : t;
|
|
1769
1769
|
}
|
|
1770
|
-
function
|
|
1770
|
+
function $([t, e], i) {
|
|
1771
1771
|
return Math.max(t, Math.min(e, i));
|
|
1772
1772
|
}
|
|
1773
|
-
class
|
|
1773
|
+
class Ai {
|
|
1774
1774
|
constructor(e, i, r) {
|
|
1775
1775
|
this.repaint = i, this.emit = r, this.field = null, this.manifest = null, this.gl = null, this.pendingField = null, this.standby = null, this.awaitingNext = !1, this.timeRange = null, this.lastTick = null, this.lastStepTime = null, this.seekId = 0, this.seeking = !1, this.failed = !1, this.exactTime = 0, this.endEmitted = !1, this.destroyed = !1, this.resumePlayback = !1, this.playOnReady = e.autoplay ?? !0, this.loop = e.loop ?? !0, this.playbackRate = e.playbackRate ?? 1, this.stepsPerSecond = e.stepsPerSecond;
|
|
1776
1776
|
const n = typeof e.time == "string" ? Date.parse(e.time) : e.time;
|
|
1777
|
-
this.requestedTime = n != null && Number.isFinite(n) ? n : null, this.requestedTimeRange = e.timeRange, this.clock = new
|
|
1777
|
+
this.requestedTime = n != null && Number.isFinite(n) ? n : null, this.requestedTimeRange = e.timeRange, this.clock = new Xt(
|
|
1778
1778
|
!1,
|
|
1779
1779
|
(s) => this.emit("playbackChange", s)
|
|
1780
1780
|
);
|
|
1781
1781
|
}
|
|
1782
1782
|
async load(e, i) {
|
|
1783
|
-
if (this.gl = e, this.manifest = i, this.timeRange =
|
|
1783
|
+
if (this.gl = e, this.manifest = i, this.timeRange = J(
|
|
1784
1784
|
X(i),
|
|
1785
1785
|
this.requestedTimeRange
|
|
1786
1786
|
), this.timeRange[0] > this.timeRange[1])
|
|
@@ -1840,11 +1840,11 @@ class Ri {
|
|
|
1840
1840
|
const r = this.clock.advance(
|
|
1841
1841
|
i,
|
|
1842
1842
|
this.field.times,
|
|
1843
|
-
this.stepsPerSecond ?? this.playbackRate *
|
|
1843
|
+
this.stepsPerSecond ?? this.playbackRate * fe(this.field.manifest),
|
|
1844
1844
|
this.playbackRange(this.field),
|
|
1845
1845
|
this.loop,
|
|
1846
1846
|
!0
|
|
1847
|
-
), { index: n } = v(this.field.times, this.clock.ms), s = this.field.manifest.timeline.kind === "snapshot-loop" ? this.field.times[0] :
|
|
1847
|
+
), { index: n } = v(this.field.times, this.clock.ms), s = this.field.manifest.timeline.kind === "snapshot-loop" ? this.field.times[0] : $(this.timeRange, this.field.times[n]);
|
|
1848
1848
|
s !== this.lastStepTime && (this.lastStepTime = s, this.emit("timeChange", s)), r ? this.reachEnd() : this.repaint();
|
|
1849
1849
|
}
|
|
1850
1850
|
setTime(e) {
|
|
@@ -1858,27 +1858,27 @@ class Ri {
|
|
|
1858
1858
|
/** Load the requested step first; stale seeks and swaps cannot replace it. */
|
|
1859
1859
|
async prepare(e, i) {
|
|
1860
1860
|
this.failed = !1;
|
|
1861
|
-
const r = ++this.seekId, n = this.timeRange ?? X(e.manifest), s = i ??
|
|
1861
|
+
const r = ++this.seekId, n = this.timeRange ?? X(e.manifest), s = i ?? $(n, this.requestedTime ?? n[0]), o = v(e.times, s), a = Math.min(
|
|
1862
1862
|
e.times.length - 1,
|
|
1863
1863
|
o.index + (o.fraction > 0.5 ? 1 : 0)
|
|
1864
|
-
),
|
|
1865
|
-
this.seeking = !0, this.lastTick = null, e.focus(
|
|
1864
|
+
), c = e.times[a];
|
|
1865
|
+
this.seeking = !0, this.lastTick = null, e.focus(c);
|
|
1866
1866
|
try {
|
|
1867
|
-
await e.prime(
|
|
1868
|
-
} catch (
|
|
1867
|
+
await e.prime(c);
|
|
1868
|
+
} catch (d) {
|
|
1869
1869
|
if (r !== this.seekId)
|
|
1870
1870
|
return;
|
|
1871
|
-
throw
|
|
1871
|
+
throw d;
|
|
1872
1872
|
}
|
|
1873
1873
|
if (r !== this.seekId || this.destroyed)
|
|
1874
1874
|
return;
|
|
1875
|
-
const
|
|
1876
|
-
if (
|
|
1877
|
-
const
|
|
1875
|
+
const l = this.pendingField === e;
|
|
1876
|
+
if (l && (this.field?.destroy(), this.field = e, this.pendingField = null, this.lastStepTime = null), this.exactTime = c, this.clock.ms = $(this.playbackRange(e), c), e.sample(c, !1), this.seeking = !1, this.endEmitted = !1, this.repaint(), l) {
|
|
1877
|
+
const d = e.manifest;
|
|
1878
1878
|
if (this.emit("loaded", {
|
|
1879
|
-
min:
|
|
1880
|
-
max:
|
|
1881
|
-
unit:
|
|
1879
|
+
min: d.style.colorDomain[0],
|
|
1880
|
+
max: d.style.colorDomain[1],
|
|
1881
|
+
unit: d.style.unit ?? "",
|
|
1882
1882
|
time: new Date(this.clock.ms).toISOString()
|
|
1883
1883
|
}), this.emit("status", { phase: "ready", time: this.clock.ms }), this.playOnReady) {
|
|
1884
1884
|
this.playOnReady = !1;
|
|
@@ -1903,7 +1903,7 @@ class Ri {
|
|
|
1903
1903
|
const r = this.replacementTimeRange(e, i);
|
|
1904
1904
|
if (!r || !this.gl || e.media.url === this.manifest?.media.url)
|
|
1905
1905
|
return !1;
|
|
1906
|
-
const n =
|
|
1906
|
+
const n = $(r, i.time ?? r[0]);
|
|
1907
1907
|
this.standby?.field.manifest.media.url !== e.media.url && (this.discardStandby(), this.standby = { field: this.createField(e), time: n });
|
|
1908
1908
|
const s = this.standby;
|
|
1909
1909
|
return s.time = n, s.field.focus(n), s.field.prime(n).catch(() => {
|
|
@@ -1918,7 +1918,7 @@ class Ri {
|
|
|
1918
1918
|
const r = this.manifest;
|
|
1919
1919
|
if (!r || e.encoding.kind !== r.encoding.kind || e.media.width !== r.media.width || e.media.height !== r.media.height || e.mask.width !== r.mask.width || e.mask.height !== r.mask.height)
|
|
1920
1920
|
return null;
|
|
1921
|
-
const n =
|
|
1921
|
+
const n = J(
|
|
1922
1922
|
X(e),
|
|
1923
1923
|
i.timeRange
|
|
1924
1924
|
);
|
|
@@ -1964,7 +1964,7 @@ class Ri {
|
|
|
1964
1964
|
setTimeRange(e) {
|
|
1965
1965
|
if (!Number.isFinite(e[0]) || !Number.isFinite(e[1]) || e[0] > e[1])
|
|
1966
1966
|
throw new Error("Invalid GeoVideo time range");
|
|
1967
|
-
const i =
|
|
1967
|
+
const i = J(
|
|
1968
1968
|
this.manifest ? X(this.manifest) : e,
|
|
1969
1969
|
e
|
|
1970
1970
|
);
|
|
@@ -1983,7 +1983,7 @@ class Ri {
|
|
|
1983
1983
|
];
|
|
1984
1984
|
}
|
|
1985
1985
|
createField(e) {
|
|
1986
|
-
const i = new
|
|
1986
|
+
const i = new Bt(this.gl, e, {
|
|
1987
1987
|
repeatLongitude: !1,
|
|
1988
1988
|
animateSnapshot: !0,
|
|
1989
1989
|
onError: (r) => {
|
|
@@ -1998,7 +1998,7 @@ class Ri {
|
|
|
1998
1998
|
i.name === "AbortError" || this.destroyed || (this.playOnReady = !1, this.awaitingNext = !1, this.failed = !0, this.seeking = !0, this.clock.setPlaying(!1), this.emit("status", { phase: "error", error: i }), this.emit("error", i));
|
|
1999
1999
|
}
|
|
2000
2000
|
}
|
|
2001
|
-
function
|
|
2001
|
+
function H(t) {
|
|
2002
2002
|
const { start: e, end: i } = t.temporal ?? {};
|
|
2003
2003
|
return {
|
|
2004
2004
|
source: t,
|
|
@@ -2006,35 +2006,46 @@ function Z(t) {
|
|
|
2006
2006
|
end: Date.parse(i ?? e ?? "")
|
|
2007
2007
|
};
|
|
2008
2008
|
}
|
|
2009
|
-
function
|
|
2010
|
-
const r = t.filter((s) => s.id === e.id && s.temporal?.start != null).map(
|
|
2009
|
+
function ki(t, e, i = {}) {
|
|
2010
|
+
const r = t.filter((s) => s.id === e.id && s.temporal?.start != null).map(H), n = Ut(
|
|
2011
2011
|
r,
|
|
2012
2012
|
Date.parse(e.temporal?.end ?? ""),
|
|
2013
2013
|
i
|
|
2014
2014
|
);
|
|
2015
2015
|
return n ? { source: n.chunk.source, time: n.time } : null;
|
|
2016
2016
|
}
|
|
2017
|
-
function
|
|
2018
|
-
return
|
|
2017
|
+
function Fi(t, e) {
|
|
2018
|
+
return Mt(H(t), e.map(H))?.source ?? null;
|
|
2019
2019
|
}
|
|
2020
|
-
|
|
2021
|
-
|
|
2020
|
+
function Si(t, e = {}) {
|
|
2021
|
+
const i = e.start ?? -1 / 0, r = e.end ?? 1 / 0, n = t.map(H).filter((a) => a.end >= i && a.start <= r).sort((a, c) => a.start - c.start);
|
|
2022
|
+
if (n.length === 0)
|
|
2023
|
+
return;
|
|
2024
|
+
if (e.time == null)
|
|
2025
|
+
return n[n.length - 1].source;
|
|
2026
|
+
const s = Math.min(r, Math.max(i, e.time)), o = (a) => s < a.start ? a.start - s : Math.max(0, s - a.end);
|
|
2027
|
+
return n.reduce(
|
|
2028
|
+
(a, c) => o(c) <= o(a) ? c : a
|
|
2029
|
+
).source;
|
|
2030
|
+
}
|
|
2031
|
+
const $t = /^P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/;
|
|
2032
|
+
function qt(t) {
|
|
2022
2033
|
return t instanceof Date ? t.getTime() : typeof t == "number" ? t : new Date(t).getTime();
|
|
2023
2034
|
}
|
|
2024
|
-
function
|
|
2025
|
-
const i =
|
|
2035
|
+
function he(t, e) {
|
|
2036
|
+
const i = qt(t);
|
|
2026
2037
|
if (!Number.isFinite(i))
|
|
2027
2038
|
throw new Error(`Invalid ${e}`);
|
|
2028
2039
|
return i;
|
|
2029
2040
|
}
|
|
2030
|
-
function
|
|
2031
|
-
const i = e.match(
|
|
2041
|
+
function ge(t, e) {
|
|
2042
|
+
const i = e.match($t);
|
|
2032
2043
|
if (!i)
|
|
2033
2044
|
throw new Error(`Invalid trailing time duration: ${e}`);
|
|
2034
|
-
const r = i.slice(1).map((
|
|
2035
|
-
if (!r.some((
|
|
2045
|
+
const r = i.slice(1).map((k) => Number(k ?? 0));
|
|
2046
|
+
if (!r.some((k) => k > 0))
|
|
2036
2047
|
throw new Error("Trailing time duration must be positive");
|
|
2037
|
-
const [n, s, o, a,
|
|
2048
|
+
const [n, s, o, a, c, l, d] = r, h = new Date(t), p = h.getUTCFullYear() * 12 + h.getUTCMonth() - n * 12 - s, m = Math.floor(p / 12), E = (p % 12 + 12) % 12, w = new Date(Date.UTC(m, E + 1, 0)).getUTCDate();
|
|
2038
2049
|
return Date.UTC(
|
|
2039
2050
|
m,
|
|
2040
2051
|
E,
|
|
@@ -2043,17 +2054,17 @@ function Ee(t, e) {
|
|
|
2043
2054
|
h.getUTCMinutes(),
|
|
2044
2055
|
h.getUTCSeconds(),
|
|
2045
2056
|
h.getUTCMilliseconds()
|
|
2046
|
-
) - (((o * 7 + a) * 24 +
|
|
2057
|
+
) - (((o * 7 + a) * 24 + c) * 60 + l) * 6e4 - d * 1e3;
|
|
2047
2058
|
}
|
|
2048
|
-
function
|
|
2059
|
+
function Ui(t, [e, i]) {
|
|
2049
2060
|
let r = e, n = i;
|
|
2050
|
-
if (typeof t.trailing == "string" ? r =
|
|
2061
|
+
if (typeof t.trailing == "string" ? r = ge(i, t.trailing) : (t.start != null && (r = he(t.start, "time range start")), t.end != null && (n = he(t.end, "time range end"))), r > n)
|
|
2051
2062
|
throw new Error("Time range start must not follow its end");
|
|
2052
2063
|
return [Math.max(e, r), Math.min(i, n)];
|
|
2053
2064
|
}
|
|
2054
|
-
const
|
|
2055
|
-
function
|
|
2056
|
-
if (!
|
|
2065
|
+
const Wt = (t) => typeof t == "object" && t !== null && !Array.isArray(t);
|
|
2066
|
+
function Mi(t, e) {
|
|
2067
|
+
if (!Wt(t))
|
|
2057
2068
|
throw new Error(`${e} must be an object`);
|
|
2058
2069
|
for (const s of Object.keys(t))
|
|
2059
2070
|
if (s !== "start" && s !== "end" && s !== "trailing")
|
|
@@ -2063,7 +2074,7 @@ function Ai(t, e) {
|
|
|
2063
2074
|
throw new Error(`${e}.trailing excludes start and end`);
|
|
2064
2075
|
if (typeof t.trailing != "string")
|
|
2065
2076
|
throw new Error(`${e}.trailing must be an ISO 8601 duration`);
|
|
2066
|
-
return
|
|
2077
|
+
return ge(0, t.trailing), { trailing: t.trailing };
|
|
2067
2078
|
}
|
|
2068
2079
|
const i = (s) => {
|
|
2069
2080
|
const o = t[s];
|
|
@@ -2080,55 +2091,91 @@ function Ai(t, e) {
|
|
|
2080
2091
|
...n !== void 0 && { end: n }
|
|
2081
2092
|
};
|
|
2082
2093
|
}
|
|
2083
|
-
function
|
|
2094
|
+
function Di(t, e) {
|
|
2095
|
+
return !!t && !!e && t.name === e.name && t.units === e.units && t.positive === e.positive && t.value === e.value;
|
|
2096
|
+
}
|
|
2097
|
+
function q(t) {
|
|
2098
|
+
const e = t;
|
|
2099
|
+
return !!e && typeof e.name == "string" && typeof e.units == "string" && typeof e.positive == "string" && Number.isFinite(e.value);
|
|
2100
|
+
}
|
|
2101
|
+
function Ht(t) {
|
|
2102
|
+
const e = t.depths;
|
|
2103
|
+
if (e === void 0)
|
|
2104
|
+
return t.surface === void 0 || q(t.surface);
|
|
2105
|
+
const i = t.surface ?? e?.[0];
|
|
2106
|
+
if (!Array.isArray(e) || !q(i))
|
|
2107
|
+
return e?.length === 0;
|
|
2108
|
+
const r = new Set(t.surface ? [i.value] : []);
|
|
2109
|
+
return e.every((n) => {
|
|
2110
|
+
const s = q(n) && typeof n.indexUrl == "string" && n.name === i.name && n.units === i.units && n.positive === i.positive && !r.has(n.value);
|
|
2111
|
+
return r.add(n.value), s;
|
|
2112
|
+
});
|
|
2113
|
+
}
|
|
2114
|
+
function Pi(t) {
|
|
2084
2115
|
return t.type === "geovideo" && typeof t.indexUrl == "string";
|
|
2085
2116
|
}
|
|
2086
|
-
function
|
|
2117
|
+
function Ni(t, e) {
|
|
2087
2118
|
return t.id === e.id && (t.type !== "geovideo" || e.type !== "geovideo" || t.manifestUrl === e.manifestUrl);
|
|
2088
2119
|
}
|
|
2089
|
-
function
|
|
2120
|
+
function ee(t) {
|
|
2090
2121
|
return typeof t == "string" && Number.isFinite(Date.parse(t));
|
|
2091
2122
|
}
|
|
2092
|
-
function
|
|
2123
|
+
function zt(t) {
|
|
2124
|
+
const e = t.times;
|
|
2125
|
+
if (!Array.isArray(e) || e.length !== t.samples || e[0] !== t.start || e[e.length - 1] !== t.end)
|
|
2126
|
+
return !1;
|
|
2127
|
+
let i = -1 / 0;
|
|
2128
|
+
for (const r of e) {
|
|
2129
|
+
const n = ee(r) ? Date.parse(r) : NaN;
|
|
2130
|
+
if (!(n > i))
|
|
2131
|
+
return !1;
|
|
2132
|
+
i = n;
|
|
2133
|
+
}
|
|
2134
|
+
return !0;
|
|
2135
|
+
}
|
|
2136
|
+
function Yt(t) {
|
|
2093
2137
|
const e = t;
|
|
2094
2138
|
if (!e || e.schemaVersion !== 1 || e.type !== "geovideo-index" || !Array.isArray(e.chunks))
|
|
2095
2139
|
throw new Error("Unsupported GeoVideo index");
|
|
2140
|
+
if (!Ht(e) || e.vertical !== void 0 && !q(e.vertical))
|
|
2141
|
+
throw new Error("Invalid GeoVideo index levels");
|
|
2096
2142
|
for (const i of e.chunks)
|
|
2097
|
-
if (!
|
|
2143
|
+
if (!ee(i?.start) || !ee(i.end) || Date.parse(i.end) < Date.parse(i.start) || typeof i.manifestUrl != "string" || i.times !== void 0 && !zt(i))
|
|
2098
2144
|
throw new Error("Invalid GeoVideo index chunk");
|
|
2099
2145
|
return e;
|
|
2100
2146
|
}
|
|
2101
|
-
async function
|
|
2147
|
+
async function Gi(t, e) {
|
|
2102
2148
|
const i = await fetch(t, { signal: e });
|
|
2103
2149
|
if (!i.ok)
|
|
2104
2150
|
throw new Error(
|
|
2105
2151
|
`GeoVideo index request failed (${i.status}): ${t}`
|
|
2106
2152
|
);
|
|
2107
|
-
return
|
|
2153
|
+
return Yt(await i.json());
|
|
2108
2154
|
}
|
|
2109
|
-
function
|
|
2155
|
+
function Te(t) {
|
|
2110
2156
|
return typeof document < "u" ? new URL(t, document.baseURI).href : t;
|
|
2111
2157
|
}
|
|
2112
|
-
function
|
|
2113
|
-
const i =
|
|
2158
|
+
function jt(t, e) {
|
|
2159
|
+
const i = Te(e);
|
|
2114
2160
|
return t.chunks.map((r) => ({
|
|
2115
2161
|
key: r.key,
|
|
2116
2162
|
manifestUrl: new URL(r.manifestUrl, i).href,
|
|
2117
2163
|
start: Date.parse(r.start),
|
|
2118
2164
|
end: Date.parse(r.end),
|
|
2119
2165
|
samples: r.samples,
|
|
2166
|
+
...r.times ? { times: r.times.map(Date.parse) } : {},
|
|
2120
2167
|
...r.provisional ? { provisional: !0 } : {}
|
|
2121
2168
|
}));
|
|
2122
2169
|
}
|
|
2123
|
-
function
|
|
2170
|
+
function Kt(t, e, i) {
|
|
2124
2171
|
if (e.sourceId !== t.id || e.catalogEntryId !== i.id)
|
|
2125
2172
|
throw new Error(
|
|
2126
2173
|
`GeoVideo index identity does not match catalog entry/source: ${t.id}`
|
|
2127
2174
|
);
|
|
2128
2175
|
}
|
|
2129
|
-
function
|
|
2130
|
-
|
|
2131
|
-
const r =
|
|
2176
|
+
function Ii(t, e, i) {
|
|
2177
|
+
Kt(t, e, i);
|
|
2178
|
+
const r = jt(e, t.indexUrl);
|
|
2132
2179
|
return e.chunks.map(
|
|
2133
2180
|
(n, s) => ({
|
|
2134
2181
|
id: t.id,
|
|
@@ -2145,72 +2192,78 @@ function Mi(t, e, i) {
|
|
|
2145
2192
|
})
|
|
2146
2193
|
);
|
|
2147
2194
|
}
|
|
2195
|
+
function Li(t, e) {
|
|
2196
|
+
return new URL(t.indexUrl, Te(e)).href;
|
|
2197
|
+
}
|
|
2148
2198
|
export {
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2199
|
+
mi as $,
|
|
2200
|
+
_i as A,
|
|
2201
|
+
fe as B,
|
|
2202
|
+
hi as C,
|
|
2203
|
+
Si as D,
|
|
2204
|
+
Pi as E,
|
|
2205
|
+
ki as F,
|
|
2206
|
+
yi as G,
|
|
2207
|
+
Ui as H,
|
|
2208
|
+
Li as I,
|
|
2209
|
+
Gi as J,
|
|
2210
|
+
Ii as K,
|
|
2211
|
+
jt as L,
|
|
2212
|
+
xi as M,
|
|
2213
|
+
le as N,
|
|
2214
|
+
pi as O,
|
|
2215
|
+
gi as P,
|
|
2216
|
+
bi as Q,
|
|
2217
|
+
vi as R,
|
|
2218
|
+
Xt as S,
|
|
2219
|
+
fi as T,
|
|
2170
2220
|
At as U,
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2221
|
+
Bt as V,
|
|
2222
|
+
pe as W,
|
|
2223
|
+
yt as X,
|
|
2224
|
+
St as Y,
|
|
2225
|
+
Ei as Z,
|
|
2226
|
+
Ti as _,
|
|
2227
|
+
ai as a,
|
|
2228
|
+
$e as a0,
|
|
2229
|
+
Kt as a1,
|
|
2230
|
+
Ee as a2,
|
|
2231
|
+
ae as a3,
|
|
2232
|
+
nt as a4,
|
|
2233
|
+
Dt as a5,
|
|
2234
|
+
Ut as a6,
|
|
2235
|
+
Fi as a7,
|
|
2236
|
+
Mt as a8,
|
|
2237
|
+
Mi as a9,
|
|
2238
|
+
Rt as aa,
|
|
2239
|
+
ge as ab,
|
|
2240
|
+
v as ac,
|
|
2241
|
+
Z as ad,
|
|
2242
|
+
Yt as ae,
|
|
2243
|
+
Ot as af,
|
|
2244
|
+
oi as b,
|
|
2245
|
+
Jt as c,
|
|
2246
|
+
ii as d,
|
|
2247
|
+
ri as e,
|
|
2248
|
+
si as f,
|
|
2249
|
+
ci as g,
|
|
2250
|
+
ei as h,
|
|
2251
|
+
ni as i,
|
|
2252
|
+
wi as j,
|
|
2253
|
+
ti as k,
|
|
2254
|
+
di as l,
|
|
2255
|
+
Ai as m,
|
|
2256
|
+
ui as n,
|
|
2257
|
+
mt as o,
|
|
2258
|
+
wt as p,
|
|
2259
|
+
je as q,
|
|
2260
|
+
Ze as r,
|
|
2261
|
+
li as s,
|
|
2262
|
+
pt as t,
|
|
2263
|
+
Zt as u,
|
|
2264
|
+
Ri as v,
|
|
2265
|
+
he as w,
|
|
2266
|
+
Di as x,
|
|
2267
|
+
M as y,
|
|
2268
|
+
Ni as z
|
|
2216
2269
|
};
|