@tomorrowevening/hermes 0.0.8 → 0.0.11

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.
Files changed (35) hide show
  1. package/dist/hermes.js +1614 -1528
  2. package/dist/hermes.umd.cjs +51 -13
  3. package/dist/style.css +1 -1
  4. package/package.json +3 -1
  5. package/src/core/RemoteController.ts +0 -3
  6. package/src/core/remote/RemoteThree.ts +5 -10
  7. package/src/core/types.ts +0 -1
  8. package/src/editor/global.ts +0 -1
  9. package/src/editor/{sceneHierarchy/inspector/MultiView → multiView}/MultiView.scss +6 -0
  10. package/src/editor/{sceneHierarchy/inspector/MultiView → multiView}/MultiView.tsx +110 -118
  11. package/src/editor/multiView/MultiViewData.ts +59 -0
  12. package/src/editor/multiView/UVMaterial.ts +55 -0
  13. package/src/editor/sceneHierarchy/SceneHierarchy.tsx +7 -21
  14. package/src/editor/sceneHierarchy/inspector/SceneInspector.tsx +16 -11
  15. package/src/editor/sceneHierarchy/inspector/utils/InspectMaterial.tsx +1 -0
  16. package/src/editor/sceneHierarchy/inspector/utils/InspectTransform.tsx +35 -46
  17. package/src/editor/utils.ts +60 -4
  18. package/src/index.ts +3 -2
  19. package/types/core/remote/RemoteThree.d.ts +0 -1
  20. package/types/core/types.d.ts +1 -1
  21. package/types/editor/global.d.ts +0 -1
  22. package/types/editor/multiView/MultiView.d.ts +9 -0
  23. package/types/editor/multiView/MultiViewData.d.ts +16 -0
  24. package/types/editor/multiView/UVMaterial.d.ts +4 -0
  25. package/types/editor/sceneHierarchy/SceneHierarchy.d.ts +0 -2
  26. package/types/editor/sceneHierarchy/inspector/SceneInspector.d.ts +0 -2
  27. package/types/editor/utils.d.ts +7 -1
  28. package/types/index.d.ts +3 -2
  29. package/types/editor/sceneHierarchy/inspector/MultiView/MultiView.d.ts +0 -11
  30. /package/src/editor/{sceneHierarchy/inspector/MultiView → multiView}/CameraWindow.tsx +0 -0
  31. /package/src/editor/{sceneHierarchy/inspector/MultiView → multiView}/InfiniteGridHelper.ts +0 -0
  32. /package/src/editor/{sceneHierarchy/inspector/MultiView → multiView}/InfiniteGridMaterial.ts +0 -0
  33. /package/types/editor/{sceneHierarchy/inspector/MultiView → multiView}/CameraWindow.d.ts +0 -0
  34. /package/types/editor/{sceneHierarchy/inspector/MultiView → multiView}/InfiniteGridHelper.d.ts +0 -0
  35. /package/types/editor/{sceneHierarchy/inspector/MultiView → multiView}/InfiniteGridMaterial.d.ts +0 -0
package/dist/hermes.js CHANGED
@@ -1,52 +1,74 @@
1
- var on = Object.defineProperty;
2
- var sn = (t, n, r) => n in t ? on(t, n, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[n] = r;
3
- var $ = (t, n, r) => (sn(t, typeof n != "symbol" ? n + "" : n, r), r);
4
- import { EventDispatcher as Gt, Texture as Yt, CubeTexture as cn, RepeatWrapping as Pt, Color as Ct, Matrix4 as ln, Vector3 as G, Euler as un, Ray as dn, Plane as fn, MathUtils as hn, MOUSE as De, TOUCH as _e, Quaternion as Rt, Spherical as jt, Vector2 as ae, ShaderMaterial as pn, GLSL3 as mn, DoubleSide as gn, Mesh as vn, PlaneGeometry as bn, PerspectiveCamera as bt, MeshNormalMaterial as yn, MeshBasicMaterial as En, Scene as wn, AxesHelper as xn, OrthographicCamera as Vt, CameraHelper as Cn } from "three";
5
- import { getProject as Sn } from "@theatre/core";
6
- import { Pane as On } from "tweakpane";
7
- import * as Tn from "@tweakpane/plugin-essentials";
8
- import zt, { useState as re, useRef as Se, useEffect as qe, Component as Mn, forwardRef as Pn } from "react";
9
- import { Reorder as Wt } from "framer-motion";
10
- import We from "@theatre/studio";
11
- function va(t, n, r) {
12
- return Math.min(n, Math.max(t, r));
1
+ var bn = Object.defineProperty;
2
+ var yn = (t, n, a) => n in t ? bn(t, n, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[n] = a;
3
+ var $ = (t, n, a) => (yn(t, typeof n != "symbol" ? n + "" : n, a), a);
4
+ import { PositionalAudio as En, EventDispatcher as Zt, Texture as Jt, CubeTexture as xn, RepeatWrapping as Lt, ShaderMaterial as Qt, GLSL3 as wn, DoubleSide as Cn, Color as kt, Mesh as Sn, PlaneGeometry as On, Matrix4 as Tn, Vector3 as L, Euler as Rn, Ray as Mn, Plane as Pn, MathUtils as jn, MOUSE as Ne, TOUCH as Le, Quaternion as Ft, Spherical as Ut, Vector2 as oe, PerspectiveCamera as Tt, MeshDepthMaterial as _n, MeshNormalMaterial as kn, MeshBasicMaterial as Dn, OrthographicCamera as en, Scene as tn, AxesHelper as An, WebGLRenderer as In, CameraHelper as Nn } from "three";
5
+ import { getProject as Ln } from "@theatre/core";
6
+ import { Pane as Fn } from "tweakpane";
7
+ import * as Un from "@tweakpane/plugin-essentials";
8
+ import nn, { useState as ne, useRef as ye, useEffect as Be, Component as Bn, forwardRef as $n } from "react";
9
+ import { Reorder as an } from "framer-motion";
10
+ import Ze from "@theatre/studio";
11
+ function Ba(t, n, a) {
12
+ return Math.min(n, Math.max(t, a));
13
13
  }
14
- function ba(t, n) {
15
- const r = t - n;
16
- return Math.sqrt(r * r);
14
+ function $a(t, n) {
15
+ const a = t - n;
16
+ return Math.sqrt(a * a);
17
17
  }
18
- function Rn() {
18
+ function Gn() {
19
19
  return Math.round(Math.random() * 1e6).toString();
20
20
  }
21
- function jn(t) {
21
+ function Vn(t) {
22
22
  return t.r !== void 0 && t.g !== void 0 && t.b !== void 0;
23
23
  }
24
- function kn(t) {
25
- const n = Math.round(t.r * 255), r = Math.round(t.g * 255), e = Math.round(t.b * 255), i = (l) => {
26
- const h = l.toString(16);
27
- return h.length === 1 ? "0" + h : h;
28
- }, d = i(n), c = i(r), s = i(e);
29
- return "#" + d + c + s;
24
+ function Yn(t) {
25
+ const n = Math.round(t.r * 255), a = Math.round(t.g * 255), e = Math.round(t.b * 255), o = (d) => {
26
+ const p = d.toString(16);
27
+ return p.length === 1 ? "0" + p : p;
28
+ }, u = o(n), c = o(a), s = o(e);
29
+ return "#" + u + c + s;
30
30
  }
31
- let kt = 0;
32
- const Ht = (t) => {
31
+ function Ct(t, n = 1) {
32
+ return Number(t.toFixed(n));
33
+ }
34
+ let Rt = 0;
35
+ const zn = () => {
36
+ Rt = 0;
37
+ }, rn = (t) => {
33
38
  if (!t)
34
39
  return;
35
40
  let n = t.name.replace(" ", "");
36
- n.length === 0 && (n = `obj_${kt}`), t.parent !== null && (n = `${t.parent.uuid}.${n}`), t.uuid = n, kt++, t.children.forEach((r) => {
37
- Ht(r);
41
+ n.length === 0 && (n = `obj_${Rt}`, Rt++), t.parent !== null && (n = `${t.parent.uuid}.${n}`), t.uuid = n, t.children.forEach((a) => {
42
+ rn(a);
38
43
  });
44
+ }, Ga = (t) => {
45
+ t == null || t.dispose();
46
+ }, Wn = (t) => {
47
+ t && (Array.isArray(t) ? t.forEach((n) => n.dispose()) : t.dispose());
48
+ }, on = (t) => {
49
+ var n;
50
+ if (t) {
51
+ for (; t.children.length > 0; ) {
52
+ const a = t.children[0];
53
+ a instanceof En ? (a.pause(), a.parent && a.parent.remove(a)) : on(a);
54
+ }
55
+ if (t.parent && t.parent.remove(t), t.isMesh) {
56
+ const a = t;
57
+ (n = a.geometry) == null || n.dispose(), Wn(a.material);
58
+ }
59
+ t.dispose !== void 0 && t.dispose();
60
+ }
39
61
  };
40
- class ya {
41
- constructor(n, r, e) {
62
+ class Va {
63
+ constructor(n, a, e) {
42
64
  $(this, "channel");
43
65
  $(this, "components", /* @__PURE__ */ new Map());
44
66
  // Protected
45
67
  $(this, "_mode", "app");
46
- this.editor = r && document.location.hash.search(e) > -1, r && (this.channel = new BroadcastChannel(n));
68
+ this.editor = a && document.location.hash.search(e) > -1, a && (this.channel = new BroadcastChannel(n));
47
69
  }
48
- addComponent(n, r) {
49
- this.components.set(n, r);
70
+ addComponent(n, a) {
71
+ this.components.set(n, a);
50
72
  }
51
73
  dispose() {
52
74
  this.components.forEach((n) => {
@@ -58,8 +80,8 @@ class ya {
58
80
  this.channel !== void 0 && this._mode !== n.target && this.channel.postMessage(n);
59
81
  }
60
82
  listen(n) {
61
- this.channel !== void 0 && (this.channel.onmessage = (r) => {
62
- n(r.data);
83
+ this.channel !== void 0 && (this.channel.onmessage = (a) => {
84
+ n(a.data);
63
85
  });
64
86
  }
65
87
  // Getters / Setters
@@ -73,13 +95,12 @@ class ya {
73
95
  n && (this._mode = "editor", document.title += " - Editor");
74
96
  }
75
97
  }
76
- const A = new Gt(), N = {
98
+ const I = new Zt(), N = {
77
99
  CUSTOM: "ToolEvents::custom",
78
100
  // Components
79
101
  SELECT_DROPDOWN: "ToolEvents::selectDropdown",
80
102
  DRAG_UPDATE: "ToolEvents::dragUpdate",
81
103
  // SceneHierarchy
82
- GET_SCENE: "ToolEvents::getScene",
83
104
  SET_SCENE: "ToolEvents::setScene",
84
105
  GET_OBJECT: "ToolEvents::getObject",
85
106
  SET_OBJECT: "ToolEvents::setObject",
@@ -87,7 +108,7 @@ const A = new Gt(), N = {
87
108
  CREATE_TEXTURE: "ToolEvents::createTexture",
88
109
  REQUEST_METHOD: "ToolEvents::requestMethod"
89
110
  };
90
- class lt {
111
+ class gt {
91
112
  constructor(n) {
92
113
  $(this, "app");
93
114
  this.app = n;
@@ -95,74 +116,74 @@ class lt {
95
116
  dispose() {
96
117
  }
97
118
  }
98
- class Ea extends lt {
99
- selectDropdown(n, r) {
119
+ class Ya extends gt {
120
+ selectDropdown(n, a) {
100
121
  this.app.send({
101
122
  event: "selectComponent",
102
123
  target: "app",
103
124
  data: {
104
125
  dropdown: n,
105
- value: r
126
+ value: a
106
127
  }
107
128
  });
108
129
  }
109
- updateDropdown(n, r) {
130
+ updateDropdown(n, a) {
110
131
  this.app.send({
111
132
  event: "draggableListUpdate",
112
133
  target: "app",
113
134
  data: {
114
135
  dropdown: n,
115
- value: r
136
+ value: a
116
137
  }
117
138
  });
118
139
  }
119
140
  }
120
- const Kt = () => {
141
+ const sn = () => {
121
142
  };
122
- class wa extends lt {
123
- constructor(r, e, i) {
124
- super(r);
143
+ class za extends gt {
144
+ constructor(a, e, o) {
145
+ super(a);
125
146
  $(this, "project");
126
147
  $(this, "sheets");
127
148
  $(this, "sheetObjects");
128
149
  $(this, "sheetObjectCBs");
129
150
  $(this, "sheetObjectUnsubscribe");
130
- this.project = Sn(e, i), this.sheets = /* @__PURE__ */ new Map(), this.sheetObjects = /* @__PURE__ */ new Map(), this.sheetObjectCBs = /* @__PURE__ */ new Map(), this.sheetObjectUnsubscribe = /* @__PURE__ */ new Map();
151
+ this.project = Ln(e, o), this.sheets = /* @__PURE__ */ new Map(), this.sheetObjects = /* @__PURE__ */ new Map(), this.sheetObjectCBs = /* @__PURE__ */ new Map(), this.sheetObjectUnsubscribe = /* @__PURE__ */ new Map();
131
152
  }
132
153
  dispose() {
133
154
  this.project = void 0, this.sheets = /* @__PURE__ */ new Map(), this.sheetObjects = /* @__PURE__ */ new Map(), this.sheetObjectCBs = /* @__PURE__ */ new Map(), this.sheetObjectUnsubscribe = /* @__PURE__ */ new Map();
134
155
  }
135
- sheet(r) {
136
- var i;
156
+ sheet(a) {
157
+ var o;
137
158
  if (this.project === void 0) {
138
159
  console.error("Theatre Project hasn't been created yet.");
139
160
  return;
140
161
  }
141
- let e = this.sheets.get(r);
142
- return e !== void 0 || (e = (i = this.project) == null ? void 0 : i.sheet(r), this.sheets.set(r, e)), e;
162
+ let e = this.sheets.get(a);
163
+ return e !== void 0 || (e = (o = this.project) == null ? void 0 : o.sheet(a), this.sheets.set(a, e)), e;
143
164
  }
144
- sheetObject(r, e, i, d) {
165
+ sheetObject(a, e, o, u) {
145
166
  if (this.project === void 0) {
146
167
  console.error("Theatre Project hasn't been created yet.");
147
168
  return;
148
169
  }
149
- const c = this.sheets.get(r);
170
+ const c = this.sheets.get(a);
150
171
  if (c === void 0)
151
172
  return;
152
- const s = `${r}_${e}`;
153
- let l = this.sheetObjects.get(s);
154
- if (l !== void 0)
155
- return l = c.object(e, { ...i, ...l.value }, { reconfigure: !0 }), l;
156
- l = c.object(e, i), this.sheetObjects.set(s, l), this.sheetObjectCBs.set(s, d !== void 0 ? d : Kt);
157
- const h = l.onValuesChange((p) => {
173
+ const s = `${a}_${e}`;
174
+ let d = this.sheetObjects.get(s);
175
+ if (d !== void 0)
176
+ return d = c.object(e, { ...o, ...d.value }, { reconfigure: !0 }), d;
177
+ d = c.object(e, o), this.sheetObjects.set(s, d), this.sheetObjectCBs.set(s, u !== void 0 ? u : sn);
178
+ const p = d.onValuesChange((h) => {
158
179
  if (this.app.editor) {
159
- for (const g in p) {
160
- const E = p[g];
161
- typeof E == "object" && jn(E) && (p[g] = {
162
- r: E.r,
163
- g: E.g,
164
- b: E.b,
165
- a: E.a
180
+ for (const b in h) {
181
+ const x = h[b];
182
+ typeof x == "object" && Vn(x) && (h[b] = {
183
+ r: x.r,
184
+ g: x.g,
185
+ b: x.b,
186
+ a: x.a
166
187
  });
167
188
  }
168
189
  this.app.send({
@@ -170,26 +191,26 @@ class wa extends lt {
170
191
  target: "app",
171
192
  data: {
172
193
  sheetObject: s,
173
- values: p
194
+ values: h
174
195
  }
175
196
  });
176
197
  } else {
177
- const g = this.sheetObjectCBs.get(s);
178
- g !== void 0 && g(p);
198
+ const b = this.sheetObjectCBs.get(s);
199
+ b !== void 0 && b(h);
179
200
  }
180
201
  });
181
- return this.sheetObjectUnsubscribe.set(s, h), l;
202
+ return this.sheetObjectUnsubscribe.set(s, p), d;
182
203
  }
183
- unsubscribe(r) {
204
+ unsubscribe(a) {
184
205
  if (this.project === void 0) {
185
206
  console.error("Theatre Project hasn't been created yet.");
186
207
  return;
187
208
  }
188
- const e = `${r.address.sheetId}_${r.address.objectKey}`, i = this.sheetObjectUnsubscribe.get(e);
189
- i !== void 0 && i();
209
+ const e = `${a.address.sheetId}_${a.address.objectKey}`, o = this.sheetObjectUnsubscribe.get(e);
210
+ o !== void 0 && o();
190
211
  }
191
212
  }
192
- function Dn(t) {
213
+ function Hn(t) {
193
214
  if (t.name === "cameras")
194
215
  return "camera";
195
216
  if (t.name === "interactive")
@@ -203,26 +224,26 @@ function Dn(t) {
203
224
  const n = t.type;
204
225
  return n.search("Helper") > -1 ? "icon_utils" : n.search("Camera") > -1 ? "camera" : n.search("Light") > -1 ? "light" : "obj3D";
205
226
  }
206
- function Xt(t) {
227
+ function cn(t) {
207
228
  const n = {
208
229
  name: t.name,
209
230
  type: t.type,
210
231
  uuid: t.uuid,
211
232
  children: []
212
233
  };
213
- return t.children.forEach((r) => {
214
- n.children.push(Xt(r));
234
+ return t.children.forEach((a) => {
235
+ n.children.push(cn(a));
215
236
  }), n;
216
237
  }
217
- function _n(t) {
238
+ function Kn(t) {
218
239
  const n = {};
219
- for (const r in t) {
220
- const e = t[r].value;
221
- n[r] = { value: e }, e === null ? n[r].value = { src: "" } : e.isTexture && (n[r].value = { src: e.image.src });
240
+ for (const a in t) {
241
+ const e = t[a].value;
242
+ n[a] = { value: e }, e === null ? n[a].value = { src: "" } : e.isTexture && (n[a].value = { src: e.image.src });
222
243
  }
223
244
  return n;
224
245
  }
225
- function In(t) {
246
+ function Xn(t) {
226
247
  switch (t) {
227
248
  case "blendSrcAlpha":
228
249
  case "blendDstAlpha":
@@ -234,36 +255,36 @@ function In(t) {
234
255
  }
235
256
  return !1;
236
257
  }
237
- function Dt(t) {
258
+ function Bt(t) {
238
259
  const n = {};
239
- for (const r in t) {
240
- if (r.substring(0, 1) === "_" || r.substring(0, 2) === "is" || In(r))
260
+ for (const a in t) {
261
+ if (a.substring(0, 1) === "_" || a.substring(0, 2) === "is" || Xn(a))
241
262
  continue;
242
- const e = typeof t[r], i = t[r];
263
+ const e = typeof t[a], o = t[a];
243
264
  switch (e) {
244
265
  case "boolean":
245
266
  case "number":
246
267
  case "string":
247
- n[r] = i;
268
+ n[a] = o;
248
269
  break;
249
270
  case "object":
250
- if (i !== null)
251
- if (n[r] = i, i.isTexture)
252
- if (i instanceof Yt) {
253
- const d = i.source.toJSON();
254
- n[r] = { src: d.url };
271
+ if (o !== null)
272
+ if (n[a] = o, o.isTexture)
273
+ if (o instanceof Jt) {
274
+ const u = o.source.toJSON();
275
+ n[a] = { src: u.url };
255
276
  } else
256
- i instanceof cn && (console.log("env map"), console.log(i.source.data), console.log(i.source.toJSON()), n[r] = { src: "" });
277
+ o instanceof xn && (console.log("env map"), console.log(o.source.data), console.log(o.source.toJSON()), n[a] = { src: "" });
257
278
  else
258
- r === "uniforms" && (n[r] = _n(n[r]));
279
+ a === "uniforms" && (n[a] = Kn(n[a]));
259
280
  else
260
- n[r] = { src: "" };
281
+ n[a] = { src: "" };
261
282
  break;
262
283
  }
263
284
  }
264
285
  return n;
265
286
  }
266
- function An(t) {
287
+ function qn(t) {
267
288
  t.updateMatrix();
268
289
  const n = {
269
290
  name: t.name,
@@ -275,18 +296,18 @@ function An(t) {
275
296
  perspectiveCameraInfo: void 0,
276
297
  orthographicCameraInfo: void 0,
277
298
  lightInfo: void 0
278
- }, r = t.type.toLowerCase();
279
- if (r.search("mesh") > -1) {
299
+ }, a = t.type.toLowerCase();
300
+ if (a.search("mesh") > -1) {
280
301
  const e = t;
281
302
  if (Array.isArray(e.material)) {
282
- const i = [];
283
- e.material.forEach((d) => {
284
- i.push(Dt(d));
285
- }), n.material = i;
303
+ const o = [];
304
+ e.material.forEach((u) => {
305
+ o.push(Bt(u));
306
+ }), n.material = o;
286
307
  } else
287
- n.material = Dt(e.material);
308
+ n.material = Bt(e.material);
288
309
  } else
289
- r.search("camera") > -1 ? t.type === "PerspectiveCamera" ? n.perspectiveCameraInfo = {
310
+ a.search("camera") > -1 ? t.type === "PerspectiveCamera" ? n.perspectiveCameraInfo = {
290
311
  fov: t.fov,
291
312
  zoom: t.zoom,
292
313
  near: t.near,
@@ -303,7 +324,7 @@ function An(t) {
303
324
  right: t.right,
304
325
  top: t.top,
305
326
  bottom: t.bottom
306
- }) : r.search("light") > -1 && (n.lightInfo = {
327
+ }) : a.search("light") > -1 && (n.lightInfo = {
307
328
  color: t.color,
308
329
  intensity: t.intensity,
309
330
  decay: t.decay,
@@ -314,97 +335,93 @@ function An(t) {
314
335
  });
315
336
  return n;
316
337
  }
317
- function Z(t, n, r) {
338
+ function q(t, n, a) {
318
339
  const e = n.split(".");
319
340
  switch (e.length) {
320
341
  case 1:
321
- t[e[0]] = r;
342
+ t[e[0]] = a;
322
343
  break;
323
344
  case 2:
324
- t[e[0]][e[1]] = r;
345
+ t[e[0]][e[1]] = a;
325
346
  break;
326
347
  case 3:
327
- t[e[0]][e[1]][e[2]] = r;
348
+ t[e[0]][e[1]][e[2]] = a;
328
349
  break;
329
350
  case 4:
330
- t[e[0]][e[1]][e[2]][e[3]] = r;
351
+ t[e[0]][e[1]][e[2]][e[3]] = a;
331
352
  break;
332
353
  case 5:
333
- t[e[0]][e[1]][e[2]][e[3]][e[4]] = r;
354
+ t[e[0]][e[1]][e[2]][e[3]][e[4]] = a;
334
355
  break;
335
356
  }
336
357
  }
337
- function yt(t) {
338
- return new Promise((n, r) => {
358
+ function Mt(t) {
359
+ return new Promise((n, a) => {
339
360
  const e = new Image();
340
361
  e.onload = () => {
341
- const i = new Yt(e);
342
- i.wrapS = Pt, i.wrapT = Pt, i.needsUpdate = !0, n(i);
343
- }, e.onerror = r, e.src = t;
362
+ const o = new Jt(e);
363
+ o.wrapS = Lt, o.wrapT = Lt, o.needsUpdate = !0, n(o);
364
+ }, e.onerror = a, e.src = t;
344
365
  });
345
366
  }
346
- class xa extends lt {
367
+ class Wa extends gt {
347
368
  constructor() {
348
369
  super(...arguments);
349
370
  $(this, "scene");
350
371
  }
351
- getObject(r) {
372
+ getObject(a) {
352
373
  this.app.send({
353
374
  event: "getObject",
354
375
  target: "app",
355
- data: r
376
+ data: a
356
377
  });
357
378
  }
358
- setObject(r) {
359
- const e = An(r);
379
+ setObject(a) {
380
+ const e = qn(a);
360
381
  this.app.send({
361
382
  event: "setObject",
362
383
  target: "editor",
363
384
  data: e
364
385
  });
365
386
  }
366
- requestMethod(r, e, i) {
387
+ requestMethod(a, e, o) {
367
388
  this.app.send({
368
389
  event: "requestMethod",
369
390
  target: "app",
370
391
  data: {
371
- uuid: r,
392
+ uuid: a,
372
393
  key: e,
373
- value: i
394
+ value: o
374
395
  }
375
396
  });
376
397
  }
377
- updateObject(r, e, i) {
398
+ updateObject(a, e, o) {
378
399
  this.app.send({
379
400
  event: "updateObject",
380
401
  target: "app",
381
402
  data: {
382
- uuid: r,
403
+ uuid: a,
383
404
  key: e,
384
- value: i
405
+ value: o
385
406
  }
386
407
  });
387
408
  }
388
- createTexture(r, e, i) {
409
+ createTexture(a, e, o) {
389
410
  this.app.send({
390
411
  event: "createTexture",
391
412
  target: "app",
392
413
  data: {
393
- uuid: r,
414
+ uuid: a,
394
415
  key: e,
395
- value: i
416
+ value: o
396
417
  }
397
418
  });
398
419
  }
399
- getScene() {
400
- this.app.send({
401
- event: "getScene",
402
- target: "app"
403
- });
404
- }
405
- setScene(r) {
406
- this.scene = r, Ht(r);
407
- const e = Xt(r);
420
+ setScene(a) {
421
+ if (a === void 0)
422
+ return;
423
+ this.scene = a, zn(), rn(this.scene);
424
+ const e = cn(this.scene);
408
425
  this.app.send({
409
426
  event: "setScene",
410
427
  target: "editor",
@@ -412,37 +429,37 @@ class xa extends lt {
412
429
  });
413
430
  }
414
431
  }
415
- class Ca extends lt {
416
- constructor(r) {
417
- super(r);
432
+ class Ha extends gt {
433
+ constructor(a) {
434
+ super(a);
418
435
  $(this, "bindCBs");
419
436
  $(this, "buttonCBs");
420
437
  $(this, "pane");
421
438
  $(this, "appCallbacks", 0);
422
439
  $(this, "editorCallbacks", 0);
423
440
  $(this, "inspectorFolder");
424
- this.bindCBs = /* @__PURE__ */ new Map(), this.buttonCBs = /* @__PURE__ */ new Map(), r.editor && this.createGUI();
441
+ this.bindCBs = /* @__PURE__ */ new Map(), this.buttonCBs = /* @__PURE__ */ new Map(), a.editor && this.createGUI();
425
442
  }
426
443
  createGUI() {
427
- this.pane = new On({ title: "GUI" }), this.pane.registerPlugin(Tn);
444
+ this.pane = new Fn({ title: "GUI" }), this.pane.registerPlugin(Un);
428
445
  }
429
446
  dispose() {
430
- var r;
431
- this.bindCBs.clear(), this.buttonCBs.clear(), this.appCallbacks = 0, this.editorCallbacks = 0, this.app.editor && ((r = this.pane) == null || r.dispose(), this.pane = void 0);
447
+ var a;
448
+ this.bindCBs.clear(), this.buttonCBs.clear(), this.appCallbacks = 0, this.editorCallbacks = 0, this.app.editor && ((a = this.pane) == null || a.dispose(), this.pane = void 0);
432
449
  }
433
- addFolder(r, e = void 0, i = void 0) {
450
+ addFolder(a, e = void 0, o = void 0) {
434
451
  if (this.app.editor)
435
- return this.pane === void 0 && this.createGUI(), (i !== void 0 ? i : this.pane).addFolder({
436
- title: r,
452
+ return this.pane === void 0 && this.createGUI(), (o !== void 0 ? o : this.pane).addFolder({
453
+ title: a,
437
454
  ...e
438
455
  });
439
456
  this.app.send({
440
457
  event: "addFolder",
441
458
  target: "app",
442
459
  data: {
443
- name: r,
460
+ name: a,
444
461
  params: e,
445
- parent: i
462
+ parent: o
446
463
  }
447
464
  });
448
465
  }
@@ -450,15 +467,15 @@ class Ca extends lt {
450
467
  return `debug_${Math.max(this.appCallbacks, this.editorCallbacks)}`;
451
468
  }
452
469
  // Binding
453
- bind(r, e, i, d = void 0) {
454
- const c = this.bindID, s = i.onChange !== void 0 ? i.onChange : Kt;
455
- this.bindCBs.set(c, s), this.app.editor ? (this.pane === void 0 && this.createGUI(), (d !== void 0 ? d : this.pane).addBinding(r, e, i).on("change", (h) => {
470
+ bind(a, e, o, u = void 0) {
471
+ const c = this.bindID, s = o.onChange !== void 0 ? o.onChange : sn;
472
+ this.bindCBs.set(c, s), this.app.editor ? (this.pane === void 0 && this.createGUI(), (u !== void 0 ? u : this.pane).addBinding(a, e, o).on("change", (p) => {
456
473
  this.app.send({
457
474
  event: "updateBind",
458
475
  target: "app",
459
476
  data: {
460
477
  id: c,
461
- value: h.value
478
+ value: p.value
462
479
  }
463
480
  });
464
481
  }), this.editorCallbacks++) : (this.app.send({
@@ -467,39 +484,39 @@ class Ca extends lt {
467
484
  data: {
468
485
  id: c,
469
486
  name: e,
470
- params: i,
471
- parent: d
487
+ params: o,
488
+ parent: u
472
489
  }
473
490
  }), this.appCallbacks++);
474
491
  }
475
- triggerBind(r, e) {
476
- const i = this.bindCBs.get(r);
477
- i !== void 0 ? i(e) : console.warn(`No callback for: ${r}`, e);
492
+ triggerBind(a, e) {
493
+ const o = this.bindCBs.get(a);
494
+ o !== void 0 ? o(e) : console.warn(`No callback for: ${a}`, e);
478
495
  }
479
496
  // Buttons
480
- button(r, e, i = void 0) {
481
- const d = this.bindID;
482
- this.buttonCBs.set(d, e), this.app.editor ? (this.pane === void 0 && this.createGUI(), (i !== void 0 ? i : this.pane).addButton({ title: r }).on("click", () => {
497
+ button(a, e, o = void 0) {
498
+ const u = this.bindID;
499
+ this.buttonCBs.set(u, e), this.app.editor ? (this.pane === void 0 && this.createGUI(), (o !== void 0 ? o : this.pane).addButton({ title: a }).on("click", () => {
483
500
  this.app.send({
484
501
  event: "clickButton",
485
502
  target: "app",
486
503
  data: {
487
- id: d
504
+ id: u
488
505
  }
489
506
  });
490
507
  }), this.editorCallbacks++) : (this.app.send({
491
508
  event: "addButton",
492
509
  target: "app",
493
510
  data: {
494
- id: d,
495
- name: r,
511
+ id: u,
512
+ name: a,
496
513
  callback: e,
497
- parent: i
514
+ parent: o
498
515
  }
499
516
  }), this.appCallbacks++);
500
517
  }
501
- triggerButton(r) {
502
- const e = this.buttonCBs.get(r);
518
+ triggerButton(a) {
519
+ const e = this.buttonCBs.get(a);
503
520
  e !== void 0 && e();
504
521
  }
505
522
  // Inspector
@@ -507,12 +524,12 @@ class Ca extends lt {
507
524
  this.inspectorFolder = this.addFolder("Inspector", this.pane);
508
525
  }
509
526
  clearInspector() {
510
- const r = this.inspectorFolder.children.length - 1;
511
- for (let e = r; e > -1; --e)
527
+ const a = this.inspectorFolder.children.length - 1;
528
+ for (let e = a; e > -1; --e)
512
529
  this.inspectorFolder.remove(this.inspectorFolder.children[e]);
513
530
  }
514
531
  }
515
- var Et = { exports: {} }, He = {};
532
+ var Pt = { exports: {} }, Je = {};
516
533
  /**
517
534
  * @license React
518
535
  * react-jsx-runtime.production.min.js
@@ -522,25 +539,25 @@ var Et = { exports: {} }, He = {};
522
539
  * This source code is licensed under the MIT license found in the
523
540
  * LICENSE file in the root directory of this source tree.
524
541
  */
525
- var _t;
526
- function Nn() {
527
- if (_t)
528
- return He;
529
- _t = 1;
530
- var t = zt, n = Symbol.for("react.element"), r = Symbol.for("react.fragment"), e = Object.prototype.hasOwnProperty, i = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, d = { key: !0, ref: !0, __self: !0, __source: !0 };
531
- function c(s, l, h) {
532
- var p, g = {}, E = null, C = null;
533
- h !== void 0 && (E = "" + h), l.key !== void 0 && (E = "" + l.key), l.ref !== void 0 && (C = l.ref);
534
- for (p in l)
535
- e.call(l, p) && !d.hasOwnProperty(p) && (g[p] = l[p]);
542
+ var $t;
543
+ function Zn() {
544
+ if ($t)
545
+ return Je;
546
+ $t = 1;
547
+ var t = nn, n = Symbol.for("react.element"), a = Symbol.for("react.fragment"), e = Object.prototype.hasOwnProperty, o = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, u = { key: !0, ref: !0, __self: !0, __source: !0 };
548
+ function c(s, d, p) {
549
+ var h, b = {}, x = null, S = null;
550
+ p !== void 0 && (x = "" + p), d.key !== void 0 && (x = "" + d.key), d.ref !== void 0 && (S = d.ref);
551
+ for (h in d)
552
+ e.call(d, h) && !u.hasOwnProperty(h) && (b[h] = d[h]);
536
553
  if (s && s.defaultProps)
537
- for (p in l = s.defaultProps, l)
538
- g[p] === void 0 && (g[p] = l[p]);
539
- return { $$typeof: n, type: s, key: E, ref: C, props: g, _owner: i.current };
554
+ for (h in d = s.defaultProps, d)
555
+ b[h] === void 0 && (b[h] = d[h]);
556
+ return { $$typeof: n, type: s, key: x, ref: S, props: b, _owner: o.current };
540
557
  }
541
- return He.Fragment = r, He.jsx = c, He.jsxs = c, He;
558
+ return Je.Fragment = a, Je.jsx = c, Je.jsxs = c, Je;
542
559
  }
543
- var Ke = {};
560
+ var Qe = {};
544
561
  /**
545
562
  * @license React
546
563
  * react-jsx-runtime.development.js
@@ -550,91 +567,91 @@ var Ke = {};
550
567
  * This source code is licensed under the MIT license found in the
551
568
  * LICENSE file in the root directory of this source tree.
552
569
  */
553
- var It;
554
- function Ln() {
555
- return It || (It = 1, process.env.NODE_ENV !== "production" && function() {
556
- var t = zt, n = Symbol.for("react.element"), r = Symbol.for("react.portal"), e = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), d = Symbol.for("react.profiler"), c = Symbol.for("react.provider"), s = Symbol.for("react.context"), l = Symbol.for("react.forward_ref"), h = Symbol.for("react.suspense"), p = Symbol.for("react.suspense_list"), g = Symbol.for("react.memo"), E = Symbol.for("react.lazy"), C = Symbol.for("react.offscreen"), P = Symbol.iterator, D = "@@iterator";
557
- function y(a) {
558
- if (a === null || typeof a != "object")
570
+ var Gt;
571
+ function Jn() {
572
+ return Gt || (Gt = 1, process.env.NODE_ENV !== "production" && function() {
573
+ var t = nn, n = Symbol.for("react.element"), a = Symbol.for("react.portal"), e = Symbol.for("react.fragment"), o = Symbol.for("react.strict_mode"), u = Symbol.for("react.profiler"), c = Symbol.for("react.provider"), s = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), p = Symbol.for("react.suspense"), h = Symbol.for("react.suspense_list"), b = Symbol.for("react.memo"), x = Symbol.for("react.lazy"), S = Symbol.for("react.offscreen"), O = Symbol.iterator, m = "@@iterator";
574
+ function v(r) {
575
+ if (r === null || typeof r != "object")
559
576
  return null;
560
- var f = P && a[P] || a[D];
577
+ var f = O && r[O] || r[m];
561
578
  return typeof f == "function" ? f : null;
562
579
  }
563
- var b = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
564
- function v(a) {
580
+ var y = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
581
+ function w(r) {
565
582
  {
566
- for (var f = arguments.length, m = new Array(f > 1 ? f - 1 : 0), x = 1; x < f; x++)
567
- m[x - 1] = arguments[x];
568
- O("error", a, m);
583
+ for (var f = arguments.length, g = new Array(f > 1 ? f - 1 : 0), C = 1; C < f; C++)
584
+ g[C - 1] = arguments[C];
585
+ F("error", r, g);
569
586
  }
570
587
  }
571
- function O(a, f, m) {
588
+ function F(r, f, g) {
572
589
  {
573
- var x = b.ReactDebugCurrentFrame, k = x.getStackAddendum();
574
- k !== "" && (f += "%s", m = m.concat([k]));
575
- var _ = m.map(function(M) {
576
- return String(M);
590
+ var C = y.ReactDebugCurrentFrame, M = C.getStackAddendum();
591
+ M !== "" && (f += "%s", g = g.concat([M]));
592
+ var k = g.map(function(R) {
593
+ return String(R);
577
594
  });
578
- _.unshift("Warning: " + f), Function.prototype.apply.call(console[a], console, _);
595
+ k.unshift("Warning: " + f), Function.prototype.apply.call(console[r], console, k);
579
596
  }
580
597
  }
581
- var R = !1, z = !1, ee = !1, T = !1, le = !1, Te;
582
- Te = Symbol.for("react.module.reference");
583
- function oe(a) {
584
- return !!(typeof a == "string" || typeof a == "function" || a === e || a === d || le || a === i || a === h || a === p || T || a === C || R || z || ee || typeof a == "object" && a !== null && (a.$$typeof === E || a.$$typeof === g || a.$$typeof === c || a.$$typeof === s || a.$$typeof === l || // This needs to include all possible module reference object
598
+ var V = !1, Z = !1, se = !1, Y = !1, fe = !1, j;
599
+ j = Symbol.for("react.module.reference");
600
+ function D(r) {
601
+ return !!(typeof r == "string" || typeof r == "function" || r === e || r === u || fe || r === o || r === p || r === h || Y || r === S || V || Z || se || typeof r == "object" && r !== null && (r.$$typeof === x || r.$$typeof === b || r.$$typeof === c || r.$$typeof === s || r.$$typeof === d || // This needs to include all possible module reference object
585
602
  // types supported by any Flight configuration anywhere since
586
603
  // we don't know which Flight build this will end up being used
587
604
  // with.
588
- a.$$typeof === Te || a.getModuleId !== void 0));
605
+ r.$$typeof === j || r.getModuleId !== void 0));
589
606
  }
590
- function j(a, f, m) {
591
- var x = a.displayName;
592
- if (x)
593
- return x;
594
- var k = f.displayName || f.name || "";
595
- return k !== "" ? m + "(" + k + ")" : m;
607
+ function z(r, f, g) {
608
+ var C = r.displayName;
609
+ if (C)
610
+ return C;
611
+ var M = f.displayName || f.name || "";
612
+ return M !== "" ? g + "(" + M + ")" : g;
596
613
  }
597
- function I(a) {
598
- return a.displayName || "Context";
614
+ function ce(r) {
615
+ return r.displayName || "Context";
599
616
  }
600
- function L(a) {
601
- if (a == null)
617
+ function ae(r) {
618
+ if (r == null)
602
619
  return null;
603
- if (typeof a.tag == "number" && v("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof a == "function")
604
- return a.displayName || a.name || null;
605
- if (typeof a == "string")
606
- return a;
607
- switch (a) {
620
+ if (typeof r.tag == "number" && w("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof r == "function")
621
+ return r.displayName || r.name || null;
622
+ if (typeof r == "string")
623
+ return r;
624
+ switch (r) {
608
625
  case e:
609
626
  return "Fragment";
610
- case r:
627
+ case a:
611
628
  return "Portal";
612
- case d:
629
+ case u:
613
630
  return "Profiler";
614
- case i:
631
+ case o:
615
632
  return "StrictMode";
616
- case h:
617
- return "Suspense";
618
633
  case p:
634
+ return "Suspense";
635
+ case h:
619
636
  return "SuspenseList";
620
637
  }
621
- if (typeof a == "object")
622
- switch (a.$$typeof) {
638
+ if (typeof r == "object")
639
+ switch (r.$$typeof) {
623
640
  case s:
624
- var f = a;
625
- return I(f) + ".Consumer";
641
+ var f = r;
642
+ return ce(f) + ".Consumer";
626
643
  case c:
627
- var m = a;
628
- return I(m._context) + ".Provider";
629
- case l:
630
- return j(a, a.render, "ForwardRef");
631
- case g:
632
- var x = a.displayName || null;
633
- return x !== null ? x : L(a.type) || "Memo";
634
- case E: {
635
- var k = a, _ = k._payload, M = k._init;
644
+ var g = r;
645
+ return ce(g._context) + ".Provider";
646
+ case d:
647
+ return z(r, r.render, "ForwardRef");
648
+ case b:
649
+ var C = r.displayName || null;
650
+ return C !== null ? C : ae(r.type) || "Memo";
651
+ case x: {
652
+ var M = r, k = M._payload, R = M._init;
636
653
  try {
637
- return L(M(_));
654
+ return ae(R(k));
638
655
  } catch {
639
656
  return null;
640
657
  }
@@ -642,511 +659,511 @@ function Ln() {
642
659
  }
643
660
  return null;
644
661
  }
645
- var J = Object.assign, te = 0, Me, Ae, Ne, Pe, Le, Ze, Fe;
646
- function Je() {
662
+ var le = Object.assign, re = 0, Me, Ge, Pe, je, Ve, nt, Ye;
663
+ function at() {
647
664
  }
648
- Je.__reactDisabledLog = !0;
649
- function dt() {
665
+ at.__reactDisabledLog = !0;
666
+ function bt() {
650
667
  {
651
- if (te === 0) {
652
- Me = console.log, Ae = console.info, Ne = console.warn, Pe = console.error, Le = console.group, Ze = console.groupCollapsed, Fe = console.groupEnd;
653
- var a = {
668
+ if (re === 0) {
669
+ Me = console.log, Ge = console.info, Pe = console.warn, je = console.error, Ve = console.group, nt = console.groupCollapsed, Ye = console.groupEnd;
670
+ var r = {
654
671
  configurable: !0,
655
672
  enumerable: !0,
656
- value: Je,
673
+ value: at,
657
674
  writable: !0
658
675
  };
659
676
  Object.defineProperties(console, {
660
- info: a,
661
- log: a,
662
- warn: a,
663
- error: a,
664
- group: a,
665
- groupCollapsed: a,
666
- groupEnd: a
677
+ info: r,
678
+ log: r,
679
+ warn: r,
680
+ error: r,
681
+ group: r,
682
+ groupCollapsed: r,
683
+ groupEnd: r
667
684
  });
668
685
  }
669
- te++;
686
+ re++;
670
687
  }
671
688
  }
672
- function ft() {
689
+ function yt() {
673
690
  {
674
- if (te--, te === 0) {
675
- var a = {
691
+ if (re--, re === 0) {
692
+ var r = {
676
693
  configurable: !0,
677
694
  enumerable: !0,
678
695
  writable: !0
679
696
  };
680
697
  Object.defineProperties(console, {
681
- log: J({}, a, {
698
+ log: le({}, r, {
682
699
  value: Me
683
700
  }),
684
- info: J({}, a, {
685
- value: Ae
701
+ info: le({}, r, {
702
+ value: Ge
686
703
  }),
687
- warn: J({}, a, {
688
- value: Ne
689
- }),
690
- error: J({}, a, {
704
+ warn: le({}, r, {
691
705
  value: Pe
692
706
  }),
693
- group: J({}, a, {
694
- value: Le
707
+ error: le({}, r, {
708
+ value: je
709
+ }),
710
+ group: le({}, r, {
711
+ value: Ve
695
712
  }),
696
- groupCollapsed: J({}, a, {
697
- value: Ze
713
+ groupCollapsed: le({}, r, {
714
+ value: nt
698
715
  }),
699
- groupEnd: J({}, a, {
700
- value: Fe
716
+ groupEnd: le({}, r, {
717
+ value: Ye
701
718
  })
702
719
  });
703
720
  }
704
- te < 0 && v("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
721
+ re < 0 && w("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
705
722
  }
706
723
  }
707
- var Ue = b.ReactCurrentDispatcher, Be;
708
- function me(a, f, m) {
724
+ var ze = y.ReactCurrentDispatcher, We;
725
+ function Ee(r, f, g) {
709
726
  {
710
- if (Be === void 0)
727
+ if (We === void 0)
711
728
  try {
712
729
  throw Error();
713
- } catch (k) {
714
- var x = k.stack.trim().match(/\n( *(at )?)/);
715
- Be = x && x[1] || "";
730
+ } catch (M) {
731
+ var C = M.stack.trim().match(/\n( *(at )?)/);
732
+ We = C && C[1] || "";
716
733
  }
717
734
  return `
718
- ` + Be + a;
735
+ ` + We + r;
719
736
  }
720
737
  }
721
- var Re = !1, ge;
738
+ var _e = !1, xe;
722
739
  {
723
- var ht = typeof WeakMap == "function" ? WeakMap : Map;
724
- ge = new ht();
740
+ var Et = typeof WeakMap == "function" ? WeakMap : Map;
741
+ xe = new Et();
725
742
  }
726
- function Qe(a, f) {
727
- if (!a || Re)
743
+ function rt(r, f) {
744
+ if (!r || _e)
728
745
  return "";
729
746
  {
730
- var m = ge.get(a);
731
- if (m !== void 0)
732
- return m;
747
+ var g = xe.get(r);
748
+ if (g !== void 0)
749
+ return g;
733
750
  }
734
- var x;
735
- Re = !0;
736
- var k = Error.prepareStackTrace;
751
+ var C;
752
+ _e = !0;
753
+ var M = Error.prepareStackTrace;
737
754
  Error.prepareStackTrace = void 0;
738
- var _;
739
- _ = Ue.current, Ue.current = null, dt();
755
+ var k;
756
+ k = ze.current, ze.current = null, bt();
740
757
  try {
741
758
  if (f) {
742
- var M = function() {
759
+ var R = function() {
743
760
  throw Error();
744
761
  };
745
- if (Object.defineProperty(M.prototype, "props", {
762
+ if (Object.defineProperty(R.prototype, "props", {
746
763
  set: function() {
747
764
  throw Error();
748
765
  }
749
766
  }), typeof Reflect == "object" && Reflect.construct) {
750
767
  try {
751
- Reflect.construct(M, []);
752
- } catch (se) {
753
- x = se;
768
+ Reflect.construct(R, []);
769
+ } catch (pe) {
770
+ C = pe;
754
771
  }
755
- Reflect.construct(a, [], M);
772
+ Reflect.construct(r, [], R);
756
773
  } else {
757
774
  try {
758
- M.call();
759
- } catch (se) {
760
- x = se;
775
+ R.call();
776
+ } catch (pe) {
777
+ C = pe;
761
778
  }
762
- a.call(M.prototype);
779
+ r.call(R.prototype);
763
780
  }
764
781
  } else {
765
782
  try {
766
783
  throw Error();
767
- } catch (se) {
768
- x = se;
784
+ } catch (pe) {
785
+ C = pe;
769
786
  }
770
- a();
787
+ r();
771
788
  }
772
- } catch (se) {
773
- if (se && x && typeof se.stack == "string") {
774
- for (var S = se.stack.split(`
775
- `), X = x.stack.split(`
776
- `), B = S.length - 1, Y = X.length - 1; B >= 1 && Y >= 0 && S[B] !== X[Y]; )
777
- Y--;
778
- for (; B >= 1 && Y >= 0; B--, Y--)
779
- if (S[B] !== X[Y]) {
780
- if (B !== 1 || Y !== 1)
789
+ } catch (pe) {
790
+ if (pe && C && typeof pe.stack == "string") {
791
+ for (var T = pe.stack.split(`
792
+ `), K = C.stack.split(`
793
+ `), U = T.length - 1, B = K.length - 1; U >= 1 && B >= 0 && T[U] !== K[B]; )
794
+ B--;
795
+ for (; U >= 1 && B >= 0; U--, B--)
796
+ if (T[U] !== K[B]) {
797
+ if (U !== 1 || B !== 1)
781
798
  do
782
- if (B--, Y--, Y < 0 || S[B] !== X[Y]) {
783
- var ne = `
784
- ` + S[B].replace(" at new ", " at ");
785
- return a.displayName && ne.includes("<anonymous>") && (ne = ne.replace("<anonymous>", a.displayName)), typeof a == "function" && ge.set(a, ne), ne;
799
+ if (U--, B--, B < 0 || T[U] !== K[B]) {
800
+ var ie = `
801
+ ` + T[U].replace(" at new ", " at ");
802
+ return r.displayName && ie.includes("<anonymous>") && (ie = ie.replace("<anonymous>", r.displayName)), typeof r == "function" && xe.set(r, ie), ie;
786
803
  }
787
- while (B >= 1 && Y >= 0);
804
+ while (U >= 1 && B >= 0);
788
805
  break;
789
806
  }
790
807
  }
791
808
  } finally {
792
- Re = !1, Ue.current = _, ft(), Error.prepareStackTrace = k;
809
+ _e = !1, ze.current = k, yt(), Error.prepareStackTrace = M;
793
810
  }
794
- var ke = a ? a.displayName || a.name : "", Mt = ke ? me(ke) : "";
795
- return typeof a == "function" && ge.set(a, Mt), Mt;
811
+ var Ie = r ? r.displayName || r.name : "", Nt = Ie ? Ee(Ie) : "";
812
+ return typeof r == "function" && xe.set(r, Nt), Nt;
796
813
  }
797
- function et(a, f, m) {
798
- return Qe(a, !1);
814
+ function it(r, f, g) {
815
+ return rt(r, !1);
799
816
  }
800
- function tt(a) {
801
- var f = a.prototype;
817
+ function ot(r) {
818
+ var f = r.prototype;
802
819
  return !!(f && f.isReactComponent);
803
820
  }
804
- function ve(a, f, m) {
805
- if (a == null)
821
+ function we(r, f, g) {
822
+ if (r == null)
806
823
  return "";
807
- if (typeof a == "function")
808
- return Qe(a, tt(a));
809
- if (typeof a == "string")
810
- return me(a);
811
- switch (a) {
812
- case h:
813
- return me("Suspense");
824
+ if (typeof r == "function")
825
+ return rt(r, ot(r));
826
+ if (typeof r == "string")
827
+ return Ee(r);
828
+ switch (r) {
814
829
  case p:
815
- return me("SuspenseList");
830
+ return Ee("Suspense");
831
+ case h:
832
+ return Ee("SuspenseList");
816
833
  }
817
- if (typeof a == "object")
818
- switch (a.$$typeof) {
819
- case l:
820
- return et(a.render);
821
- case g:
822
- return ve(a.type, f, m);
823
- case E: {
824
- var x = a, k = x._payload, _ = x._init;
834
+ if (typeof r == "object")
835
+ switch (r.$$typeof) {
836
+ case d:
837
+ return it(r.render);
838
+ case b:
839
+ return we(r.type, f, g);
840
+ case x: {
841
+ var C = r, M = C._payload, k = C._init;
825
842
  try {
826
- return ve(_(k), f, m);
843
+ return we(k(M), f, g);
827
844
  } catch {
828
845
  }
829
846
  }
830
847
  }
831
848
  return "";
832
849
  }
833
- var je = Object.prototype.hasOwnProperty, nt = {}, $e = b.ReactDebugCurrentFrame;
834
- function ue(a) {
835
- if (a) {
836
- var f = a._owner, m = ve(a.type, a._source, f ? f.type : null);
837
- $e.setExtraStackFrame(m);
850
+ var ke = Object.prototype.hasOwnProperty, st = {}, He = y.ReactDebugCurrentFrame;
851
+ function ge(r) {
852
+ if (r) {
853
+ var f = r._owner, g = we(r.type, r._source, f ? f.type : null);
854
+ He.setExtraStackFrame(g);
838
855
  } else
839
- $e.setExtraStackFrame(null);
856
+ He.setExtraStackFrame(null);
840
857
  }
841
- function be(a, f, m, x, k) {
858
+ function Ce(r, f, g, C, M) {
842
859
  {
843
- var _ = Function.call.bind(je);
844
- for (var M in a)
845
- if (_(a, M)) {
846
- var S = void 0;
860
+ var k = Function.call.bind(ke);
861
+ for (var R in r)
862
+ if (k(r, R)) {
863
+ var T = void 0;
847
864
  try {
848
- if (typeof a[M] != "function") {
849
- var X = Error((x || "React class") + ": " + m + " type `" + M + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof a[M] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
850
- throw X.name = "Invariant Violation", X;
865
+ if (typeof r[R] != "function") {
866
+ var K = Error((C || "React class") + ": " + g + " type `" + R + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof r[R] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
867
+ throw K.name = "Invariant Violation", K;
851
868
  }
852
- S = a[M](f, M, x, m, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
853
- } catch (B) {
854
- S = B;
869
+ T = r[R](f, R, C, g, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
870
+ } catch (U) {
871
+ T = U;
855
872
  }
856
- S && !(S instanceof Error) && (ue(k), v("%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).", x || "React class", m, M, typeof S), ue(null)), S instanceof Error && !(S.message in nt) && (nt[S.message] = !0, ue(k), v("Failed %s type: %s", m, S.message), ue(null));
873
+ T && !(T instanceof Error) && (ge(M), w("%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", g, R, typeof T), ge(null)), T instanceof Error && !(T.message in st) && (st[T.message] = !0, ge(M), w("Failed %s type: %s", g, T.message), ge(null));
857
874
  }
858
875
  }
859
876
  }
860
- var pt = Array.isArray;
861
- function Ge(a) {
862
- return pt(a);
877
+ var xt = Array.isArray;
878
+ function Ke(r) {
879
+ return xt(r);
863
880
  }
864
- function at(a) {
881
+ function ct(r) {
865
882
  {
866
- var f = typeof Symbol == "function" && Symbol.toStringTag, m = f && a[Symbol.toStringTag] || a.constructor.name || "Object";
867
- return m;
883
+ var f = typeof Symbol == "function" && Symbol.toStringTag, g = f && r[Symbol.toStringTag] || r.constructor.name || "Object";
884
+ return g;
868
885
  }
869
886
  }
870
- function Ye(a) {
887
+ function Xe(r) {
871
888
  try {
872
- return rt(a), !1;
889
+ return lt(r), !1;
873
890
  } catch {
874
891
  return !0;
875
892
  }
876
893
  }
877
- function rt(a) {
878
- return "" + a;
894
+ function lt(r) {
895
+ return "" + r;
879
896
  }
880
- function it(a) {
881
- if (Ye(a))
882
- return v("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", at(a)), rt(a);
897
+ function ut(r) {
898
+ if (Xe(r))
899
+ return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", ct(r)), lt(r);
883
900
  }
884
- var de = b.ReactCurrentOwner, mt = {
901
+ var ve = y.ReactCurrentOwner, wt = {
885
902
  key: !0,
886
903
  ref: !0,
887
904
  __self: !0,
888
905
  __source: !0
889
- }, ot, Ve, ye;
890
- ye = {};
891
- function o(a) {
892
- if (je.call(a, "ref")) {
893
- var f = Object.getOwnPropertyDescriptor(a, "ref").get;
906
+ }, dt, qe, ue;
907
+ ue = {};
908
+ function i(r) {
909
+ if (ke.call(r, "ref")) {
910
+ var f = Object.getOwnPropertyDescriptor(r, "ref").get;
894
911
  if (f && f.isReactWarning)
895
912
  return !1;
896
913
  }
897
- return a.ref !== void 0;
914
+ return r.ref !== void 0;
898
915
  }
899
- function w(a) {
900
- if (je.call(a, "key")) {
901
- var f = Object.getOwnPropertyDescriptor(a, "key").get;
916
+ function E(r) {
917
+ if (ke.call(r, "key")) {
918
+ var f = Object.getOwnPropertyDescriptor(r, "key").get;
902
919
  if (f && f.isReactWarning)
903
920
  return !1;
904
921
  }
905
- return a.key !== void 0;
922
+ return r.key !== void 0;
906
923
  }
907
- function F(a, f) {
908
- if (typeof a.ref == "string" && de.current && f && de.current.stateNode !== f) {
909
- var m = L(de.current.type);
910
- ye[m] || (v('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', L(de.current.type), a.ref), ye[m] = !0);
924
+ function P(r, f) {
925
+ if (typeof r.ref == "string" && ve.current && f && ve.current.stateNode !== f) {
926
+ var g = ae(ve.current.type);
927
+ ue[g] || (w('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', ae(ve.current.type), r.ref), ue[g] = !0);
911
928
  }
912
929
  }
913
- function U(a, f) {
930
+ function _(r, f) {
914
931
  {
915
- var m = function() {
916
- ot || (ot = !0, v("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", f));
932
+ var g = function() {
933
+ dt || (dt = !0, w("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", f));
917
934
  };
918
- m.isReactWarning = !0, Object.defineProperty(a, "key", {
919
- get: m,
935
+ g.isReactWarning = !0, Object.defineProperty(r, "key", {
936
+ get: g,
920
937
  configurable: !0
921
938
  });
922
939
  }
923
940
  }
924
- function K(a, f) {
941
+ function W(r, f) {
925
942
  {
926
- var m = function() {
927
- Ve || (Ve = !0, v("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", f));
943
+ var g = function() {
944
+ qe || (qe = !0, w("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", f));
928
945
  };
929
- m.isReactWarning = !0, Object.defineProperty(a, "ref", {
930
- get: m,
946
+ g.isReactWarning = !0, Object.defineProperty(r, "ref", {
947
+ get: g,
931
948
  configurable: !0
932
949
  });
933
950
  }
934
951
  }
935
- var fe = function(a, f, m, x, k, _, M) {
936
- var S = {
952
+ var de = function(r, f, g, C, M, k, R) {
953
+ var T = {
937
954
  // This tag allows us to uniquely identify this as a React Element
938
955
  $$typeof: n,
939
956
  // Built-in properties that belong on the element
940
- type: a,
957
+ type: r,
941
958
  key: f,
942
- ref: m,
943
- props: M,
959
+ ref: g,
960
+ props: R,
944
961
  // Record the component responsible for creating this element.
945
- _owner: _
962
+ _owner: k
946
963
  };
947
- return S._store = {}, Object.defineProperty(S._store, "validated", {
964
+ return T._store = {}, Object.defineProperty(T._store, "validated", {
948
965
  configurable: !1,
949
966
  enumerable: !1,
950
967
  writable: !0,
951
968
  value: !1
952
- }), Object.defineProperty(S, "_self", {
969
+ }), Object.defineProperty(T, "_self", {
953
970
  configurable: !1,
954
971
  enumerable: !1,
955
972
  writable: !1,
956
- value: x
957
- }), Object.defineProperty(S, "_source", {
973
+ value: C
974
+ }), Object.defineProperty(T, "_source", {
958
975
  configurable: !1,
959
976
  enumerable: !1,
960
977
  writable: !1,
961
- value: k
962
- }), Object.freeze && (Object.freeze(S.props), Object.freeze(S)), S;
978
+ value: M
979
+ }), Object.freeze && (Object.freeze(T.props), Object.freeze(T)), T;
963
980
  };
964
- function ie(a, f, m, x, k) {
981
+ function J(r, f, g, C, M) {
965
982
  {
966
- var _, M = {}, S = null, X = null;
967
- m !== void 0 && (it(m), S = "" + m), w(f) && (it(f.key), S = "" + f.key), o(f) && (X = f.ref, F(f, k));
968
- for (_ in f)
969
- je.call(f, _) && !mt.hasOwnProperty(_) && (M[_] = f[_]);
970
- if (a && a.defaultProps) {
971
- var B = a.defaultProps;
972
- for (_ in B)
973
- M[_] === void 0 && (M[_] = B[_]);
983
+ var k, R = {}, T = null, K = null;
984
+ g !== void 0 && (ut(g), T = "" + g), E(f) && (ut(f.key), T = "" + f.key), i(f) && (K = f.ref, P(f, M));
985
+ for (k in f)
986
+ ke.call(f, k) && !wt.hasOwnProperty(k) && (R[k] = f[k]);
987
+ if (r && r.defaultProps) {
988
+ var U = r.defaultProps;
989
+ for (k in U)
990
+ R[k] === void 0 && (R[k] = U[k]);
974
991
  }
975
- if (S || X) {
976
- var Y = typeof a == "function" ? a.displayName || a.name || "Unknown" : a;
977
- S && U(M, Y), X && K(M, Y);
992
+ if (T || K) {
993
+ var B = typeof r == "function" ? r.displayName || r.name || "Unknown" : r;
994
+ T && _(R, B), K && W(R, B);
978
995
  }
979
- return fe(a, S, X, k, x, de.current, M);
996
+ return de(r, T, K, M, C, ve.current, R);
980
997
  }
981
998
  }
982
- var st = b.ReactCurrentOwner, ze = b.ReactDebugCurrentFrame;
983
- function W(a) {
984
- if (a) {
985
- var f = a._owner, m = ve(a.type, a._source, f ? f.type : null);
986
- ze.setExtraStackFrame(m);
999
+ var ft = y.ReactCurrentOwner, ht = y.ReactDebugCurrentFrame;
1000
+ function he(r) {
1001
+ if (r) {
1002
+ var f = r._owner, g = we(r.type, r._source, f ? f.type : null);
1003
+ ht.setExtraStackFrame(g);
987
1004
  } else
988
- ze.setExtraStackFrame(null);
1005
+ ht.setExtraStackFrame(null);
989
1006
  }
990
1007
  var Q;
991
1008
  Q = !1;
992
- function he(a) {
993
- return typeof a == "object" && a !== null && a.$$typeof === n;
1009
+ function ee(r) {
1010
+ return typeof r == "object" && r !== null && r.$$typeof === n;
994
1011
  }
995
- function pe() {
1012
+ function De() {
996
1013
  {
997
- if (st.current) {
998
- var a = L(st.current.type);
999
- if (a)
1014
+ if (ft.current) {
1015
+ var r = ae(ft.current.type);
1016
+ if (r)
1000
1017
  return `
1001
1018
 
1002
- Check the render method of \`` + a + "`.";
1019
+ Check the render method of \`` + r + "`.";
1003
1020
  }
1004
1021
  return "";
1005
1022
  }
1006
1023
  }
1007
- function Ee(a) {
1024
+ function Se(r) {
1008
1025
  {
1009
- if (a !== void 0) {
1010
- var f = a.fileName.replace(/^.*[\\\/]/, ""), m = a.lineNumber;
1026
+ if (r !== void 0) {
1027
+ var f = r.fileName.replace(/^.*[\\\/]/, ""), g = r.lineNumber;
1011
1028
  return `
1012
1029
 
1013
- Check your code at ` + f + ":" + m + ".";
1030
+ Check your code at ` + f + ":" + g + ".";
1014
1031
  }
1015
1032
  return "";
1016
1033
  }
1017
1034
  }
1018
- var we = {};
1019
- function Jt(a) {
1035
+ var be = {};
1036
+ function Ae(r) {
1020
1037
  {
1021
- var f = pe();
1038
+ var f = De();
1022
1039
  if (!f) {
1023
- var m = typeof a == "string" ? a : a.displayName || a.name;
1024
- m && (f = `
1040
+ var g = typeof r == "string" ? r : r.displayName || r.name;
1041
+ g && (f = `
1025
1042
 
1026
- Check the top-level render call using <` + m + ">.");
1043
+ Check the top-level render call using <` + g + ">.");
1027
1044
  }
1028
1045
  return f;
1029
1046
  }
1030
1047
  }
1031
- function St(a, f) {
1048
+ function Dt(r, f) {
1032
1049
  {
1033
- if (!a._store || a._store.validated || a.key != null)
1050
+ if (!r._store || r._store.validated || r.key != null)
1034
1051
  return;
1035
- a._store.validated = !0;
1036
- var m = Jt(f);
1037
- if (we[m])
1052
+ r._store.validated = !0;
1053
+ var g = Ae(f);
1054
+ if (be[g])
1038
1055
  return;
1039
- we[m] = !0;
1040
- var x = "";
1041
- a && a._owner && a._owner !== st.current && (x = " It was passed a child from " + L(a._owner.type) + "."), W(a), v('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', m, x), W(null);
1056
+ be[g] = !0;
1057
+ var C = "";
1058
+ r && r._owner && r._owner !== ft.current && (C = " It was passed a child from " + ae(r._owner.type) + "."), he(r), w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', g, C), he(null);
1042
1059
  }
1043
1060
  }
1044
- function Ot(a, f) {
1061
+ function At(r, f) {
1045
1062
  {
1046
- if (typeof a != "object")
1063
+ if (typeof r != "object")
1047
1064
  return;
1048
- if (Ge(a))
1049
- for (var m = 0; m < a.length; m++) {
1050
- var x = a[m];
1051
- he(x) && St(x, f);
1065
+ if (Ke(r))
1066
+ for (var g = 0; g < r.length; g++) {
1067
+ var C = r[g];
1068
+ ee(C) && Dt(C, f);
1052
1069
  }
1053
- else if (he(a))
1054
- a._store && (a._store.validated = !0);
1055
- else if (a) {
1056
- var k = y(a);
1057
- if (typeof k == "function" && k !== a.entries)
1058
- for (var _ = k.call(a), M; !(M = _.next()).done; )
1059
- he(M.value) && St(M.value, f);
1070
+ else if (ee(r))
1071
+ r._store && (r._store.validated = !0);
1072
+ else if (r) {
1073
+ var M = v(r);
1074
+ if (typeof M == "function" && M !== r.entries)
1075
+ for (var k = M.call(r), R; !(R = k.next()).done; )
1076
+ ee(R.value) && Dt(R.value, f);
1060
1077
  }
1061
1078
  }
1062
1079
  }
1063
- function Qt(a) {
1080
+ function fn(r) {
1064
1081
  {
1065
- var f = a.type;
1082
+ var f = r.type;
1066
1083
  if (f == null || typeof f == "string")
1067
1084
  return;
1068
- var m;
1085
+ var g;
1069
1086
  if (typeof f == "function")
1070
- m = f.propTypes;
1071
- else if (typeof f == "object" && (f.$$typeof === l || // Note: Memo only checks outer props here.
1087
+ g = f.propTypes;
1088
+ else if (typeof f == "object" && (f.$$typeof === d || // Note: Memo only checks outer props here.
1072
1089
  // Inner props are checked in the reconciler.
1073
- f.$$typeof === g))
1074
- m = f.propTypes;
1090
+ f.$$typeof === b))
1091
+ g = f.propTypes;
1075
1092
  else
1076
1093
  return;
1077
- if (m) {
1078
- var x = L(f);
1079
- be(m, a.props, "prop", x, a);
1094
+ if (g) {
1095
+ var C = ae(f);
1096
+ Ce(g, r.props, "prop", C, r);
1080
1097
  } else if (f.PropTypes !== void 0 && !Q) {
1081
1098
  Q = !0;
1082
- var k = L(f);
1083
- v("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", k || "Unknown");
1099
+ var M = ae(f);
1100
+ w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", M || "Unknown");
1084
1101
  }
1085
- typeof f.getDefaultProps == "function" && !f.getDefaultProps.isReactClassApproved && v("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
1102
+ typeof f.getDefaultProps == "function" && !f.getDefaultProps.isReactClassApproved && w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
1086
1103
  }
1087
1104
  }
1088
- function en(a) {
1105
+ function hn(r) {
1089
1106
  {
1090
- for (var f = Object.keys(a.props), m = 0; m < f.length; m++) {
1091
- var x = f[m];
1092
- if (x !== "children" && x !== "key") {
1093
- W(a), v("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", x), W(null);
1107
+ for (var f = Object.keys(r.props), g = 0; g < f.length; g++) {
1108
+ var C = f[g];
1109
+ if (C !== "children" && C !== "key") {
1110
+ he(r), w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", C), he(null);
1094
1111
  break;
1095
1112
  }
1096
1113
  }
1097
- a.ref !== null && (W(a), v("Invalid attribute `ref` supplied to `React.Fragment`."), W(null));
1114
+ r.ref !== null && (he(r), w("Invalid attribute `ref` supplied to `React.Fragment`."), he(null));
1098
1115
  }
1099
1116
  }
1100
- function Tt(a, f, m, x, k, _) {
1117
+ function It(r, f, g, C, M, k) {
1101
1118
  {
1102
- var M = oe(a);
1103
- if (!M) {
1104
- var S = "";
1105
- (a === void 0 || typeof a == "object" && a !== null && Object.keys(a).length === 0) && (S += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
1106
- var X = Ee(k);
1107
- X ? S += X : S += pe();
1108
- var B;
1109
- a === null ? B = "null" : Ge(a) ? B = "array" : a !== void 0 && a.$$typeof === n ? (B = "<" + (L(a.type) || "Unknown") + " />", S = " Did you accidentally export a JSX literal instead of a component?") : B = typeof a, v("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", B, S);
1119
+ var R = D(r);
1120
+ if (!R) {
1121
+ var T = "";
1122
+ (r === void 0 || typeof r == "object" && r !== null && Object.keys(r).length === 0) && (T += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
1123
+ var K = Se(M);
1124
+ K ? T += K : T += De();
1125
+ var U;
1126
+ r === null ? U = "null" : Ke(r) ? U = "array" : r !== void 0 && r.$$typeof === n ? (U = "<" + (ae(r.type) || "Unknown") + " />", T = " Did you accidentally export a JSX literal instead of a component?") : U = typeof r, w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", U, T);
1110
1127
  }
1111
- var Y = ie(a, f, m, k, _);
1112
- if (Y == null)
1113
- return Y;
1114
- if (M) {
1115
- var ne = f.children;
1116
- if (ne !== void 0)
1117
- if (x)
1118
- if (Ge(ne)) {
1119
- for (var ke = 0; ke < ne.length; ke++)
1120
- Ot(ne[ke], a);
1121
- Object.freeze && Object.freeze(ne);
1128
+ var B = J(r, f, g, M, k);
1129
+ if (B == null)
1130
+ return B;
1131
+ if (R) {
1132
+ var ie = f.children;
1133
+ if (ie !== void 0)
1134
+ if (C)
1135
+ if (Ke(ie)) {
1136
+ for (var Ie = 0; Ie < ie.length; Ie++)
1137
+ At(ie[Ie], r);
1138
+ Object.freeze && Object.freeze(ie);
1122
1139
  } else
1123
- v("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
1140
+ w("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
1124
1141
  else
1125
- Ot(ne, a);
1142
+ At(ie, r);
1126
1143
  }
1127
- return a === e ? en(Y) : Qt(Y), Y;
1144
+ return r === e ? hn(B) : fn(B), B;
1128
1145
  }
1129
1146
  }
1130
- function tn(a, f, m) {
1131
- return Tt(a, f, m, !0);
1147
+ function pn(r, f, g) {
1148
+ return It(r, f, g, !0);
1132
1149
  }
1133
- function nn(a, f, m) {
1134
- return Tt(a, f, m, !1);
1150
+ function mn(r, f, g) {
1151
+ return It(r, f, g, !1);
1135
1152
  }
1136
- var an = nn, rn = tn;
1137
- Ke.Fragment = e, Ke.jsx = an, Ke.jsxs = rn;
1138
- }()), Ke;
1153
+ var gn = mn, vn = pn;
1154
+ Qe.Fragment = e, Qe.jsx = gn, Qe.jsxs = vn;
1155
+ }()), Qe;
1139
1156
  }
1140
- process.env.NODE_ENV === "production" ? Et.exports = Nn() : Et.exports = Ln();
1141
- var u = Et.exports;
1142
- function qt(t) {
1143
- return t.title.search("<") > -1 ? /* @__PURE__ */ u.jsx("button", { className: "svg", dangerouslySetInnerHTML: { __html: t.title } }) : /* @__PURE__ */ u.jsx("button", { children: t.title });
1157
+ process.env.NODE_ENV === "production" ? Pt.exports = Zn() : Pt.exports = Jn();
1158
+ var l = Pt.exports;
1159
+ function ln(t) {
1160
+ return t.title.search("<") > -1 ? /* @__PURE__ */ l.jsx("button", { className: "svg", dangerouslySetInnerHTML: { __html: t.title } }) : /* @__PURE__ */ l.jsx("button", { children: t.title });
1144
1161
  }
1145
- const Fn = /* @__PURE__ */ u.jsxs("svg", { className: "closeIcon", width: "14", height: "14", fill: "none", stroke: "#666666", strokeMiterlimit: "10", children: [
1146
- /* @__PURE__ */ u.jsx("circle", { cx: "7", cy: "7", r: "6" }),
1147
- /* @__PURE__ */ u.jsx("line", { x1: "4", y1: "4", x2: "10", y2: "10" }),
1148
- /* @__PURE__ */ u.jsx("line", { x1: "4", y1: "10", x2: "10", y2: "4" })
1149
- ] }), Un = /* @__PURE__ */ u.jsx("svg", { className: "dragIcon", width: "14", height: "14", fill: "#666666", stroke: "none", children: /* @__PURE__ */ u.jsx(
1162
+ const Qn = /* @__PURE__ */ l.jsxs("svg", { className: "closeIcon", width: "14", height: "14", fill: "none", stroke: "#666666", strokeMiterlimit: "10", children: [
1163
+ /* @__PURE__ */ l.jsx("circle", { cx: "7", cy: "7", r: "6" }),
1164
+ /* @__PURE__ */ l.jsx("line", { x1: "4", y1: "4", x2: "10", y2: "10" }),
1165
+ /* @__PURE__ */ l.jsx("line", { x1: "4", y1: "10", x2: "10", y2: "4" })
1166
+ ] }), ea = /* @__PURE__ */ l.jsx("svg", { className: "dragIcon", width: "14", height: "14", fill: "#666666", stroke: "none", children: /* @__PURE__ */ l.jsx(
1150
1167
  "path",
1151
1168
  {
1152
1169
  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
@@ -1154,46 +1171,46 @@ 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
1154
1171
  C11,8.22,10.74,8,10.43,8z`
1155
1172
  }
1156
1173
  ) });
1157
- function Bn(t) {
1158
- return /* @__PURE__ */ u.jsx(Wt.Item, { value: t.title, children: /* @__PURE__ */ u.jsxs("div", { children: [
1159
- Un,
1160
- /* @__PURE__ */ u.jsx("span", { children: t.title }),
1161
- /* @__PURE__ */ u.jsx("button", { className: "closeIcon", onClick: () => {
1174
+ function ta(t) {
1175
+ return /* @__PURE__ */ l.jsx(an.Item, { value: t.title, children: /* @__PURE__ */ l.jsxs("div", { children: [
1176
+ ea,
1177
+ /* @__PURE__ */ l.jsx("span", { children: t.title }),
1178
+ /* @__PURE__ */ l.jsx("button", { className: "closeIcon", onClick: () => {
1162
1179
  t.onDelete(t.index);
1163
- }, children: Fn })
1180
+ }, children: Qn })
1164
1181
  ] }) }, t.title);
1165
1182
  }
1166
- function $n(t) {
1167
- const [n, r] = re(!1), [e, i] = re(t.options), d = (h) => {
1168
- t.onDragComplete(h), i(h);
1169
- }, c = (h) => {
1170
- const p = [...e];
1171
- p.splice(h, 1), d(p);
1183
+ function na(t) {
1184
+ const [n, a] = ne(!1), [e, o] = ne(t.options), u = (p) => {
1185
+ t.onDragComplete(p), o(p);
1186
+ }, c = (p) => {
1187
+ const h = [...e];
1188
+ h.splice(p, 1), u(h);
1172
1189
  }, s = [];
1173
- e.forEach((h, p) => {
1174
- s.push(/* @__PURE__ */ u.jsx(Bn, { index: p, title: h, onDelete: c }, h));
1190
+ e.forEach((p, h) => {
1191
+ s.push(/* @__PURE__ */ l.jsx(ta, { index: h, title: p, onDelete: c }, p));
1175
1192
  });
1176
- let l = "dropdown draggable";
1177
- return t.subdropdown && (l += " subdropdown"), /* @__PURE__ */ u.jsxs("div", { className: l, onMouseEnter: () => r(!0), onMouseLeave: () => r(!1), children: [
1178
- /* @__PURE__ */ u.jsx(qt, { title: t.title }),
1179
- /* @__PURE__ */ u.jsx(Wt.Group, { axis: "y", values: e, onReorder: d, style: { visibility: n ? "visible" : "hidden" }, children: s })
1193
+ let d = "dropdown draggable";
1194
+ return t.subdropdown && (d += " subdropdown"), /* @__PURE__ */ l.jsxs("div", { className: d, onMouseEnter: () => a(!0), onMouseLeave: () => a(!1), children: [
1195
+ /* @__PURE__ */ l.jsx(ln, { title: t.title }),
1196
+ /* @__PURE__ */ l.jsx(an.Group, { axis: "y", values: e, onReorder: u, style: { visibility: n ? "visible" : "hidden" }, children: s })
1180
1197
  ] });
1181
1198
  }
1182
- function Gn(t) {
1183
- const [n, r] = re(!1), e = [];
1184
- t.options.map((d, c) => {
1185
- t.onSelect !== void 0 && (d.onSelect = t.onSelect), e.push(/* @__PURE__ */ u.jsx(Yn, { option: d }, c));
1199
+ function aa(t) {
1200
+ const [n, a] = ne(!1), e = [];
1201
+ t.options.map((u, c) => {
1202
+ t.onSelect !== void 0 && (u.onSelect = t.onSelect), e.push(/* @__PURE__ */ l.jsx(ra, { option: u }, c));
1186
1203
  });
1187
- let i = "dropdown";
1188
- return t.subdropdown && (i += " subdropdown"), /* @__PURE__ */ u.jsxs(
1204
+ let o = "dropdown";
1205
+ return t.subdropdown && (o += " subdropdown"), /* @__PURE__ */ l.jsxs(
1189
1206
  "div",
1190
1207
  {
1191
- className: i,
1192
- onMouseEnter: () => r(!0),
1193
- onMouseLeave: () => r(!1),
1208
+ className: o,
1209
+ onMouseEnter: () => a(!0),
1210
+ onMouseLeave: () => a(!1),
1194
1211
  children: [
1195
- /* @__PURE__ */ u.jsx(qt, { title: t.title }),
1196
- /* @__PURE__ */ u.jsx(
1212
+ /* @__PURE__ */ l.jsx(ln, { title: t.title }),
1213
+ /* @__PURE__ */ l.jsx(
1197
1214
  "ul",
1198
1215
  {
1199
1216
  style: { visibility: n ? "visible" : "hidden" },
@@ -1204,26 +1221,26 @@ function Gn(t) {
1204
1221
  }
1205
1222
  );
1206
1223
  }
1207
- function Yn(t) {
1208
- const { option: n } = t, [r, e] = re("");
1209
- let i;
1224
+ function ra(t) {
1225
+ const { option: n } = t, [a, e] = ne("");
1226
+ let o;
1210
1227
  switch (n.type) {
1211
1228
  case "draggable":
1212
- i = /* @__PURE__ */ u.jsx(
1213
- $n,
1229
+ o = /* @__PURE__ */ l.jsx(
1230
+ na,
1214
1231
  {
1215
1232
  title: n.title,
1216
1233
  options: n.value,
1217
- onDragComplete: (d) => {
1218
- n.onDragComplete !== void 0 && n.onDragComplete(d);
1234
+ onDragComplete: (u) => {
1235
+ n.onDragComplete !== void 0 && n.onDragComplete(u);
1219
1236
  },
1220
1237
  subdropdown: !0
1221
1238
  }
1222
1239
  );
1223
1240
  break;
1224
1241
  case "dropdown":
1225
- i = /* @__PURE__ */ u.jsx(
1226
- Gn,
1242
+ o = /* @__PURE__ */ l.jsx(
1243
+ aa,
1227
1244
  {
1228
1245
  title: n.title,
1229
1246
  options: n.value,
@@ -1233,173 +1250,344 @@ function Yn(t) {
1233
1250
  );
1234
1251
  break;
1235
1252
  case "option":
1236
- i = /* @__PURE__ */ u.jsx(
1253
+ o = /* @__PURE__ */ l.jsx(
1237
1254
  "button",
1238
1255
  {
1239
1256
  onClick: () => {
1240
- n.onSelect !== void 0 && n.onSelect(n.value), n.selectable && (r !== n.title ? e(n.title) : e(""));
1257
+ n.onSelect !== void 0 && n.onSelect(n.value), n.selectable && (a !== n.title ? e(n.title) : e(""));
1241
1258
  },
1242
1259
  children: n.title
1243
1260
  }
1244
1261
  );
1245
1262
  break;
1246
1263
  }
1247
- return /* @__PURE__ */ u.jsx("li", { className: r === n.title ? "selected" : "", children: i }, Rn());
1264
+ return /* @__PURE__ */ l.jsx("li", { className: a === n.title ? "selected" : "", children: o }, Gn());
1248
1265
  }
1249
- function Sa(t) {
1266
+ function Ka(t) {
1250
1267
  let n;
1251
- function r(c) {
1252
- var l, h, p, g, E, C, P, D, y;
1268
+ function a(c) {
1269
+ var d, p, h, b, x, S, O, m, v;
1253
1270
  let s;
1254
1271
  switch (c.event) {
1255
1272
  case "custom":
1256
- A.dispatchEvent({ type: N.CUSTOM, value: c.data });
1273
+ I.dispatchEvent({ type: N.CUSTOM, value: c.data });
1257
1274
  break;
1258
1275
  case "selectComponent":
1259
- A.dispatchEvent({ type: N.SELECT_DROPDOWN, value: c.data });
1276
+ I.dispatchEvent({ type: N.SELECT_DROPDOWN, value: c.data });
1260
1277
  break;
1261
1278
  case "draggableListUpdate":
1262
- A.dispatchEvent({ type: N.DRAG_UPDATE, value: c.data });
1279
+ I.dispatchEvent({ type: N.DRAG_UPDATE, value: c.data });
1263
1280
  break;
1264
1281
  case "addFolder":
1265
- (l = t.components.get("debug")) == null || l.addFolder(c.data.name, c.data.params, c.data.parent);
1282
+ (d = t.components.get("debug")) == null || d.addFolder(c.data.name, c.data.params, c.data.parent);
1266
1283
  break;
1267
1284
  case "bindObject":
1268
- (h = t.components.get("debug")) == null || h.bind(c.data.name, c.data.params, c.data.parent);
1285
+ (p = t.components.get("debug")) == null || p.bind(c.data.name, c.data.params, c.data.parent);
1269
1286
  break;
1270
1287
  case "updateBind":
1271
- (p = t.components.get("debug")) == null || p.triggerBind(c.data.id, c.data.value);
1288
+ (h = t.components.get("debug")) == null || h.triggerBind(c.data.id, c.data.value);
1272
1289
  break;
1273
1290
  case "addButton":
1274
- (g = t.components.get("debug")) == null || g.button(c.data.name, c.data.callback, c.data.parent);
1291
+ (b = t.components.get("debug")) == null || b.button(c.data.name, c.data.callback, c.data.parent);
1275
1292
  break;
1276
1293
  case "clickButton":
1277
- (E = t.components.get("debug")) == null || E.triggerButton(c.data.id);
1294
+ (x = t.components.get("debug")) == null || x.triggerButton(c.data.id);
1278
1295
  break;
1279
1296
  case "setSheet":
1280
- s = (C = t.components.get("theatre")) == null ? void 0 : C.sheets.get(c.data.sheet), s !== void 0 && (n = s, We.setSelection([s]));
1297
+ s = (S = t.components.get("theatre")) == null ? void 0 : S.sheets.get(c.data.sheet), s !== void 0 && (n = s, Ze.setSelection([s]));
1281
1298
  break;
1282
1299
  case "setSheetObject":
1283
- s = (P = t.components.get("theatre")) == null ? void 0 : P.sheetObjects.get(`${c.data.sheet}_${c.data.key}`), s !== void 0 && We.setSelection([s]);
1300
+ s = (O = t.components.get("theatre")) == null ? void 0 : O.sheetObjects.get(`${c.data.sheet}_${c.data.key}`), s !== void 0 && Ze.setSelection([s]);
1284
1301
  break;
1285
1302
  case "updateSheetObject":
1286
- s = (D = t.components.get("theatre")) == null ? void 0 : D.sheetObjectCBs.get(c.data.sheetObject), s !== void 0 && s(c.data.values);
1303
+ s = (m = t.components.get("theatre")) == null ? void 0 : m.sheetObjectCBs.get(c.data.sheetObject), s !== void 0 && s(c.data.values);
1287
1304
  break;
1288
1305
  case "updateTimeline":
1289
- n = (y = t.components.get("theatre")) == null ? void 0 : y.sheets.get(c.data.sheet), n !== void 0 && (n.sequence.position = c.data.position);
1290
- break;
1291
- case "getScene":
1292
- A.dispatchEvent({ type: N.GET_SCENE });
1306
+ n = (v = t.components.get("theatre")) == null ? void 0 : v.sheets.get(c.data.sheet), n !== void 0 && (n.sequence.position = c.data.position);
1293
1307
  break;
1294
1308
  case "getObject":
1295
- A.dispatchEvent({ type: N.GET_OBJECT, value: c.data });
1309
+ I.dispatchEvent({ type: N.GET_OBJECT, value: c.data });
1296
1310
  break;
1297
1311
  case "updateObject":
1298
- A.dispatchEvent({ type: N.UPDATE_OBJECT, value: c.data });
1312
+ I.dispatchEvent({ type: N.UPDATE_OBJECT, value: c.data });
1299
1313
  break;
1300
1314
  case "createTexture":
1301
- A.dispatchEvent({ type: N.CREATE_TEXTURE, value: c.data });
1315
+ I.dispatchEvent({ type: N.CREATE_TEXTURE, value: c.data });
1302
1316
  break;
1303
1317
  case "requestMethod":
1304
- A.dispatchEvent({ type: N.REQUEST_METHOD, value: c.data });
1318
+ I.dispatchEvent({ type: N.REQUEST_METHOD, value: c.data });
1305
1319
  break;
1306
1320
  }
1307
1321
  }
1308
1322
  function e(c) {
1309
1323
  switch (c.event) {
1310
1324
  case "custom":
1311
- A.dispatchEvent({ type: N.CUSTOM, value: c.data });
1325
+ I.dispatchEvent({ type: N.CUSTOM, value: c.data });
1312
1326
  break;
1313
1327
  case "setObject":
1314
- A.dispatchEvent({ type: N.SET_OBJECT, value: c.data });
1328
+ I.dispatchEvent({ type: N.SET_OBJECT, value: c.data });
1315
1329
  break;
1316
1330
  case "setScene":
1317
- A.dispatchEvent({ type: N.SET_SCENE, value: c.data });
1331
+ I.dispatchEvent({ type: N.SET_SCENE, value: c.data });
1318
1332
  break;
1319
1333
  }
1320
1334
  }
1321
- function i() {
1322
- We.ui.hide();
1335
+ function o() {
1336
+ Ze.ui.hide();
1323
1337
  }
1324
- function d() {
1325
- We.ui.restore(), We.onSelectionChange((h) => {
1326
- h.length < 1 || h.forEach((p) => {
1327
- var P;
1328
- let g = p.address.sheetId, E = "setSheet", C = {};
1329
- switch (p.type) {
1338
+ function u() {
1339
+ Ze.ui.restore(), Ze.onSelectionChange((p) => {
1340
+ p.length < 1 || p.forEach((h) => {
1341
+ var O;
1342
+ let b = h.address.sheetId, x = "setSheet", S = {};
1343
+ switch (h.type) {
1330
1344
  case "Theatre_Sheet_PublicAPI":
1331
- E = "setSheet", C = {
1332
- sheet: p.address.sheetId
1333
- }, n = (P = t.components.get("theatre")) == null ? void 0 : P.sheets.get(p.address.sheetId);
1345
+ x = "setSheet", S = {
1346
+ sheet: h.address.sheetId
1347
+ }, n = (O = t.components.get("theatre")) == null ? void 0 : O.sheets.get(h.address.sheetId);
1334
1348
  break;
1335
1349
  case "Theatre_SheetObject_PublicAPI":
1336
- E = "setSheetObject", g += `_${p.address.objectKey}`, C = {
1337
- id: g,
1338
- sheet: p.address.sheetId,
1339
- key: p.address.objectKey
1350
+ x = "setSheetObject", b += `_${h.address.objectKey}`, S = {
1351
+ id: b,
1352
+ sheet: h.address.sheetId,
1353
+ key: h.address.objectKey
1340
1354
  };
1341
1355
  break;
1342
1356
  }
1343
- t.send({ event: E, target: "app", data: C });
1357
+ t.send({ event: x, target: "app", data: S });
1344
1358
  });
1345
1359
  });
1346
1360
  let c = 0;
1347
1361
  const s = () => {
1348
1362
  if (n !== void 0 && c !== n.sequence.position) {
1349
1363
  c = n.sequence.position;
1350
- const h = n;
1364
+ const p = n;
1351
1365
  t.send({
1352
1366
  event: "updateTimeline",
1353
1367
  target: "app",
1354
1368
  data: {
1355
1369
  position: c,
1356
- sheet: h.address.sheetId
1370
+ sheet: p.address.sheetId
1357
1371
  }
1358
1372
  });
1359
1373
  }
1360
- }, l = () => {
1361
- s(), requestAnimationFrame(l);
1374
+ }, d = () => {
1375
+ s(), requestAnimationFrame(d);
1362
1376
  };
1363
- s(), l();
1377
+ s(), d();
1364
1378
  }
1365
1379
  t.listen((c) => {
1366
- t.editor ? e(c) : r(c);
1367
- }), t.editor ? d() : i();
1380
+ t.editor ? e(c) : a(c);
1381
+ }), t.editor ? u() : o();
1382
+ }
1383
+ const ia = `out vec3 worldPosition;
1384
+ uniform float uDistance;
1385
+
1386
+ void main() {
1387
+ // Scale the plane by the drawing distance
1388
+ worldPosition = position.xzy * uDistance;
1389
+ worldPosition.xz += cameraPosition.xz;
1390
+
1391
+ gl_Position = projectionMatrix * modelViewMatrix * vec4(worldPosition, 1.0);
1392
+ }`, oa = `out vec4 fragColor;
1393
+ in vec3 worldPosition;
1394
+
1395
+ uniform float uDivisions;
1396
+ uniform float uScale;
1397
+ uniform vec3 uColor;
1398
+ uniform float uDistance;
1399
+ uniform float uSubgridOpacity;
1400
+ uniform float uGridOpacity;
1401
+
1402
+ float getGrid(float gapSize) {
1403
+ vec2 worldPositionByDivision = worldPosition.xz / gapSize;
1404
+
1405
+ // Inverted, 0 where line, >1 where there's no line
1406
+ // We use the worldPosition (which in this case we use similarly to UVs) differential to control the anti-aliasing
1407
+ // We need to do the -0.5)-0.5 trick because the result fades out from 0 to 1, and we want both
1408
+ // worldPositionByDivision == 0.3 and worldPositionByDivision == 0.7 to result in the same fade, i.e. 0.3,
1409
+ // otherwise only one side of the line will be anti-aliased
1410
+ vec2 grid = abs(fract(worldPositionByDivision-0.5)-0.5) / fwidth(worldPositionByDivision) / 2.0;
1411
+ float gridLine = min(grid.x, grid.y);
1412
+
1413
+ // Uninvert and clamp
1414
+ return 1.0 - min(gridLine, 1.0);
1415
+ }
1416
+
1417
+ void main() {
1418
+ float cameraDistanceToGridPlane = distance(cameraPosition.y, worldPosition.y);
1419
+ float cameraDistanceToFragmentOnGridPlane = distance(cameraPosition.xz, worldPosition.xz);
1420
+
1421
+ // The size of the grid and subgrid are powers of each other and they are determined based on camera distance.
1422
+ // The current grid will become the next subgrid when it becomes too small, and its next power becomes the new grid.
1423
+ float subGridPower = pow(uDivisions, floor(log(cameraDistanceToGridPlane) / log(uDivisions)));
1424
+ float gridPower = subGridPower * uDivisions;
1425
+
1426
+ // If we want to fade both the grid and its subgrid, we need to displays 3 different opacities, with the next grid being the third
1427
+ float nextGridPower = gridPower * uDivisions;
1428
+
1429
+ // 1 where grid, 0 where no grid
1430
+ float subgrid = getGrid(subGridPower * uScale);
1431
+ float grid = getGrid(gridPower * uScale);
1432
+ float nextGrid = getGrid(nextGridPower * uScale);
1433
+
1434
+ // Where we are between the introduction of the current grid power and when we switch to the next grid power
1435
+ float stepPercentage = (cameraDistanceToGridPlane - subGridPower)/(gridPower - subGridPower);
1436
+
1437
+ // The last x percentage of the current step over which we want to fade
1438
+ float fadeRange = 0.3;
1439
+
1440
+ // We calculate the fade percentage from the step percentage and the fade range
1441
+ float fadePercentage = max(stepPercentage - 1.0 + fadeRange, 0.0) / fadeRange;
1442
+
1443
+ // Set base opacity based on how close we are to the drawing distance, with a cubic falloff
1444
+ float baseOpacity = subgrid * pow(1.0 - min(cameraDistanceToFragmentOnGridPlane / uDistance, 1.0), 3.0);
1445
+
1446
+ // Shade the subgrid
1447
+ fragColor = vec4(uColor.rgb, (baseOpacity - fadePercentage) * uSubgridOpacity);
1448
+
1449
+ // Somewhat arbitrary additional fade coefficient to counter anti-aliasing popping when switching between grid powers
1450
+ float fadeCoefficient = 0.5;
1451
+
1452
+ // Shade the grid
1453
+ fragColor.a = mix(fragColor.a, baseOpacity * uGridOpacity - fadePercentage * (uGridOpacity - uSubgridOpacity) * fadeCoefficient, grid);
1454
+
1455
+ // Shade the next grid
1456
+ fragColor.a = mix(fragColor.a, baseOpacity * uGridOpacity, nextGrid);
1457
+
1458
+ if (fragColor.a <= 0.0) discard;
1459
+ }`;
1460
+ class sa extends Qt {
1461
+ constructor(n) {
1462
+ super({
1463
+ extensions: {
1464
+ derivatives: !0
1465
+ },
1466
+ glslVersion: wn,
1467
+ side: Cn,
1468
+ transparent: !0,
1469
+ uniforms: {
1470
+ uScale: {
1471
+ value: (n == null ? void 0 : n.scale) !== void 0 ? n == null ? void 0 : n.scale : 0.1
1472
+ },
1473
+ uDivisions: {
1474
+ value: (n == null ? void 0 : n.divisions) !== void 0 ? n == null ? void 0 : n.divisions : 10
1475
+ },
1476
+ uColor: {
1477
+ value: (n == null ? void 0 : n.color) !== void 0 ? n == null ? void 0 : n.color : new kt(16777215)
1478
+ },
1479
+ uDistance: {
1480
+ value: (n == null ? void 0 : n.distance) !== void 0 ? n == null ? void 0 : n.distance : 1e4
1481
+ },
1482
+ uSubgridOpacity: {
1483
+ value: (n == null ? void 0 : n.subgridOpacity) !== void 0 ? n == null ? void 0 : n.subgridOpacity : 0.15
1484
+ },
1485
+ uGridOpacity: {
1486
+ value: (n == null ? void 0 : n.gridOpacity) !== void 0 ? n == null ? void 0 : n.gridOpacity : 0.25
1487
+ }
1488
+ },
1489
+ vertexShader: ia,
1490
+ fragmentShader: oa,
1491
+ name: "InfiniteGrid",
1492
+ depthWrite: !1
1493
+ });
1494
+ }
1495
+ }
1496
+ class ca extends Sn {
1497
+ constructor() {
1498
+ const a = new sa();
1499
+ super(new On(2, 2), a);
1500
+ $(this, "gridMaterial");
1501
+ this.gridMaterial = a, this.frustumCulled = !1, this.name = "InfiniteGridHelper", this.position.y = 0.1;
1502
+ }
1503
+ update() {
1504
+ this.gridMaterial.needsUpdate = !0;
1505
+ }
1368
1506
  }
1369
- function wt(t) {
1370
- const [n, r] = re(t.open !== void 0 ? t.open : !0), e = !n || t.children === void 0;
1371
- return /* @__PURE__ */ u.jsxs("div", { className: `accordion ${e ? "hide" : ""}`, children: [
1372
- /* @__PURE__ */ u.jsxs(
1507
+ const la = `#include <common>
1508
+ #include <batching_pars_vertex>
1509
+ #include <uv_pars_vertex>
1510
+ #include <color_pars_vertex>
1511
+ #include <morphtarget_pars_vertex>
1512
+ #include <skinning_pars_vertex>
1513
+ #include <logdepthbuf_pars_vertex>
1514
+ #include <clipping_planes_pars_vertex>
1515
+
1516
+ void main() {
1517
+ #include <uv_vertex>
1518
+ #include <color_vertex>
1519
+ #include <morphcolor_vertex>
1520
+ #include <batching_vertex>
1521
+
1522
+ #if defined ( USE_SKINNING )
1523
+ #include <beginnormal_vertex>
1524
+ #include <morphnormal_vertex>
1525
+ #include <skinbase_vertex>
1526
+ #include <skinnormal_vertex>
1527
+ #include <defaultnormal_vertex>
1528
+ #endif
1529
+
1530
+ #include <begin_vertex>
1531
+ #include <morphtarget_vertex>
1532
+ #include <skinning_vertex>
1533
+ #include <project_vertex>
1534
+ #include <logdepthbuf_vertex>
1535
+ #include <clipping_planes_vertex>
1536
+ #include <worldpos_vertex>
1537
+ }`, ua = `
1538
+ #include <common>
1539
+ #include <uv_pars_fragment>
1540
+ #include <clipping_planes_pars_fragment>
1541
+
1542
+ void main() {
1543
+ #include <clipping_planes_fragment>
1544
+ gl_FragColor = vec4(vec3(vUv, 0.0), 1.0);
1545
+ }`;
1546
+ class da extends Qt {
1547
+ constructor() {
1548
+ super({
1549
+ defines: {
1550
+ USE_UV: ""
1551
+ },
1552
+ vertexShader: la,
1553
+ fragmentShader: ua
1554
+ });
1555
+ }
1556
+ }
1557
+ function jt(t) {
1558
+ const [n, a] = ne(t.open !== void 0 ? t.open : !0), e = !n || t.children === void 0;
1559
+ return /* @__PURE__ */ l.jsxs("div", { className: `accordion ${e ? "hide" : ""}`, children: [
1560
+ /* @__PURE__ */ l.jsxs(
1373
1561
  "button",
1374
1562
  {
1375
1563
  className: "toggle",
1376
1564
  onClick: () => {
1377
- const i = !n;
1378
- t.onToggle !== void 0 && t.onToggle(i), r(i);
1565
+ const o = !n;
1566
+ t.onToggle !== void 0 && t.onToggle(o), a(o);
1379
1567
  },
1380
1568
  children: [
1381
- /* @__PURE__ */ u.jsx(
1569
+ /* @__PURE__ */ l.jsx(
1382
1570
  "p",
1383
1571
  {
1384
1572
  className: `status ${n ? "open" : ""}`,
1385
1573
  children: "Toggle"
1386
1574
  }
1387
1575
  ),
1388
- /* @__PURE__ */ u.jsx("p", { className: "label", children: t.label })
1576
+ /* @__PURE__ */ l.jsx("p", { className: "label", children: t.label })
1389
1577
  ]
1390
1578
  }
1391
1579
  ),
1392
1580
  t.button,
1393
- /* @__PURE__ */ u.jsx("div", { className: n ? "open" : "", children: /* @__PURE__ */ u.jsx("div", { children: t.children }) })
1581
+ /* @__PURE__ */ l.jsx("div", { className: n ? "open" : "", children: /* @__PURE__ */ l.jsx("div", { children: t.children }) })
1394
1582
  ] });
1395
1583
  }
1396
- function Zt(t) {
1397
- const [n, r] = re(!1), e = t.child.children.length > 0, i = [];
1398
- return t.child.children.length > 0 && t.child.children.map((d) => {
1399
- i.push(/* @__PURE__ */ u.jsx(Zt, { child: d, three: t.three }, Math.random()));
1400
- }), /* @__PURE__ */ u.jsxs("div", { className: "childObject", children: [
1401
- /* @__PURE__ */ u.jsxs("div", { className: "child", children: [
1402
- e ? /* @__PURE__ */ u.jsx(
1584
+ function un(t) {
1585
+ const [n, a] = ne(!1), e = t.child.children.length > 0, o = [];
1586
+ return t.child.children.length > 0 && t.child.children.map((u) => {
1587
+ o.push(/* @__PURE__ */ l.jsx(un, { child: u, three: t.three }, Math.random()));
1588
+ }), /* @__PURE__ */ l.jsxs("div", { className: "childObject", children: [
1589
+ /* @__PURE__ */ l.jsxs("div", { className: "child", children: [
1590
+ e ? /* @__PURE__ */ l.jsx(
1403
1591
  "button",
1404
1592
  {
1405
1593
  className: "status",
@@ -1407,11 +1595,11 @@ function Zt(t) {
1407
1595
  backgroundPositionX: n ? "-14px" : "2px"
1408
1596
  },
1409
1597
  onClick: () => {
1410
- r(!n);
1598
+ a(!n);
1411
1599
  }
1412
1600
  }
1413
1601
  ) : null,
1414
- /* @__PURE__ */ u.jsx(
1602
+ /* @__PURE__ */ l.jsx(
1415
1603
  "button",
1416
1604
  {
1417
1605
  className: "name",
@@ -1424,32 +1612,32 @@ function Zt(t) {
1424
1612
  children: t.child.name.length > 0 ? `${t.child.name} (${t.child.type})` : `${t.child.type}::${t.child.uuid}`
1425
1613
  }
1426
1614
  ),
1427
- /* @__PURE__ */ u.jsx("div", { className: `icon ${Dn(t.child)}` })
1615
+ /* @__PURE__ */ l.jsx("div", { className: `icon ${Hn(t.child)}` })
1428
1616
  ] }),
1429
- /* @__PURE__ */ u.jsx("div", { className: n ? "open" : "", children: /* @__PURE__ */ u.jsx("div", { className: "container", children: i }) })
1617
+ /* @__PURE__ */ l.jsx("div", { className: n ? "open" : "", children: /* @__PURE__ */ l.jsx("div", { className: "container", children: o }) })
1430
1618
  ] }, Math.random());
1431
1619
  }
1432
- function Vn(t) {
1620
+ function fa(t) {
1433
1621
  const n = [];
1434
- return t.child.children.map((r) => {
1435
- n.push(/* @__PURE__ */ u.jsx(Zt, { child: r, three: t.three }, Math.random()));
1436
- }), /* @__PURE__ */ u.jsx("div", { className: `scene ${t.class !== void 0 ? t.class : ""}`, children: n });
1622
+ return t.child.children.map((a) => {
1623
+ n.push(/* @__PURE__ */ l.jsx(un, { child: a, three: t.three }, Math.random()));
1624
+ }), /* @__PURE__ */ l.jsx("div", { className: `scene ${t.class !== void 0 ? t.class : ""}`, children: n });
1437
1625
  }
1438
- const zn = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA5klEQVRoge2Y0Q6EIAwE6cX//+X6cCFpSMEKVTdk501OpRNKiyelFC0b8Ps6gCwoggZF0KAIGhRBgyJoUAQNiqCxjciR9SLV//eZiAyvK3U8i/QVaQO2YyLSFVvlkdTKDjJCukh2ykR5ZEW+kHmlatl90RaBtDkK/w7CYhuRUEO0ee3l+J3m55Vm+17vtwjTnV1V3QA8qfbeUXCzRWDpiLLS+OyzvRW7IzW9R+okvclsqR09743bo0yUpc1+lSJvNsa002+Euk9GKzV7SmZDRIMiaFAEDYqgQRE0KIIGRdCgCBoUQeMEMERadX7YUz8AAAAASUVORK5CYII=";
1439
- function Wn(t) {
1626
+ const ha = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA5klEQVRoge2Y0Q6EIAwE6cX//+X6cCFpSMEKVTdk501OpRNKiyelFC0b8Ps6gCwoggZF0KAIGhRBgyJoUAQNiqCxjciR9SLV//eZiAyvK3U8i/QVaQO2YyLSFVvlkdTKDjJCukh2ykR5ZEW+kHmlatl90RaBtDkK/w7CYhuRUEO0ee3l+J3m55Vm+17vtwjTnV1V3QA8qfbeUXCzRWDpiLLS+OyzvRW7IzW9R+okvclsqR09743bo0yUpc1+lSJvNsa002+Euk9GKzV7SmZDRIMiaFAEDYqgQRE0KIIGRdCgCBoUQeMEMERadX7YUz8AAAAASUVORK5CYII=";
1627
+ function pa(t) {
1440
1628
  return "items" in t;
1441
1629
  }
1442
- function Ie(t) {
1443
- function n(e, i) {
1444
- console.log("onChange:", e, i);
1630
+ function $e(t) {
1631
+ function n(e, o) {
1632
+ console.log("onChange:", e, o);
1445
1633
  }
1446
- const r = [];
1634
+ const a = [];
1447
1635
  return t.items.forEach((e) => {
1448
- Wn(e) ? r.push(
1449
- /* @__PURE__ */ u.jsx(Ie, { title: e.title, items: e.items }, Math.random())
1450
- ) : r.push(
1451
- /* @__PURE__ */ u.jsx(
1452
- Xe,
1636
+ pa(e) ? a.push(
1637
+ /* @__PURE__ */ l.jsx($e, { title: e.title, items: e.items }, Math.random())
1638
+ ) : a.push(
1639
+ /* @__PURE__ */ l.jsx(
1640
+ et,
1453
1641
  {
1454
1642
  title: e.title,
1455
1643
  prop: e.prop,
@@ -1459,19 +1647,19 @@ function Ie(t) {
1459
1647
  max: e.max,
1460
1648
  step: e.step,
1461
1649
  disabled: e.disabled,
1462
- onChange: (i, d) => {
1463
- e.onChange !== void 0 ? e.onChange(i, d) : n(i, d);
1650
+ onChange: (o, u) => {
1651
+ e.onChange !== void 0 ? e.onChange(o, u) : n(o, u);
1464
1652
  }
1465
1653
  },
1466
1654
  Math.random()
1467
1655
  )
1468
1656
  );
1469
- }), /* @__PURE__ */ u.jsx(wt, { label: t.title, open: !1, children: r });
1657
+ }), /* @__PURE__ */ l.jsx(jt, { label: t.title, open: !1, children: a });
1470
1658
  }
1471
- function Hn(t) {
1659
+ function ma(t) {
1472
1660
  return !(t === "alphaHash" || t === "alphaToCoverage" || t === "attenuationDistance" || t === "colorWrite" || t === "combine" || t === "defaultAttributeValues" || t === "depthFunc" || t === "forceSinglePass" || t === "glslVersion" || t === "linewidth" || t === "normalMapType" || t === "precision" || t === "premultipliedAlpha" || t === "shadowSide" || t === "side" || t === "toneMapped" || t === "uniformsGroups" || t === "uniformsNeedUpdate" || t === "userData" || t === "vertexColors" || t === "version" || t === "wireframeLinecap" || t === "wireframeLinejoin" || t === "wireframeLinewidth" || t.slice(0, 5) === "blend" || t.slice(0, 4) === "clip" || t.slice(0, 7) === "polygon" || t.slice(0, 7) === "stencil" || t.slice(0, 2) === "is");
1473
1661
  }
1474
- function xe(t) {
1662
+ function Oe(t) {
1475
1663
  switch (t) {
1476
1664
  case "alphaMap":
1477
1665
  return "Alpha Map";
@@ -1620,270 +1808,271 @@ function xe(t) {
1620
1808
  }
1621
1809
  return t;
1622
1810
  }
1623
- function Kn(t) {
1811
+ function ga(t) {
1624
1812
  return t.toLowerCase().search("intensity") > -1 || t === "anisotropyRotation" || t === "bumpScale" || t === "clearcoatRoughness" || t === "displacementBias" || t === "displacementScale" || t === "metalness" || t === "opacity" || t === "reflectivity" || t === "refractionRatio" || t === "roughness" || t === "sheenRoughness" || t === "thickness";
1625
1813
  }
1626
- function Xn() {
1814
+ function va() {
1627
1815
  const t = document.createElement("input");
1628
- return t.type = "file", new Promise((n, r) => {
1816
+ return t.type = "file", new Promise((n, a) => {
1629
1817
  t.addEventListener("change", function() {
1630
1818
  if (t.files === null)
1631
- r();
1819
+ a();
1632
1820
  else {
1633
- const e = t.files[0], i = new FileReader();
1634
- i.onload = function(d) {
1635
- n(d.target.result);
1636
- }, i.readAsDataURL(e);
1821
+ const e = t.files[0], o = new FileReader();
1822
+ o.onload = function(u) {
1823
+ n(u.target.result);
1824
+ }, o.readAsDataURL(e);
1637
1825
  }
1638
1826
  }), t.click();
1639
1827
  });
1640
1828
  }
1641
- function At(t, n, r) {
1829
+ function Vt(t, n, a) {
1642
1830
  const e = [];
1643
- for (const i in t) {
1644
- if (!Hn(i))
1831
+ for (const o in t) {
1832
+ if (!ma(o))
1645
1833
  continue;
1646
- const d = typeof t[i], c = t[i];
1647
- if (d === "boolean" || d === "number" || d === "string") {
1834
+ const u = typeof t[o], c = t[o];
1835
+ if (u === "boolean" || u === "number" || u === "string") {
1648
1836
  const s = {
1649
- title: xe(i),
1650
- prop: i,
1651
- type: d,
1837
+ title: Oe(o),
1838
+ prop: o,
1839
+ type: u,
1652
1840
  value: c,
1653
1841
  min: void 0,
1654
1842
  max: void 0,
1655
- onChange: (l, h) => {
1656
- var g;
1657
- r.updateObject(n.uuid, `material.${l}`, h), d === "boolean" && r.updateObject(n.uuid, "material.needsUpdate", !0);
1658
- const p = (g = r.scene) == null ? void 0 : g.getObjectByProperty("uuid", n.uuid);
1659
- p !== void 0 && Z(p, `material.${l}`, h);
1843
+ onChange: (d, p) => {
1844
+ var b;
1845
+ a.updateObject(n.uuid, `material.${d}`, p), u === "boolean" && a.updateObject(n.uuid, "material.needsUpdate", !0);
1846
+ const h = (b = a.scene) == null ? void 0 : b.getObjectByProperty("uuid", n.uuid);
1847
+ h !== void 0 && q(h, `material.${d}`, p);
1660
1848
  }
1661
1849
  };
1662
- Kn(i) && (s.value = Number(c), s.type = "range", s.min = 0, s.max = 1, s.step = 0.01), e.push(s);
1663
- } else if (d === "object")
1850
+ ga(o) && (s.value = Number(c), s.type = "range", s.min = 0, s.max = 1, s.step = 0.01), e.push(s);
1851
+ } else if (u === "object")
1664
1852
  if (c.isColor)
1665
1853
  e.push({
1666
- title: xe(i),
1667
- prop: i,
1854
+ title: Oe(o),
1855
+ prop: o,
1668
1856
  type: "color",
1669
1857
  value: c,
1670
- onChange: (s, l) => {
1671
- var g;
1672
- const h = new Ct(l);
1673
- r.updateObject(n.uuid, `material.${s}`, h);
1674
- const p = (g = r.scene) == null ? void 0 : g.getObjectByProperty("uuid", n.uuid);
1675
- p !== void 0 && Z(p, `material.${s}`, h);
1858
+ onChange: (s, d) => {
1859
+ var b;
1860
+ const p = new kt(d);
1861
+ a.updateObject(n.uuid, `material.${s}`, p);
1862
+ const h = (b = a.scene) == null ? void 0 : b.getObjectByProperty("uuid", n.uuid);
1863
+ h !== void 0 && q(h, `material.${s}`, p);
1676
1864
  }
1677
1865
  });
1678
1866
  else if (Array.isArray(c)) {
1679
1867
  const s = [];
1680
- for (const l in c)
1868
+ for (const d in c)
1681
1869
  s.push({
1682
- title: `${l}`,
1683
- type: `${typeof c[l]}`,
1684
- value: c[l],
1685
- onChange: (h, p) => {
1686
- var E;
1687
- r.updateObject(n.uuid, `material.${i}`, p);
1688
- const g = (E = r.scene) == null ? void 0 : E.getObjectByProperty("uuid", n.uuid);
1689
- g !== void 0 && Z(g, `material.${i}`, p);
1870
+ title: `${d}`,
1871
+ type: `${typeof c[d]}`,
1872
+ value: c[d],
1873
+ onChange: (p, h) => {
1874
+ var x;
1875
+ a.updateObject(n.uuid, `material.${o}`, h);
1876
+ const b = (x = a.scene) == null ? void 0 : x.getObjectByProperty("uuid", n.uuid);
1877
+ b !== void 0 && q(b, `material.${o}`, h);
1690
1878
  }
1691
1879
  });
1692
1880
  e.push({
1693
- title: xe(i),
1881
+ title: Oe(o),
1694
1882
  items: s
1695
1883
  });
1696
1884
  } else {
1697
1885
  const s = [];
1698
- for (const l in c) {
1699
- const h = c[l];
1700
- switch (typeof h) {
1886
+ for (const d in c) {
1887
+ const p = c[d];
1888
+ switch (typeof p) {
1701
1889
  case "boolean":
1702
1890
  case "number":
1703
1891
  case "string":
1704
- l === "src" ? e.push({
1705
- title: xe(i),
1892
+ d === "src" ? e.push({
1893
+ title: Oe(o),
1706
1894
  type: "image",
1707
- value: h,
1708
- onChange: (g, E) => {
1709
- var P;
1710
- r.createTexture(n.uuid, `material.${i}`, E);
1711
- const C = (P = r.scene) == null ? void 0 : P.getObjectByProperty("uuid", n.uuid);
1712
- C !== void 0 && yt(E).then((D) => {
1713
- Z(C, `material.${i}`, D), Z(C, "material.needsUpdate", !0);
1895
+ value: p,
1896
+ onChange: (b, x) => {
1897
+ var O;
1898
+ a.createTexture(n.uuid, `material.${o}`, x);
1899
+ const S = (O = a.scene) == null ? void 0 : O.getObjectByProperty("uuid", n.uuid);
1900
+ S !== void 0 && Mt(x).then((m) => {
1901
+ q(S, `material.${o}`, m), q(S, "material.needsUpdate", !0);
1714
1902
  });
1715
1903
  }
1716
1904
  }) : s.push({
1717
- title: `${xe(l)}`,
1718
- prop: `material.${i}.${l}`,
1719
- type: `${typeof t[i][l]}`,
1720
- value: c[l],
1721
- onChange: (g, E) => {
1722
- var P;
1723
- r.updateObject(n.uuid, `material.${i}.${l}`, E);
1724
- const C = (P = r.scene) == null ? void 0 : P.getObjectByProperty("uuid", n.uuid);
1725
- C !== void 0 && Z(C, `material.${i}.${l}`, E);
1905
+ title: `${Oe(d)}`,
1906
+ prop: `material.${o}.${d}`,
1907
+ type: `${typeof t[o][d]}`,
1908
+ value: c[d],
1909
+ onChange: (b, x) => {
1910
+ var O;
1911
+ a.updateObject(n.uuid, `material.${o}.${d}`, x);
1912
+ const S = (O = a.scene) == null ? void 0 : O.getObjectByProperty("uuid", n.uuid);
1913
+ S !== void 0 && q(S, `material.${o}.${d}`, x);
1726
1914
  }
1727
1915
  });
1728
1916
  break;
1729
1917
  case "object":
1730
- h.value !== void 0 && h.value.src !== void 0 ? s.push({
1731
- title: xe(l),
1918
+ p.value !== void 0 && p.value.src !== void 0 ? s.push({
1919
+ title: Oe(d),
1732
1920
  type: "image",
1733
- value: h.value.src,
1734
- onChange: (g, E) => {
1735
- var P;
1736
- r.createTexture(n.uuid, `material.${i}.${l}.value`, E);
1737
- const C = (P = r.scene) == null ? void 0 : P.getObjectByProperty("uuid", n.uuid);
1738
- C !== void 0 && yt(E).then((D) => {
1739
- Z(C, `material.${i}.${l}.value`, D);
1921
+ value: p.value.src,
1922
+ onChange: (b, x) => {
1923
+ var O;
1924
+ a.createTexture(n.uuid, `material.${o}.${d}.value`, x);
1925
+ const S = (O = a.scene) == null ? void 0 : O.getObjectByProperty("uuid", n.uuid);
1926
+ S !== void 0 && Mt(x).then((m) => {
1927
+ q(S, `material.${o}.${d}.value`, m);
1740
1928
  });
1741
1929
  }
1742
1930
  }) : s.push({
1743
- title: l,
1744
- type: `${typeof h.value}`,
1745
- value: h.value,
1746
- onChange: (g, E) => {
1747
- var P;
1748
- r.updateObject(n.uuid, `material.${i}.${l}.value`, E);
1749
- const C = (P = r.scene) == null ? void 0 : P.getObjectByProperty("uuid", n.uuid);
1750
- C !== void 0 && Z(C, `material.${i}.${l}.value`, E);
1931
+ title: d,
1932
+ type: `${typeof p.value}`,
1933
+ value: p.value,
1934
+ onChange: (b, x) => {
1935
+ var O;
1936
+ a.updateObject(n.uuid, `material.${o}.${d}.value`, x);
1937
+ const S = (O = a.scene) == null ? void 0 : O.getObjectByProperty("uuid", n.uuid);
1938
+ S !== void 0 && q(S, `material.${o}.${d}.value`, x);
1751
1939
  }
1752
1940
  });
1753
1941
  break;
1754
1942
  }
1755
1943
  }
1756
1944
  s.length > 0 && e.push({
1757
- title: xe(i),
1945
+ title: Oe(o),
1758
1946
  items: s
1759
1947
  });
1760
1948
  }
1761
1949
  else
1762
- c !== void 0 && console.log("other:", i, d, c);
1950
+ c !== void 0 && console.log("other:", o, u, c);
1763
1951
  }
1764
- return e.sort((i, d) => i.title < d.title ? -1 : i.title > d.title ? 1 : 0), e.push({
1952
+ return e.sort((o, u) => o.title < u.title ? -1 : o.title > u.title ? 1 : 0), e.push({
1765
1953
  title: "Update Material",
1766
1954
  type: "button",
1767
1955
  onChange: () => {
1768
- r.updateObject(n.uuid, "material.needsUpdate", !0);
1956
+ a.updateObject(n.uuid, "material.needsUpdate", !0);
1769
1957
  }
1770
1958
  }), e;
1771
1959
  }
1772
- function qn(t, n) {
1773
- const r = t.material;
1774
- if (Array.isArray(r)) {
1775
- const e = [], i = r.length;
1776
- for (let d = 0; d < i; d++)
1960
+ function ba(t, n) {
1961
+ const a = t.material;
1962
+ if (Array.isArray(a)) {
1963
+ const e = [], o = a.length;
1964
+ for (let u = 0; u < o; u++)
1777
1965
  e.push(
1778
- /* @__PURE__ */ u.jsx(
1779
- Ie,
1966
+ /* @__PURE__ */ l.jsx(
1967
+ $e,
1780
1968
  {
1781
- title: `Material ${d}`,
1782
- items: At(r[d], t, n)
1783
- }
1969
+ title: `Material ${u}`,
1970
+ items: Vt(a[u], t, n)
1971
+ },
1972
+ `Material ${u}`
1784
1973
  )
1785
1974
  );
1786
- return /* @__PURE__ */ u.jsx(u.Fragment, { children: e });
1975
+ return /* @__PURE__ */ l.jsx(l.Fragment, { children: e });
1787
1976
  } else
1788
- return /* @__PURE__ */ u.jsx(
1789
- Ie,
1977
+ return /* @__PURE__ */ l.jsx(
1978
+ $e,
1790
1979
  {
1791
1980
  title: "Material",
1792
- items: At(r, t, n)
1981
+ items: Vt(a, t, n)
1793
1982
  }
1794
1983
  );
1795
1984
  }
1796
- function Xe(t) {
1985
+ function et(t) {
1797
1986
  let n = t.value;
1798
- n !== void 0 && n.isColor !== void 0 && (n = kn(t.value));
1799
- const [r, e] = re(n), i = Se(null), d = Se(null), c = Se(null);
1800
- qe(() => {
1801
- var O;
1802
- let p = !1, g = -1, E = 0, C = Number(r);
1803
- const P = (R) => {
1804
- p = !0, E = C, g = R.clientX;
1805
- }, D = (R) => {
1806
- if (!p)
1987
+ n !== void 0 && n.isColor !== void 0 && (n = Yn(t.value));
1988
+ const [a, e] = ne(n), o = ye(null), u = ye(null), c = ye(null);
1989
+ Be(() => {
1990
+ var F;
1991
+ let h = !1, b = -1, x = 0, S = Number(a);
1992
+ const O = (V) => {
1993
+ h = !0, x = S, b = V.clientX;
1994
+ }, m = (V) => {
1995
+ if (!h)
1807
1996
  return;
1808
- const z = t.step !== void 0 ? t.step : 1, ee = (R.clientX - g) * z;
1809
- C = Number((E + ee).toFixed(4)), d.current !== null && (d.current.value = C.toString()), t.onChange !== void 0 && t.onChange(t.prop !== void 0 ? t.prop : t.title, C);
1997
+ const Z = t.step !== void 0 ? t.step : 1, se = (V.clientX - b) * Z;
1998
+ S = Number((x + se).toFixed(4)), u.current !== null && (u.current.value = S.toString()), t.onChange !== void 0 && t.onChange(t.prop !== void 0 ? t.prop : t.title, S);
1999
+ }, v = () => {
2000
+ h = !1;
1810
2001
  }, y = () => {
1811
- p = !1;
1812
- }, b = () => {
1813
- p = !1;
1814
- }, v = t.type === "number";
1815
- return v && ((O = i.current) == null || O.addEventListener("mousedown", P, !1), document.addEventListener("mouseup", y, !1), document.addEventListener("mousemove", D, !1), document.addEventListener("contextmenu", b, !1)), () => {
1816
- var R;
1817
- v && ((R = i.current) == null || R.removeEventListener("mousedown", P), document.removeEventListener("mouseup", y), document.removeEventListener("mousemove", D), document.removeEventListener("contextmenu", b));
2002
+ h = !1;
2003
+ }, w = t.type === "number";
2004
+ return w && ((F = o.current) == null || F.addEventListener("mousedown", O, !1), document.addEventListener("mouseup", v, !1), document.addEventListener("mousemove", m, !1), document.addEventListener("contextmenu", y, !1)), () => {
2005
+ var V;
2006
+ w && ((V = o.current) == null || V.removeEventListener("mousedown", O), document.removeEventListener("mouseup", v), document.removeEventListener("mousemove", m), document.removeEventListener("contextmenu", y));
1818
2007
  };
1819
- }, [r]);
1820
- const s = t.type === "string" && (r.length > 100 || r.search(`
1821
- `) > -1), l = s || t.type === "image", h = (p) => {
1822
- let g = p.target.value;
1823
- t.type === "boolean" && (g = p.target.checked), e(g), t.onChange !== void 0 && t.onChange(t.prop !== void 0 ? t.prop : t.title, g);
2008
+ }, [a]);
2009
+ const s = t.type === "string" && (a.length > 100 || a.search(`
2010
+ `) > -1), d = s || t.type === "image", p = (h) => {
2011
+ let b = h.target.value;
2012
+ t.type === "boolean" && (b = h.target.checked), e(b), t.onChange !== void 0 && t.onChange(t.prop !== void 0 ? t.prop : t.title, b);
1824
2013
  };
1825
- return /* @__PURE__ */ u.jsxs("div", { className: `field ${l ? "block" : ""}`, children: [
1826
- t.type !== "button" && /* @__PURE__ */ u.jsx("label", { ref: i, children: t.title }, "fieldLabel"),
1827
- t.type === "string" && !s && /* @__PURE__ */ u.jsx(
2014
+ return /* @__PURE__ */ l.jsxs("div", { className: `field ${d ? "block" : ""}`, children: [
2015
+ t.type !== "button" && /* @__PURE__ */ l.jsx("label", { ref: o, children: t.title }, "fieldLabel"),
2016
+ t.type === "string" && !s && /* @__PURE__ */ l.jsx(
1828
2017
  "input",
1829
2018
  {
1830
2019
  type: "text",
1831
2020
  disabled: t.disabled,
1832
- onChange: h,
1833
- value: r
2021
+ onChange: p,
2022
+ value: a
1834
2023
  }
1835
2024
  ),
1836
- t.type === "string" && s && /* @__PURE__ */ u.jsx(
2025
+ t.type === "string" && s && /* @__PURE__ */ l.jsx(
1837
2026
  "textarea",
1838
2027
  {
1839
2028
  cols: 50,
1840
2029
  rows: 10,
1841
2030
  disabled: !0,
1842
- onChange: h,
1843
- value: r
2031
+ onChange: p,
2032
+ value: a
1844
2033
  }
1845
2034
  ),
1846
- t.type === "boolean" && /* @__PURE__ */ u.jsx(
2035
+ t.type === "boolean" && /* @__PURE__ */ l.jsx(
1847
2036
  "input",
1848
2037
  {
1849
2038
  type: "checkbox",
1850
2039
  disabled: t.disabled,
1851
- onChange: h,
1852
- checked: r
2040
+ onChange: p,
2041
+ checked: a
1853
2042
  }
1854
2043
  ),
1855
- t.type === "number" && /* @__PURE__ */ u.jsx(
2044
+ t.type === "number" && /* @__PURE__ */ l.jsx(
1856
2045
  "input",
1857
2046
  {
1858
- ref: d,
2047
+ ref: u,
1859
2048
  type: "number",
1860
- value: r,
2049
+ value: a,
1861
2050
  min: t.min,
1862
2051
  max: t.max,
1863
2052
  step: t.step,
1864
- onChange: h
2053
+ onChange: p
1865
2054
  }
1866
2055
  ),
1867
- t.type === "range" && /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
1868
- /* @__PURE__ */ u.jsx("input", { type: "text", value: r.toString(), onChange: h, className: "min" }),
1869
- /* @__PURE__ */ u.jsx(
2056
+ t.type === "range" && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
2057
+ /* @__PURE__ */ l.jsx("input", { type: "text", value: a.toString(), onChange: p, className: "min" }),
2058
+ /* @__PURE__ */ l.jsx(
1870
2059
  "input",
1871
2060
  {
1872
2061
  disabled: t.disabled,
1873
2062
  type: "range",
1874
- value: r,
2063
+ value: a,
1875
2064
  min: t.min,
1876
2065
  max: t.max,
1877
2066
  step: t.step,
1878
- onChange: h
2067
+ onChange: p
1879
2068
  }
1880
2069
  )
1881
2070
  ] }),
1882
- t.type === "color" && /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
1883
- /* @__PURE__ */ u.jsx("input", { type: "text", value: r.toString(), onChange: h, className: "color" }),
1884
- /* @__PURE__ */ u.jsx("input", { type: "color", value: r, onChange: h })
2071
+ t.type === "color" && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
2072
+ /* @__PURE__ */ l.jsx("input", { type: "text", value: a.toString(), onChange: p, className: "color" }),
2073
+ /* @__PURE__ */ l.jsx("input", { type: "color", value: a, onChange: p })
1885
2074
  ] }),
1886
- t.type === "button" && /* @__PURE__ */ u.jsx(
2075
+ t.type === "button" && /* @__PURE__ */ l.jsx(
1887
2076
  "button",
1888
2077
  {
1889
2078
  onClick: () => {
@@ -1892,14 +2081,14 @@ function Xe(t) {
1892
2081
  children: t.title
1893
2082
  }
1894
2083
  ),
1895
- t.type === "image" && /* @__PURE__ */ u.jsx("img", { ref: c, onClick: () => {
1896
- Xn().then((p) => {
1897
- c.current.src = p, t.onChange !== void 0 && t.onChange(t.prop !== void 0 ? t.prop : t.title, p);
2084
+ t.type === "image" && /* @__PURE__ */ l.jsx("img", { ref: c, onClick: () => {
2085
+ va().then((h) => {
2086
+ c.current.src = h, t.onChange !== void 0 && t.onChange(t.prop !== void 0 ? t.prop : t.title, h);
1898
2087
  });
1899
- }, src: r.length > 0 ? r : zn })
2088
+ }, src: a.length > 0 ? a : ha })
1900
2089
  ] });
1901
2090
  }
1902
- function Nt(t) {
2091
+ function Yt(t) {
1903
2092
  switch (t) {
1904
2093
  case "fov":
1905
2094
  return "FOV";
@@ -1928,157 +2117,151 @@ function Nt(t) {
1928
2117
  }
1929
2118
  return t;
1930
2119
  }
1931
- function Zn(t, n) {
1932
- const r = [];
2120
+ function ya(t, n) {
2121
+ const a = [];
1933
2122
  if (t.perspectiveCameraInfo !== void 0)
1934
2123
  for (const e in t.perspectiveCameraInfo)
1935
- r.push({
1936
- title: Nt(e),
2124
+ a.push({
2125
+ title: Yt(e),
1937
2126
  prop: e,
1938
2127
  type: "number",
1939
2128
  step: 0.01,
1940
2129
  value: t.perspectiveCameraInfo[e],
1941
- onChange: (i, d) => {
2130
+ onChange: (o, u) => {
1942
2131
  var s;
1943
- n.updateObject(t.uuid, i, d), n.requestMethod(t.uuid, "updateProjectionMatrix");
2132
+ n.updateObject(t.uuid, o, u), n.requestMethod(t.uuid, "updateProjectionMatrix");
1944
2133
  const c = (s = n.scene) == null ? void 0 : s.getObjectByProperty("uuid", t.uuid);
1945
- c !== void 0 && (Z(c, i, d), c.updateProjectionMatrix());
2134
+ c !== void 0 && (q(c, o, u), c.updateProjectionMatrix());
1946
2135
  }
1947
2136
  });
1948
2137
  else if (t.orthographicCameraInfo !== void 0)
1949
2138
  for (const e in t.orthographicCameraInfo)
1950
- r.push({
1951
- title: Nt(e),
2139
+ a.push({
2140
+ title: Yt(e),
1952
2141
  prop: e,
1953
2142
  type: "number",
1954
2143
  step: 0.01,
1955
2144
  value: t.perspectiveCameraInfo[e],
1956
- onChange: (i, d) => {
2145
+ onChange: (o, u) => {
1957
2146
  var s;
1958
- n.updateObject(t.uuid, i, d), n.requestMethod(t.uuid, "updateProjectionMatrix");
2147
+ n.updateObject(t.uuid, o, u), n.requestMethod(t.uuid, "updateProjectionMatrix");
1959
2148
  const c = (s = n.scene) == null ? void 0 : s.getObjectByProperty("uuid", t.uuid);
1960
- c !== void 0 && (Z(c, i, d), c.updateProjectionMatrix());
2149
+ c !== void 0 && (q(c, o, u), c.updateProjectionMatrix());
1961
2150
  }
1962
2151
  });
1963
- return /* @__PURE__ */ u.jsx(
1964
- Ie,
2152
+ return /* @__PURE__ */ l.jsx(
2153
+ $e,
1965
2154
  {
1966
2155
  title: "Camera",
1967
- items: r
2156
+ items: a
1968
2157
  }
1969
2158
  );
1970
2159
  }
1971
- function Jn(t, n) {
1972
- const r = new ln();
1973
- r.elements = t.matrix;
1974
- const e = new G(), i = new un(), d = new G();
1975
- t.uuid.length > 0 && (e.setFromMatrixPosition(r), i.setFromRotationMatrix(r), d.setFromMatrixScale(r));
1976
- const c = (l, h) => {
1977
- var g;
1978
- n.updateObject(t.uuid, l, h);
1979
- const p = (g = n.scene) == null ? void 0 : g.getObjectByProperty("uuid", t.uuid);
1980
- p !== void 0 && Z(p, l, h);
1981
- }, s = [
2160
+ const Ea = Math.PI / 180, xa = 180 / Math.PI;
2161
+ function wa(t) {
2162
+ return t * Ea;
2163
+ }
2164
+ function St(t) {
2165
+ return t * xa;
2166
+ }
2167
+ function Ca(t, n) {
2168
+ const a = new Tn();
2169
+ a.elements = t.matrix;
2170
+ const e = new L(), o = new Rn(), u = new L();
2171
+ t.uuid.length > 0 && (e.setFromMatrixPosition(a), o.setFromRotationMatrix(a), u.setFromMatrixScale(a));
2172
+ const c = (d, p) => {
2173
+ var b;
2174
+ n.updateObject(t.uuid, d, p);
2175
+ const h = (b = n.scene) == null ? void 0 : b.getObjectByProperty("uuid", t.uuid);
2176
+ h !== void 0 && q(h, d, p);
2177
+ }, s = (d, p) => {
2178
+ c(d, wa(p));
2179
+ };
2180
+ return /* @__PURE__ */ l.jsx(
2181
+ $e,
1982
2182
  {
1983
- title: "Position",
2183
+ title: "Transform",
1984
2184
  items: [
1985
2185
  {
1986
- title: "X",
2186
+ title: "Position X",
1987
2187
  prop: "position.x",
1988
2188
  type: "number",
1989
2189
  value: e.x,
1990
2190
  onChange: c
1991
2191
  },
1992
2192
  {
1993
- title: "Y",
2193
+ title: "Position Y",
1994
2194
  prop: "position.y",
1995
2195
  type: "number",
1996
2196
  value: e.y,
1997
2197
  onChange: c
1998
2198
  },
1999
2199
  {
2000
- title: "Z",
2200
+ title: "Position Z",
2001
2201
  prop: "position.z",
2002
2202
  type: "number",
2003
2203
  value: e.z,
2004
2204
  onChange: c
2005
- }
2006
- ]
2007
- },
2008
- {
2009
- title: "Rotation",
2010
- items: [
2205
+ },
2011
2206
  {
2012
- title: "X",
2207
+ title: "Rotation X",
2013
2208
  prop: "rotation.x",
2014
2209
  type: "number",
2015
- value: i.x,
2016
- min: -Math.PI,
2017
- max: Math.PI,
2018
- step: 0.01,
2019
- onChange: c
2210
+ value: Ct(St(o.x)),
2211
+ min: -360,
2212
+ max: 360,
2213
+ step: 0.1,
2214
+ onChange: s
2020
2215
  },
2021
2216
  {
2022
- title: "Y",
2217
+ title: "Rotation Y",
2023
2218
  prop: "rotation.y",
2024
2219
  type: "number",
2025
- value: i.y,
2026
- min: -Math.PI,
2027
- max: Math.PI,
2028
- step: 0.01,
2029
- onChange: c
2220
+ value: Ct(St(o.y)),
2221
+ min: -360,
2222
+ max: 360,
2223
+ step: 0.1,
2224
+ onChange: s
2030
2225
  },
2031
2226
  {
2032
- title: "Z",
2227
+ title: "Rotation Z",
2033
2228
  prop: "rotation.z",
2034
2229
  type: "number",
2035
- value: i.z,
2036
- min: -Math.PI,
2037
- max: Math.PI,
2038
- step: 0.01,
2039
- onChange: c
2040
- }
2041
- ]
2042
- },
2043
- {
2044
- title: "Scale",
2045
- items: [
2230
+ value: Ct(St(o.z)),
2231
+ min: -360,
2232
+ max: 360,
2233
+ step: 0.1,
2234
+ onChange: s
2235
+ },
2046
2236
  {
2047
- title: "X",
2237
+ title: "Scale X",
2048
2238
  prop: "scale.x",
2049
2239
  type: "number",
2050
- value: d.x,
2240
+ value: u.x,
2051
2241
  step: 0.01,
2052
2242
  onChange: c
2053
2243
  },
2054
2244
  {
2055
- title: "Y",
2245
+ title: "Scale Y",
2056
2246
  prop: "scale.y",
2057
2247
  type: "number",
2058
- value: d.y,
2248
+ value: u.y,
2059
2249
  step: 0.01,
2060
2250
  onChange: c
2061
2251
  },
2062
2252
  {
2063
- title: "Z",
2253
+ title: "Scale Z",
2064
2254
  prop: "scale.z",
2065
2255
  type: "number",
2066
- value: d.z,
2256
+ value: u.z,
2067
2257
  step: 0.01,
2068
2258
  onChange: c
2069
2259
  }
2070
2260
  ]
2071
2261
  }
2072
- ];
2073
- return /* @__PURE__ */ u.jsx(
2074
- Ie,
2075
- {
2076
- title: "Transform",
2077
- items: s
2078
- }
2079
2262
  );
2080
2263
  }
2081
- function Lt(t) {
2264
+ function zt(t) {
2082
2265
  switch (t) {
2083
2266
  case "color":
2084
2267
  return "Color";
@@ -2097,47 +2280,47 @@ function Lt(t) {
2097
2280
  }
2098
2281
  return t;
2099
2282
  }
2100
- function Qn(t, n) {
2101
- const r = [];
2283
+ function Sa(t, n) {
2284
+ const a = [];
2102
2285
  if (t.lightInfo !== void 0)
2103
2286
  for (const e in t.lightInfo) {
2104
- const i = t.lightInfo[e];
2105
- i !== void 0 && (i.isColor !== void 0 ? r.push({
2106
- title: Lt(e),
2287
+ const o = t.lightInfo[e];
2288
+ o !== void 0 && (o.isColor !== void 0 ? a.push({
2289
+ title: zt(e),
2107
2290
  prop: e,
2108
2291
  type: "color",
2109
- value: i,
2110
- onChange: (d, c) => {
2111
- var h;
2112
- const s = new Ct(c);
2113
- n.updateObject(t.uuid, d, s);
2114
- const l = (h = n.scene) == null ? void 0 : h.getObjectByProperty("uuid", t.uuid);
2115
- l !== void 0 && Z(l, d, s);
2292
+ value: o,
2293
+ onChange: (u, c) => {
2294
+ var p;
2295
+ const s = new kt(c);
2296
+ n.updateObject(t.uuid, u, s);
2297
+ const d = (p = n.scene) == null ? void 0 : p.getObjectByProperty("uuid", t.uuid);
2298
+ d !== void 0 && q(d, u, s);
2116
2299
  }
2117
- }) : r.push({
2118
- title: Lt(e),
2300
+ }) : a.push({
2301
+ title: zt(e),
2119
2302
  prop: e,
2120
- type: typeof i,
2121
- value: i,
2122
- step: typeof i == "number" ? 0.01 : void 0,
2123
- onChange: (d, c) => {
2124
- var l;
2125
- n.updateObject(t.uuid, d, c);
2126
- const s = (l = n.scene) == null ? void 0 : l.getObjectByProperty("uuid", t.uuid);
2127
- s !== void 0 && Z(s, d, c);
2303
+ type: typeof o,
2304
+ value: o,
2305
+ step: typeof o == "number" ? 0.01 : void 0,
2306
+ onChange: (u, c) => {
2307
+ var d;
2308
+ n.updateObject(t.uuid, u, c);
2309
+ const s = (d = n.scene) == null ? void 0 : d.getObjectByProperty("uuid", t.uuid);
2310
+ s !== void 0 && q(s, u, c);
2128
2311
  }
2129
2312
  }));
2130
2313
  }
2131
- return /* @__PURE__ */ u.jsx(
2132
- Ie,
2314
+ return /* @__PURE__ */ l.jsx(
2315
+ $e,
2133
2316
  {
2134
2317
  title: "Light",
2135
- items: r
2318
+ items: a
2136
2319
  }
2137
2320
  );
2138
2321
  }
2139
- function ea(t) {
2140
- const [n, r] = re(-1), [e, i] = re({
2322
+ function Oa(t) {
2323
+ const [n, a] = ne(-1), [e, o] = ne({
2141
2324
  name: "",
2142
2325
  uuid: "",
2143
2326
  type: "",
@@ -2148,20 +2331,20 @@ function ea(t) {
2148
2331
  orthographicCameraInfo: void 0,
2149
2332
  lightInfo: void 0
2150
2333
  });
2151
- qe(() => {
2334
+ Be(() => {
2152
2335
  function c(s) {
2153
- const l = s.value;
2154
- i(l), r(Date.now());
2336
+ const d = s.value;
2337
+ o(d), a(Date.now());
2155
2338
  }
2156
- return A.addEventListener(N.SET_OBJECT, c), () => {
2157
- A.removeEventListener(N.SET_OBJECT, c);
2339
+ return I.addEventListener(N.SET_OBJECT, c), () => {
2340
+ I.removeEventListener(N.SET_OBJECT, c);
2158
2341
  };
2159
2342
  }, []);
2160
- const d = e.type.toLowerCase();
2161
- return /* @__PURE__ */ u.jsx("div", { id: "Inspector", className: t.class, children: e.uuid.length > 0 && /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
2162
- /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
2163
- /* @__PURE__ */ u.jsx(
2164
- Xe,
2343
+ const u = e.type.toLowerCase();
2344
+ return /* @__PURE__ */ l.jsx("div", { id: "Inspector", className: t.class, children: e.uuid.length > 0 && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
2345
+ /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
2346
+ /* @__PURE__ */ l.jsx(
2347
+ et,
2165
2348
  {
2166
2349
  type: "string",
2167
2350
  title: "Name",
@@ -2170,8 +2353,8 @@ function ea(t) {
2170
2353
  disabled: !0
2171
2354
  }
2172
2355
  ),
2173
- /* @__PURE__ */ u.jsx(
2174
- Xe,
2356
+ /* @__PURE__ */ l.jsx(
2357
+ et,
2175
2358
  {
2176
2359
  type: "string",
2177
2360
  title: "Type",
@@ -2180,8 +2363,8 @@ function ea(t) {
2180
2363
  disabled: !0
2181
2364
  }
2182
2365
  ),
2183
- /* @__PURE__ */ u.jsx(
2184
- Xe,
2366
+ /* @__PURE__ */ l.jsx(
2367
+ et,
2185
2368
  {
2186
2369
  type: "string",
2187
2370
  title: "UUID",
@@ -2190,67 +2373,53 @@ function ea(t) {
2190
2373
  disabled: !0
2191
2374
  }
2192
2375
  ),
2193
- /* @__PURE__ */ u.jsx(
2194
- Xe,
2376
+ /* @__PURE__ */ l.jsx(
2377
+ et,
2195
2378
  {
2196
2379
  type: "boolean",
2197
2380
  title: "Visible",
2198
2381
  prop: "visible",
2199
2382
  value: e.visible,
2200
2383
  onChange: (c, s) => {
2201
- var h;
2384
+ var p;
2202
2385
  t.three.updateObject(e.uuid, c, s);
2203
- const l = (h = t.three.scene) == null ? void 0 : h.getObjectByProperty("uuid", e.uuid);
2204
- l !== void 0 && Z(l, c, s);
2386
+ const d = (p = t.three.scene) == null ? void 0 : p.getObjectByProperty("uuid", e.uuid);
2387
+ d !== void 0 && q(d, c, s);
2205
2388
  }
2206
2389
  }
2207
2390
  )
2208
2391
  ] }),
2209
- /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
2210
- Jn(e, t.three),
2211
- d.search("camera") > -1 ? Zn(e, t.three) : null,
2212
- d.search("light") > -1 ? Qn(e, t.three) : null,
2213
- d.search("mesh") > -1 ? qn(e, t.three) : null
2392
+ /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
2393
+ Ca(e, t.three),
2394
+ u.search("camera") > -1 ? ya(e, t.three) : null,
2395
+ u.search("light") > -1 ? Sa(e, t.three) : null,
2396
+ u.search("mesh") > -1 ? ba(e, t.three) : null
2214
2397
  ] })
2215
2398
  ] }) }, n);
2216
2399
  }
2217
- class Oa extends Mn {
2218
- constructor(r) {
2219
- super(r);
2400
+ class Xa extends Bn {
2401
+ constructor(a) {
2402
+ super(a);
2220
2403
  $(this, "three");
2221
2404
  // Private
2222
- $(this, "onRefresh", () => {
2223
- this.three.getScene();
2224
- });
2225
- $(this, "setScene", (r) => {
2405
+ $(this, "setScene", (a) => {
2226
2406
  this.setState(() => ({
2227
- scene: r.value
2407
+ scene: a.value
2228
2408
  }));
2229
2409
  });
2230
2410
  this.state = {
2231
- scene: r.scene !== void 0 ? r.scene : null
2232
- }, this.three = r.three, A.addEventListener(N.SET_SCENE, this.setScene);
2233
- }
2234
- componentDidMount() {
2235
- this.onRefresh();
2411
+ scene: a.scene !== void 0 ? a.scene : null
2412
+ }, this.three = a.three, I.addEventListener(N.SET_SCENE, this.setScene);
2236
2413
  }
2237
2414
  componentWillUnmount() {
2238
- A.removeEventListener(N.SET_SCENE, this.setScene);
2415
+ I.removeEventListener(N.SET_SCENE, this.setScene);
2239
2416
  }
2240
2417
  render() {
2241
- var i;
2242
- const r = this.componentState.scene !== null, e = "Hierarchy" + (r ? `: ${(i = this.componentState.scene) == null ? void 0 : i.name}` : "");
2243
- return /* @__PURE__ */ u.jsx("div", { id: "SceneHierarchy", children: /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
2244
- r && /* @__PURE__ */ u.jsx(
2245
- wt,
2246
- {
2247
- label: e,
2248
- button: /* @__PURE__ */ u.jsx("button", { className: "icon refresh hideText", onClick: this.onRefresh, children: "Refresh" }),
2249
- open: !0,
2250
- children: /* @__PURE__ */ u.jsx(Vn, { child: this.componentState.scene, three: this.three })
2251
- }
2252
- ),
2253
- /* @__PURE__ */ u.jsx(wt, { label: "Inspector", children: /* @__PURE__ */ u.jsx(ea, { three: this.three }, "Inspector") })
2418
+ var o;
2419
+ const a = this.componentState.scene !== null, e = "Hierarchy - " + (a ? `${(o = this.componentState.scene) == null ? void 0 : o.name}` : "No Scene");
2420
+ return /* @__PURE__ */ l.jsx("div", { id: "SceneHierarchy", children: /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
2421
+ /* @__PURE__ */ l.jsx(jt, { label: e, open: !0, children: /* @__PURE__ */ l.jsx(l.Fragment, { children: a && /* @__PURE__ */ l.jsx(fa, { child: this.componentState.scene, three: this.three }) }) }),
2422
+ /* @__PURE__ */ l.jsx(jt, { label: "Inspector", children: /* @__PURE__ */ l.jsx(Oa, { three: this.three }, "Inspector") })
2254
2423
  ] }) }, "SceneHierarchy");
2255
2424
  }
2256
2425
  // Getters / Setters
@@ -2258,84 +2427,98 @@ class Oa extends Mn {
2258
2427
  return this.state;
2259
2428
  }
2260
2429
  }
2261
- function Ta(t) {
2262
- const n = (s) => {
2263
- const l = t.scene.getObjectByProperty("uuid", s.value);
2264
- l !== void 0 && t.three.setObject(l);
2265
- }, r = (s, l, h) => {
2266
- const p = t.scene.getObjectByProperty("uuid", s);
2267
- p !== void 0 && Z(p, l, h);
2268
- }, e = (s) => {
2269
- const l = s.value, { key: h, value: p, uuid: g } = l;
2270
- r(g, h, p);
2271
- }, i = (s) => {
2272
- const l = s.value;
2273
- yt(l.value).then((h) => {
2274
- r(l.uuid, l.key, h), r(l.uuid, "material.needsUpdate", !0);
2430
+ function qa(t) {
2431
+ function n() {
2432
+ return t.three.scene === void 0 ? (console.log("No scene:", t.three), !1) : !0;
2433
+ }
2434
+ const a = (s) => {
2435
+ var p;
2436
+ if (!n())
2437
+ return;
2438
+ const d = (p = t.three.scene) == null ? void 0 : p.getObjectByProperty("uuid", s.value);
2439
+ d !== void 0 && t.three.setObject(d);
2440
+ }, e = (s, d, p) => {
2441
+ var b;
2442
+ if (!n())
2443
+ return;
2444
+ const h = (b = t.three.scene) == null ? void 0 : b.getObjectByProperty("uuid", s);
2445
+ h !== void 0 && q(h, d, p);
2446
+ }, o = (s) => {
2447
+ if (!n())
2448
+ return;
2449
+ const d = s.value, { key: p, value: h, uuid: b } = d;
2450
+ e(b, p, h);
2451
+ }, u = (s) => {
2452
+ if (!n())
2453
+ return;
2454
+ const d = s.value;
2455
+ Mt(d.value).then((p) => {
2456
+ e(d.uuid, d.key, p), e(d.uuid, "material.needsUpdate", !0);
2275
2457
  });
2276
- }, d = () => {
2277
- t.three.setScene(t.scene);
2278
2458
  }, c = (s) => {
2279
- const { key: l, uuid: h, value: p } = s.value, g = t.scene.getObjectByProperty("uuid", h);
2280
- if (g !== void 0)
2459
+ var x;
2460
+ if (!n())
2461
+ return;
2462
+ const { key: d, uuid: p, value: h } = s.value, b = (x = t.three.scene) == null ? void 0 : x.getObjectByProperty("uuid", p);
2463
+ if (b !== void 0)
2281
2464
  try {
2282
- g[l](p);
2283
- } catch (E) {
2284
- console.log("Error requesting method:"), console.log(E), console.log(l), console.log(p);
2465
+ b[d](h);
2466
+ } catch (S) {
2467
+ console.log("Error requesting method:"), console.log(S), console.log(d), console.log(h);
2285
2468
  }
2286
2469
  };
2287
- return qe(() => (A.addEventListener(N.GET_OBJECT, n), A.addEventListener(N.GET_SCENE, d), A.addEventListener(N.UPDATE_OBJECT, e), A.addEventListener(N.CREATE_TEXTURE, i), A.addEventListener(N.REQUEST_METHOD, c), () => {
2288
- A.removeEventListener(N.GET_OBJECT, n), A.removeEventListener(N.GET_SCENE, d), A.removeEventListener(N.UPDATE_OBJECT, e), A.removeEventListener(N.CREATE_TEXTURE, i), A.removeEventListener(N.REQUEST_METHOD, c);
2470
+ return Be(() => (I.addEventListener(N.GET_OBJECT, a), I.addEventListener(N.UPDATE_OBJECT, o), I.addEventListener(N.CREATE_TEXTURE, u), I.addEventListener(N.REQUEST_METHOD, c), () => {
2471
+ I.removeEventListener(N.GET_OBJECT, a), I.removeEventListener(N.UPDATE_OBJECT, o), I.removeEventListener(N.CREATE_TEXTURE, u), I.removeEventListener(N.REQUEST_METHOD, c);
2289
2472
  }), []), null;
2290
2473
  }
2291
- const Ft = { type: "change" }, gt = { type: "start" }, Ut = { type: "end" }, ct = new dn(), Bt = new fn(), ta = Math.cos(70 * hn.DEG2RAD);
2292
- class na extends Gt {
2293
- constructor(n, r) {
2294
- super(), this.object = n, this.domElement = r, this.domElement.style.touchAction = "none", this.enabled = !0, this.target = new G(), this.minDistance = 0, this.maxDistance = 1 / 0, this.minZoom = 0, this.maxZoom = 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: De.ROTATE, MIDDLE: De.DOLLY, RIGHT: De.PAN }, this.touches = { ONE: _e.ROTATE, TWO: _e.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this.getPolarAngle = function() {
2474
+ const Wt = { type: "change" }, Ot = { type: "start" }, Ht = { type: "end" }, pt = new Mn(), Kt = new Pn(), Ta = Math.cos(70 * jn.DEG2RAD);
2475
+ class Ra extends Zt {
2476
+ constructor(n, a) {
2477
+ super(), this.object = n, this.domElement = a, this.domElement.style.touchAction = "none", this.enabled = !0, this.target = new L(), this.cursor = new L(), 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: Ne.ROTATE, MIDDLE: Ne.DOLLY, RIGHT: Ne.PAN }, this.touches = { ONE: Le.ROTATE, TWO: Le.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this.getPolarAngle = function() {
2295
2478
  return s.phi;
2296
2479
  }, this.getAzimuthalAngle = function() {
2297
2480
  return s.theta;
2298
2481
  }, this.getDistance = function() {
2299
2482
  return this.object.position.distanceTo(this.target);
2300
- }, this.listenToKeyEvents = function(o) {
2301
- o.addEventListener("keydown", Ye), this._domElementKeyEvents = o;
2483
+ }, this.listenToKeyEvents = function(i) {
2484
+ i.addEventListener("keydown", Xe), this._domElementKeyEvents = i;
2302
2485
  }, this.stopListenToKeyEvents = function() {
2303
- this._domElementKeyEvents.removeEventListener("keydown", Ye), this._domElementKeyEvents = null;
2486
+ this._domElementKeyEvents.removeEventListener("keydown", Xe), this._domElementKeyEvents = null;
2304
2487
  }, this.saveState = function() {
2305
2488
  e.target0.copy(e.target), e.position0.copy(e.object.position), e.zoom0 = e.object.zoom;
2306
2489
  }, this.reset = function() {
2307
- e.target.copy(e.target0), e.object.position.copy(e.position0), e.object.zoom = e.zoom0, e.object.updateProjectionMatrix(), e.dispatchEvent(Ft), e.update(), d = i.NONE;
2490
+ e.target.copy(e.target0), e.object.position.copy(e.position0), e.object.zoom = e.zoom0, e.object.updateProjectionMatrix(), e.dispatchEvent(Wt), e.update(), u = o.NONE;
2308
2491
  }, this.update = function() {
2309
- const o = new G(), w = new Rt().setFromUnitVectors(n.up, new G(0, 1, 0)), F = w.clone().invert(), U = new G(), K = new Rt(), fe = new G(), ie = 2 * Math.PI;
2310
- return function() {
2311
- const ze = e.object.position;
2312
- o.copy(ze).sub(e.target), o.applyQuaternion(w), s.setFromVector3(o), e.autoRotate && d === i.NONE && j(Te()), e.enableDamping ? (s.theta += l.theta * e.dampingFactor, s.phi += l.phi * e.dampingFactor) : (s.theta += l.theta, s.phi += l.phi);
2313
- let W = e.minAzimuthAngle, Q = e.maxAzimuthAngle;
2314
- isFinite(W) && isFinite(Q) && (W < -Math.PI ? W += ie : W > Math.PI && (W -= ie), Q < -Math.PI ? Q += ie : Q > Math.PI && (Q -= ie), W <= Q ? s.theta = Math.max(W, Math.min(Q, s.theta)) : s.theta = s.theta > (W + Q) / 2 ? Math.max(W, s.theta) : Math.min(Q, s.theta)), s.phi = Math.max(e.minPolarAngle, Math.min(e.maxPolarAngle, s.phi)), s.makeSafe(), e.enableDamping === !0 ? e.target.addScaledVector(p, e.dampingFactor) : e.target.add(p), e.zoomToCursor && ee || e.object.isOrthographicCamera ? s.radius = Pe(s.radius) : s.radius = Pe(s.radius * h), o.setFromSpherical(s), o.applyQuaternion(F), ze.copy(e.target).add(o), e.object.lookAt(e.target), e.enableDamping === !0 ? (l.theta *= 1 - e.dampingFactor, l.phi *= 1 - e.dampingFactor, p.multiplyScalar(1 - e.dampingFactor)) : (l.set(0, 0, 0), p.set(0, 0, 0));
2315
- let he = !1;
2316
- if (e.zoomToCursor && ee) {
2317
- let pe = null;
2492
+ const i = new L(), E = new Ft().setFromUnitVectors(n.up, new L(0, 1, 0)), P = E.clone().invert(), _ = new L(), W = new Ft(), de = new L(), J = 2 * Math.PI;
2493
+ return function(ht = null) {
2494
+ const he = e.object.position;
2495
+ i.copy(he).sub(e.target), i.applyQuaternion(E), s.setFromVector3(i), e.autoRotate && u === o.NONE && z(j(ht)), e.enableDamping ? (s.theta += d.theta * e.dampingFactor, s.phi += d.phi * e.dampingFactor) : (s.theta += d.theta, s.phi += d.phi);
2496
+ let Q = e.minAzimuthAngle, ee = e.maxAzimuthAngle;
2497
+ isFinite(Q) && isFinite(ee) && (Q < -Math.PI ? Q += J : Q > Math.PI && (Q -= J), ee < -Math.PI ? ee += J : ee > Math.PI && (ee -= J), Q <= ee ? s.theta = Math.max(Q, Math.min(ee, s.theta)) : s.theta = s.theta > (Q + ee) / 2 ? Math.max(Q, s.theta) : Math.min(ee, s.theta)), s.phi = Math.max(e.minPolarAngle, Math.min(e.maxPolarAngle, s.phi)), s.makeSafe(), e.enableDamping === !0 ? e.target.addScaledVector(h, e.dampingFactor) : e.target.add(h), e.target.sub(e.cursor), e.target.clampLength(e.minTargetRadius, e.maxTargetRadius), e.target.add(e.cursor), e.zoomToCursor && se || e.object.isOrthographicCamera ? s.radius = je(s.radius) : s.radius = je(s.radius * p), i.setFromSpherical(s), i.applyQuaternion(P), he.copy(e.target).add(i), e.object.lookAt(e.target), e.enableDamping === !0 ? (d.theta *= 1 - e.dampingFactor, d.phi *= 1 - e.dampingFactor, h.multiplyScalar(1 - e.dampingFactor)) : (d.set(0, 0, 0), h.set(0, 0, 0));
2498
+ let De = !1;
2499
+ if (e.zoomToCursor && se) {
2500
+ let Se = null;
2318
2501
  if (e.object.isPerspectiveCamera) {
2319
- const Ee = o.length();
2320
- pe = Pe(Ee * h);
2321
- const we = Ee - pe;
2322
- e.object.position.addScaledVector(R, we), e.object.updateMatrixWorld();
2502
+ const be = i.length();
2503
+ Se = je(be * p);
2504
+ const Ae = be - Se;
2505
+ e.object.position.addScaledVector(V, Ae), e.object.updateMatrixWorld();
2323
2506
  } else if (e.object.isOrthographicCamera) {
2324
- const Ee = new G(z.x, z.y, 0);
2325
- Ee.unproject(e.object), e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom / h)), e.object.updateProjectionMatrix(), he = !0;
2326
- const we = new G(z.x, z.y, 0);
2327
- we.unproject(e.object), e.object.position.sub(we).add(Ee), e.object.updateMatrixWorld(), pe = o.length();
2507
+ const be = new L(Z.x, Z.y, 0);
2508
+ be.unproject(e.object), e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom / p)), e.object.updateProjectionMatrix(), De = !0;
2509
+ const Ae = new L(Z.x, Z.y, 0);
2510
+ Ae.unproject(e.object), e.object.position.sub(Ae).add(be), e.object.updateMatrixWorld(), Se = i.length();
2328
2511
  } else
2329
2512
  console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), e.zoomToCursor = !1;
2330
- pe !== null && (this.screenSpacePanning ? e.target.set(0, 0, -1).transformDirection(e.object.matrix).multiplyScalar(pe).add(e.object.position) : (ct.origin.copy(e.object.position), ct.direction.set(0, 0, -1).transformDirection(e.object.matrix), Math.abs(e.object.up.dot(ct.direction)) < ta ? n.lookAt(e.target) : (Bt.setFromNormalAndCoplanarPoint(e.object.up, e.target), ct.intersectPlane(Bt, e.target))));
2513
+ Se !== null && (this.screenSpacePanning ? e.target.set(0, 0, -1).transformDirection(e.object.matrix).multiplyScalar(Se).add(e.object.position) : (pt.origin.copy(e.object.position), pt.direction.set(0, 0, -1).transformDirection(e.object.matrix), Math.abs(e.object.up.dot(pt.direction)) < Ta ? n.lookAt(e.target) : (Kt.setFromNormalAndCoplanarPoint(e.object.up, e.target), pt.intersectPlane(Kt, e.target))));
2331
2514
  } else
2332
- e.object.isOrthographicCamera && (e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom / h)), e.object.updateProjectionMatrix(), he = !0);
2333
- return h = 1, ee = !1, he || U.distanceToSquared(e.object.position) > c || 8 * (1 - K.dot(e.object.quaternion)) > c || fe.distanceToSquared(e.target) > 0 ? (e.dispatchEvent(Ft), U.copy(e.object.position), K.copy(e.object.quaternion), fe.copy(e.target), he = !1, !0) : !1;
2515
+ e.object.isOrthographicCamera && (e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom / p)), e.object.updateProjectionMatrix(), De = !0);
2516
+ return p = 1, se = !1, De || _.distanceToSquared(e.object.position) > c || 8 * (1 - W.dot(e.object.quaternion)) > c || de.distanceToSquared(e.target) > 0 ? (e.dispatchEvent(Wt), _.copy(e.object.position), W.copy(e.object.quaternion), de.copy(e.target), !0) : !1;
2334
2517
  };
2335
2518
  }(), this.dispose = function() {
2336
- e.domElement.removeEventListener("contextmenu", de), e.domElement.removeEventListener("pointerdown", $e), e.domElement.removeEventListener("pointercancel", be), e.domElement.removeEventListener("wheel", at), e.domElement.removeEventListener("pointermove", ue), e.domElement.removeEventListener("pointerup", be), e._domElementKeyEvents !== null && (e._domElementKeyEvents.removeEventListener("keydown", Ye), e._domElementKeyEvents = null);
2519
+ e.domElement.removeEventListener("contextmenu", ve), e.domElement.removeEventListener("pointerdown", He), e.domElement.removeEventListener("pointercancel", Ce), e.domElement.removeEventListener("wheel", ct), e.domElement.removeEventListener("pointermove", ge), e.domElement.removeEventListener("pointerup", Ce), e._domElementKeyEvents !== null && (e._domElementKeyEvents.removeEventListener("keydown", Xe), e._domElementKeyEvents = null);
2337
2520
  };
2338
- const e = this, i = {
2521
+ const e = this, o = {
2339
2522
  NONE: -1,
2340
2523
  ROTATE: 0,
2341
2524
  DOLLY: 1,
@@ -2345,700 +2528,596 @@ class na extends Gt {
2345
2528
  TOUCH_DOLLY_PAN: 5,
2346
2529
  TOUCH_DOLLY_ROTATE: 6
2347
2530
  };
2348
- let d = i.NONE;
2349
- const c = 1e-6, s = new jt(), l = new jt();
2350
- let h = 1;
2351
- const p = new G(), g = new ae(), E = new ae(), C = new ae(), P = new ae(), D = new ae(), y = new ae(), b = new ae(), v = new ae(), O = new ae(), R = new G(), z = new ae();
2352
- let ee = !1;
2353
- const T = [], le = {};
2354
- function Te() {
2355
- return 2 * Math.PI / 60 / 60 * e.autoRotateSpeed;
2356
- }
2357
- function oe() {
2358
- return Math.pow(0.95, e.zoomSpeed);
2359
- }
2360
- function j(o) {
2361
- l.theta -= o;
2362
- }
2363
- function I(o) {
2364
- l.phi -= o;
2365
- }
2366
- const L = function() {
2367
- const o = new G();
2368
- return function(F, U) {
2369
- o.setFromMatrixColumn(U, 0), o.multiplyScalar(-F), p.add(o);
2531
+ let u = o.NONE;
2532
+ const c = 1e-6, s = new Ut(), d = new Ut();
2533
+ let p = 1;
2534
+ const h = new L(), b = new oe(), x = new oe(), S = new oe(), O = new oe(), m = new oe(), v = new oe(), y = new oe(), w = new oe(), F = new oe(), V = new L(), Z = new oe();
2535
+ let se = !1;
2536
+ const Y = [], fe = {};
2537
+ function j(i) {
2538
+ return i !== null ? 2 * Math.PI / 60 * e.autoRotateSpeed * i : 2 * Math.PI / 60 / 60 * e.autoRotateSpeed;
2539
+ }
2540
+ function D(i) {
2541
+ const E = Math.abs(i) / (100 * (window.devicePixelRatio | 0));
2542
+ return Math.pow(0.95, e.zoomSpeed * E);
2543
+ }
2544
+ function z(i) {
2545
+ d.theta -= i;
2546
+ }
2547
+ function ce(i) {
2548
+ d.phi -= i;
2549
+ }
2550
+ const ae = function() {
2551
+ const i = new L();
2552
+ return function(P, _) {
2553
+ i.setFromMatrixColumn(_, 0), i.multiplyScalar(-P), h.add(i);
2370
2554
  };
2371
- }(), J = function() {
2372
- const o = new G();
2373
- return function(F, U) {
2374
- e.screenSpacePanning === !0 ? o.setFromMatrixColumn(U, 1) : (o.setFromMatrixColumn(U, 0), o.crossVectors(e.object.up, o)), o.multiplyScalar(F), p.add(o);
2555
+ }(), le = function() {
2556
+ const i = new L();
2557
+ return function(P, _) {
2558
+ e.screenSpacePanning === !0 ? i.setFromMatrixColumn(_, 1) : (i.setFromMatrixColumn(_, 0), i.crossVectors(e.object.up, i)), i.multiplyScalar(P), h.add(i);
2375
2559
  };
2376
- }(), te = function() {
2377
- const o = new G();
2378
- return function(F, U) {
2379
- const K = e.domElement;
2560
+ }(), re = function() {
2561
+ const i = new L();
2562
+ return function(P, _) {
2563
+ const W = e.domElement;
2380
2564
  if (e.object.isPerspectiveCamera) {
2381
- const fe = e.object.position;
2382
- o.copy(fe).sub(e.target);
2383
- let ie = o.length();
2384
- ie *= Math.tan(e.object.fov / 2 * Math.PI / 180), L(2 * F * ie / K.clientHeight, e.object.matrix), J(2 * U * ie / K.clientHeight, e.object.matrix);
2565
+ const de = e.object.position;
2566
+ i.copy(de).sub(e.target);
2567
+ let J = i.length();
2568
+ J *= Math.tan(e.object.fov / 2 * Math.PI / 180), ae(2 * P * J / W.clientHeight, e.object.matrix), le(2 * _ * J / W.clientHeight, e.object.matrix);
2385
2569
  } else
2386
- e.object.isOrthographicCamera ? (L(F * (e.object.right - e.object.left) / e.object.zoom / K.clientWidth, e.object.matrix), J(U * (e.object.top - e.object.bottom) / e.object.zoom / K.clientHeight, e.object.matrix)) : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."), e.enablePan = !1);
2570
+ e.object.isOrthographicCamera ? (ae(P * (e.object.right - e.object.left) / e.object.zoom / W.clientWidth, e.object.matrix), le(_ * (e.object.top - e.object.bottom) / e.object.zoom / W.clientHeight, e.object.matrix)) : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."), e.enablePan = !1);
2387
2571
  };
2388
2572
  }();
2389
- function Me(o) {
2390
- e.object.isPerspectiveCamera || e.object.isOrthographicCamera ? h /= o : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), e.enableZoom = !1);
2573
+ function Me(i) {
2574
+ e.object.isPerspectiveCamera || e.object.isOrthographicCamera ? p /= i : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), e.enableZoom = !1);
2391
2575
  }
2392
- function Ae(o) {
2393
- e.object.isPerspectiveCamera || e.object.isOrthographicCamera ? h *= o : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), e.enableZoom = !1);
2576
+ function Ge(i) {
2577
+ e.object.isPerspectiveCamera || e.object.isOrthographicCamera ? p *= i : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), e.enableZoom = !1);
2394
2578
  }
2395
- function Ne(o) {
2579
+ function Pe(i, E) {
2396
2580
  if (!e.zoomToCursor)
2397
2581
  return;
2398
- ee = !0;
2399
- const w = e.domElement.getBoundingClientRect(), F = o.clientX - w.left, U = o.clientY - w.top, K = w.width, fe = w.height;
2400
- z.x = F / K * 2 - 1, z.y = -(U / fe) * 2 + 1, R.set(z.x, z.y, 1).unproject(n).sub(n.position).normalize();
2582
+ se = !0;
2583
+ const P = e.domElement.getBoundingClientRect(), _ = i - P.left, W = E - P.top, de = P.width, J = P.height;
2584
+ Z.x = _ / de * 2 - 1, Z.y = -(W / J) * 2 + 1, V.set(Z.x, Z.y, 1).unproject(e.object).sub(e.object.position).normalize();
2401
2585
  }
2402
- function Pe(o) {
2403
- return Math.max(e.minDistance, Math.min(e.maxDistance, o));
2586
+ function je(i) {
2587
+ return Math.max(e.minDistance, Math.min(e.maxDistance, i));
2404
2588
  }
2405
- function Le(o) {
2406
- g.set(o.clientX, o.clientY);
2589
+ function Ve(i) {
2590
+ b.set(i.clientX, i.clientY);
2407
2591
  }
2408
- function Ze(o) {
2409
- Ne(o), b.set(o.clientX, o.clientY);
2592
+ function nt(i) {
2593
+ Pe(i.clientX, i.clientX), y.set(i.clientX, i.clientY);
2410
2594
  }
2411
- function Fe(o) {
2412
- P.set(o.clientX, o.clientY);
2595
+ function Ye(i) {
2596
+ O.set(i.clientX, i.clientY);
2413
2597
  }
2414
- function Je(o) {
2415
- E.set(o.clientX, o.clientY), C.subVectors(E, g).multiplyScalar(e.rotateSpeed);
2416
- const w = e.domElement;
2417
- j(2 * Math.PI * C.x / w.clientHeight), I(2 * Math.PI * C.y / w.clientHeight), g.copy(E), e.update();
2598
+ function at(i) {
2599
+ x.set(i.clientX, i.clientY), S.subVectors(x, b).multiplyScalar(e.rotateSpeed);
2600
+ const E = e.domElement;
2601
+ z(2 * Math.PI * S.x / E.clientHeight), ce(2 * Math.PI * S.y / E.clientHeight), b.copy(x), e.update();
2418
2602
  }
2419
- function dt(o) {
2420
- v.set(o.clientX, o.clientY), O.subVectors(v, b), O.y > 0 ? Me(oe()) : O.y < 0 && Ae(oe()), b.copy(v), e.update();
2603
+ function bt(i) {
2604
+ w.set(i.clientX, i.clientY), F.subVectors(w, y), F.y > 0 ? Me(D(F.y)) : F.y < 0 && Ge(D(F.y)), y.copy(w), e.update();
2421
2605
  }
2422
- function ft(o) {
2423
- D.set(o.clientX, o.clientY), y.subVectors(D, P).multiplyScalar(e.panSpeed), te(y.x, y.y), P.copy(D), e.update();
2606
+ function yt(i) {
2607
+ m.set(i.clientX, i.clientY), v.subVectors(m, O).multiplyScalar(e.panSpeed), re(v.x, v.y), O.copy(m), e.update();
2424
2608
  }
2425
- function Ue(o) {
2426
- Ne(o), o.deltaY < 0 ? Ae(oe()) : o.deltaY > 0 && Me(oe()), e.update();
2609
+ function ze(i) {
2610
+ Pe(i.clientX, i.clientY), i.deltaY < 0 ? Ge(D(i.deltaY)) : i.deltaY > 0 && Me(D(i.deltaY)), e.update();
2427
2611
  }
2428
- function Be(o) {
2429
- let w = !1;
2430
- switch (o.code) {
2612
+ function We(i) {
2613
+ let E = !1;
2614
+ switch (i.code) {
2431
2615
  case e.keys.UP:
2432
- o.ctrlKey || o.metaKey || o.shiftKey ? I(2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : te(0, e.keyPanSpeed), w = !0;
2616
+ i.ctrlKey || i.metaKey || i.shiftKey ? ce(2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : re(0, e.keyPanSpeed), E = !0;
2433
2617
  break;
2434
2618
  case e.keys.BOTTOM:
2435
- o.ctrlKey || o.metaKey || o.shiftKey ? I(-2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : te(0, -e.keyPanSpeed), w = !0;
2619
+ i.ctrlKey || i.metaKey || i.shiftKey ? ce(-2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : re(0, -e.keyPanSpeed), E = !0;
2436
2620
  break;
2437
2621
  case e.keys.LEFT:
2438
- o.ctrlKey || o.metaKey || o.shiftKey ? j(2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : te(e.keyPanSpeed, 0), w = !0;
2622
+ i.ctrlKey || i.metaKey || i.shiftKey ? z(2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : re(e.keyPanSpeed, 0), E = !0;
2439
2623
  break;
2440
2624
  case e.keys.RIGHT:
2441
- o.ctrlKey || o.metaKey || o.shiftKey ? j(-2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : te(-e.keyPanSpeed, 0), w = !0;
2625
+ i.ctrlKey || i.metaKey || i.shiftKey ? z(-2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : re(-e.keyPanSpeed, 0), E = !0;
2442
2626
  break;
2443
2627
  }
2444
- w && (o.preventDefault(), e.update());
2628
+ E && (i.preventDefault(), e.update());
2445
2629
  }
2446
- function me() {
2447
- if (T.length === 1)
2448
- g.set(T[0].pageX, T[0].pageY);
2630
+ function Ee(i) {
2631
+ if (Y.length === 1)
2632
+ b.set(i.pageX, i.pageY);
2449
2633
  else {
2450
- const o = 0.5 * (T[0].pageX + T[1].pageX), w = 0.5 * (T[0].pageY + T[1].pageY);
2451
- g.set(o, w);
2634
+ const E = ue(i), P = 0.5 * (i.pageX + E.x), _ = 0.5 * (i.pageY + E.y);
2635
+ b.set(P, _);
2452
2636
  }
2453
2637
  }
2454
- function Re() {
2455
- if (T.length === 1)
2456
- P.set(T[0].pageX, T[0].pageY);
2638
+ function _e(i) {
2639
+ if (Y.length === 1)
2640
+ O.set(i.pageX, i.pageY);
2457
2641
  else {
2458
- const o = 0.5 * (T[0].pageX + T[1].pageX), w = 0.5 * (T[0].pageY + T[1].pageY);
2459
- P.set(o, w);
2642
+ const E = ue(i), P = 0.5 * (i.pageX + E.x), _ = 0.5 * (i.pageY + E.y);
2643
+ O.set(P, _);
2460
2644
  }
2461
2645
  }
2462
- function ge() {
2463
- const o = T[0].pageX - T[1].pageX, w = T[0].pageY - T[1].pageY, F = Math.sqrt(o * o + w * w);
2464
- b.set(0, F);
2646
+ function xe(i) {
2647
+ const E = ue(i), P = i.pageX - E.x, _ = i.pageY - E.y, W = Math.sqrt(P * P + _ * _);
2648
+ y.set(0, W);
2465
2649
  }
2466
- function ht() {
2467
- e.enableZoom && ge(), e.enablePan && Re();
2650
+ function Et(i) {
2651
+ e.enableZoom && xe(i), e.enablePan && _e(i);
2468
2652
  }
2469
- function Qe() {
2470
- e.enableZoom && ge(), e.enableRotate && me();
2653
+ function rt(i) {
2654
+ e.enableZoom && xe(i), e.enableRotate && Ee(i);
2471
2655
  }
2472
- function et(o) {
2473
- if (T.length == 1)
2474
- E.set(o.pageX, o.pageY);
2656
+ function it(i) {
2657
+ if (Y.length == 1)
2658
+ x.set(i.pageX, i.pageY);
2475
2659
  else {
2476
- const F = ye(o), U = 0.5 * (o.pageX + F.x), K = 0.5 * (o.pageY + F.y);
2477
- E.set(U, K);
2660
+ const P = ue(i), _ = 0.5 * (i.pageX + P.x), W = 0.5 * (i.pageY + P.y);
2661
+ x.set(_, W);
2478
2662
  }
2479
- C.subVectors(E, g).multiplyScalar(e.rotateSpeed);
2480
- const w = e.domElement;
2481
- j(2 * Math.PI * C.x / w.clientHeight), I(2 * Math.PI * C.y / w.clientHeight), g.copy(E);
2663
+ S.subVectors(x, b).multiplyScalar(e.rotateSpeed);
2664
+ const E = e.domElement;
2665
+ z(2 * Math.PI * S.x / E.clientHeight), ce(2 * Math.PI * S.y / E.clientHeight), b.copy(x);
2482
2666
  }
2483
- function tt(o) {
2484
- if (T.length === 1)
2485
- D.set(o.pageX, o.pageY);
2667
+ function ot(i) {
2668
+ if (Y.length === 1)
2669
+ m.set(i.pageX, i.pageY);
2486
2670
  else {
2487
- const w = ye(o), F = 0.5 * (o.pageX + w.x), U = 0.5 * (o.pageY + w.y);
2488
- D.set(F, U);
2671
+ const E = ue(i), P = 0.5 * (i.pageX + E.x), _ = 0.5 * (i.pageY + E.y);
2672
+ m.set(P, _);
2489
2673
  }
2490
- y.subVectors(D, P).multiplyScalar(e.panSpeed), te(y.x, y.y), P.copy(D);
2674
+ v.subVectors(m, O).multiplyScalar(e.panSpeed), re(v.x, v.y), O.copy(m);
2491
2675
  }
2492
- function ve(o) {
2493
- const w = ye(o), F = o.pageX - w.x, U = o.pageY - w.y, K = Math.sqrt(F * F + U * U);
2494
- v.set(0, K), O.set(0, Math.pow(v.y / b.y, e.zoomSpeed)), Me(O.y), b.copy(v);
2676
+ function we(i) {
2677
+ const E = ue(i), P = i.pageX - E.x, _ = i.pageY - E.y, W = Math.sqrt(P * P + _ * _);
2678
+ w.set(0, W), F.set(0, Math.pow(w.y / y.y, e.zoomSpeed)), Me(F.y), y.copy(w);
2679
+ const de = (i.pageX + E.x) * 0.5, J = (i.pageY + E.y) * 0.5;
2680
+ Pe(de, J);
2495
2681
  }
2496
- function je(o) {
2497
- e.enableZoom && ve(o), e.enablePan && tt(o);
2682
+ function ke(i) {
2683
+ e.enableZoom && we(i), e.enablePan && ot(i);
2498
2684
  }
2499
- function nt(o) {
2500
- e.enableZoom && ve(o), e.enableRotate && et(o);
2685
+ function st(i) {
2686
+ e.enableZoom && we(i), e.enableRotate && it(i);
2501
2687
  }
2502
- function $e(o) {
2503
- e.enabled !== !1 && (T.length === 0 && (e.domElement.setPointerCapture(o.pointerId), e.domElement.addEventListener("pointermove", ue), e.domElement.addEventListener("pointerup", be)), mt(o), o.pointerType === "touch" ? rt(o) : pt(o));
2688
+ function He(i) {
2689
+ e.enabled !== !1 && (Y.length === 0 && (e.domElement.setPointerCapture(i.pointerId), e.domElement.addEventListener("pointermove", ge), e.domElement.addEventListener("pointerup", Ce)), wt(i), i.pointerType === "touch" ? lt(i) : xt(i));
2504
2690
  }
2505
- function ue(o) {
2506
- e.enabled !== !1 && (o.pointerType === "touch" ? it(o) : Ge(o));
2691
+ function ge(i) {
2692
+ e.enabled !== !1 && (i.pointerType === "touch" ? ut(i) : Ke(i));
2507
2693
  }
2508
- function be(o) {
2509
- ot(o), T.length === 0 && (e.domElement.releasePointerCapture(o.pointerId), e.domElement.removeEventListener("pointermove", ue), e.domElement.removeEventListener("pointerup", be)), e.dispatchEvent(Ut), d = i.NONE;
2694
+ function Ce(i) {
2695
+ dt(i), Y.length === 0 && (e.domElement.releasePointerCapture(i.pointerId), e.domElement.removeEventListener("pointermove", ge), e.domElement.removeEventListener("pointerup", Ce)), e.dispatchEvent(Ht), u = o.NONE;
2510
2696
  }
2511
- function pt(o) {
2512
- let w;
2513
- switch (o.button) {
2697
+ function xt(i) {
2698
+ let E;
2699
+ switch (i.button) {
2514
2700
  case 0:
2515
- w = e.mouseButtons.LEFT;
2701
+ E = e.mouseButtons.LEFT;
2516
2702
  break;
2517
2703
  case 1:
2518
- w = e.mouseButtons.MIDDLE;
2704
+ E = e.mouseButtons.MIDDLE;
2519
2705
  break;
2520
2706
  case 2:
2521
- w = e.mouseButtons.RIGHT;
2707
+ E = e.mouseButtons.RIGHT;
2522
2708
  break;
2523
2709
  default:
2524
- w = -1;
2710
+ E = -1;
2525
2711
  }
2526
- switch (w) {
2527
- case De.DOLLY:
2712
+ switch (E) {
2713
+ case Ne.DOLLY:
2528
2714
  if (e.enableZoom === !1)
2529
2715
  return;
2530
- Ze(o), d = i.DOLLY;
2716
+ nt(i), u = o.DOLLY;
2531
2717
  break;
2532
- case De.ROTATE:
2533
- if (o.ctrlKey || o.metaKey || o.shiftKey) {
2718
+ case Ne.ROTATE:
2719
+ if (i.ctrlKey || i.metaKey || i.shiftKey) {
2534
2720
  if (e.enablePan === !1)
2535
2721
  return;
2536
- Fe(o), d = i.PAN;
2722
+ Ye(i), u = o.PAN;
2537
2723
  } else {
2538
2724
  if (e.enableRotate === !1)
2539
2725
  return;
2540
- Le(o), d = i.ROTATE;
2726
+ Ve(i), u = o.ROTATE;
2541
2727
  }
2542
2728
  break;
2543
- case De.PAN:
2544
- if (o.ctrlKey || o.metaKey || o.shiftKey) {
2729
+ case Ne.PAN:
2730
+ if (i.ctrlKey || i.metaKey || i.shiftKey) {
2545
2731
  if (e.enableRotate === !1)
2546
2732
  return;
2547
- Le(o), d = i.ROTATE;
2733
+ Ve(i), u = o.ROTATE;
2548
2734
  } else {
2549
2735
  if (e.enablePan === !1)
2550
2736
  return;
2551
- Fe(o), d = i.PAN;
2737
+ Ye(i), u = o.PAN;
2552
2738
  }
2553
2739
  break;
2554
2740
  default:
2555
- d = i.NONE;
2741
+ u = o.NONE;
2556
2742
  }
2557
- d !== i.NONE && e.dispatchEvent(gt);
2743
+ u !== o.NONE && e.dispatchEvent(Ot);
2558
2744
  }
2559
- function Ge(o) {
2560
- switch (d) {
2561
- case i.ROTATE:
2745
+ function Ke(i) {
2746
+ switch (u) {
2747
+ case o.ROTATE:
2562
2748
  if (e.enableRotate === !1)
2563
2749
  return;
2564
- Je(o);
2750
+ at(i);
2565
2751
  break;
2566
- case i.DOLLY:
2752
+ case o.DOLLY:
2567
2753
  if (e.enableZoom === !1)
2568
2754
  return;
2569
- dt(o);
2755
+ bt(i);
2570
2756
  break;
2571
- case i.PAN:
2757
+ case o.PAN:
2572
2758
  if (e.enablePan === !1)
2573
2759
  return;
2574
- ft(o);
2760
+ yt(i);
2575
2761
  break;
2576
2762
  }
2577
2763
  }
2578
- function at(o) {
2579
- e.enabled === !1 || e.enableZoom === !1 || d !== i.NONE || (o.preventDefault(), e.dispatchEvent(gt), Ue(o), e.dispatchEvent(Ut));
2764
+ function ct(i) {
2765
+ e.enabled === !1 || e.enableZoom === !1 || u !== o.NONE || (i.preventDefault(), e.dispatchEvent(Ot), ze(i), e.dispatchEvent(Ht));
2580
2766
  }
2581
- function Ye(o) {
2582
- e.enabled === !1 || e.enablePan === !1 || Be(o);
2767
+ function Xe(i) {
2768
+ e.enabled === !1 || e.enablePan === !1 || We(i);
2583
2769
  }
2584
- function rt(o) {
2585
- switch (Ve(o), T.length) {
2770
+ function lt(i) {
2771
+ switch (qe(i), Y.length) {
2586
2772
  case 1:
2587
2773
  switch (e.touches.ONE) {
2588
- case _e.ROTATE:
2774
+ case Le.ROTATE:
2589
2775
  if (e.enableRotate === !1)
2590
2776
  return;
2591
- me(), d = i.TOUCH_ROTATE;
2777
+ Ee(i), u = o.TOUCH_ROTATE;
2592
2778
  break;
2593
- case _e.PAN:
2779
+ case Le.PAN:
2594
2780
  if (e.enablePan === !1)
2595
2781
  return;
2596
- Re(), d = i.TOUCH_PAN;
2782
+ _e(i), u = o.TOUCH_PAN;
2597
2783
  break;
2598
2784
  default:
2599
- d = i.NONE;
2785
+ u = o.NONE;
2600
2786
  }
2601
2787
  break;
2602
2788
  case 2:
2603
2789
  switch (e.touches.TWO) {
2604
- case _e.DOLLY_PAN:
2790
+ case Le.DOLLY_PAN:
2605
2791
  if (e.enableZoom === !1 && e.enablePan === !1)
2606
2792
  return;
2607
- ht(), d = i.TOUCH_DOLLY_PAN;
2793
+ Et(i), u = o.TOUCH_DOLLY_PAN;
2608
2794
  break;
2609
- case _e.DOLLY_ROTATE:
2795
+ case Le.DOLLY_ROTATE:
2610
2796
  if (e.enableZoom === !1 && e.enableRotate === !1)
2611
2797
  return;
2612
- Qe(), d = i.TOUCH_DOLLY_ROTATE;
2798
+ rt(i), u = o.TOUCH_DOLLY_ROTATE;
2613
2799
  break;
2614
2800
  default:
2615
- d = i.NONE;
2801
+ u = o.NONE;
2616
2802
  }
2617
2803
  break;
2618
2804
  default:
2619
- d = i.NONE;
2805
+ u = o.NONE;
2620
2806
  }
2621
- d !== i.NONE && e.dispatchEvent(gt);
2807
+ u !== o.NONE && e.dispatchEvent(Ot);
2622
2808
  }
2623
- function it(o) {
2624
- switch (Ve(o), d) {
2625
- case i.TOUCH_ROTATE:
2809
+ function ut(i) {
2810
+ switch (qe(i), u) {
2811
+ case o.TOUCH_ROTATE:
2626
2812
  if (e.enableRotate === !1)
2627
2813
  return;
2628
- et(o), e.update();
2814
+ it(i), e.update();
2629
2815
  break;
2630
- case i.TOUCH_PAN:
2816
+ case o.TOUCH_PAN:
2631
2817
  if (e.enablePan === !1)
2632
2818
  return;
2633
- tt(o), e.update();
2819
+ ot(i), e.update();
2634
2820
  break;
2635
- case i.TOUCH_DOLLY_PAN:
2821
+ case o.TOUCH_DOLLY_PAN:
2636
2822
  if (e.enableZoom === !1 && e.enablePan === !1)
2637
2823
  return;
2638
- je(o), e.update();
2824
+ ke(i), e.update();
2639
2825
  break;
2640
- case i.TOUCH_DOLLY_ROTATE:
2826
+ case o.TOUCH_DOLLY_ROTATE:
2641
2827
  if (e.enableZoom === !1 && e.enableRotate === !1)
2642
2828
  return;
2643
- nt(o), e.update();
2829
+ st(i), e.update();
2644
2830
  break;
2645
2831
  default:
2646
- d = i.NONE;
2832
+ u = o.NONE;
2647
2833
  }
2648
2834
  }
2649
- function de(o) {
2650
- e.enabled !== !1 && o.preventDefault();
2835
+ function ve(i) {
2836
+ e.enabled !== !1 && i.preventDefault();
2651
2837
  }
2652
- function mt(o) {
2653
- T.push(o);
2838
+ function wt(i) {
2839
+ Y.push(i.pointerId);
2654
2840
  }
2655
- function ot(o) {
2656
- delete le[o.pointerId];
2657
- for (let w = 0; w < T.length; w++)
2658
- if (T[w].pointerId == o.pointerId) {
2659
- T.splice(w, 1);
2841
+ function dt(i) {
2842
+ delete fe[i.pointerId];
2843
+ for (let E = 0; E < Y.length; E++)
2844
+ if (Y[E] == i.pointerId) {
2845
+ Y.splice(E, 1);
2660
2846
  return;
2661
2847
  }
2662
2848
  }
2663
- function Ve(o) {
2664
- let w = le[o.pointerId];
2665
- w === void 0 && (w = new ae(), le[o.pointerId] = w), w.set(o.pageX, o.pageY);
2849
+ function qe(i) {
2850
+ let E = fe[i.pointerId];
2851
+ E === void 0 && (E = new oe(), fe[i.pointerId] = E), E.set(i.pageX, i.pageY);
2666
2852
  }
2667
- function ye(o) {
2668
- const w = o.pointerId === T[0].pointerId ? T[1] : T[0];
2669
- return le[w.pointerId];
2853
+ function ue(i) {
2854
+ const E = i.pointerId === Y[0] ? Y[1] : Y[0];
2855
+ return fe[E];
2670
2856
  }
2671
- e.domElement.addEventListener("contextmenu", de), e.domElement.addEventListener("pointerdown", $e), e.domElement.addEventListener("pointercancel", be), e.domElement.addEventListener("wheel", at, { passive: !1 }), this.update();
2857
+ e.domElement.addEventListener("contextmenu", ve), e.domElement.addEventListener("pointerdown", He), e.domElement.addEventListener("pointercancel", Ce), e.domElement.addEventListener("wheel", ct, { passive: !1 }), this.update();
2672
2858
  }
2673
2859
  }
2674
- const xt = (t) => {
2675
- const [n, r] = re(!1), [e, i] = re(t.options[t.index]), d = () => {
2676
- r(!n);
2860
+ const _t = (t) => {
2861
+ const [n, a] = ne(!1), [e, o] = ne(t.options[t.index]), u = () => {
2862
+ a(!n);
2677
2863
  }, c = (s) => {
2678
- s !== e && (t.onSelect(s), i(s)), r(!1);
2864
+ s !== e && (t.onSelect(s), o(s)), a(!1);
2679
2865
  };
2680
- return /* @__PURE__ */ u.jsxs("div", { className: `dropdown ${t.up === !0 ? "up" : ""}`, children: [
2681
- /* @__PURE__ */ u.jsx("div", { className: "dropdown-toggle", onClick: d, children: e }),
2682
- n && /* @__PURE__ */ u.jsx("ul", { className: "dropdown-menu", children: t.options.map((s) => /* @__PURE__ */ u.jsx("li", { onClick: () => c(s), children: s }, s)) })
2866
+ return /* @__PURE__ */ l.jsxs("div", { className: `dropdown ${t.up === !0 ? "up" : ""}`, children: [
2867
+ /* @__PURE__ */ l.jsx("div", { className: "dropdown-toggle", onClick: u, children: e }),
2868
+ n && /* @__PURE__ */ l.jsx("ul", { className: "dropdown-menu", children: t.options.map((s) => /* @__PURE__ */ l.jsx("li", { onClick: () => c(s), children: s }, s)) })
2683
2869
  ] });
2684
- }, Ce = Pn(function(n, r) {
2870
+ }, Te = $n(function(n, a) {
2685
2871
  const e = n.options.indexOf(n.camera.name);
2686
- return /* @__PURE__ */ u.jsxs("div", { className: "CameraWindow", children: [
2687
- /* @__PURE__ */ u.jsx("div", { ref: r, className: "clickable" }),
2688
- /* @__PURE__ */ u.jsx(xt, { index: e, options: n.options, onSelect: n.onSelect, up: !0 })
2872
+ return /* @__PURE__ */ l.jsxs("div", { className: "CameraWindow", children: [
2873
+ /* @__PURE__ */ l.jsx("div", { ref: a, className: "clickable" }),
2874
+ /* @__PURE__ */ l.jsx(_t, { index: e, options: n.options, onSelect: n.onSelect, up: !0 })
2689
2875
  ] });
2690
- }), aa = `out vec3 worldPosition;
2691
- uniform float uDistance;
2692
-
2693
- void main() {
2694
- // Scale the plane by the drawing distance
2695
- worldPosition = position.xzy * uDistance;
2696
- worldPosition.xz += cameraPosition.xz;
2697
-
2698
- gl_Position = projectionMatrix * modelViewMatrix * vec4(worldPosition, 1.0);
2699
- }`, ra = `out vec4 fragColor;
2700
- in vec3 worldPosition;
2701
-
2702
- uniform float uDivisions;
2703
- uniform float uScale;
2704
- uniform vec3 uColor;
2705
- uniform float uDistance;
2706
- uniform float uSubgridOpacity;
2707
- uniform float uGridOpacity;
2708
-
2709
- float getGrid(float gapSize) {
2710
- vec2 worldPositionByDivision = worldPosition.xz / gapSize;
2711
-
2712
- // Inverted, 0 where line, >1 where there's no line
2713
- // We use the worldPosition (which in this case we use similarly to UVs) differential to control the anti-aliasing
2714
- // We need to do the -0.5)-0.5 trick because the result fades out from 0 to 1, and we want both
2715
- // worldPositionByDivision == 0.3 and worldPositionByDivision == 0.7 to result in the same fade, i.e. 0.3,
2716
- // otherwise only one side of the line will be anti-aliased
2717
- vec2 grid = abs(fract(worldPositionByDivision-0.5)-0.5) / fwidth(worldPositionByDivision) / 2.0;
2718
- float gridLine = min(grid.x, grid.y);
2719
-
2720
- // Uninvert and clamp
2721
- return 1.0 - min(gridLine, 1.0);
2722
- }
2723
-
2724
- void main() {
2725
- float cameraDistanceToGridPlane = distance(cameraPosition.y, worldPosition.y);
2726
- float cameraDistanceToFragmentOnGridPlane = distance(cameraPosition.xz, worldPosition.xz);
2727
-
2728
- // The size of the grid and subgrid are powers of each other and they are determined based on camera distance.
2729
- // The current grid will become the next subgrid when it becomes too small, and its next power becomes the new grid.
2730
- float subGridPower = pow(uDivisions, floor(log(cameraDistanceToGridPlane) / log(uDivisions)));
2731
- float gridPower = subGridPower * uDivisions;
2732
-
2733
- // If we want to fade both the grid and its subgrid, we need to displays 3 different opacities, with the next grid being the third
2734
- float nextGridPower = gridPower * uDivisions;
2735
-
2736
- // 1 where grid, 0 where no grid
2737
- float subgrid = getGrid(subGridPower * uScale);
2738
- float grid = getGrid(gridPower * uScale);
2739
- float nextGrid = getGrid(nextGridPower * uScale);
2740
-
2741
- // Where we are between the introduction of the current grid power and when we switch to the next grid power
2742
- float stepPercentage = (cameraDistanceToGridPlane - subGridPower)/(gridPower - subGridPower);
2743
-
2744
- // The last x percentage of the current step over which we want to fade
2745
- float fadeRange = 0.3;
2746
-
2747
- // We calculate the fade percentage from the step percentage and the fade range
2748
- float fadePercentage = max(stepPercentage - 1.0 + fadeRange, 0.0) / fadeRange;
2749
-
2750
- // Set base opacity based on how close we are to the drawing distance, with a cubic falloff
2751
- float baseOpacity = subgrid * pow(1.0 - min(cameraDistanceToFragmentOnGridPlane / uDistance, 1.0), 3.0);
2752
-
2753
- // Shade the subgrid
2754
- fragColor = vec4(uColor.rgb, (baseOpacity - fadePercentage) * uSubgridOpacity);
2755
-
2756
- // Somewhat arbitrary additional fade coefficient to counter anti-aliasing popping when switching between grid powers
2757
- float fadeCoefficient = 0.5;
2758
-
2759
- // Shade the grid
2760
- fragColor.a = mix(fragColor.a, baseOpacity * uGridOpacity - fadePercentage * (uGridOpacity - uSubgridOpacity) * fadeCoefficient, grid);
2761
-
2762
- // Shade the next grid
2763
- fragColor.a = mix(fragColor.a, baseOpacity * uGridOpacity, nextGrid);
2764
-
2765
- if (fragColor.a <= 0.0) discard;
2766
- }`;
2767
- class ia extends pn {
2768
- constructor(n) {
2769
- super({
2770
- extensions: {
2771
- derivatives: !0
2772
- },
2773
- glslVersion: mn,
2774
- side: gn,
2775
- transparent: !0,
2776
- uniforms: {
2777
- uScale: {
2778
- value: (n == null ? void 0 : n.scale) !== void 0 ? n == null ? void 0 : n.scale : 0.1
2779
- },
2780
- uDivisions: {
2781
- value: (n == null ? void 0 : n.divisions) !== void 0 ? n == null ? void 0 : n.divisions : 10
2782
- },
2783
- uColor: {
2784
- value: (n == null ? void 0 : n.color) !== void 0 ? n == null ? void 0 : n.color : new Ct(16777215)
2785
- },
2786
- uDistance: {
2787
- value: (n == null ? void 0 : n.distance) !== void 0 ? n == null ? void 0 : n.distance : 1e4
2788
- },
2789
- uSubgridOpacity: {
2790
- value: (n == null ? void 0 : n.subgridOpacity) !== void 0 ? n == null ? void 0 : n.subgridOpacity : 0.15
2791
- },
2792
- uGridOpacity: {
2793
- value: (n == null ? void 0 : n.gridOpacity) !== void 0 ? n == null ? void 0 : n.gridOpacity : 0.25
2794
- }
2795
- },
2796
- vertexShader: aa,
2797
- fragmentShader: ra,
2798
- name: "InfiniteGrid",
2799
- depthWrite: !1
2800
- });
2801
- }
2802
- }
2803
- class oa extends vn {
2804
- constructor() {
2805
- const r = new ia();
2806
- super(new bn(2, 2), r);
2807
- $(this, "gridMaterial");
2808
- this.gridMaterial = r, this.frustumCulled = !1, this.name = "InfiniteGridHelper", this.position.y = 0.1;
2809
- }
2810
- update() {
2811
- this.gridMaterial.needsUpdate = !0;
2812
- }
2813
- }
2814
- const $t = [
2876
+ }), Xt = [
2815
2877
  "Single",
2816
2878
  "Side by Side",
2817
2879
  "Stacked",
2818
2880
  "Quad"
2819
- ], q = /* @__PURE__ */ new Map(), H = /* @__PURE__ */ new Map(), ce = /* @__PURE__ */ new Map();
2820
- function Oe(t, n) {
2821
- const r = new Vt(-100, 100, 100, -100, 50, 3e3);
2822
- return r.name = t, r.position.copy(n), r.lookAt(0, 0, 0), q.set(t, r), r;
2881
+ ], X = /* @__PURE__ */ new Map(), H = /* @__PURE__ */ new Map(), me = /* @__PURE__ */ new Map();
2882
+ function Re(t, n) {
2883
+ const a = new en(-100, 100, 100, -100, 50, 3e3);
2884
+ return a.name = t, a.position.copy(n), a.lookAt(0, 0, 0), X.set(t, a), a;
2823
2885
  }
2824
- Oe("Top", new G(0, 1e3, 0));
2825
- Oe("Bottom", new G(0, -1e3, 0));
2826
- Oe("Left", new G(-1e3, 0, 0));
2827
- Oe("Right", new G(1e3, 0, 0));
2828
- Oe("Front", new G(0, 0, 1e3));
2829
- Oe("Back", new G(0, 0, -1e3));
2830
- Oe("Orthographic", new G(1e3, 1e3, 1e3));
2831
- const ut = new bt(60, 1, 50, 3e3);
2832
- ut.name = "Debug";
2833
- ut.position.set(500, 500, 500);
2834
- ut.lookAt(0, 0, 0);
2835
- q.set("Debug", ut);
2836
- let vt = "Default";
2837
- const sa = [
2838
- "Default",
2886
+ Re("Top", new L(0, 1e3, 0));
2887
+ Re("Bottom", new L(0, -1e3, 0));
2888
+ Re("Left", new L(-1e3, 0, 0));
2889
+ Re("Right", new L(1e3, 0, 0));
2890
+ Re("Front", new L(0, 0, 1e3));
2891
+ Re("Back", new L(0, 0, -1e3));
2892
+ Re("Orthographic", new L(1e3, 1e3, 1e3));
2893
+ const vt = new Tt(60, 1, 50, 3e3);
2894
+ vt.name = "Debug";
2895
+ vt.position.set(500, 500, 500);
2896
+ vt.lookAt(0, 0, 0);
2897
+ X.set("Debug", vt);
2898
+ const qt = [
2899
+ "Renderer",
2900
+ "Depth",
2839
2901
  "Normals",
2902
+ "UVs",
2840
2903
  "Wireframe"
2841
- ], ca = new yn(), la = new En({
2904
+ ], Ma = new _n(), Pa = new kn(), ja = new da(), _a = new Dn({
2842
2905
  opacity: 0.33,
2843
2906
  transparent: !0,
2844
2907
  wireframe: !0
2845
- }), V = new wn();
2846
- function Ma(t) {
2847
- const [n, r] = re(t.mode !== void 0 ? t.mode : "Quad"), e = Se(null), i = Se(null), d = Se(null), c = Se(null);
2848
- let s = q.get("Debug"), l = q.get("Orthographic"), h = q.get("Front"), p = q.get("Top");
2849
- const g = (y, b) => {
2850
- const v = H.get(y.name);
2851
- v !== void 0 && v.dispose(), H.delete(y.name);
2852
- const O = ce.get(y.name);
2853
- O !== void 0 && (V.remove(O), O.dispose()), ce.delete(y.name);
2854
- const R = new na(y, b);
2855
- switch (y.name) {
2908
+ });
2909
+ let mt = "Renderer";
2910
+ const A = new tn();
2911
+ A.name = "Debug Scene";
2912
+ let tt = new tn();
2913
+ A.add(tt);
2914
+ const ka = new ca();
2915
+ A.add(ka);
2916
+ const dn = new An(500);
2917
+ dn.name = "axisHelper";
2918
+ A.add(dn);
2919
+ let G = X.get("Debug"), te = X.get("Orthographic"), Fe = X.get("Front"), Ue = X.get("Top");
2920
+ function Za(t) {
2921
+ const [n, a] = ne(t.mode !== void 0 ? t.mode : "Quad"), [e, o] = ne(null), u = ye(null), c = ye(null), s = ye(null), d = ye(null), p = ye(null), h = (m, v) => {
2922
+ const y = H.get(m.name);
2923
+ y !== void 0 && y.dispose(), H.delete(m.name);
2924
+ const w = me.get(m.name);
2925
+ w !== void 0 && (A.remove(w), w.dispose()), me.delete(m.name);
2926
+ const F = new Ra(m, v);
2927
+ switch (F.enableDamping = !0, F.dampingFactor = 0.05, m.name) {
2856
2928
  case "Top":
2857
2929
  case "Bottom":
2858
2930
  case "Left":
2859
2931
  case "Right":
2860
2932
  case "Front":
2861
2933
  case "Back":
2862
- R.enableRotate = !1;
2934
+ F.enableRotate = !1;
2863
2935
  break;
2864
2936
  }
2865
- if (H.set(y.name, R), y instanceof bt) {
2866
- const z = new Cn(y);
2867
- ce.set(y.name, z), V.add(z);
2868
- }
2869
- }, E = (y) => {
2870
- const b = ce.get(y.name);
2871
- b !== void 0 && (V.remove(b), b.dispose(), ce.delete(y.name));
2872
- const v = H.get(y.name);
2873
- v !== void 0 && (v.dispose(), H.delete(y.name));
2874
- }, C = () => {
2875
- H.forEach((y, b) => {
2876
- y.dispose();
2877
- const v = ce.get(b);
2878
- v !== void 0 && (V.remove(v), v.dispose()), ce.delete(b), H.delete(b);
2879
- }), H.clear(), ce.clear();
2880
- }, P = () => {
2937
+ if (H.set(m.name, F), m instanceof Tt) {
2938
+ const V = new Nn(m);
2939
+ me.set(m.name, V), A.add(V);
2940
+ }
2941
+ }, b = (m) => {
2942
+ const v = me.get(m.name);
2943
+ v !== void 0 && (A.remove(v), v.dispose(), me.delete(m.name));
2944
+ const y = H.get(m.name);
2945
+ y !== void 0 && (y.dispose(), H.delete(m.name));
2946
+ }, x = () => {
2947
+ H.forEach((m, v) => {
2948
+ m.dispose();
2949
+ const y = me.get(v);
2950
+ y !== void 0 && (A.remove(y), y.dispose()), me.delete(v), H.delete(v);
2951
+ }), H.clear(), me.clear();
2952
+ }, S = () => {
2881
2953
  switch (n) {
2882
2954
  case "Single":
2883
- g(s, e.current);
2955
+ h(G, c.current);
2884
2956
  break;
2885
2957
  case "Side by Side":
2886
2958
  case "Stacked":
2887
- g(s, e.current), g(l, i.current);
2959
+ h(G, c.current), h(te, s.current);
2888
2960
  break;
2889
2961
  case "Quad":
2890
- g(s, e.current), g(l, i.current), g(h, d.current), g(p, c.current);
2962
+ h(G, c.current), h(te, s.current), h(Fe, d.current), h(Ue, p.current);
2891
2963
  break;
2892
2964
  }
2893
2965
  };
2894
- qe(() => {
2895
- V.name = "Debug Scene", V.add(t.scene);
2896
- const y = new oa();
2897
- V.add(y);
2898
- const b = new xn(500);
2899
- b.name = "axisHelper", V.add(b);
2900
- }, []), qe(() => {
2901
- const y = t.renderer.getSize(new ae());
2902
- let b = y.x, v = y.y, O = Math.floor(b / 2), R = Math.floor(v / 2), z = -1;
2903
- const ee = () => {
2904
- b = window.innerWidth - 300, v = window.innerHeight, O = Math.floor(b / 2), R = Math.floor(v / 2);
2905
- let j = b, I = v;
2966
+ Be(() => {
2967
+ const m = new In({
2968
+ canvas: u.current,
2969
+ stencil: !1
2970
+ });
2971
+ m.autoClear = !1, m.shadowMap.enabled = !0, m.setPixelRatio(devicePixelRatio), m.setClearColor(0), o(m);
2972
+ }, []), Be(() => {
2973
+ const m = () => {
2974
+ on(tt), A.remove(tt), t.three.scene !== void 0 && (tt = t.three.scene, A.add(tt));
2975
+ };
2976
+ return I.addEventListener(N.SET_SCENE, m), () => {
2977
+ I.removeEventListener(N.SET_SCENE, m);
2978
+ };
2979
+ }, []), Be(() => {
2980
+ if (e === null)
2981
+ return;
2982
+ let m = window.innerWidth, v = window.innerHeight, y = Math.floor(m / 2), w = Math.floor(v / 2), F = -1;
2983
+ const V = () => {
2984
+ m = window.innerWidth - 300, v = window.innerHeight, y = Math.floor(m / 2), w = Math.floor(v / 2), e.setSize(m, v);
2985
+ let j = m, D = v;
2906
2986
  switch (n) {
2907
2987
  case "Side by Side":
2908
- j = O, I = v;
2988
+ j = y, D = v;
2909
2989
  break;
2910
2990
  case "Stacked":
2911
- j = b, I = R;
2991
+ j = m, D = w;
2912
2992
  break;
2913
2993
  case "Quad":
2914
- j = O, I = R;
2994
+ j = y, D = w;
2915
2995
  break;
2916
2996
  }
2917
- q.forEach((L) => {
2918
- var J;
2919
- L instanceof Vt ? (L.left = j / -2, L.right = j / 2, L.top = I / 2, L.bottom = I / -2, L.updateProjectionMatrix()) : L instanceof bt && (L.aspect = j / I, L.updateProjectionMatrix(), (J = ce.get(L.name)) == null || J.update());
2997
+ X.forEach((z) => {
2998
+ var ce;
2999
+ z instanceof en ? (z.left = j / -2, z.right = j / 2, z.top = D / 2, z.bottom = D / -2, z.updateProjectionMatrix()) : z instanceof Tt && (z.aspect = j / D, z.updateProjectionMatrix(), (ce = me.get(z.name)) == null || ce.update());
2920
3000
  });
2921
- }, T = () => {
2922
- t.renderer.setViewport(0, 0, b, v), t.renderer.setScissor(0, 0, b, v), t.renderer.render(V, s);
2923
- }, le = () => {
3001
+ }, Z = () => {
3002
+ e.setViewport(0, 0, m, v), e.setScissor(0, 0, m, v), e.render(A, G);
3003
+ }, se = () => {
2924
3004
  if (n === "Side by Side")
2925
- t.renderer.setViewport(0, 0, O, v), t.renderer.setScissor(0, 0, O, v), t.renderer.render(V, s), t.renderer.setViewport(O, 0, O, v), t.renderer.setScissor(O, 0, O, v), t.renderer.render(V, l);
3005
+ e.setViewport(0, 0, y, v), e.setScissor(0, 0, y, v), e.render(A, G), e.setViewport(y, 0, y, v), e.setScissor(y, 0, y, v), e.render(A, te);
2926
3006
  else {
2927
- const j = v - R;
2928
- t.renderer.setViewport(0, j, b, R), t.renderer.setScissor(0, j, b, R), t.renderer.render(V, s), t.renderer.setViewport(0, 0, b, R), t.renderer.setScissor(0, 0, b, R), t.renderer.render(V, l);
3007
+ const j = v - w;
3008
+ e.setViewport(0, j, m, w), e.setScissor(0, j, m, w), e.render(A, G), e.setViewport(0, 0, m, w), e.setScissor(0, 0, m, w), e.render(A, te);
2929
3009
  }
2930
- }, Te = () => {
2931
- let j = 0, I = 0;
2932
- I = v - R, j = 0, t.renderer.setViewport(j, I, O, R), t.renderer.setScissor(j, I, O, R), t.renderer.render(V, s), j = O, t.renderer.setViewport(j, I, O, R), t.renderer.setScissor(j, I, O, R), t.renderer.render(V, l), I = 0, j = 0, t.renderer.setViewport(j, I, O, R), t.renderer.setScissor(j, I, O, R), t.renderer.render(V, h), j = O, t.renderer.setViewport(j, I, O, R), t.renderer.setScissor(j, I, O, R), t.renderer.render(V, p);
2933
- }, oe = () => {
3010
+ }, Y = () => {
3011
+ let j = 0, D = 0;
3012
+ D = v - w, j = 0, e.setViewport(j, D, y, w), e.setScissor(j, D, y, w), e.render(A, G), j = y, e.setViewport(j, D, y, w), e.setScissor(j, D, y, w), e.render(A, te), D = 0, j = 0, e.setViewport(j, D, y, w), e.setScissor(j, D, y, w), e.render(A, Fe), j = y, e.setViewport(j, D, y, w), e.setScissor(j, D, y, w), e.render(A, Ue);
3013
+ }, fe = () => {
2934
3014
  switch (H.forEach((j) => {
2935
3015
  j.update();
2936
- }), t.scene.update(), t.renderer.clear(), n) {
3016
+ }), e.clear(), n) {
2937
3017
  case "Single":
2938
- T();
3018
+ Z();
2939
3019
  break;
2940
3020
  case "Side by Side":
2941
3021
  case "Stacked":
2942
- le();
3022
+ se();
2943
3023
  break;
2944
3024
  case "Quad":
2945
- Te();
3025
+ Y();
2946
3026
  break;
2947
3027
  }
2948
- z = requestAnimationFrame(oe);
3028
+ F = requestAnimationFrame(fe);
2949
3029
  };
2950
- return P(), window.addEventListener("resize", ee), ee(), oe(), () => {
2951
- window.removeEventListener("resize", ee), cancelAnimationFrame(z), z = -1;
3030
+ return S(), window.addEventListener("resize", V), V(), fe(), () => {
3031
+ window.removeEventListener("resize", V), cancelAnimationFrame(F), F = -1;
2952
3032
  };
2953
- }, [n]);
2954
- const D = [
2955
- "Top",
2956
- "Bottom",
2957
- "Left",
2958
- "Right",
2959
- "Front",
2960
- "Back",
2961
- "Orthographic",
2962
- "Debug"
2963
- ];
2964
- return t.cameras.forEach((y) => {
2965
- q.set(y.name, y), D.push(y.name);
2966
- }), /* @__PURE__ */ u.jsxs("div", { className: "multiview", children: [
2967
- /* @__PURE__ */ u.jsxs("div", { className: `cameras ${n === "Single" || n === "Stacked" ? "single" : ""}`, children: [
2968
- n === "Single" && /* @__PURE__ */ u.jsx(u.Fragment, { children: /* @__PURE__ */ u.jsx(Ce, { camera: s, options: D, ref: e, onSelect: (y) => {
2969
- var v;
2970
- (v = H.get(s.name)) == null || v.dispose();
2971
- const b = q.get(y);
2972
- b !== void 0 && (E(s), s = b, g(b, e.current));
3033
+ }, [n, e]);
3034
+ const O = [];
3035
+ return X.forEach((m, v) => {
3036
+ O.push(v);
3037
+ }), /* @__PURE__ */ l.jsxs("div", { className: "multiview", children: [
3038
+ /* @__PURE__ */ l.jsx("canvas", { ref: u }),
3039
+ /* @__PURE__ */ l.jsxs("div", { className: `cameras ${n === "Single" || n === "Stacked" ? "single" : ""}`, children: [
3040
+ n === "Single" && /* @__PURE__ */ l.jsx(l.Fragment, { children: /* @__PURE__ */ l.jsx(Te, { camera: G, options: O, ref: c, onSelect: (m) => {
3041
+ var y;
3042
+ (y = H.get(G.name)) == null || y.dispose();
3043
+ const v = X.get(m);
3044
+ v !== void 0 && (b(G), G = v, h(v, c.current));
2973
3045
  } }) }),
2974
- (n === "Side by Side" || n === "Stacked") && /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
2975
- /* @__PURE__ */ u.jsx(Ce, { camera: s, options: D, ref: e, onSelect: (y) => {
2976
- var v;
2977
- (v = H.get(s.name)) == null || v.dispose();
2978
- const b = q.get(y);
2979
- b !== void 0 && (E(s), s = b, g(b, e.current));
3046
+ (n === "Side by Side" || n === "Stacked") && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
3047
+ /* @__PURE__ */ l.jsx(Te, { camera: G, options: O, ref: c, onSelect: (m) => {
3048
+ var y;
3049
+ (y = H.get(G.name)) == null || y.dispose();
3050
+ const v = X.get(m);
3051
+ v !== void 0 && (b(G), G = v, h(v, c.current));
2980
3052
  } }),
2981
- /* @__PURE__ */ u.jsx(Ce, { camera: l, options: D, ref: i, onSelect: (y) => {
2982
- var v;
2983
- (v = H.get(l.name)) == null || v.dispose();
2984
- const b = q.get(y);
2985
- b !== void 0 && (E(l), l = b, g(b, i.current));
3053
+ /* @__PURE__ */ l.jsx(Te, { camera: te, options: O, ref: s, onSelect: (m) => {
3054
+ var y;
3055
+ (y = H.get(te.name)) == null || y.dispose();
3056
+ const v = X.get(m);
3057
+ v !== void 0 && (b(te), te = v, h(v, s.current));
2986
3058
  } })
2987
3059
  ] }),
2988
- n === "Quad" && /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
2989
- /* @__PURE__ */ u.jsx(Ce, { camera: s, options: D, ref: e, onSelect: (y) => {
2990
- var v;
2991
- (v = H.get(s.name)) == null || v.dispose();
2992
- const b = q.get(y);
2993
- b !== void 0 && (E(s), s = b, g(b, e.current));
3060
+ n === "Quad" && /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
3061
+ /* @__PURE__ */ l.jsx(Te, { camera: G, options: O, ref: c, onSelect: (m) => {
3062
+ var y;
3063
+ (y = H.get(G.name)) == null || y.dispose();
3064
+ const v = X.get(m);
3065
+ v !== void 0 && (b(G), G = v, h(v, c.current));
2994
3066
  } }),
2995
- /* @__PURE__ */ u.jsx(Ce, { camera: l, options: D, ref: i, onSelect: (y) => {
2996
- var v;
2997
- (v = H.get(l.name)) == null || v.dispose();
2998
- const b = q.get(y);
2999
- b !== void 0 && (E(l), l = b, g(b, i.current));
3067
+ /* @__PURE__ */ l.jsx(Te, { camera: te, options: O, ref: s, onSelect: (m) => {
3068
+ var y;
3069
+ (y = H.get(te.name)) == null || y.dispose();
3070
+ const v = X.get(m);
3071
+ v !== void 0 && (b(te), te = v, h(v, s.current));
3000
3072
  } }),
3001
- /* @__PURE__ */ u.jsx(Ce, { camera: h, options: D, ref: d, onSelect: (y) => {
3002
- var v;
3003
- (v = H.get(h.name)) == null || v.dispose();
3004
- const b = q.get(y);
3005
- b !== void 0 && (E(h), h = b, g(b, d.current));
3073
+ /* @__PURE__ */ l.jsx(Te, { camera: Fe, options: O, ref: d, onSelect: (m) => {
3074
+ var y;
3075
+ (y = H.get(Fe.name)) == null || y.dispose();
3076
+ const v = X.get(m);
3077
+ v !== void 0 && (b(Fe), Fe = v, h(v, d.current));
3006
3078
  } }),
3007
- /* @__PURE__ */ u.jsx(Ce, { camera: p, options: D, ref: c, onSelect: (y) => {
3008
- var v;
3009
- (v = H.get(p.name)) == null || v.dispose();
3010
- const b = q.get(y);
3011
- b !== void 0 && (E(p), p = b, g(b, c.current));
3079
+ /* @__PURE__ */ l.jsx(Te, { camera: Ue, options: O, ref: p, onSelect: (m) => {
3080
+ var y;
3081
+ (y = H.get(Ue.name)) == null || y.dispose();
3082
+ const v = X.get(m);
3083
+ v !== void 0 && (b(Ue), Ue = v, h(v, p.current));
3012
3084
  } })
3013
3085
  ] })
3014
3086
  ] }),
3015
- /* @__PURE__ */ u.jsxs("div", { className: "settings", children: [
3016
- /* @__PURE__ */ u.jsx(
3017
- xt,
3087
+ /* @__PURE__ */ l.jsxs("div", { className: "settings", children: [
3088
+ /* @__PURE__ */ l.jsx(
3089
+ _t,
3018
3090
  {
3019
- index: $t.indexOf(n),
3020
- options: $t,
3021
- onSelect: (y) => {
3022
- y !== n && (C(), r(y));
3091
+ index: Xt.indexOf(n),
3092
+ options: Xt,
3093
+ onSelect: (m) => {
3094
+ m !== n && (x(), a(m));
3023
3095
  }
3024
3096
  }
3025
3097
  ),
3026
- /* @__PURE__ */ u.jsx(
3027
- xt,
3098
+ /* @__PURE__ */ l.jsx(
3099
+ _t,
3028
3100
  {
3029
- index: 0,
3030
- options: sa,
3031
- onSelect: (y) => {
3032
- if (y !== vt)
3033
- switch (vt = y, vt) {
3034
- case "Default":
3035
- V.overrideMaterial = null;
3101
+ index: qt.indexOf(mt),
3102
+ options: qt,
3103
+ onSelect: (m) => {
3104
+ if (m !== mt)
3105
+ switch (mt = m, mt) {
3106
+ case "Depth":
3107
+ A.overrideMaterial = Ma;
3036
3108
  break;
3037
3109
  case "Normals":
3038
- V.overrideMaterial = ca;
3110
+ A.overrideMaterial = Pa;
3111
+ break;
3112
+ default:
3113
+ case "Renderer":
3114
+ A.overrideMaterial = null;
3039
3115
  break;
3040
3116
  case "Wireframe":
3041
- V.overrideMaterial = la;
3117
+ A.overrideMaterial = _a;
3118
+ break;
3119
+ case "UVs":
3120
+ A.overrideMaterial = ja;
3042
3121
  break;
3043
3122
  }
3044
3123
  }
@@ -3047,41 +3126,48 @@ function Ma(t) {
3047
3126
  ] })
3048
3127
  ] });
3049
3128
  }
3050
- function Pa(t) {
3051
- return /* @__PURE__ */ u.jsxs("div", { className: "editor", ref: t.ref, style: t.style, children: [
3052
- /* @__PURE__ */ u.jsx("header", { children: t.header }),
3129
+ function Ja(t) {
3130
+ return /* @__PURE__ */ l.jsxs("div", { className: "editor", ref: t.ref, style: t.style, children: [
3131
+ /* @__PURE__ */ l.jsx("header", { children: t.header }),
3053
3132
  t.children,
3054
- /* @__PURE__ */ u.jsx("footer", { children: t.footer })
3133
+ /* @__PURE__ */ l.jsx("footer", { children: t.footer })
3055
3134
  ] });
3056
3135
  }
3057
3136
  export {
3058
- wt as Accordion,
3059
- ya as Application,
3060
- lt as BaseRemote,
3061
- Zt as ChildObject,
3062
- Vn as ContainerObject,
3063
- $n as Draggable,
3064
- Bn as DraggableItem,
3065
- Gn as Dropdown,
3066
- Yn as DropdownItem,
3067
- Pa as Editor,
3068
- oa as InfiniteGridHelper,
3069
- ea as Inspector,
3070
- Ma as MultiView,
3071
- qt as NavButton,
3072
- Ea as RemoteComponents,
3073
- Sa as RemoteController,
3074
- wa as RemoteTheatre,
3075
- xa as RemoteThree,
3076
- Ca as RemoteTweakpane,
3077
- Oa as SceneHierarchy,
3078
- Ta as SceneInspector,
3137
+ jt as Accordion,
3138
+ Va as Application,
3139
+ gt as BaseRemote,
3140
+ un as ChildObject,
3141
+ fa as ContainerObject,
3142
+ na as Draggable,
3143
+ ta as DraggableItem,
3144
+ aa as Dropdown,
3145
+ ra as DropdownItem,
3146
+ Ja as Editor,
3147
+ ca as InfiniteGridHelper,
3148
+ Oa as Inspector,
3149
+ Za as MultiView,
3150
+ ln as NavButton,
3151
+ Ya as RemoteComponents,
3152
+ Ka as RemoteController,
3153
+ za as RemoteTheatre,
3154
+ Wa as RemoteThree,
3155
+ Ha as RemoteTweakpane,
3156
+ Xa as SceneHierarchy,
3157
+ qa as SceneInspector,
3079
3158
  N as ToolEvents,
3080
- va as clamp,
3081
- kn as colorToHex,
3082
- A as debugDispatcher,
3083
- ba as distance,
3084
- Ht as hierarchyUUID,
3085
- jn as isColor,
3086
- Rn as randomID
3159
+ da as UVMaterial,
3160
+ Ba as clamp,
3161
+ Yn as colorToHex,
3162
+ I as debugDispatcher,
3163
+ on as dispose,
3164
+ Wn as disposeMaterial,
3165
+ Ga as disposeTexture,
3166
+ $a as distance,
3167
+ rn as hierarchyUUID,
3168
+ Vn as isColor,
3169
+ Gn as randomID,
3170
+ zn as resetThreeObjects,
3171
+ Ct as round,
3172
+ Rt as totalThreeObjects
3087
3173
  };