@tomorrowevening/hermes 0.0.7 → 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 +1588 -1494
- package/dist/hermes.umd.cjs +52 -14
- package/package.json +3 -1
- package/src/editor/sceneHierarchy/inspector/Inspector.tsx +5 -3
- 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/editor/sceneHierarchy/inspector/utils/InspectCamera.tsx +1 -1
- package/src/editor/sceneHierarchy/inspector/utils/InspectLight.tsx +3 -3
- package/src/editor/sceneHierarchy/inspector/utils/InspectMaterial.tsx +24 -8
- package/src/editor/sceneHierarchy/utils.ts +29 -23
- 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/editor/sceneHierarchy/inspector/utils/InspectCamera.d.ts +1 -1
- package/types/editor/sceneHierarchy/inspector/utils/InspectLight.d.ts +1 -1
- package/types/editor/sceneHierarchy/inspector/utils/InspectMaterial.d.ts +1 -1
- 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 wa {
|
|
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 wa {
|
|
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 I = new Yt(), 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 Ca extends ut {
|
|
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 An(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,55 +234,59 @@ function Nn(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,
|
270
270
|
type: t.type,
|
271
271
|
uuid: t.uuid,
|
272
272
|
visible: t.visible,
|
273
|
-
matrix: t.matrix.elements
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
273
|
+
matrix: t.matrix.elements,
|
274
|
+
material: void 0,
|
275
|
+
perspectiveCameraInfo: void 0,
|
276
|
+
orthographicCameraInfo: void 0,
|
277
|
+
lightInfo: void 0
|
278
|
+
}, a = t.type.toLowerCase();
|
279
|
+
if (a.search("mesh") > -1) {
|
280
|
+
const e = t;
|
281
|
+
if (Array.isArray(e.material)) {
|
282
|
+
const o = [];
|
283
|
+
e.material.forEach((u) => {
|
284
|
+
o.push(Ft(u));
|
285
|
+
}), n.material = o;
|
282
286
|
} else
|
283
|
-
n.material =
|
287
|
+
n.material = Ft(e.material);
|
284
288
|
} else
|
285
|
-
|
289
|
+
a.search("camera") > -1 ? t.type === "PerspectiveCamera" ? n.perspectiveCameraInfo = {
|
286
290
|
fov: t.fov,
|
287
291
|
zoom: t.zoom,
|
288
292
|
near: t.near,
|
@@ -291,7 +295,7 @@ function Ln(t) {
|
|
291
295
|
aspect: t.aspect,
|
292
296
|
filmGauge: t.filmGauge,
|
293
297
|
filmOffset: t.filmOffset
|
294
|
-
} : t
|
298
|
+
} : t.type === "OrthographicCamera" && (n.orthographicCameraInfo = {
|
295
299
|
zoom: t.zoom,
|
296
300
|
near: t.near,
|
297
301
|
far: t.far,
|
@@ -299,7 +303,7 @@ function Ln(t) {
|
|
299
303
|
right: t.right,
|
300
304
|
top: t.top,
|
301
305
|
bottom: t.bottom
|
302
|
-
}) :
|
306
|
+
}) : a.search("light") > -1 && (n.lightInfo = {
|
303
307
|
color: t.color,
|
304
308
|
intensity: t.intensity,
|
305
309
|
decay: t.decay,
|
@@ -310,85 +314,85 @@ function Ln(t) {
|
|
310
314
|
});
|
311
315
|
return n;
|
312
316
|
}
|
313
|
-
function
|
317
|
+
function K(t, n, a) {
|
314
318
|
const e = n.split(".");
|
315
319
|
switch (e.length) {
|
316
320
|
case 1:
|
317
|
-
t[e[0]] =
|
321
|
+
t[e[0]] = a;
|
318
322
|
break;
|
319
323
|
case 2:
|
320
|
-
t[e[0]][e[1]] =
|
324
|
+
t[e[0]][e[1]] = a;
|
321
325
|
break;
|
322
326
|
case 3:
|
323
|
-
t[e[0]][e[1]][e[2]] =
|
327
|
+
t[e[0]][e[1]][e[2]] = a;
|
324
328
|
break;
|
325
329
|
case 4:
|
326
|
-
t[e[0]][e[1]][e[2]][e[3]] =
|
330
|
+
t[e[0]][e[1]][e[2]][e[3]] = a;
|
327
331
|
break;
|
328
332
|
case 5:
|
329
|
-
t[e[0]][e[1]][e[2]][e[3]][e[4]] =
|
333
|
+
t[e[0]][e[1]][e[2]][e[3]][e[4]] = a;
|
330
334
|
break;
|
331
335
|
}
|
332
336
|
}
|
333
|
-
function
|
334
|
-
return new Promise((n,
|
337
|
+
function Tt(t) {
|
338
|
+
return new Promise((n, a) => {
|
335
339
|
const e = new Image();
|
336
340
|
e.onload = () => {
|
337
|
-
const
|
338
|
-
|
339
|
-
}, 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;
|
340
344
|
});
|
341
345
|
}
|
342
|
-
class
|
346
|
+
class _r extends mt {
|
343
347
|
constructor() {
|
344
348
|
super(...arguments);
|
345
|
-
|
349
|
+
L(this, "scene");
|
346
350
|
}
|
347
|
-
getObject(
|
351
|
+
getObject(a) {
|
348
352
|
this.app.send({
|
349
353
|
event: "getObject",
|
350
354
|
target: "app",
|
351
|
-
data:
|
355
|
+
data: a
|
352
356
|
});
|
353
357
|
}
|
354
|
-
setObject(
|
355
|
-
const e =
|
358
|
+
setObject(a) {
|
359
|
+
const e = Bn(a);
|
356
360
|
this.app.send({
|
357
361
|
event: "setObject",
|
358
362
|
target: "editor",
|
359
363
|
data: e
|
360
364
|
});
|
361
365
|
}
|
362
|
-
requestMethod(
|
366
|
+
requestMethod(a, e, o) {
|
363
367
|
this.app.send({
|
364
368
|
event: "requestMethod",
|
365
369
|
target: "app",
|
366
370
|
data: {
|
367
|
-
uuid:
|
371
|
+
uuid: a,
|
368
372
|
key: e,
|
369
|
-
value:
|
373
|
+
value: o
|
370
374
|
}
|
371
375
|
});
|
372
376
|
}
|
373
|
-
updateObject(
|
377
|
+
updateObject(a, e, o) {
|
374
378
|
this.app.send({
|
375
379
|
event: "updateObject",
|
376
380
|
target: "app",
|
377
381
|
data: {
|
378
|
-
uuid:
|
382
|
+
uuid: a,
|
379
383
|
key: e,
|
380
|
-
value:
|
384
|
+
value: o
|
381
385
|
}
|
382
386
|
});
|
383
387
|
}
|
384
|
-
createTexture(
|
388
|
+
createTexture(a, e, o) {
|
385
389
|
this.app.send({
|
386
390
|
event: "createTexture",
|
387
391
|
target: "app",
|
388
392
|
data: {
|
389
|
-
uuid:
|
393
|
+
uuid: a,
|
390
394
|
key: e,
|
391
|
-
value:
|
395
|
+
value: o
|
392
396
|
}
|
393
397
|
});
|
394
398
|
}
|
@@ -398,9 +402,9 @@ class Sa extends ut {
|
|
398
402
|
target: "app"
|
399
403
|
});
|
400
404
|
}
|
401
|
-
setScene(
|
402
|
-
this.scene =
|
403
|
-
const e =
|
405
|
+
setScene(a) {
|
406
|
+
this.scene = a, en(a);
|
407
|
+
const e = nn(a);
|
404
408
|
this.app.send({
|
405
409
|
event: "setScene",
|
406
410
|
target: "editor",
|
@@ -408,37 +412,37 @@ class Sa extends ut {
|
|
408
412
|
});
|
409
413
|
}
|
410
414
|
}
|
411
|
-
class
|
412
|
-
constructor(
|
413
|
-
super(
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
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();
|
421
425
|
}
|
422
426
|
createGUI() {
|
423
|
-
this.pane = new
|
427
|
+
this.pane = new jn({ title: "GUI" }), this.pane.registerPlugin(_n);
|
424
428
|
}
|
425
429
|
dispose() {
|
426
|
-
var
|
427
|
-
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);
|
428
432
|
}
|
429
|
-
addFolder(
|
433
|
+
addFolder(a, e = void 0, o = void 0) {
|
430
434
|
if (this.app.editor)
|
431
|
-
return this.pane === void 0 && this.createGUI(), (
|
432
|
-
title:
|
435
|
+
return this.pane === void 0 && this.createGUI(), (o !== void 0 ? o : this.pane).addFolder({
|
436
|
+
title: a,
|
433
437
|
...e
|
434
438
|
});
|
435
439
|
this.app.send({
|
436
440
|
event: "addFolder",
|
437
441
|
target: "app",
|
438
442
|
data: {
|
439
|
-
name:
|
443
|
+
name: a,
|
440
444
|
params: e,
|
441
|
-
parent:
|
445
|
+
parent: o
|
442
446
|
}
|
443
447
|
});
|
444
448
|
}
|
@@ -446,15 +450,15 @@ class Oa extends ut {
|
|
446
450
|
return `debug_${Math.max(this.appCallbacks, this.editorCallbacks)}`;
|
447
451
|
}
|
448
452
|
// Binding
|
449
|
-
bind(
|
450
|
-
const c = this.bindID, s =
|
451
|
-
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) => {
|
452
456
|
this.app.send({
|
453
457
|
event: "updateBind",
|
454
458
|
target: "app",
|
455
459
|
data: {
|
456
460
|
id: c,
|
457
|
-
value:
|
461
|
+
value: m.value
|
458
462
|
}
|
459
463
|
});
|
460
464
|
}), this.editorCallbacks++) : (this.app.send({
|
@@ -463,39 +467,39 @@ class Oa extends ut {
|
|
463
467
|
data: {
|
464
468
|
id: c,
|
465
469
|
name: e,
|
466
|
-
params:
|
467
|
-
parent:
|
470
|
+
params: o,
|
471
|
+
parent: u
|
468
472
|
}
|
469
473
|
}), this.appCallbacks++);
|
470
474
|
}
|
471
|
-
triggerBind(
|
472
|
-
const
|
473
|
-
|
475
|
+
triggerBind(a, e) {
|
476
|
+
const o = this.bindCBs.get(a);
|
477
|
+
o !== void 0 ? o(e) : console.warn(`No callback for: ${a}`, e);
|
474
478
|
}
|
475
479
|
// Buttons
|
476
|
-
button(
|
477
|
-
const
|
478
|
-
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", () => {
|
479
483
|
this.app.send({
|
480
484
|
event: "clickButton",
|
481
485
|
target: "app",
|
482
486
|
data: {
|
483
|
-
id:
|
487
|
+
id: u
|
484
488
|
}
|
485
489
|
});
|
486
490
|
}), this.editorCallbacks++) : (this.app.send({
|
487
491
|
event: "addButton",
|
488
492
|
target: "app",
|
489
493
|
data: {
|
490
|
-
id:
|
491
|
-
name:
|
494
|
+
id: u,
|
495
|
+
name: a,
|
492
496
|
callback: e,
|
493
|
-
parent:
|
497
|
+
parent: o
|
494
498
|
}
|
495
499
|
}), this.appCallbacks++);
|
496
500
|
}
|
497
|
-
triggerButton(
|
498
|
-
const e = this.buttonCBs.get(
|
501
|
+
triggerButton(a) {
|
502
|
+
const e = this.buttonCBs.get(a);
|
499
503
|
e !== void 0 && e();
|
500
504
|
}
|
501
505
|
// Inspector
|
@@ -503,12 +507,12 @@ class Oa extends ut {
|
|
503
507
|
this.inspectorFolder = this.addFolder("Inspector", this.pane);
|
504
508
|
}
|
505
509
|
clearInspector() {
|
506
|
-
const
|
507
|
-
for (let e =
|
510
|
+
const a = this.inspectorFolder.children.length - 1;
|
511
|
+
for (let e = a; e > -1; --e)
|
508
512
|
this.inspectorFolder.remove(this.inspectorFolder.children[e]);
|
509
513
|
}
|
510
514
|
}
|
511
|
-
var
|
515
|
+
var Ot = { exports: {} }, Je = {};
|
512
516
|
/**
|
513
517
|
* @license React
|
514
518
|
* react-jsx-runtime.production.min.js
|
@@ -518,25 +522,25 @@ var Et = { exports: {} }, He = {};
|
|
518
522
|
* This source code is licensed under the MIT license found in the
|
519
523
|
* LICENSE file in the root directory of this source tree.
|
520
524
|
*/
|
521
|
-
var
|
522
|
-
function
|
523
|
-
if (
|
524
|
-
return
|
525
|
-
|
526
|
-
var t =
|
527
|
-
function c(s,
|
528
|
-
var
|
529
|
-
|
530
|
-
for (
|
531
|
-
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]);
|
532
536
|
if (s && s.defaultProps)
|
533
|
-
for (
|
534
|
-
|
535
|
-
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 };
|
536
540
|
}
|
537
|
-
return
|
541
|
+
return Je.Fragment = a, Je.jsx = c, Je.jsxs = c, Je;
|
538
542
|
}
|
539
|
-
var
|
543
|
+
var Qe = {};
|
540
544
|
/**
|
541
545
|
* @license React
|
542
546
|
* react-jsx-runtime.development.js
|
@@ -546,91 +550,91 @@ var Ke = {};
|
|
546
550
|
* This source code is licensed under the MIT license found in the
|
547
551
|
* LICENSE file in the root directory of this source tree.
|
548
552
|
*/
|
549
|
-
var
|
550
|
-
function
|
551
|
-
return
|
552
|
-
var t =
|
553
|
-
function
|
554
|
-
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")
|
555
559
|
return null;
|
556
|
-
var
|
557
|
-
return typeof
|
560
|
+
var p = E && r[E] || r[w];
|
561
|
+
return typeof p == "function" ? p : null;
|
558
562
|
}
|
559
|
-
var
|
560
|
-
function
|
563
|
+
var U = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
564
|
+
function j(r) {
|
561
565
|
{
|
562
|
-
for (var
|
563
|
-
|
564
|
-
|
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);
|
565
569
|
}
|
566
570
|
}
|
567
|
-
function
|
571
|
+
function X(r, p, b) {
|
568
572
|
{
|
569
|
-
var x =
|
570
|
-
|
571
|
-
var _ =
|
572
|
-
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);
|
573
577
|
});
|
574
|
-
_.unshift("Warning: " +
|
578
|
+
_.unshift("Warning: " + p), Function.prototype.apply.call(console[r], console, _);
|
575
579
|
}
|
576
580
|
}
|
577
|
-
var
|
578
|
-
|
579
|
-
function
|
580
|
-
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
|
581
585
|
// types supported by any Flight configuration anywhere since
|
582
586
|
// we don't know which Flight build this will end up being used
|
583
587
|
// with.
|
584
|
-
|
588
|
+
r.$$typeof === ge || r.getModuleId !== void 0));
|
585
589
|
}
|
586
|
-
function
|
587
|
-
var x =
|
590
|
+
function ve(r, p, b) {
|
591
|
+
var x = r.displayName;
|
588
592
|
if (x)
|
589
593
|
return x;
|
590
|
-
var
|
591
|
-
return
|
594
|
+
var M = p.displayName || p.name || "";
|
595
|
+
return M !== "" ? b + "(" + M + ")" : b;
|
592
596
|
}
|
593
|
-
function
|
594
|
-
return
|
597
|
+
function be(r) {
|
598
|
+
return r.displayName || "Context";
|
595
599
|
}
|
596
|
-
function
|
597
|
-
if (
|
600
|
+
function te(r) {
|
601
|
+
if (r == null)
|
598
602
|
return null;
|
599
|
-
if (typeof
|
600
|
-
return
|
601
|
-
if (typeof
|
602
|
-
return
|
603
|
-
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) {
|
604
608
|
case e:
|
605
609
|
return "Fragment";
|
606
|
-
case
|
610
|
+
case a:
|
607
611
|
return "Portal";
|
608
|
-
case
|
612
|
+
case u:
|
609
613
|
return "Profiler";
|
610
|
-
case
|
614
|
+
case o:
|
611
615
|
return "StrictMode";
|
612
|
-
case h:
|
613
|
-
return "Suspense";
|
614
616
|
case m:
|
617
|
+
return "Suspense";
|
618
|
+
case v:
|
615
619
|
return "SuspenseList";
|
616
620
|
}
|
617
|
-
if (typeof
|
618
|
-
switch (
|
621
|
+
if (typeof r == "object")
|
622
|
+
switch (r.$$typeof) {
|
619
623
|
case s:
|
620
|
-
var
|
621
|
-
return
|
624
|
+
var p = r;
|
625
|
+
return be(p) + ".Consumer";
|
622
626
|
case c:
|
623
|
-
var
|
624
|
-
return
|
625
|
-
case
|
626
|
-
return
|
627
|
-
case
|
628
|
-
var x =
|
629
|
-
return x !== null ? x :
|
630
|
-
case
|
631
|
-
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;
|
632
636
|
try {
|
633
|
-
return
|
637
|
+
return te(T(_));
|
634
638
|
} catch {
|
635
639
|
return null;
|
636
640
|
}
|
@@ -638,511 +642,511 @@ function Un() {
|
|
638
642
|
}
|
639
643
|
return null;
|
640
644
|
}
|
641
|
-
var
|
642
|
-
function
|
645
|
+
var oe = Object.assign, ne = 0, Pe, Ge, je, _e, Ve, nt, Ye;
|
646
|
+
function rt() {
|
643
647
|
}
|
644
|
-
|
645
|
-
function
|
648
|
+
rt.__reactDisabledLog = !0;
|
649
|
+
function vt() {
|
646
650
|
{
|
647
|
-
if (
|
648
|
-
Pe = console.log,
|
649
|
-
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 = {
|
650
654
|
configurable: !0,
|
651
655
|
enumerable: !0,
|
652
|
-
value:
|
656
|
+
value: rt,
|
653
657
|
writable: !0
|
654
658
|
};
|
655
659
|
Object.defineProperties(console, {
|
656
|
-
info:
|
657
|
-
log:
|
658
|
-
warn:
|
659
|
-
error:
|
660
|
-
group:
|
661
|
-
groupCollapsed:
|
662
|
-
groupEnd:
|
660
|
+
info: r,
|
661
|
+
log: r,
|
662
|
+
warn: r,
|
663
|
+
error: r,
|
664
|
+
group: r,
|
665
|
+
groupCollapsed: r,
|
666
|
+
groupEnd: r
|
663
667
|
});
|
664
668
|
}
|
665
|
-
|
669
|
+
ne++;
|
666
670
|
}
|
667
671
|
}
|
668
|
-
function
|
672
|
+
function bt() {
|
669
673
|
{
|
670
|
-
if (
|
671
|
-
var
|
674
|
+
if (ne--, ne === 0) {
|
675
|
+
var r = {
|
672
676
|
configurable: !0,
|
673
677
|
enumerable: !0,
|
674
678
|
writable: !0
|
675
679
|
};
|
676
680
|
Object.defineProperties(console, {
|
677
|
-
log:
|
681
|
+
log: oe({}, r, {
|
678
682
|
value: Pe
|
679
683
|
}),
|
680
|
-
info:
|
681
|
-
value:
|
684
|
+
info: oe({}, r, {
|
685
|
+
value: Ge
|
682
686
|
}),
|
683
|
-
warn:
|
684
|
-
value:
|
687
|
+
warn: oe({}, r, {
|
688
|
+
value: je
|
685
689
|
}),
|
686
|
-
error:
|
687
|
-
value:
|
690
|
+
error: oe({}, r, {
|
691
|
+
value: _e
|
688
692
|
}),
|
689
|
-
group:
|
690
|
-
value:
|
693
|
+
group: oe({}, r, {
|
694
|
+
value: Ve
|
691
695
|
}),
|
692
|
-
groupCollapsed:
|
693
|
-
value:
|
696
|
+
groupCollapsed: oe({}, r, {
|
697
|
+
value: nt
|
694
698
|
}),
|
695
|
-
groupEnd:
|
696
|
-
value:
|
699
|
+
groupEnd: oe({}, r, {
|
700
|
+
value: Ye
|
697
701
|
})
|
698
702
|
});
|
699
703
|
}
|
700
|
-
|
704
|
+
ne < 0 && j("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
701
705
|
}
|
702
706
|
}
|
703
|
-
var
|
704
|
-
function
|
707
|
+
var ze = U.ReactCurrentDispatcher, We;
|
708
|
+
function ye(r, p, b) {
|
705
709
|
{
|
706
|
-
if (
|
710
|
+
if (We === void 0)
|
707
711
|
try {
|
708
712
|
throw Error();
|
709
|
-
} catch (
|
710
|
-
var x =
|
711
|
-
|
713
|
+
} catch (M) {
|
714
|
+
var x = M.stack.trim().match(/\n( *(at )?)/);
|
715
|
+
We = x && x[1] || "";
|
712
716
|
}
|
713
717
|
return `
|
714
|
-
` +
|
718
|
+
` + We + r;
|
715
719
|
}
|
716
720
|
}
|
717
|
-
var
|
721
|
+
var ke = !1, Ee;
|
718
722
|
{
|
719
|
-
var
|
720
|
-
|
723
|
+
var yt = typeof WeakMap == "function" ? WeakMap : Map;
|
724
|
+
Ee = new yt();
|
721
725
|
}
|
722
|
-
function
|
723
|
-
if (!
|
726
|
+
function at(r, p) {
|
727
|
+
if (!r || ke)
|
724
728
|
return "";
|
725
729
|
{
|
726
|
-
var
|
727
|
-
if (
|
728
|
-
return
|
730
|
+
var b = Ee.get(r);
|
731
|
+
if (b !== void 0)
|
732
|
+
return b;
|
729
733
|
}
|
730
734
|
var x;
|
731
|
-
|
732
|
-
var
|
735
|
+
ke = !0;
|
736
|
+
var M = Error.prepareStackTrace;
|
733
737
|
Error.prepareStackTrace = void 0;
|
734
738
|
var _;
|
735
|
-
_ =
|
739
|
+
_ = ze.current, ze.current = null, vt();
|
736
740
|
try {
|
737
|
-
if (
|
738
|
-
var
|
741
|
+
if (p) {
|
742
|
+
var T = function() {
|
739
743
|
throw Error();
|
740
744
|
};
|
741
|
-
if (Object.defineProperty(
|
745
|
+
if (Object.defineProperty(T.prototype, "props", {
|
742
746
|
set: function() {
|
743
747
|
throw Error();
|
744
748
|
}
|
745
749
|
}), typeof Reflect == "object" && Reflect.construct) {
|
746
750
|
try {
|
747
|
-
Reflect.construct(
|
748
|
-
} catch (
|
749
|
-
x =
|
751
|
+
Reflect.construct(T, []);
|
752
|
+
} catch (ue) {
|
753
|
+
x = ue;
|
750
754
|
}
|
751
|
-
Reflect.construct(
|
755
|
+
Reflect.construct(r, [], T);
|
752
756
|
} else {
|
753
757
|
try {
|
754
|
-
|
755
|
-
} catch (
|
756
|
-
x =
|
758
|
+
T.call();
|
759
|
+
} catch (ue) {
|
760
|
+
x = ue;
|
757
761
|
}
|
758
|
-
|
762
|
+
r.call(T.prototype);
|
759
763
|
}
|
760
764
|
} else {
|
761
765
|
try {
|
762
766
|
throw Error();
|
763
|
-
} catch (
|
764
|
-
x =
|
767
|
+
} catch (ue) {
|
768
|
+
x = ue;
|
765
769
|
}
|
766
|
-
|
770
|
+
r();
|
767
771
|
}
|
768
|
-
} catch (
|
769
|
-
if (
|
770
|
-
for (var
|
771
|
-
`),
|
772
|
-
`),
|
773
|
-
|
774
|
-
for (;
|
775
|
-
if (
|
776
|
-
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)
|
777
781
|
do
|
778
|
-
if (
|
779
|
-
var
|
780
|
-
` +
|
781
|
-
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;
|
782
786
|
}
|
783
|
-
while (
|
787
|
+
while (N >= 1 && B >= 0);
|
784
788
|
break;
|
785
789
|
}
|
786
790
|
}
|
787
791
|
} finally {
|
788
|
-
|
792
|
+
ke = !1, ze.current = _, bt(), Error.prepareStackTrace = M;
|
789
793
|
}
|
790
|
-
var
|
791
|
-
return typeof
|
794
|
+
var Ne = r ? r.displayName || r.name : "", Dt = Ne ? ye(Ne) : "";
|
795
|
+
return typeof r == "function" && Ee.set(r, Dt), Dt;
|
792
796
|
}
|
793
|
-
function
|
794
|
-
return
|
797
|
+
function it(r, p, b) {
|
798
|
+
return at(r, !1);
|
795
799
|
}
|
796
|
-
function
|
797
|
-
var
|
798
|
-
return !!(
|
800
|
+
function ot(r) {
|
801
|
+
var p = r.prototype;
|
802
|
+
return !!(p && p.isReactComponent);
|
799
803
|
}
|
800
|
-
function
|
801
|
-
if (
|
804
|
+
function xe(r, p, b) {
|
805
|
+
if (r == null)
|
802
806
|
return "";
|
803
|
-
if (typeof
|
804
|
-
return
|
805
|
-
if (typeof
|
806
|
-
return
|
807
|
-
switch (
|
808
|
-
case h:
|
809
|
-
return pe("Suspense");
|
807
|
+
if (typeof r == "function")
|
808
|
+
return at(r, ot(r));
|
809
|
+
if (typeof r == "string")
|
810
|
+
return ye(r);
|
811
|
+
switch (r) {
|
810
812
|
case m:
|
811
|
-
return
|
813
|
+
return ye("Suspense");
|
814
|
+
case v:
|
815
|
+
return ye("SuspenseList");
|
812
816
|
}
|
813
|
-
if (typeof
|
814
|
-
switch (
|
815
|
-
case
|
816
|
-
return
|
817
|
-
case
|
818
|
-
return
|
819
|
-
case
|
820
|
-
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;
|
821
825
|
try {
|
822
|
-
return
|
826
|
+
return xe(_(M), p, b);
|
823
827
|
} catch {
|
824
828
|
}
|
825
829
|
}
|
826
830
|
}
|
827
831
|
return "";
|
828
832
|
}
|
829
|
-
var
|
830
|
-
function
|
831
|
-
if (
|
832
|
-
var
|
833
|
-
|
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);
|
834
838
|
} else
|
835
|
-
|
839
|
+
He.setExtraStackFrame(null);
|
836
840
|
}
|
837
|
-
function
|
841
|
+
function we(r, p, b, x, M) {
|
838
842
|
{
|
839
|
-
var _ = Function.call.bind(
|
840
|
-
for (var
|
841
|
-
if (_(
|
842
|
-
var
|
843
|
+
var _ = Function.call.bind(De);
|
844
|
+
for (var T in r)
|
845
|
+
if (_(r, T)) {
|
846
|
+
var C = void 0;
|
843
847
|
try {
|
844
|
-
if (typeof
|
845
|
-
var
|
846
|
-
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;
|
847
851
|
}
|
848
|
-
|
849
|
-
} catch (
|
850
|
-
|
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;
|
851
855
|
}
|
852
|
-
|
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));
|
853
857
|
}
|
854
858
|
}
|
855
859
|
}
|
856
|
-
var
|
857
|
-
function
|
858
|
-
return
|
860
|
+
var Et = Array.isArray;
|
861
|
+
function Ke(r) {
|
862
|
+
return Et(r);
|
859
863
|
}
|
860
|
-
function
|
864
|
+
function ct(r) {
|
861
865
|
{
|
862
|
-
var
|
863
|
-
return
|
866
|
+
var p = typeof Symbol == "function" && Symbol.toStringTag, b = p && r[Symbol.toStringTag] || r.constructor.name || "Object";
|
867
|
+
return b;
|
864
868
|
}
|
865
869
|
}
|
866
|
-
function
|
870
|
+
function Xe(r) {
|
867
871
|
try {
|
868
|
-
return
|
872
|
+
return lt(r), !1;
|
869
873
|
} catch {
|
870
874
|
return !0;
|
871
875
|
}
|
872
876
|
}
|
873
|
-
function
|
874
|
-
return "" +
|
877
|
+
function lt(r) {
|
878
|
+
return "" + r;
|
875
879
|
}
|
876
|
-
function
|
877
|
-
if (
|
878
|
-
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);
|
879
883
|
}
|
880
|
-
var
|
884
|
+
var he = U.ReactCurrentOwner, xt = {
|
881
885
|
key: !0,
|
882
886
|
ref: !0,
|
883
887
|
__self: !0,
|
884
888
|
__source: !0
|
885
|
-
},
|
886
|
-
|
887
|
-
function
|
888
|
-
if (
|
889
|
-
var
|
890
|
-
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)
|
891
895
|
return !1;
|
892
896
|
}
|
893
|
-
return
|
897
|
+
return r.ref !== void 0;
|
894
898
|
}
|
895
|
-
function
|
896
|
-
if (
|
897
|
-
var
|
898
|
-
if (
|
899
|
+
function y(r) {
|
900
|
+
if (De.call(r, "key")) {
|
901
|
+
var p = Object.getOwnPropertyDescriptor(r, "key").get;
|
902
|
+
if (p && p.isReactWarning)
|
899
903
|
return !1;
|
900
904
|
}
|
901
|
-
return
|
905
|
+
return r.key !== void 0;
|
902
906
|
}
|
903
|
-
function
|
904
|
-
if (typeof
|
905
|
-
var
|
906
|
-
|
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);
|
907
911
|
}
|
908
912
|
}
|
909
|
-
function
|
913
|
+
function P(r, p) {
|
910
914
|
{
|
911
|
-
var
|
912
|
-
|
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));
|
913
917
|
};
|
914
|
-
|
915
|
-
get:
|
918
|
+
b.isReactWarning = !0, Object.defineProperty(r, "key", {
|
919
|
+
get: b,
|
916
920
|
configurable: !0
|
917
921
|
});
|
918
922
|
}
|
919
923
|
}
|
920
|
-
function
|
924
|
+
function V(r, p) {
|
921
925
|
{
|
922
|
-
var
|
923
|
-
|
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));
|
924
928
|
};
|
925
|
-
|
926
|
-
get:
|
929
|
+
b.isReactWarning = !0, Object.defineProperty(r, "ref", {
|
930
|
+
get: b,
|
927
931
|
configurable: !0
|
928
932
|
});
|
929
933
|
}
|
930
934
|
}
|
931
|
-
var
|
932
|
-
var
|
935
|
+
var ce = function(r, p, b, x, M, _, T) {
|
936
|
+
var C = {
|
933
937
|
// This tag allows us to uniquely identify this as a React Element
|
934
938
|
$$typeof: n,
|
935
939
|
// Built-in properties that belong on the element
|
936
|
-
type:
|
937
|
-
key:
|
938
|
-
ref:
|
939
|
-
props:
|
940
|
+
type: r,
|
941
|
+
key: p,
|
942
|
+
ref: b,
|
943
|
+
props: T,
|
940
944
|
// Record the component responsible for creating this element.
|
941
945
|
_owner: _
|
942
946
|
};
|
943
|
-
return
|
947
|
+
return C._store = {}, Object.defineProperty(C._store, "validated", {
|
944
948
|
configurable: !1,
|
945
949
|
enumerable: !1,
|
946
950
|
writable: !0,
|
947
951
|
value: !1
|
948
|
-
}), Object.defineProperty(
|
952
|
+
}), Object.defineProperty(C, "_self", {
|
949
953
|
configurable: !1,
|
950
954
|
enumerable: !1,
|
951
955
|
writable: !1,
|
952
956
|
value: x
|
953
|
-
}), Object.defineProperty(
|
957
|
+
}), Object.defineProperty(C, "_source", {
|
954
958
|
configurable: !1,
|
955
959
|
enumerable: !1,
|
956
960
|
writable: !1,
|
957
|
-
value:
|
958
|
-
}), Object.freeze && (Object.freeze(
|
961
|
+
value: M
|
962
|
+
}), Object.freeze && (Object.freeze(C.props), Object.freeze(C)), C;
|
959
963
|
};
|
960
|
-
function
|
964
|
+
function q(r, p, b, x, M) {
|
961
965
|
{
|
962
|
-
var _,
|
963
|
-
|
964
|
-
for (_ in
|
965
|
-
|
966
|
-
if (
|
967
|
-
var
|
968
|
-
for (_ in
|
969
|
-
|
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[_]);
|
970
974
|
}
|
971
|
-
if (
|
972
|
-
var
|
973
|
-
|
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);
|
974
978
|
}
|
975
|
-
return
|
979
|
+
return ce(r, C, W, M, x, he.current, T);
|
976
980
|
}
|
977
981
|
}
|
978
|
-
var
|
979
|
-
function
|
980
|
-
if (
|
981
|
-
var
|
982
|
-
|
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);
|
983
987
|
} else
|
984
|
-
|
988
|
+
ht.setExtraStackFrame(null);
|
985
989
|
}
|
986
|
-
var
|
987
|
-
|
988
|
-
function
|
989
|
-
return typeof
|
990
|
+
var J;
|
991
|
+
J = !1;
|
992
|
+
function Q(r) {
|
993
|
+
return typeof r == "object" && r !== null && r.$$typeof === n;
|
990
994
|
}
|
991
|
-
function
|
995
|
+
function Ie() {
|
992
996
|
{
|
993
|
-
if (
|
994
|
-
var
|
995
|
-
if (
|
997
|
+
if (ft.current) {
|
998
|
+
var r = te(ft.current.type);
|
999
|
+
if (r)
|
996
1000
|
return `
|
997
1001
|
|
998
|
-
Check the render method of \`` +
|
1002
|
+
Check the render method of \`` + r + "`.";
|
999
1003
|
}
|
1000
1004
|
return "";
|
1001
1005
|
}
|
1002
1006
|
}
|
1003
|
-
function
|
1007
|
+
function Ce(r) {
|
1004
1008
|
{
|
1005
|
-
if (
|
1006
|
-
var
|
1009
|
+
if (r !== void 0) {
|
1010
|
+
var p = r.fileName.replace(/^.*[\\\/]/, ""), b = r.lineNumber;
|
1007
1011
|
return `
|
1008
1012
|
|
1009
|
-
Check your code at ` +
|
1013
|
+
Check your code at ` + p + ":" + b + ".";
|
1010
1014
|
}
|
1011
1015
|
return "";
|
1012
1016
|
}
|
1013
1017
|
}
|
1014
|
-
var
|
1015
|
-
function
|
1018
|
+
var pe = {};
|
1019
|
+
function Ae(r) {
|
1016
1020
|
{
|
1017
|
-
var
|
1018
|
-
if (!
|
1019
|
-
var
|
1020
|
-
|
1021
|
+
var p = Ie();
|
1022
|
+
if (!p) {
|
1023
|
+
var b = typeof r == "string" ? r : r.displayName || r.name;
|
1024
|
+
b && (p = `
|
1021
1025
|
|
1022
|
-
Check the top-level render call using <` +
|
1026
|
+
Check the top-level render call using <` + b + ">.");
|
1023
1027
|
}
|
1024
|
-
return
|
1028
|
+
return p;
|
1025
1029
|
}
|
1026
1030
|
}
|
1027
|
-
function
|
1031
|
+
function jt(r, p) {
|
1028
1032
|
{
|
1029
|
-
if (!
|
1033
|
+
if (!r._store || r._store.validated || r.key != null)
|
1030
1034
|
return;
|
1031
|
-
|
1032
|
-
var
|
1033
|
-
if (
|
1035
|
+
r._store.validated = !0;
|
1036
|
+
var b = Ae(p);
|
1037
|
+
if (pe[b])
|
1034
1038
|
return;
|
1035
|
-
|
1039
|
+
pe[b] = !0;
|
1036
1040
|
var x = "";
|
1037
|
-
|
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);
|
1038
1042
|
}
|
1039
1043
|
}
|
1040
|
-
function
|
1044
|
+
function _t(r, p) {
|
1041
1045
|
{
|
1042
|
-
if (typeof
|
1046
|
+
if (typeof r != "object")
|
1043
1047
|
return;
|
1044
|
-
if (
|
1045
|
-
for (var
|
1046
|
-
var x =
|
1047
|
-
|
1048
|
+
if (Ke(r))
|
1049
|
+
for (var b = 0; b < r.length; b++) {
|
1050
|
+
var x = r[b];
|
1051
|
+
Q(x) && jt(x, p);
|
1048
1052
|
}
|
1049
|
-
else if (
|
1050
|
-
|
1051
|
-
else if (
|
1052
|
-
var
|
1053
|
-
if (typeof
|
1054
|
-
for (var _ =
|
1055
|
-
|
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);
|
1056
1060
|
}
|
1057
1061
|
}
|
1058
1062
|
}
|
1059
|
-
function
|
1063
|
+
function on(r) {
|
1060
1064
|
{
|
1061
|
-
var
|
1062
|
-
if (
|
1065
|
+
var p = r.type;
|
1066
|
+
if (p == null || typeof p == "string")
|
1063
1067
|
return;
|
1064
|
-
var
|
1065
|
-
if (typeof
|
1066
|
-
|
1067
|
-
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.
|
1068
1072
|
// Inner props are checked in the reconciler.
|
1069
|
-
|
1070
|
-
|
1073
|
+
p.$$typeof === f))
|
1074
|
+
b = p.propTypes;
|
1071
1075
|
else
|
1072
1076
|
return;
|
1073
|
-
if (
|
1074
|
-
var x =
|
1075
|
-
|
1076
|
-
} else if (
|
1077
|
-
|
1078
|
-
var
|
1079
|
-
|
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");
|
1080
1084
|
}
|
1081
|
-
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.");
|
1082
1086
|
}
|
1083
1087
|
}
|
1084
|
-
function
|
1088
|
+
function sn(r) {
|
1085
1089
|
{
|
1086
|
-
for (var
|
1087
|
-
var x =
|
1090
|
+
for (var p = Object.keys(r.props), b = 0; b < p.length; b++) {
|
1091
|
+
var x = p[b];
|
1088
1092
|
if (x !== "children" && x !== "key") {
|
1089
|
-
|
1093
|
+
le(r), j("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", x), le(null);
|
1090
1094
|
break;
|
1091
1095
|
}
|
1092
1096
|
}
|
1093
|
-
|
1097
|
+
r.ref !== null && (le(r), j("Invalid attribute `ref` supplied to `React.Fragment`."), le(null));
|
1094
1098
|
}
|
1095
1099
|
}
|
1096
|
-
function
|
1100
|
+
function kt(r, p, b, x, M, _) {
|
1097
1101
|
{
|
1098
|
-
var
|
1099
|
-
if (!
|
1100
|
-
var
|
1101
|
-
(
|
1102
|
-
var
|
1103
|
-
|
1104
|
-
var
|
1105
|
-
|
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);
|
1106
1110
|
}
|
1107
|
-
var
|
1108
|
-
if (
|
1109
|
-
return
|
1110
|
-
if (
|
1111
|
-
var
|
1112
|
-
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)
|
1113
1117
|
if (x)
|
1114
|
-
if (
|
1115
|
-
for (var
|
1116
|
-
|
1117
|
-
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);
|
1118
1122
|
} else
|
1119
|
-
|
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.");
|
1120
1124
|
else
|
1121
|
-
|
1125
|
+
_t(re, r);
|
1122
1126
|
}
|
1123
|
-
return
|
1127
|
+
return r === e ? sn(B) : on(B), B;
|
1124
1128
|
}
|
1125
1129
|
}
|
1126
|
-
function
|
1127
|
-
return
|
1130
|
+
function cn(r, p, b) {
|
1131
|
+
return kt(r, p, b, !0);
|
1128
1132
|
}
|
1129
|
-
function
|
1130
|
-
return
|
1133
|
+
function ln(r, p, b) {
|
1134
|
+
return kt(r, p, b, !1);
|
1131
1135
|
}
|
1132
|
-
var
|
1133
|
-
|
1134
|
-
}()),
|
1136
|
+
var un = ln, dn = cn;
|
1137
|
+
Qe.Fragment = e, Qe.jsx = un, Qe.jsxs = dn;
|
1138
|
+
}()), Qe;
|
1135
1139
|
}
|
1136
|
-
process.env.NODE_ENV === "production" ?
|
1137
|
-
var
|
1138
|
-
function
|
1139
|
-
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 });
|
1140
1144
|
}
|
1141
|
-
const
|
1142
|
-
/* @__PURE__ */
|
1143
|
-
/* @__PURE__ */
|
1144
|
-
/* @__PURE__ */
|
1145
|
-
] }),
|
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(
|
1146
1150
|
"path",
|
1147
1151
|
{
|
1148
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
|
@@ -1150,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
|
|
1150
1154
|
C11,8.22,10.74,8,10.43,8z`
|
1151
1155
|
}
|
1152
1156
|
) });
|
1153
|
-
function
|
1154
|
-
return /* @__PURE__ */
|
1155
|
-
|
1156
|
-
/* @__PURE__ */
|
1157
|
-
/* @__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: () => {
|
1158
1162
|
t.onDelete(t.index);
|
1159
|
-
}, children:
|
1163
|
+
}, children: Vn })
|
1160
1164
|
] }) }, t.title);
|
1161
1165
|
}
|
1162
|
-
function
|
1163
|
-
const [n,
|
1164
|
-
t.onDragComplete(
|
1165
|
-
}, c = (
|
1166
|
-
const
|
1167
|
-
|
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);
|
1168
1172
|
}, s = [];
|
1169
|
-
e.forEach((
|
1170
|
-
s.push(/* @__PURE__ */
|
1173
|
+
e.forEach((m, v) => {
|
1174
|
+
s.push(/* @__PURE__ */ l.jsx(zn, { index: v, title: m, onDelete: c }, m));
|
1171
1175
|
});
|
1172
|
-
let
|
1173
|
-
return t.subdropdown && (
|
1174
|
-
/* @__PURE__ */
|
1175
|
-
/* @__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 })
|
1176
1180
|
] });
|
1177
1181
|
}
|
1178
|
-
function
|
1179
|
-
const [n,
|
1180
|
-
t.options.map((
|
1181
|
-
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));
|
1182
1186
|
});
|
1183
|
-
let
|
1184
|
-
return t.subdropdown && (
|
1187
|
+
let o = "dropdown";
|
1188
|
+
return t.subdropdown && (o += " subdropdown"), /* @__PURE__ */ l.jsxs(
|
1185
1189
|
"div",
|
1186
1190
|
{
|
1187
|
-
className:
|
1188
|
-
onMouseEnter: () =>
|
1189
|
-
onMouseLeave: () =>
|
1191
|
+
className: o,
|
1192
|
+
onMouseEnter: () => a(!0),
|
1193
|
+
onMouseLeave: () => a(!1),
|
1190
1194
|
children: [
|
1191
|
-
/* @__PURE__ */
|
1192
|
-
/* @__PURE__ */
|
1195
|
+
/* @__PURE__ */ l.jsx(rn, { title: t.title }),
|
1196
|
+
/* @__PURE__ */ l.jsx(
|
1193
1197
|
"ul",
|
1194
1198
|
{
|
1195
1199
|
style: { visibility: n ? "visible" : "hidden" },
|
@@ -1200,26 +1204,26 @@ function Vn(t) {
|
|
1200
1204
|
}
|
1201
1205
|
);
|
1202
1206
|
}
|
1203
|
-
function
|
1204
|
-
const { option: n } = t, [
|
1205
|
-
let
|
1207
|
+
function Kn(t) {
|
1208
|
+
const { option: n } = t, [a, e] = ie("");
|
1209
|
+
let o;
|
1206
1210
|
switch (n.type) {
|
1207
1211
|
case "draggable":
|
1208
|
-
|
1209
|
-
|
1212
|
+
o = /* @__PURE__ */ l.jsx(
|
1213
|
+
Wn,
|
1210
1214
|
{
|
1211
1215
|
title: n.title,
|
1212
1216
|
options: n.value,
|
1213
|
-
onDragComplete: (
|
1214
|
-
n.onDragComplete !== void 0 && n.onDragComplete(
|
1217
|
+
onDragComplete: (u) => {
|
1218
|
+
n.onDragComplete !== void 0 && n.onDragComplete(u);
|
1215
1219
|
},
|
1216
1220
|
subdropdown: !0
|
1217
1221
|
}
|
1218
1222
|
);
|
1219
1223
|
break;
|
1220
1224
|
case "dropdown":
|
1221
|
-
|
1222
|
-
|
1225
|
+
o = /* @__PURE__ */ l.jsx(
|
1226
|
+
Hn,
|
1223
1227
|
{
|
1224
1228
|
title: n.title,
|
1225
1229
|
options: n.value,
|
@@ -1229,173 +1233,347 @@ function zn(t) {
|
|
1229
1233
|
);
|
1230
1234
|
break;
|
1231
1235
|
case "option":
|
1232
|
-
|
1236
|
+
o = /* @__PURE__ */ l.jsx(
|
1233
1237
|
"button",
|
1234
1238
|
{
|
1235
1239
|
onClick: () => {
|
1236
|
-
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(""));
|
1237
1241
|
},
|
1238
1242
|
children: n.title
|
1239
1243
|
}
|
1240
1244
|
);
|
1241
1245
|
break;
|
1242
1246
|
}
|
1243
|
-
return /* @__PURE__ */
|
1247
|
+
return /* @__PURE__ */ l.jsx("li", { className: a === n.title ? "selected" : "", children: o }, In());
|
1244
1248
|
}
|
1245
|
-
function
|
1249
|
+
function Dr(t) {
|
1246
1250
|
let n;
|
1247
|
-
function
|
1248
|
-
var
|
1251
|
+
function a(c) {
|
1252
|
+
var d, m, v, f, h, g, E, w, A;
|
1249
1253
|
let s;
|
1250
1254
|
switch (c.event) {
|
1251
1255
|
case "custom":
|
1252
|
-
|
1256
|
+
k.dispatchEvent({ type: D.CUSTOM, value: c.data });
|
1253
1257
|
break;
|
1254
1258
|
case "selectComponent":
|
1255
|
-
|
1259
|
+
k.dispatchEvent({ type: D.SELECT_DROPDOWN, value: c.data });
|
1256
1260
|
break;
|
1257
1261
|
case "draggableListUpdate":
|
1258
|
-
|
1262
|
+
k.dispatchEvent({ type: D.DRAG_UPDATE, value: c.data });
|
1259
1263
|
break;
|
1260
1264
|
case "addFolder":
|
1261
|
-
(
|
1265
|
+
(d = t.components.get("debug")) == null || d.addFolder(c.data.name, c.data.params, c.data.parent);
|
1262
1266
|
break;
|
1263
1267
|
case "bindObject":
|
1264
|
-
(
|
1268
|
+
(m = t.components.get("debug")) == null || m.bind(c.data.name, c.data.params, c.data.parent);
|
1265
1269
|
break;
|
1266
1270
|
case "updateBind":
|
1267
|
-
(
|
1271
|
+
(v = t.components.get("debug")) == null || v.triggerBind(c.data.id, c.data.value);
|
1268
1272
|
break;
|
1269
1273
|
case "addButton":
|
1270
|
-
(
|
1274
|
+
(f = t.components.get("debug")) == null || f.button(c.data.name, c.data.callback, c.data.parent);
|
1271
1275
|
break;
|
1272
1276
|
case "clickButton":
|
1273
|
-
(
|
1277
|
+
(h = t.components.get("debug")) == null || h.triggerButton(c.data.id);
|
1274
1278
|
break;
|
1275
1279
|
case "setSheet":
|
1276
|
-
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]));
|
1277
1281
|
break;
|
1278
1282
|
case "setSheetObject":
|
1279
|
-
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]);
|
1280
1284
|
break;
|
1281
1285
|
case "updateSheetObject":
|
1282
|
-
s = (
|
1286
|
+
s = (w = t.components.get("theatre")) == null ? void 0 : w.sheetObjectCBs.get(c.data.sheetObject), s !== void 0 && s(c.data.values);
|
1283
1287
|
break;
|
1284
1288
|
case "updateTimeline":
|
1285
|
-
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);
|
1286
1290
|
break;
|
1287
1291
|
case "getScene":
|
1288
|
-
|
1292
|
+
k.dispatchEvent({ type: D.GET_SCENE });
|
1289
1293
|
break;
|
1290
1294
|
case "getObject":
|
1291
|
-
|
1295
|
+
k.dispatchEvent({ type: D.GET_OBJECT, value: c.data });
|
1292
1296
|
break;
|
1293
1297
|
case "updateObject":
|
1294
|
-
|
1298
|
+
k.dispatchEvent({ type: D.UPDATE_OBJECT, value: c.data });
|
1295
1299
|
break;
|
1296
1300
|
case "createTexture":
|
1297
|
-
|
1301
|
+
k.dispatchEvent({ type: D.CREATE_TEXTURE, value: c.data });
|
1298
1302
|
break;
|
1299
1303
|
case "requestMethod":
|
1300
|
-
|
1304
|
+
k.dispatchEvent({ type: D.REQUEST_METHOD, value: c.data });
|
1301
1305
|
break;
|
1302
1306
|
}
|
1303
1307
|
}
|
1304
1308
|
function e(c) {
|
1305
1309
|
switch (c.event) {
|
1306
1310
|
case "custom":
|
1307
|
-
|
1311
|
+
k.dispatchEvent({ type: D.CUSTOM, value: c.data });
|
1308
1312
|
break;
|
1309
1313
|
case "setObject":
|
1310
|
-
|
1314
|
+
k.dispatchEvent({ type: D.SET_OBJECT, value: c.data });
|
1311
1315
|
break;
|
1312
1316
|
case "setScene":
|
1313
|
-
|
1317
|
+
k.dispatchEvent({ type: D.SET_SCENE, value: c.data });
|
1314
1318
|
break;
|
1315
1319
|
}
|
1316
1320
|
}
|
1317
|
-
function
|
1318
|
-
|
1321
|
+
function o() {
|
1322
|
+
Ze.ui.hide();
|
1319
1323
|
}
|
1320
|
-
function
|
1321
|
-
|
1322
|
-
|
1323
|
-
var
|
1324
|
-
let
|
1325
|
-
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) {
|
1326
1330
|
case "Theatre_Sheet_PublicAPI":
|
1327
|
-
|
1328
|
-
sheet:
|
1329
|
-
}, 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);
|
1330
1334
|
break;
|
1331
1335
|
case "Theatre_SheetObject_PublicAPI":
|
1332
|
-
|
1333
|
-
id:
|
1334
|
-
sheet:
|
1335
|
-
key:
|
1336
|
+
h = "setSheetObject", f += `_${v.address.objectKey}`, g = {
|
1337
|
+
id: f,
|
1338
|
+
sheet: v.address.sheetId,
|
1339
|
+
key: v.address.objectKey
|
1336
1340
|
};
|
1337
1341
|
break;
|
1338
1342
|
}
|
1339
|
-
t.send({ event:
|
1343
|
+
t.send({ event: h, target: "app", data: g });
|
1340
1344
|
});
|
1341
1345
|
});
|
1342
1346
|
let c = 0;
|
1343
1347
|
const s = () => {
|
1344
1348
|
if (n !== void 0 && c !== n.sequence.position) {
|
1345
1349
|
c = n.sequence.position;
|
1346
|
-
const
|
1350
|
+
const m = n;
|
1347
1351
|
t.send({
|
1348
1352
|
event: "updateTimeline",
|
1349
1353
|
target: "app",
|
1350
1354
|
data: {
|
1351
1355
|
position: c,
|
1352
|
-
sheet:
|
1356
|
+
sheet: m.address.sheetId
|
1353
1357
|
}
|
1354
1358
|
});
|
1355
1359
|
}
|
1356
|
-
},
|
1357
|
-
s(), requestAnimationFrame(
|
1360
|
+
}, d = () => {
|
1361
|
+
s(), requestAnimationFrame(d);
|
1358
1362
|
};
|
1359
|
-
s(),
|
1363
|
+
s(), d();
|
1360
1364
|
}
|
1361
1365
|
t.listen((c) => {
|
1362
|
-
t.editor ? e(c) :
|
1363
|
-
}), 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);
|
1364
1401
|
}
|
1365
|
-
|
1366
|
-
|
1367
|
-
|
1368
|
-
|
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
|
+
}
|
1542
|
+
}
|
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(
|
1369
1547
|
"button",
|
1370
1548
|
{
|
1371
1549
|
className: "toggle",
|
1372
1550
|
onClick: () => {
|
1373
|
-
const
|
1374
|
-
t.onToggle !== void 0 && t.onToggle(
|
1551
|
+
const o = !n;
|
1552
|
+
t.onToggle !== void 0 && t.onToggle(o), a(o);
|
1375
1553
|
},
|
1376
1554
|
children: [
|
1377
|
-
/* @__PURE__ */
|
1555
|
+
/* @__PURE__ */ l.jsx(
|
1378
1556
|
"p",
|
1379
1557
|
{
|
1380
1558
|
className: `status ${n ? "open" : ""}`,
|
1381
1559
|
children: "Toggle"
|
1382
1560
|
}
|
1383
1561
|
),
|
1384
|
-
/* @__PURE__ */
|
1562
|
+
/* @__PURE__ */ l.jsx("p", { className: "label", children: t.label })
|
1385
1563
|
]
|
1386
1564
|
}
|
1387
1565
|
),
|
1388
1566
|
t.button,
|
1389
|
-
/* @__PURE__ */
|
1567
|
+
/* @__PURE__ */ l.jsx("div", { className: n ? "open" : "", children: /* @__PURE__ */ l.jsx("div", { children: t.children }) })
|
1390
1568
|
] });
|
1391
1569
|
}
|
1392
|
-
function
|
1393
|
-
const [n,
|
1394
|
-
return t.child.children.length > 0 && t.child.children.map((
|
1395
|
-
|
1396
|
-
}), /* @__PURE__ */
|
1397
|
-
/* @__PURE__ */
|
1398
|
-
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(
|
1399
1577
|
"button",
|
1400
1578
|
{
|
1401
1579
|
className: "status",
|
@@ -1403,11 +1581,11 @@ function Jt(t) {
|
|
1403
1581
|
backgroundPositionX: n ? "-14px" : "2px"
|
1404
1582
|
},
|
1405
1583
|
onClick: () => {
|
1406
|
-
|
1584
|
+
a(!n);
|
1407
1585
|
}
|
1408
1586
|
}
|
1409
1587
|
) : null,
|
1410
|
-
/* @__PURE__ */
|
1588
|
+
/* @__PURE__ */ l.jsx(
|
1411
1589
|
"button",
|
1412
1590
|
{
|
1413
1591
|
className: "name",
|
@@ -1420,32 +1598,32 @@ function Jt(t) {
|
|
1420
1598
|
children: t.child.name.length > 0 ? `${t.child.name} (${t.child.type})` : `${t.child.type}::${t.child.uuid}`
|
1421
1599
|
}
|
1422
1600
|
),
|
1423
|
-
/* @__PURE__ */
|
1601
|
+
/* @__PURE__ */ l.jsx("div", { className: `icon ${Ln(t.child)}` })
|
1424
1602
|
] }),
|
1425
|
-
/* @__PURE__ */
|
1603
|
+
/* @__PURE__ */ l.jsx("div", { className: n ? "open" : "", children: /* @__PURE__ */ l.jsx("div", { className: "container", children: o }) })
|
1426
1604
|
] }, Math.random());
|
1427
1605
|
}
|
1428
|
-
function
|
1606
|
+
function nr(t) {
|
1429
1607
|
const n = [];
|
1430
|
-
return t.child.children.map((
|
1431
|
-
n.push(/* @__PURE__ */
|
1432
|
-
}), /* @__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 });
|
1433
1611
|
}
|
1434
|
-
const
|
1435
|
-
function
|
1612
|
+
const rr = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA5klEQVRoge2Y0Q6EIAwE6cX//+X6cCFpSMEKVTdk501OpRNKiyelFC0b8Ps6gCwoggZF0KAIGhRBgyJoUAQNiqCxjciR9SLV//eZiAyvK3U8i/QVaQO2YyLSFVvlkdTKDjJCukh2ykR5ZEW+kHmlatl90RaBtDkK/w7CYhuRUEO0ee3l+J3m55Vm+17vtwjTnV1V3QA8qfbeUXCzRWDpiLLS+OyzvRW7IzW9R+okvclsqR09743bo0yUpc1+lSJvNsa002+Euk9GKzV7SmZDRIMiaFAEDYqgQRE0KIIGRdCgCBoUQeMEMERadX7YUz8AAAAASUVORK5CYII=";
|
1613
|
+
function ar(t) {
|
1436
1614
|
return "items" in t;
|
1437
1615
|
}
|
1438
|
-
function
|
1439
|
-
function n(e,
|
1440
|
-
console.log("onChange:", e,
|
1616
|
+
function $e(t) {
|
1617
|
+
function n(e, o) {
|
1618
|
+
console.log("onChange:", e, o);
|
1441
1619
|
}
|
1442
|
-
const
|
1620
|
+
const a = [];
|
1443
1621
|
return t.items.forEach((e) => {
|
1444
|
-
|
1445
|
-
/* @__PURE__ */
|
1446
|
-
) :
|
1447
|
-
/* @__PURE__ */
|
1448
|
-
|
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,
|
1449
1627
|
{
|
1450
1628
|
title: e.title,
|
1451
1629
|
prop: e.prop,
|
@@ -1455,22 +1633,24 @@ function Ae(t) {
|
|
1455
1633
|
max: e.max,
|
1456
1634
|
step: e.step,
|
1457
1635
|
disabled: e.disabled,
|
1458
|
-
onChange: (
|
1459
|
-
e.onChange !== void 0 ? e.onChange(
|
1636
|
+
onChange: (o, u) => {
|
1637
|
+
e.onChange !== void 0 ? e.onChange(o, u) : n(o, u);
|
1460
1638
|
}
|
1461
1639
|
},
|
1462
1640
|
Math.random()
|
1463
1641
|
)
|
1464
1642
|
);
|
1465
|
-
}), /* @__PURE__ */
|
1643
|
+
}), /* @__PURE__ */ l.jsx(Mt, { label: t.title, open: !1, children: a });
|
1466
1644
|
}
|
1467
|
-
function
|
1645
|
+
function ir(t) {
|
1468
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");
|
1469
1647
|
}
|
1470
|
-
function
|
1648
|
+
function Se(t) {
|
1471
1649
|
switch (t) {
|
1472
1650
|
case "alphaMap":
|
1473
1651
|
return "Alpha Map";
|
1652
|
+
case "anisotropyMap":
|
1653
|
+
return "Anisotropy Map";
|
1474
1654
|
case "anisotropyRotation":
|
1475
1655
|
return "Anisotropy Rotation";
|
1476
1656
|
case "aoMap":
|
@@ -1483,10 +1663,16 @@ function xe(t) {
|
|
1483
1663
|
return "Bump Map";
|
1484
1664
|
case "bumpScale":
|
1485
1665
|
return "Bump Scale";
|
1666
|
+
case "clearcoatMap":
|
1667
|
+
return "Clearcoat Map";
|
1668
|
+
case "clearcoatNormalMap":
|
1669
|
+
return "Clearcoat Normal Map";
|
1486
1670
|
case "clearcoatNormalScale":
|
1487
1671
|
return "Clearcoat Normal Scale";
|
1488
1672
|
case "clearcoatRoughness":
|
1489
1673
|
return "Clearcoat Roughness";
|
1674
|
+
case "clearcoatRoughnessMap":
|
1675
|
+
return "Clearcoat Roughness Map";
|
1490
1676
|
case "color":
|
1491
1677
|
return "Color";
|
1492
1678
|
case "defines":
|
@@ -1505,6 +1691,8 @@ function xe(t) {
|
|
1505
1691
|
return "Dithering";
|
1506
1692
|
case "emissive":
|
1507
1693
|
return "Emissive";
|
1694
|
+
case "emissiveMap":
|
1695
|
+
return "Emissive Map";
|
1508
1696
|
case "emissiveIntensity":
|
1509
1697
|
return "Emissive Intensity";
|
1510
1698
|
case "envMap":
|
@@ -1525,6 +1713,10 @@ function xe(t) {
|
|
1525
1713
|
return "IOR";
|
1526
1714
|
case "iridescenceIOR":
|
1527
1715
|
return "Iridescence IOR";
|
1716
|
+
case "iridescenceMap":
|
1717
|
+
return "Iridescence Map";
|
1718
|
+
case "iridescenceThicknessMap":
|
1719
|
+
return "Iridescence Thickness Map";
|
1528
1720
|
case "iridescenceThicknessRange":
|
1529
1721
|
return "Iridescence Thickness Range";
|
1530
1722
|
case "lights":
|
@@ -1539,6 +1731,8 @@ function xe(t) {
|
|
1539
1731
|
return "Matcap";
|
1540
1732
|
case "metalness":
|
1541
1733
|
return "Metalness";
|
1734
|
+
case "metalnessMap":
|
1735
|
+
return "Metalness Map";
|
1542
1736
|
case "name":
|
1543
1737
|
return "Name";
|
1544
1738
|
case "normalMap":
|
@@ -1553,20 +1747,36 @@ function xe(t) {
|
|
1553
1747
|
return "Refraction Ratio";
|
1554
1748
|
case "roughness":
|
1555
1749
|
return "Roughness";
|
1750
|
+
case "roughnessMap":
|
1751
|
+
return "Roughness Map";
|
1556
1752
|
case "sheenColor":
|
1557
1753
|
return "Sheen Color";
|
1754
|
+
case "sheenColorMap":
|
1755
|
+
return "Sheen Color Map";
|
1558
1756
|
case "sheenRoughness":
|
1559
1757
|
return "Sheen Roughness";
|
1758
|
+
case "sheenRoughnessMap":
|
1759
|
+
return "Sheen Roughness Map";
|
1560
1760
|
case "shininess":
|
1561
1761
|
return "Shininess";
|
1562
1762
|
case "specular":
|
1563
1763
|
return "Specular";
|
1564
1764
|
case "specularColor":
|
1565
1765
|
return "Specular Color";
|
1766
|
+
case "specularColorMap":
|
1767
|
+
return "Specular Color Map";
|
1566
1768
|
case "specularIntensity":
|
1567
1769
|
return "Specular Intensity";
|
1770
|
+
case "specularIntensityMap":
|
1771
|
+
return "Specular Map Intensity";
|
1568
1772
|
case "thickness":
|
1569
1773
|
return "Thickness";
|
1774
|
+
case "thicknessMap":
|
1775
|
+
return "Thickness Map";
|
1776
|
+
case "transmission":
|
1777
|
+
return "Transmission";
|
1778
|
+
case "transmissionMap":
|
1779
|
+
return "Transmission Map";
|
1570
1780
|
case "transparent":
|
1571
1781
|
return "Transparent";
|
1572
1782
|
case "type":
|
@@ -1584,270 +1794,270 @@ function xe(t) {
|
|
1584
1794
|
}
|
1585
1795
|
return t;
|
1586
1796
|
}
|
1587
|
-
function
|
1797
|
+
function or(t) {
|
1588
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";
|
1589
1799
|
}
|
1590
|
-
function
|
1800
|
+
function sr() {
|
1591
1801
|
const t = document.createElement("input");
|
1592
|
-
return t.type = "file", new Promise((n,
|
1802
|
+
return t.type = "file", new Promise((n, a) => {
|
1593
1803
|
t.addEventListener("change", function() {
|
1594
1804
|
if (t.files === null)
|
1595
|
-
|
1805
|
+
a();
|
1596
1806
|
else {
|
1597
|
-
const e = t.files[0],
|
1598
|
-
|
1599
|
-
n(
|
1600
|
-
},
|
1807
|
+
const e = t.files[0], o = new FileReader();
|
1808
|
+
o.onload = function(u) {
|
1809
|
+
n(u.target.result);
|
1810
|
+
}, o.readAsDataURL(e);
|
1601
1811
|
}
|
1602
1812
|
}), t.click();
|
1603
1813
|
});
|
1604
1814
|
}
|
1605
|
-
function
|
1815
|
+
function $t(t, n, a) {
|
1606
1816
|
const e = [];
|
1607
|
-
for (const
|
1608
|
-
if (!
|
1817
|
+
for (const o in t) {
|
1818
|
+
if (!ir(o))
|
1609
1819
|
continue;
|
1610
|
-
const
|
1611
|
-
if (
|
1820
|
+
const u = typeof t[o], c = t[o];
|
1821
|
+
if (u === "boolean" || u === "number" || u === "string") {
|
1612
1822
|
const s = {
|
1613
|
-
title:
|
1614
|
-
prop:
|
1615
|
-
type:
|
1823
|
+
title: Se(o),
|
1824
|
+
prop: o,
|
1825
|
+
type: u,
|
1616
1826
|
value: c,
|
1617
1827
|
min: void 0,
|
1618
1828
|
max: void 0,
|
1619
|
-
onChange: (
|
1620
|
-
var
|
1621
|
-
|
1622
|
-
const
|
1623
|
-
|
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);
|
1624
1834
|
}
|
1625
1835
|
};
|
1626
|
-
|
1627
|
-
} 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")
|
1628
1838
|
if (c.isColor)
|
1629
1839
|
e.push({
|
1630
|
-
title:
|
1631
|
-
prop:
|
1840
|
+
title: Se(o),
|
1841
|
+
prop: o,
|
1632
1842
|
type: "color",
|
1633
1843
|
value: c,
|
1634
|
-
onChange: (s,
|
1635
|
-
var
|
1636
|
-
const
|
1637
|
-
|
1638
|
-
const
|
1639
|
-
|
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);
|
1640
1850
|
}
|
1641
1851
|
});
|
1642
1852
|
else if (Array.isArray(c)) {
|
1643
1853
|
const s = [];
|
1644
|
-
for (const
|
1854
|
+
for (const d in c)
|
1645
1855
|
s.push({
|
1646
|
-
title: `${
|
1647
|
-
type: `${typeof c[
|
1648
|
-
value: c[
|
1649
|
-
onChange: (
|
1650
|
-
var
|
1651
|
-
|
1652
|
-
const
|
1653
|
-
|
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);
|
1654
1864
|
}
|
1655
1865
|
});
|
1656
1866
|
e.push({
|
1657
|
-
title:
|
1867
|
+
title: Se(o),
|
1658
1868
|
items: s
|
1659
1869
|
});
|
1660
1870
|
} else {
|
1661
1871
|
const s = [];
|
1662
|
-
for (const
|
1663
|
-
const
|
1664
|
-
switch (typeof
|
1872
|
+
for (const d in c) {
|
1873
|
+
const m = c[d];
|
1874
|
+
switch (typeof m) {
|
1665
1875
|
case "boolean":
|
1666
1876
|
case "number":
|
1667
1877
|
case "string":
|
1668
|
-
|
1669
|
-
title:
|
1878
|
+
d === "src" ? e.push({
|
1879
|
+
title: Se(o),
|
1670
1880
|
type: "image",
|
1671
|
-
value:
|
1672
|
-
onChange: (
|
1673
|
-
var
|
1674
|
-
|
1675
|
-
const
|
1676
|
-
|
1677
|
-
|
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);
|
1678
1888
|
});
|
1679
1889
|
}
|
1680
1890
|
}) : s.push({
|
1681
|
-
title: `${
|
1682
|
-
prop: `material.${
|
1683
|
-
type: `${typeof t[
|
1684
|
-
value: c[
|
1685
|
-
onChange: (
|
1686
|
-
var
|
1687
|
-
|
1688
|
-
const
|
1689
|
-
|
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);
|
1690
1900
|
}
|
1691
1901
|
});
|
1692
1902
|
break;
|
1693
1903
|
case "object":
|
1694
|
-
|
1695
|
-
title:
|
1904
|
+
m.value !== void 0 && m.value.src !== void 0 ? s.push({
|
1905
|
+
title: Se(d),
|
1696
1906
|
type: "image",
|
1697
|
-
value:
|
1698
|
-
onChange: (
|
1699
|
-
var
|
1700
|
-
|
1701
|
-
const
|
1702
|
-
|
1703
|
-
|
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);
|
1704
1914
|
});
|
1705
1915
|
}
|
1706
1916
|
}) : s.push({
|
1707
|
-
title:
|
1708
|
-
type: `${typeof
|
1709
|
-
value:
|
1710
|
-
onChange: (
|
1711
|
-
var
|
1712
|
-
|
1713
|
-
const
|
1714
|
-
|
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);
|
1715
1925
|
}
|
1716
1926
|
});
|
1717
1927
|
break;
|
1718
1928
|
}
|
1719
1929
|
}
|
1720
1930
|
s.length > 0 && e.push({
|
1721
|
-
title:
|
1931
|
+
title: Se(o),
|
1722
1932
|
items: s
|
1723
1933
|
});
|
1724
1934
|
}
|
1725
1935
|
else
|
1726
|
-
c !== void 0 && console.log("other:",
|
1936
|
+
c !== void 0 && console.log("other:", o, u, c);
|
1727
1937
|
}
|
1728
|
-
return e.sort((
|
1938
|
+
return e.sort((o, u) => o.title < u.title ? -1 : o.title > u.title ? 1 : 0), e.push({
|
1729
1939
|
title: "Update Material",
|
1730
1940
|
type: "button",
|
1731
1941
|
onChange: () => {
|
1732
|
-
|
1942
|
+
a.updateObject(n.uuid, "material.needsUpdate", !0);
|
1733
1943
|
}
|
1734
1944
|
}), e;
|
1735
1945
|
}
|
1736
|
-
function
|
1737
|
-
const
|
1738
|
-
if (Array.isArray(
|
1739
|
-
const e = [],
|
1740
|
-
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++)
|
1741
1951
|
e.push(
|
1742
|
-
/* @__PURE__ */
|
1743
|
-
|
1952
|
+
/* @__PURE__ */ l.jsx(
|
1953
|
+
$e,
|
1744
1954
|
{
|
1745
|
-
title: `Material ${
|
1746
|
-
items:
|
1955
|
+
title: `Material ${u}`,
|
1956
|
+
items: $t(a[u], t, n)
|
1747
1957
|
}
|
1748
1958
|
)
|
1749
1959
|
);
|
1750
|
-
return /* @__PURE__ */
|
1960
|
+
return /* @__PURE__ */ l.jsx(l.Fragment, { children: e });
|
1751
1961
|
} else
|
1752
|
-
return /* @__PURE__ */
|
1753
|
-
|
1962
|
+
return /* @__PURE__ */ l.jsx(
|
1963
|
+
$e,
|
1754
1964
|
{
|
1755
1965
|
title: "Material",
|
1756
|
-
items:
|
1966
|
+
items: $t(a, t, n)
|
1757
1967
|
}
|
1758
1968
|
);
|
1759
1969
|
}
|
1760
|
-
function
|
1970
|
+
function et(t) {
|
1761
1971
|
let n = t.value;
|
1762
|
-
n !== void 0 && n.isColor !== void 0 && (n =
|
1763
|
-
const [
|
1764
|
-
|
1765
|
-
var
|
1766
|
-
let
|
1767
|
-
const
|
1768
|
-
|
1769
|
-
},
|
1770
|
-
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)
|
1771
1981
|
return;
|
1772
|
-
const z = t.step !== void 0 ? t.step : 1,
|
1773
|
-
|
1774
|
-
},
|
1775
|
-
|
1776
|
-
},
|
1777
|
-
|
1778
|
-
},
|
1779
|
-
return
|
1780
|
-
var
|
1781
|
-
|
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));
|
1782
1992
|
};
|
1783
|
-
}, [
|
1784
|
-
const s = t.type === "string" && (
|
1785
|
-
`) > -1),
|
1786
|
-
let
|
1787
|
-
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);
|
1788
1998
|
};
|
1789
|
-
return /* @__PURE__ */
|
1790
|
-
t.type !== "button" && /* @__PURE__ */
|
1791
|
-
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(
|
1792
2002
|
"input",
|
1793
2003
|
{
|
1794
2004
|
type: "text",
|
1795
2005
|
disabled: t.disabled,
|
1796
|
-
onChange:
|
1797
|
-
value:
|
2006
|
+
onChange: m,
|
2007
|
+
value: a
|
1798
2008
|
}
|
1799
2009
|
),
|
1800
|
-
t.type === "string" && s && /* @__PURE__ */
|
2010
|
+
t.type === "string" && s && /* @__PURE__ */ l.jsx(
|
1801
2011
|
"textarea",
|
1802
2012
|
{
|
1803
2013
|
cols: 50,
|
1804
2014
|
rows: 10,
|
1805
2015
|
disabled: !0,
|
1806
|
-
onChange:
|
1807
|
-
value:
|
2016
|
+
onChange: m,
|
2017
|
+
value: a
|
1808
2018
|
}
|
1809
2019
|
),
|
1810
|
-
t.type === "boolean" && /* @__PURE__ */
|
2020
|
+
t.type === "boolean" && /* @__PURE__ */ l.jsx(
|
1811
2021
|
"input",
|
1812
2022
|
{
|
1813
2023
|
type: "checkbox",
|
1814
2024
|
disabled: t.disabled,
|
1815
|
-
onChange:
|
1816
|
-
checked:
|
2025
|
+
onChange: m,
|
2026
|
+
checked: a
|
1817
2027
|
}
|
1818
2028
|
),
|
1819
|
-
t.type === "number" && /* @__PURE__ */
|
2029
|
+
t.type === "number" && /* @__PURE__ */ l.jsx(
|
1820
2030
|
"input",
|
1821
2031
|
{
|
1822
|
-
ref:
|
2032
|
+
ref: u,
|
1823
2033
|
type: "number",
|
1824
|
-
value:
|
2034
|
+
value: a,
|
1825
2035
|
min: t.min,
|
1826
2036
|
max: t.max,
|
1827
2037
|
step: t.step,
|
1828
|
-
onChange:
|
2038
|
+
onChange: m
|
1829
2039
|
}
|
1830
2040
|
),
|
1831
|
-
t.type === "range" && /* @__PURE__ */
|
1832
|
-
/* @__PURE__ */
|
1833
|
-
/* @__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(
|
1834
2044
|
"input",
|
1835
2045
|
{
|
1836
2046
|
disabled: t.disabled,
|
1837
2047
|
type: "range",
|
1838
|
-
value:
|
2048
|
+
value: a,
|
1839
2049
|
min: t.min,
|
1840
2050
|
max: t.max,
|
1841
2051
|
step: t.step,
|
1842
|
-
onChange:
|
2052
|
+
onChange: m
|
1843
2053
|
}
|
1844
2054
|
)
|
1845
2055
|
] }),
|
1846
|
-
t.type === "color" && /* @__PURE__ */
|
1847
|
-
/* @__PURE__ */
|
1848
|
-
/* @__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 })
|
1849
2059
|
] }),
|
1850
|
-
t.type === "button" && /* @__PURE__ */
|
2060
|
+
t.type === "button" && /* @__PURE__ */ l.jsx(
|
1851
2061
|
"button",
|
1852
2062
|
{
|
1853
2063
|
onClick: () => {
|
@@ -1856,14 +2066,14 @@ function Xe(t) {
|
|
1856
2066
|
children: t.title
|
1857
2067
|
}
|
1858
2068
|
),
|
1859
|
-
t.type === "image" && /* @__PURE__ */
|
1860
|
-
|
1861
|
-
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);
|
1862
2072
|
});
|
1863
|
-
}, src:
|
2073
|
+
}, src: a.length > 0 ? a : rr })
|
1864
2074
|
] });
|
1865
2075
|
}
|
1866
|
-
function
|
2076
|
+
function Gt(t) {
|
1867
2077
|
switch (t) {
|
1868
2078
|
case "fov":
|
1869
2079
|
return "FOV";
|
@@ -1892,56 +2102,56 @@ function Lt(t) {
|
|
1892
2102
|
}
|
1893
2103
|
return t;
|
1894
2104
|
}
|
1895
|
-
function
|
1896
|
-
const
|
2105
|
+
function lr(t, n) {
|
2106
|
+
const a = [];
|
1897
2107
|
if (t.perspectiveCameraInfo !== void 0)
|
1898
2108
|
for (const e in t.perspectiveCameraInfo)
|
1899
|
-
|
1900
|
-
title:
|
2109
|
+
a.push({
|
2110
|
+
title: Gt(e),
|
1901
2111
|
prop: e,
|
1902
2112
|
type: "number",
|
1903
2113
|
step: 0.01,
|
1904
2114
|
value: t.perspectiveCameraInfo[e],
|
1905
|
-
onChange: (
|
2115
|
+
onChange: (o, u) => {
|
1906
2116
|
var s;
|
1907
|
-
n.updateObject(t.uuid,
|
2117
|
+
n.updateObject(t.uuid, o, u), n.requestMethod(t.uuid, "updateProjectionMatrix");
|
1908
2118
|
const c = (s = n.scene) == null ? void 0 : s.getObjectByProperty("uuid", t.uuid);
|
1909
|
-
c !== void 0 && (
|
2119
|
+
c !== void 0 && (K(c, o, u), c.updateProjectionMatrix());
|
1910
2120
|
}
|
1911
2121
|
});
|
1912
2122
|
else if (t.orthographicCameraInfo !== void 0)
|
1913
2123
|
for (const e in t.orthographicCameraInfo)
|
1914
|
-
|
1915
|
-
title:
|
2124
|
+
a.push({
|
2125
|
+
title: Gt(e),
|
1916
2126
|
prop: e,
|
1917
2127
|
type: "number",
|
1918
2128
|
step: 0.01,
|
1919
2129
|
value: t.perspectiveCameraInfo[e],
|
1920
|
-
onChange: (
|
2130
|
+
onChange: (o, u) => {
|
1921
2131
|
var s;
|
1922
|
-
n.updateObject(t.uuid,
|
2132
|
+
n.updateObject(t.uuid, o, u), n.requestMethod(t.uuid, "updateProjectionMatrix");
|
1923
2133
|
const c = (s = n.scene) == null ? void 0 : s.getObjectByProperty("uuid", t.uuid);
|
1924
|
-
c !== void 0 && (
|
2134
|
+
c !== void 0 && (K(c, o, u), c.updateProjectionMatrix());
|
1925
2135
|
}
|
1926
2136
|
});
|
1927
|
-
return /* @__PURE__ */
|
1928
|
-
|
2137
|
+
return /* @__PURE__ */ l.jsx(
|
2138
|
+
$e,
|
1929
2139
|
{
|
1930
2140
|
title: "Camera",
|
1931
|
-
items:
|
2141
|
+
items: a
|
1932
2142
|
}
|
1933
2143
|
);
|
1934
2144
|
}
|
1935
|
-
function
|
1936
|
-
const
|
1937
|
-
|
1938
|
-
const e = new
|
1939
|
-
t.uuid.length > 0 && (e.setFromMatrixPosition(
|
1940
|
-
const c = (
|
1941
|
-
var
|
1942
|
-
n.updateObject(t.uuid,
|
1943
|
-
const
|
1944
|
-
|
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);
|
1945
2155
|
}, s = [
|
1946
2156
|
{
|
1947
2157
|
title: "Position",
|
@@ -1976,7 +2186,7 @@ function ea(t, n) {
|
|
1976
2186
|
title: "X",
|
1977
2187
|
prop: "rotation.x",
|
1978
2188
|
type: "number",
|
1979
|
-
value:
|
2189
|
+
value: o.x,
|
1980
2190
|
min: -Math.PI,
|
1981
2191
|
max: Math.PI,
|
1982
2192
|
step: 0.01,
|
@@ -1986,7 +2196,7 @@ function ea(t, n) {
|
|
1986
2196
|
title: "Y",
|
1987
2197
|
prop: "rotation.y",
|
1988
2198
|
type: "number",
|
1989
|
-
value:
|
2199
|
+
value: o.y,
|
1990
2200
|
min: -Math.PI,
|
1991
2201
|
max: Math.PI,
|
1992
2202
|
step: 0.01,
|
@@ -1996,7 +2206,7 @@ function ea(t, n) {
|
|
1996
2206
|
title: "Z",
|
1997
2207
|
prop: "rotation.z",
|
1998
2208
|
type: "number",
|
1999
|
-
value:
|
2209
|
+
value: o.z,
|
2000
2210
|
min: -Math.PI,
|
2001
2211
|
max: Math.PI,
|
2002
2212
|
step: 0.01,
|
@@ -2011,7 +2221,7 @@ function ea(t, n) {
|
|
2011
2221
|
title: "X",
|
2012
2222
|
prop: "scale.x",
|
2013
2223
|
type: "number",
|
2014
|
-
value:
|
2224
|
+
value: u.x,
|
2015
2225
|
step: 0.01,
|
2016
2226
|
onChange: c
|
2017
2227
|
},
|
@@ -2019,7 +2229,7 @@ function ea(t, n) {
|
|
2019
2229
|
title: "Y",
|
2020
2230
|
prop: "scale.y",
|
2021
2231
|
type: "number",
|
2022
|
-
value:
|
2232
|
+
value: u.y,
|
2023
2233
|
step: 0.01,
|
2024
2234
|
onChange: c
|
2025
2235
|
},
|
@@ -2027,22 +2237,22 @@ function ea(t, n) {
|
|
2027
2237
|
title: "Z",
|
2028
2238
|
prop: "scale.z",
|
2029
2239
|
type: "number",
|
2030
|
-
value:
|
2240
|
+
value: u.z,
|
2031
2241
|
step: 0.01,
|
2032
2242
|
onChange: c
|
2033
2243
|
}
|
2034
2244
|
]
|
2035
2245
|
}
|
2036
2246
|
];
|
2037
|
-
return /* @__PURE__ */
|
2038
|
-
|
2247
|
+
return /* @__PURE__ */ l.jsx(
|
2248
|
+
$e,
|
2039
2249
|
{
|
2040
2250
|
title: "Transform",
|
2041
2251
|
items: s
|
2042
2252
|
}
|
2043
2253
|
);
|
2044
2254
|
}
|
2045
|
-
function
|
2255
|
+
function Vt(t) {
|
2046
2256
|
switch (t) {
|
2047
2257
|
case "color":
|
2048
2258
|
return "Color";
|
@@ -2061,47 +2271,47 @@ function Ft(t) {
|
|
2061
2271
|
}
|
2062
2272
|
return t;
|
2063
2273
|
}
|
2064
|
-
function
|
2065
|
-
const
|
2274
|
+
function dr(t, n) {
|
2275
|
+
const a = [];
|
2066
2276
|
if (t.lightInfo !== void 0)
|
2067
2277
|
for (const e in t.lightInfo) {
|
2068
|
-
const
|
2069
|
-
|
2070
|
-
title:
|
2278
|
+
const o = t.lightInfo[e];
|
2279
|
+
o !== void 0 && (o.isColor !== void 0 ? a.push({
|
2280
|
+
title: Vt(e),
|
2071
2281
|
prop: e,
|
2072
2282
|
type: "color",
|
2073
|
-
value:
|
2074
|
-
onChange: (
|
2075
|
-
var
|
2076
|
-
const s = new
|
2077
|
-
n.updateObject(t.uuid,
|
2078
|
-
const
|
2079
|
-
|
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);
|
2080
2290
|
}
|
2081
|
-
}) :
|
2082
|
-
title:
|
2291
|
+
}) : a.push({
|
2292
|
+
title: Vt(e),
|
2083
2293
|
prop: e,
|
2084
|
-
type: typeof
|
2085
|
-
value:
|
2086
|
-
step: typeof
|
2087
|
-
onChange: (
|
2088
|
-
var
|
2089
|
-
n.updateObject(t.uuid,
|
2090
|
-
const s = (
|
2091
|
-
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);
|
2092
2302
|
}
|
2093
2303
|
}));
|
2094
2304
|
}
|
2095
|
-
return /* @__PURE__ */
|
2096
|
-
|
2305
|
+
return /* @__PURE__ */ l.jsx(
|
2306
|
+
$e,
|
2097
2307
|
{
|
2098
2308
|
title: "Light",
|
2099
|
-
items:
|
2309
|
+
items: a
|
2100
2310
|
}
|
2101
2311
|
);
|
2102
2312
|
}
|
2103
|
-
function
|
2104
|
-
const [n,
|
2313
|
+
function fr(t) {
|
2314
|
+
const [n, a] = ie(-1), [e, o] = ie({
|
2105
2315
|
name: "",
|
2106
2316
|
uuid: "",
|
2107
2317
|
type: "",
|
@@ -2112,18 +2322,20 @@ function na(t) {
|
|
2112
2322
|
orthographicCameraInfo: void 0,
|
2113
2323
|
lightInfo: void 0
|
2114
2324
|
});
|
2115
|
-
|
2116
|
-
function
|
2117
|
-
const
|
2118
|
-
|
2325
|
+
tt(() => {
|
2326
|
+
function c(s) {
|
2327
|
+
const d = s.value;
|
2328
|
+
o(d), a(Date.now());
|
2119
2329
|
}
|
2120
|
-
return
|
2121
|
-
|
2330
|
+
return k.addEventListener(D.SET_OBJECT, c), () => {
|
2331
|
+
k.removeEventListener(D.SET_OBJECT, c);
|
2122
2332
|
};
|
2123
|
-
}, [])
|
2124
|
-
|
2125
|
-
|
2126
|
-
|
2333
|
+
}, []);
|
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,
|
2127
2339
|
{
|
2128
2340
|
type: "string",
|
2129
2341
|
title: "Name",
|
@@ -2132,8 +2344,8 @@ function na(t) {
|
|
2132
2344
|
disabled: !0
|
2133
2345
|
}
|
2134
2346
|
),
|
2135
|
-
/* @__PURE__ */
|
2136
|
-
|
2347
|
+
/* @__PURE__ */ l.jsx(
|
2348
|
+
et,
|
2137
2349
|
{
|
2138
2350
|
type: "string",
|
2139
2351
|
title: "Type",
|
@@ -2142,8 +2354,8 @@ function na(t) {
|
|
2142
2354
|
disabled: !0
|
2143
2355
|
}
|
2144
2356
|
),
|
2145
|
-
/* @__PURE__ */
|
2146
|
-
|
2357
|
+
/* @__PURE__ */ l.jsx(
|
2358
|
+
et,
|
2147
2359
|
{
|
2148
2360
|
type: "string",
|
2149
2361
|
title: "UUID",
|
@@ -2152,67 +2364,67 @@ function na(t) {
|
|
2152
2364
|
disabled: !0
|
2153
2365
|
}
|
2154
2366
|
),
|
2155
|
-
/* @__PURE__ */
|
2156
|
-
|
2367
|
+
/* @__PURE__ */ l.jsx(
|
2368
|
+
et,
|
2157
2369
|
{
|
2158
2370
|
type: "boolean",
|
2159
2371
|
title: "Visible",
|
2160
2372
|
prop: "visible",
|
2161
2373
|
value: e.visible,
|
2162
|
-
onChange: (
|
2163
|
-
var
|
2164
|
-
t.three.updateObject(e.uuid,
|
2165
|
-
const
|
2166
|
-
|
2374
|
+
onChange: (c, s) => {
|
2375
|
+
var m;
|
2376
|
+
t.three.updateObject(e.uuid, c, s);
|
2377
|
+
const d = (m = t.three.scene) == null ? void 0 : m.getObjectByProperty("uuid", e.uuid);
|
2378
|
+
d !== void 0 && K(d, c, s);
|
2167
2379
|
}
|
2168
2380
|
}
|
2169
2381
|
)
|
2170
2382
|
] }),
|
2171
|
-
/* @__PURE__ */
|
2172
|
-
|
2173
|
-
|
2174
|
-
|
2175
|
-
|
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
|
2176
2388
|
] })
|
2177
2389
|
] }) }, n);
|
2178
2390
|
}
|
2179
|
-
class
|
2180
|
-
constructor(
|
2181
|
-
super(
|
2182
|
-
|
2391
|
+
class Ir extends kn {
|
2392
|
+
constructor(a) {
|
2393
|
+
super(a);
|
2394
|
+
L(this, "three");
|
2183
2395
|
// Private
|
2184
|
-
|
2396
|
+
L(this, "onRefresh", () => {
|
2185
2397
|
this.three.getScene();
|
2186
2398
|
});
|
2187
|
-
|
2399
|
+
L(this, "setScene", (a) => {
|
2188
2400
|
this.setState(() => ({
|
2189
|
-
scene:
|
2401
|
+
scene: a.value
|
2190
2402
|
}));
|
2191
2403
|
});
|
2192
2404
|
this.state = {
|
2193
|
-
scene:
|
2194
|
-
}, this.three =
|
2405
|
+
scene: a.scene !== void 0 ? a.scene : null
|
2406
|
+
}, this.three = a.three, k.addEventListener(D.SET_SCENE, this.setScene);
|
2195
2407
|
}
|
2196
2408
|
componentDidMount() {
|
2197
2409
|
this.onRefresh();
|
2198
2410
|
}
|
2199
2411
|
componentWillUnmount() {
|
2200
|
-
|
2412
|
+
k.removeEventListener(D.SET_SCENE, this.setScene);
|
2201
2413
|
}
|
2202
2414
|
render() {
|
2203
|
-
var
|
2204
|
-
const
|
2205
|
-
return /* @__PURE__ */
|
2206
|
-
|
2207
|
-
|
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,
|
2208
2420
|
{
|
2209
2421
|
label: e,
|
2210
|
-
button: /* @__PURE__ */
|
2422
|
+
button: /* @__PURE__ */ l.jsx("button", { className: "icon refresh hideText", onClick: this.onRefresh, children: "Refresh" }),
|
2211
2423
|
open: !0,
|
2212
|
-
children: /* @__PURE__ */
|
2424
|
+
children: /* @__PURE__ */ l.jsx(nr, { child: this.componentState.scene, three: this.three })
|
2213
2425
|
}
|
2214
2426
|
),
|
2215
|
-
/* @__PURE__ */
|
2427
|
+
/* @__PURE__ */ l.jsx(Mt, { label: "Inspector", children: /* @__PURE__ */ l.jsx(fr, { three: this.three }, "Inspector") })
|
2216
2428
|
] }) }, "SceneHierarchy");
|
2217
2429
|
}
|
2218
2430
|
// Getters / Setters
|
@@ -2220,84 +2432,84 @@ class Pa extends jn {
|
|
2220
2432
|
return this.state;
|
2221
2433
|
}
|
2222
2434
|
}
|
2223
|
-
function
|
2435
|
+
function Ar(t) {
|
2224
2436
|
const n = (s) => {
|
2225
|
-
const
|
2226
|
-
|
2227
|
-
},
|
2228
|
-
const
|
2229
|
-
|
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);
|
2230
2442
|
}, e = (s) => {
|
2231
|
-
const
|
2232
|
-
|
2233
|
-
},
|
2234
|
-
const
|
2235
|
-
|
2236
|
-
|
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);
|
2237
2449
|
});
|
2238
|
-
},
|
2450
|
+
}, u = () => {
|
2239
2451
|
t.three.setScene(t.scene);
|
2240
2452
|
}, c = (s) => {
|
2241
|
-
const { key:
|
2242
|
-
if (
|
2453
|
+
const { key: d, uuid: m, value: v } = s.value, f = t.scene.getObjectByProperty("uuid", m);
|
2454
|
+
if (f !== void 0)
|
2243
2455
|
try {
|
2244
|
-
|
2245
|
-
} catch (
|
2246
|
-
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);
|
2247
2459
|
}
|
2248
2460
|
};
|
2249
|
-
return
|
2250
|
-
|
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);
|
2251
2463
|
}), []), null;
|
2252
2464
|
}
|
2253
|
-
const
|
2254
|
-
class
|
2255
|
-
constructor(n,
|
2256
|
-
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() {
|
2257
2469
|
return s.phi;
|
2258
2470
|
}, this.getAzimuthalAngle = function() {
|
2259
2471
|
return s.theta;
|
2260
2472
|
}, this.getDistance = function() {
|
2261
2473
|
return this.object.position.distanceTo(this.target);
|
2262
|
-
}, this.listenToKeyEvents = function(
|
2263
|
-
|
2474
|
+
}, this.listenToKeyEvents = function(i) {
|
2475
|
+
i.addEventListener("keydown", Xe), this._domElementKeyEvents = i;
|
2264
2476
|
}, this.stopListenToKeyEvents = function() {
|
2265
|
-
this._domElementKeyEvents.removeEventListener("keydown",
|
2477
|
+
this._domElementKeyEvents.removeEventListener("keydown", Xe), this._domElementKeyEvents = null;
|
2266
2478
|
}, this.saveState = function() {
|
2267
2479
|
e.target0.copy(e.target), e.position0.copy(e.object.position), e.zoom0 = e.object.zoom;
|
2268
2480
|
}, this.reset = function() {
|
2269
|
-
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;
|
2270
2482
|
}, this.update = function() {
|
2271
|
-
const
|
2272
|
-
return function() {
|
2273
|
-
const
|
2274
|
-
|
2275
|
-
let
|
2276
|
-
isFinite(
|
2277
|
-
let
|
2278
|
-
if (e.zoomToCursor &&
|
2279
|
-
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;
|
2280
2492
|
if (e.object.isPerspectiveCamera) {
|
2281
|
-
const
|
2282
|
-
|
2283
|
-
const
|
2284
|
-
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();
|
2285
2497
|
} else if (e.object.isOrthographicCamera) {
|
2286
|
-
const
|
2287
|
-
|
2288
|
-
const
|
2289
|
-
|
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();
|
2290
2502
|
} else
|
2291
2503
|
console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), e.zoomToCursor = !1;
|
2292
|
-
|
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))));
|
2293
2505
|
} else
|
2294
|
-
e.object.isOrthographicCamera && (e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom /
|
2295
|
-
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;
|
2296
2508
|
};
|
2297
2509
|
}(), this.dispose = function() {
|
2298
|
-
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);
|
2299
2511
|
};
|
2300
|
-
const e = this,
|
2512
|
+
const e = this, o = {
|
2301
2513
|
NONE: -1,
|
2302
2514
|
ROTATE: 0,
|
2303
2515
|
DOLLY: 1,
|
@@ -2307,700 +2519,581 @@ class ra extends Yt {
|
|
2307
2519
|
TOUCH_DOLLY_PAN: 5,
|
2308
2520
|
TOUCH_DOLLY_ROTATE: 6
|
2309
2521
|
};
|
2310
|
-
let
|
2311
|
-
const c = 1e-6, s = new
|
2312
|
-
let
|
2313
|
-
const
|
2314
|
-
let
|
2315
|
-
const
|
2316
|
-
function
|
2317
|
-
return 2 * Math.PI / 60 / 60 * e.autoRotateSpeed;
|
2318
|
-
}
|
2319
|
-
function
|
2320
|
-
|
2321
|
-
|
2322
|
-
|
2323
|
-
|
2324
|
-
|
2325
|
-
|
2326
|
-
|
2327
|
-
|
2328
|
-
|
2329
|
-
|
2330
|
-
|
2331
|
-
|
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);
|
2332
2545
|
};
|
2333
|
-
}(),
|
2334
|
-
const
|
2335
|
-
return function(
|
2336
|
-
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);
|
2337
2550
|
};
|
2338
|
-
}(),
|
2339
|
-
const
|
2340
|
-
return function(
|
2341
|
-
const
|
2551
|
+
}(), ne = function() {
|
2552
|
+
const i = new I();
|
2553
|
+
return function(R, P) {
|
2554
|
+
const V = e.domElement;
|
2342
2555
|
if (e.object.isPerspectiveCamera) {
|
2343
|
-
const
|
2344
|
-
|
2345
|
-
let
|
2346
|
-
|
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);
|
2347
2560
|
} else
|
2348
|
-
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);
|
2349
2562
|
};
|
2350
2563
|
}();
|
2351
|
-
function Pe(
|
2352
|
-
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);
|
2353
2566
|
}
|
2354
|
-
function
|
2355
|
-
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);
|
2356
2569
|
}
|
2357
|
-
function
|
2570
|
+
function je(i, y) {
|
2358
2571
|
if (!e.zoomToCursor)
|
2359
2572
|
return;
|
2360
|
-
|
2361
|
-
const
|
2362
|
-
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();
|
2363
2576
|
}
|
2364
|
-
function
|
2365
|
-
return Math.max(e.minDistance, Math.min(e.maxDistance,
|
2577
|
+
function _e(i) {
|
2578
|
+
return Math.max(e.minDistance, Math.min(e.maxDistance, i));
|
2366
2579
|
}
|
2367
|
-
function
|
2368
|
-
|
2580
|
+
function Ve(i) {
|
2581
|
+
f.set(i.clientX, i.clientY);
|
2369
2582
|
}
|
2370
|
-
function
|
2371
|
-
|
2583
|
+
function nt(i) {
|
2584
|
+
je(i.clientX, i.clientX), U.set(i.clientX, i.clientY);
|
2372
2585
|
}
|
2373
|
-
function
|
2374
|
-
|
2586
|
+
function Ye(i) {
|
2587
|
+
E.set(i.clientX, i.clientY);
|
2375
2588
|
}
|
2376
|
-
function
|
2377
|
-
|
2378
|
-
const
|
2379
|
-
|
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();
|
2380
2593
|
}
|
2381
|
-
function
|
2382
|
-
|
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();
|
2383
2596
|
}
|
2384
|
-
function
|
2385
|
-
|
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();
|
2386
2599
|
}
|
2387
|
-
function
|
2388
|
-
|
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();
|
2389
2602
|
}
|
2390
|
-
function
|
2391
|
-
let
|
2392
|
-
switch (
|
2603
|
+
function We(i) {
|
2604
|
+
let y = !1;
|
2605
|
+
switch (i.code) {
|
2393
2606
|
case e.keys.UP:
|
2394
|
-
|
2607
|
+
i.ctrlKey || i.metaKey || i.shiftKey ? be(2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : ne(0, e.keyPanSpeed), y = !0;
|
2395
2608
|
break;
|
2396
2609
|
case e.keys.BOTTOM:
|
2397
|
-
|
2610
|
+
i.ctrlKey || i.metaKey || i.shiftKey ? be(-2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : ne(0, -e.keyPanSpeed), y = !0;
|
2398
2611
|
break;
|
2399
2612
|
case e.keys.LEFT:
|
2400
|
-
|
2613
|
+
i.ctrlKey || i.metaKey || i.shiftKey ? ve(2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : ne(e.keyPanSpeed, 0), y = !0;
|
2401
2614
|
break;
|
2402
2615
|
case e.keys.RIGHT:
|
2403
|
-
|
2616
|
+
i.ctrlKey || i.metaKey || i.shiftKey ? ve(-2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : ne(-e.keyPanSpeed, 0), y = !0;
|
2404
2617
|
break;
|
2405
2618
|
}
|
2406
|
-
|
2619
|
+
y && (i.preventDefault(), e.update());
|
2407
2620
|
}
|
2408
|
-
function
|
2409
|
-
if (
|
2410
|
-
|
2621
|
+
function ye(i) {
|
2622
|
+
if (S.length === 1)
|
2623
|
+
f.set(i.pageX, i.pageY);
|
2411
2624
|
else {
|
2412
|
-
const
|
2413
|
-
|
2625
|
+
const y = se(i), R = 0.5 * (i.pageX + y.x), P = 0.5 * (i.pageY + y.y);
|
2626
|
+
f.set(R, P);
|
2414
2627
|
}
|
2415
2628
|
}
|
2416
|
-
function
|
2417
|
-
if (
|
2418
|
-
|
2629
|
+
function ke(i) {
|
2630
|
+
if (S.length === 1)
|
2631
|
+
E.set(i.pageX, i.pageY);
|
2419
2632
|
else {
|
2420
|
-
const
|
2421
|
-
|
2633
|
+
const y = se(i), R = 0.5 * (i.pageX + y.x), P = 0.5 * (i.pageY + y.y);
|
2634
|
+
E.set(R, P);
|
2422
2635
|
}
|
2423
2636
|
}
|
2424
|
-
function
|
2425
|
-
const
|
2426
|
-
|
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);
|
2427
2640
|
}
|
2428
|
-
function
|
2429
|
-
e.enableZoom &&
|
2641
|
+
function yt(i) {
|
2642
|
+
e.enableZoom && Ee(i), e.enablePan && ke(i);
|
2430
2643
|
}
|
2431
|
-
function
|
2432
|
-
e.enableZoom &&
|
2644
|
+
function at(i) {
|
2645
|
+
e.enableZoom && Ee(i), e.enableRotate && ye(i);
|
2433
2646
|
}
|
2434
|
-
function
|
2435
|
-
if (
|
2436
|
-
|
2647
|
+
function it(i) {
|
2648
|
+
if (S.length == 1)
|
2649
|
+
h.set(i.pageX, i.pageY);
|
2437
2650
|
else {
|
2438
|
-
const
|
2439
|
-
|
2651
|
+
const R = se(i), P = 0.5 * (i.pageX + R.x), V = 0.5 * (i.pageY + R.y);
|
2652
|
+
h.set(P, V);
|
2440
2653
|
}
|
2441
|
-
|
2442
|
-
const
|
2443
|
-
|
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);
|
2444
2657
|
}
|
2445
|
-
function
|
2446
|
-
if (
|
2447
|
-
|
2658
|
+
function ot(i) {
|
2659
|
+
if (S.length === 1)
|
2660
|
+
w.set(i.pageX, i.pageY);
|
2448
2661
|
else {
|
2449
|
-
const
|
2450
|
-
|
2662
|
+
const y = se(i), R = 0.5 * (i.pageX + y.x), P = 0.5 * (i.pageY + y.y);
|
2663
|
+
w.set(R, P);
|
2451
2664
|
}
|
2452
|
-
|
2665
|
+
A.subVectors(w, E).multiplyScalar(e.panSpeed), ne(A.x, A.y), E.copy(w);
|
2453
2666
|
}
|
2454
|
-
function
|
2455
|
-
const
|
2456
|
-
|
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);
|
2457
2672
|
}
|
2458
|
-
function
|
2459
|
-
e.enableZoom &&
|
2673
|
+
function De(i) {
|
2674
|
+
e.enableZoom && xe(i), e.enablePan && ot(i);
|
2460
2675
|
}
|
2461
|
-
function
|
2462
|
-
e.enableZoom &&
|
2676
|
+
function st(i) {
|
2677
|
+
e.enableZoom && xe(i), e.enableRotate && it(i);
|
2463
2678
|
}
|
2464
|
-
function
|
2465
|
-
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));
|
2466
2681
|
}
|
2467
|
-
function
|
2468
|
-
e.enabled !== !1 && (
|
2682
|
+
function fe(i) {
|
2683
|
+
e.enabled !== !1 && (i.pointerType === "touch" ? ut(i) : Ke(i));
|
2469
2684
|
}
|
2470
|
-
function
|
2471
|
-
|
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;
|
2472
2687
|
}
|
2473
|
-
function
|
2474
|
-
let
|
2475
|
-
switch (
|
2688
|
+
function Et(i) {
|
2689
|
+
let y;
|
2690
|
+
switch (i.button) {
|
2476
2691
|
case 0:
|
2477
|
-
|
2692
|
+
y = e.mouseButtons.LEFT;
|
2478
2693
|
break;
|
2479
2694
|
case 1:
|
2480
|
-
|
2695
|
+
y = e.mouseButtons.MIDDLE;
|
2481
2696
|
break;
|
2482
2697
|
case 2:
|
2483
|
-
|
2698
|
+
y = e.mouseButtons.RIGHT;
|
2484
2699
|
break;
|
2485
2700
|
default:
|
2486
|
-
|
2701
|
+
y = -1;
|
2487
2702
|
}
|
2488
|
-
switch (
|
2489
|
-
case
|
2703
|
+
switch (y) {
|
2704
|
+
case Le.DOLLY:
|
2490
2705
|
if (e.enableZoom === !1)
|
2491
2706
|
return;
|
2492
|
-
|
2707
|
+
nt(i), u = o.DOLLY;
|
2493
2708
|
break;
|
2494
|
-
case
|
2495
|
-
if (
|
2709
|
+
case Le.ROTATE:
|
2710
|
+
if (i.ctrlKey || i.metaKey || i.shiftKey) {
|
2496
2711
|
if (e.enablePan === !1)
|
2497
2712
|
return;
|
2498
|
-
|
2713
|
+
Ye(i), u = o.PAN;
|
2499
2714
|
} else {
|
2500
2715
|
if (e.enableRotate === !1)
|
2501
2716
|
return;
|
2502
|
-
|
2717
|
+
Ve(i), u = o.ROTATE;
|
2503
2718
|
}
|
2504
2719
|
break;
|
2505
|
-
case
|
2506
|
-
if (
|
2720
|
+
case Le.PAN:
|
2721
|
+
if (i.ctrlKey || i.metaKey || i.shiftKey) {
|
2507
2722
|
if (e.enableRotate === !1)
|
2508
2723
|
return;
|
2509
|
-
|
2724
|
+
Ve(i), u = o.ROTATE;
|
2510
2725
|
} else {
|
2511
2726
|
if (e.enablePan === !1)
|
2512
2727
|
return;
|
2513
|
-
|
2728
|
+
Ye(i), u = o.PAN;
|
2514
2729
|
}
|
2515
2730
|
break;
|
2516
2731
|
default:
|
2517
|
-
|
2732
|
+
u = o.NONE;
|
2518
2733
|
}
|
2519
|
-
|
2734
|
+
u !== o.NONE && e.dispatchEvent(wt);
|
2520
2735
|
}
|
2521
|
-
function
|
2522
|
-
switch (
|
2523
|
-
case
|
2736
|
+
function Ke(i) {
|
2737
|
+
switch (u) {
|
2738
|
+
case o.ROTATE:
|
2524
2739
|
if (e.enableRotate === !1)
|
2525
2740
|
return;
|
2526
|
-
|
2741
|
+
rt(i);
|
2527
2742
|
break;
|
2528
|
-
case
|
2743
|
+
case o.DOLLY:
|
2529
2744
|
if (e.enableZoom === !1)
|
2530
2745
|
return;
|
2531
|
-
|
2746
|
+
vt(i);
|
2532
2747
|
break;
|
2533
|
-
case
|
2748
|
+
case o.PAN:
|
2534
2749
|
if (e.enablePan === !1)
|
2535
2750
|
return;
|
2536
|
-
|
2751
|
+
bt(i);
|
2537
2752
|
break;
|
2538
2753
|
}
|
2539
2754
|
}
|
2540
|
-
function
|
2541
|
-
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));
|
2542
2757
|
}
|
2543
|
-
function
|
2544
|
-
e.enabled === !1 || e.enablePan === !1 ||
|
2758
|
+
function Xe(i) {
|
2759
|
+
e.enabled === !1 || e.enablePan === !1 || We(i);
|
2545
2760
|
}
|
2546
|
-
function
|
2547
|
-
switch (
|
2761
|
+
function lt(i) {
|
2762
|
+
switch (qe(i), S.length) {
|
2548
2763
|
case 1:
|
2549
2764
|
switch (e.touches.ONE) {
|
2550
|
-
case
|
2765
|
+
case Fe.ROTATE:
|
2551
2766
|
if (e.enableRotate === !1)
|
2552
2767
|
return;
|
2553
|
-
|
2768
|
+
ye(i), u = o.TOUCH_ROTATE;
|
2554
2769
|
break;
|
2555
|
-
case
|
2770
|
+
case Fe.PAN:
|
2556
2771
|
if (e.enablePan === !1)
|
2557
2772
|
return;
|
2558
|
-
|
2773
|
+
ke(i), u = o.TOUCH_PAN;
|
2559
2774
|
break;
|
2560
2775
|
default:
|
2561
|
-
|
2776
|
+
u = o.NONE;
|
2562
2777
|
}
|
2563
2778
|
break;
|
2564
2779
|
case 2:
|
2565
2780
|
switch (e.touches.TWO) {
|
2566
|
-
case
|
2781
|
+
case Fe.DOLLY_PAN:
|
2567
2782
|
if (e.enableZoom === !1 && e.enablePan === !1)
|
2568
2783
|
return;
|
2569
|
-
|
2784
|
+
yt(i), u = o.TOUCH_DOLLY_PAN;
|
2570
2785
|
break;
|
2571
|
-
case
|
2786
|
+
case Fe.DOLLY_ROTATE:
|
2572
2787
|
if (e.enableZoom === !1 && e.enableRotate === !1)
|
2573
2788
|
return;
|
2574
|
-
|
2789
|
+
at(i), u = o.TOUCH_DOLLY_ROTATE;
|
2575
2790
|
break;
|
2576
2791
|
default:
|
2577
|
-
|
2792
|
+
u = o.NONE;
|
2578
2793
|
}
|
2579
2794
|
break;
|
2580
2795
|
default:
|
2581
|
-
|
2796
|
+
u = o.NONE;
|
2582
2797
|
}
|
2583
|
-
|
2798
|
+
u !== o.NONE && e.dispatchEvent(wt);
|
2584
2799
|
}
|
2585
|
-
function
|
2586
|
-
switch (
|
2587
|
-
case
|
2800
|
+
function ut(i) {
|
2801
|
+
switch (qe(i), u) {
|
2802
|
+
case o.TOUCH_ROTATE:
|
2588
2803
|
if (e.enableRotate === !1)
|
2589
2804
|
return;
|
2590
|
-
|
2805
|
+
it(i), e.update();
|
2591
2806
|
break;
|
2592
|
-
case
|
2807
|
+
case o.TOUCH_PAN:
|
2593
2808
|
if (e.enablePan === !1)
|
2594
2809
|
return;
|
2595
|
-
|
2810
|
+
ot(i), e.update();
|
2596
2811
|
break;
|
2597
|
-
case
|
2812
|
+
case o.TOUCH_DOLLY_PAN:
|
2598
2813
|
if (e.enableZoom === !1 && e.enablePan === !1)
|
2599
2814
|
return;
|
2600
|
-
|
2815
|
+
De(i), e.update();
|
2601
2816
|
break;
|
2602
|
-
case
|
2817
|
+
case o.TOUCH_DOLLY_ROTATE:
|
2603
2818
|
if (e.enableZoom === !1 && e.enableRotate === !1)
|
2604
2819
|
return;
|
2605
|
-
|
2820
|
+
st(i), e.update();
|
2606
2821
|
break;
|
2607
2822
|
default:
|
2608
|
-
|
2823
|
+
u = o.NONE;
|
2609
2824
|
}
|
2610
2825
|
}
|
2611
|
-
function
|
2612
|
-
e.enabled !== !1 &&
|
2826
|
+
function he(i) {
|
2827
|
+
e.enabled !== !1 && i.preventDefault();
|
2613
2828
|
}
|
2614
|
-
function
|
2615
|
-
|
2829
|
+
function xt(i) {
|
2830
|
+
S.push(i.pointerId);
|
2616
2831
|
}
|
2617
|
-
function
|
2618
|
-
delete
|
2619
|
-
for (let
|
2620
|
-
if (
|
2621
|
-
|
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);
|
2622
2837
|
return;
|
2623
2838
|
}
|
2624
2839
|
}
|
2625
|
-
function
|
2626
|
-
let
|
2627
|
-
|
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);
|
2628
2843
|
}
|
2629
|
-
function
|
2630
|
-
const
|
2631
|
-
return
|
2844
|
+
function se(i) {
|
2845
|
+
const y = i.pointerId === S[0] ? S[1] : S[0];
|
2846
|
+
return G[y];
|
2632
2847
|
}
|
2633
|
-
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();
|
2634
2849
|
}
|
2635
2850
|
}
|
2636
|
-
const
|
2637
|
-
const [n,
|
2638
|
-
|
2851
|
+
const Rt = (t) => {
|
2852
|
+
const [n, a] = ie(!1), [e, o] = ie(t.options[t.index]), u = () => {
|
2853
|
+
a(!n);
|
2639
2854
|
}, c = (s) => {
|
2640
|
-
s !== e && (t.onSelect(s),
|
2855
|
+
s !== e && (t.onSelect(s), o(s)), a(!1);
|
2641
2856
|
};
|
2642
|
-
return /* @__PURE__ */
|
2643
|
-
/* @__PURE__ */
|
2644
|
-
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)) })
|
2645
2860
|
] });
|
2646
|
-
},
|
2861
|
+
}, Te = Dn(function(n, a) {
|
2647
2862
|
const e = n.options.indexOf(n.camera.name);
|
2648
|
-
return /* @__PURE__ */
|
2649
|
-
/* @__PURE__ */
|
2650
|
-
/* @__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 })
|
2651
2866
|
] });
|
2652
|
-
}),
|
2653
|
-
uniform float uDistance;
|
2654
|
-
|
2655
|
-
void main() {
|
2656
|
-
// Scale the plane by the drawing distance
|
2657
|
-
worldPosition = position.xzy * uDistance;
|
2658
|
-
worldPosition.xz += cameraPosition.xz;
|
2659
|
-
|
2660
|
-
gl_Position = projectionMatrix * modelViewMatrix * vec4(worldPosition, 1.0);
|
2661
|
-
}`, oa = `out vec4 fragColor;
|
2662
|
-
in vec3 worldPosition;
|
2663
|
-
|
2664
|
-
uniform float uDivisions;
|
2665
|
-
uniform float uScale;
|
2666
|
-
uniform vec3 uColor;
|
2667
|
-
uniform float uDistance;
|
2668
|
-
uniform float uSubgridOpacity;
|
2669
|
-
uniform float uGridOpacity;
|
2670
|
-
|
2671
|
-
float getGrid(float gapSize) {
|
2672
|
-
vec2 worldPositionByDivision = worldPosition.xz / gapSize;
|
2673
|
-
|
2674
|
-
// Inverted, 0 where line, >1 where there's no line
|
2675
|
-
// We use the worldPosition (which in this case we use similarly to UVs) differential to control the anti-aliasing
|
2676
|
-
// We need to do the -0.5)-0.5 trick because the result fades out from 0 to 1, and we want both
|
2677
|
-
// worldPositionByDivision == 0.3 and worldPositionByDivision == 0.7 to result in the same fade, i.e. 0.3,
|
2678
|
-
// otherwise only one side of the line will be anti-aliased
|
2679
|
-
vec2 grid = abs(fract(worldPositionByDivision-0.5)-0.5) / fwidth(worldPositionByDivision) / 2.0;
|
2680
|
-
float gridLine = min(grid.x, grid.y);
|
2681
|
-
|
2682
|
-
// Uninvert and clamp
|
2683
|
-
return 1.0 - min(gridLine, 1.0);
|
2684
|
-
}
|
2685
|
-
|
2686
|
-
void main() {
|
2687
|
-
float cameraDistanceToGridPlane = distance(cameraPosition.y, worldPosition.y);
|
2688
|
-
float cameraDistanceToFragmentOnGridPlane = distance(cameraPosition.xz, worldPosition.xz);
|
2689
|
-
|
2690
|
-
// The size of the grid and subgrid are powers of each other and they are determined based on camera distance.
|
2691
|
-
// The current grid will become the next subgrid when it becomes too small, and its next power becomes the new grid.
|
2692
|
-
float subGridPower = pow(uDivisions, floor(log(cameraDistanceToGridPlane) / log(uDivisions)));
|
2693
|
-
float gridPower = subGridPower * uDivisions;
|
2694
|
-
|
2695
|
-
// 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
|
2696
|
-
float nextGridPower = gridPower * uDivisions;
|
2697
|
-
|
2698
|
-
// 1 where grid, 0 where no grid
|
2699
|
-
float subgrid = getGrid(subGridPower * uScale);
|
2700
|
-
float grid = getGrid(gridPower * uScale);
|
2701
|
-
float nextGrid = getGrid(nextGridPower * uScale);
|
2702
|
-
|
2703
|
-
// Where we are between the introduction of the current grid power and when we switch to the next grid power
|
2704
|
-
float stepPercentage = (cameraDistanceToGridPlane - subGridPower)/(gridPower - subGridPower);
|
2705
|
-
|
2706
|
-
// The last x percentage of the current step over which we want to fade
|
2707
|
-
float fadeRange = 0.3;
|
2708
|
-
|
2709
|
-
// We calculate the fade percentage from the step percentage and the fade range
|
2710
|
-
float fadePercentage = max(stepPercentage - 1.0 + fadeRange, 0.0) / fadeRange;
|
2711
|
-
|
2712
|
-
// Set base opacity based on how close we are to the drawing distance, with a cubic falloff
|
2713
|
-
float baseOpacity = subgrid * pow(1.0 - min(cameraDistanceToFragmentOnGridPlane / uDistance, 1.0), 3.0);
|
2714
|
-
|
2715
|
-
// Shade the subgrid
|
2716
|
-
fragColor = vec4(uColor.rgb, (baseOpacity - fadePercentage) * uSubgridOpacity);
|
2717
|
-
|
2718
|
-
// Somewhat arbitrary additional fade coefficient to counter anti-aliasing popping when switching between grid powers
|
2719
|
-
float fadeCoefficient = 0.5;
|
2720
|
-
|
2721
|
-
// Shade the grid
|
2722
|
-
fragColor.a = mix(fragColor.a, baseOpacity * uGridOpacity - fadePercentage * (uGridOpacity - uSubgridOpacity) * fadeCoefficient, grid);
|
2723
|
-
|
2724
|
-
// Shade the next grid
|
2725
|
-
fragColor.a = mix(fragColor.a, baseOpacity * uGridOpacity, nextGrid);
|
2726
|
-
|
2727
|
-
if (fragColor.a <= 0.0) discard;
|
2728
|
-
}`;
|
2729
|
-
class sa extends vn {
|
2730
|
-
constructor(n) {
|
2731
|
-
super({
|
2732
|
-
extensions: {
|
2733
|
-
derivatives: !0
|
2734
|
-
},
|
2735
|
-
glslVersion: bn,
|
2736
|
-
side: yn,
|
2737
|
-
transparent: !0,
|
2738
|
-
uniforms: {
|
2739
|
-
uScale: {
|
2740
|
-
value: (n == null ? void 0 : n.scale) !== void 0 ? n == null ? void 0 : n.scale : 0.1
|
2741
|
-
},
|
2742
|
-
uDivisions: {
|
2743
|
-
value: (n == null ? void 0 : n.divisions) !== void 0 ? n == null ? void 0 : n.divisions : 10
|
2744
|
-
},
|
2745
|
-
uColor: {
|
2746
|
-
value: (n == null ? void 0 : n.color) !== void 0 ? n == null ? void 0 : n.color : new St(16777215)
|
2747
|
-
},
|
2748
|
-
uDistance: {
|
2749
|
-
value: (n == null ? void 0 : n.distance) !== void 0 ? n == null ? void 0 : n.distance : 1e4
|
2750
|
-
},
|
2751
|
-
uSubgridOpacity: {
|
2752
|
-
value: (n == null ? void 0 : n.subgridOpacity) !== void 0 ? n == null ? void 0 : n.subgridOpacity : 0.15
|
2753
|
-
},
|
2754
|
-
uGridOpacity: {
|
2755
|
-
value: (n == null ? void 0 : n.gridOpacity) !== void 0 ? n == null ? void 0 : n.gridOpacity : 0.25
|
2756
|
-
}
|
2757
|
-
},
|
2758
|
-
vertexShader: ia,
|
2759
|
-
fragmentShader: oa,
|
2760
|
-
name: "InfiniteGrid",
|
2761
|
-
depthWrite: !1
|
2762
|
-
});
|
2763
|
-
}
|
2764
|
-
}
|
2765
|
-
class ca extends Vt {
|
2766
|
-
constructor() {
|
2767
|
-
const r = new sa();
|
2768
|
-
super(new En(2, 2), r);
|
2769
|
-
$(this, "gridMaterial");
|
2770
|
-
this.gridMaterial = r, this.frustumCulled = !1, this.name = "InfiniteGridHelper", this.position.y = 0.1;
|
2771
|
-
}
|
2772
|
-
update() {
|
2773
|
-
this.gridMaterial.needsUpdate = !0;
|
2774
|
-
}
|
2775
|
-
}
|
2776
|
-
const Gt = [
|
2867
|
+
}), Ht = [
|
2777
2868
|
"Single",
|
2778
2869
|
"Side by Side",
|
2779
2870
|
"Stacked",
|
2780
2871
|
"Quad"
|
2781
|
-
],
|
2782
|
-
|
2783
|
-
|
2784
|
-
|
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;
|
2785
2885
|
}
|
2786
|
-
|
2787
|
-
|
2788
|
-
|
2789
|
-
|
2790
|
-
|
2791
|
-
|
2792
|
-
|
2793
|
-
const
|
2794
|
-
|
2795
|
-
|
2796
|
-
|
2797
|
-
|
2798
|
-
|
2799
|
-
const la = [
|
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 = [
|
2800
2899
|
"Default",
|
2801
2900
|
"Normals",
|
2802
|
-
"Wireframe"
|
2803
|
-
|
2901
|
+
"Wireframe",
|
2902
|
+
"UVs"
|
2903
|
+
], gr = new Sn(), vr = new Tn({
|
2804
2904
|
opacity: 0.33,
|
2805
2905
|
transparent: !0,
|
2806
2906
|
wireframe: !0
|
2807
|
-
}),
|
2808
|
-
|
2809
|
-
|
2810
|
-
|
2811
|
-
|
2812
|
-
|
2813
|
-
|
2814
|
-
|
2815
|
-
|
2816
|
-
|
2817
|
-
|
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) {
|
2818
2919
|
case "Top":
|
2819
2920
|
case "Bottom":
|
2820
2921
|
case "Left":
|
2821
2922
|
case "Right":
|
2822
2923
|
case "Front":
|
2823
2924
|
case "Back":
|
2824
|
-
|
2925
|
+
w.enableRotate = !1;
|
2825
2926
|
break;
|
2826
2927
|
}
|
2827
|
-
if (
|
2828
|
-
const
|
2829
|
-
|
2830
|
-
}
|
2831
|
-
},
|
2832
|
-
const
|
2833
|
-
|
2834
|
-
const
|
2835
|
-
|
2836
|
-
},
|
2837
|
-
|
2838
|
-
|
2839
|
-
const
|
2840
|
-
|
2841
|
-
}),
|
2842
|
-
},
|
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 = () => {
|
2843
2944
|
switch (n) {
|
2844
2945
|
case "Single":
|
2845
|
-
|
2946
|
+
s($, e.current);
|
2846
2947
|
break;
|
2847
2948
|
case "Side by Side":
|
2848
2949
|
case "Stacked":
|
2849
|
-
|
2950
|
+
s($, e.current), s(ee, o.current);
|
2850
2951
|
break;
|
2851
2952
|
case "Quad":
|
2852
|
-
|
2953
|
+
s($, e.current), s(ee, o.current), s(Ue, u.current), s(Be, c.current);
|
2853
2954
|
break;
|
2854
2955
|
}
|
2855
2956
|
};
|
2856
|
-
|
2857
|
-
|
2858
|
-
const
|
2859
|
-
|
2860
|
-
const
|
2861
|
-
|
2862
|
-
}, []),
|
2863
|
-
const
|
2864
|
-
let
|
2865
|
-
const
|
2866
|
-
|
2867
|
-
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;
|
2868
2969
|
switch (n) {
|
2869
2970
|
case "Side by Side":
|
2870
|
-
|
2971
|
+
O = E, S = g;
|
2871
2972
|
break;
|
2872
2973
|
case "Stacked":
|
2873
|
-
|
2974
|
+
O = h, S = w;
|
2874
2975
|
break;
|
2875
2976
|
case "Quad":
|
2876
|
-
|
2977
|
+
O = E, S = w;
|
2877
2978
|
break;
|
2878
2979
|
}
|
2879
|
-
|
2880
|
-
var
|
2881
|
-
|
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());
|
2882
2983
|
});
|
2883
|
-
},
|
2884
|
-
t.renderer.setViewport(0, 0,
|
2885
|
-
},
|
2984
|
+
}, j = () => {
|
2985
|
+
t.renderer.setViewport(0, 0, h, g), t.renderer.setScissor(0, 0, h, g), t.renderer.render(F, $);
|
2986
|
+
}, X = () => {
|
2886
2987
|
if (n === "Side by Side")
|
2887
|
-
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);
|
2888
2989
|
else {
|
2889
|
-
const
|
2890
|
-
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);
|
2891
2992
|
}
|
2892
|
-
},
|
2893
|
-
let
|
2894
|
-
|
2895
|
-
},
|
2896
|
-
switch (
|
2897
|
-
|
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();
|
2898
2999
|
}), t.scene.update(), t.renderer.clear(), n) {
|
2899
3000
|
case "Single":
|
2900
|
-
|
3001
|
+
j();
|
2901
3002
|
break;
|
2902
3003
|
case "Side by Side":
|
2903
3004
|
case "Stacked":
|
2904
|
-
|
3005
|
+
X();
|
2905
3006
|
break;
|
2906
3007
|
case "Quad":
|
2907
|
-
|
3008
|
+
Z();
|
2908
3009
|
break;
|
2909
3010
|
}
|
2910
|
-
|
3011
|
+
A = requestAnimationFrame(z);
|
2911
3012
|
};
|
2912
|
-
return
|
2913
|
-
window.removeEventListener("resize",
|
3013
|
+
return v(), window.addEventListener("resize", U), U(), z(), () => {
|
3014
|
+
window.removeEventListener("resize", U), cancelAnimationFrame(A), A = -1;
|
2914
3015
|
};
|
2915
|
-
}, [n])
|
2916
|
-
|
2917
|
-
|
2918
|
-
"
|
2919
|
-
|
2920
|
-
|
2921
|
-
|
2922
|
-
|
2923
|
-
|
2924
|
-
"Debug"
|
2925
|
-
];
|
2926
|
-
return t.cameras.forEach((y) => {
|
2927
|
-
q.set(y.name, y), D.push(y.name);
|
2928
|
-
}), /* @__PURE__ */ u.jsxs("div", { className: "multiview", children: [
|
2929
|
-
/* @__PURE__ */ u.jsxs("div", { className: `cameras ${n === "Single" || n === "Stacked" ? "single" : ""}`, children: [
|
2930
|
-
n === "Single" && /* @__PURE__ */ u.jsx(u.Fragment, { children: /* @__PURE__ */ u.jsx(Ce, { camera: s, options: D, ref: e, onSelect: (y) => {
|
2931
|
-
var v;
|
2932
|
-
(v = H.get(s.name)) == null || v.dispose();
|
2933
|
-
const b = q.get(y);
|
2934
|
-
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));
|
2935
3025
|
} }) }),
|
2936
|
-
(n === "Side by Side" || n === "Stacked") && /* @__PURE__ */
|
2937
|
-
/* @__PURE__ */
|
2938
|
-
var
|
2939
|
-
(
|
2940
|
-
const
|
2941
|
-
|
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));
|
2942
3032
|
} }),
|
2943
|
-
/* @__PURE__ */
|
2944
|
-
var
|
2945
|
-
(
|
2946
|
-
const
|
2947
|
-
|
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));
|
2948
3038
|
} })
|
2949
3039
|
] }),
|
2950
|
-
n === "Quad" && /* @__PURE__ */
|
2951
|
-
/* @__PURE__ */
|
2952
|
-
var
|
2953
|
-
(
|
2954
|
-
const
|
2955
|
-
|
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));
|
2956
3046
|
} }),
|
2957
|
-
/* @__PURE__ */
|
2958
|
-
var
|
2959
|
-
(
|
2960
|
-
const
|
2961
|
-
|
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));
|
2962
3052
|
} }),
|
2963
|
-
/* @__PURE__ */
|
2964
|
-
var
|
2965
|
-
(
|
2966
|
-
const
|
2967
|
-
|
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));
|
2968
3058
|
} }),
|
2969
|
-
/* @__PURE__ */
|
2970
|
-
var
|
2971
|
-
(
|
2972
|
-
const
|
2973
|
-
|
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));
|
2974
3064
|
} })
|
2975
3065
|
] })
|
2976
3066
|
] }),
|
2977
|
-
/* @__PURE__ */
|
2978
|
-
/* @__PURE__ */
|
2979
|
-
|
3067
|
+
/* @__PURE__ */ l.jsxs("div", { className: "settings", children: [
|
3068
|
+
/* @__PURE__ */ l.jsx(
|
3069
|
+
Rt,
|
2980
3070
|
{
|
2981
|
-
index:
|
2982
|
-
options:
|
2983
|
-
onSelect: (
|
2984
|
-
|
3071
|
+
index: Ht.indexOf(n),
|
3072
|
+
options: Ht,
|
3073
|
+
onSelect: (f) => {
|
3074
|
+
f !== n && (m(), a(f));
|
2985
3075
|
}
|
2986
3076
|
}
|
2987
3077
|
),
|
2988
|
-
/* @__PURE__ */
|
2989
|
-
|
3078
|
+
/* @__PURE__ */ l.jsx(
|
3079
|
+
Rt,
|
2990
3080
|
{
|
2991
3081
|
index: 0,
|
2992
|
-
options:
|
2993
|
-
onSelect: (
|
2994
|
-
if (
|
2995
|
-
switch (
|
3082
|
+
options: mr,
|
3083
|
+
onSelect: (f) => {
|
3084
|
+
if (f !== Ct)
|
3085
|
+
switch (Ct = f, Ct) {
|
2996
3086
|
case "Default":
|
2997
|
-
|
3087
|
+
F.overrideMaterial = null;
|
2998
3088
|
break;
|
2999
3089
|
case "Normals":
|
3000
|
-
|
3090
|
+
F.overrideMaterial = gr;
|
3001
3091
|
break;
|
3002
3092
|
case "Wireframe":
|
3003
|
-
|
3093
|
+
F.overrideMaterial = vr;
|
3094
|
+
break;
|
3095
|
+
case "UVs":
|
3096
|
+
F.overrideMaterial = br;
|
3004
3097
|
break;
|
3005
3098
|
}
|
3006
3099
|
}
|
@@ -3009,41 +3102,42 @@ function ja(t) {
|
|
3009
3102
|
] })
|
3010
3103
|
] });
|
3011
3104
|
}
|
3012
|
-
function
|
3013
|
-
return /* @__PURE__ */
|
3014
|
-
/* @__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 }),
|
3015
3108
|
t.children,
|
3016
|
-
/* @__PURE__ */
|
3109
|
+
/* @__PURE__ */ l.jsx("footer", { children: t.footer })
|
3017
3110
|
] });
|
3018
3111
|
}
|
3019
3112
|
export {
|
3020
|
-
|
3021
|
-
|
3022
|
-
|
3023
|
-
|
3024
|
-
|
3025
|
-
|
3026
|
-
|
3027
|
-
|
3028
|
-
|
3029
|
-
|
3030
|
-
|
3031
|
-
|
3032
|
-
|
3033
|
-
|
3034
|
-
|
3035
|
-
|
3036
|
-
|
3037
|
-
|
3038
|
-
|
3039
|
-
|
3040
|
-
|
3041
|
-
|
3042
|
-
|
3043
|
-
|
3044
|
-
|
3045
|
-
|
3046
|
-
|
3047
|
-
|
3048
|
-
|
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
|
3049
3143
|
};
|