softbox 4.3.0 → 4.3.1

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.
@@ -1,6 +1,6 @@
1
1
  import { jsx as Te, jsxs as Hn } from "react/jsx-runtime";
2
2
  import { useMemo as Dt, useRef as Ge, useState as Xn, useEffect as ht, useCallback as Rt, createContext as Wa, useContext as Za, Component as Ka, forwardRef as yo, useImperativeHandle as Xa } from "react";
3
- import * as T from "three";
3
+ import * as E from "three";
4
4
  import { Box3 as _t, Matrix4 as ut, BufferAttribute as jn, Vector3 as $, Line3 as Nt, Plane as Qn, Vector2 as pe, Triangle as En, BackSide as wo, DoubleSide as Eo, REVISION as To, Ray as Yi, FrontSide as Ai, Mesh as wt, LineSegments as qi, LineLoop as $i, Line as Qi, Points as Ji, Sphere as _o, BatchedMesh as Ya, TrianglesDrawMode as qa, TriangleFanDrawMode as vi, TriangleStripDrawMode as So, Loader as $a, LoaderUtils as Gn, FileLoader as bo, MeshPhysicalMaterial as Mt, Color as tn, LinearSRGBColorSpace as je, SRGBColorSpace as Yn, SpotLight as Qa, PointLight as xo, DirectionalLight as Ja, Quaternion as xn, InstancedMesh as Ao, InstancedBufferAttribute as ec, Object3D as er, TextureLoader as tc, ImageBitmapLoader as nc, InterleavedBuffer as sc, InterleavedBufferAttribute as ic, LinearMipmapLinearFilter as vo, NearestMipmapLinearFilter as rc, LinearMipmapNearestFilter as oc, NearestMipmapNearestFilter as ac, LinearFilter as nn, NearestFilter as Ro, RepeatWrapping as Ri, MirroredRepeatWrapping as cc, ClampToEdgeWrapping as lc, PointsMaterial as hc, Material as ei, LineBasicMaterial as uc, MeshStandardMaterial as Hs, MeshBasicMaterial as Un, PropertyBinding as dc, BufferGeometry as fc, SkinnedMesh as pc, Group as ti, PerspectiveCamera as mc, MathUtils as tr, OrthographicCamera as gc, Skeleton as yc, AnimationClip as wc, Bone as Ec, InterpolateDiscrete as Tc, InterpolateLinear as Mo, Texture as xr, VectorKeyframeTrack as Ar, NumberKeyframeTrack as vr, QuaternionKeyframeTrack as Rr, ColorManagement as Mr, Interpolant as _c, Controls as Io, MOUSE as Be, TOUCH as Ye, Spherical as js, Raycaster as Sc, DataTextureLoader as Co, HalfFloatType as Vt, RGBAFormat as Yt, RGFormat as In, DataUtils as Et, RedFormat as fs, FloatType as Vn, Scene as bc, BoxGeometry as xc, MeshLambertMaterial as Ac } from "three";
5
5
  class Z extends Error {
6
6
  constructor(e, t, n) {
@@ -161,7 +161,7 @@ class Rc {
161
161
  * aborts before touching a disposed renderer/scene.
162
162
  */
163
163
  async configureEnvironment(e, t, n, s, r, o) {
164
- var d, h, f, p, y, S;
164
+ var d, h, f, p, y, b;
165
165
  const a = await t.initialize({ renderer: s, autoDispose: !0 });
166
166
  if (o())
167
167
  return;
@@ -172,17 +172,17 @@ class Rc {
172
172
  environmentIntensity: (f = r.environment) == null ? void 0 : f.environmentIntensity
173
173
  }, u = (p = r.environment) == null ? void 0 : p.url;
174
174
  if (u) {
175
- const E = await t.loadEnvironmentMap(u);
175
+ const T = await t.loadEnvironmentMap(u);
176
176
  if (o())
177
177
  return;
178
- E.ok ? t.applyToScene(e, E.value, c) : console.warn("Failed to load environment map:", E.error);
178
+ T.ok ? t.applyToScene(e, T.value, c) : console.warn("Failed to load environment map:", T.error);
179
179
  } else if ((y = r.helpers) != null && y.studioEnvironment) {
180
- const E = t.createStudioEnvironment();
181
- if (E.ok) {
182
- if (t.applyToScene(e, E.value, {
180
+ const T = t.createStudioEnvironment();
181
+ if (T.ok) {
182
+ if (t.applyToScene(e, T.value, {
183
183
  ...c,
184
184
  setBackground: !1
185
- }), (S = r.helpers) != null && S.darkStudioMode && n) {
185
+ }), (b = r.helpers) != null && b.darkStudioMode && n) {
186
186
  const x = n.createGradientBackground(e, {
187
187
  topColor: Cr,
188
188
  bottomColor: Cr
@@ -190,7 +190,7 @@ class Rc {
190
190
  x.ok || console.warn("Failed to set dark studio background:", x.error);
191
191
  }
192
192
  } else
193
- console.warn("Failed to create studio environment:", E.error);
193
+ console.warn("Failed to create studio environment:", T.error);
194
194
  }
195
195
  }
196
196
  }
@@ -1015,10 +1015,10 @@ class kc {
1015
1015
  return this.deps.renderLoopManager.requireContinuous(u), this.deps.reviveRenderLoop(), this.deps.renderLoopManager.requestRender(), new Promise((h) => {
1016
1016
  const f = [];
1017
1017
  let p = null, y = !1;
1018
- const S = (x) => {
1019
- y || (y = !0, this.pendingSettlers.delete(E), c(), p !== null && clearTimeout(p), this.deps.renderLoopManager.releaseContinuous(u), s.getTracks().forEach((w) => w.stop()), h(x));
1020
- }, E = () => {
1021
- S(
1018
+ const b = (x) => {
1019
+ y || (y = !0, this.pendingSettlers.delete(T), c(), p !== null && clearTimeout(p), this.deps.renderLoopManager.releaseContinuous(u), s.getTracks().forEach((w) => w.stop()), h(x));
1020
+ }, T = () => {
1021
+ b(
1022
1022
  k.err(
1023
1023
  new Z("Viewer was disposed during video capture", Y.INVALID_STATE)
1024
1024
  )
@@ -1028,12 +1028,12 @@ class kc {
1028
1028
  } catch {
1029
1029
  }
1030
1030
  };
1031
- this.pendingSettlers.add(E), r.ondataavailable = (x) => {
1031
+ this.pendingSettlers.add(T), r.ondataavailable = (x) => {
1032
1032
  x.data.size > 0 && f.push(x.data);
1033
1033
  }, r.onstop = () => {
1034
- S(k.ok(new Blob(f, { type: r.mimeType || "video/webm" })));
1034
+ b(k.ok(new Blob(f, { type: r.mimeType || "video/webm" })));
1035
1035
  }, r.onerror = () => {
1036
- S(
1036
+ b(
1037
1037
  k.err(
1038
1038
  new Z("Video recording failed", Y.OPERATION_FAILED)
1039
1039
  )
@@ -1113,8 +1113,8 @@ class kc {
1113
1113
  )
1114
1114
  );
1115
1115
  t.setPixelRatio(1), t.setSize(f, p), Mi(s, f / p);
1116
- const S = t.render(n, s), E = S.ok ? this.readCanvasPng() : k.err(S.error);
1117
- return t.setSize(u, d), t.setPixelRatio(a), Mi(s, h), t.render(n, s), r.requestRender(), E;
1116
+ const b = t.render(n, s), T = b.ok ? this.readCanvasPng() : k.err(b.error);
1117
+ return t.setSize(u, d), t.setPixelRatio(a), Mi(s, h), t.render(n, s), r.requestRender(), T;
1118
1118
  }
1119
1119
  readCanvasPng() {
1120
1120
  const e = Oo(this.deps.renderer.getDomElement());
@@ -1319,7 +1319,7 @@ class Fc {
1319
1319
  * helpers — take effect at construction time and require a rebuild.
1320
1320
  */
1321
1321
  updateOptions(e) {
1322
- var h, f, p, y, S, E, x, w, b;
1322
+ var h, f, p, y, b, T, x, w, S;
1323
1323
  if (this.disposed)
1324
1324
  return;
1325
1325
  const t = (h = this.options.animations) == null ? void 0 : h.autoplay, n = (f = this.options.controls) == null ? void 0 : f.autoRotate;
@@ -1330,14 +1330,14 @@ class Fc {
1330
1330
  r !== void 0 && (this.renderer.setToneMappingExposure(r), s = !0);
1331
1331
  const o = (y = e.environment) == null ? void 0 : y.environmentIntensity;
1332
1332
  o !== void 0 && (this.scene.setEnvironmentIntensity(o), s = !0);
1333
- const a = (S = e.controls) == null ? void 0 : S.autoRotate;
1333
+ const a = (b = e.controls) == null ? void 0 : b.autoRotate;
1334
1334
  a !== void 0 && a !== n && (this.controls.autoRotate = a, a ? (this.renderLoopManager.requireContinuous("turntable"), this.capture.notifyTurntableEnabled()) : this.renderLoopManager.releaseContinuous("turntable"), s = !0);
1335
- const c = (E = e.controls) == null ? void 0 : E.autoRotateSpeed;
1335
+ const c = (T = e.controls) == null ? void 0 : T.autoRotateSpeed;
1336
1336
  c !== void 0 && (this.controls.autoRotateSpeed = c, s = !0);
1337
1337
  const u = (x = e.animations) == null ? void 0 : x.autoplay;
1338
1338
  u !== void 0 && u !== t && (u ? this.modelManager.getCurrentModel() && this.autoplayFromOptions(u) : this.pauseAnimations(), s = !0);
1339
1339
  const d = (w = e.animations) == null ? void 0 : w.speed;
1340
- d !== void 0 && ((b = this.animationService) == null || b.setSpeed(d), s = !0), s && (this.reviveRenderLoop(), this.renderLoopManager.requestRender());
1340
+ d !== void 0 && ((S = this.animationService) == null || S.setSpeed(d), s = !0), s && (this.reviveRenderLoop(), this.renderLoopManager.requestRender());
1341
1341
  }
1342
1342
  applyBackgroundColor(e) {
1343
1343
  var n;
@@ -1570,10 +1570,10 @@ class Zt {
1570
1570
  return new Zt(e);
1571
1571
  }
1572
1572
  static create(e = 0, t = 0, n = 0) {
1573
- return new Zt(new T.Vector3(e, t, n));
1573
+ return new Zt(new E.Vector3(e, t, n));
1574
1574
  }
1575
1575
  }
1576
- const No = 0, zc = 1, Bc = 2, Pr = 2, si = 1.25, Lr = 1, qe = 32, Oe = qe / 4, sr = 65535, zd = sr << 16, zs = Math.pow(2, -24), ir = Symbol("SKIP_GENERATION"), ko = {
1576
+ const No = 0, zc = 1, Bc = 2, Pr = 2, si = 1.25, Lr = 1, qe = 32, Oe = qe / 4, sr = 65535, Bd = sr << 16, zs = Math.pow(2, -24), ir = Symbol("SKIP_GENERATION"), ko = {
1577
1577
  strategy: No,
1578
1578
  maxDepth: 40,
1579
1579
  maxLeafSize: 10,
@@ -1635,21 +1635,21 @@ function ze(i, e) {
1635
1635
  function rr(i, e) {
1636
1636
  return e[i + 7];
1637
1637
  }
1638
- function Bd(i) {
1638
+ function Ud(i) {
1639
1639
  return i;
1640
1640
  }
1641
1641
  function ii(i, e, t, n, s) {
1642
- let r = 1 / 0, o = 1 / 0, a = 1 / 0, c = -1 / 0, u = -1 / 0, d = -1 / 0, h = 1 / 0, f = 1 / 0, p = 1 / 0, y = -1 / 0, S = -1 / 0, E = -1 / 0;
1642
+ let r = 1 / 0, o = 1 / 0, a = 1 / 0, c = -1 / 0, u = -1 / 0, d = -1 / 0, h = 1 / 0, f = 1 / 0, p = 1 / 0, y = -1 / 0, b = -1 / 0, T = -1 / 0;
1643
1643
  const x = i.offset || 0;
1644
- for (let w = (e - x) * 6, b = (e + t - x) * 6; w < b; w += 6) {
1644
+ for (let w = (e - x) * 6, S = (e + t - x) * 6; w < S; w += 6) {
1645
1645
  const _ = i[w + 0], A = i[w + 1], P = _ - A, I = _ + A;
1646
1646
  P < r && (r = P), I > c && (c = I), _ < h && (h = _), _ > y && (y = _);
1647
1647
  const M = i[w + 2], O = i[w + 3], C = M - O, N = M + O;
1648
- C < o && (o = C), N > u && (u = N), M < f && (f = M), M > S && (S = M);
1648
+ C < o && (o = C), N > u && (u = N), M < f && (f = M), M > b && (b = M);
1649
1649
  const D = i[w + 4], H = i[w + 5], G = D - H, q = D + H;
1650
- G < a && (a = G), q > d && (d = q), D < p && (p = D), D > E && (E = D);
1650
+ G < a && (a = G), q > d && (d = q), D < p && (p = D), D > T && (T = D);
1651
1651
  }
1652
- n[0] = r, n[1] = o, n[2] = a, n[3] = c, n[4] = u, n[5] = d, s[0] = h, s[1] = f, s[2] = p, s[3] = y, s[4] = S, s[5] = E;
1652
+ n[0] = r, n[1] = o, n[2] = a, n[3] = c, n[4] = u, n[5] = d, s[0] = h, s[1] = f, s[2] = p, s[3] = y, s[4] = b, s[5] = T;
1653
1653
  }
1654
1654
  const Ct = 32, Uc = (i, e) => i.candidate - e.candidate, Bt = /* @__PURE__ */ new Array(Ct).fill().map(() => ({
1655
1655
  count: 0,
@@ -1673,9 +1673,9 @@ function Hc(i, e, t, n, s, r) {
1673
1673
  if (s < Ct / 4) {
1674
1674
  const w = [...Bt];
1675
1675
  w.length = s;
1676
- let b = 0;
1677
- for (let A = h; A < f; A += 6, b++) {
1678
- const P = w[b];
1676
+ let S = 0;
1677
+ for (let A = h; A < f; A += 6, S++) {
1678
+ const P = w[S];
1679
1679
  P.candidate = t[A + 2 * p], P.count = 0;
1680
1680
  const {
1681
1681
  bounds: I,
@@ -1729,15 +1729,15 @@ function Hc(i, e, t, n, s, r) {
1729
1729
  const A = Bt[_], P = Bt[_ + 1];
1730
1730
  Nr(A.bounds, P.rightCacheBounds, A.rightCacheBounds);
1731
1731
  }
1732
- let b = 0;
1732
+ let S = 0;
1733
1733
  for (let _ = 0; _ < Ct - 1; _++) {
1734
1734
  const A = Bt[_], P = A.count, I = A.bounds, O = Bt[_ + 1].rightCacheBounds;
1735
- P !== 0 && (b === 0 ? Dr(I, gs) : Nr(I, gs, gs)), b += P;
1735
+ P !== 0 && (S === 0 ? Dr(I, gs) : Nr(I, gs, gs)), S += P;
1736
1736
  let C = 0, N = 0;
1737
- b !== 0 && (C = Cn(gs) / c);
1738
- const D = s - b;
1737
+ S !== 0 && (C = Cn(gs) / c);
1738
+ const D = s - S;
1739
1739
  D !== 0 && (N = Cn(O) / c);
1740
- const H = Lr + si * (C * b + N * D);
1740
+ const H = Lr + si * (C * S + N * D);
1741
1741
  H < u && (o = p, u = H, a = A.candidate);
1742
1742
  }
1743
1743
  }
@@ -1812,23 +1812,23 @@ function Zc(i, e, t, n, s, r) {
1812
1812
  onProgress: d
1813
1813
  } = s, h = i.primitiveBuffer, f = i.primitiveBufferStride, p = new Float32Array(6);
1814
1814
  let y = !1;
1815
- const S = new ri();
1816
- return ii(e, t, n, S.boundingData, p), x(S, t, n, p), S;
1817
- function E(w) {
1815
+ const b = new ri();
1816
+ return ii(e, t, n, b.boundingData, p), x(b, t, n, p), b;
1817
+ function T(w) {
1818
1818
  d && d((w - r.offset) / r.count);
1819
1819
  }
1820
- function x(w, b, _, A = null, P = 0) {
1820
+ function x(w, S, _, A = null, P = 0) {
1821
1821
  if (!y && P >= o && (y = !0, a && console.warn(`BVH: Max depth of ${o} reached when generating BVH. Consider increasing maxDepth.`)), _ <= c || P >= o)
1822
- return E(b + _), w.offset = b, w.count = _, w;
1823
- const I = Hc(w.boundingData, A, e, b, _, u);
1822
+ return T(S + _), w.offset = S, w.count = _, w;
1823
+ const I = Hc(w.boundingData, A, e, S, _, u);
1824
1824
  if (I.axis === -1)
1825
- return E(b + _), w.offset = b, w.count = _, w;
1826
- const M = Gc(h, f, e, b, _, I);
1827
- if (M === b || M === b + _)
1828
- E(b + _), w.offset = b, w.count = _;
1825
+ return T(S + _), w.offset = S, w.count = _, w;
1826
+ const M = Gc(h, f, e, S, _, I);
1827
+ if (M === S || M === S + _)
1828
+ T(S + _), w.offset = S, w.count = _;
1829
1829
  else {
1830
1830
  w.splitAxis = I.axis;
1831
- const O = new ri(), C = b, N = M - b;
1831
+ const O = new ri(), C = S, N = M - S;
1832
1832
  w.left = O, ii(e, C, N, O.boundingData, p), x(O, C, N, p, P + 1);
1833
1833
  const D = new ri(), H = M, G = _ - N;
1834
1834
  w.right = D, ii(e, H, G, D.boundingData, p), x(D, H, G, p, P + 1);
@@ -1901,14 +1901,14 @@ function Li(i, e, t, n, s = null, r = 0, o = 0) {
1901
1901
  return $e(D, G) + Qe(q, H);
1902
1902
  };
1903
1903
  const f = Fe(i), p = ze(i, u);
1904
- let y = f, S = p, E, x, w, b;
1905
- if (s && (w = Wt, b = _n, xe(y, a, w), xe(S, a, b), E = s(w), x = s(b), x < E)) {
1906
- y = p, S = f;
1907
- const D = E;
1908
- E = x, x = D, w = b;
1904
+ let y = f, b = p, T, x, w, S;
1905
+ if (s && (w = Wt, S = _n, xe(y, a, w), xe(b, a, S), T = s(w), x = s(S), x < T)) {
1906
+ y = p, b = f;
1907
+ const D = T;
1908
+ T = x, x = D, w = S;
1909
1909
  }
1910
1910
  w || (w = Wt, xe(y, a, w));
1911
- const _ = De(y * 2, c), A = t(w, _, E, o + 1, r + y / Oe);
1911
+ const _ = De(y * 2, c), A = t(w, _, T, o + 1, r + y / Oe);
1912
1912
  let P;
1913
1913
  if (A === Pr) {
1914
1914
  const D = C(y), G = N(y) - D;
@@ -1924,15 +1924,15 @@ function Li(i, e, t, n, s = null, r = 0, o = 0) {
1924
1924
  o + 1
1925
1925
  );
1926
1926
  if (P) return !0;
1927
- b = _n, xe(S, a, b);
1928
- const I = De(S * 2, c), M = t(b, I, x, o + 1, r + S / Oe);
1927
+ S = _n, xe(b, a, S);
1928
+ const I = De(b * 2, c), M = t(S, I, x, o + 1, r + b / Oe);
1929
1929
  let O;
1930
1930
  if (M === Pr) {
1931
- const D = C(S), G = N(S) - D;
1932
- O = n(D, G, !0, o + 1, r + S / Oe, b);
1931
+ const D = C(b), G = N(b) - D;
1932
+ O = n(D, G, !0, o + 1, r + b / Oe, S);
1933
1933
  } else
1934
1934
  O = M && Li(
1935
- S,
1935
+ b,
1936
1936
  e,
1937
1937
  t,
1938
1938
  n,
@@ -1977,21 +1977,21 @@ function qc(i, e, t, n) {
1977
1977
  function gt(i, e, t, n, s, r = 0, o = 0, a = 0, c = 0, u = null, d = !1) {
1978
1978
  let h, f;
1979
1979
  d ? (h = Vs, f = Wn) : (h = Wn, f = Vs);
1980
- const p = h.float32Array, y = h.uint32Array, S = h.uint16Array, E = f.float32Array, x = f.uint32Array, w = f.uint16Array, b = i * 2, _ = e * 2, A = De(b, S), P = De(_, w);
1980
+ const p = h.float32Array, y = h.uint32Array, b = h.uint16Array, T = f.float32Array, x = f.uint32Array, w = f.uint16Array, S = i * 2, _ = e * 2, A = De(S, b), P = De(_, w);
1981
1981
  let I = !1;
1982
1982
  if (P && A)
1983
1983
  d ? I = s(
1984
1984
  $e(e, x),
1985
1985
  Qe(e * 2, w),
1986
1986
  $e(i, y),
1987
- Qe(i * 2, S),
1987
+ Qe(i * 2, b),
1988
1988
  c,
1989
1989
  o + e / Oe,
1990
1990
  a,
1991
1991
  r + i / Oe
1992
1992
  ) : I = s(
1993
1993
  $e(i, y),
1994
- Qe(i * 2, S),
1994
+ Qe(i * 2, b),
1995
1995
  $e(e, x),
1996
1996
  Qe(e * 2, w),
1997
1997
  a,
@@ -2001,7 +2001,7 @@ function gt(i, e, t, n, s, r = 0, o = 0, a = 0, c = 0, u = null, d = !1) {
2001
2001
  );
2002
2002
  else if (P) {
2003
2003
  const M = jt.getPrimitive();
2004
- xe(e, E, M), M.applyMatrix4(t);
2004
+ xe(e, T, M), M.applyMatrix4(t);
2005
2005
  const O = Fe(i), C = ze(i, y);
2006
2006
  xe(O, p, ln), xe(C, p, hn);
2007
2007
  const N = M.intersectsBox(ln), D = M.intersectsBox(hn);
@@ -2032,7 +2032,7 @@ function gt(i, e, t, n, s, r = 0, o = 0, a = 0, c = 0, u = null, d = !1) {
2032
2032
  ), jt.releasePrimitive(M);
2033
2033
  } else {
2034
2034
  const M = Fe(e), O = ze(e, x);
2035
- xe(M, E, oi), xe(O, E, ai);
2035
+ xe(M, T, oi), xe(O, T, ai);
2036
2036
  const C = u.intersectsBox(oi), N = u.intersectsBox(ai);
2037
2037
  if (C && N)
2038
2038
  I = gt(
@@ -2182,8 +2182,8 @@ class $c {
2182
2182
  let r = 1 / 0, o = 1 / 0, a = 1 / 0, c = -1 / 0, u = -1 / 0, d = -1 / 0;
2183
2183
  for (let h = e, f = e + t; h < f; h++) {
2184
2184
  this.writePrimitiveBounds(h, un, 0);
2185
- const [p, y, S, E, x, w] = un;
2186
- p < r && (r = p), E > c && (c = E), y < o && (o = y), x > u && (u = x), S < a && (a = S), w > d && (d = w);
2185
+ const [p, y, b, T, x, w] = un;
2186
+ p < r && (r = p), T > c && (c = T), y < o && (o = y), x > u && (u = x), b < a && (a = b), w > d && (d = w);
2187
2187
  }
2188
2188
  return n[s + 0] = r, n[s + 1] = o, n[s + 2] = a, n[s + 3] = c, n[s + 4] = u, n[s + 5] = d, n;
2189
2189
  }
@@ -2191,8 +2191,8 @@ class $c {
2191
2191
  const s = n.offset || 0;
2192
2192
  for (let r = e, o = e + t; r < o; r++) {
2193
2193
  this.writePrimitiveBounds(r, un, 0);
2194
- const [a, c, u, d, h, f] = un, p = (a + d) / 2, y = (c + h) / 2, S = (u + f) / 2, E = (d - a) / 2, x = (h - c) / 2, w = (f - u) / 2, b = (r - s) * 6;
2195
- n[b + 0] = p, n[b + 1] = E + (Math.abs(p) + E) * zs, n[b + 2] = y, n[b + 3] = x + (Math.abs(y) + x) * zs, n[b + 4] = S, n[b + 5] = w + (Math.abs(S) + w) * zs;
2194
+ const [a, c, u, d, h, f] = un, p = (a + d) / 2, y = (c + h) / 2, b = (u + f) / 2, T = (d - a) / 2, x = (h - c) / 2, w = (f - u) / 2, S = (r - s) * 6;
2195
+ n[S + 0] = p, n[S + 1] = T + (Math.abs(p) + T) * zs, n[S + 2] = y, n[S + 3] = x + (Math.abs(y) + x) * zs, n[S + 4] = b, n[S + 5] = w + (Math.abs(b) + w) * zs;
2196
2196
  }
2197
2197
  return n;
2198
2198
  }
@@ -2256,9 +2256,9 @@ class $c {
2256
2256
  this.writePrimitiveRangeBounds(p, y, un, 0), a.set(un, d);
2257
2257
  } else {
2258
2258
  const p = Fe(d), y = ze(d, r);
2259
- for (let S = 0; S < 3; S++) {
2260
- const E = a[p + S], x = a[p + S + 3], w = a[y + S], b = a[y + S + 3];
2261
- a[d + S] = E < w ? E : w, a[d + S + 3] = x > b ? x : b;
2259
+ for (let b = 0; b < 3; b++) {
2260
+ const T = a[p + b], x = a[p + b + 3], w = a[y + b], S = a[y + b + 3];
2261
+ a[d + b] = T < w ? T : w, a[d + b + 3] = x > S ? x : S;
2262
2262
  }
2263
2263
  }
2264
2264
  }
@@ -2300,7 +2300,7 @@ class $c {
2300
2300
  } = e;
2301
2301
  if (s && r) {
2302
2302
  const h = s;
2303
- s = (f, p, y, S, E) => h(f, p, y, S, E) ? !0 : a(f, p, this, r, y, S, o);
2303
+ s = (f, p, y, b, T) => h(f, p, y, b, T) ? !0 : a(f, p, this, r, y, b, o);
2304
2304
  } else s || (r ? s = (h, f, p, y) => a(h, f, this, r, p, y, o) : s = (h, f, p) => p);
2305
2305
  let c = !1, u = 0;
2306
2306
  const d = this._roots;
@@ -2367,8 +2367,8 @@ function Fr(i, e, t) {
2367
2367
  return [n];
2368
2368
  const r = [], o = n.offset, a = n.offset + n.count, c = ar(i) / t, u = [];
2369
2369
  for (const f of s) {
2370
- const { offset: p, count: y } = f, S = p, E = isFinite(y) ? y : c - p, x = p + E;
2371
- S < a && x > o && (u.push({ pos: Math.max(o, S), isStart: !0 }), u.push({ pos: Math.min(a, x), isStart: !1 }));
2370
+ const { offset: p, count: y } = f, b = p, T = isFinite(y) ? y : c - p, x = p + T;
2371
+ b < a && x > o && (u.push({ pos: Math.max(o, b), isStart: !0 }), u.push({ pos: Math.min(a, x), isStart: !1 }));
2372
2372
  }
2373
2373
  u.sort((f, p) => f.pos !== p.pos ? f.pos - p.pos : f.type === "end" ? -1 : 1);
2374
2374
  let d = 0, h = null;
@@ -2487,9 +2487,9 @@ const rl = /* @__PURE__ */ (function() {
2487
2487
  return function(s, r, o) {
2488
2488
  const a = s.start, c = i, u = r.start, d = e;
2489
2489
  t.subVectors(a, u), i.subVectors(s.end, s.start), e.subVectors(r.end, r.start);
2490
- const h = t.dot(d), f = d.dot(c), p = d.dot(d), y = t.dot(c), E = c.dot(c) * p - f * f;
2490
+ const h = t.dot(d), f = d.dot(c), p = d.dot(d), y = t.dot(c), T = c.dot(c) * p - f * f;
2491
2491
  let x, w;
2492
- E !== 0 ? x = (h * f - y * p) / E : x = 0, w = (h + x * f) / p, o.x = x, o.y = w;
2492
+ T !== 0 ? x = (h * f - y * p) / T : x = 0, w = (h + x * f) / p, o.x = x, o.y = w;
2493
2493
  };
2494
2494
  })(), cr = /* @__PURE__ */ (function() {
2495
2495
  const i = /* @__PURE__ */ new pe(), e = /* @__PURE__ */ new $(), t = /* @__PURE__ */ new $();
@@ -2525,9 +2525,9 @@ const rl = /* @__PURE__ */ (function() {
2525
2525
  return function(r, o) {
2526
2526
  const { radius: a, center: c } = r, { a: u, b: d, c: h } = o;
2527
2527
  if (n.start = u, n.end = d, n.closestPointToPoint(c, !0, i).distanceTo(c) <= a || (n.start = u, n.end = h, n.closestPointToPoint(c, !0, i).distanceTo(c) <= a) || (n.start = d, n.end = h, n.closestPointToPoint(c, !0, i).distanceTo(c) <= a)) return !0;
2528
- const S = o.getPlane(t);
2529
- if (Math.abs(S.distanceToPoint(c)) <= a) {
2530
- const x = S.projectPoint(c, e);
2528
+ const b = o.getPlane(t);
2529
+ if (Math.abs(b.distanceToPoint(c)) <= a) {
2530
+ const x = b.projectPoint(c, e);
2531
2531
  if (o.containsPoint(x)) return !0;
2532
2532
  }
2533
2533
  return !1;
@@ -2557,8 +2557,8 @@ class Tt extends En {
2557
2557
  h.subVectors(t, n), f.setFromPoints(h, s);
2558
2558
  const p = r[3], y = o[3];
2559
2559
  p.subVectors(n, e), y.setFromPoints(p, s);
2560
- const S = u.length(), E = h.length(), x = p.length();
2561
- this.isDegenerateIntoPoint = !1, this.isDegenerateIntoSegment = !1, S < Pt ? E < Pt || x < Pt ? this.isDegenerateIntoPoint = !0 : (this.isDegenerateIntoSegment = !0, this.degenerateSegment.start.copy(e), this.degenerateSegment.end.copy(n)) : E < Pt ? x < Pt ? this.isDegenerateIntoPoint = !0 : (this.isDegenerateIntoSegment = !0, this.degenerateSegment.start.copy(t), this.degenerateSegment.end.copy(e)) : x < Pt && (this.isDegenerateIntoSegment = !0, this.degenerateSegment.start.copy(n), this.degenerateSegment.end.copy(t)), this.plane.setFromNormalAndCoplanarPoint(a, e), this.needsUpdate = !1;
2560
+ const b = u.length(), T = h.length(), x = p.length();
2561
+ this.isDegenerateIntoPoint = !1, this.isDegenerateIntoSegment = !1, b < Pt ? T < Pt || x < Pt ? this.isDegenerateIntoPoint = !0 : (this.isDegenerateIntoSegment = !0, this.degenerateSegment.start.copy(e), this.degenerateSegment.end.copy(n)) : T < Pt ? x < Pt ? this.isDegenerateIntoPoint = !0 : (this.isDegenerateIntoSegment = !0, this.degenerateSegment.start.copy(t), this.degenerateSegment.end.copy(e)) : x < Pt && (this.isDegenerateIntoSegment = !0, this.degenerateSegment.start.copy(n), this.degenerateSegment.end.copy(t)), this.plane.setFromNormalAndCoplanarPoint(a, e), this.needsUpdate = !1;
2562
2562
  }
2563
2563
  }
2564
2564
  Tt.prototype.closestPointToSegment = /* @__PURE__ */ (function() {
@@ -2575,56 +2575,56 @@ Tt.prototype.closestPointToSegment = /* @__PURE__ */ (function() {
2575
2575
  })();
2576
2576
  Tt.prototype.intersectsTriangle = /* @__PURE__ */ (function() {
2577
2577
  const i = /* @__PURE__ */ new Tt(), e = /* @__PURE__ */ new kt(), t = /* @__PURE__ */ new kt(), n = /* @__PURE__ */ new $(), s = /* @__PURE__ */ new $(), r = /* @__PURE__ */ new $(), o = /* @__PURE__ */ new $(), a = /* @__PURE__ */ new Nt(), c = /* @__PURE__ */ new Nt(), u = /* @__PURE__ */ new $(), d = /* @__PURE__ */ new pe(), h = /* @__PURE__ */ new pe();
2578
- function f(b, _, A, P) {
2578
+ function f(S, _, A, P) {
2579
2579
  const I = n;
2580
- !b.isDegenerateIntoPoint && !b.isDegenerateIntoSegment ? I.copy(b.plane.normal) : I.copy(_.plane.normal);
2581
- const M = b.satBounds, O = b.satAxes;
2580
+ !S.isDegenerateIntoPoint && !S.isDegenerateIntoSegment ? I.copy(S.plane.normal) : I.copy(_.plane.normal);
2581
+ const M = S.satBounds, O = S.satAxes;
2582
2582
  for (let D = 1; D < 4; D++) {
2583
2583
  const H = M[D], G = O[D];
2584
- if (e.setFromPoints(G, _.points), H.isSeparated(e) || (o.copy(I).cross(G), e.setFromPoints(o, b.points), t.setFromPoints(o, _.points), e.isSeparated(t))) return !1;
2584
+ if (e.setFromPoints(G, _.points), H.isSeparated(e) || (o.copy(I).cross(G), e.setFromPoints(o, S.points), t.setFromPoints(o, _.points), e.isSeparated(t))) return !1;
2585
2585
  }
2586
2586
  const C = _.satBounds, N = _.satAxes;
2587
2587
  for (let D = 1; D < 4; D++) {
2588
2588
  const H = C[D], G = N[D];
2589
- if (e.setFromPoints(G, b.points), H.isSeparated(e) || (o.crossVectors(I, G), e.setFromPoints(o, b.points), t.setFromPoints(o, _.points), e.isSeparated(t))) return !1;
2589
+ if (e.setFromPoints(G, S.points), H.isSeparated(e) || (o.crossVectors(I, G), e.setFromPoints(o, S.points), t.setFromPoints(o, _.points), e.isSeparated(t))) return !1;
2590
2590
  }
2591
2591
  return A && (P || console.warn("ExtendedTriangle.intersectsTriangle: Triangles are coplanar which does not support an output edge. Setting edge to 0, 0, 0."), A.start.set(0, 0, 0), A.end.set(0, 0, 0)), !0;
2592
2592
  }
2593
- function p(b, _, A, P, I, M, O, C, N, D, H) {
2593
+ function p(S, _, A, P, I, M, O, C, N, D, H) {
2594
2594
  let G = O / (O - C);
2595
- D.x = P + (I - P) * G, H.start.subVectors(_, b).multiplyScalar(G).add(b), G = O / (O - N), D.y = P + (M - P) * G, H.end.subVectors(A, b).multiplyScalar(G).add(b);
2595
+ D.x = P + (I - P) * G, H.start.subVectors(_, S).multiplyScalar(G).add(S), G = O / (O - N), D.y = P + (M - P) * G, H.end.subVectors(A, S).multiplyScalar(G).add(S);
2596
2596
  }
2597
- function y(b, _, A, P, I, M, O, C, N, D, H) {
2597
+ function y(S, _, A, P, I, M, O, C, N, D, H) {
2598
2598
  if (I > 0)
2599
- p(b.c, b.a, b.b, P, _, A, N, O, C, D, H);
2599
+ p(S.c, S.a, S.b, P, _, A, N, O, C, D, H);
2600
2600
  else if (M > 0)
2601
- p(b.b, b.a, b.c, A, _, P, C, O, N, D, H);
2601
+ p(S.b, S.a, S.c, A, _, P, C, O, N, D, H);
2602
2602
  else if (C * N > 0 || O != 0)
2603
- p(b.a, b.b, b.c, _, A, P, O, C, N, D, H);
2603
+ p(S.a, S.b, S.c, _, A, P, O, C, N, D, H);
2604
2604
  else if (C != 0)
2605
- p(b.b, b.a, b.c, A, _, P, C, O, N, D, H);
2605
+ p(S.b, S.a, S.c, A, _, P, C, O, N, D, H);
2606
2606
  else if (N != 0)
2607
- p(b.c, b.a, b.b, P, _, A, N, O, C, D, H);
2607
+ p(S.c, S.a, S.b, P, _, A, N, O, C, D, H);
2608
2608
  else
2609
2609
  return !0;
2610
2610
  return !1;
2611
2611
  }
2612
- function S(b, _, A, P) {
2613
- const I = _.degenerateSegment, M = b.plane.distanceToPoint(I.start), O = b.plane.distanceToPoint(I.end);
2614
- return ot(M) ? ot(O) ? f(b, _, A, P) : (A && (A.start.copy(I.start), A.end.copy(I.start)), b.containsPoint(I.start)) : ot(O) ? (A && (A.start.copy(I.end), A.end.copy(I.end)), b.containsPoint(I.end)) : b.plane.intersectLine(I, n) != null ? (A && (A.start.copy(n), A.end.copy(n)), b.containsPoint(n)) : !1;
2612
+ function b(S, _, A, P) {
2613
+ const I = _.degenerateSegment, M = S.plane.distanceToPoint(I.start), O = S.plane.distanceToPoint(I.end);
2614
+ return ot(M) ? ot(O) ? f(S, _, A, P) : (A && (A.start.copy(I.start), A.end.copy(I.start)), S.containsPoint(I.start)) : ot(O) ? (A && (A.start.copy(I.end), A.end.copy(I.end)), S.containsPoint(I.end)) : S.plane.intersectLine(I, n) != null ? (A && (A.start.copy(n), A.end.copy(n)), S.containsPoint(n)) : !1;
2615
2615
  }
2616
- function E(b, _, A) {
2616
+ function T(S, _, A) {
2617
2617
  const P = _.a;
2618
- return ot(b.plane.distanceToPoint(P)) && b.containsPoint(P) ? (A && (A.start.copy(P), A.end.copy(P)), !0) : !1;
2618
+ return ot(S.plane.distanceToPoint(P)) && S.containsPoint(P) ? (A && (A.start.copy(P), A.end.copy(P)), !0) : !1;
2619
2619
  }
2620
- function x(b, _, A) {
2621
- const P = b.degenerateSegment, I = _.a;
2620
+ function x(S, _, A) {
2621
+ const P = S.degenerateSegment, I = _.a;
2622
2622
  return P.closestPointToPoint(I, !0, n), I.distanceToSquared(n) < zr ? (A && (A.start.copy(I), A.end.copy(I)), !0) : !1;
2623
2623
  }
2624
- function w(b, _, A, P) {
2625
- if (b.isDegenerateIntoSegment)
2624
+ function w(S, _, A, P) {
2625
+ if (S.isDegenerateIntoSegment)
2626
2626
  if (_.isDegenerateIntoSegment) {
2627
- const I = b.degenerateSegment, M = _.degenerateSegment, O = s, C = r;
2627
+ const I = S.degenerateSegment, M = _.degenerateSegment, O = s, C = r;
2628
2628
  I.delta(O), M.delta(C);
2629
2629
  const N = n.subVectors(M.start, I.start), D = O.x * C.y - O.y * C.x;
2630
2630
  if (ot(D))
@@ -2634,14 +2634,14 @@ Tt.prototype.intersectsTriangle = /* @__PURE__ */ (function() {
2634
2634
  return !1;
2635
2635
  const q = I.start.z + O.z * H, ie = M.start.z + C.z * G;
2636
2636
  return ot(q - ie) ? (A && (A.start.copy(I.start).addScaledVector(O, H), A.end.copy(I.start).addScaledVector(O, H)), !0) : !1;
2637
- } else return _.isDegenerateIntoPoint ? x(b, _, A) : S(_, b, A, P);
2637
+ } else return _.isDegenerateIntoPoint ? x(S, _, A) : b(_, S, A, P);
2638
2638
  else {
2639
- if (b.isDegenerateIntoPoint)
2640
- return _.isDegenerateIntoPoint ? _.a.distanceToSquared(b.a) < zr ? (A && (A.start.copy(b.a), A.end.copy(b.a)), !0) : !1 : _.isDegenerateIntoSegment ? x(_, b, A) : E(_, b, A);
2639
+ if (S.isDegenerateIntoPoint)
2640
+ return _.isDegenerateIntoPoint ? _.a.distanceToSquared(S.a) < zr ? (A && (A.start.copy(S.a), A.end.copy(S.a)), !0) : !1 : _.isDegenerateIntoSegment ? x(_, S, A) : T(_, S, A);
2641
2641
  if (_.isDegenerateIntoPoint)
2642
- return E(b, _, A);
2642
+ return T(S, _, A);
2643
2643
  if (_.isDegenerateIntoSegment)
2644
- return S(b, _, A, P);
2644
+ return b(S, _, A, P);
2645
2645
  }
2646
2646
  }
2647
2647
  return function(_, A = null, P = !1) {
@@ -2698,15 +2698,15 @@ Tt.prototype.distanceToTriangle = /* @__PURE__ */ (function() {
2698
2698
  let f;
2699
2699
  const p = t[h], y = o[p];
2700
2700
  this.closestPointToPoint(y, i), f = y.distanceToSquared(i), f < d && (d = f, a && a.copy(i), c && c.copy(y));
2701
- const S = this[p];
2702
- o.closestPointToPoint(S, i), f = S.distanceToSquared(i), f < d && (d = f, a && a.copy(S), c && c.copy(i));
2701
+ const b = this[p];
2702
+ o.closestPointToPoint(b, i), f = b.distanceToSquared(i), f < d && (d = f, a && a.copy(b), c && c.copy(i));
2703
2703
  }
2704
2704
  for (let h = 0; h < 3; h++) {
2705
2705
  const f = t[h], p = t[(h + 1) % 3];
2706
2706
  n.set(this[f], this[p]);
2707
2707
  for (let y = 0; y < 3; y++) {
2708
- const S = t[y], E = t[(y + 1) % 3];
2709
- s.set(o[S], o[E]), cr(n, s, i, e);
2708
+ const b = t[y], T = t[(y + 1) % 3];
2709
+ s.set(o[b], o[T]), cr(n, s, i, e);
2710
2710
  const x = i.distanceToSquared(e);
2711
2711
  x < d && (d = x, a && a.copy(i), c && c.copy(e));
2712
2712
  }
@@ -2780,8 +2780,8 @@ Je.prototype.intersectsTriangle = /* @__PURE__ */ (function() {
2780
2780
  for (let f = 0; f < 3; f++) {
2781
2781
  const p = c[f];
2782
2782
  for (let y = 0; y < 4; y++) {
2783
- const S = d[y];
2784
- if (s.crossVectors(p, S), t.setFromPoints(s, e), n.setFromPoints(s, h), t.isSeparated(n)) return !1;
2783
+ const b = d[y];
2784
+ if (s.crossVectors(p, b), t.setFromPoints(s, e), n.setFromPoints(s, h), t.isSeparated(n)) return !1;
2785
2785
  }
2786
2786
  }
2787
2787
  return !0;
@@ -2805,35 +2805,35 @@ Je.prototype.distanceToBox = /* @__PURE__ */ (function() {
2805
2805
  return (c || u) && (o.getCenter(s), this.closestPointToPoint(s, n), o.closestPointToPoint(n, s), c && c.copy(n), u && u.copy(s)), 0;
2806
2806
  const d = a * a, h = o.min, f = o.max, p = this.points;
2807
2807
  let y = 1 / 0;
2808
- for (let E = 0; E < 8; E++) {
2809
- const x = p[E];
2808
+ for (let T = 0; T < 8; T++) {
2809
+ const x = p[T];
2810
2810
  s.copy(x).clamp(h, f);
2811
2811
  const w = x.distanceToSquared(s);
2812
2812
  if (w < y && (y = w, c && c.copy(x), u && u.copy(s), w < d))
2813
2813
  return Math.sqrt(w);
2814
2814
  }
2815
- let S = 0;
2816
- for (let E = 0; E < 3; E++)
2815
+ let b = 0;
2816
+ for (let T = 0; T < 3; T++)
2817
2817
  for (let x = 0; x <= 1; x++)
2818
2818
  for (let w = 0; w <= 1; w++) {
2819
- const b = (E + 1) % 3, _ = (E + 2) % 3, A = x << b | w << _, P = 1 << E | x << b | w << _, I = p[A], M = p[P];
2820
- e[S].set(I, M);
2821
- const C = i[E], N = i[b], D = i[_], H = t[S], G = H.start, q = H.end;
2822
- G[C] = h[C], G[N] = x ? h[N] : f[N], G[D] = w ? h[D] : f[N], q[C] = f[C], q[N] = x ? h[N] : f[N], q[D] = w ? h[D] : f[N], S++;
2819
+ const S = (T + 1) % 3, _ = (T + 2) % 3, A = x << S | w << _, P = 1 << T | x << S | w << _, I = p[A], M = p[P];
2820
+ e[b].set(I, M);
2821
+ const C = i[T], N = i[S], D = i[_], H = t[b], G = H.start, q = H.end;
2822
+ G[C] = h[C], G[N] = x ? h[N] : f[N], G[D] = w ? h[D] : f[N], q[C] = f[C], q[N] = x ? h[N] : f[N], q[D] = w ? h[D] : f[N], b++;
2823
2823
  }
2824
- for (let E = 0; E <= 1; E++)
2824
+ for (let T = 0; T <= 1; T++)
2825
2825
  for (let x = 0; x <= 1; x++)
2826
2826
  for (let w = 0; w <= 1; w++) {
2827
- s.x = E ? f.x : h.x, s.y = x ? f.y : h.y, s.z = w ? f.z : h.z, this.closestPointToPoint(s, n);
2828
- const b = s.distanceToSquared(n);
2829
- if (b < y && (y = b, c && c.copy(n), u && u.copy(s), b < d))
2830
- return Math.sqrt(b);
2827
+ s.x = T ? f.x : h.x, s.y = x ? f.y : h.y, s.z = w ? f.z : h.z, this.closestPointToPoint(s, n);
2828
+ const S = s.distanceToSquared(n);
2829
+ if (S < y && (y = S, c && c.copy(n), u && u.copy(s), S < d))
2830
+ return Math.sqrt(S);
2831
2831
  }
2832
- for (let E = 0; E < 12; E++) {
2833
- const x = e[E];
2832
+ for (let T = 0; T < 12; T++) {
2833
+ const x = e[T];
2834
2834
  for (let w = 0; w < 12; w++) {
2835
- const b = t[w];
2836
- cr(x, b, n, s);
2835
+ const S = t[w];
2836
+ cr(x, S, n, s);
2837
2837
  const _ = n.distanceToSquared(s);
2838
2838
  if (_ < y && (y = _, c && c.copy(n), u && u.copy(s), _ < d))
2839
2839
  return Math.sqrt(_);
@@ -2916,13 +2916,13 @@ function qs(i, e, t, n, s, r, o) {
2916
2916
  let c = a + 0, u = a + 1, d = a + 2;
2917
2917
  const { index: h, groups: f } = i;
2918
2918
  i.index && (c = h.getX(c), u = h.getX(u), d = h.getX(d));
2919
- const { position: p, normal: y, uv: S, uv1: E } = i.attributes;
2919
+ const { position: p, normal: y, uv: b, uv1: T } = i.attributes;
2920
2920
  if (Array.isArray(e)) {
2921
2921
  const x = n * 3;
2922
- for (let w = 0, b = f.length; w < b; w++) {
2922
+ for (let w = 0, S = f.length; w < S; w++) {
2923
2923
  const { start: _, count: A, materialIndex: P } = f[w];
2924
2924
  if (x >= _ && x < _ + A) {
2925
- const I = Gr(e[P]), M = jr(t, p, y, S, E, c, u, d, I, r, o);
2925
+ const I = Gr(e[P]), M = jr(t, p, y, b, T, c, u, d, I, r, o);
2926
2926
  if (M)
2927
2927
  if (M.faceIndex = n, M.face.materialIndex = P, s)
2928
2928
  s.push(M);
@@ -2931,7 +2931,7 @@ function qs(i, e, t, n, s, r, o) {
2931
2931
  }
2932
2932
  }
2933
2933
  } else {
2934
- const x = Gr(e), w = jr(t, p, y, S, E, c, u, d, x, r, o);
2934
+ const x = Gr(e), w = jr(t, p, y, b, T, c, u, d, x, r, o);
2935
2935
  if (w)
2936
2936
  if (w.faceIndex = n, w.face.materialIndex = 0, s)
2937
2937
  s.push(w);
@@ -2976,35 +2976,35 @@ function ml(i, e = null) {
2976
2976
  for (let f = 0, p = d.length; f < p; f++)
2977
2977
  r = d[f], o = new Uint32Array(r), a = new Uint16Array(r), c = new Float32Array(r), h(0, u), u += r.byteLength;
2978
2978
  function h(f, p, y = !1) {
2979
- const S = f * 2;
2980
- if (De(S, a)) {
2981
- const E = $e(f, o), x = Qe(S, a);
2982
- let w = 1 / 0, b = 1 / 0, _ = 1 / 0, A = -1 / 0, P = -1 / 0, I = -1 / 0;
2983
- for (let M = 3 * E, O = 3 * (E + x); M < O; M++) {
2979
+ const b = f * 2;
2980
+ if (De(b, a)) {
2981
+ const T = $e(f, o), x = Qe(b, a);
2982
+ let w = 1 / 0, S = 1 / 0, _ = 1 / 0, A = -1 / 0, P = -1 / 0, I = -1 / 0;
2983
+ for (let M = 3 * T, O = 3 * (T + x); M < O; M++) {
2984
2984
  let C = n[M];
2985
2985
  const N = s.getX(C), D = s.getY(C), H = s.getZ(C);
2986
- N < w && (w = N), N > A && (A = N), D < b && (b = D), D > P && (P = D), H < _ && (_ = H), H > I && (I = H);
2986
+ N < w && (w = N), N > A && (A = N), D < S && (S = D), D > P && (P = D), H < _ && (_ = H), H > I && (I = H);
2987
2987
  }
2988
- return c[f + 0] !== w || c[f + 1] !== b || c[f + 2] !== _ || c[f + 3] !== A || c[f + 4] !== P || c[f + 5] !== I ? (c[f + 0] = w, c[f + 1] = b, c[f + 2] = _, c[f + 3] = A, c[f + 4] = P, c[f + 5] = I, !0) : !1;
2988
+ return c[f + 0] !== w || c[f + 1] !== S || c[f + 2] !== _ || c[f + 3] !== A || c[f + 4] !== P || c[f + 5] !== I ? (c[f + 0] = w, c[f + 1] = S, c[f + 2] = _, c[f + 3] = A, c[f + 4] = P, c[f + 5] = I, !0) : !1;
2989
2989
  } else {
2990
- const E = Fe(f), x = ze(f, o);
2991
- let w = y, b = !1, _ = !1;
2990
+ const T = Fe(f), x = ze(f, o);
2991
+ let w = y, S = !1, _ = !1;
2992
2992
  if (e) {
2993
2993
  if (!w) {
2994
- const C = E / Oe + p / qe, N = x / Oe + p / qe;
2995
- b = e.has(C), _ = e.has(N), w = !b && !_;
2994
+ const C = T / Oe + p / qe, N = x / Oe + p / qe;
2995
+ S = e.has(C), _ = e.has(N), w = !S && !_;
2996
2996
  }
2997
2997
  } else
2998
- b = !0, _ = !0;
2999
- const A = w || b, P = w || _;
2998
+ S = !0, _ = !0;
2999
+ const A = w || S, P = w || _;
3000
3000
  let I = !1;
3001
- A && (I = h(E, p, w));
3001
+ A && (I = h(T, p, w));
3002
3002
  let M = !1;
3003
3003
  P && (M = h(x, p, w));
3004
3004
  const O = I || M;
3005
3005
  if (O)
3006
3006
  for (let C = 0; C < 3; C++) {
3007
- const N = E + C, D = x + C, H = c[N], G = c[N + 3], q = c[D], ie = c[D + 3];
3007
+ const N = T + C, D = x + C, H = c[N], G = c[N + 3], q = c[D], ie = c[D + 3];
3008
3008
  c[f + C] = H < q ? H : q, c[f + C + 3] = G > ie ? G : ie;
3009
3009
  }
3010
3010
  return O;
@@ -3013,9 +3013,9 @@ function ml(i, e = null) {
3013
3013
  }
3014
3014
  function Kt(i, e, t, n, s) {
3015
3015
  let r, o, a, c, u, d;
3016
- const h = 1 / t.direction.x, f = 1 / t.direction.y, p = 1 / t.direction.z, y = t.origin.x, S = t.origin.y, E = t.origin.z;
3017
- let x = e[i], w = e[i + 3], b = e[i + 1], _ = e[i + 3 + 1], A = e[i + 2], P = e[i + 3 + 2];
3018
- return h >= 0 ? (r = (x - y) * h, o = (w - y) * h) : (r = (w - y) * h, o = (x - y) * h), f >= 0 ? (a = (b - S) * f, c = (_ - S) * f) : (a = (_ - S) * f, c = (b - S) * f), r > c || a > o || ((a > r || isNaN(r)) && (r = a), (c < o || isNaN(o)) && (o = c), p >= 0 ? (u = (A - E) * p, d = (P - E) * p) : (u = (P - E) * p, d = (A - E) * p), r > d || u > o) ? !1 : ((u > r || r !== r) && (r = u), (d < o || o !== o) && (o = d), r <= s && o >= n);
3016
+ const h = 1 / t.direction.x, f = 1 / t.direction.y, p = 1 / t.direction.z, y = t.origin.x, b = t.origin.y, T = t.origin.z;
3017
+ let x = e[i], w = e[i + 3], S = e[i + 1], _ = e[i + 3 + 1], A = e[i + 2], P = e[i + 3 + 2];
3018
+ return h >= 0 ? (r = (x - y) * h, o = (w - y) * h) : (r = (w - y) * h, o = (x - y) * h), f >= 0 ? (a = (S - b) * f, c = (_ - b) * f) : (a = (_ - b) * f, c = (S - b) * f), r > c || a > o || ((a > r || isNaN(r)) && (r = a), (c < o || isNaN(o)) && (o = c), p >= 0 ? (u = (A - T) * p, d = (P - T) * p) : (u = (P - T) * p, d = (A - T) * p), r > d || u > o) ? !1 : ((u > r || r !== r) && (r = u), (d < o || o !== o) && (o = d), r <= s && o >= n);
3019
3019
  }
3020
3020
  function gl(i, e, t, n, s, r, o, a) {
3021
3021
  const { geometry: c, _indirectBuffer: u } = i;
@@ -3071,18 +3071,18 @@ function Di(i, e, t, n, s, r) {
3071
3071
  return fl(e, t, n, h, f, s, r);
3072
3072
  } else {
3073
3073
  const h = rr(i, c), f = Tl[h], y = n.direction[f] >= 0;
3074
- let S, E;
3075
- y ? (S = Fe(i), E = ze(i, c)) : (S = ze(i, c), E = Fe(i));
3076
- const w = Kt(S, o, n, s, r) ? Di(S, e, t, n, s, r) : null;
3074
+ let b, T;
3075
+ y ? (b = Fe(i), T = ze(i, c)) : (b = ze(i, c), T = Fe(i));
3076
+ const w = Kt(b, o, n, s, r) ? Di(b, e, t, n, s, r) : null;
3077
3077
  if (w) {
3078
3078
  const A = w.point[f];
3079
- if (y ? A <= o[E + h] : (
3079
+ if (y ? A <= o[T + h] : (
3080
3080
  // min bounding data
3081
- A >= o[E + h + 3]
3081
+ A >= o[T + h + 3]
3082
3082
  ))
3083
3083
  return w;
3084
3084
  }
3085
- const _ = Kt(E, o, n, s, r) ? Di(E, e, t, n, s, r) : null;
3085
+ const _ = Kt(T, o, n, s, r) ? Di(T, e, t, n, s, r) : null;
3086
3086
  return w && _ ? w.distance <= _.distance ? w : _ : w || _ || null;
3087
3087
  }
3088
3088
  }
@@ -3096,21 +3096,21 @@ function Ni(i, e, t, n, s = null) {
3096
3096
  const { float32Array: r, uint16Array: o, uint32Array: a } = be;
3097
3097
  let c = i * 2;
3098
3098
  if (s === null && (t.boundingBox || t.computeBoundingBox(), Vr.set(t.boundingBox.min, t.boundingBox.max, n), s = Vr), De(c, o)) {
3099
- const d = e.geometry, h = d.index, f = d.attributes.position, p = t.index, y = t.attributes.position, S = $e(i, a), E = Qe(c, o);
3099
+ const d = e.geometry, h = d.index, f = d.attributes.position, p = t.index, y = t.attributes.position, b = $e(i, a), T = Qe(c, o);
3100
3100
  if (On.copy(n).invert(), t.boundsTree)
3101
3101
  return xe(i, r, bs), bs.matrix.copy(On), bs.needsUpdate = !0, t.boundsTree.shapecast({
3102
3102
  intersectsBounds: (w) => bs.intersectsBox(w),
3103
3103
  intersectsTriangle: (w) => {
3104
3104
  w.a.applyMatrix4(n), w.b.applyMatrix4(n), w.c.applyMatrix4(n), w.needsUpdate = !0;
3105
- for (let b = S * 3, _ = (E + S) * 3; b < _; b += 3)
3106
- if (Ie(fn, b, h, f), fn.needsUpdate = !0, w.intersectsTriangle(fn))
3105
+ for (let S = b * 3, _ = (T + b) * 3; S < _; S += 3)
3106
+ if (Ie(fn, S, h, f), fn.needsUpdate = !0, w.intersectsTriangle(fn))
3107
3107
  return !0;
3108
3108
  return !1;
3109
3109
  }
3110
3110
  });
3111
3111
  {
3112
3112
  const x = Ys(t);
3113
- for (let w = S * 3, b = (E + S) * 3; w < b; w += 3) {
3113
+ for (let w = b * 3, S = (T + b) * 3; w < S; w += 3) {
3114
3114
  Ie(dn, w, h, f), dn.a.applyMatrix4(On), dn.b.applyMatrix4(On), dn.c.applyMatrix4(On), dn.needsUpdate = !0;
3115
3115
  for (let _ = 0, A = x * 3; _ < A; _ += 3)
3116
3116
  if (Ie(fn, _, p, y), fn.needsUpdate = !0, dn.intersectsTriangle(fn))
@@ -3126,9 +3126,9 @@ const xs = /* @__PURE__ */ new ut(), hi = /* @__PURE__ */ new Je(), Dn = /* @__P
3126
3126
  function Rl(i, e, t, n = {}, s = {}, r = 0, o = 1 / 0) {
3127
3127
  e.boundingBox || e.computeBoundingBox(), hi.set(e.boundingBox.min, e.boundingBox.max, t), hi.needsUpdate = !0;
3128
3128
  const a = i.geometry, c = a.attributes.position, u = a.index, d = e.attributes.position, h = e.index, f = lt.getPrimitive(), p = lt.getPrimitive();
3129
- let y = bl, S = xl, E = null, x = null;
3130
- s && (E = Al, x = vl);
3131
- let w = 1 / 0, b = null, _ = null;
3129
+ let y = bl, b = xl, T = null, x = null;
3130
+ s && (T = Al, x = vl);
3131
+ let w = 1 / 0, S = null, _ = null;
3132
3132
  return xs.copy(t).invert(), Dn.matrix.copy(xs), i.shapecast(
3133
3133
  {
3134
3134
  boundsTraverseOrder: (A) => hi.distanceToBox(A),
@@ -3143,8 +3143,8 @@ function Rl(i, e, t, n = {}, s = {}, r = 0, o = 1 / 0) {
3143
3143
  Ie(p, 3 * C, h, d), p.a.applyMatrix4(t), p.b.applyMatrix4(t), p.c.applyMatrix4(t), p.needsUpdate = !0;
3144
3144
  for (let D = A, H = A + P; D < H; D++) {
3145
3145
  Ie(f, 3 * D, u, c), f.needsUpdate = !0;
3146
- const G = f.distanceToTriangle(p, y, E);
3147
- if (G < w && (S.copy(y), x && x.copy(E), w = G, b = D, _ = C), G < r)
3146
+ const G = f.distanceToTriangle(p, y, T);
3147
+ if (G < w && (b.copy(y), x && x.copy(T), w = G, S = D, _ = C), G < r)
3148
3148
  return !0;
3149
3149
  }
3150
3150
  }
@@ -3156,15 +3156,15 @@ function Rl(i, e, t, n = {}, s = {}, r = 0, o = 1 / 0) {
3156
3156
  Ie(p, 3 * M, h, d), p.a.applyMatrix4(t), p.b.applyMatrix4(t), p.c.applyMatrix4(t), p.needsUpdate = !0;
3157
3157
  for (let C = A, N = A + P; C < N; C++) {
3158
3158
  Ie(f, 3 * C, u, c), f.needsUpdate = !0;
3159
- const D = f.distanceToTriangle(p, y, E);
3160
- if (D < w && (S.copy(y), x && x.copy(E), w = D, b = C, _ = M), D < r)
3159
+ const D = f.distanceToTriangle(p, y, T);
3160
+ if (D < w && (b.copy(y), x && x.copy(T), w = D, S = C, _ = M), D < r)
3161
3161
  return !0;
3162
3162
  }
3163
3163
  }
3164
3164
  }
3165
3165
  }
3166
3166
  }
3167
- ), lt.releasePrimitive(f), lt.releasePrimitive(p), w === 1 / 0 ? null : (n.point ? n.point.copy(S) : n.point = S.clone(), n.distance = w, n.faceIndex = b, s && (s.point ? s.point.copy(x) : s.point = x.clone(), s.point.applyMatrix4(xs), S.applyMatrix4(xs), s.distance = S.sub(s.point).length(), s.faceIndex = _), n);
3167
+ ), lt.releasePrimitive(f), lt.releasePrimitive(p), w === 1 / 0 ? null : (n.point ? n.point.copy(b) : n.point = b.clone(), n.distance = w, n.faceIndex = S, s && (s.point ? s.point.copy(x) : s.point = x.clone(), s.point.applyMatrix4(xs), b.applyMatrix4(xs), s.distance = b.sub(s.point).length(), s.faceIndex = _), n);
3168
3168
  }
3169
3169
  function Ml(i, e = null) {
3170
3170
  e && Array.isArray(e) && (e = new Set(e));
@@ -3174,39 +3174,39 @@ function Ml(i, e = null) {
3174
3174
  for (let f = 0, p = d.length; f < p; f++)
3175
3175
  r = d[f], o = new Uint32Array(r), a = new Uint16Array(r), c = new Float32Array(r), h(0, u), u += r.byteLength;
3176
3176
  function h(f, p, y = !1) {
3177
- const S = f * 2;
3178
- if (De(S, a)) {
3179
- const E = $e(f, o), x = Qe(S, a);
3180
- let w = 1 / 0, b = 1 / 0, _ = 1 / 0, A = -1 / 0, P = -1 / 0, I = -1 / 0;
3181
- for (let M = E, O = E + x; M < O; M++) {
3177
+ const b = f * 2;
3178
+ if (De(b, a)) {
3179
+ const T = $e(f, o), x = Qe(b, a);
3180
+ let w = 1 / 0, S = 1 / 0, _ = 1 / 0, A = -1 / 0, P = -1 / 0, I = -1 / 0;
3181
+ for (let M = T, O = T + x; M < O; M++) {
3182
3182
  const C = 3 * i.resolveTriangleIndex(M);
3183
3183
  for (let N = 0; N < 3; N++) {
3184
3184
  let D = C + N;
3185
3185
  D = n ? n[D] : D;
3186
3186
  const H = s.getX(D), G = s.getY(D), q = s.getZ(D);
3187
- H < w && (w = H), H > A && (A = H), G < b && (b = G), G > P && (P = G), q < _ && (_ = q), q > I && (I = q);
3187
+ H < w && (w = H), H > A && (A = H), G < S && (S = G), G > P && (P = G), q < _ && (_ = q), q > I && (I = q);
3188
3188
  }
3189
3189
  }
3190
- return c[f + 0] !== w || c[f + 1] !== b || c[f + 2] !== _ || c[f + 3] !== A || c[f + 4] !== P || c[f + 5] !== I ? (c[f + 0] = w, c[f + 1] = b, c[f + 2] = _, c[f + 3] = A, c[f + 4] = P, c[f + 5] = I, !0) : !1;
3190
+ return c[f + 0] !== w || c[f + 1] !== S || c[f + 2] !== _ || c[f + 3] !== A || c[f + 4] !== P || c[f + 5] !== I ? (c[f + 0] = w, c[f + 1] = S, c[f + 2] = _, c[f + 3] = A, c[f + 4] = P, c[f + 5] = I, !0) : !1;
3191
3191
  } else {
3192
- const E = Fe(f), x = ze(f, o);
3193
- let w = y, b = !1, _ = !1;
3192
+ const T = Fe(f), x = ze(f, o);
3193
+ let w = y, S = !1, _ = !1;
3194
3194
  if (e) {
3195
3195
  if (!w) {
3196
- const C = E / Oe + p / qe, N = x / Oe + p / qe;
3197
- b = e.has(C), _ = e.has(N), w = !b && !_;
3196
+ const C = T / Oe + p / qe, N = x / Oe + p / qe;
3197
+ S = e.has(C), _ = e.has(N), w = !S && !_;
3198
3198
  }
3199
3199
  } else
3200
- b = !0, _ = !0;
3201
- const A = w || b, P = w || _;
3200
+ S = !0, _ = !0;
3201
+ const A = w || S, P = w || _;
3202
3202
  let I = !1;
3203
- A && (I = h(E, p, w));
3203
+ A && (I = h(T, p, w));
3204
3204
  let M = !1;
3205
3205
  P && (M = h(x, p, w));
3206
3206
  const O = I || M;
3207
3207
  if (O)
3208
3208
  for (let C = 0; C < 3; C++) {
3209
- const N = E + C, D = x + C, H = c[N], G = c[N + 3], q = c[D], ie = c[D + 3];
3209
+ const N = T + C, D = x + C, H = c[N], G = c[N + 3], q = c[D], ie = c[D + 3];
3210
3210
  c[f + C] = H < q ? H : q, c[f + C + 3] = G > ie ? G : ie;
3211
3211
  }
3212
3212
  return O;
@@ -3242,18 +3242,18 @@ function Fi(i, e, t, n, s, r) {
3242
3242
  return yl(e, t, n, h, f, s, r);
3243
3243
  } else {
3244
3244
  const h = rr(i, c), f = Cl[h], y = n.direction[f] >= 0;
3245
- let S, E;
3246
- y ? (S = Fe(i), E = ze(i, c)) : (S = ze(i, c), E = Fe(i));
3247
- const w = Kt(S, o, n, s, r) ? Fi(S, e, t, n, s, r) : null;
3245
+ let b, T;
3246
+ y ? (b = Fe(i), T = ze(i, c)) : (b = ze(i, c), T = Fe(i));
3247
+ const w = Kt(b, o, n, s, r) ? Fi(b, e, t, n, s, r) : null;
3248
3248
  if (w) {
3249
3249
  const A = w.point[f];
3250
- if (y ? A <= o[E + h] : (
3250
+ if (y ? A <= o[T + h] : (
3251
3251
  // min bounding data
3252
- A >= o[E + h + 3]
3252
+ A >= o[T + h + 3]
3253
3253
  ))
3254
3254
  return w;
3255
3255
  }
3256
- const _ = Kt(E, o, n, s, r) ? Fi(E, e, t, n, s, r) : null;
3256
+ const _ = Kt(T, o, n, s, r) ? Fi(T, e, t, n, s, r) : null;
3257
3257
  return w && _ ? w.distance <= _.distance ? w : _ : w || _ || null;
3258
3258
  }
3259
3259
  }
@@ -3267,21 +3267,21 @@ function zi(i, e, t, n, s = null) {
3267
3267
  const { float32Array: r, uint16Array: o, uint32Array: a } = be;
3268
3268
  let c = i * 2;
3269
3269
  if (s === null && (t.boundingBox || t.computeBoundingBox(), Wr.set(t.boundingBox.min, t.boundingBox.max, n), s = Wr), De(c, o)) {
3270
- const d = e.geometry, h = d.index, f = d.attributes.position, p = t.index, y = t.attributes.position, S = $e(i, a), E = Qe(c, o);
3270
+ const d = e.geometry, h = d.index, f = d.attributes.position, p = t.index, y = t.attributes.position, b = $e(i, a), T = Qe(c, o);
3271
3271
  if (Nn.copy(n).invert(), t.boundsTree)
3272
3272
  return xe(i, r, vs), vs.matrix.copy(Nn), vs.needsUpdate = !0, t.boundsTree.shapecast({
3273
3273
  intersectsBounds: (w) => vs.intersectsBox(w),
3274
3274
  intersectsTriangle: (w) => {
3275
3275
  w.a.applyMatrix4(n), w.b.applyMatrix4(n), w.c.applyMatrix4(n), w.needsUpdate = !0;
3276
- for (let b = S, _ = E + S; b < _; b++)
3277
- if (Ie(mn, 3 * e.resolveTriangleIndex(b), h, f), mn.needsUpdate = !0, w.intersectsTriangle(mn))
3276
+ for (let S = b, _ = T + b; S < _; S++)
3277
+ if (Ie(mn, 3 * e.resolveTriangleIndex(S), h, f), mn.needsUpdate = !0, w.intersectsTriangle(mn))
3278
3278
  return !0;
3279
3279
  return !1;
3280
3280
  }
3281
3281
  });
3282
3282
  {
3283
3283
  const x = Ys(t);
3284
- for (let w = S, b = E + S; w < b; w++) {
3284
+ for (let w = b, S = T + b; w < S; w++) {
3285
3285
  const _ = e.resolveTriangleIndex(w);
3286
3286
  Ie(pn, 3 * _, h, f), pn.a.applyMatrix4(Nn), pn.b.applyMatrix4(Nn), pn.c.applyMatrix4(Nn), pn.needsUpdate = !0;
3287
3287
  for (let A = 0, P = x * 3; A < P; A += 3)
@@ -3298,9 +3298,9 @@ const Rs = /* @__PURE__ */ new ut(), ui = /* @__PURE__ */ new Je(), kn = /* @__P
3298
3298
  function Fl(i, e, t, n = {}, s = {}, r = 0, o = 1 / 0) {
3299
3299
  e.boundingBox || e.computeBoundingBox(), ui.set(e.boundingBox.min, e.boundingBox.max, t), ui.needsUpdate = !0;
3300
3300
  const a = i.geometry, c = a.attributes.position, u = a.index, d = e.attributes.position, h = e.index, f = lt.getPrimitive(), p = lt.getPrimitive();
3301
- let y = Ol, S = Dl, E = null, x = null;
3302
- s && (E = Nl, x = kl);
3303
- let w = 1 / 0, b = null, _ = null;
3301
+ let y = Ol, b = Dl, T = null, x = null;
3302
+ s && (T = Nl, x = kl);
3303
+ let w = 1 / 0, S = null, _ = null;
3304
3304
  return Rs.copy(t).invert(), kn.matrix.copy(Rs), i.shapecast(
3305
3305
  {
3306
3306
  boundsTraverseOrder: (A) => ui.distanceToBox(A),
@@ -3318,8 +3318,8 @@ function Fl(i, e, t, n = {}, s = {}, r = 0, o = 1 / 0) {
3318
3318
  for (let H = A, G = A + P; H < G; H++) {
3319
3319
  const q = i.resolveTriangleIndex(H);
3320
3320
  Ie(f, 3 * q, u, c), f.needsUpdate = !0;
3321
- const ie = f.distanceToTriangle(p, y, E);
3322
- if (ie < w && (S.copy(y), x && x.copy(E), w = ie, b = H, _ = C), ie < r)
3321
+ const ie = f.distanceToTriangle(p, y, T);
3322
+ if (ie < w && (b.copy(y), x && x.copy(T), w = ie, S = H, _ = C), ie < r)
3323
3323
  return !0;
3324
3324
  }
3325
3325
  }
@@ -3332,15 +3332,15 @@ function Fl(i, e, t, n = {}, s = {}, r = 0, o = 1 / 0) {
3332
3332
  for (let C = A, N = A + P; C < N; C++) {
3333
3333
  const D = i.resolveTriangleIndex(C);
3334
3334
  Ie(f, 3 * D, u, c), f.needsUpdate = !0;
3335
- const H = f.distanceToTriangle(p, y, E);
3336
- if (H < w && (S.copy(y), x && x.copy(E), w = H, b = C, _ = M), H < r)
3335
+ const H = f.distanceToTriangle(p, y, T);
3336
+ if (H < w && (b.copy(y), x && x.copy(T), w = H, S = C, _ = M), H < r)
3337
3337
  return !0;
3338
3338
  }
3339
3339
  }
3340
3340
  }
3341
3341
  }
3342
3342
  }
3343
- ), lt.releasePrimitive(f), lt.releasePrimitive(p), w === 1 / 0 ? null : (n.point ? n.point.copy(S) : n.point = S.clone(), n.distance = w, n.faceIndex = b, s && (s.point ? s.point.copy(x) : s.point = x.clone(), s.point.applyMatrix4(Rs), S.applyMatrix4(Rs), s.distance = S.sub(s.point).length(), s.faceIndex = _), n);
3343
+ ), lt.releasePrimitive(f), lt.releasePrimitive(p), w === 1 / 0 ? null : (n.point ? n.point.copy(b) : n.point = b.clone(), n.distance = w, n.faceIndex = S, s && (s.point ? s.point.copy(x) : s.point = x.clone(), s.point.applyMatrix4(Rs), b.applyMatrix4(Rs), s.distance = b.sub(s.point).length(), s.faceIndex = _), n);
3344
3344
  }
3345
3345
  function Zr(i, e, t) {
3346
3346
  return i === null ? null : (i.point.applyMatrix4(e.matrixWorld), i.distance = i.point.distanceTo(t.ray.origin), i.object = e, i);
@@ -3411,9 +3411,9 @@ class Ws extends il {
3411
3411
  function c(u) {
3412
3412
  for (let d = 0; d < u.length; d++) {
3413
3413
  const h = u[d], f = new Uint32Array(h), p = new Uint16Array(h);
3414
- for (let y = 0, S = h.byteLength / qe; y < S; y++) {
3415
- const E = Oe * y, x = 2 * E;
3416
- De(x, p) || (f[E + 6] = f[E + 6] / Oe - y);
3414
+ for (let y = 0, b = h.byteLength / qe; y < b; y++) {
3415
+ const T = Oe * y, x = 2 * T;
3416
+ De(x, p) || (f[T + 6] = f[T + 6] / Oe - y);
3417
3417
  }
3418
3418
  }
3419
3419
  }
@@ -3457,11 +3457,11 @@ class Ws extends il {
3457
3457
  let d = u + 0, h = u + 1, f = u + 2;
3458
3458
  a && (d = a[d], h = a[h], f = a[f]);
3459
3459
  for (let p = 0; p < 3; p++) {
3460
- const y = o[di[p]](d), S = o[di[p]](h), E = o[di[p]](f);
3460
+ const y = o[di[p]](d), b = o[di[p]](h), T = o[di[p]](f);
3461
3461
  let x = y;
3462
- S < x && (x = S), E < x && (x = E);
3462
+ b < x && (x = b), T < x && (x = T);
3463
3463
  let w = y;
3464
- S > w && (w = S), E > w && (w = E), t[n + p] = x, t[n + p + 3] = w;
3464
+ b > w && (w = b), T > w && (w = T), t[n + p] = x, t[n + p + 3] = w;
3465
3465
  }
3466
3466
  return t;
3467
3467
  }
@@ -3477,13 +3477,13 @@ class Ws extends il {
3477
3477
  let h = 3;
3478
3478
  o.isInterleavedBufferAttribute && (h = o.data.stride);
3479
3479
  const f = ["getX", "getY", "getZ"], p = n.offset;
3480
- for (let y = e, S = e + t; y < S; y++) {
3480
+ for (let y = e, b = e + t; y < b; y++) {
3481
3481
  const x = (r ? r[y] : y) * 3, w = (y - p) * 6;
3482
- let b = x + 0, _ = x + 1, A = x + 2;
3483
- a && (b = a[b], _ = a[_], A = a[A]), c || (b = b * h + d, _ = _ * h + d, A = A * h + d);
3482
+ let S = x + 0, _ = x + 1, A = x + 2;
3483
+ a && (S = a[S], _ = a[_], A = a[A]), c || (S = S * h + d, _ = _ * h + d, A = A * h + d);
3484
3484
  for (let P = 0; P < 3; P++) {
3485
3485
  let I, M, O;
3486
- c ? (I = o[f[P]](b), M = o[f[P]](_), O = o[f[P]](A)) : (I = u[b + P], M = u[_ + P], O = u[A + P]);
3486
+ c ? (I = o[f[P]](S), M = o[f[P]](_), O = o[f[P]](A)) : (I = u[S + P], M = u[_ + P], O = u[A + P]);
3487
3487
  let C = I;
3488
3488
  M < C && (C = M), O < C && (C = O);
3489
3489
  let N = I;
@@ -3646,32 +3646,32 @@ class Ws extends il {
3646
3646
  intersectsTriangles: r
3647
3647
  } = n;
3648
3648
  const o = lt.getPrimitive(), a = this.geometry.index, c = this.geometry.attributes.position, u = this.indirect ? (y) => {
3649
- const S = this.resolveTriangleIndex(y);
3650
- Ie(o, S * 3, a, c);
3649
+ const b = this.resolveTriangleIndex(y);
3650
+ Ie(o, b * 3, a, c);
3651
3651
  } : (y) => {
3652
3652
  Ie(o, y * 3, a, c);
3653
3653
  }, d = lt.getPrimitive(), h = e.geometry.index, f = e.geometry.attributes.position, p = e.indirect ? (y) => {
3654
- const S = e.resolveTriangleIndex(y);
3655
- Ie(d, S * 3, h, f);
3654
+ const b = e.resolveTriangleIndex(y);
3655
+ Ie(d, b * 3, h, f);
3656
3656
  } : (y) => {
3657
3657
  Ie(d, y * 3, h, f);
3658
3658
  };
3659
3659
  if (r) {
3660
3660
  if (!(e instanceof Ws))
3661
3661
  throw new Error('MeshBVH: "intersectsTriangles" callback can only be used with another MeshBVH.');
3662
- const y = (S, E, x, w, b, _, A, P) => {
3662
+ const y = (b, T, x, w, S, _, A, P) => {
3663
3663
  for (let I = x, M = x + w; I < M; I++) {
3664
3664
  p(I), d.a.applyMatrix4(t), d.b.applyMatrix4(t), d.c.applyMatrix4(t), d.needsUpdate = !0;
3665
- for (let O = S, C = S + E; O < C; O++)
3666
- if (u(O), o.needsUpdate = !0, r(o, d, O, I, b, _, A, P))
3665
+ for (let O = b, C = b + T; O < C; O++)
3666
+ if (u(O), o.needsUpdate = !0, r(o, d, O, I, S, _, A, P))
3667
3667
  return !0;
3668
3668
  }
3669
3669
  return !1;
3670
3670
  };
3671
3671
  if (s) {
3672
- const S = s;
3673
- s = function(E, x, w, b, _, A, P, I) {
3674
- return S(E, x, w, b, _, A, P, I) ? !0 : y(E, x, w, b, _, A, P, I);
3672
+ const b = s;
3673
+ s = function(T, x, w, S, _, A, P, I) {
3674
+ return b(T, x, w, S, _, A, P, I) ? !0 : y(T, x, w, S, _, A, P, I);
3675
3675
  };
3676
3676
  } else
3677
3677
  s = y;
@@ -3855,12 +3855,12 @@ function qr(i) {
3855
3855
  const e = i;
3856
3856
  for (const n of Object.keys(e)) {
3857
3857
  const s = e[n];
3858
- s instanceof T.Texture && s.dispose();
3858
+ s instanceof E.Texture && s.dispose();
3859
3859
  }
3860
3860
  const t = i;
3861
3861
  if (t.isShaderMaterial && t.uniforms)
3862
3862
  for (const n of Object.values(t.uniforms))
3863
- (n == null ? void 0 : n.value) instanceof T.Texture && n.value.dispose();
3863
+ (n == null ? void 0 : n.value) instanceof E.Texture && n.value.dispose();
3864
3864
  i.dispose();
3865
3865
  }
3866
3866
  function $s(i) {
@@ -3876,7 +3876,7 @@ function $s(i) {
3876
3876
  }
3877
3877
  function Hl(i, e) {
3878
3878
  if (!(e != null && e.keepBackgrounds)) {
3879
- i.background instanceof T.Texture && (i.background.dispose(), i.background = null), i.environment instanceof T.Texture && (i.environment.dispose(), i.environment = null);
3879
+ i.background instanceof E.Texture && (i.background.dispose(), i.background = null), i.environment instanceof E.Texture && (i.environment.dispose(), i.environment = null);
3880
3880
  const t = i;
3881
3881
  t.__originalEnvironmentTexture && (t.__originalEnvironmentTexture = void 0);
3882
3882
  }
@@ -3979,12 +3979,12 @@ class Le {
3979
3979
  return new Le(e);
3980
3980
  }
3981
3981
  static create() {
3982
- return new Le(new T.Object3D());
3982
+ return new Le(new E.Object3D());
3983
3983
  }
3984
3984
  }
3985
3985
  class Lt {
3986
3986
  constructor(e) {
3987
- this.scene = e || new T.Scene();
3987
+ this.scene = e || new E.Scene();
3988
3988
  }
3989
3989
  get id() {
3990
3990
  return this.scene.uuid;
@@ -4044,7 +4044,7 @@ class Lt {
4044
4044
  });
4045
4045
  }
4046
4046
  get background() {
4047
- return this.scene.background instanceof T.Color ? new Bi(this.scene.background) : this.scene.background instanceof T.Texture ? new Ps(this.scene.background) : null;
4047
+ return this.scene.background instanceof E.Color ? new Bi(this.scene.background) : this.scene.background instanceof E.Texture ? new Ps(this.scene.background) : null;
4048
4048
  }
4049
4049
  set background(e) {
4050
4050
  e instanceof Bi ? this.scene.background = e.getThreeColor() : e instanceof Ps ? this.scene.background = e.getThreeTexture() : this.scene.background = null;
@@ -4156,25 +4156,25 @@ class Uo extends Le {
4156
4156
  super(e), this.camera = e;
4157
4157
  }
4158
4158
  get near() {
4159
- return this.camera instanceof T.PerspectiveCamera || this.camera instanceof T.OrthographicCamera ? this.camera.near : 0.1;
4159
+ return this.camera instanceof E.PerspectiveCamera || this.camera instanceof E.OrthographicCamera ? this.camera.near : 0.1;
4160
4160
  }
4161
4161
  set near(e) {
4162
- (this.camera instanceof T.PerspectiveCamera || this.camera instanceof T.OrthographicCamera) && (this.camera.near = e);
4162
+ (this.camera instanceof E.PerspectiveCamera || this.camera instanceof E.OrthographicCamera) && (this.camera.near = e);
4163
4163
  }
4164
4164
  get far() {
4165
- return this.camera instanceof T.PerspectiveCamera || this.camera instanceof T.OrthographicCamera ? this.camera.far : 1e3;
4165
+ return this.camera instanceof E.PerspectiveCamera || this.camera instanceof E.OrthographicCamera ? this.camera.far : 1e3;
4166
4166
  }
4167
4167
  set far(e) {
4168
- (this.camera instanceof T.PerspectiveCamera || this.camera instanceof T.OrthographicCamera) && (this.camera.far = e);
4168
+ (this.camera instanceof E.PerspectiveCamera || this.camera instanceof E.OrthographicCamera) && (this.camera.far = e);
4169
4169
  }
4170
4170
  lookAt(e) {
4171
4171
  e instanceof Zt ? this.camera.lookAt(e.getThreeVector()) : this.camera.lookAt(e.x, e.y, e.z);
4172
4172
  }
4173
4173
  updateProjectionMatrix() {
4174
- (this.camera instanceof T.PerspectiveCamera || this.camera instanceof T.OrthographicCamera) && this.camera.updateProjectionMatrix();
4174
+ (this.camera instanceof E.PerspectiveCamera || this.camera instanceof E.OrthographicCamera) && this.camera.updateProjectionMatrix();
4175
4175
  }
4176
4176
  getWorldDirection(e) {
4177
- const t = new T.Vector3();
4177
+ const t = new E.Vector3();
4178
4178
  this.camera.getWorldDirection(t), e.set(t.x, t.y, t.z);
4179
4179
  }
4180
4180
  /**
@@ -4191,7 +4191,7 @@ class Uo extends Le {
4191
4191
  }
4192
4192
  class lr extends Uo {
4193
4193
  constructor(e) {
4194
- const t = e || new T.PerspectiveCamera();
4194
+ const t = e || new E.PerspectiveCamera();
4195
4195
  super(t), this.perspectiveCamera = t;
4196
4196
  }
4197
4197
  get type() {
@@ -4211,7 +4211,7 @@ class lr extends Uo {
4211
4211
  }
4212
4212
  static create(e = 75, t = 1, n = 0.1, s = 1e3) {
4213
4213
  return new lr(
4214
- new T.PerspectiveCamera(e, t, n, s)
4214
+ new E.PerspectiveCamera(e, t, n, s)
4215
4215
  );
4216
4216
  }
4217
4217
  }
@@ -4224,7 +4224,7 @@ class jl {
4224
4224
  }
4225
4225
  initialize(e) {
4226
4226
  try {
4227
- if (this.renderer = new T.WebGLRenderer({
4227
+ if (this.renderer = new E.WebGLRenderer({
4228
4228
  canvas: this.canvas,
4229
4229
  antialias: e.antialias ?? !0,
4230
4230
  alpha: e.alpha ?? !1,
@@ -4233,20 +4233,20 @@ class jl {
4233
4233
  powerPreference: e.powerPreference ?? "default"
4234
4234
  }), e.shadowMap && (this.renderer.shadowMap.enabled = e.shadowMap.enabled, this.renderer.shadowMap.autoUpdate = !0, e.shadowMap.type)) {
4235
4235
  const t = {
4236
- basic: T.BasicShadowMap,
4237
- pcf: T.PCFShadowMap,
4238
- pcfsoft: T.PCFSoftShadowMap,
4239
- vsm: T.VSMShadowMap
4236
+ basic: E.BasicShadowMap,
4237
+ pcf: E.PCFShadowMap,
4238
+ pcfsoft: E.PCFSoftShadowMap,
4239
+ vsm: E.VSMShadowMap
4240
4240
  };
4241
4241
  this.renderer.shadowMap.type = t[e.shadowMap.type];
4242
4242
  }
4243
4243
  if (e.toneMapping) {
4244
4244
  const t = {
4245
- none: T.NoToneMapping,
4246
- linear: T.LinearToneMapping,
4247
- reinhard: T.ReinhardToneMapping,
4248
- cineon: T.CineonToneMapping,
4249
- aces: T.ACESFilmicToneMapping
4245
+ none: E.NoToneMapping,
4246
+ linear: E.LinearToneMapping,
4247
+ reinhard: E.ReinhardToneMapping,
4248
+ cineon: E.CineonToneMapping,
4249
+ aces: E.ACESFilmicToneMapping
4250
4250
  };
4251
4251
  this.renderer.toneMapping = t[e.toneMapping.type], this.renderer.toneMappingExposure = e.toneMapping.exposure;
4252
4252
  }
@@ -4254,7 +4254,7 @@ class jl {
4254
4254
  const { clientWidth: t, clientHeight: n } = this.canvas.parentElement || this.canvas;
4255
4255
  t && n && this.renderer.setSize(t, n);
4256
4256
  }
4257
- return this.renderer.outputColorSpace = T.SRGBColorSpace, k.ok(void 0);
4257
+ return this.renderer.outputColorSpace = E.SRGBColorSpace, k.ok(void 0);
4258
4258
  } catch (t) {
4259
4259
  return k.err(
4260
4260
  new Z(
@@ -4983,15 +4983,15 @@ class ch {
4983
4983
  return a.length < 1 ? null : (a.push(this.parser.createNodeMesh(e)), Promise.all(a).then((u) => {
4984
4984
  const d = u.pop(), h = d.isGroup ? d.children : [d], f = u[0].count, p = [];
4985
4985
  for (const y of h) {
4986
- const S = new ut(), E = new $(), x = new xn(), w = new $(1, 1, 1), b = new Ao(y.geometry, y.material, f);
4986
+ const b = new ut(), T = new $(), x = new xn(), w = new $(1, 1, 1), S = new Ao(y.geometry, y.material, f);
4987
4987
  for (let _ = 0; _ < f; _++)
4988
- c.TRANSLATION && E.fromBufferAttribute(c.TRANSLATION, _), c.ROTATION && x.fromBufferAttribute(c.ROTATION, _), c.SCALE && w.fromBufferAttribute(c.SCALE, _), b.setMatrixAt(_, S.compose(E, x, w));
4988
+ c.TRANSLATION && T.fromBufferAttribute(c.TRANSLATION, _), c.ROTATION && x.fromBufferAttribute(c.ROTATION, _), c.SCALE && w.fromBufferAttribute(c.SCALE, _), S.setMatrixAt(_, b.compose(T, x, w));
4989
4989
  for (const _ in c)
4990
4990
  if (_ === "_COLOR_0") {
4991
4991
  const A = c[_];
4992
- b.instanceColor = new ec(A.array, A.itemSize, A.normalized);
4992
+ S.instanceColor = new ec(A.array, A.itemSize, A.normalized);
4993
4993
  } else _ !== "TRANSLATION" && _ !== "ROTATION" && _ !== "SCALE" && y.geometry.setAttribute(_, c[_]);
4994
- er.prototype.copy.call(b, y), this.parser.assignFinalMaterial(b), p.push(b);
4994
+ er.prototype.copy.call(S, y), this.parser.assignFinalMaterial(S), p.push(S);
4995
4995
  }
4996
4996
  return d.isGroup ? (d.clear(), d.add(...p), d) : p[0];
4997
4997
  }));
@@ -5052,8 +5052,8 @@ class hh {
5052
5052
  return new Promise(function(h, f) {
5053
5053
  s.decodeDracoFile(d, function(p) {
5054
5054
  for (const y in p.attributes) {
5055
- const S = p.attributes[y], E = c[y];
5056
- E !== void 0 && (S.normalized = E);
5055
+ const b = p.attributes[y], T = c[y];
5056
+ T !== void 0 && (b.normalized = T);
5057
5057
  }
5058
5058
  h(p);
5059
5059
  }, a, u, je, f);
@@ -5085,10 +5085,10 @@ class Go extends _c {
5085
5085
  return t;
5086
5086
  }
5087
5087
  interpolate_(e, t, n, s) {
5088
- const r = this.resultBuffer, o = this.sampleValues, a = this.valueSize, c = a * 2, u = a * 3, d = s - t, h = (n - t) / d, f = h * h, p = f * h, y = e * u, S = y - u, E = -2 * p + 3 * f, x = p - f, w = 1 - E, b = x - f + h;
5088
+ const r = this.resultBuffer, o = this.sampleValues, a = this.valueSize, c = a * 2, u = a * 3, d = s - t, h = (n - t) / d, f = h * h, p = f * h, y = e * u, b = y - u, T = -2 * p + 3 * f, x = p - f, w = 1 - T, S = x - f + h;
5089
5089
  for (let _ = 0; _ !== a; _++) {
5090
- const A = o[S + _ + a], P = o[S + _ + c] * d, I = o[y + _ + a], M = o[y + _] * d;
5091
- r[_] = w * A + b * P + E * I + x * M;
5090
+ const A = o[b + _ + a], P = o[b + _ + c] * d, I = o[y + _ + a], M = o[y + _] * d;
5091
+ r[_] = w * A + S * P + T * I + x * M;
5092
5092
  }
5093
5093
  return r;
5094
5094
  }
@@ -5514,23 +5514,23 @@ class Sh {
5514
5514
  const r = [];
5515
5515
  return s.bufferView !== void 0 ? r.push(this.getDependency("bufferView", s.bufferView)) : r.push(null), s.sparse !== void 0 && (r.push(this.getDependency("bufferView", s.sparse.indices.bufferView)), r.push(this.getDependency("bufferView", s.sparse.values.bufferView))), Promise.all(r).then(function(o) {
5516
5516
  const a = o[0], c = fi[s.type], u = bn[s.componentType], d = u.BYTES_PER_ELEMENT, h = d * c, f = s.byteOffset || 0, p = s.bufferView !== void 0 ? n.bufferViews[s.bufferView].byteStride : void 0, y = s.normalized === !0;
5517
- let S, E;
5517
+ let b, T;
5518
5518
  if (p && p !== h) {
5519
5519
  const x = Math.floor(f / p), w = "InterleavedBuffer:" + s.bufferView + ":" + s.componentType + ":" + x + ":" + s.count;
5520
- let b = t.cache.get(w);
5521
- b || (S = new u(a, x * p, s.count * p / d), b = new sc(S, p / d), t.cache.add(w, b)), E = new ic(b, c, f % p / d, y);
5520
+ let S = t.cache.get(w);
5521
+ S || (b = new u(a, x * p, s.count * p / d), S = new sc(b, p / d), t.cache.add(w, S)), T = new ic(S, c, f % p / d, y);
5522
5522
  } else
5523
- a === null ? S = new u(s.count * c) : S = new u(a, f, s.count * c), E = new jn(S, c, y);
5523
+ a === null ? b = new u(s.count * c) : b = new u(a, f, s.count * c), T = new jn(b, c, y);
5524
5524
  if (s.sparse !== void 0) {
5525
- const x = fi.SCALAR, w = bn[s.sparse.indices.componentType], b = s.sparse.indices.byteOffset || 0, _ = s.sparse.values.byteOffset || 0, A = new w(o[1], b, s.sparse.count * x), P = new u(o[2], _, s.sparse.count * c);
5526
- a !== null && (E = new jn(E.array.slice(), E.itemSize, E.normalized)), E.normalized = !1;
5525
+ const x = fi.SCALAR, w = bn[s.sparse.indices.componentType], S = s.sparse.indices.byteOffset || 0, _ = s.sparse.values.byteOffset || 0, A = new w(o[1], S, s.sparse.count * x), P = new u(o[2], _, s.sparse.count * c);
5526
+ a !== null && (T = new jn(T.array.slice(), T.itemSize, T.normalized)), T.normalized = !1;
5527
5527
  for (let I = 0, M = A.length; I < M; I++) {
5528
5528
  const O = A[I];
5529
- if (E.setX(O, P[I * c]), c >= 2 && E.setY(O, P[I * c + 1]), c >= 3 && E.setZ(O, P[I * c + 2]), c >= 4 && E.setW(O, P[I * c + 3]), c >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");
5529
+ if (T.setX(O, P[I * c]), c >= 2 && T.setY(O, P[I * c + 1]), c >= 3 && T.setZ(O, P[I * c + 2]), c >= 4 && T.setW(O, P[I * c + 3]), c >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");
5530
5530
  }
5531
- E.normalized = y;
5531
+ T.normalized = y;
5532
5532
  }
5533
- return E;
5533
+ return T;
5534
5534
  });
5535
5535
  }
5536
5536
  /**
@@ -5579,9 +5579,9 @@ class Sh {
5579
5579
  const d = Promise.resolve(c).then(function(h) {
5580
5580
  return new Promise(function(f, p) {
5581
5581
  let y = f;
5582
- t.isImageBitmapLoader === !0 && (y = function(S) {
5583
- const E = new xr(S);
5584
- E.needsUpdate = !0, f(E);
5582
+ t.isImageBitmapLoader === !0 && (y = function(b) {
5583
+ const T = new xr(b);
5584
+ T.needsUpdate = !0, f(T);
5585
5585
  }), t.load(Gn.resolveURL(h, r.path), y, void 0, p);
5586
5586
  });
5587
5587
  }).then(function(h) {
@@ -5745,22 +5745,22 @@ class Sh {
5745
5745
  return a.push(t.loadGeometries(o)), Promise.all(a).then(function(c) {
5746
5746
  const u = c.slice(0, c.length - 1), d = c[c.length - 1], h = [];
5747
5747
  for (let p = 0, y = d.length; p < y; p++) {
5748
- const S = d[p], E = o[p];
5748
+ const b = d[p], T = o[p];
5749
5749
  let x;
5750
5750
  const w = u[p];
5751
- if (E.mode === at.TRIANGLES || E.mode === at.TRIANGLE_STRIP || E.mode === at.TRIANGLE_FAN || E.mode === void 0)
5752
- x = r.isSkinnedMesh === !0 ? new pc(S, w) : new wt(S, w), x.isSkinnedMesh === !0 && x.normalizeSkinWeights(), E.mode === at.TRIANGLE_STRIP ? x.geometry = Qr(x.geometry, So) : E.mode === at.TRIANGLE_FAN && (x.geometry = Qr(x.geometry, vi));
5753
- else if (E.mode === at.LINES)
5754
- x = new qi(S, w);
5755
- else if (E.mode === at.LINE_STRIP)
5756
- x = new Qi(S, w);
5757
- else if (E.mode === at.LINE_LOOP)
5758
- x = new $i(S, w);
5759
- else if (E.mode === at.POINTS)
5760
- x = new Ji(S, w);
5751
+ if (T.mode === at.TRIANGLES || T.mode === at.TRIANGLE_STRIP || T.mode === at.TRIANGLE_FAN || T.mode === void 0)
5752
+ x = r.isSkinnedMesh === !0 ? new pc(b, w) : new wt(b, w), x.isSkinnedMesh === !0 && x.normalizeSkinWeights(), T.mode === at.TRIANGLE_STRIP ? x.geometry = Qr(x.geometry, So) : T.mode === at.TRIANGLE_FAN && (x.geometry = Qr(x.geometry, vi));
5753
+ else if (T.mode === at.LINES)
5754
+ x = new qi(b, w);
5755
+ else if (T.mode === at.LINE_STRIP)
5756
+ x = new Qi(b, w);
5757
+ else if (T.mode === at.LINE_LOOP)
5758
+ x = new $i(b, w);
5759
+ else if (T.mode === at.POINTS)
5760
+ x = new Ji(b, w);
5761
5761
  else
5762
- throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + E.mode);
5763
- Object.keys(x.geometry.morphAttributes).length > 0 && wh(x, r), x.name = t.createUniqueName(r.name || "mesh_" + e), vt(x, r), E.extensions && Jt(s, x, E), t.assignFinalMaterial(x), h.push(x);
5762
+ throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + T.mode);
5763
+ Object.keys(x.geometry.morphAttributes).length > 0 && wh(x, r), x.name = t.createUniqueName(r.name || "mesh_" + e), vt(x, r), T.extensions && Jt(s, x, T), t.assignFinalMaterial(x), h.push(x);
5764
5764
  }
5765
5765
  for (let p = 0, y = h.length; p < y; p++)
5766
5766
  t.associations.set(h[p], {
@@ -5827,8 +5827,8 @@ class Sh {
5827
5827
  loadAnimation(e) {
5828
5828
  const t = this.json, n = this, s = t.animations[e], r = s.name ? s.name : "animation_" + e, o = [], a = [], c = [], u = [], d = [];
5829
5829
  for (let h = 0, f = s.channels.length; h < f; h++) {
5830
- const p = s.channels[h], y = s.samplers[p.sampler], S = p.target, E = S.node, x = s.parameters !== void 0 ? s.parameters[y.input] : y.input, w = s.parameters !== void 0 ? s.parameters[y.output] : y.output;
5831
- S.node !== void 0 && (o.push(this.getDependency("node", E)), a.push(this.getDependency("accessor", x)), c.push(this.getDependency("accessor", w)), u.push(y), d.push(S));
5830
+ const p = s.channels[h], y = s.samplers[p.sampler], b = p.target, T = b.node, x = s.parameters !== void 0 ? s.parameters[y.input] : y.input, w = s.parameters !== void 0 ? s.parameters[y.output] : y.output;
5831
+ b.node !== void 0 && (o.push(this.getDependency("node", T)), a.push(this.getDependency("accessor", x)), c.push(this.getDependency("accessor", w)), u.push(y), d.push(b));
5832
5832
  }
5833
5833
  return Promise.all([
5834
5834
  Promise.all(o),
@@ -5837,9 +5837,9 @@ class Sh {
5837
5837
  Promise.all(u),
5838
5838
  Promise.all(d)
5839
5839
  ]).then(function(h) {
5840
- const f = h[0], p = h[1], y = h[2], S = h[3], E = h[4], x = [];
5841
- for (let b = 0, _ = f.length; b < _; b++) {
5842
- const A = f[b], P = p[b], I = y[b], M = S[b], O = E[b];
5840
+ const f = h[0], p = h[1], y = h[2], b = h[3], T = h[4], x = [];
5841
+ for (let S = 0, _ = f.length; S < _; S++) {
5842
+ const A = f[S], P = p[S], I = y[S], M = b[S], O = T[S];
5843
5843
  if (A === void 0) continue;
5844
5844
  A.updateMatrix && A.updateMatrix();
5845
5845
  const C = n._createAnimationTracks(A, P, I, M, O);
@@ -5989,13 +5989,13 @@ class Sh {
5989
5989
  }
5990
5990
  const h = s.interpolation !== void 0 ? mh[s.interpolation] : Mo, f = this._getArrayFromAccessor(n);
5991
5991
  for (let p = 0, y = c.length; p < y; p++) {
5992
- const S = new d(
5992
+ const b = new d(
5993
5993
  c[p] + "." + Ut[r.path],
5994
5994
  t.array,
5995
5995
  f,
5996
5996
  h
5997
5997
  );
5998
- s.interpolation === "CUBICSPLINE" && this._createCubicSplineTrackInterpolant(S), o.push(S);
5998
+ s.interpolation === "CUBICSPLINE" && this._createCubicSplineTrackInterpolant(b), o.push(b);
5999
5999
  }
6000
6000
  return o;
6001
6001
  }
@@ -6043,8 +6043,8 @@ function bh(i, e, t) {
6043
6043
  const f = t.json.accessors[h.POSITION], p = f.min, y = f.max;
6044
6044
  if (p !== void 0 && y !== void 0) {
6045
6045
  if (c.setX(Math.max(Math.abs(p[0]), Math.abs(y[0]))), c.setY(Math.max(Math.abs(p[1]), Math.abs(y[1]))), c.setZ(Math.max(Math.abs(p[2]), Math.abs(y[2]))), f.normalized) {
6046
- const S = Hi(bn[f.componentType]);
6047
- c.multiplyScalar(S);
6046
+ const b = Hi(bn[f.componentType]);
6047
+ c.multiplyScalar(b);
6048
6048
  }
6049
6049
  a.max(c);
6050
6050
  } else
@@ -6078,10 +6078,10 @@ function so(i, e, t) {
6078
6078
  return e.targets !== void 0 ? yh(i, e.targets, t) : i;
6079
6079
  });
6080
6080
  }
6081
- const xh = T.REVISION.replace(/\D/g, ""), Vo = `https://cdn.jsdelivr.net/npm/three@0.${xh}/examples/jsm/libs`, Ah = `${Vo}/draco/`, vh = `${Vo}/basis/`;
6081
+ const xh = E.REVISION.replace(/\D/g, ""), Vo = `https://cdn.jsdelivr.net/npm/three@0.${xh}/examples/jsm/libs`, Ah = `${Vo}/draco/`, vh = `${Vo}/basis/`;
6082
6082
  class Rh {
6083
6083
  constructor(e = {}) {
6084
- this.loadingManager = new T.LoadingManager(), this.loader = new Vl(this.loadingManager), this.config = e;
6084
+ this.loadingManager = new E.LoadingManager(), this.loader = new Vl(this.loadingManager), this.config = e;
6085
6085
  }
6086
6086
  ensureDecoders() {
6087
6087
  return this.decodersReady || (this.decodersReady = this.configureDecoders()), this.decodersReady;
@@ -6122,7 +6122,7 @@ class Rh {
6122
6122
  scene: new Le(s.scene),
6123
6123
  animations: this.convertAnimations(s.animations),
6124
6124
  cameras: (o = s.cameras) == null ? void 0 : o.map((a) => {
6125
- const c = a instanceof T.PerspectiveCamera, u = a instanceof T.OrthographicCamera;
6125
+ const c = a instanceof E.PerspectiveCamera, u = a instanceof E.OrthographicCamera;
6126
6126
  return {
6127
6127
  name: a.name,
6128
6128
  type: a.type,
@@ -6186,7 +6186,7 @@ class Rh {
6186
6186
  }));
6187
6187
  }
6188
6188
  getTrackType(e) {
6189
- return e instanceof T.VectorKeyframeTrack ? "vector" : e instanceof T.QuaternionKeyframeTrack ? "quaternion" : e instanceof T.NumberKeyframeTrack ? "number" : e instanceof T.BooleanKeyframeTrack ? "boolean" : "number";
6189
+ return e instanceof E.VectorKeyframeTrack ? "vector" : e instanceof E.QuaternionKeyframeTrack ? "quaternion" : e instanceof E.NumberKeyframeTrack ? "number" : e instanceof E.BooleanKeyframeTrack ? "boolean" : "number";
6190
6190
  }
6191
6191
  }
6192
6192
  class io {
@@ -6899,16 +6899,16 @@ const Jn = (i, e) => {
6899
6899
  return null;
6900
6900
  };
6901
6901
  function en(i) {
6902
- return Jn(i, "getThreeObject") ?? (i instanceof T.Object3D ? i : null);
6902
+ return Jn(i, "getThreeObject") ?? (i instanceof E.Object3D ? i : null);
6903
6903
  }
6904
6904
  function es(i) {
6905
- return Jn(i, "getThreeCamera") ?? (i instanceof T.Camera ? i : null);
6905
+ return Jn(i, "getThreeCamera") ?? (i instanceof E.Camera ? i : null);
6906
6906
  }
6907
6907
  function ji(i) {
6908
- return Jn(i, "getThreeScene") ?? (i instanceof T.Scene ? i : null);
6908
+ return Jn(i, "getThreeScene") ?? (i instanceof E.Scene ? i : null);
6909
6909
  }
6910
6910
  function Xo(i) {
6911
- return Jn(i, "getThreeRenderer") ?? (i instanceof T.WebGLRenderer ? i : null);
6911
+ return Jn(i, "getThreeRenderer") ?? (i instanceof E.WebGLRenderer ? i : null);
6912
6912
  }
6913
6913
  function ur(i) {
6914
6914
  return Jn(i, "getThreeControls");
@@ -6922,47 +6922,47 @@ const Gi = "contact-shadow-baked", qn = "contact-shadow-live", Yo = "softboxCont
6922
6922
  if (!o)
6923
6923
  return;
6924
6924
  const a = n.getObjectByName(qn);
6925
- (a == null ? void 0 : a.geometry) instanceof T.CircleGeometry && (o.halfExtent = Math.min(o.halfExtent, a.geometry.parameters.radius));
6926
- const c = new T.WebGLRenderTarget(
6925
+ (a == null ? void 0 : a.geometry) instanceof E.CircleGeometry && (o.halfExtent = Math.min(o.halfExtent, a.geometry.parameters.radius));
6926
+ const c = new E.WebGLRenderTarget(
6927
6927
  Xe.ACCUMULATION_TEXTURE_SIZE,
6928
6928
  Xe.ACCUMULATION_TEXTURE_SIZE,
6929
6929
  {
6930
- type: t.capabilities.isWebGL2 ? T.HalfFloatType : T.UnsignedByteType,
6930
+ type: t.capabilities.isWebGL2 ? E.HalfFloatType : E.UnsignedByteType,
6931
6931
  depthBuffer: !1,
6932
6932
  stencilBuffer: !1
6933
6933
  }
6934
- ), u = new T.CircleGeometry(o.halfExtent, 64);
6934
+ ), u = new E.CircleGeometry(o.halfExtent, 64);
6935
6935
  this.accumulateShadowPasses(t, s, r, o, c, u), this.installBakedMesh(n, o, c, u);
6936
6936
  }
6937
6937
  measureBakeRegion(e) {
6938
- const t = new T.Box3().setFromObject(e);
6938
+ const t = new E.Box3().setFromObject(e);
6939
6939
  if (t.isEmpty() || !Number.isFinite(t.min.x) || !Number.isFinite(t.max.x))
6940
6940
  return null;
6941
- const n = t.getSize(new T.Vector3()), s = t.getCenter(new T.Vector3()), o = Math.max(Math.max(n.x, n.z) * 1.6 + n.y, 0.05);
6941
+ const n = t.getSize(new E.Vector3()), s = t.getCenter(new E.Vector3()), o = Math.max(Math.max(n.x, n.z) * 1.6 + n.y, 0.05);
6942
6942
  return { center: s, halfExtent: o, objectHeight: n.y };
6943
6943
  }
6944
6944
  accumulateShadowPasses(e, t, n, s, r, o) {
6945
- const a = new T.Scene(), c = t.parent;
6945
+ const a = new E.Scene(), c = t.parent;
6946
6946
  a.add(t);
6947
6947
  const u = this.disableColorWrite(t), d = this.createBakeLight(n);
6948
6948
  a.add(d), a.add(d.target);
6949
- const h = new T.ShadowMaterial({
6949
+ const h = new E.ShadowMaterial({
6950
6950
  transparent: !0,
6951
6951
  opacity: 1 / this.passes,
6952
6952
  depthWrite: !1
6953
6953
  });
6954
- h.blending = T.CustomBlending, h.blendEquation = T.AddEquation, h.blendSrc = T.OneFactor, h.blendDst = T.OneFactor;
6955
- const f = new T.Mesh(o, h);
6954
+ h.blending = E.CustomBlending, h.blendEquation = E.AddEquation, h.blendSrc = E.OneFactor, h.blendDst = E.OneFactor;
6955
+ const f = new E.Mesh(o, h);
6956
6956
  f.rotation.x = -Math.PI / 2, f.position.set(s.center.x, 0, s.center.z), f.receiveShadow = !0, a.add(f);
6957
6957
  const p = this.createBakeCamera(s);
6958
6958
  a.add(p);
6959
- const y = e.getRenderTarget(), S = e.autoClear, E = e.getClearColor(new T.Color()), x = e.getClearAlpha(), w = e.shadowMap.autoUpdate;
6959
+ const y = e.getRenderTarget(), b = e.autoClear, T = e.getClearColor(new E.Color()), x = e.getClearAlpha(), w = e.shadowMap.autoUpdate;
6960
6960
  try {
6961
6961
  e.shadowMap.autoUpdate = !0, e.setRenderTarget(r), e.setClearColor(0, 0), e.clear(!0, !1, !1), e.autoClear = !1;
6962
- for (const b of this.sampleLightPositions(n))
6963
- d.position.copy(b), e.render(a, p);
6962
+ for (const S of this.sampleLightPositions(n))
6963
+ d.position.copy(S), e.render(a, p);
6964
6964
  } finally {
6965
- e.autoClear = S, e.setClearColor(E, x), e.setRenderTarget(y), e.shadowMap.autoUpdate = w, this.restoreColorWrite(u), c ? c.add(t) : a.remove(t), d.dispose(), h.dispose();
6965
+ e.autoClear = b, e.setClearColor(T, x), e.setRenderTarget(y), e.shadowMap.autoUpdate = w, this.restoreColorWrite(u), c ? c.add(t) : a.remove(t), d.dispose(), h.dispose();
6966
6966
  }
6967
6967
  }
6968
6968
  /**
@@ -6972,7 +6972,7 @@ const Gi = "contact-shadow-baked", qn = "contact-shadow-live", Yo = "softboxCont
6972
6972
  * the object.
6973
6973
  */
6974
6974
  createBakeLight(e) {
6975
- const t = new T.DirectionalLight(16777215, 1);
6975
+ const t = new E.DirectionalLight(16777215, 1);
6976
6976
  t.castShadow = !0, t.shadow.mapSize.set(
6977
6977
  Xe.BAKE_SHADOW_MAP_SIZE,
6978
6978
  Xe.BAKE_SHADOW_MAP_SIZE
@@ -6981,7 +6981,7 @@ const Gi = "contact-shadow-baked", qn = "contact-shadow-live", Yo = "softboxCont
6981
6981
  return s.left = n.left, s.right = n.right, s.top = n.top, s.bottom = n.bottom, s.near = n.near, s.far = n.far, s.updateProjectionMatrix(), t;
6982
6982
  }
6983
6983
  createBakeCamera(e) {
6984
- const t = new T.OrthographicCamera(
6984
+ const t = new E.OrthographicCamera(
6985
6985
  -e.halfExtent,
6986
6986
  e.halfExtent,
6987
6987
  e.halfExtent,
@@ -6997,25 +6997,25 @@ const Gi = "contact-shadow-baked", qn = "contact-shadow-live", Yo = "softboxCont
6997
6997
  * clumping (visible as lumpy penumbra) that random sampling produces.
6998
6998
  */
6999
6999
  sampleLightPositions(e) {
7000
- const t = e.position.clone(), n = e.target.parent ? e.target.getWorldPosition(new T.Vector3()) : e.target.position.clone(), s = n.clone().sub(t), r = s.length(), o = s.normalize(), a = new T.Vector3().crossVectors(o, new T.Vector3(0, 1, 0));
7000
+ const t = e.position.clone(), n = e.target.parent ? e.target.getWorldPosition(new E.Vector3()) : e.target.position.clone(), s = n.clone().sub(t), r = s.length(), o = s.normalize(), a = new E.Vector3().crossVectors(o, new E.Vector3(0, 1, 0));
7001
7001
  a.lengthSq() < 1e-6 && a.set(1, 0, 0), a.normalize();
7002
- const c = new T.Vector3().crossVectors(o, a), u = Math.round(this.passes * Xe.AMBIENT_RATIO), d = this.passes - u, h = T.MathUtils.degToRad(Xe.LIGHT_APERTURE_DEGREES), f = Math.tan(h / 2) * r, p = [];
7003
- for (let E = 0; E < d; E++) {
7004
- const x = f * Math.sqrt((E + 0.5) / d), w = E * ao;
7002
+ const c = new E.Vector3().crossVectors(o, a), u = Math.round(this.passes * Xe.AMBIENT_RATIO), d = this.passes - u, h = E.MathUtils.degToRad(Xe.LIGHT_APERTURE_DEGREES), f = Math.tan(h / 2) * r, p = [];
7003
+ for (let T = 0; T < d; T++) {
7004
+ const x = f * Math.sqrt((T + 0.5) / d), w = T * ao;
7005
7005
  p.push(
7006
7006
  t.clone().addScaledVector(a, x * Math.cos(w)).addScaledVector(c, x * Math.sin(w))
7007
7007
  );
7008
7008
  }
7009
7009
  const y = Math.sin(
7010
- T.MathUtils.degToRad(Xe.AMBIENT_MIN_ELEVATION_DEGREES)
7011
- ), S = 0.98;
7012
- for (let E = 0; E < u; E++) {
7013
- const x = Math.sqrt((E + 0.5) / u), w = y + (S - y) * x, b = Math.sqrt(1 - w * w), _ = E * ao;
7010
+ E.MathUtils.degToRad(Xe.AMBIENT_MIN_ELEVATION_DEGREES)
7011
+ ), b = 0.98;
7012
+ for (let T = 0; T < u; T++) {
7013
+ const x = Math.sqrt((T + 0.5) / u), w = y + (b - y) * x, S = Math.sqrt(1 - w * w), _ = T * ao;
7014
7014
  p.push(
7015
- new T.Vector3(
7016
- b * Math.cos(_),
7015
+ new E.Vector3(
7016
+ S * Math.cos(_),
7017
7017
  w,
7018
- b * Math.sin(_)
7018
+ S * Math.sin(_)
7019
7019
  ).multiplyScalar(r).add(n)
7020
7020
  );
7021
7021
  }
@@ -7024,7 +7024,7 @@ const Gi = "contact-shadow-baked", qn = "contact-shadow-live", Yo = "softboxCont
7024
7024
  installBakedMesh(e, t, n, s) {
7025
7025
  const r = e.getObjectByName(Gi);
7026
7026
  r && (e.remove(r), $s(r));
7027
- const o = new T.MeshBasicMaterial({
7027
+ const o = new E.MeshBasicMaterial({
7028
7028
  map: n.texture,
7029
7029
  transparent: !0,
7030
7030
  opacity: Xe.SHADOW_STRENGTH,
@@ -7038,9 +7038,9 @@ const Gi = "contact-shadow-baked", qn = "contact-shadow-live", Yo = "softboxCont
7038
7038
  diffuseColor.a = pow(diffuseColor.a, 0.75);`
7039
7039
  );
7040
7040
  }, o.customProgramCacheKey = () => "contact-shadow-alpha-gamma", o.addEventListener("dispose", () => n.dispose());
7041
- const a = new T.Mesh(s, o);
7041
+ const a = new E.Mesh(s, o);
7042
7042
  a.name = Gi, a.userData[Yo] = !0, a.rotation.x = -Math.PI / 2;
7043
- const c = T.MathUtils.clamp(t.objectHeight * 25e-4, 2e-4, 0.01);
7043
+ const c = E.MathUtils.clamp(t.objectHeight * 25e-4, 2e-4, 0.01);
7044
7044
  a.position.set(t.center.x, c, t.center.z), a.userData.renderTarget = n, e.add(a);
7045
7045
  const u = e.getObjectByName(qn);
7046
7046
  u && (u.visible = !1);
@@ -7125,7 +7125,7 @@ class Vh {
7125
7125
  this.name = "Square Wire Grid";
7126
7126
  }
7127
7127
  createGrid(e) {
7128
- const t = e.size || 10, n = e.divisions || 10, s = new T.Color(e.color || 8947848), r = new T.Color(e.centerLineColor || e.color || 4473924), o = new T.GridHelper(t, n, r, s);
7128
+ const t = e.size || 10, n = e.divisions || 10, s = new E.Color(e.color || 8947848), r = new E.Color(e.centerLineColor || e.color || 4473924), o = new E.GridHelper(t, n, r, s);
7129
7129
  if (e.opacity !== void 0 && e.opacity < 1) {
7130
7130
  const a = o.material;
7131
7131
  a.transparent = !0, a.opacity = e.opacity;
@@ -7141,7 +7141,7 @@ class Wh {
7141
7141
  }
7142
7142
  createGrid(e) {
7143
7143
  var d;
7144
- const t = new T.Group(), n = ((d = e.styleOptions) == null ? void 0 : d.hexRadius) || Math.floor(e.divisions / 2), s = e.size / Math.max(1, n * 2), r = new T.Color(e.color || 8947848), o = e.opacity || 0.4, a = new T.LineBasicMaterial({
7144
+ const t = new E.Group(), n = ((d = e.styleOptions) == null ? void 0 : d.hexRadius) || Math.floor(e.divisions / 2), s = e.size / Math.max(1, n * 2), r = new E.Color(e.color || 8947848), o = e.opacity || 0.4, a = new E.LineBasicMaterial({
7145
7145
  color: r,
7146
7146
  transparent: !0,
7147
7147
  opacity: o
@@ -7149,12 +7149,12 @@ class Wh {
7149
7149
  for (let h = -n; h <= n; h++) {
7150
7150
  const f = Math.max(-n, -h - n), p = Math.min(n, -h + n);
7151
7151
  for (let y = f; y <= p; y++) {
7152
- const S = c * (h + y / 2), E = u * 0.75 * y, x = [], w = Math.PI * 2 / 6;
7152
+ const b = c * (h + y / 2), T = u * 0.75 * y, x = [], w = Math.PI * 2 / 6;
7153
7153
  for (let A = 0; A <= 6; A++) {
7154
- const P = A * w + Math.PI / 6, I = S + s * Math.cos(P), M = E + s * Math.sin(P);
7155
- x.push(new T.Vector3(I, 0, M));
7154
+ const P = A * w + Math.PI / 6, I = b + s * Math.cos(P), M = T + s * Math.sin(P);
7155
+ x.push(new E.Vector3(I, 0, M));
7156
7156
  }
7157
- const b = new T.BufferGeometry().setFromPoints(x), _ = new T.Line(b, a);
7157
+ const S = new E.BufferGeometry().setFromPoints(x), _ = new E.Line(S, a);
7158
7158
  t.add(_);
7159
7159
  }
7160
7160
  }
@@ -7167,93 +7167,117 @@ class Zh {
7167
7167
  constructor(e, t, n, s = {}) {
7168
7168
  this.position = e, this.size = t, this.color = n, this.materialOptions = s, this.height = sn.getHeight(this.size), this.bevel = sn.getBevelSize(this.size);
7169
7169
  }
7170
- createMesh() {
7171
- const e = new T.Shape(), t = this.size + this.bevel, n = Math.PI * 2 / 6;
7172
- for (let S = 0; S < 6; S++) {
7173
- const E = t * Math.cos(S * n), x = t * Math.sin(S * n);
7174
- S === 0 ? e.moveTo(E, x) : e.lineTo(E, x);
7170
+ /**
7171
+ * Tile geometry with its resting transform baked into the vertices:
7172
+ * laid flat on the floor plane, point-up hex orientation, translated to
7173
+ * the tile's grid position. Baking (instead of positioning a wrapper
7174
+ * object per tile) is what lets a whole floor of tiles merge into one
7175
+ * mesh — at real-world paver scale that is thousands of tiles.
7176
+ */
7177
+ createGeometry() {
7178
+ const e = new E.Shape(), t = this.size + this.bevel, n = Math.PI * 2 / 6;
7179
+ for (let o = 0; o < 6; o++) {
7180
+ const a = t * Math.cos(o * n), c = t * Math.sin(o * n);
7181
+ o === 0 ? e.moveTo(a, c) : e.lineTo(a, c);
7175
7182
  }
7176
7183
  e.closePath();
7177
7184
  const s = {
7178
7185
  depth: this.height,
7179
- // Tile thickness
7180
7186
  bevelEnabled: !0,
7181
- // Enable beveling (chamfer)
7182
7187
  bevelSize: this.bevel,
7183
- // Bevel size
7184
7188
  bevelThickness: this.bevel,
7185
- // Bevel thickness
7186
7189
  bevelSegments: 2
7187
7190
  // A crisp chamfer (like a real paver's arris), not a rounded soap-bar edge
7188
- }, r = new T.ExtrudeGeometry(e, s), {
7189
- metalness: o = 0,
7190
- roughness: a = 0.15,
7191
- transmission: c = 1,
7192
- thickness: u = 0.4,
7193
- ior: d = 1.5
7194
- } = this.materialOptions, h = c > 0, f = new T.MeshPhysicalMaterial({
7195
- color: new T.Color(this.color),
7196
- metalness: o,
7197
- roughness: a,
7198
- transparent: h,
7199
- transmission: c,
7200
- thickness: u,
7201
- ior: d,
7191
+ }, r = new E.ExtrudeGeometry(e, s);
7192
+ return r.rotateZ(Math.PI / 6), r.rotateX(Math.PI / 2), r.translate(this.position.x, this.position.y, this.position.z), r;
7193
+ }
7194
+ /**
7195
+ * Defaults reproduce the original glossy "liquid glass" look; passing
7196
+ * materialOptions (e.g. transmission: 0, roughness: 0.9) turns the same
7197
+ * hex tile into a matte finish like concrete.
7198
+ */
7199
+ createMaterial() {
7200
+ const {
7201
+ metalness: e = 0,
7202
+ roughness: t = 0.15,
7203
+ transmission: n = 1,
7204
+ thickness: s = 0.4,
7205
+ ior: r = 1.5
7206
+ } = this.materialOptions, o = n > 0;
7207
+ return new E.MeshPhysicalMaterial({
7208
+ color: new E.Color(this.color),
7209
+ metalness: e,
7210
+ roughness: t,
7211
+ transparent: o,
7212
+ transmission: n,
7213
+ thickness: s,
7214
+ ior: r,
7202
7215
  opacity: 1,
7203
- clearcoat: h ? 1 : 0,
7216
+ clearcoat: o ? 1 : 0,
7204
7217
  clearcoatRoughness: 0.05,
7205
- sheen: h ? 1 : 0,
7206
- sheenColor: new T.Color(16777215),
7218
+ sheen: o ? 1 : 0,
7219
+ sheenColor: new E.Color(16777215),
7207
7220
  envMapIntensity: 1
7208
- // Enable environment map reflections
7209
- }), p = new T.Mesh(r, f);
7210
- p.receiveShadow = !0;
7211
- const y = new T.Group();
7212
- return y.add(p), y.position.set(this.position.x, this.position.y, this.position.z), y.rotation.x = Math.PI / 2, y.rotation.z = Math.PI / 6, y;
7221
+ });
7213
7222
  }
7214
7223
  }
7215
- class Kh {
7224
+ function Kh(i, e) {
7225
+ var d;
7226
+ const t = i.getIndex() ? i.toNonIndexed() : i, n = t.getAttribute("position").array, s = t.getAttribute("normal").array, r = (d = t.getAttribute("uv")) == null ? void 0 : d.array, o = new Float32Array(n.length * e.length), a = new Float32Array(s.length * e.length), c = r ? new Float32Array(r.length * e.length) : void 0;
7227
+ e.forEach((h, f) => {
7228
+ const p = f * n.length;
7229
+ o.set(n, p);
7230
+ for (let y = p; y < p + n.length; y += 3)
7231
+ o[y] += h.x, o[y + 1] += h.y, o[y + 2] += h.z;
7232
+ a.set(s, f * s.length), c && r && c.set(r, f * r.length);
7233
+ });
7234
+ const u = new E.BufferGeometry();
7235
+ return u.setAttribute("position", new E.BufferAttribute(o, 3)), u.setAttribute("normal", new E.BufferAttribute(a, 3)), c && u.setAttribute("uv", new E.BufferAttribute(c, 2)), u;
7236
+ }
7237
+ class Xh {
7216
7238
  constructor() {
7217
7239
  this.name = "Hexagonal Glass Grid";
7218
7240
  }
7219
7241
  createGrid(e) {
7220
- var u, d, h, f, p, y, S;
7221
- const t = new T.Group(), n = ((u = e.styleOptions) == null ? void 0 : u.hexRadius) || Math.floor(e.divisions / 2), s = ((d = e.styleOptions) == null ? void 0 : d.tileSize) || 1, r = String(e.color || "#ffffff"), o = sn.getGridSpacing(s), a = o.width, c = o.height;
7222
- for (let E = -n; E <= n; E++) {
7223
- const x = Math.max(-n, -E - n), w = Math.min(n, -E + n);
7224
- for (let b = x; b <= w; b++) {
7225
- const _ = a * (E + b / 2), A = c * 0.75 * b, P = sn.getYPosition(s), M = new Zh(new T.Vector3(_, P, A), s, r, {
7226
- metalness: (h = e.styleOptions) == null ? void 0 : h.metalness,
7227
- roughness: (f = e.styleOptions) == null ? void 0 : f.roughness,
7228
- transmission: (p = e.styleOptions) == null ? void 0 : p.transmission,
7229
- thickness: (y = e.styleOptions) == null ? void 0 : y.thickness,
7230
- ior: (S = e.styleOptions) == null ? void 0 : S.ior
7231
- }).createMesh();
7232
- t.add(M);
7233
- }
7234
- }
7235
- return t.add(this.createShadowCatcher(a * (n + 0.5))), t;
7242
+ var y, b, T, x, w, S, _;
7243
+ const t = new E.Group(), n = ((y = e.styleOptions) == null ? void 0 : y.hexRadius) ?? Math.floor(e.divisions / 2), s = ((b = e.styleOptions) == null ? void 0 : b.tileSize) || 1, r = String(e.color || "#ffffff"), o = sn.getGridSpacing(s), a = o.width, c = o.height, u = new Zh(new E.Vector3(0, 0, 0), s, r, {
7244
+ metalness: (T = e.styleOptions) == null ? void 0 : T.metalness,
7245
+ roughness: (x = e.styleOptions) == null ? void 0 : x.roughness,
7246
+ transmission: (w = e.styleOptions) == null ? void 0 : w.transmission,
7247
+ thickness: (S = e.styleOptions) == null ? void 0 : S.thickness,
7248
+ ior: (_ = e.styleOptions) == null ? void 0 : _.ior
7249
+ }), d = u.createGeometry(), h = sn.getYPosition(s), f = [];
7250
+ for (let A = -n; A <= n; A++) {
7251
+ const P = Math.max(-n, -A - n), I = Math.min(n, -A + n);
7252
+ for (let M = P; M <= I; M++)
7253
+ f.push(new E.Vector3(a * (A + M / 2), h, c * 0.75 * M));
7254
+ }
7255
+ const p = new E.Mesh(
7256
+ Kh(d, f),
7257
+ u.createMaterial()
7258
+ );
7259
+ return p.receiveShadow = !0, t.add(p), d.dispose(), t.add(this.createShadowCatcher(a * (n + 0.5))), t;
7236
7260
  }
7237
7261
  createShadowCatcher(e) {
7238
- const t = new T.Mesh(
7239
- new T.CircleGeometry(Math.max(e, 1), 64),
7240
- new T.ShadowMaterial({ opacity: 0.35 })
7262
+ const t = new E.Mesh(
7263
+ new E.CircleGeometry(Math.max(e, 1), 64),
7264
+ new E.ShadowMaterial({ opacity: 0.35 })
7241
7265
  );
7242
7266
  return t.name = qn, t.userData[Yo] = !0, t.rotation.x = -Math.PI / 2, t.position.y = 2e-3, t.receiveShadow = !0, t;
7243
7267
  }
7244
7268
  dispose() {
7245
7269
  }
7246
7270
  }
7247
- class Xh {
7271
+ class Yh {
7248
7272
  constructor() {
7249
- this.name = "Stone Tile Grid", this.textureLoader = new T.TextureLoader();
7273
+ this.name = "Stone Tile Grid", this.textureLoader = new E.TextureLoader();
7250
7274
  }
7251
7275
  createGrid(e) {
7252
- var p, y, S, E;
7253
- const t = new T.Group(), n = e.size, s = Math.max(1, e.divisions), r = n / s, o = r * 0.02, a = r - o, c = ((p = e.styleOptions) == null ? void 0 : p.height) || r * 0.05, u = ((y = e.styleOptions) == null ? void 0 : y.bevelSize) || c * 0.2, d = ((S = e.styleOptions) == null ? void 0 : S.randomHeight) || !1, h = ((E = e.styleOptions) == null ? void 0 : E.randomRotation) || !1, f = this.createStoneMaterial(e);
7276
+ var p, y, b, T;
7277
+ const t = new E.Group(), n = e.size, s = Math.max(1, e.divisions), r = n / s, o = r * 0.02, a = r - o, c = ((p = e.styleOptions) == null ? void 0 : p.height) || r * 0.05, u = ((y = e.styleOptions) == null ? void 0 : y.bevelSize) || c * 0.2, d = ((b = e.styleOptions) == null ? void 0 : b.randomHeight) || !1, h = ((T = e.styleOptions) == null ? void 0 : T.randomRotation) || !1, f = this.createStoneMaterial(e);
7254
7278
  for (let x = 0; x < s; x++)
7255
7279
  for (let w = 0; w < s; w++) {
7256
- const b = (x - s / 2) * r + r / 2, _ = (w - s / 2) * r + r / 2, A = d ? c * (0.8 + Math.random() * 0.4) : c, P = new T.Shape(), I = a / 2;
7280
+ const S = (x - s / 2) * r + r / 2, _ = (w - s / 2) * r + r / 2, A = d ? c * (0.8 + Math.random() * 0.4) : c, P = new E.Shape(), I = a / 2;
7257
7281
  P.moveTo(-I, -I), P.lineTo(I, -I), P.lineTo(I, I), P.lineTo(-I, I), P.closePath();
7258
7282
  const M = {
7259
7283
  depth: A,
@@ -7261,33 +7285,33 @@ class Xh {
7261
7285
  bevelSize: u,
7262
7286
  bevelThickness: u,
7263
7287
  bevelSegments: 2
7264
- }, O = new T.ExtrudeGeometry(P, M);
7288
+ }, O = new E.ExtrudeGeometry(P, M);
7265
7289
  O.rotateX(-Math.PI / 2);
7266
- const C = new T.Mesh(O, f);
7267
- C.position.set(b, -A / 2, _), C.castShadow = !0, C.receiveShadow = !0, h && (C.rotation.y = Math.floor(Math.random() * 4) * (Math.PI / 2)), t.add(C);
7290
+ const C = new E.Mesh(O, f);
7291
+ C.position.set(S, -A / 2, _), C.castShadow = !0, C.receiveShadow = !0, h && (C.rotation.y = Math.floor(Math.random() * 4) * (Math.PI / 2)), t.add(C);
7268
7292
  }
7269
7293
  return t;
7270
7294
  }
7271
7295
  createStoneMaterial(e) {
7272
7296
  var o, a, c, u, d;
7273
- const t = new T.Color(e.color || 8421504), n = ((o = e.styleOptions) == null ? void 0 : o.metalness) || 0, s = ((a = e.styleOptions) == null ? void 0 : a.roughness) || 0.8, r = {
7297
+ const t = new E.Color(e.color || 8421504), n = ((o = e.styleOptions) == null ? void 0 : o.metalness) || 0, s = ((a = e.styleOptions) == null ? void 0 : a.roughness) || 0.8, r = {
7274
7298
  color: t,
7275
7299
  metalness: n,
7276
7300
  roughness: s
7277
7301
  };
7278
7302
  if ((c = e.styleOptions) != null && c.texture) {
7279
7303
  const h = this.loadTexture(e.styleOptions.texture);
7280
- h && (r.map = h, h.wrapS = h.wrapT = T.RepeatWrapping, h.repeat.set(1, 1));
7304
+ h && (r.map = h, h.wrapS = h.wrapT = E.RepeatWrapping, h.repeat.set(1, 1));
7281
7305
  }
7282
7306
  if ((u = e.styleOptions) != null && u.normalMap) {
7283
7307
  const h = this.loadTexture(e.styleOptions.normalMap);
7284
- h && (r.normalMap = h, h.wrapS = h.wrapT = T.RepeatWrapping, h.repeat.set(1, 1));
7308
+ h && (r.normalMap = h, h.wrapS = h.wrapT = E.RepeatWrapping, h.repeat.set(1, 1));
7285
7309
  }
7286
7310
  if ((d = e.styleOptions) != null && d.roughnessMap) {
7287
7311
  const h = this.loadTexture(e.styleOptions.roughnessMap);
7288
- h && (r.roughnessMap = h, h.wrapS = h.wrapT = T.RepeatWrapping, h.repeat.set(1, 1));
7312
+ h && (r.roughnessMap = h, h.wrapS = h.wrapT = E.RepeatWrapping, h.repeat.set(1, 1));
7289
7313
  }
7290
- return new T.MeshStandardMaterial(r);
7314
+ return new E.MeshStandardMaterial(r);
7291
7315
  }
7292
7316
  // Each grid owns the textures it loads. They are attached to the grid's
7293
7317
  // material and freed exactly once by the scene's canonical disposal on
@@ -7340,8 +7364,8 @@ const fr = class fr {
7340
7364
  fr.gridStyles = /* @__PURE__ */ new Map([
7341
7365
  [Ot.SQUARE_WIRE, new Vh()],
7342
7366
  [Ot.HEXAGONAL_WIRE, new Wh()],
7343
- [Ot.HEXAGONAL_GLASS, new Kh()],
7344
- [Ot.STONE_TILES, new Xh()]
7367
+ [Ot.HEXAGONAL_GLASS, new Xh()],
7368
+ [Ot.STONE_TILES, new Yh()]
7345
7369
  ]);
7346
7370
  let Zs = fr;
7347
7371
  const co = (i) => {
@@ -7350,7 +7374,7 @@ const co = (i) => {
7350
7374
  !e && t.isDirectionalLight && (e = t);
7351
7375
  }), e;
7352
7376
  };
7353
- class Yh {
7377
+ class qh {
7354
7378
  constructor() {
7355
7379
  this.contactShadowBaker = new Vi();
7356
7380
  }
@@ -7391,7 +7415,7 @@ class Yh {
7391
7415
  }
7392
7416
  }
7393
7417
  if (t.axes) {
7394
- const s = t.axesSize || 5, r = new T.AxesHelper(s);
7418
+ const s = t.axesSize || 5, r = new E.AxesHelper(s);
7395
7419
  n.add(r);
7396
7420
  }
7397
7421
  return k.ok(void 0);
@@ -7427,16 +7451,16 @@ class Yh {
7427
7451
  });
7428
7452
  let u;
7429
7453
  t instanceof Le || "getThreeObject" in t && typeof t.getThreeObject == "function" ? u = t.getThreeObject() : u = t;
7430
- const d = new T.Box3().setFromObject(u), h = d.getSize(new T.Vector3());
7454
+ const d = new E.Box3().setFromObject(u), h = d.getSize(new E.Vector3());
7431
7455
  if (d.isEmpty() || !Number.isFinite(h.x) || !Number.isFinite(h.z))
7432
7456
  return console.warn("Skipping dynamic grid: object has an empty or non-finite bounding box"), k.ok(void 0);
7433
- const f = (s = a.styleOptions) == null ? void 0 : s.tileSize, p = typeof f == "number" ? f : 1, S = sn.getGridSpacing(p).width, E = Math.max(h.x, h.z) * n + h.y;
7434
- let x = E <= S ? 0 : Math.ceil((E / S - 1) / 2);
7457
+ const f = (s = a.styleOptions) == null ? void 0 : s.tileSize, p = typeof f == "number" ? f : 1, b = sn.getGridSpacing(p).width, T = Math.max(h.x, h.z) * n + h.y;
7458
+ let x = T <= b ? 0 : Math.ceil((T / b - 1) / 2);
7435
7459
  const w = 60;
7436
7460
  x > w && (console.warn(
7437
7461
  `Dynamic grid would need ${x} rings to cover the object; capping at ${w}. The floor will not fully reach the configured coverage for this tileSize/object-size combination.`
7438
- ), x = w), E < S * 0.8 ? x = 0 : x < 3 && E > S * 2 && (x = 3);
7439
- const b = a.type || Ot.HEXAGONAL_GLASS, A = {
7462
+ ), x = w), T < b * 0.8 ? x = 0 : x < 3 && T > b * 2 && (x = 3);
7463
+ const S = a.type || Ot.HEXAGONAL_GLASS, A = {
7440
7464
  size: Math.max(h.x, h.z) * n,
7441
7465
  divisions: x * 2 + 1,
7442
7466
  color: a.color,
@@ -7446,10 +7470,10 @@ class Yh {
7446
7470
  tileSize: p,
7447
7471
  ...a.styleOptions
7448
7472
  }
7449
- }, P = Zs.createGrid(b, A);
7473
+ }, P = Zs.createGrid(S, A);
7450
7474
  P.userData.isGrid = !0, P.userData.isHexGrid = !0;
7451
7475
  const I = P.getObjectByName(qn);
7452
- return I && (I.position.y = T.MathUtils.clamp(h.y * 25e-4, 2e-4, 2e-3)), r.add(P), k.ok(void 0);
7476
+ return I && (I.position.y = E.MathUtils.clamp(h.y * 25e-4, 2e-4, 2e-3)), r.add(P), k.ok(void 0);
7453
7477
  } catch (r) {
7454
7478
  return k.err(
7455
7479
  new Z(
@@ -7492,25 +7516,25 @@ class Yh {
7492
7516
  }), o.length === 0 || a.length === 0)
7493
7517
  return k.ok(void 0);
7494
7518
  let c = -1 / 0;
7495
- const u = new T.Box3();
7519
+ const u = new E.Box3();
7496
7520
  for (const _ of o)
7497
7521
  u.setFromObject(_), Number.isFinite(u.max.y) && (c = Math.max(c, u.max.y));
7498
7522
  if (!Number.isFinite(c))
7499
7523
  return k.ok(void 0);
7500
- const d = new T.Box3().setFromObject(n);
7524
+ const d = new E.Box3().setFromObject(n);
7501
7525
  if (d.isEmpty() || !Number.isFinite(d.min.x) || !Number.isFinite(d.max.x))
7502
7526
  return k.ok(void 0);
7503
- const h = 40, f = Math.max(1, d.max.y - d.min.y), p = d.max.y + f, y = d.min.y - f, S = new T.Raycaster(), E = new T.Vector3(0, -1, 0), x = new T.Vector3(0, 1, 0);
7527
+ const h = 40, f = Math.max(1, d.max.y - d.min.y), p = d.max.y + f, y = d.min.y - f, b = new E.Raycaster(), T = new E.Vector3(0, -1, 0), x = new E.Vector3(0, 1, 0);
7504
7528
  let w = 1 / 0;
7505
- const b = (_, A, P, I) => {
7506
- S.set(new T.Vector3(_, A, P), I);
7507
- for (const M of S.intersectObjects(a, !1))
7529
+ const S = (_, A, P, I) => {
7530
+ b.set(new E.Vector3(_, A, P), I);
7531
+ for (const M of b.intersectObjects(a, !1))
7508
7532
  M.point.y < w && (w = M.point.y);
7509
7533
  };
7510
7534
  for (let _ = 0; _ <= h; _++)
7511
7535
  for (let A = 0; A <= h; A++) {
7512
7536
  const P = d.min.x + (d.max.x - d.min.x) * (_ / h), I = d.min.z + (d.max.z - d.min.z) * (A / h);
7513
- b(P, p, I, E), b(P, y, I, x);
7537
+ S(P, p, I, T), S(P, y, I, x);
7514
7538
  }
7515
7539
  if (Number.isFinite(w)) {
7516
7540
  const _ = w - c;
@@ -7538,10 +7562,10 @@ class Yh {
7538
7562
  );
7539
7563
  let n;
7540
7564
  t instanceof Le || "getThreeObject" in t && typeof t.getThreeObject == "function" ? n = t.getThreeObject() : n = t;
7541
- const s = new T.Box3().setFromObject(n);
7565
+ const s = new E.Box3().setFromObject(n);
7542
7566
  if (s.isEmpty() || !Number.isFinite(s.min.x) || !Number.isFinite(s.max.x))
7543
7567
  return k.ok(void 0);
7544
- const r = s.getSize(new T.Vector3()), o = e.getThreeScene(), a = co(o);
7568
+ const r = s.getSize(new E.Vector3()), o = e.getThreeScene(), a = co(o);
7545
7569
  if (!a || !a.castShadow)
7546
7570
  return k.ok(void 0);
7547
7571
  const d = Math.max(r.x, r.y, r.z, 0.1) * 2, h = a.shadow.camera;
@@ -7626,7 +7650,7 @@ class Yh {
7626
7650
  Y.INVALID_PARAMETER
7627
7651
  )
7628
7652
  );
7629
- const s = new T.Group();
7653
+ const s = new E.Group();
7630
7654
  return s.name = vc, s.scale.setScalar(t), s.add(n), k.ok(new Le(s));
7631
7655
  } catch (n) {
7632
7656
  return k.err(
@@ -7649,18 +7673,18 @@ class Yh {
7649
7673
  );
7650
7674
  const n = e.getThreeScene();
7651
7675
  if (t.ambient) {
7652
- const s = new T.Color(t.ambient.color || "#404040"), r = t.ambient.intensity ?? Math.PI, o = new T.AmbientLight(s, r);
7676
+ const s = new E.Color(t.ambient.color || "#404040"), r = t.ambient.intensity ?? Math.PI, o = new E.AmbientLight(s, r);
7653
7677
  n.add(o);
7654
7678
  }
7655
7679
  if (t.hemisphere) {
7656
- const s = new T.Color(t.hemisphere.skyColor || "#ffffbb"), r = new T.Color(t.hemisphere.groundColor || "#080820"), o = t.hemisphere.intensity ?? 1, a = new T.HemisphereLight(s, r, o);
7680
+ const s = new E.Color(t.hemisphere.skyColor || "#ffffbb"), r = new E.Color(t.hemisphere.groundColor || "#080820"), o = t.hemisphere.intensity ?? 1, a = new E.HemisphereLight(s, r, o);
7657
7681
  n.add(a);
7658
7682
  }
7659
7683
  if (t.directional) {
7660
- const s = new T.Color(t.directional.color || "#ffffff"), r = t.directional.intensity ?? Math.PI, o = new T.DirectionalLight(s, r);
7684
+ const s = new E.Color(t.directional.color || "#ffffff"), r = t.directional.intensity ?? Math.PI, o = new E.DirectionalLight(s, r);
7661
7685
  if (t.directional.position) {
7662
7686
  const a = t.directional.position;
7663
- if (a instanceof T.Vector3)
7687
+ if (a instanceof E.Vector3)
7664
7688
  o.position.copy(a);
7665
7689
  else if (Array.isArray(a))
7666
7690
  o.position.set(a[0], a[1], a[2]);
@@ -7712,10 +7736,10 @@ class Yh {
7712
7736
  );
7713
7737
  const o = r.createLinearGradient(0, 0, 0, s.height);
7714
7738
  o.addColorStop(0, t.topColor), o.addColorStop(1, t.bottomColor), r.fillStyle = o, r.fillRect(0, 0, s.width, s.height);
7715
- const a = new T.CanvasTexture(s);
7739
+ const a = new E.CanvasTexture(s);
7716
7740
  a.needsUpdate = !0;
7717
7741
  const c = n.background;
7718
- return c instanceof T.Texture && c !== n.environment && c.dispose(), n.background = a, k.ok(void 0);
7742
+ return c instanceof E.Texture && c !== n.environment && c.dispose(), n.background = a, k.ok(void 0);
7719
7743
  } catch (n) {
7720
7744
  return k.err(
7721
7745
  new Z(
@@ -7728,13 +7752,13 @@ class Yh {
7728
7752
  }
7729
7753
  fitCameraToObject(e, t, n) {
7730
7754
  try {
7731
- const s = en(e) ?? e, r = es(t) ?? t, o = ur(n) ?? n, a = new T.Box3().setFromObject(s), c = a.getCenter(new T.Vector3()), u = a.getSize(new T.Vector3()), d = Math.max(u.x, u.y, u.z);
7755
+ const s = en(e) ?? e, r = es(t) ?? t, o = ur(n) ?? n, a = new E.Box3().setFromObject(s), c = a.getCenter(new E.Vector3()), u = a.getSize(new E.Vector3()), d = Math.max(u.x, u.y, u.z);
7732
7756
  let h;
7733
7757
  "fov" in r ? h = r.fov * (Math.PI / 180) : h = 50 * (Math.PI / 180);
7734
7758
  let f = Math.abs(d / 2 / Math.tan(h / 2));
7735
7759
  f *= 2;
7736
- const p = -Math.PI / 4, y = Math.PI / 8, S = c.x + f * Math.sin(p) * Math.cos(y), E = c.y + f * Math.sin(y), x = c.z + f * Math.cos(p) * Math.cos(y);
7737
- return r.position.set(S, E, x), r.lookAt(c), r.updateProjectionMatrix(), o && o.target && (o.target.copy(c), o.update()), k.ok(void 0);
7760
+ const p = -Math.PI / 4, y = Math.PI / 8, b = c.x + f * Math.sin(p) * Math.cos(y), T = c.y + f * Math.sin(y), x = c.z + f * Math.cos(p) * Math.cos(y);
7761
+ return r.position.set(b, T, x), r.lookAt(c), r.updateProjectionMatrix(), o && o.target && (o.target.copy(c), o.update()), k.ok(void 0);
7738
7762
  } catch (s) {
7739
7763
  return k.err(
7740
7764
  new Z(
@@ -7746,12 +7770,12 @@ class Yh {
7746
7770
  }
7747
7771
  }
7748
7772
  }
7749
- class qh {
7773
+ class $h {
7750
7774
  constructor() {
7751
7775
  this.events = new nr(), this.disposed = !1;
7752
7776
  }
7753
7777
  async initialize(e) {
7754
- const { ThreePathTracingService: t } = await import("./ThreePathTracingService-B3fodLjq.js");
7778
+ const { ThreePathTracingService: t } = await import("./ThreePathTracingService-CT85JiaL.js");
7755
7779
  if (this.disposed)
7756
7780
  return k.ok(void 0);
7757
7781
  const n = new t();
@@ -7799,7 +7823,7 @@ fflate - fast JavaScript compression/decompression
7799
7823
  Licensed under MIT. https://github.com/101arrowz/fflate/blob/master/LICENSE
7800
7824
  version 0.8.2
7801
7825
  */
7802
- var ct = Uint8Array, Sn = Uint16Array, $h = Int32Array, qo = new ct([
7826
+ var ct = Uint8Array, Sn = Uint16Array, Qh = Int32Array, qo = new ct([
7803
7827
  0,
7804
7828
  0,
7805
7829
  0,
@@ -7868,16 +7892,16 @@ var ct = Uint8Array, Sn = Uint16Array, $h = Int32Array, qo = new ct([
7868
7892
  /* unused */
7869
7893
  0,
7870
7894
  0
7871
- ]), Qh = new ct([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]), Qo = function(i, e) {
7895
+ ]), Jh = new ct([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]), Qo = function(i, e) {
7872
7896
  for (var t = new Sn(31), n = 0; n < 31; ++n)
7873
7897
  t[n] = e += 1 << i[n - 1];
7874
- for (var s = new $h(t[30]), n = 1; n < 30; ++n)
7898
+ for (var s = new Qh(t[30]), n = 1; n < 30; ++n)
7875
7899
  for (var r = t[n]; r < t[n + 1]; ++r)
7876
7900
  s[r] = r - t[n] << 5 | n;
7877
7901
  return { b: t, r: s };
7878
- }, Jo = Qo(qo, 2), ea = Jo.b, Jh = Jo.r;
7879
- ea[28] = 258, Jh[258] = 28;
7880
- var eu = Qo($o, 0), tu = eu.b, Wi = new Sn(32768);
7902
+ }, Jo = Qo(qo, 2), ea = Jo.b, eu = Jo.r;
7903
+ ea[28] = 258, eu[258] = 28;
7904
+ var tu = Qo($o, 0), nu = tu.b, Wi = new Sn(32768);
7881
7905
  for (var Se = 0; Se < 32768; ++Se) {
7882
7906
  var Ht = (Se & 43690) >> 1 | (Se & 21845) << 1;
7883
7907
  Ht = (Ht & 52428) >> 2 | (Ht & 13107) << 2, Ht = (Ht & 61680) >> 4 | (Ht & 3855) << 4, Wi[Se] = ((Ht & 65280) >> 8 | (Ht & 255) << 8) >> 1;
@@ -7912,7 +7936,7 @@ for (var Se = 280; Se < 288; ++Se)
7912
7936
  var ta = new ct(32);
7913
7937
  for (var Se = 0; Se < 32; ++Se)
7914
7938
  ta[Se] = 5;
7915
- var nu = /* @__PURE__ */ Zn(ts, 9, 1), su = /* @__PURE__ */ Zn(ta, 5, 1), Ei = function(i) {
7939
+ var su = /* @__PURE__ */ Zn(ts, 9, 1), iu = /* @__PURE__ */ Zn(ta, 5, 1), Ei = function(i) {
7916
7940
  for (var e = i[0], t = 1; t < i.length; ++t)
7917
7941
  i[t] > e && (e = i[t]);
7918
7942
  return e;
@@ -7922,11 +7946,11 @@ var nu = /* @__PURE__ */ Zn(ts, 9, 1), su = /* @__PURE__ */ Zn(ta, 5, 1), Ei = f
7922
7946
  }, Ti = function(i, e) {
7923
7947
  var t = e / 8 | 0;
7924
7948
  return (i[t] | i[t + 1] << 8 | i[t + 2] << 16) >> (e & 7);
7925
- }, iu = function(i) {
7949
+ }, ru = function(i) {
7926
7950
  return (i + 7) / 8 | 0;
7927
- }, ru = function(i, e, t) {
7951
+ }, ou = function(i, e, t) {
7928
7952
  return (t == null || t > i.length) && (t = i.length), new ct(i.subarray(e, t));
7929
- }, ou = [
7953
+ }, au = [
7930
7954
  "unexpected EOF",
7931
7955
  "invalid block type",
7932
7956
  "invalid length/literal",
@@ -7943,11 +7967,11 @@ var nu = /* @__PURE__ */ Zn(ts, 9, 1), su = /* @__PURE__ */ Zn(ta, 5, 1), Ei = f
7943
7967
  "invalid zip data"
7944
7968
  // determined by unknown compression method
7945
7969
  ], yt = function(i, e, t) {
7946
- var n = new Error(e || ou[i]);
7970
+ var n = new Error(e || au[i]);
7947
7971
  if (n.code = i, Error.captureStackTrace && Error.captureStackTrace(n, yt), !t)
7948
7972
  throw n;
7949
7973
  return n;
7950
- }, au = function(i, e, t, n) {
7974
+ }, cu = function(i, e, t, n) {
7951
7975
  var s = i.length, r = 0;
7952
7976
  if (!s || e.f && !e.l)
7953
7977
  return t || new ct(0);
@@ -7959,43 +7983,43 @@ var nu = /* @__PURE__ */ Zn(ts, 9, 1), su = /* @__PURE__ */ Zn(ta, 5, 1), Ei = f
7959
7983
  var ns = new ct(Math.max(It * 2, rn));
7960
7984
  ns.set(t), t = ns;
7961
7985
  }
7962
- }, d = e.f || 0, h = e.p || 0, f = e.b || 0, p = e.l, y = e.d, S = e.m, E = e.n, x = s * 8;
7986
+ }, d = e.f || 0, h = e.p || 0, f = e.b || 0, p = e.l, y = e.d, b = e.m, T = e.n, x = s * 8;
7963
7987
  do {
7964
7988
  if (!p) {
7965
7989
  d = mt(i, h, 1);
7966
7990
  var w = mt(i, h + 1, 3);
7967
7991
  if (h += 3, w)
7968
7992
  if (w == 1)
7969
- p = nu, y = su, S = 9, E = 5;
7993
+ p = su, y = iu, b = 9, T = 5;
7970
7994
  else if (w == 2) {
7971
7995
  var P = mt(i, h, 31) + 257, I = mt(i, h + 10, 15) + 4, M = P + mt(i, h + 5, 31) + 1;
7972
7996
  h += 14;
7973
7997
  for (var O = new ct(M), C = new ct(19), N = 0; N < I; ++N)
7974
- C[Qh[N]] = mt(i, h + N * 3, 7);
7998
+ C[Jh[N]] = mt(i, h + N * 3, 7);
7975
7999
  h += I * 3;
7976
8000
  for (var D = Ei(C), H = (1 << D) - 1, G = Zn(C, D, 1), N = 0; N < M; ) {
7977
8001
  var q = G[mt(i, h, H)];
7978
8002
  h += q & 15;
7979
- var b = q >> 4;
7980
- if (b < 16)
7981
- O[N++] = b;
8003
+ var S = q >> 4;
8004
+ if (S < 16)
8005
+ O[N++] = S;
7982
8006
  else {
7983
8007
  var ie = 0, Ne = 0;
7984
- for (b == 16 ? (Ne = 3 + mt(i, h, 3), h += 2, ie = O[N - 1]) : b == 17 ? (Ne = 3 + mt(i, h, 7), h += 3) : b == 18 && (Ne = 11 + mt(i, h, 127), h += 7); Ne--; )
8008
+ for (S == 16 ? (Ne = 3 + mt(i, h, 3), h += 2, ie = O[N - 1]) : S == 17 ? (Ne = 3 + mt(i, h, 7), h += 3) : S == 18 && (Ne = 11 + mt(i, h, 127), h += 7); Ne--; )
7985
8009
  O[N++] = ie;
7986
8010
  }
7987
8011
  }
7988
8012
  var dt = O.subarray(0, P), Re = O.subarray(P);
7989
- S = Ei(dt), E = Ei(Re), p = Zn(dt, S, 1), y = Zn(Re, E, 1);
8013
+ b = Ei(dt), T = Ei(Re), p = Zn(dt, b, 1), y = Zn(Re, T, 1);
7990
8014
  } else
7991
8015
  yt(1);
7992
8016
  else {
7993
- var b = iu(h) + 4, _ = i[b - 4] | i[b - 3] << 8, A = b + _;
8017
+ var S = ru(h) + 4, _ = i[S - 4] | i[S - 3] << 8, A = S + _;
7994
8018
  if (A > s) {
7995
8019
  c && yt(0);
7996
8020
  break;
7997
8021
  }
7998
- a && u(f + _), t.set(i.subarray(b, A), f), e.b = f += _, e.p = h = A * 8, e.f = d;
8022
+ a && u(f + _), t.set(i.subarray(S, A), f), e.b = f += _, e.p = h = A * 8, e.f = d;
7999
8023
  continue;
8000
8024
  }
8001
8025
  if (h > x) {
@@ -8004,7 +8028,7 @@ var nu = /* @__PURE__ */ Zn(ts, 9, 1), su = /* @__PURE__ */ Zn(ta, 5, 1), Ei = f
8004
8028
  }
8005
8029
  }
8006
8030
  a && u(f + 131072);
8007
- for (var Ue = (1 << S) - 1, Ve = (1 << E) - 1, Ae = h; ; Ae = h) {
8031
+ for (var Ue = (1 << b) - 1, Ve = (1 << T) - 1, Ae = h; ; Ae = h) {
8008
8032
  var ie = p[Ti(i, h) & Ue], ge = ie >> 4;
8009
8033
  if (h += ie & 15, h > x) {
8010
8034
  c && yt(0);
@@ -8023,7 +8047,7 @@ var nu = /* @__PURE__ */ Zn(ts, 9, 1), su = /* @__PURE__ */ Zn(ta, 5, 1), Ei = f
8023
8047
  }
8024
8048
  var Ft = y[Ti(i, h) & Ve], me = Ft >> 4;
8025
8049
  Ft || yt(3), h += Ft & 15;
8026
- var Re = tu[me];
8050
+ var Re = nu[me];
8027
8051
  if (me > 3) {
8028
8052
  var We = $o[me];
8029
8053
  Re += Ti(i, h) & (1 << We) - 1, h += We;
@@ -8043,21 +8067,21 @@ var nu = /* @__PURE__ */ Zn(ts, 9, 1), su = /* @__PURE__ */ Zn(ta, 5, 1), Ei = f
8043
8067
  t[f] = t[f - Re];
8044
8068
  }
8045
8069
  }
8046
- e.l = p, e.p = Ae, e.b = f, e.f = d, p && (d = 1, e.m = S, e.d = y, e.n = E);
8070
+ e.l = p, e.p = Ae, e.b = f, e.f = d, p && (d = 1, e.m = b, e.d = y, e.n = T);
8047
8071
  } while (!d);
8048
- return f != t.length && o ? ru(t, 0, f) : t.subarray(0, f);
8049
- }, cu = /* @__PURE__ */ new ct(0), lu = function(i, e) {
8072
+ return f != t.length && o ? ou(t, 0, f) : t.subarray(0, f);
8073
+ }, lu = /* @__PURE__ */ new ct(0), hu = function(i, e) {
8050
8074
  return ((i[0] & 15) != 8 || i[0] >> 4 > 7 || (i[0] << 8 | i[1]) % 31) && yt(6, "invalid zlib data"), (i[1] >> 5 & 1) == 1 && yt(6, "invalid zlib data: " + (i[1] & 32 ? "need" : "unexpected") + " dictionary"), (i[1] >> 3 & 4) + 2;
8051
8075
  };
8052
8076
  function zn(i, e) {
8053
- return au(i.subarray(lu(i), -4), { i: 2 }, e, e);
8077
+ return cu(i.subarray(hu(i), -4), { i: 2 }, e, e);
8054
8078
  }
8055
- var hu = typeof TextDecoder < "u" && /* @__PURE__ */ new TextDecoder(), uu = 0;
8079
+ var uu = typeof TextDecoder < "u" && /* @__PURE__ */ new TextDecoder(), du = 0;
8056
8080
  try {
8057
- hu.decode(cu, { stream: !0 }), uu = 1;
8081
+ uu.decode(lu, { stream: !0 }), du = 1;
8058
8082
  } catch {
8059
8083
  }
8060
- class du extends Co {
8084
+ class fu extends Co {
8061
8085
  /**
8062
8086
  * Constructs a new EXR loader.
8063
8087
  *
@@ -9281,7 +9305,7 @@ class du extends Co {
9281
9305
  return this.part = e, this;
9282
9306
  }
9283
9307
  }
9284
- class fu extends Co {
9308
+ class pu extends Co {
9285
9309
  /**
9286
9310
  * Constructs a new RGBE/HDR loader.
9287
9311
  *
@@ -9386,12 +9410,12 @@ class fu extends Co {
9386
9410
  }, y = function(M, O, C, N) {
9387
9411
  const D = M[O + 3], H = Math.pow(2, D - 128) / 255;
9388
9412
  C[N + 0] = M[O + 0] * H, C[N + 1] = M[O + 1] * H, C[N + 2] = M[O + 2] * H, C[N + 3] = 1;
9389
- }, S = function(M, O, C, N) {
9413
+ }, b = function(M, O, C, N) {
9390
9414
  const D = M[O + 3], H = Math.pow(2, D - 128) / 255;
9391
9415
  C[N + 0] = Et.toHalfFloat(Math.min(M[O + 0] * H, 65504)), C[N + 1] = Et.toHalfFloat(Math.min(M[O + 1] * H, 65504)), C[N + 2] = Et.toHalfFloat(Math.min(M[O + 2] * H, 65504)), C[N + 3] = Et.toHalfFloat(1);
9392
- }, E = new Uint8Array(e);
9393
- E.pos = 0;
9394
- const x = f(E), w = x.width, b = x.height, _ = p(E.subarray(E.pos), w, b);
9416
+ }, T = new Uint8Array(e);
9417
+ T.pos = 0;
9418
+ const x = f(T), w = x.width, S = x.height, _ = p(T.subarray(T.pos), w, S);
9395
9419
  let A, P, I;
9396
9420
  switch (this.type) {
9397
9421
  case Vn:
@@ -9405,7 +9429,7 @@ class fu extends Co {
9405
9429
  I = _.length / 4;
9406
9430
  const O = new Uint16Array(I * 4);
9407
9431
  for (let C = 0; C < I; C++)
9408
- S(_, C * 4, O, C * 4);
9432
+ b(_, C * 4, O, C * 4);
9409
9433
  A = O, P = Vt;
9410
9434
  break;
9411
9435
  default:
@@ -9413,7 +9437,7 @@ class fu extends Co {
9413
9437
  }
9414
9438
  return {
9415
9439
  width: w,
9416
- height: b,
9440
+ height: S,
9417
9441
  data: A,
9418
9442
  header: x.string,
9419
9443
  gamma: x.gamma,
@@ -9436,12 +9460,12 @@ class fu extends Co {
9436
9460
  return this.type = e, this;
9437
9461
  }
9438
9462
  }
9439
- class pu extends fu {
9463
+ class mu extends pu {
9440
9464
  constructor(e) {
9441
9465
  console.warn("RGBELoader has been deprecated. Please use HDRLoader instead."), super(e);
9442
9466
  }
9443
9467
  }
9444
- class mu extends bc {
9468
+ class gu extends bc {
9445
9469
  constructor() {
9446
9470
  super(), this.name = "RoomEnvironment", this.position.y = -3.5;
9447
9471
  const e = new xc();
@@ -9485,7 +9509,7 @@ function yn(i) {
9485
9509
  emissiveIntensity: i
9486
9510
  });
9487
9511
  }
9488
- class gu {
9512
+ class yu {
9489
9513
  constructor() {
9490
9514
  this.pmremGenerator = null, this.loadedTextures = /* @__PURE__ */ new Map(), this.renderTargets = [], this.disposed = !1;
9491
9515
  }
@@ -9498,10 +9522,10 @@ class gu {
9498
9522
  const r = n.getDomElement();
9499
9523
  if (r && "parentElement" in r && r.parentElement) {
9500
9524
  const o = r.parentElement.renderer;
9501
- o instanceof T.WebGLRenderer && (s = o);
9525
+ o instanceof E.WebGLRenderer && (s = o);
9502
9526
  }
9503
9527
  }
9504
- return s ? (this.pmremGenerator = new T.PMREMGenerator(s), this.pmremGenerator.compileEquirectangularShader(), k.ok(void 0)) : k.err(
9528
+ return s ? (this.pmremGenerator = new E.PMREMGenerator(s), this.pmremGenerator.compileEquirectangularShader(), k.ok(void 0)) : k.err(
9505
9529
  new Z(
9506
9530
  "Could not access Three.js renderer",
9507
9531
  Y.INITIALIZATION_FAILED
@@ -9527,15 +9551,15 @@ class gu {
9527
9551
  let r;
9528
9552
  switch (s) {
9529
9553
  case "hdr":
9530
- r = new pu();
9554
+ r = new mu();
9531
9555
  break;
9532
9556
  case "exr":
9533
- r = new du();
9557
+ r = new fu();
9534
9558
  break;
9535
9559
  case "jpg":
9536
9560
  case "jpeg":
9537
9561
  case "png":
9538
- r = new T.TextureLoader();
9562
+ r = new E.TextureLoader();
9539
9563
  break;
9540
9564
  default:
9541
9565
  return k.err(
@@ -9565,7 +9589,7 @@ class gu {
9565
9589
  )
9566
9590
  );
9567
9591
  if (this.pmremGenerator) {
9568
- o.mapping = T.EquirectangularReflectionMapping;
9592
+ o.mapping = E.EquirectangularReflectionMapping;
9569
9593
  const a = this.pmremGenerator.fromEquirectangular(o);
9570
9594
  this.renderTargets.push(a);
9571
9595
  const c = a.texture;
@@ -9599,18 +9623,18 @@ class gu {
9599
9623
  )
9600
9624
  );
9601
9625
  const s = e.getThreeScene(), r = t.getThreeTexture();
9602
- if (s.environment = r, n && (n.backgroundBlurriness !== void 0 && (s.backgroundBlurriness = n.backgroundBlurriness), n.backgroundIntensity !== void 0 && (s.backgroundIntensity = n.backgroundIntensity), n.environmentIntensity !== void 0 && (s.environmentIntensity = n.environmentIntensity)), r.mapping === T.CubeUVReflectionMapping) {
9626
+ if (s.environment = r, n && (n.backgroundBlurriness !== void 0 && (s.backgroundBlurriness = n.backgroundBlurriness), n.backgroundIntensity !== void 0 && (s.backgroundIntensity = n.backgroundIntensity), n.environmentIntensity !== void 0 && (s.environmentIntensity = n.environmentIntensity)), r.mapping === E.CubeUVReflectionMapping) {
9603
9627
  const a = Array.from(this.loadedTextures.entries()).find(
9604
- ([c, u]) => c.endsWith("_original") && u.mapping === T.EquirectangularReflectionMapping
9628
+ ([c, u]) => c.endsWith("_original") && u.mapping === E.EquirectangularReflectionMapping
9605
9629
  );
9606
9630
  a && (s.__originalEnvironmentTexture = a[1]);
9607
- } else r.mapping === T.EquirectangularReflectionMapping && (s.__originalEnvironmentTexture = r);
9631
+ } else r.mapping === E.EquirectangularReflectionMapping && (s.__originalEnvironmentTexture = r);
9608
9632
  if ((n == null ? void 0 : n.setBackground) ?? !0)
9609
- if (r.mapping === T.EquirectangularReflectionMapping)
9633
+ if (r.mapping === E.EquirectangularReflectionMapping)
9610
9634
  s.background = r;
9611
- else if (r.mapping === T.CubeUVReflectionMapping) {
9635
+ else if (r.mapping === E.CubeUVReflectionMapping) {
9612
9636
  const a = Array.from(this.loadedTextures.entries()).find(
9613
- ([c, u]) => c.endsWith("_original") && u.mapping === T.EquirectangularReflectionMapping
9637
+ ([c, u]) => c.endsWith("_original") && u.mapping === E.EquirectangularReflectionMapping
9614
9638
  );
9615
9639
  a ? s.background = a[1] : s.background = r;
9616
9640
  } else
@@ -9642,7 +9666,7 @@ class gu {
9642
9666
  Y.INITIALIZATION_FAILED
9643
9667
  )
9644
9668
  );
9645
- const t = new mu(), n = this.pmremGenerator.fromScene(t);
9669
+ const t = new gu(), n = this.pmremGenerator.fromScene(t);
9646
9670
  this.renderTargets.push(n);
9647
9671
  const s = n.texture;
9648
9672
  return t.dispose(), k.ok(new wn(s));
@@ -9683,27 +9707,27 @@ class wn {
9683
9707
  return this.texture;
9684
9708
  }
9685
9709
  }
9686
- class yu {
9710
+ class wu {
9687
9711
  constructor(e) {
9688
- this.object = e, this.boundingBox = new T.Box3().setFromObject(this.object);
9712
+ this.object = e, this.boundingBox = new E.Box3().setFromObject(this.object);
9689
9713
  }
9690
9714
  alignToFloor() {
9691
9715
  const e = this.calculateFloorOffset();
9692
9716
  this.applyOffset(e);
9693
9717
  }
9694
9718
  calculateFloorOffset() {
9695
- const e = this.boundingBox.min.y, t = this.boundingBox.max.y - e, n = new T.Vector3();
9719
+ const e = this.boundingBox.min.y, t = this.boundingBox.max.y - e, n = new E.Vector3();
9696
9720
  return t > 0 ? n.y = -e : n.y = 0, n;
9697
9721
  }
9698
9722
  applyOffset(e) {
9699
9723
  this.object.position.add(e);
9700
9724
  }
9701
9725
  }
9702
- class wu {
9726
+ class Eu {
9703
9727
  alignToFloor(e) {
9704
9728
  try {
9705
9729
  let t = null;
9706
- return "getThreeObject" in e && typeof e.getThreeObject == "function" ? t = e.getThreeObject() : e instanceof T.Object3D && (t = e), t ? (new yu(t).alignToFloor(), k.ok(void 0)) : k.err(
9730
+ return "getThreeObject" in e && typeof e.getThreeObject == "function" ? t = e.getThreeObject() : e instanceof E.Object3D && (t = e), t ? (new wu(t).alignToFloor(), k.ok(void 0)) : k.err(
9707
9731
  new Z(
9708
9732
  "Could not get Three.js object for floor alignment",
9709
9733
  Y.INVALID_PARAMETER
@@ -9721,9 +9745,9 @@ class wu {
9721
9745
  }
9722
9746
  }
9723
9747
  const lo = { touch: 10, default: 5 };
9724
- class Eu {
9748
+ class Tu {
9725
9749
  constructor() {
9726
- this.raycaster = new T.Raycaster(), this.activePointers = /* @__PURE__ */ new Set(), this.options = null, this.pending = null, this.detach = null;
9750
+ this.raycaster = new E.Raycaster(), this.activePointers = /* @__PURE__ */ new Set(), this.options = null, this.pending = null, this.detach = null;
9727
9751
  }
9728
9752
  initialize(e) {
9729
9753
  this.dispose(), this.options = e;
@@ -9767,7 +9791,7 @@ class Eu {
9767
9791
  o(null);
9768
9792
  return;
9769
9793
  }
9770
- const h = new T.Vector2(
9794
+ const h = new E.Vector2(
9771
9795
  (e - d.left) / d.width * 2 - 1,
9772
9796
  -((t - d.top) / d.height) * 2 + 1
9773
9797
  );
@@ -9787,10 +9811,10 @@ class Eu {
9787
9811
  (e = this.detach) == null || e.call(this), this.detach = null, this.options = null, this.pending = null, this.activePointers.clear();
9788
9812
  }
9789
9813
  }
9790
- const Tu = 1e-3, ho = { visible: !1 };
9791
- class _u {
9814
+ const _u = 1e-3, ho = { visible: !1 };
9815
+ class Su {
9792
9816
  constructor(e) {
9793
- this.sources = e, this.anchor = new T.Vector3(), this.projected = new T.Vector3(), this.cameraPosition = new T.Vector3(), this.toAnchor = new T.Vector3(), this.raycaster = new T.Raycaster(), this.lastCameraMatrix = new T.Matrix4(), this.lastWidth = -1, this.lastHeight = -1, this.hasProjected = !1;
9817
+ this.sources = e, this.anchor = new E.Vector3(), this.projected = new E.Vector3(), this.cameraPosition = new E.Vector3(), this.toAnchor = new E.Vector3(), this.raycaster = new E.Raycaster(), this.lastCameraMatrix = new E.Matrix4(), this.lastWidth = -1, this.lastHeight = -1, this.hasProjected = !1;
9794
9818
  }
9795
9819
  invalidate() {
9796
9820
  this.hasProjected = !1;
@@ -9814,15 +9838,15 @@ class _u {
9814
9838
  const n = this.toAnchor.length();
9815
9839
  this.raycaster.set(this.cameraPosition, this.toAnchor.normalize()), this.raycaster.camera = e, this.raycaster.firstHitOnly = !0;
9816
9840
  const s = this.raycaster.intersectObject(t, !0)[0];
9817
- return !!(s && s.distance < n - Tu);
9841
+ return !!(s && s.distance < n - _u);
9818
9842
  }
9819
9843
  }
9820
- class Su {
9844
+ class bu {
9821
9845
  createProjector(e) {
9822
- return new _u(e);
9846
+ return new Su(e);
9823
9847
  }
9824
9848
  }
9825
- class bu {
9849
+ class xu {
9826
9850
  constructor() {
9827
9851
  this.mixer = null, this.clips = [], this.activeActions = [], this.playing = !1, this.speed = 1;
9828
9852
  }
@@ -9831,8 +9855,8 @@ class bu {
9831
9855
  const t = en(e);
9832
9856
  if (!t)
9833
9857
  return;
9834
- const n = xu(t);
9835
- n && (this.clips = n.animations, this.mixer = new T.AnimationMixer(n), this.mixer.timeScale = this.speed);
9858
+ const n = Au(t);
9859
+ n && (this.clips = n.animations, this.mixer = new E.AnimationMixer(n), this.mixer.timeScale = this.speed);
9836
9860
  }
9837
9861
  getClipNames() {
9838
9862
  return this.clips.map((e) => e.name);
@@ -9885,7 +9909,7 @@ class bu {
9885
9909
  this.mixer && (this.mixer.stopAllAction(), this.mixer.uncacheRoot(this.mixer.getRoot())), this.mixer = null, this.clips = [], this.activeActions = [], this.playing = !1;
9886
9910
  }
9887
9911
  }
9888
- function xu(i) {
9912
+ function Au(i) {
9889
9913
  let e = null;
9890
9914
  return i.traverse((t) => {
9891
9915
  var n;
@@ -9893,7 +9917,7 @@ function xu(i) {
9893
9917
  }), e;
9894
9918
  }
9895
9919
  var Ks = /* @__PURE__ */ ((i) => (i.MapControls = "MapControls", i.OrbitControls = "OrbitControls", i))(Ks || {});
9896
- class Au {
9920
+ class vu {
9897
9921
  static convertRendererOptions(e) {
9898
9922
  const t = {
9899
9923
  antialias: e.antialias,
@@ -9913,46 +9937,46 @@ class Au {
9913
9937
  }
9914
9938
  static convertShadowMapType(e) {
9915
9939
  if (typeof e == "number") {
9916
- if (e === T.BasicShadowMap) return "basic";
9917
- if (e === T.PCFShadowMap) return "pcf";
9918
- if (e === T.PCFSoftShadowMap) return "pcfsoft";
9919
- if (e === T.VSMShadowMap) return "vsm";
9940
+ if (e === E.BasicShadowMap) return "basic";
9941
+ if (e === E.PCFShadowMap) return "pcf";
9942
+ if (e === E.PCFSoftShadowMap) return "pcfsoft";
9943
+ if (e === E.VSMShadowMap) return "vsm";
9920
9944
  }
9921
9945
  return typeof e == "string" ? e : void 0;
9922
9946
  }
9923
9947
  static convertToneMappingType(e) {
9924
9948
  if (typeof e == "number") {
9925
- if (e === T.NoToneMapping) return "none";
9926
- if (e === T.LinearToneMapping) return "linear";
9927
- if (e === T.ReinhardToneMapping) return "reinhard";
9928
- if (e === T.CineonToneMapping) return "cineon";
9929
- if (e === T.ACESFilmicToneMapping) return "aces";
9949
+ if (e === E.NoToneMapping) return "none";
9950
+ if (e === E.LinearToneMapping) return "linear";
9951
+ if (e === E.ReinhardToneMapping) return "reinhard";
9952
+ if (e === E.CineonToneMapping) return "cineon";
9953
+ if (e === E.ACESFilmicToneMapping) return "aces";
9930
9954
  }
9931
9955
  return typeof e == "string" ? e : "aces";
9932
9956
  }
9933
9957
  }
9934
- class vu {
9958
+ class Ru {
9935
9959
  /**
9936
9960
  * Create a ViewerCore instance with Three.js implementations
9937
9961
  */
9938
9962
  static createViewer(e, t) {
9939
- var w, b, _;
9963
+ var w, S, _;
9940
9964
  Po(t.units);
9941
9965
  const n = new jl(e), s = new Lt(), r = this.createCamera(t), o = this.createControls(
9942
9966
  r.getThreeCamera(),
9943
9967
  e,
9944
9968
  t
9945
- ), a = new Ru().createDefaultLoader({
9969
+ ), a = new Mu().createDefaultLoader({
9946
9970
  renderer: n.getThreeRenderer() ?? void 0,
9947
9971
  bvh: (w = t.selection) == null ? void 0 : w.bvh,
9948
9972
  ...t.loaders
9949
- }), c = new Yh(), u = new gu();
9973
+ }), c = new qh(), u = new yu();
9950
9974
  let d;
9951
- (((b = t.pathTracing) == null ? void 0 : b.enabled) ?? !1) && (d = new qh());
9952
- const f = new wu(), p = new Eu(), y = new Su(), S = new bu(), E = Au.convertRendererOptions(
9975
+ (((S = t.pathTracing) == null ? void 0 : S.enabled) ?? !1) && (d = new $h());
9976
+ const f = new Eu(), p = new Tu(), y = new bu(), b = new xu(), T = vu.convertRendererOptions(
9953
9977
  t.renderer || {}
9954
9978
  );
9955
- (t.replaceWithScreenshotOnComplete || (_ = t.pathTracing) != null && _.enabled) && (E.preserveDrawingBuffer = !0);
9979
+ (t.replaceWithScreenshotOnComplete || (_ = t.pathTracing) != null && _.enabled) && (T.preserveDrawingBuffer = !0);
9956
9980
  const x = {
9957
9981
  renderer: n,
9958
9982
  scene: s,
@@ -9960,14 +9984,14 @@ class vu {
9960
9984
  controls: o,
9961
9985
  modelLoader: a,
9962
9986
  options: t,
9963
- rendererOptions: E,
9987
+ rendererOptions: T,
9964
9988
  sceneSetupService: c,
9965
9989
  environmentService: u,
9966
9990
  pathTracingService: d,
9967
9991
  floorAlignmentService: f,
9968
9992
  selectionService: p,
9969
9993
  anchorProjectionService: y,
9970
- animationService: S
9994
+ animationService: b
9971
9995
  };
9972
9996
  return new Fc(x);
9973
9997
  }
@@ -10008,12 +10032,12 @@ class vu {
10008
10032
  return u && o.target && (o.target.set(u[0], u[1], u[2]), o.update()), o;
10009
10033
  }
10010
10034
  }
10011
- class Ru extends io {
10035
+ class Mu extends io {
10012
10036
  createDefaultLoader(e = {}) {
10013
10037
  return io.createLoader("model.glb", e);
10014
10038
  }
10015
10039
  }
10016
- const Mu = ["toneMappingExposure"], Iu = ["environmentIntensity"], Cu = ["autoRotate", "autoRotateSpeed"];
10040
+ const Iu = ["toneMappingExposure"], Cu = ["environmentIntensity"], Pu = ["autoRotate", "autoRotateSpeed"];
10017
10041
  function na(i) {
10018
10042
  var t, n, s, r, o, a, c, u, d, h;
10019
10043
  const e = {
@@ -10195,11 +10219,11 @@ const Zi = {
10195
10219
  environment: { environmentIntensity: 0.85 }
10196
10220
  }
10197
10221
  };
10198
- function Pu(i) {
10222
+ function Lu(i) {
10199
10223
  return i ? sa[i] : {};
10200
10224
  }
10201
10225
  function Ki(i, e) {
10202
- return Gs(Gs(i, Pu(e.preset)), e);
10226
+ return Gs(Gs(i, Lu(e.preset)), e);
10203
10227
  }
10204
10228
  const _i = (i, ...e) => {
10205
10229
  if (!i)
@@ -10209,7 +10233,7 @@ const _i = (i, ...e) => {
10209
10233
  delete t[n];
10210
10234
  return Object.keys(t).length > 0 ? t : void 0;
10211
10235
  };
10212
- function Lu(i) {
10236
+ function Ou(i) {
10213
10237
  const e = Dt(
10214
10238
  () => {
10215
10239
  var s;
@@ -10219,12 +10243,12 @@ function Lu(i) {
10219
10243
  // renderer/environment minus their runtime-tunable fields: a direct
10220
10244
  // toneMappingExposure / environmentIntensity change is exactly what
10221
10245
  // the live updateOptions path exists for and must not rebuild.
10222
- renderer: _i(i.renderer, ...Mu),
10246
+ renderer: _i(i.renderer, ...Iu),
10223
10247
  camera: i.camera,
10224
10248
  // The turntable fields toggle live (updateOptions), like the look
10225
10249
  // fields — flipping auto-rotate must not reload the model.
10226
- controls: _i(i.controls, ...Cu),
10227
- environment: _i(i.environment, ...Iu),
10250
+ controls: _i(i.controls, ...Pu),
10251
+ environment: _i(i.environment, ...Cu),
10228
10252
  lighting: i.lighting,
10229
10253
  helpers: i.helpers,
10230
10254
  rendering: i.rendering,
@@ -10261,8 +10285,8 @@ function Lu(i) {
10261
10285
  }, [i.preset, i.backgroundColor, i.renderer, i.environment, i.controls, i.animations]);
10262
10286
  return { options: Dt(() => i, [e, t]), structuralKey: e, runtimeKey: t };
10263
10287
  }
10264
- function Ou(i, e) {
10265
- const t = Ge(null), [n, s] = Xn(!1), [r, o] = Xn(null), { options: a, structuralKey: c, runtimeKey: u } = Lu(e);
10288
+ function Du(i, e) {
10289
+ const t = Ge(null), [n, s] = Xn(!1), [r, o] = Xn(null), { options: a, structuralKey: c, runtimeKey: u } = Ou(e);
10266
10290
  ht(() => {
10267
10291
  if (!i.current || t.current)
10268
10292
  return;
@@ -10270,7 +10294,7 @@ function Ou(i, e) {
10270
10294
  const h = Ki(Zi, a);
10271
10295
  let f;
10272
10296
  try {
10273
- f = vu.createViewer(i.current, h);
10297
+ f = Ru.createViewer(i.current, h);
10274
10298
  } catch (y) {
10275
10299
  console.error("Failed to create viewer:", y), o(y instanceof Error ? y : new Error(String(y)));
10276
10300
  return;
@@ -10293,13 +10317,13 @@ function Ou(i, e) {
10293
10317
  if (!t.current || !i.current)
10294
10318
  return;
10295
10319
  let h = null;
10296
- const f = (S) => {
10320
+ const f = (b) => {
10297
10321
  if (i.current && t.current) {
10298
- const E = i.current.parentElement || i.current;
10299
- let { clientWidth: x, clientHeight: w } = E;
10300
- if (S && S[0]) {
10301
- const { width: b, height: _ } = S[0].contentRect;
10302
- x = Math.floor(b), w = Math.floor(_);
10322
+ const T = i.current.parentElement || i.current;
10323
+ let { clientWidth: x, clientHeight: w } = T;
10324
+ if (b && b[0]) {
10325
+ const { width: S, height: _ } = b[0].contentRect;
10326
+ x = Math.floor(S), w = Math.floor(_);
10303
10327
  }
10304
10328
  if (d.current.width === x && d.current.height === w)
10305
10329
  return;
@@ -10341,7 +10365,7 @@ function ia(i, e) {
10341
10365
  };
10342
10366
  }, [i]);
10343
10367
  }
10344
- function Du(i, e) {
10368
+ function Nu(i, e) {
10345
10369
  const [t, n] = Xn(null), s = Ge(/* @__PURE__ */ new Set());
10346
10370
  ht(() => {
10347
10371
  if (i !== void 0 && s.current.has(i)) {
@@ -10366,7 +10390,7 @@ function Du(i, e) {
10366
10390
  selectPreset: a
10367
10391
  };
10368
10392
  }
10369
- function Nu(i, e, t, n, s) {
10393
+ function ku(i, e, t, n, s) {
10370
10394
  return Dt(() => {
10371
10395
  var u, d, h;
10372
10396
  const r = i.preset !== e, o = t === !0 && ((u = i.pathTracing) == null ? void 0 : u.enabled) === void 0, a = n !== void 0 && ((d = i.controls) == null ? void 0 : d.autoRotate) === void 0, c = s !== void 0 && ((h = i.animations) == null ? void 0 : h.autoplay) === void 0;
@@ -10379,7 +10403,7 @@ function Nu(i, e, t, n, s) {
10379
10403
  };
10380
10404
  }, [i, e, t, n, s]);
10381
10405
  }
10382
- function ku(i, e, t) {
10406
+ function Fu(i, e, t) {
10383
10407
  const n = Dt(() => {
10384
10408
  if (typeof t == "string")
10385
10409
  return t;
@@ -10410,14 +10434,14 @@ class Si {
10410
10434
  const t = en(e);
10411
10435
  if (t)
10412
10436
  return t;
10413
- const n = new T.Object3D();
10437
+ const n = new E.Object3D();
10414
10438
  return n.position.set(e.position.x, e.position.y, e.position.z), n.rotation.set(e.rotation.x, e.rotation.y, e.rotation.z), n.scale.set(e.scale.x, e.scale.y, e.scale.z), n;
10415
10439
  }
10416
10440
  /**
10417
10441
  * Convert ICamera to THREE.Camera
10418
10442
  */
10419
10443
  static toThreeCamera(e) {
10420
- return es(e) ?? new T.PerspectiveCamera();
10444
+ return es(e) ?? new E.PerspectiveCamera();
10421
10445
  }
10422
10446
  /**
10423
10447
  * Convert IControls to ControlsInstance
@@ -10471,7 +10495,7 @@ class Si {
10471
10495
  };
10472
10496
  }
10473
10497
  }
10474
- function Fu(i) {
10498
+ function zu(i) {
10475
10499
  const e = Ge(new nr()), t = Dt(
10476
10500
  () => ({
10477
10501
  "model:loading": (n) => e.current.emit("model:loading", n),
@@ -10488,7 +10512,7 @@ function Fu(i) {
10488
10512
  );
10489
10513
  return ia(i, t), e.current;
10490
10514
  }
10491
- function zu(i, e, t) {
10515
+ function Bu(i, e, t) {
10492
10516
  const n = Ge(t);
10493
10517
  n.current = t;
10494
10518
  const s = Dt(
@@ -10524,7 +10548,7 @@ function zu(i, e, t) {
10524
10548
  });
10525
10549
  }
10526
10550
  const ra = Wa(null);
10527
- function Bu({ viewer: i, canvasRef: e, children: t }) {
10551
+ function Uu({ viewer: i, canvasRef: e, children: t }) {
10528
10552
  const n = Dt(() => ({ viewer: i, canvasRef: e }), [i, e]);
10529
10553
  return /* @__PURE__ */ Te(ra.Provider, { value: n, children: t });
10530
10554
  }
@@ -10534,7 +10558,7 @@ function oa() {
10534
10558
  throw new Error("useViewerContext must be used within ViewerProvider");
10535
10559
  return i;
10536
10560
  }
10537
- function Uu() {
10561
+ function Hu() {
10538
10562
  const { canvasRef: i } = oa();
10539
10563
  return /* @__PURE__ */ Te(
10540
10564
  "canvas",
@@ -10562,13 +10586,13 @@ function Uu() {
10562
10586
  console.error("vite-plugin-css-injected-by-js", e);
10563
10587
  }
10564
10588
  })();
10565
- const Hu = (i, e, t, n, s, r) => {
10589
+ const ju = (i, e, t, n, s, r) => {
10566
10590
  const o = performance.now(), a = () => {
10567
10591
  const c = performance.now() - o, u = Math.min(c / s, 1);
10568
10592
  i.position.lerpVectors(t, n, u), e == null || e.update(), r(), u < 1 && requestAnimationFrame(a);
10569
10593
  };
10570
10594
  requestAnimationFrame(a);
10571
- }, uo = { type: "change" }, dr = { type: "start" }, aa = { type: "end" }, Ds = new Yi(), fo = new Qn(), ju = Math.cos(70 * tr.DEG2RAD), Pe = new $(), nt = 2 * Math.PI, Ee = {
10595
+ }, uo = { type: "change" }, dr = { type: "start" }, aa = { type: "end" }, Ds = new Yi(), fo = new Qn(), Gu = Math.cos(70 * tr.DEG2RAD), Pe = new $(), nt = 2 * Math.PI, Ee = {
10572
10596
  NONE: -1,
10573
10597
  ROTATE: 0,
10574
10598
  DOLLY: 1,
@@ -10586,7 +10610,7 @@ class ca extends Io {
10586
10610
  * @param {?HTMLDOMElement} domElement - The HTML element used for event listeners.
10587
10611
  */
10588
10612
  constructor(e, t = null) {
10589
- super(e, t), this.state = Ee.NONE, this.target = new $(), this.cursor = new $(), this.minDistance = 0, this.maxDistance = 1 / 0, this.minZoom = 0, this.maxZoom = 1 / 0, this.minTargetRadius = 0, this.maxTargetRadius = 1 / 0, this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -1 / 0, this.maxAzimuthAngle = 1 / 0, this.enableDamping = !1, this.dampingFactor = 0.05, this.enableZoom = !0, this.zoomSpeed = 1, this.enableRotate = !0, this.rotateSpeed = 1, this.keyRotateSpeed = 1, this.enablePan = !0, this.panSpeed = 1, this.screenSpacePanning = !0, this.keyPanSpeed = 7, this.zoomToCursor = !1, this.autoRotate = !1, this.autoRotateSpeed = 2, this.keys = { LEFT: "ArrowLeft", UP: "ArrowUp", RIGHT: "ArrowRight", BOTTOM: "ArrowDown" }, this.mouseButtons = { LEFT: Be.ROTATE, MIDDLE: Be.DOLLY, RIGHT: Be.PAN }, this.touches = { ONE: Ye.ROTATE, TWO: Ye.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this._lastPosition = new $(), this._lastQuaternion = new xn(), this._lastTargetPosition = new $(), this._quat = new xn().setFromUnitVectors(e.up, new $(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new js(), this._sphericalDelta = new js(), this._scale = 1, this._panOffset = new $(), this._rotateStart = new pe(), this._rotateEnd = new pe(), this._rotateDelta = new pe(), this._panStart = new pe(), this._panEnd = new pe(), this._panDelta = new pe(), this._dollyStart = new pe(), this._dollyEnd = new pe(), this._dollyDelta = new pe(), this._dollyDirection = new $(), this._mouse = new pe(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = Vu.bind(this), this._onPointerDown = Gu.bind(this), this._onPointerUp = Wu.bind(this), this._onContextMenu = Qu.bind(this), this._onMouseWheel = Xu.bind(this), this._onKeyDown = Yu.bind(this), this._onTouchStart = qu.bind(this), this._onTouchMove = $u.bind(this), this._onMouseDown = Zu.bind(this), this._onMouseMove = Ku.bind(this), this._interceptControlDown = Ju.bind(this), this._interceptControlUp = ed.bind(this), this.domElement !== null && this.connect(this.domElement), this.update();
10613
+ super(e, t), this.state = Ee.NONE, this.target = new $(), this.cursor = new $(), this.minDistance = 0, this.maxDistance = 1 / 0, this.minZoom = 0, this.maxZoom = 1 / 0, this.minTargetRadius = 0, this.maxTargetRadius = 1 / 0, this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -1 / 0, this.maxAzimuthAngle = 1 / 0, this.enableDamping = !1, this.dampingFactor = 0.05, this.enableZoom = !0, this.zoomSpeed = 1, this.enableRotate = !0, this.rotateSpeed = 1, this.keyRotateSpeed = 1, this.enablePan = !0, this.panSpeed = 1, this.screenSpacePanning = !0, this.keyPanSpeed = 7, this.zoomToCursor = !1, this.autoRotate = !1, this.autoRotateSpeed = 2, this.keys = { LEFT: "ArrowLeft", UP: "ArrowUp", RIGHT: "ArrowRight", BOTTOM: "ArrowDown" }, this.mouseButtons = { LEFT: Be.ROTATE, MIDDLE: Be.DOLLY, RIGHT: Be.PAN }, this.touches = { ONE: Ye.ROTATE, TWO: Ye.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this._lastPosition = new $(), this._lastQuaternion = new xn(), this._lastTargetPosition = new $(), this._quat = new xn().setFromUnitVectors(e.up, new $(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new js(), this._sphericalDelta = new js(), this._scale = 1, this._panOffset = new $(), this._rotateStart = new pe(), this._rotateEnd = new pe(), this._rotateDelta = new pe(), this._panStart = new pe(), this._panEnd = new pe(), this._panDelta = new pe(), this._dollyStart = new pe(), this._dollyEnd = new pe(), this._dollyDelta = new pe(), this._dollyDirection = new $(), this._mouse = new pe(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = Wu.bind(this), this._onPointerDown = Vu.bind(this), this._onPointerUp = Zu.bind(this), this._onContextMenu = Ju.bind(this), this._onMouseWheel = Yu.bind(this), this._onKeyDown = qu.bind(this), this._onTouchStart = $u.bind(this), this._onTouchMove = Qu.bind(this), this._onMouseDown = Ku.bind(this), this._onMouseMove = Xu.bind(this), this._interceptControlDown = ed.bind(this), this._interceptControlUp = td.bind(this), this.domElement !== null && this.connect(this.domElement), this.update();
10590
10614
  }
10591
10615
  connect(e) {
10592
10616
  super.connect(e), this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointercancel", this._onPointerUp), this.domElement.addEventListener("contextmenu", this._onContextMenu), this.domElement.addEventListener("wheel", this._onMouseWheel, { passive: !1 }), this.domElement.getRootNode().addEventListener("keydown", this._interceptControlDown, { passive: !0, capture: !0 }), this.domElement.style.touchAction = "none";
@@ -10677,7 +10701,7 @@ class ca extends Io {
10677
10701
  u.unproject(this.object), this.object.position.sub(u).add(a), this.object.updateMatrixWorld(), o = Pe.length();
10678
10702
  } else
10679
10703
  console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), this.zoomToCursor = !1;
10680
- o !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(o).add(this.object.position) : (Ds.origin.copy(this.object.position), Ds.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(Ds.direction)) < ju ? this.object.lookAt(this.target) : (fo.setFromNormalAndCoplanarPoint(this.object.up, this.target), Ds.intersectPlane(fo, this.target))));
10704
+ o !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(o).add(this.object.position) : (Ds.origin.copy(this.object.position), Ds.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(Ds.direction)) < Gu ? this.object.lookAt(this.target) : (fo.setFromNormalAndCoplanarPoint(this.object.up, this.target), Ds.intersectPlane(fo, this.target))));
10681
10705
  } else if (this.object.isOrthographicCamera) {
10682
10706
  const o = this.object.zoom;
10683
10707
  this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), o !== this.object.zoom && (this.object.updateProjectionMatrix(), r = !0);
@@ -10874,13 +10898,13 @@ class ca extends Io {
10874
10898
  return e.ctrlKey && !this._controlActive && (n.deltaY *= 10), n;
10875
10899
  }
10876
10900
  }
10877
- function Gu(i) {
10901
+ function Vu(i) {
10878
10902
  this.enabled !== !1 && (this._pointers.length === 0 && (this.domElement.setPointerCapture(i.pointerId), this.domElement.addEventListener("pointermove", this._onPointerMove), this.domElement.addEventListener("pointerup", this._onPointerUp)), !this._isTrackingPointer(i) && (this._addPointer(i), i.pointerType === "touch" ? this._onTouchStart(i) : this._onMouseDown(i)));
10879
10903
  }
10880
- function Vu(i) {
10904
+ function Wu(i) {
10881
10905
  this.enabled !== !1 && (i.pointerType === "touch" ? this._onTouchMove(i) : this._onMouseMove(i));
10882
10906
  }
10883
- function Wu(i) {
10907
+ function Zu(i) {
10884
10908
  switch (this._removePointer(i), this._pointers.length) {
10885
10909
  case 0:
10886
10910
  this.domElement.releasePointerCapture(i.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(aa), this.state = Ee.NONE;
@@ -10891,7 +10915,7 @@ function Wu(i) {
10891
10915
  break;
10892
10916
  }
10893
10917
  }
10894
- function Zu(i) {
10918
+ function Ku(i) {
10895
10919
  let e;
10896
10920
  switch (i.button) {
10897
10921
  case 0:
@@ -10934,7 +10958,7 @@ function Zu(i) {
10934
10958
  }
10935
10959
  this.state !== Ee.NONE && this.dispatchEvent(dr);
10936
10960
  }
10937
- function Ku(i) {
10961
+ function Xu(i) {
10938
10962
  switch (this.state) {
10939
10963
  case Ee.ROTATE:
10940
10964
  if (this.enableRotate === !1) return;
@@ -10950,13 +10974,13 @@ function Ku(i) {
10950
10974
  break;
10951
10975
  }
10952
10976
  }
10953
- function Xu(i) {
10977
+ function Yu(i) {
10954
10978
  this.enabled === !1 || this.enableZoom === !1 || this.state !== Ee.NONE || (i.preventDefault(), this.dispatchEvent(dr), this._handleMouseWheel(this._customWheelEvent(i)), this.dispatchEvent(aa));
10955
10979
  }
10956
- function Yu(i) {
10980
+ function qu(i) {
10957
10981
  this.enabled !== !1 && this._handleKeyDown(i);
10958
10982
  }
10959
- function qu(i) {
10983
+ function $u(i) {
10960
10984
  switch (this._trackPointer(i), this._pointers.length) {
10961
10985
  case 1:
10962
10986
  switch (this.touches.ONE) {
@@ -10991,7 +11015,7 @@ function qu(i) {
10991
11015
  }
10992
11016
  this.state !== Ee.NONE && this.dispatchEvent(dr);
10993
11017
  }
10994
- function $u(i) {
11018
+ function Qu(i) {
10995
11019
  switch (this._trackPointer(i), this.state) {
10996
11020
  case Ee.TOUCH_ROTATE:
10997
11021
  if (this.enableRotate === !1) return;
@@ -11013,16 +11037,16 @@ function $u(i) {
11013
11037
  this.state = Ee.NONE;
11014
11038
  }
11015
11039
  }
11016
- function Qu(i) {
11040
+ function Ju(i) {
11017
11041
  this.enabled !== !1 && i.preventDefault();
11018
11042
  }
11019
- function Ju(i) {
11043
+ function ed(i) {
11020
11044
  i.key === "Control" && (this._controlActive = !0, this.domElement.getRootNode().addEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
11021
11045
  }
11022
- function ed(i) {
11046
+ function td(i) {
11023
11047
  i.key === "Control" && (this._controlActive = !1, this.domElement.getRootNode().removeEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
11024
11048
  }
11025
- class td extends ca {
11049
+ class nd extends ca {
11026
11050
  constructor(e, t) {
11027
11051
  super(e, t), this.screenSpacePanning = !1, this.mouseButtons = { LEFT: Be.PAN, MIDDLE: Be.DOLLY, RIGHT: Be.ROTATE }, this.touches = { ONE: Ye.PAN, TWO: Ye.DOLLY_ROTATE };
11028
11052
  }
@@ -11042,16 +11066,16 @@ const de = {
11042
11066
  LINE_COLOR: 0
11043
11067
  };
11044
11068
  var Gt = /* @__PURE__ */ ((i) => (i.FRONT = "FRONT", i.BACK = "BACK", i.RIGHT = "RIGHT", i.LEFT = "LEFT", i.TOP = "TOP", i.BOTTOM = "BOTTOM", i))(Gt || {});
11045
- new T.Vector3(0, 1, 0);
11046
- const $n = "rotation-arrows-name", Xi = "left-rotation-arrow-name", Xs = "right-rotation-arrow-name", nd = "gizmo-group-name", sd = [
11069
+ new E.Vector3(0, 1, 0);
11070
+ const $n = "rotation-arrows-name", Xi = "left-rotation-arrow-name", Xs = "right-rotation-arrow-name", sd = "gizmo-group-name", id = [
11047
11071
  Xs,
11048
11072
  Xi
11049
11073
  ], Us = {
11050
11074
  GIZMO_DISTANCE: 8,
11051
- DEFAULT_UP: new T.Vector3(0, 1, 0),
11052
- FORWARD: new T.Vector3(0, 0, -1)
11053
- }, xi = (i) => Us.FORWARD.clone().applyQuaternion(i), po = (i, e, t = new T.Vector3()) => t.clone().add(i.multiplyScalar(-e));
11054
- class id {
11075
+ DEFAULT_UP: new E.Vector3(0, 1, 0),
11076
+ FORWARD: new E.Vector3(0, 0, -1)
11077
+ }, xi = (i) => Us.FORWARD.clone().applyQuaternion(i), po = (i, e, t = new E.Vector3()) => t.clone().add(i.multiplyScalar(-e));
11078
+ class rd {
11055
11079
  constructor(e, t = $n) {
11056
11080
  this.gizmoScene = e, this.gizmoArrowsName = t;
11057
11081
  }
@@ -11065,8 +11089,8 @@ class id {
11065
11089
  s && s.rotation.copy(e.camera.rotation);
11066
11090
  }
11067
11091
  syncMainWithGizmo(e, t, n) {
11068
- const s = n.target.clone(), r = e.position.distanceTo(s), o = e.camera instanceof T.PerspectiveCamera;
11069
- n instanceof td && !o ? this.syncMapControls(e, t, s, r) : this.syncOrbitControls(e, t, s, r), e.camera.updateMatrix(), e.camera.updateMatrixWorld(!0), n.update();
11092
+ const s = n.target.clone(), r = e.position.distanceTo(s), o = e.camera instanceof E.PerspectiveCamera;
11093
+ n instanceof nd && !o ? this.syncMapControls(e, t, s, r) : this.syncOrbitControls(e, t, s, r), e.camera.updateMatrix(), e.camera.updateMatrixWorld(!0), n.update();
11070
11094
  }
11071
11095
  syncMapControls(e, t, n, s) {
11072
11096
  const r = e.position.y - n.y, o = xi(t.quaternion);
@@ -11081,7 +11105,7 @@ class id {
11081
11105
  e.position.copy(a), e.up.copy(o), e.camera.lookAt(n);
11082
11106
  }
11083
11107
  }
11084
- const la = (i) => new id(i), mo = (i, e, t) => {
11108
+ const la = (i) => new rd(i), mo = (i, e, t) => {
11085
11109
  la(t).syncGizmoWithMain(
11086
11110
  {
11087
11111
  camera: i,
@@ -11096,7 +11120,7 @@ const la = (i) => new id(i), mo = (i, e, t) => {
11096
11120
  up: e.up
11097
11121
  }
11098
11122
  );
11099
- }, rd = (i, e, t) => {
11123
+ }, od = (i, e, t) => {
11100
11124
  la(e.userData.scene).syncMainWithGizmo(
11101
11125
  {
11102
11126
  camera: i,
@@ -11112,34 +11136,34 @@ const la = (i) => new id(i), mo = (i, e, t) => {
11112
11136
  },
11113
11137
  t
11114
11138
  );
11115
- }, od = () => {
11139
+ }, ad = () => {
11116
11140
  try {
11117
11141
  const i = document.createElement("canvas");
11118
11142
  return !!(window.WebGLRenderingContext && (i.getContext("webgl") || i.getContext("experimental-webgl")));
11119
11143
  } catch {
11120
11144
  return !1;
11121
11145
  }
11122
- }, ad = () => od() ? new T.WebGLRenderer({ alpha: !0, antialias: !1 }) : (console.error("WebGL is not supported in this environment."), null), cd = (i) => {
11123
- const e = new T.AmbientLight(16777215, 1);
11146
+ }, cd = () => ad() ? new E.WebGLRenderer({ alpha: !0, antialias: !1 }) : (console.error("WebGL is not supported in this environment."), null), ld = (i) => {
11147
+ const e = new E.AmbientLight(16777215, 1);
11124
11148
  i.add(e);
11125
- const t = new T.DirectionalLight(16777215, 1);
11149
+ const t = new E.DirectionalLight(16777215, 1);
11126
11150
  t.position.set(5, 10, 5), i.add(t);
11127
- const n = new T.DirectionalLight(16777215, 1);
11151
+ const n = new E.DirectionalLight(16777215, 1);
11128
11152
  n.position.set(-5, -10, 5), i.add(n);
11129
- const s = new T.PointLight(16777215, 1, 100);
11153
+ const s = new E.PointLight(16777215, 1, 100);
11130
11154
  s.position.set(0, 0, 5), i.add(s), t.castShadow = !1, n.castShadow = !1, s.castShadow = !1;
11131
11155
  };
11132
- class ld {
11156
+ class hd {
11133
11157
  static createTextTexture(e) {
11134
11158
  const t = document.createElement("canvas"), n = t.getContext("2d");
11135
11159
  t.width = de.CANVAS_SIZE, t.height = de.CANVAS_SIZE, n && (n.clearRect(0, 0, t.width, t.height), n.font = `${de.FONT_SIZE} Arial`, n.fillStyle = de.TEXT_COLOR, n.textAlign = de.TEXT_ALIGN, n.textBaseline = de.TEXT_BASELINE, n.fillText(e, t.width / 2, t.height / 2));
11136
- const s = new T.CanvasTexture(t);
11160
+ const s = new E.CanvasTexture(t);
11137
11161
  return s.needsUpdate = !0, s;
11138
11162
  }
11139
11163
  }
11140
11164
  class Ns {
11141
11165
  static createWireframe([e, t, n]) {
11142
- const s = new T.BoxGeometry(e, t, n), r = new T.EdgesGeometry(s), o = new T.LineBasicMaterial({ color: de.LINE_COLOR }), a = new T.LineSegments(r, o);
11166
+ const s = new E.BoxGeometry(e, t, n), r = new E.EdgesGeometry(s), o = new E.LineBasicMaterial({ color: de.LINE_COLOR }), a = new E.LineSegments(r, o);
11143
11167
  return a.name = "Wireframe", a;
11144
11168
  }
11145
11169
  static createEdgeBox(e, t, n) {
@@ -11149,44 +11173,44 @@ class Ns {
11149
11173
  z: de.EDGE_SECTION_SIZE
11150
11174
  };
11151
11175
  r[t] = s;
11152
- const o = new T.BoxGeometry(r.x, r.y, r.z), a = new T.MeshStandardMaterial({ color: de.EDGE_COLOR }), c = new T.Mesh(o, a);
11176
+ const o = new E.BoxGeometry(r.x, r.y, r.z), a = new E.MeshStandardMaterial({ color: de.EDGE_COLOR }), c = new E.Mesh(o, a);
11153
11177
  return c.position.copy(e), c.name = `Edge Box ${n}`, c;
11154
11178
  }
11155
11179
  static createCornerCube(e, t) {
11156
- const n = new T.BoxGeometry(
11180
+ const n = new E.BoxGeometry(
11157
11181
  de.EDGE_SECTION_SIZE,
11158
11182
  de.EDGE_SECTION_SIZE,
11159
11183
  de.EDGE_SECTION_SIZE
11160
- ), s = new T.MeshStandardMaterial({ color: de.CORNER_COLOR }), r = new T.Mesh(n, s);
11184
+ ), s = new E.MeshStandardMaterial({ color: de.CORNER_COLOR }), r = new E.Mesh(n, s);
11161
11185
  return r.position.copy(e), r.name = `Corner Cube ${t}`, r;
11162
11186
  }
11163
11187
  static createFace(e, t, n) {
11164
- const s = new T.Group(), r = new T.BoxGeometry(
11188
+ const s = new E.Group(), r = new E.BoxGeometry(
11165
11189
  de.CUBE_SIZE - de.EDGE_SECTION_SIZE,
11166
11190
  de.CUBE_SIZE - de.EDGE_SECTION_SIZE,
11167
11191
  de.FACE_THICKNESS
11168
- ), o = new T.MeshStandardMaterial({ color: de.FACE_COLOR }), a = new T.Mesh(r, o);
11192
+ ), o = new E.MeshStandardMaterial({ color: de.FACE_COLOR }), a = new E.Mesh(r, o);
11169
11193
  a.name = `Face Box ${n}`, s.add(a);
11170
- const c = new T.PlaneGeometry(
11194
+ const c = new E.PlaneGeometry(
11171
11195
  de.CUBE_SIZE - de.EDGE_SECTION_SIZE,
11172
11196
  de.CUBE_SIZE - de.EDGE_SECTION_SIZE
11173
- ), u = new T.MeshStandardMaterial({
11174
- map: ld.createTextTexture(n),
11197
+ ), u = new E.MeshStandardMaterial({
11198
+ map: hd.createTextTexture(n),
11175
11199
  transparent: !0,
11176
11200
  depthWrite: !1
11177
- }), d = new T.Mesh(c, u);
11201
+ }), d = new E.Mesh(c, u);
11178
11202
  return d.position.set(0, 0, de.FACE_THICKNESS / 2 + 0.01), s.add(d), s.position.copy(e), s.rotation.copy(t), s;
11179
11203
  }
11180
11204
  }
11181
- const hd = (i, e) => {
11205
+ const ud = (i, e) => {
11182
11206
  const t = document.createElement("canvas");
11183
11207
  t.width = 64, t.height = 64;
11184
11208
  const n = t.getContext("2d");
11185
11209
  n.fillStyle = "rgba(0, 0, 0, 0)", n.fillRect(0, 0, t.width, t.height), n.font = "Bold 48px Arial", n.fillStyle = `#${e.toString(16).padStart(6, "0")}`, n.textAlign = "center", n.textBaseline = "middle", n.fillText(i, t.width / 2, t.height / 2);
11186
- const s = new T.CanvasTexture(t), r = new T.SpriteMaterial({ map: s }), o = new T.Sprite(r);
11210
+ const s = new E.CanvasTexture(t), r = new E.SpriteMaterial({ map: s }), o = new E.Sprite(r);
11187
11211
  return o.scale.set(0.5, 0.5, 0.5), o;
11188
11212
  };
11189
- class ud {
11213
+ class dd {
11190
11214
  constructor(e) {
11191
11215
  this.hoveredObject = null, this.originalColor = null, this.config = e;
11192
11216
  }
@@ -11197,18 +11221,18 @@ class ud {
11197
11221
  getInitialRotation() {
11198
11222
  switch (this.config.initialFace) {
11199
11223
  case Gt.BACK:
11200
- return new T.Euler(0, Math.PI, 0);
11224
+ return new E.Euler(0, Math.PI, 0);
11201
11225
  case Gt.RIGHT:
11202
- return new T.Euler(0, -Math.PI / 2, 0);
11226
+ return new E.Euler(0, -Math.PI / 2, 0);
11203
11227
  case Gt.LEFT:
11204
- return new T.Euler(0, Math.PI / 2, 0);
11228
+ return new E.Euler(0, Math.PI / 2, 0);
11205
11229
  case Gt.TOP:
11206
- return new T.Euler(Math.PI / 2, 0, 0);
11230
+ return new E.Euler(Math.PI / 2, 0, 0);
11207
11231
  case Gt.BOTTOM:
11208
- return new T.Euler(-Math.PI / 2, 0, 0);
11232
+ return new E.Euler(-Math.PI / 2, 0, 0);
11209
11233
  case Gt.FRONT:
11210
11234
  default:
11211
- return new T.Euler(0, 0, 0);
11235
+ return new E.Euler(0, 0, 0);
11212
11236
  }
11213
11237
  }
11214
11238
  createWireframe() {
@@ -11230,18 +11254,18 @@ class ud {
11230
11254
  createEdges(e) {
11231
11255
  const t = de.CUBE_SIZE / 2;
11232
11256
  [
11233
- { axis: "x", pos: new T.Vector3(0, t, -t) },
11234
- { axis: "x", pos: new T.Vector3(0, t, t) },
11235
- { axis: "x", pos: new T.Vector3(0, -t, -t) },
11236
- { axis: "x", pos: new T.Vector3(0, -t, t) },
11237
- { axis: "y", pos: new T.Vector3(t, 0, -t) },
11238
- { axis: "y", pos: new T.Vector3(t, 0, t) },
11239
- { axis: "y", pos: new T.Vector3(-t, 0, -t) },
11240
- { axis: "y", pos: new T.Vector3(-t, 0, t) },
11241
- { axis: "z", pos: new T.Vector3(t, t, 0) },
11242
- { axis: "z", pos: new T.Vector3(t, -t, 0) },
11243
- { axis: "z", pos: new T.Vector3(-t, t, 0) },
11244
- { axis: "z", pos: new T.Vector3(-t, -t, 0) }
11257
+ { axis: "x", pos: new E.Vector3(0, t, -t) },
11258
+ { axis: "x", pos: new E.Vector3(0, t, t) },
11259
+ { axis: "x", pos: new E.Vector3(0, -t, -t) },
11260
+ { axis: "x", pos: new E.Vector3(0, -t, t) },
11261
+ { axis: "y", pos: new E.Vector3(t, 0, -t) },
11262
+ { axis: "y", pos: new E.Vector3(t, 0, t) },
11263
+ { axis: "y", pos: new E.Vector3(-t, 0, -t) },
11264
+ { axis: "y", pos: new E.Vector3(-t, 0, t) },
11265
+ { axis: "z", pos: new E.Vector3(t, t, 0) },
11266
+ { axis: "z", pos: new E.Vector3(t, -t, 0) },
11267
+ { axis: "z", pos: new E.Vector3(-t, t, 0) },
11268
+ { axis: "z", pos: new E.Vector3(-t, -t, 0) }
11245
11269
  ].forEach(({ axis: n, pos: s }, r) => {
11246
11270
  const o = this.createEdgeBox(s, n, r + 1);
11247
11271
  e.add(o);
@@ -11250,14 +11274,14 @@ class ud {
11250
11274
  createCorners(e) {
11251
11275
  const t = de.CUBE_SIZE / 2;
11252
11276
  [
11253
- new T.Vector3(-t, -t, -t),
11254
- new T.Vector3(-t, -t, t),
11255
- new T.Vector3(-t, t, -t),
11256
- new T.Vector3(-t, t, t),
11257
- new T.Vector3(t, -t, -t),
11258
- new T.Vector3(t, -t, t),
11259
- new T.Vector3(t, t, -t),
11260
- new T.Vector3(t, t, t)
11277
+ new E.Vector3(-t, -t, -t),
11278
+ new E.Vector3(-t, -t, t),
11279
+ new E.Vector3(-t, t, -t),
11280
+ new E.Vector3(-t, t, t),
11281
+ new E.Vector3(t, -t, -t),
11282
+ new E.Vector3(t, -t, t),
11283
+ new E.Vector3(t, t, -t),
11284
+ new E.Vector3(t, t, t)
11261
11285
  ].forEach((n, s) => {
11262
11286
  const r = this.createCornerCube(n, s + 1);
11263
11287
  e.add(r);
@@ -11267,33 +11291,33 @@ class ud {
11267
11291
  const t = de.CUBE_SIZE / 2;
11268
11292
  [
11269
11293
  {
11270
- pos: new T.Vector3(0, 0, t),
11271
- rotation: new T.Euler(0, 0, 0),
11294
+ pos: new E.Vector3(0, 0, t),
11295
+ rotation: new E.Euler(0, 0, 0),
11272
11296
  label: "FRONT"
11273
11297
  },
11274
11298
  {
11275
- pos: new T.Vector3(0, 0, -t),
11276
- rotation: new T.Euler(0, Math.PI, 0),
11299
+ pos: new E.Vector3(0, 0, -t),
11300
+ rotation: new E.Euler(0, Math.PI, 0),
11277
11301
  label: "BACK"
11278
11302
  },
11279
11303
  {
11280
- pos: new T.Vector3(t, 0, 0),
11281
- rotation: new T.Euler(0, Math.PI / 2, 0),
11304
+ pos: new E.Vector3(t, 0, 0),
11305
+ rotation: new E.Euler(0, Math.PI / 2, 0),
11282
11306
  label: "RIGHT"
11283
11307
  },
11284
11308
  {
11285
- pos: new T.Vector3(-t, 0, 0),
11286
- rotation: new T.Euler(0, -Math.PI / 2, 0),
11309
+ pos: new E.Vector3(-t, 0, 0),
11310
+ rotation: new E.Euler(0, -Math.PI / 2, 0),
11287
11311
  label: "LEFT"
11288
11312
  },
11289
11313
  {
11290
- pos: new T.Vector3(0, t, 0),
11291
- rotation: new T.Euler(-Math.PI / 2, 0, 0),
11314
+ pos: new E.Vector3(0, t, 0),
11315
+ rotation: new E.Euler(-Math.PI / 2, 0, 0),
11292
11316
  label: "TOP"
11293
11317
  },
11294
11318
  {
11295
- pos: new T.Vector3(0, -t, 0),
11296
- rotation: new T.Euler(Math.PI / 2, 0, 0),
11319
+ pos: new E.Vector3(0, -t, 0),
11320
+ rotation: new E.Euler(Math.PI / 2, 0, 0),
11297
11321
  label: "BOTTOM"
11298
11322
  }
11299
11323
  ].forEach(({ pos: n, rotation: s, label: r }) => {
@@ -11302,26 +11326,26 @@ class ud {
11302
11326
  });
11303
11327
  }
11304
11328
  createAxis(e) {
11305
- const { color: t, direction: n, length: s, origin: r, lineWidth: o, label: a } = e, c = new T.Group(), u = o / 2, d = new T.CylinderGeometry(u, u, s, 32), h = new T.MeshBasicMaterial({ color: t }), f = new T.Mesh(d, h);
11306
- if (f.position.copy(r).add(n.clone().multiplyScalar(s / 2)), !n.equals(new T.Vector3(0, 1, 0))) {
11307
- const y = new T.Vector3(0, 1, 0).cross(n).normalize(), S = Math.acos(new T.Vector3(0, 1, 0).dot(n));
11308
- f.setRotationFromAxisAngle(y, S);
11329
+ const { color: t, direction: n, length: s, origin: r, lineWidth: o, label: a } = e, c = new E.Group(), u = o / 2, d = new E.CylinderGeometry(u, u, s, 32), h = new E.MeshBasicMaterial({ color: t }), f = new E.Mesh(d, h);
11330
+ if (f.position.copy(r).add(n.clone().multiplyScalar(s / 2)), !n.equals(new E.Vector3(0, 1, 0))) {
11331
+ const y = new E.Vector3(0, 1, 0).cross(n).normalize(), b = Math.acos(new E.Vector3(0, 1, 0).dot(n));
11332
+ f.setRotationFromAxisAngle(y, b);
11309
11333
  }
11310
11334
  c.add(f);
11311
- const p = hd(a, t);
11335
+ const p = ud(a, t);
11312
11336
  return p.position.copy(r).add(n.clone().multiplyScalar(s + 0.1)), c.add(p), c;
11313
11337
  }
11314
11338
  createCoordinateAxes() {
11315
- const e = new T.Group(), t = de.CUBE_SIZE, n = de.EDGE_SECTION_SIZE, s = -1.075, r = (a) => {
11316
- const c = new T.Vector3(1, 1, 1);
11317
- return new T.Vector3(a, a, a).add(
11339
+ const e = new E.Group(), t = de.CUBE_SIZE, n = de.EDGE_SECTION_SIZE, s = -1.075, r = (a) => {
11340
+ const c = new E.Vector3(1, 1, 1);
11341
+ return new E.Vector3(a, a, a).add(
11318
11342
  c.clone().normalize().negate().multiplyScalar(0.04)
11319
11343
  );
11320
11344
  }, o = t + 1.25 * n;
11321
11345
  return [
11322
11346
  {
11323
11347
  color: 16711680,
11324
- direction: new T.Vector3(1, 0, 0),
11348
+ direction: new E.Vector3(1, 0, 0),
11325
11349
  length: o,
11326
11350
  origin: r(s),
11327
11351
  lineWidth: 0.04,
@@ -11330,7 +11354,7 @@ class ud {
11330
11354
  },
11331
11355
  {
11332
11356
  color: 65280,
11333
- direction: new T.Vector3(0, 1, 0),
11357
+ direction: new E.Vector3(0, 1, 0),
11334
11358
  length: o,
11335
11359
  origin: r(s),
11336
11360
  lineWidth: 0.04,
@@ -11338,7 +11362,7 @@ class ud {
11338
11362
  },
11339
11363
  {
11340
11364
  color: 255,
11341
- direction: new T.Vector3(0, 0, 1),
11365
+ direction: new E.Vector3(0, 0, 1),
11342
11366
  length: o,
11343
11367
  origin: r(s),
11344
11368
  lineWidth: 0.04,
@@ -11350,8 +11374,8 @@ class ud {
11350
11374
  }), e;
11351
11375
  }
11352
11376
  create() {
11353
- const e = new T.Group();
11354
- e.name = nd;
11377
+ const e = new E.Group();
11378
+ e.name = sd;
11355
11379
  const t = this.createWireframe();
11356
11380
  e.add(t), this.createEdges(e), this.createCorners(e), this.createFaces(e);
11357
11381
  const n = this.createCoordinateAxes();
@@ -11361,7 +11385,7 @@ class ud {
11361
11385
  }
11362
11386
  highlightObject(e) {
11363
11387
  if (this.hoveredObject !== e)
11364
- if (this.hoveredObject && this.originalColor && this.hoveredObject.material.color.set(this.originalColor), e && e instanceof T.Mesh) {
11388
+ if (this.hoveredObject && this.originalColor && this.hoveredObject.material.color.set(this.originalColor), e && e instanceof E.Mesh) {
11365
11389
  const t = e.material;
11366
11390
  this.hoveredObject = e, this.originalColor = t.color.clone(), t.color.set(11519973);
11367
11391
  } else
@@ -11369,14 +11393,14 @@ class ud {
11369
11393
  }
11370
11394
  handleClick() {
11371
11395
  if (this.hoveredObject) {
11372
- let e = new T.Vector3();
11396
+ let e = new E.Vector3();
11373
11397
  e = this.hoveredObject.getWorldPosition(e).clone();
11374
- const t = new T.Vector3(0, 0, 0), n = e.sub(t).normalize();
11398
+ const t = new E.Vector3(0, 0, 0), n = e.sub(t).normalize();
11375
11399
  this.hoveredObject.userData.vectorToCube = n;
11376
11400
  }
11377
11401
  }
11378
11402
  }
11379
- class dd {
11403
+ class fd {
11380
11404
  constructor(e) {
11381
11405
  this.onChangeMainControlsListener = () => {
11382
11406
  }, this.onChangeGizmoControlsListener = () => {
@@ -11398,10 +11422,10 @@ class dd {
11398
11422
  }
11399
11423
  initializeScene() {
11400
11424
  var e;
11401
- const t = new ud({
11425
+ const t = new dd({
11402
11426
  initialFace: ((e = this.options) == null ? void 0 : e.initialFace) ?? Gt.FRONT
11403
11427
  }).create();
11404
- this.gizmoScene.add(t), cd(this.gizmoScene);
11428
+ this.gizmoScene.add(t), ld(this.gizmoScene);
11405
11429
  }
11406
11430
  initializeControls() {
11407
11431
  this.onChangeMainControlsListener = () => this.syncFunctions.syncGizmoCameraWithMain(
@@ -11441,7 +11465,7 @@ class dd {
11441
11465
  ), this.gizmoScene.clear(), cancelAnimationFrame(this.animationId);
11442
11466
  }
11443
11467
  }
11444
- const fd = (i, e) => {
11468
+ const pd = (i, e) => {
11445
11469
  let t;
11446
11470
  return function(...n) {
11447
11471
  t || (i.apply(this, n), t = !0, setTimeout(() => t = !1, e));
@@ -11457,12 +11481,12 @@ const ha = (i, e, t, n) => (n.setFromCamera(i, e), n.intersectObjects(t.children
11457
11481
  const t = ["Wireframe", ""];
11458
11482
  return ((e = i.find((n) => !t.includes(n.object.name))) == null ? void 0 : e.object) || null;
11459
11483
  };
11460
- function pd(i, e, t, n) {
11484
+ function md(i, e, t, n) {
11461
11485
  if (!e || !t) return null;
11462
11486
  const s = ha(i, e, t, n);
11463
11487
  return ua(s);
11464
11488
  }
11465
- function md(i, e) {
11489
+ function gd(i, e) {
11466
11490
  const t = i == null ? void 0 : i.userData.gizmoCube;
11467
11491
  if (i && t) {
11468
11492
  t.handleClick();
@@ -11470,34 +11494,34 @@ function md(i, e) {
11470
11494
  n && e(n);
11471
11495
  }
11472
11496
  }
11473
- const gd = {
11497
+ const yd = {
11474
11498
  radius: 2.1,
11475
11499
  color: 12369854,
11476
11500
  tubeRadius: 0.1,
11477
11501
  tubeSegments: 8,
11478
11502
  numPoints: 64,
11479
11503
  tubeOffset: 1.5
11480
- }, yd = {
11504
+ }, wd = {
11481
11505
  size: 0.2,
11482
11506
  depth: 0.1,
11483
11507
  heightRatio: 1.4,
11484
11508
  segments: 1
11485
11509
  };
11486
- class wd {
11510
+ class Ed {
11487
11511
  constructor(e = {}) {
11488
- this.config = { ...gd, ...e }, this.material = new T.MeshBasicMaterial({ color: this.config.color });
11512
+ this.config = { ...yd, ...e }, this.material = new E.MeshBasicMaterial({ color: this.config.color });
11489
11513
  }
11490
11514
  create() {
11491
- const e = new T.Group(), t = this.createQuarterCircleCurves();
11515
+ const e = new E.Group(), t = this.createQuarterCircleCurves();
11492
11516
  return e.add(...this.createTubes(t), ...this.createArrowHeads(t)), e.name = $n, e;
11493
11517
  }
11494
11518
  createQuarterCircleCurves() {
11495
11519
  const e = this.generateQuarterCirclePoints(), t = Math.floor(e.length / 2);
11496
11520
  return [
11497
- new T.CatmullRomCurve3(
11521
+ new E.CatmullRomCurve3(
11498
11522
  e.slice(0, t - this.config.tubeOffset)
11499
11523
  ),
11500
- new T.CatmullRomCurve3(
11524
+ new E.CatmullRomCurve3(
11501
11525
  e.slice(t + this.config.tubeOffset)
11502
11526
  )
11503
11527
  ];
@@ -11506,18 +11530,18 @@ class wd {
11506
11530
  const e = Math.PI / 2, t = e / 2, n = e / 4;
11507
11531
  return Array.from({ length: this.config.numPoints + 1 }, (s, r) => {
11508
11532
  const o = r / this.config.numPoints, a = n + t * o, c = this.config.radius * Math.sin(a), u = this.config.radius * Math.cos(a);
11509
- return new T.Vector3(c, u, 0);
11533
+ return new E.Vector3(c, u, 0);
11510
11534
  });
11511
11535
  }
11512
11536
  createTubes([e, t]) {
11513
11537
  const n = (s, r) => {
11514
- const o = new T.TubeGeometry(
11538
+ const o = new E.TubeGeometry(
11515
11539
  s,
11516
11540
  this.config.numPoints,
11517
11541
  this.config.tubeRadius,
11518
11542
  this.config.tubeSegments,
11519
11543
  !1
11520
- ), a = new T.Mesh(o, this.material);
11544
+ ), a = new E.Mesh(o, this.material);
11521
11545
  return a.name = r, a;
11522
11546
  };
11523
11547
  return [
@@ -11526,12 +11550,12 @@ class wd {
11526
11550
  ];
11527
11551
  }
11528
11552
  createArrowHeads([e, t]) {
11529
- const { size: n, depth: s, heightRatio: r, segments: o } = yd, a = this.createArrowShape(n, r), c = new T.ExtrudeGeometry(a, {
11553
+ const { size: n, depth: s, heightRatio: r, segments: o } = wd, a = this.createArrowShape(n, r), c = new E.ExtrudeGeometry(a, {
11530
11554
  steps: o,
11531
11555
  depth: s,
11532
11556
  bevelEnabled: !1
11533
11557
  }).center(), u = (d, h, f) => {
11534
- const p = new T.Mesh(c, this.material);
11558
+ const p = new E.Mesh(c, this.material);
11535
11559
  return p.position.copy(d), p.rotation.z = h, p.name = f, p;
11536
11560
  };
11537
11561
  return [
@@ -11548,49 +11572,49 @@ class wd {
11548
11572
  ];
11549
11573
  }
11550
11574
  createArrowShape(e, t) {
11551
- return new T.Shape().moveTo(0, 0).lineTo(e, -e * t).lineTo(-e, -e * t).lineTo(0, 0);
11575
+ return new E.Shape().moveTo(0, 0).lineTo(e, -e * t).lineTo(-e, -e * t).lineTo(0, 0);
11552
11576
  }
11553
11577
  calculateArrowRotation(e) {
11554
11578
  return Math.atan2(e.y, e.x);
11555
11579
  }
11556
11580
  }
11557
- const Ed = (i) => {
11581
+ const Td = (i) => {
11558
11582
  const e = i.rotation, t = 0.01, n = Math.PI, s = (Math.abs(e.x) % (2 * n) + 2 * n) % (2 * n), r = (Math.abs(e.y) % (2 * n) + 2 * n) % (2 * n), o = Math.abs(s - n / 2) < t || Math.abs(s - 3 * n / 2) < t || Math.abs(r - n / 2) < t || Math.abs(r - 3 * n / 2) < t, a = (Math.abs(s) < t || Math.abs(s - n) < t) && (Math.abs(r) < t || Math.abs(r - n) < t);
11559
11583
  return !(o || a);
11560
- }, Td = 25, _d = 200;
11561
- function Sd({
11584
+ }, _d = 25, Sd = 200;
11585
+ function bd({
11562
11586
  gizmoRenderer: i,
11563
11587
  gizmoScene: e,
11564
11588
  gizmoCamera: t,
11565
11589
  alignCameraWithVector: n,
11566
11590
  gizmoControlRef: s
11567
11591
  }) {
11568
- const r = Ge(null), o = Ge(null), a = Ge(new T.Raycaster()).current, c = Ge(new T.Vector2()).current, u = Rt(() => {
11569
- const S = e.getObjectByName($n), E = Ed(t);
11570
- if (S && E) {
11571
- e.remove(S);
11592
+ const r = Ge(null), o = Ge(null), a = Ge(new E.Raycaster()).current, c = Ge(new E.Vector2()).current, u = Rt(() => {
11593
+ const b = e.getObjectByName($n), T = Td(t);
11594
+ if (b && T) {
11595
+ e.remove(b);
11572
11596
  return;
11573
11597
  }
11574
- if (S || E) return;
11575
- const x = new wd().create();
11598
+ if (b || T) return;
11599
+ const x = new Ed().create();
11576
11600
  x.rotation.copy(t.rotation), e.add(x);
11577
11601
  }, [e, t]), d = Rt(() => {
11578
- const S = e.getObjectByName($n);
11579
- S && e.remove(S);
11602
+ const b = e.getObjectByName($n);
11603
+ b && e.remove(b);
11580
11604
  }, [e]), h = Rt(
11581
- fd((S) => {
11605
+ pd((b) => {
11582
11606
  if (!s.current || !i) return;
11583
- go(S, i, c);
11584
- const E = ha(
11607
+ go(b, i, c);
11608
+ const T = ha(
11585
11609
  c,
11586
11610
  t,
11587
11611
  e,
11588
11612
  a
11589
- ), x = ua(E);
11613
+ ), x = ua(T);
11590
11614
  x != null && x.userData.gizmoCube ? x.userData.gizmoCube.highlightObject(x) : e.traverse((w) => {
11591
11615
  w.userData.gizmoCube && w.userData.gizmoCube.highlightObject(null);
11592
- }), E.length > 0 ? u() : d();
11593
- }, 1e3 / Td),
11616
+ }), T.length > 0 ? u() : d();
11617
+ }, 1e3 / _d),
11594
11618
  [
11595
11619
  s,
11596
11620
  i,
@@ -11601,26 +11625,26 @@ function Sd({
11601
11625
  u,
11602
11626
  d
11603
11627
  ]
11604
- ), f = Rt((S) => {
11605
- r.current = Date.now(), o.current = { x: S.clientX, y: S.clientY };
11628
+ ), f = Rt((b) => {
11629
+ r.current = Date.now(), o.current = { x: b.clientX, y: b.clientY };
11606
11630
  }, []), p = Rt(
11607
- (S) => {
11608
- var E;
11609
- const x = S.name === Xs ? 1 : -1, w = 90 * Math.PI / 180, b = new T.Vector3(0, 0, 0), _ = x * w, A = new T.Matrix4();
11610
- A.makeRotationZ(_), t.up.applyMatrix4(A), t.lookAt(b), (E = s.current) == null || E.gizmoControls.update();
11631
+ (b) => {
11632
+ var T;
11633
+ const x = b.name === Xs ? 1 : -1, w = 90 * Math.PI / 180, S = new E.Vector3(0, 0, 0), _ = x * w, A = new E.Matrix4();
11634
+ A.makeRotationZ(_), t.up.applyMatrix4(A), t.lookAt(S), (T = s.current) == null || T.gizmoControls.update();
11611
11635
  },
11612
11636
  [t, s]
11613
11637
  ), y = Rt(
11614
- (S) => {
11615
- if ((r.current ? Date.now() - r.current : 0) < _d) {
11616
- go(S, i, c);
11617
- const E = pd(
11638
+ (b) => {
11639
+ if ((r.current ? Date.now() - r.current : 0) < Sd) {
11640
+ go(b, i, c);
11641
+ const T = md(
11618
11642
  c,
11619
11643
  t,
11620
11644
  e,
11621
11645
  a
11622
11646
  );
11623
- E != null && E.name && sd.includes(E.name) ? p(E) : md(E, n);
11647
+ T != null && T.name && id.includes(T.name) ? p(T) : gd(T, n);
11624
11648
  }
11625
11649
  r.current = null, o.current = null;
11626
11650
  },
@@ -11641,41 +11665,41 @@ function Sd({
11641
11665
  onMouseLeave: d
11642
11666
  };
11643
11667
  }
11644
- const bd = ({
11668
+ const xd = ({
11645
11669
  camera: i,
11646
11670
  controls: e,
11647
11671
  className: t,
11648
11672
  render: n,
11649
11673
  options: s
11650
11674
  }) => {
11651
- const r = Ge(null), o = Ge(new T.Scene()).current, [a] = Xn(() => ad()), c = 30, u = 1, d = 0.1, h = 10, f = new T.PerspectiveCamera(
11675
+ const r = Ge(null), o = Ge(new E.Scene()).current, [a] = Xn(() => cd()), c = 30, u = 1, d = 0.1, h = 10, f = new E.PerspectiveCamera(
11652
11676
  c,
11653
11677
  u,
11654
11678
  d,
11655
11679
  h
11656
- ), p = Ge(f).current, y = Ge(null), S = Rt(() => {
11680
+ ), p = Ge(f).current, y = Ge(null), b = Rt(() => {
11657
11681
  a && (n(), a.render(o, p));
11658
- }, [n, a, o, p]), E = Rt(
11682
+ }, [n, a, o, p]), T = Rt(
11659
11683
  (A) => {
11660
11684
  if (!i || !e) return;
11661
- const P = i.position.length(), I = A.clone().multiplyScalar(P), M = 400, O = new T.Matrix4();
11662
- O.lookAt(I, new T.Vector3(0, 0, 0), new T.Vector3(0, 1, 0));
11663
- const C = new T.Quaternion();
11664
- C.setFromRotationMatrix(O), i.quaternion.copy(C), Hu(
11685
+ const P = i.position.length(), I = A.clone().multiplyScalar(P), M = 400, O = new E.Matrix4();
11686
+ O.lookAt(I, new E.Vector3(0, 0, 0), new E.Vector3(0, 1, 0));
11687
+ const C = new E.Quaternion();
11688
+ C.setFromRotationMatrix(O), i.quaternion.copy(C), ju(
11665
11689
  i,
11666
11690
  e,
11667
11691
  i.position.clone(),
11668
11692
  I,
11669
11693
  M,
11670
- S
11671
- ), i.up.set(0, 1, 0), i.lookAt(new T.Vector3(0, 0, 0)), e.target.set(0, 0, 0), e.update();
11694
+ b
11695
+ ), i.up.set(0, 1, 0), i.lookAt(new E.Vector3(0, 0, 0)), e.target.set(0, 0, 0), e.update();
11672
11696
  },
11673
- [i, e, S, o]
11674
- ), { onMouseDown: x, onMouseMove: w, onMouseUp: b, onMouseLeave: _ } = Sd({
11697
+ [i, e, b, o]
11698
+ ), { onMouseDown: x, onMouseMove: w, onMouseUp: S, onMouseLeave: _ } = bd({
11675
11699
  gizmoRenderer: a,
11676
11700
  gizmoScene: o,
11677
11701
  gizmoCamera: p,
11678
- alignCameraWithVector: E,
11702
+ alignCameraWithVector: T,
11679
11703
  gizmoControlRef: y
11680
11704
  });
11681
11705
  return ht(() => {
@@ -11690,34 +11714,34 @@ const bd = ({
11690
11714
  }, I = {
11691
11715
  mainCamera: i,
11692
11716
  mainControls: e,
11693
- renderGizmo: S
11717
+ renderGizmo: b
11694
11718
  }, M = {
11695
11719
  syncGizmoCameraWithMain: mo,
11696
- syncMainCameraWithGizmo: rd
11720
+ syncMainCameraWithGizmo: od
11697
11721
  };
11698
- return y.current = new dd({
11722
+ return y.current = new fd({
11699
11723
  gizmoParams: P,
11700
11724
  mainParams: I,
11701
11725
  syncFunctions: M,
11702
11726
  options: s
11703
- }), A.addEventListener("mousedown", x), A.addEventListener("mousemove", w), A.addEventListener("mouseup", b), A.addEventListener("mouseleave", _), () => {
11704
- y.current && (y.current.dispose(), y.current = null), A.removeEventListener("mousedown", x), A.removeEventListener("mousemove", w), A.removeEventListener("mouseup", b), A.removeEventListener("mouseleave", _);
11727
+ }), A.addEventListener("mousedown", x), A.addEventListener("mousemove", w), A.addEventListener("mouseup", S), A.addEventListener("mouseleave", _), () => {
11728
+ y.current && (y.current.dispose(), y.current = null), A.removeEventListener("mousedown", x), A.removeEventListener("mousemove", w), A.removeEventListener("mouseup", S), A.removeEventListener("mouseleave", _);
11705
11729
  };
11706
- }, [i, e, S, w, x, b]), ht(() => {
11707
- i && (mo(p, i, o), S());
11708
- }, [i, S]), /* @__PURE__ */ Te(
11730
+ }, [i, e, b, w, x, S]), ht(() => {
11731
+ i && (mo(p, i, o), b());
11732
+ }, [i, b]), /* @__PURE__ */ Te(
11709
11733
  "div",
11710
11734
  {
11711
11735
  className: t ? `${t}` : "gizmo-default",
11712
11736
  ref: r
11713
11737
  }
11714
11738
  );
11715
- }, ks = 10, xd = (i) => ({
11739
+ }, ks = 10, Ad = (i) => ({
11716
11740
  top: i.startsWith("top") ? ks : "auto",
11717
11741
  bottom: i.startsWith("bottom") ? ks : "auto",
11718
11742
  left: i.endsWith("left") ? ks : "auto",
11719
11743
  right: i.endsWith("right") ? ks : "auto"
11720
- }), Ad = ({
11744
+ }), vd = ({
11721
11745
  camera: i,
11722
11746
  controls: e,
11723
11747
  render: t,
@@ -11736,10 +11760,10 @@ const bd = ({
11736
11760
  width: s,
11737
11761
  height: s,
11738
11762
  zIndex: 1e3,
11739
- ...xd(n)
11763
+ ...Ad(n)
11740
11764
  },
11741
11765
  children: /* @__PURE__ */ Te(
11742
- bd,
11766
+ xd,
11743
11767
  {
11744
11768
  camera: i,
11745
11769
  controls: r,
@@ -11749,7 +11773,7 @@ const bd = ({
11749
11773
  }
11750
11774
  );
11751
11775
  };
11752
- class vd extends Ka {
11776
+ class Rd extends Ka {
11753
11777
  constructor(e) {
11754
11778
  super(e), this.reset = () => {
11755
11779
  this.setState({ hasError: !1, error: null });
@@ -11781,7 +11805,7 @@ class vd extends Ka {
11781
11805
  ] }) }) : this.props.children;
11782
11806
  }
11783
11807
  }
11784
- function Rd({ status: i, label: e, color: t, backdrop: n }) {
11808
+ function Md({ status: i, label: e, color: t, backdrop: n }) {
11785
11809
  const s = typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
11786
11810
  return /* @__PURE__ */ Hn(
11787
11811
  "div",
@@ -11831,14 +11855,14 @@ function Rd({ status: i, label: e, color: t, backdrop: n }) {
11831
11855
  }
11832
11856
  );
11833
11857
  }
11834
- const Md = '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif', Id = {
11858
+ const Id = '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif', Cd = {
11835
11859
  background: "rgba(255,255,255,0.78)",
11836
11860
  backdropFilter: "blur(16px)",
11837
11861
  WebkitBackdropFilter: "blur(16px)",
11838
11862
  border: "1px solid rgba(0,0,0,0.06)",
11839
11863
  boxShadow: "0 8px 30px rgba(0,0,0,0.10)"
11840
- }, Cd = Object.keys(sa);
11841
- function Pd({ active: i, onSelect: e }) {
11864
+ }, Pd = Object.keys(sa);
11865
+ function Ld({ active: i, onSelect: e }) {
11842
11866
  return /* @__PURE__ */ Te(
11843
11867
  "div",
11844
11868
  {
@@ -11859,9 +11883,9 @@ function Pd({ active: i, onSelect: e }) {
11859
11883
  // instead of bleeding past the canvas edges.
11860
11884
  maxWidth: "calc(100% - 16px)",
11861
11885
  overflowX: "auto",
11862
- ...Id
11886
+ ...Cd
11863
11887
  },
11864
- children: Cd.map((t) => /* @__PURE__ */ Te(
11888
+ children: Pd.map((t) => /* @__PURE__ */ Te(
11865
11889
  "button",
11866
11890
  {
11867
11891
  type: "button",
@@ -11876,7 +11900,7 @@ function Pd({ active: i, onSelect: e }) {
11876
11900
  border: t === i ? "1px solid #111318" : "1px solid transparent",
11877
11901
  background: t === i ? "#111318" : "transparent",
11878
11902
  color: t === i ? "#fff" : "#3f3f4a",
11879
- fontFamily: Md,
11903
+ fontFamily: Id,
11880
11904
  fontSize: 13,
11881
11905
  fontWeight: 500,
11882
11906
  lineHeight: 1,
@@ -11901,7 +11925,7 @@ const Bn = {
11901
11925
  // default light background (#f0f0f7) and dark studio mode.
11902
11926
  backdrop: "rgba(15,16,20,0.6)"
11903
11927
  };
11904
- function Ld(i) {
11928
+ function Od(i) {
11905
11929
  return i === void 0 || i === !0 ? Bn : i === !1 ? { ...Bn, enabled: !1 } : {
11906
11930
  enabled: i.enabled ?? !0,
11907
11931
  label: i.label ?? Bn.label,
@@ -11913,26 +11937,26 @@ function Ld(i) {
11913
11937
  const Fs = () => new Z("Viewer is not ready yet", Y.COMPONENT_NOT_MOUNTED), da = yo(
11914
11938
  ({ object: i, options: e = {}, preset: t, pathTraced: n, turntable: s, animations: r, children: o }, a) => {
11915
11939
  var D, H;
11916
- const c = Ge(null), u = e.preset ?? t, { activePreset: d, pickerEnabled: h, selectPreset: f } = Du(
11940
+ const c = Ge(null), u = e.preset ?? t, { activePreset: d, pickerEnabled: h, selectPreset: f } = Nu(
11917
11941
  u,
11918
11942
  e.ui
11919
- ), p = Nu(
11943
+ ), p = ku(
11920
11944
  e,
11921
11945
  d,
11922
11946
  n,
11923
11947
  s,
11924
11948
  r
11925
- ), { viewer: y, isInitialized: S, initError: E } = Ou(c, p), x = ku(y, S, i), w = Fu(y);
11926
- zu(y, E, e);
11927
- const b = y ? es(y.getCamera()) : null, _ = y ? ur(y.getControls()) : null, A = y ? Xo(y.getRenderer()) : null, P = Rt(() => {
11949
+ ), { viewer: y, isInitialized: b, initError: T } = Du(c, p), x = Fu(y, b, i), w = zu(y);
11950
+ Bu(y, T, e);
11951
+ const S = y ? es(y.getCamera()) : null, _ = y ? ur(y.getControls()) : null, A = y ? Xo(y.getRenderer()) : null, P = Rt(() => {
11928
11952
  y == null || y.requestRender();
11929
11953
  }, [y]), I = ((D = e.helpers) == null ? void 0 : D.gizmo) !== void 0 && e.helpers.gizmo !== !1, M = typeof ((H = e.helpers) == null ? void 0 : H.gizmo) == "object" ? e.helpers.gizmo : {}, O = Dt(
11930
- () => Ld(e.loadingIndicator),
11954
+ () => Od(e.loadingIndicator),
11931
11955
  [e.loadingIndicator]
11932
- ), C = x.status === "error" || !!E, N = O.enabled && (x.status === "loading" || C);
11956
+ ), C = x.status === "error" || !!T, N = O.enabled && (x.status === "loading" || C);
11933
11957
  return Xa(a, () => ({
11934
11958
  scene: y ? ji(y.getScene()) : null,
11935
- camera: b,
11959
+ camera: S,
11936
11960
  renderer: A,
11937
11961
  controls: _,
11938
11962
  events: w,
@@ -11973,12 +11997,12 @@ const Fs = () => new Z("Viewer is not ready yet", Y.COMPONENT_NOT_MOUNTED), da =
11973
11997
  dispose: () => {
11974
11998
  y == null || y.dispose();
11975
11999
  }
11976
- }), [y, b, A, _, w]), /* @__PURE__ */ Te(vd, { children: /* @__PURE__ */ Te(Bu, { viewer: y, canvasRef: c, children: /* @__PURE__ */ Hn("div", { style: { position: "relative", width: "100%", height: "100%" }, children: [
11977
- /* @__PURE__ */ Te(Uu, {}),
11978
- I && S && b && _ && /* @__PURE__ */ Te(
11979
- Ad,
12000
+ }), [y, S, A, _, w]), /* @__PURE__ */ Te(Rd, { children: /* @__PURE__ */ Te(Uu, { viewer: y, canvasRef: c, children: /* @__PURE__ */ Hn("div", { style: { position: "relative", width: "100%", height: "100%" }, children: [
12001
+ /* @__PURE__ */ Te(Hu, {}),
12002
+ I && b && S && _ && /* @__PURE__ */ Te(
12003
+ vd,
11980
12004
  {
11981
- camera: b,
12005
+ camera: S,
11982
12006
  controls: _,
11983
12007
  render: P,
11984
12008
  placement: M.placement,
@@ -11986,27 +12010,27 @@ const Fs = () => new Z("Viewer is not ready yet", Y.COMPONENT_NOT_MOUNTED), da =
11986
12010
  }
11987
12011
  ),
11988
12012
  N && /* @__PURE__ */ Te(
11989
- Rd,
12013
+ Md,
11990
12014
  {
11991
12015
  status: C ? "error" : "loading",
11992
- label: C ? O.errorLabel ?? (E == null ? void 0 : E.message) ?? x.error ?? "Failed to load model" : O.label,
12016
+ label: C ? O.errorLabel ?? (T == null ? void 0 : T.message) ?? x.error ?? "Failed to load model" : O.label,
11993
12017
  color: O.color,
11994
12018
  backdrop: O.backdrop
11995
12019
  }
11996
12020
  ),
11997
12021
  h && /* The defaults ARE the studio look (pinned by presets.test.ts),
11998
12022
  so with no preset set the studio chip is the honest active one. */
11999
- /* @__PURE__ */ Te(Pd, { active: d ?? "studio", onSelect: f }),
12023
+ /* @__PURE__ */ Te(Ld, { active: d ?? "studio", onSelect: f }),
12000
12024
  o
12001
12025
  ] }) }) });
12002
12026
  }
12003
12027
  );
12004
12028
  da.displayName = "SimpleViewer";
12005
- const Od = yo(
12029
+ const Dd = yo(
12006
12030
  (i, e) => /* @__PURE__ */ Te(da, { ref: e, ...i })
12007
12031
  );
12008
- Od.displayName = "SimpleViewer";
12009
- const Dd = () => /* @__PURE__ */ Te(
12032
+ Dd.displayName = "SimpleViewer";
12033
+ const Nd = () => /* @__PURE__ */ Te(
12010
12034
  "span",
12011
12035
  {
12012
12036
  "aria-hidden": "true",
@@ -12021,7 +12045,7 @@ const Dd = () => /* @__PURE__ */ Te(
12021
12045
  }
12022
12046
  }
12023
12047
  );
12024
- function Hd({ position: i, occlude: e = !1, children: t }) {
12048
+ function jd({ position: i, occlude: e = !1, children: t }) {
12025
12049
  const { viewer: n } = oa(), s = Ge(null), [r, o, a] = i;
12026
12050
  ht(() => {
12027
12051
  if (!n)
@@ -12033,25 +12057,25 @@ function Hd({ position: i, occlude: e = !1, children: t }) {
12033
12057
  if (!d)
12034
12058
  return;
12035
12059
  const h = { x: r, y: o, z: a }, f = () => {
12036
- const E = d.project(h, e);
12037
- if (E) {
12038
- if (!E.visible) {
12060
+ const T = d.project(h, e);
12061
+ if (T) {
12062
+ if (!T.visible) {
12039
12063
  u.style.visibility = "hidden";
12040
12064
  return;
12041
12065
  }
12042
- u.style.visibility = "visible", u.style.left = `${E.left}px`, u.style.top = `${E.top}px`;
12066
+ u.style.visibility = "visible", u.style.left = `${T.left}px`, u.style.top = `${T.top}px`;
12043
12067
  }
12044
12068
  }, p = () => {
12045
12069
  d.invalidate(), f();
12046
12070
  };
12047
12071
  f();
12048
- const y = n.getEvents(), S = [
12072
+ const y = n.getEvents(), b = [
12049
12073
  y.on("render:complete", f),
12050
12074
  y.on("controls:change", f),
12051
12075
  y.on("model:loaded", p)
12052
12076
  ];
12053
12077
  return window.addEventListener("resize", p), () => {
12054
- S.forEach((E) => E()), window.removeEventListener("resize", p);
12078
+ b.forEach((T) => T()), window.removeEventListener("resize", p);
12055
12079
  };
12056
12080
  }, [n, r, o, a, e]);
12057
12081
  const c = t != null && t !== !1;
@@ -12072,7 +12096,7 @@ function Hd({ position: i, occlude: e = !1, children: t }) {
12072
12096
  // interactive custom children keep receiving pointer events.
12073
12097
  pointerEvents: c ? "auto" : "none"
12074
12098
  },
12075
- children: c ? t : /* @__PURE__ */ Te(Dd, {})
12099
+ children: c ? t : /* @__PURE__ */ Te(Nd, {})
12076
12100
  }
12077
12101
  );
12078
12102
  }
@@ -12081,9 +12105,9 @@ export {
12081
12105
  Qe as C,
12082
12106
  Ir as D,
12083
12107
  Y as E,
12084
- Hd as H,
12108
+ jd as H,
12085
12109
  De as I,
12086
- zd as L,
12110
+ Bd as L,
12087
12111
  Ws as M,
12088
12112
  $e as O,
12089
12113
  k as R,
@@ -12091,14 +12115,14 @@ export {
12091
12115
  nr as T,
12092
12116
  sa as V,
12093
12117
  ar as a,
12094
- Bd as b,
12118
+ Ud as b,
12095
12119
  Bc as c,
12096
12120
  Yo as d,
12097
12121
  Z as e,
12098
12122
  Ks as f,
12099
12123
  Jc as g,
12100
12124
  Oc as h,
12101
- Od as i,
12125
+ Dd as i,
12102
12126
  Zi as j,
12103
- Pu as r
12127
+ Lu as r
12104
12128
  };