@tomorrowevening/hermes 0.0.39 → 0.0.41
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.
@@ -1,64 +1,66 @@
|
|
1
|
-
import { PositionalAudio as
|
2
|
-
import
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import
|
6
|
-
import
|
7
|
-
|
8
|
-
|
1
|
+
import { PositionalAudio as zn, EventDispatcher as ln, Texture as cn, CubeTexture as Yn, RepeatWrapping as Wt, ShaderMaterial as un, GLSL3 as Gn, DoubleSide as dn, Color as Ot, Mesh as Vn, PlaneGeometry as Hn, FrontSide as Wn, BackSide as Xn, NoBlending as Kn, NormalBlending as qn, AdditiveBlending as Zn, SubtractiveBlending as Jn, MultiplyBlending as Qn, CustomBlending as ea, AddEquation as ta, SubtractEquation as na, ReverseSubtractEquation as aa, MinEquation as ia, MaxEquation as ra, ZeroFactor as fn, OneFactor as pn, SrcColorFactor as hn, OneMinusSrcColorFactor as mn, SrcAlphaFactor as vn, OneMinusSrcAlphaFactor as gn, DstAlphaFactor as bn, OneMinusDstAlphaFactor as yn, DstColorFactor as En, OneMinusDstColorFactor as Cn, SrcAlphaSaturateFactor as oa, ConstantColorFactor as xn, OneMinusConstantColorFactor as wn, ConstantAlphaFactor as Sn, OneMinusConstantAlphaFactor as On, Matrix4 as sa, Vector3 as q, Euler as la, Ray as ca, Plane as ua, MathUtils as da, MOUSE as Ge, TOUCH as Ve, Quaternion as Xt, Spherical as Kt, Vector2 as ue, PerspectiveCamera as Bt, MeshDepthMaterial as fa, MeshNormalMaterial as pa, MeshBasicMaterial as ha, OrthographicCamera as Mn, Scene as Tn, Group as ma, AxesHelper as Rn, WebGLRenderer as va, Raycaster as ga, CameraHelper as ba } from "three";
|
2
|
+
import "@theatre/studio";
|
3
|
+
import { Pane as ya } from "tweakpane";
|
4
|
+
import * as Ea from "@tweakpane/plugin-essentials";
|
5
|
+
import _n, { useState as ae, useRef as ye, useEffect as Se, forwardRef as Ca } from "react";
|
6
|
+
import { Reorder as An } from "framer-motion";
|
7
|
+
const xa = () => {
|
8
|
+
}, Si = () => {
|
9
|
+
};
|
10
|
+
function st(t) {
|
9
11
|
return t.substring(0, 1).toUpperCase() + t.substring(1);
|
10
12
|
}
|
11
|
-
function
|
13
|
+
function Oi(t, n, a) {
|
12
14
|
return Math.min(n, Math.max(t, a));
|
13
15
|
}
|
14
|
-
function
|
16
|
+
function Mi(t, n) {
|
15
17
|
const a = t - n;
|
16
18
|
return Math.sqrt(a * a);
|
17
19
|
}
|
18
|
-
function
|
20
|
+
function wa() {
|
19
21
|
return Math.round(Math.random() * 1e6).toString();
|
20
22
|
}
|
21
|
-
function
|
23
|
+
function Ti(t) {
|
22
24
|
return t.r !== void 0 && t.g !== void 0 && t.b !== void 0;
|
23
25
|
}
|
24
|
-
function
|
26
|
+
function Sa(t) {
|
25
27
|
const n = Math.round(t.r * 255), a = Math.round(t.g * 255), e = Math.round(t.b * 255), o = (u) => {
|
26
|
-
const
|
27
|
-
return
|
28
|
-
},
|
29
|
-
return "#" +
|
28
|
+
const p = u.toString(16);
|
29
|
+
return p.length === 1 ? "0" + p : p;
|
30
|
+
}, l = o(n), m = o(a), s = o(e);
|
31
|
+
return "#" + l + m + s;
|
30
32
|
}
|
31
|
-
function
|
33
|
+
function It(t, n = 1) {
|
32
34
|
return Number(t.toFixed(n));
|
33
35
|
}
|
34
|
-
let
|
35
|
-
const
|
36
|
-
|
37
|
-
},
|
36
|
+
let Ut = 0;
|
37
|
+
const Oa = () => {
|
38
|
+
Ut = 0;
|
39
|
+
}, Pn = (t) => {
|
38
40
|
if (!t)
|
39
41
|
return;
|
40
42
|
let n = t.name.replace(" ", "");
|
41
|
-
n.length === 0 && (n = `obj_${
|
42
|
-
|
43
|
+
n.length === 0 && (n = `obj_${Ut}`, Ut++), t.parent !== null && (n = `${t.parent.uuid}.${n}`), t.uuid = n, t.children.forEach((a) => {
|
44
|
+
Pn(a);
|
43
45
|
});
|
44
|
-
},
|
46
|
+
}, Ri = (t) => {
|
45
47
|
t?.dispose();
|
46
|
-
},
|
48
|
+
}, Ma = (t) => {
|
47
49
|
t && (Array.isArray(t) ? t.forEach((n) => n.dispose()) : t.dispose());
|
48
|
-
},
|
50
|
+
}, kn = (t) => {
|
49
51
|
if (t) {
|
50
52
|
for (; t.children.length > 0; ) {
|
51
53
|
const n = t.children[0];
|
52
|
-
n instanceof
|
54
|
+
n instanceof zn ? (n.pause(), n.parent && n.parent.remove(n)) : kn(n);
|
53
55
|
}
|
54
56
|
if (t.parent && t.parent.remove(t), t.isMesh) {
|
55
57
|
const n = t;
|
56
|
-
n.geometry?.dispose(),
|
58
|
+
n.geometry?.dispose(), Ma(n.material);
|
57
59
|
}
|
58
60
|
t.dispose !== void 0 && t.dispose();
|
59
61
|
}
|
60
62
|
};
|
61
|
-
class
|
63
|
+
class _i {
|
62
64
|
components = /* @__PURE__ */ new Map();
|
63
65
|
listen;
|
64
66
|
// Protected
|
@@ -74,9 +76,7 @@ class ji {
|
|
74
76
|
// Set editor and add components here
|
75
77
|
init() {
|
76
78
|
return new Promise((n) => {
|
77
|
-
|
78
|
-
a.handleEditorApp();
|
79
|
-
}), n();
|
79
|
+
n();
|
80
80
|
});
|
81
81
|
}
|
82
82
|
addComponent(n, a) {
|
@@ -120,7 +120,7 @@ class ji {
|
|
120
120
|
n && (this._mode = "editor");
|
121
121
|
}
|
122
122
|
}
|
123
|
-
const k = new
|
123
|
+
const k = new ln(), D = {
|
124
124
|
CUSTOM: "ToolEvents::custom",
|
125
125
|
// Components
|
126
126
|
SELECT_DROPDOWN: "ToolEvents::selectDropdown",
|
@@ -136,7 +136,7 @@ const k = new un(), j = {
|
|
136
136
|
ADD_CAMERA: "ToolEvents::addCamera",
|
137
137
|
REMOVE_CAMERA: "ToolEvents::removeCamera"
|
138
138
|
};
|
139
|
-
class
|
139
|
+
class Yt {
|
140
140
|
app;
|
141
141
|
constructor(n) {
|
142
142
|
this.app = n;
|
@@ -150,11 +150,8 @@ class Rt {
|
|
150
150
|
// Receives Editor events
|
151
151
|
handleEditor(n) {
|
152
152
|
}
|
153
|
-
// Runs only in-editor
|
154
|
-
handleEditorApp() {
|
155
|
-
}
|
156
153
|
}
|
157
|
-
class
|
154
|
+
class Ai extends Yt {
|
158
155
|
selectDropdown(n, a) {
|
159
156
|
this.app.send({
|
160
157
|
event: "selectComponent",
|
@@ -180,189 +177,59 @@ class Di extends Rt {
|
|
180
177
|
handleApp(n) {
|
181
178
|
switch (n.event) {
|
182
179
|
case "selectComponent":
|
183
|
-
k.dispatchEvent({ type:
|
180
|
+
k.dispatchEvent({ type: D.SELECT_DROPDOWN, value: n.data });
|
184
181
|
break;
|
185
182
|
case "draggableListUpdate":
|
186
|
-
k.dispatchEvent({ type:
|
183
|
+
k.dispatchEvent({ type: D.DRAG_UPDATE, value: n.data });
|
187
184
|
break;
|
188
185
|
}
|
189
186
|
}
|
190
187
|
}
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
return;
|
211
|
-
}
|
212
|
-
let a = this.sheets.get(n);
|
213
|
-
return a !== void 0 || (a = this.project?.sheet(n), this.sheets.set(n, a)), a;
|
214
|
-
}
|
215
|
-
playSheet(n, a) {
|
216
|
-
this.sheet(n)?.sequence.play(a), this.app.send({
|
217
|
-
event: "playSheet",
|
218
|
-
target: "editor",
|
219
|
-
data: {
|
220
|
-
sheet: n,
|
221
|
-
value: a
|
222
|
-
}
|
223
|
-
});
|
224
|
-
}
|
225
|
-
pauseSheet(n) {
|
226
|
-
this.sheet(n)?.sequence.pause(), this.app.send({
|
227
|
-
event: "pauseSheet",
|
228
|
-
target: "editor",
|
229
|
-
data: {
|
230
|
-
sheet: n
|
231
|
-
}
|
232
|
-
});
|
233
|
-
}
|
234
|
-
clearSheetObjects(n) {
|
235
|
-
this.sheetObjects.forEach((a, e) => {
|
236
|
-
e.search(`${n}_`) > -1 && this.unsubscribe(a);
|
237
|
-
});
|
238
|
-
}
|
239
|
-
sheetObject(n, a, e, o) {
|
240
|
-
if (this.project === void 0) {
|
241
|
-
console.error("Theatre Project hasn't been created yet.");
|
242
|
-
return;
|
243
|
-
}
|
244
|
-
const s = this.sheet(n);
|
245
|
-
if (s === void 0)
|
246
|
-
return;
|
247
|
-
const p = `${n}_${a}`;
|
248
|
-
let c = this.sheetObjects.get(p);
|
249
|
-
c !== void 0 ? c = s.object(a, { ...e, ...c.value }, { reconfigure: !0 }) : c = s.object(a, e), this.sheetObjects.set(p, c), this.sheetObjectCBs.set(p, o !== void 0 ? o : In);
|
250
|
-
const u = c.onValuesChange((f) => {
|
251
|
-
if (this.app.editor) {
|
252
|
-
for (const b in f) {
|
253
|
-
const E = f[b];
|
254
|
-
typeof E == "object" && Ra(E) && (f[b] = {
|
255
|
-
r: E.r,
|
256
|
-
g: E.g,
|
257
|
-
b: E.b,
|
258
|
-
a: E.a
|
259
|
-
});
|
188
|
+
let He;
|
189
|
+
function Pi(t, n, a) {
|
190
|
+
if (t.editor) {
|
191
|
+
a.ui.restore(), a.onSelectionChange((m) => {
|
192
|
+
m.length < 1 || m.forEach((s) => {
|
193
|
+
let u = s.address.sheetId, p = "setSheet", v = {};
|
194
|
+
switch (s.type) {
|
195
|
+
case "Theatre_Sheet_PublicAPI":
|
196
|
+
p = "setSheet", v = {
|
197
|
+
sheet: s.address.sheetId
|
198
|
+
}, He = n.sheets.get(s.address.sheetId);
|
199
|
+
break;
|
200
|
+
case "Theatre_SheetObject_PublicAPI":
|
201
|
+
p = "setSheetObject", u += `_${s.address.objectKey}`, v = {
|
202
|
+
id: u,
|
203
|
+
sheet: s.address.sheetId,
|
204
|
+
key: s.address.objectKey
|
205
|
+
}, He = n.sheets.get(s.address.sheetId);
|
206
|
+
break;
|
260
207
|
}
|
261
|
-
|
262
|
-
|
208
|
+
t.send({ event: p, target: "app", data: v });
|
209
|
+
});
|
210
|
+
});
|
211
|
+
let e = -1;
|
212
|
+
const o = () => {
|
213
|
+
if (He !== void 0 && e !== He.sequence.position) {
|
214
|
+
e = He.sequence.position;
|
215
|
+
const m = He;
|
216
|
+
t.send({
|
217
|
+
event: "updateTimeline",
|
263
218
|
target: "app",
|
264
219
|
data: {
|
265
|
-
|
266
|
-
|
267
|
-
values: f
|
220
|
+
position: e,
|
221
|
+
sheet: m.address.sheetId
|
268
222
|
}
|
269
223
|
});
|
270
224
|
}
|
271
|
-
|
272
|
-
|
273
|
-
}
|
274
|
-
|
275
|
-
}
|
276
|
-
|
277
|
-
if (this.project === void 0) {
|
278
|
-
console.error("Theatre Project hasn't been created yet.");
|
279
|
-
return;
|
280
|
-
}
|
281
|
-
const a = n.address.sheetId, e = n.address.objectKey;
|
282
|
-
this.sheets.get(a)?.detachObject(e);
|
283
|
-
const s = `${a}_${e}`, p = this.sheetObjectUnsubscribe.get(s);
|
284
|
-
p !== void 0 && (this.sheetObjects.delete(s), this.sheetObjectCBs.delete(s), this.sheetObjectUnsubscribe.delete(s), p());
|
285
|
-
}
|
286
|
-
// Remote Controller
|
287
|
-
// Receives App events
|
288
|
-
handleApp(n) {
|
289
|
-
let a;
|
290
|
-
switch (n.event) {
|
291
|
-
case "setSheet":
|
292
|
-
a = this.sheets.get(n.data.sheet), a !== void 0 && (ge = a, at.setSelection([a]));
|
293
|
-
break;
|
294
|
-
case "setSheetObject":
|
295
|
-
a = this.sheetObjects.get(`${n.data.sheet}_${n.data.key}`), a !== void 0 && at.setSelection([a]);
|
296
|
-
break;
|
297
|
-
case "updateSheetObject":
|
298
|
-
a = this.sheets.get(n.data.sheet), a !== void 0 && a.sequence.pause(), a = this.sheetObjectCBs.get(n.data.sheetObject), a !== void 0 && a(n.data.values);
|
299
|
-
break;
|
300
|
-
case "updateTimeline":
|
301
|
-
a = this.sheets.get(n.data.sheet), ge !== void 0 && (ge.sequence.position = n.data.position);
|
302
|
-
break;
|
303
|
-
}
|
304
|
-
}
|
305
|
-
// Receives Editor events
|
306
|
-
handleEditor(n) {
|
307
|
-
if (this.app.editor)
|
308
|
-
switch (n.event) {
|
309
|
-
case "playSheet":
|
310
|
-
this.sheet(n.data.sheet)?.sequence.play(n.data.value);
|
311
|
-
break;
|
312
|
-
case "pauseSheet":
|
313
|
-
this.sheet(n.data.sheet)?.sequence.pause();
|
314
|
-
break;
|
315
|
-
}
|
316
|
-
}
|
317
|
-
// Runs only in-editor
|
318
|
-
handleEditorApp() {
|
319
|
-
if (this.app.editor) {
|
320
|
-
at.ui.restore(), at.onSelectionChange((o) => {
|
321
|
-
o.length < 1 || o.forEach((s) => {
|
322
|
-
let p = s.address.sheetId, c = "setSheet", u = {};
|
323
|
-
switch (s.type) {
|
324
|
-
case "Theatre_Sheet_PublicAPI":
|
325
|
-
c = "setSheet", u = {
|
326
|
-
sheet: s.address.sheetId
|
327
|
-
}, ge = this.sheets.get(s.address.sheetId);
|
328
|
-
break;
|
329
|
-
case "Theatre_SheetObject_PublicAPI":
|
330
|
-
c = "setSheetObject", p += `_${s.address.objectKey}`, u = {
|
331
|
-
id: p,
|
332
|
-
sheet: s.address.sheetId,
|
333
|
-
key: s.address.objectKey
|
334
|
-
}, ge = this.sheets.get(s.address.sheetId);
|
335
|
-
break;
|
336
|
-
}
|
337
|
-
this.app.send({ event: c, target: "app", data: u });
|
338
|
-
});
|
339
|
-
});
|
340
|
-
let n = -1;
|
341
|
-
const a = () => {
|
342
|
-
if (st.getRafDriver().tick(performance.now()), ge !== void 0 && n !== ge.sequence.position) {
|
343
|
-
n = ge.sequence.position;
|
344
|
-
const o = ge;
|
345
|
-
this.app.send({
|
346
|
-
event: "updateTimeline",
|
347
|
-
target: "app",
|
348
|
-
data: {
|
349
|
-
position: n,
|
350
|
-
sheet: o.address.sheetId
|
351
|
-
}
|
352
|
-
});
|
353
|
-
}
|
354
|
-
}, e = () => {
|
355
|
-
a(), requestAnimationFrame(e);
|
356
|
-
};
|
357
|
-
a(), e();
|
358
|
-
} else
|
359
|
-
at.ui.hide();
|
360
|
-
}
|
361
|
-
static getRafDriver() {
|
362
|
-
return st.rafDriver || (st.rafDriver = wa()), st.rafDriver;
|
363
|
-
}
|
225
|
+
}, l = () => {
|
226
|
+
o(), requestAnimationFrame(l);
|
227
|
+
};
|
228
|
+
o(), l();
|
229
|
+
} else
|
230
|
+
a.ui.hide();
|
364
231
|
}
|
365
|
-
function
|
232
|
+
function Ta(t) {
|
366
233
|
if (t.name === "cameras")
|
367
234
|
return "camera";
|
368
235
|
if (t.name === "interactive")
|
@@ -376,7 +243,7 @@ function ka(t) {
|
|
376
243
|
const n = t.type;
|
377
244
|
return n.search("Helper") > -1 ? "icon_utils" : n.search("Camera") > -1 ? "camera" : n.search("Light") > -1 ? "light" : "obj3D";
|
378
245
|
}
|
379
|
-
function
|
246
|
+
function Dn(t) {
|
380
247
|
const n = {
|
381
248
|
name: t.name,
|
382
249
|
type: t.type,
|
@@ -384,10 +251,10 @@ function Ln(t) {
|
|
384
251
|
children: []
|
385
252
|
};
|
386
253
|
return t.children.forEach((a) => {
|
387
|
-
n.children.push(
|
254
|
+
n.children.push(Dn(a));
|
388
255
|
}), n;
|
389
256
|
}
|
390
|
-
function
|
257
|
+
function Ra(t) {
|
391
258
|
const n = {};
|
392
259
|
for (const a in t) {
|
393
260
|
const e = t[a].value;
|
@@ -395,7 +262,7 @@ function ja(t) {
|
|
395
262
|
}
|
396
263
|
return n;
|
397
264
|
}
|
398
|
-
function
|
265
|
+
function _a(t) {
|
399
266
|
switch (t) {
|
400
267
|
case "blendSrcAlpha":
|
401
268
|
case "blendDstAlpha":
|
@@ -410,7 +277,7 @@ function Da(t) {
|
|
410
277
|
function We(t) {
|
411
278
|
const n = {};
|
412
279
|
for (const a in t) {
|
413
|
-
if (a.substring(0, 1) === "_" || a.substring(0, 2) === "is" ||
|
280
|
+
if (a.substring(0, 1) === "_" || a.substring(0, 2) === "is" || _a(a))
|
414
281
|
continue;
|
415
282
|
const e = typeof t[a], o = t[a];
|
416
283
|
switch (e) {
|
@@ -422,13 +289,13 @@ function We(t) {
|
|
422
289
|
case "object":
|
423
290
|
if (o !== null)
|
424
291
|
if (n[a] = o, o.isTexture)
|
425
|
-
if (o instanceof
|
426
|
-
const
|
427
|
-
n[a] = { src:
|
292
|
+
if (o instanceof cn) {
|
293
|
+
const l = o.source.toJSON();
|
294
|
+
n[a] = { src: l.url };
|
428
295
|
} else
|
429
|
-
o instanceof
|
296
|
+
o instanceof Yn && (console.log("env map"), console.log(o.source.data), console.log(o.source.toJSON()), n[a] = { src: "" });
|
430
297
|
else
|
431
|
-
a === "uniforms" && (n[a] =
|
298
|
+
a === "uniforms" && (n[a] = Ra(n[a]));
|
432
299
|
else
|
433
300
|
n[a] = { src: "" };
|
434
301
|
break;
|
@@ -436,7 +303,7 @@ function We(t) {
|
|
436
303
|
}
|
437
304
|
return n;
|
438
305
|
}
|
439
|
-
function
|
306
|
+
function Lt(t) {
|
440
307
|
t.updateMatrix();
|
441
308
|
const n = {
|
442
309
|
name: t.name,
|
@@ -462,8 +329,8 @@ function Bt(t) {
|
|
462
329
|
const e = t;
|
463
330
|
if (Array.isArray(e.material)) {
|
464
331
|
const o = [];
|
465
|
-
e.material.forEach((
|
466
|
-
o.push(We(
|
332
|
+
e.material.forEach((l) => {
|
333
|
+
o.push(We(l));
|
467
334
|
}), n.material = o;
|
468
335
|
} else
|
469
336
|
n.material = We(e.material);
|
@@ -471,8 +338,8 @@ function Bt(t) {
|
|
471
338
|
const e = t;
|
472
339
|
if (Array.isArray(e.material)) {
|
473
340
|
const o = [];
|
474
|
-
e.material.forEach((
|
475
|
-
o.push(We(
|
341
|
+
e.material.forEach((l) => {
|
342
|
+
o.push(We(l));
|
476
343
|
}), n.material = o;
|
477
344
|
} else
|
478
345
|
n.material = We(e.material);
|
@@ -480,8 +347,8 @@ function Bt(t) {
|
|
480
347
|
const e = t;
|
481
348
|
if (Array.isArray(e.material)) {
|
482
349
|
const o = [];
|
483
|
-
e.material.forEach((
|
484
|
-
o.push(We(
|
350
|
+
e.material.forEach((l) => {
|
351
|
+
o.push(We(l));
|
485
352
|
}), n.material = o;
|
486
353
|
} else
|
487
354
|
n.material = We(e.material);
|
@@ -514,7 +381,7 @@ function Bt(t) {
|
|
514
381
|
});
|
515
382
|
return n;
|
516
383
|
}
|
517
|
-
function
|
384
|
+
function Aa(t, n) {
|
518
385
|
const a = n.split(".");
|
519
386
|
switch (a.length) {
|
520
387
|
case 1:
|
@@ -551,16 +418,16 @@ function ee(t, n, a) {
|
|
551
418
|
break;
|
552
419
|
}
|
553
420
|
}
|
554
|
-
function
|
421
|
+
function $t(t) {
|
555
422
|
return new Promise((n, a) => {
|
556
423
|
const e = new Image();
|
557
424
|
e.onload = () => {
|
558
|
-
const o = new
|
559
|
-
o.wrapS =
|
425
|
+
const o = new cn(e);
|
426
|
+
o.wrapS = Wt, o.wrapT = Wt, o.needsUpdate = !0, n(o);
|
560
427
|
}, e.onerror = a, e.src = t;
|
561
428
|
});
|
562
429
|
}
|
563
|
-
class
|
430
|
+
class ki extends Yt {
|
564
431
|
scene = void 0;
|
565
432
|
getObject(n) {
|
566
433
|
this.app.debugEnabled && this.app.send({
|
@@ -570,7 +437,7 @@ class Ii extends Rt {
|
|
570
437
|
});
|
571
438
|
}
|
572
439
|
setObject(n) {
|
573
|
-
const a =
|
440
|
+
const a = Lt(n);
|
574
441
|
this.app.send({
|
575
442
|
event: "setObject",
|
576
443
|
target: "editor",
|
@@ -614,8 +481,8 @@ class Ii extends Rt {
|
|
614
481
|
setScene(n) {
|
615
482
|
if (n === void 0 || (this.scene = n, !this.app.debugEnabled))
|
616
483
|
return;
|
617
|
-
|
618
|
-
const a =
|
484
|
+
Oa(), Pn(this.scene);
|
485
|
+
const a = Dn(this.scene);
|
619
486
|
this.app.send({
|
620
487
|
event: "setScene",
|
621
488
|
target: "editor",
|
@@ -625,7 +492,7 @@ class Ii extends Rt {
|
|
625
492
|
addCamera(n) {
|
626
493
|
if (!this.app.debugEnabled)
|
627
494
|
return;
|
628
|
-
const a =
|
495
|
+
const a = Lt(n);
|
629
496
|
this.app.send({
|
630
497
|
event: "addCamera",
|
631
498
|
target: "editor",
|
@@ -635,7 +502,7 @@ class Ii extends Rt {
|
|
635
502
|
removeCamera(n) {
|
636
503
|
if (!this.app.debugEnabled)
|
637
504
|
return;
|
638
|
-
const a =
|
505
|
+
const a = Lt(n);
|
639
506
|
this.app.send({
|
640
507
|
event: "removeCamera",
|
641
508
|
target: "editor",
|
@@ -647,16 +514,16 @@ class Ii extends Rt {
|
|
647
514
|
handleApp(n) {
|
648
515
|
switch (n.event) {
|
649
516
|
case "getObject":
|
650
|
-
k.dispatchEvent({ type:
|
517
|
+
k.dispatchEvent({ type: D.GET_OBJECT, value: n.data });
|
651
518
|
break;
|
652
519
|
case "updateObject":
|
653
|
-
k.dispatchEvent({ type:
|
520
|
+
k.dispatchEvent({ type: D.UPDATE_OBJECT, value: n.data });
|
654
521
|
break;
|
655
522
|
case "createTexture":
|
656
|
-
k.dispatchEvent({ type:
|
523
|
+
k.dispatchEvent({ type: D.CREATE_TEXTURE, value: n.data });
|
657
524
|
break;
|
658
525
|
case "requestMethod":
|
659
|
-
k.dispatchEvent({ type:
|
526
|
+
k.dispatchEvent({ type: D.REQUEST_METHOD, value: n.data });
|
660
527
|
break;
|
661
528
|
}
|
662
529
|
}
|
@@ -664,21 +531,21 @@ class Ii extends Rt {
|
|
664
531
|
handleEditor(n) {
|
665
532
|
switch (n.event) {
|
666
533
|
case "setObject":
|
667
|
-
k.dispatchEvent({ type:
|
534
|
+
k.dispatchEvent({ type: D.SET_OBJECT, value: n.data });
|
668
535
|
break;
|
669
536
|
case "setScene":
|
670
|
-
k.dispatchEvent({ type:
|
537
|
+
k.dispatchEvent({ type: D.SET_SCENE, value: n.data });
|
671
538
|
break;
|
672
539
|
case "addCamera":
|
673
|
-
k.dispatchEvent({ type:
|
540
|
+
k.dispatchEvent({ type: D.ADD_CAMERA, value: n.data });
|
674
541
|
break;
|
675
542
|
case "removeCamera":
|
676
|
-
k.dispatchEvent({ type:
|
543
|
+
k.dispatchEvent({ type: D.REMOVE_CAMERA, value: n.data });
|
677
544
|
break;
|
678
545
|
}
|
679
546
|
}
|
680
547
|
}
|
681
|
-
class
|
548
|
+
class Di extends Yt {
|
682
549
|
bindCBs;
|
683
550
|
buttonCBs;
|
684
551
|
pane = void 0;
|
@@ -689,7 +556,7 @@ class Li extends Rt {
|
|
689
556
|
super(n), this.bindCBs = /* @__PURE__ */ new Map(), this.buttonCBs = /* @__PURE__ */ new Map(), n.editor && this.createGUI();
|
690
557
|
}
|
691
558
|
createGUI() {
|
692
|
-
this.pane = new
|
559
|
+
this.pane = new ya({ title: "GUI" }), this.pane.registerPlugin(Ea);
|
693
560
|
}
|
694
561
|
dispose() {
|
695
562
|
this.bindCBs.clear(), this.buttonCBs.clear(), this.appCallbacks = 0, this.editorCallbacks = 0, this.app.editor && (this.pane?.dispose(), this.pane = void 0);
|
@@ -715,13 +582,13 @@ class Li extends Rt {
|
|
715
582
|
}
|
716
583
|
// Binding
|
717
584
|
bind(n, a, e, o = void 0) {
|
718
|
-
const
|
719
|
-
this.bindCBs.set(
|
585
|
+
const l = this.bindID, m = e.onChange !== void 0 ? e.onChange : xa;
|
586
|
+
this.bindCBs.set(l, m), this.app.editor ? (this.pane === void 0 && this.createGUI(), (o !== void 0 ? o : this.pane).addBinding(n, a, e).on("change", (u) => {
|
720
587
|
this.app.send({
|
721
588
|
event: "updateBind",
|
722
589
|
target: "app",
|
723
590
|
data: {
|
724
|
-
id:
|
591
|
+
id: l,
|
725
592
|
value: u.value
|
726
593
|
}
|
727
594
|
});
|
@@ -729,7 +596,7 @@ class Li extends Rt {
|
|
729
596
|
event: "bindObject",
|
730
597
|
target: "app",
|
731
598
|
data: {
|
732
|
-
id:
|
599
|
+
id: l,
|
733
600
|
name: a,
|
734
601
|
params: e,
|
735
602
|
parent: o
|
@@ -797,7 +664,7 @@ class Li extends Rt {
|
|
797
664
|
}
|
798
665
|
}
|
799
666
|
}
|
800
|
-
var
|
667
|
+
var zt = { exports: {} }, at = {};
|
801
668
|
/**
|
802
669
|
* @license React
|
803
670
|
* react-jsx-runtime.production.min.js
|
@@ -807,25 +674,25 @@ var Vt = { exports: {} }, it = {};
|
|
807
674
|
* This source code is licensed under the MIT license found in the
|
808
675
|
* LICENSE file in the root directory of this source tree.
|
809
676
|
*/
|
810
|
-
var
|
811
|
-
function
|
812
|
-
if (
|
813
|
-
return
|
814
|
-
|
815
|
-
var t =
|
816
|
-
function
|
677
|
+
var qt;
|
678
|
+
function Pa() {
|
679
|
+
if (qt)
|
680
|
+
return at;
|
681
|
+
qt = 1;
|
682
|
+
var t = _n, 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, l = { key: !0, ref: !0, __self: !0, __source: !0 };
|
683
|
+
function m(s, u, p) {
|
817
684
|
var v, b = {}, E = null, x = null;
|
818
|
-
|
685
|
+
p !== void 0 && (E = "" + p), u.key !== void 0 && (E = "" + u.key), u.ref !== void 0 && (x = u.ref);
|
819
686
|
for (v in u)
|
820
|
-
e.call(u, v) && !
|
821
|
-
if (
|
822
|
-
for (v in u =
|
687
|
+
e.call(u, v) && !l.hasOwnProperty(v) && (b[v] = u[v]);
|
688
|
+
if (s && s.defaultProps)
|
689
|
+
for (v in u = s.defaultProps, u)
|
823
690
|
b[v] === void 0 && (b[v] = u[v]);
|
824
|
-
return { $$typeof: n, type:
|
691
|
+
return { $$typeof: n, type: s, key: E, ref: x, props: b, _owner: o.current };
|
825
692
|
}
|
826
|
-
return
|
693
|
+
return at.Fragment = a, at.jsx = m, at.jsxs = m, at;
|
827
694
|
}
|
828
|
-
var
|
695
|
+
var it = {};
|
829
696
|
/**
|
830
697
|
* @license React
|
831
698
|
* react-jsx-runtime.development.js
|
@@ -835,49 +702,49 @@ var rt = {};
|
|
835
702
|
* This source code is licensed under the MIT license found in the
|
836
703
|
* LICENSE file in the root directory of this source tree.
|
837
704
|
*/
|
838
|
-
var
|
839
|
-
function
|
840
|
-
return
|
841
|
-
var t =
|
705
|
+
var Zt;
|
706
|
+
function ka() {
|
707
|
+
return Zt || (Zt = 1, process.env.NODE_ENV !== "production" && function() {
|
708
|
+
var t = _n, n = Symbol.for("react.element"), a = Symbol.for("react.portal"), e = Symbol.for("react.fragment"), o = Symbol.for("react.strict_mode"), l = Symbol.for("react.profiler"), m = Symbol.for("react.provider"), s = Symbol.for("react.context"), u = Symbol.for("react.forward_ref"), p = Symbol.for("react.suspense"), v = Symbol.for("react.suspense_list"), b = Symbol.for("react.memo"), E = Symbol.for("react.lazy"), x = Symbol.for("react.offscreen"), M = Symbol.iterator, P = "@@iterator";
|
842
709
|
function H(i) {
|
843
710
|
if (i === null || typeof i != "object")
|
844
711
|
return null;
|
845
|
-
var
|
846
|
-
return typeof
|
712
|
+
var f = M && i[M] || i[P];
|
713
|
+
return typeof f == "function" ? f : null;
|
847
714
|
}
|
848
715
|
var B = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
849
716
|
function w(i) {
|
850
717
|
{
|
851
|
-
for (var
|
718
|
+
for (var f = arguments.length, g = new Array(f > 1 ? f - 1 : 0), C = 1; C < f; C++)
|
852
719
|
g[C - 1] = arguments[C];
|
853
720
|
z("error", i, g);
|
854
721
|
}
|
855
722
|
}
|
856
|
-
function z(i,
|
723
|
+
function z(i, f, g) {
|
857
724
|
{
|
858
|
-
var C = B.ReactDebugCurrentFrame,
|
859
|
-
|
725
|
+
var C = B.ReactDebugCurrentFrame, j = C.getStackAddendum();
|
726
|
+
j !== "" && (f += "%s", g = g.concat([j]));
|
860
727
|
var F = g.map(function(A) {
|
861
728
|
return String(A);
|
862
729
|
});
|
863
|
-
F.unshift("Warning: " +
|
730
|
+
F.unshift("Warning: " + f), Function.prototype.apply.call(console[i], console, F);
|
864
731
|
}
|
865
732
|
}
|
866
|
-
var
|
733
|
+
var Ee = !1, ce = !1, se = !1, d = !1, h = !1, S;
|
867
734
|
S = Symbol.for("react.module.reference");
|
868
735
|
function _(i) {
|
869
|
-
return !!(typeof i == "string" || typeof i == "function" || i === e || i ===
|
736
|
+
return !!(typeof i == "string" || typeof i == "function" || i === e || i === l || h || i === o || i === p || i === v || d || i === x || Ee || ce || se || typeof i == "object" && i !== null && (i.$$typeof === E || i.$$typeof === b || i.$$typeof === m || i.$$typeof === s || i.$$typeof === u || // This needs to include all possible module reference object
|
870
737
|
// types supported by any Flight configuration anywhere since
|
871
738
|
// we don't know which Flight build this will end up being used
|
872
739
|
// with.
|
873
740
|
i.$$typeof === S || i.getModuleId !== void 0));
|
874
741
|
}
|
875
|
-
function Y(i,
|
742
|
+
function Y(i, f, g) {
|
876
743
|
var C = i.displayName;
|
877
744
|
if (C)
|
878
745
|
return C;
|
879
|
-
var
|
880
|
-
return
|
746
|
+
var j = f.displayName || f.name || "";
|
747
|
+
return j !== "" ? g + "(" + j + ")" : g;
|
881
748
|
}
|
882
749
|
function U(i) {
|
883
750
|
return i.displayName || "Context";
|
@@ -894,21 +761,21 @@ function Na() {
|
|
894
761
|
return "Fragment";
|
895
762
|
case a:
|
896
763
|
return "Portal";
|
897
|
-
case
|
764
|
+
case l:
|
898
765
|
return "Profiler";
|
899
766
|
case o:
|
900
767
|
return "StrictMode";
|
901
|
-
case
|
768
|
+
case p:
|
902
769
|
return "Suspense";
|
903
770
|
case v:
|
904
771
|
return "SuspenseList";
|
905
772
|
}
|
906
773
|
if (typeof i == "object")
|
907
774
|
switch (i.$$typeof) {
|
908
|
-
case
|
909
|
-
var
|
910
|
-
return U(
|
911
|
-
case
|
775
|
+
case s:
|
776
|
+
var f = i;
|
777
|
+
return U(f) + ".Consumer";
|
778
|
+
case m:
|
912
779
|
var g = i;
|
913
780
|
return U(g._context) + ".Provider";
|
914
781
|
case u:
|
@@ -917,7 +784,7 @@ function Na() {
|
|
917
784
|
var C = i.displayName || null;
|
918
785
|
return C !== null ? C : $(i.type) || "Memo";
|
919
786
|
case E: {
|
920
|
-
var
|
787
|
+
var j = i, F = j._payload, A = j._init;
|
921
788
|
try {
|
922
789
|
return $(A(F));
|
923
790
|
} catch {
|
@@ -927,14 +794,14 @@ function Na() {
|
|
927
794
|
}
|
928
795
|
return null;
|
929
796
|
}
|
930
|
-
var I = Object.assign, W = 0,
|
797
|
+
var I = Object.assign, W = 0, X, T, N, J, me, Ce, ut;
|
931
798
|
function Ke() {
|
932
799
|
}
|
933
800
|
Ke.__reactDisabledLog = !0;
|
934
|
-
function
|
801
|
+
function Tt() {
|
935
802
|
{
|
936
803
|
if (W === 0) {
|
937
|
-
|
804
|
+
X = console.log, T = console.info, N = console.warn, J = console.error, me = console.group, Ce = console.groupCollapsed, ut = console.groupEnd;
|
938
805
|
var i = {
|
939
806
|
configurable: !0,
|
940
807
|
enumerable: !0,
|
@@ -954,7 +821,7 @@ function Na() {
|
|
954
821
|
W++;
|
955
822
|
}
|
956
823
|
}
|
957
|
-
function
|
824
|
+
function Rt() {
|
958
825
|
{
|
959
826
|
if (W--, W === 0) {
|
960
827
|
var i = {
|
@@ -964,7 +831,7 @@ function Na() {
|
|
964
831
|
};
|
965
832
|
Object.defineProperties(console, {
|
966
833
|
log: I({}, i, {
|
967
|
-
value:
|
834
|
+
value: X
|
968
835
|
}),
|
969
836
|
info: I({}, i, {
|
970
837
|
value: T
|
@@ -979,51 +846,51 @@ function Na() {
|
|
979
846
|
value: me
|
980
847
|
}),
|
981
848
|
groupCollapsed: I({}, i, {
|
982
|
-
value:
|
849
|
+
value: Ce
|
983
850
|
}),
|
984
851
|
groupEnd: I({}, i, {
|
985
|
-
value:
|
852
|
+
value: ut
|
986
853
|
})
|
987
854
|
});
|
988
855
|
}
|
989
856
|
W < 0 && w("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
990
857
|
}
|
991
858
|
}
|
992
|
-
var
|
993
|
-
function
|
859
|
+
var qe = B.ReactCurrentDispatcher, Ze;
|
860
|
+
function Ue(i, f, g) {
|
994
861
|
{
|
995
862
|
if (Ze === void 0)
|
996
863
|
try {
|
997
864
|
throw Error();
|
998
|
-
} catch (
|
999
|
-
var C =
|
865
|
+
} catch (j) {
|
866
|
+
var C = j.stack.trim().match(/\n( *(at )?)/);
|
1000
867
|
Ze = C && C[1] || "";
|
1001
868
|
}
|
1002
869
|
return `
|
1003
870
|
` + Ze + i;
|
1004
871
|
}
|
1005
872
|
}
|
1006
|
-
var
|
873
|
+
var $e = !1, Oe;
|
1007
874
|
{
|
1008
|
-
var
|
1009
|
-
|
875
|
+
var dt = typeof WeakMap == "function" ? WeakMap : Map;
|
876
|
+
Oe = new dt();
|
1010
877
|
}
|
1011
|
-
function
|
1012
|
-
if (!i ||
|
878
|
+
function ft(i, f) {
|
879
|
+
if (!i || $e)
|
1013
880
|
return "";
|
1014
881
|
{
|
1015
|
-
var g =
|
882
|
+
var g = Oe.get(i);
|
1016
883
|
if (g !== void 0)
|
1017
884
|
return g;
|
1018
885
|
}
|
1019
886
|
var C;
|
1020
|
-
|
1021
|
-
var
|
887
|
+
$e = !0;
|
888
|
+
var j = Error.prepareStackTrace;
|
1022
889
|
Error.prepareStackTrace = void 0;
|
1023
890
|
var F;
|
1024
|
-
F =
|
891
|
+
F = qe.current, qe.current = null, Tt();
|
1025
892
|
try {
|
1026
|
-
if (
|
893
|
+
if (f) {
|
1027
894
|
var A = function() {
|
1028
895
|
throw Error();
|
1029
896
|
};
|
@@ -1057,148 +924,148 @@ function Na() {
|
|
1057
924
|
} catch (ve) {
|
1058
925
|
if (ve && C && typeof ve.stack == "string") {
|
1059
926
|
for (var R = ve.stack.split(`
|
1060
|
-
`),
|
1061
|
-
`), Z = R.length - 1, Q =
|
927
|
+
`), le = C.stack.split(`
|
928
|
+
`), Z = R.length - 1, Q = le.length - 1; Z >= 1 && Q >= 0 && R[Z] !== le[Q]; )
|
1062
929
|
Q--;
|
1063
930
|
for (; Z >= 1 && Q >= 0; Z--, Q--)
|
1064
|
-
if (R[Z] !==
|
931
|
+
if (R[Z] !== le[Q]) {
|
1065
932
|
if (Z !== 1 || Q !== 1)
|
1066
933
|
do
|
1067
|
-
if (Z--, Q--, Q < 0 || R[Z] !==
|
1068
|
-
var
|
934
|
+
if (Z--, Q--, Q < 0 || R[Z] !== le[Q]) {
|
935
|
+
var pe = `
|
1069
936
|
` + R[Z].replace(" at new ", " at ");
|
1070
|
-
return i.displayName &&
|
937
|
+
return i.displayName && pe.includes("<anonymous>") && (pe = pe.replace("<anonymous>", i.displayName)), typeof i == "function" && Oe.set(i, pe), pe;
|
1071
938
|
}
|
1072
939
|
while (Z >= 1 && Q >= 0);
|
1073
940
|
break;
|
1074
941
|
}
|
1075
942
|
}
|
1076
943
|
} finally {
|
1077
|
-
|
944
|
+
$e = !1, qe.current = F, Rt(), Error.prepareStackTrace = j;
|
1078
945
|
}
|
1079
|
-
var
|
1080
|
-
return typeof i == "function" &&
|
946
|
+
var Ye = i ? i.displayName || i.name : "", Ht = Ye ? Ue(Ye) : "";
|
947
|
+
return typeof i == "function" && Oe.set(i, Ht), Ht;
|
1081
948
|
}
|
1082
|
-
function
|
1083
|
-
return
|
949
|
+
function _t(i, f, g) {
|
950
|
+
return ft(i, !1);
|
1084
951
|
}
|
1085
|
-
function
|
1086
|
-
var
|
1087
|
-
return !!(
|
952
|
+
function pt(i) {
|
953
|
+
var f = i.prototype;
|
954
|
+
return !!(f && f.isReactComponent);
|
1088
955
|
}
|
1089
|
-
function
|
956
|
+
function Me(i, f, g) {
|
1090
957
|
if (i == null)
|
1091
958
|
return "";
|
1092
959
|
if (typeof i == "function")
|
1093
|
-
return
|
960
|
+
return ft(i, pt(i));
|
1094
961
|
if (typeof i == "string")
|
1095
|
-
return
|
962
|
+
return Ue(i);
|
1096
963
|
switch (i) {
|
1097
|
-
case
|
1098
|
-
return
|
964
|
+
case p:
|
965
|
+
return Ue("Suspense");
|
1099
966
|
case v:
|
1100
|
-
return
|
967
|
+
return Ue("SuspenseList");
|
1101
968
|
}
|
1102
969
|
if (typeof i == "object")
|
1103
970
|
switch (i.$$typeof) {
|
1104
971
|
case u:
|
1105
|
-
return
|
972
|
+
return _t(i.render);
|
1106
973
|
case b:
|
1107
|
-
return
|
974
|
+
return Me(i.type, f, g);
|
1108
975
|
case E: {
|
1109
|
-
var C = i,
|
976
|
+
var C = i, j = C._payload, F = C._init;
|
1110
977
|
try {
|
1111
|
-
return
|
978
|
+
return Me(F(j), f, g);
|
1112
979
|
} catch {
|
1113
980
|
}
|
1114
981
|
}
|
1115
982
|
}
|
1116
983
|
return "";
|
1117
984
|
}
|
1118
|
-
var
|
1119
|
-
function
|
985
|
+
var Te = Object.prototype.hasOwnProperty, ht = {}, mt = B.ReactDebugCurrentFrame;
|
986
|
+
function Re(i) {
|
1120
987
|
if (i) {
|
1121
|
-
var
|
1122
|
-
|
988
|
+
var f = i._owner, g = Me(i.type, i._source, f ? f.type : null);
|
989
|
+
mt.setExtraStackFrame(g);
|
1123
990
|
} else
|
1124
|
-
|
991
|
+
mt.setExtraStackFrame(null);
|
1125
992
|
}
|
1126
|
-
function Je(i,
|
993
|
+
function Je(i, f, g, C, j) {
|
1127
994
|
{
|
1128
|
-
var F = Function.call.bind(
|
995
|
+
var F = Function.call.bind(Te);
|
1129
996
|
for (var A in i)
|
1130
997
|
if (F(i, A)) {
|
1131
998
|
var R = void 0;
|
1132
999
|
try {
|
1133
1000
|
if (typeof i[A] != "function") {
|
1134
|
-
var
|
1135
|
-
throw
|
1001
|
+
var le = Error((C || "React class") + ": " + g + " type `" + A + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof i[A] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
1002
|
+
throw le.name = "Invariant Violation", le;
|
1136
1003
|
}
|
1137
|
-
R = i[A](
|
1004
|
+
R = i[A](f, A, C, g, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
1138
1005
|
} catch (Z) {
|
1139
1006
|
R = Z;
|
1140
1007
|
}
|
1141
|
-
R && !(R instanceof Error) && (
|
1008
|
+
R && !(R instanceof Error) && (Re(j), 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, A, typeof R), Re(null)), R instanceof Error && !(R.message in ht) && (ht[R.message] = !0, Re(j), w("Failed %s type: %s", g, R.message), Re(null));
|
1142
1009
|
}
|
1143
1010
|
}
|
1144
1011
|
}
|
1145
|
-
var
|
1012
|
+
var _e = Array.isArray;
|
1146
1013
|
function Qe(i) {
|
1147
|
-
return
|
1014
|
+
return _e(i);
|
1148
1015
|
}
|
1149
|
-
function
|
1016
|
+
function At(i) {
|
1150
1017
|
{
|
1151
|
-
var
|
1018
|
+
var f = typeof Symbol == "function" && Symbol.toStringTag, g = f && i[Symbol.toStringTag] || i.constructor.name || "Object";
|
1152
1019
|
return g;
|
1153
1020
|
}
|
1154
1021
|
}
|
1155
|
-
function
|
1022
|
+
function vt(i) {
|
1156
1023
|
try {
|
1157
|
-
return
|
1024
|
+
return gt(i), !1;
|
1158
1025
|
} catch {
|
1159
1026
|
return !0;
|
1160
1027
|
}
|
1161
1028
|
}
|
1162
|
-
function
|
1029
|
+
function gt(i) {
|
1163
1030
|
return "" + i;
|
1164
1031
|
}
|
1165
|
-
function
|
1166
|
-
if (
|
1167
|
-
return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",
|
1032
|
+
function bt(i) {
|
1033
|
+
if (vt(i))
|
1034
|
+
return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", At(i)), gt(i);
|
1168
1035
|
}
|
1169
|
-
var
|
1036
|
+
var xe = B.ReactCurrentOwner, et = {
|
1170
1037
|
key: !0,
|
1171
1038
|
ref: !0,
|
1172
1039
|
__self: !0,
|
1173
1040
|
__source: !0
|
1174
|
-
}, tt,
|
1175
|
-
|
1176
|
-
function
|
1177
|
-
if (
|
1178
|
-
var
|
1179
|
-
if (
|
1041
|
+
}, tt, yt, ze;
|
1042
|
+
ze = {};
|
1043
|
+
function Pt(i) {
|
1044
|
+
if (Te.call(i, "ref")) {
|
1045
|
+
var f = Object.getOwnPropertyDescriptor(i, "ref").get;
|
1046
|
+
if (f && f.isReactWarning)
|
1180
1047
|
return !1;
|
1181
1048
|
}
|
1182
1049
|
return i.ref !== void 0;
|
1183
1050
|
}
|
1184
|
-
function
|
1185
|
-
if (
|
1186
|
-
var
|
1187
|
-
if (
|
1051
|
+
function kt(i) {
|
1052
|
+
if (Te.call(i, "key")) {
|
1053
|
+
var f = Object.getOwnPropertyDescriptor(i, "key").get;
|
1054
|
+
if (f && f.isReactWarning)
|
1188
1055
|
return !1;
|
1189
1056
|
}
|
1190
1057
|
return i.key !== void 0;
|
1191
1058
|
}
|
1192
|
-
function
|
1193
|
-
if (typeof i.ref == "string" &&
|
1194
|
-
var g = $(
|
1195
|
-
|
1059
|
+
function Et(i, f) {
|
1060
|
+
if (typeof i.ref == "string" && xe.current && f && xe.current.stateNode !== f) {
|
1061
|
+
var g = $(xe.current.type);
|
1062
|
+
ze[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', $(xe.current.type), i.ref), ze[g] = !0);
|
1196
1063
|
}
|
1197
1064
|
}
|
1198
|
-
function
|
1065
|
+
function we(i, f) {
|
1199
1066
|
{
|
1200
1067
|
var g = function() {
|
1201
|
-
tt || (tt = !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)",
|
1068
|
+
tt || (tt = !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));
|
1202
1069
|
};
|
1203
1070
|
g.isReactWarning = !0, Object.defineProperty(i, "key", {
|
1204
1071
|
get: g,
|
@@ -1206,10 +1073,10 @@ function Na() {
|
|
1206
1073
|
});
|
1207
1074
|
}
|
1208
1075
|
}
|
1209
|
-
function
|
1076
|
+
function Vt(i, f) {
|
1210
1077
|
{
|
1211
1078
|
var g = function() {
|
1212
|
-
|
1079
|
+
yt || (yt = !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));
|
1213
1080
|
};
|
1214
1081
|
g.isReactWarning = !0, Object.defineProperty(i, "ref", {
|
1215
1082
|
get: g,
|
@@ -1217,13 +1084,13 @@ function Na() {
|
|
1217
1084
|
});
|
1218
1085
|
}
|
1219
1086
|
}
|
1220
|
-
var r = function(i,
|
1087
|
+
var r = function(i, f, g, C, j, F, A) {
|
1221
1088
|
var R = {
|
1222
1089
|
// This tag allows us to uniquely identify this as a React Element
|
1223
1090
|
$$typeof: n,
|
1224
1091
|
// Built-in properties that belong on the element
|
1225
1092
|
type: i,
|
1226
|
-
key:
|
1093
|
+
key: f,
|
1227
1094
|
ref: g,
|
1228
1095
|
props: A,
|
1229
1096
|
// Record the component responsible for creating this element.
|
@@ -1243,31 +1110,31 @@ function Na() {
|
|
1243
1110
|
configurable: !1,
|
1244
1111
|
enumerable: !1,
|
1245
1112
|
writable: !1,
|
1246
|
-
value:
|
1113
|
+
value: j
|
1247
1114
|
}), Object.freeze && (Object.freeze(R.props), Object.freeze(R)), R;
|
1248
1115
|
};
|
1249
|
-
function y(i,
|
1116
|
+
function y(i, f, g, C, j) {
|
1250
1117
|
{
|
1251
|
-
var F, A = {}, R = null,
|
1252
|
-
g !== void 0 && (
|
1253
|
-
for (F in
|
1254
|
-
|
1118
|
+
var F, A = {}, R = null, le = null;
|
1119
|
+
g !== void 0 && (bt(g), R = "" + g), kt(f) && (bt(f.key), R = "" + f.key), Pt(f) && (le = f.ref, Et(f, j));
|
1120
|
+
for (F in f)
|
1121
|
+
Te.call(f, F) && !et.hasOwnProperty(F) && (A[F] = f[F]);
|
1255
1122
|
if (i && i.defaultProps) {
|
1256
1123
|
var Z = i.defaultProps;
|
1257
1124
|
for (F in Z)
|
1258
1125
|
A[F] === void 0 && (A[F] = Z[F]);
|
1259
1126
|
}
|
1260
|
-
if (R ||
|
1127
|
+
if (R || le) {
|
1261
1128
|
var Q = typeof i == "function" ? i.displayName || i.name || "Unknown" : i;
|
1262
|
-
R &&
|
1129
|
+
R && we(A, Q), le && Vt(A, Q);
|
1263
1130
|
}
|
1264
|
-
return r(i, R,
|
1131
|
+
return r(i, R, le, j, C, xe.current, A);
|
1265
1132
|
}
|
1266
1133
|
}
|
1267
1134
|
var O = B.ReactCurrentOwner, L = B.ReactDebugCurrentFrame;
|
1268
1135
|
function K(i) {
|
1269
1136
|
if (i) {
|
1270
|
-
var
|
1137
|
+
var f = i._owner, g = Me(i.type, i._source, f ? f.type : null);
|
1271
1138
|
L.setExtraStackFrame(g);
|
1272
1139
|
} else
|
1273
1140
|
L.setExtraStackFrame(null);
|
@@ -1277,7 +1144,7 @@ function Na() {
|
|
1277
1144
|
function ie(i) {
|
1278
1145
|
return typeof i == "object" && i !== null && i.$$typeof === n;
|
1279
1146
|
}
|
1280
|
-
function
|
1147
|
+
function Dt() {
|
1281
1148
|
{
|
1282
1149
|
if (O.current) {
|
1283
1150
|
var i = $(O.current.type);
|
@@ -1289,36 +1156,36 @@ Check the render method of \`` + i + "`.";
|
|
1289
1156
|
return "";
|
1290
1157
|
}
|
1291
1158
|
}
|
1292
|
-
function
|
1159
|
+
function jt(i) {
|
1293
1160
|
{
|
1294
1161
|
if (i !== void 0) {
|
1295
|
-
var
|
1162
|
+
var f = i.fileName.replace(/^.*[\\\/]/, ""), g = i.lineNumber;
|
1296
1163
|
return `
|
1297
1164
|
|
1298
|
-
Check your code at ` +
|
1165
|
+
Check your code at ` + f + ":" + g + ".";
|
1299
1166
|
}
|
1300
1167
|
return "";
|
1301
1168
|
}
|
1302
1169
|
}
|
1303
1170
|
var nt = {};
|
1304
|
-
function
|
1171
|
+
function he(i) {
|
1305
1172
|
{
|
1306
|
-
var
|
1307
|
-
if (!
|
1173
|
+
var f = Dt();
|
1174
|
+
if (!f) {
|
1308
1175
|
var g = typeof i == "string" ? i : i.displayName || i.name;
|
1309
|
-
g && (
|
1176
|
+
g && (f = `
|
1310
1177
|
|
1311
1178
|
Check the top-level render call using <` + g + ">.");
|
1312
1179
|
}
|
1313
|
-
return
|
1180
|
+
return f;
|
1314
1181
|
}
|
1315
1182
|
}
|
1316
|
-
function
|
1183
|
+
function fe(i, f) {
|
1317
1184
|
{
|
1318
1185
|
if (!i._store || i._store.validated || i.key != null)
|
1319
1186
|
return;
|
1320
1187
|
i._store.validated = !0;
|
1321
|
-
var g =
|
1188
|
+
var g = he(f);
|
1322
1189
|
if (nt[g])
|
1323
1190
|
return;
|
1324
1191
|
nt[g] = !0;
|
@@ -1326,54 +1193,54 @@ Check the top-level render call using <` + g + ">.");
|
|
1326
1193
|
i && i._owner && i._owner !== O.current && (C = " It was passed a child from " + $(i._owner.type) + "."), K(i), 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), K(null);
|
1327
1194
|
}
|
1328
1195
|
}
|
1329
|
-
function
|
1196
|
+
function Ae(i, f) {
|
1330
1197
|
{
|
1331
1198
|
if (typeof i != "object")
|
1332
1199
|
return;
|
1333
1200
|
if (Qe(i))
|
1334
1201
|
for (var g = 0; g < i.length; g++) {
|
1335
1202
|
var C = i[g];
|
1336
|
-
ie(C) &&
|
1203
|
+
ie(C) && fe(C, f);
|
1337
1204
|
}
|
1338
1205
|
else if (ie(i))
|
1339
1206
|
i._store && (i._store.validated = !0);
|
1340
1207
|
else if (i) {
|
1341
|
-
var
|
1342
|
-
if (typeof
|
1343
|
-
for (var F =
|
1344
|
-
ie(A.value) &&
|
1208
|
+
var j = H(i);
|
1209
|
+
if (typeof j == "function" && j !== i.entries)
|
1210
|
+
for (var F = j.call(i), A; !(A = F.next()).done; )
|
1211
|
+
ie(A.value) && fe(A.value, f);
|
1345
1212
|
}
|
1346
1213
|
}
|
1347
1214
|
}
|
1348
|
-
function
|
1215
|
+
function Pe(i) {
|
1349
1216
|
{
|
1350
|
-
var
|
1351
|
-
if (
|
1217
|
+
var f = i.type;
|
1218
|
+
if (f == null || typeof f == "string")
|
1352
1219
|
return;
|
1353
1220
|
var g;
|
1354
|
-
if (typeof
|
1355
|
-
g =
|
1356
|
-
else if (typeof
|
1221
|
+
if (typeof f == "function")
|
1222
|
+
g = f.propTypes;
|
1223
|
+
else if (typeof f == "object" && (f.$$typeof === u || // Note: Memo only checks outer props here.
|
1357
1224
|
// Inner props are checked in the reconciler.
|
1358
|
-
|
1359
|
-
g =
|
1225
|
+
f.$$typeof === b))
|
1226
|
+
g = f.propTypes;
|
1360
1227
|
else
|
1361
1228
|
return;
|
1362
1229
|
if (g) {
|
1363
|
-
var C = $(
|
1230
|
+
var C = $(f);
|
1364
1231
|
Je(g, i.props, "prop", C, i);
|
1365
|
-
} else if (
|
1232
|
+
} else if (f.PropTypes !== void 0 && !de) {
|
1366
1233
|
de = !0;
|
1367
|
-
var
|
1368
|
-
w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",
|
1234
|
+
var j = $(f);
|
1235
|
+
w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", j || "Unknown");
|
1369
1236
|
}
|
1370
|
-
typeof
|
1237
|
+
typeof f.getDefaultProps == "function" && !f.getDefaultProps.isReactClassApproved && w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
1371
1238
|
}
|
1372
1239
|
}
|
1373
|
-
function
|
1240
|
+
function ke(i) {
|
1374
1241
|
{
|
1375
|
-
for (var
|
1376
|
-
var C =
|
1242
|
+
for (var f = Object.keys(i.props), g = 0; g < f.length; g++) {
|
1243
|
+
var C = f[g];
|
1377
1244
|
if (C !== "children" && C !== "key") {
|
1378
1245
|
K(i), w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", C), K(null);
|
1379
1246
|
break;
|
@@ -1382,56 +1249,56 @@ Check the top-level render call using <` + g + ">.");
|
|
1382
1249
|
i.ref !== null && (K(i), w("Invalid attribute `ref` supplied to `React.Fragment`."), K(null));
|
1383
1250
|
}
|
1384
1251
|
}
|
1385
|
-
function De(i,
|
1252
|
+
function De(i, f, g, C, j, F) {
|
1386
1253
|
{
|
1387
1254
|
var A = _(i);
|
1388
1255
|
if (!A) {
|
1389
1256
|
var R = "";
|
1390
1257
|
(i === void 0 || typeof i == "object" && i !== null && Object.keys(i).length === 0) && (R += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
1391
|
-
var
|
1392
|
-
|
1258
|
+
var le = jt(j);
|
1259
|
+
le ? R += le : R += Dt();
|
1393
1260
|
var Z;
|
1394
1261
|
i === null ? Z = "null" : Qe(i) ? Z = "array" : i !== void 0 && i.$$typeof === n ? (Z = "<" + ($(i.type) || "Unknown") + " />", R = " Did you accidentally export a JSX literal instead of a component?") : Z = typeof i, w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", Z, R);
|
1395
1262
|
}
|
1396
|
-
var Q = y(i,
|
1263
|
+
var Q = y(i, f, g, j, F);
|
1397
1264
|
if (Q == null)
|
1398
1265
|
return Q;
|
1399
1266
|
if (A) {
|
1400
|
-
var
|
1401
|
-
if (
|
1267
|
+
var pe = f.children;
|
1268
|
+
if (pe !== void 0)
|
1402
1269
|
if (C)
|
1403
|
-
if (Qe(
|
1404
|
-
for (var
|
1405
|
-
|
1406
|
-
Object.freeze && Object.freeze(
|
1270
|
+
if (Qe(pe)) {
|
1271
|
+
for (var Ye = 0; Ye < pe.length; Ye++)
|
1272
|
+
Ae(pe[Ye], i);
|
1273
|
+
Object.freeze && Object.freeze(pe);
|
1407
1274
|
} else
|
1408
1275
|
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.");
|
1409
1276
|
else
|
1410
|
-
|
1277
|
+
Ae(pe, i);
|
1411
1278
|
}
|
1412
|
-
return i === e ?
|
1279
|
+
return i === e ? ke(Q) : Pe(Q), Q;
|
1413
1280
|
}
|
1414
1281
|
}
|
1415
|
-
function
|
1416
|
-
return De(i,
|
1282
|
+
function Fn(i, f, g) {
|
1283
|
+
return De(i, f, g, !0);
|
1417
1284
|
}
|
1418
|
-
function
|
1419
|
-
return De(i,
|
1285
|
+
function Bn(i, f, g) {
|
1286
|
+
return De(i, f, g, !1);
|
1420
1287
|
}
|
1421
|
-
var
|
1422
|
-
|
1423
|
-
}()),
|
1288
|
+
var Un = Bn, $n = Fn;
|
1289
|
+
it.Fragment = e, it.jsx = Un, it.jsxs = $n;
|
1290
|
+
}()), it;
|
1424
1291
|
}
|
1425
|
-
process.env.NODE_ENV === "production" ?
|
1426
|
-
var
|
1427
|
-
function
|
1428
|
-
return t.title.search("<") > -1 ? /* @__PURE__ */
|
1292
|
+
process.env.NODE_ENV === "production" ? zt.exports = Pa() : zt.exports = ka();
|
1293
|
+
var c = zt.exports;
|
1294
|
+
function jn(t) {
|
1295
|
+
return t.title.search("<") > -1 ? /* @__PURE__ */ c.jsx("button", { className: "svg", dangerouslySetInnerHTML: { __html: t.title } }) : /* @__PURE__ */ c.jsx("button", { children: t.title });
|
1429
1296
|
}
|
1430
|
-
const
|
1431
|
-
/* @__PURE__ */
|
1432
|
-
/* @__PURE__ */
|
1433
|
-
/* @__PURE__ */
|
1434
|
-
] }),
|
1297
|
+
const Da = /* @__PURE__ */ c.jsxs("svg", { className: "closeIcon", width: "14", height: "14", fill: "none", stroke: "#666666", strokeMiterlimit: "10", children: [
|
1298
|
+
/* @__PURE__ */ c.jsx("circle", { cx: "7", cy: "7", r: "6" }),
|
1299
|
+
/* @__PURE__ */ c.jsx("line", { x1: "4", y1: "4", x2: "10", y2: "10" }),
|
1300
|
+
/* @__PURE__ */ c.jsx("line", { x1: "4", y1: "10", x2: "10", y2: "4" })
|
1301
|
+
] }), ja = /* @__PURE__ */ c.jsx("svg", { className: "dragIcon", width: "14", height: "14", fill: "#666666", stroke: "none", children: /* @__PURE__ */ c.jsx(
|
1435
1302
|
"path",
|
1436
1303
|
{
|
1437
1304
|
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
|
@@ -1439,46 +1306,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
|
|
1439
1306
|
C11,8.22,10.74,8,10.43,8z`
|
1440
1307
|
}
|
1441
1308
|
) });
|
1442
|
-
function
|
1443
|
-
return /* @__PURE__ */
|
1444
|
-
|
1445
|
-
/* @__PURE__ */
|
1446
|
-
/* @__PURE__ */
|
1309
|
+
function Ia(t) {
|
1310
|
+
return /* @__PURE__ */ c.jsx(An.Item, { value: t.title, children: /* @__PURE__ */ c.jsxs("div", { children: [
|
1311
|
+
ja,
|
1312
|
+
/* @__PURE__ */ c.jsx("span", { children: t.title }),
|
1313
|
+
/* @__PURE__ */ c.jsx("button", { className: "closeIcon", onClick: () => {
|
1447
1314
|
t.onDelete(t.index);
|
1448
|
-
}, children:
|
1315
|
+
}, children: Da })
|
1449
1316
|
] }) }, t.title);
|
1450
1317
|
}
|
1451
|
-
function
|
1452
|
-
const [n, a] = ae(!1), [e, o] = ae(t.options),
|
1453
|
-
t.onDragComplete(
|
1454
|
-
},
|
1318
|
+
function La(t) {
|
1319
|
+
const [n, a] = ae(!1), [e, o] = ae(t.options), l = (p) => {
|
1320
|
+
t.onDragComplete(p), o(p);
|
1321
|
+
}, m = (p) => {
|
1455
1322
|
const v = [...e];
|
1456
|
-
v.splice(
|
1457
|
-
},
|
1458
|
-
e.forEach((
|
1459
|
-
|
1323
|
+
v.splice(p, 1), l(v);
|
1324
|
+
}, s = [];
|
1325
|
+
e.forEach((p, v) => {
|
1326
|
+
s.push(/* @__PURE__ */ c.jsx(Ia, { index: v, title: p, onDelete: m }, p));
|
1460
1327
|
});
|
1461
1328
|
let u = "dropdown draggable";
|
1462
|
-
return t.subdropdown && (u += " subdropdown"), /* @__PURE__ */
|
1463
|
-
/* @__PURE__ */
|
1464
|
-
/* @__PURE__ */
|
1329
|
+
return t.subdropdown && (u += " subdropdown"), /* @__PURE__ */ c.jsxs("div", { className: u, onMouseEnter: () => a(!0), onMouseLeave: () => a(!1), children: [
|
1330
|
+
/* @__PURE__ */ c.jsx(jn, { title: t.title }),
|
1331
|
+
/* @__PURE__ */ c.jsx(An.Group, { axis: "y", values: e, onReorder: l, style: { visibility: n ? "visible" : "hidden" }, children: s })
|
1465
1332
|
] });
|
1466
1333
|
}
|
1467
|
-
function
|
1334
|
+
function Na(t) {
|
1468
1335
|
const [n, a] = ae(!1), e = [];
|
1469
|
-
t.options.map((
|
1470
|
-
t.onSelect !== void 0 && (
|
1336
|
+
t.options.map((l, m) => {
|
1337
|
+
t.onSelect !== void 0 && (l.onSelect = t.onSelect), e.push(/* @__PURE__ */ c.jsx(Fa, { option: l }, m));
|
1471
1338
|
});
|
1472
1339
|
let o = "dropdown";
|
1473
|
-
return t.subdropdown && (o += " subdropdown"), /* @__PURE__ */
|
1340
|
+
return t.subdropdown && (o += " subdropdown"), /* @__PURE__ */ c.jsxs(
|
1474
1341
|
"div",
|
1475
1342
|
{
|
1476
1343
|
className: o,
|
1477
1344
|
onMouseEnter: () => a(!0),
|
1478
1345
|
onMouseLeave: () => a(!1),
|
1479
1346
|
children: [
|
1480
|
-
/* @__PURE__ */
|
1481
|
-
/* @__PURE__ */
|
1347
|
+
/* @__PURE__ */ c.jsx(jn, { title: t.title }),
|
1348
|
+
/* @__PURE__ */ c.jsx(
|
1482
1349
|
"ul",
|
1483
1350
|
{
|
1484
1351
|
style: { visibility: n ? "visible" : "hidden" },
|
@@ -1489,26 +1356,26 @@ function za(t) {
|
|
1489
1356
|
}
|
1490
1357
|
);
|
1491
1358
|
}
|
1492
|
-
function
|
1359
|
+
function Fa(t) {
|
1493
1360
|
const { option: n } = t, [a, e] = ae("");
|
1494
1361
|
let o;
|
1495
1362
|
switch (n.type) {
|
1496
1363
|
case "draggable":
|
1497
|
-
o = /* @__PURE__ */
|
1498
|
-
|
1364
|
+
o = /* @__PURE__ */ c.jsx(
|
1365
|
+
La,
|
1499
1366
|
{
|
1500
1367
|
title: n.title,
|
1501
1368
|
options: n.value,
|
1502
|
-
onDragComplete: (
|
1503
|
-
n.onDragComplete !== void 0 && n.onDragComplete(
|
1369
|
+
onDragComplete: (l) => {
|
1370
|
+
n.onDragComplete !== void 0 && n.onDragComplete(l);
|
1504
1371
|
},
|
1505
1372
|
subdropdown: !0
|
1506
1373
|
}
|
1507
1374
|
);
|
1508
1375
|
break;
|
1509
1376
|
case "dropdown":
|
1510
|
-
o = /* @__PURE__ */
|
1511
|
-
|
1377
|
+
o = /* @__PURE__ */ c.jsx(
|
1378
|
+
Na,
|
1512
1379
|
{
|
1513
1380
|
title: n.title,
|
1514
1381
|
options: n.value,
|
@@ -1518,7 +1385,7 @@ function Ya(t) {
|
|
1518
1385
|
);
|
1519
1386
|
break;
|
1520
1387
|
case "option":
|
1521
|
-
o = /* @__PURE__ */
|
1388
|
+
o = /* @__PURE__ */ c.jsx(
|
1522
1389
|
"button",
|
1523
1390
|
{
|
1524
1391
|
onClick: () => {
|
@@ -1529,15 +1396,15 @@ function Ya(t) {
|
|
1529
1396
|
);
|
1530
1397
|
break;
|
1531
1398
|
}
|
1532
|
-
return /* @__PURE__ */
|
1399
|
+
return /* @__PURE__ */ c.jsx("li", { className: a === n.title ? "selected" : "", children: o }, wa());
|
1533
1400
|
}
|
1534
|
-
function
|
1401
|
+
function ji(t) {
|
1535
1402
|
function n(e) {
|
1536
1403
|
switch (t.components.forEach((o) => {
|
1537
1404
|
o.handleApp(e);
|
1538
1405
|
}), e.event) {
|
1539
1406
|
case "custom":
|
1540
|
-
k.dispatchEvent({ type:
|
1407
|
+
k.dispatchEvent({ type: D.CUSTOM, value: e.data });
|
1541
1408
|
break;
|
1542
1409
|
}
|
1543
1410
|
}
|
@@ -1546,7 +1413,7 @@ function Ni(t) {
|
|
1546
1413
|
o.handleEditor(e);
|
1547
1414
|
}), e.event) {
|
1548
1415
|
case "custom":
|
1549
|
-
k.dispatchEvent({ type:
|
1416
|
+
k.dispatchEvent({ type: D.CUSTOM, value: e.data });
|
1550
1417
|
break;
|
1551
1418
|
}
|
1552
1419
|
}
|
@@ -1554,7 +1421,7 @@ function Ni(t) {
|
|
1554
1421
|
e.target === "editor" ? a(e) : n(e);
|
1555
1422
|
};
|
1556
1423
|
}
|
1557
|
-
const
|
1424
|
+
const Ba = `out vec3 worldPosition;
|
1558
1425
|
uniform float uDistance;
|
1559
1426
|
|
1560
1427
|
void main() {
|
@@ -1563,7 +1430,7 @@ void main() {
|
|
1563
1430
|
worldPosition.xz += cameraPosition.xz;
|
1564
1431
|
|
1565
1432
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(worldPosition, 1.0);
|
1566
|
-
}`,
|
1433
|
+
}`, Ua = `out vec4 fragColor;
|
1567
1434
|
in vec3 worldPosition;
|
1568
1435
|
|
1569
1436
|
uniform float uDivisions;
|
@@ -1631,14 +1498,14 @@ void main() {
|
|
1631
1498
|
|
1632
1499
|
if (fragColor.a <= 0.0) discard;
|
1633
1500
|
}`;
|
1634
|
-
class
|
1501
|
+
class $a extends un {
|
1635
1502
|
constructor(n) {
|
1636
1503
|
super({
|
1637
1504
|
extensions: {
|
1638
1505
|
derivatives: !0
|
1639
1506
|
},
|
1640
|
-
glslVersion:
|
1641
|
-
side:
|
1507
|
+
glslVersion: Gn,
|
1508
|
+
side: dn,
|
1642
1509
|
transparent: !0,
|
1643
1510
|
uniforms: {
|
1644
1511
|
uScale: {
|
@@ -1648,7 +1515,7 @@ class Ha extends hn {
|
|
1648
1515
|
value: n?.divisions !== void 0 ? n?.divisions : 10
|
1649
1516
|
},
|
1650
1517
|
uColor: {
|
1651
|
-
value: n?.color !== void 0 ? n?.color : new
|
1518
|
+
value: n?.color !== void 0 ? n?.color : new Ot(16777215)
|
1652
1519
|
},
|
1653
1520
|
uDistance: {
|
1654
1521
|
value: n?.distance !== void 0 ? n?.distance : 1e4
|
@@ -1660,24 +1527,24 @@ class Ha extends hn {
|
|
1660
1527
|
value: n?.gridOpacity !== void 0 ? n?.gridOpacity : 0.25
|
1661
1528
|
}
|
1662
1529
|
},
|
1663
|
-
vertexShader:
|
1664
|
-
fragmentShader:
|
1530
|
+
vertexShader: Ba,
|
1531
|
+
fragmentShader: Ua,
|
1665
1532
|
name: "InfiniteGrid",
|
1666
1533
|
depthWrite: !1
|
1667
1534
|
});
|
1668
1535
|
}
|
1669
1536
|
}
|
1670
|
-
class
|
1537
|
+
class za extends Vn {
|
1671
1538
|
gridMaterial;
|
1672
1539
|
constructor() {
|
1673
|
-
const n = new
|
1674
|
-
super(new
|
1540
|
+
const n = new $a();
|
1541
|
+
super(new Hn(2, 2), n), this.gridMaterial = n, this.frustumCulled = !1, this.name = "InfiniteGridHelper", this.position.y = 0.1;
|
1675
1542
|
}
|
1676
1543
|
update() {
|
1677
1544
|
this.gridMaterial.needsUpdate = !0;
|
1678
1545
|
}
|
1679
1546
|
}
|
1680
|
-
const
|
1547
|
+
const Ya = `#include <common>
|
1681
1548
|
#include <batching_pars_vertex>
|
1682
1549
|
#include <uv_pars_vertex>
|
1683
1550
|
#include <color_pars_vertex>
|
@@ -1707,7 +1574,7 @@ void main() {
|
|
1707
1574
|
#include <logdepthbuf_vertex>
|
1708
1575
|
#include <clipping_planes_vertex>
|
1709
1576
|
#include <worldpos_vertex>
|
1710
|
-
}`,
|
1577
|
+
}`, Ga = `
|
1711
1578
|
#include <common>
|
1712
1579
|
#include <uv_pars_fragment>
|
1713
1580
|
#include <clipping_planes_pars_fragment>
|
@@ -1716,21 +1583,21 @@ void main() {
|
|
1716
1583
|
#include <clipping_planes_fragment>
|
1717
1584
|
gl_FragColor = vec4(vec3(vUv, 0.0), 1.0);
|
1718
1585
|
}`;
|
1719
|
-
class
|
1586
|
+
class Va extends un {
|
1720
1587
|
constructor() {
|
1721
1588
|
super({
|
1722
1589
|
defines: {
|
1723
1590
|
USE_UV: ""
|
1724
1591
|
},
|
1725
|
-
vertexShader:
|
1726
|
-
fragmentShader:
|
1592
|
+
vertexShader: Ya,
|
1593
|
+
fragmentShader: Ga
|
1727
1594
|
});
|
1728
1595
|
}
|
1729
1596
|
}
|
1730
|
-
function
|
1597
|
+
function Gt(t) {
|
1731
1598
|
const [n, a] = ae(t.open !== void 0 ? t.open : !0), e = !n || t.children === void 0;
|
1732
|
-
return /* @__PURE__ */
|
1733
|
-
/* @__PURE__ */
|
1599
|
+
return /* @__PURE__ */ c.jsxs("div", { className: `accordion ${e ? "hide" : ""}`, children: [
|
1600
|
+
/* @__PURE__ */ c.jsxs(
|
1734
1601
|
"button",
|
1735
1602
|
{
|
1736
1603
|
className: "toggle",
|
@@ -1739,28 +1606,28 @@ function Ht(t) {
|
|
1739
1606
|
t.onToggle !== void 0 && t.onToggle(o), a(o);
|
1740
1607
|
},
|
1741
1608
|
children: [
|
1742
|
-
/* @__PURE__ */
|
1609
|
+
/* @__PURE__ */ c.jsx(
|
1743
1610
|
"p",
|
1744
1611
|
{
|
1745
1612
|
className: `status ${n ? "open" : ""}`,
|
1746
1613
|
children: "Toggle"
|
1747
1614
|
}
|
1748
1615
|
),
|
1749
|
-
/* @__PURE__ */
|
1616
|
+
/* @__PURE__ */ c.jsx("p", { className: "label", children: st(t.label) })
|
1750
1617
|
]
|
1751
1618
|
}
|
1752
1619
|
),
|
1753
1620
|
t.button,
|
1754
|
-
/* @__PURE__ */
|
1621
|
+
/* @__PURE__ */ c.jsx("div", { className: n ? "open" : "", children: /* @__PURE__ */ c.jsx("div", { children: t.children }) })
|
1755
1622
|
] });
|
1756
1623
|
}
|
1757
|
-
function
|
1758
|
-
const [n, a] = ae(!1), e = t.child.children.length > 0, o = [];
|
1759
|
-
return t.child.children.length > 0 && t.child.children.map((
|
1760
|
-
o.push(/* @__PURE__ */
|
1761
|
-
}), /* @__PURE__ */
|
1762
|
-
/* @__PURE__ */
|
1763
|
-
e ? /* @__PURE__ */
|
1624
|
+
function In(t) {
|
1625
|
+
const [n, a] = ae(!1), e = t.child !== void 0 && t.child.children.length > 0, o = [];
|
1626
|
+
return t.child !== void 0 && t.child.children.length > 0 && t.child.children.map((l) => {
|
1627
|
+
o.push(/* @__PURE__ */ c.jsx(In, { child: l, three: t.three }, Math.random()));
|
1628
|
+
}), /* @__PURE__ */ c.jsx(c.Fragment, { children: t.child !== void 0 && /* @__PURE__ */ c.jsxs("div", { className: "childObject", children: [
|
1629
|
+
/* @__PURE__ */ c.jsxs("div", { className: "child", children: [
|
1630
|
+
e ? /* @__PURE__ */ c.jsx(
|
1764
1631
|
"button",
|
1765
1632
|
{
|
1766
1633
|
className: "status",
|
@@ -1772,7 +1639,7 @@ function Fn(t) {
|
|
1772
1639
|
}
|
1773
1640
|
}
|
1774
1641
|
) : null,
|
1775
|
-
/* @__PURE__ */
|
1642
|
+
/* @__PURE__ */ c.jsx(
|
1776
1643
|
"button",
|
1777
1644
|
{
|
1778
1645
|
className: "name",
|
@@ -1780,34 +1647,34 @@ function Fn(t) {
|
|
1780
1647
|
left: e ? "20px" : "5px"
|
1781
1648
|
},
|
1782
1649
|
onClick: () => {
|
1783
|
-
t.three.getObject(t.child.uuid), n || a(!0);
|
1650
|
+
t.child !== void 0 && (t.three.getObject(t.child.uuid), n || a(!0));
|
1784
1651
|
},
|
1785
1652
|
children: t.child.name.length > 0 ? `${t.child.name} (${t.child.type})` : `${t.child.type}::${t.child.uuid}`
|
1786
1653
|
}
|
1787
1654
|
),
|
1788
|
-
/* @__PURE__ */
|
1655
|
+
/* @__PURE__ */ c.jsx("div", { className: `icon ${Ta(t.child)}` })
|
1789
1656
|
] }),
|
1790
|
-
/* @__PURE__ */
|
1791
|
-
] }, Math.random());
|
1657
|
+
/* @__PURE__ */ c.jsx("div", { className: n ? "open" : "", children: /* @__PURE__ */ c.jsx("div", { className: "container", children: o }) })
|
1658
|
+
] }, Math.random()) });
|
1792
1659
|
}
|
1793
|
-
function
|
1660
|
+
function Ha(t) {
|
1794
1661
|
const n = [];
|
1795
|
-
return t.child
|
1796
|
-
n.push(/* @__PURE__ */
|
1797
|
-
}), /* @__PURE__ */
|
1662
|
+
return t.child?.children.map((a) => {
|
1663
|
+
n.push(/* @__PURE__ */ c.jsx(In, { child: a, three: t.three }, Math.random()));
|
1664
|
+
}), /* @__PURE__ */ c.jsx("div", { className: `scene ${t.class !== void 0 ? t.class : ""}`, children: n });
|
1798
1665
|
}
|
1799
|
-
const
|
1800
|
-
function
|
1666
|
+
const Wa = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA5klEQVRoge2Y0Q6EIAwE6cX//+X6cCFpSMEKVTdk501OpRNKiyelFC0b8Ps6gCwoggZF0KAIGhRBgyJoUAQNiqCxjciR9SLV//eZiAyvK3U8i/QVaQO2YyLSFVvlkdTKDjJCukh2ykR5ZEW+kHmlatl90RaBtDkK/w7CYhuRUEO0ee3l+J3m55Vm+17vtwjTnV1V3QA8qfbeUXCzRWDpiLLS+OyzvRW7IzW9R+okvclsqR09743bo0yUpc1+lSJvNsa002+Euk9GKzV7SmZDRIMiaFAEDYqgQRE0KIIGRdCgCBoUQeMEMERadX7YUz8AAAAASUVORK5CYII=";
|
1667
|
+
function Xa(t) {
|
1801
1668
|
return "items" in t;
|
1802
1669
|
}
|
1803
|
-
function
|
1670
|
+
function Fe(t) {
|
1804
1671
|
const n = [];
|
1805
1672
|
return t.items.forEach((a) => {
|
1806
|
-
|
1807
|
-
/* @__PURE__ */
|
1673
|
+
Xa(a) ? n.push(
|
1674
|
+
/* @__PURE__ */ c.jsx(Fe, { title: st(a.title), items: a.items }, Math.random())
|
1808
1675
|
) : n.push(
|
1809
|
-
/* @__PURE__ */
|
1810
|
-
|
1676
|
+
/* @__PURE__ */ c.jsx(
|
1677
|
+
ot,
|
1811
1678
|
{
|
1812
1679
|
title: a.title,
|
1813
1680
|
prop: a.prop,
|
@@ -1825,12 +1692,12 @@ function Be(t) {
|
|
1825
1692
|
Math.random()
|
1826
1693
|
)
|
1827
1694
|
);
|
1828
|
-
}), /* @__PURE__ */
|
1695
|
+
}), /* @__PURE__ */ c.jsx(Gt, { label: t.title, open: t.expanded === !0, children: n });
|
1829
1696
|
}
|
1830
|
-
function
|
1697
|
+
function Ka(t) {
|
1831
1698
|
return !(t === "alphaHash" || t === "alphaToCoverage" || t === "attenuationDistance" || t === "blendDstAlpha" || t === "colorWrite" || t === "combine" || t === "defaultAttributeValues" || t === "depthFunc" || t === "forceSinglePass" || t === "glslVersion" || t === "linecap" || t === "linejoin" || t === "linewidth" || t === "normalMapType" || t === "precision" || t === "premultipliedAlpha" || t === "shadowSide" || t === "toneMapped" || t === "uniformsGroups" || t === "uniformsNeedUpdate" || t === "userData" || t === "vertexColors" || t === "version" || t === "wireframeLinecap" || t === "wireframeLinejoin" || t === "wireframeLinewidth" || t.slice(0, 4) === "clip" || t.slice(0, 7) === "polygon" || t.slice(0, 7) === "stencil" || t.slice(0, 2) === "is");
|
1832
1699
|
}
|
1833
|
-
function
|
1700
|
+
function je(t) {
|
1834
1701
|
switch (t) {
|
1835
1702
|
case "alphaMap":
|
1836
1703
|
return "Alpha Map";
|
@@ -2003,10 +1870,10 @@ function Ie(t) {
|
|
2003
1870
|
}
|
2004
1871
|
return t;
|
2005
1872
|
}
|
2006
|
-
function
|
1873
|
+
function qa(t) {
|
2007
1874
|
return t.toLowerCase().search("intensity") > -1 || t === "anisotropyRotation" || t === "blendAlpha" || t === "bumpScale" || t === "clearcoatRoughness" || t === "displacementBias" || t === "displacementScale" || t === "metalness" || t === "opacity" || t === "reflectivity" || t === "refractionRatio" || t === "roughness" || t === "sheenRoughness" || t === "thickness";
|
2008
1875
|
}
|
2009
|
-
function
|
1876
|
+
function Za() {
|
2010
1877
|
const t = document.createElement("input");
|
2011
1878
|
return t.type = "file", new Promise((n, a) => {
|
2012
1879
|
t.addEventListener("change", function() {
|
@@ -2014,300 +1881,300 @@ function ni() {
|
|
2014
1881
|
a();
|
2015
1882
|
else {
|
2016
1883
|
const e = t.files[0], o = new FileReader();
|
2017
|
-
o.onload = function(
|
2018
|
-
n(
|
1884
|
+
o.onload = function(l) {
|
1885
|
+
n(l.target.result);
|
2019
1886
|
}, o.readAsDataURL(e);
|
2020
1887
|
}
|
2021
1888
|
}), t.click();
|
2022
1889
|
});
|
2023
1890
|
}
|
2024
|
-
const
|
1891
|
+
const Ja = [
|
2025
1892
|
{
|
2026
1893
|
title: "Front",
|
2027
|
-
value:
|
1894
|
+
value: Wn
|
2028
1895
|
},
|
2029
1896
|
{
|
2030
1897
|
title: "Back",
|
2031
|
-
value:
|
1898
|
+
value: Xn
|
2032
1899
|
},
|
2033
1900
|
{
|
2034
1901
|
title: "Double",
|
2035
|
-
value:
|
1902
|
+
value: dn
|
2036
1903
|
}
|
2037
|
-
],
|
1904
|
+
], Qa = [
|
2038
1905
|
{
|
2039
1906
|
title: "No Blending",
|
2040
|
-
value:
|
1907
|
+
value: Kn
|
2041
1908
|
},
|
2042
1909
|
{
|
2043
1910
|
title: "Normal",
|
2044
|
-
value:
|
1911
|
+
value: qn
|
2045
1912
|
},
|
2046
1913
|
{
|
2047
1914
|
title: "Additive",
|
2048
|
-
value:
|
1915
|
+
value: Zn
|
2049
1916
|
},
|
2050
1917
|
{
|
2051
1918
|
title: "Subtractive",
|
2052
|
-
value:
|
1919
|
+
value: Jn
|
2053
1920
|
},
|
2054
1921
|
{
|
2055
1922
|
title: "Multiply",
|
2056
|
-
value:
|
1923
|
+
value: Qn
|
2057
1924
|
},
|
2058
1925
|
{
|
2059
1926
|
title: "Custom",
|
2060
|
-
value:
|
1927
|
+
value: ea
|
2061
1928
|
}
|
2062
|
-
],
|
1929
|
+
], ei = [
|
2063
1930
|
{
|
2064
1931
|
title: "Add",
|
2065
|
-
value:
|
1932
|
+
value: ta
|
2066
1933
|
},
|
2067
1934
|
{
|
2068
1935
|
title: "Subtract",
|
2069
|
-
value:
|
1936
|
+
value: na
|
2070
1937
|
},
|
2071
1938
|
{
|
2072
1939
|
title: "Reverse Subtract",
|
2073
|
-
value:
|
1940
|
+
value: aa
|
2074
1941
|
},
|
2075
1942
|
{
|
2076
1943
|
title: "Min",
|
2077
|
-
value:
|
1944
|
+
value: ia
|
2078
1945
|
},
|
2079
1946
|
{
|
2080
1947
|
title: "Max",
|
2081
|
-
value:
|
1948
|
+
value: ra
|
2082
1949
|
}
|
2083
|
-
],
|
1950
|
+
], ti = [
|
2084
1951
|
{
|
2085
1952
|
title: "Zero",
|
2086
|
-
valye:
|
1953
|
+
valye: fn
|
2087
1954
|
},
|
2088
1955
|
{
|
2089
1956
|
title: "One",
|
2090
|
-
valye:
|
1957
|
+
valye: pn
|
2091
1958
|
},
|
2092
1959
|
{
|
2093
1960
|
title: "Src Color",
|
2094
|
-
valye:
|
1961
|
+
valye: hn
|
2095
1962
|
},
|
2096
1963
|
{
|
2097
1964
|
title: "One Minus Src Color",
|
2098
|
-
valye:
|
1965
|
+
valye: mn
|
2099
1966
|
},
|
2100
1967
|
{
|
2101
1968
|
title: "Src Alpha",
|
2102
|
-
valye:
|
1969
|
+
valye: vn
|
2103
1970
|
},
|
2104
1971
|
{
|
2105
1972
|
title: "One Minus Src Alpha",
|
2106
|
-
valye:
|
1973
|
+
valye: gn
|
2107
1974
|
},
|
2108
1975
|
{
|
2109
1976
|
title: "Dst Alpha",
|
2110
|
-
valye:
|
1977
|
+
valye: bn
|
2111
1978
|
},
|
2112
1979
|
{
|
2113
1980
|
title: "One Minus Dst Alpha",
|
2114
|
-
valye:
|
1981
|
+
valye: yn
|
2115
1982
|
},
|
2116
1983
|
{
|
2117
1984
|
title: "Dst Color",
|
2118
|
-
valye:
|
1985
|
+
valye: En
|
2119
1986
|
},
|
2120
1987
|
{
|
2121
1988
|
title: "One Minus Dst Color",
|
2122
|
-
valye:
|
1989
|
+
valye: Cn
|
2123
1990
|
},
|
2124
1991
|
{
|
2125
1992
|
title: "Src Alpha Saturate",
|
2126
|
-
valye:
|
1993
|
+
valye: oa
|
2127
1994
|
},
|
2128
1995
|
{
|
2129
1996
|
title: "Constant Color",
|
2130
|
-
valye:
|
1997
|
+
valye: xn
|
2131
1998
|
},
|
2132
1999
|
{
|
2133
2000
|
title: "One Minus Constant Color",
|
2134
|
-
valye:
|
2001
|
+
valye: wn
|
2135
2002
|
},
|
2136
2003
|
{
|
2137
2004
|
title: "Constant Alpha",
|
2138
|
-
valye:
|
2005
|
+
valye: Sn
|
2139
2006
|
},
|
2140
2007
|
{
|
2141
2008
|
title: "One Minus Constant Alpha",
|
2142
|
-
valye:
|
2009
|
+
valye: On
|
2143
2010
|
}
|
2144
|
-
],
|
2011
|
+
], ni = [
|
2145
2012
|
{
|
2146
2013
|
title: "Zero",
|
2147
|
-
valye:
|
2014
|
+
valye: fn
|
2148
2015
|
},
|
2149
2016
|
{
|
2150
2017
|
title: "One",
|
2151
|
-
valye:
|
2018
|
+
valye: pn
|
2152
2019
|
},
|
2153
2020
|
{
|
2154
2021
|
title: "Src Color",
|
2155
|
-
valye:
|
2022
|
+
valye: hn
|
2156
2023
|
},
|
2157
2024
|
{
|
2158
2025
|
title: "One Minus Src Color",
|
2159
|
-
valye:
|
2026
|
+
valye: mn
|
2160
2027
|
},
|
2161
2028
|
{
|
2162
2029
|
title: "Src Alpha",
|
2163
|
-
valye:
|
2030
|
+
valye: vn
|
2164
2031
|
},
|
2165
2032
|
{
|
2166
2033
|
title: "One Minus Src Alpha",
|
2167
|
-
valye:
|
2034
|
+
valye: gn
|
2168
2035
|
},
|
2169
2036
|
{
|
2170
2037
|
title: "Dst Alpha",
|
2171
|
-
valye:
|
2038
|
+
valye: bn
|
2172
2039
|
},
|
2173
2040
|
{
|
2174
2041
|
title: "One Minus Dst Alpha",
|
2175
|
-
valye:
|
2042
|
+
valye: yn
|
2176
2043
|
},
|
2177
2044
|
{
|
2178
2045
|
title: "Dst Color",
|
2179
|
-
valye:
|
2046
|
+
valye: En
|
2180
2047
|
},
|
2181
2048
|
{
|
2182
2049
|
title: "One Minus Dst Color",
|
2183
|
-
valye:
|
2050
|
+
valye: Cn
|
2184
2051
|
},
|
2185
2052
|
{
|
2186
2053
|
title: "Constant Color",
|
2187
|
-
valye:
|
2054
|
+
valye: xn
|
2188
2055
|
},
|
2189
2056
|
{
|
2190
2057
|
title: "One Minus Constant Color",
|
2191
|
-
valye:
|
2058
|
+
valye: wn
|
2192
2059
|
},
|
2193
2060
|
{
|
2194
2061
|
title: "Constant Alpha",
|
2195
|
-
valye:
|
2062
|
+
valye: Sn
|
2196
2063
|
},
|
2197
2064
|
{
|
2198
2065
|
title: "One Minus Constant Alpha",
|
2199
|
-
valye:
|
2066
|
+
valye: On
|
2200
2067
|
}
|
2201
2068
|
];
|
2202
|
-
function
|
2069
|
+
function rt(t, n) {
|
2203
2070
|
t.needsUpdate = !0, t.type = "option", t.options = n;
|
2204
2071
|
}
|
2205
|
-
function
|
2072
|
+
function Jt(t, n, a) {
|
2206
2073
|
const e = [];
|
2207
2074
|
for (const o in t) {
|
2208
|
-
if (!
|
2075
|
+
if (!Ka(o))
|
2209
2076
|
continue;
|
2210
|
-
const
|
2211
|
-
if (
|
2212
|
-
const
|
2213
|
-
title:
|
2077
|
+
const l = typeof t[o], m = t[o];
|
2078
|
+
if (l === "boolean" || l === "number" || l === "string") {
|
2079
|
+
const s = {
|
2080
|
+
title: je(o),
|
2214
2081
|
prop: o,
|
2215
|
-
type:
|
2216
|
-
value:
|
2082
|
+
type: l,
|
2083
|
+
value: m,
|
2217
2084
|
min: void 0,
|
2218
2085
|
max: void 0,
|
2219
|
-
needsUpdate:
|
2220
|
-
onChange: (
|
2221
|
-
a.updateObject(n.uuid, `material.${
|
2086
|
+
needsUpdate: l === "boolean",
|
2087
|
+
onChange: (p, v) => {
|
2088
|
+
a.updateObject(n.uuid, `material.${p}`, v), s.needsUpdate && a.updateObject(n.uuid, "material.needsUpdate", !0);
|
2222
2089
|
const b = a.scene?.getObjectByProperty("uuid", n.uuid);
|
2223
|
-
b !== void 0 && ee(b, `material.${
|
2090
|
+
b !== void 0 && ee(b, `material.${p}`, v);
|
2224
2091
|
}
|
2225
2092
|
};
|
2226
2093
|
switch (o) {
|
2227
2094
|
case "blending":
|
2228
|
-
|
2095
|
+
rt(s, Qa);
|
2229
2096
|
break;
|
2230
2097
|
case "blendDst":
|
2231
|
-
|
2098
|
+
rt(s, ni);
|
2232
2099
|
break;
|
2233
2100
|
case "blendEquation":
|
2234
|
-
|
2101
|
+
rt(s, ei);
|
2235
2102
|
break;
|
2236
2103
|
case "blendSrc":
|
2237
|
-
|
2104
|
+
rt(s, ti);
|
2238
2105
|
break;
|
2239
2106
|
case "side":
|
2240
|
-
|
2107
|
+
rt(s, Ja);
|
2241
2108
|
break;
|
2242
2109
|
}
|
2243
|
-
|
2244
|
-
const u =
|
2245
|
-
u && (
|
2246
|
-
|
2247
|
-
}), e.push(
|
2248
|
-
title: `${
|
2110
|
+
qa(o) && (s.value = Number(m), s.type = "range", s.min = 0, s.max = 1, s.step = 0.01);
|
2111
|
+
const u = l === "string" && (o === "vertexShader" || o === "fragmentShader");
|
2112
|
+
u && (s.disabled = !1, s.latest = s.value, s.onChange = (p, v) => {
|
2113
|
+
s.latest = v;
|
2114
|
+
}), e.push(s), u && e.push({
|
2115
|
+
title: `${st(o)} - Update`,
|
2249
2116
|
type: "button",
|
2250
2117
|
onChange: () => {
|
2251
|
-
a.updateObject(n.uuid, `material.${o}`,
|
2252
|
-
const
|
2253
|
-
|
2118
|
+
a.updateObject(n.uuid, `material.${o}`, s.latest), a.updateObject(n.uuid, "material.needsUpdate", !0);
|
2119
|
+
const p = a.scene?.getObjectByProperty("uuid", n.uuid);
|
2120
|
+
p !== void 0 && (ee(p, `material.${o}`, s.latest), p.material.needsUpdate = !0);
|
2254
2121
|
}
|
2255
2122
|
});
|
2256
|
-
} else if (
|
2257
|
-
if (
|
2123
|
+
} else if (l === "object")
|
2124
|
+
if (m.isColor)
|
2258
2125
|
e.push({
|
2259
|
-
title:
|
2126
|
+
title: je(o),
|
2260
2127
|
prop: o,
|
2261
2128
|
type: "color",
|
2262
|
-
value:
|
2263
|
-
onChange: (
|
2264
|
-
const
|
2265
|
-
a.updateObject(n.uuid, `material.${
|
2129
|
+
value: m,
|
2130
|
+
onChange: (s, u) => {
|
2131
|
+
const p = new Ot(u);
|
2132
|
+
a.updateObject(n.uuid, `material.${s}`, p);
|
2266
2133
|
const v = a.scene?.getObjectByProperty("uuid", n.uuid);
|
2267
|
-
v !== void 0 && ee(v, `material.${
|
2134
|
+
v !== void 0 && ee(v, `material.${s}`, p);
|
2268
2135
|
}
|
2269
2136
|
});
|
2270
|
-
else if (Array.isArray(
|
2271
|
-
const
|
2272
|
-
for (const u in
|
2273
|
-
|
2137
|
+
else if (Array.isArray(m)) {
|
2138
|
+
const s = [];
|
2139
|
+
for (const u in m)
|
2140
|
+
s.push({
|
2274
2141
|
title: `${u}`,
|
2275
|
-
type: `${typeof
|
2276
|
-
value:
|
2277
|
-
onChange: (
|
2142
|
+
type: `${typeof m[u]}`,
|
2143
|
+
value: m[u],
|
2144
|
+
onChange: (p, v) => {
|
2278
2145
|
a.updateObject(n.uuid, `material.${o}`, v);
|
2279
2146
|
const b = a.scene?.getObjectByProperty("uuid", n.uuid);
|
2280
2147
|
b !== void 0 && ee(b, `material.${o}`, v);
|
2281
2148
|
}
|
2282
2149
|
});
|
2283
2150
|
e.push({
|
2284
|
-
title:
|
2285
|
-
items:
|
2151
|
+
title: je(o),
|
2152
|
+
items: s
|
2286
2153
|
});
|
2287
2154
|
} else {
|
2288
|
-
const
|
2289
|
-
for (const u in
|
2290
|
-
const
|
2291
|
-
switch (typeof
|
2155
|
+
const s = [];
|
2156
|
+
for (const u in m) {
|
2157
|
+
const p = m[u];
|
2158
|
+
switch (typeof p) {
|
2292
2159
|
case "boolean":
|
2293
2160
|
case "number":
|
2294
2161
|
case "string":
|
2295
2162
|
u === "src" ? e.push({
|
2296
|
-
title:
|
2163
|
+
title: je(o),
|
2297
2164
|
type: "image",
|
2298
|
-
value:
|
2165
|
+
value: p,
|
2299
2166
|
onChange: (b, E) => {
|
2300
2167
|
a.createTexture(n.uuid, `material.${o}`, E);
|
2301
2168
|
const x = a.scene?.getObjectByProperty("uuid", n.uuid);
|
2302
|
-
x !== void 0 &&
|
2169
|
+
x !== void 0 && $t(E).then((M) => {
|
2303
2170
|
ee(x, `material.${o}`, M), ee(x, "material.needsUpdate", !0);
|
2304
2171
|
});
|
2305
2172
|
}
|
2306
|
-
}) :
|
2307
|
-
title: `${
|
2173
|
+
}) : s.push({
|
2174
|
+
title: `${je(u)}`,
|
2308
2175
|
prop: `material.${o}.${u}`,
|
2309
2176
|
type: `${typeof t[o][u]}`,
|
2310
|
-
value:
|
2177
|
+
value: m[u],
|
2311
2178
|
onChange: (b, E) => {
|
2312
2179
|
a.updateObject(n.uuid, `material.${o}.${u}`, E);
|
2313
2180
|
const x = a.scene?.getObjectByProperty("uuid", n.uuid);
|
@@ -2316,21 +2183,21 @@ function en(t, n, a) {
|
|
2316
2183
|
});
|
2317
2184
|
break;
|
2318
2185
|
case "object":
|
2319
|
-
if (
|
2320
|
-
|
2321
|
-
title:
|
2186
|
+
if (p.value !== void 0 && p.value.src !== void 0)
|
2187
|
+
s.push({
|
2188
|
+
title: je(u),
|
2322
2189
|
type: "image",
|
2323
|
-
value:
|
2190
|
+
value: p.value.src,
|
2324
2191
|
onChange: (b, E) => {
|
2325
|
-
a.createTexture(n.uuid, `material.${o}.${u}.value`,
|
2192
|
+
a.createTexture(n.uuid, `material.${o}.${u}.value`, m);
|
2326
2193
|
const x = a.scene?.getObjectByProperty("uuid", n.uuid);
|
2327
|
-
x !== void 0 &&
|
2194
|
+
x !== void 0 && $t(E).then((M) => {
|
2328
2195
|
ee(x, `material.${o}.${u}.value`, M);
|
2329
2196
|
});
|
2330
2197
|
}
|
2331
2198
|
});
|
2332
2199
|
else if (o === "uniforms") {
|
2333
|
-
const b =
|
2200
|
+
const b = p.value, E = (x, M, P) => ({
|
2334
2201
|
title: x,
|
2335
2202
|
type: "number",
|
2336
2203
|
value: P,
|
@@ -2342,11 +2209,11 @@ function en(t, n, a) {
|
|
2342
2209
|
z !== void 0 && ee(z, w, B);
|
2343
2210
|
}
|
2344
2211
|
});
|
2345
|
-
if (typeof
|
2346
|
-
|
2212
|
+
if (typeof p.value == "number")
|
2213
|
+
s.push({
|
2347
2214
|
title: u,
|
2348
2215
|
type: "number",
|
2349
|
-
value:
|
2216
|
+
value: p.value,
|
2350
2217
|
onChange: (x, M) => {
|
2351
2218
|
const P = `material.${o}.${x}.value`;
|
2352
2219
|
a.updateObject(n.uuid, P, M);
|
@@ -2355,47 +2222,47 @@ function en(t, n, a) {
|
|
2355
2222
|
}
|
2356
2223
|
});
|
2357
2224
|
else if (b.r !== void 0 && b.g !== void 0 && b.b !== void 0)
|
2358
|
-
|
2225
|
+
s.push({
|
2359
2226
|
title: u,
|
2360
2227
|
type: "color",
|
2361
|
-
value:
|
2228
|
+
value: p.value,
|
2362
2229
|
onChange: (x, M) => {
|
2363
|
-
const P = new
|
2230
|
+
const P = new Ot(M), H = `material.${o}.${x}.value`;
|
2364
2231
|
a.updateObject(n.uuid, H, P);
|
2365
2232
|
const B = a.scene?.getObjectByProperty("uuid", n.uuid);
|
2366
2233
|
B !== void 0 && ee(B, H, P);
|
2367
2234
|
}
|
2368
2235
|
});
|
2369
2236
|
else if (b.x !== void 0 && b.y !== void 0 && b.z === void 0 && b.w === void 0)
|
2370
|
-
|
2237
|
+
s.push(
|
2371
2238
|
{
|
2372
2239
|
title: u,
|
2373
2240
|
items: [
|
2374
|
-
E("X", "x",
|
2375
|
-
E("Y", "y",
|
2241
|
+
E("X", "x", p.value.x),
|
2242
|
+
E("Y", "y", p.value.y)
|
2376
2243
|
]
|
2377
2244
|
}
|
2378
2245
|
);
|
2379
2246
|
else if (b.x !== void 0 && b.y !== void 0 && b.z !== void 0 && b.w === void 0)
|
2380
|
-
|
2247
|
+
s.push(
|
2381
2248
|
{
|
2382
2249
|
title: u,
|
2383
2250
|
items: [
|
2384
|
-
E("X", "x",
|
2385
|
-
E("Y", "y",
|
2386
|
-
E("Z", "z",
|
2251
|
+
E("X", "x", p.value.x),
|
2252
|
+
E("Y", "y", p.value.y),
|
2253
|
+
E("Z", "z", p.value.z)
|
2387
2254
|
]
|
2388
2255
|
}
|
2389
2256
|
);
|
2390
2257
|
else if (b.x !== void 0 && b.y !== void 0 && b.z !== void 0 && b.w !== void 0)
|
2391
|
-
|
2258
|
+
s.push(
|
2392
2259
|
{
|
2393
2260
|
title: u,
|
2394
2261
|
items: [
|
2395
|
-
E("X", "x",
|
2396
|
-
E("Y", "y",
|
2397
|
-
E("Z", "z",
|
2398
|
-
E("W", "w",
|
2262
|
+
E("X", "x", p.value.x),
|
2263
|
+
E("Y", "y", p.value.y),
|
2264
|
+
E("Z", "z", p.value.z),
|
2265
|
+
E("W", "w", p.value.w)
|
2399
2266
|
]
|
2400
2267
|
}
|
2401
2268
|
);
|
@@ -2403,7 +2270,7 @@ function en(t, n, a) {
|
|
2403
2270
|
const x = b.elements, M = [];
|
2404
2271
|
for (let P = 0; P < x.length; P++)
|
2405
2272
|
M.push(E(P.toString(), P.toString(), x[P]));
|
2406
|
-
|
2273
|
+
s.push(
|
2407
2274
|
{
|
2408
2275
|
title: u,
|
2409
2276
|
items: M
|
@@ -2412,10 +2279,10 @@ function en(t, n, a) {
|
|
2412
2279
|
} else
|
2413
2280
|
console.log(">>> need to add this format:", u, b);
|
2414
2281
|
} else
|
2415
|
-
|
2282
|
+
s.push({
|
2416
2283
|
title: u,
|
2417
|
-
type: `${typeof
|
2418
|
-
value:
|
2284
|
+
type: `${typeof p.value}`,
|
2285
|
+
value: p.value,
|
2419
2286
|
onChange: (b, E) => {
|
2420
2287
|
a.updateObject(n.uuid, `material.${o}.${u}.value`, E);
|
2421
2288
|
const x = a.scene?.getObjectByProperty("uuid", n.uuid);
|
@@ -2425,15 +2292,15 @@ function en(t, n, a) {
|
|
2425
2292
|
break;
|
2426
2293
|
}
|
2427
2294
|
}
|
2428
|
-
|
2429
|
-
title:
|
2430
|
-
items:
|
2295
|
+
s.length > 0 && e.push({
|
2296
|
+
title: je(o),
|
2297
|
+
items: s
|
2431
2298
|
});
|
2432
2299
|
}
|
2433
2300
|
else
|
2434
|
-
|
2301
|
+
m !== void 0 && console.log("other:", o, l, m);
|
2435
2302
|
}
|
2436
|
-
return e.sort((o,
|
2303
|
+
return e.sort((o, l) => o.title < l.title ? -1 : o.title > l.title ? 1 : 0), e.push({
|
2437
2304
|
title: "Update Material",
|
2438
2305
|
type: "button",
|
2439
2306
|
onChange: () => {
|
@@ -2441,44 +2308,44 @@ function en(t, n, a) {
|
|
2441
2308
|
}
|
2442
2309
|
}), e;
|
2443
2310
|
}
|
2444
|
-
function
|
2311
|
+
function ai(t, n) {
|
2445
2312
|
const a = t.material;
|
2446
2313
|
if (Array.isArray(a)) {
|
2447
2314
|
const e = [], o = a.length;
|
2448
|
-
for (let
|
2315
|
+
for (let l = 0; l < o; l++)
|
2449
2316
|
e.push(
|
2450
|
-
/* @__PURE__ */
|
2451
|
-
|
2317
|
+
/* @__PURE__ */ c.jsx(
|
2318
|
+
Fe,
|
2452
2319
|
{
|
2453
|
-
title: `Material ${
|
2454
|
-
items:
|
2320
|
+
title: `Material ${l}`,
|
2321
|
+
items: Jt(a[l], t, n)
|
2455
2322
|
},
|
2456
|
-
`Material ${
|
2323
|
+
`Material ${l}`
|
2457
2324
|
)
|
2458
2325
|
);
|
2459
|
-
return /* @__PURE__ */
|
2326
|
+
return /* @__PURE__ */ c.jsx(c.Fragment, { children: e });
|
2460
2327
|
} else
|
2461
|
-
return /* @__PURE__ */
|
2462
|
-
|
2328
|
+
return /* @__PURE__ */ c.jsx(
|
2329
|
+
Fe,
|
2463
2330
|
{
|
2464
2331
|
title: "Material",
|
2465
|
-
items:
|
2332
|
+
items: Jt(a, t, n)
|
2466
2333
|
}
|
2467
2334
|
);
|
2468
2335
|
}
|
2469
|
-
function
|
2336
|
+
function ot(t) {
|
2470
2337
|
let n = t.value;
|
2471
|
-
n !== void 0 && n.isColor !== void 0 && (n =
|
2472
|
-
const [a, e] = ae(n), o =
|
2473
|
-
|
2338
|
+
n !== void 0 && n.isColor !== void 0 && (n = Sa(t.value));
|
2339
|
+
const [a, e] = ae(n), o = ye(null), l = ye(null), m = ye(null);
|
2340
|
+
Se(() => {
|
2474
2341
|
let v = !1, b = -1, E = 0, x = Number(a);
|
2475
2342
|
const M = (z) => {
|
2476
2343
|
v = !0, E = x, b = z.clientX;
|
2477
2344
|
}, P = (z) => {
|
2478
2345
|
if (!v)
|
2479
2346
|
return;
|
2480
|
-
const
|
2481
|
-
x = Number((E +
|
2347
|
+
const Ee = t.step !== void 0 ? t.step : 1, ce = (z.clientX - b) * Ee;
|
2348
|
+
x = Number((E + ce).toFixed(4)), l.current !== null && (l.current.value = x.toString()), t.onChange !== void 0 && t.onChange(t.prop !== void 0 ? t.prop : t.title, x);
|
2482
2349
|
}, H = () => {
|
2483
2350
|
v = !1;
|
2484
2351
|
}, B = () => {
|
@@ -2488,57 +2355,57 @@ function ct(t) {
|
|
2488
2355
|
w && (o.current?.removeEventListener("mousedown", M), document.removeEventListener("mouseup", H), document.removeEventListener("mousemove", P), document.removeEventListener("contextmenu", B));
|
2489
2356
|
};
|
2490
2357
|
}, [a]);
|
2491
|
-
const
|
2492
|
-
`) > -1), u =
|
2358
|
+
const s = t.type === "string" && (a.length > 100 || a.search(`
|
2359
|
+
`) > -1), u = s || t.type === "image", p = (v) => {
|
2493
2360
|
let b = v.target.value;
|
2494
2361
|
t.type === "boolean" ? b = v.target.checked : t.type === "option" && (b = t.options[b].value), e(b), t.onChange !== void 0 && t.onChange(t.prop !== void 0 ? t.prop : t.title, b);
|
2495
2362
|
};
|
2496
|
-
return /* @__PURE__ */
|
2497
|
-
t.type !== "button" && /* @__PURE__ */
|
2498
|
-
t.type === "string" && !
|
2363
|
+
return /* @__PURE__ */ c.jsxs("div", { className: `field ${u ? "block" : ""}`, children: [
|
2364
|
+
t.type !== "button" && /* @__PURE__ */ c.jsx("label", { ref: o, children: st(t.title) }, "fieldLabel"),
|
2365
|
+
t.type === "string" && !s && /* @__PURE__ */ c.jsx(
|
2499
2366
|
"input",
|
2500
2367
|
{
|
2501
2368
|
type: "text",
|
2502
2369
|
disabled: t.disabled,
|
2503
|
-
onChange:
|
2370
|
+
onChange: p,
|
2504
2371
|
value: a
|
2505
2372
|
}
|
2506
2373
|
),
|
2507
|
-
t.type === "string" &&
|
2374
|
+
t.type === "string" && s && /* @__PURE__ */ c.jsx(
|
2508
2375
|
"textarea",
|
2509
2376
|
{
|
2510
2377
|
cols: 50,
|
2511
2378
|
rows: 10,
|
2512
2379
|
disabled: t.disabled !== void 0 ? t.disabled : !0,
|
2513
|
-
onChange:
|
2380
|
+
onChange: p,
|
2514
2381
|
value: a
|
2515
2382
|
}
|
2516
2383
|
),
|
2517
|
-
t.type === "boolean" && /* @__PURE__ */
|
2384
|
+
t.type === "boolean" && /* @__PURE__ */ c.jsx(
|
2518
2385
|
"input",
|
2519
2386
|
{
|
2520
2387
|
type: "checkbox",
|
2521
2388
|
disabled: t.disabled,
|
2522
|
-
onChange:
|
2389
|
+
onChange: p,
|
2523
2390
|
checked: a
|
2524
2391
|
}
|
2525
2392
|
),
|
2526
|
-
t.type === "number" && /* @__PURE__ */
|
2393
|
+
t.type === "number" && /* @__PURE__ */ c.jsx(
|
2527
2394
|
"input",
|
2528
2395
|
{
|
2529
|
-
ref:
|
2396
|
+
ref: l,
|
2530
2397
|
type: "number",
|
2531
2398
|
value: a,
|
2532
2399
|
min: t.min,
|
2533
2400
|
max: t.max,
|
2534
2401
|
step: t.step,
|
2535
2402
|
disabled: t.disabled,
|
2536
|
-
onChange:
|
2403
|
+
onChange: p
|
2537
2404
|
}
|
2538
2405
|
),
|
2539
|
-
t.type === "range" && /* @__PURE__ */
|
2540
|
-
/* @__PURE__ */
|
2541
|
-
/* @__PURE__ */
|
2406
|
+
t.type === "range" && /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
|
2407
|
+
/* @__PURE__ */ c.jsx("input", { type: "text", value: a.toString(), onChange: p, disabled: t.disabled, className: "min" }),
|
2408
|
+
/* @__PURE__ */ c.jsx(
|
2542
2409
|
"input",
|
2543
2410
|
{
|
2544
2411
|
disabled: t.disabled,
|
@@ -2547,15 +2414,15 @@ function ct(t) {
|
|
2547
2414
|
min: t.min,
|
2548
2415
|
max: t.max,
|
2549
2416
|
step: t.step,
|
2550
|
-
onChange:
|
2417
|
+
onChange: p
|
2551
2418
|
}
|
2552
2419
|
)
|
2553
2420
|
] }),
|
2554
|
-
t.type === "color" && /* @__PURE__ */
|
2555
|
-
/* @__PURE__ */
|
2556
|
-
/* @__PURE__ */
|
2421
|
+
t.type === "color" && /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
|
2422
|
+
/* @__PURE__ */ c.jsx("input", { type: "text", value: a.toString(), onChange: p, disabled: t.disabled, className: "color" }),
|
2423
|
+
/* @__PURE__ */ c.jsx("input", { type: "color", value: a, onChange: p, disabled: t.disabled })
|
2557
2424
|
] }),
|
2558
|
-
t.type === "button" && /* @__PURE__ */
|
2425
|
+
t.type === "button" && /* @__PURE__ */ c.jsx(
|
2559
2426
|
"button",
|
2560
2427
|
{
|
2561
2428
|
disabled: t.disabled,
|
@@ -2565,15 +2432,15 @@ function ct(t) {
|
|
2565
2432
|
children: t.title
|
2566
2433
|
}
|
2567
2434
|
),
|
2568
|
-
t.type === "image" && /* @__PURE__ */
|
2569
|
-
|
2570
|
-
|
2435
|
+
t.type === "image" && /* @__PURE__ */ c.jsx("img", { ref: m, onClick: () => {
|
2436
|
+
Za().then((v) => {
|
2437
|
+
m.current.src = v, t.onChange !== void 0 && t.onChange(t.prop !== void 0 ? t.prop : t.title, v);
|
2571
2438
|
});
|
2572
|
-
}, src: a.length > 0 ? a :
|
2573
|
-
t.type === "option" && /* @__PURE__ */
|
2439
|
+
}, src: a.length > 0 ? a : Wa }),
|
2440
|
+
t.type === "option" && /* @__PURE__ */ c.jsx(c.Fragment, { children: /* @__PURE__ */ c.jsx("select", { onChange: p, disabled: t.disabled, defaultValue: t.value, children: t.options?.map((v, b) => /* @__PURE__ */ c.jsx("option", { value: v.value, children: st(v.title) }, b)) }) })
|
2574
2441
|
] });
|
2575
2442
|
}
|
2576
|
-
function
|
2443
|
+
function Qt(t) {
|
2577
2444
|
switch (t) {
|
2578
2445
|
case "fov":
|
2579
2446
|
return "FOV";
|
@@ -2602,68 +2469,68 @@ function tn(t) {
|
|
2602
2469
|
}
|
2603
2470
|
return t;
|
2604
2471
|
}
|
2605
|
-
function
|
2472
|
+
function ii(t, n) {
|
2606
2473
|
const a = [];
|
2607
2474
|
if (t.perspectiveCameraInfo !== void 0)
|
2608
2475
|
for (const e in t.perspectiveCameraInfo)
|
2609
2476
|
a.push({
|
2610
|
-
title:
|
2477
|
+
title: Qt(e),
|
2611
2478
|
prop: e,
|
2612
2479
|
type: "number",
|
2613
2480
|
step: 0.01,
|
2614
2481
|
value: t.perspectiveCameraInfo[e],
|
2615
|
-
onChange: (o,
|
2616
|
-
n.updateObject(t.uuid, o,
|
2617
|
-
const
|
2618
|
-
|
2482
|
+
onChange: (o, l) => {
|
2483
|
+
n.updateObject(t.uuid, o, l), n.requestMethod(t.uuid, "updateProjectionMatrix");
|
2484
|
+
const m = n.scene?.getObjectByProperty("uuid", t.uuid);
|
2485
|
+
m !== void 0 && (ee(m, o, l), m.updateProjectionMatrix());
|
2619
2486
|
}
|
2620
2487
|
});
|
2621
2488
|
else if (t.orthographicCameraInfo !== void 0)
|
2622
2489
|
for (const e in t.orthographicCameraInfo)
|
2623
2490
|
a.push({
|
2624
|
-
title:
|
2491
|
+
title: Qt(e),
|
2625
2492
|
prop: e,
|
2626
2493
|
type: "number",
|
2627
2494
|
step: 0.01,
|
2628
2495
|
value: t.perspectiveCameraInfo[e],
|
2629
|
-
onChange: (o,
|
2630
|
-
n.updateObject(t.uuid, o,
|
2631
|
-
const
|
2632
|
-
|
2496
|
+
onChange: (o, l) => {
|
2497
|
+
n.updateObject(t.uuid, o, l), n.requestMethod(t.uuid, "updateProjectionMatrix");
|
2498
|
+
const m = n.scene?.getObjectByProperty("uuid", t.uuid);
|
2499
|
+
m !== void 0 && (ee(m, o, l), m.updateProjectionMatrix());
|
2633
2500
|
}
|
2634
2501
|
});
|
2635
|
-
return /* @__PURE__ */
|
2636
|
-
|
2502
|
+
return /* @__PURE__ */ c.jsx(
|
2503
|
+
Fe,
|
2637
2504
|
{
|
2638
2505
|
title: "Camera",
|
2639
2506
|
items: a
|
2640
2507
|
}
|
2641
2508
|
);
|
2642
2509
|
}
|
2643
|
-
const
|
2644
|
-
function
|
2510
|
+
const ri = Math.PI / 180, oi = 180 / Math.PI;
|
2511
|
+
function Xe(t, n, a, e, o) {
|
2645
2512
|
return e + (t - n) * (o - e) / (a - n);
|
2646
2513
|
}
|
2647
|
-
function
|
2648
|
-
return t *
|
2514
|
+
function si(t) {
|
2515
|
+
return t * ri;
|
2649
2516
|
}
|
2650
|
-
function
|
2651
|
-
return t *
|
2517
|
+
function Nt(t) {
|
2518
|
+
return t * oi;
|
2652
2519
|
}
|
2653
|
-
function
|
2654
|
-
const a = new
|
2520
|
+
function li(t, n) {
|
2521
|
+
const a = new sa();
|
2655
2522
|
a.elements = t.matrix;
|
2656
|
-
const e = new
|
2657
|
-
t.uuid.length > 0 && (e.setFromMatrixPosition(a), o.setFromRotationMatrix(a),
|
2658
|
-
const
|
2659
|
-
n.updateObject(t.uuid, u,
|
2523
|
+
const e = new q(), o = new la(), l = new q();
|
2524
|
+
t.uuid.length > 0 && (e.setFromMatrixPosition(a), o.setFromRotationMatrix(a), l.setFromMatrixScale(a));
|
2525
|
+
const m = (u, p) => {
|
2526
|
+
n.updateObject(t.uuid, u, p);
|
2660
2527
|
const v = n.scene?.getObjectByProperty("uuid", t.uuid);
|
2661
|
-
v !== void 0 && ee(v, u,
|
2662
|
-
},
|
2663
|
-
|
2528
|
+
v !== void 0 && ee(v, u, p);
|
2529
|
+
}, s = (u, p) => {
|
2530
|
+
m(u, si(p));
|
2664
2531
|
};
|
2665
|
-
return /* @__PURE__ */
|
2666
|
-
|
2532
|
+
return /* @__PURE__ */ c.jsx(
|
2533
|
+
Fe,
|
2667
2534
|
{
|
2668
2535
|
title: "Transform",
|
2669
2536
|
items: [
|
@@ -2672,81 +2539,81 @@ function fi(t, n) {
|
|
2672
2539
|
prop: "position.x",
|
2673
2540
|
type: "number",
|
2674
2541
|
value: e.x,
|
2675
|
-
onChange:
|
2542
|
+
onChange: m
|
2676
2543
|
},
|
2677
2544
|
{
|
2678
2545
|
title: "Position Y",
|
2679
2546
|
prop: "position.y",
|
2680
2547
|
type: "number",
|
2681
2548
|
value: e.y,
|
2682
|
-
onChange:
|
2549
|
+
onChange: m
|
2683
2550
|
},
|
2684
2551
|
{
|
2685
2552
|
title: "Position Z",
|
2686
2553
|
prop: "position.z",
|
2687
2554
|
type: "number",
|
2688
2555
|
value: e.z,
|
2689
|
-
onChange:
|
2556
|
+
onChange: m
|
2690
2557
|
},
|
2691
2558
|
{
|
2692
2559
|
title: "Rotation X",
|
2693
2560
|
prop: "rotation.x",
|
2694
2561
|
type: "number",
|
2695
|
-
value:
|
2562
|
+
value: It(Nt(o.x)),
|
2696
2563
|
min: -360,
|
2697
2564
|
max: 360,
|
2698
2565
|
step: 0.1,
|
2699
|
-
onChange:
|
2566
|
+
onChange: s
|
2700
2567
|
},
|
2701
2568
|
{
|
2702
2569
|
title: "Rotation Y",
|
2703
2570
|
prop: "rotation.y",
|
2704
2571
|
type: "number",
|
2705
|
-
value:
|
2572
|
+
value: It(Nt(o.y)),
|
2706
2573
|
min: -360,
|
2707
2574
|
max: 360,
|
2708
2575
|
step: 0.1,
|
2709
|
-
onChange:
|
2576
|
+
onChange: s
|
2710
2577
|
},
|
2711
2578
|
{
|
2712
2579
|
title: "Rotation Z",
|
2713
2580
|
prop: "rotation.z",
|
2714
2581
|
type: "number",
|
2715
|
-
value:
|
2582
|
+
value: It(Nt(o.z)),
|
2716
2583
|
min: -360,
|
2717
2584
|
max: 360,
|
2718
2585
|
step: 0.1,
|
2719
|
-
onChange:
|
2586
|
+
onChange: s
|
2720
2587
|
},
|
2721
2588
|
{
|
2722
2589
|
title: "Scale X",
|
2723
2590
|
prop: "scale.x",
|
2724
2591
|
type: "number",
|
2725
|
-
value:
|
2592
|
+
value: l.x,
|
2726
2593
|
step: 0.01,
|
2727
|
-
onChange:
|
2594
|
+
onChange: m
|
2728
2595
|
},
|
2729
2596
|
{
|
2730
2597
|
title: "Scale Y",
|
2731
2598
|
prop: "scale.y",
|
2732
2599
|
type: "number",
|
2733
|
-
value:
|
2600
|
+
value: l.y,
|
2734
2601
|
step: 0.01,
|
2735
|
-
onChange:
|
2602
|
+
onChange: m
|
2736
2603
|
},
|
2737
2604
|
{
|
2738
2605
|
title: "Scale Z",
|
2739
2606
|
prop: "scale.z",
|
2740
2607
|
type: "number",
|
2741
|
-
value:
|
2608
|
+
value: l.z,
|
2742
2609
|
step: 0.01,
|
2743
|
-
onChange:
|
2610
|
+
onChange: m
|
2744
2611
|
}
|
2745
2612
|
]
|
2746
2613
|
}
|
2747
2614
|
);
|
2748
2615
|
}
|
2749
|
-
function
|
2616
|
+
function en(t) {
|
2750
2617
|
switch (t) {
|
2751
2618
|
case "color":
|
2752
2619
|
return "Color";
|
@@ -2765,54 +2632,54 @@ function nn(t) {
|
|
2765
2632
|
}
|
2766
2633
|
return t;
|
2767
2634
|
}
|
2768
|
-
function
|
2635
|
+
function ci(t, n) {
|
2769
2636
|
const a = [];
|
2770
2637
|
if (t.lightInfo !== void 0)
|
2771
2638
|
for (const e in t.lightInfo) {
|
2772
2639
|
const o = t.lightInfo[e];
|
2773
2640
|
o !== void 0 && (o.isColor !== void 0 ? a.push({
|
2774
|
-
title:
|
2641
|
+
title: en(e),
|
2775
2642
|
prop: e,
|
2776
2643
|
type: "color",
|
2777
2644
|
value: o,
|
2778
|
-
onChange: (
|
2779
|
-
const
|
2780
|
-
n.updateObject(t.uuid,
|
2645
|
+
onChange: (l, m) => {
|
2646
|
+
const s = new Ot(m);
|
2647
|
+
n.updateObject(t.uuid, l, s);
|
2781
2648
|
const u = n.scene?.getObjectByProperty("uuid", t.uuid);
|
2782
|
-
u !== void 0 && ee(u,
|
2649
|
+
u !== void 0 && ee(u, l, s);
|
2783
2650
|
}
|
2784
2651
|
}) : a.push({
|
2785
|
-
title:
|
2652
|
+
title: en(e),
|
2786
2653
|
prop: e,
|
2787
2654
|
type: typeof o,
|
2788
2655
|
value: o,
|
2789
2656
|
step: typeof o == "number" ? 0.01 : void 0,
|
2790
|
-
onChange: (
|
2791
|
-
n.updateObject(t.uuid,
|
2792
|
-
const
|
2793
|
-
|
2657
|
+
onChange: (l, m) => {
|
2658
|
+
n.updateObject(t.uuid, l, m);
|
2659
|
+
const s = n.scene?.getObjectByProperty("uuid", t.uuid);
|
2660
|
+
s !== void 0 && ee(s, l, m);
|
2794
2661
|
}
|
2795
2662
|
}));
|
2796
2663
|
}
|
2797
|
-
return /* @__PURE__ */
|
2798
|
-
|
2664
|
+
return /* @__PURE__ */ c.jsx(
|
2665
|
+
Fe,
|
2799
2666
|
{
|
2800
2667
|
title: "Light",
|
2801
2668
|
items: a
|
2802
2669
|
}
|
2803
2670
|
);
|
2804
2671
|
}
|
2805
|
-
function
|
2672
|
+
function ui(t, n) {
|
2806
2673
|
const a = [], e = [];
|
2807
2674
|
let o = 0;
|
2808
|
-
t.animations.forEach((
|
2809
|
-
o = Math.max(o,
|
2810
|
-
title:
|
2675
|
+
t.animations.forEach((s) => {
|
2676
|
+
o = Math.max(o, s.duration), s.duration > 0 && e.push({
|
2677
|
+
title: s.name,
|
2811
2678
|
items: [
|
2812
2679
|
{
|
2813
2680
|
title: "Duration",
|
2814
2681
|
type: "number",
|
2815
|
-
value:
|
2682
|
+
value: s.duration,
|
2816
2683
|
disabled: !0
|
2817
2684
|
},
|
2818
2685
|
{
|
@@ -2836,21 +2703,21 @@ function mi(t, n) {
|
|
2836
2703
|
title: "Animations",
|
2837
2704
|
items: e
|
2838
2705
|
});
|
2839
|
-
const
|
2840
|
-
let
|
2841
|
-
if (
|
2842
|
-
const
|
2843
|
-
if (
|
2706
|
+
const l = n.scene?.getObjectByProperty("uuid", t.uuid);
|
2707
|
+
let m = !1;
|
2708
|
+
if (l !== void 0) {
|
2709
|
+
const s = l.mixer;
|
2710
|
+
if (m = s !== void 0, m) {
|
2844
2711
|
const u = [
|
2845
2712
|
{
|
2846
2713
|
title: "Time Scale",
|
2847
2714
|
type: "range",
|
2848
|
-
value:
|
2715
|
+
value: s.timeScale,
|
2849
2716
|
step: 0.01,
|
2850
2717
|
min: -1,
|
2851
2718
|
max: 2,
|
2852
|
-
onChange: (
|
2853
|
-
|
2719
|
+
onChange: (p, v) => {
|
2720
|
+
s.timeScale = v, n.updateObject(t.uuid, "mixer.timeScale", v);
|
2854
2721
|
}
|
2855
2722
|
}
|
2856
2723
|
];
|
@@ -2858,7 +2725,7 @@ function mi(t, n) {
|
|
2858
2725
|
title: "Stop All",
|
2859
2726
|
type: "button",
|
2860
2727
|
onChange: () => {
|
2861
|
-
|
2728
|
+
s.stopAllAction(), n.requestMethod(t.uuid, "stopAllAction", void 0, "mixer");
|
2862
2729
|
}
|
2863
2730
|
}), a.push({
|
2864
2731
|
title: "Mixer",
|
@@ -2866,9 +2733,9 @@ function mi(t, n) {
|
|
2866
2733
|
});
|
2867
2734
|
}
|
2868
2735
|
}
|
2869
|
-
return /* @__PURE__ */
|
2736
|
+
return /* @__PURE__ */ c.jsx(Fe, { title: "Animation", items: a });
|
2870
2737
|
}
|
2871
|
-
const
|
2738
|
+
const Ln = {
|
2872
2739
|
name: "",
|
2873
2740
|
uuid: "",
|
2874
2741
|
type: "",
|
@@ -2880,25 +2747,25 @@ const Bn = {
|
|
2880
2747
|
orthographicCameraInfo: void 0,
|
2881
2748
|
lightInfo: void 0
|
2882
2749
|
};
|
2883
|
-
let te = { ...
|
2884
|
-
function
|
2750
|
+
let te = { ...Ln };
|
2751
|
+
function di(t) {
|
2885
2752
|
const [n, a] = ae(-1);
|
2886
|
-
|
2887
|
-
function
|
2753
|
+
Se(() => {
|
2754
|
+
function m(u) {
|
2888
2755
|
te = { ...u.value }, a(Date.now());
|
2889
2756
|
}
|
2890
|
-
function
|
2891
|
-
te = { ...
|
2757
|
+
function s() {
|
2758
|
+
te = { ...Ln }, a(Date.now());
|
2892
2759
|
}
|
2893
|
-
return k.addEventListener(
|
2894
|
-
k.removeEventListener(
|
2760
|
+
return k.addEventListener(D.SET_SCENE, s), k.addEventListener(D.SET_OBJECT, m), () => {
|
2761
|
+
k.removeEventListener(D.SET_SCENE, s), k.removeEventListener(D.SET_OBJECT, m);
|
2895
2762
|
};
|
2896
2763
|
}, []);
|
2897
|
-
const e = te.type.toLowerCase(), o = te.animations.length > 0 || te.mixer !== void 0,
|
2898
|
-
return /* @__PURE__ */
|
2899
|
-
/* @__PURE__ */
|
2900
|
-
/* @__PURE__ */
|
2901
|
-
|
2764
|
+
const e = te.type.toLowerCase(), o = te.animations.length > 0 || te.mixer !== void 0, l = e.search("mesh") > -1 || e.search("line") > -1 || e.search("points") > -1;
|
2765
|
+
return /* @__PURE__ */ c.jsx(Gt, { label: "Inspector", children: /* @__PURE__ */ c.jsx("div", { id: "Inspector", className: t.class, children: te.uuid.length > 0 && /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
|
2766
|
+
/* @__PURE__ */ c.jsxs(c.Fragment, { children: [
|
2767
|
+
/* @__PURE__ */ c.jsx(
|
2768
|
+
ot,
|
2902
2769
|
{
|
2903
2770
|
type: "string",
|
2904
2771
|
title: "Name",
|
@@ -2907,8 +2774,8 @@ function vi(t) {
|
|
2907
2774
|
disabled: !0
|
2908
2775
|
}
|
2909
2776
|
),
|
2910
|
-
/* @__PURE__ */
|
2911
|
-
|
2777
|
+
/* @__PURE__ */ c.jsx(
|
2778
|
+
ot,
|
2912
2779
|
{
|
2913
2780
|
type: "string",
|
2914
2781
|
title: "Type",
|
@@ -2917,8 +2784,8 @@ function vi(t) {
|
|
2917
2784
|
disabled: !0
|
2918
2785
|
}
|
2919
2786
|
),
|
2920
|
-
/* @__PURE__ */
|
2921
|
-
|
2787
|
+
/* @__PURE__ */ c.jsx(
|
2788
|
+
ot,
|
2922
2789
|
{
|
2923
2790
|
type: "string",
|
2924
2791
|
title: "UUID",
|
@@ -2927,94 +2794,94 @@ function vi(t) {
|
|
2927
2794
|
disabled: !0
|
2928
2795
|
}
|
2929
2796
|
),
|
2930
|
-
/* @__PURE__ */
|
2931
|
-
|
2797
|
+
/* @__PURE__ */ c.jsx(
|
2798
|
+
ot,
|
2932
2799
|
{
|
2933
2800
|
type: "boolean",
|
2934
2801
|
title: "Visible",
|
2935
2802
|
prop: "visible",
|
2936
2803
|
value: te.visible,
|
2937
|
-
onChange: (
|
2938
|
-
t.three.updateObject(te.uuid,
|
2804
|
+
onChange: (m, s) => {
|
2805
|
+
t.three.updateObject(te.uuid, m, s);
|
2939
2806
|
const u = t.three.scene?.getObjectByProperty("uuid", te.uuid);
|
2940
|
-
u !== void 0 && ee(u,
|
2807
|
+
u !== void 0 && ee(u, m, s);
|
2941
2808
|
}
|
2942
2809
|
}
|
2943
2810
|
)
|
2944
2811
|
] }),
|
2945
|
-
/* @__PURE__ */
|
2946
|
-
|
2947
|
-
o ?
|
2948
|
-
e.search("camera") > -1 ?
|
2949
|
-
e.search("light") > -1 ?
|
2950
|
-
|
2812
|
+
/* @__PURE__ */ c.jsxs(c.Fragment, { children: [
|
2813
|
+
li(te, t.three),
|
2814
|
+
o ? ui(te, t.three) : null,
|
2815
|
+
e.search("camera") > -1 ? ii(te, t.three) : null,
|
2816
|
+
e.search("light") > -1 ? ci(te, t.three) : null,
|
2817
|
+
l ? ai(te, t.three) : null
|
2951
2818
|
] })
|
2952
2819
|
] }) }, n) }, "Inspector");
|
2953
2820
|
}
|
2954
|
-
function
|
2821
|
+
function Ii(t) {
|
2955
2822
|
const [n, a] = ae(t.scene);
|
2956
|
-
|
2957
|
-
const
|
2958
|
-
a(
|
2823
|
+
Se(() => {
|
2824
|
+
const l = (m) => {
|
2825
|
+
a(m.value);
|
2959
2826
|
};
|
2960
|
-
return k.addEventListener(
|
2961
|
-
k.removeEventListener(
|
2827
|
+
return k.addEventListener(D.SET_SCENE, l), () => {
|
2828
|
+
k.removeEventListener(D.SET_SCENE, l);
|
2962
2829
|
};
|
2963
2830
|
}, []);
|
2964
2831
|
const e = n !== null, o = "Hierarchy - " + (e ? `${n?.name}` : "No Scene");
|
2965
|
-
return /* @__PURE__ */
|
2966
|
-
/* @__PURE__ */
|
2967
|
-
/* @__PURE__ */
|
2832
|
+
return /* @__PURE__ */ c.jsxs("div", { id: "SidePanel", children: [
|
2833
|
+
/* @__PURE__ */ c.jsx(Gt, { label: o, open: !0, children: /* @__PURE__ */ c.jsx(c.Fragment, { children: e && /* @__PURE__ */ c.jsx(Ha, { child: n, three: t.three }) }) }),
|
2834
|
+
/* @__PURE__ */ c.jsx(di, { three: t.three })
|
2968
2835
|
] }, "SidePanel");
|
2969
2836
|
}
|
2970
|
-
function
|
2837
|
+
function Li(t) {
|
2971
2838
|
function n() {
|
2972
2839
|
return t.three.scene === void 0 ? (console.log("No scene:", t.three), !1) : !0;
|
2973
2840
|
}
|
2974
|
-
const a = (
|
2841
|
+
const a = (s) => {
|
2975
2842
|
if (!n())
|
2976
2843
|
return;
|
2977
|
-
const u = t.three.scene?.getObjectByProperty("uuid",
|
2844
|
+
const u = t.three.scene?.getObjectByProperty("uuid", s.value);
|
2978
2845
|
u !== void 0 && t.three.setObject(u);
|
2979
|
-
}, e = (
|
2846
|
+
}, e = (s, u, p) => {
|
2980
2847
|
if (!n())
|
2981
2848
|
return;
|
2982
|
-
const v = t.three.scene?.getObjectByProperty("uuid",
|
2983
|
-
v !== void 0 && ee(v, u,
|
2984
|
-
}, o = (
|
2849
|
+
const v = t.three.scene?.getObjectByProperty("uuid", s);
|
2850
|
+
v !== void 0 && ee(v, u, p);
|
2851
|
+
}, o = (s) => {
|
2985
2852
|
if (!n())
|
2986
2853
|
return;
|
2987
|
-
const u =
|
2988
|
-
e(b,
|
2989
|
-
},
|
2854
|
+
const u = s.value, { key: p, value: v, uuid: b } = u;
|
2855
|
+
e(b, p, v);
|
2856
|
+
}, l = (s) => {
|
2990
2857
|
if (!n())
|
2991
2858
|
return;
|
2992
|
-
const u =
|
2993
|
-
|
2994
|
-
e(u.uuid, u.key,
|
2859
|
+
const u = s.value;
|
2860
|
+
$t(u.value).then((p) => {
|
2861
|
+
e(u.uuid, u.key, p), e(u.uuid, "material.needsUpdate", !0);
|
2995
2862
|
});
|
2996
|
-
},
|
2863
|
+
}, m = (s) => {
|
2997
2864
|
if (!n())
|
2998
2865
|
return;
|
2999
|
-
const { key: u, uuid:
|
2866
|
+
const { key: u, uuid: p, value: v, subitem: b } = s.value, E = t.three.scene?.getObjectByProperty("uuid", p);
|
3000
2867
|
if (E !== void 0)
|
3001
2868
|
try {
|
3002
|
-
b !== void 0 ?
|
2869
|
+
b !== void 0 ? Aa(E, b)[u](v) : E[u](v);
|
3003
2870
|
} catch (x) {
|
3004
2871
|
console.log("Error requesting method:"), console.log(x), console.log(u), console.log(v);
|
3005
2872
|
}
|
3006
2873
|
};
|
3007
|
-
return
|
3008
|
-
k.removeEventListener(
|
2874
|
+
return Se(() => (k.addEventListener(D.GET_OBJECT, a), k.addEventListener(D.UPDATE_OBJECT, o), k.addEventListener(D.CREATE_TEXTURE, l), k.addEventListener(D.REQUEST_METHOD, m), () => {
|
2875
|
+
k.removeEventListener(D.GET_OBJECT, a), k.removeEventListener(D.UPDATE_OBJECT, o), k.removeEventListener(D.CREATE_TEXTURE, l), k.removeEventListener(D.REQUEST_METHOD, m);
|
3009
2876
|
}), []), null;
|
3010
2877
|
}
|
3011
|
-
const
|
3012
|
-
class
|
2878
|
+
const tn = { type: "change" }, Ft = { type: "start" }, nn = { type: "end" }, Ct = new ca(), an = new ua(), fi = Math.cos(70 * da.DEG2RAD);
|
2879
|
+
class pi extends ln {
|
3013
2880
|
constructor(n, a) {
|
3014
|
-
super(), this.object = n, this.domElement = a, this.domElement.style.touchAction = "none", this.enabled = !0, this.target = new
|
3015
|
-
return
|
2881
|
+
super(), this.object = n, this.domElement = a, this.domElement.style.touchAction = "none", this.enabled = !0, this.target = new q(), this.cursor = new q(), 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: Ge.ROTATE, MIDDLE: Ge.DOLLY, RIGHT: Ge.PAN }, this.touches = { ONE: Ve.ROTATE, TWO: Ve.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this.getPolarAngle = function() {
|
2882
|
+
return s.phi;
|
3016
2883
|
}, this.getAzimuthalAngle = function() {
|
3017
|
-
return
|
2884
|
+
return s.theta;
|
3018
2885
|
}, this.getDistance = function() {
|
3019
2886
|
return this.object.position.distanceTo(this.target);
|
3020
2887
|
}, this.listenToKeyEvents = function(r) {
|
@@ -3024,36 +2891,36 @@ class bi extends un {
|
|
3024
2891
|
}, this.saveState = function() {
|
3025
2892
|
e.target0.copy(e.target), e.position0.copy(e.object.position), e.zoom0 = e.object.zoom;
|
3026
2893
|
}, this.reset = function() {
|
3027
|
-
e.target.copy(e.target0), e.object.position.copy(e.position0), e.object.zoom = e.zoom0, e.object.updateProjectionMatrix(), e.dispatchEvent(
|
2894
|
+
e.target.copy(e.target0), e.object.position.copy(e.position0), e.object.zoom = e.zoom0, e.object.updateProjectionMatrix(), e.dispatchEvent(tn), e.update(), l = o.NONE;
|
3028
2895
|
}, this.update = function() {
|
3029
|
-
const r = new
|
3030
|
-
return function(
|
2896
|
+
const r = new q(), y = new Xt().setFromUnitVectors(n.up, new q(0, 1, 0)), O = y.clone().invert(), L = new q(), K = new Xt(), de = new q(), ie = 2 * Math.PI;
|
2897
|
+
return function(jt = null) {
|
3031
2898
|
const nt = e.object.position;
|
3032
|
-
r.copy(nt).sub(e.target), r.applyQuaternion(y),
|
3033
|
-
let
|
3034
|
-
isFinite(
|
3035
|
-
let
|
2899
|
+
r.copy(nt).sub(e.target), r.applyQuaternion(y), s.setFromVector3(r), e.autoRotate && l === o.NONE && U(_(jt)), e.enableDamping ? (s.theta += u.theta * e.dampingFactor, s.phi += u.phi * e.dampingFactor) : (s.theta += u.theta, s.phi += u.phi);
|
2900
|
+
let he = e.minAzimuthAngle, fe = e.maxAzimuthAngle;
|
2901
|
+
isFinite(he) && isFinite(fe) && (he < -Math.PI ? he += ie : he > Math.PI && (he -= ie), fe < -Math.PI ? fe += ie : fe > Math.PI && (fe -= ie), he <= fe ? s.theta = Math.max(he, Math.min(fe, s.theta)) : s.theta = s.theta > (he + fe) / 2 ? Math.max(he, s.theta) : Math.min(fe, s.theta)), s.phi = Math.max(e.minPolarAngle, Math.min(e.maxPolarAngle, s.phi)), s.makeSafe(), e.enableDamping === !0 ? e.target.addScaledVector(v, e.dampingFactor) : e.target.add(v), e.target.sub(e.cursor), e.target.clampLength(e.minTargetRadius, e.maxTargetRadius), e.target.add(e.cursor), e.zoomToCursor && se || e.object.isOrthographicCamera ? s.radius = me(s.radius) : s.radius = me(s.radius * p), r.setFromSpherical(s), r.applyQuaternion(O), nt.copy(e.target).add(r), e.object.lookAt(e.target), e.enableDamping === !0 ? (u.theta *= 1 - e.dampingFactor, u.phi *= 1 - e.dampingFactor, v.multiplyScalar(1 - e.dampingFactor)) : (u.set(0, 0, 0), v.set(0, 0, 0));
|
2902
|
+
let Ae = !1;
|
3036
2903
|
if (e.zoomToCursor && se) {
|
3037
|
-
let
|
2904
|
+
let Pe = null;
|
3038
2905
|
if (e.object.isPerspectiveCamera) {
|
3039
|
-
const
|
3040
|
-
|
3041
|
-
const De =
|
3042
|
-
e.object.position.addScaledVector(
|
2906
|
+
const ke = r.length();
|
2907
|
+
Pe = me(ke * p);
|
2908
|
+
const De = ke - Pe;
|
2909
|
+
e.object.position.addScaledVector(Ee, De), e.object.updateMatrixWorld();
|
3043
2910
|
} else if (e.object.isOrthographicCamera) {
|
3044
|
-
const
|
3045
|
-
|
3046
|
-
const De = new
|
3047
|
-
De.unproject(e.object), e.object.position.sub(De).add(
|
2911
|
+
const ke = new q(ce.x, ce.y, 0);
|
2912
|
+
ke.unproject(e.object), e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom / p)), e.object.updateProjectionMatrix(), Ae = !0;
|
2913
|
+
const De = new q(ce.x, ce.y, 0);
|
2914
|
+
De.unproject(e.object), e.object.position.sub(De).add(ke), e.object.updateMatrixWorld(), Pe = r.length();
|
3048
2915
|
} else
|
3049
2916
|
console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), e.zoomToCursor = !1;
|
3050
|
-
|
2917
|
+
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)) < fi ? n.lookAt(e.target) : (an.setFromNormalAndCoplanarPoint(e.object.up, e.target), Ct.intersectPlane(an, e.target))));
|
3051
2918
|
} else
|
3052
|
-
e.object.isOrthographicCamera && (
|
3053
|
-
return
|
2919
|
+
e.object.isOrthographicCamera && (Ae = p !== 1, Ae && (e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom / p)), e.object.updateProjectionMatrix()));
|
2920
|
+
return p = 1, se = !1, Ae || L.distanceToSquared(e.object.position) > m || 8 * (1 - K.dot(e.object.quaternion)) > m || de.distanceToSquared(e.target) > 0 ? (e.dispatchEvent(tn), L.copy(e.object.position), K.copy(e.object.quaternion), de.copy(e.target), !0) : !1;
|
3054
2921
|
};
|
3055
2922
|
}(), this.dispose = function() {
|
3056
|
-
e.domElement.removeEventListener("contextmenu",
|
2923
|
+
e.domElement.removeEventListener("contextmenu", ze), e.domElement.removeEventListener("pointerdown", Re), e.domElement.removeEventListener("pointercancel", _e), e.domElement.removeEventListener("wheel", vt), e.domElement.removeEventListener("pointermove", Je), e.domElement.removeEventListener("pointerup", _e), e._domElementKeyEvents !== null && (e._domElementKeyEvents.removeEventListener("keydown", et), e._domElementKeyEvents = null);
|
3057
2924
|
};
|
3058
2925
|
const e = this, o = {
|
3059
2926
|
NONE: -1,
|
@@ -3065,12 +2932,12 @@ class bi extends un {
|
|
3065
2932
|
TOUCH_DOLLY_PAN: 5,
|
3066
2933
|
TOUCH_DOLLY_ROTATE: 6
|
3067
2934
|
};
|
3068
|
-
let
|
3069
|
-
const
|
3070
|
-
let
|
3071
|
-
const v = new
|
2935
|
+
let l = o.NONE;
|
2936
|
+
const m = 1e-6, s = new Kt(), u = new Kt();
|
2937
|
+
let p = 1;
|
2938
|
+
const v = new q(), b = new ue(), E = new ue(), x = new ue(), M = new ue(), P = new ue(), H = new ue(), B = new ue(), w = new ue(), z = new ue(), Ee = new q(), ce = new ue();
|
3072
2939
|
let se = !1;
|
3073
|
-
const d = [],
|
2940
|
+
const d = [], h = {};
|
3074
2941
|
let S = !1;
|
3075
2942
|
function _(r) {
|
3076
2943
|
return r !== null ? 2 * Math.PI / 60 * e.autoRotateSpeed * r : 2 * Math.PI / 60 / 60 * e.autoRotateSpeed;
|
@@ -3086,17 +2953,17 @@ class bi extends un {
|
|
3086
2953
|
u.phi -= r;
|
3087
2954
|
}
|
3088
2955
|
const I = function() {
|
3089
|
-
const r = new
|
2956
|
+
const r = new q();
|
3090
2957
|
return function(O, L) {
|
3091
2958
|
r.setFromMatrixColumn(L, 0), r.multiplyScalar(-O), v.add(r);
|
3092
2959
|
};
|
3093
2960
|
}(), W = function() {
|
3094
|
-
const r = new
|
2961
|
+
const r = new q();
|
3095
2962
|
return function(O, L) {
|
3096
2963
|
e.screenSpacePanning === !0 ? r.setFromMatrixColumn(L, 1) : (r.setFromMatrixColumn(L, 0), r.crossVectors(e.object.up, r)), r.multiplyScalar(O), v.add(r);
|
3097
2964
|
};
|
3098
|
-
}(),
|
3099
|
-
const r = new
|
2965
|
+
}(), X = function() {
|
2966
|
+
const r = new q();
|
3100
2967
|
return function(O, L) {
|
3101
2968
|
const K = e.domElement;
|
3102
2969
|
if (e.object.isPerspectiveCamera) {
|
@@ -3109,133 +2976,133 @@ class bi extends un {
|
|
3109
2976
|
};
|
3110
2977
|
}();
|
3111
2978
|
function T(r) {
|
3112
|
-
e.object.isPerspectiveCamera || e.object.isOrthographicCamera ?
|
2979
|
+
e.object.isPerspectiveCamera || e.object.isOrthographicCamera ? p /= r : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), e.enableZoom = !1);
|
3113
2980
|
}
|
3114
2981
|
function N(r) {
|
3115
|
-
e.object.isPerspectiveCamera || e.object.isOrthographicCamera ?
|
2982
|
+
e.object.isPerspectiveCamera || e.object.isOrthographicCamera ? p *= r : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), e.enableZoom = !1);
|
3116
2983
|
}
|
3117
2984
|
function J(r, y) {
|
3118
2985
|
if (!e.zoomToCursor)
|
3119
2986
|
return;
|
3120
2987
|
se = !0;
|
3121
2988
|
const O = e.domElement.getBoundingClientRect(), L = r - O.left, K = y - O.top, de = O.width, ie = O.height;
|
3122
|
-
|
2989
|
+
ce.x = L / de * 2 - 1, ce.y = -(K / ie) * 2 + 1, Ee.set(ce.x, ce.y, 1).unproject(e.object).sub(e.object.position).normalize();
|
3123
2990
|
}
|
3124
2991
|
function me(r) {
|
3125
2992
|
return Math.max(e.minDistance, Math.min(e.maxDistance, r));
|
3126
2993
|
}
|
3127
|
-
function
|
2994
|
+
function Ce(r) {
|
3128
2995
|
b.set(r.clientX, r.clientY);
|
3129
2996
|
}
|
3130
|
-
function
|
2997
|
+
function ut(r) {
|
3131
2998
|
J(r.clientX, r.clientX), B.set(r.clientX, r.clientY);
|
3132
2999
|
}
|
3133
3000
|
function Ke(r) {
|
3134
3001
|
M.set(r.clientX, r.clientY);
|
3135
3002
|
}
|
3136
|
-
function
|
3003
|
+
function Tt(r) {
|
3137
3004
|
E.set(r.clientX, r.clientY), x.subVectors(E, b).multiplyScalar(e.rotateSpeed);
|
3138
3005
|
const y = e.domElement;
|
3139
3006
|
U(2 * Math.PI * x.x / y.clientHeight), $(2 * Math.PI * x.y / y.clientHeight), b.copy(E), e.update();
|
3140
3007
|
}
|
3141
|
-
function
|
3008
|
+
function Rt(r) {
|
3142
3009
|
w.set(r.clientX, r.clientY), z.subVectors(w, B), z.y > 0 ? T(Y(z.y)) : z.y < 0 && N(Y(z.y)), B.copy(w), e.update();
|
3143
3010
|
}
|
3144
|
-
function
|
3145
|
-
P.set(r.clientX, r.clientY), H.subVectors(P, M).multiplyScalar(e.panSpeed),
|
3011
|
+
function qe(r) {
|
3012
|
+
P.set(r.clientX, r.clientY), H.subVectors(P, M).multiplyScalar(e.panSpeed), X(H.x, H.y), M.copy(P), e.update();
|
3146
3013
|
}
|
3147
3014
|
function Ze(r) {
|
3148
3015
|
J(r.clientX, r.clientY), r.deltaY < 0 ? N(Y(r.deltaY)) : r.deltaY > 0 && T(Y(r.deltaY)), e.update();
|
3149
3016
|
}
|
3150
|
-
function
|
3017
|
+
function Ue(r) {
|
3151
3018
|
let y = !1;
|
3152
3019
|
switch (r.code) {
|
3153
3020
|
case e.keys.UP:
|
3154
|
-
r.ctrlKey || r.metaKey || r.shiftKey ? $(2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) :
|
3021
|
+
r.ctrlKey || r.metaKey || r.shiftKey ? $(2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : X(0, e.keyPanSpeed), y = !0;
|
3155
3022
|
break;
|
3156
3023
|
case e.keys.BOTTOM:
|
3157
|
-
r.ctrlKey || r.metaKey || r.shiftKey ? $(-2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) :
|
3024
|
+
r.ctrlKey || r.metaKey || r.shiftKey ? $(-2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : X(0, -e.keyPanSpeed), y = !0;
|
3158
3025
|
break;
|
3159
3026
|
case e.keys.LEFT:
|
3160
|
-
r.ctrlKey || r.metaKey || r.shiftKey ? U(2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) :
|
3027
|
+
r.ctrlKey || r.metaKey || r.shiftKey ? U(2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : X(e.keyPanSpeed, 0), y = !0;
|
3161
3028
|
break;
|
3162
3029
|
case e.keys.RIGHT:
|
3163
|
-
r.ctrlKey || r.metaKey || r.shiftKey ? U(-2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) :
|
3030
|
+
r.ctrlKey || r.metaKey || r.shiftKey ? U(-2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : X(-e.keyPanSpeed, 0), y = !0;
|
3164
3031
|
break;
|
3165
3032
|
}
|
3166
3033
|
y && (r.preventDefault(), e.update());
|
3167
3034
|
}
|
3168
|
-
function
|
3035
|
+
function $e(r) {
|
3169
3036
|
if (d.length === 1)
|
3170
3037
|
b.set(r.pageX, r.pageY);
|
3171
3038
|
else {
|
3172
|
-
const y =
|
3039
|
+
const y = we(r), O = 0.5 * (r.pageX + y.x), L = 0.5 * (r.pageY + y.y);
|
3173
3040
|
b.set(O, L);
|
3174
3041
|
}
|
3175
3042
|
}
|
3176
|
-
function
|
3043
|
+
function Oe(r) {
|
3177
3044
|
if (d.length === 1)
|
3178
3045
|
M.set(r.pageX, r.pageY);
|
3179
3046
|
else {
|
3180
|
-
const y =
|
3047
|
+
const y = we(r), O = 0.5 * (r.pageX + y.x), L = 0.5 * (r.pageY + y.y);
|
3181
3048
|
M.set(O, L);
|
3182
3049
|
}
|
3183
3050
|
}
|
3184
|
-
function
|
3185
|
-
const y =
|
3051
|
+
function dt(r) {
|
3052
|
+
const y = we(r), O = r.pageX - y.x, L = r.pageY - y.y, K = Math.sqrt(O * O + L * L);
|
3186
3053
|
B.set(0, K);
|
3187
3054
|
}
|
3188
|
-
function
|
3189
|
-
e.enableZoom &&
|
3055
|
+
function ft(r) {
|
3056
|
+
e.enableZoom && dt(r), e.enablePan && Oe(r);
|
3190
3057
|
}
|
3191
|
-
function
|
3192
|
-
e.enableZoom &&
|
3058
|
+
function _t(r) {
|
3059
|
+
e.enableZoom && dt(r), e.enableRotate && $e(r);
|
3193
3060
|
}
|
3194
|
-
function
|
3061
|
+
function pt(r) {
|
3195
3062
|
if (d.length == 1)
|
3196
3063
|
E.set(r.pageX, r.pageY);
|
3197
3064
|
else {
|
3198
|
-
const O =
|
3065
|
+
const O = we(r), L = 0.5 * (r.pageX + O.x), K = 0.5 * (r.pageY + O.y);
|
3199
3066
|
E.set(L, K);
|
3200
3067
|
}
|
3201
3068
|
x.subVectors(E, b).multiplyScalar(e.rotateSpeed);
|
3202
3069
|
const y = e.domElement;
|
3203
3070
|
U(2 * Math.PI * x.x / y.clientHeight), $(2 * Math.PI * x.y / y.clientHeight), b.copy(E);
|
3204
3071
|
}
|
3205
|
-
function
|
3072
|
+
function Me(r) {
|
3206
3073
|
if (d.length === 1)
|
3207
3074
|
P.set(r.pageX, r.pageY);
|
3208
3075
|
else {
|
3209
|
-
const y =
|
3076
|
+
const y = we(r), O = 0.5 * (r.pageX + y.x), L = 0.5 * (r.pageY + y.y);
|
3210
3077
|
P.set(O, L);
|
3211
3078
|
}
|
3212
|
-
H.subVectors(P, M).multiplyScalar(e.panSpeed),
|
3079
|
+
H.subVectors(P, M).multiplyScalar(e.panSpeed), X(H.x, H.y), M.copy(P);
|
3213
3080
|
}
|
3214
|
-
function
|
3215
|
-
const y =
|
3081
|
+
function Te(r) {
|
3082
|
+
const y = we(r), O = r.pageX - y.x, L = r.pageY - y.y, K = Math.sqrt(O * O + L * L);
|
3216
3083
|
w.set(0, K), z.set(0, Math.pow(w.y / B.y, e.zoomSpeed)), T(z.y), B.copy(w);
|
3217
3084
|
const de = (r.pageX + y.x) * 0.5, ie = (r.pageY + y.y) * 0.5;
|
3218
3085
|
J(de, ie);
|
3219
3086
|
}
|
3220
|
-
function
|
3221
|
-
e.enableZoom &&
|
3087
|
+
function ht(r) {
|
3088
|
+
e.enableZoom && Te(r), e.enablePan && Me(r);
|
3222
3089
|
}
|
3223
|
-
function
|
3224
|
-
e.enableZoom &&
|
3090
|
+
function mt(r) {
|
3091
|
+
e.enableZoom && Te(r), e.enableRotate && pt(r);
|
3225
3092
|
}
|
3226
|
-
function
|
3227
|
-
e.enabled !== !1 && (d.length === 0 && (e.domElement.setPointerCapture(r.pointerId), e.domElement.addEventListener("pointermove", Je), e.domElement.addEventListener("pointerup",
|
3093
|
+
function Re(r) {
|
3094
|
+
e.enabled !== !1 && (d.length === 0 && (e.domElement.setPointerCapture(r.pointerId), e.domElement.addEventListener("pointermove", Je), e.domElement.addEventListener("pointerup", _e)), Pt(r), r.pointerType === "touch" ? tt(r) : Qe(r));
|
3228
3095
|
}
|
3229
3096
|
function Je(r) {
|
3230
|
-
e.enabled !== !1 && (r.pointerType === "touch" ?
|
3097
|
+
e.enabled !== !1 && (r.pointerType === "touch" ? yt(r) : At(r));
|
3231
3098
|
}
|
3232
|
-
function
|
3233
|
-
switch (
|
3099
|
+
function _e(r) {
|
3100
|
+
switch (kt(r), d.length) {
|
3234
3101
|
case 0:
|
3235
|
-
e.domElement.releasePointerCapture(r.pointerId), e.domElement.removeEventListener("pointermove", Je), e.domElement.removeEventListener("pointerup",
|
3102
|
+
e.domElement.releasePointerCapture(r.pointerId), e.domElement.removeEventListener("pointermove", Je), e.domElement.removeEventListener("pointerup", _e), e.dispatchEvent(nn), l = o.NONE;
|
3236
3103
|
break;
|
3237
3104
|
case 1:
|
3238
|
-
const y = d[0], O =
|
3105
|
+
const y = d[0], O = h[y];
|
3239
3106
|
tt({ pointerId: y, pageX: O.x, pageY: O.y });
|
3240
3107
|
break;
|
3241
3108
|
}
|
@@ -3256,61 +3123,61 @@ class bi extends un {
|
|
3256
3123
|
y = -1;
|
3257
3124
|
}
|
3258
3125
|
switch (y) {
|
3259
|
-
case
|
3126
|
+
case Ge.DOLLY:
|
3260
3127
|
if (e.enableZoom === !1)
|
3261
3128
|
return;
|
3262
|
-
|
3129
|
+
ut(r), l = o.DOLLY;
|
3263
3130
|
break;
|
3264
|
-
case
|
3131
|
+
case Ge.ROTATE:
|
3265
3132
|
if (r.ctrlKey || r.metaKey || r.shiftKey) {
|
3266
3133
|
if (e.enablePan === !1)
|
3267
3134
|
return;
|
3268
|
-
Ke(r),
|
3135
|
+
Ke(r), l = o.PAN;
|
3269
3136
|
} else {
|
3270
3137
|
if (e.enableRotate === !1)
|
3271
3138
|
return;
|
3272
|
-
|
3139
|
+
Ce(r), l = o.ROTATE;
|
3273
3140
|
}
|
3274
3141
|
break;
|
3275
|
-
case
|
3142
|
+
case Ge.PAN:
|
3276
3143
|
if (r.ctrlKey || r.metaKey || r.shiftKey) {
|
3277
3144
|
if (e.enableRotate === !1)
|
3278
3145
|
return;
|
3279
|
-
|
3146
|
+
Ce(r), l = o.ROTATE;
|
3280
3147
|
} else {
|
3281
3148
|
if (e.enablePan === !1)
|
3282
3149
|
return;
|
3283
|
-
Ke(r),
|
3150
|
+
Ke(r), l = o.PAN;
|
3284
3151
|
}
|
3285
3152
|
break;
|
3286
3153
|
default:
|
3287
|
-
|
3154
|
+
l = o.NONE;
|
3288
3155
|
}
|
3289
|
-
|
3156
|
+
l !== o.NONE && e.dispatchEvent(Ft);
|
3290
3157
|
}
|
3291
|
-
function
|
3292
|
-
switch (
|
3158
|
+
function At(r) {
|
3159
|
+
switch (l) {
|
3293
3160
|
case o.ROTATE:
|
3294
3161
|
if (e.enableRotate === !1)
|
3295
3162
|
return;
|
3296
|
-
|
3163
|
+
Tt(r);
|
3297
3164
|
break;
|
3298
3165
|
case o.DOLLY:
|
3299
3166
|
if (e.enableZoom === !1)
|
3300
3167
|
return;
|
3301
|
-
|
3168
|
+
Rt(r);
|
3302
3169
|
break;
|
3303
3170
|
case o.PAN:
|
3304
3171
|
if (e.enablePan === !1)
|
3305
3172
|
return;
|
3306
|
-
|
3173
|
+
qe(r);
|
3307
3174
|
break;
|
3308
3175
|
}
|
3309
3176
|
}
|
3310
|
-
function
|
3311
|
-
e.enabled === !1 || e.enableZoom === !1 ||
|
3177
|
+
function vt(r) {
|
3178
|
+
e.enabled === !1 || e.enableZoom === !1 || l !== o.NONE || (r.preventDefault(), e.dispatchEvent(Ft), Ze(gt(r)), e.dispatchEvent(nn));
|
3312
3179
|
}
|
3313
|
-
function
|
3180
|
+
function gt(r) {
|
3314
3181
|
const y = r.deltaMode, O = {
|
3315
3182
|
clientX: r.clientX,
|
3316
3183
|
clientY: r.clientY,
|
@@ -3326,193 +3193,193 @@ class bi extends un {
|
|
3326
3193
|
}
|
3327
3194
|
return r.ctrlKey && !S && (O.deltaY *= 10), O;
|
3328
3195
|
}
|
3329
|
-
function
|
3330
|
-
r.key === "Control" && (S = !0, e.domElement.getRootNode().addEventListener("keyup",
|
3196
|
+
function bt(r) {
|
3197
|
+
r.key === "Control" && (S = !0, e.domElement.getRootNode().addEventListener("keyup", xe, { passive: !0, capture: !0 }));
|
3331
3198
|
}
|
3332
|
-
function
|
3333
|
-
r.key === "Control" && (S = !1, e.domElement.getRootNode().removeEventListener("keyup",
|
3199
|
+
function xe(r) {
|
3200
|
+
r.key === "Control" && (S = !1, e.domElement.getRootNode().removeEventListener("keyup", xe, { passive: !0, capture: !0 }));
|
3334
3201
|
}
|
3335
3202
|
function et(r) {
|
3336
|
-
e.enabled === !1 || e.enablePan === !1 ||
|
3203
|
+
e.enabled === !1 || e.enablePan === !1 || Ue(r);
|
3337
3204
|
}
|
3338
3205
|
function tt(r) {
|
3339
|
-
switch (
|
3206
|
+
switch (Et(r), d.length) {
|
3340
3207
|
case 1:
|
3341
3208
|
switch (e.touches.ONE) {
|
3342
|
-
case
|
3209
|
+
case Ve.ROTATE:
|
3343
3210
|
if (e.enableRotate === !1)
|
3344
3211
|
return;
|
3345
|
-
|
3212
|
+
$e(r), l = o.TOUCH_ROTATE;
|
3346
3213
|
break;
|
3347
|
-
case
|
3214
|
+
case Ve.PAN:
|
3348
3215
|
if (e.enablePan === !1)
|
3349
3216
|
return;
|
3350
|
-
|
3217
|
+
Oe(r), l = o.TOUCH_PAN;
|
3351
3218
|
break;
|
3352
3219
|
default:
|
3353
|
-
|
3220
|
+
l = o.NONE;
|
3354
3221
|
}
|
3355
3222
|
break;
|
3356
3223
|
case 2:
|
3357
3224
|
switch (e.touches.TWO) {
|
3358
|
-
case
|
3225
|
+
case Ve.DOLLY_PAN:
|
3359
3226
|
if (e.enableZoom === !1 && e.enablePan === !1)
|
3360
3227
|
return;
|
3361
|
-
|
3228
|
+
ft(r), l = o.TOUCH_DOLLY_PAN;
|
3362
3229
|
break;
|
3363
|
-
case
|
3230
|
+
case Ve.DOLLY_ROTATE:
|
3364
3231
|
if (e.enableZoom === !1 && e.enableRotate === !1)
|
3365
3232
|
return;
|
3366
|
-
|
3233
|
+
_t(r), l = o.TOUCH_DOLLY_ROTATE;
|
3367
3234
|
break;
|
3368
3235
|
default:
|
3369
|
-
|
3236
|
+
l = o.NONE;
|
3370
3237
|
}
|
3371
3238
|
break;
|
3372
3239
|
default:
|
3373
|
-
|
3240
|
+
l = o.NONE;
|
3374
3241
|
}
|
3375
|
-
|
3242
|
+
l !== o.NONE && e.dispatchEvent(Ft);
|
3376
3243
|
}
|
3377
|
-
function
|
3378
|
-
switch (
|
3244
|
+
function yt(r) {
|
3245
|
+
switch (Et(r), l) {
|
3379
3246
|
case o.TOUCH_ROTATE:
|
3380
3247
|
if (e.enableRotate === !1)
|
3381
3248
|
return;
|
3382
|
-
|
3249
|
+
pt(r), e.update();
|
3383
3250
|
break;
|
3384
3251
|
case o.TOUCH_PAN:
|
3385
3252
|
if (e.enablePan === !1)
|
3386
3253
|
return;
|
3387
|
-
|
3254
|
+
Me(r), e.update();
|
3388
3255
|
break;
|
3389
3256
|
case o.TOUCH_DOLLY_PAN:
|
3390
3257
|
if (e.enableZoom === !1 && e.enablePan === !1)
|
3391
3258
|
return;
|
3392
|
-
|
3259
|
+
ht(r), e.update();
|
3393
3260
|
break;
|
3394
3261
|
case o.TOUCH_DOLLY_ROTATE:
|
3395
3262
|
if (e.enableZoom === !1 && e.enableRotate === !1)
|
3396
3263
|
return;
|
3397
|
-
|
3264
|
+
mt(r), e.update();
|
3398
3265
|
break;
|
3399
3266
|
default:
|
3400
|
-
|
3267
|
+
l = o.NONE;
|
3401
3268
|
}
|
3402
3269
|
}
|
3403
|
-
function
|
3270
|
+
function ze(r) {
|
3404
3271
|
e.enabled !== !1 && r.preventDefault();
|
3405
3272
|
}
|
3406
|
-
function
|
3273
|
+
function Pt(r) {
|
3407
3274
|
d.push(r.pointerId);
|
3408
3275
|
}
|
3409
|
-
function
|
3410
|
-
delete
|
3276
|
+
function kt(r) {
|
3277
|
+
delete h[r.pointerId];
|
3411
3278
|
for (let y = 0; y < d.length; y++)
|
3412
3279
|
if (d[y] == r.pointerId) {
|
3413
3280
|
d.splice(y, 1);
|
3414
3281
|
return;
|
3415
3282
|
}
|
3416
3283
|
}
|
3417
|
-
function
|
3418
|
-
let y =
|
3419
|
-
y === void 0 && (y = new ue(),
|
3284
|
+
function Et(r) {
|
3285
|
+
let y = h[r.pointerId];
|
3286
|
+
y === void 0 && (y = new ue(), h[r.pointerId] = y), y.set(r.pageX, r.pageY);
|
3420
3287
|
}
|
3421
|
-
function
|
3288
|
+
function we(r) {
|
3422
3289
|
const y = r.pointerId === d[0] ? d[1] : d[0];
|
3423
|
-
return
|
3290
|
+
return h[y];
|
3424
3291
|
}
|
3425
|
-
e.domElement.addEventListener("contextmenu",
|
3292
|
+
e.domElement.addEventListener("contextmenu", ze), e.domElement.addEventListener("pointerdown", Re), e.domElement.addEventListener("pointercancel", _e), e.domElement.addEventListener("wheel", vt, { passive: !1 }), e.domElement.getRootNode().addEventListener("keydown", bt, { passive: !0, capture: !0 }), this.update();
|
3426
3293
|
}
|
3427
3294
|
}
|
3428
|
-
const
|
3295
|
+
const St = (t) => {
|
3429
3296
|
const [n, a] = ae(t.options[t.index]), e = () => {
|
3430
3297
|
t.onToggle(!t.open);
|
3431
|
-
}, o = (
|
3432
|
-
|
3298
|
+
}, o = (l) => {
|
3299
|
+
l !== n && (t.onSelect(l), a(l)), t.onToggle(!1);
|
3433
3300
|
};
|
3434
|
-
return /* @__PURE__ */
|
3435
|
-
/* @__PURE__ */
|
3436
|
-
t.open && /* @__PURE__ */
|
3301
|
+
return /* @__PURE__ */ c.jsxs("div", { className: `dropdown ${t.up === !0 ? "up" : ""}`, children: [
|
3302
|
+
/* @__PURE__ */ c.jsx("div", { className: "dropdown-toggle", onClick: e, children: n }),
|
3303
|
+
t.open && /* @__PURE__ */ c.jsx("ul", { className: "dropdown-menu", children: t.options.map((l) => /* @__PURE__ */ c.jsx("li", { onClick: () => o(l), children: l }, l)) })
|
3437
3304
|
] });
|
3438
|
-
},
|
3439
|
-
const [e, o] = ae(!1),
|
3440
|
-
return /* @__PURE__ */
|
3441
|
-
/* @__PURE__ */
|
3305
|
+
}, Ie = Ca(function(n, a) {
|
3306
|
+
const [e, o] = ae(!1), l = n.options.indexOf(n.camera.name);
|
3307
|
+
return /* @__PURE__ */ c.jsxs("div", { className: "CameraWindow", children: [
|
3308
|
+
/* @__PURE__ */ c.jsx("div", { ref: a, className: "clickable", onClick: () => {
|
3442
3309
|
e && o(!1);
|
3443
3310
|
} }),
|
3444
|
-
/* @__PURE__ */
|
3445
|
-
|
3311
|
+
/* @__PURE__ */ c.jsx(
|
3312
|
+
St,
|
3446
3313
|
{
|
3447
|
-
index:
|
3314
|
+
index: l,
|
3448
3315
|
open: e,
|
3449
3316
|
options: n.options,
|
3450
3317
|
onSelect: n.onSelect,
|
3451
|
-
onToggle: (
|
3452
|
-
o(
|
3318
|
+
onToggle: (m) => {
|
3319
|
+
o(m);
|
3453
3320
|
},
|
3454
3321
|
up: !0
|
3455
3322
|
}
|
3456
3323
|
)
|
3457
3324
|
] });
|
3458
|
-
}),
|
3325
|
+
}), rn = [
|
3459
3326
|
"Single",
|
3460
3327
|
"Side by Side",
|
3461
3328
|
"Stacked",
|
3462
3329
|
"Quad"
|
3463
|
-
], ne = /* @__PURE__ */ new Map(), re = /* @__PURE__ */ new Map(),
|
3464
|
-
function
|
3465
|
-
const a = new
|
3330
|
+
], ne = /* @__PURE__ */ new Map(), re = /* @__PURE__ */ new Map(), ge = /* @__PURE__ */ new Map();
|
3331
|
+
function Be(t, n) {
|
3332
|
+
const a = new Mn(-100, 100, 100, -100, 50, 3e3);
|
3466
3333
|
return a.name = t, a.position.copy(n), a.lookAt(0, 0, 0), ne.set(t, a), a;
|
3467
3334
|
}
|
3468
|
-
|
3469
|
-
|
3470
|
-
|
3471
|
-
|
3472
|
-
|
3473
|
-
|
3474
|
-
|
3475
|
-
const
|
3476
|
-
|
3477
|
-
|
3478
|
-
|
3479
|
-
ne.set("Debug",
|
3480
|
-
const
|
3335
|
+
Be("Top", new q(0, 1e3, 0));
|
3336
|
+
Be("Bottom", new q(0, -1e3, 0));
|
3337
|
+
Be("Left", new q(-1e3, 0, 0));
|
3338
|
+
Be("Right", new q(1e3, 0, 0));
|
3339
|
+
Be("Front", new q(0, 0, 1e3));
|
3340
|
+
Be("Back", new q(0, 0, -1e3));
|
3341
|
+
Be("Orthographic", new q(1e3, 1e3, 1e3));
|
3342
|
+
const Mt = new Bt(60, 1, 50, 3e3);
|
3343
|
+
Mt.name = "Debug";
|
3344
|
+
Mt.position.set(500, 500, 500);
|
3345
|
+
Mt.lookAt(0, 0, 0);
|
3346
|
+
ne.set("Debug", Mt);
|
3347
|
+
const on = [
|
3481
3348
|
"Renderer",
|
3482
3349
|
"Depth",
|
3483
3350
|
"Normals",
|
3484
3351
|
"UVs",
|
3485
3352
|
"Wireframe"
|
3486
|
-
],
|
3353
|
+
], hi = new fa(), mi = new pa(), vi = new Va(), gi = new ha({
|
3487
3354
|
opacity: 0.33,
|
3488
3355
|
transparent: !0,
|
3489
3356
|
wireframe: !0
|
3490
3357
|
});
|
3491
|
-
let
|
3492
|
-
const V = new
|
3358
|
+
let xt = "Renderer";
|
3359
|
+
const V = new Tn();
|
3493
3360
|
V.name = "Debug Scene";
|
3494
|
-
let
|
3495
|
-
V.add(
|
3496
|
-
const
|
3497
|
-
|
3498
|
-
V.add(
|
3499
|
-
const
|
3500
|
-
|
3501
|
-
const
|
3502
|
-
|
3503
|
-
|
3504
|
-
const
|
3505
|
-
|
3506
|
-
|
3507
|
-
|
3508
|
-
let
|
3509
|
-
function
|
3510
|
-
const [n, a] = ae(t.mode !== void 0 ? t.mode : "Single"), [e, o] = ae(null), [
|
3361
|
+
let be = new Tn();
|
3362
|
+
V.add(be);
|
3363
|
+
const ct = new ma();
|
3364
|
+
ct.name = "helpers";
|
3365
|
+
V.add(ct);
|
3366
|
+
const bi = new za();
|
3367
|
+
ct.add(bi);
|
3368
|
+
const Nn = new Rn(500);
|
3369
|
+
Nn.name = "axisHelper";
|
3370
|
+
ct.add(Nn);
|
3371
|
+
const lt = new Rn(100);
|
3372
|
+
lt.name = "interactionHelper";
|
3373
|
+
ct.add(lt);
|
3374
|
+
lt.visible = !1;
|
3375
|
+
let wt = !1, G = ne.get("Debug"), oe = ne.get("Orthographic"), Le = ne.get("Front"), Ne = ne.get("Top"), sn = !1;
|
3376
|
+
function Ni(t) {
|
3377
|
+
const [n, a] = ae(t.mode !== void 0 ? t.mode : "Single"), [e, o] = ae(null), [l, m] = ae(!1), [s, u] = ae(!1), [p, v] = ae(!1), [, b] = ae(Date.now()), E = ye(null), x = ye(null), M = ye(null), P = ye(null), H = ye(null), B = ye(null), w = (d, h) => {
|
3511
3378
|
const S = re.get(d.name);
|
3512
3379
|
S !== void 0 && S.dispose(), re.delete(d.name);
|
3513
|
-
const _ =
|
3514
|
-
_ !== void 0 && (V.remove(_), _.dispose()),
|
3515
|
-
const Y = new
|
3380
|
+
const _ = ge.get(d.name);
|
3381
|
+
_ !== void 0 && (V.remove(_), _.dispose()), ge.delete(d.name);
|
3382
|
+
const Y = new pi(d, h);
|
3516
3383
|
switch (Y.enableDamping = !0, Y.dampingFactor = 0.05, d.name) {
|
3517
3384
|
case "Top":
|
3518
3385
|
case "Bottom":
|
@@ -3523,22 +3390,22 @@ function Ui(t) {
|
|
3523
3390
|
Y.enableRotate = !1;
|
3524
3391
|
break;
|
3525
3392
|
}
|
3526
|
-
if (re.set(d.name, Y), d instanceof
|
3527
|
-
const U = new
|
3528
|
-
|
3393
|
+
if (re.set(d.name, Y), d instanceof Bt) {
|
3394
|
+
const U = new ba(d);
|
3395
|
+
ge.set(d.name, U), V.add(U);
|
3529
3396
|
}
|
3530
3397
|
}, z = (d) => {
|
3531
|
-
const
|
3532
|
-
|
3398
|
+
const h = ge.get(d.name);
|
3399
|
+
h !== void 0 && (V.remove(h), h.dispose(), ge.delete(d.name));
|
3533
3400
|
const S = re.get(d.name);
|
3534
3401
|
S !== void 0 && (S.dispose(), re.delete(d.name));
|
3535
|
-
},
|
3536
|
-
re.forEach((d,
|
3402
|
+
}, Ee = () => {
|
3403
|
+
re.forEach((d, h) => {
|
3537
3404
|
d.dispose();
|
3538
|
-
const S =
|
3539
|
-
S !== void 0 && (V.remove(S), S.dispose()),
|
3540
|
-
}), re.clear(),
|
3541
|
-
},
|
3405
|
+
const S = ge.get(h);
|
3406
|
+
S !== void 0 && (V.remove(S), S.dispose()), ge.delete(h), re.delete(h);
|
3407
|
+
}), re.clear(), ge.clear();
|
3408
|
+
}, ce = () => {
|
3542
3409
|
switch (n) {
|
3543
3410
|
case "Single":
|
3544
3411
|
w(G, M.current);
|
@@ -3548,43 +3415,43 @@ function Ui(t) {
|
|
3548
3415
|
w(G, M.current), w(oe, P.current);
|
3549
3416
|
break;
|
3550
3417
|
case "Quad":
|
3551
|
-
w(G, M.current), w(oe, P.current), w(
|
3418
|
+
w(G, M.current), w(oe, P.current), w(Le, H.current), w(Ne, B.current);
|
3552
3419
|
break;
|
3553
3420
|
}
|
3554
3421
|
};
|
3555
|
-
|
3556
|
-
const d = new
|
3422
|
+
Se(() => {
|
3423
|
+
const d = new va({
|
3557
3424
|
canvas: E.current,
|
3558
3425
|
stencil: !1
|
3559
3426
|
});
|
3560
3427
|
d.autoClear = !1, d.shadowMap.enabled = !0, d.setPixelRatio(devicePixelRatio), d.setClearColor(0), o(d);
|
3561
|
-
}, []),
|
3428
|
+
}, []), Se(() => {
|
3562
3429
|
const d = (_) => {
|
3563
|
-
|
3430
|
+
kn(be), V.remove(be);
|
3564
3431
|
const Y = t.scenes.get(_.value.name);
|
3565
3432
|
if (Y !== void 0) {
|
3566
3433
|
const U = new Y();
|
3567
|
-
t.onSceneSet !== void 0 && t.onSceneSet(U),
|
3434
|
+
t.onSceneSet !== void 0 && t.onSceneSet(U), be = U, t.three.scene = be, V.add(be), sn = !0;
|
3568
3435
|
}
|
3569
|
-
},
|
3436
|
+
}, h = (_) => {
|
3570
3437
|
const Y = _.value, U = t.three.scene?.getObjectByProperty("uuid", Y.uuid);
|
3571
3438
|
U !== void 0 && ne.set(Y.name, U), b(Date.now());
|
3572
3439
|
}, S = (_) => {
|
3573
3440
|
ne.delete(_.value.name), b(Date.now());
|
3574
3441
|
};
|
3575
|
-
return k.addEventListener(
|
3576
|
-
k.removeEventListener(
|
3442
|
+
return k.addEventListener(D.SET_SCENE, d), k.addEventListener(D.ADD_CAMERA, h), k.addEventListener(D.REMOVE_CAMERA, S), () => {
|
3443
|
+
k.removeEventListener(D.SET_SCENE, d), k.removeEventListener(D.ADD_CAMERA, h), k.removeEventListener(D.REMOVE_CAMERA, S);
|
3577
3444
|
};
|
3578
|
-
}, []),
|
3445
|
+
}, []), Se(() => {
|
3579
3446
|
if (e === null)
|
3580
3447
|
return;
|
3581
|
-
let d = window.innerWidth,
|
3448
|
+
let d = window.innerWidth, h = window.innerHeight, S = Math.floor(d / 2), _ = Math.floor(h / 2), Y = -1;
|
3582
3449
|
const U = () => {
|
3583
|
-
d = window.innerWidth - 300,
|
3584
|
-
let T = d, N =
|
3450
|
+
d = window.innerWidth - 300, h = window.innerHeight, S = Math.floor(d / 2), _ = Math.floor(h / 2), e.setSize(d, h);
|
3451
|
+
let T = d, N = h;
|
3585
3452
|
switch (n) {
|
3586
3453
|
case "Side by Side":
|
3587
|
-
T = S, N =
|
3454
|
+
T = S, N = h;
|
3588
3455
|
break;
|
3589
3456
|
case "Stacked":
|
3590
3457
|
T = d, N = _;
|
@@ -3594,24 +3461,24 @@ function Ui(t) {
|
|
3594
3461
|
break;
|
3595
3462
|
}
|
3596
3463
|
ne.forEach((J) => {
|
3597
|
-
J instanceof
|
3464
|
+
J instanceof Mn ? (J.left = T / -2, J.right = T / 2, J.top = N / 2, J.bottom = N / -2, J.updateProjectionMatrix()) : J instanceof Bt && (J.aspect = T / N, J.updateProjectionMatrix(), ge.get(J.name)?.update());
|
3598
3465
|
});
|
3599
3466
|
}, $ = () => {
|
3600
|
-
e.setViewport(0, 0, d,
|
3467
|
+
e.setViewport(0, 0, d, h), e.setScissor(0, 0, d, h), e.render(V, G);
|
3601
3468
|
}, I = () => {
|
3602
3469
|
if (n === "Side by Side")
|
3603
|
-
e.setViewport(0, 0, S,
|
3470
|
+
e.setViewport(0, 0, S, h), e.setScissor(0, 0, S, h), e.render(V, G), e.setViewport(S, 0, S, h), e.setScissor(S, 0, S, h), e.render(V, oe);
|
3604
3471
|
else {
|
3605
|
-
const T =
|
3472
|
+
const T = h - _;
|
3606
3473
|
e.setViewport(0, T, d, _), e.setScissor(0, T, d, _), e.render(V, G), e.setViewport(0, 0, d, _), e.setScissor(0, 0, d, _), e.render(V, oe);
|
3607
3474
|
}
|
3608
3475
|
}, W = () => {
|
3609
3476
|
let T = 0, N = 0;
|
3610
|
-
N =
|
3611
|
-
},
|
3477
|
+
N = h - _, T = 0, e.setViewport(T, N, S, _), e.setScissor(T, N, S, _), e.render(V, G), T = S, e.setViewport(T, N, S, _), e.setScissor(T, N, S, _), e.render(V, oe), N = 0, T = 0, e.setViewport(T, N, S, _), e.setScissor(T, N, S, _), e.render(V, Le), T = S, e.setViewport(T, N, S, _), e.setScissor(T, N, S, _), e.render(V, Ne);
|
3478
|
+
}, X = () => {
|
3612
3479
|
switch (re.forEach((T) => {
|
3613
3480
|
T.update();
|
3614
|
-
}), t.onSceneUpdate !== void 0 &&
|
3481
|
+
}), t.onSceneUpdate !== void 0 && sn && t.onSceneUpdate(be), e.clear(), n) {
|
3615
3482
|
case "Single":
|
3616
3483
|
$();
|
3617
3484
|
break;
|
@@ -3623,39 +3490,39 @@ function Ui(t) {
|
|
3623
3490
|
W();
|
3624
3491
|
break;
|
3625
3492
|
}
|
3626
|
-
Y = requestAnimationFrame(
|
3493
|
+
Y = requestAnimationFrame(X);
|
3627
3494
|
};
|
3628
|
-
return
|
3495
|
+
return ce(), window.addEventListener("resize", U), U(), X(), () => {
|
3629
3496
|
window.removeEventListener("resize", U), cancelAnimationFrame(Y), Y = -1;
|
3630
3497
|
};
|
3631
|
-
}, [n, e]),
|
3498
|
+
}, [n, e]), Se(() => {
|
3632
3499
|
if (e !== null) {
|
3633
|
-
const d = new
|
3500
|
+
const d = new ga(), h = new ue(), S = ($, I, W, X) => {
|
3634
3501
|
switch (n) {
|
3635
3502
|
case "Quad":
|
3636
|
-
$ < W ? I <
|
3503
|
+
$ < W ? I < X ? d.setFromCamera(h, G) : d.setFromCamera(h, Le) : I < X ? d.setFromCamera(h, oe) : d.setFromCamera(h, Ne);
|
3637
3504
|
break;
|
3638
3505
|
case "Side by Side":
|
3639
|
-
$ < W ? d.setFromCamera(
|
3506
|
+
$ < W ? d.setFromCamera(h, G) : d.setFromCamera(h, oe);
|
3640
3507
|
break;
|
3641
3508
|
case "Single":
|
3642
|
-
d.setFromCamera(
|
3509
|
+
d.setFromCamera(h, G);
|
3643
3510
|
break;
|
3644
3511
|
case "Stacked":
|
3645
|
-
I <
|
3512
|
+
I < X ? d.setFromCamera(h, G) : d.setFromCamera(h, oe);
|
3646
3513
|
break;
|
3647
3514
|
}
|
3648
3515
|
}, _ = ($) => {
|
3649
|
-
if (!
|
3516
|
+
if (!wt)
|
3650
3517
|
return;
|
3651
3518
|
const I = new ue();
|
3652
3519
|
e.getSize(I);
|
3653
|
-
const W = Math.min($.clientX, I.x),
|
3654
|
-
|
3520
|
+
const W = Math.min($.clientX, I.x), X = Math.min($.clientY, I.y);
|
3521
|
+
h.x = Xe(W, 0, I.x, -1, 1), h.y = Xe(X, 0, I.y, 1, -1);
|
3655
3522
|
const T = I.x / 2, N = I.y / 2, J = () => {
|
3656
|
-
W < T ?
|
3523
|
+
W < T ? h.x = Xe(W, 0, T, -1, 1) : h.x = Xe(W, T, I.x, -1, 1);
|
3657
3524
|
}, me = () => {
|
3658
|
-
|
3525
|
+
X < N ? h.y = Xe(X, 0, N, 1, -1) : h.y = Xe(X, N, I.y, 1, -1);
|
3659
3526
|
};
|
3660
3527
|
switch (n) {
|
3661
3528
|
case "Quad":
|
@@ -3668,17 +3535,17 @@ function Ui(t) {
|
|
3668
3535
|
me(), me();
|
3669
3536
|
break;
|
3670
3537
|
}
|
3671
|
-
S(W,
|
3672
|
-
const
|
3673
|
-
|
3538
|
+
S(W, X, T, N);
|
3539
|
+
const Ce = d.intersectObjects(be.children);
|
3540
|
+
Ce.length > 0 && lt.position.copy(Ce[0].point);
|
3674
3541
|
}, Y = ($) => {
|
3675
|
-
if (!
|
3542
|
+
if (!wt)
|
3676
3543
|
return;
|
3677
3544
|
const I = new ue();
|
3678
3545
|
if (e.getSize(I), $.clientX >= I.x)
|
3679
3546
|
return;
|
3680
3547
|
_($);
|
3681
|
-
const W = d.intersectObjects(
|
3548
|
+
const W = d.intersectObjects(be.children);
|
3682
3549
|
W.length > 0 && t.three.getObject(W[0].object.uuid);
|
3683
3550
|
}, U = x.current;
|
3684
3551
|
return U.addEventListener("mousemove", _, !1), U.addEventListener("click", Y, !1), () => {
|
@@ -3687,100 +3554,100 @@ function Ui(t) {
|
|
3687
3554
|
}
|
3688
3555
|
}, [n, e]);
|
3689
3556
|
const se = [];
|
3690
|
-
return ne.forEach((d,
|
3691
|
-
se.push(
|
3692
|
-
}), /* @__PURE__ */
|
3693
|
-
/* @__PURE__ */
|
3694
|
-
/* @__PURE__ */
|
3695
|
-
n === "Single" && /* @__PURE__ */
|
3557
|
+
return ne.forEach((d, h) => {
|
3558
|
+
se.push(h);
|
3559
|
+
}), /* @__PURE__ */ c.jsxs("div", { className: "multiview", children: [
|
3560
|
+
/* @__PURE__ */ c.jsx("canvas", { ref: E }),
|
3561
|
+
/* @__PURE__ */ c.jsxs("div", { className: `cameras ${n === "Single" || n === "Stacked" ? "single" : ""}`, ref: x, children: [
|
3562
|
+
n === "Single" && /* @__PURE__ */ c.jsx(c.Fragment, { children: /* @__PURE__ */ c.jsx(Ie, { camera: G, options: se, ref: M, onSelect: (d) => {
|
3696
3563
|
re.get(G.name)?.dispose();
|
3697
|
-
const
|
3698
|
-
|
3564
|
+
const h = ne.get(d);
|
3565
|
+
h !== void 0 && (z(G), G = h, w(h, M.current));
|
3699
3566
|
} }) }),
|
3700
|
-
(n === "Side by Side" || n === "Stacked") && /* @__PURE__ */
|
3701
|
-
/* @__PURE__ */
|
3567
|
+
(n === "Side by Side" || n === "Stacked") && /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
|
3568
|
+
/* @__PURE__ */ c.jsx(Ie, { camera: G, options: se, ref: M, onSelect: (d) => {
|
3702
3569
|
re.get(G.name)?.dispose();
|
3703
|
-
const
|
3704
|
-
|
3570
|
+
const h = ne.get(d);
|
3571
|
+
h !== void 0 && (z(G), G = h, w(h, M.current));
|
3705
3572
|
} }),
|
3706
|
-
/* @__PURE__ */
|
3573
|
+
/* @__PURE__ */ c.jsx(Ie, { camera: oe, options: se, ref: P, onSelect: (d) => {
|
3707
3574
|
re.get(oe.name)?.dispose();
|
3708
|
-
const
|
3709
|
-
|
3575
|
+
const h = ne.get(d);
|
3576
|
+
h !== void 0 && (z(oe), oe = h, w(h, P.current));
|
3710
3577
|
} })
|
3711
3578
|
] }),
|
3712
|
-
n === "Quad" && /* @__PURE__ */
|
3713
|
-
/* @__PURE__ */
|
3579
|
+
n === "Quad" && /* @__PURE__ */ c.jsxs(c.Fragment, { children: [
|
3580
|
+
/* @__PURE__ */ c.jsx(Ie, { camera: G, options: se, ref: M, onSelect: (d) => {
|
3714
3581
|
re.get(G.name)?.dispose();
|
3715
|
-
const
|
3716
|
-
|
3582
|
+
const h = ne.get(d);
|
3583
|
+
h !== void 0 && (z(G), G = h, w(h, M.current));
|
3717
3584
|
} }),
|
3718
|
-
/* @__PURE__ */
|
3585
|
+
/* @__PURE__ */ c.jsx(Ie, { camera: oe, options: se, ref: P, onSelect: (d) => {
|
3719
3586
|
re.get(oe.name)?.dispose();
|
3720
|
-
const
|
3721
|
-
|
3587
|
+
const h = ne.get(d);
|
3588
|
+
h !== void 0 && (z(oe), oe = h, w(h, P.current));
|
3722
3589
|
} }),
|
3723
|
-
/* @__PURE__ */
|
3724
|
-
re.get(
|
3725
|
-
const
|
3726
|
-
|
3590
|
+
/* @__PURE__ */ c.jsx(Ie, { camera: Le, options: se, ref: H, onSelect: (d) => {
|
3591
|
+
re.get(Le.name)?.dispose();
|
3592
|
+
const h = ne.get(d);
|
3593
|
+
h !== void 0 && (z(Le), Le = h, w(h, H.current));
|
3727
3594
|
} }),
|
3728
|
-
/* @__PURE__ */
|
3729
|
-
re.get(
|
3730
|
-
const
|
3731
|
-
|
3595
|
+
/* @__PURE__ */ c.jsx(Ie, { camera: Ne, options: se, ref: B, onSelect: (d) => {
|
3596
|
+
re.get(Ne.name)?.dispose();
|
3597
|
+
const h = ne.get(d);
|
3598
|
+
h !== void 0 && (z(Ne), Ne = h, w(h, B.current));
|
3732
3599
|
} })
|
3733
3600
|
] })
|
3734
3601
|
] }),
|
3735
|
-
/* @__PURE__ */
|
3736
|
-
/* @__PURE__ */
|
3737
|
-
|
3602
|
+
/* @__PURE__ */ c.jsxs("div", { className: "settings", children: [
|
3603
|
+
/* @__PURE__ */ c.jsx(
|
3604
|
+
St,
|
3738
3605
|
{
|
3739
|
-
index:
|
3740
|
-
options:
|
3606
|
+
index: rn.indexOf(n),
|
3607
|
+
options: rn,
|
3741
3608
|
onSelect: (d) => {
|
3742
|
-
d !== n && (
|
3609
|
+
d !== n && (Ee(), a(d));
|
3743
3610
|
},
|
3744
|
-
open:
|
3611
|
+
open: l,
|
3745
3612
|
onToggle: (d) => {
|
3746
|
-
|
3613
|
+
m(d), s && u(!1), p && v(!1);
|
3747
3614
|
}
|
3748
3615
|
}
|
3749
3616
|
),
|
3750
|
-
/* @__PURE__ */
|
3751
|
-
|
3617
|
+
/* @__PURE__ */ c.jsx(
|
3618
|
+
St,
|
3752
3619
|
{
|
3753
|
-
index:
|
3754
|
-
options:
|
3620
|
+
index: on.indexOf(xt),
|
3621
|
+
options: on,
|
3755
3622
|
onSelect: (d) => {
|
3756
|
-
if (d !==
|
3757
|
-
switch (
|
3623
|
+
if (d !== xt)
|
3624
|
+
switch (xt = d, xt) {
|
3758
3625
|
case "Depth":
|
3759
|
-
V.overrideMaterial =
|
3626
|
+
V.overrideMaterial = hi;
|
3760
3627
|
break;
|
3761
3628
|
case "Normals":
|
3762
|
-
V.overrideMaterial =
|
3629
|
+
V.overrideMaterial = mi;
|
3763
3630
|
break;
|
3764
3631
|
default:
|
3765
3632
|
case "Renderer":
|
3766
3633
|
V.overrideMaterial = null;
|
3767
3634
|
break;
|
3768
3635
|
case "Wireframe":
|
3769
|
-
V.overrideMaterial =
|
3636
|
+
V.overrideMaterial = gi;
|
3770
3637
|
break;
|
3771
3638
|
case "UVs":
|
3772
|
-
V.overrideMaterial =
|
3639
|
+
V.overrideMaterial = vi;
|
3773
3640
|
break;
|
3774
3641
|
}
|
3775
3642
|
},
|
3776
|
-
open:
|
3643
|
+
open: s,
|
3777
3644
|
onToggle: (d) => {
|
3778
|
-
|
3645
|
+
l && m(!1), u(d), p && v(!1);
|
3779
3646
|
}
|
3780
3647
|
}
|
3781
3648
|
),
|
3782
|
-
/* @__PURE__ */
|
3783
|
-
|
3649
|
+
/* @__PURE__ */ c.jsx(
|
3650
|
+
St,
|
3784
3651
|
{
|
3785
3652
|
index: 0,
|
3786
3653
|
options: [
|
@@ -3788,60 +3655,62 @@ function Ui(t) {
|
|
3788
3655
|
"Selection Mode"
|
3789
3656
|
],
|
3790
3657
|
onSelect: (d) => {
|
3791
|
-
|
3658
|
+
wt = d === "Selection Mode", lt.visible = wt;
|
3792
3659
|
},
|
3793
|
-
open:
|
3660
|
+
open: p,
|
3794
3661
|
onToggle: (d) => {
|
3795
|
-
|
3662
|
+
l && m(!1), s && u(!1), v(d);
|
3796
3663
|
}
|
3797
3664
|
}
|
3798
3665
|
)
|
3799
3666
|
] })
|
3800
3667
|
] });
|
3801
3668
|
}
|
3802
|
-
function
|
3803
|
-
return /* @__PURE__ */
|
3804
|
-
/* @__PURE__ */
|
3669
|
+
function Fi(t) {
|
3670
|
+
return /* @__PURE__ */ c.jsxs("div", { className: "editor", ref: t.ref, style: t.style, children: [
|
3671
|
+
/* @__PURE__ */ c.jsx("header", { children: t.header }),
|
3805
3672
|
t.children,
|
3806
|
-
/* @__PURE__ */
|
3673
|
+
/* @__PURE__ */ c.jsx("footer", { children: t.footer })
|
3807
3674
|
] });
|
3808
3675
|
}
|
3809
3676
|
export {
|
3810
|
-
|
3811
|
-
|
3812
|
-
|
3813
|
-
|
3814
|
-
|
3815
|
-
|
3816
|
-
|
3817
|
-
|
3818
|
-
|
3819
|
-
|
3820
|
-
|
3821
|
-
|
3822
|
-
|
3823
|
-
|
3824
|
-
|
3825
|
-
|
3826
|
-
|
3827
|
-
|
3828
|
-
Li as
|
3829
|
-
|
3830
|
-
|
3831
|
-
|
3832
|
-
|
3833
|
-
|
3834
|
-
|
3835
|
-
_a as colorToHex,
|
3677
|
+
Gt as Accordion,
|
3678
|
+
_i as Application,
|
3679
|
+
Yt as BaseRemote,
|
3680
|
+
In as ChildObject,
|
3681
|
+
Ha as ContainerObject,
|
3682
|
+
La as Draggable,
|
3683
|
+
Ia as DraggableItem,
|
3684
|
+
Na as Dropdown,
|
3685
|
+
Fa as DropdownItem,
|
3686
|
+
Fi as Editor,
|
3687
|
+
za as InfiniteGridHelper,
|
3688
|
+
di as Inspector,
|
3689
|
+
Ni as MultiView,
|
3690
|
+
jn as NavButton,
|
3691
|
+
Ai as RemoteComponents,
|
3692
|
+
ji as RemoteController,
|
3693
|
+
ki as RemoteThree,
|
3694
|
+
Di as RemoteTweakpane,
|
3695
|
+
Li as SceneInspector,
|
3696
|
+
Ii as SidePanel,
|
3697
|
+
D as ToolEvents,
|
3698
|
+
Va as UVMaterial,
|
3699
|
+
st as capitalize,
|
3700
|
+
Oi as clamp,
|
3701
|
+
Sa as colorToHex,
|
3836
3702
|
k as debugDispatcher,
|
3837
|
-
|
3838
|
-
|
3839
|
-
|
3840
|
-
|
3841
|
-
|
3842
|
-
|
3843
|
-
|
3844
|
-
|
3845
|
-
|
3846
|
-
|
3703
|
+
Si as defaultTheatreCallback,
|
3704
|
+
kn as dispose,
|
3705
|
+
Ma as disposeMaterial,
|
3706
|
+
Ri as disposeTexture,
|
3707
|
+
Mi as distance,
|
3708
|
+
Pn as hierarchyUUID,
|
3709
|
+
Ti as isColor,
|
3710
|
+
xa as noop,
|
3711
|
+
wa as randomID,
|
3712
|
+
Oa as resetThreeObjects,
|
3713
|
+
It as round,
|
3714
|
+
Pi as theatreEditorApp,
|
3715
|
+
Ut as totalThreeObjects
|
3847
3716
|
};
|