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