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