@tomorrowevening/hermes 0.0.59 → 0.0.61

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,7 +1,7 @@
1
- import { EventDispatcher as hn, Texture as fn, CubeTexture as Wn, RepeatWrapping as Ht, WebGLRenderTarget as Hn, Color as Lt, FrontSide as Yn, BackSide as mn, DoubleSide as pn, NoBlending as Vn, NormalBlending as qn, AdditiveBlending as Zn, SubtractiveBlending as Xn, MultiplyBlending as Jn, CustomBlending as Kn, AddEquation as Qn, SubtractEquation as ea, ReverseSubtractEquation as ta, MinEquation as na, MaxEquation as aa, ZeroFactor as gn, OneFactor as vn, SrcColorFactor as bn, OneMinusSrcColorFactor as yn, SrcAlphaFactor as xn, OneMinusSrcAlphaFactor as En, DstAlphaFactor as Cn, OneMinusDstAlphaFactor as Sn, DstColorFactor as wn, OneMinusDstColorFactor as Mn, SrcAlphaSaturateFactor as ia, ConstantColorFactor as On, OneMinusConstantColorFactor as Tn, ConstantAlphaFactor as _n, OneMinusConstantAlphaFactor as Rn, Matrix4 as ra, Vector3 as Y, Euler as sa, Line as oa, BufferGeometry as Yt, Float32BufferAttribute as Vt, LineBasicMaterial as ca, Mesh as Pn, MeshBasicMaterial as kn, Ray as la, Plane as ua, MathUtils as da, MOUSE as nt, TOUCH as at, Quaternion as qt, Spherical as Zt, Vector2 as fe, ShaderMaterial as jn, GLSL3 as ha, PlaneGeometry as fa, Scene as ma, Group as pa, AxesHelper as Xt, MeshDepthMaterial as ga, MeshNormalMaterial as va, WebGLRenderer as ba, PerspectiveCamera as kt, Raycaster as ya, OrthographicCamera as Jt, CameraHelper as xa, SpotLightHelper as Ea, PointLightHelper as Ca, HemisphereLightHelper as Sa, DirectionalLightHelper as wa } from "three";
1
+ import { EventDispatcher as hn, Texture as fn, CubeTexture as Wn, RepeatWrapping as Ht, WebGLRenderTarget as Hn, Color as Lt, FrontSide as Yn, BackSide as mn, DoubleSide as pn, NoBlending as Vn, NormalBlending as qn, AdditiveBlending as Kn, SubtractiveBlending as Zn, MultiplyBlending as Xn, CustomBlending as Jn, AddEquation as Qn, SubtractEquation as ea, ReverseSubtractEquation as ta, MinEquation as na, MaxEquation as aa, ZeroFactor as gn, OneFactor as vn, SrcColorFactor as bn, OneMinusSrcColorFactor as yn, SrcAlphaFactor as xn, OneMinusSrcAlphaFactor as En, DstAlphaFactor as Cn, OneMinusDstAlphaFactor as Sn, DstColorFactor as wn, OneMinusDstColorFactor as Mn, SrcAlphaSaturateFactor as ia, ConstantColorFactor as On, OneMinusConstantColorFactor as Tn, ConstantAlphaFactor as _n, OneMinusConstantAlphaFactor as Rn, Matrix4 as ra, Vector3 as Y, Euler as sa, Line as oa, BufferGeometry as Yt, Float32BufferAttribute as Vt, LineBasicMaterial as ca, Mesh as Pn, MeshBasicMaterial as kn, Ray as la, Plane as ua, MathUtils as da, MOUSE as nt, TOUCH as at, Quaternion as qt, Spherical as Kt, Vector2 as fe, ShaderMaterial as jn, GLSL3 as ha, PlaneGeometry as fa, Scene as ma, Group as pa, AxesHelper as Zt, MeshDepthMaterial as ga, MeshNormalMaterial as va, WebGLRenderer as ba, PerspectiveCamera as kt, Raycaster as ya, OrthographicCamera as Xt, CameraHelper as xa, SpotLightHelper as Ea, PointLightHelper as Ca, HemisphereLightHelper as Sa, DirectionalLightHelper as wa } from "three";
2
2
  import { Pane as Ma } from "tweakpane";
3
3
  import * as Oa from "@tweakpane/plugin-essentials";
4
- import An, { useState as X, useEffect as Ae, useRef as J, useMemo as ie, forwardRef as Ta } from "react";
4
+ import An, { useState as Z, useEffect as Ae, useRef as X, useMemo as ie, forwardRef as Ta } from "react";
5
5
  import { Reorder as Dn } from "framer-motion";
6
6
  const Bt = () => {
7
7
  }, Pi = () => {
@@ -9,10 +9,10 @@ const Bt = () => {
9
9
  function Mt(e) {
10
10
  return e.substring(0, 1).toUpperCase() + e.substring(1);
11
11
  }
12
- function Ze(e, n, a) {
12
+ function Ke(e, n, a) {
13
13
  return Math.min(n, Math.max(e, a));
14
14
  }
15
- function Kt(e, n, a) {
15
+ function Jt(e, n, a) {
16
16
  return (a - e) / (n - e);
17
17
  }
18
18
  function Qt(e, n, a) {
@@ -740,8 +740,8 @@ class Ni extends Ot {
740
740
  }
741
741
  }
742
742
  // Renderer
743
- rendererWidth = 0;
744
- rendererHeight = 0;
743
+ rendererWidth = 300;
744
+ rendererHeight = 150;
745
745
  addRT(n, a) {
746
746
  const t = new Hn(32, 32, a);
747
747
  t.texture.name = n, this.renderTargets.set(n, t);
@@ -753,7 +753,7 @@ class Ni extends Ot {
753
753
  }), this.renderer?.setSize(n, a);
754
754
  }
755
755
  set dpr(n) {
756
- this.renderer?.setPixelRatio(Ze(1, 2, n));
756
+ this.renderer?.setPixelRatio(Ke(1, 2, n));
757
757
  }
758
758
  get dpr() {
759
759
  return this.renderer !== void 0 ? this.renderer?.getPixelRatio() : 1;
@@ -927,11 +927,11 @@ var ut = {};
927
927
  var nn;
928
928
  function Fa() {
929
929
  return nn || (nn = 1, process.env.NODE_ENV !== "production" && function() {
930
- var e = An, n = Symbol.for("react.element"), a = Symbol.for("react.portal"), t = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), c = Symbol.for("react.profiler"), u = Symbol.for("react.provider"), o = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), h = Symbol.for("react.suspense"), f = Symbol.for("react.suspense_list"), m = Symbol.for("react.memo"), x = Symbol.for("react.lazy"), T = Symbol.for("react.offscreen"), H = Symbol.iterator, te = "@@iterator";
930
+ var e = An, n = Symbol.for("react.element"), a = Symbol.for("react.portal"), t = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), c = Symbol.for("react.profiler"), u = Symbol.for("react.provider"), o = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), h = Symbol.for("react.suspense"), f = Symbol.for("react.suspense_list"), m = Symbol.for("react.memo"), x = Symbol.for("react.lazy"), T = Symbol.for("react.offscreen"), W = Symbol.iterator, te = "@@iterator";
931
931
  function me(r) {
932
932
  if (r === null || typeof r != "object")
933
933
  return null;
934
- var p = H && r[H] || r[te];
934
+ var p = W && r[W] || r[te];
935
935
  return typeof p == "function" ? p : null;
936
936
  }
937
937
  var re = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
@@ -1147,18 +1147,18 @@ function Fa() {
1147
1147
  if (Le && S && typeof Le.stack == "string") {
1148
1148
  for (var R = Le.stack.split(`
1149
1149
  `), he = S.stack.split(`
1150
- `), Z = R.length - 1, Q = he.length - 1; Z >= 1 && Q >= 0 && R[Z] !== he[Q]; )
1150
+ `), K = R.length - 1, Q = he.length - 1; K >= 1 && Q >= 0 && R[K] !== he[Q]; )
1151
1151
  Q--;
1152
- for (; Z >= 1 && Q >= 0; Z--, Q--)
1153
- if (R[Z] !== he[Q]) {
1154
- if (Z !== 1 || Q !== 1)
1152
+ for (; K >= 1 && Q >= 0; K--, Q--)
1153
+ if (R[K] !== he[Q]) {
1154
+ if (K !== 1 || Q !== 1)
1155
1155
  do
1156
- if (Z--, Q--, Q < 0 || R[Z] !== he[Q]) {
1156
+ if (K--, Q--, Q < 0 || R[K] !== he[Q]) {
1157
1157
  var Ce = `
1158
- ` + R[Z].replace(" at new ", " at ");
1158
+ ` + R[K].replace(" at new ", " at ");
1159
1159
  return r.displayName && Ce.includes("<anonymous>") && (Ce = Ce.replace("<anonymous>", r.displayName)), typeof r == "function" && v.set(r, Ce), Ce;
1160
1160
  }
1161
- while (Z >= 1 && Q >= 0);
1161
+ while (K >= 1 && Q >= 0);
1162
1162
  break;
1163
1163
  }
1164
1164
  }
@@ -1204,13 +1204,13 @@ function Fa() {
1204
1204
  }
1205
1205
  return "";
1206
1206
  }
1207
- var E = Object.prototype.hasOwnProperty, F = {}, K = re.ReactDebugCurrentFrame;
1207
+ var E = Object.prototype.hasOwnProperty, F = {}, J = re.ReactDebugCurrentFrame;
1208
1208
  function O(r) {
1209
1209
  if (r) {
1210
1210
  var p = r._owner, b = C(r.type, r._source, p ? p.type : null);
1211
- K.setExtraStackFrame(b);
1211
+ J.setExtraStackFrame(b);
1212
1212
  } else
1213
- K.setExtraStackFrame(null);
1213
+ J.setExtraStackFrame(null);
1214
1214
  }
1215
1215
  function B(r, p, b, S, L) {
1216
1216
  {
@@ -1224,8 +1224,8 @@ function Fa() {
1224
1224
  throw he.name = "Invariant Violation", he;
1225
1225
  }
1226
1226
  R = r[k](p, k, S, b, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
1227
- } catch (Z) {
1228
- R = Z;
1227
+ } catch (K) {
1228
+ R = K;
1229
1229
  }
1230
1230
  R && !(R instanceof Error) && (O(L), $("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", S || "React class", b, k, typeof R), O(null)), R instanceof Error && !(R.message in F) && (F[R.message] = !0, O(L), $("Failed %s type: %s", b, R.message), O(null));
1231
1231
  }
@@ -1235,7 +1235,7 @@ function Fa() {
1235
1235
  function Ne(r) {
1236
1236
  return G(r);
1237
1237
  }
1238
- function Ke(r) {
1238
+ function Je(r) {
1239
1239
  {
1240
1240
  var p = typeof Symbol == "function" && Symbol.toStringTag, b = p && r[Symbol.toStringTag] || r.constructor.name || "Object";
1241
1241
  return b;
@@ -1253,7 +1253,7 @@ function Fa() {
1253
1253
  }
1254
1254
  function st(r) {
1255
1255
  if (mt(r))
1256
- return $("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ke(r)), pt(r);
1256
+ return $("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Je(r)), pt(r);
1257
1257
  }
1258
1258
  var Ue = re.ReactCurrentOwner, ot = {
1259
1259
  key: !0,
@@ -1342,9 +1342,9 @@ function Fa() {
1342
1342
  for (U in p)
1343
1343
  E.call(p, U) && !ot.hasOwnProperty(U) && (k[U] = p[U]);
1344
1344
  if (r && r.defaultProps) {
1345
- var Z = r.defaultProps;
1346
- for (U in Z)
1347
- k[U] === void 0 && (k[U] = Z[U]);
1345
+ var K = r.defaultProps;
1346
+ for (U in K)
1347
+ k[U] === void 0 && (k[U] = K[U]);
1348
1348
  }
1349
1349
  if (R || he) {
1350
1350
  var Q = typeof r == "function" ? r.displayName || r.name || "Unknown" : r;
@@ -1479,8 +1479,8 @@ Check the top-level render call using <` + b + ">.");
1479
1479
  (r === void 0 || typeof r == "object" && r !== null && Object.keys(r).length === 0) && (R += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
1480
1480
  var he = Gt(L);
1481
1481
  he ? R += he : R += de();
1482
- var Z;
1483
- r === null ? Z = "null" : Ne(r) ? Z = "array" : r !== void 0 && r.$$typeof === n ? (Z = "<" + (N(r.type) || "Unknown") + " />", R = " Did you accidentally export a JSX literal instead of a component?") : Z = typeof r, $("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", Z, R);
1482
+ var K;
1483
+ r === null ? K = "null" : Ne(r) ? K = "array" : r !== void 0 && r.$$typeof === n ? (K = "<" + (N(r.type) || "Unknown") + " />", R = " Did you accidentally export a JSX literal instead of a component?") : K = typeof r, $("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", K, R);
1484
1484
  }
1485
1485
  var Q = s(r, p, b, L, U);
1486
1486
  if (Q == null)
@@ -1538,7 +1538,7 @@ function za(e) {
1538
1538
  ] }) }, e.title);
1539
1539
  }
1540
1540
  function Ga(e) {
1541
- const [n, a] = X(!1), [t, i] = X(e.options), c = (h) => {
1541
+ const [n, a] = Z(!1), [t, i] = Z(e.options), c = (h) => {
1542
1542
  e.onDragComplete(h), i(h);
1543
1543
  }, u = (h) => {
1544
1544
  const f = [...t];
@@ -1554,7 +1554,7 @@ function Ga(e) {
1554
1554
  ] });
1555
1555
  }
1556
1556
  function Wa(e) {
1557
- const [n, a] = X(!1), t = [];
1557
+ const [n, a] = Z(!1), t = [];
1558
1558
  e.options.map((c, u) => {
1559
1559
  e.onSelect !== void 0 && (c.onSelect = e.onSelect), t.push(/* @__PURE__ */ l.jsx(Ha, { option: c }, u));
1560
1560
  });
@@ -1579,7 +1579,7 @@ function Wa(e) {
1579
1579
  );
1580
1580
  }
1581
1581
  function Ha(e) {
1582
- const { option: n } = e, [a, t] = X("");
1582
+ const { option: n } = e, [a, t] = Z("");
1583
1583
  let i;
1584
1584
  switch (n.type) {
1585
1585
  case "draggable":
@@ -1644,7 +1644,7 @@ function Bi(e, n, a) {
1644
1644
  };
1645
1645
  }
1646
1646
  function $t(e) {
1647
- const [n, a] = X(e.open !== void 0 ? e.open : !0), t = !n || e.children === void 0;
1647
+ const [n, a] = Z(e.open !== void 0 ? e.open : !0), t = !n || e.children === void 0;
1648
1648
  return /* @__PURE__ */ l.jsxs("div", { className: `accordion ${t ? "hide" : ""}`, children: [
1649
1649
  /* @__PURE__ */ l.jsxs(
1650
1650
  "button",
@@ -1671,7 +1671,7 @@ function $t(e) {
1671
1671
  ] });
1672
1672
  }
1673
1673
  function Fn(e) {
1674
- const [n, a] = X(!1), t = e.child !== void 0 && e.child.children.length > 0, i = [];
1674
+ const [n, a] = Z(!1), t = e.child !== void 0 && e.child.children.length > 0, i = [];
1675
1675
  return e.child !== void 0 && e.child.children.length > 0 && e.child.children.map((c) => {
1676
1676
  i.push(/* @__PURE__ */ l.jsx(Fn, { child: c, three: e.three }, Math.random()));
1677
1677
  }), /* @__PURE__ */ l.jsx(l.Fragment, { children: e.child !== void 0 && /* @__PURE__ */ l.jsxs("div", { className: "childObject", children: [
@@ -1716,11 +1716,11 @@ const Va = "data:image/gif;base64,R0lGODlhDgFkAIAAAP///wAAACH/C1hNUCBEYXRhWE1QPD
1716
1716
  function qa(e) {
1717
1717
  return "items" in e;
1718
1718
  }
1719
- function Je(e) {
1719
+ function Xe(e) {
1720
1720
  const n = [];
1721
1721
  return e.items.forEach((a) => {
1722
1722
  qa(a) ? n.push(
1723
- /* @__PURE__ */ l.jsx(Je, { title: Mt(a.title), items: a.items }, Math.random())
1723
+ /* @__PURE__ */ l.jsx(Xe, { title: Mt(a.title), items: a.items }, Math.random())
1724
1724
  ) : n.push(
1725
1725
  /* @__PURE__ */ l.jsx(
1726
1726
  ft,
@@ -1736,6 +1736,9 @@ function Je(e) {
1736
1736
  options: a.options,
1737
1737
  onChange: (t, i) => {
1738
1738
  a.onChange !== void 0 && a.onChange(t, i);
1739
+ },
1740
+ onKeyDown: (t) => {
1741
+ a.onKeyDown !== void 0 && a.onKeyDown(t);
1739
1742
  }
1740
1743
  },
1741
1744
  Math.random()
@@ -1743,10 +1746,10 @@ function Je(e) {
1743
1746
  );
1744
1747
  }), /* @__PURE__ */ l.jsx($t, { label: e.title, open: e.expanded === !0, children: n });
1745
1748
  }
1746
- function Za(e) {
1749
+ function Ka(e) {
1747
1750
  return !(e === "alphaHash" || e === "alphaToCoverage" || e === "attenuationDistance" || e === "blendAlpha" || e === "blendColor" || e === "blendDstAlpha" || e === "colorWrite" || e === "combine" || e === "defaultAttributeValues" || e === "depthFunc" || e === "forceSinglePass" || e === "glslVersion" || e === "linecap" || e === "linejoin" || e === "linewidth" || e === "normalMapType" || e === "precision" || e === "premultipliedAlpha" || e === "shadowSide" || e === "toneMapped" || e === "uniformsGroups" || e === "uniformsNeedUpdate" || e === "userData" || e === "vertexColors" || e === "version" || e === "wireframeLinecap" || e === "wireframeLinejoin" || e === "wireframeLinewidth" || e.slice(0, 4) === "clip" || e.slice(0, 7) === "polygon" || e.slice(0, 7) === "stencil" || e.slice(0, 2) === "is");
1748
1751
  }
1749
- function Xa(e) {
1752
+ function Za(e) {
1750
1753
  switch (e) {
1751
1754
  case "Alpha Map":
1752
1755
  return "alphaMap";
@@ -1970,7 +1973,7 @@ function Un(e) {
1970
1973
  const n = e.toLowerCase();
1971
1974
  return n.search("intensity") > -1 || n === "anisotropyrotation" || n === "blendalpha" || n === "bumpscale" || n === "clearcoatroughness" || n === "displacementbias" || n === "displacementscale" || n === "metalness" || n === "opacity" || n === "reflectivity" || n === "refractionratio" || n === "roughness" || n === "sheenroughness" || n === "thickness";
1972
1975
  }
1973
- function Ja() {
1976
+ function Xa() {
1974
1977
  const e = document.createElement("input");
1975
1978
  return e.type = "file", new Promise((n, a) => {
1976
1979
  e.addEventListener("change", function() {
@@ -1985,7 +1988,7 @@ function Ja() {
1985
1988
  }), e.click();
1986
1989
  });
1987
1990
  }
1988
- const Ka = [
1991
+ const Ja = [
1989
1992
  {
1990
1993
  title: "Front",
1991
1994
  value: Yn
@@ -2009,19 +2012,19 @@ const Ka = [
2009
2012
  },
2010
2013
  {
2011
2014
  title: "Additive",
2012
- value: Zn
2015
+ value: Kn
2013
2016
  },
2014
2017
  {
2015
2018
  title: "Subtractive",
2016
- value: Xn
2019
+ value: Zn
2017
2020
  },
2018
2021
  {
2019
2022
  title: "Multiply",
2020
- value: Jn
2023
+ value: Xn
2021
2024
  },
2022
2025
  {
2023
2026
  title: "Custom",
2024
- value: Kn
2027
+ value: Jn
2025
2028
  }
2026
2029
  ], ei = [
2027
2030
  {
@@ -2210,7 +2213,7 @@ function ii(e, n, a, t) {
2210
2213
  dt(i, ti);
2211
2214
  break;
2212
2215
  case "side":
2213
- dt(i, Ka);
2216
+ dt(i, Ja);
2214
2217
  break;
2215
2218
  }
2216
2219
  return Un(e) && (i.value = Number(n), i.type = "range", i.min = Math.min(0, i.value), i.max = Math.max(1, i.value), i.step = 0.01), i;
@@ -2226,12 +2229,20 @@ function ri(e, n, a, t) {
2226
2229
  t.updateObject(a.uuid, `material.${e}`, o), t.updateObject(a.uuid, "material.needsUpdate", !0);
2227
2230
  const d = t.scene?.getObjectByProperty("uuid", a.uuid);
2228
2231
  d !== void 0 && V(d, `material.${e}`, o);
2232
+ },
2233
+ onKeyDown: (u) => {
2229
2234
  }
2230
2235
  };
2231
2236
  return (e === "vertexShader" || e === "fragmentShader") && (i.disabled = !1, i.latest = i.value, i.onChange = (u, o) => {
2232
2237
  i.latest = o, t.updateObject(a.uuid, `material.${e}`, o);
2233
2238
  const d = t.scene?.getObjectByProperty("uuid", a.uuid);
2234
2239
  d !== void 0 && V(d, `material.${e}`, o);
2240
+ }, i.onKeyDown = (u) => {
2241
+ if (u.key === "Enter" && (u.altKey || u.metaKey)) {
2242
+ t.updateObject(a.uuid, "material.needsUpdate", !0);
2243
+ const o = t.scene?.getObjectByProperty("uuid", a.uuid);
2244
+ o !== void 0 && V(o, "material.needsUpdate", !0);
2245
+ }
2235
2246
  }), i;
2236
2247
  }
2237
2248
  function si(e) {
@@ -2368,11 +2379,11 @@ function ht(e, n, a, t, i = "", c = !1) {
2368
2379
  value: n,
2369
2380
  disabled: c,
2370
2381
  onChange: (h, f) => {
2371
- const m = Xa(e), x = i.length > 0 ? `${i}.${m}` : m;
2382
+ const m = Za(e), x = i.length > 0 ? `${i}.${m}` : m;
2372
2383
  t.createTexture(a.uuid, `material.${x}`, f);
2373
2384
  const T = t.scene?.getObjectByProperty("uuid", a.uuid);
2374
- T !== void 0 && Ln(f).then((H) => {
2375
- V(T, `material.${x}`, H), V(T, "material.needsUpdate", !0);
2385
+ T !== void 0 && Ln(f).then((W) => {
2386
+ V(T, `material.${x}`, W), V(T, "material.needsUpdate", !0);
2376
2387
  });
2377
2388
  }
2378
2389
  };
@@ -2418,7 +2429,7 @@ function ht(e, n, a, t, i = "", c = !1) {
2418
2429
  function an(e, n, a) {
2419
2430
  const t = [];
2420
2431
  for (const i in e) {
2421
- if (!Za(i))
2432
+ if (!Ka(i))
2422
2433
  continue;
2423
2434
  const c = typeof e[i], u = e[i];
2424
2435
  if (c === "boolean")
@@ -2450,7 +2461,7 @@ function li(e, n) {
2450
2461
  for (let c = 0; c < i; c++)
2451
2462
  t.push(
2452
2463
  /* @__PURE__ */ l.jsx(
2453
- Je,
2464
+ Xe,
2454
2465
  {
2455
2466
  title: `Material ${c}`,
2456
2467
  items: an(a[c], e, n)
@@ -2461,7 +2472,7 @@ function li(e, n) {
2461
2472
  return /* @__PURE__ */ l.jsx(l.Fragment, { children: t });
2462
2473
  } else
2463
2474
  return /* @__PURE__ */ l.jsx(
2464
- Je,
2475
+ Xe,
2465
2476
  {
2466
2477
  title: "Material",
2467
2478
  items: an(a, e, n)
@@ -2469,7 +2480,7 @@ function li(e, n) {
2469
2480
  );
2470
2481
  }
2471
2482
  function ui(e) {
2472
- const [n, a] = X(e.defaultValue);
2483
+ const [n, a] = Z(e.defaultValue);
2473
2484
  return Ae(() => {
2474
2485
  let t = !1, i = -1, c = 0, u = e.defaultValue;
2475
2486
  const o = (x) => {
@@ -2477,8 +2488,8 @@ function ui(e) {
2477
2488
  }, d = (x) => {
2478
2489
  if (!t)
2479
2490
  return;
2480
- const T = e.step !== void 0 ? e.step : 1, H = (x.clientX - i) * T;
2481
- u = Number((c + H).toFixed(4)), e.min !== void 0 && (u = Math.max(u, e.min)), e.max !== void 0 && (u = Math.min(u, e.max)), e.onChange !== void 0 && e.onChange(u), a(u);
2491
+ const T = e.step !== void 0 ? e.step : 1, W = (x.clientX - i) * T;
2492
+ u = Number((c + W).toFixed(4)), e.min !== void 0 && (u = Math.max(u, e.min)), e.max !== void 0 && (u = Math.min(u, e.max)), e.onChange !== void 0 && e.onChange(u), a(u);
2482
2493
  }, h = () => {
2483
2494
  t = !1, document.removeEventListener("mouseup", h), document.removeEventListener("mousemove", d), document.removeEventListener("contextmenu", h);
2484
2495
  }, f = (x) => {
@@ -2493,8 +2504,8 @@ function ui(e) {
2493
2504
  };
2494
2505
  }, []), n;
2495
2506
  }
2496
- function Xe(e) {
2497
- const n = J(null), a = J(null), t = ui({
2507
+ function Ze(e) {
2508
+ const n = X(null), a = X(null), t = ui({
2498
2509
  label: e.labelRef,
2499
2510
  input: n,
2500
2511
  sliderRef: a,
@@ -2557,18 +2568,18 @@ function Xe(e) {
2557
2568
  ] });
2558
2569
  }
2559
2570
  function di(e) {
2560
- const n = J(null), a = J(null), t = J(null), i = J(null), c = J(null), u = J(null), [o, d] = X(e.value), [h, f] = X({
2571
+ const n = X(null), a = X(null), t = X(null), i = X(null), c = X(null), u = X(null), [o, d] = Z(e.value), [h, f] = Z({
2561
2572
  min: Math.min(e.min, Math.min(e.value.x, e.value.y)),
2562
2573
  max: Math.max(e.max, Math.max(e.value.x, e.value.y))
2563
- }), [m, x] = X(!1);
2574
+ }), [m, x] = Z(!1);
2564
2575
  function T() {
2565
- m || (window.addEventListener("mousemove", te), window.addEventListener("mouseup", H), window.addEventListener("mouseup", H), x(!0));
2576
+ m || (window.addEventListener("mousemove", te), window.addEventListener("mouseup", W), window.addEventListener("mouseup", W), x(!0));
2566
2577
  }
2567
- function H() {
2568
- window.removeEventListener("mousemove", te), window.removeEventListener("mouseup", H), x(!1);
2578
+ function W() {
2579
+ window.removeEventListener("mousemove", te), window.removeEventListener("mouseup", W), x(!1);
2569
2580
  }
2570
2581
  function te(I) {
2571
- const q = c.current.getBoundingClientRect(), ne = Ze(0, 99, I.clientX - q.left) / 99, Se = Ze(0, 99, I.clientY - q.top) / 99, z = en(Qt(h.min, h.max, ne), 3), pe = en(Qt(h.min, h.max, Se), 3);
2582
+ const q = c.current.getBoundingClientRect(), ne = Ke(0, 99, I.clientX - q.left) / 99, Se = Ke(0, 99, I.clientY - q.top) / 99, z = en(Qt(h.min, h.max, ne), 3), pe = en(Qt(h.min, h.max, Se), 3);
2572
2583
  e.onChange({ target: { value: { x: z, y: pe } } }), d({ x: z, y: pe });
2573
2584
  }
2574
2585
  function me(I) {
@@ -2577,14 +2588,14 @@ function di(e) {
2577
2588
  }
2578
2589
  function re() {
2579
2590
  const I = Number(t.current.value);
2580
- f({ min: I, max: h.max }), (o.x < I || o.y < I) && d({ x: Ze(I, h.max, o.x), y: Ze(I, h.max, o.y) });
2591
+ f({ min: I, max: h.max }), (o.x < I || o.y < I) && d({ x: Ke(I, h.max, o.x), y: Ke(I, h.max, o.y) });
2581
2592
  }
2582
2593
  function $() {
2583
2594
  const I = Number(i.current.value);
2584
- f({ min: h.min, max: I }), (o.x > I || o.y > I) && d({ x: Ze(h.min, I, o.x), y: Ze(h.min, I, o.y) });
2595
+ f({ min: h.min, max: I }), (o.x > I || o.y > I) && d({ x: Ke(h.min, I, o.x), y: Ke(h.min, I, o.y) });
2585
2596
  }
2586
2597
  return Ae(() => {
2587
- const I = Kt(h.min, h.max, o.x), q = Kt(h.min, h.max, o.y);
2598
+ const I = Jt(h.min, h.max, o.x), q = Jt(h.min, h.max, o.y);
2588
2599
  u.current.style.left = `${I * 100}%`, u.current.style.top = `${q * 100}%`;
2589
2600
  }, [h, o]), /* @__PURE__ */ l.jsxs("div", { className: "vector2", children: [
2590
2601
  /* @__PURE__ */ l.jsxs("div", { className: "fields", children: [
@@ -2645,7 +2656,7 @@ function di(e) {
2645
2656
  )
2646
2657
  ] })
2647
2658
  ] }),
2648
- /* @__PURE__ */ l.jsxs("div", { className: "input", ref: c, onMouseDown: T, onMouseUp: H, children: [
2659
+ /* @__PURE__ */ l.jsxs("div", { className: "input", ref: c, onMouseDown: T, onMouseUp: W, children: [
2649
2660
  /* @__PURE__ */ l.jsx("div", { className: "x" }),
2650
2661
  /* @__PURE__ */ l.jsx("div", { className: "y" }),
2651
2662
  /* @__PURE__ */ l.jsx("div", { className: "pt", ref: u })
@@ -2659,12 +2670,12 @@ function rn(e) {
2659
2670
  c[d] = h, e.onChange({ target: { value: c } });
2660
2671
  };
2661
2672
  ["x", "y", "z"].forEach((d) => {
2662
- const h = J(null);
2673
+ const h = X(null);
2663
2674
  i.push(
2664
2675
  /* @__PURE__ */ l.jsxs("div", { children: [
2665
2676
  /* @__PURE__ */ l.jsx("label", { ref: h, children: d.toUpperCase() }),
2666
2677
  /* @__PURE__ */ l.jsx(
2667
- Xe,
2678
+ Ze,
2668
2679
  {
2669
2680
  value: c[d],
2670
2681
  type: "number",
@@ -2682,12 +2693,12 @@ function rn(e) {
2682
2693
  c[d] = h, e.onChange({ target: { value: c } });
2683
2694
  };
2684
2695
  ["_x", "_y", "_z"].forEach((d) => {
2685
- const h = J(null);
2696
+ const h = X(null);
2686
2697
  i.push(
2687
2698
  /* @__PURE__ */ l.jsxs("div", { children: [
2688
2699
  /* @__PURE__ */ l.jsx("label", { ref: h, children: d.substring(1).toUpperCase() }),
2689
2700
  /* @__PURE__ */ l.jsx(
2690
- Xe,
2701
+ Ze,
2691
2702
  {
2692
2703
  value: c[d],
2693
2704
  type: "number",
@@ -2706,12 +2717,12 @@ function rn(e) {
2706
2717
  c.elements[h] = d, e.onChange({ target: { value: c } });
2707
2718
  };
2708
2719
  for (let o = 0; o < 9; o++) {
2709
- const d = J(null);
2720
+ const d = X(null);
2710
2721
  i.push(
2711
2722
  /* @__PURE__ */ l.jsxs("div", { children: [
2712
2723
  /* @__PURE__ */ l.jsx("label", { ref: d, children: o + 1 }),
2713
2724
  /* @__PURE__ */ l.jsx(
2714
- Xe,
2725
+ Ze,
2715
2726
  {
2716
2727
  value: c.elements[o],
2717
2728
  type: "number",
@@ -2734,12 +2745,12 @@ function hi(e) {
2734
2745
  t[u] = o, e.onChange({ target: { value: t } });
2735
2746
  };
2736
2747
  ["x", "y", "z", "w"].forEach((u) => {
2737
- const o = J(null);
2748
+ const o = X(null);
2738
2749
  a.push(
2739
2750
  /* @__PURE__ */ l.jsxs("div", { children: [
2740
2751
  /* @__PURE__ */ l.jsx("label", { ref: o, children: u.toUpperCase() }),
2741
2752
  /* @__PURE__ */ l.jsx(
2742
- Xe,
2753
+ Ze,
2743
2754
  {
2744
2755
  value: t.x,
2745
2756
  type: "number",
@@ -2758,12 +2769,12 @@ function hi(e) {
2758
2769
  t.elements[o] = u, e.onChange({ target: { value: t } });
2759
2770
  };
2760
2771
  for (let c = 0; c < 16; c++) {
2761
- const u = J(null);
2772
+ const u = X(null);
2762
2773
  a.push(
2763
2774
  /* @__PURE__ */ l.jsxs("div", { children: [
2764
2775
  /* @__PURE__ */ l.jsx("label", { ref: u, children: c + 1 }),
2765
2776
  /* @__PURE__ */ l.jsx(
2766
- Xe,
2777
+ Ze,
2767
2778
  {
2768
2779
  value: t.elements[c],
2769
2780
  type: "number",
@@ -2782,7 +2793,7 @@ function hi(e) {
2782
2793
  function ft(e) {
2783
2794
  let n = e.value;
2784
2795
  n !== void 0 && n.isColor !== void 0 && (n = Pa(e.value));
2785
- const [a, t] = X(n), i = J(null), c = J(null), u = (f) => {
2796
+ const [a, t] = Z(n), i = X(null), c = X(null), u = (f) => {
2786
2797
  let m = f.target.value;
2787
2798
  e.type === "boolean" ? m = f.target.checked : e.type === "option" && (m = e.options[m].value), t(m), e.onChange !== void 0 && e.onChange(e.prop !== void 0 ? e.prop : e.title, m);
2788
2799
  }, o = {};
@@ -2807,6 +2818,9 @@ function ft(e) {
2807
2818
  rows: 10,
2808
2819
  disabled: e.disabled !== void 0 ? e.disabled : !0,
2809
2820
  onChange: u,
2821
+ onKeyDown: (f) => {
2822
+ e.onKeyDown !== void 0 && e.onKeyDown(f);
2823
+ },
2810
2824
  value: a
2811
2825
  }
2812
2826
  ),
@@ -2820,7 +2834,7 @@ function ft(e) {
2820
2834
  }
2821
2835
  ),
2822
2836
  e.type === "number" && /* @__PURE__ */ l.jsx(
2823
- Xe,
2837
+ Ze,
2824
2838
  {
2825
2839
  value: a,
2826
2840
  type: e.type,
@@ -2834,7 +2848,7 @@ function ft(e) {
2834
2848
  }
2835
2849
  ),
2836
2850
  e.type === "range" && /* @__PURE__ */ l.jsx(
2837
- Xe,
2851
+ Ze,
2838
2852
  {
2839
2853
  value: a,
2840
2854
  type: e.type,
@@ -2862,7 +2876,7 @@ function ft(e) {
2862
2876
  }
2863
2877
  ),
2864
2878
  e.type === "image" && /* @__PURE__ */ l.jsx("img", { alt: e.title, ref: c, onClick: () => {
2865
- Ja().then((f) => {
2879
+ Xa().then((f) => {
2866
2880
  c.current.src = f, e.onChange !== void 0 && e.onChange(e.prop !== void 0 ? e.prop : e.title, f);
2867
2881
  });
2868
2882
  }, src: a.src.length > 0 ? a.src : Va }),
@@ -2933,7 +2947,7 @@ function fi(e, n) {
2933
2947
  }
2934
2948
  });
2935
2949
  return /* @__PURE__ */ l.jsx(
2936
- Je,
2950
+ Xe,
2937
2951
  {
2938
2952
  title: "Camera",
2939
2953
  items: a
@@ -2952,7 +2966,7 @@ function mi(e, n) {
2952
2966
  f !== void 0 && V(f, o, h);
2953
2967
  };
2954
2968
  return /* @__PURE__ */ l.jsx(
2955
- Je,
2969
+ Xe,
2956
2970
  {
2957
2971
  title: "Transform",
2958
2972
  items: [
@@ -3034,7 +3048,7 @@ function pi(e, n) {
3034
3048
  }));
3035
3049
  }
3036
3050
  return /* @__PURE__ */ l.jsx(
3037
- Je,
3051
+ Xe,
3038
3052
  {
3039
3053
  title: "Light",
3040
3054
  items: a
@@ -3105,7 +3119,7 @@ function gi(e, n) {
3105
3119
  });
3106
3120
  }
3107
3121
  }
3108
- return /* @__PURE__ */ l.jsx(Je, { title: "Animation", items: a });
3122
+ return /* @__PURE__ */ l.jsx(Xe, { title: "Animation", items: a });
3109
3123
  }
3110
3124
  const $n = {
3111
3125
  name: "",
@@ -3121,7 +3135,7 @@ const $n = {
3121
3135
  };
3122
3136
  let se = { ...$n };
3123
3137
  function vi(e) {
3124
- const [n, a] = X(-1);
3138
+ const [n, a] = Z(-1);
3125
3139
  Ae(() => {
3126
3140
  function u(d) {
3127
3141
  se = { ...d.value }, a(Date.now());
@@ -3191,7 +3205,7 @@ function vi(e) {
3191
3205
  ] }) }, n) }, "Inspector");
3192
3206
  }
3193
3207
  function Fi(e) {
3194
- const [n, a] = X(e.scene);
3208
+ const [n, a] = Z(e.scene);
3195
3209
  Ae(() => {
3196
3210
  const c = (u) => {
3197
3211
  a(u.value);
@@ -3338,9 +3352,9 @@ class xi extends hn {
3338
3352
  TOUCH_DOLLY_ROTATE: 6
3339
3353
  };
3340
3354
  let c = i.NONE;
3341
- const u = 1e-6, o = new Zt(), d = new Zt();
3355
+ const u = 1e-6, o = new Kt(), d = new Kt();
3342
3356
  let h = 1;
3343
- const f = new Y(), m = new fe(), x = new fe(), T = new fe(), H = new fe(), te = new fe(), me = new fe(), re = new fe(), $ = new fe(), I = new fe(), q = new Y(), ne = new fe();
3357
+ const f = new Y(), m = new fe(), x = new fe(), T = new fe(), W = new fe(), te = new fe(), me = new fe(), re = new fe(), $ = new fe(), I = new fe(), q = new Y(), ne = new fe();
3344
3358
  let Se = !1;
3345
3359
  const z = [], pe = {};
3346
3360
  let ce = !1;
@@ -3403,7 +3417,7 @@ class xi extends hn {
3403
3417
  Pe(s.clientX, s.clientX), re.set(s.clientX, s.clientY);
3404
3418
  }
3405
3419
  function Fe(s) {
3406
- H.set(s.clientX, s.clientY);
3420
+ W.set(s.clientX, s.clientY);
3407
3421
  }
3408
3422
  function ae(s) {
3409
3423
  x.set(s.clientX, s.clientY), T.subVectors(x, m).multiplyScalar(t.rotateSpeed);
@@ -3414,7 +3428,7 @@ class xi extends hn {
3414
3428
  $.set(s.clientX, s.clientY), I.subVectors($, re), I.y > 0 ? Re(_e(I.y)) : I.y < 0 && De(_e(I.y)), re.copy($), t.update();
3415
3429
  }
3416
3430
  function He(s) {
3417
- te.set(s.clientX, s.clientY), me.subVectors(te, H).multiplyScalar(t.panSpeed), we(me.x, me.y), H.copy(te), t.update();
3431
+ te.set(s.clientX, s.clientY), me.subVectors(te, W).multiplyScalar(t.panSpeed), we(me.x, me.y), W.copy(te), t.update();
3418
3432
  }
3419
3433
  function Ye(s) {
3420
3434
  Pe(s.clientX, s.clientY), s.deltaY < 0 ? De(_e(s.deltaY)) : s.deltaY > 0 && Re(_e(s.deltaY)), t.update();
@@ -3447,10 +3461,10 @@ class xi extends hn {
3447
3461
  }
3448
3462
  function v(s) {
3449
3463
  if (z.length === 1)
3450
- H.set(s.pageX, s.pageY);
3464
+ W.set(s.pageX, s.pageY);
3451
3465
  else {
3452
3466
  const y = $e(s), _ = 0.5 * (s.pageX + y.x), D = 0.5 * (s.pageY + y.y);
3453
- H.set(_, D);
3467
+ W.set(_, D);
3454
3468
  }
3455
3469
  }
3456
3470
  function M(s) {
@@ -3481,7 +3495,7 @@ class xi extends hn {
3481
3495
  const y = $e(s), _ = 0.5 * (s.pageX + y.x), D = 0.5 * (s.pageY + y.y);
3482
3496
  te.set(_, D);
3483
3497
  }
3484
- me.subVectors(te, H).multiplyScalar(t.panSpeed), we(me.x, me.y), H.copy(te);
3498
+ me.subVectors(te, W).multiplyScalar(t.panSpeed), we(me.x, me.y), W.copy(te);
3485
3499
  }
3486
3500
  function E(s) {
3487
3501
  const y = $e(s), _ = s.pageX - y.x, D = s.pageY - y.y, ee = Math.sqrt(_ * _ + D * D);
@@ -3492,14 +3506,14 @@ class xi extends hn {
3492
3506
  function F(s) {
3493
3507
  t.enableZoom && E(s), t.enablePan && C(s);
3494
3508
  }
3495
- function K(s) {
3509
+ function J(s) {
3496
3510
  t.enableZoom && E(s), t.enableRotate && le(s);
3497
3511
  }
3498
3512
  function O(s) {
3499
3513
  t.enabled !== !1 && (z.length === 0 && (t.domElement.setPointerCapture(s.pointerId), t.domElement.addEventListener("pointermove", B), t.domElement.addEventListener("pointerup", G)), !Pt(s) && (_t(s), s.pointerType === "touch" ? ct(s) : Ne(s)));
3500
3514
  }
3501
3515
  function B(s) {
3502
- t.enabled !== !1 && (s.pointerType === "touch" ? gt(s) : Ke(s));
3516
+ t.enabled !== !1 && (s.pointerType === "touch" ? gt(s) : Je(s));
3503
3517
  }
3504
3518
  function G(s) {
3505
3519
  switch (Rt(s), z.length) {
@@ -3560,7 +3574,7 @@ class xi extends hn {
3560
3574
  }
3561
3575
  c !== i.NONE && t.dispatchEvent(At);
3562
3576
  }
3563
- function Ke(s) {
3577
+ function Je(s) {
3564
3578
  switch (c) {
3565
3579
  case i.ROTATE:
3566
3580
  if (t.enableRotate === !1)
@@ -3666,7 +3680,7 @@ class xi extends hn {
3666
3680
  case i.TOUCH_DOLLY_ROTATE:
3667
3681
  if (t.enableZoom === !1 && t.enableRotate === !1)
3668
3682
  return;
3669
- K(s), t.update();
3683
+ J(s), t.update();
3670
3684
  break;
3671
3685
  default:
3672
3686
  c = i.NONE;
@@ -3707,7 +3721,7 @@ function rt(e, n, a, t, i) {
3707
3721
  return t + (e - n) * (i - t) / (a - n);
3708
3722
  }
3709
3723
  const wt = (e) => {
3710
- const [n, a] = X(e.options[e.index]), t = () => {
3724
+ const [n, a] = Z(e.options[e.index]), t = () => {
3711
3725
  e.onToggle(!e.open);
3712
3726
  }, i = (c) => {
3713
3727
  c !== n && (e.onSelect(c), a(c)), e.onToggle(!1);
@@ -3717,7 +3731,7 @@ const wt = (e) => {
3717
3731
  e.open && /* @__PURE__ */ l.jsx("ul", { className: "dropdown-menu", children: e.options.map((c) => /* @__PURE__ */ l.jsx("li", { onClick: () => i(c), children: c }, c)) })
3718
3732
  ] });
3719
3733
  }, qe = Ta(function(n, a) {
3720
- const [t, i] = X(!1), c = n.options.indexOf(n.camera.name);
3734
+ const [t, i] = Z(!1), c = n.options.indexOf(n.camera.name);
3721
3735
  return /* @__PURE__ */ l.jsxs("div", { className: "CameraWindow", children: [
3722
3736
  /* @__PURE__ */ l.jsx("div", { ref: a, className: "clickable", onClick: () => {
3723
3737
  t && i(!1);
@@ -3910,15 +3924,15 @@ class Mi extends jn {
3910
3924
  });
3911
3925
  }
3912
3926
  }
3913
- let Ct = "Renderer", je, St = !1, dn = !1, W = null, oe = null, Ge = null, We = null;
3927
+ let Ct = "Renderer", je, St = !1, dn = !1, H = null, oe = null, Ge = null, We = null;
3914
3928
  function $i(e) {
3915
- const n = e.three.app.appID, a = localStorage.getItem(`${n}_mode`), t = localStorage.getItem(`${n}_tlCam`) !== null ? localStorage.getItem(`${n}_tlCam`) : "Debug", i = localStorage.getItem(`${n}_trCam`) !== null ? localStorage.getItem(`${n}_trCam`) : "Orthographic", c = localStorage.getItem(`${n}_blCam`) !== null ? localStorage.getItem(`${n}_blCam`) : "Front", u = localStorage.getItem(`${n}_brCam`) !== null ? localStorage.getItem(`${n}_brCam`) : "Top", o = ie(() => /* @__PURE__ */ new Map(), []), d = ie(() => /* @__PURE__ */ new Map(), []), h = ie(() => /* @__PURE__ */ new Map(), []), f = ie(() => /* @__PURE__ */ new Map(), []), m = ie(() => new ma(), []), x = ie(() => new pa(), []), T = ie(() => new Ci(), []), H = ie(() => new Xt(500), []), te = ie(() => new Xt(100), []), me = ie(() => new ga(), []), re = ie(() => new va(), []), $ = ie(() => new Mi(), []), I = ie(() => new kn({
3929
+ const n = e.three.app.appID, a = localStorage.getItem(`${n}_mode`), t = localStorage.getItem(`${n}_tlCam`) !== null ? localStorage.getItem(`${n}_tlCam`) : "Debug", i = localStorage.getItem(`${n}_trCam`) !== null ? localStorage.getItem(`${n}_trCam`) : "Orthographic", c = localStorage.getItem(`${n}_blCam`) !== null ? localStorage.getItem(`${n}_blCam`) : "Front", u = localStorage.getItem(`${n}_brCam`) !== null ? localStorage.getItem(`${n}_brCam`) : "Top", o = ie(() => /* @__PURE__ */ new Map(), []), d = ie(() => /* @__PURE__ */ new Map(), []), h = ie(() => /* @__PURE__ */ new Map(), []), f = ie(() => /* @__PURE__ */ new Map(), []), m = ie(() => new ma(), []), x = ie(() => new pa(), []), T = ie(() => new Ci(), []), W = ie(() => new Zt(500), []), te = ie(() => new Zt(100), []), me = ie(() => new ga(), []), re = ie(() => new va(), []), $ = ie(() => new Mi(), []), I = ie(() => new kn({
3916
3930
  opacity: 0.33,
3917
3931
  transparent: !0,
3918
3932
  wireframe: !0
3919
3933
  }), []);
3920
3934
  function q(g, v) {
3921
- const M = new Jt(-100, 100, 100, -100, 50, 5e3);
3935
+ const M = new Xt(-100, 100, 100, -100, 50, 5e3);
3922
3936
  return M.name = g, M.position.copy(v), M.lookAt(0, 0, 0), o.set(g, M), M;
3923
3937
  }
3924
3938
  const ne = [
@@ -3932,7 +3946,7 @@ function $i(e) {
3932
3946
  "Side by Side",
3933
3947
  "Stacked",
3934
3948
  "Quad"
3935
- ], z = J(null), pe = J(null), ce = J(null), Te = J(null), _e = J(null), ve = J(null), [N, be] = X(a !== null ? a : "Single"), [w, we] = X(null), [Re, De] = X(!1), [Pe, ke] = X(!1), [Ie, Be] = X(!1), [, Fe] = X(Date.now());
3949
+ ], z = X(null), pe = X(null), ce = X(null), Te = X(null), _e = X(null), ve = X(null), [N, be] = Z(a !== null ? a : "Single"), [w, we] = Z(null), [Re, De] = Z(!1), [Pe, ke] = Z(!1), [Ie, Be] = Z(!1), [, Fe] = Z(Date.now());
3936
3950
  localStorage.setItem(`${n}_mode`, N), localStorage.setItem(`${n}_tlCam`, t), localStorage.setItem(`${n}_trCam`, i), localStorage.setItem(`${n}_blCam`, c), localStorage.setItem(`${n}_brCam`, u);
3937
3951
  const ae = (g, v) => {
3938
3952
  const M = d.get(g.name);
@@ -3964,14 +3978,14 @@ function $i(e) {
3964
3978
  }, Ye = () => {
3965
3979
  switch (N) {
3966
3980
  case "Single":
3967
- ae(W, ce.current);
3981
+ ae(H, ce.current);
3968
3982
  break;
3969
3983
  case "Side by Side":
3970
3984
  case "Stacked":
3971
- ae(W, ce.current), ae(oe, Te.current);
3985
+ ae(H, ce.current), ae(oe, Te.current);
3972
3986
  break;
3973
3987
  case "Quad":
3974
- ae(W, ce.current), ae(oe, Te.current), ae(Ge, _e.current), ae(We, ve.current);
3988
+ ae(H, ce.current), ae(oe, Te.current), ae(Ge, _e.current), ae(We, ve.current);
3975
3989
  break;
3976
3990
  }
3977
3991
  };
@@ -3982,9 +3996,9 @@ function $i(e) {
3982
3996
  });
3983
3997
  g.autoClear = !1, g.shadowMap.enabled = !0, g.setPixelRatio(devicePixelRatio), g.setClearColor(0), e.three.renderer = g, we(g);
3984
3998
  }, []), Ae(() => {
3985
- m.name = "Debug Scene", m.uuid = "", x.name = "helpers", m.add(x), x.add(T), H.name = "axisHelper", x.add(H), te.name = "interactionHelper", x.add(te), te.visible = !1, q("Top", new Y(0, 1e3, 0)), q("Bottom", new Y(0, -1e3, 0)), q("Left", new Y(-1e3, 0, 0)), q("Right", new Y(1e3, 0, 0)), q("Front", new Y(0, 0, 1e3)), q("Back", new Y(0, 0, -1e3)), q("Orthographic", new Y(1e3, 1e3, 1e3)), q("UI", new Y());
3999
+ m.name = "Debug Scene", m.uuid = "", x.name = "helpers", m.add(x), x.add(T), W.name = "axisHelper", x.add(W), te.name = "interactionHelper", x.add(te), te.visible = !1, q("Top", new Y(0, 1e3, 0)), q("Bottom", new Y(0, -1e3, 0)), q("Left", new Y(-1e3, 0, 0)), q("Right", new Y(1e3, 0, 0)), q("Front", new Y(0, 0, 1e3)), q("Back", new Y(0, 0, -1e3)), q("Orthographic", new Y(1e3, 1e3, 1e3)), q("UI", new Y());
3986
4000
  const g = new kt(60, 1, 50, 5e3);
3987
- g.name = "Debug", g.position.set(500, 500, 500), g.lookAt(0, 0, 0), o.set("Debug", g), W = o.get(localStorage.getItem(`${n}_tlCam`)), oe = o.get(localStorage.getItem(`${n}_trCam`)), Ge = o.get(localStorage.getItem(`${n}_blCam`)), We = o.get(localStorage.getItem(`${n}_brCam`));
4001
+ g.name = "Debug", g.position.set(500, 500, 500), g.lookAt(0, 0, 0), o.set("Debug", g), H = o.get(localStorage.getItem(`${n}_tlCam`)), oe = o.get(localStorage.getItem(`${n}_trCam`)), Ge = o.get(localStorage.getItem(`${n}_blCam`)), We = o.get(localStorage.getItem(`${n}_brCam`));
3988
4002
  }, []), Ae(() => {
3989
4003
  const g = () => {
3990
4004
  f.forEach((C) => {
@@ -4014,7 +4028,7 @@ function $i(e) {
4014
4028
  }
4015
4029
  });
4016
4030
  }, M = (C) => {
4017
- g(), Ft(je), m.remove(je);
4031
+ x.add(W), g(), Ft(je), m.remove(je);
4018
4032
  const E = e.scenes.get(C.value.name);
4019
4033
  if (E !== void 0) {
4020
4034
  const F = new E();
@@ -4023,8 +4037,8 @@ function $i(e) {
4023
4037
  }, P = (C) => {
4024
4038
  const E = C.value, F = e.three.scene?.getObjectByProperty("uuid", E.uuid);
4025
4039
  if (F !== void 0 && o.set(E.name, F), F instanceof kt) {
4026
- const K = new xa(F);
4027
- h.set(F.name, K), m.add(K);
4040
+ const J = new xa(F);
4041
+ h.set(F.name, J), m.add(J);
4028
4042
  }
4029
4043
  Fe(Date.now());
4030
4044
  }, ge = (C) => {
@@ -4032,7 +4046,7 @@ function $i(e) {
4032
4046
  E !== void 0 && (m.remove(E), E.dispose()), o.delete(C.value.name), Fe(Date.now());
4033
4047
  }, le = (C) => {
4034
4048
  const E = je.getObjectByProperty("uuid", C.value.uuid);
4035
- E && E.add(H);
4049
+ E && E.add(W);
4036
4050
  };
4037
4051
  return j.addEventListener(A.SET_SCENE, M), j.addEventListener(A.ADD_CAMERA, P), j.addEventListener(A.REMOVE_CAMERA, ge), j.addEventListener(A.SET_OBJECT, le), () => {
4038
4052
  j.removeEventListener(A.SET_SCENE, M), j.removeEventListener(A.ADD_CAMERA, P), j.removeEventListener(A.REMOVE_CAMERA, ge), j.removeEventListener(A.SET_OBJECT, le);
@@ -4056,21 +4070,21 @@ function $i(e) {
4056
4070
  break;
4057
4071
  }
4058
4072
  o.forEach((G) => {
4059
- G instanceof Jt ? (G.left = O / -2, G.right = O / 2, G.top = B / 2, G.bottom = B / -2, G.name === "UI" && (G.position.x = g / 2, G.position.y = v / -2, G.position.z = 100), G.updateProjectionMatrix()) : G instanceof kt && (G.aspect = O / B, G.updateProjectionMatrix(), h.get(G.name)?.update());
4073
+ G instanceof Xt ? (G.left = O / -2, G.right = O / 2, G.top = B / 2, G.bottom = B / -2, G.name === "UI" && (G.position.x = g / 2, G.position.y = v / -2, G.position.z = 100), G.updateProjectionMatrix()) : G instanceof kt && (G.aspect = O / B, G.updateProjectionMatrix(), h.get(G.name)?.update());
4060
4074
  });
4061
4075
  }, C = () => {
4062
- w.setViewport(0, 0, g, v), w.setScissor(0, 0, g, v), w.render(m, W);
4076
+ w.setViewport(0, 0, g, v), w.setScissor(0, 0, g, v), w.render(m, H);
4063
4077
  }, E = () => {
4064
4078
  if (N === "Side by Side")
4065
- w.setViewport(0, 0, M, v), w.setScissor(0, 0, M, v), w.render(m, W), w.setViewport(M, 0, M, v), w.setScissor(M, 0, M, v), w.render(m, oe);
4079
+ w.setViewport(0, 0, M, v), w.setScissor(0, 0, M, v), w.render(m, H), w.setViewport(M, 0, M, v), w.setScissor(M, 0, M, v), w.render(m, oe);
4066
4080
  else {
4067
4081
  const O = v - P;
4068
- w.setViewport(0, O, g, P), w.setScissor(0, O, g, P), w.render(m, W), w.setViewport(0, 0, g, P), w.setScissor(0, 0, g, P), w.render(m, oe);
4082
+ w.setViewport(0, O, g, P), w.setScissor(0, O, g, P), w.render(m, H), w.setViewport(0, 0, g, P), w.setScissor(0, 0, g, P), w.render(m, oe);
4069
4083
  }
4070
4084
  }, F = () => {
4071
4085
  let O = 0, B = 0;
4072
- B = v - P, O = 0, w.setViewport(O, B, M, P), w.setScissor(O, B, M, P), w.render(m, W), O = M, w.setViewport(O, B, M, P), w.setScissor(O, B, M, P), w.render(m, oe), B = 0, O = 0, w.setViewport(O, B, M, P), w.setScissor(O, B, M, P), w.render(m, Ge), O = M, w.setViewport(O, B, M, P), w.setScissor(O, B, M, P), w.render(m, We);
4073
- }, K = () => {
4086
+ B = v - P, O = 0, w.setViewport(O, B, M, P), w.setScissor(O, B, M, P), w.render(m, H), O = M, w.setViewport(O, B, M, P), w.setScissor(O, B, M, P), w.render(m, oe), B = 0, O = 0, w.setViewport(O, B, M, P), w.setScissor(O, B, M, P), w.render(m, Ge), O = M, w.setViewport(O, B, M, P), w.setScissor(O, B, M, P), w.render(m, We);
4087
+ }, J = () => {
4074
4088
  switch (d.forEach((O) => {
4075
4089
  O.update();
4076
4090
  }), h.forEach((O) => {
@@ -4089,26 +4103,26 @@ function $i(e) {
4089
4103
  F();
4090
4104
  break;
4091
4105
  }
4092
- ge = requestAnimationFrame(K);
4106
+ ge = requestAnimationFrame(J);
4093
4107
  };
4094
- return Ye(), window.addEventListener("resize", le), le(), K(), () => {
4108
+ return Ye(), window.addEventListener("resize", le), le(), J(), () => {
4095
4109
  window.removeEventListener("resize", le), cancelAnimationFrame(ge), ge = -1;
4096
4110
  };
4097
4111
  }, [N, w]), Ae(() => {
4098
4112
  if (w !== null) {
4099
- const g = new ya(), v = new fe(), M = (C, E, F, K) => {
4113
+ const g = new ya(), v = new fe(), M = (C, E, F, J) => {
4100
4114
  switch (N) {
4101
4115
  case "Quad":
4102
- C < F ? E < K ? g.setFromCamera(v, W) : g.setFromCamera(v, Ge) : E < K ? g.setFromCamera(v, oe) : g.setFromCamera(v, We);
4116
+ C < F ? E < J ? g.setFromCamera(v, H) : g.setFromCamera(v, Ge) : E < J ? g.setFromCamera(v, oe) : g.setFromCamera(v, We);
4103
4117
  break;
4104
4118
  case "Side by Side":
4105
- C < F ? g.setFromCamera(v, W) : g.setFromCamera(v, oe);
4119
+ C < F ? g.setFromCamera(v, H) : g.setFromCamera(v, oe);
4106
4120
  break;
4107
4121
  case "Single":
4108
- g.setFromCamera(v, W);
4122
+ g.setFromCamera(v, H);
4109
4123
  break;
4110
4124
  case "Stacked":
4111
- E < K ? g.setFromCamera(v, W) : g.setFromCamera(v, oe);
4125
+ E < J ? g.setFromCamera(v, H) : g.setFromCamera(v, oe);
4112
4126
  break;
4113
4127
  }
4114
4128
  }, P = (C) => {
@@ -4116,12 +4130,12 @@ function $i(e) {
4116
4130
  return;
4117
4131
  const E = new fe();
4118
4132
  w.getSize(E);
4119
- const F = Math.min(C.clientX, E.x), K = Math.min(C.clientY, E.y);
4120
- v.x = rt(F, 0, E.x, -1, 1), v.y = rt(K, 0, E.y, 1, -1);
4133
+ const F = Math.min(C.clientX, E.x), J = Math.min(C.clientY, E.y);
4134
+ v.x = rt(F, 0, E.x, -1, 1), v.y = rt(J, 0, E.y, 1, -1);
4121
4135
  const O = E.x / 2, B = E.y / 2, G = () => {
4122
4136
  F < O ? v.x = rt(F, 0, O, -1, 1) : v.x = rt(F, O, E.x, -1, 1);
4123
4137
  }, Ne = () => {
4124
- K < B ? v.y = rt(K, 0, B, 1, -1) : v.y = rt(K, B, E.y, 1, -1);
4138
+ J < B ? v.y = rt(J, 0, B, 1, -1) : v.y = rt(J, B, E.y, 1, -1);
4125
4139
  };
4126
4140
  switch (N) {
4127
4141
  case "Quad":
@@ -4134,9 +4148,9 @@ function $i(e) {
4134
4148
  Ne(), Ne();
4135
4149
  break;
4136
4150
  }
4137
- M(F, K, O, B);
4138
- const Ke = g.intersectObjects(je.children);
4139
- Ke.length > 0 && te.position.copy(Ke[0].point);
4151
+ M(F, J, O, B);
4152
+ const Je = g.intersectObjects(je.children);
4153
+ Je.length > 0 && te.position.copy(Je[0].point);
4140
4154
  }, ge = (C) => {
4141
4155
  if (!St)
4142
4156
  return;
@@ -4159,16 +4173,16 @@ function $i(e) {
4159
4173
  /* @__PURE__ */ l.jsx("canvas", { ref: z }),
4160
4174
  w !== null && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
4161
4175
  /* @__PURE__ */ l.jsxs("div", { className: `cameras ${N === "Single" || N === "Stacked" ? "single" : ""}`, ref: pe, children: [
4162
- N === "Single" && /* @__PURE__ */ l.jsx(l.Fragment, { children: /* @__PURE__ */ l.jsx(qe, { camera: W, options: ue, ref: ce, onSelect: (g) => {
4163
- d.get(W.name)?.dispose();
4176
+ N === "Single" && /* @__PURE__ */ l.jsx(l.Fragment, { children: /* @__PURE__ */ l.jsx(qe, { camera: H, options: ue, ref: ce, onSelect: (g) => {
4177
+ d.get(H.name)?.dispose();
4164
4178
  const v = o.get(g);
4165
- v !== void 0 && (Me(W), W = v, localStorage.setItem(`${n}_tlCam`, v.name), ae(v, ce.current));
4179
+ v !== void 0 && (Me(H), H = v, localStorage.setItem(`${n}_tlCam`, v.name), ae(v, ce.current));
4166
4180
  } }) }),
4167
4181
  (N === "Side by Side" || N === "Stacked") && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
4168
- /* @__PURE__ */ l.jsx(qe, { camera: W, options: ue, ref: ce, onSelect: (g) => {
4169
- d.get(W.name)?.dispose();
4182
+ /* @__PURE__ */ l.jsx(qe, { camera: H, options: ue, ref: ce, onSelect: (g) => {
4183
+ d.get(H.name)?.dispose();
4170
4184
  const v = o.get(g);
4171
- v !== void 0 && (Me(W), W = v, localStorage.setItem(`${n}_tlCam`, v.name), ae(v, ce.current));
4185
+ v !== void 0 && (Me(H), H = v, localStorage.setItem(`${n}_tlCam`, v.name), ae(v, ce.current));
4172
4186
  } }),
4173
4187
  /* @__PURE__ */ l.jsx(qe, { camera: oe, options: ue, ref: Te, onSelect: (g) => {
4174
4188
  d.get(oe.name)?.dispose();
@@ -4177,10 +4191,10 @@ function $i(e) {
4177
4191
  } })
4178
4192
  ] }),
4179
4193
  N === "Quad" && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
4180
- /* @__PURE__ */ l.jsx(qe, { camera: W, options: ue, ref: ce, onSelect: (g) => {
4181
- d.get(W.name)?.dispose();
4194
+ /* @__PURE__ */ l.jsx(qe, { camera: H, options: ue, ref: ce, onSelect: (g) => {
4195
+ d.get(H.name)?.dispose();
4182
4196
  const v = o.get(g);
4183
- v !== void 0 && (Me(W), W = v, localStorage.setItem(`${n}_tlCam`, v.name), ae(v, ce.current));
4197
+ v !== void 0 && (Me(H), H = v, localStorage.setItem(`${n}_tlCam`, v.name), ae(v, ce.current));
4184
4198
  } }),
4185
4199
  /* @__PURE__ */ l.jsx(qe, { camera: oe, options: ue, ref: Te, onSelect: (g) => {
4186
4200
  d.get(oe.name)?.dispose();
@@ -4297,7 +4311,7 @@ export {
4297
4311
  Fi as SidePanel,
4298
4312
  A as ToolEvents,
4299
4313
  Mt as capitalize,
4300
- Ze as clamp,
4314
+ Ke as clamp,
4301
4315
  Pa as colorToHex,
4302
4316
  j as debugDispatcher,
4303
4317
  Pi as defaultTheatreCallback,
@@ -4309,7 +4323,7 @@ export {
4309
4323
  Ra as isColor,
4310
4324
  Qt as mix,
4311
4325
  Bt as noop,
4312
- Kt as normalize,
4326
+ Jt as normalize,
4313
4327
  _a as randomID,
4314
4328
  ka as resetThreeObjects,
4315
4329
  en as round,