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