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