@quick-threejs/reactive 0.1.46 → 0.1.48
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/{FontLoader-D3WA1QGd.js → FontLoader-76d20F_i.js} +6 -6
- package/dist/{FontLoader-ejhD_xZ1.mjs → FontLoader-YhZm0TOQ.mjs} +31 -30
- package/dist/common/blueprints/props.blueprint.d.ts +78 -43
- package/dist/common/interfaces/core.interface.d.ts +13 -1
- package/dist/common/interfaces/proxy-event.interface.d.ts +2 -0
- package/dist/core/app/app.module.d.ts +2 -2
- package/dist/core/app/app.service.d.ts +2 -1
- package/dist/core/app/app.worker.d.ts +1 -1
- package/dist/core/app/camera/camera.module.d.ts +2 -4
- package/dist/core/app/camera/camera.service.d.ts +3 -2
- package/dist/core/app/debug/debug.module.d.ts +1 -1
- package/dist/core/app/debug/debug.service.d.ts +2 -2
- package/dist/core/app/loader/loader.module.d.ts +1 -1
- package/dist/core/app/renderer/renderer.module.d.ts +4 -4
- package/dist/core/app/renderer/renderer.service.d.ts +5 -5
- package/dist/core/app/sizes/sizes.module.d.ts +13 -4
- package/dist/core/app/sizes/sizes.service.d.ts +13 -2
- package/dist/core/register/register.module.d.ts +3 -5
- package/dist/core/register/register.service.d.ts +18 -7
- package/dist/main.js +4 -4
- package/dist/main.mjs +904 -914
- package/dist/worker.js +1 -1
- package/dist/worker.mjs +551 -510
- package/package.json +5 -5
package/dist/main.mjs
CHANGED
|
@@ -1,144 +1,134 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { g as
|
|
5
|
-
import { A as fi,
|
|
6
|
-
import { TrianglesDrawMode as
|
|
7
|
-
class
|
|
1
|
+
var pn = Object.defineProperty;
|
|
2
|
+
var mn = (s, e, t) => e in s ? pn(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
|
|
3
|
+
var S = (s, e, t) => mn(s, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { g as gn, r as Nt, a as _n, b as rt, c as Ft, d as bn, e as yn, f as Tn, s as ie, L as oe, i as O, U as pe, K as wn, P as vn, h as Dt, j as Ht, S as jt, k as En, m as ye, l as Ut, F as Rn, n as Pe, o as ot, J as Bt, R as Cn, p as xn, C as Wt, N as W, D as te, q as at, t as ct, E as Sn } from "./FontLoader-YhZm0TOQ.mjs";
|
|
5
|
+
import { A as fi, v as pi, u as mi } from "./FontLoader-YhZm0TOQ.mjs";
|
|
6
|
+
import { TrianglesDrawMode as Mn, TriangleFanDrawMode as Ke, TriangleStripDrawMode as Gt, Loader as zt, FileLoader as we, SRGBColorSpace as z, LinearSRGBColorSpace as F, BufferGeometry as $t, BufferAttribute as me, InterleavedBuffer as Kt, InterleavedBufferAttribute as qt, Color as $, ColorManagement as qe, LoaderUtils as ge, SpotLight as kn, PointLight as Ln, DirectionalLight as An, MeshBasicMaterial as fe, MeshPhysicalMaterial as D, Vector2 as Vt, Matrix4 as ve, Vector3 as Z, Quaternion as Xt, InstancedMesh as Pn, InstancedBufferAttribute as On, Object3D as Qt, TextureLoader as In, ImageBitmapLoader as Yt, LinearFilter as Ve, LinearMipmapLinearFilter as Jt, RepeatWrapping as Xe, NearestFilter as Zt, PointsMaterial as Nn, Material as Oe, LineBasicMaterial as Fn, MeshStandardMaterial as en, DoubleSide as Dn, PropertyBinding as Hn, SkinnedMesh as jn, Mesh as Un, LineSegments as Bn, Line as Wn, LineLoop as Gn, Points as zn, Group as Ie, PerspectiveCamera as $n, MathUtils as Kn, OrthographicCamera as qn, Skeleton as Vn, AnimationClip as Xn, Bone as Qn, InterpolateLinear as tn, NearestMipmapNearestFilter as Yn, LinearMipmapNearestFilter as Jn, NearestMipmapLinearFilter as Zn, ClampToEdgeWrapping as er, MirroredRepeatWrapping as tr, InterpolateDiscrete as nr, FrontSide as rr, Texture as ut, VectorKeyframeTrack as lt, NumberKeyframeTrack as dt, QuaternionKeyframeTrack as ht, Box3 as sr, Sphere as ir, Interpolant as or, LoadingManager as ar, AudioLoader as cr } from "three";
|
|
7
|
+
class Se {
|
|
8
8
|
constructor() {
|
|
9
9
|
/**
|
|
10
10
|
* @description The app worker logic location.
|
|
11
11
|
*
|
|
12
12
|
* @required
|
|
13
13
|
*/
|
|
14
|
-
|
|
14
|
+
S(this, "location");
|
|
15
15
|
/**
|
|
16
16
|
* @description Initialize the app on construct.
|
|
17
17
|
*
|
|
18
18
|
* @default true
|
|
19
19
|
*/
|
|
20
|
-
|
|
20
|
+
S(this, "initOnConstruct");
|
|
21
21
|
/**
|
|
22
22
|
* @description Initialize the app on main thread.
|
|
23
23
|
*
|
|
24
24
|
* @default false
|
|
25
25
|
*/
|
|
26
|
-
|
|
26
|
+
S(this, "mainThread");
|
|
27
27
|
/**
|
|
28
28
|
* @description App `canvas` element reference.
|
|
29
29
|
*
|
|
30
|
+
* @note If not provided, the canvas will be created automatically.
|
|
31
|
+
*
|
|
30
32
|
* @default undefined
|
|
31
33
|
*/
|
|
32
|
-
|
|
34
|
+
S(this, "canvas");
|
|
33
35
|
/**
|
|
34
|
-
* @description
|
|
36
|
+
* @description Wrapper element for the canvas used to set the canvas size.
|
|
35
37
|
*
|
|
36
|
-
* @
|
|
37
|
-
*/
|
|
38
|
-
x(this, "fullScreen");
|
|
39
|
-
/**
|
|
40
|
-
* Default used camera.
|
|
38
|
+
* @note If the `fullScreen` property is `true`, the element won't be used to set the canvas size.
|
|
41
39
|
*
|
|
42
|
-
* @
|
|
43
|
-
*
|
|
44
|
-
* @default DefaultCameraType.PERSPECTIVE
|
|
40
|
+
* @default undefined
|
|
45
41
|
*/
|
|
46
|
-
|
|
42
|
+
S(this, "canvasWrapper");
|
|
47
43
|
/**
|
|
48
|
-
* @description
|
|
44
|
+
* @description Use the window size to render the canvas in fullscreen and auto-resize it.
|
|
49
45
|
*
|
|
50
46
|
* @default true
|
|
51
47
|
*/
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* @description Resources to load.
|
|
55
|
-
*
|
|
56
|
-
* @default []
|
|
57
|
-
*/
|
|
58
|
-
x(this, "loaderDataSources", []);
|
|
48
|
+
S(this, "fullScreen");
|
|
59
49
|
/**
|
|
60
|
-
*
|
|
50
|
+
* Initial pixel ratio to use for the renderer.
|
|
61
51
|
*
|
|
62
|
-
* @default
|
|
52
|
+
* @default `Math.min(window.devicePixelRatio, 2)`
|
|
63
53
|
*/
|
|
64
|
-
|
|
54
|
+
S(this, "pixelRatio");
|
|
65
55
|
/**
|
|
66
|
-
* @description
|
|
56
|
+
* @description Auto-resize the renderer when the canvas size changes.
|
|
67
57
|
*
|
|
68
|
-
* @
|
|
58
|
+
* @note Will have no effect if either {@link LaunchAppProps.fullScreen} or {@link RegisterPropsBlueprint.canvasWrapper} are not provided.
|
|
69
59
|
*
|
|
70
60
|
* @default true
|
|
71
61
|
*/
|
|
72
|
-
|
|
62
|
+
S(this, "autoRenderResize");
|
|
73
63
|
/**
|
|
74
|
-
*
|
|
64
|
+
* Default used camera.
|
|
75
65
|
*
|
|
76
|
-
* @
|
|
66
|
+
* @see {@link DefaultCameraType}
|
|
77
67
|
*
|
|
78
|
-
* @default
|
|
68
|
+
* @default DefaultCameraType.PERSPECTIVE
|
|
79
69
|
*/
|
|
80
|
-
|
|
70
|
+
S(this, "defaultCamera");
|
|
81
71
|
/**
|
|
82
|
-
*
|
|
72
|
+
* @description Stepping the timer animation loop on launch.
|
|
83
73
|
*
|
|
84
|
-
* @
|
|
85
|
-
* @remark __This property depends on {@link RegisterPropsBlueprint.enableDebug enableDebug}__
|
|
86
|
-
*
|
|
87
|
-
* @default undefined
|
|
74
|
+
* @default true
|
|
88
75
|
*/
|
|
89
|
-
|
|
76
|
+
S(this, "startTimer");
|
|
90
77
|
/**
|
|
91
|
-
*
|
|
78
|
+
* @description Resources to load.
|
|
92
79
|
*
|
|
93
|
-
* @
|
|
94
|
-
|
|
80
|
+
* @default []
|
|
81
|
+
*/
|
|
82
|
+
S(this, "loaderDataSources", []);
|
|
83
|
+
/**
|
|
84
|
+
* @description GLTF Draco decoder path.
|
|
95
85
|
*
|
|
96
86
|
* @default undefined
|
|
97
87
|
*/
|
|
98
|
-
|
|
88
|
+
S(this, "loaderDracoDecoderPath");
|
|
99
89
|
/**
|
|
100
|
-
*
|
|
90
|
+
* @description Will directly load the resources on initialization.
|
|
101
91
|
*
|
|
102
|
-
* @remark
|
|
103
|
-
* @remark __This property depends on {@link RegisterPropsBlueprint.enableDebug enableDebug}__
|
|
92
|
+
* @remark __This property depends on {@link RegisterPropsBlueprint.initOnConstruct initOnConstruct}__
|
|
104
93
|
*
|
|
105
|
-
* @default
|
|
94
|
+
* @default true
|
|
106
95
|
*/
|
|
107
|
-
|
|
96
|
+
S(this, "loadResourcesOnInit");
|
|
108
97
|
/**
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
* @remark __Deactivated if the value is `false` or `undefined`__
|
|
112
|
-
* @remark __This property depends on {@link RegisterPropsBlueprint.enableDebug enableDebug}__
|
|
98
|
+
* @description Debug properties.
|
|
113
99
|
*
|
|
114
100
|
* @default undefined
|
|
115
101
|
*/
|
|
116
|
-
|
|
102
|
+
S(this, "debug");
|
|
117
103
|
/**
|
|
118
104
|
* @description Handler called when the app is ready.
|
|
119
105
|
*
|
|
120
106
|
* @default undefined
|
|
121
107
|
*/
|
|
122
|
-
|
|
108
|
+
S(this, "onReady");
|
|
123
109
|
}
|
|
124
110
|
}
|
|
125
|
-
class
|
|
111
|
+
class ci {
|
|
126
112
|
constructor() {
|
|
127
|
-
/**
|
|
128
|
-
|
|
113
|
+
/**
|
|
114
|
+
* @description App `canvas` element reference.
|
|
115
|
+
*
|
|
116
|
+
* @note Will be used on main-thread strategy only.
|
|
117
|
+
*/
|
|
118
|
+
S(this, "canvas");
|
|
129
119
|
/** @description Handler triggered when the app is ready. */
|
|
130
|
-
|
|
120
|
+
S(this, "onReady");
|
|
131
121
|
}
|
|
132
122
|
}
|
|
133
|
-
var
|
|
134
|
-
function
|
|
135
|
-
if (
|
|
136
|
-
|
|
123
|
+
var X = {}, Ne = {}, H = {}, Q = {}, ft;
|
|
124
|
+
function ur() {
|
|
125
|
+
if (ft) return Q;
|
|
126
|
+
ft = 1, Object.defineProperty(Q, "__esModule", { value: !0 }), Q.getBundleURL = Q.getBaseURL = void 0;
|
|
137
127
|
let s;
|
|
138
128
|
function e() {
|
|
139
129
|
return s || (s = t()), s;
|
|
140
130
|
}
|
|
141
|
-
|
|
131
|
+
Q.getBundleURL = e;
|
|
142
132
|
function t() {
|
|
143
133
|
try {
|
|
144
134
|
throw new Error();
|
|
@@ -152,14 +142,14 @@ function cr() {
|
|
|
152
142
|
function n(r) {
|
|
153
143
|
return ("" + r).replace(/^((?:https?|file|ftp|chrome-extension|moz-extension):\/\/.+)?\/[^/]+(?:\?.*)?$/, "$1") + "/";
|
|
154
144
|
}
|
|
155
|
-
return
|
|
145
|
+
return Q.getBaseURL = n, Q;
|
|
156
146
|
}
|
|
157
147
|
var pt;
|
|
158
|
-
function
|
|
159
|
-
if (pt) return
|
|
160
|
-
pt = 1, Object.defineProperty(
|
|
161
|
-
const s = /* @__PURE__ */
|
|
162
|
-
|
|
148
|
+
function nn() {
|
|
149
|
+
if (pt) return H;
|
|
150
|
+
pt = 1, Object.defineProperty(H, "__esModule", { value: !0 }), H.isWorkerRuntime = H.getWorkerImplementation = H.defaultPoolSize = void 0;
|
|
151
|
+
const s = /* @__PURE__ */ ur();
|
|
152
|
+
H.defaultPoolSize = typeof navigator < "u" && navigator.hardwareConcurrency ? navigator.hardwareConcurrency : 4;
|
|
163
153
|
const e = (c) => /^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(c);
|
|
164
154
|
function t(c) {
|
|
165
155
|
const a = new Blob([c], { type: "application/javascript" });
|
|
@@ -174,18 +164,18 @@ function tn() {
|
|
|
174
164
|
};
|
|
175
165
|
class c extends Worker {
|
|
176
166
|
constructor(u, l) {
|
|
177
|
-
var
|
|
178
|
-
typeof u == "string" && l && l._baseURL ? u = new URL(u, l._baseURL) : typeof u == "string" && !e(u) && s.getBundleURL().match(/^file:\/\//i) && (u = new URL(u, s.getBundleURL().replace(/\/[^\/]+$/, "/")), (!((
|
|
167
|
+
var h, f;
|
|
168
|
+
typeof u == "string" && l && l._baseURL ? u = new URL(u, l._baseURL) : typeof u == "string" && !e(u) && s.getBundleURL().match(/^file:\/\//i) && (u = new URL(u, s.getBundleURL().replace(/\/[^\/]+$/, "/")), (!((h = l == null ? void 0 : l.CORSWorkaround) !== null && h !== void 0) || h) && (u = t(`importScripts(${JSON.stringify(u)});`))), typeof u == "string" && e(u) && (!((f = l == null ? void 0 : l.CORSWorkaround) !== null && f !== void 0) || f) && (u = t(`importScripts(${JSON.stringify(u)});`)), super(u, l);
|
|
179
169
|
}
|
|
180
170
|
}
|
|
181
171
|
class a extends c {
|
|
182
172
|
constructor(u, l) {
|
|
183
|
-
const
|
|
184
|
-
super(
|
|
173
|
+
const h = window.URL.createObjectURL(u);
|
|
174
|
+
super(h, l);
|
|
185
175
|
}
|
|
186
176
|
static fromText(u, l) {
|
|
187
|
-
const
|
|
188
|
-
return new a(
|
|
177
|
+
const h = new window.Blob([u], { type: "text/javascript" });
|
|
178
|
+
return new a(h, l);
|
|
189
179
|
}
|
|
190
180
|
}
|
|
191
181
|
return {
|
|
@@ -197,24 +187,24 @@ function tn() {
|
|
|
197
187
|
function i() {
|
|
198
188
|
return r || (r = n()), r;
|
|
199
189
|
}
|
|
200
|
-
|
|
190
|
+
H.getWorkerImplementation = i;
|
|
201
191
|
function o() {
|
|
202
192
|
const c = typeof self < "u" && typeof Window < "u" && self instanceof Window;
|
|
203
193
|
return !!(typeof self < "u" && self.postMessage && !c);
|
|
204
194
|
}
|
|
205
|
-
return
|
|
195
|
+
return H.isWorkerRuntime = o, H;
|
|
206
196
|
}
|
|
207
|
-
var
|
|
208
|
-
function
|
|
197
|
+
var Y = {}, be = { exports: {} }, Fe, mt;
|
|
198
|
+
function lr() {
|
|
209
199
|
if (mt) return Fe;
|
|
210
200
|
mt = 1;
|
|
211
201
|
var s = 1e3, e = s * 60, t = e * 60, n = t * 24, r = n * 7, i = n * 365.25;
|
|
212
202
|
Fe = function(u, l) {
|
|
213
203
|
l = l || {};
|
|
214
|
-
var
|
|
215
|
-
if (
|
|
204
|
+
var h = typeof u;
|
|
205
|
+
if (h === "string" && u.length > 0)
|
|
216
206
|
return o(u);
|
|
217
|
-
if (
|
|
207
|
+
if (h === "number" && isFinite(u))
|
|
218
208
|
return l.long ? a(u) : c(u);
|
|
219
209
|
throw new Error(
|
|
220
210
|
"val is not a non-empty string or a valid number. val=" + JSON.stringify(u)
|
|
@@ -226,46 +216,46 @@ function ur() {
|
|
|
226
216
|
u
|
|
227
217
|
);
|
|
228
218
|
if (l) {
|
|
229
|
-
var
|
|
230
|
-
switch (
|
|
219
|
+
var h = parseFloat(l[1]), f = (l[2] || "ms").toLowerCase();
|
|
220
|
+
switch (f) {
|
|
231
221
|
case "years":
|
|
232
222
|
case "year":
|
|
233
223
|
case "yrs":
|
|
234
224
|
case "yr":
|
|
235
225
|
case "y":
|
|
236
|
-
return
|
|
226
|
+
return h * i;
|
|
237
227
|
case "weeks":
|
|
238
228
|
case "week":
|
|
239
229
|
case "w":
|
|
240
|
-
return
|
|
230
|
+
return h * r;
|
|
241
231
|
case "days":
|
|
242
232
|
case "day":
|
|
243
233
|
case "d":
|
|
244
|
-
return
|
|
234
|
+
return h * n;
|
|
245
235
|
case "hours":
|
|
246
236
|
case "hour":
|
|
247
237
|
case "hrs":
|
|
248
238
|
case "hr":
|
|
249
239
|
case "h":
|
|
250
|
-
return
|
|
240
|
+
return h * t;
|
|
251
241
|
case "minutes":
|
|
252
242
|
case "minute":
|
|
253
243
|
case "mins":
|
|
254
244
|
case "min":
|
|
255
245
|
case "m":
|
|
256
|
-
return
|
|
246
|
+
return h * e;
|
|
257
247
|
case "seconds":
|
|
258
248
|
case "second":
|
|
259
249
|
case "secs":
|
|
260
250
|
case "sec":
|
|
261
251
|
case "s":
|
|
262
|
-
return
|
|
252
|
+
return h * s;
|
|
263
253
|
case "milliseconds":
|
|
264
254
|
case "millisecond":
|
|
265
255
|
case "msecs":
|
|
266
256
|
case "msec":
|
|
267
257
|
case "ms":
|
|
268
|
-
return
|
|
258
|
+
return h;
|
|
269
259
|
default:
|
|
270
260
|
return;
|
|
271
261
|
}
|
|
@@ -280,43 +270,43 @@ function ur() {
|
|
|
280
270
|
var l = Math.abs(u);
|
|
281
271
|
return l >= n ? d(u, l, n, "day") : l >= t ? d(u, l, t, "hour") : l >= e ? d(u, l, e, "minute") : l >= s ? d(u, l, s, "second") : u + " ms";
|
|
282
272
|
}
|
|
283
|
-
function d(u, l,
|
|
284
|
-
var w = l >=
|
|
285
|
-
return Math.round(u /
|
|
273
|
+
function d(u, l, h, f) {
|
|
274
|
+
var w = l >= h * 1.5;
|
|
275
|
+
return Math.round(u / h) + " " + f + (w ? "s" : "");
|
|
286
276
|
}
|
|
287
277
|
return Fe;
|
|
288
278
|
}
|
|
289
279
|
var De, gt;
|
|
290
|
-
function
|
|
280
|
+
function dr() {
|
|
291
281
|
if (gt) return De;
|
|
292
282
|
gt = 1;
|
|
293
283
|
function s(e) {
|
|
294
|
-
n.debug = n, n.default = n, n.coerce = d, n.disable = o, n.enable = i, n.enabled = c, n.humanize =
|
|
284
|
+
n.debug = n, n.default = n, n.coerce = d, n.disable = o, n.enable = i, n.enabled = c, n.humanize = lr(), n.destroy = u, Object.keys(e).forEach((l) => {
|
|
295
285
|
n[l] = e[l];
|
|
296
286
|
}), n.names = [], n.skips = [], n.formatters = {};
|
|
297
287
|
function t(l) {
|
|
298
|
-
let
|
|
299
|
-
for (let
|
|
300
|
-
|
|
301
|
-
return n.colors[Math.abs(
|
|
288
|
+
let h = 0;
|
|
289
|
+
for (let f = 0; f < l.length; f++)
|
|
290
|
+
h = (h << 5) - h + l.charCodeAt(f), h |= 0;
|
|
291
|
+
return n.colors[Math.abs(h) % n.colors.length];
|
|
302
292
|
}
|
|
303
293
|
n.selectColor = t;
|
|
304
294
|
function n(l) {
|
|
305
|
-
let
|
|
295
|
+
let h, f = null, w, E;
|
|
306
296
|
function T(...p) {
|
|
307
297
|
if (!T.enabled)
|
|
308
298
|
return;
|
|
309
|
-
const g = T, m = Number(/* @__PURE__ */ new Date()), b = m - (
|
|
310
|
-
g.diff = b, g.prev =
|
|
299
|
+
const g = T, m = Number(/* @__PURE__ */ new Date()), b = m - (h || m);
|
|
300
|
+
g.diff = b, g.prev = h, g.curr = m, h = m, p[0] = n.coerce(p[0]), typeof p[0] != "string" && p.unshift("%O");
|
|
311
301
|
let _ = 0;
|
|
312
|
-
p[0] = p[0].replace(/%([a-zA-Z%])/g, (v,
|
|
302
|
+
p[0] = p[0].replace(/%([a-zA-Z%])/g, (v, R) => {
|
|
313
303
|
if (v === "%%")
|
|
314
304
|
return "%";
|
|
315
305
|
_++;
|
|
316
|
-
const
|
|
317
|
-
if (typeof
|
|
318
|
-
const
|
|
319
|
-
v =
|
|
306
|
+
const C = n.formatters[R];
|
|
307
|
+
if (typeof C == "function") {
|
|
308
|
+
const M = p[_];
|
|
309
|
+
v = C.call(g, M), p.splice(_, 1), _--;
|
|
320
310
|
}
|
|
321
311
|
return v;
|
|
322
312
|
}), n.formatArgs.call(g, p), (g.log || n.log).apply(g, p);
|
|
@@ -324,39 +314,39 @@ function lr() {
|
|
|
324
314
|
return T.namespace = l, T.useColors = n.useColors(), T.color = n.selectColor(l), T.extend = r, T.destroy = n.destroy, Object.defineProperty(T, "enabled", {
|
|
325
315
|
enumerable: !0,
|
|
326
316
|
configurable: !1,
|
|
327
|
-
get: () =>
|
|
317
|
+
get: () => f !== null ? f : (w !== n.namespaces && (w = n.namespaces, E = n.enabled(l)), E),
|
|
328
318
|
set: (p) => {
|
|
329
|
-
|
|
319
|
+
f = p;
|
|
330
320
|
}
|
|
331
321
|
}), typeof n.init == "function" && n.init(T), T;
|
|
332
322
|
}
|
|
333
|
-
function r(l,
|
|
334
|
-
const
|
|
335
|
-
return
|
|
323
|
+
function r(l, h) {
|
|
324
|
+
const f = n(this.namespace + (typeof h > "u" ? ":" : h) + l);
|
|
325
|
+
return f.log = this.log, f;
|
|
336
326
|
}
|
|
337
327
|
function i(l) {
|
|
338
328
|
n.save(l), n.namespaces = l, n.names = [], n.skips = [];
|
|
339
|
-
let
|
|
340
|
-
const
|
|
341
|
-
for (
|
|
342
|
-
h
|
|
329
|
+
let h;
|
|
330
|
+
const f = (typeof l == "string" ? l : "").split(/[\s,]+/), w = f.length;
|
|
331
|
+
for (h = 0; h < w; h++)
|
|
332
|
+
f[h] && (l = f[h].replace(/\*/g, ".*?"), l[0] === "-" ? n.skips.push(new RegExp("^" + l.slice(1) + "$")) : n.names.push(new RegExp("^" + l + "$")));
|
|
343
333
|
}
|
|
344
334
|
function o() {
|
|
345
335
|
const l = [
|
|
346
336
|
...n.names.map(a),
|
|
347
|
-
...n.skips.map(a).map((
|
|
337
|
+
...n.skips.map(a).map((h) => "-" + h)
|
|
348
338
|
].join(",");
|
|
349
339
|
return n.enable(""), l;
|
|
350
340
|
}
|
|
351
341
|
function c(l) {
|
|
352
342
|
if (l[l.length - 1] === "*")
|
|
353
343
|
return !0;
|
|
354
|
-
let
|
|
355
|
-
for (
|
|
356
|
-
if (n.skips[
|
|
344
|
+
let h, f;
|
|
345
|
+
for (h = 0, f = n.skips.length; h < f; h++)
|
|
346
|
+
if (n.skips[h].test(l))
|
|
357
347
|
return !1;
|
|
358
|
-
for (
|
|
359
|
-
if (n.names[
|
|
348
|
+
for (h = 0, f = n.names.length; h < f; h++)
|
|
349
|
+
if (n.names[h].test(l))
|
|
360
350
|
return !0;
|
|
361
351
|
return !1;
|
|
362
352
|
}
|
|
@@ -374,7 +364,7 @@ function lr() {
|
|
|
374
364
|
return De = s, De;
|
|
375
365
|
}
|
|
376
366
|
var _t;
|
|
377
|
-
function
|
|
367
|
+
function st() {
|
|
378
368
|
return _t || (_t = 1, function(s, e) {
|
|
379
369
|
e.formatArgs = n, e.save = r, e.load = i, e.useColors = t, e.storage = o(), e.destroy = /* @__PURE__ */ (() => {
|
|
380
370
|
let a = !1;
|
|
@@ -477,8 +467,8 @@ function it() {
|
|
|
477
467
|
const d = "color: " + this.color;
|
|
478
468
|
a.splice(1, 0, d, "color: inherit");
|
|
479
469
|
let u = 0, l = 0;
|
|
480
|
-
a[0].replace(/%[a-zA-Z%]/g, (
|
|
481
|
-
|
|
470
|
+
a[0].replace(/%[a-zA-Z%]/g, (h) => {
|
|
471
|
+
h !== "%%" && (u++, h === "%c" && (l = u));
|
|
482
472
|
}), a.splice(l, 0, d);
|
|
483
473
|
}
|
|
484
474
|
e.log = console.debug || console.log || (() => {
|
|
@@ -503,7 +493,7 @@ function it() {
|
|
|
503
493
|
} catch {
|
|
504
494
|
}
|
|
505
495
|
}
|
|
506
|
-
s.exports =
|
|
496
|
+
s.exports = dr()(e);
|
|
507
497
|
const { formatters: c } = s.exports;
|
|
508
498
|
c.j = function(a) {
|
|
509
499
|
try {
|
|
@@ -514,7 +504,7 @@ function it() {
|
|
|
514
504
|
};
|
|
515
505
|
}(be, be.exports)), be.exports;
|
|
516
506
|
}
|
|
517
|
-
var
|
|
507
|
+
var hr = function(s, e, t, n) {
|
|
518
508
|
function r(i) {
|
|
519
509
|
return i instanceof t ? i : new t(function(o) {
|
|
520
510
|
o(i);
|
|
@@ -541,7 +531,7 @@ var dr = function(s, e, t, n) {
|
|
|
541
531
|
d((n = n.apply(s, e || [])).next());
|
|
542
532
|
});
|
|
543
533
|
};
|
|
544
|
-
class
|
|
534
|
+
class Me {
|
|
545
535
|
constructor(e) {
|
|
546
536
|
this._baseObserver = e, this._pendingPromises = /* @__PURE__ */ new Set();
|
|
547
537
|
}
|
|
@@ -552,7 +542,7 @@ class ke {
|
|
|
552
542
|
this._baseObserver.error(e);
|
|
553
543
|
}
|
|
554
544
|
schedule(e) {
|
|
555
|
-
const t = Promise.all(this._pendingPromises), n = [], r = (o) => n.push(o), i = Promise.resolve().then(() =>
|
|
545
|
+
const t = Promise.all(this._pendingPromises), n = [], r = (o) => n.push(o), i = Promise.resolve().then(() => hr(this, void 0, void 0, function* () {
|
|
556
546
|
yield t, yield e(r), this._pendingPromises.delete(i);
|
|
557
547
|
for (const o of n)
|
|
558
548
|
this._baseObserver.next(o);
|
|
@@ -562,9 +552,9 @@ class ke {
|
|
|
562
552
|
this._pendingPromises.add(i);
|
|
563
553
|
}
|
|
564
554
|
}
|
|
565
|
-
const
|
|
566
|
-
|
|
567
|
-
const fr =
|
|
555
|
+
const rn = () => typeof Symbol == "function", _e = (s) => rn() && !!Symbol[s], it = (s) => _e(s) ? Symbol[s] : "@@" + s;
|
|
556
|
+
_e("asyncIterator") || (Symbol.asyncIterator = Symbol.asyncIterator || Symbol.for("Symbol.asyncIterator"));
|
|
557
|
+
const fr = it("iterator"), Qe = it("observable"), sn = it("species");
|
|
568
558
|
function Ee(s, e) {
|
|
569
559
|
const t = s[e];
|
|
570
560
|
if (t != null) {
|
|
@@ -573,15 +563,15 @@ function Ee(s, e) {
|
|
|
573
563
|
return t;
|
|
574
564
|
}
|
|
575
565
|
}
|
|
576
|
-
function
|
|
566
|
+
function ae(s) {
|
|
577
567
|
let e = s.constructor;
|
|
578
|
-
return e !== void 0 && (e = e[
|
|
568
|
+
return e !== void 0 && (e = e[sn], e === null && (e = void 0)), e !== void 0 ? e : A;
|
|
579
569
|
}
|
|
580
|
-
function
|
|
581
|
-
return s instanceof
|
|
570
|
+
function pr(s) {
|
|
571
|
+
return s instanceof A;
|
|
582
572
|
}
|
|
583
|
-
function
|
|
584
|
-
|
|
573
|
+
function se(s) {
|
|
574
|
+
se.log ? se.log(s) : setTimeout(() => {
|
|
585
575
|
throw s;
|
|
586
576
|
}, 0);
|
|
587
577
|
}
|
|
@@ -590,11 +580,11 @@ function Te(s) {
|
|
|
590
580
|
try {
|
|
591
581
|
s();
|
|
592
582
|
} catch (e) {
|
|
593
|
-
|
|
583
|
+
se(e);
|
|
594
584
|
}
|
|
595
585
|
});
|
|
596
586
|
}
|
|
597
|
-
function
|
|
587
|
+
function on(s) {
|
|
598
588
|
const e = s._cleanup;
|
|
599
589
|
if (e !== void 0 && (s._cleanup = void 0, !!e))
|
|
600
590
|
try {
|
|
@@ -605,22 +595,22 @@ function sn(s) {
|
|
|
605
595
|
t && t.call(e);
|
|
606
596
|
}
|
|
607
597
|
} catch (t) {
|
|
608
|
-
|
|
598
|
+
se(t);
|
|
609
599
|
}
|
|
610
600
|
}
|
|
611
|
-
function
|
|
601
|
+
function Ye(s) {
|
|
612
602
|
s._observer = void 0, s._queue = void 0, s._state = "closed";
|
|
613
603
|
}
|
|
614
|
-
function
|
|
604
|
+
function mr(s) {
|
|
615
605
|
const e = s._queue;
|
|
616
606
|
if (e) {
|
|
617
607
|
s._queue = void 0, s._state = "ready";
|
|
618
608
|
for (const t of e)
|
|
619
|
-
if (
|
|
609
|
+
if (an(s, t.type, t.value), s._state === "closed")
|
|
620
610
|
break;
|
|
621
611
|
}
|
|
622
612
|
}
|
|
623
|
-
function
|
|
613
|
+
function an(s, e, t) {
|
|
624
614
|
s._state = "running";
|
|
625
615
|
const n = s._observer;
|
|
626
616
|
try {
|
|
@@ -630,37 +620,37 @@ function on(s, e, t) {
|
|
|
630
620
|
r && r.call(n, t);
|
|
631
621
|
break;
|
|
632
622
|
case "error":
|
|
633
|
-
if (
|
|
623
|
+
if (Ye(s), r)
|
|
634
624
|
r.call(n, t);
|
|
635
625
|
else
|
|
636
626
|
throw t;
|
|
637
627
|
break;
|
|
638
628
|
case "complete":
|
|
639
|
-
|
|
629
|
+
Ye(s), r && r.call(n);
|
|
640
630
|
break;
|
|
641
631
|
}
|
|
642
632
|
} catch (r) {
|
|
643
|
-
|
|
633
|
+
se(r);
|
|
644
634
|
}
|
|
645
|
-
s._state === "closed" ?
|
|
635
|
+
s._state === "closed" ? on(s) : s._state === "running" && (s._state = "ready");
|
|
646
636
|
}
|
|
647
|
-
function
|
|
637
|
+
function He(s, e, t) {
|
|
648
638
|
if (s._state !== "closed") {
|
|
649
639
|
if (s._state === "buffering") {
|
|
650
640
|
s._queue = s._queue || [], s._queue.push({ type: e, value: t });
|
|
651
641
|
return;
|
|
652
642
|
}
|
|
653
643
|
if (s._state !== "ready") {
|
|
654
|
-
s._state = "buffering", s._queue = [{ type: e, value: t }], Te(() =>
|
|
644
|
+
s._state = "buffering", s._queue = [{ type: e, value: t }], Te(() => mr(s));
|
|
655
645
|
return;
|
|
656
646
|
}
|
|
657
|
-
|
|
647
|
+
an(s, e, t);
|
|
658
648
|
}
|
|
659
649
|
}
|
|
660
|
-
class
|
|
650
|
+
class gr {
|
|
661
651
|
constructor(e, t) {
|
|
662
652
|
this._cleanup = void 0, this._observer = e, this._queue = void 0, this._state = "initializing";
|
|
663
|
-
const n = new
|
|
653
|
+
const n = new _r(this);
|
|
664
654
|
try {
|
|
665
655
|
this._cleanup = t.call(void 0, n);
|
|
666
656
|
} catch (r) {
|
|
@@ -672,10 +662,10 @@ class mr {
|
|
|
672
662
|
return this._state === "closed";
|
|
673
663
|
}
|
|
674
664
|
unsubscribe() {
|
|
675
|
-
this._state !== "closed" && (
|
|
665
|
+
this._state !== "closed" && (Ye(this), on(this));
|
|
676
666
|
}
|
|
677
667
|
}
|
|
678
|
-
class
|
|
668
|
+
class _r {
|
|
679
669
|
constructor(e) {
|
|
680
670
|
this._subscription = e;
|
|
681
671
|
}
|
|
@@ -683,18 +673,18 @@ class gr {
|
|
|
683
673
|
return this._subscription._state === "closed";
|
|
684
674
|
}
|
|
685
675
|
next(e) {
|
|
686
|
-
|
|
676
|
+
He(this._subscription, "next", e);
|
|
687
677
|
}
|
|
688
678
|
error(e) {
|
|
689
|
-
|
|
679
|
+
He(this._subscription, "error", e);
|
|
690
680
|
}
|
|
691
681
|
complete() {
|
|
692
|
-
|
|
682
|
+
He(this._subscription, "complete");
|
|
693
683
|
}
|
|
694
684
|
}
|
|
695
|
-
class
|
|
685
|
+
class A {
|
|
696
686
|
constructor(e) {
|
|
697
|
-
if (!(this instanceof
|
|
687
|
+
if (!(this instanceof A))
|
|
698
688
|
throw new TypeError("Observable cannot be called as a function");
|
|
699
689
|
if (typeof e != "function")
|
|
700
690
|
throw new TypeError("Observable initializer must be a function");
|
|
@@ -705,7 +695,7 @@ class L {
|
|
|
705
695
|
next: e,
|
|
706
696
|
error: t,
|
|
707
697
|
complete: n
|
|
708
|
-
}), new
|
|
698
|
+
}), new gr(e, this._subscriber);
|
|
709
699
|
}
|
|
710
700
|
pipe(e, ...t) {
|
|
711
701
|
let n = this;
|
|
@@ -719,7 +709,7 @@ class L {
|
|
|
719
709
|
error: t,
|
|
720
710
|
complete: n
|
|
721
711
|
} : e;
|
|
722
|
-
return new
|
|
712
|
+
return new A((i) => this.subscribe({
|
|
723
713
|
next(o) {
|
|
724
714
|
r.next && r.next(o), i.next(o);
|
|
725
715
|
},
|
|
@@ -763,7 +753,7 @@ class L {
|
|
|
763
753
|
map(e) {
|
|
764
754
|
if (typeof e != "function")
|
|
765
755
|
throw new TypeError(e + " is not a function");
|
|
766
|
-
const t =
|
|
756
|
+
const t = ae(this);
|
|
767
757
|
return new t((n) => this.subscribe({
|
|
768
758
|
next(r) {
|
|
769
759
|
let i = r;
|
|
@@ -785,7 +775,7 @@ class L {
|
|
|
785
775
|
filter(e) {
|
|
786
776
|
if (typeof e != "function")
|
|
787
777
|
throw new TypeError(e + " is not a function");
|
|
788
|
-
const t =
|
|
778
|
+
const t = ae(this);
|
|
789
779
|
return new t((n) => this.subscribe({
|
|
790
780
|
next(r) {
|
|
791
781
|
try {
|
|
@@ -807,7 +797,7 @@ class L {
|
|
|
807
797
|
reduce(e, t) {
|
|
808
798
|
if (typeof e != "function")
|
|
809
799
|
throw new TypeError(e + " is not a function");
|
|
810
|
-
const n =
|
|
800
|
+
const n = ae(this), r = arguments.length > 1;
|
|
811
801
|
let i = !1, o = t;
|
|
812
802
|
return new n((c) => this.subscribe({
|
|
813
803
|
next(a) {
|
|
@@ -832,7 +822,7 @@ class L {
|
|
|
832
822
|
}));
|
|
833
823
|
}
|
|
834
824
|
concat(...e) {
|
|
835
|
-
const t =
|
|
825
|
+
const t = ae(this);
|
|
836
826
|
return new t((n) => {
|
|
837
827
|
let r, i = 0;
|
|
838
828
|
function o(c) {
|
|
@@ -856,7 +846,7 @@ class L {
|
|
|
856
846
|
flatMap(e) {
|
|
857
847
|
if (typeof e != "function")
|
|
858
848
|
throw new TypeError(e + " is not a function");
|
|
859
|
-
const t =
|
|
849
|
+
const t = ae(this);
|
|
860
850
|
return new t((n) => {
|
|
861
851
|
const r = [], i = this.subscribe({
|
|
862
852
|
next(c) {
|
|
@@ -898,21 +888,21 @@ class L {
|
|
|
898
888
|
};
|
|
899
889
|
});
|
|
900
890
|
}
|
|
901
|
-
[
|
|
891
|
+
[Qe]() {
|
|
902
892
|
return this;
|
|
903
893
|
}
|
|
904
894
|
static from(e) {
|
|
905
|
-
const t = typeof this == "function" ? this :
|
|
895
|
+
const t = typeof this == "function" ? this : A;
|
|
906
896
|
if (e == null)
|
|
907
897
|
throw new TypeError(e + " is not an object");
|
|
908
|
-
const n = Ee(e,
|
|
898
|
+
const n = Ee(e, Qe);
|
|
909
899
|
if (n) {
|
|
910
900
|
const r = n.call(e);
|
|
911
901
|
if (Object(r) !== r)
|
|
912
902
|
throw new TypeError(r + " is not an object");
|
|
913
|
-
return
|
|
903
|
+
return pr(r) && r.constructor === t ? r : new t((i) => r.subscribe(i));
|
|
914
904
|
}
|
|
915
|
-
if (
|
|
905
|
+
if (_e("iterator")) {
|
|
916
906
|
const r = Ee(e, fr);
|
|
917
907
|
if (r)
|
|
918
908
|
return new t((i) => {
|
|
@@ -940,7 +930,7 @@ class L {
|
|
|
940
930
|
throw new TypeError(e + " is not observable");
|
|
941
931
|
}
|
|
942
932
|
static of(...e) {
|
|
943
|
-
const t = typeof this == "function" ? this :
|
|
933
|
+
const t = typeof this == "function" ? this : A;
|
|
944
934
|
return new t((n) => {
|
|
945
935
|
Te(() => {
|
|
946
936
|
if (!n.closed) {
|
|
@@ -952,21 +942,21 @@ class L {
|
|
|
952
942
|
});
|
|
953
943
|
});
|
|
954
944
|
}
|
|
955
|
-
static get [
|
|
945
|
+
static get [sn]() {
|
|
956
946
|
return this;
|
|
957
947
|
}
|
|
958
948
|
}
|
|
959
|
-
|
|
949
|
+
rn() && Object.defineProperty(A, Symbol("extensions"), {
|
|
960
950
|
value: {
|
|
961
|
-
symbol:
|
|
962
|
-
hostReportError:
|
|
951
|
+
symbol: Qe,
|
|
952
|
+
hostReportError: se
|
|
963
953
|
},
|
|
964
954
|
configurable: !0
|
|
965
955
|
});
|
|
966
|
-
function
|
|
956
|
+
function ee(s) {
|
|
967
957
|
typeof s == "function" ? s() : s && typeof s.unsubscribe == "function" && s.unsubscribe();
|
|
968
958
|
}
|
|
969
|
-
var
|
|
959
|
+
var br = function(s, e, t, n) {
|
|
970
960
|
function r(i) {
|
|
971
961
|
return i instanceof t ? i : new t(function(o) {
|
|
972
962
|
o(i);
|
|
@@ -993,9 +983,9 @@ var _r = function(s, e, t, n) {
|
|
|
993
983
|
d((n = n.apply(s, e || [])).next());
|
|
994
984
|
});
|
|
995
985
|
};
|
|
996
|
-
function
|
|
997
|
-
return (e) => new
|
|
998
|
-
const n = new
|
|
986
|
+
function yr(s) {
|
|
987
|
+
return (e) => new A((t) => {
|
|
988
|
+
const n = new Me(t), r = e.subscribe({
|
|
999
989
|
complete() {
|
|
1000
990
|
n.complete();
|
|
1001
991
|
},
|
|
@@ -1003,21 +993,21 @@ function br(s) {
|
|
|
1003
993
|
n.error(i);
|
|
1004
994
|
},
|
|
1005
995
|
next(i) {
|
|
1006
|
-
n.schedule((o) =>
|
|
996
|
+
n.schedule((o) => br(this, void 0, void 0, function* () {
|
|
1007
997
|
(yield s(i)) && o(i);
|
|
1008
998
|
}));
|
|
1009
999
|
}
|
|
1010
1000
|
});
|
|
1011
|
-
return () =>
|
|
1001
|
+
return () => ee(r);
|
|
1012
1002
|
});
|
|
1013
1003
|
}
|
|
1014
|
-
function yr(s) {
|
|
1015
|
-
return s && me("asyncIterator") && s[Symbol.asyncIterator];
|
|
1016
|
-
}
|
|
1017
1004
|
function Tr(s) {
|
|
1018
|
-
return s &&
|
|
1005
|
+
return s && _e("asyncIterator") && s[Symbol.asyncIterator];
|
|
1019
1006
|
}
|
|
1020
|
-
|
|
1007
|
+
function wr(s) {
|
|
1008
|
+
return s && _e("iterator") && s[Symbol.iterator];
|
|
1009
|
+
}
|
|
1010
|
+
var vr = function(s, e, t, n) {
|
|
1021
1011
|
function r(i) {
|
|
1022
1012
|
return i instanceof t ? i : new t(function(o) {
|
|
1023
1013
|
o(i);
|
|
@@ -1043,7 +1033,7 @@ var wr = function(s, e, t, n) {
|
|
|
1043
1033
|
}
|
|
1044
1034
|
d((n = n.apply(s, e || [])).next());
|
|
1045
1035
|
});
|
|
1046
|
-
},
|
|
1036
|
+
}, Er = function(s) {
|
|
1047
1037
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
1048
1038
|
var e = s[Symbol.asyncIterator], t;
|
|
1049
1039
|
return e ? e.call(s) : (s = typeof __values == "function" ? __values(s) : s[Symbol.iterator](), t = {}, n("next"), n("throw"), n("return"), t[Symbol.asyncIterator] = function() {
|
|
@@ -1062,9 +1052,9 @@ var wr = function(s, e, t, n) {
|
|
|
1062
1052
|
}, o);
|
|
1063
1053
|
}
|
|
1064
1054
|
};
|
|
1065
|
-
function
|
|
1066
|
-
return (e) => new
|
|
1067
|
-
const n = new
|
|
1055
|
+
function Rr(s) {
|
|
1056
|
+
return (e) => new A((t) => {
|
|
1057
|
+
const n = new Me(t), r = e.subscribe({
|
|
1068
1058
|
complete() {
|
|
1069
1059
|
n.complete();
|
|
1070
1060
|
},
|
|
@@ -1072,17 +1062,17 @@ function Er(s) {
|
|
|
1072
1062
|
n.error(i);
|
|
1073
1063
|
},
|
|
1074
1064
|
next(i) {
|
|
1075
|
-
n.schedule((o) =>
|
|
1065
|
+
n.schedule((o) => vr(this, void 0, void 0, function* () {
|
|
1076
1066
|
var c, a;
|
|
1077
1067
|
const d = yield s(i);
|
|
1078
|
-
if (
|
|
1068
|
+
if (wr(d) || Tr(d))
|
|
1079
1069
|
try {
|
|
1080
|
-
for (var u =
|
|
1081
|
-
const
|
|
1082
|
-
o(
|
|
1070
|
+
for (var u = Er(d), l; l = yield u.next(), !l.done; ) {
|
|
1071
|
+
const h = l.value;
|
|
1072
|
+
o(h);
|
|
1083
1073
|
}
|
|
1084
|
-
} catch (
|
|
1085
|
-
c = { error:
|
|
1074
|
+
} catch (h) {
|
|
1075
|
+
c = { error: h };
|
|
1086
1076
|
} finally {
|
|
1087
1077
|
try {
|
|
1088
1078
|
l && !l.done && (a = u.return) && (yield a.call(u));
|
|
@@ -1091,15 +1081,15 @@ function Er(s) {
|
|
|
1091
1081
|
}
|
|
1092
1082
|
}
|
|
1093
1083
|
else
|
|
1094
|
-
d.map((
|
|
1084
|
+
d.map((h) => o(h));
|
|
1095
1085
|
}));
|
|
1096
1086
|
}
|
|
1097
1087
|
});
|
|
1098
|
-
return () =>
|
|
1088
|
+
return () => ee(r);
|
|
1099
1089
|
});
|
|
1100
1090
|
}
|
|
1101
1091
|
function Cr(s) {
|
|
1102
|
-
return new
|
|
1092
|
+
return new A((e) => {
|
|
1103
1093
|
let t = 0;
|
|
1104
1094
|
const n = setInterval(() => {
|
|
1105
1095
|
e.next(t++);
|
|
@@ -1107,7 +1097,7 @@ function Cr(s) {
|
|
|
1107
1097
|
return () => clearInterval(n);
|
|
1108
1098
|
});
|
|
1109
1099
|
}
|
|
1110
|
-
var
|
|
1100
|
+
var xr = function(s, e, t, n) {
|
|
1111
1101
|
function r(i) {
|
|
1112
1102
|
return i instanceof t ? i : new t(function(o) {
|
|
1113
1103
|
o(i);
|
|
@@ -1135,8 +1125,8 @@ var Rr = function(s, e, t, n) {
|
|
|
1135
1125
|
});
|
|
1136
1126
|
};
|
|
1137
1127
|
function Sr(s) {
|
|
1138
|
-
return (e) => new
|
|
1139
|
-
const n = new
|
|
1128
|
+
return (e) => new A((t) => {
|
|
1129
|
+
const n = new Me(t), r = e.subscribe({
|
|
1140
1130
|
complete() {
|
|
1141
1131
|
n.complete();
|
|
1142
1132
|
},
|
|
@@ -1144,17 +1134,17 @@ function Sr(s) {
|
|
|
1144
1134
|
n.error(i);
|
|
1145
1135
|
},
|
|
1146
1136
|
next(i) {
|
|
1147
|
-
n.schedule((o) =>
|
|
1137
|
+
n.schedule((o) => xr(this, void 0, void 0, function* () {
|
|
1148
1138
|
const c = yield s(i);
|
|
1149
1139
|
o(c);
|
|
1150
1140
|
}));
|
|
1151
1141
|
}
|
|
1152
1142
|
});
|
|
1153
|
-
return () =>
|
|
1143
|
+
return () => ee(r);
|
|
1154
1144
|
});
|
|
1155
1145
|
}
|
|
1156
|
-
function
|
|
1157
|
-
return s.length === 0 ?
|
|
1146
|
+
function Mr(...s) {
|
|
1147
|
+
return s.length === 0 ? A.from([]) : new A((e) => {
|
|
1158
1148
|
let t = 0;
|
|
1159
1149
|
const n = s.map((i) => i.subscribe({
|
|
1160
1150
|
error(o) {
|
|
@@ -1167,12 +1157,12 @@ function xr(...s) {
|
|
|
1167
1157
|
++t === s.length && (e.complete(), r());
|
|
1168
1158
|
}
|
|
1169
1159
|
})), r = () => {
|
|
1170
|
-
n.forEach((i) =>
|
|
1160
|
+
n.forEach((i) => ee(i));
|
|
1171
1161
|
};
|
|
1172
1162
|
return r;
|
|
1173
1163
|
});
|
|
1174
1164
|
}
|
|
1175
|
-
class
|
|
1165
|
+
class cn extends A {
|
|
1176
1166
|
constructor() {
|
|
1177
1167
|
super((e) => (this._observers.add(e), () => this._observers.delete(e))), this._observers = /* @__PURE__ */ new Set();
|
|
1178
1168
|
}
|
|
@@ -1190,17 +1180,17 @@ class an extends L {
|
|
|
1190
1180
|
}
|
|
1191
1181
|
}
|
|
1192
1182
|
function kr(s) {
|
|
1193
|
-
const e = new
|
|
1183
|
+
const e = new cn();
|
|
1194
1184
|
let t, n = 0;
|
|
1195
|
-
return new
|
|
1185
|
+
return new A((r) => {
|
|
1196
1186
|
t || (t = s.subscribe(e));
|
|
1197
1187
|
const i = e.subscribe(r);
|
|
1198
1188
|
return n++, () => {
|
|
1199
|
-
n--, i.unsubscribe(), n === 0 && (
|
|
1189
|
+
n--, i.unsubscribe(), n === 0 && (ee(t), t = void 0);
|
|
1200
1190
|
};
|
|
1201
1191
|
});
|
|
1202
1192
|
}
|
|
1203
|
-
var
|
|
1193
|
+
var Lr = function(s, e, t, n) {
|
|
1204
1194
|
function r(i) {
|
|
1205
1195
|
return i instanceof t ? i : new t(function(o) {
|
|
1206
1196
|
o(i);
|
|
@@ -1228,9 +1218,9 @@ var Mr = function(s, e, t, n) {
|
|
|
1228
1218
|
});
|
|
1229
1219
|
};
|
|
1230
1220
|
function Ar(s, e) {
|
|
1231
|
-
return (t) => new
|
|
1221
|
+
return (t) => new A((n) => {
|
|
1232
1222
|
let r, i = 0;
|
|
1233
|
-
const o = new
|
|
1223
|
+
const o = new Me(n), c = t.subscribe({
|
|
1234
1224
|
complete() {
|
|
1235
1225
|
o.complete();
|
|
1236
1226
|
},
|
|
@@ -1238,31 +1228,31 @@ function Ar(s, e) {
|
|
|
1238
1228
|
o.error(a);
|
|
1239
1229
|
},
|
|
1240
1230
|
next(a) {
|
|
1241
|
-
o.schedule((d) =>
|
|
1231
|
+
o.schedule((d) => Lr(this, void 0, void 0, function* () {
|
|
1242
1232
|
r = yield s(i === 0 ? typeof e > "u" ? a : e : r, a, i++), d(r);
|
|
1243
1233
|
}));
|
|
1244
1234
|
}
|
|
1245
1235
|
});
|
|
1246
|
-
return () =>
|
|
1236
|
+
return () => ee(c);
|
|
1247
1237
|
});
|
|
1248
1238
|
}
|
|
1249
|
-
const
|
|
1239
|
+
const Pr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1250
1240
|
__proto__: null,
|
|
1251
|
-
Observable:
|
|
1252
|
-
Subject:
|
|
1253
|
-
filter:
|
|
1254
|
-
flatMap:
|
|
1241
|
+
Observable: A,
|
|
1242
|
+
Subject: cn,
|
|
1243
|
+
filter: yr,
|
|
1244
|
+
flatMap: Rr,
|
|
1255
1245
|
interval: Cr,
|
|
1256
1246
|
map: Sr,
|
|
1257
|
-
merge:
|
|
1247
|
+
merge: Mr,
|
|
1258
1248
|
multicast: kr,
|
|
1259
1249
|
scan: Ar,
|
|
1260
|
-
unsubscribe:
|
|
1261
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1262
|
-
var
|
|
1263
|
-
function
|
|
1264
|
-
if (bt) return
|
|
1265
|
-
bt = 1, Object.defineProperty(
|
|
1250
|
+
unsubscribe: ee
|
|
1251
|
+
}, Symbol.toStringTag, { value: "Module" })), ke = /* @__PURE__ */ gn(Pr);
|
|
1252
|
+
var ce = {}, bt;
|
|
1253
|
+
function Or() {
|
|
1254
|
+
if (bt) return ce;
|
|
1255
|
+
bt = 1, Object.defineProperty(ce, "__esModule", { value: !0 }), ce.allSettled = void 0;
|
|
1266
1256
|
function s(e) {
|
|
1267
1257
|
return Promise.all(e.map((t) => {
|
|
1268
1258
|
const n = (o) => ({ status: "fulfilled", value: o }), r = (o) => ({ status: "rejected", reason: o }), i = Promise.resolve(t);
|
|
@@ -1273,25 +1263,25 @@ function Pr() {
|
|
|
1273
1263
|
}
|
|
1274
1264
|
}));
|
|
1275
1265
|
}
|
|
1276
|
-
return
|
|
1266
|
+
return ce.allSettled = s, ce;
|
|
1277
1267
|
}
|
|
1278
|
-
var
|
|
1279
|
-
function
|
|
1268
|
+
var je = {}, yt;
|
|
1269
|
+
function Ir() {
|
|
1280
1270
|
return yt || (yt = 1, function(s) {
|
|
1281
1271
|
Object.defineProperty(s, "__esModule", { value: !0 }), s.PoolEventType = void 0, function(e) {
|
|
1282
1272
|
e.initialized = "initialized", e.taskCanceled = "taskCanceled", e.taskCompleted = "taskCompleted", e.taskFailed = "taskFailed", e.taskQueued = "taskQueued", e.taskQueueDrained = "taskQueueDrained", e.taskStart = "taskStart", e.terminated = "terminated";
|
|
1283
1273
|
}(s.PoolEventType || (s.PoolEventType = {}));
|
|
1284
|
-
}(
|
|
1274
|
+
}(je)), je;
|
|
1285
1275
|
}
|
|
1286
|
-
var
|
|
1287
|
-
function
|
|
1288
|
-
if (Tt) return
|
|
1289
|
-
Tt = 1, Object.defineProperty(
|
|
1276
|
+
var ue = {}, Tt;
|
|
1277
|
+
function un() {
|
|
1278
|
+
if (Tt) return ue;
|
|
1279
|
+
Tt = 1, Object.defineProperty(ue, "__esModule", { value: !0 }), ue.Thread = void 0;
|
|
1290
1280
|
const s = /* @__PURE__ */ Nt();
|
|
1291
1281
|
function e(t) {
|
|
1292
1282
|
throw Error(t);
|
|
1293
1283
|
}
|
|
1294
|
-
return
|
|
1284
|
+
return ue.Thread = {
|
|
1295
1285
|
/** Return an observable that can be used to subscribe to all errors happening in the thread. */
|
|
1296
1286
|
errors(t) {
|
|
1297
1287
|
return t[s.$errors] || e("Error observable not found. Make sure to pass a thread instance as returned by the spawn() promise.");
|
|
@@ -1304,46 +1294,46 @@ function cn() {
|
|
|
1304
1294
|
terminate(t) {
|
|
1305
1295
|
return t[s.$terminate]();
|
|
1306
1296
|
}
|
|
1307
|
-
},
|
|
1297
|
+
}, ue;
|
|
1308
1298
|
}
|
|
1309
1299
|
var wt;
|
|
1310
|
-
function
|
|
1300
|
+
function Nr() {
|
|
1311
1301
|
return wt || (wt = 1, function(s) {
|
|
1312
|
-
var e =
|
|
1302
|
+
var e = Y && Y.__awaiter || function(p, g, m, b) {
|
|
1313
1303
|
function _(y) {
|
|
1314
1304
|
return y instanceof m ? y : new m(function(v) {
|
|
1315
1305
|
v(y);
|
|
1316
1306
|
});
|
|
1317
1307
|
}
|
|
1318
1308
|
return new (m || (m = Promise))(function(y, v) {
|
|
1319
|
-
function
|
|
1309
|
+
function R(k) {
|
|
1320
1310
|
try {
|
|
1321
|
-
|
|
1311
|
+
M(b.next(k));
|
|
1322
1312
|
} catch (I) {
|
|
1323
1313
|
v(I);
|
|
1324
1314
|
}
|
|
1325
1315
|
}
|
|
1326
|
-
function
|
|
1316
|
+
function C(k) {
|
|
1327
1317
|
try {
|
|
1328
|
-
|
|
1318
|
+
M(b.throw(k));
|
|
1329
1319
|
} catch (I) {
|
|
1330
1320
|
v(I);
|
|
1331
1321
|
}
|
|
1332
1322
|
}
|
|
1333
|
-
function k
|
|
1334
|
-
|
|
1323
|
+
function M(k) {
|
|
1324
|
+
k.done ? y(k.value) : _(k.value).then(R, C);
|
|
1335
1325
|
}
|
|
1336
|
-
|
|
1326
|
+
M((b = b.apply(p, g || [])).next());
|
|
1337
1327
|
});
|
|
1338
|
-
}, t =
|
|
1328
|
+
}, t = Y && Y.__importDefault || function(p) {
|
|
1339
1329
|
return p && p.__esModule ? p : { default: p };
|
|
1340
1330
|
};
|
|
1341
1331
|
Object.defineProperty(s, "__esModule", { value: !0 }), s.Pool = s.Thread = s.PoolEventType = void 0;
|
|
1342
|
-
const n = t(
|
|
1332
|
+
const n = t(st()), r = ke, i = /* @__PURE__ */ Or(), o = /* @__PURE__ */ nn(), c = /* @__PURE__ */ Ir();
|
|
1343
1333
|
Object.defineProperty(s, "PoolEventType", { enumerable: !0, get: function() {
|
|
1344
1334
|
return c.PoolEventType;
|
|
1345
1335
|
} });
|
|
1346
|
-
const a = /* @__PURE__ */
|
|
1336
|
+
const a = /* @__PURE__ */ un();
|
|
1347
1337
|
Object.defineProperty(s, "Thread", { enumerable: !0, get: function() {
|
|
1348
1338
|
return a.Thread;
|
|
1349
1339
|
} });
|
|
@@ -1357,10 +1347,10 @@ function Ir() {
|
|
|
1357
1347
|
function l(p) {
|
|
1358
1348
|
return new Promise((g) => setTimeout(g, p));
|
|
1359
1349
|
}
|
|
1360
|
-
function
|
|
1350
|
+
function h(p, g) {
|
|
1361
1351
|
return p.reduce((m, b) => [...m, ...g(b)], []);
|
|
1362
1352
|
}
|
|
1363
|
-
function
|
|
1353
|
+
function f(p) {
|
|
1364
1354
|
return p.replace(/\W/g, " ").trim().replace(/\s+/g, "-");
|
|
1365
1355
|
}
|
|
1366
1356
|
function w(p, g) {
|
|
@@ -1373,7 +1363,7 @@ function Ir() {
|
|
|
1373
1363
|
constructor(g, m) {
|
|
1374
1364
|
this.eventSubject = new r.Subject(), this.initErrors = [], this.isClosing = !1, this.nextTaskID = 1, this.taskQueue = [];
|
|
1375
1365
|
const b = typeof m == "number" ? { size: m } : m || {}, { size: _ = o.defaultPoolSize } = b;
|
|
1376
|
-
this.debug = n.default(`threads:pool:${
|
|
1366
|
+
this.debug = n.default(`threads:pool:${f(b.name || String(d++))}`), this.options = b, this.workers = w(g, _), this.eventObservable = r.multicast(r.Observable.from(this.eventSubject)), Promise.all(this.workers.map((y) => y.init)).then(() => this.eventSubject.next({
|
|
1377
1367
|
type: c.PoolEventType.initialized,
|
|
1378
1368
|
size: this.workers.length
|
|
1379
1369
|
}), (y) => {
|
|
@@ -1447,13 +1437,13 @@ function Ir() {
|
|
|
1447
1437
|
}
|
|
1448
1438
|
settled(g = !1) {
|
|
1449
1439
|
return e(this, void 0, void 0, function* () {
|
|
1450
|
-
const m = () =>
|
|
1440
|
+
const m = () => h(this.workers, (y) => y.runningTasks), b = [], _ = this.eventObservable.subscribe((y) => {
|
|
1451
1441
|
y.type === c.PoolEventType.taskFailed && b.push(y.error);
|
|
1452
1442
|
});
|
|
1453
1443
|
return this.initErrors.length > 0 ? Promise.reject(this.initErrors[0]) : g && this.taskQueue.length === 0 ? (yield i.allSettled(m()), b) : (yield new Promise((y, v) => {
|
|
1454
|
-
const
|
|
1455
|
-
next(
|
|
1456
|
-
|
|
1444
|
+
const R = this.eventObservable.subscribe({
|
|
1445
|
+
next(C) {
|
|
1446
|
+
C.type === c.PoolEventType.taskQueueDrained && (R.unsubscribe(), y(void 0));
|
|
1457
1447
|
},
|
|
1458
1448
|
error: v
|
|
1459
1449
|
// make a pool-wide error reject the completed() result promise
|
|
@@ -1464,9 +1454,9 @@ function Ir() {
|
|
|
1464
1454
|
completed(g = !1) {
|
|
1465
1455
|
return e(this, void 0, void 0, function* () {
|
|
1466
1456
|
const m = this.settled(g), b = new Promise((y, v) => {
|
|
1467
|
-
const
|
|
1468
|
-
next(
|
|
1469
|
-
|
|
1457
|
+
const R = this.eventObservable.subscribe({
|
|
1458
|
+
next(C) {
|
|
1459
|
+
C.type === c.PoolEventType.taskQueueDrained ? (R.unsubscribe(), y(m)) : C.type === c.PoolEventType.taskFailed && (R.unsubscribe(), v(C.error));
|
|
1470
1460
|
},
|
|
1471
1461
|
error: v
|
|
1472
1462
|
// make a pool-wide error reject the completed() result promise
|
|
@@ -1527,12 +1517,12 @@ This usually happens for one of two reasons: We are either at peak workload righ
|
|
|
1527
1517
|
return new E(p, g);
|
|
1528
1518
|
}
|
|
1529
1519
|
T.EventType = c.PoolEventType, s.Pool = T;
|
|
1530
|
-
}(
|
|
1520
|
+
}(Y)), Y;
|
|
1531
1521
|
}
|
|
1532
|
-
var
|
|
1533
|
-
function
|
|
1534
|
-
if (vt) return
|
|
1535
|
-
vt = 1, Object.defineProperty(
|
|
1522
|
+
var j = {}, le = {}, vt;
|
|
1523
|
+
function Fr() {
|
|
1524
|
+
if (vt) return le;
|
|
1525
|
+
vt = 1, Object.defineProperty(le, "__esModule", { value: !0 }), le.createPromiseWithResolver = void 0;
|
|
1536
1526
|
const s = () => {
|
|
1537
1527
|
};
|
|
1538
1528
|
function e() {
|
|
@@ -1543,21 +1533,21 @@ function Nr() {
|
|
|
1543
1533
|
t = !0, n = c, r(n);
|
|
1544
1534
|
}];
|
|
1545
1535
|
}
|
|
1546
|
-
return
|
|
1536
|
+
return le.createPromiseWithResolver = e, le;
|
|
1547
1537
|
}
|
|
1548
1538
|
var Ue = {}, Et;
|
|
1549
|
-
function
|
|
1539
|
+
function Dr() {
|
|
1550
1540
|
return Et || (Et = 1, function(s) {
|
|
1551
1541
|
Object.defineProperty(s, "__esModule", { value: !0 }), s.WorkerEventType = void 0, function(e) {
|
|
1552
1542
|
e.internalError = "internalError", e.message = "message", e.termination = "termination";
|
|
1553
1543
|
}(s.WorkerEventType || (s.WorkerEventType = {}));
|
|
1554
1544
|
}(Ue)), Ue;
|
|
1555
1545
|
}
|
|
1556
|
-
var U = {},
|
|
1557
|
-
function
|
|
1558
|
-
if (
|
|
1559
|
-
|
|
1560
|
-
const s =
|
|
1546
|
+
var U = {}, de = {}, Rt;
|
|
1547
|
+
function Hr() {
|
|
1548
|
+
if (Rt) return de;
|
|
1549
|
+
Rt = 1, Object.defineProperty(de, "__esModule", { value: !0 }), de.ObservablePromise = void 0;
|
|
1550
|
+
const s = ke, e = () => {
|
|
1561
1551
|
}, t = (c) => c, n = (c) => Promise.resolve().then(c);
|
|
1562
1552
|
function r(c) {
|
|
1563
1553
|
throw c;
|
|
@@ -1572,17 +1562,17 @@ function Dr() {
|
|
|
1572
1562
|
complete() {
|
|
1573
1563
|
d.complete(), u.onCompletion();
|
|
1574
1564
|
},
|
|
1575
|
-
error(
|
|
1576
|
-
d.error(
|
|
1565
|
+
error(h) {
|
|
1566
|
+
d.error(h), u.onError(h);
|
|
1577
1567
|
},
|
|
1578
|
-
next(
|
|
1579
|
-
d.next(
|
|
1568
|
+
next(h) {
|
|
1569
|
+
d.next(h), u.onNext(h);
|
|
1580
1570
|
}
|
|
1581
1571
|
});
|
|
1582
1572
|
try {
|
|
1583
1573
|
return this.initHasRun = !0, a(l);
|
|
1584
|
-
} catch (
|
|
1585
|
-
l.error(
|
|
1574
|
+
} catch (h) {
|
|
1575
|
+
l.error(h);
|
|
1586
1576
|
}
|
|
1587
1577
|
}), this.initHasRun = !1, this.fulfillmentCallbacks = [], this.rejectionCallbacks = [], this.firstValueSet = !1, this.state = "pending";
|
|
1588
1578
|
}
|
|
@@ -1601,28 +1591,28 @@ function Dr() {
|
|
|
1601
1591
|
}
|
|
1602
1592
|
then(a, d) {
|
|
1603
1593
|
const u = a || t, l = d || r;
|
|
1604
|
-
let
|
|
1605
|
-
return new Promise((
|
|
1594
|
+
let h = !1;
|
|
1595
|
+
return new Promise((f, w) => {
|
|
1606
1596
|
const E = (p) => {
|
|
1607
|
-
if (!
|
|
1608
|
-
|
|
1597
|
+
if (!h) {
|
|
1598
|
+
h = !0;
|
|
1609
1599
|
try {
|
|
1610
|
-
|
|
1600
|
+
f(l(p));
|
|
1611
1601
|
} catch (g) {
|
|
1612
1602
|
w(g);
|
|
1613
1603
|
}
|
|
1614
1604
|
}
|
|
1615
1605
|
}, T = (p) => {
|
|
1616
1606
|
try {
|
|
1617
|
-
|
|
1607
|
+
f(u(p));
|
|
1618
1608
|
} catch (g) {
|
|
1619
1609
|
E(g);
|
|
1620
1610
|
}
|
|
1621
1611
|
};
|
|
1622
1612
|
if (this.initHasRun || this.subscribe({ error: E }), this.state === "fulfilled")
|
|
1623
|
-
return
|
|
1613
|
+
return f(u(this.firstValue));
|
|
1624
1614
|
if (this.state === "rejected")
|
|
1625
|
-
return
|
|
1615
|
+
return h = !0, f(l(this.rejection));
|
|
1626
1616
|
this.fulfillmentCallbacks.push(T), this.rejectionCallbacks.push(E);
|
|
1627
1617
|
});
|
|
1628
1618
|
}
|
|
@@ -1635,34 +1625,34 @@ function Dr() {
|
|
|
1635
1625
|
}
|
|
1636
1626
|
static from(a) {
|
|
1637
1627
|
return i(a) ? new o((d) => {
|
|
1638
|
-
const u = (
|
|
1639
|
-
d.next(
|
|
1640
|
-
}, l = (
|
|
1641
|
-
d.error(
|
|
1628
|
+
const u = (h) => {
|
|
1629
|
+
d.next(h), d.complete();
|
|
1630
|
+
}, l = (h) => {
|
|
1631
|
+
d.error(h);
|
|
1642
1632
|
};
|
|
1643
1633
|
a.then(u, l);
|
|
1644
1634
|
}) : super.from(a);
|
|
1645
1635
|
}
|
|
1646
1636
|
}
|
|
1647
|
-
return
|
|
1637
|
+
return de.ObservablePromise = o, de;
|
|
1648
1638
|
}
|
|
1649
|
-
var
|
|
1639
|
+
var Ct;
|
|
1650
1640
|
function jr() {
|
|
1651
|
-
if (
|
|
1652
|
-
|
|
1641
|
+
if (Ct) return U;
|
|
1642
|
+
Ct = 1;
|
|
1653
1643
|
var s = U && U.__importDefault || function(p) {
|
|
1654
1644
|
return p && p.__esModule ? p : { default: p };
|
|
1655
1645
|
};
|
|
1656
1646
|
Object.defineProperty(U, "__esModule", { value: !0 }), U.createProxyModule = U.createProxyFunction = void 0;
|
|
1657
|
-
const e = s(
|
|
1647
|
+
const e = s(st()), t = ke, n = /* @__PURE__ */ rt(), r = /* @__PURE__ */ Hr(), i = /* @__PURE__ */ Ft(), o = /* @__PURE__ */ _n(), c = e.default("threads:master:messages");
|
|
1658
1648
|
let a = 1;
|
|
1659
|
-
const d = (p) => Array.from(new Set(p)), u = (p) => p && p.type === o.WorkerMessageType.error, l = (p) => p && p.type === o.WorkerMessageType.result,
|
|
1660
|
-
function
|
|
1649
|
+
const d = (p) => Array.from(new Set(p)), u = (p) => p && p.type === o.WorkerMessageType.error, l = (p) => p && p.type === o.WorkerMessageType.result, h = (p) => p && p.type === o.WorkerMessageType.running;
|
|
1650
|
+
function f(p, g) {
|
|
1661
1651
|
return new t.Observable((m) => {
|
|
1662
1652
|
let b;
|
|
1663
1653
|
const _ = (y) => {
|
|
1664
1654
|
if (c("Message from worker:", y.data), !(!y.data || y.data.uid !== g)) {
|
|
1665
|
-
if (
|
|
1655
|
+
if (h(y.data))
|
|
1666
1656
|
b = y.data.resultType;
|
|
1667
1657
|
else if (l(y.data))
|
|
1668
1658
|
b === "promise" ? (typeof y.data.payload < "u" && m.next(n.deserialize(y.data.payload)), m.complete(), p.removeEventListener("message", _)) : (y.data.payload && m.next(n.deserialize(y.data.payload)), y.data.complete && (m.complete(), p.removeEventListener("message", _)));
|
|
@@ -1709,10 +1699,10 @@ function jr() {
|
|
|
1709
1699
|
c("Sending command to run function to worker:", v);
|
|
1710
1700
|
try {
|
|
1711
1701
|
p.postMessage(v, y);
|
|
1712
|
-
} catch (
|
|
1713
|
-
return r.ObservablePromise.from(Promise.reject(
|
|
1702
|
+
} catch (R) {
|
|
1703
|
+
return r.ObservablePromise.from(Promise.reject(R));
|
|
1714
1704
|
}
|
|
1715
|
-
return r.ObservablePromise.from(t.multicast(
|
|
1705
|
+
return r.ObservablePromise.from(t.multicast(f(p, b)));
|
|
1716
1706
|
};
|
|
1717
1707
|
}
|
|
1718
1708
|
U.createProxyFunction = E;
|
|
@@ -1724,82 +1714,82 @@ function jr() {
|
|
|
1724
1714
|
}
|
|
1725
1715
|
return U.createProxyModule = T, U;
|
|
1726
1716
|
}
|
|
1727
|
-
var
|
|
1728
|
-
function
|
|
1729
|
-
if (
|
|
1730
|
-
|
|
1731
|
-
var s =
|
|
1732
|
-
function
|
|
1733
|
-
return
|
|
1734
|
-
M
|
|
1717
|
+
var xt;
|
|
1718
|
+
function Ur() {
|
|
1719
|
+
if (xt) return j;
|
|
1720
|
+
xt = 1;
|
|
1721
|
+
var s = j && j.__awaiter || function(_, y, v, R) {
|
|
1722
|
+
function C(M) {
|
|
1723
|
+
return M instanceof v ? M : new v(function(k) {
|
|
1724
|
+
k(M);
|
|
1735
1725
|
});
|
|
1736
1726
|
}
|
|
1737
|
-
return new (v || (v = Promise))(function(
|
|
1738
|
-
function I(
|
|
1727
|
+
return new (v || (v = Promise))(function(M, k) {
|
|
1728
|
+
function I(V) {
|
|
1739
1729
|
try {
|
|
1740
|
-
|
|
1741
|
-
} catch (
|
|
1742
|
-
|
|
1730
|
+
Le(R.next(V));
|
|
1731
|
+
} catch (Ae) {
|
|
1732
|
+
k(Ae);
|
|
1743
1733
|
}
|
|
1744
1734
|
}
|
|
1745
|
-
function
|
|
1735
|
+
function q(V) {
|
|
1746
1736
|
try {
|
|
1747
|
-
|
|
1748
|
-
} catch (
|
|
1749
|
-
|
|
1737
|
+
Le(R.throw(V));
|
|
1738
|
+
} catch (Ae) {
|
|
1739
|
+
k(Ae);
|
|
1750
1740
|
}
|
|
1751
1741
|
}
|
|
1752
|
-
function
|
|
1753
|
-
|
|
1742
|
+
function Le(V) {
|
|
1743
|
+
V.done ? M(V.value) : C(V.value).then(I, q);
|
|
1754
1744
|
}
|
|
1755
|
-
|
|
1745
|
+
Le((R = R.apply(_, y || [])).next());
|
|
1756
1746
|
});
|
|
1757
|
-
}, e =
|
|
1747
|
+
}, e = j && j.__importDefault || function(_) {
|
|
1758
1748
|
return _ && _.__esModule ? _ : { default: _ };
|
|
1759
1749
|
};
|
|
1760
|
-
Object.defineProperty(
|
|
1761
|
-
const t = e(
|
|
1750
|
+
Object.defineProperty(j, "__esModule", { value: !0 }), j.spawn = void 0;
|
|
1751
|
+
const t = e(st()), n = ke, r = /* @__PURE__ */ rt(), i = /* @__PURE__ */ Fr(), o = /* @__PURE__ */ Nt(), c = /* @__PURE__ */ Dr(), a = /* @__PURE__ */ jr(), d = t.default("threads:master:messages"), u = t.default("threads:master:spawn"), l = t.default("threads:master:thread-utils"), h = (_) => _ && _.type === "init", f = (_) => _ && _.type === "uncaughtError", w = typeof process < "u" && process.env.THREADS_WORKER_INIT_TIMEOUT ? Number.parseInt(process.env.THREADS_WORKER_INIT_TIMEOUT, 10) : 1e4;
|
|
1762
1752
|
function E(_, y, v) {
|
|
1763
1753
|
return s(this, void 0, void 0, function* () {
|
|
1764
|
-
let
|
|
1765
|
-
const
|
|
1766
|
-
|
|
1767
|
-
}),
|
|
1754
|
+
let R;
|
|
1755
|
+
const C = new Promise((k, I) => {
|
|
1756
|
+
R = setTimeout(() => I(Error(v)), y);
|
|
1757
|
+
}), M = yield Promise.race([
|
|
1768
1758
|
_,
|
|
1769
|
-
|
|
1759
|
+
C
|
|
1770
1760
|
]);
|
|
1771
|
-
return clearTimeout(
|
|
1761
|
+
return clearTimeout(R), M;
|
|
1772
1762
|
});
|
|
1773
1763
|
}
|
|
1774
1764
|
function T(_) {
|
|
1775
1765
|
return new Promise((y, v) => {
|
|
1776
|
-
const
|
|
1777
|
-
d("Message from worker before finishing initialization:",
|
|
1766
|
+
const R = (C) => {
|
|
1767
|
+
d("Message from worker before finishing initialization:", C.data), h(C.data) ? (_.removeEventListener("message", R), y(C.data)) : f(C.data) && (_.removeEventListener("message", R), v(r.deserialize(C.data.error)));
|
|
1778
1768
|
};
|
|
1779
|
-
_.addEventListener("message",
|
|
1769
|
+
_.addEventListener("message", R);
|
|
1780
1770
|
});
|
|
1781
1771
|
}
|
|
1782
1772
|
function p(_, y) {
|
|
1783
1773
|
return new n.Observable((v) => {
|
|
1784
|
-
const
|
|
1785
|
-
const
|
|
1774
|
+
const R = (M) => {
|
|
1775
|
+
const k = {
|
|
1786
1776
|
type: c.WorkerEventType.message,
|
|
1787
|
-
data:
|
|
1777
|
+
data: M.data
|
|
1788
1778
|
};
|
|
1789
|
-
v.next(
|
|
1790
|
-
},
|
|
1791
|
-
l("Unhandled promise rejection event in thread:",
|
|
1792
|
-
const
|
|
1779
|
+
v.next(k);
|
|
1780
|
+
}, C = (M) => {
|
|
1781
|
+
l("Unhandled promise rejection event in thread:", M);
|
|
1782
|
+
const k = {
|
|
1793
1783
|
type: c.WorkerEventType.internalError,
|
|
1794
|
-
error: Error(
|
|
1784
|
+
error: Error(M.reason)
|
|
1795
1785
|
};
|
|
1796
|
-
v.next(
|
|
1786
|
+
v.next(k);
|
|
1797
1787
|
};
|
|
1798
|
-
_.addEventListener("message",
|
|
1799
|
-
const
|
|
1788
|
+
_.addEventListener("message", R), _.addEventListener("unhandledrejection", C), y.then(() => {
|
|
1789
|
+
const M = {
|
|
1800
1790
|
type: c.WorkerEventType.termination
|
|
1801
1791
|
};
|
|
1802
|
-
_.removeEventListener("message",
|
|
1792
|
+
_.removeEventListener("message", R), _.removeEventListener("unhandledrejection", C), v.next(M), v.complete();
|
|
1803
1793
|
});
|
|
1804
1794
|
});
|
|
1805
1795
|
}
|
|
@@ -1809,77 +1799,77 @@ function Hr() {
|
|
|
1809
1799
|
l("Terminating worker"), yield _.terminate(), v();
|
|
1810
1800
|
}), termination: y };
|
|
1811
1801
|
}
|
|
1812
|
-
function m(_, y, v,
|
|
1813
|
-
const
|
|
1802
|
+
function m(_, y, v, R) {
|
|
1803
|
+
const C = v.filter((M) => M.type === c.WorkerEventType.internalError).map((M) => M.error);
|
|
1814
1804
|
return Object.assign(_, {
|
|
1815
|
-
[o.$errors]:
|
|
1805
|
+
[o.$errors]: C,
|
|
1816
1806
|
[o.$events]: v,
|
|
1817
|
-
[o.$terminate]:
|
|
1807
|
+
[o.$terminate]: R,
|
|
1818
1808
|
[o.$worker]: y
|
|
1819
1809
|
});
|
|
1820
1810
|
}
|
|
1821
1811
|
function b(_, y) {
|
|
1822
1812
|
return s(this, void 0, void 0, function* () {
|
|
1823
1813
|
u("Initializing new thread");
|
|
1824
|
-
const v = y && y.timeout ? y.timeout : w,
|
|
1825
|
-
if (
|
|
1826
|
-
const
|
|
1827
|
-
return m(
|
|
1828
|
-
} else if (
|
|
1829
|
-
const
|
|
1830
|
-
return m(
|
|
1814
|
+
const v = y && y.timeout ? y.timeout : w, C = (yield E(T(_), v, `Timeout: Did not receive an init message from worker after ${v}ms. Make sure the worker calls expose().`)).exposed, { termination: M, terminate: k } = g(_), I = p(_, M);
|
|
1815
|
+
if (C.type === "function") {
|
|
1816
|
+
const q = a.createProxyFunction(_);
|
|
1817
|
+
return m(q, _, I, k);
|
|
1818
|
+
} else if (C.type === "module") {
|
|
1819
|
+
const q = a.createProxyModule(_, C.methods);
|
|
1820
|
+
return m(q, _, I, k);
|
|
1831
1821
|
} else {
|
|
1832
|
-
const
|
|
1833
|
-
throw Error(`Worker init message states unexpected type of expose(): ${
|
|
1822
|
+
const q = C.type;
|
|
1823
|
+
throw Error(`Worker init message states unexpected type of expose(): ${q}`);
|
|
1834
1824
|
}
|
|
1835
1825
|
});
|
|
1836
1826
|
}
|
|
1837
|
-
return
|
|
1827
|
+
return j.spawn = b, j;
|
|
1838
1828
|
}
|
|
1839
|
-
var
|
|
1840
|
-
function
|
|
1841
|
-
return
|
|
1829
|
+
var St;
|
|
1830
|
+
function Br() {
|
|
1831
|
+
return St || (St = 1, function(s) {
|
|
1842
1832
|
Object.defineProperty(s, "__esModule", { value: !0 }), s.Worker = s.BlobWorker = s.isWorkerRuntime = s.Thread = s.spawn = s.Pool = void 0;
|
|
1843
|
-
const e = /* @__PURE__ */
|
|
1833
|
+
const e = /* @__PURE__ */ nn();
|
|
1844
1834
|
Object.defineProperty(s, "isWorkerRuntime", { enumerable: !0, get: function() {
|
|
1845
1835
|
return e.isWorkerRuntime;
|
|
1846
1836
|
} });
|
|
1847
|
-
var t = /* @__PURE__ */
|
|
1837
|
+
var t = /* @__PURE__ */ Nr();
|
|
1848
1838
|
Object.defineProperty(s, "Pool", { enumerable: !0, get: function() {
|
|
1849
1839
|
return t.Pool;
|
|
1850
1840
|
} });
|
|
1851
|
-
var n = /* @__PURE__ */
|
|
1841
|
+
var n = /* @__PURE__ */ Ur();
|
|
1852
1842
|
Object.defineProperty(s, "spawn", { enumerable: !0, get: function() {
|
|
1853
1843
|
return n.spawn;
|
|
1854
1844
|
} });
|
|
1855
|
-
var r = /* @__PURE__ */
|
|
1845
|
+
var r = /* @__PURE__ */ un();
|
|
1856
1846
|
Object.defineProperty(s, "Thread", { enumerable: !0, get: function() {
|
|
1857
1847
|
return r.Thread;
|
|
1858
1848
|
} }), s.BlobWorker = e.getWorkerImplementation().blob, s.Worker = e.getWorkerImplementation().default;
|
|
1859
1849
|
}(Ne)), Ne;
|
|
1860
1850
|
}
|
|
1861
|
-
var
|
|
1862
|
-
function
|
|
1863
|
-
return
|
|
1864
|
-
var e =
|
|
1851
|
+
var Mt;
|
|
1852
|
+
function Wr() {
|
|
1853
|
+
return Mt || (Mt = 1, function(s) {
|
|
1854
|
+
var e = X && X.__createBinding || (Object.create ? function(c, a, d, u) {
|
|
1865
1855
|
u === void 0 && (u = d), Object.defineProperty(c, u, { enumerable: !0, get: function() {
|
|
1866
1856
|
return a[d];
|
|
1867
1857
|
} });
|
|
1868
1858
|
} : function(c, a, d, u) {
|
|
1869
1859
|
u === void 0 && (u = d), c[u] = a[d];
|
|
1870
|
-
}), t =
|
|
1860
|
+
}), t = X && X.__exportStar || function(c, a) {
|
|
1871
1861
|
for (var d in c) d !== "default" && !Object.prototype.hasOwnProperty.call(a, d) && e(a, c, d);
|
|
1872
1862
|
};
|
|
1873
1863
|
Object.defineProperty(s, "__esModule", { value: !0 }), s.Transfer = s.DefaultSerializer = s.expose = s.registerSerializer = void 0;
|
|
1874
|
-
var n = /* @__PURE__ */
|
|
1864
|
+
var n = /* @__PURE__ */ rt();
|
|
1875
1865
|
Object.defineProperty(s, "registerSerializer", { enumerable: !0, get: function() {
|
|
1876
1866
|
return n.registerSerializer;
|
|
1877
|
-
} }), t(/* @__PURE__ */
|
|
1878
|
-
var r =
|
|
1867
|
+
} }), t(/* @__PURE__ */ Br(), s);
|
|
1868
|
+
var r = bn();
|
|
1879
1869
|
Object.defineProperty(s, "expose", { enumerable: !0, get: function() {
|
|
1880
1870
|
return r.expose;
|
|
1881
1871
|
} });
|
|
1882
|
-
var i = /* @__PURE__ */
|
|
1872
|
+
var i = /* @__PURE__ */ yn();
|
|
1883
1873
|
Object.defineProperty(s, "DefaultSerializer", { enumerable: !0, get: function() {
|
|
1884
1874
|
return i.DefaultSerializer;
|
|
1885
1875
|
} });
|
|
@@ -1887,20 +1877,20 @@ function Br() {
|
|
|
1887
1877
|
Object.defineProperty(s, "Transfer", { enumerable: !0, get: function() {
|
|
1888
1878
|
return o.Transfer;
|
|
1889
1879
|
} });
|
|
1890
|
-
}(
|
|
1880
|
+
}(X)), X;
|
|
1891
1881
|
}
|
|
1892
|
-
var Gr = /* @__PURE__ */
|
|
1893
|
-
const
|
|
1894
|
-
|
|
1895
|
-
const
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
const
|
|
1900
|
-
|
|
1901
|
-
const
|
|
1902
|
-
var
|
|
1903
|
-
const
|
|
1882
|
+
var Gr = /* @__PURE__ */ Wr();
|
|
1883
|
+
const K = /* @__PURE__ */ Tn(Gr);
|
|
1884
|
+
K.registerSerializer;
|
|
1885
|
+
const zr = K.spawn;
|
|
1886
|
+
K.BlobWorker;
|
|
1887
|
+
K.DefaultSerializer;
|
|
1888
|
+
K.Pool;
|
|
1889
|
+
const $r = K.Thread;
|
|
1890
|
+
K.Transfer;
|
|
1891
|
+
const Kr = K.Worker;
|
|
1892
|
+
var qr = Object.defineProperty, Vr = (s, e, t) => e in s ? qr(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, B = (s, e, t) => Vr(s, typeof e != "symbol" ? e + "" : e, t);
|
|
1893
|
+
const Xr = () => {
|
|
1904
1894
|
try {
|
|
1905
1895
|
if (window) {
|
|
1906
1896
|
if (navigator != null && navigator.hardwareConcurrency)
|
|
@@ -1910,24 +1900,24 @@ const Vr = () => {
|
|
|
1910
1900
|
} catch (s) {
|
|
1911
1901
|
return console.error("🛑 Unable to detect available cores", s), 2;
|
|
1912
1902
|
}
|
|
1913
|
-
},
|
|
1914
|
-
let
|
|
1915
|
-
class
|
|
1903
|
+
}, Qr = () => Xr() - 1, Yr = "TERMINATE_THREAD_FROM_WORKER";
|
|
1904
|
+
let Jr = -1;
|
|
1905
|
+
class Zr {
|
|
1916
1906
|
constructor(e) {
|
|
1917
|
-
B(this, "_handleTerminate"), B(this, "_handleError"), B(this, "_task"), B(this, "id",
|
|
1907
|
+
B(this, "_handleTerminate"), B(this, "_handleError"), B(this, "_task"), B(this, "id", Jr += 1), B(this, "idle", !0), B(this, "worker"), B(this, "thread"), this._handleTerminate = e == null ? void 0 : e.onTerminate, this._handleError = e == null ? void 0 : e.onError;
|
|
1918
1908
|
}
|
|
1919
1909
|
_handleMessages(e) {
|
|
1920
1910
|
var t;
|
|
1921
|
-
e instanceof MessageEvent && ((t = e.data) == null ? void 0 : t.token) ===
|
|
1911
|
+
e instanceof MessageEvent && ((t = e.data) == null ? void 0 : t.token) === Yr && this.terminate();
|
|
1922
1912
|
}
|
|
1923
1913
|
async run(e) {
|
|
1924
1914
|
var t;
|
|
1925
1915
|
try {
|
|
1926
1916
|
const { payload: n, options: r } = e;
|
|
1927
|
-
return this.idle = !1, this.worker = new
|
|
1917
|
+
return this.idle = !1, this.worker = new Kr(n.path, {
|
|
1928
1918
|
type: "module",
|
|
1929
1919
|
...r == null ? void 0 : r.worker
|
|
1930
|
-
}), this.thread = await
|
|
1920
|
+
}), this.thread = await zr(this.worker, {
|
|
1931
1921
|
timeout: 1e4,
|
|
1932
1922
|
...r == null ? void 0 : r.spawn
|
|
1933
1923
|
}), this._task = e, this.worker.postMessage(n.subject, n.transferSubject), this.worker.addEventListener("message", this._handleMessages.bind(this)), this;
|
|
@@ -1944,10 +1934,10 @@ class Jr {
|
|
|
1944
1934
|
(e = this.worker) == null || e.removeEventListener(
|
|
1945
1935
|
"message",
|
|
1946
1936
|
this._handleMessages.bind(this)
|
|
1947
|
-
), this.thread && await
|
|
1937
|
+
), this.thread && await $r.terminate(this.thread), await ((t = this.worker) == null ? void 0 : t.terminate()), this.worker = void 0, this.thread = void 0, this._task = void 0, this.idle = !0, (n = this._handleTerminate) == null || n.call(this);
|
|
1948
1938
|
}
|
|
1949
1939
|
}
|
|
1950
|
-
class
|
|
1940
|
+
class es {
|
|
1951
1941
|
constructor(e, t, n) {
|
|
1952
1942
|
B(this, "_workerThreads", []), B(this, "_tasksQueue", []), this.maxWorkersCount = e, this.debugMode = t, this.onWorkerThreadRun = n;
|
|
1953
1943
|
for (let r = 0; r < this.maxWorkersCount; r++)
|
|
@@ -1960,7 +1950,7 @@ class Zr {
|
|
|
1960
1950
|
console.error(`Error from worker #${t.id}:`, e), this.runNext();
|
|
1961
1951
|
}
|
|
1962
1952
|
_createWorkerThread() {
|
|
1963
|
-
const e = new
|
|
1953
|
+
const e = new Zr({
|
|
1964
1954
|
onTerminate: () => this._handleWorkerThreadTerminate(e),
|
|
1965
1955
|
onError: (t) => this._handleWorkerThreadError(t, e)
|
|
1966
1956
|
});
|
|
@@ -2024,23 +2014,21 @@ class Zr {
|
|
|
2024
2014
|
this._tasksQueue = [], await Promise.all(this._workerThreads.map((e) => e.terminate()));
|
|
2025
2015
|
}
|
|
2026
2016
|
}
|
|
2027
|
-
const
|
|
2028
|
-
var
|
|
2029
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
2017
|
+
const ts = (s, e) => new es(Qr(), !!e);
|
|
2018
|
+
var ns = Object.defineProperty, rs = Object.getOwnPropertyDescriptor, ss = (s, e, t, n) => {
|
|
2019
|
+
for (var r = n > 1 ? void 0 : n ? rs(e, t) : e, i = s.length - 1, o; i >= 0; i--)
|
|
2030
2020
|
(o = s[i]) && (r = (n ? o(e, t, r) : o(r)) || r);
|
|
2031
|
-
return n && r &&
|
|
2032
|
-
},
|
|
2033
|
-
let
|
|
2021
|
+
return n && r && ns(e, t, r), r;
|
|
2022
|
+
}, is = (s, e) => (t, n) => e(t, n, s);
|
|
2023
|
+
let Re = class {
|
|
2034
2024
|
constructor(s) {
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
init(s) {
|
|
2043
|
-
this.worker = s.worker, this.thread = s.thread;
|
|
2025
|
+
S(this, "workerPool");
|
|
2026
|
+
S(this, "canvas");
|
|
2027
|
+
S(this, "canvasWrapper");
|
|
2028
|
+
S(this, "offscreenCanvas");
|
|
2029
|
+
S(this, "workerThread");
|
|
2030
|
+
var e;
|
|
2031
|
+
this._props = s, this.workerPool = ts(void 0, !!((e = this._props.debug) != null && e.enabled));
|
|
2044
2032
|
}
|
|
2045
2033
|
preventDefaultHandler(s) {
|
|
2046
2034
|
return s.preventDefault(), {
|
|
@@ -2048,10 +2036,12 @@ let Ce = class {
|
|
|
2048
2036
|
};
|
|
2049
2037
|
}
|
|
2050
2038
|
getScreenSizes() {
|
|
2051
|
-
var s, e;
|
|
2039
|
+
var s, e, t, n;
|
|
2052
2040
|
return {
|
|
2053
2041
|
width: (s = this.canvas) == null ? void 0 : s.width,
|
|
2054
2042
|
height: (e = this.canvas) == null ? void 0 : e.height,
|
|
2043
|
+
wrapperWidth: ((t = this.canvasWrapper) == null ? void 0 : t.clientWidth) ?? 0,
|
|
2044
|
+
wrapperHeight: ((n = this.canvasWrapper) == null ? void 0 : n.clientHeight) ?? 0,
|
|
2055
2045
|
windowWidth: (window == null ? void 0 : window.innerWidth) ?? 0,
|
|
2056
2046
|
windowHeight: (window == null ? void 0 : window.innerHeight) ?? 0
|
|
2057
2047
|
};
|
|
@@ -2069,7 +2059,7 @@ let Ce = class {
|
|
|
2069
2059
|
mouseEventHandler(s) {
|
|
2070
2060
|
return {
|
|
2071
2061
|
...this.getScreenSizes(),
|
|
2072
|
-
...
|
|
2062
|
+
...pe(s, [
|
|
2073
2063
|
"ctrlKey",
|
|
2074
2064
|
"metaKey",
|
|
2075
2065
|
"shiftKey",
|
|
@@ -2096,27 +2086,27 @@ let Ce = class {
|
|
|
2096
2086
|
wheelEventHandler(s) {
|
|
2097
2087
|
return s.preventDefault(), {
|
|
2098
2088
|
...this.getScreenSizes(),
|
|
2099
|
-
...
|
|
2089
|
+
...pe(s, ["deltaX", "deltaY"])
|
|
2100
2090
|
};
|
|
2101
2091
|
}
|
|
2102
2092
|
keyEventHandler(s) {
|
|
2103
|
-
if (
|
|
2093
|
+
if (wn.includes(s.code))
|
|
2104
2094
|
return s.preventDefault(), {
|
|
2105
2095
|
...this.getScreenSizes(),
|
|
2106
|
-
...
|
|
2096
|
+
...pe(s, ["ctrlKey", "metaKey", "shiftKey", "keyCode"])
|
|
2107
2097
|
};
|
|
2108
2098
|
}
|
|
2109
2099
|
};
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
],
|
|
2114
|
-
var
|
|
2115
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
2100
|
+
Re = ss([
|
|
2101
|
+
ie(oe.ContainerScoped),
|
|
2102
|
+
is(0, O(Se))
|
|
2103
|
+
], Re);
|
|
2104
|
+
var os = Object.defineProperty, as = Object.getOwnPropertyDescriptor, cs = (s, e, t, n) => {
|
|
2105
|
+
for (var r = n > 1 ? void 0 : n ? as(e, t) : e, i = s.length - 1, o; i >= 0; i--)
|
|
2116
2106
|
(o = s[i]) && (r = (n ? o(e, t, r) : o(r)) || r);
|
|
2117
|
-
return n && r &&
|
|
2118
|
-
},
|
|
2119
|
-
let
|
|
2107
|
+
return n && r && os(e, t, r), r;
|
|
2108
|
+
}, us = (s, e) => (t, n) => e(t, n, s);
|
|
2109
|
+
let Je = class extends vn {
|
|
2120
2110
|
constructor(s) {
|
|
2121
2111
|
super(), this._service = s;
|
|
2122
2112
|
}
|
|
@@ -2127,34 +2117,33 @@ let Ze = class extends wn {
|
|
|
2127
2117
|
} catch {
|
|
2128
2118
|
s = void 0;
|
|
2129
2119
|
}
|
|
2130
|
-
for (const e of
|
|
2120
|
+
for (const e of Ht) {
|
|
2131
2121
|
const t = e.startsWith("mouse") || e.startsWith("pointer") || e.startsWith("touch") ? this._service.mouseEventHandler.bind(this._service) : e.startsWith("key") ? this._service.keyEventHandler.bind(this._service) : e === "resize" ? this._service.uiEventHandler.bind(this._service) : e === "wheel" ? this._service.wheelEventHandler.bind(this._service) : this._service.preventDefaultHandler.bind(this._service);
|
|
2132
|
-
this[`${e}$$`] = new
|
|
2122
|
+
this[`${e}$$`] = new jt(), En(
|
|
2133
2123
|
e === "resize" ? window : this._service.canvas,
|
|
2134
2124
|
e
|
|
2135
2125
|
).pipe(
|
|
2136
|
-
|
|
2137
|
-
ye(t.bind(this)),
|
|
2126
|
+
ye((n) => t.bind(this)(n)),
|
|
2138
2127
|
Ut((n) => !(e === "keydown" && !n))
|
|
2139
2128
|
).subscribe((n) => {
|
|
2140
2129
|
this[`${e}$$`].next(
|
|
2141
2130
|
n
|
|
2142
2131
|
);
|
|
2143
2132
|
}), this[`${e}$`] = this[`${e}$$`].asObservable(), this[`${e}$`].subscribe((n) => {
|
|
2144
|
-
var r, i, o;
|
|
2145
|
-
(i = (r = this._service.thread) == null ? void 0 :
|
|
2133
|
+
var r, i, o, c;
|
|
2134
|
+
(o = (i = (r = this._service.workerThread) == null ? void 0 : r.thread) == null ? void 0 : i[e]) == null || o.call(i, n), (c = s == null ? void 0 : s[e]) == null || c.call(s, n);
|
|
2146
2135
|
});
|
|
2147
2136
|
}
|
|
2148
2137
|
}
|
|
2149
2138
|
};
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
],
|
|
2154
|
-
function
|
|
2155
|
-
if (e ===
|
|
2139
|
+
Je = cs([
|
|
2140
|
+
ie(oe.ContainerScoped),
|
|
2141
|
+
us(0, O(Re))
|
|
2142
|
+
], Je);
|
|
2143
|
+
function kt(s, e) {
|
|
2144
|
+
if (e === Mn)
|
|
2156
2145
|
return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."), s;
|
|
2157
|
-
if (e ===
|
|
2146
|
+
if (e === Ke || e === Gt) {
|
|
2158
2147
|
let t = s.getIndex();
|
|
2159
2148
|
if (t === null) {
|
|
2160
2149
|
const o = [], c = s.getAttribute("position");
|
|
@@ -2166,7 +2155,7 @@ function Mt(s, e) {
|
|
|
2166
2155
|
return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."), s;
|
|
2167
2156
|
}
|
|
2168
2157
|
const n = t.count - 2, r = [];
|
|
2169
|
-
if (e ===
|
|
2158
|
+
if (e === Ke)
|
|
2170
2159
|
for (let o = 1; o <= n; o++)
|
|
2171
2160
|
r.push(t.getX(0)), r.push(t.getX(o)), r.push(t.getX(o + 1));
|
|
2172
2161
|
else
|
|
@@ -2179,7 +2168,7 @@ function Mt(s, e) {
|
|
|
2179
2168
|
return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:", e), s;
|
|
2180
2169
|
}
|
|
2181
2170
|
const Be = /* @__PURE__ */ new WeakMap();
|
|
2182
|
-
class
|
|
2171
|
+
class ln extends zt {
|
|
2183
2172
|
/**
|
|
2184
2173
|
* Constructs a new Draco loader.
|
|
2185
2174
|
*
|
|
@@ -2250,7 +2239,7 @@ class un extends Wt {
|
|
|
2250
2239
|
*/
|
|
2251
2240
|
parse(e, t, n = () => {
|
|
2252
2241
|
}) {
|
|
2253
|
-
this.decodeDracoFile(e, t, null, null,
|
|
2242
|
+
this.decodeDracoFile(e, t, null, null, z, n).catch(n);
|
|
2254
2243
|
}
|
|
2255
2244
|
//
|
|
2256
2245
|
decodeDracoFile(e, t, n, r, i = F, o = () => {
|
|
@@ -2286,26 +2275,26 @@ class un extends Wt {
|
|
|
2286
2275
|
}), c;
|
|
2287
2276
|
}
|
|
2288
2277
|
_createGeometry(e) {
|
|
2289
|
-
const t = new
|
|
2290
|
-
e.index && t.setIndex(new
|
|
2278
|
+
const t = new $t();
|
|
2279
|
+
e.index && t.setIndex(new me(e.index.array, 1));
|
|
2291
2280
|
for (let n = 0; n < e.attributes.length; n++) {
|
|
2292
2281
|
const { name: r, array: i, itemSize: o, stride: c, vertexColorSpace: a } = e.attributes[n];
|
|
2293
2282
|
let d;
|
|
2294
2283
|
if (o === c)
|
|
2295
|
-
d = new
|
|
2284
|
+
d = new me(i, o);
|
|
2296
2285
|
else {
|
|
2297
|
-
const u = new
|
|
2298
|
-
d = new
|
|
2286
|
+
const u = new Kt(i, c);
|
|
2287
|
+
d = new qt(u, o, 0);
|
|
2299
2288
|
}
|
|
2300
2289
|
r === "color" && (this._assignVertexColorSpace(d, a), d.normalized = !(i instanceof Float32Array)), t.setAttribute(r, d);
|
|
2301
2290
|
}
|
|
2302
2291
|
return t;
|
|
2303
2292
|
}
|
|
2304
2293
|
_assignVertexColorSpace(e, t) {
|
|
2305
|
-
if (t !==
|
|
2306
|
-
const n = new
|
|
2294
|
+
if (t !== z) return;
|
|
2295
|
+
const n = new $();
|
|
2307
2296
|
for (let r = 0, i = e.count; r < i; r++)
|
|
2308
|
-
n.fromBufferAttribute(e, r),
|
|
2297
|
+
n.fromBufferAttribute(e, r), qe.colorSpaceToWorking(n, z), e.setXYZ(r, n.r, n.g, n.b);
|
|
2309
2298
|
}
|
|
2310
2299
|
_loadLibrary(e, t) {
|
|
2311
2300
|
const n = new we(this.manager);
|
|
@@ -2322,7 +2311,7 @@ class un extends Wt {
|
|
|
2322
2311
|
return e ? t.push(this._loadLibrary("draco_decoder.js", "text")) : (t.push(this._loadLibrary("draco_wasm_wrapper.js", "text")), t.push(this._loadLibrary("draco_decoder.wasm", "arraybuffer"))), this.decoderPending = Promise.all(t).then((n) => {
|
|
2323
2312
|
const r = n[0];
|
|
2324
2313
|
e || (this.decoderConfig.wasmBinary = n[1]);
|
|
2325
|
-
const i =
|
|
2314
|
+
const i = ls.toString(), o = [
|
|
2326
2315
|
"/* draco decoder */",
|
|
2327
2316
|
r,
|
|
2328
2317
|
"",
|
|
@@ -2370,7 +2359,7 @@ class un extends Wt {
|
|
|
2370
2359
|
return this.workerPool.length = 0, this.workerSourceURL !== "" && URL.revokeObjectURL(this.workerSourceURL), this;
|
|
2371
2360
|
}
|
|
2372
2361
|
}
|
|
2373
|
-
function
|
|
2362
|
+
function ls() {
|
|
2374
2363
|
let s, e;
|
|
2375
2364
|
onmessage = function(o) {
|
|
2376
2365
|
const c = o.data;
|
|
@@ -2385,14 +2374,14 @@ function us() {
|
|
|
2385
2374
|
case "decode":
|
|
2386
2375
|
const a = c.buffer, d = c.taskConfig;
|
|
2387
2376
|
e.then((u) => {
|
|
2388
|
-
const l = u.draco,
|
|
2377
|
+
const l = u.draco, h = new l.Decoder();
|
|
2389
2378
|
try {
|
|
2390
|
-
const
|
|
2391
|
-
|
|
2392
|
-
} catch (
|
|
2393
|
-
console.error(
|
|
2379
|
+
const f = t(l, h, new Int8Array(a), d), w = f.attributes.map((E) => E.array.buffer);
|
|
2380
|
+
f.index && w.push(f.index.array.buffer), self.postMessage({ type: "decode", id: c.id, geometry: f }, w);
|
|
2381
|
+
} catch (f) {
|
|
2382
|
+
console.error(f), self.postMessage({ type: "error", id: c.id, error: f.message });
|
|
2394
2383
|
} finally {
|
|
2395
|
-
l.destroy(
|
|
2384
|
+
l.destroy(h);
|
|
2396
2385
|
}
|
|
2397
2386
|
});
|
|
2398
2387
|
break;
|
|
@@ -2400,39 +2389,39 @@ function us() {
|
|
|
2400
2389
|
};
|
|
2401
2390
|
function t(o, c, a, d) {
|
|
2402
2391
|
const u = d.attributeIDs, l = d.attributeTypes;
|
|
2403
|
-
let
|
|
2392
|
+
let h, f;
|
|
2404
2393
|
const w = c.GetEncodedGeometryType(a);
|
|
2405
2394
|
if (w === o.TRIANGULAR_MESH)
|
|
2406
|
-
|
|
2395
|
+
h = new o.Mesh(), f = c.DecodeArrayToMesh(a, a.byteLength, h);
|
|
2407
2396
|
else if (w === o.POINT_CLOUD)
|
|
2408
|
-
|
|
2397
|
+
h = new o.PointCloud(), f = c.DecodeArrayToPointCloud(a, a.byteLength, h);
|
|
2409
2398
|
else
|
|
2410
2399
|
throw new Error("THREE.DRACOLoader: Unexpected geometry type.");
|
|
2411
|
-
if (!
|
|
2412
|
-
throw new Error("THREE.DRACOLoader: Decoding failed: " +
|
|
2400
|
+
if (!f.ok() || h.ptr === 0)
|
|
2401
|
+
throw new Error("THREE.DRACOLoader: Decoding failed: " + f.error_msg());
|
|
2413
2402
|
const E = { index: null, attributes: [] };
|
|
2414
2403
|
for (const T in u) {
|
|
2415
2404
|
const p = self[l[T]];
|
|
2416
2405
|
let g, m;
|
|
2417
2406
|
if (d.useUniqueIDs)
|
|
2418
|
-
m = u[T], g = c.GetAttributeByUniqueId(
|
|
2407
|
+
m = u[T], g = c.GetAttributeByUniqueId(h, m);
|
|
2419
2408
|
else {
|
|
2420
|
-
if (m = c.GetAttributeId(
|
|
2421
|
-
g = c.GetAttribute(
|
|
2409
|
+
if (m = c.GetAttributeId(h, o[u[T]]), m === -1) continue;
|
|
2410
|
+
g = c.GetAttribute(h, m);
|
|
2422
2411
|
}
|
|
2423
|
-
const b = r(o, c,
|
|
2412
|
+
const b = r(o, c, h, T, p, g);
|
|
2424
2413
|
T === "color" && (b.vertexColorSpace = d.vertexColorSpace), E.attributes.push(b);
|
|
2425
2414
|
}
|
|
2426
|
-
return w === o.TRIANGULAR_MESH && (E.index = n(o, c,
|
|
2415
|
+
return w === o.TRIANGULAR_MESH && (E.index = n(o, c, h)), o.destroy(h), E;
|
|
2427
2416
|
}
|
|
2428
2417
|
function n(o, c, a) {
|
|
2429
|
-
const u = a.num_faces() * 3, l = u * 4,
|
|
2430
|
-
c.GetTrianglesUInt32Array(a, l,
|
|
2431
|
-
const
|
|
2432
|
-
return o._free(
|
|
2418
|
+
const u = a.num_faces() * 3, l = u * 4, h = o._malloc(l);
|
|
2419
|
+
c.GetTrianglesUInt32Array(a, l, h);
|
|
2420
|
+
const f = new Uint32Array(o.HEAPF32.buffer, h, u).slice();
|
|
2421
|
+
return o._free(h), { array: f, itemSize: 1 };
|
|
2433
2422
|
}
|
|
2434
2423
|
function r(o, c, a, d, u, l) {
|
|
2435
|
-
const
|
|
2424
|
+
const h = a.num_points(), f = l.num_components(), w = i(o, u), E = f * u.BYTES_PER_ELEMENT, T = Math.ceil(E / 4) * 4, p = T / u.BYTES_PER_ELEMENT, g = h * E, m = h * T, b = o._malloc(g);
|
|
2436
2425
|
c.GetAttributeDataArrayForAllPoints(a, l, w, g, b);
|
|
2437
2426
|
const _ = new u(o.HEAPF32.buffer, b, g / u.BYTES_PER_ELEMENT);
|
|
2438
2427
|
let y;
|
|
@@ -2441,16 +2430,16 @@ function us() {
|
|
|
2441
2430
|
else {
|
|
2442
2431
|
y = new u(m / u.BYTES_PER_ELEMENT);
|
|
2443
2432
|
let v = 0;
|
|
2444
|
-
for (let
|
|
2445
|
-
for (let
|
|
2446
|
-
y[v +
|
|
2433
|
+
for (let R = 0, C = _.length; R < C; R++) {
|
|
2434
|
+
for (let M = 0; M < f; M++)
|
|
2435
|
+
y[v + M] = _[R * f + M];
|
|
2447
2436
|
v += p;
|
|
2448
2437
|
}
|
|
2449
2438
|
}
|
|
2450
2439
|
return o._free(b), {
|
|
2451
2440
|
name: d,
|
|
2452
|
-
count:
|
|
2453
|
-
itemSize:
|
|
2441
|
+
count: h,
|
|
2442
|
+
itemSize: f,
|
|
2454
2443
|
array: y,
|
|
2455
2444
|
stride: p
|
|
2456
2445
|
};
|
|
@@ -2474,9 +2463,9 @@ function us() {
|
|
|
2474
2463
|
}
|
|
2475
2464
|
}
|
|
2476
2465
|
}
|
|
2477
|
-
function
|
|
2466
|
+
function ds(s) {
|
|
2478
2467
|
const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), n = s.clone();
|
|
2479
|
-
return
|
|
2468
|
+
return dn(s, n, function(r, i) {
|
|
2480
2469
|
e.set(i, r), t.set(r, i);
|
|
2481
2470
|
}), n.traverse(function(r) {
|
|
2482
2471
|
if (!r.isSkinnedMesh) return;
|
|
@@ -2486,12 +2475,12 @@ function ls(s) {
|
|
|
2486
2475
|
}), i.bind(i.skeleton, i.bindMatrix);
|
|
2487
2476
|
}), n;
|
|
2488
2477
|
}
|
|
2489
|
-
function
|
|
2478
|
+
function dn(s, e, t) {
|
|
2490
2479
|
t(s, e);
|
|
2491
2480
|
for (let n = 0; n < s.children.length; n++)
|
|
2492
|
-
|
|
2481
|
+
dn(s.children[n], e.children[n], t);
|
|
2493
2482
|
}
|
|
2494
|
-
class
|
|
2483
|
+
class hs extends zt {
|
|
2495
2484
|
/**
|
|
2496
2485
|
* Constructs a new glTF loader.
|
|
2497
2486
|
*
|
|
@@ -2499,41 +2488,41 @@ class ds extends Wt {
|
|
|
2499
2488
|
*/
|
|
2500
2489
|
constructor(e) {
|
|
2501
2490
|
super(e), this.dracoLoader = null, this.ktx2Loader = null, this.meshoptDecoder = null, this.pluginCallbacks = [], this.register(function(t) {
|
|
2502
|
-
return new gs(t);
|
|
2503
|
-
}), this.register(function(t) {
|
|
2504
2491
|
return new _s(t);
|
|
2492
|
+
}), this.register(function(t) {
|
|
2493
|
+
return new bs(t);
|
|
2505
2494
|
}), this.register(function(t) {
|
|
2506
2495
|
return new Ss(t);
|
|
2507
2496
|
}), this.register(function(t) {
|
|
2508
|
-
return new
|
|
2497
|
+
return new Ms(t);
|
|
2509
2498
|
}), this.register(function(t) {
|
|
2510
2499
|
return new ks(t);
|
|
2511
|
-
}), this.register(function(t) {
|
|
2512
|
-
return new ys(t);
|
|
2513
2500
|
}), this.register(function(t) {
|
|
2514
2501
|
return new Ts(t);
|
|
2515
2502
|
}), this.register(function(t) {
|
|
2516
2503
|
return new ws(t);
|
|
2517
2504
|
}), this.register(function(t) {
|
|
2518
2505
|
return new vs(t);
|
|
2519
|
-
}), this.register(function(t) {
|
|
2520
|
-
return new ms(t);
|
|
2521
2506
|
}), this.register(function(t) {
|
|
2522
2507
|
return new Es(t);
|
|
2523
2508
|
}), this.register(function(t) {
|
|
2524
|
-
return new
|
|
2509
|
+
return new gs(t);
|
|
2525
2510
|
}), this.register(function(t) {
|
|
2526
2511
|
return new Rs(t);
|
|
2512
|
+
}), this.register(function(t) {
|
|
2513
|
+
return new ys(t);
|
|
2514
|
+
}), this.register(function(t) {
|
|
2515
|
+
return new xs(t);
|
|
2527
2516
|
}), this.register(function(t) {
|
|
2528
2517
|
return new Cs(t);
|
|
2529
2518
|
}), this.register(function(t) {
|
|
2530
|
-
return new
|
|
2519
|
+
return new ps(t);
|
|
2531
2520
|
}), this.register(function(t) {
|
|
2532
|
-
return new
|
|
2521
|
+
return new Lt(t, x.EXT_MESHOPT_COMPRESSION);
|
|
2533
2522
|
}), this.register(function(t) {
|
|
2534
|
-
return new
|
|
2523
|
+
return new Lt(t, x.KHR_MESHOPT_COMPRESSION);
|
|
2535
2524
|
}), this.register(function(t) {
|
|
2536
|
-
return new
|
|
2525
|
+
return new Ls(t);
|
|
2537
2526
|
});
|
|
2538
2527
|
}
|
|
2539
2528
|
/**
|
|
@@ -2551,10 +2540,10 @@ class ds extends Wt {
|
|
|
2551
2540
|
if (this.resourcePath !== "")
|
|
2552
2541
|
o = this.resourcePath;
|
|
2553
2542
|
else if (this.path !== "") {
|
|
2554
|
-
const d =
|
|
2555
|
-
o =
|
|
2543
|
+
const d = ge.extractUrlBase(e);
|
|
2544
|
+
o = ge.resolveURL(d, this.path);
|
|
2556
2545
|
} else
|
|
2557
|
-
o =
|
|
2546
|
+
o = ge.extractUrlBase(e);
|
|
2558
2547
|
this.manager.itemStart(e);
|
|
2559
2548
|
const c = function(d) {
|
|
2560
2549
|
r ? r(d) : console.error(d), i.manager.itemError(e), i.manager.itemEnd(e);
|
|
@@ -2633,14 +2622,14 @@ class ds extends Wt {
|
|
|
2633
2622
|
if (typeof e == "string")
|
|
2634
2623
|
i = JSON.parse(e);
|
|
2635
2624
|
else if (e instanceof ArrayBuffer)
|
|
2636
|
-
if (a.decode(new Uint8Array(e, 0, 4)) ===
|
|
2625
|
+
if (a.decode(new Uint8Array(e, 0, 4)) === hn) {
|
|
2637
2626
|
try {
|
|
2638
|
-
o[
|
|
2627
|
+
o[x.KHR_BINARY_GLTF] = new As(e);
|
|
2639
2628
|
} catch (l) {
|
|
2640
2629
|
r && r(l);
|
|
2641
2630
|
return;
|
|
2642
2631
|
}
|
|
2643
|
-
i = JSON.parse(o[
|
|
2632
|
+
i = JSON.parse(o[x.KHR_BINARY_GLTF].content);
|
|
2644
2633
|
} else
|
|
2645
2634
|
i = JSON.parse(a.decode(e));
|
|
2646
2635
|
else
|
|
@@ -2649,7 +2638,7 @@ class ds extends Wt {
|
|
|
2649
2638
|
r && r(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));
|
|
2650
2639
|
return;
|
|
2651
2640
|
}
|
|
2652
|
-
const d = new
|
|
2641
|
+
const d = new zs(i, {
|
|
2653
2642
|
path: t || this.resourcePath || "",
|
|
2654
2643
|
crossOrigin: this.crossOrigin,
|
|
2655
2644
|
requestHeader: this.requestHeader,
|
|
@@ -2664,22 +2653,22 @@ class ds extends Wt {
|
|
|
2664
2653
|
}
|
|
2665
2654
|
if (i.extensionsUsed)
|
|
2666
2655
|
for (let u = 0; u < i.extensionsUsed.length; ++u) {
|
|
2667
|
-
const l = i.extensionsUsed[u],
|
|
2656
|
+
const l = i.extensionsUsed[u], h = i.extensionsRequired || [];
|
|
2668
2657
|
switch (l) {
|
|
2669
|
-
case
|
|
2670
|
-
o[l] = new
|
|
2671
|
-
break;
|
|
2672
|
-
case S.KHR_DRACO_MESH_COMPRESSION:
|
|
2673
|
-
o[l] = new Ls(i, this.dracoLoader);
|
|
2658
|
+
case x.KHR_MATERIALS_UNLIT:
|
|
2659
|
+
o[l] = new ms();
|
|
2674
2660
|
break;
|
|
2675
|
-
case
|
|
2676
|
-
o[l] = new Ps();
|
|
2661
|
+
case x.KHR_DRACO_MESH_COMPRESSION:
|
|
2662
|
+
o[l] = new Ps(i, this.dracoLoader);
|
|
2677
2663
|
break;
|
|
2678
|
-
case
|
|
2664
|
+
case x.KHR_TEXTURE_TRANSFORM:
|
|
2679
2665
|
o[l] = new Os();
|
|
2680
2666
|
break;
|
|
2667
|
+
case x.KHR_MESH_QUANTIZATION:
|
|
2668
|
+
o[l] = new Is();
|
|
2669
|
+
break;
|
|
2681
2670
|
default:
|
|
2682
|
-
|
|
2671
|
+
h.indexOf(l) >= 0 && c[l] === void 0 && console.warn('THREE.GLTFLoader: Unknown extension "' + l + '".');
|
|
2683
2672
|
}
|
|
2684
2673
|
}
|
|
2685
2674
|
d.setExtensions(o), d.setPlugins(c), d.parse(n, r);
|
|
@@ -2716,11 +2705,11 @@ function fs() {
|
|
|
2716
2705
|
}
|
|
2717
2706
|
};
|
|
2718
2707
|
}
|
|
2719
|
-
function
|
|
2708
|
+
function L(s, e, t) {
|
|
2720
2709
|
const n = s.json.materials[e];
|
|
2721
2710
|
return n.extensions && n.extensions[t] ? n.extensions[t] : null;
|
|
2722
2711
|
}
|
|
2723
|
-
const
|
|
2712
|
+
const x = {
|
|
2724
2713
|
KHR_BINARY_GLTF: "KHR_binary_glTF",
|
|
2725
2714
|
KHR_DRACO_MESH_COMPRESSION: "KHR_draco_mesh_compression",
|
|
2726
2715
|
KHR_LIGHTS_PUNCTUAL: "KHR_lights_punctual",
|
|
@@ -2745,9 +2734,9 @@ const S = {
|
|
|
2745
2734
|
KHR_MESHOPT_COMPRESSION: "KHR_meshopt_compression",
|
|
2746
2735
|
EXT_MESH_GPU_INSTANCING: "EXT_mesh_gpu_instancing"
|
|
2747
2736
|
};
|
|
2748
|
-
class
|
|
2737
|
+
class ps {
|
|
2749
2738
|
constructor(e) {
|
|
2750
|
-
this.parser = e, this.name =
|
|
2739
|
+
this.parser = e, this.name = x.KHR_LIGHTS_PUNCTUAL, this.cache = { refs: {}, uses: {} };
|
|
2751
2740
|
}
|
|
2752
2741
|
_markDefs() {
|
|
2753
2742
|
const e = this.parser, t = this.parser.json.nodes || [];
|
|
@@ -2762,7 +2751,7 @@ class hs {
|
|
|
2762
2751
|
if (r) return r;
|
|
2763
2752
|
const i = t.json, a = ((i.extensions && i.extensions[this.name] || {}).lights || [])[e];
|
|
2764
2753
|
let d;
|
|
2765
|
-
const u = new
|
|
2754
|
+
const u = new $(16777215);
|
|
2766
2755
|
a.color !== void 0 && u.setRGB(a.color[0], a.color[1], a.color[2], F);
|
|
2767
2756
|
const l = a.range !== void 0 ? a.range : 0;
|
|
2768
2757
|
switch (a.type) {
|
|
@@ -2770,7 +2759,7 @@ class hs {
|
|
|
2770
2759
|
d = new An(u), d.target.position.set(0, 0, -1), d.add(d.target);
|
|
2771
2760
|
break;
|
|
2772
2761
|
case "point":
|
|
2773
|
-
d = new
|
|
2762
|
+
d = new Ln(u), d.distance = l;
|
|
2774
2763
|
break;
|
|
2775
2764
|
case "spot":
|
|
2776
2765
|
d = new kn(u), d.distance = l, a.spot = a.spot || {}, a.spot.innerConeAngle = a.spot.innerConeAngle !== void 0 ? a.spot.innerConeAngle : 0, a.spot.outerConeAngle = a.spot.outerConeAngle !== void 0 ? a.spot.outerConeAngle : Math.PI / 4, d.angle = a.spot.outerConeAngle, d.penumbra = 1 - a.spot.innerConeAngle / a.spot.outerConeAngle, d.target.position.set(0, 0, -1), d.add(d.target);
|
|
@@ -2791,179 +2780,179 @@ class hs {
|
|
|
2791
2780
|
});
|
|
2792
2781
|
}
|
|
2793
2782
|
}
|
|
2794
|
-
class
|
|
2783
|
+
class ms {
|
|
2795
2784
|
constructor() {
|
|
2796
|
-
this.name =
|
|
2785
|
+
this.name = x.KHR_MATERIALS_UNLIT;
|
|
2797
2786
|
}
|
|
2798
2787
|
getMaterialType() {
|
|
2799
|
-
return
|
|
2788
|
+
return fe;
|
|
2800
2789
|
}
|
|
2801
2790
|
extendParams(e, t, n) {
|
|
2802
2791
|
const r = [];
|
|
2803
|
-
e.color = new
|
|
2792
|
+
e.color = new $(1, 1, 1), e.opacity = 1;
|
|
2804
2793
|
const i = t.pbrMetallicRoughness;
|
|
2805
2794
|
if (i) {
|
|
2806
2795
|
if (Array.isArray(i.baseColorFactor)) {
|
|
2807
2796
|
const o = i.baseColorFactor;
|
|
2808
2797
|
e.color.setRGB(o[0], o[1], o[2], F), e.opacity = o[3];
|
|
2809
2798
|
}
|
|
2810
|
-
i.baseColorTexture !== void 0 && r.push(n.assignTexture(e, "map", i.baseColorTexture,
|
|
2799
|
+
i.baseColorTexture !== void 0 && r.push(n.assignTexture(e, "map", i.baseColorTexture, z));
|
|
2811
2800
|
}
|
|
2812
2801
|
return Promise.all(r);
|
|
2813
2802
|
}
|
|
2814
2803
|
}
|
|
2815
|
-
class
|
|
2804
|
+
class gs {
|
|
2816
2805
|
constructor(e) {
|
|
2817
|
-
this.parser = e, this.name =
|
|
2806
|
+
this.parser = e, this.name = x.KHR_MATERIALS_EMISSIVE_STRENGTH;
|
|
2818
2807
|
}
|
|
2819
2808
|
extendMaterialParams(e, t) {
|
|
2820
|
-
const n =
|
|
2809
|
+
const n = L(this.parser, e, this.name);
|
|
2821
2810
|
return n === null || n.emissiveStrength !== void 0 && (t.emissiveIntensity = n.emissiveStrength), Promise.resolve();
|
|
2822
2811
|
}
|
|
2823
2812
|
}
|
|
2824
|
-
class
|
|
2813
|
+
class _s {
|
|
2825
2814
|
constructor(e) {
|
|
2826
|
-
this.parser = e, this.name =
|
|
2815
|
+
this.parser = e, this.name = x.KHR_MATERIALS_CLEARCOAT;
|
|
2827
2816
|
}
|
|
2828
2817
|
getMaterialType(e) {
|
|
2829
|
-
return
|
|
2818
|
+
return L(this.parser, e, this.name) !== null ? D : null;
|
|
2830
2819
|
}
|
|
2831
2820
|
extendMaterialParams(e, t) {
|
|
2832
|
-
const n =
|
|
2821
|
+
const n = L(this.parser, e, this.name);
|
|
2833
2822
|
if (n === null) return Promise.resolve();
|
|
2834
2823
|
const r = [];
|
|
2835
2824
|
if (n.clearcoatFactor !== void 0 && (t.clearcoat = n.clearcoatFactor), n.clearcoatTexture !== void 0 && r.push(this.parser.assignTexture(t, "clearcoatMap", n.clearcoatTexture)), n.clearcoatRoughnessFactor !== void 0 && (t.clearcoatRoughness = n.clearcoatRoughnessFactor), n.clearcoatRoughnessTexture !== void 0 && r.push(this.parser.assignTexture(t, "clearcoatRoughnessMap", n.clearcoatRoughnessTexture)), n.clearcoatNormalTexture !== void 0 && (r.push(this.parser.assignTexture(t, "clearcoatNormalMap", n.clearcoatNormalTexture)), n.clearcoatNormalTexture.scale !== void 0)) {
|
|
2836
2825
|
const i = n.clearcoatNormalTexture.scale;
|
|
2837
|
-
t.clearcoatNormalScale = new
|
|
2826
|
+
t.clearcoatNormalScale = new Vt(i, i);
|
|
2838
2827
|
}
|
|
2839
2828
|
return Promise.all(r);
|
|
2840
2829
|
}
|
|
2841
2830
|
}
|
|
2842
|
-
class
|
|
2831
|
+
class bs {
|
|
2843
2832
|
constructor(e) {
|
|
2844
|
-
this.parser = e, this.name =
|
|
2833
|
+
this.parser = e, this.name = x.KHR_MATERIALS_DISPERSION;
|
|
2845
2834
|
}
|
|
2846
2835
|
getMaterialType(e) {
|
|
2847
|
-
return
|
|
2836
|
+
return L(this.parser, e, this.name) !== null ? D : null;
|
|
2848
2837
|
}
|
|
2849
2838
|
extendMaterialParams(e, t) {
|
|
2850
|
-
const n =
|
|
2839
|
+
const n = L(this.parser, e, this.name);
|
|
2851
2840
|
return n === null || (t.dispersion = n.dispersion !== void 0 ? n.dispersion : 0), Promise.resolve();
|
|
2852
2841
|
}
|
|
2853
2842
|
}
|
|
2854
|
-
class
|
|
2843
|
+
class ys {
|
|
2855
2844
|
constructor(e) {
|
|
2856
|
-
this.parser = e, this.name =
|
|
2845
|
+
this.parser = e, this.name = x.KHR_MATERIALS_IRIDESCENCE;
|
|
2857
2846
|
}
|
|
2858
2847
|
getMaterialType(e) {
|
|
2859
|
-
return
|
|
2848
|
+
return L(this.parser, e, this.name) !== null ? D : null;
|
|
2860
2849
|
}
|
|
2861
2850
|
extendMaterialParams(e, t) {
|
|
2862
|
-
const n =
|
|
2851
|
+
const n = L(this.parser, e, this.name);
|
|
2863
2852
|
if (n === null) return Promise.resolve();
|
|
2864
2853
|
const r = [];
|
|
2865
2854
|
return n.iridescenceFactor !== void 0 && (t.iridescence = n.iridescenceFactor), n.iridescenceTexture !== void 0 && r.push(this.parser.assignTexture(t, "iridescenceMap", n.iridescenceTexture)), n.iridescenceIor !== void 0 && (t.iridescenceIOR = n.iridescenceIor), t.iridescenceThicknessRange === void 0 && (t.iridescenceThicknessRange = [100, 400]), n.iridescenceThicknessMinimum !== void 0 && (t.iridescenceThicknessRange[0] = n.iridescenceThicknessMinimum), n.iridescenceThicknessMaximum !== void 0 && (t.iridescenceThicknessRange[1] = n.iridescenceThicknessMaximum), n.iridescenceThicknessTexture !== void 0 && r.push(this.parser.assignTexture(t, "iridescenceThicknessMap", n.iridescenceThicknessTexture)), Promise.all(r);
|
|
2866
2855
|
}
|
|
2867
2856
|
}
|
|
2868
|
-
class
|
|
2857
|
+
class Ts {
|
|
2869
2858
|
constructor(e) {
|
|
2870
|
-
this.parser = e, this.name =
|
|
2859
|
+
this.parser = e, this.name = x.KHR_MATERIALS_SHEEN;
|
|
2871
2860
|
}
|
|
2872
2861
|
getMaterialType(e) {
|
|
2873
|
-
return
|
|
2862
|
+
return L(this.parser, e, this.name) !== null ? D : null;
|
|
2874
2863
|
}
|
|
2875
2864
|
extendMaterialParams(e, t) {
|
|
2876
|
-
const n =
|
|
2865
|
+
const n = L(this.parser, e, this.name);
|
|
2877
2866
|
if (n === null) return Promise.resolve();
|
|
2878
2867
|
const r = [];
|
|
2879
|
-
if (t.sheenColor = new
|
|
2868
|
+
if (t.sheenColor = new $(0, 0, 0), t.sheenRoughness = 0, t.sheen = 1, n.sheenColorFactor !== void 0) {
|
|
2880
2869
|
const i = n.sheenColorFactor;
|
|
2881
2870
|
t.sheenColor.setRGB(i[0], i[1], i[2], F);
|
|
2882
2871
|
}
|
|
2883
|
-
return n.sheenRoughnessFactor !== void 0 && (t.sheenRoughness = n.sheenRoughnessFactor), n.sheenColorTexture !== void 0 && r.push(this.parser.assignTexture(t, "sheenColorMap", n.sheenColorTexture,
|
|
2872
|
+
return n.sheenRoughnessFactor !== void 0 && (t.sheenRoughness = n.sheenRoughnessFactor), n.sheenColorTexture !== void 0 && r.push(this.parser.assignTexture(t, "sheenColorMap", n.sheenColorTexture, z)), n.sheenRoughnessTexture !== void 0 && r.push(this.parser.assignTexture(t, "sheenRoughnessMap", n.sheenRoughnessTexture)), Promise.all(r);
|
|
2884
2873
|
}
|
|
2885
2874
|
}
|
|
2886
|
-
class
|
|
2875
|
+
class ws {
|
|
2887
2876
|
constructor(e) {
|
|
2888
|
-
this.parser = e, this.name =
|
|
2877
|
+
this.parser = e, this.name = x.KHR_MATERIALS_TRANSMISSION;
|
|
2889
2878
|
}
|
|
2890
2879
|
getMaterialType(e) {
|
|
2891
|
-
return
|
|
2880
|
+
return L(this.parser, e, this.name) !== null ? D : null;
|
|
2892
2881
|
}
|
|
2893
2882
|
extendMaterialParams(e, t) {
|
|
2894
|
-
const n =
|
|
2883
|
+
const n = L(this.parser, e, this.name);
|
|
2895
2884
|
if (n === null) return Promise.resolve();
|
|
2896
2885
|
const r = [];
|
|
2897
2886
|
return n.transmissionFactor !== void 0 && (t.transmission = n.transmissionFactor), n.transmissionTexture !== void 0 && r.push(this.parser.assignTexture(t, "transmissionMap", n.transmissionTexture)), Promise.all(r);
|
|
2898
2887
|
}
|
|
2899
2888
|
}
|
|
2900
|
-
class
|
|
2889
|
+
class vs {
|
|
2901
2890
|
constructor(e) {
|
|
2902
|
-
this.parser = e, this.name =
|
|
2891
|
+
this.parser = e, this.name = x.KHR_MATERIALS_VOLUME;
|
|
2903
2892
|
}
|
|
2904
2893
|
getMaterialType(e) {
|
|
2905
|
-
return
|
|
2894
|
+
return L(this.parser, e, this.name) !== null ? D : null;
|
|
2906
2895
|
}
|
|
2907
2896
|
extendMaterialParams(e, t) {
|
|
2908
|
-
const n =
|
|
2897
|
+
const n = L(this.parser, e, this.name);
|
|
2909
2898
|
if (n === null) return Promise.resolve();
|
|
2910
2899
|
const r = [];
|
|
2911
2900
|
t.thickness = n.thicknessFactor !== void 0 ? n.thicknessFactor : 0, n.thicknessTexture !== void 0 && r.push(this.parser.assignTexture(t, "thicknessMap", n.thicknessTexture)), t.attenuationDistance = n.attenuationDistance || 1 / 0;
|
|
2912
2901
|
const i = n.attenuationColor || [1, 1, 1];
|
|
2913
|
-
return t.attenuationColor = new
|
|
2902
|
+
return t.attenuationColor = new $().setRGB(i[0], i[1], i[2], F), Promise.all(r);
|
|
2914
2903
|
}
|
|
2915
2904
|
}
|
|
2916
|
-
class
|
|
2905
|
+
class Es {
|
|
2917
2906
|
constructor(e) {
|
|
2918
|
-
this.parser = e, this.name =
|
|
2907
|
+
this.parser = e, this.name = x.KHR_MATERIALS_IOR;
|
|
2919
2908
|
}
|
|
2920
2909
|
getMaterialType(e) {
|
|
2921
|
-
return
|
|
2910
|
+
return L(this.parser, e, this.name) !== null ? D : null;
|
|
2922
2911
|
}
|
|
2923
2912
|
extendMaterialParams(e, t) {
|
|
2924
|
-
const n =
|
|
2913
|
+
const n = L(this.parser, e, this.name);
|
|
2925
2914
|
return n === null || (t.ior = n.ior !== void 0 ? n.ior : 1.5), Promise.resolve();
|
|
2926
2915
|
}
|
|
2927
2916
|
}
|
|
2928
|
-
class
|
|
2917
|
+
class Rs {
|
|
2929
2918
|
constructor(e) {
|
|
2930
|
-
this.parser = e, this.name =
|
|
2919
|
+
this.parser = e, this.name = x.KHR_MATERIALS_SPECULAR;
|
|
2931
2920
|
}
|
|
2932
2921
|
getMaterialType(e) {
|
|
2933
|
-
return
|
|
2922
|
+
return L(this.parser, e, this.name) !== null ? D : null;
|
|
2934
2923
|
}
|
|
2935
2924
|
extendMaterialParams(e, t) {
|
|
2936
|
-
const n =
|
|
2925
|
+
const n = L(this.parser, e, this.name);
|
|
2937
2926
|
if (n === null) return Promise.resolve();
|
|
2938
2927
|
const r = [];
|
|
2939
2928
|
t.specularIntensity = n.specularFactor !== void 0 ? n.specularFactor : 1, n.specularTexture !== void 0 && r.push(this.parser.assignTexture(t, "specularIntensityMap", n.specularTexture));
|
|
2940
2929
|
const i = n.specularColorFactor || [1, 1, 1];
|
|
2941
|
-
return t.specularColor = new
|
|
2930
|
+
return t.specularColor = new $().setRGB(i[0], i[1], i[2], F), n.specularColorTexture !== void 0 && r.push(this.parser.assignTexture(t, "specularColorMap", n.specularColorTexture, z)), Promise.all(r);
|
|
2942
2931
|
}
|
|
2943
2932
|
}
|
|
2944
2933
|
class Cs {
|
|
2945
2934
|
constructor(e) {
|
|
2946
|
-
this.parser = e, this.name =
|
|
2935
|
+
this.parser = e, this.name = x.EXT_MATERIALS_BUMP;
|
|
2947
2936
|
}
|
|
2948
2937
|
getMaterialType(e) {
|
|
2949
|
-
return
|
|
2938
|
+
return L(this.parser, e, this.name) !== null ? D : null;
|
|
2950
2939
|
}
|
|
2951
2940
|
extendMaterialParams(e, t) {
|
|
2952
|
-
const n =
|
|
2941
|
+
const n = L(this.parser, e, this.name);
|
|
2953
2942
|
if (n === null) return Promise.resolve();
|
|
2954
2943
|
const r = [];
|
|
2955
2944
|
return t.bumpScale = n.bumpFactor !== void 0 ? n.bumpFactor : 1, n.bumpTexture !== void 0 && r.push(this.parser.assignTexture(t, "bumpMap", n.bumpTexture)), Promise.all(r);
|
|
2956
2945
|
}
|
|
2957
2946
|
}
|
|
2958
|
-
class
|
|
2947
|
+
class xs {
|
|
2959
2948
|
constructor(e) {
|
|
2960
|
-
this.parser = e, this.name =
|
|
2949
|
+
this.parser = e, this.name = x.KHR_MATERIALS_ANISOTROPY;
|
|
2961
2950
|
}
|
|
2962
2951
|
getMaterialType(e) {
|
|
2963
|
-
return
|
|
2952
|
+
return L(this.parser, e, this.name) !== null ? D : null;
|
|
2964
2953
|
}
|
|
2965
2954
|
extendMaterialParams(e, t) {
|
|
2966
|
-
const n =
|
|
2955
|
+
const n = L(this.parser, e, this.name);
|
|
2967
2956
|
if (n === null) return Promise.resolve();
|
|
2968
2957
|
const r = [];
|
|
2969
2958
|
return n.anisotropyStrength !== void 0 && (t.anisotropy = n.anisotropyStrength), n.anisotropyRotation !== void 0 && (t.anisotropyRotation = n.anisotropyRotation), n.anisotropyTexture !== void 0 && r.push(this.parser.assignTexture(t, "anisotropyMap", n.anisotropyTexture)), Promise.all(r);
|
|
@@ -2971,7 +2960,7 @@ class Rs {
|
|
|
2971
2960
|
}
|
|
2972
2961
|
class Ss {
|
|
2973
2962
|
constructor(e) {
|
|
2974
|
-
this.parser = e, this.name =
|
|
2963
|
+
this.parser = e, this.name = x.KHR_TEXTURE_BASISU;
|
|
2975
2964
|
}
|
|
2976
2965
|
loadTexture(e) {
|
|
2977
2966
|
const t = this.parser, n = t.json, r = n.textures[e];
|
|
@@ -2986,9 +2975,9 @@ class Ss {
|
|
|
2986
2975
|
return t.loadTextureImage(e, i.source, o);
|
|
2987
2976
|
}
|
|
2988
2977
|
}
|
|
2989
|
-
class
|
|
2978
|
+
class Ms {
|
|
2990
2979
|
constructor(e) {
|
|
2991
|
-
this.parser = e, this.name =
|
|
2980
|
+
this.parser = e, this.name = x.EXT_TEXTURE_WEBP;
|
|
2992
2981
|
}
|
|
2993
2982
|
loadTexture(e) {
|
|
2994
2983
|
const t = this.name, n = this.parser, r = n.json, i = r.textures[e];
|
|
@@ -3005,7 +2994,7 @@ class xs {
|
|
|
3005
2994
|
}
|
|
3006
2995
|
class ks {
|
|
3007
2996
|
constructor(e) {
|
|
3008
|
-
this.parser = e, this.name =
|
|
2997
|
+
this.parser = e, this.name = x.EXT_TEXTURE_AVIF;
|
|
3009
2998
|
}
|
|
3010
2999
|
loadTexture(e) {
|
|
3011
3000
|
const t = this.name, n = this.parser, r = n.json, i = r.textures[e];
|
|
@@ -3020,7 +3009,7 @@ class ks {
|
|
|
3020
3009
|
return n.loadTextureImage(e, o.source, a);
|
|
3021
3010
|
}
|
|
3022
3011
|
}
|
|
3023
|
-
class
|
|
3012
|
+
class Lt {
|
|
3024
3013
|
constructor(e, t) {
|
|
3025
3014
|
this.name = t, this.parser = e;
|
|
3026
3015
|
}
|
|
@@ -3034,21 +3023,21 @@ class At {
|
|
|
3034
3023
|
return null;
|
|
3035
3024
|
}
|
|
3036
3025
|
return i.then(function(c) {
|
|
3037
|
-
const a = r.byteOffset || 0, d = r.byteLength || 0, u = r.count, l = r.byteStride,
|
|
3038
|
-
return o.decodeGltfBufferAsync ? o.decodeGltfBufferAsync(u, l,
|
|
3039
|
-
return
|
|
3026
|
+
const a = r.byteOffset || 0, d = r.byteLength || 0, u = r.count, l = r.byteStride, h = new Uint8Array(c, a, d);
|
|
3027
|
+
return o.decodeGltfBufferAsync ? o.decodeGltfBufferAsync(u, l, h, r.mode, r.filter).then(function(f) {
|
|
3028
|
+
return f.buffer;
|
|
3040
3029
|
}) : o.ready.then(function() {
|
|
3041
|
-
const
|
|
3042
|
-
return o.decodeGltfBuffer(new Uint8Array(
|
|
3030
|
+
const f = new ArrayBuffer(u * l);
|
|
3031
|
+
return o.decodeGltfBuffer(new Uint8Array(f), u, l, h, r.mode, r.filter), f;
|
|
3043
3032
|
});
|
|
3044
3033
|
});
|
|
3045
3034
|
} else
|
|
3046
3035
|
return null;
|
|
3047
3036
|
}
|
|
3048
3037
|
}
|
|
3049
|
-
class
|
|
3038
|
+
class Ls {
|
|
3050
3039
|
constructor(e) {
|
|
3051
|
-
this.name =
|
|
3040
|
+
this.name = x.EXT_MESH_GPU_INSTANCING, this.parser = e;
|
|
3052
3041
|
}
|
|
3053
3042
|
createNodeMesh(e) {
|
|
3054
3043
|
const t = this.parser.json, n = t.nodes[e];
|
|
@@ -3062,46 +3051,46 @@ class Ms {
|
|
|
3062
3051
|
for (const d in o)
|
|
3063
3052
|
c.push(this.parser.getDependency("accessor", o[d]).then((u) => (a[d] = u, a[d])));
|
|
3064
3053
|
return c.length < 1 ? null : (c.push(this.parser.createNodeMesh(e)), Promise.all(c).then((d) => {
|
|
3065
|
-
const u = d.pop(), l = u.isGroup ? u.children : [u],
|
|
3054
|
+
const u = d.pop(), l = u.isGroup ? u.children : [u], h = d[0].count, f = [];
|
|
3066
3055
|
for (const w of l) {
|
|
3067
|
-
const E = new ve(), T = new
|
|
3068
|
-
for (let b = 0; b <
|
|
3056
|
+
const E = new ve(), T = new Z(), p = new Xt(), g = new Z(1, 1, 1), m = new Pn(w.geometry, w.material, h);
|
|
3057
|
+
for (let b = 0; b < h; b++)
|
|
3069
3058
|
a.TRANSLATION && T.fromBufferAttribute(a.TRANSLATION, b), a.ROTATION && p.fromBufferAttribute(a.ROTATION, b), a.SCALE && g.fromBufferAttribute(a.SCALE, b), m.setMatrixAt(b, E.compose(T, p, g));
|
|
3070
3059
|
for (const b in a)
|
|
3071
3060
|
if (b === "_COLOR_0") {
|
|
3072
3061
|
const _ = a[b];
|
|
3073
|
-
m.instanceColor = new
|
|
3062
|
+
m.instanceColor = new On(_.array, _.itemSize, _.normalized);
|
|
3074
3063
|
} else b !== "TRANSLATION" && b !== "ROTATION" && b !== "SCALE" && w.geometry.setAttribute(b, a[b]);
|
|
3075
|
-
|
|
3064
|
+
Qt.prototype.copy.call(m, w), this.parser.assignFinalMaterial(m), f.push(m);
|
|
3076
3065
|
}
|
|
3077
|
-
return u.isGroup ? (u.clear(), u.add(...
|
|
3066
|
+
return u.isGroup ? (u.clear(), u.add(...f), u) : f[0];
|
|
3078
3067
|
}));
|
|
3079
3068
|
}
|
|
3080
3069
|
}
|
|
3081
|
-
const
|
|
3070
|
+
const hn = "glTF", he = 12, At = { JSON: 1313821514, BIN: 5130562 };
|
|
3082
3071
|
class As {
|
|
3083
3072
|
constructor(e) {
|
|
3084
|
-
this.name =
|
|
3085
|
-
const t = new DataView(e, 0,
|
|
3073
|
+
this.name = x.KHR_BINARY_GLTF, this.content = null, this.body = null;
|
|
3074
|
+
const t = new DataView(e, 0, he), n = new TextDecoder();
|
|
3086
3075
|
if (this.header = {
|
|
3087
3076
|
magic: n.decode(new Uint8Array(e.slice(0, 4))),
|
|
3088
3077
|
version: t.getUint32(4, !0),
|
|
3089
3078
|
length: t.getUint32(8, !0)
|
|
3090
|
-
}, this.header.magic !==
|
|
3079
|
+
}, this.header.magic !== hn)
|
|
3091
3080
|
throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");
|
|
3092
3081
|
if (this.header.version < 2)
|
|
3093
3082
|
throw new Error("THREE.GLTFLoader: Legacy binary file detected.");
|
|
3094
|
-
const r = this.header.length -
|
|
3083
|
+
const r = this.header.length - he, i = new DataView(e, he);
|
|
3095
3084
|
let o = 0;
|
|
3096
3085
|
for (; o < r; ) {
|
|
3097
3086
|
const c = i.getUint32(o, !0);
|
|
3098
3087
|
o += 4;
|
|
3099
3088
|
const a = i.getUint32(o, !0);
|
|
3100
|
-
if (o += 4, a ===
|
|
3101
|
-
const d = new Uint8Array(e,
|
|
3089
|
+
if (o += 4, a === At.JSON) {
|
|
3090
|
+
const d = new Uint8Array(e, he + o, c);
|
|
3102
3091
|
this.content = n.decode(d);
|
|
3103
|
-
} else if (a ===
|
|
3104
|
-
const d =
|
|
3092
|
+
} else if (a === At.BIN) {
|
|
3093
|
+
const d = he + o;
|
|
3105
3094
|
this.body = e.slice(d, d + c);
|
|
3106
3095
|
}
|
|
3107
3096
|
o += c;
|
|
@@ -3110,52 +3099,52 @@ class As {
|
|
|
3110
3099
|
throw new Error("THREE.GLTFLoader: JSON content not found.");
|
|
3111
3100
|
}
|
|
3112
3101
|
}
|
|
3113
|
-
class
|
|
3102
|
+
class Ps {
|
|
3114
3103
|
constructor(e, t) {
|
|
3115
3104
|
if (!t)
|
|
3116
3105
|
throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");
|
|
3117
|
-
this.name =
|
|
3106
|
+
this.name = x.KHR_DRACO_MESH_COMPRESSION, this.json = e, this.dracoLoader = t, this.dracoLoader.preload();
|
|
3118
3107
|
}
|
|
3119
3108
|
decodePrimitive(e, t) {
|
|
3120
3109
|
const n = this.json, r = this.dracoLoader, i = e.extensions[this.name].bufferView, o = e.extensions[this.name].attributes, c = {}, a = {}, d = {};
|
|
3121
3110
|
for (const u in o) {
|
|
3122
|
-
const l =
|
|
3111
|
+
const l = Ze[u] || u.toLowerCase();
|
|
3123
3112
|
c[l] = o[u];
|
|
3124
3113
|
}
|
|
3125
3114
|
for (const u in e.attributes) {
|
|
3126
|
-
const l =
|
|
3115
|
+
const l = Ze[u] || u.toLowerCase();
|
|
3127
3116
|
if (o[u] !== void 0) {
|
|
3128
|
-
const
|
|
3129
|
-
d[l] =
|
|
3117
|
+
const h = n.accessors[e.attributes[u]], f = re[h.componentType];
|
|
3118
|
+
d[l] = f.name, a[l] = h.normalized === !0;
|
|
3130
3119
|
}
|
|
3131
3120
|
}
|
|
3132
3121
|
return t.getDependency("bufferView", i).then(function(u) {
|
|
3133
|
-
return new Promise(function(l,
|
|
3134
|
-
r.decodeDracoFile(u, function(
|
|
3135
|
-
for (const w in
|
|
3136
|
-
const E =
|
|
3122
|
+
return new Promise(function(l, h) {
|
|
3123
|
+
r.decodeDracoFile(u, function(f) {
|
|
3124
|
+
for (const w in f.attributes) {
|
|
3125
|
+
const E = f.attributes[w], T = a[w];
|
|
3137
3126
|
T !== void 0 && (E.normalized = T);
|
|
3138
3127
|
}
|
|
3139
|
-
l(
|
|
3140
|
-
}, c, d, F,
|
|
3128
|
+
l(f);
|
|
3129
|
+
}, c, d, F, h);
|
|
3141
3130
|
});
|
|
3142
3131
|
});
|
|
3143
3132
|
}
|
|
3144
3133
|
}
|
|
3145
|
-
class
|
|
3134
|
+
class Os {
|
|
3146
3135
|
constructor() {
|
|
3147
|
-
this.name =
|
|
3136
|
+
this.name = x.KHR_TEXTURE_TRANSFORM;
|
|
3148
3137
|
}
|
|
3149
3138
|
extendTexture(e, t) {
|
|
3150
3139
|
return (t.texCoord === void 0 || t.texCoord === e.channel) && t.offset === void 0 && t.rotation === void 0 && t.scale === void 0 || (e = e.clone(), t.texCoord !== void 0 && (e.channel = t.texCoord), t.offset !== void 0 && e.offset.fromArray(t.offset), t.rotation !== void 0 && (e.rotation = t.rotation), t.scale !== void 0 && e.repeat.fromArray(t.scale), e.needsUpdate = !0), e;
|
|
3151
3140
|
}
|
|
3152
3141
|
}
|
|
3153
|
-
class
|
|
3142
|
+
class Is {
|
|
3154
3143
|
constructor() {
|
|
3155
|
-
this.name =
|
|
3144
|
+
this.name = x.KHR_MESH_QUANTIZATION;
|
|
3156
3145
|
}
|
|
3157
3146
|
}
|
|
3158
|
-
class fn extends
|
|
3147
|
+
class fn extends or {
|
|
3159
3148
|
constructor(e, t, n, r) {
|
|
3160
3149
|
super(e, t, n, r);
|
|
3161
3150
|
}
|
|
@@ -3166,19 +3155,19 @@ class fn extends ir {
|
|
|
3166
3155
|
return t;
|
|
3167
3156
|
}
|
|
3168
3157
|
interpolate_(e, t, n, r) {
|
|
3169
|
-
const i = this.resultBuffer, o = this.sampleValues, c = this.valueSize, a = c * 2, d = c * 3, u = r - t, l = (n - t) / u,
|
|
3158
|
+
const i = this.resultBuffer, o = this.sampleValues, c = this.valueSize, a = c * 2, d = c * 3, u = r - t, l = (n - t) / u, h = l * l, f = h * l, w = e * d, E = w - d, T = -2 * f + 3 * h, p = f - h, g = 1 - T, m = p - h + l;
|
|
3170
3159
|
for (let b = 0; b !== c; b++) {
|
|
3171
|
-
const _ = o[E + b + c], y = o[E + b + a] * u, v = o[w + b + c],
|
|
3172
|
-
i[b] = g * _ + m * y + T * v + p *
|
|
3160
|
+
const _ = o[E + b + c], y = o[E + b + a] * u, v = o[w + b + c], R = o[w + b] * u;
|
|
3161
|
+
i[b] = g * _ + m * y + T * v + p * R;
|
|
3173
3162
|
}
|
|
3174
3163
|
return i;
|
|
3175
3164
|
}
|
|
3176
3165
|
}
|
|
3177
|
-
const
|
|
3178
|
-
class
|
|
3166
|
+
const Ns = new Xt();
|
|
3167
|
+
class Fs extends fn {
|
|
3179
3168
|
interpolate_(e, t, n, r) {
|
|
3180
3169
|
const i = super.interpolate_(e, t, n, r);
|
|
3181
|
-
return
|
|
3170
|
+
return Ns.fromArray(i).normalize().toArray(i), i;
|
|
3182
3171
|
}
|
|
3183
3172
|
}
|
|
3184
3173
|
const P = {
|
|
@@ -3201,7 +3190,7 @@ const P = {
|
|
|
3201
3190
|
TRIANGLE_FAN: 6,
|
|
3202
3191
|
UNSIGNED_BYTE: 5121,
|
|
3203
3192
|
UNSIGNED_SHORT: 5123
|
|
3204
|
-
},
|
|
3193
|
+
}, re = {
|
|
3205
3194
|
5120: Int8Array,
|
|
3206
3195
|
5121: Uint8Array,
|
|
3207
3196
|
5122: Int16Array,
|
|
@@ -3209,17 +3198,17 @@ const P = {
|
|
|
3209
3198
|
5125: Uint32Array,
|
|
3210
3199
|
5126: Float32Array
|
|
3211
3200
|
}, Pt = {
|
|
3212
|
-
9728:
|
|
3213
|
-
9729:
|
|
3214
|
-
9984:
|
|
3215
|
-
9985:
|
|
3216
|
-
9986:
|
|
3217
|
-
9987:
|
|
3201
|
+
9728: Zt,
|
|
3202
|
+
9729: Ve,
|
|
3203
|
+
9984: Yn,
|
|
3204
|
+
9985: Jn,
|
|
3205
|
+
9986: Zn,
|
|
3206
|
+
9987: Jt
|
|
3218
3207
|
}, Ot = {
|
|
3219
|
-
33071:
|
|
3220
|
-
33648:
|
|
3221
|
-
10497:
|
|
3222
|
-
},
|
|
3208
|
+
33071: er,
|
|
3209
|
+
33648: tr,
|
|
3210
|
+
10497: Xe
|
|
3211
|
+
}, We = {
|
|
3223
3212
|
SCALAR: 1,
|
|
3224
3213
|
VEC2: 2,
|
|
3225
3214
|
VEC3: 3,
|
|
@@ -3227,7 +3216,7 @@ const P = {
|
|
|
3227
3216
|
MAT2: 4,
|
|
3228
3217
|
MAT3: 9,
|
|
3229
3218
|
MAT4: 16
|
|
3230
|
-
},
|
|
3219
|
+
}, Ze = {
|
|
3231
3220
|
POSITION: "position",
|
|
3232
3221
|
NORMAL: "normal",
|
|
3233
3222
|
TANGENT: "tangent",
|
|
@@ -3243,29 +3232,29 @@ const P = {
|
|
|
3243
3232
|
translation: "position",
|
|
3244
3233
|
rotation: "quaternion",
|
|
3245
3234
|
weights: "morphTargetInfluences"
|
|
3246
|
-
},
|
|
3235
|
+
}, Ds = {
|
|
3247
3236
|
CUBICSPLINE: void 0,
|
|
3248
3237
|
// We use a custom interpolant (GLTFCubicSplineInterpolation) for CUBICSPLINE tracks. Each
|
|
3249
3238
|
// keyframe track will be initialized with a default interpolation type, then modified.
|
|
3250
|
-
LINEAR:
|
|
3251
|
-
STEP:
|
|
3252
|
-
},
|
|
3239
|
+
LINEAR: tn,
|
|
3240
|
+
STEP: nr
|
|
3241
|
+
}, Ge = {
|
|
3253
3242
|
OPAQUE: "OPAQUE",
|
|
3254
3243
|
MASK: "MASK",
|
|
3255
3244
|
BLEND: "BLEND"
|
|
3256
3245
|
};
|
|
3257
|
-
function
|
|
3258
|
-
return s.DefaultMaterial === void 0 && (s.DefaultMaterial = new
|
|
3246
|
+
function Hs(s) {
|
|
3247
|
+
return s.DefaultMaterial === void 0 && (s.DefaultMaterial = new en({
|
|
3259
3248
|
color: 16777215,
|
|
3260
3249
|
emissive: 0,
|
|
3261
3250
|
metalness: 1,
|
|
3262
3251
|
roughness: 1,
|
|
3263
3252
|
transparent: !1,
|
|
3264
3253
|
depthTest: !0,
|
|
3265
|
-
side:
|
|
3254
|
+
side: rr
|
|
3266
3255
|
})), s.DefaultMaterial;
|
|
3267
3256
|
}
|
|
3268
|
-
function
|
|
3257
|
+
function J(s, e, t) {
|
|
3269
3258
|
for (const n in t.extensions)
|
|
3270
3259
|
s[n] === void 0 && (e.userData.gltfExtensions = e.userData.gltfExtensions || {}, e.userData.gltfExtensions[n] = t.extensions[n]);
|
|
3271
3260
|
}
|
|
@@ -3283,16 +3272,16 @@ function js(s, e, t) {
|
|
|
3283
3272
|
for (let d = 0, u = e.length; d < u; d++) {
|
|
3284
3273
|
const l = e[d];
|
|
3285
3274
|
if (n) {
|
|
3286
|
-
const
|
|
3287
|
-
o.push(
|
|
3275
|
+
const h = l.POSITION !== void 0 ? t.getDependency("accessor", l.POSITION) : s.attributes.position;
|
|
3276
|
+
o.push(h);
|
|
3288
3277
|
}
|
|
3289
3278
|
if (r) {
|
|
3290
|
-
const
|
|
3291
|
-
c.push(
|
|
3279
|
+
const h = l.NORMAL !== void 0 ? t.getDependency("accessor", l.NORMAL) : s.attributes.normal;
|
|
3280
|
+
c.push(h);
|
|
3292
3281
|
}
|
|
3293
3282
|
if (i) {
|
|
3294
|
-
const
|
|
3295
|
-
a.push(
|
|
3283
|
+
const h = l.COLOR_0 !== void 0 ? t.getDependency("accessor", l.COLOR_0) : s.attributes.color;
|
|
3284
|
+
a.push(h);
|
|
3296
3285
|
}
|
|
3297
3286
|
}
|
|
3298
3287
|
return Promise.all([
|
|
@@ -3300,11 +3289,11 @@ function js(s, e, t) {
|
|
|
3300
3289
|
Promise.all(c),
|
|
3301
3290
|
Promise.all(a)
|
|
3302
3291
|
]).then(function(d) {
|
|
3303
|
-
const u = d[0], l = d[1],
|
|
3304
|
-
return n && (s.morphAttributes.position = u), r && (s.morphAttributes.normal = l), i && (s.morphAttributes.color =
|
|
3292
|
+
const u = d[0], l = d[1], h = d[2];
|
|
3293
|
+
return n && (s.morphAttributes.position = u), r && (s.morphAttributes.normal = l), i && (s.morphAttributes.color = h), s.morphTargetsRelative = !0, s;
|
|
3305
3294
|
});
|
|
3306
3295
|
}
|
|
3307
|
-
function
|
|
3296
|
+
function Us(s, e) {
|
|
3308
3297
|
if (s.updateMorphTargets(), e.weights !== void 0)
|
|
3309
3298
|
for (let t = 0, n = e.weights.length; t < n; t++)
|
|
3310
3299
|
s.morphTargetInfluences[t] = e.weights[t];
|
|
@@ -3318,9 +3307,9 @@ function Hs(s, e) {
|
|
|
3318
3307
|
console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.");
|
|
3319
3308
|
}
|
|
3320
3309
|
}
|
|
3321
|
-
function
|
|
3310
|
+
function Bs(s) {
|
|
3322
3311
|
let e;
|
|
3323
|
-
const t = s.extensions && s.extensions[
|
|
3312
|
+
const t = s.extensions && s.extensions[x.KHR_DRACO_MESH_COMPRESSION];
|
|
3324
3313
|
if (t ? e = "draco:" + t.bufferView + ":" + t.indices + ":" + ze(t.attributes) : e = s.indices + ":" + ze(s.attributes) + ":" + s.mode, s.targets !== void 0)
|
|
3325
3314
|
for (let n = 0, r = s.targets.length; n < r; n++)
|
|
3326
3315
|
e += ":" + ze(s.targets[n]);
|
|
@@ -3333,7 +3322,7 @@ function ze(s) {
|
|
|
3333
3322
|
e += t[n] + ":" + s[t[n]] + ";";
|
|
3334
3323
|
return e;
|
|
3335
3324
|
}
|
|
3336
|
-
function
|
|
3325
|
+
function et(s) {
|
|
3337
3326
|
switch (s) {
|
|
3338
3327
|
case Int8Array:
|
|
3339
3328
|
return 1 / 127;
|
|
@@ -3347,11 +3336,11 @@ function tt(s) {
|
|
|
3347
3336
|
throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.");
|
|
3348
3337
|
}
|
|
3349
3338
|
}
|
|
3350
|
-
function
|
|
3339
|
+
function Ws(s) {
|
|
3351
3340
|
return s.search(/\.jpe?g($|\?)/i) > 0 || s.search(/^data\:image\/jpeg/) === 0 ? "image/jpeg" : s.search(/\.webp($|\?)/i) > 0 || s.search(/^data\:image\/webp/) === 0 ? "image/webp" : s.search(/\.ktx2($|\?)/i) > 0 || s.search(/^data\:image\/ktx2/) === 0 ? "image/ktx2" : "image/png";
|
|
3352
3341
|
}
|
|
3353
3342
|
const Gs = new ve();
|
|
3354
|
-
class
|
|
3343
|
+
class zs {
|
|
3355
3344
|
constructor(e = {}, t = {}) {
|
|
3356
3345
|
this.json = e, this.extensions = {}, this.plugins = {}, this.options = t, this.cache = new fs(), this.associations = /* @__PURE__ */ new Map(), this.primitiveCache = {}, this.nodeCache = {}, this.meshCache = { refs: {}, uses: {} }, this.cameraCache = { refs: {}, uses: {} }, this.lightCache = { refs: {}, uses: {} }, this.sourceCache = {}, this.textureCache = {}, this.nodeNamesUsed = {};
|
|
3357
3346
|
let n = !1, r = -1, i = !1, o = -1;
|
|
@@ -3361,7 +3350,7 @@ class Ws {
|
|
|
3361
3350
|
const a = c.match(/Version\/(\d+)/);
|
|
3362
3351
|
r = n && a ? parseInt(a[1], 10) : -1, i = c.indexOf("Firefox") > -1, o = i ? c.match(/Firefox\/([0-9]+)\./)[1] : -1;
|
|
3363
3352
|
}
|
|
3364
|
-
typeof createImageBitmap > "u" || n && r < 17 || i && o < 98 ? this.textureLoader = new
|
|
3353
|
+
typeof createImageBitmap > "u" || n && r < 17 || i && o < 98 ? this.textureLoader = new In(this.options.manager) : this.textureLoader = new Yt(this.options.manager), this.textureLoader.setCrossOrigin(this.options.crossOrigin), this.textureLoader.setRequestHeader(this.options.requestHeader), this.fileLoader = new we(this.options.manager), this.fileLoader.setResponseType("arraybuffer"), this.options.crossOrigin === "use-credentials" && this.fileLoader.setWithCredentials(!0);
|
|
3365
3354
|
}
|
|
3366
3355
|
setExtensions(e) {
|
|
3367
3356
|
this.extensions = e;
|
|
@@ -3391,7 +3380,7 @@ class Ws {
|
|
|
3391
3380
|
parser: n,
|
|
3392
3381
|
userData: {}
|
|
3393
3382
|
};
|
|
3394
|
-
return
|
|
3383
|
+
return J(i, c, r), N(c, r), Promise.all(n._invokeAll(function(a) {
|
|
3395
3384
|
return a.afterRoot && a.afterRoot(c);
|
|
3396
3385
|
})).then(function() {
|
|
3397
3386
|
for (const a of c.scenes)
|
|
@@ -3569,10 +3558,10 @@ class Ws {
|
|
|
3569
3558
|
if (t.type && t.type !== "arraybuffer")
|
|
3570
3559
|
throw new Error("THREE.GLTFLoader: " + t.type + " buffer type is not supported.");
|
|
3571
3560
|
if (t.uri === void 0 && e === 0)
|
|
3572
|
-
return Promise.resolve(this.extensions[
|
|
3561
|
+
return Promise.resolve(this.extensions[x.KHR_BINARY_GLTF].body);
|
|
3573
3562
|
const r = this.options;
|
|
3574
3563
|
return new Promise(function(i, o) {
|
|
3575
|
-
n.load(
|
|
3564
|
+
n.load(ge.resolveURL(t.uri, r.path), i, void 0, function() {
|
|
3576
3565
|
o(new Error('THREE.GLTFLoader: Failed to load buffer "' + t.uri + '".'));
|
|
3577
3566
|
});
|
|
3578
3567
|
});
|
|
@@ -3601,25 +3590,25 @@ class Ws {
|
|
|
3601
3590
|
loadAccessor(e) {
|
|
3602
3591
|
const t = this, n = this.json, r = this.json.accessors[e];
|
|
3603
3592
|
if (r.bufferView === void 0 && r.sparse === void 0) {
|
|
3604
|
-
const o =
|
|
3605
|
-
return Promise.resolve(new
|
|
3593
|
+
const o = We[r.type], c = re[r.componentType], a = r.normalized === !0, d = new c(r.count * o);
|
|
3594
|
+
return Promise.resolve(new me(d, o, a));
|
|
3606
3595
|
}
|
|
3607
3596
|
const i = [];
|
|
3608
3597
|
return r.bufferView !== void 0 ? i.push(this.getDependency("bufferView", r.bufferView)) : i.push(null), r.sparse !== void 0 && (i.push(this.getDependency("bufferView", r.sparse.indices.bufferView)), i.push(this.getDependency("bufferView", r.sparse.values.bufferView))), Promise.all(i).then(function(o) {
|
|
3609
|
-
const c = o[0], a =
|
|
3598
|
+
const c = o[0], a = We[r.type], d = re[r.componentType], u = d.BYTES_PER_ELEMENT, l = u * a, h = r.byteOffset || 0, f = r.bufferView !== void 0 ? n.bufferViews[r.bufferView].byteStride : void 0, w = r.normalized === !0;
|
|
3610
3599
|
let E, T;
|
|
3611
|
-
if (
|
|
3612
|
-
const p = Math.floor(
|
|
3600
|
+
if (f && f !== l) {
|
|
3601
|
+
const p = Math.floor(h / f), g = "InterleavedBuffer:" + r.bufferView + ":" + r.componentType + ":" + p + ":" + r.count;
|
|
3613
3602
|
let m = t.cache.get(g);
|
|
3614
|
-
m || (E = new d(c, p *
|
|
3603
|
+
m || (E = new d(c, p * f, r.count * f / u), m = new Kt(E, f / u), t.cache.add(g, m)), T = new qt(m, a, h % f / u, w);
|
|
3615
3604
|
} else
|
|
3616
|
-
c === null ? E = new d(r.count * a) : E = new d(c,
|
|
3605
|
+
c === null ? E = new d(r.count * a) : E = new d(c, h, r.count * a), T = new me(E, a, w);
|
|
3617
3606
|
if (r.sparse !== void 0) {
|
|
3618
|
-
const p =
|
|
3619
|
-
c !== null && (T = new
|
|
3620
|
-
for (let v = 0,
|
|
3621
|
-
const
|
|
3622
|
-
if (T.setX(
|
|
3607
|
+
const p = We.SCALAR, g = re[r.sparse.indices.componentType], m = r.sparse.indices.byteOffset || 0, b = r.sparse.values.byteOffset || 0, _ = new g(o[1], m, r.sparse.count * p), y = new d(o[2], b, r.sparse.count * a);
|
|
3608
|
+
c !== null && (T = new me(T.array.slice(), T.itemSize, T.normalized)), T.normalized = !1;
|
|
3609
|
+
for (let v = 0, R = _.length; v < R; v++) {
|
|
3610
|
+
const C = _[v];
|
|
3611
|
+
if (T.setX(C, y[v * a]), a >= 2 && T.setY(C, y[v * a + 1]), a >= 3 && T.setZ(C, y[v * a + 2]), a >= 4 && T.setW(C, y[v * a + 3]), a >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");
|
|
3623
3612
|
}
|
|
3624
3613
|
T.normalized = w;
|
|
3625
3614
|
}
|
|
@@ -3648,8 +3637,8 @@ class Ws {
|
|
|
3648
3637
|
return this.textureCache[a];
|
|
3649
3638
|
const d = this.loadImageSource(t, n).then(function(u) {
|
|
3650
3639
|
u.flipY = !1, u.name = o.name || c.name || "", u.name === "" && typeof c.uri == "string" && c.uri.startsWith("data:image/") === !1 && (u.name = c.uri);
|
|
3651
|
-
const
|
|
3652
|
-
return u.magFilter = Pt[
|
|
3640
|
+
const h = (i.samplers || {})[o.sampler] || {};
|
|
3641
|
+
return u.magFilter = Pt[h.magFilter] || Ve, u.minFilter = Pt[h.minFilter] || Jt, u.wrapS = Ot[h.wrapS] || Xe, u.wrapT = Ot[h.wrapT] || Xe, u.generateMipmaps = !u.isCompressedTexture && u.minFilter !== Zt && u.minFilter !== Ve, r.associations.set(u, { textures: e }), u;
|
|
3653
3642
|
}).catch(function() {
|
|
3654
3643
|
return null;
|
|
3655
3644
|
});
|
|
@@ -3664,21 +3653,21 @@ class Ws {
|
|
|
3664
3653
|
if (o.bufferView !== void 0)
|
|
3665
3654
|
a = n.getDependency("bufferView", o.bufferView).then(function(l) {
|
|
3666
3655
|
d = !0;
|
|
3667
|
-
const
|
|
3668
|
-
return a = c.createObjectURL(
|
|
3656
|
+
const h = new Blob([l], { type: o.mimeType });
|
|
3657
|
+
return a = c.createObjectURL(h), a;
|
|
3669
3658
|
});
|
|
3670
3659
|
else if (o.uri === void 0)
|
|
3671
3660
|
throw new Error("THREE.GLTFLoader: Image " + e + " is missing URI and bufferView");
|
|
3672
3661
|
const u = Promise.resolve(a).then(function(l) {
|
|
3673
|
-
return new Promise(function(
|
|
3674
|
-
let w =
|
|
3662
|
+
return new Promise(function(h, f) {
|
|
3663
|
+
let w = h;
|
|
3675
3664
|
t.isImageBitmapLoader === !0 && (w = function(E) {
|
|
3676
3665
|
const T = new ut(E);
|
|
3677
|
-
T.needsUpdate = !0,
|
|
3678
|
-
}), t.load(
|
|
3666
|
+
T.needsUpdate = !0, h(T);
|
|
3667
|
+
}), t.load(ge.resolveURL(l, i.path), w, void 0, f);
|
|
3679
3668
|
});
|
|
3680
3669
|
}).then(function(l) {
|
|
3681
|
-
return d === !0 && c.revokeObjectURL(a), N(l, o), l.userData.mimeType = o.mimeType ||
|
|
3670
|
+
return d === !0 && c.revokeObjectURL(a), N(l, o), l.userData.mimeType = o.mimeType || Ws(o.uri), l;
|
|
3682
3671
|
}).catch(function(l) {
|
|
3683
3672
|
throw console.error("THREE.GLTFLoader: Couldn't load texture", a), l;
|
|
3684
3673
|
});
|
|
@@ -3698,11 +3687,11 @@ class Ws {
|
|
|
3698
3687
|
const i = this;
|
|
3699
3688
|
return this.getDependency("texture", n.index).then(function(o) {
|
|
3700
3689
|
if (!o) return null;
|
|
3701
|
-
if (n.texCoord !== void 0 && n.texCoord > 0 && (o = o.clone(), o.channel = n.texCoord), i.extensions[
|
|
3702
|
-
const c = n.extensions !== void 0 ? n.extensions[
|
|
3690
|
+
if (n.texCoord !== void 0 && n.texCoord > 0 && (o = o.clone(), o.channel = n.texCoord), i.extensions[x.KHR_TEXTURE_TRANSFORM]) {
|
|
3691
|
+
const c = n.extensions !== void 0 ? n.extensions[x.KHR_TEXTURE_TRANSFORM] : void 0;
|
|
3703
3692
|
if (c) {
|
|
3704
3693
|
const a = i.associations.get(o);
|
|
3705
|
-
o = i.extensions[
|
|
3694
|
+
o = i.extensions[x.KHR_TEXTURE_TRANSFORM].extendTexture(o, c), i.associations.set(o, a);
|
|
3706
3695
|
}
|
|
3707
3696
|
}
|
|
3708
3697
|
return r !== void 0 && (o.colorSpace = r), e[t] = o, o;
|
|
@@ -3725,11 +3714,11 @@ class Ws {
|
|
|
3725
3714
|
if (e.isPoints) {
|
|
3726
3715
|
const c = "PointsMaterial:" + n.uuid;
|
|
3727
3716
|
let a = this.cache.get(c);
|
|
3728
|
-
a || (a = new
|
|
3717
|
+
a || (a = new Nn(), Oe.prototype.copy.call(a, n), a.color.copy(n.color), a.map = n.map, a.sizeAttenuation = !1, this.cache.add(c, a)), n = a;
|
|
3729
3718
|
} else if (e.isLine) {
|
|
3730
3719
|
const c = "LineBasicMaterial:" + n.uuid;
|
|
3731
3720
|
let a = this.cache.get(c);
|
|
3732
|
-
a || (a = new
|
|
3721
|
+
a || (a = new Fn(), Oe.prototype.copy.call(a, n), a.color.copy(n.color), a.map = n.map, this.cache.add(c, a)), n = a;
|
|
3733
3722
|
}
|
|
3734
3723
|
if (r || i || o) {
|
|
3735
3724
|
let c = "ClonedMaterial:" + n.uuid + ":";
|
|
@@ -3740,7 +3729,7 @@ class Ws {
|
|
|
3740
3729
|
e.material = n;
|
|
3741
3730
|
}
|
|
3742
3731
|
getMaterialType() {
|
|
3743
|
-
return
|
|
3732
|
+
return en;
|
|
3744
3733
|
}
|
|
3745
3734
|
/**
|
|
3746
3735
|
* Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#materials
|
|
@@ -3753,34 +3742,34 @@ class Ws {
|
|
|
3753
3742
|
const t = this, n = this.json, r = this.extensions, i = n.materials[e];
|
|
3754
3743
|
let o;
|
|
3755
3744
|
const c = {}, a = i.extensions || {}, d = [];
|
|
3756
|
-
if (a[
|
|
3757
|
-
const l = r[
|
|
3745
|
+
if (a[x.KHR_MATERIALS_UNLIT]) {
|
|
3746
|
+
const l = r[x.KHR_MATERIALS_UNLIT];
|
|
3758
3747
|
o = l.getMaterialType(), d.push(l.extendParams(c, i, t));
|
|
3759
3748
|
} else {
|
|
3760
3749
|
const l = i.pbrMetallicRoughness || {};
|
|
3761
|
-
if (c.color = new
|
|
3762
|
-
const
|
|
3763
|
-
c.color.setRGB(
|
|
3750
|
+
if (c.color = new $(1, 1, 1), c.opacity = 1, Array.isArray(l.baseColorFactor)) {
|
|
3751
|
+
const h = l.baseColorFactor;
|
|
3752
|
+
c.color.setRGB(h[0], h[1], h[2], F), c.opacity = h[3];
|
|
3764
3753
|
}
|
|
3765
|
-
l.baseColorTexture !== void 0 && d.push(t.assignTexture(c, "map", l.baseColorTexture,
|
|
3766
|
-
return
|
|
3767
|
-
}), d.push(Promise.all(this._invokeAll(function(
|
|
3768
|
-
return
|
|
3754
|
+
l.baseColorTexture !== void 0 && d.push(t.assignTexture(c, "map", l.baseColorTexture, z)), c.metalness = l.metallicFactor !== void 0 ? l.metallicFactor : 1, c.roughness = l.roughnessFactor !== void 0 ? l.roughnessFactor : 1, l.metallicRoughnessTexture !== void 0 && (d.push(t.assignTexture(c, "metalnessMap", l.metallicRoughnessTexture)), d.push(t.assignTexture(c, "roughnessMap", l.metallicRoughnessTexture))), o = this._invokeOne(function(h) {
|
|
3755
|
+
return h.getMaterialType && h.getMaterialType(e);
|
|
3756
|
+
}), d.push(Promise.all(this._invokeAll(function(h) {
|
|
3757
|
+
return h.extendMaterialParams && h.extendMaterialParams(e, c);
|
|
3769
3758
|
})));
|
|
3770
3759
|
}
|
|
3771
|
-
i.doubleSided === !0 && (c.side =
|
|
3772
|
-
const u = i.alphaMode ||
|
|
3773
|
-
if (u ===
|
|
3760
|
+
i.doubleSided === !0 && (c.side = Dn);
|
|
3761
|
+
const u = i.alphaMode || Ge.OPAQUE;
|
|
3762
|
+
if (u === Ge.BLEND ? (c.transparent = !0, c.depthWrite = !1) : (c.transparent = !1, u === Ge.MASK && (c.alphaTest = i.alphaCutoff !== void 0 ? i.alphaCutoff : 0.5)), i.normalTexture !== void 0 && o !== fe && (d.push(t.assignTexture(c, "normalMap", i.normalTexture)), c.normalScale = new Vt(1, 1), i.normalTexture.scale !== void 0)) {
|
|
3774
3763
|
const l = i.normalTexture.scale;
|
|
3775
3764
|
c.normalScale.set(l, l);
|
|
3776
3765
|
}
|
|
3777
|
-
if (i.occlusionTexture !== void 0 && o !==
|
|
3766
|
+
if (i.occlusionTexture !== void 0 && o !== fe && (d.push(t.assignTexture(c, "aoMap", i.occlusionTexture)), i.occlusionTexture.strength !== void 0 && (c.aoMapIntensity = i.occlusionTexture.strength)), i.emissiveFactor !== void 0 && o !== fe) {
|
|
3778
3767
|
const l = i.emissiveFactor;
|
|
3779
|
-
c.emissive = new
|
|
3768
|
+
c.emissive = new $().setRGB(l[0], l[1], l[2], F);
|
|
3780
3769
|
}
|
|
3781
|
-
return i.emissiveTexture !== void 0 && o !==
|
|
3770
|
+
return i.emissiveTexture !== void 0 && o !== fe && d.push(t.assignTexture(c, "emissiveMap", i.emissiveTexture, z)), Promise.all(d).then(function() {
|
|
3782
3771
|
const l = new o(c);
|
|
3783
|
-
return i.name && (l.name = i.name), N(l, i), t.associations.set(l, { materials: e }), i.extensions &&
|
|
3772
|
+
return i.name && (l.name = i.name), N(l, i), t.associations.set(l, { materials: e }), i.extensions && J(r, l, i), l;
|
|
3784
3773
|
});
|
|
3785
3774
|
}
|
|
3786
3775
|
/**
|
|
@@ -3791,7 +3780,7 @@ class Ws {
|
|
|
3791
3780
|
* @return {string}
|
|
3792
3781
|
*/
|
|
3793
3782
|
createUniqueName(e) {
|
|
3794
|
-
const t =
|
|
3783
|
+
const t = Hn.sanitizeNodeName(e || "");
|
|
3795
3784
|
return t in this.nodeNamesUsed ? t + "_" + ++this.nodeNamesUsed[t] : (this.nodeNamesUsed[t] = 0, t);
|
|
3796
3785
|
}
|
|
3797
3786
|
/**
|
|
@@ -3806,18 +3795,18 @@ class Ws {
|
|
|
3806
3795
|
loadGeometries(e) {
|
|
3807
3796
|
const t = this, n = this.extensions, r = this.primitiveCache;
|
|
3808
3797
|
function i(c) {
|
|
3809
|
-
return n[
|
|
3798
|
+
return n[x.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(c, t).then(function(a) {
|
|
3810
3799
|
return It(a, c, t);
|
|
3811
3800
|
});
|
|
3812
3801
|
}
|
|
3813
3802
|
const o = [];
|
|
3814
3803
|
for (let c = 0, a = e.length; c < a; c++) {
|
|
3815
|
-
const d = e[c], u =
|
|
3804
|
+
const d = e[c], u = Bs(d), l = r[u];
|
|
3816
3805
|
if (l)
|
|
3817
3806
|
o.push(l.promise);
|
|
3818
3807
|
else {
|
|
3819
|
-
let
|
|
3820
|
-
d.extensions && d.extensions[
|
|
3808
|
+
let h;
|
|
3809
|
+
d.extensions && d.extensions[x.KHR_DRACO_MESH_COMPRESSION] ? h = i(d) : h = It(new $t(), d, t), r[u] = { primitive: d, promise: h }, o.push(h);
|
|
3821
3810
|
}
|
|
3822
3811
|
}
|
|
3823
3812
|
return Promise.all(o);
|
|
@@ -3832,41 +3821,41 @@ class Ws {
|
|
|
3832
3821
|
loadMesh(e) {
|
|
3833
3822
|
const t = this, n = this.json, r = this.extensions, i = n.meshes[e], o = i.primitives, c = [];
|
|
3834
3823
|
for (let a = 0, d = o.length; a < d; a++) {
|
|
3835
|
-
const u = o[a].material === void 0 ?
|
|
3824
|
+
const u = o[a].material === void 0 ? Hs(this.cache) : this.getDependency("material", o[a].material);
|
|
3836
3825
|
c.push(u);
|
|
3837
3826
|
}
|
|
3838
3827
|
return c.push(t.loadGeometries(o)), Promise.all(c).then(function(a) {
|
|
3839
3828
|
const d = a.slice(0, a.length - 1), u = a[a.length - 1], l = [];
|
|
3840
|
-
for (let
|
|
3841
|
-
const E = u[
|
|
3829
|
+
for (let f = 0, w = u.length; f < w; f++) {
|
|
3830
|
+
const E = u[f], T = o[f];
|
|
3842
3831
|
let p;
|
|
3843
|
-
const g = d[
|
|
3832
|
+
const g = d[f];
|
|
3844
3833
|
if (T.mode === P.TRIANGLES || T.mode === P.TRIANGLE_STRIP || T.mode === P.TRIANGLE_FAN || T.mode === void 0)
|
|
3845
|
-
p = i.isSkinnedMesh === !0 ? new jn(E, g) : new
|
|
3834
|
+
p = i.isSkinnedMesh === !0 ? new jn(E, g) : new Un(E, g), p.isSkinnedMesh === !0 && p.normalizeSkinWeights(), T.mode === P.TRIANGLE_STRIP ? p.geometry = kt(p.geometry, Gt) : T.mode === P.TRIANGLE_FAN && (p.geometry = kt(p.geometry, Ke));
|
|
3846
3835
|
else if (T.mode === P.LINES)
|
|
3847
|
-
p = new Un(E, g);
|
|
3848
|
-
else if (T.mode === P.LINE_STRIP)
|
|
3849
3836
|
p = new Bn(E, g);
|
|
3837
|
+
else if (T.mode === P.LINE_STRIP)
|
|
3838
|
+
p = new Wn(E, g);
|
|
3850
3839
|
else if (T.mode === P.LINE_LOOP)
|
|
3851
3840
|
p = new Gn(E, g);
|
|
3852
3841
|
else if (T.mode === P.POINTS)
|
|
3853
|
-
p = new
|
|
3842
|
+
p = new zn(E, g);
|
|
3854
3843
|
else
|
|
3855
3844
|
throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + T.mode);
|
|
3856
|
-
Object.keys(p.geometry.morphAttributes).length > 0 &&
|
|
3845
|
+
Object.keys(p.geometry.morphAttributes).length > 0 && Us(p, i), p.name = t.createUniqueName(i.name || "mesh_" + e), N(p, i), T.extensions && J(r, p, T), t.assignFinalMaterial(p), l.push(p);
|
|
3857
3846
|
}
|
|
3858
|
-
for (let
|
|
3859
|
-
t.associations.set(l[
|
|
3847
|
+
for (let f = 0, w = l.length; f < w; f++)
|
|
3848
|
+
t.associations.set(l[f], {
|
|
3860
3849
|
meshes: e,
|
|
3861
|
-
primitives:
|
|
3850
|
+
primitives: f
|
|
3862
3851
|
});
|
|
3863
3852
|
if (l.length === 1)
|
|
3864
|
-
return i.extensions &&
|
|
3865
|
-
const
|
|
3866
|
-
i.extensions &&
|
|
3867
|
-
for (let
|
|
3868
|
-
|
|
3869
|
-
return
|
|
3853
|
+
return i.extensions && J(r, l[0], i), l[0];
|
|
3854
|
+
const h = new Ie();
|
|
3855
|
+
i.extensions && J(r, h, i), t.associations.set(h, { meshes: e });
|
|
3856
|
+
for (let f = 0, w = l.length; f < w; f++)
|
|
3857
|
+
h.add(l[f]);
|
|
3858
|
+
return h;
|
|
3870
3859
|
});
|
|
3871
3860
|
}
|
|
3872
3861
|
/**
|
|
@@ -3883,7 +3872,7 @@ class Ws {
|
|
|
3883
3872
|
console.warn("THREE.GLTFLoader: Missing camera parameters.");
|
|
3884
3873
|
return;
|
|
3885
3874
|
}
|
|
3886
|
-
return n.type === "perspective" ? t = new
|
|
3875
|
+
return n.type === "perspective" ? t = new $n(Kn.radToDeg(r.yfov), r.aspectRatio || 1, r.znear || 1, r.zfar || 2e6) : n.type === "orthographic" && (t = new qn(-r.xmag, r.xmag, r.ymag, -r.ymag, r.znear, r.zfar)), n.name && (t.name = this.createUniqueName(n.name)), N(t, n), Promise.resolve(t);
|
|
3887
3876
|
}
|
|
3888
3877
|
/**
|
|
3889
3878
|
* Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins
|
|
@@ -3902,12 +3891,12 @@ class Ws {
|
|
|
3902
3891
|
const l = o[d];
|
|
3903
3892
|
if (l) {
|
|
3904
3893
|
c.push(l);
|
|
3905
|
-
const
|
|
3906
|
-
i !== null &&
|
|
3894
|
+
const h = new ve();
|
|
3895
|
+
i !== null && h.fromArray(i.array, d * 16), a.push(h);
|
|
3907
3896
|
} else
|
|
3908
3897
|
console.warn('THREE.GLTFLoader: Joint "%s" could not be found.', t.joints[d]);
|
|
3909
3898
|
}
|
|
3910
|
-
return new
|
|
3899
|
+
return new Vn(c, a);
|
|
3911
3900
|
});
|
|
3912
3901
|
}
|
|
3913
3902
|
/**
|
|
@@ -3919,8 +3908,8 @@ class Ws {
|
|
|
3919
3908
|
*/
|
|
3920
3909
|
loadAnimation(e) {
|
|
3921
3910
|
const t = this.json, n = this, r = t.animations[e], i = r.name ? r.name : "animation_" + e, o = [], c = [], a = [], d = [], u = [];
|
|
3922
|
-
for (let l = 0,
|
|
3923
|
-
const
|
|
3911
|
+
for (let l = 0, h = r.channels.length; l < h; l++) {
|
|
3912
|
+
const f = r.channels[l], w = r.samplers[f.sampler], E = f.target, T = E.node, p = r.parameters !== void 0 ? r.parameters[w.input] : w.input, g = r.parameters !== void 0 ? r.parameters[w.output] : w.output;
|
|
3924
3913
|
E.node !== void 0 && (o.push(this.getDependency("node", T)), c.push(this.getDependency("accessor", p)), a.push(this.getDependency("accessor", g)), d.push(w), u.push(E));
|
|
3925
3914
|
}
|
|
3926
3915
|
return Promise.all([
|
|
@@ -3930,17 +3919,17 @@ class Ws {
|
|
|
3930
3919
|
Promise.all(d),
|
|
3931
3920
|
Promise.all(u)
|
|
3932
3921
|
]).then(function(l) {
|
|
3933
|
-
const
|
|
3934
|
-
for (let m = 0, b =
|
|
3935
|
-
const _ =
|
|
3922
|
+
const h = l[0], f = l[1], w = l[2], E = l[3], T = l[4], p = [];
|
|
3923
|
+
for (let m = 0, b = h.length; m < b; m++) {
|
|
3924
|
+
const _ = h[m], y = f[m], v = w[m], R = E[m], C = T[m];
|
|
3936
3925
|
if (_ === void 0) continue;
|
|
3937
3926
|
_.updateMatrix && _.updateMatrix();
|
|
3938
|
-
const
|
|
3939
|
-
if (
|
|
3940
|
-
for (let
|
|
3941
|
-
p.push(k
|
|
3927
|
+
const M = n._createAnimationTracks(_, y, v, R, C);
|
|
3928
|
+
if (M)
|
|
3929
|
+
for (let k = 0; k < M.length; k++)
|
|
3930
|
+
p.push(M[k]);
|
|
3942
3931
|
}
|
|
3943
|
-
const g = new
|
|
3932
|
+
const g = new Xn(i, void 0, p);
|
|
3944
3933
|
return N(g, r), g;
|
|
3945
3934
|
});
|
|
3946
3935
|
}
|
|
@@ -3972,15 +3961,15 @@ class Ws {
|
|
|
3972
3961
|
Promise.all(o),
|
|
3973
3962
|
a
|
|
3974
3963
|
]).then(function(d) {
|
|
3975
|
-
const u = d[0], l = d[1],
|
|
3976
|
-
|
|
3977
|
-
|
|
3964
|
+
const u = d[0], l = d[1], h = d[2];
|
|
3965
|
+
h !== null && u.traverse(function(f) {
|
|
3966
|
+
f.isSkinnedMesh && f.bind(h, Gs);
|
|
3978
3967
|
});
|
|
3979
|
-
for (let
|
|
3980
|
-
u.add(l[
|
|
3968
|
+
for (let f = 0, w = l.length; f < w; f++)
|
|
3969
|
+
u.add(l[f]);
|
|
3981
3970
|
if (u.userData.pivot !== void 0 && l.length > 0) {
|
|
3982
|
-
const
|
|
3983
|
-
u.pivot = new
|
|
3971
|
+
const f = u.userData.pivot, w = l[0];
|
|
3972
|
+
u.pivot = new Z().fromArray(f), u.position.x -= f[0], u.position.y -= f[1], u.position.z -= f[2], w.position.set(0, 0, 0), delete u.userData.pivot;
|
|
3984
3973
|
}
|
|
3985
3974
|
return u;
|
|
3986
3975
|
});
|
|
@@ -4002,10 +3991,10 @@ class Ws {
|
|
|
4002
3991
|
c.push(d);
|
|
4003
3992
|
}), this.nodeCache[e] = Promise.all(c).then(function(d) {
|
|
4004
3993
|
let u;
|
|
4005
|
-
if (i.isBone === !0 ? u = new
|
|
4006
|
-
for (let l = 0,
|
|
3994
|
+
if (i.isBone === !0 ? u = new Qn() : d.length > 1 ? u = new Ie() : d.length === 1 ? u = d[0] : u = new Qt(), u !== d[0])
|
|
3995
|
+
for (let l = 0, h = d.length; l < h; l++)
|
|
4007
3996
|
u.add(d[l]);
|
|
4008
|
-
if (i.name && (u.userData.name = i.name, u.name = o), N(u, i), i.extensions &&
|
|
3997
|
+
if (i.name && (u.userData.name = i.name, u.name = o), N(u, i), i.extensions && J(n, u, i), i.matrix !== void 0) {
|
|
4009
3998
|
const l = new ve();
|
|
4010
3999
|
l.fromArray(i.matrix), u.applyMatrix4(l);
|
|
4011
4000
|
} else
|
|
@@ -4028,22 +4017,22 @@ class Ws {
|
|
|
4028
4017
|
*/
|
|
4029
4018
|
loadScene(e) {
|
|
4030
4019
|
const t = this.extensions, n = this.json.scenes[e], r = this, i = new Ie();
|
|
4031
|
-
n.name && (i.name = r.createUniqueName(n.name)), N(i, n), n.extensions &&
|
|
4020
|
+
n.name && (i.name = r.createUniqueName(n.name)), N(i, n), n.extensions && J(t, i, n);
|
|
4032
4021
|
const o = n.nodes || [], c = [];
|
|
4033
4022
|
for (let a = 0, d = o.length; a < d; a++)
|
|
4034
4023
|
c.push(r.getDependency("node", o[a]));
|
|
4035
4024
|
return Promise.all(c).then(function(a) {
|
|
4036
4025
|
for (let u = 0, l = a.length; u < l; u++) {
|
|
4037
|
-
const
|
|
4038
|
-
|
|
4026
|
+
const h = a[u];
|
|
4027
|
+
h.parent !== null ? i.add(ds(h)) : i.add(h);
|
|
4039
4028
|
}
|
|
4040
4029
|
const d = (u) => {
|
|
4041
4030
|
const l = /* @__PURE__ */ new Map();
|
|
4042
|
-
for (const [
|
|
4043
|
-
(
|
|
4044
|
-
return u.traverse((
|
|
4045
|
-
const
|
|
4046
|
-
|
|
4031
|
+
for (const [h, f] of r.associations)
|
|
4032
|
+
(h instanceof Oe || h instanceof ut) && l.set(h, f);
|
|
4033
|
+
return u.traverse((h) => {
|
|
4034
|
+
const f = r.associations.get(h);
|
|
4035
|
+
f != null && l.set(h, f);
|
|
4047
4036
|
}), l;
|
|
4048
4037
|
};
|
|
4049
4038
|
return r.associations = d(i), i;
|
|
@@ -4051,8 +4040,8 @@ class Ws {
|
|
|
4051
4040
|
}
|
|
4052
4041
|
_createAnimationTracks(e, t, n, r, i) {
|
|
4053
4042
|
const o = [], c = e.name ? e.name : e.uuid, a = [];
|
|
4054
|
-
G[i.path] === G.weights ? e.traverse(function(
|
|
4055
|
-
|
|
4043
|
+
G[i.path] === G.weights ? e.traverse(function(h) {
|
|
4044
|
+
h.morphTargetInfluences && a.push(h.name ? h.name : h.uuid);
|
|
4056
4045
|
}) : a.push(c);
|
|
4057
4046
|
let d;
|
|
4058
4047
|
switch (G[i.path]) {
|
|
@@ -4060,7 +4049,7 @@ class Ws {
|
|
|
4060
4049
|
d = dt;
|
|
4061
4050
|
break;
|
|
4062
4051
|
case G.rotation:
|
|
4063
|
-
d =
|
|
4052
|
+
d = ht;
|
|
4064
4053
|
break;
|
|
4065
4054
|
case G.translation:
|
|
4066
4055
|
case G.scale:
|
|
@@ -4079,10 +4068,10 @@ class Ws {
|
|
|
4079
4068
|
}
|
|
4080
4069
|
break;
|
|
4081
4070
|
}
|
|
4082
|
-
const u = r.interpolation !== void 0 ?
|
|
4083
|
-
for (let
|
|
4071
|
+
const u = r.interpolation !== void 0 ? Ds[r.interpolation] : tn, l = this._getArrayFromAccessor(n);
|
|
4072
|
+
for (let h = 0, f = a.length; h < f; h++) {
|
|
4084
4073
|
const w = new d(
|
|
4085
|
-
a[
|
|
4074
|
+
a[h] + "." + G[i.path],
|
|
4086
4075
|
t.array,
|
|
4087
4076
|
l,
|
|
4088
4077
|
u
|
|
@@ -4094,7 +4083,7 @@ class Ws {
|
|
|
4094
4083
|
_getArrayFromAccessor(e) {
|
|
4095
4084
|
let t = e.array;
|
|
4096
4085
|
if (e.normalized) {
|
|
4097
|
-
const n =
|
|
4086
|
+
const n = et(t.constructor), r = new Float32Array(t.length);
|
|
4098
4087
|
for (let i = 0, o = t.length; i < o; i++)
|
|
4099
4088
|
r[i] = t[i] * n;
|
|
4100
4089
|
t = r;
|
|
@@ -4103,21 +4092,21 @@ class Ws {
|
|
|
4103
4092
|
}
|
|
4104
4093
|
_createCubicSplineTrackInterpolant(e) {
|
|
4105
4094
|
e.createInterpolant = function(n) {
|
|
4106
|
-
const r = this instanceof
|
|
4095
|
+
const r = this instanceof ht ? Fs : fn;
|
|
4107
4096
|
return new r(this.times, this.values, this.getValueSize() / 3, n);
|
|
4108
4097
|
}, e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = !0;
|
|
4109
4098
|
}
|
|
4110
4099
|
}
|
|
4111
|
-
function
|
|
4112
|
-
const n = e.attributes, r = new
|
|
4100
|
+
function $s(s, e, t) {
|
|
4101
|
+
const n = e.attributes, r = new sr();
|
|
4113
4102
|
if (n.POSITION !== void 0) {
|
|
4114
4103
|
const c = t.json.accessors[n.POSITION], a = c.min, d = c.max;
|
|
4115
4104
|
if (a !== void 0 && d !== void 0) {
|
|
4116
4105
|
if (r.set(
|
|
4117
|
-
new
|
|
4118
|
-
new
|
|
4106
|
+
new Z(a[0], a[1], a[2]),
|
|
4107
|
+
new Z(d[0], d[1], d[2])
|
|
4119
4108
|
), c.normalized) {
|
|
4120
|
-
const u =
|
|
4109
|
+
const u = et(re[c.componentType]);
|
|
4121
4110
|
r.min.multiplyScalar(u), r.max.multiplyScalar(u);
|
|
4122
4111
|
}
|
|
4123
4112
|
} else {
|
|
@@ -4128,14 +4117,14 @@ function zs(s, e, t) {
|
|
|
4128
4117
|
return;
|
|
4129
4118
|
const i = e.targets;
|
|
4130
4119
|
if (i !== void 0) {
|
|
4131
|
-
const c = new
|
|
4120
|
+
const c = new Z(), a = new Z();
|
|
4132
4121
|
for (let d = 0, u = i.length; d < u; d++) {
|
|
4133
4122
|
const l = i[d];
|
|
4134
4123
|
if (l.POSITION !== void 0) {
|
|
4135
|
-
const
|
|
4136
|
-
if (
|
|
4137
|
-
if (a.setX(Math.max(Math.abs(
|
|
4138
|
-
const E =
|
|
4124
|
+
const h = t.json.accessors[l.POSITION], f = h.min, w = h.max;
|
|
4125
|
+
if (f !== void 0 && w !== void 0) {
|
|
4126
|
+
if (a.setX(Math.max(Math.abs(f[0]), Math.abs(w[0]))), a.setY(Math.max(Math.abs(f[1]), Math.abs(w[1]))), a.setZ(Math.max(Math.abs(f[2]), Math.abs(w[2]))), h.normalized) {
|
|
4127
|
+
const E = et(re[h.componentType]);
|
|
4139
4128
|
a.multiplyScalar(E);
|
|
4140
4129
|
}
|
|
4141
4130
|
c.max(a);
|
|
@@ -4146,7 +4135,7 @@ function zs(s, e, t) {
|
|
|
4146
4135
|
r.expandByVector(c);
|
|
4147
4136
|
}
|
|
4148
4137
|
s.boundingBox = r;
|
|
4149
|
-
const o = new
|
|
4138
|
+
const o = new ir();
|
|
4150
4139
|
r.getCenter(o.center), o.radius = r.min.distanceTo(r.max) / 2, s.boundingSphere = o;
|
|
4151
4140
|
}
|
|
4152
4141
|
function It(s, e, t) {
|
|
@@ -4157,7 +4146,7 @@ function It(s, e, t) {
|
|
|
4157
4146
|
});
|
|
4158
4147
|
}
|
|
4159
4148
|
for (const o in n) {
|
|
4160
|
-
const c =
|
|
4149
|
+
const c = Ze[o] || o.toLowerCase();
|
|
4161
4150
|
c in s.attributes || r.push(i(n[o], c));
|
|
4162
4151
|
}
|
|
4163
4152
|
if (e.indices !== void 0 && !s.index) {
|
|
@@ -4166,23 +4155,23 @@ function It(s, e, t) {
|
|
|
4166
4155
|
});
|
|
4167
4156
|
r.push(o);
|
|
4168
4157
|
}
|
|
4169
|
-
return
|
|
4158
|
+
return qe.workingColorSpace !== F && "COLOR_0" in n && console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${qe.workingColorSpace}" not supported.`), N(s, e), $s(s, e, t), Promise.all(r).then(function() {
|
|
4170
4159
|
return e.targets !== void 0 ? js(s, e.targets, t) : s;
|
|
4171
4160
|
});
|
|
4172
4161
|
}
|
|
4173
|
-
var
|
|
4174
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
4162
|
+
var Ks = Object.defineProperty, qs = Object.getOwnPropertyDescriptor, Vs = (s, e, t, n) => {
|
|
4163
|
+
for (var r = n > 1 ? void 0 : n ? qs(e, t) : e, i = s.length - 1, o; i >= 0; i--)
|
|
4175
4164
|
(o = s[i]) && (r = (n ? o(e, t, r) : o(r)) || r);
|
|
4176
|
-
return n && r &&
|
|
4165
|
+
return n && r && Ks(e, t, r), r;
|
|
4177
4166
|
};
|
|
4178
|
-
let
|
|
4167
|
+
let Ce = class {
|
|
4179
4168
|
constructor() {
|
|
4180
|
-
|
|
4181
|
-
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
|
|
4185
|
-
|
|
4169
|
+
S(this, "loadingManager", new ar());
|
|
4170
|
+
S(this, "loaders", {});
|
|
4171
|
+
S(this, "sources", []);
|
|
4172
|
+
S(this, "loadedResources", {});
|
|
4173
|
+
S(this, "toLoadCount", 0);
|
|
4174
|
+
S(this, "loadedCount", 0);
|
|
4186
4175
|
}
|
|
4187
4176
|
/** @description The video loader. based on {@link HTMLVideoElement}. */
|
|
4188
4177
|
get videoLoader() {
|
|
@@ -4198,7 +4187,7 @@ let Re = class {
|
|
|
4198
4187
|
};
|
|
4199
4188
|
}
|
|
4200
4189
|
_initLoaders() {
|
|
4201
|
-
this.loaders.dracoLoader = new
|
|
4190
|
+
this.loaders.dracoLoader = new ln(this.loadingManager), this.loaders.audioLoader = new cr(this.loadingManager), this.loaders.fontLoader = new Rn(this.loadingManager), this.loaders.gltfLoader = new hs(this.loadingManager), this.loaders.imageLoader = new Yt(this.loadingManager), this.loaders.videoLoader = this.videoLoader;
|
|
4202
4191
|
}
|
|
4203
4192
|
_initSources(s) {
|
|
4204
4193
|
this.sources = s, this.toLoadCount = this.sources.length, this.loadedCount = 0;
|
|
@@ -4248,18 +4237,18 @@ let Re = class {
|
|
|
4248
4237
|
}
|
|
4249
4238
|
}
|
|
4250
4239
|
};
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
],
|
|
4254
|
-
var
|
|
4255
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
4240
|
+
Ce = Vs([
|
|
4241
|
+
ie(oe.ContainerScoped)
|
|
4242
|
+
], Ce);
|
|
4243
|
+
var Xs = Object.defineProperty, Qs = Object.getOwnPropertyDescriptor, Ys = (s, e, t, n) => {
|
|
4244
|
+
for (var r = n > 1 ? void 0 : n ? Qs(e, t) : e, i = s.length - 1, o; i >= 0; i--)
|
|
4256
4245
|
(o = s[i]) && (r = (n ? o(e, t, r) : o(r)) || r);
|
|
4257
|
-
return n && r &&
|
|
4258
|
-
},
|
|
4259
|
-
let
|
|
4246
|
+
return n && r && Xs(e, t, r), r;
|
|
4247
|
+
}, Js = (s, e) => (t, n) => e(t, n, s);
|
|
4248
|
+
let xe = class {
|
|
4260
4249
|
constructor(s) {
|
|
4261
|
-
|
|
4262
|
-
|
|
4250
|
+
S(this, "load$$", new jt());
|
|
4251
|
+
S(this, "load$", this.load$$.pipe(
|
|
4263
4252
|
ye((s) => ({
|
|
4264
4253
|
...s,
|
|
4265
4254
|
loadedCount: s.resource ? this._service.loadedCount + 1 : this._service.loadedCount,
|
|
@@ -4267,13 +4256,13 @@ let Se = class {
|
|
|
4267
4256
|
})),
|
|
4268
4257
|
Pe()
|
|
4269
4258
|
));
|
|
4270
|
-
|
|
4259
|
+
S(this, "serializedLoad$", this.load$.pipe(
|
|
4271
4260
|
ye((s) => {
|
|
4272
4261
|
var t, n, r;
|
|
4273
4262
|
let e = s.resource;
|
|
4274
4263
|
if ((t = s == null ? void 0 : s.resource) != null && t.parser) {
|
|
4275
4264
|
const i = s.resource, o = i.scenes.map(
|
|
4276
|
-
(c) =>
|
|
4265
|
+
(c) => ot(c)
|
|
4277
4266
|
);
|
|
4278
4267
|
e = {
|
|
4279
4268
|
animations: (s == null ? void 0 : s.resource).animations.map(
|
|
@@ -4281,7 +4270,7 @@ let Se = class {
|
|
|
4281
4270
|
(c) => c.toJSON()
|
|
4282
4271
|
),
|
|
4283
4272
|
cameras: i.cameras.map(
|
|
4284
|
-
(c) =>
|
|
4273
|
+
(c) => ot(c)
|
|
4285
4274
|
),
|
|
4286
4275
|
parser: { json: i.parser.json },
|
|
4287
4276
|
scene: o == null ? void 0 : o[0],
|
|
@@ -4295,7 +4284,7 @@ let Se = class {
|
|
|
4295
4284
|
sampleRate: s.resource.sampleRate,
|
|
4296
4285
|
duration: s.resource.duration
|
|
4297
4286
|
}), ((r = s == null ? void 0 : s.source) == null ? void 0 : r.type) === "video" && s.resource instanceof HTMLVideoElement && (e = {
|
|
4298
|
-
...
|
|
4287
|
+
...pe(s.resource, [
|
|
4299
4288
|
"autoplay",
|
|
4300
4289
|
"baseURI",
|
|
4301
4290
|
"controls",
|
|
@@ -4329,7 +4318,7 @@ let Se = class {
|
|
|
4329
4318
|
"width"
|
|
4330
4319
|
]),
|
|
4331
4320
|
buffered: s.resource.buffered.length,
|
|
4332
|
-
error: s.resource.error ?
|
|
4321
|
+
error: s.resource.error ? Bt(s.resource.error, []) : {},
|
|
4333
4322
|
played: s.resource.played.length,
|
|
4334
4323
|
seekable: s.resource.seekable.length,
|
|
4335
4324
|
textTracks: s.resource.textTracks.length
|
|
@@ -4340,10 +4329,10 @@ let Se = class {
|
|
|
4340
4329
|
}),
|
|
4341
4330
|
Pe()
|
|
4342
4331
|
));
|
|
4343
|
-
|
|
4332
|
+
S(this, "loadCompleted$", this.load$.pipe(
|
|
4344
4333
|
Ut((s) => s.toLoadCount === s.loadedCount),
|
|
4345
4334
|
ye(
|
|
4346
|
-
() =>
|
|
4335
|
+
() => pe(this._service, [
|
|
4347
4336
|
"loadedCount",
|
|
4348
4337
|
"loadedResources",
|
|
4349
4338
|
"toLoadCount"
|
|
@@ -4354,18 +4343,18 @@ let Se = class {
|
|
|
4354
4343
|
this._service = s;
|
|
4355
4344
|
}
|
|
4356
4345
|
};
|
|
4357
|
-
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
],
|
|
4361
|
-
var
|
|
4362
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
4346
|
+
xe = Ys([
|
|
4347
|
+
ie(oe.ContainerScoped),
|
|
4348
|
+
Js(0, O(Ce))
|
|
4349
|
+
], xe);
|
|
4350
|
+
var Zs = Object.defineProperty, ei = Object.getOwnPropertyDescriptor, ti = (s, e, t, n) => {
|
|
4351
|
+
for (var r = n > 1 ? void 0 : n ? ei(e, t) : e, i = s.length - 1, o; i >= 0; i--)
|
|
4363
4352
|
(o = s[i]) && (r = (n ? o(e, t, r) : o(r)) || r);
|
|
4364
|
-
return n && r &&
|
|
4353
|
+
return n && r && Zs(e, t, r), r;
|
|
4365
4354
|
}, $e = (s, e) => (t, n) => e(t, n, s);
|
|
4366
|
-
let
|
|
4355
|
+
let tt = class {
|
|
4367
4356
|
constructor(s, e, t) {
|
|
4368
|
-
|
|
4357
|
+
S(this, "_subscriptions", []);
|
|
4369
4358
|
this._controller = s, this._service = e, this._props = t, this._subscriptions.push(
|
|
4370
4359
|
this._controller.load$.subscribe(
|
|
4371
4360
|
this._service.handleLoad.bind(this._service)
|
|
@@ -4410,98 +4399,98 @@ let nt = class {
|
|
|
4410
4399
|
dispose() {
|
|
4411
4400
|
this._subscriptions.forEach((s) => s.unsubscribe()), Object.keys(this._service.loaders).forEach((s) => {
|
|
4412
4401
|
const e = this._service.loaders[s];
|
|
4413
|
-
e instanceof
|
|
4402
|
+
e instanceof ln && e.dispose(), this._service.loaders[s] = void 0;
|
|
4414
4403
|
}), this._controller.load$$.complete();
|
|
4415
4404
|
}
|
|
4416
4405
|
};
|
|
4417
|
-
|
|
4418
|
-
|
|
4419
|
-
$e(0, O(
|
|
4420
|
-
$e(1, O(
|
|
4421
|
-
$e(2, O(
|
|
4422
|
-
],
|
|
4423
|
-
var
|
|
4424
|
-
for (var r = n > 1 ? void 0 : n ?
|
|
4406
|
+
tt = ti([
|
|
4407
|
+
ie(oe.ContainerScoped),
|
|
4408
|
+
$e(0, O(xe)),
|
|
4409
|
+
$e(1, O(Ce)),
|
|
4410
|
+
$e(2, O(Se))
|
|
4411
|
+
], tt);
|
|
4412
|
+
var ni = Object.defineProperty, ri = Object.getOwnPropertyDescriptor, si = (s, e, t, n) => {
|
|
4413
|
+
for (var r = n > 1 ? void 0 : n ? ri(e, t) : e, i = s.length - 1, o; i >= 0; i--)
|
|
4425
4414
|
(o = s[i]) && (r = (n ? o(e, t, r) : o(r)) || r);
|
|
4426
|
-
return n && r &&
|
|
4427
|
-
},
|
|
4428
|
-
let
|
|
4415
|
+
return n && r && ni(e, t, r), r;
|
|
4416
|
+
}, ne = (s, e) => (t, n) => e(t, n, s);
|
|
4417
|
+
let nt = class extends Cn {
|
|
4429
4418
|
constructor(e, t, n, r, i, o) {
|
|
4430
4419
|
super();
|
|
4431
|
-
|
|
4432
|
-
|
|
4420
|
+
S(this, "_subscriptions", []);
|
|
4421
|
+
S(this, "_initialized", !1);
|
|
4433
4422
|
this._service = e, this._controller = t, this._loaderController = n, this.container = r, this.props = i, this.loader = o, this.props.initOnConstruct && this.init();
|
|
4434
4423
|
}
|
|
4435
4424
|
get currentWorker() {
|
|
4436
|
-
|
|
4425
|
+
var e;
|
|
4426
|
+
return this.props.mainThread ? self : (e = this._service.workerThread) == null ? void 0 : e.worker;
|
|
4437
4427
|
}
|
|
4438
4428
|
async _initCanvas() {
|
|
4429
|
+
var e;
|
|
4439
4430
|
try {
|
|
4440
|
-
|
|
4441
|
-
|
|
4442
|
-
e instanceof HTMLCanvasElement && (this._service.canvas = e);
|
|
4443
|
-
}
|
|
4444
|
-
this._service.canvas || (this._service.canvas = document.createElement("canvas"), this._service.canvas.dataset.reactive = "true", document.body.appendChild(this._service.canvas));
|
|
4445
|
-
} catch (e) {
|
|
4431
|
+
this._service.canvas = this.props.canvas instanceof HTMLCanvasElement ? this.props.canvas : void 0, this._service.canvas || (this._service.canvas = document.createElement("canvas"), this._service.canvas.dataset.reactive = "true", document.body.appendChild(this._service.canvas)), this._service.canvasWrapper = this.props.canvasWrapper instanceof HTMLElement ? this.props.canvasWrapper : this.props.canvasWrapper === "parent" ? ((e = this.props.canvas) == null ? void 0 : e.parentElement) ?? void 0 : void 0;
|
|
4432
|
+
} catch (t) {
|
|
4446
4433
|
console.error(
|
|
4447
4434
|
`🛑 Unable to initialize the canvas:
|
|
4448
|
-
${
|
|
4435
|
+
${t instanceof Error ? t.message : "Something went wrong"}`
|
|
4449
4436
|
);
|
|
4450
4437
|
}
|
|
4451
4438
|
}
|
|
4452
|
-
async _initServiceWorker() {
|
|
4453
|
-
this._service.init({
|
|
4454
|
-
worker: this._service.worker,
|
|
4455
|
-
thread: this._service.thread
|
|
4456
|
-
});
|
|
4457
|
-
}
|
|
4458
4439
|
async _initEvents() {
|
|
4459
4440
|
if (!this._service.canvas)
|
|
4460
4441
|
throw new Error("Canvas element is not initialized.");
|
|
4461
|
-
this._controller.init(),
|
|
4462
|
-
|
|
4463
|
-
|
|
4464
|
-
this.
|
|
4465
|
-
|
|
4466
|
-
|
|
4442
|
+
this._controller.init(), this.props.mainThread || this._subscriptions.push(
|
|
4443
|
+
this._controller.resize$.subscribe((r) => {
|
|
4444
|
+
const i = this._service.canvas;
|
|
4445
|
+
if (!this.props.autoRenderResize || !i) return;
|
|
4446
|
+
const o = this._service.canvasWrapper, c = this.props.fullScreen, a = c ? r.windowWidth : o ? r.wrapperWidth : r.width, d = c ? r.windowHeight : o ? r.wrapperHeight : r.height;
|
|
4447
|
+
i.style.width = a + "px", i.style.height = d + "px";
|
|
4448
|
+
})
|
|
4449
|
+
);
|
|
4450
|
+
const e = this._service.canvas, t = this._service.canvasWrapper, n = new UIEvent("resize");
|
|
4451
|
+
n.width = (e == null ? void 0 : e.width) ?? 0, n.height = (e == null ? void 0 : e.height) ?? 0, n.wrapperWidth = (t == null ? void 0 : t.clientWidth) ?? 0, n.wrapperHeight = (t == null ? void 0 : t.clientHeight) ?? 0, n.windowWidth = window.innerWidth, n.windowHeight = window.innerHeight, this._controller.resize$$.next(this._service.uiEventHandler(n));
|
|
4467
4452
|
}
|
|
4468
|
-
async
|
|
4469
|
-
|
|
4470
|
-
|
|
4471
|
-
...Ke(this.props, [
|
|
4472
|
-
"mainThread",
|
|
4453
|
+
async _initCore() {
|
|
4454
|
+
const e = {
|
|
4455
|
+
...Bt(this.props, [
|
|
4473
4456
|
"canvas",
|
|
4457
|
+
"canvasWrapper",
|
|
4474
4458
|
"location",
|
|
4475
4459
|
"onReady",
|
|
4476
4460
|
"loaderDataSources"
|
|
4477
|
-
])
|
|
4478
|
-
|
|
4479
|
-
|
|
4480
|
-
|
|
4461
|
+
]),
|
|
4462
|
+
pixelRatio: this.props.pixelRatio,
|
|
4463
|
+
initApp: !0,
|
|
4464
|
+
hasCanvasWrapper: !!this.props.canvasWrapper
|
|
4465
|
+
};
|
|
4466
|
+
if (this.props.mainThread) {
|
|
4467
|
+
await import(`${this.props.location}`), await new Promise((i) => {
|
|
4468
|
+
const o = (c) => {
|
|
4469
|
+
c.data.mainThread && (i(), self.removeEventListener("message", o));
|
|
4470
|
+
};
|
|
4471
|
+
self.addEventListener("message", o), self.postMessage(e);
|
|
4472
|
+
});
|
|
4473
|
+
return;
|
|
4474
|
+
}
|
|
4481
4475
|
if (!this._service.canvas)
|
|
4482
4476
|
throw new Error("Canvas element is not initialized.");
|
|
4483
4477
|
this._service.offscreenCanvas = this._service.canvas.transferControlToOffscreen(), this._service.offscreenCanvas.width = this._service.canvas.clientWidth, this._service.offscreenCanvas.height = this._service.canvas.clientHeight;
|
|
4484
|
-
const
|
|
4478
|
+
const t = {
|
|
4479
|
+
...e,
|
|
4480
|
+
canvas: this._service.offscreenCanvas
|
|
4481
|
+
}, [n, r] = await this._service.workerPool.run({
|
|
4485
4482
|
payload: {
|
|
4486
4483
|
path: this.props.location,
|
|
4487
|
-
subject:
|
|
4488
|
-
...Ke(this.props, [
|
|
4489
|
-
"canvas",
|
|
4490
|
-
"location",
|
|
4491
|
-
"onReady",
|
|
4492
|
-
"loaderDataSources"
|
|
4493
|
-
]),
|
|
4494
|
-
canvas: this._service.offscreenCanvas
|
|
4495
|
-
},
|
|
4484
|
+
subject: t,
|
|
4496
4485
|
transferSubject: [this._service.offscreenCanvas]
|
|
4497
4486
|
}
|
|
4498
4487
|
}) || [];
|
|
4499
|
-
if (!
|
|
4488
|
+
if (!n || r)
|
|
4500
4489
|
throw new Error("Unable to retrieve the worker-thread info.");
|
|
4501
|
-
this._service.
|
|
4490
|
+
this._service.workerThread = n;
|
|
4502
4491
|
}
|
|
4503
4492
|
async _initObservables() {
|
|
4504
|
-
|
|
4493
|
+
Ht.forEach(
|
|
4505
4494
|
(e) => this[`${e}$`] = () => {
|
|
4506
4495
|
var t;
|
|
4507
4496
|
return (t = this._controller) == null ? void 0 : t[`${e}$`];
|
|
@@ -4520,7 +4509,7 @@ ${e instanceof Error ? e.message : "Something went wrong"}`
|
|
|
4520
4509
|
e.resource
|
|
4521
4510
|
]);
|
|
4522
4511
|
(n = this.currentWorker) == null || n.postMessage({
|
|
4523
|
-
token:
|
|
4512
|
+
token: xn,
|
|
4524
4513
|
payload: e
|
|
4525
4514
|
});
|
|
4526
4515
|
})
|
|
@@ -4528,7 +4517,7 @@ ${e instanceof Error ? e.message : "Something went wrong"}`
|
|
|
4528
4517
|
}
|
|
4529
4518
|
async init() {
|
|
4530
4519
|
var e, t;
|
|
4531
|
-
this._initialized || (this._initialized = !0, await this._initCanvas(),
|
|
4520
|
+
this._initialized || (this._initialized = !0, await this._initCanvas(), await this._initCore(), await this._initObservables(), await this._initLoader(), await this._initEvents(), (t = (e = this.props).onReady) == null || t.call(e, { module: this, container: this.container }));
|
|
4532
4521
|
}
|
|
4533
4522
|
getCanvas() {
|
|
4534
4523
|
return this._service.canvas;
|
|
@@ -4536,15 +4525,15 @@ ${e instanceof Error ? e.message : "Something went wrong"}`
|
|
|
4536
4525
|
getOffscreenCanvas() {
|
|
4537
4526
|
return this._service.offscreenCanvas;
|
|
4538
4527
|
}
|
|
4539
|
-
|
|
4540
|
-
return this._service.
|
|
4541
|
-
}
|
|
4542
|
-
getWorker() {
|
|
4543
|
-
return this._service.worker;
|
|
4528
|
+
getWorkerThread() {
|
|
4529
|
+
return this._service.workerThread;
|
|
4544
4530
|
}
|
|
4545
4531
|
getWorkerPool() {
|
|
4546
4532
|
return this._service.workerPool;
|
|
4547
4533
|
}
|
|
4534
|
+
getProps() {
|
|
4535
|
+
return this.props;
|
|
4536
|
+
}
|
|
4548
4537
|
isInitialized() {
|
|
4549
4538
|
return this._initialized;
|
|
4550
4539
|
}
|
|
@@ -4553,23 +4542,24 @@ ${e instanceof Error ? e.message : "Something went wrong"}`
|
|
|
4553
4542
|
this._subscriptions.map((t) => t.unsubscribe()), await this._service.workerPool.terminateAll(), ((e = this._service.canvas) == null ? void 0 : e.dataset.reactive) === "true" && (document.body.removeChild(this._service.canvas), this._service.canvas.remove(), this._service.canvas = void 0), this._initialized = !1;
|
|
4554
4543
|
}
|
|
4555
4544
|
};
|
|
4556
|
-
|
|
4557
|
-
|
|
4558
|
-
|
|
4559
|
-
|
|
4560
|
-
|
|
4561
|
-
|
|
4562
|
-
|
|
4563
|
-
|
|
4564
|
-
],
|
|
4565
|
-
const
|
|
4545
|
+
nt = si([
|
|
4546
|
+
ie(oe.ContainerScoped),
|
|
4547
|
+
ne(0, O(Re)),
|
|
4548
|
+
ne(1, O(Je)),
|
|
4549
|
+
ne(2, O(xe)),
|
|
4550
|
+
ne(3, O(Wt)),
|
|
4551
|
+
ne(4, O(Se)),
|
|
4552
|
+
ne(5, O(tt))
|
|
4553
|
+
], nt);
|
|
4554
|
+
const li = (s) => {
|
|
4555
|
+
var n;
|
|
4566
4556
|
if (!(s != null && s.location) || !URL.canParse(s.location))
|
|
4567
4557
|
throw new Error(
|
|
4568
4558
|
"Invalid register props detected. location path is required"
|
|
4569
4559
|
);
|
|
4570
4560
|
const e = Dt.createChildContainer();
|
|
4571
|
-
s.initOnConstruct =
|
|
4572
|
-
const t = e.resolve(
|
|
4561
|
+
s.initOnConstruct = W(s.initOnConstruct) || !te(s.initOnConstruct) ? !0 : s.initOnConstruct, s.defaultCamera = s != null && s.defaultCamera && s.defaultCamera in at ? s.defaultCamera : at.PERSPECTIVE, s.fullScreen = W(s.fullScreen) || !te(s.fullScreen) ? !0 : s.fullScreen, s.autoRenderResize = W(s.autoRenderResize) || !te(s.autoRenderResize) ? !0 : s.autoRenderResize, s.startTimer = W(s.startTimer) || !te(s.startTimer) ? !0 : s.startTimer, s.pixelRatio = W(s.pixelRatio) || !ct(s.pixelRatio) ? Math.min(window.devicePixelRatio, 2) : s.pixelRatio, s.onReady = Sn(s.onReady) ? s.onReady : void 0, s.debug && (s.debug.withMiniCamera = W((n = s.debug) == null ? void 0 : n.withMiniCamera) || !te(s.debug.withMiniCamera) ? !1 : s.debug.withMiniCamera, s.debug.enableControls = W(s.debug.enableControls) || !te(s.debug.enableControls) ? !1 : s.debug.enableControls, s.debug.axesSizes = W(s.debug.axesSizes) || !ct(s.debug.axesSizes) ? void 0 : s.debug.axesSizes), e.register(Wt, { useValue: e }), e.register(Se, { useValue: s });
|
|
4562
|
+
const t = e.resolve(nt);
|
|
4573
4563
|
return {
|
|
4574
4564
|
container: e,
|
|
4575
4565
|
module: t
|
|
@@ -4577,17 +4567,17 @@ const ui = (s) => {
|
|
|
4577
4567
|
};
|
|
4578
4568
|
export {
|
|
4579
4569
|
fi as AppProxyEventHandlersBlueprint,
|
|
4580
|
-
|
|
4581
|
-
|
|
4582
|
-
|
|
4583
|
-
|
|
4584
|
-
|
|
4585
|
-
|
|
4586
|
-
|
|
4587
|
-
|
|
4588
|
-
|
|
4589
|
-
|
|
4590
|
-
|
|
4570
|
+
Wt as CONTAINER_TOKEN,
|
|
4571
|
+
at as DefaultCameraType,
|
|
4572
|
+
wn as KEYBOARD_EVENT_CODES,
|
|
4573
|
+
xn as LOADER_SERIALIZED_LOAD_TOKEN,
|
|
4574
|
+
ci as LaunchAppProps,
|
|
4575
|
+
Ht as PROXY_EVENT_LISTENERS,
|
|
4576
|
+
vn as ProxyEventHandlersBlueprint,
|
|
4577
|
+
pi as ProxyEventObservablesBlueprint,
|
|
4578
|
+
mi as ProxyEventSubjectsBlueprint,
|
|
4579
|
+
nt as RegisterModule,
|
|
4580
|
+
Se as RegisterPropsBlueprint,
|
|
4591
4581
|
Cn as RegisterProxyEventHandlersBlueprint,
|
|
4592
|
-
|
|
4582
|
+
li as register
|
|
4593
4583
|
};
|