@shopware-ag/dive 2.2.29 → 2.2.31

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 (38) hide show
  1. package/build/chunks/{AssetCache-5v3VEUpV.cjs → AssetCache-USoLeA8n.cjs} +1 -1
  2. package/build/chunks/{AssetCache-DUmXyTTh.mjs → AssetCache-Yaezy697.mjs} +1 -1
  3. package/build/chunks/{AssetLoader-CAboRD-N.mjs → AssetLoader-CWm-aunM.mjs} +984 -772
  4. package/build/chunks/AssetLoader-CxWzLiHn.cjs +5 -0
  5. package/build/chunks/{FileTypes-BQ2AN2gJ.cjs → FileTypes-D3vblaAa.cjs} +1 -1
  6. package/build/chunks/{FileTypes-OWYPzqcN.mjs → FileTypes-qgM3TaRh.mjs} +25 -9
  7. package/build/chunks/{isFileTypeSupported-BSpswPHU.mjs → isFileTypeSupported-CGTPFOhi.mjs} +6 -5
  8. package/build/chunks/isFileTypeSupported-uAFXvyzy.cjs +1 -0
  9. package/build/chunks/occt-import-js-BQ1yZHCj.cjs +1 -0
  10. package/build/chunks/occt-import-js-D-bjjBtk.mjs +4 -0
  11. package/build/chunks/occt-import-js-DdbbsFBH.cjs +1 -0
  12. package/build/chunks/occt-import-js-ekuHaP1Z.mjs +4 -0
  13. package/build/dive.cjs +1 -1
  14. package/build/dive.mjs +2 -2
  15. package/build/plugins/ar/index.cjs +1 -1
  16. package/build/plugins/ar/index.mjs +1 -1
  17. package/build/plugins/assetcache/index.cjs +1 -1
  18. package/build/plugins/assetcache/index.mjs +1 -1
  19. package/build/plugins/assetexporter/src/AssetExporter.d.ts +4 -0
  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 +1 -0
  23. package/build/plugins/assetloader/src/step/STEPLoader.d.ts +29 -0
  24. package/build/plugins/orbitcontroller/index.cjs +1 -1
  25. package/build/plugins/orbitcontroller/index.mjs +1 -1
  26. package/build/plugins/orientationdisplay/index.cjs +1 -1
  27. package/build/plugins/orientationdisplay/index.mjs +1 -1
  28. package/build/plugins/quickview/index.cjs +1 -1
  29. package/build/plugins/quickview/index.mjs +1 -1
  30. package/build/plugins/state/index.cjs +1 -1
  31. package/build/plugins/state/index.mjs +1 -1
  32. package/build/plugins/toolbox/index.cjs +1 -1
  33. package/build/plugins/toolbox/index.mjs +339 -313
  34. package/build/plugins/toolbox/src/transform/TransformTool.d.ts +18 -2
  35. package/build/types/file/FileTypes.d.ts +16 -0
  36. package/package.json +3 -2
  37. package/build/chunks/AssetLoader-tskoQtbb.cjs +0 -4
  38. package/build/chunks/isFileTypeSupported-CrEqYiv9.cjs +0 -1
@@ -1,28 +1,28 @@
1
- var ve = Object.defineProperty;
2
- var Be = (d, e, t) => e in d ? ve(d, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : d[e] = t;
3
- var v = (d, e, t) => Be(d, typeof e != "symbol" ? e + "" : e, t);
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-OWYPzqcN.mjs";
7
- import { g as wt, i as Et } from "./isFileTypeSupported-BSpswPHU.mjs";
8
- import { F as ye, P as xe } from "./parse-error-DfOPyLWM.mjs";
9
- import { A as q } from "./AssetCache-DUmXyTTh.mjs";
10
- function Re(d, e) {
11
- if (e === je)
1
+ var Be = Object.defineProperty;
2
+ var je = (d, e, t) => e in d ? Be(d, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : d[e] = t;
3
+ var O = (d, e, t) => je(d, typeof e != "symbol" ? e + "" : e, t);
4
+ import { TrianglesDrawMode as Ke, TriangleFanDrawMode as ie, TriangleStripDrawMode as Ie, Loader as le, LoaderUtils as z, FileLoader as W, MeshPhysicalMaterial as P, Vector2 as Y, Color as G, LinearSRGBColorSpace as k, SRGBColorSpace as D, SpotLight as We, PointLight as Ve, DirectionalLight as Xe, Matrix4 as J, Vector3 as j, Quaternion as Ce, InstancedMesh as ze, InstancedBufferAttribute as qe, Object3D as ue, TextureLoader as Ne, ImageBitmapLoader as Ye, BufferAttribute as N, InterleavedBuffer as Je, InterleavedBufferAttribute as Qe, LinearMipmapLinearFilter as Oe, NearestMipmapLinearFilter as Ze, LinearMipmapNearestFilter as $e, NearestMipmapNearestFilter as et, LinearFilter as De, NearestFilter as tt, RepeatWrapping as Q, MirroredRepeatWrapping as ke, ClampToEdgeWrapping as Pe, PointsMaterial as nt, Material as ee, LineBasicMaterial as st, MeshStandardMaterial as fe, DoubleSide as rt, MeshBasicMaterial as X, PropertyBinding as ot, BufferGeometry as Z, SkinnedMesh as it, Mesh as de, LineSegments as at, Line as ct, LineLoop as lt, Points as ut, Group as B, PerspectiveCamera as ft, MathUtils as dt, OrthographicCamera as ht, Skeleton as pt, AnimationClip as mt, Bone as gt, InterpolateDiscrete as At, InterpolateLinear as Fe, Texture as me, VectorKeyframeTrack as ge, NumberKeyframeTrack as Ae, QuaternionKeyframeTrack as Te, ColorManagement as _e, FrontSide as Tt, Interpolant as _t, Box3 as yt, Sphere as wt, NoColorSpace as H } from "three";
5
+ import { u as Rt, a as ye } from "./fflate.module-xyO_T3Zm.mjs";
6
+ import { S as xt } from "./FileTypes-qgM3TaRh.mjs";
7
+ import { g as Et, i as St } from "./isFileTypeSupported-CGTPFOhi.mjs";
8
+ import { F as we, P as Re } from "./parse-error-DfOPyLWM.mjs";
9
+ import { A as q } from "./AssetCache-Yaezy697.mjs";
10
+ function xe(d, e) {
11
+ if (e === Ke)
12
12
  return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."), d;
13
- if (e === oe || e === be) {
13
+ if (e === ie || e === Ie) {
14
14
  let t = d.getIndex();
15
15
  if (t === null) {
16
- const s = [], a = d.getAttribute("position");
17
- if (a !== void 0) {
18
- for (let i = 0; i < a.count; i++)
19
- s.push(i);
16
+ const s = [], i = d.getAttribute("position");
17
+ if (i !== void 0) {
18
+ for (let a = 0; a < i.count; a++)
19
+ s.push(a);
20
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
24
  const r = t.count - 2, n = [];
25
- if (e === oe)
25
+ if (e === ie)
26
26
  for (let s = 1; s <= r; s++)
27
27
  n.push(t.getX(0)), n.push(t.getX(s)), n.push(t.getX(s + 1));
28
28
  else
@@ -34,40 +34,40 @@ function Re(d, e) {
34
34
  } else
35
35
  return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:", e), d;
36
36
  }
37
- class St extends ce {
37
+ class bt extends le {
38
38
  constructor(e) {
39
39
  super(e), this.dracoLoader = null, this.ktx2Loader = null, this.meshoptDecoder = null, this.pluginCallbacks = [], this.register(function(t) {
40
- return new Ct(t);
41
- }), this.register(function(t) {
42
- return new Gt(t);
40
+ return new Nt(t);
43
41
  }), this.register(function(t) {
44
42
  return new vt(t);
45
43
  }), this.register(function(t) {
46
44
  return new Bt(t);
45
+ }), this.register(function(t) {
46
+ return new jt(t);
47
47
  }), this.register(function(t) {
48
48
  return new Dt(t);
49
49
  }), this.register(function(t) {
50
- return new Ot(t);
50
+ return new kt(t);
51
51
  }), this.register(function(t) {
52
52
  return new Pt(t);
53
53
  }), this.register(function(t) {
54
- return new kt(t);
54
+ return new Ft(t);
55
55
  }), this.register(function(t) {
56
- return new It(t);
56
+ return new Ct(t);
57
57
  }), this.register(function(t) {
58
- return new Ft(t);
58
+ return new Ut(t);
59
59
  }), this.register(function(t) {
60
- return new Nt(t);
60
+ return new Ot(t);
61
61
  }), this.register(function(t) {
62
62
  return new Ht(t);
63
63
  }), this.register(function(t) {
64
- return new Ut(t);
64
+ return new Gt(t);
65
65
  }), this.register(function(t) {
66
- return new Lt(t);
67
- }), this.register(function(t) {
68
- return new jt(t);
66
+ return new Mt(t);
69
67
  }), this.register(function(t) {
70
68
  return new Kt(t);
69
+ }), this.register(function(t) {
70
+ return new Wt(t);
71
71
  });
72
72
  }
73
73
  load(e, t, r, n) {
@@ -76,23 +76,23 @@ class St extends ce {
76
76
  if (this.resourcePath !== "")
77
77
  s = this.resourcePath;
78
78
  else if (this.path !== "") {
79
- const c = X.extractUrlBase(e);
80
- s = X.resolveURL(c, this.path);
79
+ const c = z.extractUrlBase(e);
80
+ s = z.resolveURL(c, this.path);
81
81
  } else
82
- s = X.extractUrlBase(e);
82
+ s = z.extractUrlBase(e);
83
83
  this.manager.itemStart(e);
84
- const a = function(c) {
84
+ const i = function(c) {
85
85
  n ? n(c) : console.error(c), o.manager.itemError(e), o.manager.itemEnd(e);
86
- }, i = new K(this.manager);
87
- i.setPath(this.path), i.setResponseType("arraybuffer"), i.setRequestHeader(this.requestHeader), i.setWithCredentials(this.withCredentials), i.load(e, function(c) {
86
+ }, a = new W(this.manager);
87
+ a.setPath(this.path), a.setResponseType("arraybuffer"), a.setRequestHeader(this.requestHeader), a.setWithCredentials(this.withCredentials), a.load(e, function(c) {
88
88
  try {
89
- o.parse(c, s, function(u) {
90
- t(u), o.manager.itemEnd(e);
91
- }, a);
92
- } catch (u) {
93
- a(u);
89
+ o.parse(c, s, function(l) {
90
+ t(l), o.manager.itemEnd(e);
91
+ }, i);
92
+ } catch (l) {
93
+ i(l);
94
94
  }
95
- }, r, a);
95
+ }, r, i);
96
96
  }
97
97
  setDRACOLoader(e) {
98
98
  return this.dracoLoader = e, this;
@@ -116,27 +116,27 @@ class St extends ce {
116
116
  }
117
117
  parse(e, t, r, n) {
118
118
  let o;
119
- const s = {}, a = {}, i = new TextDecoder();
119
+ const s = {}, i = {}, a = new TextDecoder();
120
120
  if (typeof e == "string")
121
121
  o = JSON.parse(e);
122
122
  else if (e instanceof ArrayBuffer)
123
- if (i.decode(new Uint8Array(e, 0, 4)) === Fe) {
123
+ if (a.decode(new Uint8Array(e, 0, 4)) === Ue) {
124
124
  try {
125
125
  s[b.KHR_BINARY_GLTF] = new Vt(e);
126
- } catch (l) {
127
- n && n(l);
126
+ } catch (u) {
127
+ n && n(u);
128
128
  return;
129
129
  }
130
130
  o = JSON.parse(s[b.KHR_BINARY_GLTF].content);
131
131
  } else
132
- o = JSON.parse(i.decode(e));
132
+ o = JSON.parse(a.decode(e));
133
133
  else
134
134
  o = e;
135
135
  if (o.asset === void 0 || o.asset.version[0] < 2) {
136
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(o, {
139
+ const c = new rn(o, {
140
140
  path: t || this.resourcePath || "",
141
141
  crossOrigin: this.crossOrigin,
142
142
  requestHeader: this.requestHeader,
@@ -145,31 +145,31 @@ class St extends ce {
145
145
  meshoptDecoder: this.meshoptDecoder
146
146
  });
147
147
  c.fileLoader.setRequestHeader(this.requestHeader);
148
- for (let u = 0; u < this.pluginCallbacks.length; u++) {
149
- const l = this.pluginCallbacks[u](c);
150
- l.name || console.error("THREE.GLTFLoader: Invalid plugin found: missing name"), a[l.name] = l, s[l.name] = !0;
148
+ for (let l = 0; l < this.pluginCallbacks.length; l++) {
149
+ const u = this.pluginCallbacks[l](c);
150
+ u.name || console.error("THREE.GLTFLoader: Invalid plugin found: missing name"), i[u.name] = u, s[u.name] = !0;
151
151
  }
152
152
  if (o.extensionsUsed)
153
- for (let u = 0; u < o.extensionsUsed.length; ++u) {
154
- const l = o.extensionsUsed[u], f = o.extensionsRequired || [];
155
- switch (l) {
153
+ for (let l = 0; l < o.extensionsUsed.length; ++l) {
154
+ const u = o.extensionsUsed[l], f = o.extensionsRequired || [];
155
+ switch (u) {
156
156
  case b.KHR_MATERIALS_UNLIT:
157
- s[l] = new Mt();
157
+ s[u] = new It();
158
158
  break;
159
159
  case b.KHR_DRACO_MESH_COMPRESSION:
160
- s[l] = new Wt(o, this.dracoLoader);
160
+ s[u] = new Xt(o, this.dracoLoader);
161
161
  break;
162
162
  case b.KHR_TEXTURE_TRANSFORM:
163
- s[l] = new Xt();
163
+ s[u] = new zt();
164
164
  break;
165
165
  case b.KHR_MESH_QUANTIZATION:
166
- s[l] = new zt();
166
+ s[u] = new qt();
167
167
  break;
168
168
  default:
169
- f.indexOf(l) >= 0 && a[l] === void 0 && console.warn('THREE.GLTFLoader: Unknown extension "' + l + '".');
169
+ f.indexOf(u) >= 0 && i[u] === void 0 && console.warn('THREE.GLTFLoader: Unknown extension "' + u + '".');
170
170
  }
171
171
  }
172
- c.setExtensions(s), c.setPlugins(a), c.parse(r, n);
172
+ c.setExtensions(s), c.setPlugins(i), c.parse(r, n);
173
173
  }
174
174
  parseAsync(e, t) {
175
175
  const r = this;
@@ -178,7 +178,7 @@ class St extends ce {
178
178
  });
179
179
  }
180
180
  }
181
- function bt() {
181
+ function Lt() {
182
182
  let d = {};
183
183
  return {
184
184
  get: function(e) {
@@ -218,7 +218,7 @@ const b = {
218
218
  EXT_MESHOPT_COMPRESSION: "EXT_meshopt_compression",
219
219
  EXT_MESH_GPU_INSTANCING: "EXT_mesh_gpu_instancing"
220
220
  };
221
- class Lt {
221
+ class Mt {
222
222
  constructor(e) {
223
223
  this.parser = e, this.name = b.KHR_LIGHTS_PUNCTUAL, this.cache = { refs: {}, uses: {} };
224
224
  }
@@ -233,59 +233,59 @@ class Lt {
233
233
  const t = this.parser, r = "light:" + e;
234
234
  let n = t.cache.get(r);
235
235
  if (n) return n;
236
- const o = t.json, i = ((o.extensions && o.extensions[this.name] || {}).lights || [])[e];
236
+ const o = t.json, a = ((o.extensions && o.extensions[this.name] || {}).lights || [])[e];
237
237
  let c;
238
- const u = new U(16777215);
239
- i.color !== void 0 && u.setRGB(i.color[0], i.color[1], i.color[2], D);
240
- const l = i.range !== void 0 ? i.range : 0;
241
- switch (i.type) {
238
+ const l = new G(16777215);
239
+ a.color !== void 0 && l.setRGB(a.color[0], a.color[1], a.color[2], k);
240
+ const u = a.range !== void 0 ? a.range : 0;
241
+ switch (a.type) {
242
242
  case "directional":
243
- c = new We(u), c.target.position.set(0, 0, -1), c.add(c.target);
243
+ c = new Xe(l), c.target.position.set(0, 0, -1), c.add(c.target);
244
244
  break;
245
245
  case "point":
246
- c = new Ve(u), c.distance = l;
246
+ c = new Ve(l), c.distance = u;
247
247
  break;
248
248
  case "spot":
249
- c = new Ke(u), c.distance = l, i.spot = i.spot || {}, i.spot.innerConeAngle = i.spot.innerConeAngle !== void 0 ? i.spot.innerConeAngle : 0, i.spot.outerConeAngle = i.spot.outerConeAngle !== void 0 ? i.spot.outerConeAngle : Math.PI / 4, c.angle = i.spot.outerConeAngle, c.penumbra = 1 - i.spot.innerConeAngle / i.spot.outerConeAngle, c.target.position.set(0, 0, -1), c.add(c.target);
249
+ c = new We(l), c.distance = u, a.spot = a.spot || {}, a.spot.innerConeAngle = a.spot.innerConeAngle !== void 0 ? a.spot.innerConeAngle : 0, a.spot.outerConeAngle = a.spot.outerConeAngle !== void 0 ? a.spot.outerConeAngle : Math.PI / 4, c.angle = a.spot.outerConeAngle, c.penumbra = 1 - a.spot.innerConeAngle / a.spot.outerConeAngle, c.target.position.set(0, 0, -1), c.add(c.target);
250
250
  break;
251
251
  default:
252
- throw new Error("THREE.GLTFLoader: Unexpected light type: " + i.type);
252
+ throw new Error("THREE.GLTFLoader: Unexpected light type: " + a.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), n = Promise.resolve(c), t.cache.add(r, n), n;
254
+ return c.position.set(0, 0, 0), c.decay = 2, U(c, a), a.intensity !== void 0 && (c.intensity = a.intensity), c.name = t.createUniqueName(a.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, r = this.parser, o = r.json.nodes[e], a = (o.extensions && o.extensions[this.name] || {}).light;
262
- return a === void 0 ? null : this._loadLight(a).then(function(i) {
263
- return r._getNodeRef(t.cache, a, i);
261
+ const t = this, r = this.parser, o = r.json.nodes[e], i = (o.extensions && o.extensions[this.name] || {}).light;
262
+ return i === void 0 ? null : this._loadLight(i).then(function(a) {
263
+ return r._getNodeRef(t.cache, i, a);
264
264
  });
265
265
  }
266
266
  }
267
- class Mt {
267
+ class It {
268
268
  constructor() {
269
269
  this.name = b.KHR_MATERIALS_UNLIT;
270
270
  }
271
271
  getMaterialType() {
272
- return W;
272
+ return X;
273
273
  }
274
274
  extendParams(e, t, r) {
275
275
  const n = [];
276
- e.color = new U(1, 1, 1), e.opacity = 1;
276
+ e.color = new G(1, 1, 1), e.opacity = 1;
277
277
  const o = t.pbrMetallicRoughness;
278
278
  if (o) {
279
279
  if (Array.isArray(o.baseColorFactor)) {
280
280
  const s = o.baseColorFactor;
281
- e.color.setRGB(s[0], s[1], s[2], D), e.opacity = s[3];
281
+ e.color.setRGB(s[0], s[1], s[2], k), e.opacity = s[3];
282
282
  }
283
- o.baseColorTexture !== void 0 && n.push(r.assignTexture(e, "map", o.baseColorTexture, N));
283
+ o.baseColorTexture !== void 0 && n.push(r.assignTexture(e, "map", o.baseColorTexture, D));
284
284
  }
285
285
  return Promise.all(n);
286
286
  }
287
287
  }
288
- class It {
288
+ class Ct {
289
289
  constructor(e) {
290
290
  this.parser = e, this.name = b.KHR_MATERIALS_EMISSIVE_STRENGTH;
291
291
  }
@@ -297,13 +297,13 @@ class It {
297
297
  return o !== void 0 && (t.emissiveIntensity = o), Promise.resolve();
298
298
  }
299
299
  }
300
- class Ct {
300
+ class Nt {
301
301
  constructor(e) {
302
302
  this.parser = e, this.name = b.KHR_MATERIALS_CLEARCOAT;
303
303
  }
304
304
  getMaterialType(e) {
305
305
  const r = this.parser.json.materials[e];
306
- return !r.extensions || !r.extensions[this.name] ? null : O;
306
+ return !r.extensions || !r.extensions[this.name] ? null : P;
307
307
  }
308
308
  extendMaterialParams(e, t) {
309
309
  const r = this.parser, n = r.json.materials[e];
@@ -311,19 +311,19 @@ class Ct {
311
311
  return Promise.resolve();
312
312
  const o = [], s = n.extensions[this.name];
313
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);
314
+ const i = s.clearcoatNormalTexture.scale;
315
+ t.clearcoatNormalScale = new Y(i, i);
316
316
  }
317
317
  return Promise.all(o);
318
318
  }
319
319
  }
320
- class Nt {
320
+ class Ot {
321
321
  constructor(e) {
322
322
  this.parser = e, this.name = b.KHR_MATERIALS_IRIDESCENCE;
323
323
  }
324
324
  getMaterialType(e) {
325
325
  const r = this.parser.json.materials[e];
326
- return !r.extensions || !r.extensions[this.name] ? null : O;
326
+ return !r.extensions || !r.extensions[this.name] ? null : P;
327
327
  }
328
328
  extendMaterialParams(e, t) {
329
329
  const r = this.parser, n = r.json.materials[e];
@@ -339,29 +339,29 @@ class Dt {
339
339
  }
340
340
  getMaterialType(e) {
341
341
  const r = this.parser.json.materials[e];
342
- return !r.extensions || !r.extensions[this.name] ? null : O;
342
+ return !r.extensions || !r.extensions[this.name] ? null : P;
343
343
  }
344
344
  extendMaterialParams(e, t) {
345
345
  const r = this.parser, n = r.json.materials[e];
346
346
  if (!n.extensions || !n.extensions[this.name])
347
347
  return Promise.resolve();
348
348
  const o = [];
349
- t.sheenColor = new U(0, 0, 0), t.sheenRoughness = 0, t.sheen = 1;
349
+ t.sheenColor = new G(0, 0, 0), t.sheenRoughness = 0, t.sheen = 1;
350
350
  const s = n.extensions[this.name];
351
351
  if (s.sheenColorFactor !== void 0) {
352
- const a = s.sheenColorFactor;
353
- t.sheenColor.setRGB(a[0], a[1], a[2], D);
352
+ const i = s.sheenColorFactor;
353
+ t.sheenColor.setRGB(i[0], i[1], i[2], k);
354
354
  }
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);
355
+ return s.sheenRoughnessFactor !== void 0 && (t.sheenRoughness = s.sheenRoughnessFactor), s.sheenColorTexture !== void 0 && o.push(r.assignTexture(t, "sheenColorMap", s.sheenColorTexture, D)), s.sheenRoughnessTexture !== void 0 && o.push(r.assignTexture(t, "sheenRoughnessMap", s.sheenRoughnessTexture)), Promise.all(o);
356
356
  }
357
357
  }
358
- class Ot {
358
+ class kt {
359
359
  constructor(e) {
360
360
  this.parser = e, this.name = b.KHR_MATERIALS_TRANSMISSION;
361
361
  }
362
362
  getMaterialType(e) {
363
363
  const r = this.parser.json.materials[e];
364
- return !r.extensions || !r.extensions[this.name] ? null : O;
364
+ return !r.extensions || !r.extensions[this.name] ? null : P;
365
365
  }
366
366
  extendMaterialParams(e, t) {
367
367
  const r = this.parser, n = r.json.materials[e];
@@ -377,7 +377,7 @@ class Pt {
377
377
  }
378
378
  getMaterialType(e) {
379
379
  const r = this.parser.json.materials[e];
380
- return !r.extensions || !r.extensions[this.name] ? null : O;
380
+ return !r.extensions || !r.extensions[this.name] ? null : P;
381
381
  }
382
382
  extendMaterialParams(e, t) {
383
383
  const r = this.parser, n = r.json.materials[e];
@@ -385,17 +385,17 @@ class Pt {
385
385
  return Promise.resolve();
386
386
  const o = [], s = n.extensions[this.name];
387
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);
388
+ const i = s.attenuationColor || [1, 1, 1];
389
+ return t.attenuationColor = new G().setRGB(i[0], i[1], i[2], k), Promise.all(o);
390
390
  }
391
391
  }
392
- class kt {
392
+ class Ft {
393
393
  constructor(e) {
394
394
  this.parser = e, this.name = b.KHR_MATERIALS_IOR;
395
395
  }
396
396
  getMaterialType(e) {
397
397
  const r = this.parser.json.materials[e];
398
- return !r.extensions || !r.extensions[this.name] ? null : O;
398
+ return !r.extensions || !r.extensions[this.name] ? null : P;
399
399
  }
400
400
  extendMaterialParams(e, t) {
401
401
  const n = this.parser.json.materials[e];
@@ -405,13 +405,13 @@ class kt {
405
405
  return t.ior = o.ior !== void 0 ? o.ior : 1.5, Promise.resolve();
406
406
  }
407
407
  }
408
- class Ft {
408
+ class Ut {
409
409
  constructor(e) {
410
410
  this.parser = e, this.name = b.KHR_MATERIALS_SPECULAR;
411
411
  }
412
412
  getMaterialType(e) {
413
413
  const r = this.parser.json.materials[e];
414
- return !r.extensions || !r.extensions[this.name] ? null : O;
414
+ return !r.extensions || !r.extensions[this.name] ? null : P;
415
415
  }
416
416
  extendMaterialParams(e, t) {
417
417
  const r = this.parser, n = r.json.materials[e];
@@ -419,17 +419,17 @@ class Ft {
419
419
  return Promise.resolve();
420
420
  const o = [], s = n.extensions[this.name];
421
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);
422
+ const i = s.specularColorFactor || [1, 1, 1];
423
+ return t.specularColor = new G().setRGB(i[0], i[1], i[2], k), s.specularColorTexture !== void 0 && o.push(r.assignTexture(t, "specularColorMap", s.specularColorTexture, D)), Promise.all(o);
424
424
  }
425
425
  }
426
- class Ut {
426
+ class Gt {
427
427
  constructor(e) {
428
428
  this.parser = e, this.name = b.EXT_MATERIALS_BUMP;
429
429
  }
430
430
  getMaterialType(e) {
431
431
  const r = this.parser.json.materials[e];
432
- return !r.extensions || !r.extensions[this.name] ? null : O;
432
+ return !r.extensions || !r.extensions[this.name] ? null : P;
433
433
  }
434
434
  extendMaterialParams(e, t) {
435
435
  const r = this.parser, n = r.json.materials[e];
@@ -445,7 +445,7 @@ class Ht {
445
445
  }
446
446
  getMaterialType(e) {
447
447
  const r = this.parser.json.materials[e];
448
- return !r.extensions || !r.extensions[this.name] ? null : O;
448
+ return !r.extensions || !r.extensions[this.name] ? null : P;
449
449
  }
450
450
  extendMaterialParams(e, t) {
451
451
  const r = this.parser, n = r.json.materials[e];
@@ -455,7 +455,7 @@ class Ht {
455
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
- class Gt {
458
+ class vt {
459
459
  constructor(e) {
460
460
  this.parser = e, this.name = b.KHR_TEXTURE_BASISU;
461
461
  }
@@ -472,7 +472,7 @@ class Gt {
472
472
  return t.loadTextureImage(e, o.source, s);
473
473
  }
474
474
  }
475
- class vt {
475
+ class Bt {
476
476
  constructor(e) {
477
477
  this.parser = e, this.name = b.EXT_TEXTURE_WEBP, this.isSupported = null;
478
478
  }
@@ -480,14 +480,14 @@ class vt {
480
480
  const t = this.name, r = this.parser, n = r.json, o = n.textures[e];
481
481
  if (!o.extensions || !o.extensions[t])
482
482
  return null;
483
- const s = o.extensions[t], a = n.images[s.source];
484
- let i = r.textureLoader;
485
- if (a.uri) {
486
- const c = r.options.manager.getHandler(a.uri);
487
- c !== null && (i = c);
483
+ const s = o.extensions[t], i = n.images[s.source];
484
+ let a = r.textureLoader;
485
+ if (i.uri) {
486
+ const c = r.options.manager.getHandler(i.uri);
487
+ c !== null && (a = c);
488
488
  }
489
489
  return this.detectSupport().then(function(c) {
490
- if (c) return r.loadTextureImage(e, s.source, i);
490
+ if (c) return r.loadTextureImage(e, s.source, a);
491
491
  if (n.extensionsRequired && n.extensionsRequired.indexOf(t) >= 0)
492
492
  throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");
493
493
  return r.loadTexture(e);
@@ -502,7 +502,7 @@ class vt {
502
502
  })), this.isSupported;
503
503
  }
504
504
  }
505
- class Bt {
505
+ class jt {
506
506
  constructor(e) {
507
507
  this.parser = e, this.name = b.EXT_TEXTURE_AVIF, this.isSupported = null;
508
508
  }
@@ -510,14 +510,14 @@ class Bt {
510
510
  const t = this.name, r = this.parser, n = r.json, o = n.textures[e];
511
511
  if (!o.extensions || !o.extensions[t])
512
512
  return null;
513
- const s = o.extensions[t], a = n.images[s.source];
514
- let i = r.textureLoader;
515
- if (a.uri) {
516
- const c = r.options.manager.getHandler(a.uri);
517
- c !== null && (i = c);
513
+ const s = o.extensions[t], i = n.images[s.source];
514
+ let a = r.textureLoader;
515
+ if (i.uri) {
516
+ const c = r.options.manager.getHandler(i.uri);
517
+ c !== null && (a = c);
518
518
  }
519
519
  return this.detectSupport().then(function(c) {
520
- if (c) return r.loadTextureImage(e, s.source, i);
520
+ if (c) return r.loadTextureImage(e, s.source, a);
521
521
  if (n.extensionsRequired && n.extensionsRequired.indexOf(t) >= 0)
522
522
  throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");
523
523
  return r.loadTexture(e);
@@ -532,7 +532,7 @@ class Bt {
532
532
  })), this.isSupported;
533
533
  }
534
534
  }
535
- class jt {
535
+ class Kt {
536
536
  constructor(e) {
537
537
  this.name = b.EXT_MESHOPT_COMPRESSION, this.parser = e;
538
538
  }
@@ -545,20 +545,20 @@ class jt {
545
545
  throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");
546
546
  return null;
547
547
  }
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
- return m.buffer;
548
+ return o.then(function(i) {
549
+ const a = n.byteOffset || 0, c = n.byteLength || 0, l = n.count, u = n.byteStride, f = new Uint8Array(i, a, c);
550
+ return s.decodeGltfBufferAsync ? s.decodeGltfBufferAsync(l, u, f, n.mode, n.filter).then(function(p) {
551
+ return p.buffer;
552
552
  }) : s.ready.then(function() {
553
- const m = new ArrayBuffer(u * l);
554
- return s.decodeGltfBuffer(new Uint8Array(m), u, l, f, n.mode, n.filter), m;
553
+ const p = new ArrayBuffer(l * u);
554
+ return s.decodeGltfBuffer(new Uint8Array(p), l, u, f, n.mode, n.filter), p;
555
555
  });
556
556
  });
557
557
  } else
558
558
  return null;
559
559
  }
560
560
  }
561
- class Kt {
561
+ class Wt {
562
562
  constructor(e) {
563
563
  this.name = b.EXT_MESH_GPU_INSTANCING, this.parser = e;
564
564
  }
@@ -570,27 +570,27 @@ class Kt {
570
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 s = r.extensions[this.name].attributes, a = [], i = {};
573
+ const s = r.extensions[this.name].attributes, i = [], a = {};
574
574
  for (const c in s)
575
- a.push(this.parser.getDependency("accessor", s[c]).then((u) => (i[c] = u, i[c])));
576
- return a.length < 1 ? null : (a.push(this.parser.createNodeMesh(e)), Promise.all(a).then((c) => {
577
- const u = c.pop(), l = u.isGroup ? u.children : [u], f = c[0].count, m = [];
578
- for (const T of l) {
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
- for (let _ = 0; _ < f; _++)
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
- for (const _ in i)
583
- if (_ === "_COLOR_0") {
584
- const M = i[_];
585
- S.instanceColor = new ze(M.array, M.itemSize, M.normalized);
586
- } else _ !== "TRANSLATION" && _ !== "ROTATION" && _ !== "SCALE" && T.geometry.setAttribute(_, i[_]);
587
- ue.prototype.copy.call(S, T), this.parser.assignFinalMaterial(S), m.push(S);
575
+ i.push(this.parser.getDependency("accessor", s[c]).then((l) => (a[c] = l, a[c])));
576
+ return i.length < 1 ? null : (i.push(this.parser.createNodeMesh(e)), Promise.all(i).then((c) => {
577
+ const l = c.pop(), u = l.isGroup ? l.children : [l], f = c[0].count, p = [];
578
+ for (const T of u) {
579
+ const w = new J(), _ = new j(), y = new Ce(), E = new j(1, 1, 1), S = new ze(T.geometry, T.material, f);
580
+ for (let R = 0; R < f; R++)
581
+ a.TRANSLATION && _.fromBufferAttribute(a.TRANSLATION, R), a.ROTATION && y.fromBufferAttribute(a.ROTATION, R), a.SCALE && E.fromBufferAttribute(a.SCALE, R), S.setMatrixAt(R, w.compose(_, y, E));
582
+ for (const R in a)
583
+ if (R === "_COLOR_0") {
584
+ const M = a[R];
585
+ S.instanceColor = new qe(M.array, M.itemSize, M.normalized);
586
+ } else R !== "TRANSLATION" && R !== "ROTATION" && R !== "SCALE" && T.geometry.setAttribute(R, a[R]);
587
+ ue.prototype.copy.call(S, T), this.parser.assignFinalMaterial(S), p.push(S);
588
588
  }
589
- return u.isGroup ? (u.clear(), u.add(...m), u) : m[0];
589
+ return l.isGroup ? (l.clear(), l.add(...p), l) : p[0];
590
590
  }));
591
591
  }
592
592
  }
593
- const Fe = "glTF", V = 12, _e = { JSON: 1313821514, BIN: 5130562 };
593
+ const Ue = "glTF", V = 12, Ee = { 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;
@@ -599,62 +599,62 @@ class Vt {
599
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
- }, this.header.magic !== Fe)
602
+ }, this.header.magic !== Ue)
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
606
  const n = this.header.length - V, o = new DataView(e, V);
607
607
  let s = 0;
608
608
  for (; s < n; ) {
609
- const a = o.getUint32(s, !0);
610
- s += 4;
611
609
  const i = o.getUint32(s, !0);
612
- if (s += 4, i === _e.JSON) {
613
- const c = new Uint8Array(e, V + s, a);
610
+ s += 4;
611
+ const a = o.getUint32(s, !0);
612
+ if (s += 4, a === Ee.JSON) {
613
+ const c = new Uint8Array(e, V + s, i);
614
614
  this.content = r.decode(c);
615
- } else if (i === _e.BIN) {
615
+ } else if (a === Ee.BIN) {
616
616
  const c = V + s;
617
- this.body = e.slice(c, c + a);
617
+ this.body = e.slice(c, c + i);
618
618
  }
619
- s += a;
619
+ s += i;
620
620
  }
621
621
  if (this.content === null)
622
622
  throw new Error("THREE.GLTFLoader: JSON content not found.");
623
623
  }
624
624
  }
625
- class Wt {
625
+ class Xt {
626
626
  constructor(e, t) {
627
627
  if (!t)
628
628
  throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");
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 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
- }
637
- for (const u in e.attributes) {
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
- c[l] = m.name, i[l] = f.normalized === !0;
632
+ const r = this.json, n = this.dracoLoader, o = e.extensions[this.name].bufferView, s = e.extensions[this.name].attributes, i = {}, a = {}, c = {};
633
+ for (const l in s) {
634
+ const u = ae[l] || l.toLowerCase();
635
+ i[u] = s[l];
636
+ }
637
+ for (const l in e.attributes) {
638
+ const u = ae[l] || l.toLowerCase();
639
+ if (s[l] !== void 0) {
640
+ const f = r.accessors[e.attributes[l]], p = K[f.componentType];
641
+ c[u] = p.name, a[u] = f.normalized === !0;
642
642
  }
643
643
  }
644
- return t.getDependency("bufferView", o).then(function(u) {
645
- return new Promise(function(l, f) {
646
- n.decodeDracoFile(u, function(m) {
647
- for (const T in m.attributes) {
648
- const R = m.attributes[T], y = i[T];
649
- y !== void 0 && (R.normalized = y);
644
+ return t.getDependency("bufferView", o).then(function(l) {
645
+ return new Promise(function(u, f) {
646
+ n.decodeDracoFile(l, function(p) {
647
+ for (const T in p.attributes) {
648
+ const w = p.attributes[T], _ = a[T];
649
+ _ !== void 0 && (w.normalized = _);
650
650
  }
651
- l(m);
652
- }, a, c, D, f);
651
+ u(p);
652
+ }, i, c, k, f);
653
653
  });
654
654
  });
655
655
  }
656
656
  }
657
- class Xt {
657
+ class zt {
658
658
  constructor() {
659
659
  this.name = b.KHR_TEXTURE_TRANSFORM;
660
660
  }
@@ -662,12 +662,12 @@ class Xt {
662
662
  return (t.texCoord === void 0 || t.texCoord === e.channel) && t.offset === void 0 && t.rotation === void 0 && t.scale === void 0 || (e = e.clone(), t.texCoord !== void 0 && (e.channel = t.texCoord), t.offset !== void 0 && e.offset.fromArray(t.offset), t.rotation !== void 0 && (e.rotation = t.rotation), t.scale !== void 0 && e.repeat.fromArray(t.scale), e.needsUpdate = !0), e;
663
663
  }
664
664
  }
665
- class zt {
665
+ class qt {
666
666
  constructor() {
667
667
  this.name = b.KHR_MESH_QUANTIZATION;
668
668
  }
669
669
  }
670
- class Ue extends Tt {
670
+ class Ge extends _t {
671
671
  constructor(e, t, r, n) {
672
672
  super(e, t, r, n);
673
673
  }
@@ -678,19 +678,19 @@ class Ue extends Tt {
678
678
  return t;
679
679
  }
680
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
- for (let _ = 0; _ !== a; _++) {
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;
681
+ const o = this.resultBuffer, s = this.sampleValues, i = this.valueSize, a = i * 2, c = i * 3, l = n - t, u = (r - t) / l, f = u * u, p = f * u, T = e * c, w = T - c, _ = -2 * p + 3 * f, y = p - f, E = 1 - _, S = y - f + u;
682
+ for (let R = 0; R !== i; R++) {
683
+ const M = s[w + R + i], I = s[w + R + a] * l, L = s[T + R + i], h = s[T + R] * l;
684
+ o[R] = E * M + S * I + _ * L + y * h;
685
685
  }
686
686
  return o;
687
687
  }
688
688
  }
689
- const qt = new Le();
690
- class Yt extends Ue {
689
+ const Yt = new Ce();
690
+ class Jt extends Ge {
691
691
  interpolate_(e, t, r, n) {
692
692
  const o = super.interpolate_(e, t, r, n);
693
- return qt.fromArray(o).normalize().toArray(o), o;
693
+ return Yt.fromArray(o).normalize().toArray(o), o;
694
694
  }
695
695
  }
696
696
  const C = {
@@ -701,25 +701,25 @@ const C = {
701
701
  TRIANGLES: 4,
702
702
  TRIANGLE_STRIP: 5,
703
703
  TRIANGLE_FAN: 6
704
- }, j = {
704
+ }, K = {
705
705
  5120: Int8Array,
706
706
  5121: Uint8Array,
707
707
  5122: Int16Array,
708
708
  5123: Uint16Array,
709
709
  5125: Uint32Array,
710
710
  5126: Float32Array
711
- }, we = {
712
- 9728: et,
713
- 9729: Ce,
714
- 9984: $e,
715
- 9985: Ze,
716
- 9986: Qe,
717
- 9987: Ie
718
- }, Ee = {
719
- 33071: De,
720
- 33648: Ne,
711
+ }, Se = {
712
+ 9728: tt,
713
+ 9729: De,
714
+ 9984: et,
715
+ 9985: $e,
716
+ 9986: Ze,
717
+ 9987: Oe
718
+ }, be = {
719
+ 33071: Pe,
720
+ 33648: ke,
721
721
  10497: Q
722
- }, ee = {
722
+ }, te = {
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
- }, ie = {
730
+ }, ae = {
731
731
  POSITION: "position",
732
732
  NORMAL: "normal",
733
733
  TANGENT: "tangent",
@@ -738,73 +738,73 @@ const C = {
738
738
  COLOR_0: "color",
739
739
  WEIGHTS_0: "skinWeight",
740
740
  JOINTS_0: "skinIndex"
741
- }, k = {
741
+ }, F = {
742
742
  scale: "scale",
743
743
  translation: "position",
744
744
  rotation: "quaternion",
745
745
  weights: "morphTargetInfluences"
746
- }, Jt = {
746
+ }, Qt = {
747
747
  CUBICSPLINE: void 0,
748
748
  // We use a custom interpolant (GLTFCubicSplineInterpolation) for CUBICSPLINE tracks. Each
749
749
  // keyframe track will be initialized with a default interpolation type, then modified.
750
- LINEAR: ke,
751
- STEP: gt
752
- }, te = {
750
+ LINEAR: Fe,
751
+ STEP: At
752
+ }, ne = {
753
753
  OPAQUE: "OPAQUE",
754
754
  MASK: "MASK",
755
755
  BLEND: "BLEND"
756
756
  };
757
- function Qt(d) {
758
- return d.DefaultMaterial === void 0 && (d.DefaultMaterial = new Oe({
757
+ function Zt(d) {
758
+ return d.DefaultMaterial === void 0 && (d.DefaultMaterial = new fe({
759
759
  color: 16777215,
760
760
  emissive: 0,
761
761
  metalness: 1,
762
762
  roughness: 1,
763
763
  transparent: !1,
764
764
  depthTest: !0,
765
- side: At
765
+ side: Tt
766
766
  })), d.DefaultMaterial;
767
767
  }
768
- function G(d, e, t) {
768
+ function v(d, e, t) {
769
769
  for (const r in t.extensions)
770
770
  d[r] === void 0 && (e.userData.gltfExtensions = e.userData.gltfExtensions || {}, e.userData.gltfExtensions[r] = t.extensions[r]);
771
771
  }
772
- function F(d, e) {
772
+ function U(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
- function Zt(d, e, t) {
775
+ function $t(d, e, t) {
776
776
  let r = !1, n = !1, o = !1;
777
- for (let c = 0, u = e.length; c < u; c++) {
778
- const l = e[c];
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;
777
+ for (let c = 0, l = e.length; c < l; c++) {
778
+ const u = e[c];
779
+ if (u.POSITION !== void 0 && (r = !0), u.NORMAL !== void 0 && (n = !0), u.COLOR_0 !== void 0 && (o = !0), r && n && o) break;
780
780
  }
781
781
  if (!r && !n && !o) return Promise.resolve(d);
782
- const s = [], a = [], i = [];
783
- for (let c = 0, u = e.length; c < u; c++) {
784
- const l = e[c];
782
+ const s = [], i = [], a = [];
783
+ for (let c = 0, l = e.length; c < l; c++) {
784
+ const u = e[c];
785
785
  if (r) {
786
- const f = l.POSITION !== void 0 ? t.getDependency("accessor", l.POSITION) : d.attributes.position;
786
+ const f = u.POSITION !== void 0 ? t.getDependency("accessor", u.POSITION) : d.attributes.position;
787
787
  s.push(f);
788
788
  }
789
789
  if (n) {
790
- const f = l.NORMAL !== void 0 ? t.getDependency("accessor", l.NORMAL) : d.attributes.normal;
791
- a.push(f);
790
+ const f = u.NORMAL !== void 0 ? t.getDependency("accessor", u.NORMAL) : d.attributes.normal;
791
+ i.push(f);
792
792
  }
793
793
  if (o) {
794
- const f = l.COLOR_0 !== void 0 ? t.getDependency("accessor", l.COLOR_0) : d.attributes.color;
795
- i.push(f);
794
+ const f = u.COLOR_0 !== void 0 ? t.getDependency("accessor", u.COLOR_0) : d.attributes.color;
795
+ a.push(f);
796
796
  }
797
797
  }
798
798
  return Promise.all([
799
799
  Promise.all(s),
800
- Promise.all(a),
801
- Promise.all(i)
800
+ Promise.all(i),
801
+ Promise.all(a)
802
802
  ]).then(function(c) {
803
- const u = c[0], l = c[1], f = c[2];
804
- return r && (d.morphAttributes.position = u), n && (d.morphAttributes.normal = l), o && (d.morphAttributes.color = f), d.morphTargetsRelative = !0, d;
803
+ const l = c[0], u = c[1], f = c[2];
804
+ return r && (d.morphAttributes.position = l), n && (d.morphAttributes.normal = u), o && (d.morphAttributes.color = f), d.morphTargetsRelative = !0, d;
805
805
  });
806
806
  }
807
- function $t(d, e) {
807
+ function en(d, e) {
808
808
  if (d.updateMorphTargets(), e.weights !== void 0)
809
809
  for (let t = 0, r = e.weights.length; t < r; t++)
810
810
  d.morphTargetInfluences[t] = e.weights[t];
@@ -818,22 +818,22 @@ function $t(d, e) {
818
818
  console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.");
819
819
  }
820
820
  }
821
- function en(d) {
821
+ function tn(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 + ":" + ne(t.attributes) : e = d.indices + ":" + ne(d.attributes) + ":" + d.mode, d.targets !== void 0)
824
+ if (t ? e = "draco:" + t.bufferView + ":" + t.indices + ":" + se(t.attributes) : e = d.indices + ":" + se(d.attributes) + ":" + d.mode, d.targets !== void 0)
825
825
  for (let r = 0, n = d.targets.length; r < n; r++)
826
- e += ":" + ne(d.targets[r]);
826
+ e += ":" + se(d.targets[r]);
827
827
  return e;
828
828
  }
829
- function ne(d) {
829
+ function se(d) {
830
830
  let e = "";
831
831
  const t = Object.keys(d).sort();
832
832
  for (let r = 0, n = t.length; r < n; r++)
833
833
  e += t[r] + ":" + d[t[r]] + ";";
834
834
  return e;
835
835
  }
836
- function ae(d) {
836
+ function ce(d) {
837
837
  switch (d) {
838
838
  case Int8Array:
839
839
  return 1 / 127;
@@ -847,15 +847,15 @@ function ae(d) {
847
847
  throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.");
848
848
  }
849
849
  }
850
- function tn(d) {
850
+ function nn(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 J();
854
- class sn {
853
+ const sn = new J();
854
+ class rn {
855
855
  constructor(e = {}, t = {}) {
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 = {};
856
+ this.json = e, this.extensions = {}, this.plugins = {}, this.options = t, this.cache = new Lt(), 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
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);
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 Ne(this.options.manager) : this.textureLoader = new Ye(this.options.manager), this.textureLoader.setCrossOrigin(this.options.crossOrigin), this.textureLoader.setRequestHeader(this.options.requestHeader), this.fileLoader = new W(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;
@@ -876,7 +876,7 @@ class sn {
876
876
  r.getDependencies("camera")
877
877
  ]);
878
878
  }).then(function(s) {
879
- const a = {
879
+ const i = {
880
880
  scene: s[0][n.scene || 0],
881
881
  scenes: s[0],
882
882
  animations: s[1],
@@ -885,12 +885,12 @@ class sn {
885
885
  parser: r,
886
886
  userData: {}
887
887
  };
888
- return G(o, a, n), F(a, n), Promise.all(r._invokeAll(function(i) {
889
- return i.afterRoot && i.afterRoot(a);
888
+ return v(o, i, n), U(i, n), Promise.all(r._invokeAll(function(a) {
889
+ return a.afterRoot && a.afterRoot(i);
890
890
  })).then(function() {
891
- for (const i of a.scenes)
892
- i.updateMatrixWorld();
893
- e(a);
891
+ for (const a of i.scenes)
892
+ a.updateMatrixWorld();
893
+ e(i);
894
894
  });
895
895
  }).catch(t);
896
896
  }
@@ -901,8 +901,8 @@ class sn {
901
901
  const e = this.json.nodes || [], t = this.json.skins || [], r = this.json.meshes || [];
902
902
  for (let n = 0, o = t.length; n < o; n++) {
903
903
  const s = t[n].joints;
904
- for (let a = 0, i = s.length; a < i; a++)
905
- e[s[a]].isBone = !0;
904
+ for (let i = 0, a = s.length; i < a; i++)
905
+ e[s[i]].isBone = !0;
906
906
  }
907
907
  for (let n = 0, o = e.length; n < o; n++) {
908
908
  const s = e[n];
@@ -924,11 +924,11 @@ class sn {
924
924
  /** Returns a reference to a shared resource, cloning it if necessary. */
925
925
  _getNodeRef(e, t, r) {
926
926
  if (e.refs[t] <= 1) return r;
927
- const n = r.clone(), o = (s, a) => {
928
- const i = this.associations.get(s);
929
- i != null && this.associations.set(a, i);
930
- for (const [c, u] of s.children.entries())
931
- o(u, a.children[c]);
927
+ const n = r.clone(), o = (s, i) => {
928
+ const a = this.associations.get(s);
929
+ a != null && this.associations.set(i, a);
930
+ for (const [c, l] of s.children.entries())
931
+ o(l, i.children[c]);
932
932
  };
933
933
  return o(r, n), n.name += "_instance_" + e.uses[t]++, n;
934
934
  }
@@ -1046,7 +1046,7 @@ class sn {
1046
1046
  return Promise.resolve(this.extensions[b.KHR_BINARY_GLTF].body);
1047
1047
  const n = this.options;
1048
1048
  return new Promise(function(o, s) {
1049
- r.load(X.resolveURL(t.uri, n.path), o, void 0, function() {
1049
+ r.load(z.resolveURL(t.uri, n.path), o, void 0, function() {
1050
1050
  s(new Error('THREE.GLTFLoader: Failed to load buffer "' + t.uri + '".'));
1051
1051
  });
1052
1052
  });
@@ -1071,28 +1071,28 @@ class sn {
1071
1071
  loadAccessor(e) {
1072
1072
  const t = this, r = this.json, n = this.json.accessors[e];
1073
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));
1074
+ const s = te[n.type], i = K[n.componentType], a = n.normalized === !0, c = new i(n.count * s);
1075
+ return Promise.resolve(new N(c, s, a));
1076
1076
  }
1077
1077
  const o = [];
1078
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
- let R, y;
1081
- if (m && m !== l) {
1082
- const x = Math.floor(f / m), E = "InterleavedBuffer:" + n.bufferView + ":" + n.componentType + ":" + x + ":" + n.count;
1079
+ const i = s[0], a = te[n.type], c = K[n.componentType], l = c.BYTES_PER_ELEMENT, u = l * a, f = n.byteOffset || 0, p = n.bufferView !== void 0 ? r.bufferViews[n.bufferView].byteStride : void 0, T = n.normalized === !0;
1080
+ let w, _;
1081
+ if (p && p !== u) {
1082
+ const y = Math.floor(f / p), E = "InterleavedBuffer:" + n.bufferView + ":" + n.componentType + ":" + y + ":" + n.count;
1083
1083
  let S = t.cache.get(E);
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);
1084
+ S || (w = new c(i, y * p, n.count * p / l), S = new Je(w, p / l), t.cache.add(E, S)), _ = new Qe(S, a, f % p / l, T);
1085
1085
  } else
1086
- a === null ? R = new c(n.count * i) : R = new c(a, f, n.count * i), y = new P(R, i, T);
1086
+ i === null ? w = new c(n.count * a) : w = new c(i, f, n.count * a), _ = new N(w, a, T);
1087
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
- a !== null && (y = new P(y.array.slice(), y.itemSize, y.normalized));
1088
+ const y = te.SCALAR, E = K[n.sparse.indices.componentType], S = n.sparse.indices.byteOffset || 0, R = n.sparse.values.byteOffset || 0, M = new E(s[1], S, n.sparse.count * y), I = new c(s[2], R, n.sparse.count * a);
1089
+ i !== null && (_ = new N(_.array.slice(), _.itemSize, _.normalized));
1090
1090
  for (let L = 0, h = M.length; L < h; L++) {
1091
- const p = M[L];
1092
- if (y.setX(p, I[L * i]), i >= 2 && y.setY(p, I[L * i + 1]), i >= 3 && y.setZ(p, I[L * i + 2]), i >= 4 && y.setW(p, I[L * i + 3]), i >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");
1091
+ const m = M[L];
1092
+ if (_.setX(m, I[L * a]), a >= 2 && _.setY(m, I[L * a + 1]), a >= 3 && _.setZ(m, I[L * a + 2]), a >= 4 && _.setW(m, I[L * a + 3]), a >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");
1093
1093
  }
1094
1094
  }
1095
- return y;
1095
+ return _;
1096
1096
  });
1097
1097
  }
1098
1098
  /**
@@ -1102,54 +1102,54 @@ class sn {
1102
1102
  */
1103
1103
  loadTexture(e) {
1104
1104
  const t = this.json, r = this.options, o = t.textures[e].source, s = t.images[o];
1105
- let a = this.textureLoader;
1105
+ let i = this.textureLoader;
1106
1106
  if (s.uri) {
1107
- const i = r.manager.getHandler(s.uri);
1108
- i !== null && (a = i);
1107
+ const a = r.manager.getHandler(s.uri);
1108
+ a !== null && (i = a);
1109
1109
  }
1110
- return this.loadTextureImage(e, o, a);
1110
+ return this.loadTextureImage(e, o, i);
1111
1111
  }
1112
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
- if (this.textureCache[i])
1115
- return this.textureCache[i];
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);
1113
+ const n = this, o = this.json, s = o.textures[e], i = o.images[t], a = (i.uri || i.bufferView) + ":" + s.sampler;
1114
+ if (this.textureCache[a])
1115
+ return this.textureCache[a];
1116
+ const c = this.loadImageSource(t, r).then(function(l) {
1117
+ l.flipY = !1, l.name = s.name || i.name || "", l.name === "" && typeof i.uri == "string" && i.uri.startsWith("data:image/") === !1 && (l.name = i.uri);
1118
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;
1119
+ return l.magFilter = Se[f.magFilter] || De, l.minFilter = Se[f.minFilter] || Oe, l.wrapS = be[f.wrapS] || Q, l.wrapT = be[f.wrapT] || Q, n.associations.set(l, { textures: e }), l;
1120
1120
  }).catch(function() {
1121
1121
  return null;
1122
1122
  });
1123
- return this.textureCache[i] = c, c;
1123
+ return this.textureCache[a] = c, c;
1124
1124
  }
1125
1125
  loadImageSource(e, t) {
1126
1126
  const r = this, n = this.json, o = this.options;
1127
1127
  if (this.sourceCache[e] !== void 0)
1128
- return this.sourceCache[e].then((l) => l.clone());
1129
- const s = n.images[e], a = self.URL || self.webkitURL;
1130
- let i = s.uri || "", c = !1;
1128
+ return this.sourceCache[e].then((u) => u.clone());
1129
+ const s = n.images[e], i = self.URL || self.webkitURL;
1130
+ let a = s.uri || "", c = !1;
1131
1131
  if (s.bufferView !== void 0)
1132
- i = r.getDependency("bufferView", s.bufferView).then(function(l) {
1132
+ a = r.getDependency("bufferView", s.bufferView).then(function(u) {
1133
1133
  c = !0;
1134
- const f = new Blob([l], { type: s.mimeType });
1135
- return i = a.createObjectURL(f), i;
1134
+ const f = new Blob([u], { type: s.mimeType });
1135
+ return a = i.createObjectURL(f), a;
1136
1136
  });
1137
1137
  else if (s.uri === void 0)
1138
1138
  throw new Error("THREE.GLTFLoader: Image " + e + " is missing URI and bufferView");
1139
- const u = Promise.resolve(i).then(function(l) {
1140
- return new Promise(function(f, m) {
1139
+ const l = Promise.resolve(a).then(function(u) {
1140
+ return new Promise(function(f, p) {
1141
1141
  let T = f;
1142
- t.isImageBitmapLoader === !0 && (T = function(R) {
1143
- const y = new he(R);
1144
- y.needsUpdate = !0, f(y);
1145
- }), t.load(X.resolveURL(l, o.path), T, void 0, m);
1142
+ t.isImageBitmapLoader === !0 && (T = function(w) {
1143
+ const _ = new me(w);
1144
+ _.needsUpdate = !0, f(_);
1145
+ }), t.load(z.resolveURL(u, o.path), T, void 0, p);
1146
1146
  });
1147
- }).then(function(l) {
1148
- return c === !0 && a.revokeObjectURL(i), l.userData.mimeType = s.mimeType || tn(s.uri), l;
1149
- }).catch(function(l) {
1150
- throw console.error("THREE.GLTFLoader: Couldn't load texture", i), l;
1147
+ }).then(function(u) {
1148
+ return c === !0 && i.revokeObjectURL(a), u.userData.mimeType = s.mimeType || nn(s.uri), u;
1149
+ }).catch(function(u) {
1150
+ throw console.error("THREE.GLTFLoader: Couldn't load texture", a), u;
1151
1151
  });
1152
- return this.sourceCache[e] = u, u;
1152
+ return this.sourceCache[e] = l, l;
1153
1153
  }
1154
1154
  /**
1155
1155
  * Asynchronously assigns a texture to the given material parameters.
@@ -1163,10 +1163,10 @@ class sn {
1163
1163
  return this.getDependency("texture", r.index).then(function(s) {
1164
1164
  if (!s) return null;
1165
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
- if (a) {
1168
- const i = o.associations.get(s);
1169
- s = o.extensions[b.KHR_TEXTURE_TRANSFORM].extendTexture(s, a), o.associations.set(s, i);
1166
+ const i = r.extensions !== void 0 ? r.extensions[b.KHR_TEXTURE_TRANSFORM] : void 0;
1167
+ if (i) {
1168
+ const a = o.associations.get(s);
1169
+ s = o.extensions[b.KHR_TEXTURE_TRANSFORM].extendTexture(s, i), o.associations.set(s, a);
1170
1170
  }
1171
1171
  }
1172
1172
  return n !== void 0 && (s.colorSpace = n), e[t] = s, s;
@@ -1185,24 +1185,24 @@ class sn {
1185
1185
  let r = e.material;
1186
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:" + r.uuid;
1189
- let i = this.cache.get(a);
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;
1188
+ const i = "PointsMaterial:" + r.uuid;
1189
+ let a = this.cache.get(i);
1190
+ a || (a = new nt(), ee.prototype.copy.call(a, r), a.color.copy(r.color), a.map = r.map, a.sizeAttenuation = !1, this.cache.add(i, a)), r = a;
1191
1191
  } else if (e.isLine) {
1192
- const a = "LineBasicMaterial:" + r.uuid;
1193
- let i = this.cache.get(a);
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;
1192
+ const i = "LineBasicMaterial:" + r.uuid;
1193
+ let a = this.cache.get(i);
1194
+ a || (a = new st(), ee.prototype.copy.call(a, r), a.color.copy(r.color), a.map = r.map, this.cache.add(i, a)), r = a;
1195
1195
  }
1196
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
- let i = this.cache.get(a);
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;
1197
+ let i = "ClonedMaterial:" + r.uuid + ":";
1198
+ n && (i += "derivative-tangents:"), o && (i += "vertex-colors:"), s && (i += "flat-shading:");
1199
+ let a = this.cache.get(i);
1200
+ a || (a = r.clone(), o && (a.vertexColors = !0), s && (a.flatShading = !0), n && (a.normalScale && (a.normalScale.y *= -1), a.clearcoatNormalScale && (a.clearcoatNormalScale.y *= -1)), this.cache.add(i, a), this.associations.set(a, this.associations.get(r))), r = a;
1201
1201
  }
1202
1202
  e.material = r;
1203
1203
  }
1204
1204
  getMaterialType() {
1205
- return Oe;
1205
+ return fe;
1206
1206
  }
1207
1207
  /**
1208
1208
  * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#materials
@@ -1212,40 +1212,40 @@ class sn {
1212
1212
  loadMaterial(e) {
1213
1213
  const t = this, r = this.json, n = this.extensions, o = r.materials[e];
1214
1214
  let s;
1215
- const a = {}, i = o.extensions || {}, c = [];
1216
- if (i[b.KHR_MATERIALS_UNLIT]) {
1217
- const l = n[b.KHR_MATERIALS_UNLIT];
1218
- s = l.getMaterialType(), c.push(l.extendParams(a, o, t));
1215
+ const i = {}, a = o.extensions || {}, c = [];
1216
+ if (a[b.KHR_MATERIALS_UNLIT]) {
1217
+ const u = n[b.KHR_MATERIALS_UNLIT];
1218
+ s = u.getMaterialType(), c.push(u.extendParams(i, o, t));
1219
1219
  } else {
1220
- const l = o.pbrMetallicRoughness || {};
1221
- if (a.color = new U(1, 1, 1), a.opacity = 1, Array.isArray(l.baseColorFactor)) {
1222
- const f = l.baseColorFactor;
1223
- a.color.setRGB(f[0], f[1], f[2], D), a.opacity = f[3];
1220
+ const u = o.pbrMetallicRoughness || {};
1221
+ if (i.color = new G(1, 1, 1), i.opacity = 1, Array.isArray(u.baseColorFactor)) {
1222
+ const f = u.baseColorFactor;
1223
+ i.color.setRGB(f[0], f[1], f[2], k), i.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))), s = this._invokeOne(function(f) {
1225
+ u.baseColorTexture !== void 0 && c.push(t.assignTexture(i, "map", u.baseColorTexture, D)), i.metalness = u.metallicFactor !== void 0 ? u.metallicFactor : 1, i.roughness = u.roughnessFactor !== void 0 ? u.roughnessFactor : 1, u.metallicRoughnessTexture !== void 0 && (c.push(t.assignTexture(i, "metalnessMap", u.metallicRoughnessTexture)), c.push(t.assignTexture(i, "roughnessMap", u.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
- return f.extendMaterialParams && f.extendMaterialParams(e, a);
1228
+ return f.extendMaterialParams && f.extendMaterialParams(e, i);
1229
1229
  })));
1230
1230
  }
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
- a.normalScale.set(l, l);
1231
+ o.doubleSided === !0 && (i.side = rt);
1232
+ const l = o.alphaMode || ne.OPAQUE;
1233
+ if (l === ne.BLEND ? (i.transparent = !0, i.depthWrite = !1) : (i.transparent = !1, l === ne.MASK && (i.alphaTest = o.alphaCutoff !== void 0 ? o.alphaCutoff : 0.5)), o.normalTexture !== void 0 && s !== X && (c.push(t.assignTexture(i, "normalMap", o.normalTexture)), i.normalScale = new Y(1, 1), o.normalTexture.scale !== void 0)) {
1234
+ const u = o.normalTexture.scale;
1235
+ i.normalScale.set(u, u);
1236
1236
  }
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
- a.emissive = new U().setRGB(l[0], l[1], l[2], D);
1237
+ if (o.occlusionTexture !== void 0 && s !== X && (c.push(t.assignTexture(i, "aoMap", o.occlusionTexture)), o.occlusionTexture.strength !== void 0 && (i.aoMapIntensity = o.occlusionTexture.strength)), o.emissiveFactor !== void 0 && s !== X) {
1238
+ const u = o.emissiveFactor;
1239
+ i.emissive = new G().setRGB(u[0], u[1], u[2], k);
1240
1240
  }
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;
1241
+ return o.emissiveTexture !== void 0 && s !== X && c.push(t.assignTexture(i, "emissiveMap", o.emissiveTexture, D)), Promise.all(c).then(function() {
1242
+ const u = new s(i);
1243
+ return o.name && (u.name = o.name), U(u, o), t.associations.set(u, { materials: e }), o.extensions && v(n, u, o), u;
1244
1244
  });
1245
1245
  }
1246
1246
  /** When Object3D instances are targeted by animation, they need unique names. */
1247
1247
  createUniqueName(e) {
1248
- const t = rt.sanitizeNodeName(e || "");
1248
+ const t = ot.sanitizeNodeName(e || "");
1249
1249
  return t in this.nodeNamesUsed ? t + "_" + ++this.nodeNamesUsed[t] : (this.nodeNamesUsed[t] = 0, t);
1250
1250
  }
1251
1251
  /**
@@ -1258,19 +1258,19 @@ class sn {
1258
1258
  */
1259
1259
  loadGeometries(e) {
1260
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
- return Se(i, a, t);
1261
+ function o(i) {
1262
+ return r[b.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(i, t).then(function(a) {
1263
+ return Le(a, i, t);
1264
1264
  });
1265
1265
  }
1266
1266
  const s = [];
1267
- for (let a = 0, i = e.length; a < i; a++) {
1268
- const c = e[a], u = en(c), l = n[u];
1269
- if (l)
1270
- s.push(l.promise);
1267
+ for (let i = 0, a = e.length; i < a; i++) {
1268
+ const c = e[i], l = tn(c), u = n[l];
1269
+ if (u)
1270
+ s.push(u.promise);
1271
1271
  else {
1272
1272
  let 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);
1273
+ c.extensions && c.extensions[b.KHR_DRACO_MESH_COMPRESSION] ? f = o(c) : f = Le(new Z(), c, t), n[l] = { primitive: c, promise: f }, s.push(f);
1274
1274
  }
1275
1275
  }
1276
1276
  return Promise.all(s);
@@ -1281,42 +1281,42 @@ class sn {
1281
1281
  * @return {Promise<Group|Mesh|SkinnedMesh>}
1282
1282
  */
1283
1283
  loadMesh(e) {
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
- a.push(u);
1288
- }
1289
- return a.push(t.loadGeometries(s)), Promise.all(a).then(function(i) {
1290
- const c = i.slice(0, i.length - 1), u = i[i.length - 1], l = [];
1291
- for (let m = 0, T = u.length; m < T; m++) {
1292
- const R = u[m], y = s[m];
1293
- let x;
1294
- const E = c[m];
1295
- if (y.mode === C.TRIANGLES || y.mode === C.TRIANGLE_STRIP || y.mode === C.TRIANGLE_FAN || y.mode === void 0)
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
- else if (y.mode === C.LINES)
1298
- x = new it(R, E);
1299
- else if (y.mode === C.LINE_STRIP)
1300
- x = new at(R, E);
1301
- else if (y.mode === C.LINE_LOOP)
1302
- x = new ct(R, E);
1303
- else if (y.mode === C.POINTS)
1304
- x = new ut(R, E);
1284
+ const t = this, r = this.json, n = this.extensions, o = r.meshes[e], s = o.primitives, i = [];
1285
+ for (let a = 0, c = s.length; a < c; a++) {
1286
+ const l = s[a].material === void 0 ? Zt(this.cache) : this.getDependency("material", s[a].material);
1287
+ i.push(l);
1288
+ }
1289
+ return i.push(t.loadGeometries(s)), Promise.all(i).then(function(a) {
1290
+ const c = a.slice(0, a.length - 1), l = a[a.length - 1], u = [];
1291
+ for (let p = 0, T = l.length; p < T; p++) {
1292
+ const w = l[p], _ = s[p];
1293
+ let y;
1294
+ const E = c[p];
1295
+ if (_.mode === C.TRIANGLES || _.mode === C.TRIANGLE_STRIP || _.mode === C.TRIANGLE_FAN || _.mode === void 0)
1296
+ y = o.isSkinnedMesh === !0 ? new it(w, E) : new de(w, E), y.isSkinnedMesh === !0 && y.normalizeSkinWeights(), _.mode === C.TRIANGLE_STRIP ? y.geometry = xe(y.geometry, Ie) : _.mode === C.TRIANGLE_FAN && (y.geometry = xe(y.geometry, ie));
1297
+ else if (_.mode === C.LINES)
1298
+ y = new at(w, E);
1299
+ else if (_.mode === C.LINE_STRIP)
1300
+ y = new ct(w, E);
1301
+ else if (_.mode === C.LINE_LOOP)
1302
+ y = new lt(w, E);
1303
+ else if (_.mode === C.POINTS)
1304
+ y = new ut(w, E);
1305
1305
  else
1306
- throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + y.mode);
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);
1306
+ throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + _.mode);
1307
+ Object.keys(y.geometry.morphAttributes).length > 0 && en(y, o), y.name = t.createUniqueName(o.name || "mesh_" + e), U(y, o), _.extensions && v(n, y, _), t.assignFinalMaterial(y), u.push(y);
1308
1308
  }
1309
- for (let m = 0, T = l.length; m < T; m++)
1310
- t.associations.set(l[m], {
1309
+ for (let p = 0, T = u.length; p < T; p++)
1310
+ t.associations.set(u[p], {
1311
1311
  meshes: e,
1312
- primitives: m
1312
+ primitives: p
1313
1313
  });
1314
- if (l.length === 1)
1315
- return o.extensions && G(n, l[0], o), l[0];
1316
- const f = new z();
1317
- o.extensions && G(n, f, o), t.associations.set(f, { meshes: e });
1318
- for (let m = 0, T = l.length; m < T; m++)
1319
- f.add(l[m]);
1314
+ if (u.length === 1)
1315
+ return o.extensions && v(n, u[0], o), u[0];
1316
+ const f = new B();
1317
+ o.extensions && v(n, f, o), t.associations.set(f, { meshes: e });
1318
+ for (let p = 0, T = u.length; p < T; p++)
1319
+ f.add(u[p]);
1320
1320
  return f;
1321
1321
  });
1322
1322
  }
@@ -1332,7 +1332,7 @@ class sn {
1332
1332
  console.warn("THREE.GLTFLoader: Missing camera parameters.");
1333
1333
  return;
1334
1334
  }
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);
1335
+ return r.type === "perspective" ? t = new ft(dt.radToDeg(n.yfov), n.aspectRatio || 1, n.znear || 1, n.zfar || 2e6) : r.type === "orthographic" && (t = new ht(-n.xmag, n.xmag, n.ymag, -n.ymag, n.znear, n.zfar)), r.name && (t.name = this.createUniqueName(r.name)), U(t, r), Promise.resolve(t);
1336
1336
  }
1337
1337
  /**
1338
1338
  * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins
@@ -1344,17 +1344,17 @@ class sn {
1344
1344
  for (let n = 0, o = t.joints.length; n < o; n++)
1345
1345
  r.push(this._loadNodeShallow(t.joints[n]));
1346
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
- if (l) {
1351
- a.push(l);
1347
+ const o = n.pop(), s = n, i = [], a = [];
1348
+ for (let c = 0, l = s.length; c < l; c++) {
1349
+ const u = s[c];
1350
+ if (u) {
1351
+ i.push(u);
1352
1352
  const f = new J();
1353
- o !== null && f.fromArray(o.array, c * 16), i.push(f);
1353
+ o !== null && f.fromArray(o.array, c * 16), a.push(f);
1354
1354
  } else
1355
1355
  console.warn('THREE.GLTFLoader: Joint "%s" could not be found.', t.joints[c]);
1356
1356
  }
1357
- return new ht(a, i);
1357
+ return new pt(i, a);
1358
1358
  });
1359
1359
  }
1360
1360
  /**
@@ -1363,39 +1363,39 @@ class sn {
1363
1363
  * @return {Promise<AnimationClip>}
1364
1364
  */
1365
1365
  loadAnimation(e) {
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));
1366
+ const t = this.json, r = this, n = t.animations[e], o = n.name ? n.name : "animation_" + e, s = [], i = [], a = [], c = [], l = [];
1367
+ for (let u = 0, f = n.channels.length; u < f; u++) {
1368
+ const p = n.channels[u], T = n.samplers[p.sampler], w = p.target, _ = w.node, y = n.parameters !== void 0 ? n.parameters[T.input] : T.input, E = n.parameters !== void 0 ? n.parameters[T.output] : T.output;
1369
+ w.node !== void 0 && (s.push(this.getDependency("node", _)), i.push(this.getDependency("accessor", y)), a.push(this.getDependency("accessor", E)), c.push(T), l.push(w));
1370
1370
  }
1371
1371
  return Promise.all([
1372
1372
  Promise.all(s),
1373
- Promise.all(a),
1374
1373
  Promise.all(i),
1374
+ Promise.all(a),
1375
1375
  Promise.all(c),
1376
- Promise.all(u)
1377
- ]).then(function(l) {
1378
- const f = l[0], m = l[1], T = l[2], R = l[3], y = l[4], x = [];
1376
+ Promise.all(l)
1377
+ ]).then(function(u) {
1378
+ const f = u[0], p = u[1], T = u[2], w = u[3], _ = u[4], y = [];
1379
1379
  for (let E = 0, S = f.length; E < S; E++) {
1380
- const _ = f[E], M = m[E], I = T[E], L = R[E], h = y[E];
1381
- if (_ === void 0) continue;
1382
- _.updateMatrix && _.updateMatrix();
1383
- const p = r._createAnimationTracks(_, M, I, L, h);
1384
- if (p)
1385
- for (let g = 0; g < p.length; g++)
1386
- x.push(p[g]);
1380
+ const R = f[E], M = p[E], I = T[E], L = w[E], h = _[E];
1381
+ if (R === void 0) continue;
1382
+ R.updateMatrix && R.updateMatrix();
1383
+ const m = r._createAnimationTracks(R, M, I, L, h);
1384
+ if (m)
1385
+ for (let g = 0; g < m.length; g++)
1386
+ y.push(m[g]);
1387
1387
  }
1388
- return new pt(o, void 0, x);
1388
+ return new mt(o, void 0, y);
1389
1389
  });
1390
1390
  }
1391
1391
  createNodeMesh(e) {
1392
1392
  const t = this.json, r = this, n = t.nodes[e];
1393
1393
  return n.mesh === void 0 ? null : r.getDependency("mesh", n.mesh).then(function(o) {
1394
1394
  const s = r._getNodeRef(r.meshCache, n.mesh, o);
1395
- return n.weights !== void 0 && s.traverse(function(a) {
1396
- if (a.isMesh)
1397
- for (let i = 0, c = n.weights.length; i < c; i++)
1398
- a.morphTargetInfluences[i] = n.weights[i];
1395
+ return n.weights !== void 0 && s.traverse(function(i) {
1396
+ if (i.isMesh)
1397
+ for (let a = 0, c = n.weights.length; a < c; a++)
1398
+ i.morphTargetInfluences[a] = n.weights[a];
1399
1399
  }), s;
1400
1400
  });
1401
1401
  }
@@ -1405,22 +1405,22 @@ class sn {
1405
1405
  * @return {Promise<Object3D>}
1406
1406
  */
1407
1407
  loadNode(e) {
1408
- const t = this.json, r = this, n = t.nodes[e], o = r._loadNodeShallow(e), s = [], a = n.children || [];
1409
- for (let c = 0, u = a.length; c < u; c++)
1410
- s.push(r.getDependency("node", a[c]));
1411
- const i = n.skin === void 0 ? Promise.resolve(null) : r.getDependency("skin", n.skin);
1408
+ const t = this.json, r = this, n = t.nodes[e], o = r._loadNodeShallow(e), s = [], i = n.children || [];
1409
+ for (let c = 0, l = i.length; c < l; c++)
1410
+ s.push(r.getDependency("node", i[c]));
1411
+ const a = n.skin === void 0 ? Promise.resolve(null) : r.getDependency("skin", n.skin);
1412
1412
  return Promise.all([
1413
1413
  o,
1414
1414
  Promise.all(s),
1415
- i
1415
+ a
1416
1416
  ]).then(function(c) {
1417
- const u = c[0], l = c[1], f = c[2];
1418
- f !== null && u.traverse(function(m) {
1419
- m.isSkinnedMesh && m.bind(f, nn);
1417
+ const l = c[0], u = c[1], f = c[2];
1418
+ f !== null && l.traverse(function(p) {
1419
+ p.isSkinnedMesh && p.bind(f, sn);
1420
1420
  });
1421
- for (let m = 0, T = l.length; m < T; m++)
1422
- u.add(l[m]);
1423
- return u;
1421
+ for (let p = 0, T = u.length; p < T; p++)
1422
+ l.add(u[p]);
1423
+ return l;
1424
1424
  });
1425
1425
  }
1426
1426
  // ._loadNodeShallow() parses a single node.
@@ -1429,26 +1429,26 @@ class sn {
1429
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 o = t.nodes[e], s = o.name ? n.createUniqueName(o.name) : "", a = [], i = n._invokeOne(function(c) {
1432
+ const o = t.nodes[e], s = o.name ? n.createUniqueName(o.name) : "", i = [], a = n._invokeOne(function(c) {
1433
1433
  return c.createNodeMesh && c.createNodeMesh(e);
1434
1434
  });
1435
- return i && a.push(i), o.camera !== void 0 && a.push(n.getDependency("camera", o.camera).then(function(c) {
1435
+ return a && i.push(a), o.camera !== void 0 && i.push(n.getDependency("camera", o.camera).then(function(c) {
1436
1436
  return n._getNodeRef(n.cameraCache, o.camera, c);
1437
1437
  })), n._invokeAll(function(c) {
1438
1438
  return c.createNodeAttachment && c.createNodeAttachment(e);
1439
1439
  }).forEach(function(c) {
1440
- a.push(c);
1441
- }), this.nodeCache[e] = Promise.all(a).then(function(c) {
1442
- let u;
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
- for (let l = 0, f = c.length; l < f; l++)
1445
- u.add(c[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);
1440
+ i.push(c);
1441
+ }), this.nodeCache[e] = Promise.all(i).then(function(c) {
1442
+ let l;
1443
+ if (o.isBone === !0 ? l = new gt() : c.length > 1 ? l = new B() : c.length === 1 ? l = c[0] : l = new ue(), l !== c[0])
1444
+ for (let u = 0, f = c.length; u < f; u++)
1445
+ l.add(c[u]);
1446
+ if (o.name && (l.userData.name = o.name, l.name = s), U(l, o), o.extensions && v(r, l, o), o.matrix !== void 0) {
1447
+ const u = new J();
1448
+ u.fromArray(o.matrix), l.applyMatrix4(u);
1449
1449
  } else
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;
1450
+ o.translation !== void 0 && l.position.fromArray(o.translation), o.rotation !== void 0 && l.quaternion.fromArray(o.rotation), o.scale !== void 0 && l.scale.fromArray(o.scale);
1451
+ return n.associations.has(l) || n.associations.set(l, {}), n.associations.get(l).nodes = e, l;
1452
1452
  }), this.nodeCache[e];
1453
1453
  }
1454
1454
  /**
@@ -1457,63 +1457,63 @@ class sn {
1457
1457
  * @return {Promise<Group>}
1458
1458
  */
1459
1459
  loadScene(e) {
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
- return Promise.all(a).then(function(i) {
1466
- for (let u = 0, l = i.length; u < l; u++)
1467
- o.add(i[u]);
1468
- const c = (u) => {
1469
- const l = /* @__PURE__ */ new Map();
1470
- for (const [f, m] of n.associations)
1471
- (f instanceof $ || f instanceof he) && l.set(f, m);
1472
- return u.traverse((f) => {
1473
- const m = n.associations.get(f);
1474
- m != null && l.set(f, m);
1475
- }), l;
1460
+ const t = this.extensions, r = this.json.scenes[e], n = this, o = new B();
1461
+ r.name && (o.name = n.createUniqueName(r.name)), U(o, r), r.extensions && v(t, o, r);
1462
+ const s = r.nodes || [], i = [];
1463
+ for (let a = 0, c = s.length; a < c; a++)
1464
+ i.push(n.getDependency("node", s[a]));
1465
+ return Promise.all(i).then(function(a) {
1466
+ for (let l = 0, u = a.length; l < u; l++)
1467
+ o.add(a[l]);
1468
+ const c = (l) => {
1469
+ const u = /* @__PURE__ */ new Map();
1470
+ for (const [f, p] of n.associations)
1471
+ (f instanceof ee || f instanceof me) && u.set(f, p);
1472
+ return l.traverse((f) => {
1473
+ const p = n.associations.get(f);
1474
+ p != null && u.set(f, p);
1475
+ }), u;
1476
1476
  };
1477
1477
  return n.associations = c(o), o;
1478
1478
  });
1479
1479
  }
1480
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
- f.morphTargetInfluences && i.push(f.name ? f.name : f.uuid);
1484
- }) : i.push(a);
1481
+ const s = [], i = e.name ? e.name : e.uuid, a = [];
1482
+ F[o.path] === F.weights ? e.traverse(function(f) {
1483
+ f.morphTargetInfluences && a.push(f.name ? f.name : f.uuid);
1484
+ }) : a.push(i);
1485
1485
  let c;
1486
- switch (k[o.path]) {
1487
- case k.weights:
1488
- c = me;
1486
+ switch (F[o.path]) {
1487
+ case F.weights:
1488
+ c = Ae;
1489
1489
  break;
1490
- case k.rotation:
1491
- c = ge;
1490
+ case F.rotation:
1491
+ c = Te;
1492
1492
  break;
1493
- case k.position:
1494
- case k.scale:
1495
- c = pe;
1493
+ case F.position:
1494
+ case F.scale:
1495
+ c = ge;
1496
1496
  break;
1497
1497
  default:
1498
1498
  switch (r.itemSize) {
1499
1499
  case 1:
1500
- c = me;
1500
+ c = Ae;
1501
1501
  break;
1502
1502
  case 2:
1503
1503
  case 3:
1504
1504
  default:
1505
- c = pe;
1505
+ c = ge;
1506
1506
  break;
1507
1507
  }
1508
1508
  break;
1509
1509
  }
1510
- const u = n.interpolation !== void 0 ? Jt[n.interpolation] : ke, l = this._getArrayFromAccessor(r);
1511
- for (let f = 0, m = i.length; f < m; f++) {
1510
+ const l = n.interpolation !== void 0 ? Qt[n.interpolation] : Fe, u = this._getArrayFromAccessor(r);
1511
+ for (let f = 0, p = a.length; f < p; f++) {
1512
1512
  const T = new c(
1513
- i[f] + "." + k[o.path],
1513
+ a[f] + "." + F[o.path],
1514
1514
  t.array,
1515
- l,
1516
- u
1515
+ u,
1516
+ l
1517
1517
  );
1518
1518
  n.interpolation === "CUBICSPLINE" && this._createCubicSplineTrackInterpolant(T), s.push(T);
1519
1519
  }
@@ -1522,7 +1522,7 @@ class sn {
1522
1522
  _getArrayFromAccessor(e) {
1523
1523
  let t = e.array;
1524
1524
  if (e.normalized) {
1525
- const r = ae(t.constructor), n = new Float32Array(t.length);
1525
+ const r = ce(t.constructor), n = new Float32Array(t.length);
1526
1526
  for (let o = 0, s = t.length; o < s; o++)
1527
1527
  n[o] = t[o] * r;
1528
1528
  t = n;
@@ -1531,22 +1531,22 @@ class sn {
1531
1531
  }
1532
1532
  _createCubicSplineTrackInterpolant(e) {
1533
1533
  e.createInterpolant = function(r) {
1534
- const n = this instanceof ge ? Yt : Ue;
1534
+ const n = this instanceof Te ? Jt : Ge;
1535
1535
  return new n(this.times, this.values, this.getValueSize() / 3, r);
1536
1536
  }, e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = !0;
1537
1537
  }
1538
1538
  }
1539
- function rn(d, e, t) {
1539
+ function on(d, e, t) {
1540
1540
  const r = e.attributes, n = new yt();
1541
1541
  if (r.POSITION !== void 0) {
1542
- const a = t.json.accessors[r.POSITION], i = a.min, c = a.max;
1543
- if (i !== void 0 && c !== void 0) {
1542
+ const i = t.json.accessors[r.POSITION], a = i.min, c = i.max;
1543
+ if (a !== void 0 && c !== void 0) {
1544
1544
  if (n.set(
1545
- new B(i[0], i[1], i[2]),
1546
- new B(c[0], c[1], c[2])
1547
- ), a.normalized) {
1548
- const u = ae(j[a.componentType]);
1549
- n.min.multiplyScalar(u), n.max.multiplyScalar(u);
1545
+ new j(a[0], a[1], a[2]),
1546
+ new j(c[0], c[1], c[2])
1547
+ ), i.normalized) {
1548
+ const l = ce(K[i.componentType]);
1549
+ n.min.multiplyScalar(l), n.max.multiplyScalar(l);
1550
1550
  }
1551
1551
  } else {
1552
1552
  console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");
@@ -1556,145 +1556,145 @@ function rn(d, e, t) {
1556
1556
  return;
1557
1557
  const o = e.targets;
1558
1558
  if (o !== void 0) {
1559
- const a = new B(), i = new B();
1560
- for (let c = 0, u = o.length; c < u; c++) {
1561
- const l = o[c];
1562
- if (l.POSITION !== void 0) {
1563
- const f = t.json.accessors[l.POSITION], m = f.min, T = f.max;
1564
- if (m !== void 0 && T !== void 0) {
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 = ae(j[f.componentType]);
1567
- i.multiplyScalar(R);
1559
+ const i = new j(), a = new j();
1560
+ for (let c = 0, l = o.length; c < l; c++) {
1561
+ const u = o[c];
1562
+ if (u.POSITION !== void 0) {
1563
+ const f = t.json.accessors[u.POSITION], p = f.min, T = f.max;
1564
+ if (p !== void 0 && T !== void 0) {
1565
+ if (a.setX(Math.max(Math.abs(p[0]), Math.abs(T[0]))), a.setY(Math.max(Math.abs(p[1]), Math.abs(T[1]))), a.setZ(Math.max(Math.abs(p[2]), Math.abs(T[2]))), f.normalized) {
1566
+ const w = ce(K[f.componentType]);
1567
+ a.multiplyScalar(w);
1568
1568
  }
1569
- a.max(i);
1569
+ i.max(a);
1570
1570
  } else
1571
1571
  console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");
1572
1572
  }
1573
1573
  }
1574
- n.expandByVector(a);
1574
+ n.expandByVector(i);
1575
1575
  }
1576
1576
  d.boundingBox = n;
1577
- const s = new xt();
1577
+ const s = new wt();
1578
1578
  n.getCenter(s.center), s.radius = n.min.distanceTo(n.max) / 2, d.boundingSphere = s;
1579
1579
  }
1580
- function Se(d, e, t) {
1580
+ function Le(d, e, t) {
1581
1581
  const r = e.attributes, n = [];
1582
- function o(s, a) {
1583
- return t.getDependency("accessor", s).then(function(i) {
1584
- d.setAttribute(a, i);
1582
+ function o(s, i) {
1583
+ return t.getDependency("accessor", s).then(function(a) {
1584
+ d.setAttribute(i, a);
1585
1585
  });
1586
1586
  }
1587
1587
  for (const s in r) {
1588
- const a = ie[s] || s.toLowerCase();
1589
- a in d.attributes || n.push(o(r[s], a));
1588
+ const i = ae[s] || s.toLowerCase();
1589
+ i in d.attributes || n.push(o(r[s], i));
1590
1590
  }
1591
1591
  if (e.indices !== void 0 && !d.index) {
1592
- const s = t.getDependency("accessor", e.indices).then(function(a) {
1593
- d.setIndex(a);
1592
+ const s = t.getDependency("accessor", e.indices).then(function(i) {
1593
+ d.setIndex(i);
1594
1594
  });
1595
1595
  n.push(s);
1596
1596
  }
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
- return e.targets !== void 0 ? Zt(d, e.targets, t) : d;
1597
+ return _e.workingColorSpace !== k && "COLOR_0" in r && console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${_e.workingColorSpace}" not supported.`), U(d, e), on(d, e, t), Promise.all(n).then(function() {
1598
+ return e.targets !== void 0 ? $t(d, e.targets, t) : d;
1599
1599
  });
1600
1600
  }
1601
- class on {
1601
+ class an {
1602
1602
  parse(e) {
1603
1603
  const t = {}, r = e.split(`
1604
1604
  `);
1605
1605
  let n = null, o = t;
1606
1606
  const s = [t];
1607
- for (const a of r)
1608
- if (a.includes("=")) {
1609
- const i = a.split("="), c = i[0].trim(), u = i[1].trim();
1610
- if (u.endsWith("{")) {
1611
- const l = {};
1612
- s.push(l), o[c] = l, o = l;
1607
+ for (const i of r)
1608
+ if (i.includes("=")) {
1609
+ const a = i.split("="), c = a[0].trim(), l = a[1].trim();
1610
+ if (l.endsWith("{")) {
1611
+ const u = {};
1612
+ s.push(u), o[c] = u, o = u;
1613
1613
  } else
1614
- o[c] = u;
1615
- } else if (a.endsWith("{")) {
1616
- const i = o[n] || {};
1617
- s.push(i), o[n] = i, o = i;
1618
- } else if (a.endsWith("}")) {
1614
+ o[c] = l;
1615
+ } else if (i.endsWith("{")) {
1616
+ const a = o[n] || {};
1617
+ s.push(a), o[n] = a, o = a;
1618
+ } else if (i.endsWith("}")) {
1619
1619
  if (s.pop(), s.length === 0) continue;
1620
1620
  o = s[s.length - 1];
1621
- } else if (a.endsWith("(")) {
1622
- const i = {};
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();
1621
+ } else if (i.endsWith("(")) {
1622
+ const a = {};
1623
+ s.push(a), n = i.split("(")[0].trim() || n, o[n] = a, o = a;
1624
+ } else i.endsWith(")") ? (s.pop(), o = s[s.length - 1]) : n = i.trim();
1625
1625
  return t;
1626
1626
  }
1627
1627
  }
1628
- class an extends ce {
1628
+ class cn extends le {
1629
1629
  constructor(e) {
1630
1630
  super(e);
1631
1631
  }
1632
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) {
1633
+ const o = this, s = new W(o.manager);
1634
+ s.setPath(o.path), s.setResponseType("arraybuffer"), s.setRequestHeader(o.requestHeader), s.setWithCredentials(o.withCredentials), s.load(e, function(i) {
1635
1635
  try {
1636
- t(o.parse(a));
1637
- } catch (i) {
1638
- n ? n(i) : console.error(i), o.manager.itemError(e);
1636
+ t(o.parse(i));
1637
+ } catch (a) {
1638
+ n ? n(a) : console.error(a), o.manager.itemError(e);
1639
1639
  }
1640
1640
  }, r, n);
1641
1641
  }
1642
1642
  parse(e) {
1643
- const t = new on();
1643
+ const t = new an();
1644
1644
  function r(h) {
1645
- const p = {};
1646
- new K().setResponseType("arraybuffer");
1645
+ const m = {};
1646
+ new W().setResponseType("arraybuffer");
1647
1647
  for (const A in h) {
1648
1648
  if (A.endsWith("png")) {
1649
- const w = new Blob([h[A]], { type: { type: "image/png" } });
1650
- p[A] = URL.createObjectURL(w);
1649
+ const x = new Blob([h[A]], { type: { type: "image/png" } });
1650
+ m[A] = URL.createObjectURL(x);
1651
1651
  }
1652
1652
  if (A.endsWith("usd") || A.endsWith("usda")) {
1653
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 = Te(h[A]);
1658
- p[A] = t.parse(w);
1657
+ const x = ye(h[A]);
1658
+ m[A] = t.parse(x);
1659
1659
  }
1660
1660
  }
1661
- return p;
1661
+ return m;
1662
1662
  }
1663
1663
  function n(h) {
1664
- const p = h.slice(0, 7), g = new Uint8Array([80, 88, 82, 45, 85, 83, 68, 67]);
1665
- return p.every((A, w) => A === g[w]);
1664
+ const m = h.slice(0, 7), g = new Uint8Array([80, 88, 82, 45, 85, 83, 68, 67]);
1665
+ return m.every((A, x) => A === g[x]);
1666
1666
  }
1667
1667
  function o(h) {
1668
1668
  if (h.length < 1) return;
1669
- const p = Object.keys(h)[0];
1669
+ const m = Object.keys(h)[0];
1670
1670
  let g = !1;
1671
- if (p.endsWith("usda")) return h[p];
1672
- if (p.endsWith("usdc"))
1671
+ if (m.endsWith("usda")) return h[m];
1672
+ if (m.endsWith("usdc"))
1673
1673
  g = !0;
1674
- else if (p.endsWith("usd"))
1675
- if (n(h[p]))
1674
+ else if (m.endsWith("usd"))
1675
+ if (n(h[m]))
1676
1676
  g = !0;
1677
1677
  else
1678
- return h[p];
1678
+ return h[m];
1679
1679
  g && console.warn("THREE.USDZLoader: Crate files (.usdc or binary .usd) are not supported.");
1680
1680
  }
1681
- const s = Rt(new Uint8Array(e)), a = r(s), i = o(s);
1682
- if (i === void 0)
1683
- return console.warn("THREE.USDZLoader: No usda file found."), new z();
1684
- const c = Te(i), u = t.parse(c);
1685
- function l(h) {
1681
+ const s = Rt(new Uint8Array(e)), i = r(s), a = o(s);
1682
+ if (a === void 0)
1683
+ return console.warn("THREE.USDZLoader: No usda file found."), new B();
1684
+ const c = ye(a), l = t.parse(c);
1685
+ function u(h) {
1686
1686
  if (h) {
1687
1687
  if ("prepend references" in h) {
1688
- const g = h["prepend references"].split("@"), A = g[1].replace(/^.\//, ""), w = g[2].replace(/^<\//, "").replace(/>$/, "");
1689
- return f(a[A], w);
1688
+ const g = h["prepend references"].split("@"), A = g[1].replace(/^.\//, ""), x = g[2].replace(/^<\//, "").replace(/>$/, "");
1689
+ return f(i[A], x);
1690
1690
  }
1691
1691
  return f(h);
1692
1692
  }
1693
1693
  }
1694
- function f(h, p) {
1694
+ function f(h, m) {
1695
1695
  if (h) {
1696
- if (p !== void 0) {
1697
- const g = `def Mesh "${p}"`;
1696
+ if (m !== void 0) {
1697
+ const g = `def Mesh "${m}"`;
1698
1698
  if (g in h)
1699
1699
  return h[g];
1700
1700
  }
@@ -1703,172 +1703,172 @@ class an extends ce {
1703
1703
  if (g.startsWith("def Mesh"))
1704
1704
  return "point3f[] points" in h && (A["point3f[] points"] = h["point3f[] points"]), "texCoord2f[] primvars:st" in h && (A["texCoord2f[] primvars:st"] = h["texCoord2f[] primvars:st"]), "int[] primvars:st:indices" in h && (A["int[] primvars:st:indices"] = h["int[] primvars:st:indices"]), A;
1705
1705
  if (typeof A == "object") {
1706
- const w = f(A);
1707
- if (w) return w;
1706
+ const x = f(A);
1707
+ if (x) return x;
1708
1708
  }
1709
1709
  }
1710
1710
  }
1711
1711
  }
1712
- function m(h) {
1712
+ function p(h) {
1713
1713
  if (!h) return;
1714
- let p = new le();
1714
+ let m = new Z();
1715
1715
  if ("int[] faceVertexIndices" in h) {
1716
1716
  const g = JSON.parse(h["int[] faceVertexIndices"]);
1717
- p.setIndex(g);
1717
+ m.setIndex(g);
1718
1718
  }
1719
1719
  if ("point3f[] points" in h) {
1720
- const g = JSON.parse(h["point3f[] points"].replace(/[()]*/g, "")), A = new P(new Float32Array(g), 3);
1721
- p.setAttribute("position", A);
1720
+ const g = JSON.parse(h["point3f[] points"].replace(/[()]*/g, "")), A = new N(new Float32Array(g), 3);
1721
+ m.setAttribute("position", A);
1722
1722
  }
1723
1723
  if ("normal3f[] normals" in h) {
1724
- const g = JSON.parse(h["normal3f[] normals"].replace(/[()]*/g, "")), A = new P(new Float32Array(g), 3);
1725
- p.setAttribute("normal", A);
1724
+ const g = JSON.parse(h["normal3f[] normals"].replace(/[()]*/g, "")), A = new N(new Float32Array(g), 3);
1725
+ m.setAttribute("normal", A);
1726
1726
  } else
1727
- p.computeVertexNormals();
1727
+ m.computeVertexNormals();
1728
1728
  if ("float2[] primvars:st" in h && (h["texCoord2f[] primvars:st"] = h["float2[] primvars:st"]), "texCoord2f[] primvars:st" in h) {
1729
- const g = JSON.parse(h["texCoord2f[] primvars:st"].replace(/[()]*/g, "")), A = new P(new Float32Array(g), 2);
1729
+ const g = JSON.parse(h["texCoord2f[] primvars:st"].replace(/[()]*/g, "")), A = new N(new Float32Array(g), 2);
1730
1730
  if ("int[] primvars:st:indices" in h) {
1731
- p = p.toNonIndexed();
1732
- const w = JSON.parse(h["int[] primvars:st:indices"]);
1733
- p.setAttribute("uv", T(A, w));
1731
+ m = m.toNonIndexed();
1732
+ const x = JSON.parse(h["int[] primvars:st:indices"]);
1733
+ m.setAttribute("uv", T(A, x));
1734
1734
  } else
1735
- p.setAttribute("uv", A);
1735
+ m.setAttribute("uv", A);
1736
1736
  }
1737
- return p;
1738
- }
1739
- function T(h, p) {
1740
- const g = h.array, A = h.itemSize, w = new g.constructor(p.length * A);
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++];
1737
+ return m;
1738
+ }
1739
+ function T(h, m) {
1740
+ const g = h.array, A = h.itemSize, x = new g.constructor(m.length * A);
1741
+ let he = 0, He = 0;
1742
+ for (let $ = 0, ve = m.length; $ < ve; $++) {
1743
+ he = m[$] * A;
1744
+ for (let pe = 0; pe < A; pe++)
1745
+ x[He++] = g[he++];
1746
1746
  }
1747
- return new P(w, A);
1747
+ return new N(x, A);
1748
1748
  }
1749
- function R(h) {
1749
+ function w(h) {
1750
1750
  if (h) {
1751
1751
  if ("rel material:binding" in h) {
1752
1752
  const A = h["rel material:binding"].replace(/^<\//, "").replace(/>$/, "").split("/");
1753
- return y(u, ` "${A[1]}"`);
1753
+ return _(l, ` "${A[1]}"`);
1754
1754
  }
1755
- return y(h);
1755
+ return _(h);
1756
1756
  }
1757
1757
  }
1758
- function y(h, p = "") {
1758
+ function _(h, m = "") {
1759
1759
  for (const g in h) {
1760
1760
  const A = h[g];
1761
- if (g.startsWith("def Material" + p))
1761
+ if (g.startsWith("def Material" + m))
1762
1762
  return A;
1763
1763
  if (typeof A == "object") {
1764
- const w = y(A, p);
1765
- if (w) return w;
1764
+ const x = _(A, m);
1765
+ if (x) return x;
1766
1766
  }
1767
1767
  }
1768
1768
  }
1769
- function x(h, p) {
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, "") + "]")));
1769
+ function y(h, m) {
1770
+ m["float inputs:rotation"] && (h.rotation = parseFloat(m["float inputs:rotation"])), m["float2 inputs:scale"] && (h.repeat = new Y().fromArray(JSON.parse("[" + m["float2 inputs:scale"].replace(/[()]*/g, "") + "]"))), m["float2 inputs:translation"] && (h.offset = new Y().fromArray(JSON.parse("[" + m["float2 inputs:translation"].replace(/[()]*/g, "") + "]")));
1771
1771
  }
1772
1772
  function E(h) {
1773
- const p = new O();
1773
+ const m = new P();
1774
1774
  if (h !== void 0) {
1775
1775
  if ('def Shader "PreviewSurface"' in h) {
1776
1776
  const g = h['def Shader "PreviewSurface"'];
1777
1777
  if ("color3f inputs:diffuseColor.connect" in g) {
1778
- const A = g["color3f inputs:diffuseColor.connect"], w = S(u, /(\w+).output/.exec(A)[1]);
1779
- p.map = _(w), p.map.colorSpace = N, 'def Shader "Transform2d_diffuse"' in h && x(p.map, h['def Shader "Transform2d_diffuse"']);
1778
+ const A = g["color3f inputs:diffuseColor.connect"], x = S(l, /(\w+).output/.exec(A)[1]);
1779
+ m.map = R(x), m.map.colorSpace = D, 'def Shader "Transform2d_diffuse"' in h && y(m.map, h['def Shader "Transform2d_diffuse"']);
1780
1780
  } else if ("color3f inputs:diffuseColor" in g) {
1781
1781
  const A = g["color3f inputs:diffuseColor"].replace(/[()]*/g, "");
1782
- p.color.fromArray(JSON.parse("[" + A + "]"));
1782
+ m.color.fromArray(JSON.parse("[" + A + "]"));
1783
1783
  }
1784
1784
  if ("color3f inputs:emissiveColor.connect" in g) {
1785
- const A = g["color3f inputs:emissiveColor.connect"], w = S(u, /(\w+).output/.exec(A)[1]);
1786
- p.emissiveMap = _(w), p.emissiveMap.colorSpace = N, p.emissive.set(16777215), 'def Shader "Transform2d_emissive"' in h && x(p.emissiveMap, h['def Shader "Transform2d_emissive"']);
1785
+ const A = g["color3f inputs:emissiveColor.connect"], x = S(l, /(\w+).output/.exec(A)[1]);
1786
+ m.emissiveMap = R(x), m.emissiveMap.colorSpace = D, m.emissive.set(16777215), 'def Shader "Transform2d_emissive"' in h && y(m.emissiveMap, h['def Shader "Transform2d_emissive"']);
1787
1787
  } else if ("color3f inputs:emissiveColor" in g) {
1788
1788
  const A = g["color3f inputs:emissiveColor"].replace(/[()]*/g, "");
1789
- p.emissive.fromArray(JSON.parse("[" + A + "]"));
1789
+ m.emissive.fromArray(JSON.parse("[" + A + "]"));
1790
1790
  }
1791
1791
  if ("normal3f inputs:normal.connect" in g) {
1792
- const A = g["normal3f inputs:normal.connect"], w = S(u, /(\w+).output/.exec(A)[1]);
1793
- p.normalMap = _(w), p.normalMap.colorSpace = H, 'def Shader "Transform2d_normal"' in h && x(p.normalMap, h['def Shader "Transform2d_normal"']);
1792
+ const A = g["normal3f inputs:normal.connect"], x = S(l, /(\w+).output/.exec(A)[1]);
1793
+ m.normalMap = R(x), m.normalMap.colorSpace = H, 'def Shader "Transform2d_normal"' in h && y(m.normalMap, h['def Shader "Transform2d_normal"']);
1794
1794
  }
1795
1795
  if ("float inputs:roughness.connect" in g) {
1796
- const A = g["float inputs:roughness.connect"], w = S(u, /(\w+).output/.exec(A)[1]);
1797
- p.roughness = 1, p.roughnessMap = _(w), p.roughnessMap.colorSpace = H, 'def Shader "Transform2d_roughness"' in h && x(p.roughnessMap, h['def Shader "Transform2d_roughness"']);
1798
- } else "float inputs:roughness" in g && (p.roughness = parseFloat(g["float inputs:roughness"]));
1796
+ const A = g["float inputs:roughness.connect"], x = S(l, /(\w+).output/.exec(A)[1]);
1797
+ m.roughness = 1, m.roughnessMap = R(x), m.roughnessMap.colorSpace = H, 'def Shader "Transform2d_roughness"' in h && y(m.roughnessMap, h['def Shader "Transform2d_roughness"']);
1798
+ } else "float inputs:roughness" in g && (m.roughness = parseFloat(g["float inputs:roughness"]));
1799
1799
  if ("float inputs:metallic.connect" in g) {
1800
- const A = g["float inputs:metallic.connect"], w = S(u, /(\w+).output/.exec(A)[1]);
1801
- p.metalness = 1, p.metalnessMap = _(w), p.metalnessMap.colorSpace = H, 'def Shader "Transform2d_metallic"' in h && x(p.metalnessMap, h['def Shader "Transform2d_metallic"']);
1802
- } else "float inputs:metallic" in g && (p.metalness = parseFloat(g["float inputs:metallic"]));
1800
+ const A = g["float inputs:metallic.connect"], x = S(l, /(\w+).output/.exec(A)[1]);
1801
+ m.metalness = 1, m.metalnessMap = R(x), m.metalnessMap.colorSpace = H, 'def Shader "Transform2d_metallic"' in h && y(m.metalnessMap, h['def Shader "Transform2d_metallic"']);
1802
+ } else "float inputs:metallic" in g && (m.metalness = parseFloat(g["float inputs:metallic"]));
1803
1803
  if ("float inputs:clearcoat.connect" in g) {
1804
- const A = g["float inputs:clearcoat.connect"], w = S(u, /(\w+).output/.exec(A)[1]);
1805
- p.clearcoat = 1, p.clearcoatMap = _(w), p.clearcoatMap.colorSpace = H, 'def Shader "Transform2d_clearcoat"' in h && x(p.clearcoatMap, h['def Shader "Transform2d_clearcoat"']);
1806
- } else "float inputs:clearcoat" in g && (p.clearcoat = parseFloat(g["float inputs:clearcoat"]));
1804
+ const A = g["float inputs:clearcoat.connect"], x = S(l, /(\w+).output/.exec(A)[1]);
1805
+ m.clearcoat = 1, m.clearcoatMap = R(x), m.clearcoatMap.colorSpace = H, 'def Shader "Transform2d_clearcoat"' in h && y(m.clearcoatMap, h['def Shader "Transform2d_clearcoat"']);
1806
+ } else "float inputs:clearcoat" in g && (m.clearcoat = parseFloat(g["float inputs:clearcoat"]));
1807
1807
  if ("float inputs:clearcoatRoughness.connect" in g) {
1808
- const A = g["float inputs:clearcoatRoughness.connect"], w = S(u, /(\w+).output/.exec(A)[1]);
1809
- p.clearcoatRoughness = 1, p.clearcoatRoughnessMap = _(w), p.clearcoatRoughnessMap.colorSpace = H, 'def Shader "Transform2d_clearcoatRoughness"' in h && x(p.clearcoatRoughnessMap, h['def Shader "Transform2d_clearcoatRoughness"']);
1810
- } else "float inputs:clearcoatRoughness" in g && (p.clearcoatRoughness = parseFloat(g["float inputs:clearcoatRoughness"]));
1811
- if ("float inputs:ior" in g && (p.ior = parseFloat(g["float inputs:ior"])), "float inputs:occlusion.connect" in g) {
1812
- const A = g["float inputs:occlusion.connect"], w = S(u, /(\w+).output/.exec(A)[1]);
1813
- p.aoMap = _(w), p.aoMap.colorSpace = H, 'def Shader "Transform2d_occlusion"' in h && x(p.aoMap, h['def Shader "Transform2d_occlusion"']);
1808
+ const A = g["float inputs:clearcoatRoughness.connect"], x = S(l, /(\w+).output/.exec(A)[1]);
1809
+ m.clearcoatRoughness = 1, m.clearcoatRoughnessMap = R(x), m.clearcoatRoughnessMap.colorSpace = H, 'def Shader "Transform2d_clearcoatRoughness"' in h && y(m.clearcoatRoughnessMap, h['def Shader "Transform2d_clearcoatRoughness"']);
1810
+ } else "float inputs:clearcoatRoughness" in g && (m.clearcoatRoughness = parseFloat(g["float inputs:clearcoatRoughness"]));
1811
+ if ("float inputs:ior" in g && (m.ior = parseFloat(g["float inputs:ior"])), "float inputs:occlusion.connect" in g) {
1812
+ const A = g["float inputs:occlusion.connect"], x = S(l, /(\w+).output/.exec(A)[1]);
1813
+ m.aoMap = R(x), m.aoMap.colorSpace = H, 'def Shader "Transform2d_occlusion"' in h && y(m.aoMap, h['def Shader "Transform2d_occlusion"']);
1814
1814
  }
1815
1815
  }
1816
1816
  if ('def Shader "diffuseColor_texture"' in h) {
1817
1817
  const g = h['def Shader "diffuseColor_texture"'];
1818
- p.map = _(g), p.map.colorSpace = N;
1818
+ m.map = R(g), m.map.colorSpace = D;
1819
1819
  }
1820
1820
  if ('def Shader "normal_texture"' in h) {
1821
1821
  const g = h['def Shader "normal_texture"'];
1822
- p.normalMap = _(g), p.normalMap.colorSpace = H;
1822
+ m.normalMap = R(g), m.normalMap.colorSpace = H;
1823
1823
  }
1824
1824
  }
1825
- return p;
1825
+ return m;
1826
1826
  }
1827
- function S(h, p) {
1827
+ function S(h, m) {
1828
1828
  for (const g in h) {
1829
1829
  const A = h[g];
1830
- if (g.startsWith(`def Shader "${p}"`))
1830
+ if (g.startsWith(`def Shader "${m}"`))
1831
1831
  return A;
1832
1832
  if (typeof A == "object") {
1833
- const w = S(A, p);
1834
- if (w) return w;
1833
+ const x = S(A, m);
1834
+ if (x) return x;
1835
1835
  }
1836
1836
  }
1837
1837
  }
1838
- function _(h) {
1838
+ function R(h) {
1839
1839
  if ("asset inputs:file" in h) {
1840
- const p = h["asset inputs:file"].replace(/@*/g, ""), A = new Me().load(a[p]), w = {
1841
- '"clamp"': De,
1842
- '"mirror"': Ne,
1840
+ const m = h["asset inputs:file"].replace(/@*/g, ""), A = new Ne().load(i[m]), x = {
1841
+ '"clamp"': Pe,
1842
+ '"mirror"': ke,
1843
1843
  '"repeat"': Q
1844
1844
  };
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;
1845
+ return "token inputs:wrapS" in h && (A.wrapS = x[h["token inputs:wrapS"]]), "token inputs:wrapT" in h && (A.wrapT = x[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 ue();
1850
+ const m = p(u(h)), g = E(w(h)), A = m ? new de(m, g) : new ue();
1851
1851
  if ("matrix4d xformOp:transform" in h) {
1852
- const w = JSON.parse("[" + h["matrix4d xformOp:transform"].replace(/[()]*/g, "") + "]");
1853
- A.matrix.fromArray(w), A.matrix.decompose(A.position, A.quaternion, A.scale);
1852
+ const x = JSON.parse("[" + h["matrix4d xformOp:transform"].replace(/[()]*/g, "") + "]");
1853
+ A.matrix.fromArray(x), A.matrix.decompose(A.position, A.quaternion, A.scale);
1854
1854
  }
1855
1855
  return A;
1856
1856
  }
1857
- function I(h, p) {
1857
+ function I(h, m) {
1858
1858
  for (const g in h)
1859
1859
  if (g.startsWith("def Scope"))
1860
- I(h[g], p);
1860
+ I(h[g], m);
1861
1861
  else if (g.startsWith("def Xform")) {
1862
1862
  const A = M(h[g]);
1863
- /def Xform "(\w+)"/.test(g) && (A.name = /def Xform "(\w+)"/.exec(g)[1]), p.add(A), I(h[g], A);
1863
+ /def Xform "(\w+)"/.test(g) && (A.name = /def Xform "(\w+)"/.exec(g)[1]), m.add(A), I(h[g], A);
1864
1864
  }
1865
1865
  }
1866
- const L = new z();
1867
- return I(u, L), L;
1866
+ const L = new B();
1867
+ return I(l, L), L;
1868
1868
  }
1869
1869
  }
1870
- const se = /* @__PURE__ */ new WeakMap();
1871
- class cn extends ce {
1870
+ const re = /* @__PURE__ */ new WeakMap();
1871
+ class ln extends le {
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",
@@ -1892,64 +1892,64 @@ class cn extends ce {
1892
1892
  return this.workerLimit = e, this;
1893
1893
  }
1894
1894
  load(e, t, r, n) {
1895
- const o = new K(this.manager);
1895
+ const o = new W(this.manager);
1896
1896
  o.setPath(this.path), o.setResponseType("arraybuffer"), o.setRequestHeader(this.requestHeader), o.setWithCredentials(this.withCredentials), o.load(e, (s) => {
1897
1897
  this.parse(s, t, n);
1898
1898
  }, r, n);
1899
1899
  }
1900
1900
  parse(e, t, r = () => {
1901
1901
  }) {
1902
- this.decodeDracoFile(e, t, null, null, N).catch(r);
1902
+ this.decodeDracoFile(e, t, null, null, D).catch(r);
1903
1903
  }
1904
- decodeDracoFile(e, t, r, n, o = D, s = () => {
1904
+ decodeDracoFile(e, t, r, n, o = k, s = () => {
1905
1905
  }) {
1906
- const a = {
1906
+ const i = {
1907
1907
  attributeIDs: r || this.defaultAttributeIDs,
1908
1908
  attributeTypes: n || this.defaultAttributeTypes,
1909
1909
  useUniqueIDs: !!r,
1910
1910
  vertexColorSpace: o
1911
1911
  };
1912
- return this.decodeGeometry(e, a).then(t).catch(s);
1912
+ return this.decodeGeometry(e, i).then(t).catch(s);
1913
1913
  }
1914
1914
  decodeGeometry(e, t) {
1915
1915
  const r = JSON.stringify(t);
1916
- if (se.has(e)) {
1917
- const i = se.get(e);
1918
- if (i.key === r)
1919
- return i.promise;
1916
+ if (re.has(e)) {
1917
+ const a = re.get(e);
1918
+ if (a.key === r)
1919
+ return a.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
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
- }))).then((i) => this._createGeometry(i.geometry));
1929
- return a.catch(() => !0).then(() => {
1926
+ const o = this.workerNextTaskID++, s = e.byteLength, i = this._getWorker(o, s).then((a) => (n = a, new Promise((c, l) => {
1927
+ n._callbacks[o] = { resolve: c, reject: l }, n.postMessage({ type: "decode", id: o, taskConfig: t, buffer: e }, [e]);
1928
+ }))).then((a) => this._createGeometry(a.geometry));
1929
+ return i.catch(() => !0).then(() => {
1930
1930
  n && o && this._releaseTask(n, o);
1931
- }), se.set(e, {
1931
+ }), re.set(e, {
1932
1932
  key: r,
1933
- promise: a
1934
- }), a;
1933
+ promise: i
1934
+ }), i;
1935
1935
  }
1936
1936
  _createGeometry(e) {
1937
- const t = new le();
1938
- e.index && t.setIndex(new P(e.index.array, 1));
1937
+ const t = new Z();
1938
+ e.index && t.setIndex(new N(e.index.array, 1));
1939
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);
1940
+ const n = e.attributes[r], o = n.name, s = n.array, i = n.itemSize, a = new N(s, i);
1941
+ o === "color" && (this._assignVertexColorSpace(a, n.vertexColorSpace), a.normalized = !(s instanceof Float32Array)), t.setAttribute(o, a);
1942
1942
  }
1943
1943
  return t;
1944
1944
  }
1945
1945
  _assignVertexColorSpace(e, t) {
1946
- if (t !== N) return;
1947
- const r = new U();
1946
+ if (t !== D) return;
1947
+ const r = new G();
1948
1948
  for (let n = 0, o = e.count; n < o; n++)
1949
1949
  r.fromBufferAttribute(e, n).convertSRGBToLinear(), e.setXYZ(n, r.r, r.g, r.b);
1950
1950
  }
1951
1951
  _loadLibrary(e, t) {
1952
- const r = new K(this.manager);
1952
+ const r = new W(this.manager);
1953
1953
  return r.setPath(this.decoderPath), r.setResponseType(t), r.setWithCredentials(this.withCredentials), new Promise((n, o) => {
1954
1954
  r.load(e, n, void 0, o);
1955
1955
  });
@@ -2014,76 +2014,76 @@ class cn extends ce {
2014
2014
  function un() {
2015
2015
  let d, e;
2016
2016
  onmessage = function(s) {
2017
- const a = s.data;
2018
- switch (a.type) {
2017
+ const i = s.data;
2018
+ switch (i.type) {
2019
2019
  case "init":
2020
- d = a.decoderConfig, e = new Promise(function(u) {
2021
- d.onModuleLoaded = function(l) {
2022
- u({ draco: l });
2020
+ d = i.decoderConfig, e = new Promise(function(l) {
2021
+ d.onModuleLoaded = function(u) {
2022
+ l({ draco: u });
2023
2023
  }, DracoDecoderModule(d);
2024
2024
  });
2025
2025
  break;
2026
2026
  case "decode":
2027
- const i = a.buffer, c = a.taskConfig;
2028
- e.then((u) => {
2029
- const l = u.draco, f = new l.Decoder();
2027
+ const a = i.buffer, c = i.taskConfig;
2028
+ e.then((l) => {
2029
+ const u = l.draco, f = new u.Decoder();
2030
2030
  try {
2031
- const m = t(l, f, new Int8Array(i), c), T = m.attributes.map((R) => R.array.buffer);
2032
- m.index && T.push(m.index.array.buffer), self.postMessage({ type: "decode", id: a.id, geometry: m }, T);
2033
- } catch (m) {
2034
- console.error(m), self.postMessage({ type: "error", id: a.id, error: m.message });
2031
+ const p = t(u, f, new Int8Array(a), c), T = p.attributes.map((w) => w.array.buffer);
2032
+ p.index && T.push(p.index.array.buffer), self.postMessage({ type: "decode", id: i.id, geometry: p }, T);
2033
+ } catch (p) {
2034
+ console.error(p), self.postMessage({ type: "error", id: i.id, error: p.message });
2035
2035
  } finally {
2036
- l.destroy(f);
2036
+ u.destroy(f);
2037
2037
  }
2038
2038
  });
2039
2039
  break;
2040
2040
  }
2041
2041
  };
2042
- function t(s, a, i, c) {
2043
- const u = c.attributeIDs, l = c.attributeTypes;
2044
- let f, m;
2045
- const T = a.GetEncodedGeometryType(i);
2042
+ function t(s, i, a, c) {
2043
+ const l = c.attributeIDs, u = c.attributeTypes;
2044
+ let f, p;
2045
+ const T = i.GetEncodedGeometryType(a);
2046
2046
  if (T === s.TRIANGULAR_MESH)
2047
- f = new s.Mesh(), m = a.DecodeArrayToMesh(i, i.byteLength, f);
2047
+ f = new s.Mesh(), p = i.DecodeArrayToMesh(a, a.byteLength, f);
2048
2048
  else if (T === s.POINT_CLOUD)
2049
- f = new s.PointCloud(), m = a.DecodeArrayToPointCloud(i, i.byteLength, f);
2049
+ f = new s.PointCloud(), p = i.DecodeArrayToPointCloud(a, a.byteLength, f);
2050
2050
  else
2051
2051
  throw new Error("THREE.DRACOLoader: Unexpected geometry type.");
2052
- if (!m.ok() || f.ptr === 0)
2053
- throw new Error("THREE.DRACOLoader: Decoding failed: " + m.error_msg());
2054
- const R = { index: null, attributes: [] };
2055
- for (const y in u) {
2056
- const x = self[l[y]];
2052
+ if (!p.ok() || f.ptr === 0)
2053
+ throw new Error("THREE.DRACOLoader: Decoding failed: " + p.error_msg());
2054
+ const w = { index: null, attributes: [] };
2055
+ for (const _ in l) {
2056
+ const y = self[u[_]];
2057
2057
  let E, S;
2058
2058
  if (c.useUniqueIDs)
2059
- S = u[y], E = a.GetAttributeByUniqueId(f, S);
2059
+ S = l[_], E = i.GetAttributeByUniqueId(f, S);
2060
2060
  else {
2061
- if (S = a.GetAttributeId(f, s[u[y]]), S === -1) continue;
2062
- E = a.GetAttribute(f, S);
2061
+ if (S = i.GetAttributeId(f, s[l[_]]), S === -1) continue;
2062
+ E = i.GetAttribute(f, S);
2063
2063
  }
2064
- const _ = n(s, a, f, y, x, E);
2065
- y === "color" && (_.vertexColorSpace = c.vertexColorSpace), R.attributes.push(_);
2066
- }
2067
- return T === s.TRIANGULAR_MESH && (R.index = r(s, a, f)), s.destroy(f), R;
2068
- }
2069
- function r(s, a, i) {
2070
- const u = i.num_faces() * 3, l = u * 4, f = s._malloc(l);
2071
- a.GetTrianglesUInt32Array(i, l, f);
2072
- const m = new Uint32Array(s.HEAPF32.buffer, f, u).slice();
2073
- return s._free(f), { array: m, itemSize: 1 };
2074
- }
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
- a.GetAttributeDataArrayForAllPoints(i, l, y, R, x);
2078
- const E = new u(s.HEAPF32.buffer, x, T).slice();
2079
- return s._free(x), {
2064
+ const R = n(s, i, f, _, y, E);
2065
+ _ === "color" && (R.vertexColorSpace = c.vertexColorSpace), w.attributes.push(R);
2066
+ }
2067
+ return T === s.TRIANGULAR_MESH && (w.index = r(s, i, f)), s.destroy(f), w;
2068
+ }
2069
+ function r(s, i, a) {
2070
+ const l = a.num_faces() * 3, u = l * 4, f = s._malloc(u);
2071
+ i.GetTrianglesUInt32Array(a, u, f);
2072
+ const p = new Uint32Array(s.HEAPF32.buffer, f, l).slice();
2073
+ return s._free(f), { array: p, itemSize: 1 };
2074
+ }
2075
+ function n(s, i, a, c, l, u) {
2076
+ const f = u.num_components(), T = a.num_points() * f, w = T * l.BYTES_PER_ELEMENT, _ = o(s, l), y = s._malloc(w);
2077
+ i.GetAttributeDataArrayForAllPoints(a, u, _, w, y);
2078
+ const E = new l(s.HEAPF32.buffer, y, T).slice();
2079
+ return s._free(y), {
2080
2080
  name: c,
2081
2081
  array: E,
2082
2082
  itemSize: f
2083
2083
  };
2084
2084
  }
2085
- function o(s, a) {
2086
- switch (a) {
2085
+ function o(s, i) {
2086
+ switch (i) {
2087
2087
  case Float32Array:
2088
2088
  return s.DT_FLOAT32;
2089
2089
  case Int8Array:
@@ -2101,130 +2101,130 @@ function un() {
2101
2101
  }
2102
2102
  }
2103
2103
  }
2104
- function ln() {
2104
+ function fn() {
2105
2105
  let d, e;
2106
2106
  onmessage = function(s) {
2107
- const a = s.data;
2108
- switch (a.type) {
2107
+ const i = s.data;
2108
+ switch (i.type) {
2109
2109
  case "init":
2110
- d = a.decoderConfig, e = new Promise(function(u) {
2111
- d.onModuleLoaded = function(l) {
2112
- u({ draco: l });
2110
+ d = i.decoderConfig, e = new Promise(function(l) {
2111
+ d.onModuleLoaded = function(u) {
2112
+ l({ draco: u });
2113
2113
  }, DracoDecoderModule(d);
2114
2114
  });
2115
2115
  break;
2116
2116
  case "decode":
2117
- const i = a.buffer, c = a.taskConfig;
2118
- e.then((u) => {
2119
- const l = u.draco, f = new l.Decoder();
2117
+ const a = i.buffer, c = i.taskConfig;
2118
+ e.then((l) => {
2119
+ const u = l.draco, f = new u.Decoder();
2120
2120
  try {
2121
- const m = t(
2122
- l,
2121
+ const p = t(
2122
+ u,
2123
2123
  f,
2124
- new Int8Array(i),
2124
+ new Int8Array(a),
2125
2125
  c
2126
- ), T = m.attributes.map(
2127
- (R) => R.array.buffer
2126
+ ), T = p.attributes.map(
2127
+ (w) => w.array.buffer
2128
2128
  );
2129
- m.index && T.push(m.index.array.buffer), self.postMessage(
2130
- { type: "decode", id: a.id, geometry: m },
2129
+ p.index && T.push(p.index.array.buffer), self.postMessage(
2130
+ { type: "decode", id: i.id, geometry: p },
2131
2131
  T
2132
2132
  );
2133
- } catch (m) {
2134
- console.error(m), self.postMessage({
2133
+ } catch (p) {
2134
+ console.error(p), self.postMessage({
2135
2135
  type: "error",
2136
- id: a.id,
2137
- error: m.message
2136
+ id: i.id,
2137
+ error: p.message
2138
2138
  });
2139
2139
  } finally {
2140
- l.destroy(f);
2140
+ u.destroy(f);
2141
2141
  }
2142
2142
  });
2143
2143
  break;
2144
2144
  }
2145
2145
  };
2146
- function t(s, a, i, c) {
2147
- const u = c.attributeIDs, l = c.attributeTypes;
2148
- let f, m;
2149
- const T = a.GetEncodedGeometryType(i);
2146
+ function t(s, i, a, c) {
2147
+ const l = c.attributeIDs, u = c.attributeTypes;
2148
+ let f, p;
2149
+ const T = i.GetEncodedGeometryType(a);
2150
2150
  if (T === s.TRIANGULAR_MESH)
2151
- f = new s.Mesh(), m = a.DecodeArrayToMesh(
2152
- i,
2153
- i.byteLength,
2151
+ f = new s.Mesh(), p = i.DecodeArrayToMesh(
2152
+ a,
2153
+ a.byteLength,
2154
2154
  f
2155
2155
  );
2156
2156
  else if (T === s.POINT_CLOUD)
2157
- f = new s.PointCloud(), m = a.DecodeArrayToPointCloud(
2158
- i,
2159
- i.byteLength,
2157
+ f = new s.PointCloud(), p = i.DecodeArrayToPointCloud(
2158
+ a,
2159
+ a.byteLength,
2160
2160
  f
2161
2161
  );
2162
2162
  else
2163
2163
  throw new Error("THREE.DRACOLoader: Unexpected geometry type.");
2164
- if (!m.ok() || f.ptr === 0)
2164
+ if (!p.ok() || f.ptr === 0)
2165
2165
  throw new Error(
2166
- "THREE.DRACOLoader: Decoding failed: " + m.error_msg()
2166
+ "THREE.DRACOLoader: Decoding failed: " + p.error_msg()
2167
2167
  );
2168
- const R = { index: null, attributes: [] };
2169
- for (const y in u) {
2170
- const x = self[l[y]];
2168
+ const w = { index: null, attributes: [] };
2169
+ for (const _ in l) {
2170
+ const y = self[u[_]];
2171
2171
  let E, S;
2172
2172
  if (c.useUniqueIDs)
2173
- S = u[y], E = a.GetAttributeByUniqueId(
2173
+ S = l[_], E = i.GetAttributeByUniqueId(
2174
2174
  f,
2175
2175
  S
2176
2176
  );
2177
2177
  else {
2178
- if (S = a.GetAttributeId(
2178
+ if (S = i.GetAttributeId(
2179
2179
  f,
2180
- s[u[y]]
2180
+ s[l[_]]
2181
2181
  ), S === -1) continue;
2182
- E = a.GetAttribute(f, S);
2182
+ E = i.GetAttribute(f, S);
2183
2183
  }
2184
- const _ = n(
2184
+ const R = n(
2185
2185
  s,
2186
- a,
2186
+ i,
2187
2187
  f,
2188
+ _,
2188
2189
  y,
2189
- x,
2190
2190
  E
2191
2191
  );
2192
- y === "color" && (_.vertexColorSpace = c.vertexColorSpace), R.attributes.push(_);
2192
+ _ === "color" && (R.vertexColorSpace = c.vertexColorSpace), w.attributes.push(R);
2193
2193
  }
2194
- return T === s.TRIANGULAR_MESH && (R.index = r(s, a, f)), s.destroy(f), R;
2194
+ return T === s.TRIANGULAR_MESH && (w.index = r(s, i, f)), s.destroy(f), w;
2195
2195
  }
2196
- function r(s, a, i) {
2197
- const u = i.num_faces() * 3, l = u * 4, f = s._malloc(l);
2198
- a.GetTrianglesUInt32Array(i, l, f);
2199
- const m = new Uint32Array(
2196
+ function r(s, i, a) {
2197
+ const l = a.num_faces() * 3, u = l * 4, f = s._malloc(u);
2198
+ i.GetTrianglesUInt32Array(a, u, f);
2199
+ const p = new Uint32Array(
2200
2200
  s.HEAPF32.buffer,
2201
2201
  f,
2202
- u
2202
+ l
2203
2203
  ).slice();
2204
- return s._free(f), { array: m, itemSize: 1 };
2205
- }
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
- a.GetAttributeDataArrayForAllPoints(
2209
- i,
2210
- l,
2211
- y,
2212
- R,
2213
- x
2204
+ return s._free(f), { array: p, itemSize: 1 };
2205
+ }
2206
+ function n(s, i, a, c, l, u) {
2207
+ const f = u.num_components(), T = a.num_points() * f, w = T * l.BYTES_PER_ELEMENT, _ = o(s, l), y = s._malloc(w);
2208
+ i.GetAttributeDataArrayForAllPoints(
2209
+ a,
2210
+ u,
2211
+ _,
2212
+ w,
2213
+ y
2214
2214
  );
2215
- const E = new u(
2215
+ const E = new l(
2216
2216
  s.HEAPF32.buffer,
2217
- x,
2217
+ y,
2218
2218
  T
2219
2219
  ).slice();
2220
- return s._free(x), {
2220
+ return s._free(y), {
2221
2221
  name: c,
2222
2222
  array: E,
2223
2223
  itemSize: f
2224
2224
  };
2225
2225
  }
2226
- function o(s, a) {
2227
- switch (a) {
2226
+ function o(s, i) {
2227
+ switch (i) {
2228
2228
  case Float32Array:
2229
2229
  return s.DT_FLOAT32;
2230
2230
  case Int8Array:
@@ -2242,7 +2242,7 @@ function ln() {
2242
2242
  }
2243
2243
  }
2244
2244
  }
2245
- const re = {
2245
+ const oe = {
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 () => {
@@ -2250,30 +2250,30 @@ const re = {
2250
2250
  return await (await fetch(d)).arrayBuffer();
2251
2251
  }
2252
2252
  };
2253
- class fn extends cn {
2253
+ class dn extends ln {
2254
2254
  constructor() {
2255
2255
  super(...arguments);
2256
- v(this, "decoderPending", null);
2257
- v(this, "decoderConfig", {
2256
+ O(this, "decoderPending", null);
2257
+ O(this, "decoderConfig", {
2258
2258
  type: "js",
2259
2259
  wasmBinary: null
2260
2260
  });
2261
- v(this, "workerSourceURL", "");
2261
+ O(this, "workerSourceURL", "");
2262
2262
  }
2263
2263
  async _initDecoder() {
2264
2264
  if (this.decoderPending) return this.decoderPending;
2265
2265
  const t = typeof WebAssembly != "object" || this.decoderConfig.type === "js", r = [];
2266
2266
  return t ? r.push(
2267
- re.LOAD_DRACO_JS_DECODER()
2267
+ oe.LOAD_DRACO_JS_DECODER()
2268
2268
  ) : (r.push(
2269
- re.LOAD_DRACO_WASM_WRAPPER()
2269
+ oe.LOAD_DRACO_WASM_WRAPPER()
2270
2270
  ), r.push(
2271
- re.LOAD_DRACO_WASM_DECODER()
2271
+ oe.LOAD_DRACO_WASM_DECODER()
2272
2272
  )), this.decoderPending = Promise.all(r).then(
2273
2273
  (n) => {
2274
2274
  const o = n[0];
2275
2275
  t || (this.decoderConfig.wasmBinary = n[1]);
2276
- const s = ln.toString(), a = [
2276
+ const s = fn.toString(), i = [
2277
2277
  "/* draco decoder */",
2278
2278
  o,
2279
2279
  "",
@@ -2281,35 +2281,233 @@ class fn extends cn {
2281
2281
  s.substring(s.indexOf("{") + 1, s.lastIndexOf("}"))
2282
2282
  ].join(`
2283
2283
  `);
2284
- this.workerSourceURL = URL.createObjectURL(new Blob([a]));
2284
+ this.workerSourceURL = URL.createObjectURL(new Blob([i]));
2285
2285
  }
2286
2286
  ), this.decoderPending;
2287
2287
  }
2288
2288
  }
2289
- class yn {
2289
+ function hn() {
2290
+ let d = null, e = null;
2291
+ const t = [
2292
+ [
2293
+ /'CONFIG_CONTROL_DESIGN'\s*\)/g,
2294
+ "'AP203_CONFIGURATION_CONTROLLED_3D_DESIGN_OF_MECHANICAL_PARTS_AND_ASSEMBLIES_MIM_LF')"
2295
+ ],
2296
+ [
2297
+ /'AP242_MANAGED_MODEL_BASED_3D_ENGINEERING_MIM_LF\.\s*\{[\s\S]*?\}\s*'/g,
2298
+ "'AP242_MANAGED_MODEL_BASED_3D_ENGINEERING_MIM_LF'"
2299
+ ]
2300
+ ];
2301
+ function r() {
2302
+ return d || (d = occtimportjs({
2303
+ // eslint-disable-line no-undef
2304
+ locateFile: function() {
2305
+ return e;
2306
+ }
2307
+ })), d;
2308
+ }
2309
+ function n(s) {
2310
+ for (var i = new TextDecoder("utf-8", { fatal: !1 }), a = new TextEncoder(), c = i.decode(s), l = 0; l < t.length; l++) {
2311
+ var u = t[l][0], f = t[l][1];
2312
+ c = c.replace(u, f);
2313
+ }
2314
+ return new Uint8Array(a.encode(c));
2315
+ }
2316
+ function o(s, i) {
2317
+ var a = n(i);
2318
+ try {
2319
+ var c = s.ReadStepFile(a, null);
2320
+ if (c.success && c.root) return c;
2321
+ } catch {
2322
+ }
2323
+ try {
2324
+ return s.ReadStepFile(i, null);
2325
+ } catch {
2326
+ return {
2327
+ success: !1,
2328
+ root: { meshes: [], children: [] },
2329
+ meshes: []
2330
+ };
2331
+ }
2332
+ }
2333
+ onmessage = async function(s) {
2334
+ var i = s.data;
2335
+ switch (i.type) {
2336
+ case "init":
2337
+ e = i.wasmUrl;
2338
+ break;
2339
+ case "parse":
2340
+ try {
2341
+ var a = await r(), c = new Uint8Array(i.buffer), l = i.fileType, u;
2342
+ if (l === "step" || l === "stp" ? u = o(a, c) : u = a.ReadIgesFile(c, null), !u.success || !u.root) {
2343
+ self.postMessage({
2344
+ type: "error",
2345
+ id: i.id,
2346
+ error: "Failed to parse CAD file"
2347
+ });
2348
+ return;
2349
+ }
2350
+ self.postMessage({
2351
+ type: "result",
2352
+ id: i.id,
2353
+ result: u
2354
+ });
2355
+ } catch (f) {
2356
+ self.postMessage({
2357
+ type: "error",
2358
+ id: i.id,
2359
+ error: f instanceof Error ? f.message : String(f)
2360
+ });
2361
+ }
2362
+ break;
2363
+ }
2364
+ };
2365
+ }
2366
+ const Me = {
2367
+ LOAD_OCCT_JS: async () => (await import("./occt-import-js-D-bjjBtk.mjs")).default,
2368
+ LOAD_OCCT_WASM_URL: async () => (await import("./occt-import-js-ekuHaP1Z.mjs")).default
2369
+ };
2370
+ class pn {
2371
+ constructor() {
2372
+ O(this, "_workerPending", null);
2373
+ O(this, "_worker", null);
2374
+ O(this, "_nextId", 0);
2375
+ O(this, "_pending", /* @__PURE__ */ new Map());
2376
+ }
2377
+ /**
2378
+ * Create (or return existing) blob-URL worker.
2379
+ * Loads occt-import-js JS as raw text, concatenates with STEPWorker
2380
+ * function body, and creates a classic (non-module) worker.
2381
+ */
2382
+ _getWorker() {
2383
+ return this._workerPending ? this._workerPending : (this._workerPending = (async () => {
2384
+ const [
2385
+ e,
2386
+ t
2387
+ ] = await Promise.all([
2388
+ Me.LOAD_OCCT_JS(),
2389
+ Me.LOAD_OCCT_WASM_URL()
2390
+ ]), r = hn.toString(), n = [
2391
+ "/* occt-import-js */",
2392
+ e,
2393
+ "",
2394
+ "/* step worker */",
2395
+ r.substring(r.indexOf("{") + 1, r.lastIndexOf("}"))
2396
+ ].join(`
2397
+ `), o = URL.createObjectURL(new Blob([n])), s = new Worker(o), i = new URL(t, window.location.href).href;
2398
+ return s.postMessage({ type: "init", wasmUrl: i }), s.onmessage = (a) => {
2399
+ const { type: c, id: l, result: u, error: f } = a.data, p = this._pending.get(l);
2400
+ if (p)
2401
+ if (this._pending.delete(l), c === "result")
2402
+ try {
2403
+ p.resolve(this._buildScene(u));
2404
+ } catch (T) {
2405
+ p.reject(
2406
+ T instanceof Error ? T : new Error(String(T))
2407
+ );
2408
+ }
2409
+ else
2410
+ p.reject(new Error(f ?? "Worker error"));
2411
+ }, s.onerror = (a) => {
2412
+ for (const [
2413
+ ,
2414
+ { reject: c }
2415
+ ] of this._pending)
2416
+ c(new Error(a.message ?? "Worker error"));
2417
+ this._pending.clear();
2418
+ }, this._worker = s, s;
2419
+ })(), this._workerPending);
2420
+ }
2421
+ /**
2422
+ * Parse STEP or IGES file content and return a Three.js Object3D
2423
+ */
2424
+ async parseAsync(e, t) {
2425
+ const r = this._nextId++, n = await this._getWorker();
2426
+ return new Promise((o, s) => {
2427
+ this._pending.set(r, { resolve: o, reject: s });
2428
+ const i = e.slice(0);
2429
+ n.postMessage({ type: "parse", id: r, buffer: i, fileType: t }, [
2430
+ i
2431
+ ]);
2432
+ });
2433
+ }
2434
+ /**
2435
+ * Dispose the worker. Call when the loader is no longer needed.
2436
+ */
2437
+ dispose() {
2438
+ if (this._worker) {
2439
+ for (const [
2440
+ ,
2441
+ { reject: e }
2442
+ ] of this._pending)
2443
+ e(new Error("STEPLoader disposed"));
2444
+ this._pending.clear(), this._worker.terminate(), this._worker = null, this._workerPending = null;
2445
+ }
2446
+ }
2447
+ _buildScene(e) {
2448
+ const t = new B();
2449
+ return t.name = e.root.name ?? "CAD Model", this._buildNode(e.root, e.meshes, t), t.rotation.x = -Math.PI / 2, t.rotation.z = Math.PI / 2, t;
2450
+ }
2451
+ _buildNode(e, t, r) {
2452
+ const n = new B();
2453
+ n.name = e.name ?? "Part";
2454
+ for (const o of e.meshes) {
2455
+ const s = t[o];
2456
+ if (s != null && s.attributes) {
2457
+ const i = this._createMesh(s);
2458
+ n.add(i);
2459
+ }
2460
+ }
2461
+ for (const o of e.children)
2462
+ this._buildNode(o, t, n);
2463
+ r.add(n);
2464
+ }
2465
+ _createMesh(e) {
2466
+ var c, l;
2467
+ const { position: t, normal: r } = e.attributes, n = e.index ?? e.attributes.index, o = new Z();
2468
+ o.setAttribute(
2469
+ "position",
2470
+ new N(new Float32Array(t.array), 3)
2471
+ ), (c = r == null ? void 0 : r.array) != null && c.length ? o.setAttribute(
2472
+ "normal",
2473
+ new N(new Float32Array(r.array), 3)
2474
+ ) : o.computeVertexNormals(), (l = n == null ? void 0 : n.array) != null && l.length && o.setIndex(
2475
+ new N(new Uint32Array(n.array), 1)
2476
+ );
2477
+ const s = e.color, i = new fe({
2478
+ metalness: 0.3,
2479
+ roughness: 0.6
2480
+ });
2481
+ s && s.length >= 3 ? i.color.setRGB(s[0], s[1], s[2]) : i.color.setHex(13421772);
2482
+ const a = new de(o, i);
2483
+ return a.name = e.name ?? "Mesh", a.castShadow = !0, a.receiveShadow = !0, a;
2484
+ }
2485
+ }
2486
+ class Rn {
2290
2487
  constructor() {
2291
- v(this, "_gltfLoader");
2292
- v(this, "_usdzLoader");
2293
- const e = new fn();
2294
- e.setDecoderConfig({ type: "wasm" }), this._gltfLoader = new St(), this._gltfLoader.setDRACOLoader(e), this._usdzLoader = new an();
2488
+ O(this, "_gltfLoader");
2489
+ O(this, "_usdzLoader");
2490
+ O(this, "_stepLoader");
2491
+ const e = new dn();
2492
+ e.setDecoderConfig({ type: "wasm" }), this._gltfLoader = new bt(), this._gltfLoader.setDRACOLoader(e), this._usdzLoader = new cn(), this._stepLoader = new pn();
2295
2493
  }
2296
2494
  async load(e, t) {
2297
2495
  let r;
2298
2496
  if (t)
2299
2497
  r = t;
2300
- else if (r = wt(e), r.length === 0 && (r = await this._detectFileTypeFromContent(e), r.length === 0))
2301
- throw new ye(
2498
+ else if (r = Et(e), r.length === 0 && (r = await this._detectFileTypeFromContent(e), r.length === 0))
2499
+ throw new we(
2302
2500
  "No file extension found in URI",
2303
2501
  ""
2304
2502
  );
2305
- if (!Et(r))
2306
- throw new ye(
2307
- `Unsupported file type: ${r}. Supported types: ${_t.join(", ")}`,
2503
+ if (!St(r))
2504
+ throw new we(
2505
+ `Unsupported file type: ${r}. Supported types: ${xt.join(", ")}`,
2308
2506
  r
2309
2507
  );
2310
2508
  const n = q.read(e);
2311
2509
  if (n)
2312
- return n.arrayBuffer ? this._parse(n.arrayBuffer, r) : n.promise.then((a) => this._parse(a, r));
2510
+ return n.arrayBuffer ? this._parse(n.arrayBuffer, r) : n.promise.then((i) => this._parse(i, r));
2313
2511
  const s = await q.create(e).load();
2314
2512
  return this._parse(s, r);
2315
2513
  }
@@ -2331,7 +2529,9 @@ class yn {
2331
2529
  n[3]
2332
2530
  ) === "glTF" ? n[12] === 0 ? "glb" : "gltf" : n.length >= 4 && n[0] === 80 && // 'P'
2333
2531
  n[1] === 75 && // 'K'
2334
- (n[2] === 3 || n[2] === 5) && (n[3] === 4 || n[3] === 6) ? "usdz" : "";
2532
+ (n[2] === 3 || n[2] === 5) && (n[3] === 4 || n[3] === 6) ? "usdz" : n.length >= 20 && new TextDecoder("ascii").decode(
2533
+ n.subarray(0, 20)
2534
+ ).startsWith("ISO-10303-21") ? "step" : n.length >= 80 && n[72] === 83 ? "iges" : "";
2335
2535
  } catch {
2336
2536
  return "";
2337
2537
  }
@@ -2352,18 +2552,30 @@ class yn {
2352
2552
  ""
2353
2553
  )).scene;
2354
2554
  case "usdz":
2355
- return await this._usdzLoader.parse(e);
2555
+ return this._usdzLoader.parse(e);
2556
+ case "step":
2557
+ case "stp":
2558
+ return await this._stepLoader.parseAsync(
2559
+ e,
2560
+ t
2561
+ );
2562
+ case "iges":
2563
+ case "igs":
2564
+ return await this._stepLoader.parseAsync(
2565
+ e,
2566
+ t
2567
+ );
2356
2568
  }
2357
2569
  } catch (r) {
2358
- throw r instanceof Error ? new xe(
2570
+ throw r instanceof Error ? new Re(
2359
2571
  `Failed to parse ${t} file: ${r.message}`,
2360
2572
  r
2361
- ) : new xe(`Failed to parse ${t} file`);
2573
+ ) : new Re(`Failed to parse ${t} file`);
2362
2574
  }
2363
2575
  }
2364
2576
  }
2365
2577
  export {
2366
- yn as A,
2367
- fn as D,
2368
- ln as a
2578
+ Rn as A,
2579
+ dn as D,
2580
+ fn as a
2369
2581
  };