@tomorrowevening/hermes 0.1.36 → 0.1.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/hermes.es.js CHANGED
@@ -1,19 +1,19 @@
1
1
  import { types as P, getProject as Es } from "@tomorrowevening/theatre-core";
2
- import { useState as L, useEffect as pe, useRef as z, useMemo as Ze, Component as Qe, createRef as ue, forwardRef as Bi } from "react";
3
- import { BufferGeometry as Vi, Float32BufferAttribute as ke, OrthographicCamera as Gi, Texture as Gt, Scene as Ss, MeshBasicMaterial as Os, Mesh as $i, LinearSRGBColorSpace as Ke, ObjectLoader as ws, AnimationMixer as xs, AnimationClip as Ts, Matrix4 as Wi, AlwaysStencilFunc as si, ReplaceStencilOp as Ee, NotEqualStencilFunc as ni, EqualStencilFunc as ri, KeepStencilOp as Se, NormalBlending as Yi, AddEquation as Je, SrcAlphaFactor as gt, OneMinusSrcAlphaFactor as vt, CustomBlending as _t, OneFactor as yt, DstColorFactor as Xt, OneMinusDstColorFactor as Qt, WebGLRenderTarget as Ms, RGBAFormat as As, EventDispatcher as Zi, RepeatWrapping as ai, Color as et, FrontSide as Rs, BackSide as Ps, DoubleSide as qi, ZeroFactor as ji, SrcColorFactor as Ki, OneMinusSrcColorFactor as Xi, DstAlphaFactor as Qi, OneMinusDstAlphaFactor as Ji, SrcAlphaSaturateFactor as Ds, ConstantColorFactor as es, OneMinusConstantColorFactor as ts, ConstantAlphaFactor as is, OneMinusConstantAlphaFactor as ss, SubtractEquation as Is, ReverseSubtractEquation as Us, MinEquation as Ls, MaxEquation as ks, NoBlending as Ns, AdditiveBlending as Fs, SubtractiveBlending as zs, MultiplyBlending as Hs, ShaderMaterial as ns, GLSL3 as Bs, PlaneGeometry as Vs, Object3D as Gs, Vector3 as Le, Raycaster as $s, Vector2 as Ws, WebGLRenderer as qe, Euler as Ys, SkeletonHelper as Zs, SRGBColorSpace as oi, NoToneMapping as li, ColorManagement as tt, NoColorSpace as qs, LinearToneMapping as js, ReinhardToneMapping as Ks, CineonToneMapping as Xs, ACESFilmicToneMapping as Qs, AgXToneMapping as Js, NeutralToneMapping as en, CustomToneMapping as tn } from "three";
4
- import { Color as dt, ColorManagement as St, WebGPURenderer as Ge, RenderTarget as sn, WebGLRenderTarget as nn, ComputeNode as rn, NodeMaterial as an, DoubleSide as on, Mesh as ut, PlaneGeometry as ln, BoxGeometry as cn, Vector2 as $e, Object3D as ci, CatmullRomCurve3 as hi, MeshBasicMaterial as $t, LineBasicMaterial as hn, Line as dn, BufferGeometry as di, SphereGeometry as un, Raycaster as Wt, Vector3 as ee, Group as pn, AxesHelper as mn, Scene as fn, Sphere as gn, Box3 as vn, Spherical as _n, Matrix4 as yn, Quaternion as Cn, Vector4 as bn, MeshNormalNodeMaterial as En, PerspectiveCamera as ui, OrthographicCamera as pi, CameraHelper as Sn, SkinnedMesh as On, SpotLightHelper as wn, PointLightHelper as xn, HemisphereLightHelper as Tn, DirectionalLightHelper as Mn } from "three/webgpu";
5
- import { jsx as f, jsxs as M, Fragment as q } from "react/jsx-runtime";
6
- import { radToDeg as An, degToRad as Yt, lerp as Ot, mapLinear as Oe } from "three/src/math/MathUtils.js";
2
+ import { useState as L, useEffect as pe, useRef as z, useMemo as Ze, Component as Xe, createRef as ue, forwardRef as Bi } from "react";
3
+ import { BufferGeometry as Vi, Float32BufferAttribute as ke, OrthographicCamera as Gi, Texture as Vt, Scene as Ss, MeshBasicMaterial as Os, Mesh as $i, LinearSRGBColorSpace as je, ObjectLoader as ws, AnimationMixer as xs, AnimationClip as Ts, Matrix4 as Wi, AlwaysStencilFunc as ii, ReplaceStencilOp as Ee, NotEqualStencilFunc as si, EqualStencilFunc as ni, KeepStencilOp as Se, NormalBlending as Yi, AddEquation as Qe, SrcAlphaFactor as ft, OneMinusSrcAlphaFactor as gt, CustomBlending as vt, OneFactor as _t, DstColorFactor as Kt, OneMinusDstColorFactor as Xt, WebGLRenderTarget as Ms, RGBAFormat as As, EventDispatcher as Zi, RepeatWrapping as ri, Color as Je, FrontSide as Rs, BackSide as Ps, DoubleSide as qi, ZeroFactor as ji, SrcColorFactor as Ki, OneMinusSrcColorFactor as Xi, DstAlphaFactor as Qi, OneMinusDstAlphaFactor as Ji, SrcAlphaSaturateFactor as Ds, ConstantColorFactor as es, OneMinusConstantColorFactor as ts, ConstantAlphaFactor as is, OneMinusConstantAlphaFactor as ss, SubtractEquation as Is, ReverseSubtractEquation as Us, MinEquation as Ls, MaxEquation as ks, NoBlending as Ns, AdditiveBlending as Fs, SubtractiveBlending as zs, MultiplyBlending as Hs, ShaderMaterial as ns, GLSL3 as Bs, PlaneGeometry as Vs, Object3D as Gs, Vector3 as Le, Raycaster as $s, Vector2 as Ws, WebGLRenderer as ai, Euler as Ys, SkeletonHelper as Zs, SRGBColorSpace as oi, NoToneMapping as li, ColorManagement as et, NoColorSpace as qs, LinearToneMapping as js, ReinhardToneMapping as Ks, CineonToneMapping as Xs, ACESFilmicToneMapping as Qs, AgXToneMapping as Js, NeutralToneMapping as en, CustomToneMapping as tn } from "three";
4
+ import { Color as ht, ColorManagement as Et, WebGPURenderer as Ge, RenderTarget as sn, WebGLRenderTarget as nn, ComputeNode as rn, NodeMaterial as an, DoubleSide as on, Mesh as dt, PlaneGeometry as ln, BoxGeometry as cn, Vector2 as $e, Object3D as ci, CatmullRomCurve3 as hi, MeshBasicMaterial as Gt, LineBasicMaterial as hn, Line as dn, BufferGeometry as di, SphereGeometry as un, Raycaster as $t, Vector3 as ee, Group as pn, AxesHelper as mn, Scene as fn, Sphere as gn, Box3 as vn, Spherical as _n, Matrix4 as yn, Quaternion as Cn, Vector4 as bn, MeshNormalNodeMaterial as En, PerspectiveCamera as ui, OrthographicCamera as pi, CameraHelper as Sn, SkinnedMesh as On, SpotLightHelper as wn, PointLightHelper as xn, HemisphereLightHelper as Tn, DirectionalLightHelper as Mn } from "three/webgpu";
5
+ import { jsx as f, jsxs as M, Fragment as Y } from "react/jsx-runtime";
6
+ import { radToDeg as An, degToRad as Wt, lerp as St, mapLinear as Oe } from "three/src/math/MathUtils.js";
7
7
  import { RectAreaLightHelper as Rn } from "three/examples/jsm/helpers/RectAreaLightHelper.js";
8
8
  import { OrbitControls as Pn } from "three/examples/jsm/controls/OrbitControls.js";
9
- import { uniform as we, varyingProperty as Dn, Fn as wt, positionLocal as In, vec3 as Un, cameraPosition as it, float as Y, fwidth as Ln, abs as mi, fract as kn, min as xt, max as fi, distance as Nn, log as gi, pow as vi, floor as Fn, mix as _i, If as zn, lessThanEqual as Hn, Discard as Bn, vec4 as Vn } from "three/tsl";
9
+ import { uniform as we, varyingProperty as Dn, Fn as Ot, positionLocal as In, vec3 as Un, cameraPosition as tt, float as Z, fwidth as Ln, abs as mi, fract as kn, min as wt, max as fi, distance as Nn, log as gi, pow as vi, floor as Fn, mix as _i, If as zn, lessThanEqual as Hn, Discard as Bn, vec4 as Vn } from "three/tsl";
10
10
  import rs from "three/src/materials/nodes/MeshBasicNodeMaterial.js";
11
11
  import { remapClamp as Gn, linearDepth as $n, vec4 as as, uv as Wn } from "three/src/nodes/TSL.js";
12
12
  import { TransformControls as Yn } from "three/examples/jsm/controls/TransformControls.js";
13
- const pt = () => {
14
- }, Na = () => {
13
+ const ut = () => {
14
+ }, ka = () => {
15
15
  };
16
- function mt(i) {
16
+ function pt(i) {
17
17
  return i.substring(0, 1).toUpperCase() + i.substring(1);
18
18
  }
19
19
  function Zn(i) {
@@ -33,7 +33,7 @@ function yi(i) {
33
33
  }, r = n(e), a = n(t), o = n(s);
34
34
  return "#" + r + a + o;
35
35
  }
36
- function Tt(i, e, t, s) {
36
+ function xt(i, e, t, s) {
37
37
  return new (t || (t = Promise))(function(n, r) {
38
38
  function a(l) {
39
39
  try {
@@ -105,7 +105,7 @@ class bi extends Error {
105
105
  super(e), Object.setPrototypeOf(this, new.target.prototype);
106
106
  }
107
107
  }
108
- const Mt = [], Ei = [];
108
+ const Tt = [], Ei = [];
109
109
  function Xn(i, e) {
110
110
  if (i === e) return 0;
111
111
  const t = i;
@@ -116,17 +116,17 @@ function Xn(i, e) {
116
116
  for (; a < s && i.charCodeAt(a) === e.charCodeAt(a); ) a++;
117
117
  if (s -= a, n -= a, s === 0) return n;
118
118
  let o, c, l = 0, h = 0, d = 0;
119
- for (; h < s; ) Ei[h] = i.charCodeAt(a + h), Mt[h] = ++h;
120
- for (; d < n; ) for (r = e.charCodeAt(a + d), o = d++, l = d, h = 0; h < s; h++) c = r === Ei[h] ? o : o + 1, o = Mt[h], l = Mt[h] = o > l ? c > l ? l + 1 : c : c > o ? o + 1 : c;
119
+ for (; h < s; ) Ei[h] = i.charCodeAt(a + h), Tt[h] = ++h;
120
+ for (; d < n; ) for (r = e.charCodeAt(a + d), o = d++, l = d, h = 0; h < s; h++) c = r === Ei[h] ? o : o + 1, o = Tt[h], l = Tt[h] = o > l ? c > l ? l + 1 : c : c > o ? o + 1 : c;
121
121
  return l;
122
122
  }
123
123
  function Qn(i) {
124
124
  return i != null;
125
125
  }
126
- const Jn = ({ mobileTiers: i = [0, 15, 30, 60], desktopTiers: e = [0, 15, 30, 60], override: t = {}, glContext: s, failIfMajorPerformanceCaveat: n = !1, benchmarksURL: r = "https://unpkg.com/detect-gpu@5.0.70/dist/benchmarks" } = {}) => Tt(void 0, void 0, void 0, function* () {
126
+ const Jn = ({ mobileTiers: i = [0, 15, 30, 60], desktopTiers: e = [0, 15, 30, 60], override: t = {}, glContext: s, failIfMajorPerformanceCaveat: n = !1, benchmarksURL: r = "https://unpkg.com/detect-gpu@5.0.70/dist/benchmarks" } = {}) => xt(void 0, void 0, void 0, function* () {
127
127
  const a = {};
128
128
  if (os) return { tier: 0, type: "SSR" };
129
- const { isIpad: o = !!re?.isIpad, isMobile: c = !!re?.isMobile, screenSize: l = window.screen, loadBenchmarks: h = (b) => Tt(void 0, void 0, void 0, function* () {
129
+ const { isIpad: o = !!re?.isIpad, isMobile: c = !!re?.isMobile, screenSize: l = window.screen, loadBenchmarks: h = (b) => xt(void 0, void 0, void 0, function* () {
130
130
  const O = yield fetch(`${r}/${b}`).then((w) => w.json());
131
131
  if (parseInt(O.shift().split(".")[0], 10) < 4) throw new bi("Detect GPU benchmark data is out of date. Please update to version 4x");
132
132
  return O;
@@ -151,7 +151,7 @@ const Jn = ({ mobileTiers: i = [0, 15, 30, 60], desktopTiers: e = [0, 15, 30, 60
151
151
  }
152
152
  const v = (yield Promise.all(m.map(function(b) {
153
153
  var O;
154
- return Tt(this, void 0, void 0, function* () {
154
+ return xt(this, void 0, void 0, function* () {
155
155
  const w = ((B) => {
156
156
  const j = c ? ["adreno", "apple", "mali-t", "mali", "nvidia", "powervr", "samsung"] : ["intel", "apple", "amd", "radeon", "nvidia", "geforce", "adreno"];
157
157
  for (const le of j) if (B.includes(le)) return le;
@@ -175,15 +175,15 @@ const Jn = ({ mobileTiers: i = [0, 15, 30, 60], desktopTiers: e = [0, 15, 30, 60
175
175
  const me = oe.length;
176
176
  if (me === 0) return;
177
177
  const be = b.split(/[.,()\[\]/\s]/g).sort().filter((B, j, le) => j === 0 || B !== le[j - 1]).join(" ");
178
- let fe, [gs, , , , vs] = me > 1 ? oe.map((B) => [B, Xn(be, B[2])]).sort(([, B], [, j]) => B - j)[0][0] : oe[0], Et = Number.MAX_VALUE;
179
- const { devicePixelRatio: ti } = window, _s = l.width * ti * l.height * ti;
178
+ let fe, [gs, , , , vs] = me > 1 ? oe.map((B) => [B, Xn(be, B[2])]).sort(([, B], [, j]) => B - j)[0][0] : oe[0], bt = Number.MAX_VALUE;
179
+ const { devicePixelRatio: ei } = window, _s = l.width * ei * l.height * ei;
180
180
  for (const B of vs) {
181
- const [j, le] = B, bs = j * le, ii = Math.abs(_s - bs);
182
- ii < Et && (Et = ii, fe = B);
181
+ const [j, le] = B, bs = j * le, ti = Math.abs(_s - bs);
182
+ ti < bt && (bt = ti, fe = B);
183
183
  }
184
184
  if (!fe) return;
185
185
  const [, , ys, Cs] = fe;
186
- return [Et, ys, gs, Cs];
186
+ return [bt, ys, gs, Cs];
187
187
  });
188
188
  }))).filter(Qn).sort(([b = Number.MAX_VALUE, O], [w = Number.MAX_VALUE, D]) => b === w ? O - D : b - w);
189
189
  if (!v.length) {
@@ -254,7 +254,7 @@ self.onmessage = async ({ data }) => {
254
254
  };
255
255
  `
256
256
  );
257
- class Fa {
257
+ class Na {
258
258
  worker;
259
259
  source;
260
260
  /** Intermediate 2D canvas used for GPU→CPU readback. Works with WebGPU and WebGL. */
@@ -386,26 +386,26 @@ class Fa {
386
386
  function ye(i, e, t) {
387
387
  return Math.min(e, Math.max(i, t));
388
388
  }
389
- function Zt(i, e, t) {
389
+ function Yt(i, e, t) {
390
390
  return (t - i) / (e - i);
391
391
  }
392
- function Xe(i, e, t) {
392
+ function Ke(i, e, t) {
393
393
  return i * (1 - t) + e * t;
394
394
  }
395
- function za(i, e, t, s, n) {
396
- return Xe(t, s, Zt(i, e, n));
395
+ function Fa(i, e, t, s, n) {
396
+ return Ke(t, s, Yt(i, e, n));
397
397
  }
398
- function Ha(i, e) {
398
+ function za(i, e) {
399
399
  const t = i - e;
400
400
  return Math.sqrt(t * t);
401
401
  }
402
- function Ba(i, e, t, s) {
403
- return Xe(i, e, 1 - Math.exp(-t * s));
402
+ function Ha(i, e, t, s) {
403
+ return Ke(i, e, 1 - Math.exp(-t * s));
404
404
  }
405
405
  function te(i, e = 1) {
406
406
  return Number(i.toFixed(e));
407
407
  }
408
- function Va(i, e, t, s) {
408
+ function Ba(i, e, t, s) {
409
409
  return Math.atan2(s - e, t - i);
410
410
  }
411
411
  function sr(i, e, t, s) {
@@ -421,7 +421,7 @@ function ar(i, e, t, s, n) {
421
421
  const r = i * i;
422
422
  return e * (r * i) + t * r + s * i + n;
423
423
  }
424
- function Ga(i, e, t, s, n) {
424
+ function Va(i, e, t, s, n) {
425
425
  if (i <= 0) return 0;
426
426
  if (i >= 1) return 1;
427
427
  if (sr(e, t, s, n)) return i;
@@ -434,13 +434,13 @@ function Ga(i, e, t, s, n) {
434
434
  }
435
435
  return ar(b, g, _, E, S);
436
436
  }
437
- const st = (i) => Math.round(Math.min(1, Math.max(0, i)) * 255).toString(16).padStart(2, "0");
438
- function $a({ r: i, g: e, b: t, a: s = 1 }) {
439
- const n = `#${st(i)}${st(e)}${st(t)}`;
440
- return s < 1 ? `${n}${st(s)}` : n;
437
+ const it = (i) => Math.round(Math.min(1, Math.max(0, i)) * 255).toString(16).padStart(2, "0");
438
+ function Ga({ r: i, g: e, b: t, a: s = 1 }) {
439
+ const n = `#${it(i)}${it(e)}${it(t)}`;
440
+ return s < 1 ? `${n}${it(s)}` : n;
441
441
  }
442
442
  let xe;
443
- function Wa() {
443
+ function $a() {
444
444
  const [i, e] = L(xe);
445
445
  return pe(() => {
446
446
  xe || import("@tomorrowevening/theatre-studio").then((t) => {
@@ -448,7 +448,7 @@ function Wa() {
448
448
  });
449
449
  }, []), i;
450
450
  }
451
- async function Ya() {
451
+ async function Wa() {
452
452
  for (; !document.getElementById("theatrejs-studio-root"); )
453
453
  await new Promise((s) => setTimeout(s, 100));
454
454
  const i = document.getElementById("theatrejs-studio-root");
@@ -469,7 +469,7 @@ async function Ya() {
469
469
  }
470
470
  }
471
471
  }
472
- function Za(i, e, t, s) {
472
+ function Ya(i, e, t, s) {
473
473
  s.sheetObject(i, e, {
474
474
  transform: {
475
475
  position: {
@@ -735,7 +735,7 @@ function hr(i, e, t) {
735
735
  }
736
736
  });
737
737
  }
738
- function qa(i, e, t, s) {
738
+ function Za(i, e, t, s) {
739
739
  if (!t.isMaterial) return;
740
740
  const n = lr(t), r = cr(n);
741
741
  s.sheetObject(i, e, {
@@ -744,11 +744,11 @@ function qa(i, e, t, s) {
744
744
  hr(t, n, a);
745
745
  });
746
746
  }
747
- const Jt = new Vi();
748
- Jt.setAttribute("position", new ke([-0.5, -0.5, 0, 1.5, -0.5, 0, -0.5, 1.5, 0], 3));
749
- Jt.setAttribute("normal", new ke([0, 0, 1, 0, 0, 1], 3));
750
- Jt.setAttribute("uv", new ke([0, 0, 2, 0, 0, 2], 2));
751
- const ja = new Gi(-0.5, 0.5, 0.5, -0.5, 0, 100), Oi = (i) => {
747
+ const Qt = new Vi();
748
+ Qt.setAttribute("position", new ke([-0.5, -0.5, 0, 1.5, -0.5, 0, -0.5, 1.5, 0], 3));
749
+ Qt.setAttribute("normal", new ke([0, 0, 1, 0, 0, 1], 3));
750
+ Qt.setAttribute("uv", new ke([0, 0, 2, 0, 0, 2], 2));
751
+ const qa = new Gi(-0.5, 0.5, 0.5, -0.5, 0, 100), Oi = (i) => {
752
752
  i?.dispose();
753
753
  }, ls = (i) => {
754
754
  if (i)
@@ -757,13 +757,13 @@ const ja = new Gi(-0.5, 0.5, 0.5, -0.5, 0, 100), Oi = (i) => {
757
757
  else {
758
758
  for (const e in i) {
759
759
  const t = i[e];
760
- t !== null && t instanceof Gt && Oi(t);
760
+ t !== null && t instanceof Vt && Oi(t);
761
761
  }
762
762
  if (i.isShaderMaterial === !0) {
763
763
  const e = i;
764
764
  for (const t in e.uniforms) {
765
765
  const s = e.uniforms[t];
766
- s.value !== null && s.value instanceof Gt && Oi(s.value);
766
+ s.value !== null && s.value instanceof Vt && Oi(s.value);
767
767
  }
768
768
  }
769
769
  i.dispose();
@@ -781,13 +781,13 @@ const ja = new Gi(-0.5, 0.5, 0.5, -0.5, 0, 100), Oi = (i) => {
781
781
  i.dispose !== void 0 && i.dispose();
782
782
  }
783
783
  };
784
- let qt = 0;
785
- const nt = () => {
786
- qt = 0;
784
+ let Zt = 0;
785
+ const st = () => {
786
+ Zt = 0;
787
787
  }, We = (i) => {
788
788
  if (!i) return;
789
789
  let e = i.name.replaceAll(" ", "").replaceAll("/", ".");
790
- if (e.length === 0 && (e = `obj_${qt}`, qt++), i.parent !== null && i.parent.uuid.length > 0 && (e = `${i.parent.uuid}.${e}`), i.uuid = e, i.isMesh !== void 0) {
790
+ if (e.length === 0 && (e = `obj_${Zt}`, Zt++), i.parent !== null && i.parent.uuid.length > 0 && (e = `${i.parent.uuid}.${e}`), i.uuid = e, i.isMesh !== void 0) {
791
791
  const t = i;
792
792
  if (Array.isArray(t.material))
793
793
  t.material.forEach((s, n) => {
@@ -839,12 +839,12 @@ class ce {
839
839
  this.material.map = e, this.renderer.render(this.scene, this.camera);
840
840
  else {
841
841
  const t = this.renderer.outputColorSpace, s = e.colorSpace;
842
- this.renderer.outputColorSpace = Ke, e.colorSpace = Ke, this.material.map = e, this.renderer.render(this.scene, this.camera), this.renderer.outputColorSpace = t, e.colorSpace = s;
842
+ this.renderer.outputColorSpace = je, e.colorSpace = je, this.material.map = e, this.renderer.render(this.scene, this.camera), this.renderer.outputColorSpace = t, e.colorSpace = s;
843
843
  }
844
844
  return this.renderer.domElement;
845
845
  }
846
846
  }
847
- function Ka(i) {
847
+ function ja(i) {
848
848
  return new Promise((e) => {
849
849
  const t = new ws();
850
850
  t.parseAsync(i.scene).then((s) => {
@@ -866,26 +866,26 @@ function Ka(i) {
866
866
  });
867
867
  });
868
868
  }
869
- const Xa = (i, e, t, s) => {
869
+ const Ka = (i, e, t, s) => {
870
870
  i.setRenderTarget(s), i.clear(), i.render(e, t);
871
871
  };
872
872
  function dr(i, e, t, s) {
873
873
  i.applyMatrix4(new Wi().makeTranslation(e, -t, -s));
874
874
  }
875
- function Qa(i) {
875
+ function Xa(i) {
876
876
  i.computeBoundingBox();
877
877
  const e = i.boundingBox, t = (e.max.x - e.min.x) / 2, s = (e.max.y - e.min.y) / 2;
878
878
  dr(i, t, s, 0);
879
879
  }
880
- function Ja(i, e, t) {
880
+ function Qa(i, e, t) {
881
881
  i.left = e / -2, i.right = e / 2, i.top = t / 2, i.bottom = t / -2, i.position.x = e / 2, i.position.y = t / -2, i.updateProjectionMatrix();
882
882
  }
883
- function eo(i, e, t) {
883
+ function Ja(i, e, t) {
884
884
  const s = 1.7777777777777777, n = e / t;
885
885
  let r = e, a = t;
886
886
  n > s ? r = t * s : a = e / s, i.left = r / -2, i.right = r / 2, i.top = a / 2, i.bottom = a / -2, i.updateProjectionMatrix();
887
887
  }
888
- function to() {
888
+ function eo() {
889
889
  let e = "transferControlToOffscreen" in document.createElement("canvas");
890
890
  if (/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {
891
891
  const s = navigator.userAgent.match(/version\/(\d+)/i);
@@ -893,32 +893,32 @@ function to() {
893
893
  }
894
894
  return e;
895
895
  }
896
- function io(i, e, t = !0, s = !1) {
896
+ function to(i, e, t = !0, s = !1) {
897
897
  i.renderOrder = -e;
898
898
  const n = i.material;
899
899
  Array.isArray(n) ? n.forEach((r) => {
900
- r.colorWrite = t, r.depthWrite = s, r.stencilWrite = !0, r.stencilRef = e, r.stencilFunc = si, r.stencilFail = Ee, r.stencilZFail = Ee, r.stencilZPass = Ee;
901
- }) : (n.colorWrite = t, n.depthWrite = s, n.stencilWrite = !0, n.stencilRef = e, n.stencilFunc = si, n.stencilFail = Ee, n.stencilZFail = Ee, n.stencilZPass = Ee);
900
+ r.colorWrite = t, r.depthWrite = s, r.stencilWrite = !0, r.stencilRef = e, r.stencilFunc = ii, r.stencilFail = Ee, r.stencilZFail = Ee, r.stencilZPass = Ee;
901
+ }) : (n.colorWrite = t, n.depthWrite = s, n.stencilWrite = !0, n.stencilRef = e, n.stencilFunc = ii, n.stencilFail = Ee, n.stencilZFail = Ee, n.stencilZPass = Ee);
902
902
  }
903
- function so(i, e, t = !1) {
903
+ function io(i, e, t = !1) {
904
904
  const s = i.material;
905
905
  Array.isArray(s) ? s.forEach((n) => {
906
- n.stencilWrite = !0, n.stencilRef = e, n.stencilFunc = t ? ni : ri, n.stencilFail = Se, n.stencilZFail = Se, n.stencilZPass = Se;
907
- }) : (s.stencilWrite = !0, s.stencilRef = e, s.stencilFunc = t ? ni : ri, s.stencilFail = Se, s.stencilZFail = Se, s.stencilZPass = Se);
906
+ n.stencilWrite = !0, n.stencilRef = e, n.stencilFunc = t ? si : ni, n.stencilFail = Se, n.stencilZFail = Se, n.stencilZPass = Se;
907
+ }) : (s.stencilWrite = !0, s.stencilRef = e, s.stencilFunc = t ? si : ni, s.stencilFail = Se, s.stencilZFail = Se, s.stencilZPass = Se);
908
+ }
909
+ function so(i) {
910
+ i.blending = Yi, i.blendEquation = Qe, i.blendSrc = ft, i.blendDst = gt, i.needsUpdate = !0;
908
911
  }
909
912
  function no(i) {
910
- i.blending = Yi, i.blendEquation = Je, i.blendSrc = gt, i.blendDst = vt, i.needsUpdate = !0;
913
+ i.blending = vt, i.blendEquation = Qe, i.blendSrc = ft, i.blendDst = _t, i.needsUpdate = !0;
911
914
  }
912
915
  function ro(i) {
913
- i.blending = _t, i.blendEquation = Je, i.blendSrc = gt, i.blendDst = yt, i.needsUpdate = !0;
916
+ i.blending = vt, i.blendEquation = Qe, i.blendSrc = Kt, i.blendDst = gt, i.needsUpdate = !0;
914
917
  }
915
918
  function ao(i) {
916
- i.blending = _t, i.blendEquation = Je, i.blendSrc = Xt, i.blendDst = vt, i.needsUpdate = !0;
917
- }
918
- function oo(i) {
919
- i.blending = _t, i.blendEquation = Je, i.blendSrc = Qt, i.blendDst = yt, i.needsUpdate = !0;
919
+ i.blending = vt, i.blendEquation = Qe, i.blendSrc = Xt, i.blendDst = _t, i.needsUpdate = !0;
920
920
  }
921
- let jt = [];
921
+ let qt = [];
922
922
  function ur(i, e, t = !0) {
923
923
  ce.renderer = e.renderer;
924
924
  const s = [];
@@ -1042,19 +1042,19 @@ function ur(i, e, t = !0) {
1042
1042
  onUpdate: (a, o) => {
1043
1043
  a === "Enabled" ? i.enabled = o : n(a, o);
1044
1044
  }
1045
- }), jt.push(r);
1045
+ }), qt.push(r);
1046
1046
  }
1047
- function lo(i, e) {
1047
+ function oo(i, e) {
1048
1048
  i.passes.forEach((t) => {
1049
1049
  ur(t, e);
1050
1050
  });
1051
1051
  }
1052
- function co(i) {
1053
- jt.forEach((e) => {
1052
+ function lo(i) {
1053
+ qt.forEach((e) => {
1054
1054
  i.removeGroup(e);
1055
- }), jt = [];
1055
+ }), qt = [];
1056
1056
  }
1057
- function ho(i, e, t, s = 1024) {
1057
+ function co(i, e, t, s = 1024) {
1058
1058
  return new Promise((n) => {
1059
1059
  const r = e.aspect, a = e.fov, o = e.rotation.clone(), c = t.outputBuffer;
1060
1060
  e.aspect = 1, e.fov = 90, e.updateProjectionMatrix();
@@ -1116,7 +1116,7 @@ function Te(i, e, t, s, n, r) {
1116
1116
  v.href = y, v.download = `${t.name}_${s}.png`, document.body.appendChild(v), v.click(), v.remove(), a();
1117
1117
  });
1118
1118
  }
1119
- const Me = ei([
1119
+ const Me = Jt([
1120
1120
  "ctrlKey",
1121
1121
  "metaKey",
1122
1122
  "shiftKey",
@@ -1127,13 +1127,13 @@ const Me = ei([
1127
1127
  "clientY",
1128
1128
  "pageX",
1129
1129
  "pageY"
1130
- ]), pr = ei([
1130
+ ]), pr = Jt([
1131
1131
  "clientX",
1132
1132
  "clientY",
1133
1133
  "deltaX",
1134
1134
  "deltaY",
1135
1135
  "deltaMode"
1136
- ]), mr = ei([
1136
+ ]), mr = Jt([
1137
1137
  "ctrlKey",
1138
1138
  "metaKey",
1139
1139
  "shiftKey",
@@ -1149,13 +1149,13 @@ function vr(i, e, t) {
1149
1149
  for (const s of e)
1150
1150
  t[s] = i[s];
1151
1151
  }
1152
- function ei(i) {
1152
+ function Jt(i) {
1153
1153
  return function(t, s) {
1154
1154
  const n = { type: t.type };
1155
1155
  vr(t, i, n), s(n);
1156
1156
  };
1157
1157
  }
1158
- function At(i, e) {
1158
+ function Mt(i, e) {
1159
1159
  const t = [], s = { type: i.type, touches: t };
1160
1160
  for (let n = 0; n < i.touches.length; ++n) {
1161
1161
  const r = i.touches[n];
@@ -1180,7 +1180,7 @@ function yr(i, e) {
1180
1180
  const { keyCode: t } = i;
1181
1181
  _r[t] && (i.preventDefault(), mr(i, e));
1182
1182
  }
1183
- const uo = {
1183
+ const ho = {
1184
1184
  contextmenu: gr,
1185
1185
  mousedown: Me,
1186
1186
  mousemove: Me,
@@ -1188,14 +1188,14 @@ const uo = {
1188
1188
  pointerdown: Me,
1189
1189
  pointermove: Me,
1190
1190
  pointerup: Me,
1191
- touchstart: At,
1192
- touchmove: At,
1193
- touchend: At,
1191
+ touchstart: Mt,
1192
+ touchmove: Mt,
1193
+ touchend: Mt,
1194
1194
  wheel: fr,
1195
1195
  keydown: yr
1196
1196
  };
1197
1197
  let Cr = 0;
1198
- class po {
1198
+ class uo {
1199
1199
  id;
1200
1200
  worker;
1201
1201
  constructor(e, t, s) {
@@ -1273,7 +1273,7 @@ class br extends Zi {
1273
1273
  this.left = e.left, this.top = e.top, this.width = e.width, this.height = e.height;
1274
1274
  return;
1275
1275
  }
1276
- e.preventDefault = pt, e.stopPropagation = pt, this.dispatchEvent(e);
1276
+ e.preventDefault = ut, e.stopPropagation = ut, this.dispatchEvent(e);
1277
1277
  }
1278
1278
  focus() {
1279
1279
  }
@@ -1281,7 +1281,7 @@ class br extends Zi {
1281
1281
  return this;
1282
1282
  }
1283
1283
  }
1284
- class mo {
1284
+ class po {
1285
1285
  targets = {};
1286
1286
  constructor() {
1287
1287
  this.handleEvent = this.handleEvent.bind(this);
@@ -1297,7 +1297,7 @@ class mo {
1297
1297
  this.targets[e.id]?.handleEvent(e.data);
1298
1298
  }
1299
1299
  }
1300
- class fo {
1300
+ class mo {
1301
1301
  assets = {
1302
1302
  audio: /* @__PURE__ */ new Map(),
1303
1303
  image: /* @__PURE__ */ new Map(),
@@ -1416,7 +1416,7 @@ function Sr(i, e, t) {
1416
1416
  e.value
1417
1417
  );
1418
1418
  }
1419
- class go extends cs {
1419
+ class fo extends cs {
1420
1420
  project;
1421
1421
  sheets = /* @__PURE__ */ new Map();
1422
1422
  sheetObjects = /* @__PURE__ */ new Map();
@@ -1490,7 +1490,7 @@ class go extends cs {
1490
1490
  if (a === void 0) return;
1491
1491
  const c = `${this.getSheetInstance(e, r)}_${t}`;
1492
1492
  let l = this.sheetObjects.get(c), h = s;
1493
- l !== void 0 && (h = { ...s, ...l.value }), l = a.object(t, h, { reconfigure: !0 }), this.sheetObjects.set(c, l), this.sheetObjectCBs.set(c, n !== void 0 ? n : pt);
1493
+ l !== void 0 && (h = { ...s, ...l.value }), l = a.object(t, h, { reconfigure: !0 }), this.sheetObjects.set(c, l), this.sheetObjectCBs.set(c, n !== void 0 ? n : ut);
1494
1494
  function d(m, y, v) {
1495
1495
  if (typeof v == "object")
1496
1496
  if (qn(v))
@@ -1740,7 +1740,7 @@ function Ae(i) {
1740
1740
  }
1741
1741
  return i.anisotropy !== void 0 && (e.anisotropy = i.anisotropy), i.clearcoat !== void 0 && (e.clearcoat = i.clearcoat), i.iridescence !== void 0 && (e.iridescence = i.iridescence), i.dispersion !== void 0 && (e.dispersion = i.dispersion), i.sheen !== void 0 && (e.sheen = i.sheen), i.transmission !== void 0 && (e.transmission = i.transmission), i.transmission !== void 0 && (e.transmission = i.transmission), e;
1742
1742
  }
1743
- function Rt(i) {
1743
+ function At(i) {
1744
1744
  i.updateMatrix();
1745
1745
  const e = {
1746
1746
  name: i.name,
@@ -1890,13 +1890,13 @@ function hs(i) {
1890
1890
  return new Promise((e, t) => {
1891
1891
  const s = new Image();
1892
1892
  s.onload = () => {
1893
- const n = new Gt(s);
1894
- n.wrapS = ai, n.wrapT = ai, n.needsUpdate = !0, e(n);
1893
+ const n = new Vt(s);
1894
+ n.wrapS = ri, n.wrapT = ri, n.needsUpdate = !0, e(n);
1895
1895
  }, s.onerror = t, s.src = i;
1896
1896
  });
1897
1897
  }
1898
1898
  var R = /* @__PURE__ */ ((i) => (i.CUSTOM = "ToolEvents::custom", i.SELECT_DROPDOWN = "ToolEvents::selectDropdown", i.DRAG_UPDATE = "ToolEvents::dragUpdate", i.ADD_SCENE = "ToolEvents::addScene", i.REFRESH_SCENE = "ToolEvents::refreshScene", i.REMOVE_SCENE = "ToolEvents::removeScene", i.SET_SCENE = "ToolEvents::setScene", i.SET_OBJECT = "ToolEvents::setObject", i.CLEAR_OBJECT = "ToolEvents::clearObject", i.ADD_CAMERA = "ToolEvents::addCamera", i.REMOVE_CAMERA = "ToolEvents::removeCamera", i.ADD_GROUP = "ToolEvents::addGroup", i.REMOVE_GROUP = "ToolEvents::removeGroup", i.ADD_SPLINE = "ToolEvents::addSpline", i.ADD_RENDERER = "ToolEvents::addRenderer", i.UPDATE_RENDERER = "ToolEvents::updateRenderer", i))(R || {});
1899
- class vo extends cs {
1899
+ class go extends cs {
1900
1900
  name;
1901
1901
  canvas = null;
1902
1902
  // Canvas or OffscreenCanvas
@@ -1966,7 +1966,7 @@ class vo extends cs {
1966
1966
  }
1967
1967
  setObject(e) {
1968
1968
  this.renderer !== void 0 && (ce.renderer = this.renderer);
1969
- const t = Rt(e);
1969
+ const t = At(e);
1970
1970
  this.dispatchEvent({ type: "ToolEvents::setObject", value: t });
1971
1971
  }
1972
1972
  requestMethod(e, t, s, n) {
@@ -2081,20 +2081,16 @@ class vo extends cs {
2081
2081
  // Renderer
2082
2082
  setRenderer(e, t = null) {
2083
2083
  if (this.renderer = e, this.canvas = e.domElement, this.inputElement = t !== null ? t : this.canvas, !this.debug) return;
2084
- const s = `#${e.getClearColor(new dt()).getHexString()}`;
2084
+ const s = `#${e.getClearColor(new ht()).getHexString()}`;
2085
2085
  this.send({
2086
2086
  event: "addRenderer",
2087
2087
  target: "editor",
2088
2088
  data: {
2089
- autoClear: e.autoClear,
2090
2089
  autoClearColor: e.autoClearColor,
2091
- autoClearDepth: e.autoClearDepth,
2092
- autoClearStencil: e.autoClearStencil,
2093
2090
  outputColorSpace: e.outputColorSpace,
2094
- localClippingEnabled: e.localClippingEnabled,
2095
2091
  clearColor: s,
2096
2092
  clearAlpha: e.getClearAlpha(),
2097
- colorManagement: St.enabled,
2093
+ colorManagement: Et.enabled,
2098
2094
  toneMapping: e.toneMapping,
2099
2095
  toneMappingExposure: e.toneMappingExposure,
2100
2096
  type: e.isWebGLRenderer ? "WebGLRenderer" : "WebGPURenderer"
@@ -2111,7 +2107,7 @@ class vo extends cs {
2111
2107
  // Scenes
2112
2108
  addScene(e) {
2113
2109
  if (e === void 0 || (this.scenes.set(e.name, e), !this.debug)) return;
2114
- nt(), We(e);
2110
+ st(), We(e);
2115
2111
  const t = he(e);
2116
2112
  this.send({
2117
2113
  event: "addScene",
@@ -2151,7 +2147,7 @@ class vo extends cs {
2151
2147
  }
2152
2148
  setScene(e) {
2153
2149
  if (e === void 0 || (this.scene = e, !this.debug)) return;
2154
- this.renderer !== void 0 && (ce.renderer = this.renderer), nt(), We(e);
2150
+ this.renderer !== void 0 && (ce.renderer = this.renderer), st(), We(e);
2155
2151
  const t = he(e);
2156
2152
  this.send({
2157
2153
  event: "setScene",
@@ -2180,7 +2176,7 @@ class vo extends cs {
2180
2176
  // Cameras
2181
2177
  addCamera(e) {
2182
2178
  if (!this.debug) return;
2183
- const t = Rt(e);
2179
+ const t = At(e);
2184
2180
  this.send({
2185
2181
  event: "addCamera",
2186
2182
  target: "editor",
@@ -2189,7 +2185,7 @@ class vo extends cs {
2189
2185
  }
2190
2186
  removeCamera(e) {
2191
2187
  if (!this.debug) return;
2192
- const t = Rt(e);
2188
+ const t = At(e);
2193
2189
  this.send({
2194
2190
  event: "removeCamera",
2195
2191
  target: "editor",
@@ -2206,24 +2202,20 @@ class vo extends cs {
2206
2202
  });
2207
2203
  break;
2208
2204
  case "updateRenderer":
2209
- this.renderer && (this.renderer.autoClearColor = e.data.autoClearColor, this.renderer.outputColorSpace = e.data.outputColorSpace, this.renderer.localClippingEnabled = e.data.localClippingEnabled, this.renderer.setClearColor(e.data.clearColor, e.data.clearAlpha), this.renderer.toneMapping = e.data.toneMapping, this.renderer.toneMappingExposure = e.data.toneMappingExposure, St.enabled = e.data.colorManagement);
2205
+ this.renderer && (this.renderer.autoClearColor = e.data.autoClearColor, this.renderer.outputColorSpace = e.data.outputColorSpace, this.renderer.setClearColor(e.data.clearColor, e.data.clearAlpha), this.renderer.toneMapping = e.data.toneMapping, this.renderer.toneMappingExposure = e.data.toneMappingExposure, Et.enabled = e.data.colorManagement);
2210
2206
  break;
2211
2207
  case "requestRenderer":
2212
2208
  if (this.renderer !== void 0) {
2213
- const t = `#${this.renderer.getClearColor(new dt()).getHexString()}`;
2209
+ const t = `#${this.renderer.getClearColor(new ht()).getHexString()}`;
2214
2210
  this.send({
2215
2211
  event: "addRenderer",
2216
2212
  target: "editor",
2217
2213
  data: {
2218
- autoClear: this.renderer.autoClear,
2219
2214
  autoClearColor: this.renderer.autoClearColor,
2220
- autoClearDepth: this.renderer.autoClearDepth,
2221
- autoClearStencil: this.renderer.autoClearStencil,
2222
2215
  outputColorSpace: this.renderer.outputColorSpace,
2223
- localClippingEnabled: this.renderer.localClippingEnabled,
2224
2216
  clearColor: t,
2225
2217
  clearAlpha: this.renderer.getClearAlpha(),
2226
- colorManagement: St.enabled,
2218
+ colorManagement: Et.enabled,
2227
2219
  toneMapping: this.renderer.toneMapping,
2228
2220
  toneMappingExposure: this.renderer.toneMappingExposure,
2229
2221
  type: this.renderer.isWebGLRenderer ? "WebGLRenderer" : "WebGPURenderer"
@@ -2233,12 +2225,12 @@ class vo extends cs {
2233
2225
  break;
2234
2226
  case "requestScene":
2235
2227
  this.scenes.forEach((t) => {
2236
- nt(), We(t), this.send({
2228
+ st(), We(t), this.send({
2237
2229
  event: "addScene",
2238
2230
  target: "editor",
2239
2231
  data: he(t)
2240
2232
  });
2241
- }), this.scene !== void 0 && (this.renderer !== void 0 && (ce.renderer = this.renderer), nt(), We(this.scene), this.send({
2233
+ }), this.scene !== void 0 && (this.renderer !== void 0 && (ce.renderer = this.renderer), st(), We(this.scene), this.send({
2242
2234
  event: "setScene",
2243
2235
  target: "editor",
2244
2236
  data: he(this.scene)
@@ -2470,7 +2462,7 @@ function Ur(i) {
2470
2462
  }
2471
2463
  return /* @__PURE__ */ f("li", { className: t === e.title ? "selected" : "", children: n }, W());
2472
2464
  }
2473
- function je(i) {
2465
+ function qe(i) {
2474
2466
  const [e, t] = L(i.open !== void 0 ? i.open : !1), [s, n] = L(i.visible !== void 0 ? i.visible : !1), r = !e || i.children === void 0, a = () => {
2475
2467
  i.three.dispatchEvent({ type: R.REMOVE_SCENE, value: i.scene });
2476
2468
  };
@@ -2491,11 +2483,11 @@ function je(i) {
2491
2483
  children: "Toggle"
2492
2484
  }
2493
2485
  ),
2494
- /* @__PURE__ */ f("p", { className: "label", children: mt(i.label) })
2486
+ /* @__PURE__ */ f("p", { className: "label", children: pt(i.label) })
2495
2487
  ]
2496
2488
  }
2497
2489
  ),
2498
- i.onRefresh ? /* @__PURE__ */ M(q, { children: [
2490
+ i.onRefresh ? /* @__PURE__ */ M(Y, { children: [
2499
2491
  /* @__PURE__ */ f(
2500
2492
  "button",
2501
2493
  {
@@ -2591,7 +2583,7 @@ function us(i) {
2591
2583
  /* @__PURE__ */ f("div", { className: t ? "open" : "", children: /* @__PURE__ */ f("div", { className: "container", children: r }) })
2592
2584
  ] });
2593
2585
  }
2594
- function Pt(i) {
2586
+ function Rt(i) {
2595
2587
  const e = [];
2596
2588
  return i.child?.children.map((t, s) => {
2597
2589
  e.push(/* @__PURE__ */ f(us, { child: t, scene: i.scene, three: i.three }, s));
@@ -2633,7 +2625,7 @@ function Ce(i) {
2633
2625
  onChange: (r) => {
2634
2626
  n(r), i.onChange !== void 0 && i.onChange(i.prop, r);
2635
2627
  }
2636
- }), /* @__PURE__ */ M(q, { children: [
2628
+ }), /* @__PURE__ */ M(Y, { children: [
2637
2629
  i.type === "number" && /* @__PURE__ */ f(
2638
2630
  "input",
2639
2631
  {
@@ -2654,7 +2646,7 @@ function Ce(i) {
2654
2646
  }
2655
2647
  }
2656
2648
  ),
2657
- i.type === "range" && /* @__PURE__ */ M(q, { children: [
2649
+ i.type === "range" && /* @__PURE__ */ M(Y, { children: [
2658
2650
  /* @__PURE__ */ f(
2659
2651
  "input",
2660
2652
  {
@@ -2682,7 +2674,7 @@ function Ce(i) {
2682
2674
  step: i.step,
2683
2675
  ref: t,
2684
2676
  name: W(),
2685
- onChange: pt
2677
+ onChange: ut
2686
2678
  }
2687
2679
  )
2688
2680
  ] })
@@ -2741,7 +2733,7 @@ function Lr(i) {
2741
2733
  window.removeEventListener("mousemove", b), window.removeEventListener("mouseup", S), _(!1);
2742
2734
  }
2743
2735
  function b(x) {
2744
- const N = r.current.getBoundingClientRect(), Q = ye(0, 99, x.clientX - N.left) / 99, oe = 1 - ye(0, 99, x.clientY - N.top) / 99, me = te(Xe(v.min, v.max, Q), 3), be = te(Xe(v.min, v.max, oe), 3);
2736
+ const N = r.current.getBoundingClientRect(), Q = ye(0, 99, x.clientX - N.left) / 99, oe = 1 - ye(0, 99, x.clientY - N.top) / 99, me = te(Ke(v.min, v.max, Q), 3), be = te(Ke(v.min, v.max, oe), 3);
2745
2737
  i.onChange({ target: { value: { x: me, y: be } } }), u(me), y(be);
2746
2738
  }
2747
2739
  function O() {
@@ -2753,7 +2745,7 @@ function Lr(i) {
2753
2745
  C({ min: v.min, max: x }), d > x && u(ye(v.min, x, d)), m > x && y(ye(v.min, x, m));
2754
2746
  }
2755
2747
  pe(() => {
2756
- a.current.style.left = `${Zt(v.min, v.max, d) * 100}%`, a.current.style.top = `${(1 - Zt(v.min, v.max, m)) * 100}%`;
2748
+ a.current.style.left = `${Yt(v.min, v.max, d) * 100}%`, a.current.style.top = `${(1 - Yt(v.min, v.max, m)) * 100}%`;
2757
2749
  }, [v, d, m]);
2758
2750
  const D = i.step !== void 0 ? i.step : 0.01;
2759
2751
  return /* @__PURE__ */ M("div", { className: "vector2", children: [
@@ -2852,7 +2844,7 @@ function Ti(i) {
2852
2844
  step: 0.1,
2853
2845
  labelRef: l,
2854
2846
  onChange: (h, d) => {
2855
- a[h] = Yt(d), i.onChange({ target: { value: a } });
2847
+ a[h] = Wt(d), i.onChange({ target: { value: a } });
2856
2848
  }
2857
2849
  }
2858
2850
  )
@@ -3013,7 +3005,7 @@ function Fr(i) {
3013
3005
  }
3014
3006
  return i;
3015
3007
  }
3016
- function Ct(i) {
3008
+ function yt(i) {
3017
3009
  switch (i) {
3018
3010
  case "alphaHash":
3019
3011
  return "Alpha Hash";
@@ -3271,12 +3263,12 @@ const Hr = [
3271
3263
  },
3272
3264
  {
3273
3265
  title: "Custom",
3274
- value: _t
3266
+ value: vt
3275
3267
  }
3276
3268
  ], Vr = [
3277
3269
  {
3278
3270
  title: "Add",
3279
- value: Je
3271
+ value: Qe
3280
3272
  },
3281
3273
  {
3282
3274
  title: "Subtract",
@@ -3301,7 +3293,7 @@ const Hr = [
3301
3293
  },
3302
3294
  {
3303
3295
  title: "One",
3304
- value: yt
3296
+ value: _t
3305
3297
  },
3306
3298
  {
3307
3299
  title: "Src Color",
@@ -3313,11 +3305,11 @@ const Hr = [
3313
3305
  },
3314
3306
  {
3315
3307
  title: "Src Alpha",
3316
- value: gt
3308
+ value: ft
3317
3309
  },
3318
3310
  {
3319
3311
  title: "One Minus Src Alpha",
3320
- value: vt
3312
+ value: gt
3321
3313
  },
3322
3314
  {
3323
3315
  title: "Dst Alpha",
@@ -3329,11 +3321,11 @@ const Hr = [
3329
3321
  },
3330
3322
  {
3331
3323
  title: "Dst Color",
3332
- value: Xt
3324
+ value: Kt
3333
3325
  },
3334
3326
  {
3335
3327
  title: "One Minus Dst Color",
3336
- value: Qt
3328
+ value: Xt
3337
3329
  },
3338
3330
  {
3339
3331
  title: "Src Alpha Saturate",
@@ -3362,7 +3354,7 @@ const Hr = [
3362
3354
  },
3363
3355
  {
3364
3356
  title: "One",
3365
- value: yt
3357
+ value: _t
3366
3358
  },
3367
3359
  {
3368
3360
  title: "Src Color",
@@ -3374,11 +3366,11 @@ const Hr = [
3374
3366
  },
3375
3367
  {
3376
3368
  title: "Src Alpha",
3377
- value: gt
3369
+ value: ft
3378
3370
  },
3379
3371
  {
3380
3372
  title: "One Minus Src Alpha",
3381
- value: vt
3373
+ value: gt
3382
3374
  },
3383
3375
  {
3384
3376
  title: "Dst Alpha",
@@ -3390,11 +3382,11 @@ const Hr = [
3390
3382
  },
3391
3383
  {
3392
3384
  title: "Dst Color",
3393
- value: Xt
3385
+ value: Kt
3394
3386
  },
3395
3387
  {
3396
3388
  title: "One Minus Dst Color",
3397
- value: Qt
3389
+ value: Xt
3398
3390
  },
3399
3391
  {
3400
3392
  title: "Constant Color",
@@ -3419,7 +3411,7 @@ function Ne(i, e) {
3419
3411
  function Wr(i, e, t, s) {
3420
3412
  return {
3421
3413
  type: "boolean",
3422
- title: Ct(i),
3414
+ title: yt(i),
3423
3415
  prop: i,
3424
3416
  value: e,
3425
3417
  needsUpdate: !0,
@@ -3436,7 +3428,7 @@ function Wr(i, e, t, s) {
3436
3428
  function Yr(i, e, t, s) {
3437
3429
  const n = {
3438
3430
  type: "number",
3439
- title: Ct(i),
3431
+ title: yt(i),
3440
3432
  prop: i,
3441
3433
  value: e,
3442
3434
  min: void 0,
@@ -3474,7 +3466,7 @@ function Yr(i, e, t, s) {
3474
3466
  function Zr(i, e, t, s) {
3475
3467
  const n = {
3476
3468
  type: "string",
3477
- title: Ct(i),
3469
+ title: yt(i),
3478
3470
  prop: i,
3479
3471
  value: e,
3480
3472
  needsUpdate: !0,
@@ -3516,11 +3508,11 @@ function jr(i) {
3516
3508
  function Kr(i) {
3517
3509
  return i.x !== void 0 && i.y !== void 0 && i.z !== void 0 && i.w !== void 0;
3518
3510
  }
3519
- function Kt(i) {
3511
+ function jt(i) {
3520
3512
  i.sort((e, t) => e.title < t.title ? -1 : e.title > t.title ? 1 : 0);
3521
3513
  }
3522
3514
  function Ue(i, e, t, s, n = "", r = !1) {
3523
- const a = Ct(i).split(".")[0].replaceAll("[", "").replaceAll("]", ""), o = n.length > 0 ? `${n}.${i}` : i, c = typeof e;
3515
+ const a = yt(i).split(".")[0].replaceAll("[", "").replaceAll("]", ""), o = n.length > 0 ? `${n}.${i}` : i, c = typeof e;
3524
3516
  if (c === "object" && e !== null && e.__isUniform === !0)
3525
3517
  return Ue(`${i}.value`, e.value, t, s, n, r);
3526
3518
  if (c === "boolean" || c === "string")
@@ -3566,7 +3558,7 @@ function Ue(i, e, t, s, n = "", r = !1) {
3566
3558
  value: e,
3567
3559
  disabled: r,
3568
3560
  onChange: (l, h) => {
3569
- const d = new et(h);
3561
+ const d = new Je(h);
3570
3562
  s.updateObject(t.uuid, `material.${o}`, d);
3571
3563
  const u = s.getScene(t.uuid);
3572
3564
  if (u !== null) {
@@ -3588,7 +3580,7 @@ function Ue(i, e, t, s, n = "", r = !1) {
3588
3580
  }
3589
3581
  }
3590
3582
  if (l.length > 0)
3591
- return Kt(l), {
3583
+ return jt(l), {
3592
3584
  title: a,
3593
3585
  items: l
3594
3586
  };
@@ -3732,7 +3724,7 @@ function Ue(i, e, t, s, n = "", r = !1) {
3732
3724
  console.log("Hermes - Issue cycling through material object:", i, e);
3733
3725
  }
3734
3726
  if (l.length > 0)
3735
- return Kt(l), {
3727
+ return jt(l), {
3736
3728
  title: a,
3737
3729
  items: l
3738
3730
  };
@@ -3757,7 +3749,7 @@ function Mi(i, e, t) {
3757
3749
  o !== void 0 && s.push(o);
3758
3750
  } else a !== void 0 && console.log("Hermes - Other Material Prop Type:", n, r, a);
3759
3751
  }
3760
- return Kt(s), s.push({
3752
+ return jt(s), s.push({
3761
3753
  title: "Update Material",
3762
3754
  type: "button",
3763
3755
  onChange: () => {
@@ -3793,7 +3785,7 @@ function Xr(i, e) {
3793
3785
  `Material ${l}`
3794
3786
  )
3795
3787
  );
3796
- return /* @__PURE__ */ f(q, { children: o });
3788
+ return /* @__PURE__ */ f(Y, { children: o });
3797
3789
  } else
3798
3790
  return /* @__PURE__ */ f(
3799
3791
  X,
@@ -3901,9 +3893,9 @@ function Qr(i) {
3901
3893
  ] })
3902
3894
  ] });
3903
3895
  }
3904
- function ht(i) {
3896
+ function ct(i) {
3905
3897
  let e = i.value;
3906
- e !== void 0 && (e.isColor !== void 0 ? e = yi(i.value) : i.type === "color" && (e = yi(new et().setStyle(i.value, Ke))));
3898
+ e !== void 0 && (e.isColor !== void 0 ? e = yi(i.value) : i.type === "color" && (e = yi(new Je().setStyle(i.value, je))));
3907
3899
  const [t, s] = L(e), n = z(null), r = (l) => {
3908
3900
  let h = l.target.value;
3909
3901
  if (i.type === "boolean")
@@ -3919,7 +3911,7 @@ function ht(i) {
3919
3911
  const o = i.type === "field" || i.type === "string" && (t.length > 100 || t.search(`
3920
3912
  `) > -1), c = o || i.type === "image" || i.type === "vector2";
3921
3913
  return /* @__PURE__ */ M("div", { className: `field ${c ? "block" : ""}`, style: a, children: [
3922
- i.type !== "button" && /* @__PURE__ */ f("span", { ref: n, children: mt(i.title) }, "fieldLabel"),
3914
+ i.type !== "button" && /* @__PURE__ */ f("span", { ref: n, children: pt(i.title) }, "fieldLabel"),
3923
3915
  i.type === "string" && !o && /* @__PURE__ */ f(
3924
3916
  "input",
3925
3917
  {
@@ -3982,7 +3974,7 @@ function ht(i) {
3982
3974
  onChange: i.onChange
3983
3975
  }
3984
3976
  ),
3985
- i.type === "color" && /* @__PURE__ */ M(q, { children: [
3977
+ i.type === "color" && /* @__PURE__ */ M(Y, { children: [
3986
3978
  /* @__PURE__ */ f("input", { type: "text", value: t.toString(), onChange: r, disabled: i.disabled, className: "color", name: W() }),
3987
3979
  /* @__PURE__ */ f("input", { type: "color", value: t, onChange: r, disabled: i.disabled, name: W() })
3988
3980
  ] }),
@@ -3997,14 +3989,14 @@ function ht(i) {
3997
3989
  }
3998
3990
  ),
3999
3991
  i.type === "image" && /* @__PURE__ */ f(Qr, { title: i.title, prop: i.prop, value: i.value, onChange: i.onChange }),
4000
- i.type === "option" && /* @__PURE__ */ f(q, { children: /* @__PURE__ */ f(
3992
+ i.type === "option" && /* @__PURE__ */ f(Y, { children: /* @__PURE__ */ f(
4001
3993
  "select",
4002
3994
  {
4003
3995
  onChange: r,
4004
3996
  disabled: i.disabled,
4005
3997
  defaultValue: i.value,
4006
3998
  name: W(),
4007
- children: i.options?.map((l, h) => /* @__PURE__ */ f("option", { value: l.value, children: mt(l.title) }, h))
3999
+ children: i.options?.map((l, h) => /* @__PURE__ */ f("option", { value: l.value, children: pt(l.title) }, h))
4008
4000
  }
4009
4001
  ) }),
4010
4002
  i.type === "vector2" && /* @__PURE__ */ f(Lr, { step: i.step, value: t, min: 0, max: 1, onChange: r }),
@@ -4016,7 +4008,7 @@ function ht(i) {
4016
4008
  function Jr(i) {
4017
4009
  return "items" in i;
4018
4010
  }
4019
- class X extends Qe {
4011
+ class X extends Xe {
4020
4012
  subgroupNames = [];
4021
4013
  subgroupElements = [];
4022
4014
  valueOverrides = /* @__PURE__ */ new Map();
@@ -4073,13 +4065,13 @@ class X extends Qe {
4073
4065
  return this.props.items.forEach((t) => {
4074
4066
  if (Jr(t))
4075
4067
  e.push(
4076
- /* @__PURE__ */ f(X, { three: this.props.three, title: mt(t.title), items: t.items }, t.title)
4068
+ /* @__PURE__ */ f(X, { three: this.props.three, title: pt(t.title), items: t.items }, t.title)
4077
4069
  );
4078
4070
  else {
4079
4071
  const s = this.valueOverrides.get(t.title), n = s !== void 0 ? s : t.value;
4080
4072
  e.push(
4081
4073
  /* @__PURE__ */ f(
4082
- ht,
4074
+ ct,
4083
4075
  {
4084
4076
  title: t.title,
4085
4077
  prop: t.prop,
@@ -4102,7 +4094,7 @@ class X extends Qe {
4102
4094
  );
4103
4095
  }
4104
4096
  }), this.subgroupElements.forEach((t) => e.push(t)), /* @__PURE__ */ f(
4105
- je,
4097
+ qe,
4106
4098
  {
4107
4099
  three: this.props.three,
4108
4100
  label: this.props.title,
@@ -4115,7 +4107,7 @@ class X extends Qe {
4115
4107
  );
4116
4108
  }
4117
4109
  }
4118
- class I extends Qe {
4110
+ class I extends Xe {
4119
4111
  static instance;
4120
4112
  static groups = [];
4121
4113
  static groupsRefs = [];
@@ -4226,19 +4218,19 @@ class I extends Qe {
4226
4218
  e.title
4227
4219
  );
4228
4220
  return I.groups.push(r), I.groupsRefs.push(n), I.groupTitles.push(e.title), setTimeout(() => {
4229
- I.instance.setState({ lastUpdate: Date.now() });
4221
+ I.instance?.setState({ lastUpdate: Date.now() });
4230
4222
  }, 0), n;
4231
4223
  }
4232
4224
  static removeEditorGroup(e) {
4233
4225
  const t = I.groupTitles.length;
4234
4226
  for (let s = 0; s < t; s++)
4235
4227
  if (e === I.groupTitles[s]) {
4236
- I.groups.splice(s, 1), I.groupTitles.splice(s, 1), I.instance.setState({ lastUpdate: Date.now() });
4228
+ I.groups.splice(s, 1), I.groupTitles.splice(s, 1), I.instance?.setState({ lastUpdate: Date.now() });
4237
4229
  return;
4238
4230
  }
4239
4231
  }
4240
4232
  static removeAllGroups() {
4241
- I.groups = [], I.groupTitles = [], I.groupsRefs = [], I.instance.setState({ lastUpdate: Date.now() });
4233
+ I.groups = [], I.groupTitles = [], I.groupsRefs = [], I.instance?.setState({ lastUpdate: Date.now() });
4242
4234
  }
4243
4235
  }
4244
4236
  function Ri(i) {
@@ -4388,7 +4380,7 @@ function ze(i) {
4388
4380
  function He(i) {
4389
4381
  return Math.abs(i) < Number.MAX_VALUE ? i : i * (1 / 0);
4390
4382
  }
4391
- function rt(i, e, t, s, n = 1 / 0, r) {
4383
+ function nt(i, e, t, s, n = 1 / 0, r) {
4392
4384
  s = Math.max(1e-4, s);
4393
4385
  const a = 2 / s, o = a * r, c = 1 / (1 + o + 0.48 * o * o + 0.235 * o * o * o);
4394
4386
  let l = i - e;
@@ -4414,12 +4406,12 @@ function Ii(i, e, t, s, n = 1 / 0, r, a) {
4414
4406
  const x = C - i.x, N = g - i.y, Q = _ - i.z, oe = a.x - C, me = a.y - g, be = a.z - _;
4415
4407
  return x * oe + N * me + Q * be > 0 && (a.x = C, a.y = g, a.z = _, t.x = (a.x - C) / r, t.y = (a.y - g) / r, t.z = (a.z - _) / r), a;
4416
4408
  }
4417
- function Dt(i, e) {
4409
+ function Pt(i, e) {
4418
4410
  e.set(0, 0), i.forEach((t) => {
4419
4411
  e.x += t.clientX, e.y += t.clientY;
4420
4412
  }), e.x /= i.length, e.y /= i.length;
4421
4413
  }
4422
- function It(i, e) {
4414
+ function Dt(i, e) {
4423
4415
  return de(i) ? (console.warn(`${e} is not supported in OrthographicCamera`), !0) : !1;
4424
4416
  }
4425
4417
  class ta {
@@ -4486,9 +4478,9 @@ class ta {
4486
4478
  }
4487
4479
  }
4488
4480
  }
4489
- var Ut;
4490
- const ia = "2.10.1", at = 1 / 8, sa = /Mac/.test((Ut = globalThis?.navigator) === null || Ut === void 0 ? void 0 : Ut.platform);
4491
- let T, Ui, ot, Lt, Z, A, U, De, Be, se, ne, ve, Li, ki, K, Ve, Ie, Ni, kt, Fi, Nt, Ft, lt;
4481
+ var It;
4482
+ const ia = "2.10.1", rt = 1 / 8, sa = /Mac/.test((It = globalThis?.navigator) === null || It === void 0 ? void 0 : It.platform);
4483
+ let T, Ui, at, Ut, q, A, U, De, Be, se, ne, ve, Li, ki, K, Ve, Ie, Ni, Lt, Fi, kt, Nt, ot;
4492
4484
  class ae extends ta {
4493
4485
  /**
4494
4486
  * Injects THREE as the dependency. You can then proceed to use CameraControls.
@@ -4531,7 +4523,7 @@ class ae extends ta {
4531
4523
  * @category Statics
4532
4524
  */
4533
4525
  static install(e) {
4534
- T = e.THREE, Ui = Object.freeze(new T.Vector3(0, 0, 0)), ot = Object.freeze(new T.Vector3(0, 1, 0)), Lt = Object.freeze(new T.Vector3(0, 0, 1)), Z = new T.Vector2(), A = new T.Vector3(), U = new T.Vector3(), De = new T.Vector3(), Be = new T.Vector3(), se = new T.Vector3(), ne = new T.Vector3(), ve = new T.Vector3(), Li = new T.Vector3(), ki = new T.Vector3(), K = new T.Spherical(), Ve = new T.Spherical(), Ie = new T.Box3(), Ni = new T.Box3(), kt = new T.Sphere(), Fi = new T.Quaternion(), Nt = new T.Quaternion(), Ft = new T.Matrix4(), lt = new T.Raycaster();
4526
+ T = e.THREE, Ui = Object.freeze(new T.Vector3(0, 0, 0)), at = Object.freeze(new T.Vector3(0, 1, 0)), Ut = Object.freeze(new T.Vector3(0, 0, 1)), q = new T.Vector2(), A = new T.Vector3(), U = new T.Vector3(), De = new T.Vector3(), Be = new T.Vector3(), se = new T.Vector3(), ne = new T.Vector3(), ve = new T.Vector3(), Li = new T.Vector3(), ki = new T.Vector3(), K = new T.Spherical(), Ve = new T.Spherical(), Ie = new T.Box3(), Ni = new T.Box3(), Lt = new T.Sphere(), Fi = new T.Quaternion(), kt = new T.Quaternion(), Nt = new T.Matrix4(), ot = new T.Raycaster();
4535
4527
  }
4536
4528
  /**
4537
4529
  * list all ACTIONs
@@ -4585,7 +4577,7 @@ class ae extends ta {
4585
4577
  }, this._zoomInternal = (g, _, E) => {
4586
4578
  const S = Math.pow(0.95, g * this.dollySpeed), b = this._zoom, O = this._zoom * S;
4587
4579
  this.zoomTo(O, !0), this.dollyToCursor && (this._changedZoom += O - b, this._dollyControlCoord.set(_, E));
4588
- }, typeof T > "u" && console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."), this._camera = e, this._yAxisUpSpace = new T.Quaternion().setFromUnitVectors(this._camera.up, ot), this._yAxisUpSpaceInverse = this._yAxisUpSpace.clone().invert(), this._state = p.NONE, this._target = new T.Vector3(), this._targetEnd = this._target.clone(), this._focalOffset = new T.Vector3(), this._focalOffsetEnd = this._focalOffset.clone(), this._spherical = new T.Spherical().setFromVector3(A.copy(this._camera.position).applyQuaternion(this._yAxisUpSpace)), this._sphericalEnd = this._spherical.clone(), this._lastDistance = this._spherical.radius, this._zoom = this._camera.zoom, this._zoomEnd = this._zoom, this._lastZoom = this._zoom, this._nearPlaneCorners = [
4580
+ }, typeof T > "u" && console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."), this._camera = e, this._yAxisUpSpace = new T.Quaternion().setFromUnitVectors(this._camera.up, at), this._yAxisUpSpaceInverse = this._yAxisUpSpace.clone().invert(), this._state = p.NONE, this._target = new T.Vector3(), this._targetEnd = this._target.clone(), this._focalOffset = new T.Vector3(), this._focalOffsetEnd = this._focalOffset.clone(), this._spherical = new T.Spherical().setFromVector3(A.copy(this._camera.position).applyQuaternion(this._yAxisUpSpace)), this._sphericalEnd = this._spherical.clone(), this._lastDistance = this._spherical.radius, this._zoom = this._camera.zoom, this._zoomEnd = this._zoom, this._lastZoom = this._zoom, this._nearPlaneCorners = [
4589
4581
  new T.Vector3(),
4590
4582
  new T.Vector3(),
4591
4583
  new T.Vector3(),
@@ -4720,8 +4712,8 @@ class ae extends ta {
4720
4712
  }, u = (g) => {
4721
4713
  if (!this._enabled)
4722
4714
  return;
4723
- if (Dt(this._activePointers, Z), this._getClientRect(this._elementRect), s.copy(Z), n.copy(Z), this._activePointers.length >= 2) {
4724
- const E = Z.x - this._activePointers[1].clientX, S = Z.y - this._activePointers[1].clientY, b = Math.sqrt(E * E + S * S);
4715
+ if (Pt(this._activePointers, q), this._getClientRect(this._elementRect), s.copy(q), n.copy(q), this._activePointers.length >= 2) {
4716
+ const E = q.x - this._activePointers[1].clientX, S = q.y - this._activePointers[1].clientY, b = Math.sqrt(E * E + S * S);
4725
4717
  r.set(0, b);
4726
4718
  const O = (this._activePointers[0].clientX + this._activePointers[1].clientX) * 0.5, w = (this._activePointers[0].clientY + this._activePointers[1].clientY) * 0.5;
4727
4719
  n.set(O, w);
@@ -4746,21 +4738,21 @@ class ae extends ta {
4746
4738
  }, m = () => {
4747
4739
  if (!this._enabled || !this._dragNeedsUpdate)
4748
4740
  return;
4749
- this._dragNeedsUpdate = !1, Dt(this._activePointers, Z);
4750
- const _ = this._domElement && this._domElement.ownerDocument.pointerLockElement === this._domElement ? this._lockedPointer || this._activePointers[0] : null, E = _ ? -_.deltaX : n.x - Z.x, S = _ ? -_.deltaY : n.y - Z.y;
4751
- if (n.copy(Z), ((this._state & p.ROTATE) === p.ROTATE || (this._state & p.TOUCH_ROTATE) === p.TOUCH_ROTATE || (this._state & p.TOUCH_DOLLY_ROTATE) === p.TOUCH_DOLLY_ROTATE || (this._state & p.TOUCH_ZOOM_ROTATE) === p.TOUCH_ZOOM_ROTATE) && (this._rotateInternal(E, S), this._isUserControllingRotate = !0), (this._state & p.DOLLY) === p.DOLLY || (this._state & p.ZOOM) === p.ZOOM) {
4741
+ this._dragNeedsUpdate = !1, Pt(this._activePointers, q);
4742
+ const _ = this._domElement && this._domElement.ownerDocument.pointerLockElement === this._domElement ? this._lockedPointer || this._activePointers[0] : null, E = _ ? -_.deltaX : n.x - q.x, S = _ ? -_.deltaY : n.y - q.y;
4743
+ if (n.copy(q), ((this._state & p.ROTATE) === p.ROTATE || (this._state & p.TOUCH_ROTATE) === p.TOUCH_ROTATE || (this._state & p.TOUCH_DOLLY_ROTATE) === p.TOUCH_DOLLY_ROTATE || (this._state & p.TOUCH_ZOOM_ROTATE) === p.TOUCH_ZOOM_ROTATE) && (this._rotateInternal(E, S), this._isUserControllingRotate = !0), (this._state & p.DOLLY) === p.DOLLY || (this._state & p.ZOOM) === p.ZOOM) {
4752
4744
  const b = this.dollyToCursor ? (s.x - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, O = this.dollyToCursor ? (s.y - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0, w = this.dollyDragInverted ? -1 : 1;
4753
- (this._state & p.DOLLY) === p.DOLLY ? (this._dollyInternal(w * S * at, b, O), this._isUserControllingDolly = !0) : (this._zoomInternal(w * S * at, b, O), this._isUserControllingZoom = !0);
4745
+ (this._state & p.DOLLY) === p.DOLLY ? (this._dollyInternal(w * S * rt, b, O), this._isUserControllingDolly = !0) : (this._zoomInternal(w * S * rt, b, O), this._isUserControllingZoom = !0);
4754
4746
  }
4755
4747
  if ((this._state & p.TOUCH_DOLLY) === p.TOUCH_DOLLY || (this._state & p.TOUCH_ZOOM) === p.TOUCH_ZOOM || (this._state & p.TOUCH_DOLLY_TRUCK) === p.TOUCH_DOLLY_TRUCK || (this._state & p.TOUCH_ZOOM_TRUCK) === p.TOUCH_ZOOM_TRUCK || (this._state & p.TOUCH_DOLLY_SCREEN_PAN) === p.TOUCH_DOLLY_SCREEN_PAN || (this._state & p.TOUCH_ZOOM_SCREEN_PAN) === p.TOUCH_ZOOM_SCREEN_PAN || (this._state & p.TOUCH_DOLLY_OFFSET) === p.TOUCH_DOLLY_OFFSET || (this._state & p.TOUCH_ZOOM_OFFSET) === p.TOUCH_ZOOM_OFFSET || (this._state & p.TOUCH_DOLLY_ROTATE) === p.TOUCH_DOLLY_ROTATE || (this._state & p.TOUCH_ZOOM_ROTATE) === p.TOUCH_ZOOM_ROTATE) {
4756
- const b = Z.x - this._activePointers[1].clientX, O = Z.y - this._activePointers[1].clientY, w = Math.sqrt(b * b + O * O), D = r.y - w;
4748
+ const b = q.x - this._activePointers[1].clientX, O = q.y - this._activePointers[1].clientY, w = Math.sqrt(b * b + O * O), D = r.y - w;
4757
4749
  r.set(0, w);
4758
4750
  const x = this.dollyToCursor ? (n.x - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, N = this.dollyToCursor ? (n.y - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0;
4759
- (this._state & p.TOUCH_DOLLY) === p.TOUCH_DOLLY || (this._state & p.TOUCH_DOLLY_ROTATE) === p.TOUCH_DOLLY_ROTATE || (this._state & p.TOUCH_DOLLY_TRUCK) === p.TOUCH_DOLLY_TRUCK || (this._state & p.TOUCH_DOLLY_SCREEN_PAN) === p.TOUCH_DOLLY_SCREEN_PAN || (this._state & p.TOUCH_DOLLY_OFFSET) === p.TOUCH_DOLLY_OFFSET ? (this._dollyInternal(D * at, x, N), this._isUserControllingDolly = !0) : (this._zoomInternal(D * at, x, N), this._isUserControllingZoom = !0);
4751
+ (this._state & p.TOUCH_DOLLY) === p.TOUCH_DOLLY || (this._state & p.TOUCH_DOLLY_ROTATE) === p.TOUCH_DOLLY_ROTATE || (this._state & p.TOUCH_DOLLY_TRUCK) === p.TOUCH_DOLLY_TRUCK || (this._state & p.TOUCH_DOLLY_SCREEN_PAN) === p.TOUCH_DOLLY_SCREEN_PAN || (this._state & p.TOUCH_DOLLY_OFFSET) === p.TOUCH_DOLLY_OFFSET ? (this._dollyInternal(D * rt, x, N), this._isUserControllingDolly = !0) : (this._zoomInternal(D * rt, x, N), this._isUserControllingZoom = !0);
4760
4752
  }
4761
4753
  ((this._state & p.TRUCK) === p.TRUCK || (this._state & p.TOUCH_TRUCK) === p.TOUCH_TRUCK || (this._state & p.TOUCH_DOLLY_TRUCK) === p.TOUCH_DOLLY_TRUCK || (this._state & p.TOUCH_ZOOM_TRUCK) === p.TOUCH_ZOOM_TRUCK) && (this._truckInternal(E, S, !1, !1), this._isUserControllingTruck = !0), ((this._state & p.SCREEN_PAN) === p.SCREEN_PAN || (this._state & p.TOUCH_SCREEN_PAN) === p.TOUCH_SCREEN_PAN || (this._state & p.TOUCH_DOLLY_SCREEN_PAN) === p.TOUCH_DOLLY_SCREEN_PAN || (this._state & p.TOUCH_ZOOM_SCREEN_PAN) === p.TOUCH_ZOOM_SCREEN_PAN) && (this._truckInternal(E, S, !1, !0), this._isUserControllingTruck = !0), ((this._state & p.OFFSET) === p.OFFSET || (this._state & p.TOUCH_OFFSET) === p.TOUCH_OFFSET || (this._state & p.TOUCH_DOLLY_OFFSET) === p.TOUCH_DOLLY_OFFSET || (this._state & p.TOUCH_ZOOM_OFFSET) === p.TOUCH_ZOOM_OFFSET) && (this._truckInternal(E, S, !0, !1), this._isUserControllingOffset = !0), this.dispatchEvent({ type: "control" });
4762
4754
  }, y = () => {
4763
- Dt(this._activePointers, Z), n.copy(Z), this._dragNeedsUpdate = !1, (this._activePointers.length === 0 || this._activePointers.length === 1 && this._activePointers[0] === this._lockedPointer) && (this._isDragging = !1), this._activePointers.length === 0 && this._domElement && (this._domElement.ownerDocument.removeEventListener("pointermove", o, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("pointerup", c), this.dispatchEvent({ type: "controlend" }));
4755
+ Pt(this._activePointers, q), n.copy(q), this._dragNeedsUpdate = !1, (this._activePointers.length === 0 || this._activePointers.length === 1 && this._activePointers[0] === this._lockedPointer) && (this._isDragging = !1), this._activePointers.length === 0 && this._domElement && (this._domElement.ownerDocument.removeEventListener("pointermove", o, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("pointerup", c), this.dispatchEvent({ type: "controlend" }));
4764
4756
  };
4765
4757
  this.lockPointer = () => {
4766
4758
  !this._enabled || !this._domElement || (this.cancel(), this._lockedPointer = {
@@ -5152,10 +5144,10 @@ class ae extends ta {
5152
5144
  l.isEmpty() && (console.warn("camera-controls: fitTo() cannot be used with an empty box. Aborting"), Promise.resolve());
5153
5145
  const h = Di(this._sphericalEnd.theta, Pi), d = Di(this._sphericalEnd.phi, Pi);
5154
5146
  c.push(this.rotateTo(h, d, t));
5155
- const u = A.setFromSpherical(this._sphericalEnd).normalize(), m = Fi.setFromUnitVectors(u, Lt), y = k(Math.abs(u.y), 1);
5156
- y && m.multiply(Nt.setFromAxisAngle(ot, h)), m.multiply(this._yAxisUpSpaceInverse);
5147
+ const u = A.setFromSpherical(this._sphericalEnd).normalize(), m = Fi.setFromUnitVectors(u, Ut), y = k(Math.abs(u.y), 1);
5148
+ y && m.multiply(kt.setFromAxisAngle(at, h)), m.multiply(this._yAxisUpSpaceInverse);
5157
5149
  const v = Ni.makeEmpty();
5158
- U.copy(l.min).applyQuaternion(m), v.expandByPoint(U), U.copy(l.min).setX(l.max.x).applyQuaternion(m), v.expandByPoint(U), U.copy(l.min).setY(l.max.y).applyQuaternion(m), v.expandByPoint(U), U.copy(l.max).setZ(l.min.z).applyQuaternion(m), v.expandByPoint(U), U.copy(l.min).setZ(l.max.z).applyQuaternion(m), v.expandByPoint(U), U.copy(l.max).setY(l.min.y).applyQuaternion(m), v.expandByPoint(U), U.copy(l.max).setX(l.min.x).applyQuaternion(m), v.expandByPoint(U), U.copy(l.max).applyQuaternion(m), v.expandByPoint(U), v.min.x -= n, v.min.y -= a, v.max.x += r, v.max.y += o, m.setFromUnitVectors(Lt, u), y && m.premultiply(Nt.invert()), m.premultiply(this._yAxisUpSpace);
5150
+ U.copy(l.min).applyQuaternion(m), v.expandByPoint(U), U.copy(l.min).setX(l.max.x).applyQuaternion(m), v.expandByPoint(U), U.copy(l.min).setY(l.max.y).applyQuaternion(m), v.expandByPoint(U), U.copy(l.max).setZ(l.min.z).applyQuaternion(m), v.expandByPoint(U), U.copy(l.min).setZ(l.max.z).applyQuaternion(m), v.expandByPoint(U), U.copy(l.max).setY(l.min.y).applyQuaternion(m), v.expandByPoint(U), U.copy(l.max).setX(l.min.x).applyQuaternion(m), v.expandByPoint(U), U.copy(l.max).applyQuaternion(m), v.expandByPoint(U), v.min.x -= n, v.min.y -= a, v.max.x += r, v.max.y += o, m.setFromUnitVectors(Ut, u), y && m.premultiply(kt.invert()), m.premultiply(this._yAxisUpSpace);
5159
5151
  const C = v.getSize(A), g = v.getCenter(U).applyQuaternion(m);
5160
5152
  if (ge(this._camera)) {
5161
5153
  const _ = this.getDistanceToFitBox(C.x, C.y, C.z, s);
@@ -5173,7 +5165,7 @@ class ae extends ta {
5173
5165
  * @category Methods
5174
5166
  */
5175
5167
  fitToSphere(e, t) {
5176
- const s = [], r = "isObject3D" in e ? ae.createBoundingSphere(e, kt) : kt.copy(e);
5168
+ const s = [], r = "isObject3D" in e ? ae.createBoundingSphere(e, Lt) : Lt.copy(e);
5177
5169
  if (s.push(this.moveTo(r.center.x, r.center.y, r.center.z, t)), ge(this._camera)) {
5178
5170
  const a = this.getDistanceToFitSphere(r.radius);
5179
5171
  s.push(this.dollyTo(a, t));
@@ -5318,7 +5310,7 @@ class ae extends ta {
5318
5310
  * @category Methods
5319
5311
  */
5320
5312
  getDistanceToFitBox(e, t, s, n = !1) {
5321
- if (It(this._camera, "getDistanceToFitBox"))
5313
+ if (Dt(this._camera, "getDistanceToFitBox"))
5322
5314
  return this._spherical.radius;
5323
5315
  const r = e / t, a = this._camera.getEffectiveFOV() * Fe, o = this._camera.aspect;
5324
5316
  return ((n ? r > o : r < o) ? t : e / o) * 0.5 / Math.tan(a * 0.5) + s * 0.5;
@@ -5330,7 +5322,7 @@ class ae extends ta {
5330
5322
  * @category Methods
5331
5323
  */
5332
5324
  getDistanceToFitSphere(e) {
5333
- if (It(this._camera, "getDistanceToFitSphere"))
5325
+ if (Dt(this._camera, "getDistanceToFitSphere"))
5334
5326
  return this._spherical.radius;
5335
5327
  const t = this._camera.getEffectiveFOV() * Fe, s = Math.atan(Math.tan(t * 0.5) * this._camera.aspect) * 2, n = 1 < this._camera.aspect ? t : s;
5336
5328
  return e / Math.sin(n * 0.5);
@@ -5415,7 +5407,7 @@ class ae extends ta {
5415
5407
  * @category Methods
5416
5408
  */
5417
5409
  updateCameraUp() {
5418
- this._yAxisUpSpace.setFromUnitVectors(this._camera.up, ot), this._yAxisUpSpaceInverse.copy(this._yAxisUpSpace).invert();
5410
+ this._yAxisUpSpace.setFromUnitVectors(this._camera.up, at), this._yAxisUpSpaceInverse.copy(this._yAxisUpSpace).invert();
5419
5411
  }
5420
5412
  /**
5421
5413
  * Apply current camera-up direction to the camera.
@@ -5441,19 +5433,19 @@ class ae extends ta {
5441
5433
  this._thetaVelocity.value = 0, this._spherical.theta = this._sphericalEnd.theta;
5442
5434
  else {
5443
5435
  const d = this._isUserControllingRotate ? this.draggingSmoothTime : this.smoothTime;
5444
- this._spherical.theta = rt(this._spherical.theta, this._sphericalEnd.theta, this._thetaVelocity, d, 1 / 0, e), this._needsUpdate = !0;
5436
+ this._spherical.theta = nt(this._spherical.theta, this._sphericalEnd.theta, this._thetaVelocity, d, 1 / 0, e), this._needsUpdate = !0;
5445
5437
  }
5446
5438
  if (F(s))
5447
5439
  this._phiVelocity.value = 0, this._spherical.phi = this._sphericalEnd.phi;
5448
5440
  else {
5449
5441
  const d = this._isUserControllingRotate ? this.draggingSmoothTime : this.smoothTime;
5450
- this._spherical.phi = rt(this._spherical.phi, this._sphericalEnd.phi, this._phiVelocity, d, 1 / 0, e), this._needsUpdate = !0;
5442
+ this._spherical.phi = nt(this._spherical.phi, this._sphericalEnd.phi, this._phiVelocity, d, 1 / 0, e), this._needsUpdate = !0;
5451
5443
  }
5452
5444
  if (F(n))
5453
5445
  this._radiusVelocity.value = 0, this._spherical.radius = this._sphericalEnd.radius;
5454
5446
  else {
5455
5447
  const d = this._isUserControllingDolly ? this.draggingSmoothTime : this.smoothTime;
5456
- this._spherical.radius = rt(this._spherical.radius, this._sphericalEnd.radius, this._radiusVelocity, d, this.maxSpeed, e), this._needsUpdate = !0;
5448
+ this._spherical.radius = nt(this._spherical.radius, this._sphericalEnd.radius, this._radiusVelocity, d, this.maxSpeed, e), this._needsUpdate = !0;
5457
5449
  }
5458
5450
  if (F(r.x) && F(r.y) && F(r.z))
5459
5451
  this._targetVelocity.set(0, 0, 0), this._target.copy(this._targetEnd);
@@ -5471,7 +5463,7 @@ class ae extends ta {
5471
5463
  this._zoomVelocity.value = 0, this._zoom = this._zoomEnd;
5472
5464
  else {
5473
5465
  const d = this._isUserControllingZoom ? this.draggingSmoothTime : this.smoothTime;
5474
- this._zoom = rt(this._zoom, this._zoomEnd, this._zoomVelocity, d, 1 / 0, e);
5466
+ this._zoom = nt(this._zoom, this._zoomEnd, this._zoomVelocity, d, 1 / 0, e);
5475
5467
  }
5476
5468
  if (this.dollyToCursor) {
5477
5469
  if (ge(this._camera) && this._changedDolly !== 0) {
@@ -5608,16 +5600,16 @@ class ae extends ta {
5608
5600
  // lateUpdate
5609
5601
  _collisionTest() {
5610
5602
  let e = 1 / 0;
5611
- if (!(this.colliderMeshes.length >= 1) || It(this._camera, "_collisionTest"))
5603
+ if (!(this.colliderMeshes.length >= 1) || Dt(this._camera, "_collisionTest"))
5612
5604
  return e;
5613
5605
  const s = this._getTargetDirection(Be);
5614
- Ft.lookAt(Ui, s, this._camera.up);
5606
+ Nt.lookAt(Ui, s, this._camera.up);
5615
5607
  for (let n = 0; n < 4; n++) {
5616
5608
  const r = U.copy(this._nearPlaneCorners[n]);
5617
- r.applyMatrix4(Ft);
5609
+ r.applyMatrix4(Nt);
5618
5610
  const a = De.addVectors(this._target, r);
5619
- lt.set(a, s), lt.far = this._spherical.radius + 1;
5620
- const o = lt.intersectObjects(this.colliderMeshes);
5611
+ ot.set(a, s), ot.far = this._spherical.radius + 1;
5612
+ const o = ot.intersectObjects(this.colliderMeshes);
5621
5613
  o.length !== 0 && o[0].distance < e && (e = o[0].distance);
5622
5614
  }
5623
5615
  return e;
@@ -5696,7 +5688,7 @@ class ae extends ta {
5696
5688
  }), s.radius = Math.sqrt(r), s;
5697
5689
  }
5698
5690
  }
5699
- const ft = (i) => {
5691
+ const mt = (i) => {
5700
5692
  const [e, t] = L(i.options[i.index]), s = () => {
5701
5693
  i.onToggle(!i.open);
5702
5694
  }, n = (a) => {
@@ -5720,7 +5712,7 @@ const ft = (i) => {
5720
5712
  } }),
5721
5713
  /* @__PURE__ */ M("div", { className: "options", children: [
5722
5714
  e.camera !== null && /* @__PURE__ */ f(
5723
- ft,
5715
+ mt,
5724
5716
  {
5725
5717
  title: "Camera",
5726
5718
  index: e.options.indexOf(e.camera.name),
@@ -5734,7 +5726,7 @@ const ft = (i) => {
5734
5726
  }
5735
5727
  ),
5736
5728
  /* @__PURE__ */ f(
5737
- ft,
5729
+ mt,
5738
5730
  {
5739
5731
  title: "Mode",
5740
5732
  index: s.indexOf(n),
@@ -5846,7 +5838,7 @@ class aa extends ns {
5846
5838
  value: e?.divisions !== void 0 ? e?.divisions : 10
5847
5839
  },
5848
5840
  uColor: {
5849
- value: e?.color !== void 0 ? e?.color : new et(16777215)
5841
+ value: e?.color !== void 0 ? e?.color : new Je(16777215)
5850
5842
  },
5851
5843
  uDistance: {
5852
5844
  value: e?.distance !== void 0 ? e?.distance : 1e4
@@ -5920,32 +5912,32 @@ class la extends an {
5920
5912
  uSubgridOpacity;
5921
5913
  uGridOpacity;
5922
5914
  constructor(e) {
5923
- super(), this.name = "InfiniteGrid", this.side = on, this.transparent = !0, this.uScale = we(e?.scale ?? 0.1), this.uDivisions = we(e?.divisions ?? 10), this.uColor = we(e?.color ?? new dt(16777215)), this.uDistance = we(e?.distance ?? 1e4), this.uSubgridOpacity = we(e?.subgridOpacity ?? 0.15), this.uGridOpacity = we(e?.gridOpacity ?? 0.25);
5915
+ super(), this.name = "InfiniteGrid", this.side = on, this.transparent = !0, this.uScale = we(e?.scale ?? 0.1), this.uDivisions = we(e?.divisions ?? 10), this.uColor = we(e?.color ?? new ht(16777215)), this.uDistance = we(e?.distance ?? 1e4), this.uSubgridOpacity = we(e?.subgridOpacity ?? 0.15), this.uGridOpacity = we(e?.gridOpacity ?? 0.25);
5924
5916
  const { uScale: t, uDivisions: s, uColor: n, uDistance: r, uSubgridOpacity: a, uGridOpacity: o } = this, c = Dn("vec3", "vWorldPosition");
5925
- this.positionNode = wt(() => {
5917
+ this.positionNode = Ot(() => {
5926
5918
  const h = In.xzy.mul(r).add(
5927
- Un(it.x, Y(0), it.z)
5919
+ Un(tt.x, Z(0), tt.z)
5928
5920
  );
5929
5921
  return c.assign(h), h;
5930
5922
  })();
5931
- const l = wt(([h]) => {
5932
- const d = c.xz.div(h), u = Ln(d), m = mi(kn(d.sub(0.5)).sub(0.5)).div(u).div(2), y = xt(m.x, m.y);
5933
- return Y(1).sub(xt(y, Y(1)));
5923
+ const l = Ot(([h]) => {
5924
+ const d = c.xz.div(h), u = Ln(d), m = mi(kn(d.sub(0.5)).sub(0.5)).div(u).div(2), y = wt(m.x, m.y);
5925
+ return Z(1).sub(wt(y, Z(1)));
5934
5926
  });
5935
- this.outputNode = wt(() => {
5936
- const h = c, d = fi(Y(200), mi(it.y.sub(h.y))), u = Y(Nn(it, h)), m = gi(d).div(gi(s)), y = vi(s, Fn(m)), v = y.mul(s), C = v.mul(s), g = l(y.mul(t)), _ = l(v.mul(t)), E = l(C.mul(t)), S = d.sub(y).div(v.sub(y)), b = Y(0.3), O = fi(
5937
- S.sub(Y(1)).add(b),
5938
- Y(0)
5927
+ this.outputNode = Ot(() => {
5928
+ const h = c, d = fi(Z(200), mi(tt.y.sub(h.y))), u = Z(Nn(tt, h)), m = gi(d).div(gi(s)), y = vi(s, Fn(m)), v = y.mul(s), C = v.mul(s), g = l(y.mul(t)), _ = l(v.mul(t)), E = l(C.mul(t)), S = d.sub(y).div(v.sub(y)), b = Z(0.3), O = fi(
5929
+ S.sub(Z(1)).add(b),
5930
+ Z(0)
5939
5931
  ).div(b), w = g.mul(
5940
- vi(Y(1).sub(xt(u.div(r), Y(1))), Y(3))
5941
- ), D = Y(0.5), x = w.sub(O).mul(a), N = _i(
5932
+ vi(Z(1).sub(wt(u.div(r), Z(1))), Z(3))
5933
+ ), D = Z(0.5), x = w.sub(O).mul(a), N = _i(
5942
5934
  x,
5943
5935
  w.mul(o).sub(
5944
5936
  O.mul(o.sub(a)).mul(D)
5945
5937
  ),
5946
5938
  _
5947
- ), Q = Y(_i(N, w.mul(o), E));
5948
- return zn(Hn(Q, Y(1 / 127)), () => {
5939
+ ), Q = Z(_i(N, w.mul(o), E));
5940
+ return zn(Hn(Q, Z(1 / 127)), () => {
5949
5941
  Bn();
5950
5942
  }), Vn(n, Q);
5951
5943
  })();
@@ -5970,7 +5962,7 @@ class la extends an {
5970
5962
  this.uSubgridOpacity.value = e;
5971
5963
  }
5972
5964
  }
5973
- class ca extends ut {
5965
+ class ca extends dt {
5974
5966
  gridMaterial;
5975
5967
  constructor(e) {
5976
5968
  const t = new la(e);
@@ -5996,7 +5988,7 @@ class ca extends ut {
5996
5988
  this.gridMaterial.subgridOpacity = e;
5997
5989
  }
5998
5990
  }
5999
- function zt(i) {
5991
+ function Ft(i) {
6000
5992
  const [e, t] = L(i.selected), s = "toggle" + (e ? " selected" : "");
6001
5993
  return /* @__PURE__ */ f(
6002
5994
  "button",
@@ -6097,8 +6089,8 @@ class $ extends Zi {
6097
6089
  return $._instance || ($._instance = new $()), $._instance;
6098
6090
  }
6099
6091
  }
6100
- const ua = new cn(), Ht = new $e();
6101
- class Bt extends ci {
6092
+ const ua = new cn(), zt = new $e();
6093
+ class Ht extends ci {
6102
6094
  curve = new hi();
6103
6095
  line;
6104
6096
  draggable;
@@ -6115,12 +6107,12 @@ class Bt extends ci {
6115
6107
  _draggableScale = 10;
6116
6108
  _transform;
6117
6109
  raycaster;
6118
- draggedMat = new $t();
6110
+ draggedMat = new Gt();
6119
6111
  parentGroup;
6120
6112
  group;
6121
6113
  constructor(e, t) {
6122
- const s = new dt(Ot(0.5, 1, Math.random()), Ot(0.5, 1, Math.random()), Ot(0.5, 1, Math.random()));
6123
- super(), this.name = e, this.lineMaterial = new hn({ color: s }), this.line = new dn(new di(), this.lineMaterial), this.line.name = "line", this.line.visible = !1, this.add(this.line), this._camera = t, this.curveType = "catmullrom", this.draggedMat.color = s, this.draggable = new ci(), this.draggable.name = "draggablePoints", this.add(this.draggable), this.curvePos = new ut(new un(1.5), new $t({ color: s })), this.curvePos.name = "curvePos", this.curvePos.scale.setScalar(this._draggableScale), this.curvePos.visible = !1, this.add(this.curvePos), this.raycaster = new Wt(), this.raycaster.params.Line.threshold = 3, this.enable();
6114
+ const s = new ht(St(0.5, 1, Math.random()), St(0.5, 1, Math.random()), St(0.5, 1, Math.random()));
6115
+ super(), this.name = e, this.lineMaterial = new hn({ color: s }), this.line = new dn(new di(), this.lineMaterial), this.line.name = "line", this.line.visible = !1, this.add(this.line), this._camera = t, this.curveType = "catmullrom", this.draggedMat.color = s, this.draggable = new ci(), this.draggable.name = "draggablePoints", this.add(this.draggable), this.curvePos = new dt(new un(1.5), new Gt({ color: s })), this.curvePos.name = "curvePos", this.curvePos.scale.setScalar(this._draggableScale), this.curvePos.visible = !1, this.add(this.curvePos), this.raycaster = new $t(), this.raycaster.params.Line.threshold = 3, this.enable();
6124
6116
  }
6125
6117
  enable() {
6126
6118
  document.addEventListener("pointerdown", this.onMouseClick);
@@ -6164,7 +6156,7 @@ class Bt extends ci {
6164
6156
  }
6165
6157
  };
6166
6158
  addPoint = (e, t = !0) => {
6167
- const s = this.draggable.children.length, n = new ut(ua, this.draggedMat);
6159
+ const s = this.draggable.children.length, n = new dt(ua, this.draggedMat);
6168
6160
  n.name = `point_${s}`, n.position.copy(e), n.scale.setScalar(this._draggableScale), this.draggable.add(n), this._transform?.attach(n);
6169
6161
  const r = this.points.length > 1;
6170
6162
  return r && t && this.updateSpline(), this.line.visible = r, this.updateCurrentPoint(), n;
@@ -6202,7 +6194,7 @@ class Bt extends ci {
6202
6194
  onMouseClick = (e) => {
6203
6195
  if (!G.instance || !G.instance.currentWindow || this._transform && !this._transform.getHelper().visible) return;
6204
6196
  const s = G.instance.currentWindow.current.getBoundingClientRect();
6205
- Ht.x = (e.clientX - s.x) / s.width * 2 - 1, Ht.y = -((e.clientY - s.y) / s.height) * 2 + 1, this.raycaster.setFromCamera(Ht, this.camera);
6197
+ zt.x = (e.clientX - s.x) / s.width * 2 - 1, zt.y = -((e.clientY - s.y) / s.height) * 2 + 1, this.raycaster.setFromCamera(zt, this.camera);
6206
6198
  const n = this.raycaster.intersectObjects(this.draggable.children, !1);
6207
6199
  if (n.length > 0) {
6208
6200
  const r = n[0].object;
@@ -6435,7 +6427,7 @@ class Bt extends ci {
6435
6427
  e.name, e.visible = this.draggable.visible;
6436
6428
  };
6437
6429
  }
6438
- let ct = 0;
6430
+ let lt = 0;
6439
6431
  class pa extends Gs {
6440
6432
  defaultScale = 10;
6441
6433
  currentSpline = null;
@@ -6522,8 +6514,8 @@ class pa extends Gs {
6522
6514
  e.draggableScale = this.defaultScale, e.hideTransform(), this.group?.current !== null && e.initDebug(this.group.current, t), this.add(e), this.currentSpline = e;
6523
6515
  }
6524
6516
  createSpline = (e = []) => {
6525
- const t = `Spline ${ct + 1}`, s = new Bt(t, this._camera);
6526
- return s.addPoints(e), this.addSpline(s, !0), ct++, s;
6517
+ const t = `Spline ${lt + 1}`, s = new Ht(t, this._camera);
6518
+ return s.addPoints(e), this.addSpline(s, !0), lt++, s;
6527
6519
  };
6528
6520
  createSplineFromArray = (e) => {
6529
6521
  const t = [];
@@ -6537,7 +6529,7 @@ class pa extends Gs {
6537
6529
  e.points.forEach((n) => {
6538
6530
  t.push(new Le(n[0], n[1], n[2]));
6539
6531
  });
6540
- const s = new Bt(e.name, this._camera);
6532
+ const s = new Ht(e.name, this._camera);
6541
6533
  return s.closed = e.closed, s.subdivide = e.subdivide, s.tension = e.tension, s.type = e.type, s.addPoints(t), s.updateSpline(), this.addSpline(s, !1), s;
6542
6534
  };
6543
6535
  showPoints = (e = !0) => {
@@ -6546,12 +6538,12 @@ class pa extends Gs {
6546
6538
  });
6547
6539
  };
6548
6540
  onAddSpline = (e) => {
6549
- const t = JSON.parse(e.value), s = t.name !== void 0 ? t.name : `Spline ${ct + 1}`, n = new Bt(s, this.camera);
6541
+ const t = JSON.parse(e.value), s = t.name !== void 0 ? t.name : `Spline ${lt + 1}`, n = new Ht(s, this.camera);
6550
6542
  t.tension !== void 0 && (n.tension = t.tension), t.closed !== void 0 && (n.closed = t.closed), t.subdivide !== void 0 && (n.subdivide = t.subdivide), t.type !== void 0 && (n.curveType = t.type);
6551
6543
  const r = [];
6552
6544
  t.points.forEach((a) => {
6553
6545
  r.push(new Le(a[0], a[1], a[2]));
6554
- }), n.addPoints(r), this.addSpline(n, !1), ct++;
6546
+ }), n.addPoints(r), this.addSpline(n, !1), lt++;
6555
6547
  };
6556
6548
  isMouseDown = !1;
6557
6549
  enableClickToDraw() {
@@ -6626,7 +6618,7 @@ const zi = [
6626
6618
  "Stacked",
6627
6619
  "Quad"
6628
6620
  ], ma = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAACXBIWXMAAAsTAAALEwEAmpwYAAAC60lEQVRYhe2YT4hNcRTHP48xpmYaNAvRyEQxEhnKQljYsRm9/EmSyJiMFAsMZWNhJYoNIUVJ2VGiyb9ZzIpMpkQSahbGv9GMYWrM+1rc2zjvzvvdd+99rzdvMd+6de75nd+5387vnN/v/G5KEuWMKRNNIB8mCRaKiiL5qQb2ApuBuUAV0Ad0AJeB3sSeJRX6LJbULTf6JTUn9Z+KWMUpPyp/Avoa4CNQZ3Sj/lNpdL/xottR7AjOkHRUUpekN5I6JbVLavDH75lIfZN0UFKTpCWS0pJem/HeJBEMG6yV1ONYtgFJbZJ+GF1jDh+zJb03NuliEuwMkMo4yErS2RA/LcbuYVyCrm1mA7Dal/8Cu4FG4JD/HsTTkCy6a+SVMTPQuc1sBKb78nHghi+/A+YBxwL2lbhRY+ThuARdEVxu5JdGFvACr0otdoZ8Y4+Rn0Sn5sFFsMvI6YB9MzA1YJ8mN8k1wAHzfj4uQVdyrpI0aJL7oqTtkq4FiqPLyCOSbktqlbRL0jlJQ2b8QdwCUZ4qvhRStZL0XFK1pMd57CRvq5mfhKBriRfiFUMY6oD7eOdwPlQAN4G10dfWg+uouwXsiOssAj4AC+JMcEWwvnAuOTEr7gTXPmg34zagOwkbIIOXAo9CbDYBrcBXYN+4UUdy2sRflyS5zVNlfPX7ugpJW5V9nI7mmh+lYU0lCZ2B3TOnAVuAk0BTwC5nuhWro46KauBOQJch5OpRaoIW34GreGf+YZdRqS9NAj4Bp4ClQDvwOWxCqSM4ADQEdKE5XvbXzlITrAVe4TW+M6NMKDXBFLAMuAD0ACfIc7pMZBXXA2cY3/xmodQRHAL2A2+NLtj8ZiEKwUL/z2WMPAJcAVYALWSf8dZuDFGWeBHwKxm3sWYhiGG8Tfo6sA2vSfiSy4GrH3wGrDcfKSSKKf6v1E9yF0XK9Q1XBPuMXMw8HXTonQFwETwNzMFr64v1jzgFHIk9ybHEZYPJo65QlD3Bf2/Q/eaHPiSWAAAAAElFTkSuQmCC", fa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAACXBIWXMAAAsTAAALEwEAmpwYAAAETklEQVRYhe2YXYhVVRTHf3d0/JhyUrMpFbImM+whSa3Mynww+4AeIgiKoozooQ+KyMyXIAujF6OXqHyI6iEKKYgIP/owsjSFqCkprdDUTEcjbWZ0HHV+Pex1ucfb9Z57Z9REXHA4Z++99l7/s/ZZ/7X2KaiczNLwfwPIk9MA+yunNMAG4DHgV+BvoB3YFff2TPstYEyfrajVroI6Sr1GvahsbJC63HzZq04pmztSvU5tVRuqYRiYg78JeBR4HPg5ntdmxovz9wJfA3uAxuibDLQCA+IqynnAQuBuYCnwMLC1rx48U12U8cZqdWqMDcx4cI16qTpYbVKHqa+ovWUeHKsujn7VL9ULq2HI+wY7gVeBJdGeFu3J4ZUiy/cAXeHRRuAQsC/GC0B3eG4BcH/0tUV7czUAeVsMsBF4Kha9HZgCvAncAuwPnXHA0wFuGLANuDrGuoGDwFxgTqzzQ7RX5FrP2eLsdb76vnogtme6+nE8H1YPlQXHwbi3q9eqn0e7Tb25VrsF68vFY0lb1AGcDTwItGQ8tQM4AIwGmqP/EPAu8A0wElgJfFGzxTo8mKWXu9Rd4ZF96jvqjSbauEC9Sn1O3R463epLaku99voCsFXdkAH3kNpcQW+IiT/bQne3eufxBtioPqP2mKhioXpWzpxb1T8C5Ifh4ZptVoriRmAIKdrI3Lujf3bobAPeJpF0NVkKrAFuI9HTOBIxnxFrF4OgQKKr/dnJlQA+AcwABgOHA4zAamA5cE7orQL+zAEHiWI+A2bFC7aSguheYCgpqAphZz3wSB7AecCICv2TgH8oFRib4gVqka0k0h8CXAxMBW6ooDejFoCvA9OBQUAvKWM0kDz4XUZvNKXtyZMWUl7vBbaQXq457PeEziDgx/KJlQAuIPFdMcEXv5OdYWBP9M8k8VpnDQCvB4aTSrCNJB5cSdrW3tBpIJVnR0qdUTxAfdGUOVTnmwqEanNmqltC/9OgqePKg5eom8PgdvW+oJ9Kupera0O3U50TL3lcAaI+oHaF4R3qa6Z822wq0Saq89T1lmSxOrxeW/Xm4uGkiqQDmECKuKHxHW0HdpMiewSpvGqKeR8Ay0iBsYIjg6261PE2o9Q3Yqv+MqWxO9R1Hl12qs+q49Vlppy82pSr+5xJKsko4AXgHlJ0t5NIeg3wLXAlqZhtIUV8J6nmWwX8QiLjdhL5TwMWkY4R6/rrwYKlMr1Y321QZ/vfwBijPqm+rF4Wc7PjE9QllurGVeoV5gRNHsAm9fnMom3qrKPoTjKdMXaYyrFygEWQ72XWW24qhPu8xcUc2UU6O8wFPjmK7jhgPHAuMJGUGQ6U6WwE5sfzTXGvei7KA9hFOiR9D/wOfFVFt4dS2tpfRe83Ur7/CPiJakfOGgBCypubatArl2r8VfOax/LfzABKtePAzHO/5FgC7KBEzB2kOrDfUm8mOeFySv9+OyFyGmB/5aQH+C9BVKmVCNuMZgAAAABJRU5ErkJggg==", ga = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAQ0lEQVQ4jWP8////fwYqAxYozUhFM/8zkaKYWIWkGEq0b0ZdSjQY5i79TyWagRGaTUdzFEEw6lLqGzqwLoVVJ1StpwA9sBwbUqAh5gAAAABJRU5ErkJggg==";
6629
- class G extends Qe {
6621
+ class G extends Xe {
6630
6622
  static instance = null;
6631
6623
  scene;
6632
6624
  renderer;
@@ -6649,7 +6641,7 @@ class G extends Qe {
6649
6641
  depthMaterial;
6650
6642
  normalsMaterial;
6651
6643
  uvMaterial;
6652
- wireframeMaterial = new $t({
6644
+ wireframeMaterial = new Gt({
6653
6645
  opacity: 0.33,
6654
6646
  transparent: !0,
6655
6647
  wireframe: !0
@@ -6678,7 +6670,7 @@ class G extends Qe {
6678
6670
  cameraControlsStartTime = 0;
6679
6671
  cameraControlsLastTime = 0;
6680
6672
  debugCamera;
6681
- raycaster = new Wt();
6673
+ raycaster = new $t();
6682
6674
  pointer = new $e();
6683
6675
  cameraControls = void 0;
6684
6676
  // References
@@ -6719,7 +6711,7 @@ class G extends Qe {
6719
6711
  Spherical: _n,
6720
6712
  Box3: vn,
6721
6713
  Sphere: gn,
6722
- Raycaster: Wt
6714
+ Raycaster: $t
6723
6715
  };
6724
6716
  ae.install({ THREE: r }), this.setupScene(), this.setupTools();
6725
6717
  const a = localStorage.getItem(this.expandedCameraVisibility);
@@ -6745,7 +6737,7 @@ class G extends Qe {
6745
6737
  }), /* @__PURE__ */ M("div", { className: "multiview", children: [
6746
6738
  /* @__PURE__ */ f("canvas", { ref: this.canvasRef }),
6747
6739
  /* @__PURE__ */ M("div", { className: `cameras ${this.state.mode === "Single" || this.state.mode === "Stacked" ? "single" : ""}`, ref: this.containerRef, children: [
6748
- this.state.mode === "Single" && /* @__PURE__ */ f(q, { children: /* @__PURE__ */ f(
6740
+ this.state.mode === "Single" && /* @__PURE__ */ f(Y, { children: /* @__PURE__ */ f(
6749
6741
  _e,
6750
6742
  {
6751
6743
  name: "tl",
@@ -6762,7 +6754,7 @@ class G extends Qe {
6762
6754
  }
6763
6755
  }
6764
6756
  ) }),
6765
- (this.state.mode === "Side by Side" || this.state.mode === "Stacked") && /* @__PURE__ */ M(q, { children: [
6757
+ (this.state.mode === "Side by Side" || this.state.mode === "Stacked") && /* @__PURE__ */ M(Y, { children: [
6766
6758
  /* @__PURE__ */ f(
6767
6759
  _e,
6768
6760
  {
@@ -6798,7 +6790,7 @@ class G extends Qe {
6798
6790
  }
6799
6791
  )
6800
6792
  ] }),
6801
- this.state.mode === "Quad" && /* @__PURE__ */ M(q, { children: [
6793
+ this.state.mode === "Quad" && /* @__PURE__ */ M(Y, { children: [
6802
6794
  /* @__PURE__ */ f(
6803
6795
  _e,
6804
6796
  {
@@ -6871,7 +6863,7 @@ class G extends Qe {
6871
6863
  ] }),
6872
6864
  /* @__PURE__ */ M("div", { className: "settings", children: [
6873
6865
  /* @__PURE__ */ f(
6874
- ft,
6866
+ mt,
6875
6867
  {
6876
6868
  title: "View",
6877
6869
  index: zi.indexOf(this.state.mode),
@@ -6890,7 +6882,7 @@ class G extends Qe {
6890
6882
  }
6891
6883
  ),
6892
6884
  /* @__PURE__ */ f(
6893
- ft,
6885
+ mt,
6894
6886
  {
6895
6887
  title: "Interact",
6896
6888
  index: this.state.interactionMode === "Orbit" ? 0 : 1,
@@ -6912,7 +6904,7 @@ class G extends Qe {
6912
6904
  }
6913
6905
  ),
6914
6906
  /* @__PURE__ */ f(
6915
- zt,
6907
+ Ft,
6916
6908
  {
6917
6909
  name: "cameraHelper",
6918
6910
  icon: ma,
@@ -6930,7 +6922,7 @@ class G extends Qe {
6930
6922
  }
6931
6923
  ),
6932
6924
  /* @__PURE__ */ f(
6933
- zt,
6925
+ Ft,
6934
6926
  {
6935
6927
  name: "lightHelper",
6936
6928
  icon: fa,
@@ -6948,7 +6940,7 @@ class G extends Qe {
6948
6940
  }
6949
6941
  ),
6950
6942
  /* @__PURE__ */ f(
6951
- zt,
6943
+ Ft,
6952
6944
  {
6953
6945
  name: "gridHelper",
6954
6946
  icon: ga,
@@ -6967,12 +6959,16 @@ class G extends Qe {
6967
6959
  setupRenderer = (e) => {
6968
6960
  const t = e.value;
6969
6961
  if (this.renderer) {
6970
- if (this.renderer instanceof qe && t.type === "WebGLRenderer" || this.renderer instanceof Ge && t.type === "WebGPURenderer") return;
6962
+ if (this.renderer instanceof ai && t.type === "WebGLRenderer" || this.renderer instanceof Ge && t.type === "WebGPURenderer") return;
6971
6963
  this.renderer.dispose();
6972
6964
  }
6973
6965
  this.rendererReady = !1;
6974
6966
  const s = this.canvasRef.current;
6975
- this.props.three.canvas = s, t.type === "WebGLRenderer" ? (this.renderer = new qe({
6967
+ if (s === null) {
6968
+ setTimeout(() => this.props.three.requestRenderer(), 100);
6969
+ return;
6970
+ }
6971
+ this.props.three.canvas = s, t.type === "WebGLRenderer" ? (this.renderer = new ai({
6976
6972
  canvas: s,
6977
6973
  stencil: !1
6978
6974
  }), this.grid && (this.scene.remove(this.grid), ie(this.grid)), this.grid = new oa(), this.scene.add(this.grid), this.rendererReady = !0) : t.type === "WebGPURenderer" && (this.renderer = new Ge({
@@ -7253,7 +7249,7 @@ class G extends Qe {
7253
7249
  if (e.ctrlKey) {
7254
7250
  if (this.currentCamera.name === "UI") return;
7255
7251
  const t = this.controls.get(this.currentCamera.name);
7256
- e.key === "0" ? (e.preventDefault(), this.clearControls(), this.cameraControls = new ae(this.currentCamera, this.currentWindow.current), this.selectedItem instanceof ut || this.selectedItem instanceof On ? (this.selectedItem.geometry.computeBoundingBox(), this.cameraControls.fitToBox(this.selectedItem.geometry.boundingBox, !0)) : this.cameraControls.fitToSphere(this.selectedItem, !0), this.updateCameraControls(t, !0)) : e.key === "1" ? (e.preventDefault(), this.clearControls(), this.cameraControls = new ae(this.currentCamera, this.currentWindow.current), this.cameraControls.rotateTo(0, Math.PI * 0.5, !0), this.cameraControls.moveTo(this.selectedItem.position.x, this.selectedItem.position.y, 0, !0), this.updateCameraControls(t)) : e.key === "2" ? (e.preventDefault(), this.clearControls(), this.cameraControls = new ae(this.currentCamera, this.currentWindow.current), this.cameraControls.rotateTo(0, 0, !0), this.cameraControls.moveTo(this.selectedItem.position.x, 0, this.selectedItem.position.z, !0), this.updateCameraControls(t)) : e.key === "3" ? (e.preventDefault(), this.clearControls(), this.cameraControls = new ae(this.currentCamera, this.currentWindow.current), this.cameraControls.rotateTo(Math.PI / 2, Math.PI / 2, !0), this.cameraControls.moveTo(0, this.selectedItem.position.y, this.selectedItem.position.z, !0), this.updateCameraControls(t)) : e.key === "4" ? (e.preventDefault(), this.clearControls(), this.cameraControls = new ae(this.currentCamera, this.currentWindow.current), this.cameraControls.rotateTo(Math.PI, Math.PI / 2, !0), this.cameraControls.moveTo(this.selectedItem.position.x, this.selectedItem.position.y, 0, !0), this.updateCameraControls(t)) : e.key === "5" && (e.preventDefault(), this.clearControls(), this.cameraControls = new ae(this.currentCamera, this.currentWindow.current), this.cameraControls.rotateTo(Yt(45), Yt(45), !0), this.updateCameraControls(t));
7252
+ e.key === "0" ? (e.preventDefault(), this.clearControls(), this.cameraControls = new ae(this.currentCamera, this.currentWindow.current), this.selectedItem instanceof dt || this.selectedItem instanceof On ? (this.selectedItem.geometry.computeBoundingBox(), this.cameraControls.fitToBox(this.selectedItem.geometry.boundingBox, !0)) : this.cameraControls.fitToSphere(this.selectedItem, !0), this.updateCameraControls(t, !0)) : e.key === "1" ? (e.preventDefault(), this.clearControls(), this.cameraControls = new ae(this.currentCamera, this.currentWindow.current), this.cameraControls.rotateTo(0, Math.PI * 0.5, !0), this.cameraControls.moveTo(this.selectedItem.position.x, this.selectedItem.position.y, 0, !0), this.updateCameraControls(t)) : e.key === "2" ? (e.preventDefault(), this.clearControls(), this.cameraControls = new ae(this.currentCamera, this.currentWindow.current), this.cameraControls.rotateTo(0, 0, !0), this.cameraControls.moveTo(this.selectedItem.position.x, 0, this.selectedItem.position.z, !0), this.updateCameraControls(t)) : e.key === "3" ? (e.preventDefault(), this.clearControls(), this.cameraControls = new ae(this.currentCamera, this.currentWindow.current), this.cameraControls.rotateTo(Math.PI / 2, Math.PI / 2, !0), this.cameraControls.moveTo(0, this.selectedItem.position.y, this.selectedItem.position.z, !0), this.updateCameraControls(t)) : e.key === "4" ? (e.preventDefault(), this.clearControls(), this.cameraControls = new ae(this.currentCamera, this.currentWindow.current), this.cameraControls.rotateTo(Math.PI, Math.PI / 2, !0), this.cameraControls.moveTo(this.selectedItem.position.x, this.selectedItem.position.y, 0, !0), this.updateCameraControls(t)) : e.key === "5" && (e.preventDefault(), this.clearControls(), this.cameraControls = new ae(this.currentCamera, this.currentWindow.current), this.cameraControls.rotateTo(Wt(45), Wt(45), !0), this.updateCameraControls(t));
7257
7253
  } else if (this.currentTransform !== void 0)
7258
7254
  switch (e.key) {
7259
7255
  case "r":
@@ -7299,7 +7295,7 @@ class G extends Qe {
7299
7295
  x: this.selectedItem.rotation.x,
7300
7296
  y: this.selectedItem.rotation.y,
7301
7297
  z: this.selectedItem.rotation.z
7302
- }), this.props.three.updateObject(this.selectedItem.uuid, "scale", this.selectedItem.scale), bt.instance.update());
7298
+ }), this.props.three.updateObject(this.selectedItem.uuid, "scale", this.selectedItem.scale), Ct.instance.update());
7303
7299
  };
7304
7300
  // Utils
7305
7301
  clearLightHelpers = () => {
@@ -7398,7 +7394,7 @@ class G extends Qe {
7398
7394
  this.cameraControlsStartTime = performance.now(), this.cameraControlsLastTime = this.cameraControlsStartTime, this.selectedItem.getWorldPosition(e.target0);
7399
7395
  const n = () => {
7400
7396
  const r = performance.now(), a = (r - this.cameraControlsLastTime) / 1e3;
7401
- this.cameraControlsLastTime = r, this.cameraControls && this.cameraControls.update(a), t && (e.target.lerp(e.target0, s), e.object.position.lerp(e.position0, s), e.object.zoom = Xe(e.object.zoom, e.zoom0, s), e.object.updateProjectionMatrix(), e.dispatchEvent({ type: "change" })), (r - this.cameraControlsStartTime) / 1e3 >= 0.5 ? (cancelAnimationFrame(this.cameraControlsRafID), this.cameraControlsRafID = -1, this.clearControls()) : this.cameraControlsRafID = requestAnimationFrame(n);
7397
+ this.cameraControlsLastTime = r, this.cameraControls && this.cameraControls.update(a), t && (e.target.lerp(e.target0, s), e.object.position.lerp(e.position0, s), e.object.zoom = Ke(e.object.zoom, e.zoom0, s), e.object.updateProjectionMatrix(), e.dispatchEvent({ type: "change" })), (r - this.cameraControlsStartTime) / 1e3 >= 0.5 ? (cancelAnimationFrame(this.cameraControlsRafID), this.cameraControlsRafID = -1, this.clearControls()) : this.cameraControlsRafID = requestAnimationFrame(n);
7402
7398
  };
7403
7399
  n();
7404
7400
  };
@@ -7481,7 +7477,7 @@ class G extends Qe {
7481
7477
  return `${this.appID}_multiviewGridVisibility`;
7482
7478
  }
7483
7479
  }
7484
- class bt extends Qe {
7480
+ class Ct extends Xe {
7485
7481
  static instance;
7486
7482
  matrix = new Wi();
7487
7483
  position = new Le();
@@ -7494,7 +7490,7 @@ class bt extends Qe {
7494
7490
  this.open = s, this.saveExpanded(), this.state = {
7495
7491
  lastUpdated: 0,
7496
7492
  expanded: s
7497
- }, this.matrix.elements = e.object.matrix, e.object.uuid.length > 0 && (this.position.setFromMatrixPosition(this.matrix), this.rotation.setFromRotationMatrix(this.matrix), this.scale.setFromMatrixScale(this.matrix)), bt.instance = this;
7493
+ }, this.matrix.elements = e.object.matrix, e.object.uuid.length > 0 && (this.position.setFromMatrixPosition(this.matrix), this.rotation.setFromRotationMatrix(this.matrix), this.scale.setFromMatrixScale(this.matrix)), Ct.instance = this;
7498
7494
  }
7499
7495
  update() {
7500
7496
  if (G.instance) {
@@ -7605,7 +7601,7 @@ function va(i, e) {
7605
7601
  type: "color",
7606
7602
  value: c,
7607
7603
  onChange: (l, h) => {
7608
- const d = new et(h);
7604
+ const d = new Je(h);
7609
7605
  e.updateObject(i.uuid, l, d);
7610
7606
  const u = e.getScene(i.uuid);
7611
7607
  if (u !== null) {
@@ -7732,7 +7728,7 @@ function _a(i) {
7732
7728
  }
7733
7729
  );
7734
7730
  }
7735
- const Vt = {
7731
+ const Bt = {
7736
7732
  name: "",
7737
7733
  uuid: "",
7738
7734
  type: "",
@@ -7746,13 +7742,13 @@ const Vt = {
7746
7742
  children: []
7747
7743
  };
7748
7744
  function ya(i) {
7749
- const [e, t] = L(Vt);
7745
+ const [e, t] = L(Bt);
7750
7746
  pe(() => {
7751
7747
  function a(c) {
7752
7748
  t(c.value);
7753
7749
  }
7754
7750
  function o() {
7755
- t(Vt);
7751
+ t(Bt);
7756
7752
  }
7757
7753
  return i.three.addEventListener(R.CLEAR_OBJECT, o), i.three.addEventListener(R.SET_SCENE, o), i.three.addEventListener(R.SET_OBJECT, a), () => {
7758
7754
  i.three.removeEventListener(R.CLEAR_OBJECT, o), i.three.removeEventListener(R.SET_SCENE, o), i.three.removeEventListener(R.SET_OBJECT, a);
@@ -7760,17 +7756,17 @@ function ya(i) {
7760
7756
  }, []);
7761
7757
  const s = e.type.toLowerCase(), n = e.animations.length > 0 || e.mixer !== void 0, r = s.search("mesh") > -1 || s.search("line") > -1 || s.search("points") > -1;
7762
7758
  return /* @__PURE__ */ f(
7763
- je,
7759
+ qe,
7764
7760
  {
7765
7761
  three: i.three,
7766
7762
  label: "Inspector",
7767
7763
  button: e.uuid.length > 0 ? /* @__PURE__ */ f("button", { className: "remove", onClick: () => {
7768
- $.instance.remove(e.name), t(Vt);
7764
+ $.instance.remove(e.name), t(Bt);
7769
7765
  } }) : void 0,
7770
- children: /* @__PURE__ */ f("div", { id: "Inspector", className: i.class, children: e.uuid.length > 0 && /* @__PURE__ */ M(q, { children: [
7771
- /* @__PURE__ */ M(q, { children: [
7766
+ children: /* @__PURE__ */ f("div", { id: "Inspector", className: i.class, children: e.uuid.length > 0 && /* @__PURE__ */ M(Y, { children: [
7767
+ /* @__PURE__ */ M(Y, { children: [
7772
7768
  /* @__PURE__ */ f(
7773
- ht,
7769
+ ct,
7774
7770
  {
7775
7771
  type: "string",
7776
7772
  title: "Name",
@@ -7780,7 +7776,7 @@ function ya(i) {
7780
7776
  }
7781
7777
  ),
7782
7778
  /* @__PURE__ */ f(
7783
- ht,
7779
+ ct,
7784
7780
  {
7785
7781
  type: "string",
7786
7782
  title: "Type",
@@ -7790,7 +7786,7 @@ function ya(i) {
7790
7786
  }
7791
7787
  ),
7792
7788
  /* @__PURE__ */ f(
7793
- ht,
7789
+ ct,
7794
7790
  {
7795
7791
  type: "string",
7796
7792
  title: "UUID",
@@ -7800,8 +7796,8 @@ function ya(i) {
7800
7796
  }
7801
7797
  )
7802
7798
  ] }),
7803
- /* @__PURE__ */ M(q, { children: [
7804
- /* @__PURE__ */ f(bt, { object: e, three: i.three }),
7799
+ /* @__PURE__ */ M(Y, { children: [
7800
+ /* @__PURE__ */ f(Ct, { object: e, three: i.three }),
7805
7801
  n ? /* @__PURE__ */ f(_a, { object: e, three: i.three }) : null,
7806
7802
  s.search("camera") > -1 ? ea(e, i.three) : null,
7807
7803
  s.search("light") > -1 ? va(e, i.three) : null,
@@ -7812,15 +7808,11 @@ function ya(i) {
7812
7808
  "Inspector"
7813
7809
  );
7814
7810
  }
7815
- class Ca extends Qe {
7811
+ class Ca extends Xe {
7816
7812
  // Renderer
7817
- autoClear = !0;
7818
7813
  autoClearColor = !0;
7819
- autoClearDepth = !0;
7820
- autoClearStencil = !0;
7821
7814
  outputColorSpace = oi;
7822
- localClippingEnabled = !1;
7823
- clearColor = new et(0);
7815
+ clearColor = new Je(0);
7824
7816
  clearAlpha = 1;
7825
7817
  toneMapping = li;
7826
7818
  toneMappingExposure = 1;
@@ -7833,7 +7825,7 @@ class Ca extends Qe {
7833
7825
  lastUpdated: Date.now()
7834
7826
  }, this.saveExpanded(s), G.instance) {
7835
7827
  const n = G.instance.renderer;
7836
- n && (this.autoClear = n.autoClear, this.autoClearColor = n.autoClearColor, this.autoClearDepth = n.autoClearDepth, this.autoClearStencil = n.autoClearStencil, this.clearAlpha = n.getClearAlpha(), this.toneMapping = n.toneMapping, this.toneMappingExposure = n.toneMappingExposure, n instanceof qe && (this.localClippingEnabled = n.localClippingEnabled, n.getClearColor(this.clearColor)));
7828
+ n && (this.autoClearColor = n.autoClearColor, this.clearAlpha = n.getClearAlpha(), this.toneMapping = n.toneMapping, this.toneMappingExposure = n.toneMappingExposure);
7837
7829
  }
7838
7830
  this.props.three.addEventListener(R.ADD_RENDERER, this.onAddRenderer);
7839
7831
  }
@@ -7842,9 +7834,9 @@ class Ca extends Qe {
7842
7834
  }
7843
7835
  onAddRenderer = (e) => {
7844
7836
  const t = e.value;
7845
- if (this.autoClear = t.autoClear, this.autoClearColor = t.autoClearColor, this.autoClearDepth = t.autoClearDepth, this.autoClearStencil = t.autoClearStencil, this.outputColorSpace = t.outputColorSpace, this.localClippingEnabled = t.localClippingEnabled, this.clearAlpha = t.clearAlpha, this.type = t.type, this.toneMapping = t.toneMapping, this.toneMappingExposure = t.toneMappingExposure, this.clearColor.setStyle(t.clearColor, Ke), tt.enabled = t.colorManagement, G.instance) {
7837
+ if (this.autoClearColor = t.autoClearColor, this.outputColorSpace = t.outputColorSpace, this.clearAlpha = t.clearAlpha, this.type = t.type, this.toneMapping = t.toneMapping, this.toneMappingExposure = t.toneMappingExposure, this.clearColor.setStyle(t.clearColor, je), et.enabled = t.colorManagement, G.instance) {
7846
7838
  const s = G.instance.renderer;
7847
- s && (s.autoClearColor = this.autoClearColor, s.outputColorSpace = this.outputColorSpace, s instanceof qe && (s.localClippingEnabled = this.localClippingEnabled), s.toneMapping = this.toneMapping, s.toneMappingExposure = this.toneMappingExposure, s.setClearColor(t.clearColor, this.clearAlpha));
7839
+ s && (s.autoClearColor = this.autoClearColor, s.outputColorSpace = this.outputColorSpace, s.toneMapping = this.toneMapping, s.toneMappingExposure = this.toneMappingExposure, s.setClearColor(t.clearColor, this.clearAlpha));
7848
7840
  }
7849
7841
  this.setState({ lastUpdated: Date.now() });
7850
7842
  };
@@ -7852,16 +7844,12 @@ class Ca extends Qe {
7852
7844
  const e = () => {
7853
7845
  if (G.instance) {
7854
7846
  const t = G.instance.renderer;
7855
- t && (t.autoClearColor = this.autoClearColor, t.outputColorSpace = this.outputColorSpace, t instanceof qe && (t.localClippingEnabled = this.localClippingEnabled), t.toneMapping = this.toneMapping, t.toneMappingExposure = this.toneMappingExposure, t.setClearColor(this.clearColor.getStyle(), this.clearAlpha), this.props.three.updateRenderer({
7856
- autoClear: this.autoClear,
7847
+ t && (t.autoClearColor = this.autoClearColor, t.outputColorSpace = this.outputColorSpace, t.toneMapping = this.toneMapping, t.toneMappingExposure = this.toneMappingExposure, t.setClearColor(this.clearColor.getStyle(), this.clearAlpha), this.props.three.updateRenderer({
7857
7848
  autoClearColor: this.autoClearColor,
7858
- autoClearDepth: this.autoClearDepth,
7859
- autoClearStencil: this.autoClearStencil,
7860
7849
  outputColorSpace: this.outputColorSpace,
7861
- localClippingEnabled: this.localClippingEnabled,
7862
7850
  clearAlpha: this.clearAlpha,
7863
7851
  clearColor: this.clearColor.getStyle(),
7864
- colorManagement: tt.enabled,
7852
+ colorManagement: et.enabled,
7865
7853
  toneMapping: this.toneMapping,
7866
7854
  toneMappingExposure: this.toneMappingExposure
7867
7855
  }));
@@ -7874,14 +7862,6 @@ class Ca extends Qe {
7874
7862
  title: "Renderer",
7875
7863
  expanded: this.state.expanded,
7876
7864
  items: [
7877
- {
7878
- type: "boolean",
7879
- title: "Auto Clear",
7880
- value: this.autoClear,
7881
- onChange: (t, s) => {
7882
- this.autoClear = s;
7883
- }
7884
- },
7885
7865
  {
7886
7866
  type: "boolean",
7887
7867
  title: "Auto Clear Color",
@@ -7890,30 +7870,6 @@ class Ca extends Qe {
7890
7870
  this.autoClearColor = s, e();
7891
7871
  }
7892
7872
  },
7893
- {
7894
- type: "boolean",
7895
- title: "Auto Clear Depth",
7896
- value: this.autoClearDepth,
7897
- onChange: (t, s) => {
7898
- this.autoClearDepth = s, e();
7899
- }
7900
- },
7901
- {
7902
- type: "boolean",
7903
- title: "Auto Clear Stencil",
7904
- value: this.autoClearStencil,
7905
- onChange: (t, s) => {
7906
- this.autoClearStencil = s, e();
7907
- }
7908
- },
7909
- {
7910
- type: "boolean",
7911
- title: "Local Clipping",
7912
- value: this.localClippingEnabled,
7913
- onChange: (t, s) => {
7914
- this.localClippingEnabled = s, e();
7915
- }
7916
- },
7917
7873
  {
7918
7874
  type: "color",
7919
7875
  title: "Clear Color",
@@ -7936,9 +7892,9 @@ class Ca extends Qe {
7936
7892
  {
7937
7893
  type: "boolean",
7938
7894
  title: "Color Management",
7939
- value: tt.enabled,
7895
+ value: et.enabled,
7940
7896
  onChange: (t, s) => {
7941
- tt.enabled = s, e();
7897
+ et.enabled = s, e();
7942
7898
  }
7943
7899
  },
7944
7900
  {
@@ -7956,7 +7912,7 @@ class Ca extends Qe {
7956
7912
  },
7957
7913
  {
7958
7914
  title: "Linear SRB Color Space",
7959
- value: Ke
7915
+ value: je
7960
7916
  }
7961
7917
  ],
7962
7918
  onChange: (t, s) => {
@@ -8051,7 +8007,7 @@ function ba(i) {
8051
8007
  if (h.uuid === e[d].uuid) return;
8052
8008
  e.push(h), t.push(
8053
8009
  /* @__PURE__ */ f(
8054
- je,
8010
+ qe,
8055
8011
  {
8056
8012
  three: i.three,
8057
8013
  label: `Scene: ${h.name}`,
@@ -8061,7 +8017,7 @@ function ba(i) {
8061
8017
  onRefresh: () => {
8062
8018
  i.three.refreshScene(h.name);
8063
8019
  },
8064
- children: /* @__PURE__ */ f(Pt, { child: h, scene: h, three: i.three })
8020
+ children: /* @__PURE__ */ f(Rt, { child: h, scene: h, three: i.three })
8065
8021
  },
8066
8022
  h.name
8067
8023
  )
@@ -8071,7 +8027,7 @@ function ba(i) {
8071
8027
  for (let d = 0; d < e.length; d++)
8072
8028
  if (h.uuid === e[d].uuid) {
8073
8029
  e[d] = h, t[d] = /* @__PURE__ */ f(
8074
- je,
8030
+ qe,
8075
8031
  {
8076
8032
  three: i.three,
8077
8033
  label: `Scene: ${h.name}`,
@@ -8081,7 +8037,7 @@ function ba(i) {
8081
8037
  onRefresh: () => {
8082
8038
  i.three.refreshScene(h.name);
8083
8039
  },
8084
- children: /* @__PURE__ */ f(Pt, { child: h, scene: h, three: i.three })
8040
+ children: /* @__PURE__ */ f(Rt, { child: h, scene: h, three: i.three })
8085
8041
  },
8086
8042
  h.name
8087
8043
  ), n(Date.now());
@@ -8099,7 +8055,7 @@ function ba(i) {
8099
8055
  for (let d = 0; d < e.length; d++) {
8100
8056
  const u = e[d], m = u.name === h;
8101
8057
  t[d] = /* @__PURE__ */ f(
8102
- je,
8058
+ qe,
8103
8059
  {
8104
8060
  three: i.three,
8105
8061
  label: `Scene: ${u.name}`,
@@ -8109,7 +8065,7 @@ function ba(i) {
8109
8065
  onRefresh: () => {
8110
8066
  i.three.refreshScene(u.name);
8111
8067
  },
8112
- children: /* @__PURE__ */ f(Pt, { child: u, scene: u, three: i.three })
8068
+ children: /* @__PURE__ */ f(Rt, { child: u, scene: u, three: i.three })
8113
8069
  },
8114
8070
  u.name
8115
8071
  );
@@ -8131,7 +8087,7 @@ const fs = Bi((i, e) => /* @__PURE__ */ M("div", { className: "editor", ref: e,
8131
8087
  i.footer && /* @__PURE__ */ f("div", { className: "footer", children: i.footer })
8132
8088
  ] }));
8133
8089
  fs.displayName = "Editor";
8134
- function Ea(i) {
8090
+ function vo(i) {
8135
8091
  return /* @__PURE__ */ M(fs, { children: [
8136
8092
  /* @__PURE__ */ f(
8137
8093
  G,
@@ -8149,32 +8105,23 @@ function Ea(i) {
8149
8105
  function _o(i) {
8150
8106
  const {
8151
8107
  app: e,
8152
- scenes: t,
8153
- onSceneAdd: s,
8154
- onSceneUpdate: n,
8155
- onSceneResize: r,
8156
- onLoad: a,
8157
- renderLoading: o = null,
8158
- children: c
8159
- } = i, [l, h] = L(!1);
8108
+ renderEditor: t,
8109
+ onLoad: s,
8110
+ renderLoading: n = null,
8111
+ children: r
8112
+ } = i, [a, o] = L(!1);
8160
8113
  if (pe(() => {
8161
8114
  e.detectSettings().then(() => {
8162
- a ? a(e).then(() => h(!0)) : h(!0);
8115
+ s ? s(e).then(() => o(!0)) : o(!0);
8163
8116
  });
8164
- }, []), !l) return /* @__PURE__ */ f(q, { children: o });
8165
- const d = e.components.get("three");
8166
- return e.editor ? /* @__PURE__ */ f(
8167
- Ea,
8168
- {
8169
- three: d,
8170
- scenes: t,
8171
- onSceneAdd: s,
8172
- onSceneUpdate: n,
8173
- onSceneResize: r
8174
- }
8175
- ) : /* @__PURE__ */ f(q, { children: c?.(e) });
8117
+ }, []), !a) return /* @__PURE__ */ f(Y, { children: n });
8118
+ if (e.editor && t) {
8119
+ const c = e.components.get("three");
8120
+ return /* @__PURE__ */ f(Y, { children: t(c) });
8121
+ }
8122
+ return /* @__PURE__ */ f(Y, { children: r?.(e) });
8176
8123
  }
8177
- const Sa = `#include <common>
8124
+ const Ea = `#include <common>
8178
8125
  #include <batching_pars_vertex>
8179
8126
  #include <uv_pars_vertex>
8180
8127
  #include <color_pars_vertex>
@@ -8204,7 +8151,7 @@ void main() {
8204
8151
  #include <logdepthbuf_vertex>
8205
8152
  #include <clipping_planes_vertex>
8206
8153
  #include <worldpos_vertex>
8207
- }`, Oa = `
8154
+ }`, Sa = `
8208
8155
  uniform float opacity;
8209
8156
  #include <common>
8210
8157
  #include <uv_pars_fragment>
@@ -8224,29 +8171,29 @@ class yo extends ns {
8224
8171
  uniforms: {
8225
8172
  opacity: { value: 1 }
8226
8173
  },
8227
- vertexShader: Sa,
8228
- fragmentShader: Oa,
8174
+ vertexShader: Ea,
8175
+ fragmentShader: Sa,
8229
8176
  transparent: !0
8230
8177
  });
8231
8178
  }
8232
8179
  }
8233
8180
  export {
8234
- je as Accordion,
8235
- fo as Application,
8181
+ qe as Accordion,
8182
+ mo as Application,
8236
8183
  cs as BaseRemote,
8237
8184
  us as ChildObject,
8238
- Pt as ContainerObject,
8185
+ Rt as ContainerObject,
8239
8186
  ha as DepthNodeMaterial,
8240
8187
  Dr as Draggable,
8241
8188
  Pr as DraggableItem,
8242
8189
  Ir as Dropdown,
8243
8190
  Ur as DropdownItem,
8244
8191
  fs as Editor,
8245
- po as ElementProxy,
8192
+ uo as ElementProxy,
8246
8193
  br as ElementProxyReceiver,
8247
8194
  ce as ExportTexture,
8248
8195
  _o as HermesApp,
8249
- Fa as ImageSequenceCapturer,
8196
+ Na as ImageSequenceCapturer,
8250
8197
  oa as InfiniteGridHelper,
8251
8198
  ca as InfiniteGridHelperGPU,
8252
8199
  aa as InfiniteGridMaterial,
@@ -8254,66 +8201,66 @@ export {
8254
8201
  ya as Inspector,
8255
8202
  G as MultiView,
8256
8203
  ds as NavButton,
8257
- mo as ProxyManager,
8258
- go as RemoteTheatre,
8259
- vo as RemoteThree,
8204
+ po as ProxyManager,
8205
+ fo as RemoteTheatre,
8206
+ go as RemoteThree,
8260
8207
  ba as SidePanel,
8261
- Bt as Spline,
8208
+ Ht as Spline,
8262
8209
  pa as SplineEditor,
8263
- Ea as ThreeEditor,
8210
+ vo as ThreeEditor,
8264
8211
  $ as Transform,
8265
8212
  yo as UVMaterial,
8266
8213
  da as UVNodeMaterial,
8267
- uo as WebworkerEventHandlers,
8214
+ ho as WebworkerEventHandlers,
8268
8215
  dr as anchorGeometry,
8269
- Qa as anchorGeometryTL,
8270
- qa as animateObjectMaterial,
8271
- Za as animateObjectTransform,
8216
+ Xa as anchorGeometryTL,
8217
+ Za as animateObjectMaterial,
8218
+ Ya as animateObjectTransform,
8272
8219
  hr as applyObjectMaterial,
8273
- mt as capitalize,
8220
+ pt as capitalize,
8274
8221
  ye as clamp,
8275
- co as clearComposerGroups,
8222
+ lo as clearComposerGroups,
8276
8223
  yi as colorToHex,
8277
8224
  Zn as copyToClipboard,
8278
- io as createMask,
8279
- Ga as cubicBezier,
8280
- Ya as customizeTheatreElements,
8281
- Ba as damp,
8282
- Na as defaultTheatreCallback,
8225
+ to as createMask,
8226
+ Va as cubicBezier,
8227
+ Wa as customizeTheatreElements,
8228
+ Ha as damp,
8229
+ ka as defaultTheatreCallback,
8283
8230
  er as detectMaxFrameRate,
8284
8231
  tr as detectSettings,
8285
8232
  ie as dispose,
8286
8233
  ls as disposeMaterial,
8287
8234
  Oi as disposeTexture,
8288
- Ha as distance,
8289
- ho as generateCubemap,
8290
- Va as getAngle,
8235
+ za as distance,
8236
+ co as generateCubemap,
8237
+ Ba as getAngle,
8291
8238
  cr as getObjectMaterialObject,
8292
8239
  lr as getObjectMaterialProps,
8293
8240
  We as hierarchyUUID,
8294
- lo as inspectComposer,
8241
+ oo as inspectComposer,
8295
8242
  ur as inspectComposerPass,
8296
8243
  qn as isColor,
8297
- za as map,
8298
- Xe as mix,
8299
- pt as noop,
8300
- Zt as normalize,
8301
- ja as orthoCamera,
8302
- Ka as parseModelLite,
8244
+ Fa as map,
8245
+ Ke as mix,
8246
+ ut as noop,
8247
+ Yt as normalize,
8248
+ qa as orthoCamera,
8249
+ ja as parseModelLite,
8303
8250
  W as randomID,
8304
- Xa as renderToTexture,
8305
- nt as resetThreeObjects,
8306
- $a as rgbaToHex,
8251
+ Ka as renderToTexture,
8252
+ st as resetThreeObjects,
8253
+ Ga as rgbaToHex,
8307
8254
  te as roundTo,
8308
- ro as setMaterialBlendAdd,
8309
- ao as setMaterialBlendMultiply,
8310
- no as setMaterialBlendNormal,
8311
- oo as setMaterialBlendScreen,
8312
- to as supportsOffscreenCanvas,
8313
- qt as totalThreeObjects,
8314
- Jt as triangle,
8315
- Ja as updateCameraOrtho,
8316
- eo as updateCameraOrtho16x9,
8317
- so as useMask,
8318
- Wa as useStudio
8255
+ no as setMaterialBlendAdd,
8256
+ ro as setMaterialBlendMultiply,
8257
+ so as setMaterialBlendNormal,
8258
+ ao as setMaterialBlendScreen,
8259
+ eo as supportsOffscreenCanvas,
8260
+ Zt as totalThreeObjects,
8261
+ Qt as triangle,
8262
+ Qa as updateCameraOrtho,
8263
+ Ja as updateCameraOrtho16x9,
8264
+ io as useMask,
8265
+ $a as useStudio
8319
8266
  };