@tomorrowevening/hermes 0.0.58 → 0.0.60

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,10 +1,10 @@
1
- import { EventDispatcher as dn, Texture as hn, CubeTexture as Hn, RepeatWrapping as Ht, Color as Lt, FrontSide as Yn, BackSide as fn, DoubleSide as mn, NoBlending as Gn, NormalBlending as Wn, AdditiveBlending as qn, SubtractiveBlending as Kn, MultiplyBlending as Xn, CustomBlending as Zn, AddEquation as Jn, SubtractEquation as Qn, ReverseSubtractEquation as ea, MinEquation as ta, MaxEquation as na, ZeroFactor as pn, OneFactor as gn, SrcColorFactor as vn, OneMinusSrcColorFactor as bn, SrcAlphaFactor as yn, OneMinusSrcAlphaFactor as xn, DstAlphaFactor as En, OneMinusDstAlphaFactor as Cn, DstColorFactor as Sn, OneMinusDstColorFactor as wn, SrcAlphaSaturateFactor as aa, ConstantColorFactor as Mn, OneMinusConstantColorFactor as On, ConstantAlphaFactor as _n, OneMinusConstantAlphaFactor as Tn, Matrix4 as ia, Vector3 as Y, Euler as ra, Line as sa, BufferGeometry as Yt, Float32BufferAttribute as Gt, LineBasicMaterial as oa, Mesh as Rn, MeshBasicMaterial as An, Ray as ca, Plane as la, MathUtils as ua, MOUSE as nt, TOUCH as at, Quaternion as Wt, Spherical as qt, Vector2 as fe, ShaderMaterial as kn, GLSL3 as da, PlaneGeometry as ha, Scene as fa, Group as ma, AxesHelper as Kt, MeshDepthMaterial as pa, MeshNormalMaterial as ga, WebGLRenderer as va, PerspectiveCamera as kt, Raycaster as ba, OrthographicCamera as Xt, CameraHelper as ya, SpotLightHelper as xa, PointLightHelper as Ea, HemisphereLightHelper as Ca, DirectionalLightHelper as Sa } from "three";
2
- import { Pane as wa } from "tweakpane";
3
- import * as Ma from "@tweakpane/plugin-essentials";
4
- import Pn, { useState as K, useEffect as Pe, useRef as X, useMemo as ie, forwardRef as Oa } from "react";
5
- import { Reorder as jn } from "framer-motion";
6
- const Ft = () => {
7
- }, Ri = () => {
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
+ import { Pane as Ma } from "tweakpane";
3
+ import * as Oa from "@tweakpane/plugin-essentials";
4
+ import An, { useState as Z, useEffect as Ae, useRef as X, useMemo as ie, forwardRef as Ta } from "react";
5
+ import { Reorder as Dn } from "framer-motion";
6
+ const Bt = () => {
7
+ }, Pi = () => {
8
8
  };
9
9
  function Mt(e) {
10
10
  return e.substring(0, 1).toUpperCase() + e.substring(1);
@@ -12,60 +12,60 @@ function Mt(e) {
12
12
  function Ke(e, n, a) {
13
13
  return Math.min(n, Math.max(e, a));
14
14
  }
15
- function Zt(e, n, a) {
15
+ function Jt(e, n, a) {
16
16
  return (a - e) / (n - e);
17
17
  }
18
- function Jt(e, n, a) {
18
+ function Qt(e, n, a) {
19
19
  return e * (1 - a) + n * a;
20
20
  }
21
- function Ai(e, n) {
21
+ function ki(e, n) {
22
22
  const a = e - n;
23
23
  return Math.sqrt(a * a);
24
24
  }
25
25
  function _a() {
26
26
  return Math.round(Math.random() * 1e6).toString();
27
27
  }
28
- function Ta(e) {
28
+ function Ra(e) {
29
29
  return e.r !== void 0 && e.g !== void 0 && e.b !== void 0;
30
30
  }
31
- function Ra(e) {
32
- const n = Math.round(e.r * 255), a = Math.round(e.g * 255), t = Math.round(e.b * 255), i = (h) => {
33
- const d = h.toString(16);
34
- return d.length === 1 ? "0" + d : d;
35
- }, o = i(n), u = i(a), c = i(t);
36
- return "#" + o + u + c;
31
+ function Pa(e) {
32
+ const n = Math.round(e.r * 255), a = Math.round(e.g * 255), t = Math.round(e.b * 255), i = (d) => {
33
+ const h = d.toString(16);
34
+ return h.length === 1 ? "0" + h : h;
35
+ }, c = i(n), u = i(a), o = i(t);
36
+ return "#" + c + u + o;
37
37
  }
38
- function Qt(e, n = 1) {
38
+ function en(e, n = 1) {
39
39
  return Number(e.toFixed(n));
40
40
  }
41
41
  let Dt = 0;
42
- const Aa = () => {
42
+ const ka = () => {
43
43
  Dt = 0;
44
- }, Dn = (e) => {
44
+ }, In = (e) => {
45
45
  if (!e)
46
46
  return;
47
47
  let n = e.name.replace(" ", "");
48
48
  n.length === 0 && (n = `obj_${Dt}`, Dt++), e.parent !== null && e.parent.uuid.length > 0 && (n = `${e.parent.uuid}.${n}`), e.uuid = n, e.children.forEach((a) => {
49
- Dn(a);
49
+ In(a);
50
50
  });
51
- }, ki = (e) => {
51
+ }, ji = (e) => {
52
52
  e?.dispose();
53
- }, ka = (e) => {
53
+ }, ja = (e) => {
54
54
  e && (Array.isArray(e) ? e.forEach((n) => n.dispose()) : e.dispose());
55
- }, In = (e) => {
55
+ }, Ft = (e) => {
56
56
  if (e) {
57
57
  for (; e.children.length > 0; ) {
58
58
  const n = e.children[0];
59
- n.type === "Audio" ? (n.pause(), n.parent && n.parent.remove(n)) : In(n);
59
+ n.type === "Audio" ? (n.pause(), n.parent && n.parent.remove(n)) : Ft(n);
60
60
  }
61
61
  if (e.parent && e.parent.remove(e), e.isMesh) {
62
62
  const n = e;
63
- n.geometry?.dispose(), ka(n.material);
63
+ n.geometry?.dispose(), ja(n.material);
64
64
  }
65
65
  e.dispose !== void 0 && e.dispose();
66
66
  }
67
67
  };
68
- class Pi {
68
+ class Ai {
69
69
  components = /* @__PURE__ */ new Map();
70
70
  listen;
71
71
  // Protected
@@ -123,7 +123,7 @@ class Pi {
123
123
  n && (this._mode = "editor");
124
124
  }
125
125
  }
126
- const N = new dn(), L = {
126
+ const j = new hn(), A = {
127
127
  CUSTOM: "ToolEvents::custom",
128
128
  // Components
129
129
  SELECT_DROPDOWN: "ToolEvents::selectDropdown",
@@ -151,7 +151,7 @@ class Ot {
151
151
  handleEditor(n, a, t) {
152
152
  }
153
153
  }
154
- class ji extends Ot {
154
+ class Di extends Ot {
155
155
  selectDropdown(n, a) {
156
156
  this.app.send({
157
157
  event: "selectComponent",
@@ -175,15 +175,15 @@ class ji extends Ot {
175
175
  handleApp(n, a, t) {
176
176
  switch (t.event) {
177
177
  case "selectComponent":
178
- N.dispatchEvent({ type: L.SELECT_DROPDOWN, value: t.data });
178
+ j.dispatchEvent({ type: A.SELECT_DROPDOWN, value: t.data });
179
179
  break;
180
180
  case "draggableListUpdate":
181
- N.dispatchEvent({ type: L.DRAG_UPDATE, value: t.data });
181
+ j.dispatchEvent({ type: A.DRAG_UPDATE, value: t.data });
182
182
  break;
183
183
  }
184
184
  }
185
185
  }
186
- class Bt extends Ot {
186
+ class Ut extends Ot {
187
187
  project;
188
188
  sheets = /* @__PURE__ */ new Map();
189
189
  sheetObjects = /* @__PURE__ */ new Map();
@@ -232,17 +232,17 @@ class Bt extends Ot {
232
232
  console.error("Theatre Project hasn't been created yet.");
233
233
  return;
234
234
  }
235
- const o = this.sheet(n);
236
- if (o === void 0)
235
+ const c = this.sheet(n);
236
+ if (c === void 0)
237
237
  return;
238
238
  const u = `${n}_${a}`;
239
- let c = this.sheetObjects.get(u);
240
- c !== void 0 ? c = o.object(a, { ...t, ...c.value }, { reconfigure: !0 }) : c = o.object(a, t), this.sheetObjects.set(u, c), this.sheetObjectCBs.set(u, i !== void 0 ? i : Ft);
241
- const h = c.onValuesChange((d) => {
239
+ let o = this.sheetObjects.get(u);
240
+ o !== void 0 ? o = c.object(a, { ...t, ...o.value }, { reconfigure: !0 }) : o = c.object(a, t), this.sheetObjects.set(u, o), this.sheetObjectCBs.set(u, i !== void 0 ? i : Bt);
241
+ const d = o.onValuesChange((h) => {
242
242
  if (this.app.editor) {
243
- for (const m in d) {
244
- const x = d[m];
245
- typeof x == "object" && Ta(x) && (d[m] = {
243
+ for (const m in h) {
244
+ const x = h[m];
245
+ typeof x == "object" && Ra(x) && (h[m] = {
246
246
  r: x.r,
247
247
  g: x.g,
248
248
  b: x.b,
@@ -255,14 +255,14 @@ class Bt extends Ot {
255
255
  data: {
256
256
  sheet: n,
257
257
  sheetObject: u,
258
- values: d
258
+ values: h
259
259
  }
260
260
  });
261
261
  }
262
262
  const f = this.sheetObjectCBs.get(u);
263
- f !== void 0 && f(d);
263
+ f !== void 0 && f(h);
264
264
  });
265
- return this.sheetObjectUnsubscribe.set(u, h), c;
265
+ return this.sheetObjectUnsubscribe.set(u, d), o;
266
266
  }
267
267
  unsubscribe(n) {
268
268
  if (this.project === void 0) {
@@ -271,24 +271,24 @@ class Bt extends Ot {
271
271
  }
272
272
  const a = n.address.sheetId, t = n.address.objectKey;
273
273
  this.sheets.get(a)?.detachObject(t);
274
- const o = `${a}_${t}`, u = this.sheetObjectUnsubscribe.get(o);
275
- u !== void 0 && (this.sheetObjects.delete(o), this.sheetObjectCBs.delete(o), this.sheetObjectUnsubscribe.delete(o), u());
274
+ const c = `${a}_${t}`, u = this.sheetObjectUnsubscribe.get(c);
275
+ u !== void 0 && (this.sheetObjects.delete(c), this.sheetObjectCBs.delete(c), this.sheetObjectUnsubscribe.delete(c), u());
276
276
  }
277
277
  handleApp(n, a, t) {
278
278
  const i = a;
279
- let o;
279
+ let c;
280
280
  switch (t.event) {
281
281
  case "setSheet":
282
- o = i.sheets.get(t.data.sheet), o !== void 0 && (i.activeSheet = o, this.studio?.setSelection([o]));
282
+ c = i.sheets.get(t.data.sheet), c !== void 0 && (i.activeSheet = c, this.studio?.setSelection([c]));
283
283
  break;
284
284
  case "setSheetObject":
285
- o = i.sheetObjects.get(`${t.data.sheet}_${t.data.key}`), o !== void 0 && this.studio?.setSelection([o]);
285
+ c = i.sheetObjects.get(`${t.data.sheet}_${t.data.key}`), c !== void 0 && this.studio?.setSelection([c]);
286
286
  break;
287
287
  case "updateSheetObject":
288
- o = i.sheets.get(t.data.sheet), o !== void 0 && o.sequence.pause(), o = i.sheetObjectCBs.get(t.data.sheetObject), o !== void 0 && o(t.data.values);
288
+ c = i.sheets.get(t.data.sheet), c !== void 0 && c.sequence.pause(), c = i.sheetObjectCBs.get(t.data.sheetObject), c !== void 0 && c(t.data.values);
289
289
  break;
290
290
  case "updateTimeline":
291
- o = i.sheets.get(t.data.sheet), i.activeSheet !== void 0 && (i.activeSheet.sequence.position = t.data.position);
291
+ c = i.sheets.get(t.data.sheet), i.activeSheet !== void 0 && (i.activeSheet.sequence.position = t.data.position);
292
292
  break;
293
293
  }
294
294
  }
@@ -308,28 +308,28 @@ class Bt extends Ot {
308
308
  handleEditorApp(n, a) {
309
309
  if (n.editor) {
310
310
  this.studio?.ui.restore(), this.studio?.onSelectionChange((u) => {
311
- u.length < 1 || u.forEach((c) => {
312
- let h = c.address.sheetId, d = "setSheet", f = {};
313
- switch (c.type) {
311
+ u.length < 1 || u.forEach((o) => {
312
+ let d = o.address.sheetId, h = "setSheet", f = {};
313
+ switch (o.type) {
314
314
  case "Theatre_Sheet_PublicAPI":
315
- d = "setSheet", f = {
316
- sheet: c.address.sheetId
317
- }, a.activeSheet = a.sheets.get(c.address.sheetId);
315
+ h = "setSheet", f = {
316
+ sheet: o.address.sheetId
317
+ }, a.activeSheet = a.sheets.get(o.address.sheetId);
318
318
  break;
319
319
  case "Theatre_SheetObject_PublicAPI":
320
- d = "setSheetObject", h += `_${c.address.objectKey}`, f = {
321
- id: h,
322
- sheet: c.address.sheetId,
323
- key: c.address.objectKey
324
- }, a.activeSheet = a.sheets.get(c.address.sheetId);
320
+ h = "setSheetObject", d += `_${o.address.objectKey}`, f = {
321
+ id: d,
322
+ sheet: o.address.sheetId,
323
+ key: o.address.objectKey
324
+ }, a.activeSheet = a.sheets.get(o.address.sheetId);
325
325
  break;
326
326
  }
327
- n.send({ event: d, target: "app", data: f });
327
+ n.send({ event: h, target: "app", data: f });
328
328
  });
329
329
  });
330
330
  let t = -1;
331
331
  const i = () => {
332
- if (Bt.rafDriver?.tick(performance.now()), a.activeSheet !== void 0 && t !== a.activeSheet.sequence.position) {
332
+ if (Ut.rafDriver?.tick(performance.now()), a.activeSheet !== void 0 && t !== a.activeSheet.sequence.position) {
333
333
  t = a.activeSheet.sequence.position;
334
334
  const u = a.activeSheet;
335
335
  n.send({
@@ -341,39 +341,39 @@ class Bt extends Ot {
341
341
  }
342
342
  });
343
343
  }
344
- }, o = () => {
345
- i(), requestAnimationFrame(o);
344
+ }, c = () => {
345
+ i(), requestAnimationFrame(c);
346
346
  };
347
- i(), o();
347
+ i(), c();
348
348
  } else
349
349
  this.studio?.ui.hide();
350
350
  }
351
351
  }
352
- function Di(e, n, a) {
352
+ function Ii(e, n, a) {
353
353
  if (e.editor) {
354
354
  a.ui.restore(), a.onSelectionChange((u) => {
355
- u.length < 1 || u.forEach((c) => {
356
- let h = c.address.sheetId, d = "setSheet", f = {};
357
- switch (c.type) {
355
+ u.length < 1 || u.forEach((o) => {
356
+ let d = o.address.sheetId, h = "setSheet", f = {};
357
+ switch (o.type) {
358
358
  case "Theatre_Sheet_PublicAPI":
359
- d = "setSheet", f = {
360
- sheet: c.address.sheetId
361
- }, n.activeSheet = n.sheets.get(c.address.sheetId);
359
+ h = "setSheet", f = {
360
+ sheet: o.address.sheetId
361
+ }, n.activeSheet = n.sheets.get(o.address.sheetId);
362
362
  break;
363
363
  case "Theatre_SheetObject_PublicAPI":
364
- d = "setSheetObject", h += `_${c.address.objectKey}`, f = {
365
- id: h,
366
- sheet: c.address.sheetId,
367
- key: c.address.objectKey
368
- }, n.activeSheet = n.sheets.get(c.address.sheetId);
364
+ h = "setSheetObject", d += `_${o.address.objectKey}`, f = {
365
+ id: d,
366
+ sheet: o.address.sheetId,
367
+ key: o.address.objectKey
368
+ }, n.activeSheet = n.sheets.get(o.address.sheetId);
369
369
  break;
370
370
  }
371
- e.send({ event: d, target: "app", data: f });
371
+ e.send({ event: h, target: "app", data: f });
372
372
  });
373
373
  });
374
374
  let t = -1;
375
375
  const i = () => {
376
- if (Bt.rafDriver?.tick(performance.now()), n.activeSheet !== void 0 && t !== n.activeSheet.sequence.position) {
376
+ if (Ut.rafDriver?.tick(performance.now()), n.activeSheet !== void 0 && t !== n.activeSheet.sequence.position) {
377
377
  t = n.activeSheet.sequence.position;
378
378
  const u = n.activeSheet;
379
379
  e.send({
@@ -385,14 +385,14 @@ function Di(e, n, a) {
385
385
  }
386
386
  });
387
387
  }
388
- }, o = () => {
389
- i(), requestAnimationFrame(o);
388
+ }, c = () => {
389
+ i(), requestAnimationFrame(c);
390
390
  };
391
- i(), o();
391
+ i(), c();
392
392
  } else
393
393
  a.ui.hide();
394
394
  }
395
- function Pa(e) {
395
+ function Aa(e) {
396
396
  if (e.name === "cameras")
397
397
  return "camera";
398
398
  if (e.name === "interactive")
@@ -417,7 +417,7 @@ function Nn(e) {
417
417
  n.children.push(Nn(a));
418
418
  }), n;
419
419
  }
420
- function ja(e) {
420
+ function Da(e) {
421
421
  const n = {};
422
422
  for (const a in e) {
423
423
  const t = e[a].value;
@@ -425,7 +425,7 @@ function ja(e) {
425
425
  }
426
426
  return n;
427
427
  }
428
- function Da(e) {
428
+ function Ia(e) {
429
429
  switch (e) {
430
430
  case "blendSrcAlpha":
431
431
  case "blendDstAlpha":
@@ -440,7 +440,7 @@ function Da(e) {
440
440
  function it(e) {
441
441
  const n = {};
442
442
  for (const a in e) {
443
- if (a.substring(0, 1) === "_" || a.substring(0, 2) === "is" || Da(a))
443
+ if (a.substring(0, 1) === "_" || a.substring(0, 2) === "is" || Ia(a))
444
444
  continue;
445
445
  const t = typeof e[a], i = e[a];
446
446
  switch (t) {
@@ -452,13 +452,13 @@ function it(e) {
452
452
  case "object":
453
453
  if (i !== null)
454
454
  if (n[a] = i, i.isTexture)
455
- if (i instanceof hn) {
456
- const o = i.source.toJSON();
457
- n[a] = { src: o.url };
455
+ if (i instanceof fn) {
456
+ const c = i.source.toJSON();
457
+ n[a] = { src: c.url };
458
458
  } else
459
- i instanceof Hn && (console.log("env map"), console.log(i.source.data), console.log(i.source.toJSON()), n[a] = { src: "" });
459
+ i instanceof Wn && (console.log("env map"), console.log(i.source.data), console.log(i.source.toJSON()), n[a] = { src: "" });
460
460
  else
461
- a === "uniforms" && (n[a] = ja(n[a]));
461
+ a === "uniforms" && (n[a] = Da(n[a]));
462
462
  else
463
463
  n[a] = { src: "" };
464
464
  break;
@@ -466,7 +466,7 @@ function it(e) {
466
466
  }
467
467
  return n;
468
468
  }
469
- function Pt(e) {
469
+ function jt(e) {
470
470
  e.updateMatrix();
471
471
  const n = {
472
472
  name: e.name,
@@ -492,8 +492,8 @@ function Pt(e) {
492
492
  const t = e;
493
493
  if (Array.isArray(t.material)) {
494
494
  const i = [];
495
- t.material.forEach((o) => {
496
- i.push(it(o));
495
+ t.material.forEach((c) => {
496
+ i.push(it(c));
497
497
  }), n.material = i;
498
498
  } else
499
499
  n.material = it(t.material);
@@ -501,8 +501,8 @@ function Pt(e) {
501
501
  const t = e;
502
502
  if (Array.isArray(t.material)) {
503
503
  const i = [];
504
- t.material.forEach((o) => {
505
- i.push(it(o));
504
+ t.material.forEach((c) => {
505
+ i.push(it(c));
506
506
  }), n.material = i;
507
507
  } else
508
508
  n.material = it(t.material);
@@ -510,8 +510,8 @@ function Pt(e) {
510
510
  const t = e;
511
511
  if (Array.isArray(t.material)) {
512
512
  const i = [];
513
- t.material.forEach((o) => {
514
- i.push(it(o));
513
+ t.material.forEach((c) => {
514
+ i.push(it(c));
515
515
  }), n.material = i;
516
516
  } else
517
517
  n.material = it(t.material);
@@ -546,7 +546,7 @@ function Pt(e) {
546
546
  });
547
547
  return n;
548
548
  }
549
- function Ia(e, n) {
549
+ function Na(e, n) {
550
550
  const a = n.split(".");
551
551
  switch (a.length) {
552
552
  case 1:
@@ -563,11 +563,11 @@ function Ia(e, n) {
563
563
  return e[a[0]][a[1]][a[2]][a[3]][a[4]][a[5]];
564
564
  }
565
565
  }
566
- function Na(e, n) {
566
+ function La(e, n) {
567
567
  for (const a in n)
568
568
  e[a] = n[a];
569
569
  }
570
- function Q(e, n, a) {
570
+ function V(e, n, a) {
571
571
  const t = n.split("."), i = t.length;
572
572
  if (typeof a != "object")
573
573
  switch (i) {
@@ -606,21 +606,27 @@ function Q(e, n, a) {
606
606
  u = e[t[0]][t[1]][t[2]][t[3]][t[4]];
607
607
  break;
608
608
  }
609
- u !== void 0 && Na(u, a);
609
+ u !== void 0 && La(u, a);
610
610
  }
611
611
  }
612
612
  function Ln(e) {
613
613
  return new Promise((n, a) => {
614
614
  const t = new Image();
615
615
  t.onload = () => {
616
- const i = new hn(t);
616
+ const i = new fn(t);
617
617
  i.wrapS = Ht, i.wrapT = Ht, i.needsUpdate = !0, n(i);
618
618
  }, t.onerror = a, t.src = e;
619
619
  });
620
620
  }
621
- class Ii extends Ot {
621
+ class Ni extends Ot {
622
622
  scene = void 0;
623
623
  renderer = void 0;
624
+ renderTargets = /* @__PURE__ */ new Map();
625
+ dispose() {
626
+ this.renderTargets.forEach((n) => {
627
+ n.dispose();
628
+ }), this.renderTargets.clear(), this.scene && Ft(this.scene), this.renderer?.dispose();
629
+ }
624
630
  getObject(n) {
625
631
  this.app.debugEnabled && this.app.send({
626
632
  event: "getObject",
@@ -629,7 +635,7 @@ class Ii extends Ot {
629
635
  });
630
636
  }
631
637
  setObject(n) {
632
- const a = Pt(n);
638
+ const a = jt(n);
633
639
  this.app.send({
634
640
  event: "setObject",
635
641
  target: "editor",
@@ -673,7 +679,7 @@ class Ii extends Ot {
673
679
  setScene(n) {
674
680
  if (n === void 0 || (this.scene = n, !this.app.debugEnabled))
675
681
  return;
676
- Aa(), Dn(this.scene);
682
+ ka(), In(this.scene);
677
683
  const a = Nn(this.scene);
678
684
  this.app.send({
679
685
  event: "setScene",
@@ -684,7 +690,7 @@ class Ii extends Ot {
684
690
  addCamera(n) {
685
691
  if (!this.app.debugEnabled)
686
692
  return;
687
- const a = Pt(n);
693
+ const a = jt(n);
688
694
  this.app.send({
689
695
  event: "addCamera",
690
696
  target: "editor",
@@ -694,7 +700,7 @@ class Ii extends Ot {
694
700
  removeCamera(n) {
695
701
  if (!this.app.debugEnabled)
696
702
  return;
697
- const a = Pt(n);
703
+ const a = jt(n);
698
704
  this.app.send({
699
705
  event: "removeCamera",
700
706
  target: "editor",
@@ -704,38 +710,47 @@ class Ii extends Ot {
704
710
  handleApp(n, a, t) {
705
711
  switch (t.event) {
706
712
  case "getObject":
707
- N.dispatchEvent({ type: L.GET_OBJECT, value: t.data });
713
+ j.dispatchEvent({ type: A.GET_OBJECT, value: t.data });
708
714
  break;
709
715
  case "updateObject":
710
- N.dispatchEvent({ type: L.UPDATE_OBJECT, value: t.data });
716
+ j.dispatchEvent({ type: A.UPDATE_OBJECT, value: t.data });
711
717
  break;
712
718
  case "createTexture":
713
- N.dispatchEvent({ type: L.CREATE_TEXTURE, value: t.data });
719
+ j.dispatchEvent({ type: A.CREATE_TEXTURE, value: t.data });
714
720
  break;
715
721
  case "requestMethod":
716
- N.dispatchEvent({ type: L.REQUEST_METHOD, value: t.data });
722
+ j.dispatchEvent({ type: A.REQUEST_METHOD, value: t.data });
717
723
  break;
718
724
  }
719
725
  }
720
726
  handleEditor(n, a, t) {
721
727
  switch (t.event) {
722
728
  case "setObject":
723
- N.dispatchEvent({ type: L.SET_OBJECT, value: t.data });
729
+ j.dispatchEvent({ type: A.SET_OBJECT, value: t.data });
724
730
  break;
725
731
  case "setScene":
726
- N.dispatchEvent({ type: L.SET_SCENE, value: t.data });
732
+ j.dispatchEvent({ type: A.SET_SCENE, value: t.data });
727
733
  break;
728
734
  case "addCamera":
729
- N.dispatchEvent({ type: L.ADD_CAMERA, value: t.data });
735
+ j.dispatchEvent({ type: A.ADD_CAMERA, value: t.data });
730
736
  break;
731
737
  case "removeCamera":
732
- N.dispatchEvent({ type: L.REMOVE_CAMERA, value: t.data });
738
+ j.dispatchEvent({ type: A.REMOVE_CAMERA, value: t.data });
733
739
  break;
734
740
  }
735
741
  }
736
742
  // Renderer
743
+ rendererWidth = 0;
744
+ rendererHeight = 0;
745
+ addRT(n, a) {
746
+ const t = new Hn(32, 32, a);
747
+ t.texture.name = n, this.renderTargets.set(n, t);
748
+ }
737
749
  resize(n, a) {
738
- this.renderer?.setSize(n, a);
750
+ const t = this.dpr;
751
+ this.rendererWidth = n, this.rendererHeight = a, this.renderTargets.forEach((i) => {
752
+ i.setSize(n * t, a * t);
753
+ }), this.renderer?.setSize(n, a);
739
754
  }
740
755
  set dpr(n) {
741
756
  this.renderer?.setPixelRatio(Ke(1, 2, n));
@@ -744,16 +759,16 @@ class Ii extends Ot {
744
759
  return this.renderer !== void 0 ? this.renderer?.getPixelRatio() : 1;
745
760
  }
746
761
  get width() {
747
- return this.renderer !== void 0 ? this.renderer?.domElement.width / this.dpr : 0;
762
+ return this.rendererWidth;
748
763
  }
749
764
  get height() {
750
- return this.renderer !== void 0 ? this.renderer?.domElement.height / this.dpr : 0;
765
+ return this.rendererHeight;
751
766
  }
752
767
  get canvas() {
753
768
  return this.renderer !== void 0 ? this.renderer?.domElement : null;
754
769
  }
755
770
  }
756
- class Ni extends Ot {
771
+ class Li extends Ot {
757
772
  bindCBs;
758
773
  buttonCBs;
759
774
  pane = void 0;
@@ -764,7 +779,7 @@ class Ni extends Ot {
764
779
  super(n), this.bindCBs = /* @__PURE__ */ new Map(), this.buttonCBs = /* @__PURE__ */ new Map(), n.editor && this.createGUI();
765
780
  }
766
781
  createGUI() {
767
- this.pane = new wa({ title: "GUI" }), this.pane.registerPlugin(Ma);
782
+ this.pane = new Ma({ title: "GUI" }), this.pane.registerPlugin(Oa);
768
783
  }
769
784
  dispose() {
770
785
  this.bindCBs.clear(), this.buttonCBs.clear(), this.appCallbacks = 0, this.editorCallbacks = 0, this.app.editor && (this.pane?.dispose(), this.pane = void 0);
@@ -790,21 +805,21 @@ class Ni extends Ot {
790
805
  }
791
806
  // Binding
792
807
  bind(n, a, t, i = void 0) {
793
- const o = this.bindID, u = t.onChange !== void 0 ? t.onChange : Ft;
794
- this.bindCBs.set(o, u), this.app.editor ? (this.pane === void 0 && this.createGUI(), (i !== void 0 ? i : this.pane).addBinding(n, a, t).on("change", (h) => {
808
+ const c = this.bindID, u = t.onChange !== void 0 ? t.onChange : Bt;
809
+ this.bindCBs.set(c, u), this.app.editor ? (this.pane === void 0 && this.createGUI(), (i !== void 0 ? i : this.pane).addBinding(n, a, t).on("change", (d) => {
795
810
  this.app.send({
796
811
  event: "updateBind",
797
812
  target: "app",
798
813
  data: {
799
- id: o,
800
- value: h.value
814
+ id: c,
815
+ value: d.value
801
816
  }
802
817
  });
803
818
  }), this.editorCallbacks++) : (this.app.send({
804
819
  event: "bindObject",
805
820
  target: "app",
806
821
  data: {
807
- id: o,
822
+ id: c,
808
823
  name: a,
809
824
  params: t,
810
825
  parent: i
@@ -881,21 +896,21 @@ var It = { exports: {} }, lt = {};
881
896
  * This source code is licensed under the MIT license found in the
882
897
  * LICENSE file in the root directory of this source tree.
883
898
  */
884
- var en;
885
- function La() {
886
- if (en)
899
+ var tn;
900
+ function Ba() {
901
+ if (tn)
887
902
  return lt;
888
- en = 1;
889
- var e = Pn, n = Symbol.for("react.element"), a = Symbol.for("react.fragment"), t = Object.prototype.hasOwnProperty, i = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, o = { key: !0, ref: !0, __self: !0, __source: !0 };
890
- function u(c, h, d) {
891
- var f, m = {}, x = null, O = null;
892
- d !== void 0 && (x = "" + d), h.key !== void 0 && (x = "" + h.key), h.ref !== void 0 && (O = h.ref);
893
- for (f in h)
894
- t.call(h, f) && !o.hasOwnProperty(f) && (m[f] = h[f]);
895
- if (c && c.defaultProps)
896
- for (f in h = c.defaultProps, h)
897
- m[f] === void 0 && (m[f] = h[f]);
898
- return { $$typeof: n, type: c, key: x, ref: O, props: m, _owner: i.current };
903
+ tn = 1;
904
+ var e = An, n = Symbol.for("react.element"), a = Symbol.for("react.fragment"), t = Object.prototype.hasOwnProperty, i = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, c = { key: !0, ref: !0, __self: !0, __source: !0 };
905
+ function u(o, d, h) {
906
+ var f, m = {}, x = null, T = null;
907
+ h !== void 0 && (x = "" + h), d.key !== void 0 && (x = "" + d.key), d.ref !== void 0 && (T = d.ref);
908
+ for (f in d)
909
+ t.call(d, f) && !c.hasOwnProperty(f) && (m[f] = d[f]);
910
+ if (o && o.defaultProps)
911
+ for (f in d = o.defaultProps, d)
912
+ m[f] === void 0 && (m[f] = d[f]);
913
+ return { $$typeof: n, type: o, key: x, ref: T, props: m, _owner: i.current };
899
914
  }
900
915
  return lt.Fragment = a, lt.jsx = u, lt.jsxs = u, lt;
901
916
  }
@@ -909,54 +924,54 @@ var ut = {};
909
924
  * This source code is licensed under the MIT license found in the
910
925
  * LICENSE file in the root directory of this source tree.
911
926
  */
912
- var tn;
927
+ var nn;
913
928
  function Fa() {
914
- return tn || (tn = 1, process.env.NODE_ENV !== "production" && function() {
915
- var e = Pn, n = Symbol.for("react.element"), a = Symbol.for("react.portal"), t = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), o = Symbol.for("react.profiler"), u = Symbol.for("react.provider"), c = Symbol.for("react.context"), h = Symbol.for("react.forward_ref"), d = Symbol.for("react.suspense"), f = Symbol.for("react.suspense_list"), m = Symbol.for("react.memo"), x = Symbol.for("react.lazy"), O = Symbol.for("react.offscreen"), H = Symbol.iterator, te = "@@iterator";
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"), W = Symbol.iterator, te = "@@iterator";
916
931
  function me(r) {
917
932
  if (r === null || typeof r != "object")
918
933
  return null;
919
- var p = H && r[H] || r[te];
934
+ var p = W && r[W] || r[te];
920
935
  return typeof p == "function" ? p : null;
921
936
  }
922
937
  var re = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
923
938
  function $(r) {
924
939
  {
925
- for (var p = arguments.length, b = new Array(p > 1 ? p - 1 : 0), C = 1; C < p; C++)
926
- b[C - 1] = arguments[C];
927
- D("error", r, b);
940
+ for (var p = arguments.length, b = new Array(p > 1 ? p - 1 : 0), S = 1; S < p; S++)
941
+ b[S - 1] = arguments[S];
942
+ I("error", r, b);
928
943
  }
929
944
  }
930
- function D(r, p, b) {
945
+ function I(r, p, b) {
931
946
  {
932
- var C = re.ReactDebugCurrentFrame, F = C.getStackAddendum();
933
- F !== "" && (p += "%s", b = b.concat([F]));
934
- var U = b.map(function(P) {
935
- return String(P);
947
+ var S = re.ReactDebugCurrentFrame, L = S.getStackAddendum();
948
+ L !== "" && (p += "%s", b = b.concat([L]));
949
+ var U = b.map(function(k) {
950
+ return String(k);
936
951
  });
937
952
  U.unshift("Warning: " + p), Function.prototype.apply.call(console[r], console, U);
938
953
  }
939
954
  }
940
- var Z = !1, ne = !1, Se = !1, V = !1, pe = !1, le;
941
- le = Symbol.for("react.module.reference");
942
- function _e(r) {
943
- return !!(typeof r == "string" || typeof r == "function" || r === t || r === o || pe || r === i || r === d || r === f || V || r === O || Z || ne || Se || typeof r == "object" && r !== null && (r.$$typeof === x || r.$$typeof === m || r.$$typeof === u || r.$$typeof === c || r.$$typeof === h || // This needs to include all possible module reference object
955
+ var q = !1, ne = !1, Se = !1, z = !1, pe = !1, ce;
956
+ ce = Symbol.for("react.module.reference");
957
+ function Te(r) {
958
+ return !!(typeof r == "string" || typeof r == "function" || r === t || r === c || pe || r === i || r === h || r === f || z || r === T || q || ne || Se || typeof r == "object" && r !== null && (r.$$typeof === x || r.$$typeof === m || r.$$typeof === u || r.$$typeof === o || r.$$typeof === d || // This needs to include all possible module reference object
944
959
  // types supported by any Flight configuration anywhere since
945
960
  // we don't know which Flight build this will end up being used
946
961
  // with.
947
- r.$$typeof === le || r.getModuleId !== void 0));
962
+ r.$$typeof === ce || r.getModuleId !== void 0));
948
963
  }
949
- function Te(r, p, b) {
950
- var C = r.displayName;
951
- if (C)
952
- return C;
953
- var F = p.displayName || p.name || "";
954
- return F !== "" ? b + "(" + F + ")" : b;
964
+ function _e(r, p, b) {
965
+ var S = r.displayName;
966
+ if (S)
967
+ return S;
968
+ var L = p.displayName || p.name || "";
969
+ return L !== "" ? b + "(" + L + ")" : b;
955
970
  }
956
971
  function ve(r) {
957
972
  return r.displayName || "Context";
958
973
  }
959
- function I(r) {
974
+ function N(r) {
960
975
  if (r == null)
961
976
  return null;
962
977
  if (typeof r.tag == "number" && $("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof r == "function")
@@ -968,32 +983,32 @@ function Fa() {
968
983
  return "Fragment";
969
984
  case a:
970
985
  return "Portal";
971
- case o:
986
+ case c:
972
987
  return "Profiler";
973
988
  case i:
974
989
  return "StrictMode";
975
- case d:
990
+ case h:
976
991
  return "Suspense";
977
992
  case f:
978
993
  return "SuspenseList";
979
994
  }
980
995
  if (typeof r == "object")
981
996
  switch (r.$$typeof) {
982
- case c:
997
+ case o:
983
998
  var p = r;
984
999
  return ve(p) + ".Consumer";
985
1000
  case u:
986
1001
  var b = r;
987
1002
  return ve(b._context) + ".Provider";
988
- case h:
989
- return Te(r, r.render, "ForwardRef");
1003
+ case d:
1004
+ return _e(r, r.render, "ForwardRef");
990
1005
  case m:
991
- var C = r.displayName || null;
992
- return C !== null ? C : I(r.type) || "Memo";
1006
+ var S = r.displayName || null;
1007
+ return S !== null ? S : N(r.type) || "Memo";
993
1008
  case x: {
994
- var F = r, U = F._payload, P = F._init;
1009
+ var L = r, U = L._payload, k = L._init;
995
1010
  try {
996
- return I(P(U));
1011
+ return N(k(U));
997
1012
  } catch {
998
1013
  return null;
999
1014
  }
@@ -1001,18 +1016,18 @@ function Fa() {
1001
1016
  }
1002
1017
  return null;
1003
1018
  }
1004
- var be = Object.assign, S = 0, we, Re, je, Ae, ke, De, Fe;
1005
- function Be() {
1019
+ var be = Object.assign, w = 0, we, Re, De, Pe, ke, Ie, Be;
1020
+ function Fe() {
1006
1021
  }
1007
- Be.__reactDisabledLog = !0;
1022
+ Fe.__reactDisabledLog = !0;
1008
1023
  function ae() {
1009
1024
  {
1010
- if (S === 0) {
1011
- we = console.log, Re = console.info, je = console.warn, Ae = console.error, ke = console.group, De = console.groupCollapsed, Fe = console.groupEnd;
1025
+ if (w === 0) {
1026
+ we = console.log, Re = console.info, De = console.warn, Pe = console.error, ke = console.group, Ie = console.groupCollapsed, Be = console.groupEnd;
1012
1027
  var r = {
1013
1028
  configurable: !0,
1014
1029
  enumerable: !0,
1015
- value: Be,
1030
+ value: Fe,
1016
1031
  writable: !0
1017
1032
  };
1018
1033
  Object.defineProperties(console, {
@@ -1025,12 +1040,12 @@ function Fa() {
1025
1040
  groupEnd: r
1026
1041
  });
1027
1042
  }
1028
- S++;
1043
+ w++;
1029
1044
  }
1030
1045
  }
1031
1046
  function Me() {
1032
1047
  {
1033
- if (S--, S === 0) {
1048
+ if (w--, w === 0) {
1034
1049
  var r = {
1035
1050
  configurable: !0,
1036
1051
  enumerable: !0,
@@ -1044,45 +1059,45 @@ function Fa() {
1044
1059
  value: Re
1045
1060
  }),
1046
1061
  warn: be({}, r, {
1047
- value: je
1062
+ value: De
1048
1063
  }),
1049
1064
  error: be({}, r, {
1050
- value: Ae
1065
+ value: Pe
1051
1066
  }),
1052
1067
  group: be({}, r, {
1053
1068
  value: ke
1054
1069
  }),
1055
1070
  groupCollapsed: be({}, r, {
1056
- value: De
1071
+ value: Ie
1057
1072
  }),
1058
1073
  groupEnd: be({}, r, {
1059
- value: Fe
1074
+ value: Be
1060
1075
  })
1061
1076
  });
1062
1077
  }
1063
- S < 0 && $("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
1078
+ w < 0 && $("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
1064
1079
  }
1065
1080
  }
1066
- var Ye = re.ReactCurrentDispatcher, Ge;
1081
+ var He = re.ReactCurrentDispatcher, Ye;
1067
1082
  function ue(r, p, b) {
1068
1083
  {
1069
- if (Ge === void 0)
1084
+ if (Ye === void 0)
1070
1085
  try {
1071
1086
  throw Error();
1072
- } catch (F) {
1073
- var C = F.stack.trim().match(/\n( *(at )?)/);
1074
- Ge = C && C[1] || "";
1087
+ } catch (L) {
1088
+ var S = L.stack.trim().match(/\n( *(at )?)/);
1089
+ Ye = S && S[1] || "";
1075
1090
  }
1076
1091
  return `
1077
- ` + Ge + r;
1092
+ ` + Ye + r;
1078
1093
  }
1079
1094
  }
1080
1095
  var g = !1, v;
1081
1096
  {
1082
- var w = typeof WeakMap == "function" ? WeakMap : Map;
1083
- v = new w();
1097
+ var M = typeof WeakMap == "function" ? WeakMap : Map;
1098
+ v = new M();
1084
1099
  }
1085
- function k(r, p) {
1100
+ function P(r, p) {
1086
1101
  if (!r || g)
1087
1102
  return "";
1088
1103
  {
@@ -1090,135 +1105,135 @@ function Fa() {
1090
1105
  if (b !== void 0)
1091
1106
  return b;
1092
1107
  }
1093
- var C;
1108
+ var S;
1094
1109
  g = !0;
1095
- var F = Error.prepareStackTrace;
1110
+ var L = Error.prepareStackTrace;
1096
1111
  Error.prepareStackTrace = void 0;
1097
1112
  var U;
1098
- U = Ye.current, Ye.current = null, ae();
1113
+ U = He.current, He.current = null, ae();
1099
1114
  try {
1100
1115
  if (p) {
1101
- var P = function() {
1116
+ var k = function() {
1102
1117
  throw Error();
1103
1118
  };
1104
- if (Object.defineProperty(P.prototype, "props", {
1119
+ if (Object.defineProperty(k.prototype, "props", {
1105
1120
  set: function() {
1106
1121
  throw Error();
1107
1122
  }
1108
1123
  }), typeof Reflect == "object" && Reflect.construct) {
1109
1124
  try {
1110
- Reflect.construct(P, []);
1111
- } catch (Ne) {
1112
- C = Ne;
1125
+ Reflect.construct(k, []);
1126
+ } catch (Le) {
1127
+ S = Le;
1113
1128
  }
1114
- Reflect.construct(r, [], P);
1129
+ Reflect.construct(r, [], k);
1115
1130
  } else {
1116
1131
  try {
1117
- P.call();
1118
- } catch (Ne) {
1119
- C = Ne;
1132
+ k.call();
1133
+ } catch (Le) {
1134
+ S = Le;
1120
1135
  }
1121
- r.call(P.prototype);
1136
+ r.call(k.prototype);
1122
1137
  }
1123
1138
  } else {
1124
1139
  try {
1125
1140
  throw Error();
1126
- } catch (Ne) {
1127
- C = Ne;
1141
+ } catch (Le) {
1142
+ S = Le;
1128
1143
  }
1129
1144
  r();
1130
1145
  }
1131
- } catch (Ne) {
1132
- if (Ne && C && typeof Ne.stack == "string") {
1133
- for (var R = Ne.stack.split(`
1134
- `), he = C.stack.split(`
1135
- `), q = R.length - 1, J = he.length - 1; q >= 1 && J >= 0 && R[q] !== he[J]; )
1136
- J--;
1137
- for (; q >= 1 && J >= 0; q--, J--)
1138
- if (R[q] !== he[J]) {
1139
- if (q !== 1 || J !== 1)
1146
+ } catch (Le) {
1147
+ if (Le && S && typeof Le.stack == "string") {
1148
+ for (var R = Le.stack.split(`
1149
+ `), he = S.stack.split(`
1150
+ `), K = R.length - 1, Q = he.length - 1; K >= 1 && Q >= 0 && R[K] !== he[Q]; )
1151
+ Q--;
1152
+ for (; K >= 1 && Q >= 0; K--, Q--)
1153
+ if (R[K] !== he[Q]) {
1154
+ if (K !== 1 || Q !== 1)
1140
1155
  do
1141
- if (q--, J--, J < 0 || R[q] !== he[J]) {
1156
+ if (K--, Q--, Q < 0 || R[K] !== he[Q]) {
1142
1157
  var Ce = `
1143
- ` + R[q].replace(" at new ", " at ");
1158
+ ` + R[K].replace(" at new ", " at ");
1144
1159
  return r.displayName && Ce.includes("<anonymous>") && (Ce = Ce.replace("<anonymous>", r.displayName)), typeof r == "function" && v.set(r, Ce), Ce;
1145
1160
  }
1146
- while (q >= 1 && J >= 0);
1161
+ while (K >= 1 && Q >= 0);
1147
1162
  break;
1148
1163
  }
1149
1164
  }
1150
1165
  } finally {
1151
- g = !1, Ye.current = U, Me(), Error.prepareStackTrace = F;
1166
+ g = !1, He.current = U, Me(), Error.prepareStackTrace = L;
1152
1167
  }
1153
- var tt = r ? r.displayName || r.name : "", zt = tt ? ue(tt) : "";
1154
- return typeof r == "function" && v.set(r, zt), zt;
1168
+ var tt = r ? r.displayName || r.name : "", Wt = tt ? ue(tt) : "";
1169
+ return typeof r == "function" && v.set(r, Wt), Wt;
1155
1170
  }
1156
1171
  function ge(r, p, b) {
1157
- return k(r, !1);
1172
+ return P(r, !1);
1158
1173
  }
1159
- function _(r) {
1174
+ function le(r) {
1160
1175
  var p = r.prototype;
1161
1176
  return !!(p && p.isReactComponent);
1162
1177
  }
1163
- function E(r, p, b) {
1178
+ function C(r, p, b) {
1164
1179
  if (r == null)
1165
1180
  return "";
1166
1181
  if (typeof r == "function")
1167
- return k(r, _(r));
1182
+ return P(r, le(r));
1168
1183
  if (typeof r == "string")
1169
1184
  return ue(r);
1170
1185
  switch (r) {
1171
- case d:
1186
+ case h:
1172
1187
  return ue("Suspense");
1173
1188
  case f:
1174
1189
  return ue("SuspenseList");
1175
1190
  }
1176
1191
  if (typeof r == "object")
1177
1192
  switch (r.$$typeof) {
1178
- case h:
1193
+ case d:
1179
1194
  return ge(r.render);
1180
1195
  case m:
1181
- return E(r.type, p, b);
1196
+ return C(r.type, p, b);
1182
1197
  case x: {
1183
- var C = r, F = C._payload, U = C._init;
1198
+ var S = r, L = S._payload, U = S._init;
1184
1199
  try {
1185
- return E(U(F), p, b);
1200
+ return C(U(L), p, b);
1186
1201
  } catch {
1187
1202
  }
1188
1203
  }
1189
1204
  }
1190
1205
  return "";
1191
1206
  }
1192
- var A = Object.prototype.hasOwnProperty, G = {}, se = re.ReactDebugCurrentFrame;
1193
- function M(r) {
1207
+ var E = Object.prototype.hasOwnProperty, F = {}, J = re.ReactDebugCurrentFrame;
1208
+ function O(r) {
1194
1209
  if (r) {
1195
- var p = r._owner, b = E(r.type, r._source, p ? p.type : null);
1196
- se.setExtraStackFrame(b);
1210
+ var p = r._owner, b = C(r.type, r._source, p ? p.type : null);
1211
+ J.setExtraStackFrame(b);
1197
1212
  } else
1198
- se.setExtraStackFrame(null);
1213
+ J.setExtraStackFrame(null);
1199
1214
  }
1200
- function B(r, p, b, C, F) {
1215
+ function B(r, p, b, S, L) {
1201
1216
  {
1202
- var U = Function.call.bind(A);
1203
- for (var P in r)
1204
- if (U(r, P)) {
1217
+ var U = Function.call.bind(E);
1218
+ for (var k in r)
1219
+ if (U(r, k)) {
1205
1220
  var R = void 0;
1206
1221
  try {
1207
- if (typeof r[P] != "function") {
1208
- var he = Error((C || "React class") + ": " + b + " type `" + P + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof r[P] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
1222
+ if (typeof r[k] != "function") {
1223
+ var he = Error((S || "React class") + ": " + b + " type `" + k + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof r[k] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
1209
1224
  throw he.name = "Invariant Violation", he;
1210
1225
  }
1211
- R = r[P](p, P, C, b, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
1212
- } catch (q) {
1213
- R = q;
1226
+ R = r[k](p, k, S, b, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
1227
+ } catch (K) {
1228
+ R = K;
1214
1229
  }
1215
- R && !(R instanceof Error) && (M(F), $("%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).", C || "React class", b, P, typeof R), M(null)), R instanceof Error && !(R.message in G) && (G[R.message] = !0, M(F), $("Failed %s type: %s", b, R.message), M(null));
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));
1216
1231
  }
1217
1232
  }
1218
1233
  }
1219
- var W = Array.isArray;
1220
- function Ie(r) {
1221
- return W(r);
1234
+ var G = Array.isArray;
1235
+ function Ne(r) {
1236
+ return G(r);
1222
1237
  }
1223
1238
  function Je(r) {
1224
1239
  {
@@ -1247,8 +1262,8 @@ function Fa() {
1247
1262
  __source: !0
1248
1263
  }, ct, gt, Qe;
1249
1264
  Qe = {};
1250
- function Tt(r) {
1251
- if (A.call(r, "ref")) {
1265
+ function _t(r) {
1266
+ if (E.call(r, "ref")) {
1252
1267
  var p = Object.getOwnPropertyDescriptor(r, "ref").get;
1253
1268
  if (p && p.isReactWarning)
1254
1269
  return !1;
@@ -1256,17 +1271,17 @@ function Fa() {
1256
1271
  return r.ref !== void 0;
1257
1272
  }
1258
1273
  function Rt(r) {
1259
- if (A.call(r, "key")) {
1274
+ if (E.call(r, "key")) {
1260
1275
  var p = Object.getOwnPropertyDescriptor(r, "key").get;
1261
1276
  if (p && p.isReactWarning)
1262
1277
  return !1;
1263
1278
  }
1264
1279
  return r.key !== void 0;
1265
1280
  }
1266
- function At(r, p) {
1281
+ function Pt(r, p) {
1267
1282
  if (typeof r.ref == "string" && Ue.current && p && Ue.current.stateNode !== p) {
1268
- var b = I(Ue.current.type);
1269
- Qe[b] || ($('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', I(Ue.current.type), r.ref), Qe[b] = !0);
1283
+ var b = N(Ue.current.type);
1284
+ Qe[b] || ($('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', N(Ue.current.type), r.ref), Qe[b] = !0);
1270
1285
  }
1271
1286
  }
1272
1287
  function vt(r, p) {
@@ -1291,7 +1306,7 @@ function Fa() {
1291
1306
  });
1292
1307
  }
1293
1308
  }
1294
- var $t = function(r, p, b, C, F, U, P) {
1309
+ var zt = function(r, p, b, S, L, U, k) {
1295
1310
  var R = {
1296
1311
  // This tag allows us to uniquely identify this as a React Element
1297
1312
  $$typeof: n,
@@ -1299,7 +1314,7 @@ function Fa() {
1299
1314
  type: r,
1300
1315
  key: p,
1301
1316
  ref: b,
1302
- props: P,
1317
+ props: k,
1303
1318
  // Record the component responsible for creating this element.
1304
1319
  _owner: U
1305
1320
  };
@@ -1312,39 +1327,39 @@ function Fa() {
1312
1327
  configurable: !1,
1313
1328
  enumerable: !1,
1314
1329
  writable: !1,
1315
- value: C
1330
+ value: S
1316
1331
  }), Object.defineProperty(R, "_source", {
1317
1332
  configurable: !1,
1318
1333
  enumerable: !1,
1319
1334
  writable: !1,
1320
- value: F
1335
+ value: L
1321
1336
  }), Object.freeze && (Object.freeze(R.props), Object.freeze(R)), R;
1322
1337
  };
1323
- function s(r, p, b, C, F) {
1338
+ function s(r, p, b, S, L) {
1324
1339
  {
1325
- var U, P = {}, R = null, he = null;
1326
- b !== void 0 && (st(b), R = "" + b), Rt(p) && (st(p.key), R = "" + p.key), Tt(p) && (he = p.ref, At(p, F));
1340
+ var U, k = {}, R = null, he = null;
1341
+ b !== void 0 && (st(b), R = "" + b), Rt(p) && (st(p.key), R = "" + p.key), _t(p) && (he = p.ref, Pt(p, L));
1327
1342
  for (U in p)
1328
- A.call(p, U) && !ot.hasOwnProperty(U) && (P[U] = p[U]);
1343
+ E.call(p, U) && !ot.hasOwnProperty(U) && (k[U] = p[U]);
1329
1344
  if (r && r.defaultProps) {
1330
- var q = r.defaultProps;
1331
- for (U in q)
1332
- P[U] === void 0 && (P[U] = q[U]);
1345
+ var K = r.defaultProps;
1346
+ for (U in K)
1347
+ k[U] === void 0 && (k[U] = K[U]);
1333
1348
  }
1334
1349
  if (R || he) {
1335
- var J = typeof r == "function" ? r.displayName || r.name || "Unknown" : r;
1336
- R && vt(P, J), he && $e(P, J);
1350
+ var Q = typeof r == "function" ? r.displayName || r.name || "Unknown" : r;
1351
+ R && vt(k, Q), he && $e(k, Q);
1337
1352
  }
1338
- return $t(r, R, he, F, C, Ue.current, P);
1353
+ return zt(r, R, he, L, S, Ue.current, k);
1339
1354
  }
1340
1355
  }
1341
- var y = re.ReactCurrentOwner, T = re.ReactDebugCurrentFrame;
1342
- function j(r) {
1356
+ var y = re.ReactCurrentOwner, _ = re.ReactDebugCurrentFrame;
1357
+ function D(r) {
1343
1358
  if (r) {
1344
- var p = r._owner, b = E(r.type, r._source, p ? p.type : null);
1345
- T.setExtraStackFrame(b);
1359
+ var p = r._owner, b = C(r.type, r._source, p ? p.type : null);
1360
+ _.setExtraStackFrame(b);
1346
1361
  } else
1347
- T.setExtraStackFrame(null);
1362
+ _.setExtraStackFrame(null);
1348
1363
  }
1349
1364
  var ee;
1350
1365
  ee = !1;
@@ -1354,7 +1369,7 @@ function Fa() {
1354
1369
  function de() {
1355
1370
  {
1356
1371
  if (y.current) {
1357
- var r = I(y.current.type);
1372
+ var r = N(y.current.type);
1358
1373
  if (r)
1359
1374
  return `
1360
1375
 
@@ -1363,7 +1378,7 @@ Check the render method of \`` + r + "`.";
1363
1378
  return "";
1364
1379
  }
1365
1380
  }
1366
- function Vt(r) {
1381
+ function Gt(r) {
1367
1382
  {
1368
1383
  if (r !== void 0) {
1369
1384
  var p = r.fileName.replace(/^.*[\\\/]/, ""), b = r.lineNumber;
@@ -1396,30 +1411,30 @@ Check the top-level render call using <` + b + ">.");
1396
1411
  if (bt[b])
1397
1412
  return;
1398
1413
  bt[b] = !0;
1399
- var C = "";
1400
- r && r._owner && r._owner !== y.current && (C = " It was passed a child from " + I(r._owner.type) + "."), j(r), $('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', b, C), j(null);
1414
+ var S = "";
1415
+ r && r._owner && r._owner !== y.current && (S = " It was passed a child from " + N(r._owner.type) + "."), D(r), $('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', b, S), D(null);
1401
1416
  }
1402
1417
  }
1403
1418
  function Ee(r, p) {
1404
1419
  {
1405
1420
  if (typeof r != "object")
1406
1421
  return;
1407
- if (Ie(r))
1422
+ if (Ne(r))
1408
1423
  for (var b = 0; b < r.length; b++) {
1409
- var C = r[b];
1410
- ye(C) && xe(C, p);
1424
+ var S = r[b];
1425
+ ye(S) && xe(S, p);
1411
1426
  }
1412
1427
  else if (ye(r))
1413
1428
  r._store && (r._store.validated = !0);
1414
1429
  else if (r) {
1415
- var F = me(r);
1416
- if (typeof F == "function" && F !== r.entries)
1417
- for (var U = F.call(r), P; !(P = U.next()).done; )
1418
- ye(P.value) && xe(P.value, p);
1430
+ var L = me(r);
1431
+ if (typeof L == "function" && L !== r.entries)
1432
+ for (var U = L.call(r), k; !(k = U.next()).done; )
1433
+ ye(k.value) && xe(k.value, p);
1419
1434
  }
1420
1435
  }
1421
1436
  }
1422
- function We(r) {
1437
+ function Ve(r) {
1423
1438
  {
1424
1439
  var p = r.type;
1425
1440
  if (p == null || typeof p == "string")
@@ -1427,19 +1442,19 @@ Check the top-level render call using <` + b + ">.");
1427
1442
  var b;
1428
1443
  if (typeof p == "function")
1429
1444
  b = p.propTypes;
1430
- else if (typeof p == "object" && (p.$$typeof === h || // Note: Memo only checks outer props here.
1445
+ else if (typeof p == "object" && (p.$$typeof === d || // Note: Memo only checks outer props here.
1431
1446
  // Inner props are checked in the reconciler.
1432
1447
  p.$$typeof === m))
1433
1448
  b = p.propTypes;
1434
1449
  else
1435
1450
  return;
1436
1451
  if (b) {
1437
- var C = I(p);
1438
- B(b, r.props, "prop", C, r);
1452
+ var S = N(p);
1453
+ B(b, r.props, "prop", S, r);
1439
1454
  } else if (p.PropTypes !== void 0 && !ee) {
1440
1455
  ee = !0;
1441
- var F = I(p);
1442
- $("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", F || "Unknown");
1456
+ var L = N(p);
1457
+ $("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", L || "Unknown");
1443
1458
  }
1444
1459
  typeof p.getDefaultProps == "function" && !p.getDefaultProps.isReactClassApproved && $("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
1445
1460
  }
@@ -1447,34 +1462,34 @@ Check the top-level render call using <` + b + ">.");
1447
1462
  function Oe(r) {
1448
1463
  {
1449
1464
  for (var p = Object.keys(r.props), b = 0; b < p.length; b++) {
1450
- var C = p[b];
1451
- if (C !== "children" && C !== "key") {
1452
- j(r), $("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", C), j(null);
1465
+ var S = p[b];
1466
+ if (S !== "children" && S !== "key") {
1467
+ D(r), $("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", S), D(null);
1453
1468
  break;
1454
1469
  }
1455
1470
  }
1456
- r.ref !== null && (j(r), $("Invalid attribute `ref` supplied to `React.Fragment`."), j(null));
1471
+ r.ref !== null && (D(r), $("Invalid attribute `ref` supplied to `React.Fragment`."), D(null));
1457
1472
  }
1458
1473
  }
1459
- function Ve(r, p, b, C, F, U) {
1474
+ function ze(r, p, b, S, L, U) {
1460
1475
  {
1461
- var P = _e(r);
1462
- if (!P) {
1476
+ var k = Te(r);
1477
+ if (!k) {
1463
1478
  var R = "";
1464
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.");
1465
- var he = Vt(F);
1480
+ var he = Gt(L);
1466
1481
  he ? R += he : R += de();
1467
- var q;
1468
- r === null ? q = "null" : Ie(r) ? q = "array" : r !== void 0 && r.$$typeof === n ? (q = "<" + (I(r.type) || "Unknown") + " />", R = " Did you accidentally export a JSX literal instead of a component?") : q = 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", q, 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);
1469
1484
  }
1470
- var J = s(r, p, b, F, U);
1471
- if (J == null)
1472
- return J;
1473
- if (P) {
1485
+ var Q = s(r, p, b, L, U);
1486
+ if (Q == null)
1487
+ return Q;
1488
+ if (k) {
1474
1489
  var Ce = p.children;
1475
1490
  if (Ce !== void 0)
1476
- if (C)
1477
- if (Ie(Ce)) {
1491
+ if (S)
1492
+ if (Ne(Ce)) {
1478
1493
  for (var tt = 0; tt < Ce.length; tt++)
1479
1494
  Ee(Ce[tt], r);
1480
1495
  Object.freeze && Object.freeze(Ce);
@@ -1483,29 +1498,29 @@ Check the top-level render call using <` + b + ">.");
1483
1498
  else
1484
1499
  Ee(Ce, r);
1485
1500
  }
1486
- return r === t ? Oe(J) : We(J), J;
1501
+ return r === t ? Oe(Q) : Ve(Q), Q;
1487
1502
  }
1488
1503
  }
1489
1504
  function et(r, p, b) {
1490
- return Ve(r, p, b, !0);
1505
+ return ze(r, p, b, !0);
1491
1506
  }
1492
1507
  function xt(r, p, b) {
1493
- return Ve(r, p, b, !1);
1508
+ return ze(r, p, b, !1);
1494
1509
  }
1495
- var Vn = xt, zn = et;
1496
- ut.Fragment = t, ut.jsx = Vn, ut.jsxs = zn;
1510
+ var zn = xt, Gn = et;
1511
+ ut.Fragment = t, ut.jsx = zn, ut.jsxs = Gn;
1497
1512
  }()), ut;
1498
1513
  }
1499
- process.env.NODE_ENV === "production" ? It.exports = La() : It.exports = Fa();
1514
+ process.env.NODE_ENV === "production" ? It.exports = Ba() : It.exports = Fa();
1500
1515
  var l = It.exports;
1501
- function Fn(e) {
1516
+ function Bn(e) {
1502
1517
  return e.title.search("<") > -1 ? /* @__PURE__ */ l.jsx("button", { className: "svg", dangerouslySetInnerHTML: { __html: e.title } }) : /* @__PURE__ */ l.jsx("button", { children: e.title });
1503
1518
  }
1504
- const Ba = /* @__PURE__ */ l.jsxs("svg", { className: "closeIcon", width: "14", height: "14", fill: "none", stroke: "#666666", strokeMiterlimit: "10", children: [
1519
+ const Ua = /* @__PURE__ */ l.jsxs("svg", { className: "closeIcon", width: "14", height: "14", fill: "none", stroke: "#666666", strokeMiterlimit: "10", children: [
1505
1520
  /* @__PURE__ */ l.jsx("circle", { cx: "7", cy: "7", r: "6" }),
1506
1521
  /* @__PURE__ */ l.jsx("line", { x1: "4", y1: "4", x2: "10", y2: "10" }),
1507
1522
  /* @__PURE__ */ l.jsx("line", { x1: "4", y1: "10", x2: "10", y2: "4" })
1508
- ] }), Ua = /* @__PURE__ */ l.jsx("svg", { className: "dragIcon", width: "14", height: "14", fill: "#666666", stroke: "none", children: /* @__PURE__ */ l.jsx(
1523
+ ] }), $a = /* @__PURE__ */ l.jsx("svg", { className: "dragIcon", width: "14", height: "14", fill: "#666666", stroke: "none", children: /* @__PURE__ */ l.jsx(
1509
1524
  "path",
1510
1525
  {
1511
1526
  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
@@ -1513,35 +1528,35 @@ 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
1513
1528
  C11,8.22,10.74,8,10.43,8z`
1514
1529
  }
1515
1530
  ) });
1516
- function $a(e) {
1517
- return /* @__PURE__ */ l.jsx(jn.Item, { value: e.title, children: /* @__PURE__ */ l.jsxs("div", { children: [
1518
- Ua,
1531
+ function za(e) {
1532
+ return /* @__PURE__ */ l.jsx(Dn.Item, { value: e.title, children: /* @__PURE__ */ l.jsxs("div", { children: [
1533
+ $a,
1519
1534
  /* @__PURE__ */ l.jsx("span", { children: e.title }),
1520
1535
  /* @__PURE__ */ l.jsx("button", { className: "closeIcon", onClick: () => {
1521
1536
  e.onDelete(e.index);
1522
- }, children: Ba })
1537
+ }, children: Ua })
1523
1538
  ] }) }, e.title);
1524
1539
  }
1525
- function Va(e) {
1526
- const [n, a] = K(!1), [t, i] = K(e.options), o = (d) => {
1527
- e.onDragComplete(d), i(d);
1528
- }, u = (d) => {
1540
+ function Ga(e) {
1541
+ const [n, a] = Z(!1), [t, i] = Z(e.options), c = (h) => {
1542
+ e.onDragComplete(h), i(h);
1543
+ }, u = (h) => {
1529
1544
  const f = [...t];
1530
- f.splice(d, 1), o(f);
1531
- }, c = [];
1532
- t.forEach((d, f) => {
1533
- c.push(/* @__PURE__ */ l.jsx($a, { index: f, title: d, onDelete: u }, d));
1545
+ f.splice(h, 1), c(f);
1546
+ }, o = [];
1547
+ t.forEach((h, f) => {
1548
+ o.push(/* @__PURE__ */ l.jsx(za, { index: f, title: h, onDelete: u }, h));
1534
1549
  });
1535
- let h = "dropdown draggable";
1536
- return e.subdropdown && (h += " subdropdown"), /* @__PURE__ */ l.jsxs("div", { className: h, onMouseEnter: () => a(!0), onMouseLeave: () => a(!1), children: [
1537
- /* @__PURE__ */ l.jsx(Fn, { title: e.title }),
1538
- /* @__PURE__ */ l.jsx(jn.Group, { axis: "y", values: t, onReorder: o, style: { visibility: n ? "visible" : "hidden" }, children: c })
1550
+ let d = "dropdown draggable";
1551
+ return e.subdropdown && (d += " subdropdown"), /* @__PURE__ */ l.jsxs("div", { className: d, onMouseEnter: () => a(!0), onMouseLeave: () => a(!1), children: [
1552
+ /* @__PURE__ */ l.jsx(Bn, { title: e.title }),
1553
+ /* @__PURE__ */ l.jsx(Dn.Group, { axis: "y", values: t, onReorder: c, style: { visibility: n ? "visible" : "hidden" }, children: o })
1539
1554
  ] });
1540
1555
  }
1541
- function za(e) {
1542
- const [n, a] = K(!1), t = [];
1543
- e.options.map((o, u) => {
1544
- e.onSelect !== void 0 && (o.onSelect = e.onSelect), t.push(/* @__PURE__ */ l.jsx(Ha, { option: o }, u));
1556
+ function Wa(e) {
1557
+ const [n, a] = Z(!1), t = [];
1558
+ e.options.map((c, u) => {
1559
+ e.onSelect !== void 0 && (c.onSelect = e.onSelect), t.push(/* @__PURE__ */ l.jsx(Ha, { option: c }, u));
1545
1560
  });
1546
1561
  let i = "dropdown";
1547
1562
  return e.subdropdown && (i += " subdropdown"), /* @__PURE__ */ l.jsxs(
@@ -1551,7 +1566,7 @@ function za(e) {
1551
1566
  onMouseEnter: () => a(!0),
1552
1567
  onMouseLeave: () => a(!1),
1553
1568
  children: [
1554
- /* @__PURE__ */ l.jsx(Fn, { title: e.title }),
1569
+ /* @__PURE__ */ l.jsx(Bn, { title: e.title }),
1555
1570
  /* @__PURE__ */ l.jsx(
1556
1571
  "ul",
1557
1572
  {
@@ -1564,17 +1579,17 @@ function za(e) {
1564
1579
  );
1565
1580
  }
1566
1581
  function Ha(e) {
1567
- const { option: n } = e, [a, t] = K("");
1582
+ const { option: n } = e, [a, t] = Z("");
1568
1583
  let i;
1569
1584
  switch (n.type) {
1570
1585
  case "draggable":
1571
1586
  i = /* @__PURE__ */ l.jsx(
1572
- Va,
1587
+ Ga,
1573
1588
  {
1574
1589
  title: n.title,
1575
1590
  options: n.value,
1576
- onDragComplete: (o) => {
1577
- n.onDragComplete !== void 0 && n.onDragComplete(o);
1591
+ onDragComplete: (c) => {
1592
+ n.onDragComplete !== void 0 && n.onDragComplete(c);
1578
1593
  },
1579
1594
  subdropdown: !0
1580
1595
  }
@@ -1582,7 +1597,7 @@ function Ha(e) {
1582
1597
  break;
1583
1598
  case "dropdown":
1584
1599
  i = /* @__PURE__ */ l.jsx(
1585
- za,
1600
+ Wa,
1586
1601
  {
1587
1602
  title: n.title,
1588
1603
  options: n.value,
@@ -1605,31 +1620,31 @@ function Ha(e) {
1605
1620
  }
1606
1621
  return /* @__PURE__ */ l.jsx("li", { className: a === n.title ? "selected" : "", children: i }, _a());
1607
1622
  }
1608
- function Li(e, n, a) {
1609
- function t(o) {
1623
+ function Bi(e, n, a) {
1624
+ function t(c) {
1610
1625
  switch (n.forEach((u) => {
1611
- u.callback(e, u.remote, o);
1612
- }), o.event) {
1626
+ u.callback(e, u.remote, c);
1627
+ }), c.event) {
1613
1628
  case "custom":
1614
- N.dispatchEvent({ type: L.CUSTOM, value: o.data });
1629
+ j.dispatchEvent({ type: A.CUSTOM, value: c.data });
1615
1630
  break;
1616
1631
  }
1617
1632
  }
1618
- function i(o) {
1633
+ function i(c) {
1619
1634
  switch (a.forEach((u) => {
1620
- u.callback(e, u.remote, o);
1621
- }), o.event) {
1635
+ u.callback(e, u.remote, c);
1636
+ }), c.event) {
1622
1637
  case "custom":
1623
- N.dispatchEvent({ type: L.CUSTOM, value: o.data });
1638
+ j.dispatchEvent({ type: A.CUSTOM, value: c.data });
1624
1639
  break;
1625
1640
  }
1626
1641
  }
1627
- e.listen = (o) => {
1628
- o.target === "editor" ? i(o) : t(o);
1642
+ e.listen = (c) => {
1643
+ c.target === "editor" ? i(c) : t(c);
1629
1644
  };
1630
1645
  }
1631
- function Ut(e) {
1632
- const [n, a] = K(e.open !== void 0 ? e.open : !0), t = !n || e.children === void 0;
1646
+ function $t(e) {
1647
+ const [n, a] = Z(e.open !== void 0 ? e.open : !0), t = !n || e.children === void 0;
1633
1648
  return /* @__PURE__ */ l.jsxs("div", { className: `accordion ${t ? "hide" : ""}`, children: [
1634
1649
  /* @__PURE__ */ l.jsxs(
1635
1650
  "button",
@@ -1655,10 +1670,10 @@ function Ut(e) {
1655
1670
  /* @__PURE__ */ l.jsx("div", { className: n ? "open" : "", children: /* @__PURE__ */ l.jsx("div", { children: e.children }) })
1656
1671
  ] });
1657
1672
  }
1658
- function Bn(e) {
1659
- const [n, a] = K(!1), t = e.child !== void 0 && e.child.children.length > 0, i = [];
1660
- return e.child !== void 0 && e.child.children.length > 0 && e.child.children.map((o) => {
1661
- i.push(/* @__PURE__ */ l.jsx(Bn, { child: o, three: e.three }, Math.random()));
1673
+ function Fn(e) {
1674
+ const [n, a] = Z(!1), t = e.child !== void 0 && e.child.children.length > 0, i = [];
1675
+ return e.child !== void 0 && e.child.children.length > 0 && e.child.children.map((c) => {
1676
+ i.push(/* @__PURE__ */ l.jsx(Fn, { child: c, three: e.three }, Math.random()));
1662
1677
  }), /* @__PURE__ */ l.jsx(l.Fragment, { children: e.child !== void 0 && /* @__PURE__ */ l.jsxs("div", { className: "childObject", children: [
1663
1678
  /* @__PURE__ */ l.jsxs("div", { className: "child", children: [
1664
1679
  t ? /* @__PURE__ */ l.jsx(
@@ -1686,7 +1701,7 @@ function Bn(e) {
1686
1701
  children: e.child.name.length > 0 ? `${e.child.name} (${e.child.type})` : `${e.child.type}::${e.child.uuid}`
1687
1702
  }
1688
1703
  ),
1689
- /* @__PURE__ */ l.jsx("div", { className: `icon ${Pa(e.child)}` })
1704
+ /* @__PURE__ */ l.jsx("div", { className: `icon ${Aa(e.child)}` })
1690
1705
  ] }),
1691
1706
  /* @__PURE__ */ l.jsx("div", { className: n ? "open" : "", children: /* @__PURE__ */ l.jsx("div", { className: "container", children: i }) })
1692
1707
  ] }, Math.random()) });
@@ -1694,18 +1709,18 @@ function Bn(e) {
1694
1709
  function Ya(e) {
1695
1710
  const n = [];
1696
1711
  return e.child?.children.map((a) => {
1697
- n.push(/* @__PURE__ */ l.jsx(Bn, { child: a, three: e.three }, Math.random()));
1712
+ n.push(/* @__PURE__ */ l.jsx(Fn, { child: a, three: e.three }, Math.random()));
1698
1713
  }), /* @__PURE__ */ l.jsx("div", { className: `scene ${e.class !== void 0 ? e.class : ""}`, children: n });
1699
1714
  }
1700
- const Ga = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA5klEQVRoge2Y0Q6EIAwE6cX//+X6cCFpSMEKVTdk501OpRNKiyelFC0b8Ps6gCwoggZF0KAIGhRBgyJoUAQNiqCxjciR9SLV//eZiAyvK3U8i/QVaQO2YyLSFVvlkdTKDjJCukh2ykR5ZEW+kHmlatl90RaBtDkK/w7CYhuRUEO0ee3l+J3m55Vm+17vtwjTnV1V3QA8qfbeUXCzRWDpiLLS+OyzvRW7IzW9R+okvclsqR09743bo0yUpc1+lSJvNsa002+Euk9GKzV7SmZDRIMiaFAEDYqgQRE0KIIGRdCgCBoUQeMEMERadX7YUz8AAAAASUVORK5CYII=";
1701
- function Wa(e) {
1715
+ const Va = "data:image/gif;base64,R0lGODlhDgFkAIAAAP///wAAACH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgOS4xLWMwMDIgNzkuZGJhM2RhM2I1LCAyMDIzLzEyLzE1LTEwOjQyOjM3ICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgMjUuNiAoTWFjaW50b3NoKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDoyMDk3M0NEODAxQjQxMUVGODVGNENDMkUyMUExNDk1NSIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoyMDk3M0NEOTAxQjQxMUVGODVGNENDMkUyMUExNDk1NSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkE4ODc3Qzg5MDFCMzExRUY4NUY0Q0MyRTIxQTE0OTU1IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkE4ODc3QzhBMDFCMzExRUY4NUY0Q0MyRTIxQTE0OTU1Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+Af/+/fz7+vn49/b19PPy8fDv7u3s6+rp6Ofm5eTj4uHg397d3Nva2djX1tXU09LR0M/OzczLysnIx8bFxMPCwcC/vr28u7q5uLe2tbSzsrGwr66trKuqqainpqWko6KhoJ+enZybmpmYl5aVlJOSkZCPjo2Mi4qJiIeGhYSDgoGAf359fHt6eXh3dnV0c3JxcG9ubWxramloZ2ZlZGNiYWBfXl1cW1pZWFdWVVRTUlFQT05NTEtKSUhHRkVEQ0JBQD8+PTw7Ojk4NzY1NDMyMTAvLi0sKyopKCcmJSQjIiEgHx4dHBsaGRgXFhUUExIREA8ODQwLCgkIBwYFBAMCAQAAIfkEAAAAAAAsAAAAAA4BZAAAAv+Mj6nL7Q+jnLTai7PevPsPhuJIluaJpurKtu4Lx/JM1/aN5/rO9/4PDAqHxKLxiEwql8ym8wmNSqfUqvWKzWq33K73Cw6Lx+Sy+YxOq9fstvsNj8vn9Lr9js/r9/y+/w8YKDhIWGh4iJiouMjY6PgIGSk5SVlpeYmZqTkJAGDQ+dnpuekmGgAKejpKuiZqmprKqoZKGyrbOlqrejub6xvLGyw8TFzcprurGuvqybxq7ETbrItsCz0l7Zpc+6p9/cS967w9/S2FTF0u/mzehK4Oqz3eTl9vf4+fr7/P3+//DzCgwIEECxo8iDChwoUMGzp8CDGixIkUK1q8iDGjxo0XHDt6/AgypMiRJEuaPIkypcqVLFt+KwAAOw==";
1716
+ function qa(e) {
1702
1717
  return "items" in e;
1703
1718
  }
1704
- function Ze(e) {
1719
+ function Xe(e) {
1705
1720
  const n = [];
1706
1721
  return e.items.forEach((a) => {
1707
- Wa(a) ? n.push(
1708
- /* @__PURE__ */ l.jsx(Ze, { title: Mt(a.title), items: a.items }, Math.random())
1722
+ qa(a) ? n.push(
1723
+ /* @__PURE__ */ l.jsx(Xe, { title: Mt(a.title), items: a.items }, Math.random())
1709
1724
  ) : n.push(
1710
1725
  /* @__PURE__ */ l.jsx(
1711
1726
  ft,
@@ -1721,17 +1736,20 @@ function Ze(e) {
1721
1736
  options: a.options,
1722
1737
  onChange: (t, i) => {
1723
1738
  a.onChange !== void 0 && a.onChange(t, i);
1739
+ },
1740
+ onKeyDown: (t) => {
1741
+ a.onKeyDown !== void 0 && a.onKeyDown(t);
1724
1742
  }
1725
1743
  },
1726
1744
  Math.random()
1727
1745
  )
1728
1746
  );
1729
- }), /* @__PURE__ */ l.jsx(Ut, { label: e.title, open: e.expanded === !0, children: n });
1747
+ }), /* @__PURE__ */ l.jsx($t, { label: e.title, open: e.expanded === !0, children: n });
1730
1748
  }
1731
- function qa(e) {
1749
+ function Ka(e) {
1732
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");
1733
1751
  }
1734
- function Ka(e) {
1752
+ function Za(e) {
1735
1753
  switch (e) {
1736
1754
  case "Alpha Map":
1737
1755
  return "alphaMap";
@@ -1778,7 +1796,7 @@ function Ka(e) {
1778
1796
  }
1779
1797
  return e;
1780
1798
  }
1781
- function _t(e) {
1799
+ function Tt(e) {
1782
1800
  switch (e) {
1783
1801
  case "alphaMap":
1784
1802
  return "Alpha Map";
@@ -1963,42 +1981,42 @@ function Xa() {
1963
1981
  a();
1964
1982
  else {
1965
1983
  const t = e.files[0], i = new FileReader();
1966
- i.onload = function(o) {
1967
- n(o.target.result);
1984
+ i.onload = function(c) {
1985
+ n(c.target.result);
1968
1986
  }, i.readAsDataURL(t);
1969
1987
  }
1970
1988
  }), e.click();
1971
1989
  });
1972
1990
  }
1973
- const Za = [
1991
+ const Ja = [
1974
1992
  {
1975
1993
  title: "Front",
1976
1994
  value: Yn
1977
1995
  },
1978
1996
  {
1979
1997
  title: "Back",
1980
- value: fn
1998
+ value: mn
1981
1999
  },
1982
2000
  {
1983
2001
  title: "Double",
1984
- value: mn
2002
+ value: pn
1985
2003
  }
1986
- ], Ja = [
2004
+ ], Qa = [
1987
2005
  {
1988
2006
  title: "No Blending",
1989
- value: Gn
2007
+ value: Vn
1990
2008
  },
1991
2009
  {
1992
2010
  title: "Normal",
1993
- value: Wn
2011
+ value: qn
1994
2012
  },
1995
2013
  {
1996
2014
  title: "Additive",
1997
- value: qn
2015
+ value: Kn
1998
2016
  },
1999
2017
  {
2000
2018
  title: "Subtractive",
2001
- value: Kn
2019
+ value: Zn
2002
2020
  },
2003
2021
  {
2004
2022
  title: "Multiply",
@@ -2006,81 +2024,81 @@ const Za = [
2006
2024
  },
2007
2025
  {
2008
2026
  title: "Custom",
2009
- value: Zn
2027
+ value: Jn
2010
2028
  }
2011
- ], Qa = [
2029
+ ], ei = [
2012
2030
  {
2013
2031
  title: "Add",
2014
- value: Jn
2032
+ value: Qn
2015
2033
  },
2016
2034
  {
2017
2035
  title: "Subtract",
2018
- value: Qn
2036
+ value: ea
2019
2037
  },
2020
2038
  {
2021
2039
  title: "Reverse Subtract",
2022
- value: ea
2040
+ value: ta
2023
2041
  },
2024
2042
  {
2025
2043
  title: "Min",
2026
- value: ta
2044
+ value: na
2027
2045
  },
2028
2046
  {
2029
2047
  title: "Max",
2030
- value: na
2048
+ value: aa
2031
2049
  }
2032
- ], ei = [
2050
+ ], ti = [
2033
2051
  {
2034
2052
  title: "Zero",
2035
- valye: pn
2053
+ valye: gn
2036
2054
  },
2037
2055
  {
2038
2056
  title: "One",
2039
- valye: gn
2057
+ valye: vn
2040
2058
  },
2041
2059
  {
2042
2060
  title: "Src Color",
2043
- valye: vn
2061
+ valye: bn
2044
2062
  },
2045
2063
  {
2046
2064
  title: "One Minus Src Color",
2047
- valye: bn
2065
+ valye: yn
2048
2066
  },
2049
2067
  {
2050
2068
  title: "Src Alpha",
2051
- valye: yn
2069
+ valye: xn
2052
2070
  },
2053
2071
  {
2054
2072
  title: "One Minus Src Alpha",
2055
- valye: xn
2073
+ valye: En
2056
2074
  },
2057
2075
  {
2058
2076
  title: "Dst Alpha",
2059
- valye: En
2077
+ valye: Cn
2060
2078
  },
2061
2079
  {
2062
2080
  title: "One Minus Dst Alpha",
2063
- valye: Cn
2081
+ valye: Sn
2064
2082
  },
2065
2083
  {
2066
2084
  title: "Dst Color",
2067
- valye: Sn
2085
+ valye: wn
2068
2086
  },
2069
2087
  {
2070
2088
  title: "One Minus Dst Color",
2071
- valye: wn
2089
+ valye: Mn
2072
2090
  },
2073
2091
  {
2074
2092
  title: "Src Alpha Saturate",
2075
- valye: aa
2093
+ valye: ia
2076
2094
  },
2077
2095
  {
2078
2096
  title: "Constant Color",
2079
- valye: Mn
2097
+ valye: On
2080
2098
  },
2081
2099
  {
2082
2100
  title: "One Minus Constant Color",
2083
- valye: On
2101
+ valye: Tn
2084
2102
  },
2085
2103
  {
2086
2104
  title: "Constant Alpha",
@@ -2088,56 +2106,56 @@ const Za = [
2088
2106
  },
2089
2107
  {
2090
2108
  title: "One Minus Constant Alpha",
2091
- valye: Tn
2109
+ valye: Rn
2092
2110
  }
2093
- ], ti = [
2111
+ ], ni = [
2094
2112
  {
2095
2113
  title: "Zero",
2096
- valye: pn
2114
+ valye: gn
2097
2115
  },
2098
2116
  {
2099
2117
  title: "One",
2100
- valye: gn
2118
+ valye: vn
2101
2119
  },
2102
2120
  {
2103
2121
  title: "Src Color",
2104
- valye: vn
2122
+ valye: bn
2105
2123
  },
2106
2124
  {
2107
2125
  title: "One Minus Src Color",
2108
- valye: bn
2126
+ valye: yn
2109
2127
  },
2110
2128
  {
2111
2129
  title: "Src Alpha",
2112
- valye: yn
2130
+ valye: xn
2113
2131
  },
2114
2132
  {
2115
2133
  title: "One Minus Src Alpha",
2116
- valye: xn
2134
+ valye: En
2117
2135
  },
2118
2136
  {
2119
2137
  title: "Dst Alpha",
2120
- valye: En
2138
+ valye: Cn
2121
2139
  },
2122
2140
  {
2123
2141
  title: "One Minus Dst Alpha",
2124
- valye: Cn
2142
+ valye: Sn
2125
2143
  },
2126
2144
  {
2127
2145
  title: "Dst Color",
2128
- valye: Sn
2146
+ valye: wn
2129
2147
  },
2130
2148
  {
2131
2149
  title: "One Minus Dst Color",
2132
- valye: wn
2150
+ valye: Mn
2133
2151
  },
2134
2152
  {
2135
2153
  title: "Constant Color",
2136
- valye: Mn
2154
+ valye: On
2137
2155
  },
2138
2156
  {
2139
2157
  title: "One Minus Constant Color",
2140
- valye: On
2158
+ valye: Tn
2141
2159
  },
2142
2160
  {
2143
2161
  title: "Constant Alpha",
@@ -2145,203 +2163,213 @@ const Za = [
2145
2163
  },
2146
2164
  {
2147
2165
  title: "One Minus Constant Alpha",
2148
- valye: Tn
2166
+ valye: Rn
2149
2167
  }
2150
2168
  ];
2151
2169
  function dt(e, n) {
2152
2170
  e.needsUpdate = !0, e.type = "option", e.options = n;
2153
2171
  }
2154
- function ni(e, n, a, t) {
2172
+ function ai(e, n, a, t) {
2155
2173
  return {
2156
2174
  type: "boolean",
2157
- title: _t(e),
2175
+ title: Tt(e),
2158
2176
  prop: e,
2159
2177
  value: n,
2160
2178
  needsUpdate: !0,
2161
- onChange: (i, o) => {
2162
- t.updateObject(a.uuid, `material.${e}`, o), t.updateObject(a.uuid, "material.needsUpdate", !0);
2179
+ onChange: (i, c) => {
2180
+ t.updateObject(a.uuid, `material.${e}`, c), t.updateObject(a.uuid, "material.needsUpdate", !0);
2163
2181
  const u = t.scene?.getObjectByProperty("uuid", a.uuid);
2164
- u !== void 0 && Q(u, `material.${e}`, o);
2182
+ u !== void 0 && V(u, `material.${e}`, c);
2165
2183
  }
2166
2184
  };
2167
2185
  }
2168
- function ai(e, n, a, t) {
2186
+ function ii(e, n, a, t) {
2169
2187
  const i = {
2170
2188
  type: "number",
2171
- title: _t(e),
2189
+ title: Tt(e),
2172
2190
  prop: e,
2173
2191
  value: n,
2174
2192
  min: void 0,
2175
2193
  max: void 0,
2176
2194
  step: 0.01,
2177
2195
  needsUpdate: !0,
2178
- onChange: (o, u) => {
2196
+ onChange: (c, u) => {
2179
2197
  t.updateObject(a.uuid, `material.${e}`, u), t.updateObject(a.uuid, "material.needsUpdate", !0);
2180
- const c = t.scene?.getObjectByProperty("uuid", a.uuid);
2181
- c !== void 0 && Q(c, `material.${e}`, u);
2198
+ const o = t.scene?.getObjectByProperty("uuid", a.uuid);
2199
+ o !== void 0 && V(o, `material.${e}`, u);
2182
2200
  }
2183
2201
  };
2184
2202
  switch (e) {
2185
2203
  case "blending":
2186
- dt(i, Ja);
2204
+ dt(i, Qa);
2187
2205
  break;
2188
2206
  case "blendDst":
2189
- dt(i, ti);
2207
+ dt(i, ni);
2190
2208
  break;
2191
2209
  case "blendEquation":
2192
- dt(i, Qa);
2210
+ dt(i, ei);
2193
2211
  break;
2194
2212
  case "blendSrc":
2195
- dt(i, ei);
2213
+ dt(i, ti);
2196
2214
  break;
2197
2215
  case "side":
2198
- dt(i, Za);
2216
+ dt(i, Ja);
2199
2217
  break;
2200
2218
  }
2201
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;
2202
2220
  }
2203
- function ii(e, n, a, t) {
2221
+ function ri(e, n, a, t) {
2204
2222
  const i = {
2205
2223
  type: "string",
2206
- title: _t(e),
2224
+ title: Tt(e),
2207
2225
  prop: e,
2208
2226
  value: n,
2209
2227
  needsUpdate: !0,
2210
- onChange: (u, c) => {
2211
- t.updateObject(a.uuid, `material.${e}`, c), t.updateObject(a.uuid, "material.needsUpdate", !0);
2212
- const h = t.scene?.getObjectByProperty("uuid", a.uuid);
2213
- h !== void 0 && Q(h, `material.${e}`, c);
2228
+ onChange: (u, o) => {
2229
+ t.updateObject(a.uuid, `material.${e}`, o), t.updateObject(a.uuid, "material.needsUpdate", !0);
2230
+ const d = t.scene?.getObjectByProperty("uuid", a.uuid);
2231
+ d !== void 0 && V(d, `material.${e}`, o);
2232
+ },
2233
+ onKeyDown: (u) => {
2214
2234
  }
2215
2235
  };
2216
- return (e === "vertexShader" || e === "fragmentShader") && (i.disabled = !1, i.latest = i.value, i.onChange = (u, c) => {
2217
- i.latest = c;
2236
+ return (e === "vertexShader" || e === "fragmentShader") && (i.disabled = !1, i.latest = i.value, i.onChange = (u, o) => {
2237
+ i.latest = o, t.updateObject(a.uuid, `material.${e}`, o);
2238
+ const d = t.scene?.getObjectByProperty("uuid", a.uuid);
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
+ }
2218
2246
  }), i;
2219
2247
  }
2220
- function ri(e) {
2248
+ function si(e) {
2221
2249
  return e.x !== void 0 && e.y !== void 0 && e.z === void 0;
2222
2250
  }
2223
- function si(e) {
2251
+ function oi(e) {
2224
2252
  return e.x !== void 0 && e.y !== void 0 && e.z !== void 0 && e.w === void 0;
2225
2253
  }
2226
- function oi(e) {
2254
+ function ci(e) {
2227
2255
  return e.x !== void 0 && e.y !== void 0 && e.z !== void 0 && e.w !== void 0;
2228
2256
  }
2229
2257
  function Nt(e) {
2230
2258
  e.sort((n, a) => n.title < a.title ? -1 : n.title > a.title ? 1 : 0);
2231
2259
  }
2232
- function ht(e, n, a, t, i = "", o = !1) {
2233
- const u = _t(e).split(".")[0].replaceAll("[", "").replaceAll("]", ""), c = i.length > 0 ? `${i}.${e}` : e, h = typeof n;
2234
- if (h === "boolean" || h === "string")
2260
+ function ht(e, n, a, t, i = "", c = !1) {
2261
+ const u = Tt(e).split(".")[0].replaceAll("[", "").replaceAll("]", ""), o = i.length > 0 ? `${i}.${e}` : e, d = typeof n;
2262
+ if (d === "boolean" || d === "string")
2235
2263
  return {
2236
2264
  title: u,
2237
- prop: c,
2238
- type: h,
2265
+ prop: o,
2266
+ type: d,
2239
2267
  value: n,
2240
- disabled: o,
2241
- onChange: (d, f) => {
2242
- t.updateObject(a.uuid, `material.${c}`, f);
2268
+ disabled: c,
2269
+ onChange: (h, f) => {
2270
+ t.updateObject(a.uuid, `material.${o}`, f);
2243
2271
  const m = t.scene?.getObjectByProperty("uuid", a.uuid);
2244
- m !== void 0 && Q(m, `material.${c}`, f);
2272
+ m !== void 0 && V(m, `material.${o}`, f);
2245
2273
  }
2246
2274
  };
2247
- if (h === "number") {
2248
- const d = {
2275
+ if (d === "number") {
2276
+ const h = {
2249
2277
  title: u,
2250
- prop: c,
2278
+ prop: o,
2251
2279
  type: "number",
2252
2280
  value: n,
2253
2281
  step: 0.01,
2254
- disabled: o,
2282
+ disabled: c,
2255
2283
  onChange: (f, m) => {
2256
- t.updateObject(a.uuid, `material.${c}`, m);
2284
+ t.updateObject(a.uuid, `material.${o}`, m);
2257
2285
  const x = t.scene?.getObjectByProperty("uuid", a.uuid);
2258
- x !== void 0 && Q(x, `material.${c}`, m);
2286
+ x !== void 0 && V(x, `material.${o}`, m);
2259
2287
  }
2260
2288
  };
2261
- return Un(u) && (d.type = "range", d.min = 0, d.max = 1), d;
2289
+ return Un(u) && (h.type = "range", h.min = 0, h.max = 1), h;
2262
2290
  } else {
2263
2291
  if (n.isColor)
2264
2292
  return {
2265
2293
  title: u,
2266
- prop: c,
2294
+ prop: o,
2267
2295
  type: "color",
2268
2296
  value: n,
2269
- disabled: o,
2270
- onChange: (d, f) => {
2297
+ disabled: c,
2298
+ onChange: (h, f) => {
2271
2299
  const m = new Lt(f);
2272
- t.updateObject(a.uuid, `material.${c}`, m);
2300
+ t.updateObject(a.uuid, `material.${o}`, m);
2273
2301
  const x = t.scene?.getObjectByProperty("uuid", a.uuid);
2274
- x !== void 0 && Q(x, `material.${c}`, m);
2302
+ x !== void 0 && V(x, `material.${o}`, m);
2275
2303
  }
2276
2304
  };
2277
2305
  if (Array.isArray(n)) {
2278
- const d = [];
2306
+ const h = [];
2279
2307
  for (const f in n) {
2280
2308
  const m = n[f], x = `[${f.toString()}]`;
2281
2309
  if (m.value !== void 0) {
2282
- const O = ht(`${x}.value`, m.value, a, t, c, o);
2283
- O !== void 0 && d.push(O);
2310
+ const T = ht(`${x}.value`, m.value, a, t, o, c);
2311
+ T !== void 0 && h.push(T);
2284
2312
  } else {
2285
- const O = ht(x, m, a, t, c, o);
2286
- O !== void 0 && d.push(O);
2313
+ const T = ht(x, m, a, t, o, c);
2314
+ T !== void 0 && h.push(T);
2287
2315
  }
2288
2316
  }
2289
- if (d.length > 0)
2290
- return Nt(d), {
2317
+ if (h.length > 0)
2318
+ return Nt(h), {
2291
2319
  title: u,
2292
- items: d
2320
+ items: h
2293
2321
  };
2294
2322
  } else {
2295
- if (ri(n))
2323
+ if (si(n))
2296
2324
  return {
2297
2325
  title: u,
2298
- prop: c,
2326
+ prop: o,
2299
2327
  type: "vector2",
2300
2328
  value: n,
2301
- disabled: o,
2302
- onChange: (d, f) => {
2303
- t.updateObject(a.uuid, `material.${c}`, f);
2329
+ disabled: c,
2330
+ onChange: (h, f) => {
2331
+ t.updateObject(a.uuid, `material.${o}`, f);
2304
2332
  const m = t.scene?.getObjectByProperty("uuid", a.uuid);
2305
- m !== void 0 && Q(m, `material.${c}`, f);
2333
+ m !== void 0 && V(m, `material.${o}`, f);
2306
2334
  }
2307
2335
  };
2308
- if (si(n))
2336
+ if (oi(n))
2309
2337
  return {
2310
2338
  title: u,
2311
- prop: c,
2339
+ prop: o,
2312
2340
  type: "grid3",
2313
2341
  value: n,
2314
- disabled: o,
2315
- onChange: (d, f) => {
2316
- t.updateObject(a.uuid, `material.${c}`, f);
2342
+ disabled: c,
2343
+ onChange: (h, f) => {
2344
+ t.updateObject(a.uuid, `material.${o}`, f);
2317
2345
  const m = t.scene?.getObjectByProperty("uuid", a.uuid);
2318
- m !== void 0 && Q(m, `material.${c}`, f);
2346
+ m !== void 0 && V(m, `material.${o}`, f);
2319
2347
  }
2320
2348
  };
2321
- if (oi(n))
2349
+ if (ci(n))
2322
2350
  return {
2323
2351
  title: u,
2324
- prop: c,
2352
+ prop: o,
2325
2353
  type: "grid4",
2326
2354
  value: n,
2327
- disabled: o,
2328
- onChange: (d, f) => {
2329
- t.updateObject(a.uuid, `material.${c}`, f);
2355
+ disabled: c,
2356
+ onChange: (h, f) => {
2357
+ t.updateObject(a.uuid, `material.${o}`, f);
2330
2358
  const m = t.scene?.getObjectByProperty("uuid", a.uuid);
2331
- m !== void 0 && Q(m, `material.${c}`, f);
2359
+ m !== void 0 && V(m, `material.${o}`, f);
2332
2360
  }
2333
2361
  };
2334
2362
  if (n.isEuler)
2335
2363
  return {
2336
2364
  title: u,
2337
- prop: c,
2365
+ prop: o,
2338
2366
  type: "euler",
2339
2367
  value: n,
2340
- disabled: o,
2341
- onChange: (d, f) => {
2342
- t.updateObject(a.uuid, `material.${c}`, f);
2368
+ disabled: c,
2369
+ onChange: (h, f) => {
2370
+ t.updateObject(a.uuid, `material.${o}`, f);
2343
2371
  const m = t.scene?.getObjectByProperty("uuid", a.uuid);
2344
- m !== void 0 && Q(m, `material.${c}`, f);
2372
+ m !== void 0 && V(m, `material.${o}`, f);
2345
2373
  }
2346
2374
  };
2347
2375
  if (n.src !== void 0)
@@ -2349,133 +2377,135 @@ function ht(e, n, a, t, i = "", o = !1) {
2349
2377
  title: u,
2350
2378
  type: "image",
2351
2379
  value: n,
2352
- disabled: o,
2353
- onChange: (d, f) => {
2354
- const m = Ka(e), x = i.length > 0 ? `${i}.${m}` : m;
2380
+ disabled: c,
2381
+ onChange: (h, f) => {
2382
+ const m = Za(e), x = i.length > 0 ? `${i}.${m}` : m;
2355
2383
  t.createTexture(a.uuid, `material.${x}`, f);
2356
- const O = t.scene?.getObjectByProperty("uuid", a.uuid);
2357
- O !== void 0 && Ln(f).then((H) => {
2358
- Q(O, `material.${x}`, H), Q(O, "material.needsUpdate", !0);
2384
+ const T = t.scene?.getObjectByProperty("uuid", a.uuid);
2385
+ T !== void 0 && Ln(f).then((W) => {
2386
+ V(T, `material.${x}`, W), V(T, "material.needsUpdate", !0);
2359
2387
  });
2360
2388
  }
2361
2389
  };
2362
2390
  if (n.elements !== void 0)
2363
2391
  return {
2364
2392
  title: u,
2365
- prop: c,
2393
+ prop: o,
2366
2394
  type: n.elements.length > 9 ? "grid4" : "grid3",
2367
2395
  value: n,
2368
- disabled: o,
2369
- onChange: (d, f) => {
2370
- t.updateObject(a.uuid, `material.${c}`, f);
2396
+ disabled: c,
2397
+ onChange: (h, f) => {
2398
+ t.updateObject(a.uuid, `material.${o}`, f);
2371
2399
  const m = t.scene?.getObjectByProperty("uuid", a.uuid);
2372
- m !== void 0 && Q(m, `material.${c}`, f);
2400
+ m !== void 0 && V(m, `material.${o}`, f);
2373
2401
  }
2374
2402
  };
2375
2403
  {
2376
- const d = [], f = e === "defines" || e === "extensions";
2404
+ const h = [], f = e === "defines" || e === "extensions";
2377
2405
  try {
2378
2406
  for (const m in n) {
2379
2407
  const x = n[m];
2380
2408
  if (x !== void 0)
2381
2409
  if (x.value !== void 0) {
2382
- const O = ht(`${m}.value`, x.value, a, t, c, f);
2383
- O !== void 0 && d.push(O);
2410
+ const T = ht(`${m}.value`, x.value, a, t, o, f);
2411
+ T !== void 0 && h.push(T);
2384
2412
  } else {
2385
- const O = ht(m, x, a, t, c, f);
2386
- O !== void 0 && d.push(O);
2413
+ const T = ht(m, x, a, t, o, f);
2414
+ T !== void 0 && h.push(T);
2387
2415
  }
2388
2416
  }
2389
2417
  } catch {
2390
2418
  console.log("Issue cycling through material object:", e, n);
2391
2419
  }
2392
- if (d.length > 0)
2393
- return Nt(d), {
2420
+ if (h.length > 0)
2421
+ return Nt(h), {
2394
2422
  title: u,
2395
- items: d
2423
+ items: h
2396
2424
  };
2397
2425
  }
2398
2426
  }
2399
2427
  }
2400
2428
  }
2401
- function nn(e, n, a) {
2429
+ function an(e, n, a) {
2402
2430
  const t = [];
2403
2431
  for (const i in e) {
2404
- if (!qa(i))
2432
+ if (!Ka(i))
2405
2433
  continue;
2406
- const o = typeof e[i], u = e[i];
2407
- if (o === "boolean")
2408
- t.push(ni(i, u, n, a));
2409
- else if (o === "number")
2434
+ const c = typeof e[i], u = e[i];
2435
+ if (c === "boolean")
2410
2436
  t.push(ai(i, u, n, a));
2411
- else if (o === "string")
2437
+ else if (c === "number")
2412
2438
  t.push(ii(i, u, n, a));
2413
- else if (o === "object") {
2414
- const c = ht(i, u, n, a);
2415
- c !== void 0 && t.push(c);
2439
+ else if (c === "string")
2440
+ t.push(ri(i, u, n, a));
2441
+ else if (c === "object") {
2442
+ const o = ht(i, u, n, a);
2443
+ o !== void 0 && t.push(o);
2416
2444
  } else
2417
- u !== void 0 && console.log("other:", i, o, u);
2445
+ u !== void 0 && console.log("other:", i, c, u);
2418
2446
  }
2419
2447
  return Nt(t), t.push({
2420
2448
  title: "Update Material",
2421
2449
  type: "button",
2422
2450
  onChange: () => {
2423
2451
  a.updateObject(n.uuid, "material.needsUpdate", !0);
2452
+ const i = a.scene?.getObjectByProperty("uuid", n.uuid);
2453
+ i !== void 0 && V(i, "material.needsUpdate", !0);
2424
2454
  }
2425
2455
  }), t;
2426
2456
  }
2427
- function ci(e, n) {
2457
+ function li(e, n) {
2428
2458
  const a = e.material;
2429
2459
  if (Array.isArray(a)) {
2430
2460
  const t = [], i = a.length;
2431
- for (let o = 0; o < i; o++)
2461
+ for (let c = 0; c < i; c++)
2432
2462
  t.push(
2433
2463
  /* @__PURE__ */ l.jsx(
2434
- Ze,
2464
+ Xe,
2435
2465
  {
2436
- title: `Material ${o}`,
2437
- items: nn(a[o], e, n)
2466
+ title: `Material ${c}`,
2467
+ items: an(a[c], e, n)
2438
2468
  },
2439
- `Material ${o}`
2469
+ `Material ${c}`
2440
2470
  )
2441
2471
  );
2442
2472
  return /* @__PURE__ */ l.jsx(l.Fragment, { children: t });
2443
2473
  } else
2444
2474
  return /* @__PURE__ */ l.jsx(
2445
- Ze,
2475
+ Xe,
2446
2476
  {
2447
2477
  title: "Material",
2448
- items: nn(a, e, n)
2478
+ items: an(a, e, n)
2449
2479
  }
2450
2480
  );
2451
2481
  }
2452
- function li(e) {
2453
- const [n, a] = K(e.defaultValue);
2454
- return Pe(() => {
2455
- let t = !1, i = -1, o = 0, u = e.defaultValue;
2456
- const c = (x) => {
2457
- t = !0, o = Number(e.input.current?.value), i = x.clientX, document.addEventListener("mouseup", d, !1), document.addEventListener("mousemove", h, !1), document.addEventListener("contextmenu", d, !1);
2458
- }, h = (x) => {
2482
+ function ui(e) {
2483
+ const [n, a] = Z(e.defaultValue);
2484
+ return Ae(() => {
2485
+ let t = !1, i = -1, c = 0, u = e.defaultValue;
2486
+ const o = (x) => {
2487
+ t = !0, c = Number(e.input.current?.value), i = x.clientX, document.addEventListener("mouseup", h, !1), document.addEventListener("mousemove", d, !1), document.addEventListener("contextmenu", h, !1);
2488
+ }, d = (x) => {
2459
2489
  if (!t)
2460
2490
  return;
2461
- const O = e.step !== void 0 ? e.step : 1, H = (x.clientX - i) * O;
2462
- u = Number((o + 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);
2463
- }, d = () => {
2464
- t = !1, document.removeEventListener("mouseup", d), document.removeEventListener("mousemove", h), document.removeEventListener("contextmenu", d);
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);
2493
+ }, h = () => {
2494
+ t = !1, document.removeEventListener("mouseup", h), document.removeEventListener("mousemove", d), document.removeEventListener("contextmenu", h);
2465
2495
  }, f = (x) => {
2466
- const O = Number(x.target.value);
2467
- a(O);
2496
+ const T = Number(x.target.value);
2497
+ a(T);
2468
2498
  }, m = (x) => {
2469
- const O = Number(x.target.value);
2470
- e.onChange !== void 0 && e.onChange(O), a(O);
2499
+ const T = Number(x.target.value);
2500
+ e.onChange !== void 0 && e.onChange(T), a(T);
2471
2501
  };
2472
- return e.input.current?.addEventListener("input", f), e.label.current?.addEventListener("mousedown", c, !1), e.sliderRef !== void 0 && e.sliderRef.current?.addEventListener("input", m), () => {
2473
- e.input.current?.removeEventListener("input", f), e.label.current?.removeEventListener("mousedown", c), e.sliderRef !== void 0 && e.sliderRef.current?.removeEventListener("input", m), document.removeEventListener("mouseup", d), document.removeEventListener("mousemove", h), document.removeEventListener("contextmenu", d);
2502
+ return e.input.current?.addEventListener("input", f), e.label.current?.addEventListener("mousedown", o, !1), e.sliderRef !== void 0 && e.sliderRef.current?.addEventListener("input", m), () => {
2503
+ e.input.current?.removeEventListener("input", f), e.label.current?.removeEventListener("mousedown", o), e.sliderRef !== void 0 && e.sliderRef.current?.removeEventListener("input", m), document.removeEventListener("mouseup", h), document.removeEventListener("mousemove", d), document.removeEventListener("contextmenu", h);
2474
2504
  };
2475
2505
  }, []), n;
2476
2506
  }
2477
- function Xe(e) {
2478
- const n = X(null), a = X(null), t = li({
2507
+ function Ze(e) {
2508
+ const n = X(null), a = X(null), t = ui({
2479
2509
  label: e.labelRef,
2480
2510
  input: n,
2481
2511
  sliderRef: a,
@@ -2501,8 +2531,8 @@ function Xe(e) {
2501
2531
  step: e.step,
2502
2532
  disabled: e.disabled,
2503
2533
  onChange: (i) => {
2504
- const o = Number(i.target.value);
2505
- e.onChange !== void 0 && e.onChange(e.prop, o);
2534
+ const c = Number(i.target.value);
2535
+ e.onChange !== void 0 && e.onChange(e.prop, c);
2506
2536
  }
2507
2537
  }
2508
2538
  ),
@@ -2516,8 +2546,8 @@ function Xe(e) {
2516
2546
  ref: n,
2517
2547
  className: "min",
2518
2548
  onChange: (i) => {
2519
- const o = Number(i.target.value);
2520
- e.onChange !== void 0 && e.onChange(e.prop, o);
2549
+ const c = Number(i.target.value);
2550
+ e.onChange !== void 0 && e.onChange(e.prop, c);
2521
2551
  }
2522
2552
  }
2523
2553
  ),
@@ -2531,43 +2561,43 @@ function Xe(e) {
2531
2561
  max: e.max,
2532
2562
  step: e.step,
2533
2563
  ref: a,
2534
- onChange: Ft
2564
+ onChange: Bt
2535
2565
  }
2536
2566
  )
2537
2567
  ] })
2538
2568
  ] });
2539
2569
  }
2540
- function ui(e) {
2541
- const n = X(null), a = X(null), t = X(null), i = X(null), o = X(null), u = X(null), [c, h] = K(e.value), [d, f] = K({
2570
+ function di(e) {
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({
2542
2572
  min: Math.min(e.min, Math.min(e.value.x, e.value.y)),
2543
2573
  max: Math.max(e.max, Math.max(e.value.x, e.value.y))
2544
- }), [m, x] = K(!1);
2545
- function O() {
2546
- m || (window.addEventListener("mousemove", te), window.addEventListener("mouseup", H), window.addEventListener("mouseup", H), x(!0));
2574
+ }), [m, x] = Z(!1);
2575
+ function T() {
2576
+ m || (window.addEventListener("mousemove", te), window.addEventListener("mouseup", W), window.addEventListener("mouseup", W), x(!0));
2547
2577
  }
2548
- function H() {
2549
- window.removeEventListener("mousemove", te), window.removeEventListener("mouseup", H), x(!1);
2578
+ function W() {
2579
+ window.removeEventListener("mousemove", te), window.removeEventListener("mouseup", W), x(!1);
2550
2580
  }
2551
- function te(D) {
2552
- const Z = o.current.getBoundingClientRect(), ne = Ke(0, 99, D.clientX - Z.left) / 99, Se = Ke(0, 99, D.clientY - Z.top) / 99, V = Qt(Jt(d.min, d.max, ne), 3), pe = Qt(Jt(d.min, d.max, Se), 3);
2553
- e.onChange({ target: { value: { x: V, y: pe } } }), h({ x: V, y: pe });
2581
+ function te(I) {
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);
2583
+ e.onChange({ target: { value: { x: z, y: pe } } }), d({ x: z, y: pe });
2554
2584
  }
2555
- function me(D) {
2556
- let Z = c.x, ne = c.y;
2557
- D.target === n.current ? Z = Number(D.target.value) : ne = Number(D.target.value), h({ x: Z, y: ne });
2585
+ function me(I) {
2586
+ let q = o.x, ne = o.y;
2587
+ I.target === n.current ? q = Number(I.target.value) : ne = Number(I.target.value), d({ x: q, y: ne });
2558
2588
  }
2559
2589
  function re() {
2560
- const D = Number(t.current.value);
2561
- f({ min: D, max: d.max }), (c.x < D || c.y < D) && h({ x: Ke(D, d.max, c.x), y: Ke(D, d.max, c.y) });
2590
+ const I = Number(t.current.value);
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) });
2562
2592
  }
2563
2593
  function $() {
2564
- const D = Number(i.current.value);
2565
- f({ min: d.min, max: D }), (c.x > D || c.y > D) && h({ x: Ke(d.min, D, c.x), y: Ke(d.min, D, c.y) });
2594
+ const I = Number(i.current.value);
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) });
2566
2596
  }
2567
- return Pe(() => {
2568
- const D = Zt(d.min, d.max, c.x), Z = Zt(d.min, d.max, c.y);
2569
- u.current.style.left = `${D * 100}%`, u.current.style.top = `${Z * 100}%`;
2570
- }, [d, c]), /* @__PURE__ */ l.jsxs("div", { className: "vector2", children: [
2597
+ return Ae(() => {
2598
+ const I = Jt(h.min, h.max, o.x), q = Jt(h.min, h.max, o.y);
2599
+ u.current.style.left = `${I * 100}%`, u.current.style.top = `${q * 100}%`;
2600
+ }, [h, o]), /* @__PURE__ */ l.jsxs("div", { className: "vector2", children: [
2571
2601
  /* @__PURE__ */ l.jsxs("div", { className: "fields", children: [
2572
2602
  /* @__PURE__ */ l.jsxs("div", { children: [
2573
2603
  /* @__PURE__ */ l.jsx("label", { children: "X:" }),
@@ -2576,9 +2606,9 @@ function ui(e) {
2576
2606
  {
2577
2607
  ref: n,
2578
2608
  type: "number",
2579
- value: c.x,
2580
- min: d.min,
2581
- max: d.max,
2609
+ value: o.x,
2610
+ min: h.min,
2611
+ max: h.max,
2582
2612
  step: 0.01,
2583
2613
  onChange: me
2584
2614
  }
@@ -2591,9 +2621,9 @@ function ui(e) {
2591
2621
  {
2592
2622
  ref: a,
2593
2623
  type: "number",
2594
- value: c.y,
2595
- min: d.min,
2596
- max: d.max,
2624
+ value: o.y,
2625
+ min: h.min,
2626
+ max: h.max,
2597
2627
  step: 0.01,
2598
2628
  onChange: me
2599
2629
  }
@@ -2606,7 +2636,7 @@ function ui(e) {
2606
2636
  {
2607
2637
  ref: t,
2608
2638
  type: "number",
2609
- value: d.min,
2639
+ value: h.min,
2610
2640
  step: 0.01,
2611
2641
  onChange: re
2612
2642
  }
@@ -2619,114 +2649,114 @@ function ui(e) {
2619
2649
  {
2620
2650
  ref: i,
2621
2651
  type: "number",
2622
- value: d.max,
2652
+ value: h.max,
2623
2653
  step: 0.01,
2624
2654
  onChange: $
2625
2655
  }
2626
2656
  )
2627
2657
  ] })
2628
2658
  ] }),
2629
- /* @__PURE__ */ l.jsxs("div", { className: "input", ref: o, onMouseDown: O, onMouseUp: H, children: [
2659
+ /* @__PURE__ */ l.jsxs("div", { className: "input", ref: c, onMouseDown: T, onMouseUp: W, children: [
2630
2660
  /* @__PURE__ */ l.jsx("div", { className: "x" }),
2631
2661
  /* @__PURE__ */ l.jsx("div", { className: "y" }),
2632
2662
  /* @__PURE__ */ l.jsx("div", { className: "pt", ref: u })
2633
2663
  ] })
2634
2664
  ] });
2635
2665
  }
2636
- function an(e) {
2666
+ function rn(e) {
2637
2667
  const n = e.value.isVector3 !== void 0, a = e.value.isEuler !== void 0, t = e.value.elements !== void 0, i = [];
2638
2668
  if (n) {
2639
- const o = ie(() => e.value, []), u = (h, d) => {
2640
- o[h] = d, e.onChange({ target: { value: o } });
2669
+ const c = ie(() => e.value, []), u = (d, h) => {
2670
+ c[d] = h, e.onChange({ target: { value: c } });
2641
2671
  };
2642
- ["x", "y", "z"].forEach((h) => {
2643
- const d = X(null);
2672
+ ["x", "y", "z"].forEach((d) => {
2673
+ const h = X(null);
2644
2674
  i.push(
2645
2675
  /* @__PURE__ */ l.jsxs("div", { children: [
2646
- /* @__PURE__ */ l.jsx("label", { ref: d, children: h.toUpperCase() }),
2676
+ /* @__PURE__ */ l.jsx("label", { ref: h, children: d.toUpperCase() }),
2647
2677
  /* @__PURE__ */ l.jsx(
2648
- Xe,
2678
+ Ze,
2649
2679
  {
2650
- value: o[h],
2680
+ value: c[d],
2651
2681
  type: "number",
2652
- prop: h,
2682
+ prop: d,
2653
2683
  step: 0.01,
2654
- labelRef: d,
2684
+ labelRef: h,
2655
2685
  onChange: u
2656
2686
  }
2657
2687
  )
2658
- ] }, h)
2688
+ ] }, d)
2659
2689
  );
2660
2690
  });
2661
2691
  } else if (a) {
2662
- const o = ie(() => e.value, []), u = (h, d) => {
2663
- o[h] = d, e.onChange({ target: { value: o } });
2692
+ const c = ie(() => e.value, []), u = (d, h) => {
2693
+ c[d] = h, e.onChange({ target: { value: c } });
2664
2694
  };
2665
- ["_x", "_y", "_z"].forEach((h) => {
2666
- const d = X(null);
2695
+ ["_x", "_y", "_z"].forEach((d) => {
2696
+ const h = X(null);
2667
2697
  i.push(
2668
2698
  /* @__PURE__ */ l.jsxs("div", { children: [
2669
- /* @__PURE__ */ l.jsx("label", { ref: d, children: h.substring(1).toUpperCase() }),
2699
+ /* @__PURE__ */ l.jsx("label", { ref: h, children: d.substring(1).toUpperCase() }),
2670
2700
  /* @__PURE__ */ l.jsx(
2671
- Xe,
2701
+ Ze,
2672
2702
  {
2673
- value: o[h],
2703
+ value: c[d],
2674
2704
  type: "number",
2675
- prop: h,
2705
+ prop: d,
2676
2706
  step: 0.01,
2677
- labelRef: d,
2707
+ labelRef: h,
2678
2708
  onChange: u
2679
2709
  }
2680
2710
  )
2681
- ] }, h)
2711
+ ] }, d)
2682
2712
  );
2683
2713
  });
2684
2714
  } else if (t) {
2685
- const o = ie(() => e.value, []), u = (c, h) => {
2686
- const d = Number(c);
2687
- o.elements[d] = h, e.onChange({ target: { value: o } });
2715
+ const c = ie(() => e.value, []), u = (o, d) => {
2716
+ const h = Number(o);
2717
+ c.elements[h] = d, e.onChange({ target: { value: c } });
2688
2718
  };
2689
- for (let c = 0; c < 9; c++) {
2690
- const h = X(null);
2719
+ for (let o = 0; o < 9; o++) {
2720
+ const d = X(null);
2691
2721
  i.push(
2692
2722
  /* @__PURE__ */ l.jsxs("div", { children: [
2693
- /* @__PURE__ */ l.jsx("label", { ref: h, children: c + 1 }),
2723
+ /* @__PURE__ */ l.jsx("label", { ref: d, children: o + 1 }),
2694
2724
  /* @__PURE__ */ l.jsx(
2695
- Xe,
2725
+ Ze,
2696
2726
  {
2697
- value: o.elements[c],
2727
+ value: c.elements[o],
2698
2728
  type: "number",
2699
- prop: c.toString(),
2729
+ prop: o.toString(),
2700
2730
  step: 0.01,
2701
- labelRef: h,
2731
+ labelRef: d,
2702
2732
  onChange: u
2703
2733
  }
2704
2734
  )
2705
- ] }, c.toString())
2735
+ ] }, o.toString())
2706
2736
  );
2707
2737
  }
2708
2738
  }
2709
2739
  return /* @__PURE__ */ l.jsx("div", { className: "grid3", children: i }, Math.random().toString());
2710
2740
  }
2711
- function di(e) {
2741
+ function hi(e) {
2712
2742
  const n = e.value.x !== void 0, a = [];
2713
2743
  if (n) {
2714
- const t = ie(() => e.value, []), i = (u, c) => {
2715
- t[u] = c, e.onChange({ target: { value: t } });
2744
+ const t = ie(() => e.value, []), i = (u, o) => {
2745
+ t[u] = o, e.onChange({ target: { value: t } });
2716
2746
  };
2717
2747
  ["x", "y", "z", "w"].forEach((u) => {
2718
- const c = X(null);
2748
+ const o = X(null);
2719
2749
  a.push(
2720
2750
  /* @__PURE__ */ l.jsxs("div", { children: [
2721
- /* @__PURE__ */ l.jsx("label", { ref: c, children: u.toUpperCase() }),
2751
+ /* @__PURE__ */ l.jsx("label", { ref: o, children: u.toUpperCase() }),
2722
2752
  /* @__PURE__ */ l.jsx(
2723
- Xe,
2753
+ Ze,
2724
2754
  {
2725
2755
  value: t.x,
2726
2756
  type: "number",
2727
2757
  prop: u,
2728
2758
  step: 0.01,
2729
- labelRef: c,
2759
+ labelRef: o,
2730
2760
  onChange: i
2731
2761
  }
2732
2762
  )
@@ -2734,27 +2764,27 @@ function di(e) {
2734
2764
  );
2735
2765
  });
2736
2766
  } else {
2737
- const t = ie(() => e.value, []), i = (o, u) => {
2738
- const c = Number(o);
2739
- t.elements[c] = u, e.onChange({ target: { value: t } });
2767
+ const t = ie(() => e.value, []), i = (c, u) => {
2768
+ const o = Number(c);
2769
+ t.elements[o] = u, e.onChange({ target: { value: t } });
2740
2770
  };
2741
- for (let o = 0; o < 16; o++) {
2771
+ for (let c = 0; c < 16; c++) {
2742
2772
  const u = X(null);
2743
2773
  a.push(
2744
2774
  /* @__PURE__ */ l.jsxs("div", { children: [
2745
- /* @__PURE__ */ l.jsx("label", { ref: u, children: o + 1 }),
2775
+ /* @__PURE__ */ l.jsx("label", { ref: u, children: c + 1 }),
2746
2776
  /* @__PURE__ */ l.jsx(
2747
- Xe,
2777
+ Ze,
2748
2778
  {
2749
- value: t.elements[o],
2779
+ value: t.elements[c],
2750
2780
  type: "number",
2751
- prop: o.toString(),
2781
+ prop: c.toString(),
2752
2782
  step: 0.01,
2753
2783
  labelRef: u,
2754
2784
  onChange: i
2755
2785
  }
2756
2786
  )
2757
- ] }, o.toString())
2787
+ ] }, c.toString())
2758
2788
  );
2759
2789
  }
2760
2790
  }
@@ -2762,17 +2792,17 @@ function di(e) {
2762
2792
  }
2763
2793
  function ft(e) {
2764
2794
  let n = e.value;
2765
- n !== void 0 && n.isColor !== void 0 && (n = Ra(e.value));
2766
- const [a, t] = K(n), i = X(null), o = X(null), u = (f) => {
2795
+ n !== void 0 && n.isColor !== void 0 && (n = Pa(e.value));
2796
+ const [a, t] = Z(n), i = X(null), c = X(null), u = (f) => {
2767
2797
  let m = f.target.value;
2768
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);
2769
- }, c = {};
2770
- e.disabled && (c.opacity = 0.8);
2771
- const h = e.type === "string" && (a.length > 100 || a.search(`
2772
- `) > -1), d = h || e.type === "image" || e.type === "vector2";
2773
- return /* @__PURE__ */ l.jsxs("div", { className: `field ${d ? "block" : ""}`, style: c, children: [
2799
+ }, o = {};
2800
+ e.disabled && (o.opacity = 0.8);
2801
+ const d = e.type === "string" && (a.length > 100 || a.search(`
2802
+ `) > -1), h = d || e.type === "image" || e.type === "vector2";
2803
+ return /* @__PURE__ */ l.jsxs("div", { className: `field ${h ? "block" : ""}`, style: o, children: [
2774
2804
  e.type !== "button" && /* @__PURE__ */ l.jsx("label", { ref: i, children: Mt(e.title) }, "fieldLabel"),
2775
- e.type === "string" && !h && /* @__PURE__ */ l.jsx(
2805
+ e.type === "string" && !d && /* @__PURE__ */ l.jsx(
2776
2806
  "input",
2777
2807
  {
2778
2808
  type: "text",
@@ -2781,13 +2811,16 @@ function ft(e) {
2781
2811
  value: a
2782
2812
  }
2783
2813
  ),
2784
- e.type === "string" && h && /* @__PURE__ */ l.jsx(
2814
+ e.type === "string" && d && /* @__PURE__ */ l.jsx(
2785
2815
  "textarea",
2786
2816
  {
2787
2817
  cols: 50,
2788
2818
  rows: 10,
2789
2819
  disabled: e.disabled !== void 0 ? e.disabled : !0,
2790
2820
  onChange: u,
2821
+ onKeyDown: (f) => {
2822
+ e.onKeyDown !== void 0 && e.onKeyDown(f);
2823
+ },
2791
2824
  value: a
2792
2825
  }
2793
2826
  ),
@@ -2801,7 +2834,7 @@ function ft(e) {
2801
2834
  }
2802
2835
  ),
2803
2836
  e.type === "number" && /* @__PURE__ */ l.jsx(
2804
- Xe,
2837
+ Ze,
2805
2838
  {
2806
2839
  value: a,
2807
2840
  type: e.type,
@@ -2815,7 +2848,7 @@ function ft(e) {
2815
2848
  }
2816
2849
  ),
2817
2850
  e.type === "range" && /* @__PURE__ */ l.jsx(
2818
- Xe,
2851
+ Ze,
2819
2852
  {
2820
2853
  value: a,
2821
2854
  type: e.type,
@@ -2842,19 +2875,19 @@ function ft(e) {
2842
2875
  children: e.title
2843
2876
  }
2844
2877
  ),
2845
- e.type === "image" && /* @__PURE__ */ l.jsx("img", { ref: o, onClick: () => {
2878
+ e.type === "image" && /* @__PURE__ */ l.jsx("img", { alt: e.title, ref: c, onClick: () => {
2846
2879
  Xa().then((f) => {
2847
- o.current.src = f, e.onChange !== void 0 && e.onChange(e.prop !== void 0 ? e.prop : e.title, f);
2880
+ c.current.src = f, e.onChange !== void 0 && e.onChange(e.prop !== void 0 ? e.prop : e.title, f);
2848
2881
  });
2849
- }, src: a.length > 0 ? a : Ga }),
2882
+ }, src: a.src.length > 0 ? a.src : Va }),
2850
2883
  e.type === "option" && /* @__PURE__ */ l.jsx(l.Fragment, { children: /* @__PURE__ */ l.jsx("select", { onChange: u, disabled: e.disabled, defaultValue: e.value, children: e.options?.map((f, m) => /* @__PURE__ */ l.jsx("option", { value: f.value, children: Mt(f.title) }, m)) }) }),
2851
- e.type === "vector2" && /* @__PURE__ */ l.jsx(ui, { value: a, min: 0, max: 1, onChange: u }),
2852
- e.type === "grid3" && /* @__PURE__ */ l.jsx(an, { value: a, onChange: u }),
2853
- e.type === "grid4" && /* @__PURE__ */ l.jsx(di, { value: a, onChange: u }),
2854
- e.type === "euler" && /* @__PURE__ */ l.jsx(an, { value: a, onChange: u })
2884
+ e.type === "vector2" && /* @__PURE__ */ l.jsx(di, { value: a, min: 0, max: 1, onChange: u }),
2885
+ e.type === "grid3" && /* @__PURE__ */ l.jsx(rn, { value: a, onChange: u }),
2886
+ e.type === "grid4" && /* @__PURE__ */ l.jsx(hi, { value: a, onChange: u }),
2887
+ e.type === "euler" && /* @__PURE__ */ l.jsx(rn, { value: a, onChange: u })
2855
2888
  ] });
2856
2889
  }
2857
- function rn(e) {
2890
+ function sn(e) {
2858
2891
  switch (e) {
2859
2892
  case "fov":
2860
2893
  return "FOV";
@@ -2883,57 +2916,57 @@ function rn(e) {
2883
2916
  }
2884
2917
  return e;
2885
2918
  }
2886
- function hi(e, n) {
2919
+ function fi(e, n) {
2887
2920
  const a = [];
2888
2921
  if (e.perspectiveCameraInfo !== void 0)
2889
2922
  for (const t in e.perspectiveCameraInfo)
2890
2923
  a.push({
2891
- title: rn(t),
2924
+ title: sn(t),
2892
2925
  prop: t,
2893
2926
  type: "number",
2894
2927
  step: 0.01,
2895
2928
  value: e.perspectiveCameraInfo[t],
2896
- onChange: (i, o) => {
2897
- n.updateObject(e.uuid, i, o), n.requestMethod(e.uuid, "updateProjectionMatrix");
2929
+ onChange: (i, c) => {
2930
+ n.updateObject(e.uuid, i, c), n.requestMethod(e.uuid, "updateProjectionMatrix");
2898
2931
  const u = n.scene?.getObjectByProperty("uuid", e.uuid);
2899
- u !== void 0 && (Q(u, i, o), u.updateProjectionMatrix());
2932
+ u !== void 0 && (V(u, i, c), u.updateProjectionMatrix());
2900
2933
  }
2901
2934
  });
2902
2935
  else if (e.orthographicCameraInfo !== void 0)
2903
2936
  for (const t in e.orthographicCameraInfo)
2904
2937
  a.push({
2905
- title: rn(t),
2938
+ title: sn(t),
2906
2939
  prop: t,
2907
2940
  type: "number",
2908
2941
  step: 0.01,
2909
2942
  value: e.perspectiveCameraInfo[t],
2910
- onChange: (i, o) => {
2911
- n.updateObject(e.uuid, i, o), n.requestMethod(e.uuid, "updateProjectionMatrix");
2943
+ onChange: (i, c) => {
2944
+ n.updateObject(e.uuid, i, c), n.requestMethod(e.uuid, "updateProjectionMatrix");
2912
2945
  const u = n.scene?.getObjectByProperty("uuid", e.uuid);
2913
- u !== void 0 && (Q(u, i, o), u.updateProjectionMatrix());
2946
+ u !== void 0 && (V(u, i, c), u.updateProjectionMatrix());
2914
2947
  }
2915
2948
  });
2916
2949
  return /* @__PURE__ */ l.jsx(
2917
- Ze,
2950
+ Xe,
2918
2951
  {
2919
2952
  title: "Camera",
2920
2953
  items: a
2921
2954
  }
2922
2955
  );
2923
2956
  }
2924
- function fi(e, n) {
2925
- const a = new ia();
2957
+ function mi(e, n) {
2958
+ const a = new ra();
2926
2959
  a.elements = e.matrix;
2927
- const t = new Y(), i = new ra(), o = new Y();
2928
- e.uuid.length > 0 && (t.setFromMatrixPosition(a), i.setFromRotationMatrix(a), o.setFromMatrixScale(a));
2929
- const u = (c, h) => {
2930
- const d = c === "rotation" ? { x: h._x, y: h._y, z: h._z } : h;
2931
- n.updateObject(e.uuid, c, d);
2960
+ const t = new Y(), i = new sa(), c = new Y();
2961
+ e.uuid.length > 0 && (t.setFromMatrixPosition(a), i.setFromRotationMatrix(a), c.setFromMatrixScale(a));
2962
+ const u = (o, d) => {
2963
+ const h = o === "rotation" ? { x: d._x, y: d._y, z: d._z } : d;
2964
+ n.updateObject(e.uuid, o, h);
2932
2965
  const f = n.scene?.getObjectByProperty("uuid", e.uuid);
2933
- f !== void 0 && Q(f, c, d);
2966
+ f !== void 0 && V(f, o, h);
2934
2967
  };
2935
2968
  return /* @__PURE__ */ l.jsx(
2936
- Ze,
2969
+ Xe,
2937
2970
  {
2938
2971
  title: "Transform",
2939
2972
  items: [
@@ -2955,14 +2988,14 @@ function fi(e, n) {
2955
2988
  title: "Scale",
2956
2989
  prop: "scale",
2957
2990
  type: "grid3",
2958
- value: o,
2991
+ value: c,
2959
2992
  onChange: u
2960
2993
  }
2961
2994
  ]
2962
2995
  }
2963
2996
  );
2964
2997
  }
2965
- function sn(e) {
2998
+ function on(e) {
2966
2999
  switch (e) {
2967
3000
  case "color":
2968
3001
  return "Color";
@@ -2985,54 +3018,54 @@ function sn(e) {
2985
3018
  }
2986
3019
  return e;
2987
3020
  }
2988
- function mi(e, n) {
3021
+ function pi(e, n) {
2989
3022
  const a = [];
2990
3023
  if (e.lightInfo !== void 0)
2991
3024
  for (const t in e.lightInfo) {
2992
3025
  const i = e.lightInfo[t];
2993
3026
  i !== void 0 && (i.isColor !== void 0 ? a.push({
2994
- title: sn(t),
3027
+ title: on(t),
2995
3028
  prop: t,
2996
3029
  type: "color",
2997
3030
  value: i,
2998
- onChange: (o, u) => {
2999
- const c = new Lt(u);
3000
- n.updateObject(e.uuid, o, c);
3001
- const h = n.scene?.getObjectByProperty("uuid", e.uuid);
3002
- h !== void 0 && Q(h, o, c);
3031
+ onChange: (c, u) => {
3032
+ const o = new Lt(u);
3033
+ n.updateObject(e.uuid, c, o);
3034
+ const d = n.scene?.getObjectByProperty("uuid", e.uuid);
3035
+ d !== void 0 && V(d, c, o);
3003
3036
  }
3004
3037
  }) : a.push({
3005
- title: sn(t),
3038
+ title: on(t),
3006
3039
  prop: t,
3007
3040
  type: typeof i,
3008
3041
  value: i,
3009
3042
  step: typeof i == "number" ? 0.01 : void 0,
3010
- onChange: (o, u) => {
3011
- n.updateObject(e.uuid, o, u);
3012
- const c = n.scene?.getObjectByProperty("uuid", e.uuid);
3013
- c !== void 0 && Q(c, o, u);
3043
+ onChange: (c, u) => {
3044
+ n.updateObject(e.uuid, c, u);
3045
+ const o = n.scene?.getObjectByProperty("uuid", e.uuid);
3046
+ o !== void 0 && V(o, c, u);
3014
3047
  }
3015
3048
  }));
3016
3049
  }
3017
3050
  return /* @__PURE__ */ l.jsx(
3018
- Ze,
3051
+ Xe,
3019
3052
  {
3020
3053
  title: "Light",
3021
3054
  items: a
3022
3055
  }
3023
3056
  );
3024
3057
  }
3025
- function pi(e, n) {
3058
+ function gi(e, n) {
3026
3059
  const a = [], t = [];
3027
3060
  let i = 0;
3028
- e.animations.forEach((c) => {
3029
- i = Math.max(i, c.duration), c.duration > 0 && t.push({
3030
- title: c.name,
3061
+ e.animations.forEach((o) => {
3062
+ i = Math.max(i, o.duration), o.duration > 0 && t.push({
3063
+ title: o.name,
3031
3064
  items: [
3032
3065
  {
3033
3066
  title: "Duration",
3034
3067
  type: "number",
3035
- value: c.duration,
3068
+ value: o.duration,
3036
3069
  disabled: !0
3037
3070
  },
3038
3071
  {
@@ -3056,37 +3089,37 @@ function pi(e, n) {
3056
3089
  title: "Animations",
3057
3090
  items: t
3058
3091
  });
3059
- const o = n.scene?.getObjectByProperty("uuid", e.uuid);
3092
+ const c = n.scene?.getObjectByProperty("uuid", e.uuid);
3060
3093
  let u = !1;
3061
- if (o !== void 0) {
3062
- const c = o.mixer;
3063
- if (u = c !== void 0, u) {
3064
- const h = [
3094
+ if (c !== void 0) {
3095
+ const o = c.mixer;
3096
+ if (u = o !== void 0, u) {
3097
+ const d = [
3065
3098
  {
3066
3099
  title: "Time Scale",
3067
3100
  type: "range",
3068
- value: c.timeScale,
3101
+ value: o.timeScale,
3069
3102
  step: 0.01,
3070
3103
  min: -1,
3071
3104
  max: 2,
3072
- onChange: (d, f) => {
3073
- c.timeScale = f, n.updateObject(e.uuid, "mixer.timeScale", f);
3105
+ onChange: (h, f) => {
3106
+ o.timeScale = f, n.updateObject(e.uuid, "mixer.timeScale", f);
3074
3107
  }
3075
3108
  }
3076
3109
  ];
3077
- h.push({
3110
+ d.push({
3078
3111
  title: "Stop All",
3079
3112
  type: "button",
3080
3113
  onChange: () => {
3081
- c.stopAllAction(), n.requestMethod(e.uuid, "stopAllAction", void 0, "mixer");
3114
+ o.stopAllAction(), n.requestMethod(e.uuid, "stopAllAction", void 0, "mixer");
3082
3115
  }
3083
3116
  }), a.push({
3084
3117
  title: "Mixer",
3085
- items: h
3118
+ items: d
3086
3119
  });
3087
3120
  }
3088
3121
  }
3089
- return /* @__PURE__ */ l.jsx(Ze, { title: "Animation", items: a });
3122
+ return /* @__PURE__ */ l.jsx(Xe, { title: "Animation", items: a });
3090
3123
  }
3091
3124
  const $n = {
3092
3125
  name: "",
@@ -3100,22 +3133,22 @@ const $n = {
3100
3133
  orthographicCameraInfo: void 0,
3101
3134
  lightInfo: void 0
3102
3135
  };
3103
- let oe = { ...$n };
3104
- function gi(e) {
3105
- const [n, a] = K(-1);
3106
- Pe(() => {
3107
- function u(h) {
3108
- oe = { ...h.value }, a(Date.now());
3136
+ let se = { ...$n };
3137
+ function vi(e) {
3138
+ const [n, a] = Z(-1);
3139
+ Ae(() => {
3140
+ function u(d) {
3141
+ se = { ...d.value }, a(Date.now());
3109
3142
  }
3110
- function c() {
3111
- oe = { ...$n }, a(Date.now());
3143
+ function o() {
3144
+ se = { ...$n }, a(Date.now());
3112
3145
  }
3113
- return N.addEventListener(L.SET_SCENE, c), N.addEventListener(L.SET_OBJECT, u), () => {
3114
- N.removeEventListener(L.SET_SCENE, c), N.removeEventListener(L.SET_OBJECT, u);
3146
+ return j.addEventListener(A.SET_SCENE, o), j.addEventListener(A.SET_OBJECT, u), () => {
3147
+ j.removeEventListener(A.SET_SCENE, o), j.removeEventListener(A.SET_OBJECT, u);
3115
3148
  };
3116
3149
  }, []);
3117
- const t = oe.type.toLowerCase(), i = oe.animations.length > 0 || oe.mixer !== void 0, o = t.search("mesh") > -1 || t.search("line") > -1 || t.search("points") > -1;
3118
- return /* @__PURE__ */ l.jsx(Ut, { label: "Inspector", children: /* @__PURE__ */ l.jsx("div", { id: "Inspector", className: e.class, children: oe.uuid.length > 0 && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
3150
+ const t = se.type.toLowerCase(), i = se.animations.length > 0 || se.mixer !== void 0, c = t.search("mesh") > -1 || t.search("line") > -1 || t.search("points") > -1;
3151
+ return /* @__PURE__ */ l.jsx($t, { label: "Inspector", children: /* @__PURE__ */ l.jsx("div", { id: "Inspector", className: e.class, children: se.uuid.length > 0 && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
3119
3152
  /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
3120
3153
  /* @__PURE__ */ l.jsx(
3121
3154
  ft,
@@ -3123,7 +3156,7 @@ function gi(e) {
3123
3156
  type: "string",
3124
3157
  title: "Name",
3125
3158
  prop: "name",
3126
- value: oe.name,
3159
+ value: se.name,
3127
3160
  disabled: !0
3128
3161
  }
3129
3162
  ),
@@ -3133,7 +3166,7 @@ function gi(e) {
3133
3166
  type: "string",
3134
3167
  title: "Type",
3135
3168
  prop: "type",
3136
- value: oe.type,
3169
+ value: se.type,
3137
3170
  disabled: !0
3138
3171
  }
3139
3172
  ),
@@ -3143,7 +3176,7 @@ function gi(e) {
3143
3176
  type: "string",
3144
3177
  title: "UUID",
3145
3178
  prop: "uuid",
3146
- value: oe.uuid,
3179
+ value: se.uuid,
3147
3180
  disabled: !0
3148
3181
  }
3149
3182
  ),
@@ -3153,89 +3186,89 @@ function gi(e) {
3153
3186
  type: "boolean",
3154
3187
  title: "Visible",
3155
3188
  prop: "visible",
3156
- value: oe.visible,
3157
- onChange: (u, c) => {
3158
- e.three.updateObject(oe.uuid, u, c);
3159
- const h = e.three.scene?.getObjectByProperty("uuid", oe.uuid);
3160
- h !== void 0 && Q(h, u, c);
3189
+ value: se.visible,
3190
+ onChange: (u, o) => {
3191
+ e.three.updateObject(se.uuid, u, o);
3192
+ const d = e.three.scene?.getObjectByProperty("uuid", se.uuid);
3193
+ d !== void 0 && V(d, u, o);
3161
3194
  }
3162
3195
  }
3163
3196
  )
3164
3197
  ] }),
3165
3198
  /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
3166
- fi(oe, e.three),
3167
- i ? pi(oe, e.three) : null,
3168
- t.search("camera") > -1 ? hi(oe, e.three) : null,
3169
- t.search("light") > -1 ? mi(oe, e.three) : null,
3170
- o ? ci(oe, e.three) : null
3199
+ mi(se, e.three),
3200
+ i ? gi(se, e.three) : null,
3201
+ t.search("camera") > -1 ? fi(se, e.three) : null,
3202
+ t.search("light") > -1 ? pi(se, e.three) : null,
3203
+ c ? li(se, e.three) : null
3171
3204
  ] })
3172
3205
  ] }) }, n) }, "Inspector");
3173
3206
  }
3174
3207
  function Fi(e) {
3175
- const [n, a] = K(e.scene);
3176
- Pe(() => {
3177
- const o = (u) => {
3208
+ const [n, a] = Z(e.scene);
3209
+ Ae(() => {
3210
+ const c = (u) => {
3178
3211
  a(u.value);
3179
3212
  };
3180
- return N.addEventListener(L.SET_SCENE, o), () => {
3181
- N.removeEventListener(L.SET_SCENE, o);
3213
+ return j.addEventListener(A.SET_SCENE, c), () => {
3214
+ j.removeEventListener(A.SET_SCENE, c);
3182
3215
  };
3183
3216
  }, []);
3184
3217
  const t = n !== null, i = "Hierarchy - " + (t ? `${n?.name}` : "No Scene");
3185
3218
  return /* @__PURE__ */ l.jsxs("div", { id: "SidePanel", children: [
3186
- /* @__PURE__ */ l.jsx(Ut, { label: i, open: !0, children: /* @__PURE__ */ l.jsx(l.Fragment, { children: t && /* @__PURE__ */ l.jsx(Ya, { child: n, three: e.three }) }) }),
3187
- /* @__PURE__ */ l.jsx(gi, { three: e.three })
3219
+ /* @__PURE__ */ l.jsx($t, { label: i, open: !0, children: /* @__PURE__ */ l.jsx(l.Fragment, { children: t && /* @__PURE__ */ l.jsx(Ya, { child: n, three: e.three }) }) }),
3220
+ /* @__PURE__ */ l.jsx(vi, { three: e.three })
3188
3221
  ] }, "SidePanel");
3189
3222
  }
3190
- function Bi(e) {
3223
+ function Ui(e) {
3191
3224
  function n() {
3192
3225
  return e.three.scene === void 0 ? (console.log("No scene:", e.three), !1) : !0;
3193
3226
  }
3194
- const a = (c) => {
3227
+ const a = (o) => {
3195
3228
  if (!n())
3196
3229
  return;
3197
- const h = e.three.scene?.getObjectByProperty("uuid", c.value);
3198
- h !== void 0 && e.three.setObject(h);
3199
- }, t = (c, h, d) => {
3230
+ const d = e.three.scene?.getObjectByProperty("uuid", o.value);
3231
+ d !== void 0 && e.three.setObject(d);
3232
+ }, t = (o, d, h) => {
3200
3233
  if (!n())
3201
3234
  return;
3202
- const f = e.three.scene?.getObjectByProperty("uuid", c);
3203
- f !== void 0 && Q(f, h, d);
3204
- }, i = (c) => {
3235
+ const f = e.three.scene?.getObjectByProperty("uuid", o);
3236
+ f !== void 0 && V(f, d, h);
3237
+ }, i = (o) => {
3205
3238
  if (!n())
3206
3239
  return;
3207
- const h = c.value, { key: d, value: f, uuid: m } = h;
3208
- t(m, d, f);
3209
- }, o = (c) => {
3240
+ const d = o.value, { key: h, value: f, uuid: m } = d;
3241
+ t(m, h, f);
3242
+ }, c = (o) => {
3210
3243
  if (!n())
3211
3244
  return;
3212
- const h = c.value;
3213
- Ln(h.value).then((d) => {
3214
- t(h.uuid, h.key, d), t(h.uuid, "material.needsUpdate", !0);
3245
+ const d = o.value;
3246
+ Ln(d.value).then((h) => {
3247
+ t(d.uuid, d.key, h), t(d.uuid, "material.needsUpdate", !0);
3215
3248
  });
3216
- }, u = (c) => {
3249
+ }, u = (o) => {
3217
3250
  if (!n())
3218
3251
  return;
3219
- const { key: h, uuid: d, value: f, subitem: m } = c.value, x = e.three.scene?.getObjectByProperty("uuid", d);
3252
+ const { key: d, uuid: h, value: f, subitem: m } = o.value, x = e.three.scene?.getObjectByProperty("uuid", h);
3220
3253
  if (x !== void 0)
3221
3254
  try {
3222
- m !== void 0 ? Ia(x, m)[h](f) : x[h](f);
3223
- } catch (O) {
3224
- console.log("Error requesting method:"), console.log(O), console.log(h), console.log(f);
3255
+ m !== void 0 ? Na(x, m)[d](f) : x[d](f);
3256
+ } catch (T) {
3257
+ console.log("Error requesting method:"), console.log(T), console.log(d), console.log(f);
3225
3258
  }
3226
3259
  };
3227
- return Pe(() => (N.addEventListener(L.GET_OBJECT, a), N.addEventListener(L.UPDATE_OBJECT, i), N.addEventListener(L.CREATE_TEXTURE, o), N.addEventListener(L.REQUEST_METHOD, u), () => {
3228
- N.removeEventListener(L.GET_OBJECT, a), N.removeEventListener(L.UPDATE_OBJECT, i), N.removeEventListener(L.CREATE_TEXTURE, o), N.removeEventListener(L.REQUEST_METHOD, u);
3260
+ return Ae(() => (j.addEventListener(A.GET_OBJECT, a), j.addEventListener(A.UPDATE_OBJECT, i), j.addEventListener(A.CREATE_TEXTURE, c), j.addEventListener(A.REQUEST_METHOD, u), () => {
3261
+ j.removeEventListener(A.GET_OBJECT, a), j.removeEventListener(A.UPDATE_OBJECT, i), j.removeEventListener(A.CREATE_TEXTURE, c), j.removeEventListener(A.REQUEST_METHOD, u);
3229
3262
  }), []), null;
3230
3263
  }
3231
- class vi extends sa {
3264
+ class bi extends oa {
3232
3265
  constructor(n, a) {
3233
3266
  const t = [1, 1, 0, -1, 1, 0, -1, -1, 0, 1, -1, 0, 1, 1, 0], i = new Yt();
3234
- i.setAttribute("position", new Gt(t, 3)), i.computeBoundingSphere();
3235
- const o = new oa({ fog: !1 });
3236
- super(i, o), this.light = n, this.color = a, this.type = "RectAreaLightHelper";
3237
- const u = [1, 1, 0, -1, 1, 0, -1, -1, 0, 1, 1, 0, -1, -1, 0, 1, -1, 0], c = new Yt();
3238
- c.setAttribute("position", new Gt(u, 3)), c.computeBoundingSphere(), this.add(new Rn(c, new An({ side: fn, fog: !1 })));
3267
+ i.setAttribute("position", new Vt(t, 3)), i.computeBoundingSphere();
3268
+ const c = new ca({ fog: !1 });
3269
+ super(i, c), this.light = n, this.color = a, this.type = "RectAreaLightHelper";
3270
+ const u = [1, 1, 0, -1, 1, 0, -1, -1, 0, 1, 1, 0, -1, -1, 0, 1, -1, 0], o = new Yt();
3271
+ o.setAttribute("position", new Vt(u, 3)), o.computeBoundingSphere(), this.add(new Pn(o, new kn({ side: mn, fog: !1 })));
3239
3272
  }
3240
3273
  updateMatrixWorld() {
3241
3274
  if (this.scale.set(0.5 * this.light.width, 0.5 * this.light.height, 1), this.color !== void 0)
@@ -3251,13 +3284,13 @@ class vi extends sa {
3251
3284
  this.geometry.dispose(), this.material.dispose(), this.children[0].geometry.dispose(), this.children[0].material.dispose();
3252
3285
  }
3253
3286
  }
3254
- const on = { type: "change" }, jt = { type: "start" }, cn = { type: "end" }, Et = new ca(), ln = new la(), bi = Math.cos(70 * ua.DEG2RAD);
3255
- class yi extends dn {
3287
+ const cn = { type: "change" }, At = { type: "start" }, ln = { type: "end" }, Et = new la(), un = new ua(), yi = Math.cos(70 * da.DEG2RAD);
3288
+ class xi extends hn {
3256
3289
  constructor(n, a) {
3257
3290
  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: nt.ROTATE, MIDDLE: nt.DOLLY, RIGHT: nt.PAN }, this.touches = { ONE: at.ROTATE, TWO: at.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this.getPolarAngle = function() {
3258
- return c.phi;
3291
+ return o.phi;
3259
3292
  }, this.getAzimuthalAngle = function() {
3260
- return c.theta;
3293
+ return o.theta;
3261
3294
  }, this.getDistance = function() {
3262
3295
  return this.object.position.distanceTo(this.target);
3263
3296
  }, this.listenToKeyEvents = function(s) {
@@ -3267,46 +3300,46 @@ class yi extends dn {
3267
3300
  }, this.saveState = function() {
3268
3301
  t.target0.copy(t.target), t.position0.copy(t.object.position), t.zoom0 = t.object.zoom;
3269
3302
  }, this.reset = function() {
3270
- t.target.copy(t.target0), t.object.position.copy(t.position0), t.object.zoom = t.zoom0, t.object.updateProjectionMatrix(), t.dispatchEvent(on), t.update(), o = i.NONE;
3303
+ t.target.copy(t.target0), t.object.position.copy(t.position0), t.object.zoom = t.zoom0, t.object.updateProjectionMatrix(), t.dispatchEvent(cn), t.update(), c = i.NONE;
3271
3304
  }, this.update = function() {
3272
- const s = new Y(), y = new Wt().setFromUnitVectors(n.up, new Y(0, 1, 0)), T = y.clone().invert(), j = new Y(), ee = new Wt(), ye = new Y(), de = 2 * Math.PI;
3305
+ const s = new Y(), y = new qt().setFromUnitVectors(n.up, new Y(0, 1, 0)), _ = y.clone().invert(), D = new Y(), ee = new qt(), ye = new Y(), de = 2 * Math.PI;
3273
3306
  return function(bt = null) {
3274
3307
  const yt = t.object.position;
3275
- s.copy(yt).sub(t.target), s.applyQuaternion(y), c.setFromVector3(s), t.autoRotate && o === i.NONE && ve(_e(bt)), t.enableDamping ? (c.theta += h.theta * t.dampingFactor, c.phi += h.phi * t.dampingFactor) : (c.theta += h.theta, c.phi += h.phi);
3308
+ s.copy(yt).sub(t.target), s.applyQuaternion(y), o.setFromVector3(s), t.autoRotate && c === i.NONE && ve(Te(bt)), t.enableDamping ? (o.theta += d.theta * t.dampingFactor, o.phi += d.phi * t.dampingFactor) : (o.theta += d.theta, o.phi += d.phi);
3276
3309
  let xe = t.minAzimuthAngle, Ee = t.maxAzimuthAngle;
3277
- isFinite(xe) && isFinite(Ee) && (xe < -Math.PI ? xe += de : xe > Math.PI && (xe -= de), Ee < -Math.PI ? Ee += de : Ee > Math.PI && (Ee -= de), xe <= Ee ? c.theta = Math.max(xe, Math.min(Ee, c.theta)) : c.theta = c.theta > (xe + Ee) / 2 ? Math.max(xe, c.theta) : Math.min(Ee, c.theta)), c.phi = Math.max(t.minPolarAngle, Math.min(t.maxPolarAngle, c.phi)), c.makeSafe(), t.enableDamping === !0 ? t.target.addScaledVector(f, t.dampingFactor) : t.target.add(f), t.target.sub(t.cursor), t.target.clampLength(t.minTargetRadius, t.maxTargetRadius), t.target.add(t.cursor);
3278
- let We = !1;
3310
+ isFinite(xe) && isFinite(Ee) && (xe < -Math.PI ? xe += de : xe > Math.PI && (xe -= de), Ee < -Math.PI ? Ee += de : Ee > Math.PI && (Ee -= de), xe <= Ee ? o.theta = Math.max(xe, Math.min(Ee, o.theta)) : o.theta = o.theta > (xe + Ee) / 2 ? Math.max(xe, o.theta) : Math.min(Ee, o.theta)), o.phi = Math.max(t.minPolarAngle, Math.min(t.maxPolarAngle, o.phi)), o.makeSafe(), t.enableDamping === !0 ? t.target.addScaledVector(f, t.dampingFactor) : t.target.add(f), t.target.sub(t.cursor), t.target.clampLength(t.minTargetRadius, t.maxTargetRadius), t.target.add(t.cursor);
3311
+ let Ve = !1;
3279
3312
  if (t.zoomToCursor && Se || t.object.isOrthographicCamera)
3280
- c.radius = ke(c.radius);
3313
+ o.radius = ke(o.radius);
3281
3314
  else {
3282
- const Oe = c.radius;
3283
- c.radius = ke(c.radius * d), We = Oe != c.radius;
3315
+ const Oe = o.radius;
3316
+ o.radius = ke(o.radius * h), Ve = Oe != o.radius;
3284
3317
  }
3285
- if (s.setFromSpherical(c), s.applyQuaternion(T), yt.copy(t.target).add(s), t.object.lookAt(t.target), t.enableDamping === !0 ? (h.theta *= 1 - t.dampingFactor, h.phi *= 1 - t.dampingFactor, f.multiplyScalar(1 - t.dampingFactor)) : (h.set(0, 0, 0), f.set(0, 0, 0)), t.zoomToCursor && Se) {
3318
+ if (s.setFromSpherical(o), s.applyQuaternion(_), yt.copy(t.target).add(s), t.object.lookAt(t.target), t.enableDamping === !0 ? (d.theta *= 1 - t.dampingFactor, d.phi *= 1 - t.dampingFactor, f.multiplyScalar(1 - t.dampingFactor)) : (d.set(0, 0, 0), f.set(0, 0, 0)), t.zoomToCursor && Se) {
3286
3319
  let Oe = null;
3287
3320
  if (t.object.isPerspectiveCamera) {
3288
- const Ve = s.length();
3289
- Oe = ke(Ve * d);
3290
- const et = Ve - Oe;
3291
- t.object.position.addScaledVector(Z, et), t.object.updateMatrixWorld(), We = !!et;
3321
+ const ze = s.length();
3322
+ Oe = ke(ze * h);
3323
+ const et = ze - Oe;
3324
+ t.object.position.addScaledVector(q, et), t.object.updateMatrixWorld(), Ve = !!et;
3292
3325
  } else if (t.object.isOrthographicCamera) {
3293
- const Ve = new Y(ne.x, ne.y, 0);
3294
- Ve.unproject(t.object);
3326
+ const ze = new Y(ne.x, ne.y, 0);
3327
+ ze.unproject(t.object);
3295
3328
  const et = t.object.zoom;
3296
- t.object.zoom = Math.max(t.minZoom, Math.min(t.maxZoom, t.object.zoom / d)), t.object.updateProjectionMatrix(), We = et !== t.object.zoom;
3329
+ t.object.zoom = Math.max(t.minZoom, Math.min(t.maxZoom, t.object.zoom / h)), t.object.updateProjectionMatrix(), Ve = et !== t.object.zoom;
3297
3330
  const xt = new Y(ne.x, ne.y, 0);
3298
- xt.unproject(t.object), t.object.position.sub(xt).add(Ve), t.object.updateMatrixWorld(), Oe = s.length();
3331
+ xt.unproject(t.object), t.object.position.sub(xt).add(ze), t.object.updateMatrixWorld(), Oe = s.length();
3299
3332
  } else
3300
3333
  console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), t.zoomToCursor = !1;
3301
- Oe !== null && (this.screenSpacePanning ? t.target.set(0, 0, -1).transformDirection(t.object.matrix).multiplyScalar(Oe).add(t.object.position) : (Et.origin.copy(t.object.position), Et.direction.set(0, 0, -1).transformDirection(t.object.matrix), Math.abs(t.object.up.dot(Et.direction)) < bi ? n.lookAt(t.target) : (ln.setFromNormalAndCoplanarPoint(t.object.up, t.target), Et.intersectPlane(ln, t.target))));
3334
+ Oe !== null && (this.screenSpacePanning ? t.target.set(0, 0, -1).transformDirection(t.object.matrix).multiplyScalar(Oe).add(t.object.position) : (Et.origin.copy(t.object.position), Et.direction.set(0, 0, -1).transformDirection(t.object.matrix), Math.abs(t.object.up.dot(Et.direction)) < yi ? n.lookAt(t.target) : (un.setFromNormalAndCoplanarPoint(t.object.up, t.target), Et.intersectPlane(un, t.target))));
3302
3335
  } else if (t.object.isOrthographicCamera) {
3303
3336
  const Oe = t.object.zoom;
3304
- t.object.zoom = Math.max(t.minZoom, Math.min(t.maxZoom, t.object.zoom / d)), Oe !== t.object.zoom && (t.object.updateProjectionMatrix(), We = !0);
3337
+ t.object.zoom = Math.max(t.minZoom, Math.min(t.maxZoom, t.object.zoom / h)), Oe !== t.object.zoom && (t.object.updateProjectionMatrix(), Ve = !0);
3305
3338
  }
3306
- return d = 1, Se = !1, We || j.distanceToSquared(t.object.position) > u || 8 * (1 - ee.dot(t.object.quaternion)) > u || ye.distanceToSquared(t.target) > u ? (t.dispatchEvent(on), j.copy(t.object.position), ee.copy(t.object.quaternion), ye.copy(t.target), !0) : !1;
3339
+ return h = 1, Se = !1, Ve || D.distanceToSquared(t.object.position) > u || 8 * (1 - ee.dot(t.object.quaternion)) > u || ye.distanceToSquared(t.target) > u ? (t.dispatchEvent(cn), D.copy(t.object.position), ee.copy(t.object.quaternion), ye.copy(t.target), !0) : !1;
3307
3340
  };
3308
3341
  }(), this.dispose = function() {
3309
- t.domElement.removeEventListener("contextmenu", Qe), t.domElement.removeEventListener("pointerdown", M), t.domElement.removeEventListener("pointercancel", W), t.domElement.removeEventListener("wheel", mt), t.domElement.removeEventListener("pointermove", B), t.domElement.removeEventListener("pointerup", W), t.domElement.getRootNode().removeEventListener("keydown", st, { capture: !0 }), t._domElementKeyEvents !== null && (t._domElementKeyEvents.removeEventListener("keydown", ot), t._domElementKeyEvents = null);
3342
+ t.domElement.removeEventListener("contextmenu", Qe), t.domElement.removeEventListener("pointerdown", O), t.domElement.removeEventListener("pointercancel", G), t.domElement.removeEventListener("wheel", mt), t.domElement.removeEventListener("pointermove", B), t.domElement.removeEventListener("pointerup", G), t.domElement.getRootNode().removeEventListener("keydown", st, { capture: !0 }), t._domElementKeyEvents !== null && (t._domElementKeyEvents.removeEventListener("keydown", ot), t._domElementKeyEvents = null);
3310
3343
  };
3311
3344
  const t = this, i = {
3312
3345
  NONE: -1,
@@ -3318,96 +3351,96 @@ class yi extends dn {
3318
3351
  TOUCH_DOLLY_PAN: 5,
3319
3352
  TOUCH_DOLLY_ROTATE: 6
3320
3353
  };
3321
- let o = i.NONE;
3322
- const u = 1e-6, c = new qt(), h = new qt();
3323
- let d = 1;
3324
- const f = new Y(), m = new fe(), x = new fe(), O = new fe(), H = new fe(), te = new fe(), me = new fe(), re = new fe(), $ = new fe(), D = new fe(), Z = new Y(), ne = new fe();
3354
+ let c = i.NONE;
3355
+ const u = 1e-6, o = new Kt(), d = new Kt();
3356
+ let h = 1;
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();
3325
3358
  let Se = !1;
3326
- const V = [], pe = {};
3327
- let le = !1;
3328
- function _e(s) {
3359
+ const z = [], pe = {};
3360
+ let ce = !1;
3361
+ function Te(s) {
3329
3362
  return s !== null ? 2 * Math.PI / 60 * t.autoRotateSpeed * s : 2 * Math.PI / 60 / 60 * t.autoRotateSpeed;
3330
3363
  }
3331
- function Te(s) {
3364
+ function _e(s) {
3332
3365
  const y = Math.abs(s * 0.01);
3333
3366
  return Math.pow(0.95, t.zoomSpeed * y);
3334
3367
  }
3335
3368
  function ve(s) {
3336
- h.theta -= s;
3369
+ d.theta -= s;
3337
3370
  }
3338
- function I(s) {
3339
- h.phi -= s;
3371
+ function N(s) {
3372
+ d.phi -= s;
3340
3373
  }
3341
3374
  const be = function() {
3342
3375
  const s = new Y();
3343
- return function(T, j) {
3344
- s.setFromMatrixColumn(j, 0), s.multiplyScalar(-T), f.add(s);
3376
+ return function(_, D) {
3377
+ s.setFromMatrixColumn(D, 0), s.multiplyScalar(-_), f.add(s);
3345
3378
  };
3346
- }(), S = function() {
3379
+ }(), w = function() {
3347
3380
  const s = new Y();
3348
- return function(T, j) {
3349
- t.screenSpacePanning === !0 ? s.setFromMatrixColumn(j, 1) : (s.setFromMatrixColumn(j, 0), s.crossVectors(t.object.up, s)), s.multiplyScalar(T), f.add(s);
3381
+ return function(_, D) {
3382
+ t.screenSpacePanning === !0 ? s.setFromMatrixColumn(D, 1) : (s.setFromMatrixColumn(D, 0), s.crossVectors(t.object.up, s)), s.multiplyScalar(_), f.add(s);
3350
3383
  };
3351
3384
  }(), we = function() {
3352
3385
  const s = new Y();
3353
- return function(T, j) {
3386
+ return function(_, D) {
3354
3387
  const ee = t.domElement;
3355
3388
  if (t.object.isPerspectiveCamera) {
3356
3389
  const ye = t.object.position;
3357
3390
  s.copy(ye).sub(t.target);
3358
3391
  let de = s.length();
3359
- de *= Math.tan(t.object.fov / 2 * Math.PI / 180), be(2 * T * de / ee.clientHeight, t.object.matrix), S(2 * j * de / ee.clientHeight, t.object.matrix);
3392
+ de *= Math.tan(t.object.fov / 2 * Math.PI / 180), be(2 * _ * de / ee.clientHeight, t.object.matrix), w(2 * D * de / ee.clientHeight, t.object.matrix);
3360
3393
  } else
3361
- t.object.isOrthographicCamera ? (be(T * (t.object.right - t.object.left) / t.object.zoom / ee.clientWidth, t.object.matrix), S(j * (t.object.top - t.object.bottom) / t.object.zoom / ee.clientHeight, t.object.matrix)) : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."), t.enablePan = !1);
3394
+ t.object.isOrthographicCamera ? (be(_ * (t.object.right - t.object.left) / t.object.zoom / ee.clientWidth, t.object.matrix), w(D * (t.object.top - t.object.bottom) / t.object.zoom / ee.clientHeight, t.object.matrix)) : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."), t.enablePan = !1);
3362
3395
  };
3363
3396
  }();
3364
3397
  function Re(s) {
3365
- t.object.isPerspectiveCamera || t.object.isOrthographicCamera ? d /= s : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), t.enableZoom = !1);
3398
+ t.object.isPerspectiveCamera || t.object.isOrthographicCamera ? h /= s : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), t.enableZoom = !1);
3366
3399
  }
3367
- function je(s) {
3368
- t.object.isPerspectiveCamera || t.object.isOrthographicCamera ? d *= s : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), t.enableZoom = !1);
3400
+ function De(s) {
3401
+ t.object.isPerspectiveCamera || t.object.isOrthographicCamera ? h *= s : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), t.enableZoom = !1);
3369
3402
  }
3370
- function Ae(s, y) {
3403
+ function Pe(s, y) {
3371
3404
  if (!t.zoomToCursor)
3372
3405
  return;
3373
3406
  Se = !0;
3374
- const T = t.domElement.getBoundingClientRect(), j = s - T.left, ee = y - T.top, ye = T.width, de = T.height;
3375
- ne.x = j / ye * 2 - 1, ne.y = -(ee / de) * 2 + 1, Z.set(ne.x, ne.y, 1).unproject(t.object).sub(t.object.position).normalize();
3407
+ const _ = t.domElement.getBoundingClientRect(), D = s - _.left, ee = y - _.top, ye = _.width, de = _.height;
3408
+ ne.x = D / ye * 2 - 1, ne.y = -(ee / de) * 2 + 1, q.set(ne.x, ne.y, 1).unproject(t.object).sub(t.object.position).normalize();
3376
3409
  }
3377
3410
  function ke(s) {
3378
3411
  return Math.max(t.minDistance, Math.min(t.maxDistance, s));
3379
3412
  }
3380
- function De(s) {
3413
+ function Ie(s) {
3381
3414
  m.set(s.clientX, s.clientY);
3382
3415
  }
3383
- function Fe(s) {
3384
- Ae(s.clientX, s.clientX), re.set(s.clientX, s.clientY);
3385
- }
3386
3416
  function Be(s) {
3387
- H.set(s.clientX, s.clientY);
3417
+ Pe(s.clientX, s.clientX), re.set(s.clientX, s.clientY);
3418
+ }
3419
+ function Fe(s) {
3420
+ W.set(s.clientX, s.clientY);
3388
3421
  }
3389
3422
  function ae(s) {
3390
- x.set(s.clientX, s.clientY), O.subVectors(x, m).multiplyScalar(t.rotateSpeed);
3423
+ x.set(s.clientX, s.clientY), T.subVectors(x, m).multiplyScalar(t.rotateSpeed);
3391
3424
  const y = t.domElement;
3392
- ve(2 * Math.PI * O.x / y.clientHeight), I(2 * Math.PI * O.y / y.clientHeight), m.copy(x), t.update();
3425
+ ve(2 * Math.PI * T.x / y.clientHeight), N(2 * Math.PI * T.y / y.clientHeight), m.copy(x), t.update();
3393
3426
  }
3394
3427
  function Me(s) {
3395
- $.set(s.clientX, s.clientY), D.subVectors($, re), D.y > 0 ? Re(Te(D.y)) : D.y < 0 && je(Te(D.y)), re.copy($), t.update();
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();
3396
3429
  }
3397
- function Ye(s) {
3398
- te.set(s.clientX, s.clientY), me.subVectors(te, H).multiplyScalar(t.panSpeed), we(me.x, me.y), H.copy(te), t.update();
3430
+ function He(s) {
3431
+ te.set(s.clientX, s.clientY), me.subVectors(te, W).multiplyScalar(t.panSpeed), we(me.x, me.y), W.copy(te), t.update();
3399
3432
  }
3400
- function Ge(s) {
3401
- Ae(s.clientX, s.clientY), s.deltaY < 0 ? je(Te(s.deltaY)) : s.deltaY > 0 && Re(Te(s.deltaY)), t.update();
3433
+ function Ye(s) {
3434
+ Pe(s.clientX, s.clientY), s.deltaY < 0 ? De(_e(s.deltaY)) : s.deltaY > 0 && Re(_e(s.deltaY)), t.update();
3402
3435
  }
3403
3436
  function ue(s) {
3404
3437
  let y = !1;
3405
3438
  switch (s.code) {
3406
3439
  case t.keys.UP:
3407
- s.ctrlKey || s.metaKey || s.shiftKey ? I(2 * Math.PI * t.rotateSpeed / t.domElement.clientHeight) : we(0, t.keyPanSpeed), y = !0;
3440
+ s.ctrlKey || s.metaKey || s.shiftKey ? N(2 * Math.PI * t.rotateSpeed / t.domElement.clientHeight) : we(0, t.keyPanSpeed), y = !0;
3408
3441
  break;
3409
3442
  case t.keys.BOTTOM:
3410
- s.ctrlKey || s.metaKey || s.shiftKey ? I(-2 * Math.PI * t.rotateSpeed / t.domElement.clientHeight) : we(0, -t.keyPanSpeed), y = !0;
3443
+ s.ctrlKey || s.metaKey || s.shiftKey ? N(-2 * Math.PI * t.rotateSpeed / t.domElement.clientHeight) : we(0, -t.keyPanSpeed), y = !0;
3411
3444
  break;
3412
3445
  case t.keys.LEFT:
3413
3446
  s.ctrlKey || s.metaKey || s.shiftKey ? ve(2 * Math.PI * t.rotateSpeed / t.domElement.clientHeight) : we(t.keyPanSpeed, 0), y = !0;
@@ -3419,81 +3452,81 @@ class yi extends dn {
3419
3452
  y && (s.preventDefault(), t.update());
3420
3453
  }
3421
3454
  function g(s) {
3422
- if (V.length === 1)
3455
+ if (z.length === 1)
3423
3456
  m.set(s.pageX, s.pageY);
3424
3457
  else {
3425
- const y = $e(s), T = 0.5 * (s.pageX + y.x), j = 0.5 * (s.pageY + y.y);
3426
- m.set(T, j);
3458
+ const y = $e(s), _ = 0.5 * (s.pageX + y.x), D = 0.5 * (s.pageY + y.y);
3459
+ m.set(_, D);
3427
3460
  }
3428
3461
  }
3429
3462
  function v(s) {
3430
- if (V.length === 1)
3431
- H.set(s.pageX, s.pageY);
3463
+ if (z.length === 1)
3464
+ W.set(s.pageX, s.pageY);
3432
3465
  else {
3433
- const y = $e(s), T = 0.5 * (s.pageX + y.x), j = 0.5 * (s.pageY + y.y);
3434
- H.set(T, j);
3466
+ const y = $e(s), _ = 0.5 * (s.pageX + y.x), D = 0.5 * (s.pageY + y.y);
3467
+ W.set(_, D);
3435
3468
  }
3436
3469
  }
3437
- function w(s) {
3438
- const y = $e(s), T = s.pageX - y.x, j = s.pageY - y.y, ee = Math.sqrt(T * T + j * j);
3470
+ function M(s) {
3471
+ const y = $e(s), _ = s.pageX - y.x, D = s.pageY - y.y, ee = Math.sqrt(_ * _ + D * D);
3439
3472
  re.set(0, ee);
3440
3473
  }
3441
- function k(s) {
3442
- t.enableZoom && w(s), t.enablePan && v(s);
3474
+ function P(s) {
3475
+ t.enableZoom && M(s), t.enablePan && v(s);
3443
3476
  }
3444
3477
  function ge(s) {
3445
- t.enableZoom && w(s), t.enableRotate && g(s);
3478
+ t.enableZoom && M(s), t.enableRotate && g(s);
3446
3479
  }
3447
- function _(s) {
3448
- if (V.length == 1)
3480
+ function le(s) {
3481
+ if (z.length == 1)
3449
3482
  x.set(s.pageX, s.pageY);
3450
3483
  else {
3451
- const T = $e(s), j = 0.5 * (s.pageX + T.x), ee = 0.5 * (s.pageY + T.y);
3452
- x.set(j, ee);
3484
+ const _ = $e(s), D = 0.5 * (s.pageX + _.x), ee = 0.5 * (s.pageY + _.y);
3485
+ x.set(D, ee);
3453
3486
  }
3454
- O.subVectors(x, m).multiplyScalar(t.rotateSpeed);
3487
+ T.subVectors(x, m).multiplyScalar(t.rotateSpeed);
3455
3488
  const y = t.domElement;
3456
- ve(2 * Math.PI * O.x / y.clientHeight), I(2 * Math.PI * O.y / y.clientHeight), m.copy(x);
3489
+ ve(2 * Math.PI * T.x / y.clientHeight), N(2 * Math.PI * T.y / y.clientHeight), m.copy(x);
3457
3490
  }
3458
- function E(s) {
3459
- if (V.length === 1)
3491
+ function C(s) {
3492
+ if (z.length === 1)
3460
3493
  te.set(s.pageX, s.pageY);
3461
3494
  else {
3462
- const y = $e(s), T = 0.5 * (s.pageX + y.x), j = 0.5 * (s.pageY + y.y);
3463
- te.set(T, j);
3495
+ const y = $e(s), _ = 0.5 * (s.pageX + y.x), D = 0.5 * (s.pageY + y.y);
3496
+ te.set(_, D);
3464
3497
  }
3465
- 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);
3466
3499
  }
3467
- function A(s) {
3468
- const y = $e(s), T = s.pageX - y.x, j = s.pageY - y.y, ee = Math.sqrt(T * T + j * j);
3469
- $.set(0, ee), D.set(0, Math.pow($.y / re.y, t.zoomSpeed)), Re(D.y), re.copy($);
3500
+ function E(s) {
3501
+ const y = $e(s), _ = s.pageX - y.x, D = s.pageY - y.y, ee = Math.sqrt(_ * _ + D * D);
3502
+ $.set(0, ee), I.set(0, Math.pow($.y / re.y, t.zoomSpeed)), Re(I.y), re.copy($);
3470
3503
  const ye = (s.pageX + y.x) * 0.5, de = (s.pageY + y.y) * 0.5;
3471
- Ae(ye, de);
3504
+ Pe(ye, de);
3472
3505
  }
3473
- function G(s) {
3474
- t.enableZoom && A(s), t.enablePan && E(s);
3506
+ function F(s) {
3507
+ t.enableZoom && E(s), t.enablePan && C(s);
3475
3508
  }
3476
- function se(s) {
3477
- t.enableZoom && A(s), t.enableRotate && _(s);
3509
+ function J(s) {
3510
+ t.enableZoom && E(s), t.enableRotate && le(s);
3478
3511
  }
3479
- function M(s) {
3480
- t.enabled !== !1 && (V.length === 0 && (t.domElement.setPointerCapture(s.pointerId), t.domElement.addEventListener("pointermove", B), t.domElement.addEventListener("pointerup", W)), !At(s) && (Tt(s), s.pointerType === "touch" ? ct(s) : Ie(s)));
3512
+ function O(s) {
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)));
3481
3514
  }
3482
3515
  function B(s) {
3483
3516
  t.enabled !== !1 && (s.pointerType === "touch" ? gt(s) : Je(s));
3484
3517
  }
3485
- function W(s) {
3486
- switch (Rt(s), V.length) {
3518
+ function G(s) {
3519
+ switch (Rt(s), z.length) {
3487
3520
  case 0:
3488
- t.domElement.releasePointerCapture(s.pointerId), t.domElement.removeEventListener("pointermove", B), t.domElement.removeEventListener("pointerup", W), t.dispatchEvent(cn), o = i.NONE;
3521
+ t.domElement.releasePointerCapture(s.pointerId), t.domElement.removeEventListener("pointermove", B), t.domElement.removeEventListener("pointerup", G), t.dispatchEvent(ln), c = i.NONE;
3489
3522
  break;
3490
3523
  case 1:
3491
- const y = V[0], T = pe[y];
3492
- ct({ pointerId: y, pageX: T.x, pageY: T.y });
3524
+ const y = z[0], _ = pe[y];
3525
+ ct({ pointerId: y, pageX: _.x, pageY: _.y });
3493
3526
  break;
3494
3527
  }
3495
3528
  }
3496
- function Ie(s) {
3529
+ function Ne(s) {
3497
3530
  let y;
3498
3531
  switch (s.button) {
3499
3532
  case 0:
@@ -3512,37 +3545,37 @@ class yi extends dn {
3512
3545
  case nt.DOLLY:
3513
3546
  if (t.enableZoom === !1)
3514
3547
  return;
3515
- Fe(s), o = i.DOLLY;
3548
+ Be(s), c = i.DOLLY;
3516
3549
  break;
3517
3550
  case nt.ROTATE:
3518
3551
  if (s.ctrlKey || s.metaKey || s.shiftKey) {
3519
3552
  if (t.enablePan === !1)
3520
3553
  return;
3521
- Be(s), o = i.PAN;
3554
+ Fe(s), c = i.PAN;
3522
3555
  } else {
3523
3556
  if (t.enableRotate === !1)
3524
3557
  return;
3525
- De(s), o = i.ROTATE;
3558
+ Ie(s), c = i.ROTATE;
3526
3559
  }
3527
3560
  break;
3528
3561
  case nt.PAN:
3529
3562
  if (s.ctrlKey || s.metaKey || s.shiftKey) {
3530
3563
  if (t.enableRotate === !1)
3531
3564
  return;
3532
- De(s), o = i.ROTATE;
3565
+ Ie(s), c = i.ROTATE;
3533
3566
  } else {
3534
3567
  if (t.enablePan === !1)
3535
3568
  return;
3536
- Be(s), o = i.PAN;
3569
+ Fe(s), c = i.PAN;
3537
3570
  }
3538
3571
  break;
3539
3572
  default:
3540
- o = i.NONE;
3573
+ c = i.NONE;
3541
3574
  }
3542
- o !== i.NONE && t.dispatchEvent(jt);
3575
+ c !== i.NONE && t.dispatchEvent(At);
3543
3576
  }
3544
3577
  function Je(s) {
3545
- switch (o) {
3578
+ switch (c) {
3546
3579
  case i.ROTATE:
3547
3580
  if (t.enableRotate === !1)
3548
3581
  return;
@@ -3556,54 +3589,54 @@ class yi extends dn {
3556
3589
  case i.PAN:
3557
3590
  if (t.enablePan === !1)
3558
3591
  return;
3559
- Ye(s);
3592
+ He(s);
3560
3593
  break;
3561
3594
  }
3562
3595
  }
3563
3596
  function mt(s) {
3564
- t.enabled === !1 || t.enableZoom === !1 || o !== i.NONE || (s.preventDefault(), t.dispatchEvent(jt), Ge(pt(s)), t.dispatchEvent(cn));
3597
+ t.enabled === !1 || t.enableZoom === !1 || c !== i.NONE || (s.preventDefault(), t.dispatchEvent(At), Ye(pt(s)), t.dispatchEvent(ln));
3565
3598
  }
3566
3599
  function pt(s) {
3567
- const y = s.deltaMode, T = {
3600
+ const y = s.deltaMode, _ = {
3568
3601
  clientX: s.clientX,
3569
3602
  clientY: s.clientY,
3570
3603
  deltaY: s.deltaY
3571
3604
  };
3572
3605
  switch (y) {
3573
3606
  case 1:
3574
- T.deltaY *= 16;
3607
+ _.deltaY *= 16;
3575
3608
  break;
3576
3609
  case 2:
3577
- T.deltaY *= 100;
3610
+ _.deltaY *= 100;
3578
3611
  break;
3579
3612
  }
3580
- return s.ctrlKey && !le && (T.deltaY *= 10), T;
3613
+ return s.ctrlKey && !ce && (_.deltaY *= 10), _;
3581
3614
  }
3582
3615
  function st(s) {
3583
- s.key === "Control" && (le = !0, t.domElement.getRootNode().addEventListener("keyup", Ue, { passive: !0, capture: !0 }));
3616
+ s.key === "Control" && (ce = !0, t.domElement.getRootNode().addEventListener("keyup", Ue, { passive: !0, capture: !0 }));
3584
3617
  }
3585
3618
  function Ue(s) {
3586
- s.key === "Control" && (le = !1, t.domElement.getRootNode().removeEventListener("keyup", Ue, { passive: !0, capture: !0 }));
3619
+ s.key === "Control" && (ce = !1, t.domElement.getRootNode().removeEventListener("keyup", Ue, { passive: !0, capture: !0 }));
3587
3620
  }
3588
3621
  function ot(s) {
3589
3622
  t.enabled === !1 || t.enablePan === !1 || ue(s);
3590
3623
  }
3591
3624
  function ct(s) {
3592
- switch (vt(s), V.length) {
3625
+ switch (vt(s), z.length) {
3593
3626
  case 1:
3594
3627
  switch (t.touches.ONE) {
3595
3628
  case at.ROTATE:
3596
3629
  if (t.enableRotate === !1)
3597
3630
  return;
3598
- g(s), o = i.TOUCH_ROTATE;
3631
+ g(s), c = i.TOUCH_ROTATE;
3599
3632
  break;
3600
3633
  case at.PAN:
3601
3634
  if (t.enablePan === !1)
3602
3635
  return;
3603
- v(s), o = i.TOUCH_PAN;
3636
+ v(s), c = i.TOUCH_PAN;
3604
3637
  break;
3605
3638
  default:
3606
- o = i.NONE;
3639
+ c = i.NONE;
3607
3640
  }
3608
3641
  break;
3609
3642
  case 2:
@@ -3611,65 +3644,65 @@ class yi extends dn {
3611
3644
  case at.DOLLY_PAN:
3612
3645
  if (t.enableZoom === !1 && t.enablePan === !1)
3613
3646
  return;
3614
- k(s), o = i.TOUCH_DOLLY_PAN;
3647
+ P(s), c = i.TOUCH_DOLLY_PAN;
3615
3648
  break;
3616
3649
  case at.DOLLY_ROTATE:
3617
3650
  if (t.enableZoom === !1 && t.enableRotate === !1)
3618
3651
  return;
3619
- ge(s), o = i.TOUCH_DOLLY_ROTATE;
3652
+ ge(s), c = i.TOUCH_DOLLY_ROTATE;
3620
3653
  break;
3621
3654
  default:
3622
- o = i.NONE;
3655
+ c = i.NONE;
3623
3656
  }
3624
3657
  break;
3625
3658
  default:
3626
- o = i.NONE;
3659
+ c = i.NONE;
3627
3660
  }
3628
- o !== i.NONE && t.dispatchEvent(jt);
3661
+ c !== i.NONE && t.dispatchEvent(At);
3629
3662
  }
3630
3663
  function gt(s) {
3631
- switch (vt(s), o) {
3664
+ switch (vt(s), c) {
3632
3665
  case i.TOUCH_ROTATE:
3633
3666
  if (t.enableRotate === !1)
3634
3667
  return;
3635
- _(s), t.update();
3668
+ le(s), t.update();
3636
3669
  break;
3637
3670
  case i.TOUCH_PAN:
3638
3671
  if (t.enablePan === !1)
3639
3672
  return;
3640
- E(s), t.update();
3673
+ C(s), t.update();
3641
3674
  break;
3642
3675
  case i.TOUCH_DOLLY_PAN:
3643
3676
  if (t.enableZoom === !1 && t.enablePan === !1)
3644
3677
  return;
3645
- G(s), t.update();
3678
+ F(s), t.update();
3646
3679
  break;
3647
3680
  case i.TOUCH_DOLLY_ROTATE:
3648
3681
  if (t.enableZoom === !1 && t.enableRotate === !1)
3649
3682
  return;
3650
- se(s), t.update();
3683
+ J(s), t.update();
3651
3684
  break;
3652
3685
  default:
3653
- o = i.NONE;
3686
+ c = i.NONE;
3654
3687
  }
3655
3688
  }
3656
3689
  function Qe(s) {
3657
3690
  t.enabled !== !1 && s.preventDefault();
3658
3691
  }
3659
- function Tt(s) {
3660
- V.push(s.pointerId);
3692
+ function _t(s) {
3693
+ z.push(s.pointerId);
3661
3694
  }
3662
3695
  function Rt(s) {
3663
3696
  delete pe[s.pointerId];
3664
- for (let y = 0; y < V.length; y++)
3665
- if (V[y] == s.pointerId) {
3666
- V.splice(y, 1);
3697
+ for (let y = 0; y < z.length; y++)
3698
+ if (z[y] == s.pointerId) {
3699
+ z.splice(y, 1);
3667
3700
  return;
3668
3701
  }
3669
3702
  }
3670
- function At(s) {
3671
- for (let y = 0; y < V.length; y++)
3672
- if (V[y] == s.pointerId)
3703
+ function Pt(s) {
3704
+ for (let y = 0; y < z.length; y++)
3705
+ if (z[y] == s.pointerId)
3673
3706
  return !0;
3674
3707
  return !1;
3675
3708
  }
@@ -3678,27 +3711,27 @@ class yi extends dn {
3678
3711
  y === void 0 && (y = new fe(), pe[s.pointerId] = y), y.set(s.pageX, s.pageY);
3679
3712
  }
3680
3713
  function $e(s) {
3681
- const y = s.pointerId === V[0] ? V[1] : V[0];
3714
+ const y = s.pointerId === z[0] ? z[1] : z[0];
3682
3715
  return pe[y];
3683
3716
  }
3684
- t.domElement.addEventListener("contextmenu", Qe), t.domElement.addEventListener("pointerdown", M), t.domElement.addEventListener("pointercancel", W), t.domElement.addEventListener("wheel", mt, { passive: !1 }), t.domElement.getRootNode().addEventListener("keydown", st, { passive: !0, capture: !0 }), this.update();
3717
+ t.domElement.addEventListener("contextmenu", Qe), t.domElement.addEventListener("pointerdown", O), t.domElement.addEventListener("pointercancel", G), t.domElement.addEventListener("wheel", mt, { passive: !1 }), t.domElement.getRootNode().addEventListener("keydown", st, { passive: !0, capture: !0 }), this.update();
3685
3718
  }
3686
3719
  }
3687
3720
  function rt(e, n, a, t, i) {
3688
3721
  return t + (e - n) * (i - t) / (a - n);
3689
3722
  }
3690
3723
  const wt = (e) => {
3691
- const [n, a] = K(e.options[e.index]), t = () => {
3724
+ const [n, a] = Z(e.options[e.index]), t = () => {
3692
3725
  e.onToggle(!e.open);
3693
- }, i = (o) => {
3694
- o !== n && (e.onSelect(o), a(o)), e.onToggle(!1);
3726
+ }, i = (c) => {
3727
+ c !== n && (e.onSelect(c), a(c)), e.onToggle(!1);
3695
3728
  };
3696
3729
  return /* @__PURE__ */ l.jsxs("div", { className: `dropdown ${e.up === !0 ? "up" : ""}`, children: [
3697
3730
  /* @__PURE__ */ l.jsx("div", { className: "dropdown-toggle", onClick: t, children: n }),
3698
- e.open && /* @__PURE__ */ l.jsx("ul", { className: "dropdown-menu", children: e.options.map((o) => /* @__PURE__ */ l.jsx("li", { onClick: () => i(o), children: o }, o)) })
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)) })
3699
3732
  ] });
3700
- }, qe = Oa(function(n, a) {
3701
- const [t, i] = K(!1), o = n.options.indexOf(n.camera.name);
3733
+ }, qe = Ta(function(n, a) {
3734
+ const [t, i] = Z(!1), c = n.options.indexOf(n.camera.name);
3702
3735
  return /* @__PURE__ */ l.jsxs("div", { className: "CameraWindow", children: [
3703
3736
  /* @__PURE__ */ l.jsx("div", { ref: a, className: "clickable", onClick: () => {
3704
3737
  t && i(!1);
@@ -3706,7 +3739,7 @@ const wt = (e) => {
3706
3739
  /* @__PURE__ */ l.jsx(
3707
3740
  wt,
3708
3741
  {
3709
- index: o,
3742
+ index: c,
3710
3743
  open: t,
3711
3744
  options: n.options,
3712
3745
  onSelect: n.onSelect,
@@ -3718,15 +3751,15 @@ const wt = (e) => {
3718
3751
  )
3719
3752
  ] });
3720
3753
  });
3721
- class xi extends kn {
3754
+ class Ei extends jn {
3722
3755
  constructor(n) {
3723
3756
  super({
3724
3757
  extensions: {
3725
3758
  // @ts-ignore
3726
3759
  derivatives: !0
3727
3760
  },
3728
- glslVersion: da,
3729
- side: mn,
3761
+ glslVersion: ha,
3762
+ side: pn,
3730
3763
  transparent: !0,
3731
3764
  uniforms: {
3732
3765
  uScale: {
@@ -3831,17 +3864,17 @@ class xi extends kn {
3831
3864
  });
3832
3865
  }
3833
3866
  }
3834
- class Ei extends Rn {
3867
+ class Ci extends Pn {
3835
3868
  gridMaterial;
3836
3869
  constructor() {
3837
- const n = new xi();
3838
- super(new ha(2, 2), n), this.gridMaterial = n, this.frustumCulled = !1, this.name = "InfiniteGridHelper", this.position.y = 0.1;
3870
+ const n = new Ei();
3871
+ super(new fa(2, 2), n), this.gridMaterial = n, this.frustumCulled = !1, this.name = "InfiniteGridHelper", this.position.y = 0.1;
3839
3872
  }
3840
3873
  update() {
3841
3874
  this.gridMaterial.needsUpdate = !0;
3842
3875
  }
3843
3876
  }
3844
- const Ci = `#include <common>
3877
+ const Si = `#include <common>
3845
3878
  #include <batching_pars_vertex>
3846
3879
  #include <uv_pars_vertex>
3847
3880
  #include <color_pars_vertex>
@@ -3871,7 +3904,7 @@ void main() {
3871
3904
  #include <logdepthbuf_vertex>
3872
3905
  #include <clipping_planes_vertex>
3873
3906
  #include <worldpos_vertex>
3874
- }`, Si = `
3907
+ }`, wi = `
3875
3908
  #include <common>
3876
3909
  #include <uv_pars_fragment>
3877
3910
  #include <clipping_planes_pars_fragment>
@@ -3880,27 +3913,27 @@ void main() {
3880
3913
  #include <clipping_planes_fragment>
3881
3914
  gl_FragColor = vec4(vec3(vUv, 0.0), 1.0);
3882
3915
  }`;
3883
- class wi extends kn {
3916
+ class Mi extends jn {
3884
3917
  constructor() {
3885
3918
  super({
3886
3919
  defines: {
3887
3920
  USE_UV: ""
3888
3921
  },
3889
- vertexShader: Ci,
3890
- fragmentShader: Si
3922
+ vertexShader: Si,
3923
+ fragmentShader: wi
3891
3924
  });
3892
3925
  }
3893
3926
  }
3894
- let Ct = "Renderer", Le, St = !1, un = !1, z = null, ce = null, ze = null, He = null;
3895
- function Ui(e) {
3896
- 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", o = localStorage.getItem(`${n}_blCam`) !== null ? localStorage.getItem(`${n}_blCam`) : "Front", u = localStorage.getItem(`${n}_brCam`) !== null ? localStorage.getItem(`${n}_brCam`) : "Top", c = ie(() => /* @__PURE__ */ new Map(), []), h = ie(() => /* @__PURE__ */ new Map(), []), d = ie(() => /* @__PURE__ */ new Map(), []), f = ie(() => /* @__PURE__ */ new Map(), []), m = ie(() => new fa(), []), x = ie(() => new ma(), []), O = ie(() => new Ei(), []), H = ie(() => new Kt(500), []), te = ie(() => new Kt(100), []), me = ie(() => new pa(), []), re = ie(() => new ga(), []), $ = ie(() => new wi(), []), D = ie(() => new An({
3927
+ let Ct = "Renderer", je, St = !1, dn = !1, H = null, oe = null, Ge = null, We = null;
3928
+ function $i(e) {
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({
3897
3930
  opacity: 0.33,
3898
3931
  transparent: !0,
3899
3932
  wireframe: !0
3900
3933
  }), []);
3901
- function Z(g, v) {
3902
- const w = new Xt(-100, 100, 100, -100, 50, 3e3);
3903
- return w.name = g, w.position.copy(v), w.lookAt(0, 0, 0), c.set(g, w), w;
3934
+ function q(g, v) {
3935
+ const M = new Xt(-100, 100, 100, -100, 50, 5e3);
3936
+ return M.name = g, M.position.copy(v), M.lookAt(0, 0, 0), o.set(g, M), M;
3904
3937
  }
3905
3938
  const ne = [
3906
3939
  "Renderer",
@@ -3913,266 +3946,270 @@ function Ui(e) {
3913
3946
  "Side by Side",
3914
3947
  "Stacked",
3915
3948
  "Quad"
3916
- ], V = X(null), pe = X(null), le = X(null), _e = X(null), Te = X(null), ve = X(null), [I, be] = K(a !== null ? a : "Single"), [S, we] = K(null), [Re, je] = K(!1), [Ae, ke] = K(!1), [De, Fe] = K(!1), [, Be] = K(Date.now());
3917
- localStorage.setItem(`${n}_mode`, I), localStorage.setItem(`${n}_tlCam`, t), localStorage.setItem(`${n}_trCam`, i), localStorage.setItem(`${n}_blCam`, o), localStorage.setItem(`${n}_brCam`, u);
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());
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);
3918
3951
  const ae = (g, v) => {
3919
- const w = h.get(g.name);
3920
- w !== void 0 && w.dispose(), h.delete(g.name);
3921
- const k = new yi(g, v);
3922
- switch (k.enableDamping = !0, k.dampingFactor = 0.05, g.name) {
3952
+ const M = d.get(g.name);
3953
+ if (M !== void 0 && M.dispose(), d.delete(g.name), g.name === "UI")
3954
+ return;
3955
+ const P = new xi(g, v);
3956
+ switch (P.enableDamping = !0, P.dampingFactor = 0.05, g.name) {
3923
3957
  case "Top":
3924
3958
  case "Bottom":
3925
3959
  case "Left":
3926
3960
  case "Right":
3927
3961
  case "Front":
3928
3962
  case "Back":
3929
- k.enableRotate = !1;
3963
+ P.enableRotate = !1;
3930
3964
  break;
3931
3965
  }
3932
- h.set(g.name, k);
3966
+ d.set(g.name, P);
3933
3967
  }, Me = (g) => {
3934
- const v = d.get(g.name);
3935
- v !== void 0 && (m.remove(v), v.dispose(), d.delete(g.name));
3936
- const w = h.get(g.name);
3937
- w !== void 0 && (w.dispose(), h.delete(g.name));
3938
- }, Ye = () => {
3939
- h.forEach((g, v) => {
3968
+ const v = h.get(g.name);
3969
+ v !== void 0 && (m.remove(v), v.dispose(), h.delete(g.name));
3970
+ const M = d.get(g.name);
3971
+ M !== void 0 && (M.dispose(), d.delete(g.name));
3972
+ }, He = () => {
3973
+ d.forEach((g, v) => {
3940
3974
  g.dispose();
3941
- const w = d.get(v);
3942
- w !== void 0 && (m.remove(w), w.dispose()), d.delete(v), h.delete(v);
3943
- }), h.clear(), d.clear();
3944
- }, Ge = () => {
3945
- switch (I) {
3975
+ const M = h.get(v);
3976
+ M !== void 0 && (m.remove(M), M.dispose()), h.delete(v), d.delete(v);
3977
+ }), d.clear(), h.clear();
3978
+ }, Ye = () => {
3979
+ switch (N) {
3946
3980
  case "Single":
3947
- ae(z, le.current);
3981
+ ae(H, ce.current);
3948
3982
  break;
3949
3983
  case "Side by Side":
3950
3984
  case "Stacked":
3951
- ae(z, le.current), ae(ce, _e.current);
3985
+ ae(H, ce.current), ae(oe, Te.current);
3952
3986
  break;
3953
3987
  case "Quad":
3954
- ae(z, le.current), ae(ce, _e.current), ae(ze, Te.current), ae(He, ve.current);
3988
+ ae(H, ce.current), ae(oe, Te.current), ae(Ge, _e.current), ae(We, ve.current);
3955
3989
  break;
3956
3990
  }
3957
3991
  };
3958
- Pe(() => {
3959
- const g = new va({
3960
- canvas: V.current,
3992
+ Ae(() => {
3993
+ const g = new ba({
3994
+ canvas: z.current,
3961
3995
  stencil: !1
3962
3996
  });
3963
3997
  g.autoClear = !1, g.shadowMap.enabled = !0, g.setPixelRatio(devicePixelRatio), g.setClearColor(0), e.three.renderer = g, we(g);
3964
- }, []), Pe(() => {
3965
- m.name = "Debug Scene", m.uuid = "", x.name = "helpers", m.add(x), x.add(O), H.name = "axisHelper", x.add(H), te.name = "interactionHelper", x.add(te), te.visible = !1, Z("Top", new Y(0, 1e3, 0)), Z("Bottom", new Y(0, -1e3, 0)), Z("Left", new Y(-1e3, 0, 0)), Z("Right", new Y(1e3, 0, 0)), Z("Front", new Y(0, 0, 1e3)), Z("Back", new Y(0, 0, -1e3)), Z("Orthographic", new Y(1e3, 1e3, 1e3));
3966
- const g = new kt(60, 1, 50, 3e3);
3967
- g.name = "Debug", g.position.set(500, 500, 500), g.lookAt(0, 0, 0), c.set("Debug", g), z = c.get(localStorage.getItem(`${n}_tlCam`)), ce = c.get(localStorage.getItem(`${n}_trCam`)), ze = c.get(localStorage.getItem(`${n}_blCam`)), He = c.get(localStorage.getItem(`${n}_brCam`));
3968
- }, []), Pe(() => {
3998
+ }, []), Ae(() => {
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());
4000
+ const g = new kt(60, 1, 50, 5e3);
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`));
4002
+ }, []), Ae(() => {
3969
4003
  const g = () => {
3970
- f.forEach((_) => {
3971
- x.remove(_), _.dispose();
4004
+ f.forEach((C) => {
4005
+ x.remove(C), C.dispose();
3972
4006
  }), f.clear();
3973
4007
  }, v = () => {
3974
- Le.traverse((_) => {
3975
- if (_.type.search("Light") > -1) {
4008
+ je.traverse((C) => {
4009
+ if (C.type.search("Light") > -1) {
3976
4010
  let E;
3977
- switch (_.type) {
4011
+ switch (C.type) {
3978
4012
  case "DirectionalLight":
3979
- E = new Sa(_, 100), E.name = `${_.name}Helper`, f.set(_.name, E), x.add(E);
4013
+ E = new wa(C, 100), E.name = `${C.name}Helper`, f.set(C.name, E), x.add(E);
3980
4014
  break;
3981
4015
  case "HemisphereLight":
3982
- E = new Ca(_, 250), E.name = `${_.name}Helper`, f.set(_.name, E), x.add(E);
4016
+ E = new Sa(C, 250), E.name = `${C.name}Helper`, f.set(C.name, E), x.add(E);
3983
4017
  break;
3984
4018
  case "RectAreaLight":
3985
- E = new vi(_), E.name = `${_.name}Helper`, f.set(_.name, E), x.add(E);
4019
+ E = new bi(C), E.name = `${C.name}Helper`, f.set(C.name, E), x.add(E);
3986
4020
  break;
3987
4021
  case "PointLight":
3988
- E = new Ea(_, 100), E.name = `${_.name}Helper`, f.set(_.name, E), x.add(E);
4022
+ E = new Ca(C, 100), E.name = `${C.name}Helper`, f.set(C.name, E), x.add(E);
3989
4023
  break;
3990
4024
  case "SpotLight":
3991
- E = new xa(_), E.name = `${_.name}Helper`, f.set(_.name, E), x.add(E);
4025
+ E = new Ea(C), E.name = `${C.name}Helper`, f.set(C.name, E), x.add(E);
3992
4026
  break;
3993
4027
  }
3994
4028
  }
3995
4029
  });
3996
- }, w = (_) => {
3997
- g(), In(Le), m.remove(Le);
3998
- const E = e.scenes.get(_.value.name);
4030
+ }, M = (C) => {
4031
+ x.add(W), g(), Ft(je), m.remove(je);
4032
+ const E = e.scenes.get(C.value.name);
3999
4033
  if (E !== void 0) {
4000
- const A = new E();
4001
- e.onSceneSet !== void 0 && e.onSceneSet(A), Le = A, e.three.scene = Le, m.add(Le), un = !0, v();
4034
+ const F = new E();
4035
+ e.onSceneSet !== void 0 && e.onSceneSet(F), je = F, e.three.scene = je, m.add(je), dn = !0, v();
4002
4036
  }
4003
- }, k = (_) => {
4004
- const E = _.value, A = e.three.scene?.getObjectByProperty("uuid", E.uuid);
4005
- if (A !== void 0 && c.set(E.name, A), A instanceof kt) {
4006
- const G = new ya(A);
4007
- d.set(A.name, G), m.add(G);
4037
+ }, P = (C) => {
4038
+ const E = C.value, F = e.three.scene?.getObjectByProperty("uuid", E.uuid);
4039
+ if (F !== void 0 && o.set(E.name, F), F instanceof kt) {
4040
+ const J = new xa(F);
4041
+ h.set(F.name, J), m.add(J);
4008
4042
  }
4009
- Be(Date.now());
4010
- }, ge = (_) => {
4011
- const E = d.get(_.value.name);
4012
- E !== void 0 && (m.remove(E), E.dispose()), c.delete(_.value.name), Be(Date.now());
4043
+ Fe(Date.now());
4044
+ }, ge = (C) => {
4045
+ const E = h.get(C.value.name);
4046
+ E !== void 0 && (m.remove(E), E.dispose()), o.delete(C.value.name), Fe(Date.now());
4047
+ }, le = (C) => {
4048
+ const E = je.getObjectByProperty("uuid", C.value.uuid);
4049
+ E && E.add(W);
4013
4050
  };
4014
- return N.addEventListener(L.SET_SCENE, w), N.addEventListener(L.ADD_CAMERA, k), N.addEventListener(L.REMOVE_CAMERA, ge), () => {
4015
- N.removeEventListener(L.SET_SCENE, w), N.removeEventListener(L.ADD_CAMERA, k), N.removeEventListener(L.REMOVE_CAMERA, ge);
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), () => {
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);
4016
4053
  };
4017
- }, []), Pe(() => {
4018
- if (S === null)
4054
+ }, []), Ae(() => {
4055
+ if (w === null)
4019
4056
  return;
4020
- let g = window.innerWidth, v = window.innerHeight, w = Math.floor(g / 2), k = Math.floor(v / 2), ge = -1;
4021
- const _ = () => {
4022
- g = window.innerWidth - 300, v = window.innerHeight, w = Math.floor(g / 2), k = Math.floor(v / 2), S.setSize(g, v);
4023
- let M = g, B = v;
4024
- switch (I) {
4057
+ let g = window.innerWidth, v = window.innerHeight, M = Math.floor(g / 2), P = Math.floor(v / 2), ge = -1;
4058
+ const le = () => {
4059
+ g = window.innerWidth - 300, v = window.innerHeight, M = Math.floor(g / 2), P = Math.floor(v / 2), w.setSize(g, v);
4060
+ let O = g, B = v;
4061
+ switch (N) {
4025
4062
  case "Side by Side":
4026
- M = w, B = v;
4063
+ O = M, B = v;
4027
4064
  break;
4028
4065
  case "Stacked":
4029
- M = g, B = k;
4066
+ O = g, B = P;
4030
4067
  break;
4031
4068
  case "Quad":
4032
- M = w, B = k;
4069
+ O = M, B = P;
4033
4070
  break;
4034
4071
  }
4035
- c.forEach((W) => {
4036
- W instanceof Xt ? (W.left = M / -2, W.right = M / 2, W.top = B / 2, W.bottom = B / -2, W.updateProjectionMatrix()) : W instanceof kt && (W.aspect = M / B, W.updateProjectionMatrix(), d.get(W.name)?.update());
4072
+ o.forEach((G) => {
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());
4037
4074
  });
4075
+ }, C = () => {
4076
+ w.setViewport(0, 0, g, v), w.setScissor(0, 0, g, v), w.render(m, H);
4038
4077
  }, E = () => {
4039
- S.setViewport(0, 0, g, v), S.setScissor(0, 0, g, v), S.render(m, z);
4040
- }, A = () => {
4041
- if (I === "Side by Side")
4042
- S.setViewport(0, 0, w, v), S.setScissor(0, 0, w, v), S.render(m, z), S.setViewport(w, 0, w, v), S.setScissor(w, 0, w, v), S.render(m, ce);
4078
+ if (N === "Side by Side")
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);
4043
4080
  else {
4044
- const M = v - k;
4045
- S.setViewport(0, M, g, k), S.setScissor(0, M, g, k), S.render(m, z), S.setViewport(0, 0, g, k), S.setScissor(0, 0, g, k), S.render(m, ce);
4081
+ const O = v - P;
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);
4046
4083
  }
4047
- }, G = () => {
4048
- let M = 0, B = 0;
4049
- B = v - k, M = 0, S.setViewport(M, B, w, k), S.setScissor(M, B, w, k), S.render(m, z), M = w, S.setViewport(M, B, w, k), S.setScissor(M, B, w, k), S.render(m, ce), B = 0, M = 0, S.setViewport(M, B, w, k), S.setScissor(M, B, w, k), S.render(m, ze), M = w, S.setViewport(M, B, w, k), S.setScissor(M, B, w, k), S.render(m, He);
4050
- }, se = () => {
4051
- switch (h.forEach((M) => {
4052
- M.update();
4053
- }), d.forEach((M) => {
4054
- M.update();
4055
- }), f.forEach((M) => {
4056
- M.update !== void 0 && M.update();
4057
- }), e.onSceneUpdate !== void 0 && un && e.onSceneUpdate(Le), S.clear(), I) {
4084
+ }, F = () => {
4085
+ let O = 0, B = 0;
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 = () => {
4088
+ switch (d.forEach((O) => {
4089
+ O.update();
4090
+ }), h.forEach((O) => {
4091
+ O.update();
4092
+ }), f.forEach((O) => {
4093
+ O.update !== void 0 && O.update();
4094
+ }), e.onSceneUpdate !== void 0 && dn && e.onSceneUpdate(je), w.clear(), N) {
4058
4095
  case "Single":
4059
- E();
4096
+ C();
4060
4097
  break;
4061
4098
  case "Side by Side":
4062
4099
  case "Stacked":
4063
- A();
4100
+ E();
4064
4101
  break;
4065
4102
  case "Quad":
4066
- G();
4103
+ F();
4067
4104
  break;
4068
4105
  }
4069
- ge = requestAnimationFrame(se);
4106
+ ge = requestAnimationFrame(J);
4070
4107
  };
4071
- return Ge(), window.addEventListener("resize", _), _(), se(), () => {
4072
- window.removeEventListener("resize", _), cancelAnimationFrame(ge), ge = -1;
4108
+ return Ye(), window.addEventListener("resize", le), le(), J(), () => {
4109
+ window.removeEventListener("resize", le), cancelAnimationFrame(ge), ge = -1;
4073
4110
  };
4074
- }, [I, S]), Pe(() => {
4075
- if (S !== null) {
4076
- const g = new ba(), v = new fe(), w = (E, A, G, se) => {
4077
- switch (I) {
4111
+ }, [N, w]), Ae(() => {
4112
+ if (w !== null) {
4113
+ const g = new ya(), v = new fe(), M = (C, E, F, J) => {
4114
+ switch (N) {
4078
4115
  case "Quad":
4079
- E < G ? A < se ? g.setFromCamera(v, z) : g.setFromCamera(v, ze) : A < se ? g.setFromCamera(v, ce) : g.setFromCamera(v, He);
4116
+ C < F ? E < J ? g.setFromCamera(v, H) : g.setFromCamera(v, Ge) : E < J ? g.setFromCamera(v, oe) : g.setFromCamera(v, We);
4080
4117
  break;
4081
4118
  case "Side by Side":
4082
- E < G ? g.setFromCamera(v, z) : g.setFromCamera(v, ce);
4119
+ C < F ? g.setFromCamera(v, H) : g.setFromCamera(v, oe);
4083
4120
  break;
4084
4121
  case "Single":
4085
- g.setFromCamera(v, z);
4122
+ g.setFromCamera(v, H);
4086
4123
  break;
4087
4124
  case "Stacked":
4088
- A < se ? g.setFromCamera(v, z) : g.setFromCamera(v, ce);
4125
+ E < J ? g.setFromCamera(v, H) : g.setFromCamera(v, oe);
4089
4126
  break;
4090
4127
  }
4091
- }, k = (E) => {
4128
+ }, P = (C) => {
4092
4129
  if (!St)
4093
4130
  return;
4094
- const A = new fe();
4095
- S.getSize(A);
4096
- const G = Math.min(E.clientX, A.x), se = Math.min(E.clientY, A.y);
4097
- v.x = rt(G, 0, A.x, -1, 1), v.y = rt(se, 0, A.y, 1, -1);
4098
- const M = A.x / 2, B = A.y / 2, W = () => {
4099
- G < M ? v.x = rt(G, 0, M, -1, 1) : v.x = rt(G, M, A.x, -1, 1);
4100
- }, Ie = () => {
4101
- se < B ? v.y = rt(se, 0, B, 1, -1) : v.y = rt(se, B, A.y, 1, -1);
4131
+ const E = new fe();
4132
+ w.getSize(E);
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);
4135
+ const O = E.x / 2, B = E.y / 2, G = () => {
4136
+ F < O ? v.x = rt(F, 0, O, -1, 1) : v.x = rt(F, O, E.x, -1, 1);
4137
+ }, Ne = () => {
4138
+ J < B ? v.y = rt(J, 0, B, 1, -1) : v.y = rt(J, B, E.y, 1, -1);
4102
4139
  };
4103
- switch (I) {
4140
+ switch (N) {
4104
4141
  case "Quad":
4105
- W(), Ie();
4142
+ G(), Ne();
4106
4143
  break;
4107
4144
  case "Side by Side":
4108
- W();
4145
+ G();
4109
4146
  break;
4110
4147
  case "Stacked":
4111
- Ie(), Ie();
4148
+ Ne(), Ne();
4112
4149
  break;
4113
4150
  }
4114
- w(G, se, M, B);
4115
- const Je = g.intersectObjects(Le.children);
4151
+ M(F, J, O, B);
4152
+ const Je = g.intersectObjects(je.children);
4116
4153
  Je.length > 0 && te.position.copy(Je[0].point);
4117
- }, ge = (E) => {
4154
+ }, ge = (C) => {
4118
4155
  if (!St)
4119
4156
  return;
4120
- const A = new fe();
4121
- if (S.getSize(A), E.clientX >= A.x)
4157
+ const E = new fe();
4158
+ if (w.getSize(E), C.clientX >= E.x)
4122
4159
  return;
4123
- k(E);
4124
- const G = g.intersectObjects(Le.children);
4125
- G.length > 0 && e.three.getObject(G[0].object.uuid);
4126
- }, _ = pe.current;
4127
- return _.addEventListener("mousemove", k, !1), _.addEventListener("click", ge, !1), () => {
4128
- _.removeEventListener("mousemove", k), _.removeEventListener("click", ge);
4160
+ P(C);
4161
+ const F = g.intersectObjects(je.children);
4162
+ F.length > 0 && e.three.getObject(F[0].object.uuid);
4163
+ }, le = pe.current;
4164
+ return le.addEventListener("mousemove", P, !1), le.addEventListener("click", ge, !1), () => {
4165
+ le.removeEventListener("mousemove", P), le.removeEventListener("click", ge);
4129
4166
  };
4130
4167
  }
4131
- }, [I, S]);
4168
+ }, [N, w]);
4132
4169
  const ue = [];
4133
- return c.forEach((g, v) => {
4170
+ return o.forEach((g, v) => {
4134
4171
  ue.push(v);
4135
4172
  }), /* @__PURE__ */ l.jsxs("div", { className: "multiview", children: [
4136
- /* @__PURE__ */ l.jsx("canvas", { ref: V }),
4137
- S !== null && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
4138
- /* @__PURE__ */ l.jsxs("div", { className: `cameras ${I === "Single" || I === "Stacked" ? "single" : ""}`, ref: pe, children: [
4139
- I === "Single" && /* @__PURE__ */ l.jsx(l.Fragment, { children: /* @__PURE__ */ l.jsx(qe, { camera: z, options: ue, ref: le, onSelect: (g) => {
4140
- h.get(z.name)?.dispose();
4141
- const v = c.get(g);
4142
- v !== void 0 && (Me(z), z = v, localStorage.setItem(`${n}_tlCam`, v.name), ae(v, le.current));
4173
+ /* @__PURE__ */ l.jsx("canvas", { ref: z }),
4174
+ w !== null && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
4175
+ /* @__PURE__ */ l.jsxs("div", { className: `cameras ${N === "Single" || N === "Stacked" ? "single" : ""}`, ref: pe, children: [
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();
4178
+ const v = o.get(g);
4179
+ v !== void 0 && (Me(H), H = v, localStorage.setItem(`${n}_tlCam`, v.name), ae(v, ce.current));
4143
4180
  } }) }),
4144
- (I === "Side by Side" || I === "Stacked") && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
4145
- /* @__PURE__ */ l.jsx(qe, { camera: z, options: ue, ref: le, onSelect: (g) => {
4146
- h.get(z.name)?.dispose();
4147
- const v = c.get(g);
4148
- v !== void 0 && (Me(z), z = v, localStorage.setItem(`${n}_tlCam`, v.name), ae(v, le.current));
4181
+ (N === "Side by Side" || N === "Stacked") && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
4182
+ /* @__PURE__ */ l.jsx(qe, { camera: H, options: ue, ref: ce, onSelect: (g) => {
4183
+ d.get(H.name)?.dispose();
4184
+ const v = o.get(g);
4185
+ v !== void 0 && (Me(H), H = v, localStorage.setItem(`${n}_tlCam`, v.name), ae(v, ce.current));
4149
4186
  } }),
4150
- /* @__PURE__ */ l.jsx(qe, { camera: ce, options: ue, ref: _e, onSelect: (g) => {
4151
- h.get(ce.name)?.dispose();
4152
- const v = c.get(g);
4153
- v !== void 0 && (Me(ce), ce = v, localStorage.setItem(`${n}_trCam`, v.name), ae(v, _e.current));
4187
+ /* @__PURE__ */ l.jsx(qe, { camera: oe, options: ue, ref: Te, onSelect: (g) => {
4188
+ d.get(oe.name)?.dispose();
4189
+ const v = o.get(g);
4190
+ v !== void 0 && (Me(oe), oe = v, localStorage.setItem(`${n}_trCam`, v.name), ae(v, Te.current));
4154
4191
  } })
4155
4192
  ] }),
4156
- I === "Quad" && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
4157
- /* @__PURE__ */ l.jsx(qe, { camera: z, options: ue, ref: le, onSelect: (g) => {
4158
- h.get(z.name)?.dispose();
4159
- const v = c.get(g);
4160
- v !== void 0 && (Me(z), z = v, localStorage.setItem(`${n}_tlCam`, v.name), ae(v, le.current));
4193
+ N === "Quad" && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
4194
+ /* @__PURE__ */ l.jsx(qe, { camera: H, options: ue, ref: ce, onSelect: (g) => {
4195
+ d.get(H.name)?.dispose();
4196
+ const v = o.get(g);
4197
+ v !== void 0 && (Me(H), H = v, localStorage.setItem(`${n}_tlCam`, v.name), ae(v, ce.current));
4161
4198
  } }),
4162
- /* @__PURE__ */ l.jsx(qe, { camera: ce, options: ue, ref: _e, onSelect: (g) => {
4163
- h.get(ce.name)?.dispose();
4164
- const v = c.get(g);
4165
- v !== void 0 && (Me(ce), ce = v, localStorage.setItem(`${n}_trCam`, v.name), ae(v, _e.current));
4199
+ /* @__PURE__ */ l.jsx(qe, { camera: oe, options: ue, ref: Te, onSelect: (g) => {
4200
+ d.get(oe.name)?.dispose();
4201
+ const v = o.get(g);
4202
+ v !== void 0 && (Me(oe), oe = v, localStorage.setItem(`${n}_trCam`, v.name), ae(v, Te.current));
4166
4203
  } }),
4167
- /* @__PURE__ */ l.jsx(qe, { camera: ze, options: ue, ref: Te, onSelect: (g) => {
4168
- h.get(ze.name)?.dispose();
4169
- const v = c.get(g);
4170
- v !== void 0 && (Me(ze), ze = v, localStorage.setItem(`${n}_blCam`, v.name), ae(v, Te.current));
4204
+ /* @__PURE__ */ l.jsx(qe, { camera: Ge, options: ue, ref: _e, onSelect: (g) => {
4205
+ d.get(Ge.name)?.dispose();
4206
+ const v = o.get(g);
4207
+ v !== void 0 && (Me(Ge), Ge = v, localStorage.setItem(`${n}_blCam`, v.name), ae(v, _e.current));
4171
4208
  } }),
4172
- /* @__PURE__ */ l.jsx(qe, { camera: He, options: ue, ref: ve, onSelect: (g) => {
4173
- h.get(He.name)?.dispose();
4174
- const v = c.get(g);
4175
- v !== void 0 && (Me(He), He = v, localStorage.setItem(`${n}_brCam`, v.name), ae(v, ve.current));
4209
+ /* @__PURE__ */ l.jsx(qe, { camera: We, options: ue, ref: ve, onSelect: (g) => {
4210
+ d.get(We.name)?.dispose();
4211
+ const v = o.get(g);
4212
+ v !== void 0 && (Me(We), We = v, localStorage.setItem(`${n}_brCam`, v.name), ae(v, ve.current));
4176
4213
  } })
4177
4214
  ] })
4178
4215
  ] }),
@@ -4180,14 +4217,14 @@ function Ui(e) {
4180
4217
  /* @__PURE__ */ l.jsx(
4181
4218
  wt,
4182
4219
  {
4183
- index: Se.indexOf(I),
4220
+ index: Se.indexOf(N),
4184
4221
  options: Se,
4185
4222
  onSelect: (g) => {
4186
- g !== I && (Ye(), be(g));
4223
+ g !== N && (He(), be(g));
4187
4224
  },
4188
4225
  open: Re,
4189
4226
  onToggle: (g) => {
4190
- je(g), Ae && ke(!1), De && Fe(!1);
4227
+ De(g), Pe && ke(!1), Ie && Be(!1);
4191
4228
  }
4192
4229
  }
4193
4230
  ),
@@ -4210,16 +4247,16 @@ function Ui(e) {
4210
4247
  m.overrideMaterial = null;
4211
4248
  break;
4212
4249
  case "Wireframe":
4213
- m.overrideMaterial = D;
4250
+ m.overrideMaterial = I;
4214
4251
  break;
4215
4252
  case "UVs":
4216
4253
  m.overrideMaterial = $;
4217
4254
  break;
4218
4255
  }
4219
4256
  },
4220
- open: Ae,
4257
+ open: Pe,
4221
4258
  onToggle: (g) => {
4222
- Re && je(!1), ke(g), De && Fe(!1);
4259
+ Re && De(!1), ke(g), Ie && Be(!1);
4223
4260
  }
4224
4261
  }
4225
4262
  ),
@@ -4234,9 +4271,9 @@ function Ui(e) {
4234
4271
  onSelect: (g) => {
4235
4272
  St = g === "Selection Mode", te.visible = St;
4236
4273
  },
4237
- open: De,
4274
+ open: Ie,
4238
4275
  onToggle: (g) => {
4239
- Re && je(!1), Ae && ke(!1), Fe(g);
4276
+ Re && De(!1), Pe && ke(!1), Be(g);
4240
4277
  }
4241
4278
  }
4242
4279
  )
@@ -4244,7 +4281,7 @@ function Ui(e) {
4244
4281
  ] })
4245
4282
  ] });
4246
4283
  }
4247
- function $i(e) {
4284
+ function zi(e) {
4248
4285
  return /* @__PURE__ */ l.jsxs("div", { className: "editor", ref: e.ref, style: e.style, children: [
4249
4286
  /* @__PURE__ */ l.jsx("div", { className: "header", children: e.header }),
4250
4287
  e.children,
@@ -4252,44 +4289,44 @@ function $i(e) {
4252
4289
  ] });
4253
4290
  }
4254
4291
  export {
4255
- Ut as Accordion,
4256
- Pi as Application,
4292
+ $t as Accordion,
4293
+ Ai as Application,
4257
4294
  Ot as BaseRemote,
4258
- Bn as ChildObject,
4295
+ Fn as ChildObject,
4259
4296
  Ya as ContainerObject,
4260
- Va as Draggable,
4261
- $a as DraggableItem,
4262
- za as Dropdown,
4297
+ Ga as Draggable,
4298
+ za as DraggableItem,
4299
+ Wa as Dropdown,
4263
4300
  Ha as DropdownItem,
4264
- $i as Editor,
4265
- gi as Inspector,
4266
- Ui as MultiView,
4267
- Fn as NavButton,
4268
- ji as RemoteComponents,
4269
- Li as RemoteController,
4270
- Bt as RemoteTheatre,
4271
- Ii as RemoteThree,
4272
- Ni as RemoteTweakpane,
4273
- Bi as SceneInspector,
4301
+ zi as Editor,
4302
+ vi as Inspector,
4303
+ $i as MultiView,
4304
+ Bn as NavButton,
4305
+ Di as RemoteComponents,
4306
+ Bi as RemoteController,
4307
+ Ut as RemoteTheatre,
4308
+ Ni as RemoteThree,
4309
+ Li as RemoteTweakpane,
4310
+ Ui as SceneInspector,
4274
4311
  Fi as SidePanel,
4275
- L as ToolEvents,
4312
+ A as ToolEvents,
4276
4313
  Mt as capitalize,
4277
4314
  Ke as clamp,
4278
- Ra as colorToHex,
4279
- N as debugDispatcher,
4280
- Ri as defaultTheatreCallback,
4281
- In as dispose,
4282
- ka as disposeMaterial,
4283
- ki as disposeTexture,
4284
- Ai as distance,
4285
- Dn as hierarchyUUID,
4286
- Ta as isColor,
4287
- Jt as mix,
4288
- Ft as noop,
4289
- Zt as normalize,
4315
+ Pa as colorToHex,
4316
+ j as debugDispatcher,
4317
+ Pi as defaultTheatreCallback,
4318
+ Ft as dispose,
4319
+ ja as disposeMaterial,
4320
+ ji as disposeTexture,
4321
+ ki as distance,
4322
+ In as hierarchyUUID,
4323
+ Ra as isColor,
4324
+ Qt as mix,
4325
+ Bt as noop,
4326
+ Jt as normalize,
4290
4327
  _a as randomID,
4291
- Aa as resetThreeObjects,
4292
- Qt as round,
4293
- Di as theatreEditorApp,
4328
+ ka as resetThreeObjects,
4329
+ en as round,
4330
+ Ii as theatreEditorApp,
4294
4331
  Dt as totalThreeObjects
4295
4332
  };