@shopware-ag/dive 2.2.16 → 2.2.18

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.
Files changed (47) hide show
  1. package/build/chunks/{AssetCache-PycNkZlv.cjs → AssetCache-BElKTasn.cjs} +1 -1
  2. package/build/chunks/{AssetCache-BkU-YbyI.mjs → AssetCache-DbUJFLZt.mjs} +1 -1
  3. package/build/chunks/AssetLoader-CT_t_ZfO.cjs +4 -0
  4. package/build/chunks/{AssetLoader-2zJQGAPS.mjs → AssetLoader-D5zuGw5p.mjs} +705 -677
  5. package/build/chunks/FileTypes-Bq4uWglF.mjs +2105 -0
  6. package/build/chunks/FileTypes-Vbu3ti7s.cjs +33 -0
  7. package/build/chunks/{SelectTool-CwFPCf-b.cjs → SelectTool-4zYuuCRL.cjs} +1 -1
  8. package/build/chunks/{SelectTool-DujSa1r0.mjs → SelectTool-PaTy0iER.mjs} +1 -1
  9. package/build/dive.cjs +1 -1
  10. package/build/dive.mjs +50 -48
  11. package/build/engine/Dive.d.ts +6 -0
  12. package/build/engine/environment/Environment.d.ts +133 -0
  13. package/build/engine/index.d.ts +1 -0
  14. package/build/engine/renderer/Renderer.d.ts +3 -0
  15. package/build/engine/scene/Scene.d.ts +1 -0
  16. package/build/plugins/ar/index.cjs +1 -1
  17. package/build/plugins/ar/index.mjs +1 -1
  18. package/build/plugins/assetcache/index.cjs +1 -1
  19. package/build/plugins/assetcache/index.mjs +1 -1
  20. package/build/plugins/assetloader/index.cjs +1 -1
  21. package/build/plugins/assetloader/index.mjs +1 -1
  22. package/build/plugins/assetloader/src/loader/AssetLoader.d.ts +8 -1
  23. package/build/plugins/orbitcontroller/index.cjs +1 -1
  24. package/build/plugins/orbitcontroller/index.mjs +1 -1
  25. package/build/plugins/orientationdisplay/index.cjs +1 -1
  26. package/build/plugins/orientationdisplay/index.mjs +1 -1
  27. package/build/plugins/quickview/index.cjs +1 -1
  28. package/build/plugins/quickview/index.mjs +16 -24
  29. package/build/plugins/quickview/src/QuickView.d.ts +1 -3
  30. package/build/plugins/quickview/types/QuickViewSettings.d.ts +0 -5
  31. package/build/plugins/state/index.cjs +1 -1
  32. package/build/plugins/state/index.mjs +2 -2
  33. package/build/plugins/toolbox/index.cjs +1 -1
  34. package/build/plugins/toolbox/index.mjs +2 -2
  35. package/package.json +6 -8
  36. package/build/chunks/AssetLoader-CgeC94PN.cjs +0 -4
  37. package/build/chunks/FileTypes-Bf3Ffk3D.cjs +0 -29
  38. package/build/chunks/FileTypes-Qg_Zc7TF.mjs +0 -1802
  39. package/build/chunks/HDREnvorinment-CP2Uvq4_.cjs +0 -5
  40. package/build/chunks/HDREnvorinment-DKzwfsKr.mjs +0 -257
  41. package/build/plugins/hdr/index.cjs +0 -1
  42. package/build/plugins/hdr/index.d.ts +0 -2
  43. package/build/plugins/hdr/index.mjs +0 -5
  44. package/build/plugins/hdr/src/HDREnvorinment.d.ts +0 -35
  45. package/build/plugins/hdr/src/index.d.ts +0 -1
  46. package/build/plugins/hdr/types/HDREnvironmentSettings.d.ts +0 -44
  47. package/build/plugins/hdr/types/index.d.ts +0 -1
@@ -1,40 +1,40 @@
1
1
  var ve = Object.defineProperty;
2
2
  var Be = (d, e, t) => e in d ? ve(d, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : d[e] = t;
3
3
  var v = (d, e, t) => Be(d, typeof e != "symbol" ? e + "" : e, t);
4
- import { TrianglesDrawMode as je, TriangleFanDrawMode as re, TriangleStripDrawMode as be, Loader as ae, LoaderUtils as X, FileLoader as K, MeshPhysicalMaterial as O, Vector2 as q, Color as U, LinearSRGBColorSpace as D, SRGBColorSpace as N, SpotLight as Ke, PointLight as Ve, DirectionalLight as We, Matrix4 as Y, Vector3 as B, Quaternion as Le, InstancedMesh as Xe, InstancedBufferAttribute as ze, Object3D as ce, TextureLoader as Me, ImageBitmapLoader as qe, BufferAttribute as P, InterleavedBuffer as Ye, InterleavedBufferAttribute as Je, LinearMipmapLinearFilter as Ie, NearestMipmapLinearFilter as Qe, LinearMipmapNearestFilter as Ze, NearestMipmapNearestFilter as $e, LinearFilter as Ce, NearestFilter as et, RepeatWrapping as J, MirroredRepeatWrapping as Ne, ClampToEdgeWrapping as De, PointsMaterial as tt, Material as Z, LineBasicMaterial as nt, MeshStandardMaterial as Oe, DoubleSide as st, MeshBasicMaterial as W, PropertyBinding as rt, BufferGeometry as ue, SkinnedMesh as ot, Mesh as Pe, LineSegments as it, Line as at, LineLoop as ct, Points as ut, Group as z, PerspectiveCamera as lt, MathUtils as ft, OrthographicCamera as dt, Skeleton as ht, AnimationClip as pt, Bone as mt, InterpolateDiscrete as gt, InterpolateLinear as ke, Texture as de, VectorKeyframeTrack as he, NumberKeyframeTrack as pe, QuaternionKeyframeTrack as me, ColorManagement as ge, FrontSide as At, Interpolant as Tt, Box3 as yt, Sphere as xt, NoColorSpace as H } from "three";
5
- import { u as Rt, a as Ae } from "./fflate.module-xyO_T3Zm.mjs";
6
- import { S as _t } from "./FileTypes-Qg_Zc7TF.mjs";
4
+ import { TrianglesDrawMode as je, TriangleFanDrawMode as oe, TriangleStripDrawMode as be, Loader as ce, LoaderUtils as X, FileLoader as K, MeshPhysicalMaterial as O, Vector2 as Y, Color as U, LinearSRGBColorSpace as D, SRGBColorSpace as N, SpotLight as Ke, PointLight as Ve, DirectionalLight as We, Matrix4 as J, Vector3 as B, Quaternion as Le, InstancedMesh as Xe, InstancedBufferAttribute as ze, Object3D as ue, TextureLoader as Me, ImageBitmapLoader as qe, BufferAttribute as P, InterleavedBuffer as Ye, InterleavedBufferAttribute as Je, LinearMipmapLinearFilter as Ie, NearestMipmapLinearFilter as Qe, LinearMipmapNearestFilter as Ze, NearestMipmapNearestFilter as $e, LinearFilter as Ce, NearestFilter as et, RepeatWrapping as Q, MirroredRepeatWrapping as Ne, ClampToEdgeWrapping as De, PointsMaterial as tt, Material as $, LineBasicMaterial as nt, MeshStandardMaterial as Oe, DoubleSide as st, MeshBasicMaterial as W, PropertyBinding as rt, BufferGeometry as le, SkinnedMesh as ot, Mesh as Pe, LineSegments as it, Line as at, LineLoop as ct, Points as ut, Group as z, PerspectiveCamera as lt, MathUtils as ft, OrthographicCamera as dt, Skeleton as ht, AnimationClip as pt, Bone as mt, InterpolateDiscrete as gt, InterpolateLinear as ke, Texture as he, VectorKeyframeTrack as pe, NumberKeyframeTrack as me, QuaternionKeyframeTrack as ge, ColorManagement as Ae, FrontSide as At, Interpolant as Tt, Box3 as yt, Sphere as xt, NoColorSpace as H } from "three";
5
+ import { u as Rt, a as Te } from "./fflate.module-xyO_T3Zm.mjs";
6
+ import { S as _t } from "./FileTypes-Bq4uWglF.mjs";
7
7
  import { g as wt, i as Et } from "./isFileTypeSupported-BSpswPHU.mjs";
8
- import { F as Te, P as ye } from "./parse-error-DfOPyLWM.mjs";
9
- import { A as xe } from "./AssetCache-BkU-YbyI.mjs";
8
+ import { F as ye, P as xe } from "./parse-error-DfOPyLWM.mjs";
9
+ import { A as q } from "./AssetCache-DbUJFLZt.mjs";
10
10
  function Re(d, e) {
11
11
  if (e === je)
12
12
  return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."), d;
13
- if (e === re || e === be) {
13
+ if (e === oe || e === be) {
14
14
  let t = d.getIndex();
15
15
  if (t === null) {
16
- const n = [], a = d.getAttribute("position");
16
+ const s = [], a = d.getAttribute("position");
17
17
  if (a !== void 0) {
18
18
  for (let i = 0; i < a.count; i++)
19
- n.push(i);
20
- d.setIndex(n), t = d.getIndex();
19
+ s.push(i);
20
+ d.setIndex(s), t = d.getIndex();
21
21
  } else
22
22
  return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."), d;
23
23
  }
24
- const o = t.count - 2, s = [];
25
- if (e === re)
26
- for (let n = 1; n <= o; n++)
27
- s.push(t.getX(0)), s.push(t.getX(n)), s.push(t.getX(n + 1));
24
+ const r = t.count - 2, n = [];
25
+ if (e === oe)
26
+ for (let s = 1; s <= r; s++)
27
+ n.push(t.getX(0)), n.push(t.getX(s)), n.push(t.getX(s + 1));
28
28
  else
29
- for (let n = 0; n < o; n++)
30
- n % 2 === 0 ? (s.push(t.getX(n)), s.push(t.getX(n + 1)), s.push(t.getX(n + 2))) : (s.push(t.getX(n + 2)), s.push(t.getX(n + 1)), s.push(t.getX(n)));
31
- s.length / 3 !== o && console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");
32
- const r = d.clone();
33
- return r.setIndex(s), r.clearGroups(), r;
29
+ for (let s = 0; s < r; s++)
30
+ s % 2 === 0 ? (n.push(t.getX(s)), n.push(t.getX(s + 1)), n.push(t.getX(s + 2))) : (n.push(t.getX(s + 2)), n.push(t.getX(s + 1)), n.push(t.getX(s)));
31
+ n.length / 3 !== r && console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");
32
+ const o = d.clone();
33
+ return o.setIndex(n), o.clearGroups(), o;
34
34
  } else
35
35
  return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:", e), d;
36
36
  }
37
- class St extends ae {
37
+ class St extends ce {
38
38
  constructor(e) {
39
39
  super(e), this.dracoLoader = null, this.ktx2Loader = null, this.meshoptDecoder = null, this.pluginCallbacks = [], this.register(function(t) {
40
40
  return new Ct(t);
@@ -70,29 +70,29 @@ class St extends ae {
70
70
  return new Kt(t);
71
71
  });
72
72
  }
73
- load(e, t, o, s) {
74
- const r = this;
75
- let n;
73
+ load(e, t, r, n) {
74
+ const o = this;
75
+ let s;
76
76
  if (this.resourcePath !== "")
77
- n = this.resourcePath;
77
+ s = this.resourcePath;
78
78
  else if (this.path !== "") {
79
79
  const c = X.extractUrlBase(e);
80
- n = X.resolveURL(c, this.path);
80
+ s = X.resolveURL(c, this.path);
81
81
  } else
82
- n = X.extractUrlBase(e);
82
+ s = X.extractUrlBase(e);
83
83
  this.manager.itemStart(e);
84
84
  const a = function(c) {
85
- s ? s(c) : console.error(c), r.manager.itemError(e), r.manager.itemEnd(e);
85
+ n ? n(c) : console.error(c), o.manager.itemError(e), o.manager.itemEnd(e);
86
86
  }, i = new K(this.manager);
87
87
  i.setPath(this.path), i.setResponseType("arraybuffer"), i.setRequestHeader(this.requestHeader), i.setWithCredentials(this.withCredentials), i.load(e, function(c) {
88
88
  try {
89
- r.parse(c, n, function(u) {
90
- t(u), r.manager.itemEnd(e);
89
+ o.parse(c, s, function(u) {
90
+ t(u), o.manager.itemEnd(e);
91
91
  }, a);
92
92
  } catch (u) {
93
93
  a(u);
94
94
  }
95
- }, o, a);
95
+ }, r, a);
96
96
  }
97
97
  setDRACOLoader(e) {
98
98
  return this.dracoLoader = e, this;
@@ -114,29 +114,29 @@ class St extends ae {
114
114
  unregister(e) {
115
115
  return this.pluginCallbacks.indexOf(e) !== -1 && this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e), 1), this;
116
116
  }
117
- parse(e, t, o, s) {
118
- let r;
119
- const n = {}, a = {}, i = new TextDecoder();
117
+ parse(e, t, r, n) {
118
+ let o;
119
+ const s = {}, a = {}, i = new TextDecoder();
120
120
  if (typeof e == "string")
121
- r = JSON.parse(e);
121
+ o = JSON.parse(e);
122
122
  else if (e instanceof ArrayBuffer)
123
123
  if (i.decode(new Uint8Array(e, 0, 4)) === Fe) {
124
124
  try {
125
- n[b.KHR_BINARY_GLTF] = new Vt(e);
125
+ s[b.KHR_BINARY_GLTF] = new Vt(e);
126
126
  } catch (l) {
127
- s && s(l);
127
+ n && n(l);
128
128
  return;
129
129
  }
130
- r = JSON.parse(n[b.KHR_BINARY_GLTF].content);
130
+ o = JSON.parse(s[b.KHR_BINARY_GLTF].content);
131
131
  } else
132
- r = JSON.parse(i.decode(e));
132
+ o = JSON.parse(i.decode(e));
133
133
  else
134
- r = e;
135
- if (r.asset === void 0 || r.asset.version[0] < 2) {
136
- s && s(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));
134
+ o = e;
135
+ if (o.asset === void 0 || o.asset.version[0] < 2) {
136
+ n && n(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));
137
137
  return;
138
138
  }
139
- const c = new sn(r, {
139
+ const c = new sn(o, {
140
140
  path: t || this.resourcePath || "",
141
141
  crossOrigin: this.crossOrigin,
142
142
  requestHeader: this.requestHeader,
@@ -147,34 +147,34 @@ class St extends ae {
147
147
  c.fileLoader.setRequestHeader(this.requestHeader);
148
148
  for (let u = 0; u < this.pluginCallbacks.length; u++) {
149
149
  const l = this.pluginCallbacks[u](c);
150
- l.name || console.error("THREE.GLTFLoader: Invalid plugin found: missing name"), a[l.name] = l, n[l.name] = !0;
150
+ l.name || console.error("THREE.GLTFLoader: Invalid plugin found: missing name"), a[l.name] = l, s[l.name] = !0;
151
151
  }
152
- if (r.extensionsUsed)
153
- for (let u = 0; u < r.extensionsUsed.length; ++u) {
154
- const l = r.extensionsUsed[u], f = r.extensionsRequired || [];
152
+ if (o.extensionsUsed)
153
+ for (let u = 0; u < o.extensionsUsed.length; ++u) {
154
+ const l = o.extensionsUsed[u], f = o.extensionsRequired || [];
155
155
  switch (l) {
156
156
  case b.KHR_MATERIALS_UNLIT:
157
- n[l] = new Mt();
157
+ s[l] = new Mt();
158
158
  break;
159
159
  case b.KHR_DRACO_MESH_COMPRESSION:
160
- n[l] = new Wt(r, this.dracoLoader);
160
+ s[l] = new Wt(o, this.dracoLoader);
161
161
  break;
162
162
  case b.KHR_TEXTURE_TRANSFORM:
163
- n[l] = new Xt();
163
+ s[l] = new Xt();
164
164
  break;
165
165
  case b.KHR_MESH_QUANTIZATION:
166
- n[l] = new zt();
166
+ s[l] = new zt();
167
167
  break;
168
168
  default:
169
169
  f.indexOf(l) >= 0 && a[l] === void 0 && console.warn('THREE.GLTFLoader: Unknown extension "' + l + '".');
170
170
  }
171
171
  }
172
- c.setExtensions(n), c.setPlugins(a), c.parse(o, s);
172
+ c.setExtensions(s), c.setPlugins(a), c.parse(r, n);
173
173
  }
174
174
  parseAsync(e, t) {
175
- const o = this;
176
- return new Promise(function(s, r) {
177
- o.parse(e, t, s, r);
175
+ const r = this;
176
+ return new Promise(function(n, o) {
177
+ r.parse(e, t, n, o);
178
178
  });
179
179
  }
180
180
  }
@@ -224,16 +224,16 @@ class Lt {
224
224
  }
225
225
  _markDefs() {
226
226
  const e = this.parser, t = this.parser.json.nodes || [];
227
- for (let o = 0, s = t.length; o < s; o++) {
228
- const r = t[o];
229
- r.extensions && r.extensions[this.name] && r.extensions[this.name].light !== void 0 && e._addNodeRef(this.cache, r.extensions[this.name].light);
227
+ for (let r = 0, n = t.length; r < n; r++) {
228
+ const o = t[r];
229
+ o.extensions && o.extensions[this.name] && o.extensions[this.name].light !== void 0 && e._addNodeRef(this.cache, o.extensions[this.name].light);
230
230
  }
231
231
  }
232
232
  _loadLight(e) {
233
- const t = this.parser, o = "light:" + e;
234
- let s = t.cache.get(o);
235
- if (s) return s;
236
- const r = t.json, i = ((r.extensions && r.extensions[this.name] || {}).lights || [])[e];
233
+ const t = this.parser, r = "light:" + e;
234
+ let n = t.cache.get(r);
235
+ if (n) return n;
236
+ const o = t.json, i = ((o.extensions && o.extensions[this.name] || {}).lights || [])[e];
237
237
  let c;
238
238
  const u = new U(16777215);
239
239
  i.color !== void 0 && u.setRGB(i.color[0], i.color[1], i.color[2], D);
@@ -251,16 +251,16 @@ class Lt {
251
251
  default:
252
252
  throw new Error("THREE.GLTFLoader: Unexpected light type: " + i.type);
253
253
  }
254
- return c.position.set(0, 0, 0), c.decay = 2, F(c, i), i.intensity !== void 0 && (c.intensity = i.intensity), c.name = t.createUniqueName(i.name || "light_" + e), s = Promise.resolve(c), t.cache.add(o, s), s;
254
+ return c.position.set(0, 0, 0), c.decay = 2, F(c, i), i.intensity !== void 0 && (c.intensity = i.intensity), c.name = t.createUniqueName(i.name || "light_" + e), n = Promise.resolve(c), t.cache.add(r, n), n;
255
255
  }
256
256
  getDependency(e, t) {
257
257
  if (e === "light")
258
258
  return this._loadLight(t);
259
259
  }
260
260
  createNodeAttachment(e) {
261
- const t = this, o = this.parser, r = o.json.nodes[e], a = (r.extensions && r.extensions[this.name] || {}).light;
261
+ const t = this, r = this.parser, o = r.json.nodes[e], a = (o.extensions && o.extensions[this.name] || {}).light;
262
262
  return a === void 0 ? null : this._loadLight(a).then(function(i) {
263
- return o._getNodeRef(t.cache, a, i);
263
+ return r._getNodeRef(t.cache, a, i);
264
264
  });
265
265
  }
266
266
  }
@@ -271,18 +271,18 @@ class Mt {
271
271
  getMaterialType() {
272
272
  return W;
273
273
  }
274
- extendParams(e, t, o) {
275
- const s = [];
274
+ extendParams(e, t, r) {
275
+ const n = [];
276
276
  e.color = new U(1, 1, 1), e.opacity = 1;
277
- const r = t.pbrMetallicRoughness;
278
- if (r) {
279
- if (Array.isArray(r.baseColorFactor)) {
280
- const n = r.baseColorFactor;
281
- e.color.setRGB(n[0], n[1], n[2], D), e.opacity = n[3];
277
+ const o = t.pbrMetallicRoughness;
278
+ if (o) {
279
+ if (Array.isArray(o.baseColorFactor)) {
280
+ const s = o.baseColorFactor;
281
+ e.color.setRGB(s[0], s[1], s[2], D), e.opacity = s[3];
282
282
  }
283
- r.baseColorTexture !== void 0 && s.push(o.assignTexture(e, "map", r.baseColorTexture, N));
283
+ o.baseColorTexture !== void 0 && n.push(r.assignTexture(e, "map", o.baseColorTexture, N));
284
284
  }
285
- return Promise.all(s);
285
+ return Promise.all(n);
286
286
  }
287
287
  }
288
288
  class It {
@@ -290,11 +290,11 @@ class It {
290
290
  this.parser = e, this.name = b.KHR_MATERIALS_EMISSIVE_STRENGTH;
291
291
  }
292
292
  extendMaterialParams(e, t) {
293
- const s = this.parser.json.materials[e];
294
- if (!s.extensions || !s.extensions[this.name])
293
+ const n = this.parser.json.materials[e];
294
+ if (!n.extensions || !n.extensions[this.name])
295
295
  return Promise.resolve();
296
- const r = s.extensions[this.name].emissiveStrength;
297
- return r !== void 0 && (t.emissiveIntensity = r), Promise.resolve();
296
+ const o = n.extensions[this.name].emissiveStrength;
297
+ return o !== void 0 && (t.emissiveIntensity = o), Promise.resolve();
298
298
  }
299
299
  }
300
300
  class Ct {
@@ -302,19 +302,19 @@ class Ct {
302
302
  this.parser = e, this.name = b.KHR_MATERIALS_CLEARCOAT;
303
303
  }
304
304
  getMaterialType(e) {
305
- const o = this.parser.json.materials[e];
306
- return !o.extensions || !o.extensions[this.name] ? null : O;
305
+ const r = this.parser.json.materials[e];
306
+ return !r.extensions || !r.extensions[this.name] ? null : O;
307
307
  }
308
308
  extendMaterialParams(e, t) {
309
- const o = this.parser, s = o.json.materials[e];
310
- if (!s.extensions || !s.extensions[this.name])
309
+ const r = this.parser, n = r.json.materials[e];
310
+ if (!n.extensions || !n.extensions[this.name])
311
311
  return Promise.resolve();
312
- const r = [], n = s.extensions[this.name];
313
- if (n.clearcoatFactor !== void 0 && (t.clearcoat = n.clearcoatFactor), n.clearcoatTexture !== void 0 && r.push(o.assignTexture(t, "clearcoatMap", n.clearcoatTexture)), n.clearcoatRoughnessFactor !== void 0 && (t.clearcoatRoughness = n.clearcoatRoughnessFactor), n.clearcoatRoughnessTexture !== void 0 && r.push(o.assignTexture(t, "clearcoatRoughnessMap", n.clearcoatRoughnessTexture)), n.clearcoatNormalTexture !== void 0 && (r.push(o.assignTexture(t, "clearcoatNormalMap", n.clearcoatNormalTexture)), n.clearcoatNormalTexture.scale !== void 0)) {
314
- const a = n.clearcoatNormalTexture.scale;
315
- t.clearcoatNormalScale = new q(a, a);
312
+ const o = [], s = n.extensions[this.name];
313
+ if (s.clearcoatFactor !== void 0 && (t.clearcoat = s.clearcoatFactor), s.clearcoatTexture !== void 0 && o.push(r.assignTexture(t, "clearcoatMap", s.clearcoatTexture)), s.clearcoatRoughnessFactor !== void 0 && (t.clearcoatRoughness = s.clearcoatRoughnessFactor), s.clearcoatRoughnessTexture !== void 0 && o.push(r.assignTexture(t, "clearcoatRoughnessMap", s.clearcoatRoughnessTexture)), s.clearcoatNormalTexture !== void 0 && (o.push(r.assignTexture(t, "clearcoatNormalMap", s.clearcoatNormalTexture)), s.clearcoatNormalTexture.scale !== void 0)) {
314
+ const a = s.clearcoatNormalTexture.scale;
315
+ t.clearcoatNormalScale = new Y(a, a);
316
316
  }
317
- return Promise.all(r);
317
+ return Promise.all(o);
318
318
  }
319
319
  }
320
320
  class Nt {
@@ -322,15 +322,15 @@ class Nt {
322
322
  this.parser = e, this.name = b.KHR_MATERIALS_IRIDESCENCE;
323
323
  }
324
324
  getMaterialType(e) {
325
- const o = this.parser.json.materials[e];
326
- return !o.extensions || !o.extensions[this.name] ? null : O;
325
+ const r = this.parser.json.materials[e];
326
+ return !r.extensions || !r.extensions[this.name] ? null : O;
327
327
  }
328
328
  extendMaterialParams(e, t) {
329
- const o = this.parser, s = o.json.materials[e];
330
- if (!s.extensions || !s.extensions[this.name])
329
+ const r = this.parser, n = r.json.materials[e];
330
+ if (!n.extensions || !n.extensions[this.name])
331
331
  return Promise.resolve();
332
- const r = [], n = s.extensions[this.name];
333
- return n.iridescenceFactor !== void 0 && (t.iridescence = n.iridescenceFactor), n.iridescenceTexture !== void 0 && r.push(o.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(o.assignTexture(t, "iridescenceThicknessMap", n.iridescenceThicknessTexture)), Promise.all(r);
332
+ const o = [], s = n.extensions[this.name];
333
+ return s.iridescenceFactor !== void 0 && (t.iridescence = s.iridescenceFactor), s.iridescenceTexture !== void 0 && o.push(r.assignTexture(t, "iridescenceMap", s.iridescenceTexture)), s.iridescenceIor !== void 0 && (t.iridescenceIOR = s.iridescenceIor), t.iridescenceThicknessRange === void 0 && (t.iridescenceThicknessRange = [100, 400]), s.iridescenceThicknessMinimum !== void 0 && (t.iridescenceThicknessRange[0] = s.iridescenceThicknessMinimum), s.iridescenceThicknessMaximum !== void 0 && (t.iridescenceThicknessRange[1] = s.iridescenceThicknessMaximum), s.iridescenceThicknessTexture !== void 0 && o.push(r.assignTexture(t, "iridescenceThicknessMap", s.iridescenceThicknessTexture)), Promise.all(o);
334
334
  }
335
335
  }
336
336
  class Dt {
@@ -338,21 +338,21 @@ class Dt {
338
338
  this.parser = e, this.name = b.KHR_MATERIALS_SHEEN;
339
339
  }
340
340
  getMaterialType(e) {
341
- const o = this.parser.json.materials[e];
342
- return !o.extensions || !o.extensions[this.name] ? null : O;
341
+ const r = this.parser.json.materials[e];
342
+ return !r.extensions || !r.extensions[this.name] ? null : O;
343
343
  }
344
344
  extendMaterialParams(e, t) {
345
- const o = this.parser, s = o.json.materials[e];
346
- if (!s.extensions || !s.extensions[this.name])
345
+ const r = this.parser, n = r.json.materials[e];
346
+ if (!n.extensions || !n.extensions[this.name])
347
347
  return Promise.resolve();
348
- const r = [];
348
+ const o = [];
349
349
  t.sheenColor = new U(0, 0, 0), t.sheenRoughness = 0, t.sheen = 1;
350
- const n = s.extensions[this.name];
351
- if (n.sheenColorFactor !== void 0) {
352
- const a = n.sheenColorFactor;
350
+ const s = n.extensions[this.name];
351
+ if (s.sheenColorFactor !== void 0) {
352
+ const a = s.sheenColorFactor;
353
353
  t.sheenColor.setRGB(a[0], a[1], a[2], D);
354
354
  }
355
- return n.sheenRoughnessFactor !== void 0 && (t.sheenRoughness = n.sheenRoughnessFactor), n.sheenColorTexture !== void 0 && r.push(o.assignTexture(t, "sheenColorMap", n.sheenColorTexture, N)), n.sheenRoughnessTexture !== void 0 && r.push(o.assignTexture(t, "sheenRoughnessMap", n.sheenRoughnessTexture)), Promise.all(r);
355
+ return s.sheenRoughnessFactor !== void 0 && (t.sheenRoughness = s.sheenRoughnessFactor), s.sheenColorTexture !== void 0 && o.push(r.assignTexture(t, "sheenColorMap", s.sheenColorTexture, N)), s.sheenRoughnessTexture !== void 0 && o.push(r.assignTexture(t, "sheenRoughnessMap", s.sheenRoughnessTexture)), Promise.all(o);
356
356
  }
357
357
  }
358
358
  class Ot {
@@ -360,15 +360,15 @@ class Ot {
360
360
  this.parser = e, this.name = b.KHR_MATERIALS_TRANSMISSION;
361
361
  }
362
362
  getMaterialType(e) {
363
- const o = this.parser.json.materials[e];
364
- return !o.extensions || !o.extensions[this.name] ? null : O;
363
+ const r = this.parser.json.materials[e];
364
+ return !r.extensions || !r.extensions[this.name] ? null : O;
365
365
  }
366
366
  extendMaterialParams(e, t) {
367
- const o = this.parser, s = o.json.materials[e];
368
- if (!s.extensions || !s.extensions[this.name])
367
+ const r = this.parser, n = r.json.materials[e];
368
+ if (!n.extensions || !n.extensions[this.name])
369
369
  return Promise.resolve();
370
- const r = [], n = s.extensions[this.name];
371
- return n.transmissionFactor !== void 0 && (t.transmission = n.transmissionFactor), n.transmissionTexture !== void 0 && r.push(o.assignTexture(t, "transmissionMap", n.transmissionTexture)), Promise.all(r);
370
+ const o = [], s = n.extensions[this.name];
371
+ return s.transmissionFactor !== void 0 && (t.transmission = s.transmissionFactor), s.transmissionTexture !== void 0 && o.push(r.assignTexture(t, "transmissionMap", s.transmissionTexture)), Promise.all(o);
372
372
  }
373
373
  }
374
374
  class Pt {
@@ -376,17 +376,17 @@ class Pt {
376
376
  this.parser = e, this.name = b.KHR_MATERIALS_VOLUME;
377
377
  }
378
378
  getMaterialType(e) {
379
- const o = this.parser.json.materials[e];
380
- return !o.extensions || !o.extensions[this.name] ? null : O;
379
+ const r = this.parser.json.materials[e];
380
+ return !r.extensions || !r.extensions[this.name] ? null : O;
381
381
  }
382
382
  extendMaterialParams(e, t) {
383
- const o = this.parser, s = o.json.materials[e];
384
- if (!s.extensions || !s.extensions[this.name])
383
+ const r = this.parser, n = r.json.materials[e];
384
+ if (!n.extensions || !n.extensions[this.name])
385
385
  return Promise.resolve();
386
- const r = [], n = s.extensions[this.name];
387
- t.thickness = n.thicknessFactor !== void 0 ? n.thicknessFactor : 0, n.thicknessTexture !== void 0 && r.push(o.assignTexture(t, "thicknessMap", n.thicknessTexture)), t.attenuationDistance = n.attenuationDistance || 1 / 0;
388
- const a = n.attenuationColor || [1, 1, 1];
389
- return t.attenuationColor = new U().setRGB(a[0], a[1], a[2], D), Promise.all(r);
386
+ const o = [], s = n.extensions[this.name];
387
+ t.thickness = s.thicknessFactor !== void 0 ? s.thicknessFactor : 0, s.thicknessTexture !== void 0 && o.push(r.assignTexture(t, "thicknessMap", s.thicknessTexture)), t.attenuationDistance = s.attenuationDistance || 1 / 0;
388
+ const a = s.attenuationColor || [1, 1, 1];
389
+ return t.attenuationColor = new U().setRGB(a[0], a[1], a[2], D), Promise.all(o);
390
390
  }
391
391
  }
392
392
  class kt {
@@ -394,15 +394,15 @@ class kt {
394
394
  this.parser = e, this.name = b.KHR_MATERIALS_IOR;
395
395
  }
396
396
  getMaterialType(e) {
397
- const o = this.parser.json.materials[e];
398
- return !o.extensions || !o.extensions[this.name] ? null : O;
397
+ const r = this.parser.json.materials[e];
398
+ return !r.extensions || !r.extensions[this.name] ? null : O;
399
399
  }
400
400
  extendMaterialParams(e, t) {
401
- const s = this.parser.json.materials[e];
402
- if (!s.extensions || !s.extensions[this.name])
401
+ const n = this.parser.json.materials[e];
402
+ if (!n.extensions || !n.extensions[this.name])
403
403
  return Promise.resolve();
404
- const r = s.extensions[this.name];
405
- return t.ior = r.ior !== void 0 ? r.ior : 1.5, Promise.resolve();
404
+ const o = n.extensions[this.name];
405
+ return t.ior = o.ior !== void 0 ? o.ior : 1.5, Promise.resolve();
406
406
  }
407
407
  }
408
408
  class Ft {
@@ -410,17 +410,17 @@ class Ft {
410
410
  this.parser = e, this.name = b.KHR_MATERIALS_SPECULAR;
411
411
  }
412
412
  getMaterialType(e) {
413
- const o = this.parser.json.materials[e];
414
- return !o.extensions || !o.extensions[this.name] ? null : O;
413
+ const r = this.parser.json.materials[e];
414
+ return !r.extensions || !r.extensions[this.name] ? null : O;
415
415
  }
416
416
  extendMaterialParams(e, t) {
417
- const o = this.parser, s = o.json.materials[e];
418
- if (!s.extensions || !s.extensions[this.name])
417
+ const r = this.parser, n = r.json.materials[e];
418
+ if (!n.extensions || !n.extensions[this.name])
419
419
  return Promise.resolve();
420
- const r = [], n = s.extensions[this.name];
421
- t.specularIntensity = n.specularFactor !== void 0 ? n.specularFactor : 1, n.specularTexture !== void 0 && r.push(o.assignTexture(t, "specularIntensityMap", n.specularTexture));
422
- const a = n.specularColorFactor || [1, 1, 1];
423
- return t.specularColor = new U().setRGB(a[0], a[1], a[2], D), n.specularColorTexture !== void 0 && r.push(o.assignTexture(t, "specularColorMap", n.specularColorTexture, N)), Promise.all(r);
420
+ const o = [], s = n.extensions[this.name];
421
+ t.specularIntensity = s.specularFactor !== void 0 ? s.specularFactor : 1, s.specularTexture !== void 0 && o.push(r.assignTexture(t, "specularIntensityMap", s.specularTexture));
422
+ const a = s.specularColorFactor || [1, 1, 1];
423
+ return t.specularColor = new U().setRGB(a[0], a[1], a[2], D), s.specularColorTexture !== void 0 && o.push(r.assignTexture(t, "specularColorMap", s.specularColorTexture, N)), Promise.all(o);
424
424
  }
425
425
  }
426
426
  class Ut {
@@ -428,15 +428,15 @@ class Ut {
428
428
  this.parser = e, this.name = b.EXT_MATERIALS_BUMP;
429
429
  }
430
430
  getMaterialType(e) {
431
- const o = this.parser.json.materials[e];
432
- return !o.extensions || !o.extensions[this.name] ? null : O;
431
+ const r = this.parser.json.materials[e];
432
+ return !r.extensions || !r.extensions[this.name] ? null : O;
433
433
  }
434
434
  extendMaterialParams(e, t) {
435
- const o = this.parser, s = o.json.materials[e];
436
- if (!s.extensions || !s.extensions[this.name])
435
+ const r = this.parser, n = r.json.materials[e];
436
+ if (!n.extensions || !n.extensions[this.name])
437
437
  return Promise.resolve();
438
- const r = [], n = s.extensions[this.name];
439
- return t.bumpScale = n.bumpFactor !== void 0 ? n.bumpFactor : 1, n.bumpTexture !== void 0 && r.push(o.assignTexture(t, "bumpMap", n.bumpTexture)), Promise.all(r);
438
+ const o = [], s = n.extensions[this.name];
439
+ return t.bumpScale = s.bumpFactor !== void 0 ? s.bumpFactor : 1, s.bumpTexture !== void 0 && o.push(r.assignTexture(t, "bumpMap", s.bumpTexture)), Promise.all(o);
440
440
  }
441
441
  }
442
442
  class Ht {
@@ -444,15 +444,15 @@ class Ht {
444
444
  this.parser = e, this.name = b.KHR_MATERIALS_ANISOTROPY;
445
445
  }
446
446
  getMaterialType(e) {
447
- const o = this.parser.json.materials[e];
448
- return !o.extensions || !o.extensions[this.name] ? null : O;
447
+ const r = this.parser.json.materials[e];
448
+ return !r.extensions || !r.extensions[this.name] ? null : O;
449
449
  }
450
450
  extendMaterialParams(e, t) {
451
- const o = this.parser, s = o.json.materials[e];
452
- if (!s.extensions || !s.extensions[this.name])
451
+ const r = this.parser, n = r.json.materials[e];
452
+ if (!n.extensions || !n.extensions[this.name])
453
453
  return Promise.resolve();
454
- const r = [], n = s.extensions[this.name];
455
- return n.anisotropyStrength !== void 0 && (t.anisotropy = n.anisotropyStrength), n.anisotropyRotation !== void 0 && (t.anisotropyRotation = n.anisotropyRotation), n.anisotropyTexture !== void 0 && r.push(o.assignTexture(t, "anisotropyMap", n.anisotropyTexture)), Promise.all(r);
454
+ const o = [], s = n.extensions[this.name];
455
+ return s.anisotropyStrength !== void 0 && (t.anisotropy = s.anisotropyStrength), s.anisotropyRotation !== void 0 && (t.anisotropyRotation = s.anisotropyRotation), s.anisotropyTexture !== void 0 && o.push(r.assignTexture(t, "anisotropyMap", s.anisotropyTexture)), Promise.all(o);
456
456
  }
457
457
  }
458
458
  class Gt {
@@ -460,16 +460,16 @@ class Gt {
460
460
  this.parser = e, this.name = b.KHR_TEXTURE_BASISU;
461
461
  }
462
462
  loadTexture(e) {
463
- const t = this.parser, o = t.json, s = o.textures[e];
464
- if (!s.extensions || !s.extensions[this.name])
463
+ const t = this.parser, r = t.json, n = r.textures[e];
464
+ if (!n.extensions || !n.extensions[this.name])
465
465
  return null;
466
- const r = s.extensions[this.name], n = t.options.ktx2Loader;
467
- if (!n) {
468
- if (o.extensionsRequired && o.extensionsRequired.indexOf(this.name) >= 0)
466
+ const o = n.extensions[this.name], s = t.options.ktx2Loader;
467
+ if (!s) {
468
+ if (r.extensionsRequired && r.extensionsRequired.indexOf(this.name) >= 0)
469
469
  throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");
470
470
  return null;
471
471
  }
472
- return t.loadTextureImage(e, r.source, n);
472
+ return t.loadTextureImage(e, o.source, s);
473
473
  }
474
474
  }
475
475
  class vt {
@@ -477,20 +477,20 @@ class vt {
477
477
  this.parser = e, this.name = b.EXT_TEXTURE_WEBP, this.isSupported = null;
478
478
  }
479
479
  loadTexture(e) {
480
- const t = this.name, o = this.parser, s = o.json, r = s.textures[e];
481
- if (!r.extensions || !r.extensions[t])
480
+ const t = this.name, r = this.parser, n = r.json, o = n.textures[e];
481
+ if (!o.extensions || !o.extensions[t])
482
482
  return null;
483
- const n = r.extensions[t], a = s.images[n.source];
484
- let i = o.textureLoader;
483
+ const s = o.extensions[t], a = n.images[s.source];
484
+ let i = r.textureLoader;
485
485
  if (a.uri) {
486
- const c = o.options.manager.getHandler(a.uri);
486
+ const c = r.options.manager.getHandler(a.uri);
487
487
  c !== null && (i = c);
488
488
  }
489
489
  return this.detectSupport().then(function(c) {
490
- if (c) return o.loadTextureImage(e, n.source, i);
491
- if (s.extensionsRequired && s.extensionsRequired.indexOf(t) >= 0)
490
+ if (c) return r.loadTextureImage(e, s.source, i);
491
+ if (n.extensionsRequired && n.extensionsRequired.indexOf(t) >= 0)
492
492
  throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");
493
- return o.loadTexture(e);
493
+ return r.loadTexture(e);
494
494
  });
495
495
  }
496
496
  detectSupport() {
@@ -507,20 +507,20 @@ class Bt {
507
507
  this.parser = e, this.name = b.EXT_TEXTURE_AVIF, this.isSupported = null;
508
508
  }
509
509
  loadTexture(e) {
510
- const t = this.name, o = this.parser, s = o.json, r = s.textures[e];
511
- if (!r.extensions || !r.extensions[t])
510
+ const t = this.name, r = this.parser, n = r.json, o = n.textures[e];
511
+ if (!o.extensions || !o.extensions[t])
512
512
  return null;
513
- const n = r.extensions[t], a = s.images[n.source];
514
- let i = o.textureLoader;
513
+ const s = o.extensions[t], a = n.images[s.source];
514
+ let i = r.textureLoader;
515
515
  if (a.uri) {
516
- const c = o.options.manager.getHandler(a.uri);
516
+ const c = r.options.manager.getHandler(a.uri);
517
517
  c !== null && (i = c);
518
518
  }
519
519
  return this.detectSupport().then(function(c) {
520
- if (c) return o.loadTextureImage(e, n.source, i);
521
- if (s.extensionsRequired && s.extensionsRequired.indexOf(t) >= 0)
520
+ if (c) return r.loadTextureImage(e, s.source, i);
521
+ if (n.extensionsRequired && n.extensionsRequired.indexOf(t) >= 0)
522
522
  throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");
523
- return o.loadTexture(e);
523
+ return r.loadTexture(e);
524
524
  });
525
525
  }
526
526
  detectSupport() {
@@ -537,21 +537,21 @@ class jt {
537
537
  this.name = b.EXT_MESHOPT_COMPRESSION, this.parser = e;
538
538
  }
539
539
  loadBufferView(e) {
540
- const t = this.parser.json, o = t.bufferViews[e];
541
- if (o.extensions && o.extensions[this.name]) {
542
- const s = o.extensions[this.name], r = this.parser.getDependency("buffer", s.buffer), n = this.parser.options.meshoptDecoder;
543
- if (!n || !n.supported) {
540
+ const t = this.parser.json, r = t.bufferViews[e];
541
+ if (r.extensions && r.extensions[this.name]) {
542
+ const n = r.extensions[this.name], o = this.parser.getDependency("buffer", n.buffer), s = this.parser.options.meshoptDecoder;
543
+ if (!s || !s.supported) {
544
544
  if (t.extensionsRequired && t.extensionsRequired.indexOf(this.name) >= 0)
545
545
  throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");
546
546
  return null;
547
547
  }
548
- return r.then(function(a) {
549
- const i = s.byteOffset || 0, c = s.byteLength || 0, u = s.count, l = s.byteStride, f = new Uint8Array(a, i, c);
550
- return n.decodeGltfBufferAsync ? n.decodeGltfBufferAsync(u, l, f, s.mode, s.filter).then(function(m) {
548
+ return o.then(function(a) {
549
+ const i = n.byteOffset || 0, c = n.byteLength || 0, u = n.count, l = n.byteStride, f = new Uint8Array(a, i, c);
550
+ return s.decodeGltfBufferAsync ? s.decodeGltfBufferAsync(u, l, f, n.mode, n.filter).then(function(m) {
551
551
  return m.buffer;
552
- }) : n.ready.then(function() {
552
+ }) : s.ready.then(function() {
553
553
  const m = new ArrayBuffer(u * l);
554
- return n.decodeGltfBuffer(new Uint8Array(m), u, l, f, s.mode, s.filter), m;
554
+ return s.decodeGltfBuffer(new Uint8Array(m), u, l, f, n.mode, n.filter), m;
555
555
  });
556
556
  });
557
557
  } else
@@ -563,20 +563,20 @@ class Kt {
563
563
  this.name = b.EXT_MESH_GPU_INSTANCING, this.parser = e;
564
564
  }
565
565
  createNodeMesh(e) {
566
- const t = this.parser.json, o = t.nodes[e];
567
- if (!o.extensions || !o.extensions[this.name] || o.mesh === void 0)
566
+ const t = this.parser.json, r = t.nodes[e];
567
+ if (!r.extensions || !r.extensions[this.name] || r.mesh === void 0)
568
568
  return null;
569
- const s = t.meshes[o.mesh];
570
- for (const c of s.primitives)
569
+ const n = t.meshes[r.mesh];
570
+ for (const c of n.primitives)
571
571
  if (c.mode !== C.TRIANGLES && c.mode !== C.TRIANGLE_STRIP && c.mode !== C.TRIANGLE_FAN && c.mode !== void 0)
572
572
  return null;
573
- const n = o.extensions[this.name].attributes, a = [], i = {};
574
- for (const c in n)
575
- a.push(this.parser.getDependency("accessor", n[c]).then((u) => (i[c] = u, i[c])));
573
+ const s = r.extensions[this.name].attributes, a = [], i = {};
574
+ for (const c in s)
575
+ a.push(this.parser.getDependency("accessor", s[c]).then((u) => (i[c] = u, i[c])));
576
576
  return a.length < 1 ? null : (a.push(this.parser.createNodeMesh(e)), Promise.all(a).then((c) => {
577
577
  const u = c.pop(), l = u.isGroup ? u.children : [u], f = c[0].count, m = [];
578
578
  for (const T of l) {
579
- const R = new Y(), y = new B(), x = new Le(), E = new B(1, 1, 1), S = new Xe(T.geometry, T.material, f);
579
+ const R = new J(), y = new B(), x = new Le(), E = new B(1, 1, 1), S = new Xe(T.geometry, T.material, f);
580
580
  for (let _ = 0; _ < f; _++)
581
581
  i.TRANSLATION && y.fromBufferAttribute(i.TRANSLATION, _), i.ROTATION && x.fromBufferAttribute(i.ROTATION, _), i.SCALE && E.fromBufferAttribute(i.SCALE, _), S.setMatrixAt(_, R.compose(y, x, E));
582
582
  for (const _ in i)
@@ -584,7 +584,7 @@ class Kt {
584
584
  const M = i[_];
585
585
  S.instanceColor = new ze(M.array, M.itemSize, M.normalized);
586
586
  } else _ !== "TRANSLATION" && _ !== "ROTATION" && _ !== "SCALE" && T.geometry.setAttribute(_, i[_]);
587
- ce.prototype.copy.call(S, T), this.parser.assignFinalMaterial(S), m.push(S);
587
+ ue.prototype.copy.call(S, T), this.parser.assignFinalMaterial(S), m.push(S);
588
588
  }
589
589
  return u.isGroup ? (u.clear(), u.add(...m), u) : m[0];
590
590
  }));
@@ -594,29 +594,29 @@ const Fe = "glTF", V = 12, _e = { JSON: 1313821514, BIN: 5130562 };
594
594
  class Vt {
595
595
  constructor(e) {
596
596
  this.name = b.KHR_BINARY_GLTF, this.content = null, this.body = null;
597
- const t = new DataView(e, 0, V), o = new TextDecoder();
597
+ const t = new DataView(e, 0, V), r = new TextDecoder();
598
598
  if (this.header = {
599
- magic: o.decode(new Uint8Array(e.slice(0, 4))),
599
+ magic: r.decode(new Uint8Array(e.slice(0, 4))),
600
600
  version: t.getUint32(4, !0),
601
601
  length: t.getUint32(8, !0)
602
602
  }, this.header.magic !== Fe)
603
603
  throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");
604
604
  if (this.header.version < 2)
605
605
  throw new Error("THREE.GLTFLoader: Legacy binary file detected.");
606
- const s = this.header.length - V, r = new DataView(e, V);
607
- let n = 0;
608
- for (; n < s; ) {
609
- const a = r.getUint32(n, !0);
610
- n += 4;
611
- const i = r.getUint32(n, !0);
612
- if (n += 4, i === _e.JSON) {
613
- const c = new Uint8Array(e, V + n, a);
614
- this.content = o.decode(c);
606
+ const n = this.header.length - V, o = new DataView(e, V);
607
+ let s = 0;
608
+ for (; s < n; ) {
609
+ const a = o.getUint32(s, !0);
610
+ s += 4;
611
+ const i = o.getUint32(s, !0);
612
+ if (s += 4, i === _e.JSON) {
613
+ const c = new Uint8Array(e, V + s, a);
614
+ this.content = r.decode(c);
615
615
  } else if (i === _e.BIN) {
616
- const c = V + n;
616
+ const c = V + s;
617
617
  this.body = e.slice(c, c + a);
618
618
  }
619
- n += a;
619
+ s += a;
620
620
  }
621
621
  if (this.content === null)
622
622
  throw new Error("THREE.GLTFLoader: JSON content not found.");
@@ -629,21 +629,21 @@ class Wt {
629
629
  this.name = b.KHR_DRACO_MESH_COMPRESSION, this.json = e, this.dracoLoader = t, this.dracoLoader.preload();
630
630
  }
631
631
  decodePrimitive(e, t) {
632
- const o = this.json, s = this.dracoLoader, r = e.extensions[this.name].bufferView, n = e.extensions[this.name].attributes, a = {}, i = {}, c = {};
633
- for (const u in n) {
634
- const l = oe[u] || u.toLowerCase();
635
- a[l] = n[u];
632
+ const r = this.json, n = this.dracoLoader, o = e.extensions[this.name].bufferView, s = e.extensions[this.name].attributes, a = {}, i = {}, c = {};
633
+ for (const u in s) {
634
+ const l = ie[u] || u.toLowerCase();
635
+ a[l] = s[u];
636
636
  }
637
637
  for (const u in e.attributes) {
638
- const l = oe[u] || u.toLowerCase();
639
- if (n[u] !== void 0) {
640
- const f = o.accessors[e.attributes[u]], m = j[f.componentType];
638
+ const l = ie[u] || u.toLowerCase();
639
+ if (s[u] !== void 0) {
640
+ const f = r.accessors[e.attributes[u]], m = j[f.componentType];
641
641
  c[l] = m.name, i[l] = f.normalized === !0;
642
642
  }
643
643
  }
644
- return t.getDependency("bufferView", r).then(function(u) {
644
+ return t.getDependency("bufferView", o).then(function(u) {
645
645
  return new Promise(function(l, f) {
646
- s.decodeDracoFile(u, function(m) {
646
+ n.decodeDracoFile(u, function(m) {
647
647
  for (const T in m.attributes) {
648
648
  const R = m.attributes[T], y = i[T];
649
649
  y !== void 0 && (R.normalized = y);
@@ -668,29 +668,29 @@ class zt {
668
668
  }
669
669
  }
670
670
  class Ue extends Tt {
671
- constructor(e, t, o, s) {
672
- super(e, t, o, s);
671
+ constructor(e, t, r, n) {
672
+ super(e, t, r, n);
673
673
  }
674
674
  copySampleValue_(e) {
675
- const t = this.resultBuffer, o = this.sampleValues, s = this.valueSize, r = e * s * 3 + s;
676
- for (let n = 0; n !== s; n++)
677
- t[n] = o[r + n];
675
+ const t = this.resultBuffer, r = this.sampleValues, n = this.valueSize, o = e * n * 3 + n;
676
+ for (let s = 0; s !== n; s++)
677
+ t[s] = r[o + s];
678
678
  return t;
679
679
  }
680
- interpolate_(e, t, o, s) {
681
- const r = this.resultBuffer, n = this.sampleValues, a = this.valueSize, i = a * 2, c = a * 3, u = s - t, l = (o - t) / u, f = l * l, m = f * l, T = e * c, R = T - c, y = -2 * m + 3 * f, x = m - f, E = 1 - y, S = x - f + l;
680
+ interpolate_(e, t, r, n) {
681
+ const o = this.resultBuffer, s = this.sampleValues, a = this.valueSize, i = a * 2, c = a * 3, u = n - t, l = (r - t) / u, f = l * l, m = f * l, T = e * c, R = T - c, y = -2 * m + 3 * f, x = m - f, E = 1 - y, S = x - f + l;
682
682
  for (let _ = 0; _ !== a; _++) {
683
- const M = n[R + _ + a], I = n[R + _ + i] * u, L = n[T + _ + a], h = n[T + _] * u;
684
- r[_] = E * M + S * I + y * L + x * h;
683
+ const M = s[R + _ + a], I = s[R + _ + i] * u, L = s[T + _ + a], h = s[T + _] * u;
684
+ o[_] = E * M + S * I + y * L + x * h;
685
685
  }
686
- return r;
686
+ return o;
687
687
  }
688
688
  }
689
689
  const qt = new Le();
690
690
  class Yt extends Ue {
691
- interpolate_(e, t, o, s) {
692
- const r = super.interpolate_(e, t, o, s);
693
- return qt.fromArray(r).normalize().toArray(r), r;
691
+ interpolate_(e, t, r, n) {
692
+ const o = super.interpolate_(e, t, r, n);
693
+ return qt.fromArray(o).normalize().toArray(o), o;
694
694
  }
695
695
  }
696
696
  const C = {
@@ -718,8 +718,8 @@ const C = {
718
718
  }, Ee = {
719
719
  33071: De,
720
720
  33648: Ne,
721
- 10497: J
722
- }, $ = {
721
+ 10497: Q
722
+ }, ee = {
723
723
  SCALAR: 1,
724
724
  VEC2: 2,
725
725
  VEC3: 3,
@@ -727,7 +727,7 @@ const C = {
727
727
  MAT2: 4,
728
728
  MAT3: 9,
729
729
  MAT4: 16
730
- }, oe = {
730
+ }, ie = {
731
731
  POSITION: "position",
732
732
  NORMAL: "normal",
733
733
  TANGENT: "tangent",
@@ -749,7 +749,7 @@ const C = {
749
749
  // keyframe track will be initialized with a default interpolation type, then modified.
750
750
  LINEAR: ke,
751
751
  STEP: gt
752
- }, ee = {
752
+ }, te = {
753
753
  OPAQUE: "OPAQUE",
754
754
  MASK: "MASK",
755
755
  BLEND: "BLEND"
@@ -766,54 +766,54 @@ function Qt(d) {
766
766
  })), d.DefaultMaterial;
767
767
  }
768
768
  function G(d, e, t) {
769
- for (const o in t.extensions)
770
- d[o] === void 0 && (e.userData.gltfExtensions = e.userData.gltfExtensions || {}, e.userData.gltfExtensions[o] = t.extensions[o]);
769
+ for (const r in t.extensions)
770
+ d[r] === void 0 && (e.userData.gltfExtensions = e.userData.gltfExtensions || {}, e.userData.gltfExtensions[r] = t.extensions[r]);
771
771
  }
772
772
  function F(d, e) {
773
773
  e.extras !== void 0 && (typeof e.extras == "object" ? Object.assign(d.userData, e.extras) : console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, " + e.extras));
774
774
  }
775
775
  function Zt(d, e, t) {
776
- let o = !1, s = !1, r = !1;
776
+ let r = !1, n = !1, o = !1;
777
777
  for (let c = 0, u = e.length; c < u; c++) {
778
778
  const l = e[c];
779
- if (l.POSITION !== void 0 && (o = !0), l.NORMAL !== void 0 && (s = !0), l.COLOR_0 !== void 0 && (r = !0), o && s && r) break;
779
+ if (l.POSITION !== void 0 && (r = !0), l.NORMAL !== void 0 && (n = !0), l.COLOR_0 !== void 0 && (o = !0), r && n && o) break;
780
780
  }
781
- if (!o && !s && !r) return Promise.resolve(d);
782
- const n = [], a = [], i = [];
781
+ if (!r && !n && !o) return Promise.resolve(d);
782
+ const s = [], a = [], i = [];
783
783
  for (let c = 0, u = e.length; c < u; c++) {
784
784
  const l = e[c];
785
- if (o) {
785
+ if (r) {
786
786
  const f = l.POSITION !== void 0 ? t.getDependency("accessor", l.POSITION) : d.attributes.position;
787
- n.push(f);
787
+ s.push(f);
788
788
  }
789
- if (s) {
789
+ if (n) {
790
790
  const f = l.NORMAL !== void 0 ? t.getDependency("accessor", l.NORMAL) : d.attributes.normal;
791
791
  a.push(f);
792
792
  }
793
- if (r) {
793
+ if (o) {
794
794
  const f = l.COLOR_0 !== void 0 ? t.getDependency("accessor", l.COLOR_0) : d.attributes.color;
795
795
  i.push(f);
796
796
  }
797
797
  }
798
798
  return Promise.all([
799
- Promise.all(n),
799
+ Promise.all(s),
800
800
  Promise.all(a),
801
801
  Promise.all(i)
802
802
  ]).then(function(c) {
803
803
  const u = c[0], l = c[1], f = c[2];
804
- return o && (d.morphAttributes.position = u), s && (d.morphAttributes.normal = l), r && (d.morphAttributes.color = f), d.morphTargetsRelative = !0, d;
804
+ return r && (d.morphAttributes.position = u), n && (d.morphAttributes.normal = l), o && (d.morphAttributes.color = f), d.morphTargetsRelative = !0, d;
805
805
  });
806
806
  }
807
807
  function $t(d, e) {
808
808
  if (d.updateMorphTargets(), e.weights !== void 0)
809
- for (let t = 0, o = e.weights.length; t < o; t++)
809
+ for (let t = 0, r = e.weights.length; t < r; t++)
810
810
  d.morphTargetInfluences[t] = e.weights[t];
811
811
  if (e.extras && Array.isArray(e.extras.targetNames)) {
812
812
  const t = e.extras.targetNames;
813
813
  if (d.morphTargetInfluences.length === t.length) {
814
814
  d.morphTargetDictionary = {};
815
- for (let o = 0, s = t.length; o < s; o++)
816
- d.morphTargetDictionary[t[o]] = o;
815
+ for (let r = 0, n = t.length; r < n; r++)
816
+ d.morphTargetDictionary[t[r]] = r;
817
817
  } else
818
818
  console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.");
819
819
  }
@@ -821,19 +821,19 @@ function $t(d, e) {
821
821
  function en(d) {
822
822
  let e;
823
823
  const t = d.extensions && d.extensions[b.KHR_DRACO_MESH_COMPRESSION];
824
- if (t ? e = "draco:" + t.bufferView + ":" + t.indices + ":" + te(t.attributes) : e = d.indices + ":" + te(d.attributes) + ":" + d.mode, d.targets !== void 0)
825
- for (let o = 0, s = d.targets.length; o < s; o++)
826
- e += ":" + te(d.targets[o]);
824
+ if (t ? e = "draco:" + t.bufferView + ":" + t.indices + ":" + ne(t.attributes) : e = d.indices + ":" + ne(d.attributes) + ":" + d.mode, d.targets !== void 0)
825
+ for (let r = 0, n = d.targets.length; r < n; r++)
826
+ e += ":" + ne(d.targets[r]);
827
827
  return e;
828
828
  }
829
- function te(d) {
829
+ function ne(d) {
830
830
  let e = "";
831
831
  const t = Object.keys(d).sort();
832
- for (let o = 0, s = t.length; o < s; o++)
833
- e += t[o] + ":" + d[t[o]] + ";";
832
+ for (let r = 0, n = t.length; r < n; r++)
833
+ e += t[r] + ":" + d[t[r]] + ";";
834
834
  return e;
835
835
  }
836
- function ie(d) {
836
+ function ae(d) {
837
837
  switch (d) {
838
838
  case Int8Array:
839
839
  return 1 / 127;
@@ -850,12 +850,12 @@ function ie(d) {
850
850
  function tn(d) {
851
851
  return d.search(/\.jpe?g($|\?)/i) > 0 || d.search(/^data\:image\/jpeg/) === 0 ? "image/jpeg" : d.search(/\.webp($|\?)/i) > 0 || d.search(/^data\:image\/webp/) === 0 ? "image/webp" : "image/png";
852
852
  }
853
- const nn = new Y();
853
+ const nn = new J();
854
854
  class sn {
855
855
  constructor(e = {}, t = {}) {
856
856
  this.json = e, this.extensions = {}, this.plugins = {}, this.options = t, this.cache = new bt(), 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 = {};
857
- let o = !1, s = !1, r = -1;
858
- typeof navigator < "u" && (o = /^((?!chrome|android).)*safari/i.test(navigator.userAgent) === !0, s = navigator.userAgent.indexOf("Firefox") > -1, r = s ? navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1] : -1), typeof createImageBitmap > "u" || o || s && r < 98 ? this.textureLoader = new Me(this.options.manager) : this.textureLoader = new qe(this.options.manager), this.textureLoader.setCrossOrigin(this.options.crossOrigin), this.textureLoader.setRequestHeader(this.options.requestHeader), this.fileLoader = new K(this.options.manager), this.fileLoader.setResponseType("arraybuffer"), this.options.crossOrigin === "use-credentials" && this.fileLoader.setWithCredentials(!0);
857
+ let r = !1, n = !1, o = -1;
858
+ typeof navigator < "u" && (r = /^((?!chrome|android).)*safari/i.test(navigator.userAgent) === !0, n = navigator.userAgent.indexOf("Firefox") > -1, o = n ? navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1] : -1), typeof createImageBitmap > "u" || r || n && o < 98 ? this.textureLoader = new Me(this.options.manager) : this.textureLoader = new qe(this.options.manager), this.textureLoader.setCrossOrigin(this.options.crossOrigin), this.textureLoader.setRequestHeader(this.options.requestHeader), this.fileLoader = new K(this.options.manager), this.fileLoader.setResponseType("arraybuffer"), this.options.crossOrigin === "use-credentials" && this.fileLoader.setWithCredentials(!0);
859
859
  }
860
860
  setExtensions(e) {
861
861
  this.extensions = e;
@@ -864,28 +864,28 @@ class sn {
864
864
  this.plugins = e;
865
865
  }
866
866
  parse(e, t) {
867
- const o = this, s = this.json, r = this.extensions;
868
- this.cache.removeAll(), this.nodeCache = {}, this._invokeAll(function(n) {
869
- return n._markDefs && n._markDefs();
870
- }), Promise.all(this._invokeAll(function(n) {
871
- return n.beforeRoot && n.beforeRoot();
867
+ const r = this, n = this.json, o = this.extensions;
868
+ this.cache.removeAll(), this.nodeCache = {}, this._invokeAll(function(s) {
869
+ return s._markDefs && s._markDefs();
870
+ }), Promise.all(this._invokeAll(function(s) {
871
+ return s.beforeRoot && s.beforeRoot();
872
872
  })).then(function() {
873
873
  return Promise.all([
874
- o.getDependencies("scene"),
875
- o.getDependencies("animation"),
876
- o.getDependencies("camera")
874
+ r.getDependencies("scene"),
875
+ r.getDependencies("animation"),
876
+ r.getDependencies("camera")
877
877
  ]);
878
- }).then(function(n) {
878
+ }).then(function(s) {
879
879
  const a = {
880
- scene: n[0][s.scene || 0],
881
- scenes: n[0],
882
- animations: n[1],
883
- cameras: n[2],
884
- asset: s.asset,
885
- parser: o,
880
+ scene: s[0][n.scene || 0],
881
+ scenes: s[0],
882
+ animations: s[1],
883
+ cameras: s[2],
884
+ asset: n.asset,
885
+ parser: r,
886
886
  userData: {}
887
887
  };
888
- return G(r, a, s), F(a, s), Promise.all(o._invokeAll(function(i) {
888
+ return G(o, a, n), F(a, n), Promise.all(r._invokeAll(function(i) {
889
889
  return i.afterRoot && i.afterRoot(a);
890
890
  })).then(function() {
891
891
  for (const i of a.scenes)
@@ -898,15 +898,15 @@ class sn {
898
898
  * Marks the special nodes/meshes in json for efficient parse.
899
899
  */
900
900
  _markDefs() {
901
- const e = this.json.nodes || [], t = this.json.skins || [], o = this.json.meshes || [];
902
- for (let s = 0, r = t.length; s < r; s++) {
903
- const n = t[s].joints;
904
- for (let a = 0, i = n.length; a < i; a++)
905
- e[n[a]].isBone = !0;
901
+ const e = this.json.nodes || [], t = this.json.skins || [], r = this.json.meshes || [];
902
+ for (let n = 0, o = t.length; n < o; n++) {
903
+ const s = t[n].joints;
904
+ for (let a = 0, i = s.length; a < i; a++)
905
+ e[s[a]].isBone = !0;
906
906
  }
907
- for (let s = 0, r = e.length; s < r; s++) {
908
- const n = e[s];
909
- n.mesh !== void 0 && (this._addNodeRef(this.meshCache, n.mesh), n.skin !== void 0 && (o[n.mesh].isSkinnedMesh = !0)), n.camera !== void 0 && this._addNodeRef(this.cameraCache, n.camera);
907
+ for (let n = 0, o = e.length; n < o; n++) {
908
+ const s = e[n];
909
+ s.mesh !== void 0 && (this._addNodeRef(this.meshCache, s.mesh), s.skin !== void 0 && (r[s.mesh].isSkinnedMesh = !0)), s.camera !== void 0 && this._addNodeRef(this.cameraCache, s.camera);
910
910
  }
911
911
  }
912
912
  /**
@@ -922,34 +922,34 @@ class sn {
922
922
  t !== void 0 && (e.refs[t] === void 0 && (e.refs[t] = e.uses[t] = 0), e.refs[t]++);
923
923
  }
924
924
  /** Returns a reference to a shared resource, cloning it if necessary. */
925
- _getNodeRef(e, t, o) {
926
- if (e.refs[t] <= 1) return o;
927
- const s = o.clone(), r = (n, a) => {
928
- const i = this.associations.get(n);
925
+ _getNodeRef(e, t, r) {
926
+ if (e.refs[t] <= 1) return r;
927
+ const n = r.clone(), o = (s, a) => {
928
+ const i = this.associations.get(s);
929
929
  i != null && this.associations.set(a, i);
930
- for (const [c, u] of n.children.entries())
931
- r(u, a.children[c]);
930
+ for (const [c, u] of s.children.entries())
931
+ o(u, a.children[c]);
932
932
  };
933
- return r(o, s), s.name += "_instance_" + e.uses[t]++, s;
933
+ return o(r, n), n.name += "_instance_" + e.uses[t]++, n;
934
934
  }
935
935
  _invokeOne(e) {
936
936
  const t = Object.values(this.plugins);
937
937
  t.push(this);
938
- for (let o = 0; o < t.length; o++) {
939
- const s = e(t[o]);
940
- if (s) return s;
938
+ for (let r = 0; r < t.length; r++) {
939
+ const n = e(t[r]);
940
+ if (n) return n;
941
941
  }
942
942
  return null;
943
943
  }
944
944
  _invokeAll(e) {
945
945
  const t = Object.values(this.plugins);
946
946
  t.unshift(this);
947
- const o = [];
948
- for (let s = 0; s < t.length; s++) {
949
- const r = e(t[s]);
950
- r && o.push(r);
947
+ const r = [];
948
+ for (let n = 0; n < t.length; n++) {
949
+ const o = e(t[n]);
950
+ o && r.push(o);
951
951
  }
952
- return o;
952
+ return r;
953
953
  }
954
954
  /**
955
955
  * Requests the specified dependency asynchronously, with caching.
@@ -958,65 +958,65 @@ class sn {
958
958
  * @return {Promise<Object3D|Material|THREE.Texture|AnimationClip|ArrayBuffer|Object>}
959
959
  */
960
960
  getDependency(e, t) {
961
- const o = e + ":" + t;
962
- let s = this.cache.get(o);
963
- if (!s) {
961
+ const r = e + ":" + t;
962
+ let n = this.cache.get(r);
963
+ if (!n) {
964
964
  switch (e) {
965
965
  case "scene":
966
- s = this.loadScene(t);
966
+ n = this.loadScene(t);
967
967
  break;
968
968
  case "node":
969
- s = this._invokeOne(function(r) {
970
- return r.loadNode && r.loadNode(t);
969
+ n = this._invokeOne(function(o) {
970
+ return o.loadNode && o.loadNode(t);
971
971
  });
972
972
  break;
973
973
  case "mesh":
974
- s = this._invokeOne(function(r) {
975
- return r.loadMesh && r.loadMesh(t);
974
+ n = this._invokeOne(function(o) {
975
+ return o.loadMesh && o.loadMesh(t);
976
976
  });
977
977
  break;
978
978
  case "accessor":
979
- s = this.loadAccessor(t);
979
+ n = this.loadAccessor(t);
980
980
  break;
981
981
  case "bufferView":
982
- s = this._invokeOne(function(r) {
983
- return r.loadBufferView && r.loadBufferView(t);
982
+ n = this._invokeOne(function(o) {
983
+ return o.loadBufferView && o.loadBufferView(t);
984
984
  });
985
985
  break;
986
986
  case "buffer":
987
- s = this.loadBuffer(t);
987
+ n = this.loadBuffer(t);
988
988
  break;
989
989
  case "material":
990
- s = this._invokeOne(function(r) {
991
- return r.loadMaterial && r.loadMaterial(t);
990
+ n = this._invokeOne(function(o) {
991
+ return o.loadMaterial && o.loadMaterial(t);
992
992
  });
993
993
  break;
994
994
  case "texture":
995
- s = this._invokeOne(function(r) {
996
- return r.loadTexture && r.loadTexture(t);
995
+ n = this._invokeOne(function(o) {
996
+ return o.loadTexture && o.loadTexture(t);
997
997
  });
998
998
  break;
999
999
  case "skin":
1000
- s = this.loadSkin(t);
1000
+ n = this.loadSkin(t);
1001
1001
  break;
1002
1002
  case "animation":
1003
- s = this._invokeOne(function(r) {
1004
- return r.loadAnimation && r.loadAnimation(t);
1003
+ n = this._invokeOne(function(o) {
1004
+ return o.loadAnimation && o.loadAnimation(t);
1005
1005
  });
1006
1006
  break;
1007
1007
  case "camera":
1008
- s = this.loadCamera(t);
1008
+ n = this.loadCamera(t);
1009
1009
  break;
1010
1010
  default:
1011
- if (s = this._invokeOne(function(r) {
1012
- return r != this && r.getDependency && r.getDependency(e, t);
1013
- }), !s)
1011
+ if (n = this._invokeOne(function(o) {
1012
+ return o != this && o.getDependency && o.getDependency(e, t);
1013
+ }), !n)
1014
1014
  throw new Error("Unknown type: " + e);
1015
1015
  break;
1016
1016
  }
1017
- this.cache.add(o, s);
1017
+ this.cache.add(r, n);
1018
1018
  }
1019
- return s;
1019
+ return n;
1020
1020
  }
1021
1021
  /**
1022
1022
  * Requests all dependencies of the specified type asynchronously, with caching.
@@ -1026,9 +1026,9 @@ class sn {
1026
1026
  getDependencies(e) {
1027
1027
  let t = this.cache.get(e);
1028
1028
  if (!t) {
1029
- const o = this, s = this.json[e + (e === "mesh" ? "es" : "s")] || [];
1030
- t = Promise.all(s.map(function(r, n) {
1031
- return o.getDependency(e, n);
1029
+ const r = this, n = this.json[e + (e === "mesh" ? "es" : "s")] || [];
1030
+ t = Promise.all(n.map(function(o, s) {
1031
+ return r.getDependency(e, s);
1032
1032
  })), this.cache.add(e, t);
1033
1033
  }
1034
1034
  return t;
@@ -1039,15 +1039,15 @@ class sn {
1039
1039
  * @return {Promise<ArrayBuffer>}
1040
1040
  */
1041
1041
  loadBuffer(e) {
1042
- const t = this.json.buffers[e], o = this.fileLoader;
1042
+ const t = this.json.buffers[e], r = this.fileLoader;
1043
1043
  if (t.type && t.type !== "arraybuffer")
1044
1044
  throw new Error("THREE.GLTFLoader: " + t.type + " buffer type is not supported.");
1045
1045
  if (t.uri === void 0 && e === 0)
1046
1046
  return Promise.resolve(this.extensions[b.KHR_BINARY_GLTF].body);
1047
- const s = this.options;
1048
- return new Promise(function(r, n) {
1049
- o.load(X.resolveURL(t.uri, s.path), r, void 0, function() {
1050
- n(new Error('THREE.GLTFLoader: Failed to load buffer "' + t.uri + '".'));
1047
+ const n = this.options;
1048
+ return new Promise(function(o, s) {
1049
+ r.load(X.resolveURL(t.uri, n.path), o, void 0, function() {
1050
+ s(new Error('THREE.GLTFLoader: Failed to load buffer "' + t.uri + '".'));
1051
1051
  });
1052
1052
  });
1053
1053
  }
@@ -1058,9 +1058,9 @@ class sn {
1058
1058
  */
1059
1059
  loadBufferView(e) {
1060
1060
  const t = this.json.bufferViews[e];
1061
- return this.getDependency("buffer", t.buffer).then(function(o) {
1062
- const s = t.byteLength || 0, r = t.byteOffset || 0;
1063
- return o.slice(r, r + s);
1061
+ return this.getDependency("buffer", t.buffer).then(function(r) {
1062
+ const n = t.byteLength || 0, o = t.byteOffset || 0;
1063
+ return r.slice(o, o + n);
1064
1064
  });
1065
1065
  }
1066
1066
  /**
@@ -1069,23 +1069,23 @@ class sn {
1069
1069
  * @return {Promise<BufferAttribute|InterleavedBufferAttribute>}
1070
1070
  */
1071
1071
  loadAccessor(e) {
1072
- const t = this, o = this.json, s = this.json.accessors[e];
1073
- if (s.bufferView === void 0 && s.sparse === void 0) {
1074
- const n = $[s.type], a = j[s.componentType], i = s.normalized === !0, c = new a(s.count * n);
1075
- return Promise.resolve(new P(c, n, i));
1072
+ const t = this, r = this.json, n = this.json.accessors[e];
1073
+ if (n.bufferView === void 0 && n.sparse === void 0) {
1074
+ const s = ee[n.type], a = j[n.componentType], i = n.normalized === !0, c = new a(n.count * s);
1075
+ return Promise.resolve(new P(c, s, i));
1076
1076
  }
1077
- const r = [];
1078
- return s.bufferView !== void 0 ? r.push(this.getDependency("bufferView", s.bufferView)) : r.push(null), s.sparse !== void 0 && (r.push(this.getDependency("bufferView", s.sparse.indices.bufferView)), r.push(this.getDependency("bufferView", s.sparse.values.bufferView))), Promise.all(r).then(function(n) {
1079
- const a = n[0], i = $[s.type], c = j[s.componentType], u = c.BYTES_PER_ELEMENT, l = u * i, f = s.byteOffset || 0, m = s.bufferView !== void 0 ? o.bufferViews[s.bufferView].byteStride : void 0, T = s.normalized === !0;
1077
+ const o = [];
1078
+ return n.bufferView !== void 0 ? o.push(this.getDependency("bufferView", n.bufferView)) : o.push(null), n.sparse !== void 0 && (o.push(this.getDependency("bufferView", n.sparse.indices.bufferView)), o.push(this.getDependency("bufferView", n.sparse.values.bufferView))), Promise.all(o).then(function(s) {
1079
+ const a = s[0], i = ee[n.type], c = j[n.componentType], u = c.BYTES_PER_ELEMENT, l = u * i, f = n.byteOffset || 0, m = n.bufferView !== void 0 ? r.bufferViews[n.bufferView].byteStride : void 0, T = n.normalized === !0;
1080
1080
  let R, y;
1081
1081
  if (m && m !== l) {
1082
- const x = Math.floor(f / m), E = "InterleavedBuffer:" + s.bufferView + ":" + s.componentType + ":" + x + ":" + s.count;
1082
+ const x = Math.floor(f / m), E = "InterleavedBuffer:" + n.bufferView + ":" + n.componentType + ":" + x + ":" + n.count;
1083
1083
  let S = t.cache.get(E);
1084
- S || (R = new c(a, x * m, s.count * m / u), S = new Ye(R, m / u), t.cache.add(E, S)), y = new Je(S, i, f % m / u, T);
1084
+ S || (R = new c(a, x * m, n.count * m / u), S = new Ye(R, m / u), t.cache.add(E, S)), y = new Je(S, i, f % m / u, T);
1085
1085
  } else
1086
- a === null ? R = new c(s.count * i) : R = new c(a, f, s.count * i), y = new P(R, i, T);
1087
- if (s.sparse !== void 0) {
1088
- const x = $.SCALAR, E = j[s.sparse.indices.componentType], S = s.sparse.indices.byteOffset || 0, _ = s.sparse.values.byteOffset || 0, M = new E(n[1], S, s.sparse.count * x), I = new c(n[2], _, s.sparse.count * i);
1086
+ a === null ? R = new c(n.count * i) : R = new c(a, f, n.count * i), y = new P(R, i, T);
1087
+ if (n.sparse !== void 0) {
1088
+ const x = ee.SCALAR, E = j[n.sparse.indices.componentType], S = n.sparse.indices.byteOffset || 0, _ = n.sparse.values.byteOffset || 0, M = new E(s[1], S, n.sparse.count * x), I = new c(s[2], _, n.sparse.count * i);
1089
1089
  a !== null && (y = new P(y.array.slice(), y.itemSize, y.normalized));
1090
1090
  for (let L = 0, h = M.length; L < h; L++) {
1091
1091
  const p = M[L];
@@ -1101,51 +1101,51 @@ class sn {
1101
1101
  * @return {Promise<THREE.Texture|null>}
1102
1102
  */
1103
1103
  loadTexture(e) {
1104
- const t = this.json, o = this.options, r = t.textures[e].source, n = t.images[r];
1104
+ const t = this.json, r = this.options, o = t.textures[e].source, s = t.images[o];
1105
1105
  let a = this.textureLoader;
1106
- if (n.uri) {
1107
- const i = o.manager.getHandler(n.uri);
1106
+ if (s.uri) {
1107
+ const i = r.manager.getHandler(s.uri);
1108
1108
  i !== null && (a = i);
1109
1109
  }
1110
- return this.loadTextureImage(e, r, a);
1110
+ return this.loadTextureImage(e, o, a);
1111
1111
  }
1112
- loadTextureImage(e, t, o) {
1113
- const s = this, r = this.json, n = r.textures[e], a = r.images[t], i = (a.uri || a.bufferView) + ":" + n.sampler;
1112
+ loadTextureImage(e, t, r) {
1113
+ const n = this, o = this.json, s = o.textures[e], a = o.images[t], i = (a.uri || a.bufferView) + ":" + s.sampler;
1114
1114
  if (this.textureCache[i])
1115
1115
  return this.textureCache[i];
1116
- const c = this.loadImageSource(t, o).then(function(u) {
1117
- u.flipY = !1, u.name = n.name || a.name || "", u.name === "" && typeof a.uri == "string" && a.uri.startsWith("data:image/") === !1 && (u.name = a.uri);
1118
- const f = (r.samplers || {})[n.sampler] || {};
1119
- return u.magFilter = we[f.magFilter] || Ce, u.minFilter = we[f.minFilter] || Ie, u.wrapS = Ee[f.wrapS] || J, u.wrapT = Ee[f.wrapT] || J, s.associations.set(u, { textures: e }), u;
1116
+ const c = this.loadImageSource(t, r).then(function(u) {
1117
+ u.flipY = !1, u.name = s.name || a.name || "", u.name === "" && typeof a.uri == "string" && a.uri.startsWith("data:image/") === !1 && (u.name = a.uri);
1118
+ const f = (o.samplers || {})[s.sampler] || {};
1119
+ return u.magFilter = we[f.magFilter] || Ce, u.minFilter = we[f.minFilter] || Ie, u.wrapS = Ee[f.wrapS] || Q, u.wrapT = Ee[f.wrapT] || Q, n.associations.set(u, { textures: e }), u;
1120
1120
  }).catch(function() {
1121
1121
  return null;
1122
1122
  });
1123
1123
  return this.textureCache[i] = c, c;
1124
1124
  }
1125
1125
  loadImageSource(e, t) {
1126
- const o = this, s = this.json, r = this.options;
1126
+ const r = this, n = this.json, o = this.options;
1127
1127
  if (this.sourceCache[e] !== void 0)
1128
1128
  return this.sourceCache[e].then((l) => l.clone());
1129
- const n = s.images[e], a = self.URL || self.webkitURL;
1130
- let i = n.uri || "", c = !1;
1131
- if (n.bufferView !== void 0)
1132
- i = o.getDependency("bufferView", n.bufferView).then(function(l) {
1129
+ const s = n.images[e], a = self.URL || self.webkitURL;
1130
+ let i = s.uri || "", c = !1;
1131
+ if (s.bufferView !== void 0)
1132
+ i = r.getDependency("bufferView", s.bufferView).then(function(l) {
1133
1133
  c = !0;
1134
- const f = new Blob([l], { type: n.mimeType });
1134
+ const f = new Blob([l], { type: s.mimeType });
1135
1135
  return i = a.createObjectURL(f), i;
1136
1136
  });
1137
- else if (n.uri === void 0)
1137
+ else if (s.uri === void 0)
1138
1138
  throw new Error("THREE.GLTFLoader: Image " + e + " is missing URI and bufferView");
1139
1139
  const u = Promise.resolve(i).then(function(l) {
1140
1140
  return new Promise(function(f, m) {
1141
1141
  let T = f;
1142
1142
  t.isImageBitmapLoader === !0 && (T = function(R) {
1143
- const y = new de(R);
1143
+ const y = new he(R);
1144
1144
  y.needsUpdate = !0, f(y);
1145
- }), t.load(X.resolveURL(l, r.path), T, void 0, m);
1145
+ }), t.load(X.resolveURL(l, o.path), T, void 0, m);
1146
1146
  });
1147
1147
  }).then(function(l) {
1148
- return c === !0 && a.revokeObjectURL(i), l.userData.mimeType = n.mimeType || tn(n.uri), l;
1148
+ return c === !0 && a.revokeObjectURL(i), l.userData.mimeType = s.mimeType || tn(s.uri), l;
1149
1149
  }).catch(function(l) {
1150
1150
  throw console.error("THREE.GLTFLoader: Couldn't load texture", i), l;
1151
1151
  });
@@ -1158,18 +1158,18 @@ class sn {
1158
1158
  * @param {Object} mapDef
1159
1159
  * @return {Promise<Texture>}
1160
1160
  */
1161
- assignTexture(e, t, o, s) {
1162
- const r = this;
1163
- return this.getDependency("texture", o.index).then(function(n) {
1164
- if (!n) return null;
1165
- if (o.texCoord !== void 0 && o.texCoord > 0 && (n = n.clone(), n.channel = o.texCoord), r.extensions[b.KHR_TEXTURE_TRANSFORM]) {
1166
- const a = o.extensions !== void 0 ? o.extensions[b.KHR_TEXTURE_TRANSFORM] : void 0;
1161
+ assignTexture(e, t, r, n) {
1162
+ const o = this;
1163
+ return this.getDependency("texture", r.index).then(function(s) {
1164
+ if (!s) return null;
1165
+ if (r.texCoord !== void 0 && r.texCoord > 0 && (s = s.clone(), s.channel = r.texCoord), o.extensions[b.KHR_TEXTURE_TRANSFORM]) {
1166
+ const a = r.extensions !== void 0 ? r.extensions[b.KHR_TEXTURE_TRANSFORM] : void 0;
1167
1167
  if (a) {
1168
- const i = r.associations.get(n);
1169
- n = r.extensions[b.KHR_TEXTURE_TRANSFORM].extendTexture(n, a), r.associations.set(n, i);
1168
+ const i = o.associations.get(s);
1169
+ s = o.extensions[b.KHR_TEXTURE_TRANSFORM].extendTexture(s, a), o.associations.set(s, i);
1170
1170
  }
1171
1171
  }
1172
- return s !== void 0 && (n.colorSpace = s), e[t] = n, n;
1172
+ return n !== void 0 && (s.colorSpace = n), e[t] = s, s;
1173
1173
  });
1174
1174
  }
1175
1175
  /**
@@ -1182,24 +1182,24 @@ class sn {
1182
1182
  */
1183
1183
  assignFinalMaterial(e) {
1184
1184
  const t = e.geometry;
1185
- let o = e.material;
1186
- const s = t.attributes.tangent === void 0, r = t.attributes.color !== void 0, n = t.attributes.normal === void 0;
1185
+ let r = e.material;
1186
+ const n = t.attributes.tangent === void 0, o = t.attributes.color !== void 0, s = t.attributes.normal === void 0;
1187
1187
  if (e.isPoints) {
1188
- const a = "PointsMaterial:" + o.uuid;
1188
+ const a = "PointsMaterial:" + r.uuid;
1189
1189
  let i = this.cache.get(a);
1190
- i || (i = new tt(), Z.prototype.copy.call(i, o), i.color.copy(o.color), i.map = o.map, i.sizeAttenuation = !1, this.cache.add(a, i)), o = i;
1190
+ i || (i = new tt(), $.prototype.copy.call(i, r), i.color.copy(r.color), i.map = r.map, i.sizeAttenuation = !1, this.cache.add(a, i)), r = i;
1191
1191
  } else if (e.isLine) {
1192
- const a = "LineBasicMaterial:" + o.uuid;
1192
+ const a = "LineBasicMaterial:" + r.uuid;
1193
1193
  let i = this.cache.get(a);
1194
- i || (i = new nt(), Z.prototype.copy.call(i, o), i.color.copy(o.color), i.map = o.map, this.cache.add(a, i)), o = i;
1194
+ i || (i = new nt(), $.prototype.copy.call(i, r), i.color.copy(r.color), i.map = r.map, this.cache.add(a, i)), r = i;
1195
1195
  }
1196
- if (s || r || n) {
1197
- let a = "ClonedMaterial:" + o.uuid + ":";
1198
- s && (a += "derivative-tangents:"), r && (a += "vertex-colors:"), n && (a += "flat-shading:");
1196
+ if (n || o || s) {
1197
+ let a = "ClonedMaterial:" + r.uuid + ":";
1198
+ n && (a += "derivative-tangents:"), o && (a += "vertex-colors:"), s && (a += "flat-shading:");
1199
1199
  let i = this.cache.get(a);
1200
- i || (i = o.clone(), r && (i.vertexColors = !0), n && (i.flatShading = !0), s && (i.normalScale && (i.normalScale.y *= -1), i.clearcoatNormalScale && (i.clearcoatNormalScale.y *= -1)), this.cache.add(a, i), this.associations.set(i, this.associations.get(o))), o = i;
1200
+ i || (i = r.clone(), o && (i.vertexColors = !0), s && (i.flatShading = !0), n && (i.normalScale && (i.normalScale.y *= -1), i.clearcoatNormalScale && (i.clearcoatNormalScale.y *= -1)), this.cache.add(a, i), this.associations.set(i, this.associations.get(r))), r = i;
1201
1201
  }
1202
- e.material = o;
1202
+ e.material = r;
1203
1203
  }
1204
1204
  getMaterialType() {
1205
1205
  return Oe;
@@ -1210,37 +1210,37 @@ class sn {
1210
1210
  * @return {Promise<Material>}
1211
1211
  */
1212
1212
  loadMaterial(e) {
1213
- const t = this, o = this.json, s = this.extensions, r = o.materials[e];
1214
- let n;
1215
- const a = {}, i = r.extensions || {}, c = [];
1213
+ const t = this, r = this.json, n = this.extensions, o = r.materials[e];
1214
+ let s;
1215
+ const a = {}, i = o.extensions || {}, c = [];
1216
1216
  if (i[b.KHR_MATERIALS_UNLIT]) {
1217
- const l = s[b.KHR_MATERIALS_UNLIT];
1218
- n = l.getMaterialType(), c.push(l.extendParams(a, r, t));
1217
+ const l = n[b.KHR_MATERIALS_UNLIT];
1218
+ s = l.getMaterialType(), c.push(l.extendParams(a, o, t));
1219
1219
  } else {
1220
- const l = r.pbrMetallicRoughness || {};
1220
+ const l = o.pbrMetallicRoughness || {};
1221
1221
  if (a.color = new U(1, 1, 1), a.opacity = 1, Array.isArray(l.baseColorFactor)) {
1222
1222
  const f = l.baseColorFactor;
1223
1223
  a.color.setRGB(f[0], f[1], f[2], D), a.opacity = f[3];
1224
1224
  }
1225
- l.baseColorTexture !== void 0 && c.push(t.assignTexture(a, "map", l.baseColorTexture, N)), a.metalness = l.metallicFactor !== void 0 ? l.metallicFactor : 1, a.roughness = l.roughnessFactor !== void 0 ? l.roughnessFactor : 1, l.metallicRoughnessTexture !== void 0 && (c.push(t.assignTexture(a, "metalnessMap", l.metallicRoughnessTexture)), c.push(t.assignTexture(a, "roughnessMap", l.metallicRoughnessTexture))), n = this._invokeOne(function(f) {
1225
+ l.baseColorTexture !== void 0 && c.push(t.assignTexture(a, "map", l.baseColorTexture, N)), a.metalness = l.metallicFactor !== void 0 ? l.metallicFactor : 1, a.roughness = l.roughnessFactor !== void 0 ? l.roughnessFactor : 1, l.metallicRoughnessTexture !== void 0 && (c.push(t.assignTexture(a, "metalnessMap", l.metallicRoughnessTexture)), c.push(t.assignTexture(a, "roughnessMap", l.metallicRoughnessTexture))), s = this._invokeOne(function(f) {
1226
1226
  return f.getMaterialType && f.getMaterialType(e);
1227
1227
  }), c.push(Promise.all(this._invokeAll(function(f) {
1228
1228
  return f.extendMaterialParams && f.extendMaterialParams(e, a);
1229
1229
  })));
1230
1230
  }
1231
- r.doubleSided === !0 && (a.side = st);
1232
- const u = r.alphaMode || ee.OPAQUE;
1233
- if (u === ee.BLEND ? (a.transparent = !0, a.depthWrite = !1) : (a.transparent = !1, u === ee.MASK && (a.alphaTest = r.alphaCutoff !== void 0 ? r.alphaCutoff : 0.5)), r.normalTexture !== void 0 && n !== W && (c.push(t.assignTexture(a, "normalMap", r.normalTexture)), a.normalScale = new q(1, 1), r.normalTexture.scale !== void 0)) {
1234
- const l = r.normalTexture.scale;
1231
+ o.doubleSided === !0 && (a.side = st);
1232
+ const u = o.alphaMode || te.OPAQUE;
1233
+ if (u === te.BLEND ? (a.transparent = !0, a.depthWrite = !1) : (a.transparent = !1, u === te.MASK && (a.alphaTest = o.alphaCutoff !== void 0 ? o.alphaCutoff : 0.5)), o.normalTexture !== void 0 && s !== W && (c.push(t.assignTexture(a, "normalMap", o.normalTexture)), a.normalScale = new Y(1, 1), o.normalTexture.scale !== void 0)) {
1234
+ const l = o.normalTexture.scale;
1235
1235
  a.normalScale.set(l, l);
1236
1236
  }
1237
- if (r.occlusionTexture !== void 0 && n !== W && (c.push(t.assignTexture(a, "aoMap", r.occlusionTexture)), r.occlusionTexture.strength !== void 0 && (a.aoMapIntensity = r.occlusionTexture.strength)), r.emissiveFactor !== void 0 && n !== W) {
1238
- const l = r.emissiveFactor;
1237
+ if (o.occlusionTexture !== void 0 && s !== W && (c.push(t.assignTexture(a, "aoMap", o.occlusionTexture)), o.occlusionTexture.strength !== void 0 && (a.aoMapIntensity = o.occlusionTexture.strength)), o.emissiveFactor !== void 0 && s !== W) {
1238
+ const l = o.emissiveFactor;
1239
1239
  a.emissive = new U().setRGB(l[0], l[1], l[2], D);
1240
1240
  }
1241
- return r.emissiveTexture !== void 0 && n !== W && c.push(t.assignTexture(a, "emissiveMap", r.emissiveTexture, N)), Promise.all(c).then(function() {
1242
- const l = new n(a);
1243
- return r.name && (l.name = r.name), F(l, r), t.associations.set(l, { materials: e }), r.extensions && G(s, l, r), l;
1241
+ return o.emissiveTexture !== void 0 && s !== W && c.push(t.assignTexture(a, "emissiveMap", o.emissiveTexture, N)), Promise.all(c).then(function() {
1242
+ const l = new s(a);
1243
+ return o.name && (l.name = o.name), F(l, o), t.associations.set(l, { materials: e }), o.extensions && G(n, l, o), l;
1244
1244
  });
1245
1245
  }
1246
1246
  /** When Object3D instances are targeted by animation, they need unique names. */
@@ -1257,23 +1257,23 @@ class sn {
1257
1257
  * @return {Promise<Array<BufferGeometry>>}
1258
1258
  */
1259
1259
  loadGeometries(e) {
1260
- const t = this, o = this.extensions, s = this.primitiveCache;
1261
- function r(a) {
1262
- return o[b.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a, t).then(function(i) {
1260
+ const t = this, r = this.extensions, n = this.primitiveCache;
1261
+ function o(a) {
1262
+ return r[b.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a, t).then(function(i) {
1263
1263
  return Se(i, a, t);
1264
1264
  });
1265
1265
  }
1266
- const n = [];
1266
+ const s = [];
1267
1267
  for (let a = 0, i = e.length; a < i; a++) {
1268
- const c = e[a], u = en(c), l = s[u];
1268
+ const c = e[a], u = en(c), l = n[u];
1269
1269
  if (l)
1270
- n.push(l.promise);
1270
+ s.push(l.promise);
1271
1271
  else {
1272
1272
  let f;
1273
- c.extensions && c.extensions[b.KHR_DRACO_MESH_COMPRESSION] ? f = r(c) : f = Se(new ue(), c, t), s[u] = { primitive: c, promise: f }, n.push(f);
1273
+ c.extensions && c.extensions[b.KHR_DRACO_MESH_COMPRESSION] ? f = o(c) : f = Se(new le(), c, t), n[u] = { primitive: c, promise: f }, s.push(f);
1274
1274
  }
1275
1275
  }
1276
- return Promise.all(n);
1276
+ return Promise.all(s);
1277
1277
  }
1278
1278
  /**
1279
1279
  * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#meshes
@@ -1281,19 +1281,19 @@ class sn {
1281
1281
  * @return {Promise<Group|Mesh|SkinnedMesh>}
1282
1282
  */
1283
1283
  loadMesh(e) {
1284
- const t = this, o = this.json, s = this.extensions, r = o.meshes[e], n = r.primitives, a = [];
1285
- for (let i = 0, c = n.length; i < c; i++) {
1286
- const u = n[i].material === void 0 ? Qt(this.cache) : this.getDependency("material", n[i].material);
1284
+ const t = this, r = this.json, n = this.extensions, o = r.meshes[e], s = o.primitives, a = [];
1285
+ for (let i = 0, c = s.length; i < c; i++) {
1286
+ const u = s[i].material === void 0 ? Qt(this.cache) : this.getDependency("material", s[i].material);
1287
1287
  a.push(u);
1288
1288
  }
1289
- return a.push(t.loadGeometries(n)), Promise.all(a).then(function(i) {
1289
+ return a.push(t.loadGeometries(s)), Promise.all(a).then(function(i) {
1290
1290
  const c = i.slice(0, i.length - 1), u = i[i.length - 1], l = [];
1291
1291
  for (let m = 0, T = u.length; m < T; m++) {
1292
- const R = u[m], y = n[m];
1292
+ const R = u[m], y = s[m];
1293
1293
  let x;
1294
1294
  const E = c[m];
1295
1295
  if (y.mode === C.TRIANGLES || y.mode === C.TRIANGLE_STRIP || y.mode === C.TRIANGLE_FAN || y.mode === void 0)
1296
- x = r.isSkinnedMesh === !0 ? new ot(R, E) : new Pe(R, E), x.isSkinnedMesh === !0 && x.normalizeSkinWeights(), y.mode === C.TRIANGLE_STRIP ? x.geometry = Re(x.geometry, be) : y.mode === C.TRIANGLE_FAN && (x.geometry = Re(x.geometry, re));
1296
+ x = o.isSkinnedMesh === !0 ? new ot(R, E) : new Pe(R, E), x.isSkinnedMesh === !0 && x.normalizeSkinWeights(), y.mode === C.TRIANGLE_STRIP ? x.geometry = Re(x.geometry, be) : y.mode === C.TRIANGLE_FAN && (x.geometry = Re(x.geometry, oe));
1297
1297
  else if (y.mode === C.LINES)
1298
1298
  x = new it(R, E);
1299
1299
  else if (y.mode === C.LINE_STRIP)
@@ -1304,7 +1304,7 @@ class sn {
1304
1304
  x = new ut(R, E);
1305
1305
  else
1306
1306
  throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + y.mode);
1307
- Object.keys(x.geometry.morphAttributes).length > 0 && $t(x, r), x.name = t.createUniqueName(r.name || "mesh_" + e), F(x, r), y.extensions && G(s, x, y), t.assignFinalMaterial(x), l.push(x);
1307
+ Object.keys(x.geometry.morphAttributes).length > 0 && $t(x, o), x.name = t.createUniqueName(o.name || "mesh_" + e), F(x, o), y.extensions && G(n, x, y), t.assignFinalMaterial(x), l.push(x);
1308
1308
  }
1309
1309
  for (let m = 0, T = l.length; m < T; m++)
1310
1310
  t.associations.set(l[m], {
@@ -1312,9 +1312,9 @@ class sn {
1312
1312
  primitives: m
1313
1313
  });
1314
1314
  if (l.length === 1)
1315
- return r.extensions && G(s, l[0], r), l[0];
1315
+ return o.extensions && G(n, l[0], o), l[0];
1316
1316
  const f = new z();
1317
- r.extensions && G(s, f, r), t.associations.set(f, { meshes: e });
1317
+ o.extensions && G(n, f, o), t.associations.set(f, { meshes: e });
1318
1318
  for (let m = 0, T = l.length; m < T; m++)
1319
1319
  f.add(l[m]);
1320
1320
  return f;
@@ -1327,12 +1327,12 @@ class sn {
1327
1327
  */
1328
1328
  loadCamera(e) {
1329
1329
  let t;
1330
- const o = this.json.cameras[e], s = o[o.type];
1331
- if (!s) {
1330
+ const r = this.json.cameras[e], n = r[r.type];
1331
+ if (!n) {
1332
1332
  console.warn("THREE.GLTFLoader: Missing camera parameters.");
1333
1333
  return;
1334
1334
  }
1335
- return o.type === "perspective" ? t = new lt(ft.radToDeg(s.yfov), s.aspectRatio || 1, s.znear || 1, s.zfar || 2e6) : o.type === "orthographic" && (t = new dt(-s.xmag, s.xmag, s.ymag, -s.ymag, s.znear, s.zfar)), o.name && (t.name = this.createUniqueName(o.name)), F(t, o), Promise.resolve(t);
1335
+ return r.type === "perspective" ? t = new lt(ft.radToDeg(n.yfov), n.aspectRatio || 1, n.znear || 1, n.zfar || 2e6) : r.type === "orthographic" && (t = new dt(-n.xmag, n.xmag, n.ymag, -n.ymag, n.znear, n.zfar)), r.name && (t.name = this.createUniqueName(r.name)), F(t, r), Promise.resolve(t);
1336
1336
  }
1337
1337
  /**
1338
1338
  * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins
@@ -1340,17 +1340,17 @@ class sn {
1340
1340
  * @return {Promise<Skeleton>}
1341
1341
  */
1342
1342
  loadSkin(e) {
1343
- const t = this.json.skins[e], o = [];
1344
- for (let s = 0, r = t.joints.length; s < r; s++)
1345
- o.push(this._loadNodeShallow(t.joints[s]));
1346
- return t.inverseBindMatrices !== void 0 ? o.push(this.getDependency("accessor", t.inverseBindMatrices)) : o.push(null), Promise.all(o).then(function(s) {
1347
- const r = s.pop(), n = s, a = [], i = [];
1348
- for (let c = 0, u = n.length; c < u; c++) {
1349
- const l = n[c];
1343
+ const t = this.json.skins[e], r = [];
1344
+ for (let n = 0, o = t.joints.length; n < o; n++)
1345
+ r.push(this._loadNodeShallow(t.joints[n]));
1346
+ return t.inverseBindMatrices !== void 0 ? r.push(this.getDependency("accessor", t.inverseBindMatrices)) : r.push(null), Promise.all(r).then(function(n) {
1347
+ const o = n.pop(), s = n, a = [], i = [];
1348
+ for (let c = 0, u = s.length; c < u; c++) {
1349
+ const l = s[c];
1350
1350
  if (l) {
1351
1351
  a.push(l);
1352
- const f = new Y();
1353
- r !== null && f.fromArray(r.array, c * 16), i.push(f);
1352
+ const f = new J();
1353
+ o !== null && f.fromArray(o.array, c * 16), i.push(f);
1354
1354
  } else
1355
1355
  console.warn('THREE.GLTFLoader: Joint "%s" could not be found.', t.joints[c]);
1356
1356
  }
@@ -1363,13 +1363,13 @@ class sn {
1363
1363
  * @return {Promise<AnimationClip>}
1364
1364
  */
1365
1365
  loadAnimation(e) {
1366
- const t = this.json, o = this, s = t.animations[e], r = s.name ? s.name : "animation_" + e, n = [], a = [], i = [], c = [], u = [];
1367
- for (let l = 0, f = s.channels.length; l < f; l++) {
1368
- const m = s.channels[l], T = s.samplers[m.sampler], R = m.target, y = R.node, x = s.parameters !== void 0 ? s.parameters[T.input] : T.input, E = s.parameters !== void 0 ? s.parameters[T.output] : T.output;
1369
- R.node !== void 0 && (n.push(this.getDependency("node", y)), a.push(this.getDependency("accessor", x)), i.push(this.getDependency("accessor", E)), c.push(T), u.push(R));
1366
+ const t = this.json, r = this, n = t.animations[e], o = n.name ? n.name : "animation_" + e, s = [], a = [], i = [], c = [], u = [];
1367
+ for (let l = 0, f = n.channels.length; l < f; l++) {
1368
+ const m = n.channels[l], T = n.samplers[m.sampler], R = m.target, y = R.node, x = n.parameters !== void 0 ? n.parameters[T.input] : T.input, E = n.parameters !== void 0 ? n.parameters[T.output] : T.output;
1369
+ R.node !== void 0 && (s.push(this.getDependency("node", y)), a.push(this.getDependency("accessor", x)), i.push(this.getDependency("accessor", E)), c.push(T), u.push(R));
1370
1370
  }
1371
1371
  return Promise.all([
1372
- Promise.all(n),
1372
+ Promise.all(s),
1373
1373
  Promise.all(a),
1374
1374
  Promise.all(i),
1375
1375
  Promise.all(c),
@@ -1380,23 +1380,23 @@ class sn {
1380
1380
  const _ = f[E], M = m[E], I = T[E], L = R[E], h = y[E];
1381
1381
  if (_ === void 0) continue;
1382
1382
  _.updateMatrix && _.updateMatrix();
1383
- const p = o._createAnimationTracks(_, M, I, L, h);
1383
+ const p = r._createAnimationTracks(_, M, I, L, h);
1384
1384
  if (p)
1385
1385
  for (let g = 0; g < p.length; g++)
1386
1386
  x.push(p[g]);
1387
1387
  }
1388
- return new pt(r, void 0, x);
1388
+ return new pt(o, void 0, x);
1389
1389
  });
1390
1390
  }
1391
1391
  createNodeMesh(e) {
1392
- const t = this.json, o = this, s = t.nodes[e];
1393
- return s.mesh === void 0 ? null : o.getDependency("mesh", s.mesh).then(function(r) {
1394
- const n = o._getNodeRef(o.meshCache, s.mesh, r);
1395
- return s.weights !== void 0 && n.traverse(function(a) {
1392
+ const t = this.json, r = this, n = t.nodes[e];
1393
+ return n.mesh === void 0 ? null : r.getDependency("mesh", n.mesh).then(function(o) {
1394
+ const s = r._getNodeRef(r.meshCache, n.mesh, o);
1395
+ return n.weights !== void 0 && s.traverse(function(a) {
1396
1396
  if (a.isMesh)
1397
- for (let i = 0, c = s.weights.length; i < c; i++)
1398
- a.morphTargetInfluences[i] = s.weights[i];
1399
- }), n;
1397
+ for (let i = 0, c = n.weights.length; i < c; i++)
1398
+ a.morphTargetInfluences[i] = n.weights[i];
1399
+ }), s;
1400
1400
  });
1401
1401
  }
1402
1402
  /**
@@ -1405,13 +1405,13 @@ class sn {
1405
1405
  * @return {Promise<Object3D>}
1406
1406
  */
1407
1407
  loadNode(e) {
1408
- const t = this.json, o = this, s = t.nodes[e], r = o._loadNodeShallow(e), n = [], a = s.children || [];
1408
+ const t = this.json, r = this, n = t.nodes[e], o = r._loadNodeShallow(e), s = [], a = n.children || [];
1409
1409
  for (let c = 0, u = a.length; c < u; c++)
1410
- n.push(o.getDependency("node", a[c]));
1411
- const i = s.skin === void 0 ? Promise.resolve(null) : o.getDependency("skin", s.skin);
1410
+ s.push(r.getDependency("node", a[c]));
1411
+ const i = n.skin === void 0 ? Promise.resolve(null) : r.getDependency("skin", n.skin);
1412
1412
  return Promise.all([
1413
- r,
1414
- Promise.all(n),
1413
+ o,
1414
+ Promise.all(s),
1415
1415
  i
1416
1416
  ]).then(function(c) {
1417
1417
  const u = c[0], l = c[1], f = c[2];
@@ -1426,29 +1426,29 @@ class sn {
1426
1426
  // ._loadNodeShallow() parses a single node.
1427
1427
  // skin and child nodes are created and added in .loadNode() (no '_' prefix).
1428
1428
  _loadNodeShallow(e) {
1429
- const t = this.json, o = this.extensions, s = this;
1429
+ const t = this.json, r = this.extensions, n = this;
1430
1430
  if (this.nodeCache[e] !== void 0)
1431
1431
  return this.nodeCache[e];
1432
- const r = t.nodes[e], n = r.name ? s.createUniqueName(r.name) : "", a = [], i = s._invokeOne(function(c) {
1432
+ const o = t.nodes[e], s = o.name ? n.createUniqueName(o.name) : "", a = [], i = n._invokeOne(function(c) {
1433
1433
  return c.createNodeMesh && c.createNodeMesh(e);
1434
1434
  });
1435
- return i && a.push(i), r.camera !== void 0 && a.push(s.getDependency("camera", r.camera).then(function(c) {
1436
- return s._getNodeRef(s.cameraCache, r.camera, c);
1437
- })), s._invokeAll(function(c) {
1435
+ return i && a.push(i), o.camera !== void 0 && a.push(n.getDependency("camera", o.camera).then(function(c) {
1436
+ return n._getNodeRef(n.cameraCache, o.camera, c);
1437
+ })), n._invokeAll(function(c) {
1438
1438
  return c.createNodeAttachment && c.createNodeAttachment(e);
1439
1439
  }).forEach(function(c) {
1440
1440
  a.push(c);
1441
1441
  }), this.nodeCache[e] = Promise.all(a).then(function(c) {
1442
1442
  let u;
1443
- if (r.isBone === !0 ? u = new mt() : c.length > 1 ? u = new z() : c.length === 1 ? u = c[0] : u = new ce(), u !== c[0])
1443
+ if (o.isBone === !0 ? u = new mt() : c.length > 1 ? u = new z() : c.length === 1 ? u = c[0] : u = new ue(), u !== c[0])
1444
1444
  for (let l = 0, f = c.length; l < f; l++)
1445
1445
  u.add(c[l]);
1446
- if (r.name && (u.userData.name = r.name, u.name = n), F(u, r), r.extensions && G(o, u, r), r.matrix !== void 0) {
1447
- const l = new Y();
1448
- l.fromArray(r.matrix), u.applyMatrix4(l);
1446
+ if (o.name && (u.userData.name = o.name, u.name = s), F(u, o), o.extensions && G(r, u, o), o.matrix !== void 0) {
1447
+ const l = new J();
1448
+ l.fromArray(o.matrix), u.applyMatrix4(l);
1449
1449
  } else
1450
- r.translation !== void 0 && u.position.fromArray(r.translation), r.rotation !== void 0 && u.quaternion.fromArray(r.rotation), r.scale !== void 0 && u.scale.fromArray(r.scale);
1451
- return s.associations.has(u) || s.associations.set(u, {}), s.associations.get(u).nodes = e, u;
1450
+ o.translation !== void 0 && u.position.fromArray(o.translation), o.rotation !== void 0 && u.quaternion.fromArray(o.rotation), o.scale !== void 0 && u.scale.fromArray(o.scale);
1451
+ return n.associations.has(u) || n.associations.set(u, {}), n.associations.get(u).nodes = e, u;
1452
1452
  }), this.nodeCache[e];
1453
1453
  }
1454
1454
  /**
@@ -1457,96 +1457,96 @@ class sn {
1457
1457
  * @return {Promise<Group>}
1458
1458
  */
1459
1459
  loadScene(e) {
1460
- const t = this.extensions, o = this.json.scenes[e], s = this, r = new z();
1461
- o.name && (r.name = s.createUniqueName(o.name)), F(r, o), o.extensions && G(t, r, o);
1462
- const n = o.nodes || [], a = [];
1463
- for (let i = 0, c = n.length; i < c; i++)
1464
- a.push(s.getDependency("node", n[i]));
1460
+ const t = this.extensions, r = this.json.scenes[e], n = this, o = new z();
1461
+ r.name && (o.name = n.createUniqueName(r.name)), F(o, r), r.extensions && G(t, o, r);
1462
+ const s = r.nodes || [], a = [];
1463
+ for (let i = 0, c = s.length; i < c; i++)
1464
+ a.push(n.getDependency("node", s[i]));
1465
1465
  return Promise.all(a).then(function(i) {
1466
1466
  for (let u = 0, l = i.length; u < l; u++)
1467
- r.add(i[u]);
1467
+ o.add(i[u]);
1468
1468
  const c = (u) => {
1469
1469
  const l = /* @__PURE__ */ new Map();
1470
- for (const [f, m] of s.associations)
1471
- (f instanceof Z || f instanceof de) && l.set(f, m);
1470
+ for (const [f, m] of n.associations)
1471
+ (f instanceof $ || f instanceof he) && l.set(f, m);
1472
1472
  return u.traverse((f) => {
1473
- const m = s.associations.get(f);
1473
+ const m = n.associations.get(f);
1474
1474
  m != null && l.set(f, m);
1475
1475
  }), l;
1476
1476
  };
1477
- return s.associations = c(r), r;
1477
+ return n.associations = c(o), o;
1478
1478
  });
1479
1479
  }
1480
- _createAnimationTracks(e, t, o, s, r) {
1481
- const n = [], a = e.name ? e.name : e.uuid, i = [];
1482
- k[r.path] === k.weights ? e.traverse(function(f) {
1480
+ _createAnimationTracks(e, t, r, n, o) {
1481
+ const s = [], a = e.name ? e.name : e.uuid, i = [];
1482
+ k[o.path] === k.weights ? e.traverse(function(f) {
1483
1483
  f.morphTargetInfluences && i.push(f.name ? f.name : f.uuid);
1484
1484
  }) : i.push(a);
1485
1485
  let c;
1486
- switch (k[r.path]) {
1486
+ switch (k[o.path]) {
1487
1487
  case k.weights:
1488
- c = pe;
1488
+ c = me;
1489
1489
  break;
1490
1490
  case k.rotation:
1491
- c = me;
1491
+ c = ge;
1492
1492
  break;
1493
1493
  case k.position:
1494
1494
  case k.scale:
1495
- c = he;
1495
+ c = pe;
1496
1496
  break;
1497
1497
  default:
1498
- switch (o.itemSize) {
1498
+ switch (r.itemSize) {
1499
1499
  case 1:
1500
- c = pe;
1500
+ c = me;
1501
1501
  break;
1502
1502
  case 2:
1503
1503
  case 3:
1504
1504
  default:
1505
- c = he;
1505
+ c = pe;
1506
1506
  break;
1507
1507
  }
1508
1508
  break;
1509
1509
  }
1510
- const u = s.interpolation !== void 0 ? Jt[s.interpolation] : ke, l = this._getArrayFromAccessor(o);
1510
+ const u = n.interpolation !== void 0 ? Jt[n.interpolation] : ke, l = this._getArrayFromAccessor(r);
1511
1511
  for (let f = 0, m = i.length; f < m; f++) {
1512
1512
  const T = new c(
1513
- i[f] + "." + k[r.path],
1513
+ i[f] + "." + k[o.path],
1514
1514
  t.array,
1515
1515
  l,
1516
1516
  u
1517
1517
  );
1518
- s.interpolation === "CUBICSPLINE" && this._createCubicSplineTrackInterpolant(T), n.push(T);
1518
+ n.interpolation === "CUBICSPLINE" && this._createCubicSplineTrackInterpolant(T), s.push(T);
1519
1519
  }
1520
- return n;
1520
+ return s;
1521
1521
  }
1522
1522
  _getArrayFromAccessor(e) {
1523
1523
  let t = e.array;
1524
1524
  if (e.normalized) {
1525
- const o = ie(t.constructor), s = new Float32Array(t.length);
1526
- for (let r = 0, n = t.length; r < n; r++)
1527
- s[r] = t[r] * o;
1528
- t = s;
1525
+ const r = ae(t.constructor), n = new Float32Array(t.length);
1526
+ for (let o = 0, s = t.length; o < s; o++)
1527
+ n[o] = t[o] * r;
1528
+ t = n;
1529
1529
  }
1530
1530
  return t;
1531
1531
  }
1532
1532
  _createCubicSplineTrackInterpolant(e) {
1533
- e.createInterpolant = function(o) {
1534
- const s = this instanceof me ? Yt : Ue;
1535
- return new s(this.times, this.values, this.getValueSize() / 3, o);
1533
+ e.createInterpolant = function(r) {
1534
+ const n = this instanceof ge ? Yt : Ue;
1535
+ return new n(this.times, this.values, this.getValueSize() / 3, r);
1536
1536
  }, e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = !0;
1537
1537
  }
1538
1538
  }
1539
1539
  function rn(d, e, t) {
1540
- const o = e.attributes, s = new yt();
1541
- if (o.POSITION !== void 0) {
1542
- const a = t.json.accessors[o.POSITION], i = a.min, c = a.max;
1540
+ const r = e.attributes, n = new yt();
1541
+ if (r.POSITION !== void 0) {
1542
+ const a = t.json.accessors[r.POSITION], i = a.min, c = a.max;
1543
1543
  if (i !== void 0 && c !== void 0) {
1544
- if (s.set(
1544
+ if (n.set(
1545
1545
  new B(i[0], i[1], i[2]),
1546
1546
  new B(c[0], c[1], c[2])
1547
1547
  ), a.normalized) {
1548
- const u = ie(j[a.componentType]);
1549
- s.min.multiplyScalar(u), s.max.multiplyScalar(u);
1548
+ const u = ae(j[a.componentType]);
1549
+ n.min.multiplyScalar(u), n.max.multiplyScalar(u);
1550
1550
  }
1551
1551
  } else {
1552
1552
  console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");
@@ -1554,16 +1554,16 @@ function rn(d, e, t) {
1554
1554
  }
1555
1555
  } else
1556
1556
  return;
1557
- const r = e.targets;
1558
- if (r !== void 0) {
1557
+ const o = e.targets;
1558
+ if (o !== void 0) {
1559
1559
  const a = new B(), i = new B();
1560
- for (let c = 0, u = r.length; c < u; c++) {
1561
- const l = r[c];
1560
+ for (let c = 0, u = o.length; c < u; c++) {
1561
+ const l = o[c];
1562
1562
  if (l.POSITION !== void 0) {
1563
1563
  const f = t.json.accessors[l.POSITION], m = f.min, T = f.max;
1564
1564
  if (m !== void 0 && T !== void 0) {
1565
1565
  if (i.setX(Math.max(Math.abs(m[0]), Math.abs(T[0]))), i.setY(Math.max(Math.abs(m[1]), Math.abs(T[1]))), i.setZ(Math.max(Math.abs(m[2]), Math.abs(T[2]))), f.normalized) {
1566
- const R = ie(j[f.componentType]);
1566
+ const R = ae(j[f.componentType]);
1567
1567
  i.multiplyScalar(R);
1568
1568
  }
1569
1569
  a.max(i);
@@ -1571,77 +1571,77 @@ function rn(d, e, t) {
1571
1571
  console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");
1572
1572
  }
1573
1573
  }
1574
- s.expandByVector(a);
1574
+ n.expandByVector(a);
1575
1575
  }
1576
- d.boundingBox = s;
1577
- const n = new xt();
1578
- s.getCenter(n.center), n.radius = s.min.distanceTo(s.max) / 2, d.boundingSphere = n;
1576
+ d.boundingBox = n;
1577
+ const s = new xt();
1578
+ n.getCenter(s.center), s.radius = n.min.distanceTo(n.max) / 2, d.boundingSphere = s;
1579
1579
  }
1580
1580
  function Se(d, e, t) {
1581
- const o = e.attributes, s = [];
1582
- function r(n, a) {
1583
- return t.getDependency("accessor", n).then(function(i) {
1581
+ const r = e.attributes, n = [];
1582
+ function o(s, a) {
1583
+ return t.getDependency("accessor", s).then(function(i) {
1584
1584
  d.setAttribute(a, i);
1585
1585
  });
1586
1586
  }
1587
- for (const n in o) {
1588
- const a = oe[n] || n.toLowerCase();
1589
- a in d.attributes || s.push(r(o[n], a));
1587
+ for (const s in r) {
1588
+ const a = ie[s] || s.toLowerCase();
1589
+ a in d.attributes || n.push(o(r[s], a));
1590
1590
  }
1591
1591
  if (e.indices !== void 0 && !d.index) {
1592
- const n = t.getDependency("accessor", e.indices).then(function(a) {
1592
+ const s = t.getDependency("accessor", e.indices).then(function(a) {
1593
1593
  d.setIndex(a);
1594
1594
  });
1595
- s.push(n);
1595
+ n.push(s);
1596
1596
  }
1597
- return ge.workingColorSpace !== D && "COLOR_0" in o && console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${ge.workingColorSpace}" not supported.`), F(d, e), rn(d, e, t), Promise.all(s).then(function() {
1597
+ return Ae.workingColorSpace !== D && "COLOR_0" in r && console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${Ae.workingColorSpace}" not supported.`), F(d, e), rn(d, e, t), Promise.all(n).then(function() {
1598
1598
  return e.targets !== void 0 ? Zt(d, e.targets, t) : d;
1599
1599
  });
1600
1600
  }
1601
1601
  class on {
1602
1602
  parse(e) {
1603
- const t = {}, o = e.split(`
1603
+ const t = {}, r = e.split(`
1604
1604
  `);
1605
- let s = null, r = t;
1606
- const n = [t];
1607
- for (const a of o)
1605
+ let n = null, o = t;
1606
+ const s = [t];
1607
+ for (const a of r)
1608
1608
  if (a.includes("=")) {
1609
1609
  const i = a.split("="), c = i[0].trim(), u = i[1].trim();
1610
1610
  if (u.endsWith("{")) {
1611
1611
  const l = {};
1612
- n.push(l), r[c] = l, r = l;
1612
+ s.push(l), o[c] = l, o = l;
1613
1613
  } else
1614
- r[c] = u;
1614
+ o[c] = u;
1615
1615
  } else if (a.endsWith("{")) {
1616
- const i = r[s] || {};
1617
- n.push(i), r[s] = i, r = i;
1616
+ const i = o[n] || {};
1617
+ s.push(i), o[n] = i, o = i;
1618
1618
  } else if (a.endsWith("}")) {
1619
- if (n.pop(), n.length === 0) continue;
1620
- r = n[n.length - 1];
1619
+ if (s.pop(), s.length === 0) continue;
1620
+ o = s[s.length - 1];
1621
1621
  } else if (a.endsWith("(")) {
1622
1622
  const i = {};
1623
- n.push(i), s = a.split("(")[0].trim() || s, r[s] = i, r = i;
1624
- } else a.endsWith(")") ? (n.pop(), r = n[n.length - 1]) : s = a.trim();
1623
+ s.push(i), n = a.split("(")[0].trim() || n, o[n] = i, o = i;
1624
+ } else a.endsWith(")") ? (s.pop(), o = s[s.length - 1]) : n = a.trim();
1625
1625
  return t;
1626
1626
  }
1627
1627
  }
1628
- class an extends ae {
1628
+ class an extends ce {
1629
1629
  constructor(e) {
1630
1630
  super(e);
1631
1631
  }
1632
- load(e, t, o, s) {
1633
- const r = this, n = new K(r.manager);
1634
- n.setPath(r.path), n.setResponseType("arraybuffer"), n.setRequestHeader(r.requestHeader), n.setWithCredentials(r.withCredentials), n.load(e, function(a) {
1632
+ load(e, t, r, n) {
1633
+ const o = this, s = new K(o.manager);
1634
+ s.setPath(o.path), s.setResponseType("arraybuffer"), s.setRequestHeader(o.requestHeader), s.setWithCredentials(o.withCredentials), s.load(e, function(a) {
1635
1635
  try {
1636
- t(r.parse(a));
1636
+ t(o.parse(a));
1637
1637
  } catch (i) {
1638
- s ? s(i) : console.error(i), r.manager.itemError(e);
1638
+ n ? n(i) : console.error(i), o.manager.itemError(e);
1639
1639
  }
1640
- }, o, s);
1640
+ }, r, n);
1641
1641
  }
1642
1642
  parse(e) {
1643
1643
  const t = new on();
1644
- function o(h) {
1644
+ function r(h) {
1645
1645
  const p = {};
1646
1646
  new K().setResponseType("arraybuffer");
1647
1647
  for (const A in h) {
@@ -1650,21 +1650,21 @@ class an extends ae {
1650
1650
  p[A] = URL.createObjectURL(w);
1651
1651
  }
1652
1652
  if (A.endsWith("usd") || A.endsWith("usda")) {
1653
- if (s(h[A])) {
1653
+ if (n(h[A])) {
1654
1654
  console.warn("THREE.USDZLoader: Crate files (.usdc or binary .usd) are not supported.");
1655
1655
  continue;
1656
1656
  }
1657
- const w = Ae(h[A]);
1657
+ const w = Te(h[A]);
1658
1658
  p[A] = t.parse(w);
1659
1659
  }
1660
1660
  }
1661
1661
  return p;
1662
1662
  }
1663
- function s(h) {
1663
+ function n(h) {
1664
1664
  const p = h.slice(0, 7), g = new Uint8Array([80, 88, 82, 45, 85, 83, 68, 67]);
1665
1665
  return p.every((A, w) => A === g[w]);
1666
1666
  }
1667
- function r(h) {
1667
+ function o(h) {
1668
1668
  if (h.length < 1) return;
1669
1669
  const p = Object.keys(h)[0];
1670
1670
  let g = !1;
@@ -1672,16 +1672,16 @@ class an extends ae {
1672
1672
  if (p.endsWith("usdc"))
1673
1673
  g = !0;
1674
1674
  else if (p.endsWith("usd"))
1675
- if (s(h[p]))
1675
+ if (n(h[p]))
1676
1676
  g = !0;
1677
1677
  else
1678
1678
  return h[p];
1679
1679
  g && console.warn("THREE.USDZLoader: Crate files (.usdc or binary .usd) are not supported.");
1680
1680
  }
1681
- const n = Rt(new Uint8Array(e)), a = o(n), i = r(n);
1681
+ const s = Rt(new Uint8Array(e)), a = r(s), i = o(s);
1682
1682
  if (i === void 0)
1683
1683
  return console.warn("THREE.USDZLoader: No usda file found."), new z();
1684
- const c = Ae(i), u = t.parse(c);
1684
+ const c = Te(i), u = t.parse(c);
1685
1685
  function l(h) {
1686
1686
  if (h) {
1687
1687
  if ("prepend references" in h) {
@@ -1711,7 +1711,7 @@ class an extends ae {
1711
1711
  }
1712
1712
  function m(h) {
1713
1713
  if (!h) return;
1714
- let p = new ue();
1714
+ let p = new le();
1715
1715
  if ("int[] faceVertexIndices" in h) {
1716
1716
  const g = JSON.parse(h["int[] faceVertexIndices"]);
1717
1717
  p.setIndex(g);
@@ -1738,11 +1738,11 @@ class an extends ae {
1738
1738
  }
1739
1739
  function T(h, p) {
1740
1740
  const g = h.array, A = h.itemSize, w = new g.constructor(p.length * A);
1741
- let le = 0, He = 0;
1742
- for (let Q = 0, Ge = p.length; Q < Ge; Q++) {
1743
- le = p[Q] * A;
1744
- for (let fe = 0; fe < A; fe++)
1745
- w[He++] = g[le++];
1741
+ let fe = 0, He = 0;
1742
+ for (let Z = 0, Ge = p.length; Z < Ge; Z++) {
1743
+ fe = p[Z] * A;
1744
+ for (let de = 0; de < A; de++)
1745
+ w[He++] = g[fe++];
1746
1746
  }
1747
1747
  return new P(w, A);
1748
1748
  }
@@ -1767,7 +1767,7 @@ class an extends ae {
1767
1767
  }
1768
1768
  }
1769
1769
  function x(h, p) {
1770
- p["float inputs:rotation"] && (h.rotation = parseFloat(p["float inputs:rotation"])), p["float2 inputs:scale"] && (h.repeat = new q().fromArray(JSON.parse("[" + p["float2 inputs:scale"].replace(/[()]*/g, "") + "]"))), p["float2 inputs:translation"] && (h.offset = new q().fromArray(JSON.parse("[" + p["float2 inputs:translation"].replace(/[()]*/g, "") + "]")));
1770
+ p["float inputs:rotation"] && (h.rotation = parseFloat(p["float inputs:rotation"])), p["float2 inputs:scale"] && (h.repeat = new Y().fromArray(JSON.parse("[" + p["float2 inputs:scale"].replace(/[()]*/g, "") + "]"))), p["float2 inputs:translation"] && (h.offset = new Y().fromArray(JSON.parse("[" + p["float2 inputs:translation"].replace(/[()]*/g, "") + "]")));
1771
1771
  }
1772
1772
  function E(h) {
1773
1773
  const p = new O();
@@ -1840,14 +1840,14 @@ class an extends ae {
1840
1840
  const p = h["asset inputs:file"].replace(/@*/g, ""), A = new Me().load(a[p]), w = {
1841
1841
  '"clamp"': De,
1842
1842
  '"mirror"': Ne,
1843
- '"repeat"': J
1843
+ '"repeat"': Q
1844
1844
  };
1845
1845
  return "token inputs:wrapS" in h && (A.wrapS = w[h["token inputs:wrapS"]]), "token inputs:wrapT" in h && (A.wrapT = w[h["token inputs:wrapT"]]), A;
1846
1846
  }
1847
1847
  return null;
1848
1848
  }
1849
1849
  function M(h) {
1850
- const p = m(l(h)), g = E(R(h)), A = p ? new Pe(p, g) : new ce();
1850
+ const p = m(l(h)), g = E(R(h)), A = p ? new Pe(p, g) : new ue();
1851
1851
  if ("matrix4d xformOp:transform" in h) {
1852
1852
  const w = JSON.parse("[" + h["matrix4d xformOp:transform"].replace(/[()]*/g, "") + "]");
1853
1853
  A.matrix.fromArray(w), A.matrix.decompose(A.position, A.quaternion, A.scale);
@@ -1867,8 +1867,8 @@ class an extends ae {
1867
1867
  return I(u, L), L;
1868
1868
  }
1869
1869
  }
1870
- const ne = /* @__PURE__ */ new WeakMap();
1871
- class cn extends ae {
1870
+ const se = /* @__PURE__ */ new WeakMap();
1871
+ class cn extends ce {
1872
1872
  constructor(e) {
1873
1873
  super(e), this.decoderPath = "", this.decoderConfig = {}, this.decoderBinary = null, this.decoderPending = null, this.workerLimit = 4, this.workerPool = [], this.workerNextTaskID = 1, this.workerSourceURL = "", this.defaultAttributeIDs = {
1874
1874
  position: "POSITION",
@@ -1891,67 +1891,67 @@ class cn extends ae {
1891
1891
  setWorkerLimit(e) {
1892
1892
  return this.workerLimit = e, this;
1893
1893
  }
1894
- load(e, t, o, s) {
1895
- const r = new K(this.manager);
1896
- r.setPath(this.path), r.setResponseType("arraybuffer"), r.setRequestHeader(this.requestHeader), r.setWithCredentials(this.withCredentials), r.load(e, (n) => {
1897
- this.parse(n, t, s);
1898
- }, o, s);
1894
+ load(e, t, r, n) {
1895
+ const o = new K(this.manager);
1896
+ o.setPath(this.path), o.setResponseType("arraybuffer"), o.setRequestHeader(this.requestHeader), o.setWithCredentials(this.withCredentials), o.load(e, (s) => {
1897
+ this.parse(s, t, n);
1898
+ }, r, n);
1899
1899
  }
1900
- parse(e, t, o = () => {
1900
+ parse(e, t, r = () => {
1901
1901
  }) {
1902
- this.decodeDracoFile(e, t, null, null, N).catch(o);
1902
+ this.decodeDracoFile(e, t, null, null, N).catch(r);
1903
1903
  }
1904
- decodeDracoFile(e, t, o, s, r = D, n = () => {
1904
+ decodeDracoFile(e, t, r, n, o = D, s = () => {
1905
1905
  }) {
1906
1906
  const a = {
1907
- attributeIDs: o || this.defaultAttributeIDs,
1908
- attributeTypes: s || this.defaultAttributeTypes,
1909
- useUniqueIDs: !!o,
1910
- vertexColorSpace: r
1907
+ attributeIDs: r || this.defaultAttributeIDs,
1908
+ attributeTypes: n || this.defaultAttributeTypes,
1909
+ useUniqueIDs: !!r,
1910
+ vertexColorSpace: o
1911
1911
  };
1912
- return this.decodeGeometry(e, a).then(t).catch(n);
1912
+ return this.decodeGeometry(e, a).then(t).catch(s);
1913
1913
  }
1914
1914
  decodeGeometry(e, t) {
1915
- const o = JSON.stringify(t);
1916
- if (ne.has(e)) {
1917
- const i = ne.get(e);
1918
- if (i.key === o)
1915
+ const r = JSON.stringify(t);
1916
+ if (se.has(e)) {
1917
+ const i = se.get(e);
1918
+ if (i.key === r)
1919
1919
  return i.promise;
1920
1920
  if (e.byteLength === 0)
1921
1921
  throw new Error(
1922
1922
  "THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred."
1923
1923
  );
1924
1924
  }
1925
- let s;
1926
- const r = this.workerNextTaskID++, n = e.byteLength, a = this._getWorker(r, n).then((i) => (s = i, new Promise((c, u) => {
1927
- s._callbacks[r] = { resolve: c, reject: u }, s.postMessage({ type: "decode", id: r, taskConfig: t, buffer: e }, [e]);
1925
+ let n;
1926
+ const o = this.workerNextTaskID++, s = e.byteLength, a = this._getWorker(o, s).then((i) => (n = i, new Promise((c, u) => {
1927
+ n._callbacks[o] = { resolve: c, reject: u }, n.postMessage({ type: "decode", id: o, taskConfig: t, buffer: e }, [e]);
1928
1928
  }))).then((i) => this._createGeometry(i.geometry));
1929
1929
  return a.catch(() => !0).then(() => {
1930
- s && r && this._releaseTask(s, r);
1931
- }), ne.set(e, {
1932
- key: o,
1930
+ n && o && this._releaseTask(n, o);
1931
+ }), se.set(e, {
1932
+ key: r,
1933
1933
  promise: a
1934
1934
  }), a;
1935
1935
  }
1936
1936
  _createGeometry(e) {
1937
- const t = new ue();
1937
+ const t = new le();
1938
1938
  e.index && t.setIndex(new P(e.index.array, 1));
1939
- for (let o = 0; o < e.attributes.length; o++) {
1940
- const s = e.attributes[o], r = s.name, n = s.array, a = s.itemSize, i = new P(n, a);
1941
- r === "color" && (this._assignVertexColorSpace(i, s.vertexColorSpace), i.normalized = !(n instanceof Float32Array)), t.setAttribute(r, i);
1939
+ for (let r = 0; r < e.attributes.length; r++) {
1940
+ const n = e.attributes[r], o = n.name, s = n.array, a = n.itemSize, i = new P(s, a);
1941
+ o === "color" && (this._assignVertexColorSpace(i, n.vertexColorSpace), i.normalized = !(s instanceof Float32Array)), t.setAttribute(o, i);
1942
1942
  }
1943
1943
  return t;
1944
1944
  }
1945
1945
  _assignVertexColorSpace(e, t) {
1946
1946
  if (t !== N) return;
1947
- const o = new U();
1948
- for (let s = 0, r = e.count; s < r; s++)
1949
- o.fromBufferAttribute(e, s).convertSRGBToLinear(), e.setXYZ(s, o.r, o.g, o.b);
1947
+ const r = new U();
1948
+ for (let n = 0, o = e.count; n < o; n++)
1949
+ r.fromBufferAttribute(e, n).convertSRGBToLinear(), e.setXYZ(n, r.r, r.g, r.b);
1950
1950
  }
1951
1951
  _loadLibrary(e, t) {
1952
- const o = new K(this.manager);
1953
- return o.setPath(this.decoderPath), o.setResponseType(t), o.setWithCredentials(this.withCredentials), new Promise((s, r) => {
1954
- o.load(e, s, void 0, r);
1952
+ const r = new K(this.manager);
1953
+ return r.setPath(this.decoderPath), r.setResponseType(t), r.setWithCredentials(this.withCredentials), new Promise((n, o) => {
1954
+ r.load(e, n, void 0, o);
1955
1955
  });
1956
1956
  }
1957
1957
  preload() {
@@ -1960,43 +1960,43 @@ class cn extends ae {
1960
1960
  _initDecoder() {
1961
1961
  if (this.decoderPending) return this.decoderPending;
1962
1962
  const e = typeof WebAssembly != "object" || this.decoderConfig.type === "js", t = [];
1963
- 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((o) => {
1964
- const s = o[0];
1965
- e || (this.decoderConfig.wasmBinary = o[1]);
1966
- const r = un.toString(), n = [
1963
+ 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((r) => {
1964
+ const n = r[0];
1965
+ e || (this.decoderConfig.wasmBinary = r[1]);
1966
+ const o = un.toString(), s = [
1967
1967
  "/* draco decoder */",
1968
- s,
1968
+ n,
1969
1969
  "",
1970
1970
  "/* worker */",
1971
- r.substring(r.indexOf("{") + 1, r.lastIndexOf("}"))
1971
+ o.substring(o.indexOf("{") + 1, o.lastIndexOf("}"))
1972
1972
  ].join(`
1973
1973
  `);
1974
- this.workerSourceURL = URL.createObjectURL(new Blob([n]));
1974
+ this.workerSourceURL = URL.createObjectURL(new Blob([s]));
1975
1975
  }), this.decoderPending;
1976
1976
  }
1977
1977
  _getWorker(e, t) {
1978
1978
  return this._initDecoder().then(() => {
1979
1979
  if (this.workerPool.length < this.workerLimit) {
1980
- const s = new Worker(this.workerSourceURL);
1981
- s._callbacks = {}, s._taskCosts = {}, s._taskLoad = 0, s.postMessage({ type: "init", decoderConfig: this.decoderConfig }), s.onmessage = function(r) {
1982
- const n = r.data;
1983
- switch (n.type) {
1980
+ const n = new Worker(this.workerSourceURL);
1981
+ n._callbacks = {}, n._taskCosts = {}, n._taskLoad = 0, n.postMessage({ type: "init", decoderConfig: this.decoderConfig }), n.onmessage = function(o) {
1982
+ const s = o.data;
1983
+ switch (s.type) {
1984
1984
  case "decode":
1985
- s._callbacks[n.id].resolve(n);
1985
+ n._callbacks[s.id].resolve(s);
1986
1986
  break;
1987
1987
  case "error":
1988
- s._callbacks[n.id].reject(n);
1988
+ n._callbacks[s.id].reject(s);
1989
1989
  break;
1990
1990
  default:
1991
- console.error('THREE.DRACOLoader: Unexpected message, "' + n.type + '"');
1991
+ console.error('THREE.DRACOLoader: Unexpected message, "' + s.type + '"');
1992
1992
  }
1993
- }, this.workerPool.push(s);
1993
+ }, this.workerPool.push(n);
1994
1994
  } else
1995
- this.workerPool.sort(function(s, r) {
1996
- return s._taskLoad > r._taskLoad ? -1 : 1;
1995
+ this.workerPool.sort(function(n, o) {
1996
+ return n._taskLoad > o._taskLoad ? -1 : 1;
1997
1997
  });
1998
- const o = this.workerPool[this.workerPool.length - 1];
1999
- return o._taskCosts[e] = t, o._taskLoad += t, o;
1998
+ const r = this.workerPool[this.workerPool.length - 1];
1999
+ return r._taskCosts[e] = t, r._taskLoad += t, r;
2000
2000
  });
2001
2001
  }
2002
2002
  _releaseTask(e, t) {
@@ -2013,8 +2013,8 @@ class cn extends ae {
2013
2013
  }
2014
2014
  function un() {
2015
2015
  let d, e;
2016
- onmessage = function(n) {
2017
- const a = n.data;
2016
+ onmessage = function(s) {
2017
+ const a = s.data;
2018
2018
  switch (a.type) {
2019
2019
  case "init":
2020
2020
  d = a.decoderConfig, e = new Promise(function(u) {
@@ -2039,14 +2039,14 @@ function un() {
2039
2039
  break;
2040
2040
  }
2041
2041
  };
2042
- function t(n, a, i, c) {
2042
+ function t(s, a, i, c) {
2043
2043
  const u = c.attributeIDs, l = c.attributeTypes;
2044
2044
  let f, m;
2045
2045
  const T = a.GetEncodedGeometryType(i);
2046
- if (T === n.TRIANGULAR_MESH)
2047
- f = new n.Mesh(), m = a.DecodeArrayToMesh(i, i.byteLength, f);
2048
- else if (T === n.POINT_CLOUD)
2049
- f = new n.PointCloud(), m = a.DecodeArrayToPointCloud(i, i.byteLength, f);
2046
+ if (T === s.TRIANGULAR_MESH)
2047
+ f = new s.Mesh(), m = a.DecodeArrayToMesh(i, i.byteLength, f);
2048
+ else if (T === s.POINT_CLOUD)
2049
+ f = new s.PointCloud(), m = a.DecodeArrayToPointCloud(i, i.byteLength, f);
2050
2050
  else
2051
2051
  throw new Error("THREE.DRACOLoader: Unexpected geometry type.");
2052
2052
  if (!m.ok() || f.ptr === 0)
@@ -2058,53 +2058,53 @@ function un() {
2058
2058
  if (c.useUniqueIDs)
2059
2059
  S = u[y], E = a.GetAttributeByUniqueId(f, S);
2060
2060
  else {
2061
- if (S = a.GetAttributeId(f, n[u[y]]), S === -1) continue;
2061
+ if (S = a.GetAttributeId(f, s[u[y]]), S === -1) continue;
2062
2062
  E = a.GetAttribute(f, S);
2063
2063
  }
2064
- const _ = s(n, a, f, y, x, E);
2064
+ const _ = n(s, a, f, y, x, E);
2065
2065
  y === "color" && (_.vertexColorSpace = c.vertexColorSpace), R.attributes.push(_);
2066
2066
  }
2067
- return T === n.TRIANGULAR_MESH && (R.index = o(n, a, f)), n.destroy(f), R;
2067
+ return T === s.TRIANGULAR_MESH && (R.index = r(s, a, f)), s.destroy(f), R;
2068
2068
  }
2069
- function o(n, a, i) {
2070
- const u = i.num_faces() * 3, l = u * 4, f = n._malloc(l);
2069
+ function r(s, a, i) {
2070
+ const u = i.num_faces() * 3, l = u * 4, f = s._malloc(l);
2071
2071
  a.GetTrianglesUInt32Array(i, l, f);
2072
- const m = new Uint32Array(n.HEAPF32.buffer, f, u).slice();
2073
- return n._free(f), { array: m, itemSize: 1 };
2072
+ const m = new Uint32Array(s.HEAPF32.buffer, f, u).slice();
2073
+ return s._free(f), { array: m, itemSize: 1 };
2074
2074
  }
2075
- function s(n, a, i, c, u, l) {
2076
- const f = l.num_components(), T = i.num_points() * f, R = T * u.BYTES_PER_ELEMENT, y = r(n, u), x = n._malloc(R);
2075
+ function n(s, a, i, c, u, l) {
2076
+ const f = l.num_components(), T = i.num_points() * f, R = T * u.BYTES_PER_ELEMENT, y = o(s, u), x = s._malloc(R);
2077
2077
  a.GetAttributeDataArrayForAllPoints(i, l, y, R, x);
2078
- const E = new u(n.HEAPF32.buffer, x, T).slice();
2079
- return n._free(x), {
2078
+ const E = new u(s.HEAPF32.buffer, x, T).slice();
2079
+ return s._free(x), {
2080
2080
  name: c,
2081
2081
  array: E,
2082
2082
  itemSize: f
2083
2083
  };
2084
2084
  }
2085
- function r(n, a) {
2085
+ function o(s, a) {
2086
2086
  switch (a) {
2087
2087
  case Float32Array:
2088
- return n.DT_FLOAT32;
2088
+ return s.DT_FLOAT32;
2089
2089
  case Int8Array:
2090
- return n.DT_INT8;
2090
+ return s.DT_INT8;
2091
2091
  case Int16Array:
2092
- return n.DT_INT16;
2092
+ return s.DT_INT16;
2093
2093
  case Int32Array:
2094
- return n.DT_INT32;
2094
+ return s.DT_INT32;
2095
2095
  case Uint8Array:
2096
- return n.DT_UINT8;
2096
+ return s.DT_UINT8;
2097
2097
  case Uint16Array:
2098
- return n.DT_UINT16;
2098
+ return s.DT_UINT16;
2099
2099
  case Uint32Array:
2100
- return n.DT_UINT32;
2100
+ return s.DT_UINT32;
2101
2101
  }
2102
2102
  }
2103
2103
  }
2104
2104
  function ln() {
2105
2105
  let d, e;
2106
- onmessage = function(n) {
2107
- const a = n.data;
2106
+ onmessage = function(s) {
2107
+ const a = s.data;
2108
2108
  switch (a.type) {
2109
2109
  case "init":
2110
2110
  d = a.decoderConfig, e = new Promise(function(u) {
@@ -2143,18 +2143,18 @@ function ln() {
2143
2143
  break;
2144
2144
  }
2145
2145
  };
2146
- function t(n, a, i, c) {
2146
+ function t(s, a, i, c) {
2147
2147
  const u = c.attributeIDs, l = c.attributeTypes;
2148
2148
  let f, m;
2149
2149
  const T = a.GetEncodedGeometryType(i);
2150
- if (T === n.TRIANGULAR_MESH)
2151
- f = new n.Mesh(), m = a.DecodeArrayToMesh(
2150
+ if (T === s.TRIANGULAR_MESH)
2151
+ f = new s.Mesh(), m = a.DecodeArrayToMesh(
2152
2152
  i,
2153
2153
  i.byteLength,
2154
2154
  f
2155
2155
  );
2156
- else if (T === n.POINT_CLOUD)
2157
- f = new n.PointCloud(), m = a.DecodeArrayToPointCloud(
2156
+ else if (T === s.POINT_CLOUD)
2157
+ f = new s.PointCloud(), m = a.DecodeArrayToPointCloud(
2158
2158
  i,
2159
2159
  i.byteLength,
2160
2160
  f
@@ -2177,12 +2177,12 @@ function ln() {
2177
2177
  else {
2178
2178
  if (S = a.GetAttributeId(
2179
2179
  f,
2180
- n[u[y]]
2180
+ s[u[y]]
2181
2181
  ), S === -1) continue;
2182
2182
  E = a.GetAttribute(f, S);
2183
2183
  }
2184
- const _ = s(
2185
- n,
2184
+ const _ = n(
2185
+ s,
2186
2186
  a,
2187
2187
  f,
2188
2188
  y,
@@ -2191,20 +2191,20 @@ function ln() {
2191
2191
  );
2192
2192
  y === "color" && (_.vertexColorSpace = c.vertexColorSpace), R.attributes.push(_);
2193
2193
  }
2194
- return T === n.TRIANGULAR_MESH && (R.index = o(n, a, f)), n.destroy(f), R;
2194
+ return T === s.TRIANGULAR_MESH && (R.index = r(s, a, f)), s.destroy(f), R;
2195
2195
  }
2196
- function o(n, a, i) {
2197
- const u = i.num_faces() * 3, l = u * 4, f = n._malloc(l);
2196
+ function r(s, a, i) {
2197
+ const u = i.num_faces() * 3, l = u * 4, f = s._malloc(l);
2198
2198
  a.GetTrianglesUInt32Array(i, l, f);
2199
2199
  const m = new Uint32Array(
2200
- n.HEAPF32.buffer,
2200
+ s.HEAPF32.buffer,
2201
2201
  f,
2202
2202
  u
2203
2203
  ).slice();
2204
- return n._free(f), { array: m, itemSize: 1 };
2204
+ return s._free(f), { array: m, itemSize: 1 };
2205
2205
  }
2206
- function s(n, a, i, c, u, l) {
2207
- const f = l.num_components(), T = i.num_points() * f, R = T * u.BYTES_PER_ELEMENT, y = r(n, u), x = n._malloc(R);
2206
+ function n(s, a, i, c, u, l) {
2207
+ const f = l.num_components(), T = i.num_points() * f, R = T * u.BYTES_PER_ELEMENT, y = o(s, u), x = s._malloc(R);
2208
2208
  a.GetAttributeDataArrayForAllPoints(
2209
2209
  i,
2210
2210
  l,
@@ -2213,36 +2213,36 @@ function ln() {
2213
2213
  x
2214
2214
  );
2215
2215
  const E = new u(
2216
- n.HEAPF32.buffer,
2216
+ s.HEAPF32.buffer,
2217
2217
  x,
2218
2218
  T
2219
2219
  ).slice();
2220
- return n._free(x), {
2220
+ return s._free(x), {
2221
2221
  name: c,
2222
2222
  array: E,
2223
2223
  itemSize: f
2224
2224
  };
2225
2225
  }
2226
- function r(n, a) {
2226
+ function o(s, a) {
2227
2227
  switch (a) {
2228
2228
  case Float32Array:
2229
- return n.DT_FLOAT32;
2229
+ return s.DT_FLOAT32;
2230
2230
  case Int8Array:
2231
- return n.DT_INT8;
2231
+ return s.DT_INT8;
2232
2232
  case Int16Array:
2233
- return n.DT_INT16;
2233
+ return s.DT_INT16;
2234
2234
  case Int32Array:
2235
- return n.DT_INT32;
2235
+ return s.DT_INT32;
2236
2236
  case Uint8Array:
2237
- return n.DT_UINT8;
2237
+ return s.DT_UINT8;
2238
2238
  case Uint16Array:
2239
- return n.DT_UINT16;
2239
+ return s.DT_UINT16;
2240
2240
  case Uint32Array:
2241
- return n.DT_UINT32;
2241
+ return s.DT_UINT32;
2242
2242
  }
2243
2243
  }
2244
2244
  }
2245
- const se = {
2245
+ const re = {
2246
2246
  LOAD_DRACO_JS_DECODER: async () => (await import("./draco_decoder-CEzwqP9o.mjs")).default,
2247
2247
  LOAD_DRACO_WASM_WRAPPER: async () => (await import("./draco_wasm_wrapper-yQy2VLhb.mjs")).default,
2248
2248
  LOAD_DRACO_WASM_DECODER: async () => {
@@ -2262,23 +2262,23 @@ class fn extends cn {
2262
2262
  }
2263
2263
  async _initDecoder() {
2264
2264
  if (this.decoderPending) return this.decoderPending;
2265
- const t = typeof WebAssembly != "object" || this.decoderConfig.type === "js", o = [];
2266
- return t ? o.push(
2267
- se.LOAD_DRACO_JS_DECODER()
2268
- ) : (o.push(
2269
- se.LOAD_DRACO_WASM_WRAPPER()
2270
- ), o.push(
2271
- se.LOAD_DRACO_WASM_DECODER()
2272
- )), this.decoderPending = Promise.all(o).then(
2273
- (s) => {
2274
- const r = s[0];
2275
- t || (this.decoderConfig.wasmBinary = s[1]);
2276
- const n = ln.toString(), a = [
2265
+ const t = typeof WebAssembly != "object" || this.decoderConfig.type === "js", r = [];
2266
+ return t ? r.push(
2267
+ re.LOAD_DRACO_JS_DECODER()
2268
+ ) : (r.push(
2269
+ re.LOAD_DRACO_WASM_WRAPPER()
2270
+ ), r.push(
2271
+ re.LOAD_DRACO_WASM_DECODER()
2272
+ )), this.decoderPending = Promise.all(r).then(
2273
+ (n) => {
2274
+ const o = n[0];
2275
+ t || (this.decoderConfig.wasmBinary = n[1]);
2276
+ const s = ln.toString(), a = [
2277
2277
  "/* draco decoder */",
2278
- r,
2278
+ o,
2279
2279
  "",
2280
2280
  "/* worker */",
2281
- n.substring(n.indexOf("{") + 1, n.lastIndexOf("}"))
2281
+ s.substring(s.indexOf("{") + 1, s.lastIndexOf("}"))
2282
2282
  ].join(`
2283
2283
  `);
2284
2284
  this.workerSourceURL = URL.createObjectURL(new Blob([a]));
@@ -2293,20 +2293,48 @@ class yn {
2293
2293
  const e = new fn();
2294
2294
  e.setDecoderConfig({ type: "wasm" }), this._gltfLoader = new St(), this._gltfLoader.setDRACOLoader(e), this._usdzLoader = new an();
2295
2295
  }
2296
- async load(e) {
2297
- const t = wt(e);
2298
- if (t.length === 0)
2299
- throw new Te("No file extension found in URI", "");
2300
- if (!Et(t))
2301
- throw new Te(
2302
- `Unsupported file type: ${t}. Supported types: ${_t.join(", ")}`,
2303
- t
2296
+ async load(e, t) {
2297
+ let r;
2298
+ if (t)
2299
+ r = t;
2300
+ else if (r = wt(e), r.length === 0 && (r = await this._detectFileTypeFromContent(e), r.length === 0))
2301
+ throw new ye(
2302
+ "No file extension found in URI",
2303
+ ""
2304
2304
  );
2305
- const o = xe.read(e);
2306
- if (o)
2307
- return o.arrayBuffer ? this._parse(o.arrayBuffer, t) : o.promise.then((n) => this._parse(n, t));
2308
- const r = await xe.create(e).load();
2309
- return this._parse(r, t);
2305
+ if (!Et(r))
2306
+ throw new ye(
2307
+ `Unsupported file type: ${r}. Supported types: ${_t.join(", ")}`,
2308
+ r
2309
+ );
2310
+ const n = q.read(e);
2311
+ if (n)
2312
+ return n.arrayBuffer ? this._parse(n.arrayBuffer, r) : n.promise.then((a) => this._parse(a, r));
2313
+ const s = await q.create(e).load();
2314
+ return this._parse(s, r);
2315
+ }
2316
+ /**
2317
+ * Detects file type from content (magic bytes)
2318
+ * @param uri - The URI to load and detect
2319
+ * @returns The detected file extension or empty string if detection fails
2320
+ */
2321
+ async _detectFileTypeFromContent(e) {
2322
+ try {
2323
+ const t = q.read(e);
2324
+ let r;
2325
+ t ? t.arrayBuffer ? r = t.arrayBuffer : r = await t.promise : r = await q.create(e).load();
2326
+ const n = new Uint8Array(r);
2327
+ return n.length >= 12 && String.fromCharCode(
2328
+ n[0],
2329
+ n[1],
2330
+ n[2],
2331
+ n[3]
2332
+ ) === "glTF" ? n[12] === 0 ? "glb" : "gltf" : n.length >= 4 && n[0] === 80 && // 'P'
2333
+ n[1] === 75 && // 'K'
2334
+ (n[2] === 3 || n[2] === 5) && (n[3] === 4 || n[3] === 6) ? "usdz" : "";
2335
+ } catch {
2336
+ return "";
2337
+ }
2310
2338
  }
2311
2339
  /**
2312
2340
  * parse function for the chunk
@@ -2326,11 +2354,11 @@ class yn {
2326
2354
  case "usdz":
2327
2355
  return await this._usdzLoader.parse(e);
2328
2356
  }
2329
- } catch (o) {
2330
- throw o instanceof Error ? new ye(
2331
- `Failed to parse ${t} file: ${o.message}`,
2332
- o
2333
- ) : new ye(`Failed to parse ${t} file`);
2357
+ } catch (r) {
2358
+ throw r instanceof Error ? new xe(
2359
+ `Failed to parse ${t} file: ${r.message}`,
2360
+ r
2361
+ ) : new xe(`Failed to parse ${t} file`);
2334
2362
  }
2335
2363
  }
2336
2364
  }