@tomorrowevening/hermes 0.0.20 → 0.0.22

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.js CHANGED
@@ -1,17 +1,17 @@
1
1
  var _n = Object.defineProperty;
2
2
  var kn = (t, n, a) => n in t ? _n(t, n, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[n] = a;
3
3
  var H = (t, n, a) => (kn(t, typeof n != "symbol" ? n + "" : n, a), a);
4
- import { PositionalAudio as Dn, EventDispatcher as cn, Texture as ln, CubeTexture as An, RepeatWrapping as Wt, ShaderMaterial as un, GLSL3 as In, DoubleSide as Nn, Color as Bt, Mesh as Ln, PlaneGeometry as Fn, Matrix4 as Un, Vector3 as Y, Euler as Bn, Ray as $n, Plane as Gn, MathUtils as Vn, MOUSE as We, TOUCH as He, Quaternion as Ht, Spherical as Kt, Vector2 as de, PerspectiveCamera as Nt, MeshDepthMaterial as zn, MeshNormalMaterial as Yn, MeshBasicMaterial as Wn, OrthographicCamera as dn, Scene as fn, Group as Hn, AxesHelper as hn, WebGLRenderer as Kn, Raycaster as Xn, CameraHelper as qn } from "three";
4
+ import { PositionalAudio as Dn, EventDispatcher as cn, Texture as ln, CubeTexture as An, RepeatWrapping as Wt, ShaderMaterial as un, GLSL3 as In, DoubleSide as Nn, Color as Bt, Mesh as Ln, PlaneGeometry as Fn, Matrix4 as Un, Vector3 as Y, Euler as Bn, Ray as $n, Plane as Gn, MathUtils as Vn, MOUSE as He, TOUCH as Ke, Quaternion as Ht, Spherical as Kt, Vector2 as de, PerspectiveCamera as Nt, MeshDepthMaterial as zn, MeshNormalMaterial as Yn, MeshBasicMaterial as Wn, OrthographicCamera as dn, Scene as fn, Group as Hn, AxesHelper as hn, WebGLRenderer as Kn, Raycaster as Xn, CameraHelper as qn } from "three";
5
5
  import { getProject as Zn, createRafDriver as Jn } from "@theatre/core";
6
6
  import st from "@theatre/studio";
7
7
  import { Pane as Qn } from "tweakpane";
8
8
  import * as ea from "@tweakpane/plugin-essentials";
9
9
  import pn, { useState as oe, useRef as Ce, useEffect as Fe, Component as ta, forwardRef as na } from "react";
10
10
  import { Reorder as mn } from "framer-motion";
11
- function li(t, n, a) {
11
+ function ui(t, n, a) {
12
12
  return Math.min(n, Math.max(t, a));
13
13
  }
14
- function ui(t, n) {
14
+ function di(t, n) {
15
15
  const a = t - n;
16
16
  return Math.sqrt(a * a);
17
17
  }
@@ -41,7 +41,7 @@ const oa = () => {
41
41
  n.length === 0 && (n = `obj_${Lt}`, Lt++), t.parent !== null && (n = `${t.parent.uuid}.${n}`), t.uuid = n, t.children.forEach((a) => {
42
42
  gn(a);
43
43
  });
44
- }, di = (t) => {
44
+ }, fi = (t) => {
45
45
  t == null || t.dispose();
46
46
  }, sa = (t) => {
47
47
  t && (Array.isArray(t) ? t.forEach((n) => n.dispose()) : t.dispose());
@@ -59,7 +59,7 @@ const oa = () => {
59
59
  t.dispose !== void 0 && t.dispose();
60
60
  }
61
61
  };
62
- class fi {
62
+ class hi {
63
63
  constructor(n, a, e = "editor") {
64
64
  H(this, "channel");
65
65
  H(this, "components", /* @__PURE__ */ new Map());
@@ -155,7 +155,7 @@ function la(t, n) {
155
155
  }
156
156
  }
157
157
  const bn = () => {
158
- }, Xe = class Xe extends Ot {
158
+ }, qe = class qe extends Ot {
159
159
  constructor() {
160
160
  super(...arguments);
161
161
  H(this, "project");
@@ -165,7 +165,7 @@ const bn = () => {
165
165
  H(this, "sheetObjectUnsubscribe", /* @__PURE__ */ new Map());
166
166
  }
167
167
  init(a, e) {
168
- this.project = Zn(a, e);
168
+ return this.project = Zn(a, e), this.project.ready;
169
169
  }
170
170
  dispose() {
171
171
  this.project = void 0, this.sheets = /* @__PURE__ */ new Map(), this.sheetObjects = /* @__PURE__ */ new Map(), this.sheetObjectCBs = /* @__PURE__ */ new Map(), this.sheetObjectUnsubscribe = /* @__PURE__ */ new Map();
@@ -179,6 +179,27 @@ const bn = () => {
179
179
  let e = this.sheets.get(a);
180
180
  return e !== void 0 || (e = (r = this.project) == null ? void 0 : r.sheet(a), this.sheets.set(a, e)), e;
181
181
  }
182
+ playSheet(a, e) {
183
+ var r;
184
+ (r = this.sheet(a)) == null || r.sequence.play(e), this.app.send({
185
+ event: "playSheet",
186
+ target: "editor",
187
+ data: {
188
+ sheet: a,
189
+ value: e
190
+ }
191
+ });
192
+ }
193
+ pauseSheet(a) {
194
+ var e;
195
+ (e = this.sheet(a)) == null || e.sequence.pause(), this.app.send({
196
+ event: "pauseSheet",
197
+ target: "editor",
198
+ data: {
199
+ sheet: a
200
+ }
201
+ });
202
+ }
182
203
  clearSheetObjects(a) {
183
204
  this.sheetObjects.forEach((e, r) => {
184
205
  r.search(`${a}_`) > -1 && this.unsubscribe(e);
@@ -231,14 +252,14 @@ const bn = () => {
231
252
  l !== void 0 && (this.sheetObjects.delete(u), this.sheetObjectCBs.delete(u), this.sheetObjectUnsubscribe.delete(u), l());
232
253
  }
233
254
  static getRafDriver() {
234
- return Xe.rafDriver || (Xe.rafDriver = Jn()), Xe.rafDriver;
255
+ return qe.rafDriver || (qe.rafDriver = Jn()), qe.rafDriver;
235
256
  }
236
257
  };
237
- H(Xe, "rafDriver", null);
238
- let qe = Xe, Me;
258
+ H(qe, "rafDriver", null);
259
+ let Ue = qe, Me;
239
260
  function ua(t, n) {
240
261
  t.components.forEach((a) => {
241
- if (a instanceof qe) {
262
+ if (a instanceof Ue) {
242
263
  let e;
243
264
  const r = a;
244
265
  switch (n.event) {
@@ -262,7 +283,7 @@ function da(t) {
262
283
  if (t.editor) {
263
284
  let n;
264
285
  t.components.forEach((s) => {
265
- s instanceof qe && (n = s);
286
+ s instanceof Ue && (n = s);
266
287
  }), st.ui.restore(), st.onSelectionChange((s) => {
267
288
  s.length < 1 || s.forEach((u) => {
268
289
  let l = u.address.sheetId, d = "setSheet", p = {};
@@ -285,7 +306,7 @@ function da(t) {
285
306
  });
286
307
  let a = 0;
287
308
  const e = () => {
288
- if (qe.getRafDriver().tick(performance.now()), Me !== void 0 && a !== Me.sequence.position) {
309
+ if (Ue.getRafDriver().tick(performance.now()), Me !== void 0 && a !== Me.sequence.position) {
289
310
  a = Me.sequence.position;
290
311
  const s = Me;
291
312
  t.send({
@@ -304,7 +325,24 @@ function da(t) {
304
325
  } else
305
326
  st.ui.hide();
306
327
  }
307
- function fa(t) {
328
+ function fa(t, n) {
329
+ t.editor && t.components.forEach((a) => {
330
+ var e, r;
331
+ if (a instanceof Ue) {
332
+ const s = a;
333
+ switch (n.event) {
334
+ case "playSheet":
335
+ (e = s.sheet(n.data.sheet)) == null || e.sequence.play(n.data.value);
336
+ break;
337
+ case "pauseSheet":
338
+ (r = s.sheet(n.data.sheet)) == null || r.sequence.pause();
339
+ break;
340
+ }
341
+ return;
342
+ }
343
+ });
344
+ }
345
+ function ha(t) {
308
346
  if (t.name === "cameras")
309
347
  return "camera";
310
348
  if (t.name === "interactive")
@@ -329,7 +367,7 @@ function yn(t) {
329
367
  n.children.push(yn(a));
330
368
  }), n;
331
369
  }
332
- function ha(t) {
370
+ function pa(t) {
333
371
  const n = {};
334
372
  for (const a in t) {
335
373
  const e = t[a].value;
@@ -337,7 +375,7 @@ function ha(t) {
337
375
  }
338
376
  return n;
339
377
  }
340
- function pa(t) {
378
+ function ma(t) {
341
379
  switch (t) {
342
380
  case "blendSrcAlpha":
343
381
  case "blendDstAlpha":
@@ -352,7 +390,7 @@ function pa(t) {
352
390
  function Xt(t) {
353
391
  const n = {};
354
392
  for (const a in t) {
355
- if (a.substring(0, 1) === "_" || a.substring(0, 2) === "is" || pa(a))
393
+ if (a.substring(0, 1) === "_" || a.substring(0, 2) === "is" || ma(a))
356
394
  continue;
357
395
  const e = typeof t[a], r = t[a];
358
396
  switch (e) {
@@ -370,7 +408,7 @@ function Xt(t) {
370
408
  } else
371
409
  r instanceof An && (console.log("env map"), console.log(r.source.data), console.log(r.source.toJSON()), n[a] = { src: "" });
372
410
  else
373
- a === "uniforms" && (n[a] = ha(n[a]));
411
+ a === "uniforms" && (n[a] = pa(n[a]));
374
412
  else
375
413
  n[a] = { src: "" };
376
414
  break;
@@ -467,7 +505,7 @@ function Ft(t) {
467
505
  }, e.onerror = a, e.src = t;
468
506
  });
469
507
  }
470
- class ma extends Ot {
508
+ class ga extends Ot {
471
509
  constructor() {
472
510
  super(...arguments);
473
511
  H(this, "scene");
@@ -548,7 +586,7 @@ class ma extends Ot {
548
586
  });
549
587
  }
550
588
  }
551
- function ga(t, n) {
589
+ function va(t, n) {
552
590
  switch (n.event) {
553
591
  case "getObject":
554
592
  j.dispatchEvent({ type: _.GET_OBJECT, value: n.data });
@@ -564,7 +602,7 @@ function ga(t, n) {
564
602
  break;
565
603
  }
566
604
  }
567
- function va(t, n) {
605
+ function ba(t, n) {
568
606
  switch (n.event) {
569
607
  case "setObject":
570
608
  j.dispatchEvent({ type: _.SET_OBJECT, value: n.data });
@@ -680,7 +718,7 @@ class En extends Ot {
680
718
  this.inspectorFolder.remove(this.inspectorFolder.children[e]);
681
719
  }
682
720
  }
683
- function ba(t, n) {
721
+ function ya(t, n) {
684
722
  t.components.forEach((a) => {
685
723
  if (a instanceof En) {
686
724
  const e = a;
@@ -716,7 +754,7 @@ var Ut = { exports: {} }, it = {};
716
754
  * LICENSE file in the root directory of this source tree.
717
755
  */
718
756
  var qt;
719
- function ya() {
757
+ function Ea() {
720
758
  if (qt)
721
759
  return it;
722
760
  qt = 1;
@@ -744,7 +782,7 @@ var rt = {};
744
782
  * LICENSE file in the root directory of this source tree.
745
783
  */
746
784
  var Zt;
747
- function Ea() {
785
+ function wa() {
748
786
  return Zt || (Zt = 1, process.env.NODE_ENV !== "production" && function() {
749
787
  var t = pn, n = Symbol.for("react.element"), a = Symbol.for("react.portal"), e = Symbol.for("react.fragment"), r = Symbol.for("react.strict_mode"), s = Symbol.for("react.profiler"), u = Symbol.for("react.provider"), l = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), p = Symbol.for("react.suspense"), v = Symbol.for("react.suspense_list"), E = Symbol.for("react.memo"), x = Symbol.for("react.lazy"), C = Symbol.for("react.offscreen"), M = Symbol.iterator, G = "@@iterator";
750
788
  function se(i) {
@@ -911,13 +949,13 @@ function Ea() {
911
949
  ` + Qe + i;
912
950
  }
913
951
  }
914
- var $e = !1, je;
952
+ var Ge = !1, je;
915
953
  {
916
954
  var Pt = typeof WeakMap == "function" ? WeakMap : Map;
917
955
  je = new Pt();
918
956
  }
919
957
  function dt(i, h) {
920
- if (!i || $e)
958
+ if (!i || Ge)
921
959
  return "";
922
960
  {
923
961
  var g = je.get(i);
@@ -925,7 +963,7 @@ function Ea() {
925
963
  return g;
926
964
  }
927
965
  var w;
928
- $e = !0;
966
+ Ge = !0;
929
967
  var k = Error.prepareStackTrace;
930
968
  Error.prepareStackTrace = void 0;
931
969
  var L;
@@ -982,9 +1020,9 @@ function Ea() {
982
1020
  }
983
1021
  }
984
1022
  } finally {
985
- $e = !1, Je.current = L, Rt(), Error.prepareStackTrace = k;
1023
+ Ge = !1, Je.current = L, Rt(), Error.prepareStackTrace = k;
986
1024
  }
987
- var Ye = i ? i.displayName || i.name : "", Yt = Ye ? Pe(Ye) : "";
1025
+ var We = i ? i.displayName || i.name : "", Yt = We ? Pe(We) : "";
988
1026
  return typeof i == "function" && je.set(i, Yt), Yt;
989
1027
  }
990
1028
  function ft(i, h, g) {
@@ -1023,7 +1061,7 @@ function Ea() {
1023
1061
  }
1024
1062
  return "";
1025
1063
  }
1026
- var Ge = Object.prototype.hasOwnProperty, pt = {}, et = K.ReactDebugCurrentFrame;
1064
+ var Ve = Object.prototype.hasOwnProperty, pt = {}, et = K.ReactDebugCurrentFrame;
1027
1065
  function Se(i) {
1028
1066
  if (i) {
1029
1067
  var h = i._owner, g = _e(i.type, i._source, h ? h.type : null);
@@ -1033,7 +1071,7 @@ function Ea() {
1033
1071
  }
1034
1072
  function ke(i, h, g, w, k) {
1035
1073
  {
1036
- var L = Function.call.bind(Ge);
1074
+ var L = Function.call.bind(Ve);
1037
1075
  for (var P in i)
1038
1076
  if (L(i, P)) {
1039
1077
  var T = void 0;
@@ -1082,7 +1120,7 @@ function Ea() {
1082
1120
  }, bt, at, ve;
1083
1121
  ve = {};
1084
1122
  function o(i) {
1085
- if (Ge.call(i, "ref")) {
1123
+ if (Ve.call(i, "ref")) {
1086
1124
  var h = Object.getOwnPropertyDescriptor(i, "ref").get;
1087
1125
  if (h && h.isReactWarning)
1088
1126
  return !1;
@@ -1090,7 +1128,7 @@ function Ea() {
1090
1128
  return i.ref !== void 0;
1091
1129
  }
1092
1130
  function y(i) {
1093
- if (Ge.call(i, "key")) {
1131
+ if (Ve.call(i, "key")) {
1094
1132
  var h = Object.getOwnPropertyDescriptor(i, "key").get;
1095
1133
  if (h && h.isReactWarning)
1096
1134
  return !1;
@@ -1159,7 +1197,7 @@ function Ea() {
1159
1197
  var L, P = {}, T = null, ce = null;
1160
1198
  g !== void 0 && (vt(g), T = "" + g), y(h) && (vt(h.key), T = "" + h.key), o(h) && (ce = h.ref, D(h, k));
1161
1199
  for (L in h)
1162
- Ge.call(h, L) && !_t.hasOwnProperty(L) && (P[L] = h[L]);
1200
+ Ve.call(h, L) && !_t.hasOwnProperty(L) && (P[L] = h[L]);
1163
1201
  if (i && i.defaultProps) {
1164
1202
  var W = i.defaultProps;
1165
1203
  for (L in W)
@@ -1185,7 +1223,7 @@ function Ea() {
1185
1223
  function pe(i) {
1186
1224
  return typeof i == "object" && i !== null && i.$$typeof === n;
1187
1225
  }
1188
- function Ve() {
1226
+ function ze() {
1189
1227
  {
1190
1228
  if (yt.current) {
1191
1229
  var i = F(yt.current.type);
@@ -1209,9 +1247,9 @@ Check your code at ` + h + ":" + g + ".";
1209
1247
  }
1210
1248
  }
1211
1249
  var Te = {};
1212
- function ze(i) {
1250
+ function Ye(i) {
1213
1251
  {
1214
- var h = Ve();
1252
+ var h = ze();
1215
1253
  if (!h) {
1216
1254
  var g = typeof i == "string" ? i : i.displayName || i.name;
1217
1255
  g && (h = `
@@ -1226,7 +1264,7 @@ Check the top-level render call using <` + g + ">.");
1226
1264
  if (!i._store || i._store.validated || i.key != null)
1227
1265
  return;
1228
1266
  i._store.validated = !0;
1229
- var g = ze(h);
1267
+ var g = Ye(h);
1230
1268
  if (Te[g])
1231
1269
  return;
1232
1270
  Te[g] = !0;
@@ -1297,7 +1335,7 @@ Check the top-level render call using <` + g + ">.");
1297
1335
  var T = "";
1298
1336
  (i === void 0 || typeof i == "object" && i !== null && Object.keys(i).length === 0) && (T += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
1299
1337
  var ce = De(k);
1300
- ce ? T += ce : T += Ve();
1338
+ ce ? T += ce : T += ze();
1301
1339
  var W;
1302
1340
  i === null ? W = "null" : tt(i) ? W = "array" : i !== void 0 && i.$$typeof === n ? (W = "<" + (F(i.type) || "Unknown") + " />", T = " Did you accidentally export a JSX literal instead of a component?") : W = typeof i, S("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", W, T);
1303
1341
  }
@@ -1309,8 +1347,8 @@ Check the top-level render call using <` + g + ">.");
1309
1347
  if (ge !== void 0)
1310
1348
  if (w)
1311
1349
  if (tt(ge)) {
1312
- for (var Ye = 0; Ye < ge.length; Ye++)
1313
- Vt(ge[Ye], i);
1350
+ for (var We = 0; We < ge.length; We++)
1351
+ Vt(ge[We], i);
1314
1352
  Object.freeze && Object.freeze(ge);
1315
1353
  } else
1316
1354
  S("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
@@ -1330,16 +1368,16 @@ Check the top-level render call using <` + g + ">.");
1330
1368
  rt.Fragment = e, rt.jsx = Pn, rt.jsxs = jn;
1331
1369
  }()), rt;
1332
1370
  }
1333
- process.env.NODE_ENV === "production" ? Ut.exports = ya() : Ut.exports = Ea();
1371
+ process.env.NODE_ENV === "production" ? Ut.exports = Ea() : Ut.exports = wa();
1334
1372
  var c = Ut.exports;
1335
1373
  function wn(t) {
1336
1374
  return t.title.search("<") > -1 ? /* @__PURE__ */ c.jsx("button", { className: "svg", dangerouslySetInnerHTML: { __html: t.title } }) : /* @__PURE__ */ c.jsx("button", { children: t.title });
1337
1375
  }
1338
- const wa = /* @__PURE__ */ c.jsxs("svg", { className: "closeIcon", width: "14", height: "14", fill: "none", stroke: "#666666", strokeMiterlimit: "10", children: [
1376
+ const xa = /* @__PURE__ */ c.jsxs("svg", { className: "closeIcon", width: "14", height: "14", fill: "none", stroke: "#666666", strokeMiterlimit: "10", children: [
1339
1377
  /* @__PURE__ */ c.jsx("circle", { cx: "7", cy: "7", r: "6" }),
1340
1378
  /* @__PURE__ */ c.jsx("line", { x1: "4", y1: "4", x2: "10", y2: "10" }),
1341
1379
  /* @__PURE__ */ c.jsx("line", { x1: "4", y1: "10", x2: "10", y2: "4" })
1342
- ] }), xa = /* @__PURE__ */ c.jsx("svg", { className: "dragIcon", width: "14", height: "14", fill: "#666666", stroke: "none", children: /* @__PURE__ */ c.jsx(
1380
+ ] }), Ca = /* @__PURE__ */ c.jsx("svg", { className: "dragIcon", width: "14", height: "14", fill: "#666666", stroke: "none", children: /* @__PURE__ */ c.jsx(
1343
1381
  "path",
1344
1382
  {
1345
1383
  d: `M10.43,4H3.57C3.26,4,3,4.22,3,4.5v1C3,5.78,3.26,6,3.57,6h6.86C10.74,6,11,5.78,11,5.5v-1
@@ -1347,16 +1385,16 @@ C11,4.22,10.74,4,10.43,4z M10.43,8H3.57C3.26,8,3,8.22,3,8.5v1C3,9.78,3.26,10,3.5
1347
1385
  C11,8.22,10.74,8,10.43,8z`
1348
1386
  }
1349
1387
  ) });
1350
- function Ca(t) {
1388
+ function Sa(t) {
1351
1389
  return /* @__PURE__ */ c.jsx(mn.Item, { value: t.title, children: /* @__PURE__ */ c.jsxs("div", { children: [
1352
- xa,
1390
+ Ca,
1353
1391
  /* @__PURE__ */ c.jsx("span", { children: t.title }),
1354
1392
  /* @__PURE__ */ c.jsx("button", { className: "closeIcon", onClick: () => {
1355
1393
  t.onDelete(t.index);
1356
- }, children: wa })
1394
+ }, children: xa })
1357
1395
  ] }) }, t.title);
1358
1396
  }
1359
- function Sa(t) {
1397
+ function Oa(t) {
1360
1398
  const [n, a] = oe(!1), [e, r] = oe(t.options), s = (p) => {
1361
1399
  t.onDragComplete(p), r(p);
1362
1400
  }, u = (p) => {
@@ -1364,7 +1402,7 @@ function Sa(t) {
1364
1402
  v.splice(p, 1), s(v);
1365
1403
  }, l = [];
1366
1404
  e.forEach((p, v) => {
1367
- l.push(/* @__PURE__ */ c.jsx(Ca, { index: v, title: p, onDelete: u }, p));
1405
+ l.push(/* @__PURE__ */ c.jsx(Sa, { index: v, title: p, onDelete: u }, p));
1368
1406
  });
1369
1407
  let d = "dropdown draggable";
1370
1408
  return t.subdropdown && (d += " subdropdown"), /* @__PURE__ */ c.jsxs("div", { className: d, onMouseEnter: () => a(!0), onMouseLeave: () => a(!1), children: [
@@ -1372,10 +1410,10 @@ function Sa(t) {
1372
1410
  /* @__PURE__ */ c.jsx(mn.Group, { axis: "y", values: e, onReorder: s, style: { visibility: n ? "visible" : "hidden" }, children: l })
1373
1411
  ] });
1374
1412
  }
1375
- function Oa(t) {
1413
+ function Ta(t) {
1376
1414
  const [n, a] = oe(!1), e = [];
1377
1415
  t.options.map((s, u) => {
1378
- t.onSelect !== void 0 && (s.onSelect = t.onSelect), e.push(/* @__PURE__ */ c.jsx(Ta, { option: s }, u));
1416
+ t.onSelect !== void 0 && (s.onSelect = t.onSelect), e.push(/* @__PURE__ */ c.jsx(Ma, { option: s }, u));
1379
1417
  });
1380
1418
  let r = "dropdown";
1381
1419
  return t.subdropdown && (r += " subdropdown"), /* @__PURE__ */ c.jsxs(
@@ -1397,13 +1435,13 @@ function Oa(t) {
1397
1435
  }
1398
1436
  );
1399
1437
  }
1400
- function Ta(t) {
1438
+ function Ma(t) {
1401
1439
  const { option: n } = t, [a, e] = oe("");
1402
1440
  let r;
1403
1441
  switch (n.type) {
1404
1442
  case "draggable":
1405
1443
  r = /* @__PURE__ */ c.jsx(
1406
- Sa,
1444
+ Oa,
1407
1445
  {
1408
1446
  title: n.title,
1409
1447
  options: n.value,
@@ -1416,7 +1454,7 @@ function Ta(t) {
1416
1454
  break;
1417
1455
  case "dropdown":
1418
1456
  r = /* @__PURE__ */ c.jsx(
1419
- Oa,
1457
+ Ta,
1420
1458
  {
1421
1459
  title: n.title,
1422
1460
  options: n.value,
@@ -1439,10 +1477,10 @@ function Ta(t) {
1439
1477
  }
1440
1478
  return /* @__PURE__ */ c.jsx("li", { className: a === n.title ? "selected" : "", children: r }, aa());
1441
1479
  }
1442
- function hi(t) {
1480
+ function pi(t) {
1443
1481
  const n = [], a = [];
1444
1482
  t.components.forEach((s) => {
1445
- s instanceof ca ? n.push(la) : s instanceof qe ? (n.push(ua), da(t)) : s instanceof ma ? (n.push(ga), a.push(va)) : s instanceof En && n.push(ba);
1483
+ s instanceof ca ? n.push(la) : s instanceof Ue ? (n.push(ua), a.push(fa), da(t)) : s instanceof ga ? (n.push(va), a.push(ba)) : s instanceof En && n.push(ya);
1446
1484
  });
1447
1485
  function e(s) {
1448
1486
  switch (n.forEach((u) => u(t, s)), s.event) {
@@ -1462,7 +1500,7 @@ function hi(t) {
1462
1500
  t.editor ? r(s) : e(s);
1463
1501
  });
1464
1502
  }
1465
- const Ma = `out vec3 worldPosition;
1503
+ const Ra = `out vec3 worldPosition;
1466
1504
  uniform float uDistance;
1467
1505
 
1468
1506
  void main() {
@@ -1471,7 +1509,7 @@ void main() {
1471
1509
  worldPosition.xz += cameraPosition.xz;
1472
1510
 
1473
1511
  gl_Position = projectionMatrix * modelViewMatrix * vec4(worldPosition, 1.0);
1474
- }`, Ra = `out vec4 fragColor;
1512
+ }`, Pa = `out vec4 fragColor;
1475
1513
  in vec3 worldPosition;
1476
1514
 
1477
1515
  uniform float uDivisions;
@@ -1539,7 +1577,7 @@ void main() {
1539
1577
 
1540
1578
  if (fragColor.a <= 0.0) discard;
1541
1579
  }`;
1542
- class Pa extends un {
1580
+ class ja extends un {
1543
1581
  constructor(n) {
1544
1582
  super({
1545
1583
  extensions: {
@@ -1568,16 +1606,16 @@ class Pa extends un {
1568
1606
  value: (n == null ? void 0 : n.gridOpacity) !== void 0 ? n == null ? void 0 : n.gridOpacity : 0.25
1569
1607
  }
1570
1608
  },
1571
- vertexShader: Ma,
1572
- fragmentShader: Ra,
1609
+ vertexShader: Ra,
1610
+ fragmentShader: Pa,
1573
1611
  name: "InfiniteGrid",
1574
1612
  depthWrite: !1
1575
1613
  });
1576
1614
  }
1577
1615
  }
1578
- class ja extends Ln {
1616
+ class _a extends Ln {
1579
1617
  constructor() {
1580
- const a = new Pa();
1618
+ const a = new ja();
1581
1619
  super(new Fn(2, 2), a);
1582
1620
  H(this, "gridMaterial");
1583
1621
  this.gridMaterial = a, this.frustumCulled = !1, this.name = "InfiniteGridHelper", this.position.y = 0.1;
@@ -1586,7 +1624,7 @@ class ja extends Ln {
1586
1624
  this.gridMaterial.needsUpdate = !0;
1587
1625
  }
1588
1626
  }
1589
- const _a = `#include <common>
1627
+ const ka = `#include <common>
1590
1628
  #include <batching_pars_vertex>
1591
1629
  #include <uv_pars_vertex>
1592
1630
  #include <color_pars_vertex>
@@ -1616,7 +1654,7 @@ void main() {
1616
1654
  #include <logdepthbuf_vertex>
1617
1655
  #include <clipping_planes_vertex>
1618
1656
  #include <worldpos_vertex>
1619
- }`, ka = `
1657
+ }`, Da = `
1620
1658
  #include <common>
1621
1659
  #include <uv_pars_fragment>
1622
1660
  #include <clipping_planes_pars_fragment>
@@ -1625,14 +1663,14 @@ void main() {
1625
1663
  #include <clipping_planes_fragment>
1626
1664
  gl_FragColor = vec4(vec3(vUv, 0.0), 1.0);
1627
1665
  }`;
1628
- class Da extends un {
1666
+ class Aa extends un {
1629
1667
  constructor() {
1630
1668
  super({
1631
1669
  defines: {
1632
1670
  USE_UV: ""
1633
1671
  },
1634
- vertexShader: _a,
1635
- fragmentShader: ka
1672
+ vertexShader: ka,
1673
+ fragmentShader: Da
1636
1674
  });
1637
1675
  }
1638
1676
  }
@@ -1694,26 +1732,26 @@ function xn(t) {
1694
1732
  children: t.child.name.length > 0 ? `${t.child.name} (${t.child.type})` : `${t.child.type}::${t.child.uuid}`
1695
1733
  }
1696
1734
  ),
1697
- /* @__PURE__ */ c.jsx("div", { className: `icon ${fa(t.child)}` })
1735
+ /* @__PURE__ */ c.jsx("div", { className: `icon ${ha(t.child)}` })
1698
1736
  ] }),
1699
1737
  /* @__PURE__ */ c.jsx("div", { className: n ? "open" : "", children: /* @__PURE__ */ c.jsx("div", { className: "container", children: r }) })
1700
1738
  ] }, Math.random());
1701
1739
  }
1702
- function Aa(t) {
1740
+ function Ia(t) {
1703
1741
  const n = [];
1704
1742
  return t.child.children.map((a) => {
1705
1743
  n.push(/* @__PURE__ */ c.jsx(xn, { child: a, three: t.three }, Math.random()));
1706
1744
  }), /* @__PURE__ */ c.jsx("div", { className: `scene ${t.class !== void 0 ? t.class : ""}`, children: n });
1707
1745
  }
1708
- const Ia = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA5klEQVRoge2Y0Q6EIAwE6cX//+X6cCFpSMEKVTdk501OpRNKiyelFC0b8Ps6gCwoggZF0KAIGhRBgyJoUAQNiqCxjciR9SLV//eZiAyvK3U8i/QVaQO2YyLSFVvlkdTKDjJCukh2ykR5ZEW+kHmlatl90RaBtDkK/w7CYhuRUEO0ee3l+J3m55Vm+17vtwjTnV1V3QA8qfbeUXCzRWDpiLLS+OyzvRW7IzW9R+okvclsqR09743bo0yUpc1+lSJvNsa002+Euk9GKzV7SmZDRIMiaFAEDYqgQRE0KIIGRdCgCBoUQeMEMERadX7YUz8AAAAASUVORK5CYII=";
1709
- function Na(t) {
1746
+ const Na = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA5klEQVRoge2Y0Q6EIAwE6cX//+X6cCFpSMEKVTdk501OpRNKiyelFC0b8Ps6gCwoggZF0KAIGhRBgyJoUAQNiqCxjciR9SLV//eZiAyvK3U8i/QVaQO2YyLSFVvlkdTKDjJCukh2ykR5ZEW+kHmlatl90RaBtDkK/w7CYhuRUEO0ee3l+J3m55Vm+17vtwjTnV1V3QA8qfbeUXCzRWDpiLLS+OyzvRW7IzW9R+okvclsqR09743bo0yUpc1+lSJvNsa002+Euk9GKzV7SmZDRIMiaFAEDYqgQRE0KIIGRdCgCBoUQeMEMERadX7YUz8AAAAASUVORK5CYII=";
1747
+ function La(t) {
1710
1748
  return "items" in t;
1711
1749
  }
1712
- function Ue(t) {
1750
+ function Be(t) {
1713
1751
  const n = [];
1714
1752
  return t.items.forEach((a) => {
1715
- Na(a) ? n.push(
1716
- /* @__PURE__ */ c.jsx(Ue, { title: a.title, items: a.items }, Math.random())
1753
+ La(a) ? n.push(
1754
+ /* @__PURE__ */ c.jsx(Be, { title: a.title, items: a.items }, Math.random())
1717
1755
  ) : n.push(
1718
1756
  /* @__PURE__ */ c.jsx(
1719
1757
  ot,
@@ -1735,7 +1773,7 @@ function Ue(t) {
1735
1773
  );
1736
1774
  }), /* @__PURE__ */ c.jsx($t, { label: t.title, open: t.expanded === !0, children: n });
1737
1775
  }
1738
- function La(t) {
1776
+ function Fa(t) {
1739
1777
  return !(t === "alphaHash" || t === "alphaToCoverage" || t === "attenuationDistance" || t === "colorWrite" || t === "combine" || t === "defaultAttributeValues" || t === "depthFunc" || t === "forceSinglePass" || t === "glslVersion" || t === "linewidth" || t === "normalMapType" || t === "precision" || t === "premultipliedAlpha" || t === "shadowSide" || t === "side" || t === "toneMapped" || t === "uniformsGroups" || t === "uniformsNeedUpdate" || t === "userData" || t === "vertexColors" || t === "version" || t === "wireframeLinecap" || t === "wireframeLinejoin" || t === "wireframeLinewidth" || t.slice(0, 5) === "blend" || t.slice(0, 4) === "clip" || t.slice(0, 7) === "polygon" || t.slice(0, 7) === "stencil" || t.slice(0, 2) === "is");
1740
1778
  }
1741
1779
  function Ae(t) {
@@ -1887,10 +1925,10 @@ function Ae(t) {
1887
1925
  }
1888
1926
  return t;
1889
1927
  }
1890
- function Fa(t) {
1928
+ function Ua(t) {
1891
1929
  return t.toLowerCase().search("intensity") > -1 || t === "anisotropyRotation" || t === "bumpScale" || t === "clearcoatRoughness" || t === "displacementBias" || t === "displacementScale" || t === "metalness" || t === "opacity" || t === "reflectivity" || t === "refractionRatio" || t === "roughness" || t === "sheenRoughness" || t === "thickness";
1892
1930
  }
1893
- function Ua() {
1931
+ function Ba() {
1894
1932
  const t = document.createElement("input");
1895
1933
  return t.type = "file", new Promise((n, a) => {
1896
1934
  t.addEventListener("change", function() {
@@ -1908,7 +1946,7 @@ function Ua() {
1908
1946
  function Jt(t, n, a) {
1909
1947
  const e = [];
1910
1948
  for (const r in t) {
1911
- if (!La(r))
1949
+ if (!Fa(r))
1912
1950
  continue;
1913
1951
  const s = typeof t[r], u = t[r];
1914
1952
  if (s === "boolean" || s === "number" || s === "string") {
@@ -1926,7 +1964,7 @@ function Jt(t, n, a) {
1926
1964
  v !== void 0 && Q(v, `material.${d}`, p);
1927
1965
  }
1928
1966
  };
1929
- Fa(r) && (l.value = Number(u), l.type = "range", l.min = 0, l.max = 1, l.step = 0.01), e.push(l);
1967
+ Ua(r) && (l.value = Number(u), l.type = "range", l.min = 0, l.max = 1, l.step = 0.01), e.push(l);
1930
1968
  } else if (s === "object")
1931
1969
  if (u.isColor)
1932
1970
  e.push({
@@ -2036,14 +2074,14 @@ function Jt(t, n, a) {
2036
2074
  }
2037
2075
  }), e;
2038
2076
  }
2039
- function Ba(t, n) {
2077
+ function $a(t, n) {
2040
2078
  const a = t.material;
2041
2079
  if (Array.isArray(a)) {
2042
2080
  const e = [], r = a.length;
2043
2081
  for (let s = 0; s < r; s++)
2044
2082
  e.push(
2045
2083
  /* @__PURE__ */ c.jsx(
2046
- Ue,
2084
+ Be,
2047
2085
  {
2048
2086
  title: `Material ${s}`,
2049
2087
  items: Jt(a[s], t, n)
@@ -2054,7 +2092,7 @@ function Ba(t, n) {
2054
2092
  return /* @__PURE__ */ c.jsx(c.Fragment, { children: e });
2055
2093
  } else
2056
2094
  return /* @__PURE__ */ c.jsx(
2057
- Ue,
2095
+ Be,
2058
2096
  {
2059
2097
  title: "Material",
2060
2098
  items: Jt(a, t, n)
@@ -2161,10 +2199,10 @@ function ot(t) {
2161
2199
  }
2162
2200
  ),
2163
2201
  t.type === "image" && /* @__PURE__ */ c.jsx("img", { ref: u, onClick: () => {
2164
- Ua().then((v) => {
2202
+ Ba().then((v) => {
2165
2203
  u.current.src = v, t.onChange !== void 0 && t.onChange(t.prop !== void 0 ? t.prop : t.title, v);
2166
2204
  });
2167
- }, src: a.length > 0 ? a : Ia })
2205
+ }, src: a.length > 0 ? a : Na })
2168
2206
  ] });
2169
2207
  }
2170
2208
  function Qt(t) {
@@ -2196,7 +2234,7 @@ function Qt(t) {
2196
2234
  }
2197
2235
  return t;
2198
2236
  }
2199
- function $a(t, n) {
2237
+ function Ga(t, n) {
2200
2238
  const a = [];
2201
2239
  if (t.perspectiveCameraInfo !== void 0)
2202
2240
  for (const e in t.perspectiveCameraInfo)
@@ -2229,24 +2267,24 @@ function $a(t, n) {
2229
2267
  }
2230
2268
  });
2231
2269
  return /* @__PURE__ */ c.jsx(
2232
- Ue,
2270
+ Be,
2233
2271
  {
2234
2272
  title: "Camera",
2235
2273
  items: a
2236
2274
  }
2237
2275
  );
2238
2276
  }
2239
- const Ga = Math.PI / 180, Va = 180 / Math.PI;
2240
- function Ke(t, n, a, e, r) {
2277
+ const Va = Math.PI / 180, za = 180 / Math.PI;
2278
+ function Xe(t, n, a, e, r) {
2241
2279
  return e + (t - n) * (r - e) / (a - n);
2242
2280
  }
2243
- function za(t) {
2244
- return t * Ga;
2281
+ function Ya(t) {
2282
+ return t * Va;
2245
2283
  }
2246
2284
  function At(t) {
2247
- return t * Va;
2285
+ return t * za;
2248
2286
  }
2249
- function Ya(t, n) {
2287
+ function Wa(t, n) {
2250
2288
  const a = new Un();
2251
2289
  a.elements = t.matrix;
2252
2290
  const e = new Y(), r = new Bn(), s = new Y();
@@ -2257,10 +2295,10 @@ function Ya(t, n) {
2257
2295
  const v = (E = n.scene) == null ? void 0 : E.getObjectByProperty("uuid", t.uuid);
2258
2296
  v !== void 0 && Q(v, d, p);
2259
2297
  }, l = (d, p) => {
2260
- u(d, za(p));
2298
+ u(d, Ya(p));
2261
2299
  };
2262
2300
  return /* @__PURE__ */ c.jsx(
2263
- Ue,
2301
+ Be,
2264
2302
  {
2265
2303
  title: "Transform",
2266
2304
  items: [
@@ -2362,7 +2400,7 @@ function en(t) {
2362
2400
  }
2363
2401
  return t;
2364
2402
  }
2365
- function Wa(t, n) {
2403
+ function Ha(t, n) {
2366
2404
  const a = [];
2367
2405
  if (t.lightInfo !== void 0)
2368
2406
  for (const e in t.lightInfo) {
@@ -2394,14 +2432,14 @@ function Wa(t, n) {
2394
2432
  }));
2395
2433
  }
2396
2434
  return /* @__PURE__ */ c.jsx(
2397
- Ue,
2435
+ Be,
2398
2436
  {
2399
2437
  title: "Light",
2400
2438
  items: a
2401
2439
  }
2402
2440
  );
2403
2441
  }
2404
- function Ha(t, n) {
2442
+ function Ka(t, n) {
2405
2443
  const a = [];
2406
2444
  return t.animations.forEach((e) => {
2407
2445
  a.push({
@@ -2441,7 +2479,7 @@ function Ha(t, n) {
2441
2479
  u !== void 0 && Q(u, r, s);
2442
2480
  }
2443
2481
  });
2444
- }), /* @__PURE__ */ c.jsx(Ue, { title: "Animations", items: a });
2482
+ }), /* @__PURE__ */ c.jsx(Be, { title: "Animations", items: a });
2445
2483
  }
2446
2484
  const Cn = {
2447
2485
  name: "",
@@ -2456,7 +2494,7 @@ const Cn = {
2456
2494
  lightInfo: void 0
2457
2495
  };
2458
2496
  let ae = { ...Cn };
2459
- function Ka(t) {
2497
+ function Xa(t) {
2460
2498
  const [n, a] = oe(-1);
2461
2499
  Fe(() => {
2462
2500
  function r(u) {
@@ -2519,15 +2557,15 @@ function Ka(t) {
2519
2557
  )
2520
2558
  ] }),
2521
2559
  /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
2522
- Ya(ae, t.three),
2523
- ae.animations.length > 0 ? Ha(ae, t.three) : null,
2524
- e.search("camera") > -1 ? $a(ae, t.three) : null,
2525
- e.search("light") > -1 ? Wa(ae, t.three) : null,
2526
- e.search("mesh") > -1 ? Ba(ae, t.three) : null
2560
+ Wa(ae, t.three),
2561
+ ae.animations.length > 0 ? Ka(ae, t.three) : null,
2562
+ e.search("camera") > -1 ? Ga(ae, t.three) : null,
2563
+ e.search("light") > -1 ? Ha(ae, t.three) : null,
2564
+ e.search("mesh") > -1 ? $a(ae, t.three) : null
2527
2565
  ] })
2528
2566
  ] }) }, n) }, "Inspector");
2529
2567
  }
2530
- class pi extends ta {
2568
+ class mi extends ta {
2531
2569
  constructor(a) {
2532
2570
  super(a);
2533
2571
  H(this, "three");
@@ -2548,8 +2586,8 @@ class pi extends ta {
2548
2586
  var r;
2549
2587
  const a = this.componentState.scene !== null, e = "Hierarchy - " + (a ? `${(r = this.componentState.scene) == null ? void 0 : r.name}` : "No Scene");
2550
2588
  return /* @__PURE__ */ c.jsx("div", { id: "SidePanel", children: /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
2551
- /* @__PURE__ */ c.jsx($t, { label: e, open: !0, children: /* @__PURE__ */ c.jsx(c.Fragment, { children: a && /* @__PURE__ */ c.jsx(Aa, { child: this.componentState.scene, three: this.three }) }) }),
2552
- /* @__PURE__ */ c.jsx(Ka, { three: this.three })
2589
+ /* @__PURE__ */ c.jsx($t, { label: e, open: !0, children: /* @__PURE__ */ c.jsx(c.Fragment, { children: a && /* @__PURE__ */ c.jsx(Ia, { child: this.componentState.scene, three: this.three }) }) }),
2590
+ /* @__PURE__ */ c.jsx(Xa, { three: this.three })
2553
2591
  ] }) }, "SidePanel");
2554
2592
  }
2555
2593
  // Getters / Setters
@@ -2557,7 +2595,7 @@ class pi extends ta {
2557
2595
  return this.state;
2558
2596
  }
2559
2597
  }
2560
- function mi(t) {
2598
+ function gi(t) {
2561
2599
  function n() {
2562
2600
  return t.three.scene === void 0 ? (console.log("No scene:", t.three), !1) : !0;
2563
2601
  }
@@ -2601,10 +2639,10 @@ function mi(t) {
2601
2639
  j.removeEventListener(_.GET_OBJECT, a), j.removeEventListener(_.UPDATE_OBJECT, r), j.removeEventListener(_.CREATE_TEXTURE, s), j.removeEventListener(_.REQUEST_METHOD, u);
2602
2640
  }), []), null;
2603
2641
  }
2604
- const tn = { type: "change" }, It = { type: "start" }, nn = { type: "end" }, wt = new $n(), an = new Gn(), Xa = Math.cos(70 * Vn.DEG2RAD);
2605
- class qa extends cn {
2642
+ const tn = { type: "change" }, It = { type: "start" }, nn = { type: "end" }, wt = new $n(), an = new Gn(), qa = Math.cos(70 * Vn.DEG2RAD);
2643
+ class Za extends cn {
2606
2644
  constructor(n, a) {
2607
- super(), this.object = n, this.domElement = a, this.domElement.style.touchAction = "none", this.enabled = !0, this.target = new Y(), this.cursor = new Y(), this.minDistance = 0, this.maxDistance = 1 / 0, this.minZoom = 0, this.maxZoom = 1 / 0, this.minTargetRadius = 0, this.maxTargetRadius = 1 / 0, this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -1 / 0, this.maxAzimuthAngle = 1 / 0, this.enableDamping = !1, this.dampingFactor = 0.05, this.enableZoom = !0, this.zoomSpeed = 1, this.enableRotate = !0, this.rotateSpeed = 1, this.enablePan = !0, this.panSpeed = 1, this.screenSpacePanning = !0, this.keyPanSpeed = 7, this.zoomToCursor = !1, this.autoRotate = !1, this.autoRotateSpeed = 2, this.keys = { LEFT: "ArrowLeft", UP: "ArrowUp", RIGHT: "ArrowRight", BOTTOM: "ArrowDown" }, this.mouseButtons = { LEFT: We.ROTATE, MIDDLE: We.DOLLY, RIGHT: We.PAN }, this.touches = { ONE: He.ROTATE, TWO: He.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this.getPolarAngle = function() {
2645
+ super(), this.object = n, this.domElement = a, this.domElement.style.touchAction = "none", this.enabled = !0, this.target = new Y(), this.cursor = new Y(), this.minDistance = 0, this.maxDistance = 1 / 0, this.minZoom = 0, this.maxZoom = 1 / 0, this.minTargetRadius = 0, this.maxTargetRadius = 1 / 0, this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -1 / 0, this.maxAzimuthAngle = 1 / 0, this.enableDamping = !1, this.dampingFactor = 0.05, this.enableZoom = !0, this.zoomSpeed = 1, this.enableRotate = !0, this.rotateSpeed = 1, this.enablePan = !0, this.panSpeed = 1, this.screenSpacePanning = !0, this.keyPanSpeed = 7, this.zoomToCursor = !1, this.autoRotate = !1, this.autoRotateSpeed = 2, this.keys = { LEFT: "ArrowLeft", UP: "ArrowUp", RIGHT: "ArrowRight", BOTTOM: "ArrowDown" }, this.mouseButtons = { LEFT: He.ROTATE, MIDDLE: He.DOLLY, RIGHT: He.PAN }, this.touches = { ONE: Ke.ROTATE, TWO: Ke.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this.getPolarAngle = function() {
2608
2646
  return l.phi;
2609
2647
  }, this.getAzimuthalAngle = function() {
2610
2648
  return l.theta;
@@ -2625,25 +2663,25 @@ class qa extends cn {
2625
2663
  o.copy(ye).sub(e.target), o.applyQuaternion(y), l.setFromVector3(o), e.autoRotate && s === r.NONE && B(b(Et)), e.enableDamping ? (l.theta += d.theta * e.dampingFactor, l.phi += d.phi * e.dampingFactor) : (l.theta += d.theta, l.phi += d.phi);
2626
2664
  let he = e.minAzimuthAngle, pe = e.maxAzimuthAngle;
2627
2665
  isFinite(he) && isFinite(pe) && (he < -Math.PI ? he += ue : he > Math.PI && (he -= ue), pe < -Math.PI ? pe += ue : pe > Math.PI && (pe -= ue), he <= pe ? l.theta = Math.max(he, Math.min(pe, l.theta)) : l.theta = l.theta > (he + pe) / 2 ? Math.max(he, l.theta) : Math.min(pe, l.theta)), l.phi = Math.max(e.minPolarAngle, Math.min(e.maxPolarAngle, l.phi)), l.makeSafe(), e.enableDamping === !0 ? e.target.addScaledVector(v, e.dampingFactor) : e.target.add(v), e.target.sub(e.cursor), e.target.clampLength(e.minTargetRadius, e.maxTargetRadius), e.target.add(e.cursor), e.zoomToCursor && ee || e.object.isOrthographicCamera ? l.radius = q(l.radius) : l.radius = q(l.radius * p), o.setFromSpherical(l), o.applyQuaternion(D), ye.copy(e.target).add(o), e.object.lookAt(e.target), e.enableDamping === !0 ? (d.theta *= 1 - e.dampingFactor, d.phi *= 1 - e.dampingFactor, v.multiplyScalar(1 - e.dampingFactor)) : (d.set(0, 0, 0), v.set(0, 0, 0));
2628
- let Ve = !1;
2666
+ let ze = !1;
2629
2667
  if (e.zoomToCursor && ee) {
2630
2668
  let De = null;
2631
2669
  if (e.object.isPerspectiveCamera) {
2632
2670
  const Te = o.length();
2633
2671
  De = q(Te * p);
2634
- const ze = Te - De;
2635
- e.object.position.addScaledVector(fe, ze), e.object.updateMatrixWorld();
2672
+ const Ye = Te - De;
2673
+ e.object.position.addScaledVector(fe, Ye), e.object.updateMatrixWorld();
2636
2674
  } else if (e.object.isOrthographicCamera) {
2637
2675
  const Te = new Y(le.x, le.y, 0);
2638
- Te.unproject(e.object), e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom / p)), e.object.updateProjectionMatrix(), Ve = !0;
2639
- const ze = new Y(le.x, le.y, 0);
2640
- ze.unproject(e.object), e.object.position.sub(ze).add(Te), e.object.updateMatrixWorld(), De = o.length();
2676
+ Te.unproject(e.object), e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom / p)), e.object.updateProjectionMatrix(), ze = !0;
2677
+ const Ye = new Y(le.x, le.y, 0);
2678
+ Ye.unproject(e.object), e.object.position.sub(Ye).add(Te), e.object.updateMatrixWorld(), De = o.length();
2641
2679
  } else
2642
2680
  console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), e.zoomToCursor = !1;
2643
- De !== null && (this.screenSpacePanning ? e.target.set(0, 0, -1).transformDirection(e.object.matrix).multiplyScalar(De).add(e.object.position) : (wt.origin.copy(e.object.position), wt.direction.set(0, 0, -1).transformDirection(e.object.matrix), Math.abs(e.object.up.dot(wt.direction)) < Xa ? n.lookAt(e.target) : (an.setFromNormalAndCoplanarPoint(e.object.up, e.target), wt.intersectPlane(an, e.target))));
2681
+ De !== null && (this.screenSpacePanning ? e.target.set(0, 0, -1).transformDirection(e.object.matrix).multiplyScalar(De).add(e.object.position) : (wt.origin.copy(e.object.position), wt.direction.set(0, 0, -1).transformDirection(e.object.matrix), Math.abs(e.object.up.dot(wt.direction)) < qa ? n.lookAt(e.target) : (an.setFromNormalAndCoplanarPoint(e.object.up, e.target), wt.intersectPlane(an, e.target))));
2644
2682
  } else
2645
- e.object.isOrthographicCamera && (e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom / p)), e.object.updateProjectionMatrix(), Ve = !0);
2646
- return p = 1, ee = !1, Ve || N.distanceToSquared(e.object.position) > u || 8 * (1 - te.dot(e.object.quaternion)) > u || be.distanceToSquared(e.target) > 0 ? (e.dispatchEvent(tn), N.copy(e.object.position), te.copy(e.object.quaternion), be.copy(e.target), !0) : !1;
2683
+ e.object.isOrthographicCamera && (e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom / p)), e.object.updateProjectionMatrix(), ze = !0);
2684
+ return p = 1, ee = !1, ze || N.distanceToSquared(e.object.position) > u || 8 * (1 - te.dot(e.object.quaternion)) > u || be.distanceToSquared(e.target) > 0 ? (e.dispatchEvent(tn), N.copy(e.object.position), te.copy(e.object.quaternion), be.copy(e.target), !0) : !1;
2647
2685
  };
2648
2686
  }(), this.dispose = function() {
2649
2687
  e.domElement.removeEventListener("contextmenu", Oe), e.domElement.removeEventListener("pointerdown", et), e.domElement.removeEventListener("pointercancel", ke), e.domElement.removeEventListener("wheel", mt), e.domElement.removeEventListener("pointermove", Se), e.domElement.removeEventListener("pointerup", ke), e._domElementKeyEvents !== null && (e._domElementKeyEvents.removeEventListener("keydown", nt), e._domElementKeyEvents = null);
@@ -2765,7 +2803,7 @@ class qa extends cn {
2765
2803
  E.set(D, N);
2766
2804
  }
2767
2805
  }
2768
- function $e(o) {
2806
+ function Ge(o) {
2769
2807
  if (f.length === 1)
2770
2808
  M.set(o.pageX, o.pageY);
2771
2809
  else {
@@ -2778,7 +2816,7 @@ class qa extends cn {
2778
2816
  K.set(0, te);
2779
2817
  }
2780
2818
  function Pt(o) {
2781
- e.enableZoom && je(o), e.enablePan && $e(o);
2819
+ e.enableZoom && je(o), e.enablePan && Ge(o);
2782
2820
  }
2783
2821
  function dt(o) {
2784
2822
  e.enableZoom && je(o), e.enableRotate && Pe(o);
@@ -2809,7 +2847,7 @@ class qa extends cn {
2809
2847
  const be = (o.pageX + y.x) * 0.5, ue = (o.pageY + y.y) * 0.5;
2810
2848
  I(be, ue);
2811
2849
  }
2812
- function Ge(o) {
2850
+ function Ve(o) {
2813
2851
  e.enableZoom && _e(o), e.enablePan && ht(o);
2814
2852
  }
2815
2853
  function pt(o) {
@@ -2840,12 +2878,12 @@ class qa extends cn {
2840
2878
  y = -1;
2841
2879
  }
2842
2880
  switch (y) {
2843
- case We.DOLLY:
2881
+ case He.DOLLY:
2844
2882
  if (e.enableZoom === !1)
2845
2883
  return;
2846
2884
  Re(o), s = r.DOLLY;
2847
2885
  break;
2848
- case We.ROTATE:
2886
+ case He.ROTATE:
2849
2887
  if (o.ctrlKey || o.metaKey || o.shiftKey) {
2850
2888
  if (e.enablePan === !1)
2851
2889
  return;
@@ -2856,7 +2894,7 @@ class qa extends cn {
2856
2894
  me(o), s = r.ROTATE;
2857
2895
  }
2858
2896
  break;
2859
- case We.PAN:
2897
+ case He.PAN:
2860
2898
  if (o.ctrlKey || o.metaKey || o.shiftKey) {
2861
2899
  if (e.enableRotate === !1)
2862
2900
  return;
@@ -2901,15 +2939,15 @@ class qa extends cn {
2901
2939
  switch (at(o), f.length) {
2902
2940
  case 1:
2903
2941
  switch (e.touches.ONE) {
2904
- case He.ROTATE:
2942
+ case Ke.ROTATE:
2905
2943
  if (e.enableRotate === !1)
2906
2944
  return;
2907
2945
  Pe(o), s = r.TOUCH_ROTATE;
2908
2946
  break;
2909
- case He.PAN:
2947
+ case Ke.PAN:
2910
2948
  if (e.enablePan === !1)
2911
2949
  return;
2912
- $e(o), s = r.TOUCH_PAN;
2950
+ Ge(o), s = r.TOUCH_PAN;
2913
2951
  break;
2914
2952
  default:
2915
2953
  s = r.NONE;
@@ -2917,12 +2955,12 @@ class qa extends cn {
2917
2955
  break;
2918
2956
  case 2:
2919
2957
  switch (e.touches.TWO) {
2920
- case He.DOLLY_PAN:
2958
+ case Ke.DOLLY_PAN:
2921
2959
  if (e.enableZoom === !1 && e.enablePan === !1)
2922
2960
  return;
2923
2961
  Pt(o), s = r.TOUCH_DOLLY_PAN;
2924
2962
  break;
2925
- case He.DOLLY_ROTATE:
2963
+ case Ke.DOLLY_ROTATE:
2926
2964
  if (e.enableZoom === !1 && e.enableRotate === !1)
2927
2965
  return;
2928
2966
  dt(o), s = r.TOUCH_DOLLY_ROTATE;
@@ -2951,7 +2989,7 @@ class qa extends cn {
2951
2989
  case r.TOUCH_DOLLY_PAN:
2952
2990
  if (e.enableZoom === !1 && e.enablePan === !1)
2953
2991
  return;
2954
- Ge(o), e.update();
2992
+ Ve(o), e.update();
2955
2993
  break;
2956
2994
  case r.TOUCH_DOLLY_ROTATE:
2957
2995
  if (e.enableZoom === !1 && e.enableRotate === !1)
@@ -3023,17 +3061,17 @@ const St = (t) => {
3023
3061
  "Stacked",
3024
3062
  "Quad"
3025
3063
  ], ne = /* @__PURE__ */ new Map(), ie = /* @__PURE__ */ new Map(), we = /* @__PURE__ */ new Map();
3026
- function Be(t, n) {
3064
+ function $e(t, n) {
3027
3065
  const a = new dn(-100, 100, 100, -100, 50, 3e3);
3028
3066
  return a.name = t, a.position.copy(n), a.lookAt(0, 0, 0), ne.set(t, a), a;
3029
3067
  }
3030
- Be("Top", new Y(0, 1e3, 0));
3031
- Be("Bottom", new Y(0, -1e3, 0));
3032
- Be("Left", new Y(-1e3, 0, 0));
3033
- Be("Right", new Y(1e3, 0, 0));
3034
- Be("Front", new Y(0, 0, 1e3));
3035
- Be("Back", new Y(0, 0, -1e3));
3036
- Be("Orthographic", new Y(1e3, 1e3, 1e3));
3068
+ $e("Top", new Y(0, 1e3, 0));
3069
+ $e("Bottom", new Y(0, -1e3, 0));
3070
+ $e("Left", new Y(-1e3, 0, 0));
3071
+ $e("Right", new Y(1e3, 0, 0));
3072
+ $e("Front", new Y(0, 0, 1e3));
3073
+ $e("Back", new Y(0, 0, -1e3));
3074
+ $e("Orthographic", new Y(1e3, 1e3, 1e3));
3037
3075
  const Tt = new Nt(60, 1, 50, 3e3);
3038
3076
  Tt.name = "Debug";
3039
3077
  Tt.position.set(500, 500, 500);
@@ -3045,7 +3083,7 @@ const on = [
3045
3083
  "Normals",
3046
3084
  "UVs",
3047
3085
  "Wireframe"
3048
- ], Za = new zn(), Ja = new Yn(), Qa = new Da(), ei = new Wn({
3086
+ ], Ja = new zn(), Qa = new Yn(), ei = new Aa(), ti = new Wn({
3049
3087
  opacity: 0.33,
3050
3088
  transparent: !0,
3051
3089
  wireframe: !0
@@ -3058,8 +3096,8 @@ z.add(xe);
3058
3096
  const lt = new Hn();
3059
3097
  lt.name = "helpers";
3060
3098
  z.add(lt);
3061
- const ti = new ja();
3062
- lt.add(ti);
3099
+ const ni = new _a();
3100
+ lt.add(ni);
3063
3101
  const Sn = new hn(500);
3064
3102
  Sn.name = "axisHelper";
3065
3103
  lt.add(Sn);
@@ -3068,13 +3106,13 @@ ct.name = "interactionHelper";
3068
3106
  lt.add(ct);
3069
3107
  ct.visible = !1;
3070
3108
  let Ct = !1, V = ne.get("Debug"), re = ne.get("Orthographic"), Ne = ne.get("Front"), Le = ne.get("Top"), sn = !1;
3071
- function gi(t) {
3109
+ function vi(t) {
3072
3110
  const [n, a] = oe(t.mode !== void 0 ? t.mode : "Single"), [e, r] = oe(null), [s, u] = oe(!1), [l, d] = oe(!1), [p, v] = oe(!1), [, E] = oe(Date.now()), x = Ce(null), C = Ce(null), M = Ce(null), G = Ce(null), se = Ce(null), K = Ce(null), S = (f, m) => {
3073
3111
  const b = ie.get(f.name);
3074
3112
  b !== void 0 && b.dispose(), ie.delete(f.name);
3075
3113
  const O = we.get(f.name);
3076
3114
  O !== void 0 && (z.remove(O), O.dispose()), we.delete(f.name);
3077
- const B = new qa(f, m);
3115
+ const B = new Za(f, m);
3078
3116
  switch (B.enableDamping = !0, B.dampingFactor = 0.05, f.name) {
3079
3117
  case "Top":
3080
3118
  case "Bottom":
@@ -3215,11 +3253,11 @@ function gi(t) {
3215
3253
  const A = new de();
3216
3254
  e.getSize(A);
3217
3255
  const U = Math.min(F.clientX, A.x), J = Math.min(F.clientY, A.y);
3218
- m.x = Ke(U, 0, A.x, -1, 1), m.y = Ke(J, 0, A.y, 1, -1);
3256
+ m.x = Xe(U, 0, A.x, -1, 1), m.y = Xe(J, 0, A.y, 1, -1);
3219
3257
  const R = A.x / 2, I = A.y / 2, q = () => {
3220
- U < R ? m.x = Ke(U, 0, R, -1, 1) : m.x = Ke(U, R, A.x, -1, 1);
3258
+ U < R ? m.x = Xe(U, 0, R, -1, 1) : m.x = Xe(U, R, A.x, -1, 1);
3221
3259
  }, me = () => {
3222
- J < I ? m.y = Ke(J, 0, I, 1, -1) : m.y = Ke(J, I, A.y, 1, -1);
3260
+ J < I ? m.y = Xe(J, 0, I, 1, -1) : m.y = Xe(J, I, A.y, 1, -1);
3223
3261
  };
3224
3262
  switch (n) {
3225
3263
  case "Quad":
@@ -3327,20 +3365,20 @@ function gi(t) {
3327
3365
  if (f !== xt)
3328
3366
  switch (xt = f, xt) {
3329
3367
  case "Depth":
3330
- z.overrideMaterial = Za;
3368
+ z.overrideMaterial = Ja;
3331
3369
  break;
3332
3370
  case "Normals":
3333
- z.overrideMaterial = Ja;
3371
+ z.overrideMaterial = Qa;
3334
3372
  break;
3335
3373
  default:
3336
3374
  case "Renderer":
3337
3375
  z.overrideMaterial = null;
3338
3376
  break;
3339
3377
  case "Wireframe":
3340
- z.overrideMaterial = ei;
3378
+ z.overrideMaterial = ti;
3341
3379
  break;
3342
3380
  case "UVs":
3343
- z.overrideMaterial = Qa;
3381
+ z.overrideMaterial = ei;
3344
3382
  break;
3345
3383
  }
3346
3384
  },
@@ -3370,7 +3408,7 @@ function gi(t) {
3370
3408
  ] })
3371
3409
  ] });
3372
3410
  }
3373
- function vi(t) {
3411
+ function bi(t) {
3374
3412
  return /* @__PURE__ */ c.jsxs("div", { className: "editor", ref: t.ref, style: t.style, children: [
3375
3413
  /* @__PURE__ */ c.jsx("header", { children: t.header }),
3376
3414
  t.children,
@@ -3379,35 +3417,35 @@ function vi(t) {
3379
3417
  }
3380
3418
  export {
3381
3419
  $t as Accordion,
3382
- fi as Application,
3420
+ hi as Application,
3383
3421
  Ot as BaseRemote,
3384
3422
  xn as ChildObject,
3385
- Aa as ContainerObject,
3386
- Sa as Draggable,
3387
- Ca as DraggableItem,
3388
- Oa as Dropdown,
3389
- Ta as DropdownItem,
3390
- vi as Editor,
3391
- ja as InfiniteGridHelper,
3392
- Ka as Inspector,
3393
- gi as MultiView,
3423
+ Ia as ContainerObject,
3424
+ Oa as Draggable,
3425
+ Sa as DraggableItem,
3426
+ Ta as Dropdown,
3427
+ Ma as DropdownItem,
3428
+ bi as Editor,
3429
+ _a as InfiniteGridHelper,
3430
+ Xa as Inspector,
3431
+ vi as MultiView,
3394
3432
  wn as NavButton,
3395
3433
  ca as RemoteComponents,
3396
- hi as RemoteController,
3397
- qe as RemoteTheatre,
3398
- ma as RemoteThree,
3434
+ pi as RemoteController,
3435
+ Ue as RemoteTheatre,
3436
+ ga as RemoteThree,
3399
3437
  En as RemoteTweakpane,
3400
- mi as SceneInspector,
3401
- pi as SidePanel,
3438
+ gi as SceneInspector,
3439
+ mi as SidePanel,
3402
3440
  _ as ToolEvents,
3403
- Da as UVMaterial,
3404
- li as clamp,
3441
+ Aa as UVMaterial,
3442
+ ui as clamp,
3405
3443
  ra as colorToHex,
3406
3444
  j as debugDispatcher,
3407
3445
  vn as dispose,
3408
3446
  sa as disposeMaterial,
3409
- di as disposeTexture,
3410
- ui as distance,
3447
+ fi as disposeTexture,
3448
+ di as distance,
3411
3449
  gn as hierarchyUUID,
3412
3450
  ia as isColor,
3413
3451
  aa as randomID,