threedviewer 0.5.0 → 0.6.0
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/simple-viewer.es.js +1368 -1163
- package/dist/simple-viewer.umd.js +19 -19
- package/package.json +2 -2
package/dist/simple-viewer.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import * as
|
|
3
|
-
import { Ray as
|
|
4
|
-
var
|
|
1
|
+
import ie, { useRef as X, useState as Ke, useCallback as at, useEffect as Jt, useMemo as si } from "react";
|
|
2
|
+
import * as h from "three";
|
|
3
|
+
import { Ray as Xe, Plane as $e, MathUtils as qe, Vector3 as z, Controls as Qe, MOUSE as H, TOUCH as $, Quaternion as te, Spherical as ee, Vector2 as A } from "three";
|
|
4
|
+
var je = { exports: {} }, Ht = {};
|
|
5
5
|
/**
|
|
6
6
|
* @license React
|
|
7
7
|
* react-jsx-runtime.production.min.js
|
|
@@ -11,21 +11,21 @@ var Ce = { exports: {} }, At = {};
|
|
|
11
11
|
* This source code is licensed under the MIT license found in the
|
|
12
12
|
* LICENSE file in the root directory of this source tree.
|
|
13
13
|
*/
|
|
14
|
-
var
|
|
15
|
-
function
|
|
16
|
-
if (
|
|
17
|
-
|
|
18
|
-
var
|
|
19
|
-
function
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
for (
|
|
23
|
-
if (
|
|
24
|
-
return { $$typeof: t, type:
|
|
25
|
-
}
|
|
26
|
-
return
|
|
14
|
+
var Ne;
|
|
15
|
+
function ai() {
|
|
16
|
+
if (Ne) return Ht;
|
|
17
|
+
Ne = 1;
|
|
18
|
+
var n = ie, t = Symbol.for("react.element"), i = Symbol.for("react.fragment"), o = Object.prototype.hasOwnProperty, s = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, l = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
19
|
+
function d(u, p, v) {
|
|
20
|
+
var g, C = {}, P = null, I = null;
|
|
21
|
+
v !== void 0 && (P = "" + v), p.key !== void 0 && (P = "" + p.key), p.ref !== void 0 && (I = p.ref);
|
|
22
|
+
for (g in p) o.call(p, g) && !l.hasOwnProperty(g) && (C[g] = p[g]);
|
|
23
|
+
if (u && u.defaultProps) for (g in p = u.defaultProps, p) C[g] === void 0 && (C[g] = p[g]);
|
|
24
|
+
return { $$typeof: t, type: u, key: P, ref: I, props: C, _owner: s.current };
|
|
25
|
+
}
|
|
26
|
+
return Ht.Fragment = i, Ht.jsx = d, Ht.jsxs = d, Ht;
|
|
27
27
|
}
|
|
28
|
-
var
|
|
28
|
+
var Gt = {};
|
|
29
29
|
/**
|
|
30
30
|
* @license React
|
|
31
31
|
* react-jsx-runtime.development.js
|
|
@@ -35,54 +35,54 @@ var zt = {};
|
|
|
35
35
|
* This source code is licensed under the MIT license found in the
|
|
36
36
|
* LICENSE file in the root directory of this source tree.
|
|
37
37
|
*/
|
|
38
|
-
var
|
|
39
|
-
function
|
|
40
|
-
return
|
|
41
|
-
var
|
|
42
|
-
function
|
|
38
|
+
var ze;
|
|
39
|
+
function hi() {
|
|
40
|
+
return ze || (ze = 1, process.env.NODE_ENV !== "production" && function() {
|
|
41
|
+
var n = ie, t = Symbol.for("react.element"), i = Symbol.for("react.portal"), o = Symbol.for("react.fragment"), s = Symbol.for("react.strict_mode"), l = Symbol.for("react.profiler"), d = Symbol.for("react.provider"), u = Symbol.for("react.context"), p = Symbol.for("react.forward_ref"), v = Symbol.for("react.suspense"), g = Symbol.for("react.suspense_list"), C = Symbol.for("react.memo"), P = Symbol.for("react.lazy"), I = Symbol.for("react.offscreen"), Z = Symbol.iterator, U = "@@iterator";
|
|
42
|
+
function J(e) {
|
|
43
43
|
if (e === null || typeof e != "object")
|
|
44
44
|
return null;
|
|
45
|
-
var
|
|
46
|
-
return typeof
|
|
45
|
+
var r = Z && e[Z] || e[U];
|
|
46
|
+
return typeof r == "function" ? r : null;
|
|
47
47
|
}
|
|
48
|
-
var
|
|
48
|
+
var k = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
49
49
|
function w(e) {
|
|
50
50
|
{
|
|
51
|
-
for (var
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
for (var r = arguments.length, a = new Array(r > 1 ? r - 1 : 0), c = 1; c < r; c++)
|
|
52
|
+
a[c - 1] = arguments[c];
|
|
53
|
+
ht("error", e, a);
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
-
function
|
|
56
|
+
function ht(e, r, a) {
|
|
57
57
|
{
|
|
58
|
-
var
|
|
59
|
-
|
|
60
|
-
var
|
|
61
|
-
return String(
|
|
58
|
+
var c = k.ReactDebugCurrentFrame, _ = c.getStackAddendum();
|
|
59
|
+
_ !== "" && (r += "%s", a = a.concat([_]));
|
|
60
|
+
var y = a.map(function(m) {
|
|
61
|
+
return String(m);
|
|
62
62
|
});
|
|
63
|
-
|
|
63
|
+
y.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, y);
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
|
-
var
|
|
67
|
-
|
|
68
|
-
function
|
|
69
|
-
return !!(typeof e == "string" || typeof e == "function" || e ===
|
|
66
|
+
var wt = !1, lt = !1, ct = !1, ut = !1, T = !1, O;
|
|
67
|
+
O = Symbol.for("react.module.reference");
|
|
68
|
+
function N(e) {
|
|
69
|
+
return !!(typeof e == "string" || typeof e == "function" || e === o || e === l || T || e === s || e === v || e === g || ut || e === I || wt || lt || ct || typeof e == "object" && e !== null && (e.$$typeof === P || e.$$typeof === C || e.$$typeof === d || e.$$typeof === u || e.$$typeof === p || // This needs to include all possible module reference object
|
|
70
70
|
// types supported by any Flight configuration anywhere since
|
|
71
71
|
// we don't know which Flight build this will end up being used
|
|
72
72
|
// with.
|
|
73
|
-
e.$$typeof ===
|
|
73
|
+
e.$$typeof === O || e.getModuleId !== void 0));
|
|
74
74
|
}
|
|
75
|
-
function
|
|
76
|
-
var
|
|
77
|
-
if (
|
|
78
|
-
return
|
|
79
|
-
var
|
|
80
|
-
return
|
|
75
|
+
function it(e, r, a) {
|
|
76
|
+
var c = e.displayName;
|
|
77
|
+
if (c)
|
|
78
|
+
return c;
|
|
79
|
+
var _ = r.displayName || r.name || "";
|
|
80
|
+
return _ !== "" ? a + "(" + _ + ")" : a;
|
|
81
81
|
}
|
|
82
82
|
function dt(e) {
|
|
83
83
|
return e.displayName || "Context";
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function L(e) {
|
|
86
86
|
if (e == null)
|
|
87
87
|
return null;
|
|
88
88
|
if (typeof e.tag == "number" && w("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
@@ -90,36 +90,36 @@ function ri() {
|
|
|
90
90
|
if (typeof e == "string")
|
|
91
91
|
return e;
|
|
92
92
|
switch (e) {
|
|
93
|
-
case
|
|
93
|
+
case o:
|
|
94
94
|
return "Fragment";
|
|
95
95
|
case i:
|
|
96
96
|
return "Portal";
|
|
97
|
-
case
|
|
97
|
+
case l:
|
|
98
98
|
return "Profiler";
|
|
99
|
-
case
|
|
99
|
+
case s:
|
|
100
100
|
return "StrictMode";
|
|
101
|
-
case
|
|
101
|
+
case v:
|
|
102
102
|
return "Suspense";
|
|
103
|
-
case
|
|
103
|
+
case g:
|
|
104
104
|
return "SuspenseList";
|
|
105
105
|
}
|
|
106
106
|
if (typeof e == "object")
|
|
107
107
|
switch (e.$$typeof) {
|
|
108
|
+
case u:
|
|
109
|
+
var r = e;
|
|
110
|
+
return dt(r) + ".Consumer";
|
|
108
111
|
case d:
|
|
109
|
-
var
|
|
110
|
-
return dt(
|
|
112
|
+
var a = e;
|
|
113
|
+
return dt(a._context) + ".Provider";
|
|
111
114
|
case p:
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
return
|
|
116
|
-
case
|
|
117
|
-
var
|
|
118
|
-
return h !== null ? h : x(e.type) || "Memo";
|
|
119
|
-
case M: {
|
|
120
|
-
var f = e, _ = f._payload, c = f._init;
|
|
115
|
+
return it(e, e.render, "ForwardRef");
|
|
116
|
+
case C:
|
|
117
|
+
var c = e.displayName || null;
|
|
118
|
+
return c !== null ? c : L(e.type) || "Memo";
|
|
119
|
+
case P: {
|
|
120
|
+
var _ = e, y = _._payload, m = _._init;
|
|
121
121
|
try {
|
|
122
|
-
return
|
|
122
|
+
return L(m(y));
|
|
123
123
|
} catch {
|
|
124
124
|
return null;
|
|
125
125
|
}
|
|
@@ -127,18 +127,18 @@ function ri() {
|
|
|
127
127
|
}
|
|
128
128
|
return null;
|
|
129
129
|
}
|
|
130
|
-
var
|
|
131
|
-
function
|
|
130
|
+
var V = Object.assign, G = 0, St, Tt, Ct, Pt, Rt, Ot, Dt;
|
|
131
|
+
function Mt() {
|
|
132
132
|
}
|
|
133
|
-
|
|
134
|
-
function
|
|
133
|
+
Mt.__reactDisabledLog = !0;
|
|
134
|
+
function oe() {
|
|
135
135
|
{
|
|
136
|
-
if (
|
|
137
|
-
|
|
136
|
+
if (G === 0) {
|
|
137
|
+
St = console.log, Tt = console.info, Ct = console.warn, Pt = console.error, Rt = console.group, Ot = console.groupCollapsed, Dt = console.groupEnd;
|
|
138
138
|
var e = {
|
|
139
139
|
configurable: !0,
|
|
140
140
|
enumerable: !0,
|
|
141
|
-
value:
|
|
141
|
+
value: Mt,
|
|
142
142
|
writable: !0
|
|
143
143
|
};
|
|
144
144
|
Object.defineProperties(console, {
|
|
@@ -151,336 +151,336 @@ function ri() {
|
|
|
151
151
|
groupEnd: e
|
|
152
152
|
});
|
|
153
153
|
}
|
|
154
|
-
|
|
154
|
+
G++;
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
|
-
function
|
|
157
|
+
function ne() {
|
|
158
158
|
{
|
|
159
|
-
if (
|
|
159
|
+
if (G--, G === 0) {
|
|
160
160
|
var e = {
|
|
161
161
|
configurable: !0,
|
|
162
162
|
enumerable: !0,
|
|
163
163
|
writable: !0
|
|
164
164
|
};
|
|
165
165
|
Object.defineProperties(console, {
|
|
166
|
-
log:
|
|
167
|
-
value:
|
|
166
|
+
log: V({}, e, {
|
|
167
|
+
value: St
|
|
168
168
|
}),
|
|
169
|
-
info:
|
|
170
|
-
value:
|
|
169
|
+
info: V({}, e, {
|
|
170
|
+
value: Tt
|
|
171
171
|
}),
|
|
172
|
-
warn:
|
|
173
|
-
value:
|
|
172
|
+
warn: V({}, e, {
|
|
173
|
+
value: Ct
|
|
174
174
|
}),
|
|
175
|
-
error:
|
|
176
|
-
value:
|
|
175
|
+
error: V({}, e, {
|
|
176
|
+
value: Pt
|
|
177
177
|
}),
|
|
178
|
-
group:
|
|
179
|
-
value:
|
|
178
|
+
group: V({}, e, {
|
|
179
|
+
value: Rt
|
|
180
180
|
}),
|
|
181
|
-
groupCollapsed:
|
|
182
|
-
value:
|
|
181
|
+
groupCollapsed: V({}, e, {
|
|
182
|
+
value: Ot
|
|
183
183
|
}),
|
|
184
|
-
groupEnd:
|
|
185
|
-
value:
|
|
184
|
+
groupEnd: V({}, e, {
|
|
185
|
+
value: Dt
|
|
186
186
|
})
|
|
187
187
|
});
|
|
188
188
|
}
|
|
189
|
-
|
|
189
|
+
G < 0 && w("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
|
-
var
|
|
193
|
-
function
|
|
192
|
+
var pt = k.ReactCurrentDispatcher, ft;
|
|
193
|
+
function ot(e, r, a) {
|
|
194
194
|
{
|
|
195
|
-
if (
|
|
195
|
+
if (ft === void 0)
|
|
196
196
|
try {
|
|
197
197
|
throw Error();
|
|
198
|
-
} catch (
|
|
199
|
-
var
|
|
200
|
-
|
|
198
|
+
} catch (_) {
|
|
199
|
+
var c = _.stack.trim().match(/\n( *(at )?)/);
|
|
200
|
+
ft = c && c[1] || "";
|
|
201
201
|
}
|
|
202
202
|
return `
|
|
203
|
-
` +
|
|
203
|
+
` + ft + e;
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
|
-
var
|
|
206
|
+
var mt = !1, nt;
|
|
207
207
|
{
|
|
208
|
-
var
|
|
209
|
-
|
|
208
|
+
var re = typeof WeakMap == "function" ? WeakMap : Map;
|
|
209
|
+
nt = new re();
|
|
210
210
|
}
|
|
211
|
-
function
|
|
212
|
-
if (!e ||
|
|
211
|
+
function xt(e, r) {
|
|
212
|
+
if (!e || mt)
|
|
213
213
|
return "";
|
|
214
214
|
{
|
|
215
|
-
var
|
|
216
|
-
if (
|
|
217
|
-
return
|
|
215
|
+
var a = nt.get(e);
|
|
216
|
+
if (a !== void 0)
|
|
217
|
+
return a;
|
|
218
218
|
}
|
|
219
|
-
var
|
|
220
|
-
|
|
221
|
-
var
|
|
219
|
+
var c;
|
|
220
|
+
mt = !0;
|
|
221
|
+
var _ = Error.prepareStackTrace;
|
|
222
222
|
Error.prepareStackTrace = void 0;
|
|
223
|
-
var
|
|
224
|
-
|
|
223
|
+
var y;
|
|
224
|
+
y = pt.current, pt.current = null, oe();
|
|
225
225
|
try {
|
|
226
|
-
if (
|
|
227
|
-
var
|
|
226
|
+
if (r) {
|
|
227
|
+
var m = function() {
|
|
228
228
|
throw Error();
|
|
229
229
|
};
|
|
230
|
-
if (Object.defineProperty(
|
|
230
|
+
if (Object.defineProperty(m.prototype, "props", {
|
|
231
231
|
set: function() {
|
|
232
232
|
throw Error();
|
|
233
233
|
}
|
|
234
234
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
235
235
|
try {
|
|
236
|
-
Reflect.construct(
|
|
237
|
-
} catch (
|
|
238
|
-
|
|
236
|
+
Reflect.construct(m, []);
|
|
237
|
+
} catch (D) {
|
|
238
|
+
c = D;
|
|
239
239
|
}
|
|
240
|
-
Reflect.construct(e, [],
|
|
240
|
+
Reflect.construct(e, [], m);
|
|
241
241
|
} else {
|
|
242
242
|
try {
|
|
243
|
-
|
|
244
|
-
} catch (
|
|
245
|
-
|
|
243
|
+
m.call();
|
|
244
|
+
} catch (D) {
|
|
245
|
+
c = D;
|
|
246
246
|
}
|
|
247
|
-
e.call(
|
|
247
|
+
e.call(m.prototype);
|
|
248
248
|
}
|
|
249
249
|
} else {
|
|
250
250
|
try {
|
|
251
251
|
throw Error();
|
|
252
|
-
} catch (
|
|
253
|
-
|
|
252
|
+
} catch (D) {
|
|
253
|
+
c = D;
|
|
254
254
|
}
|
|
255
255
|
e();
|
|
256
256
|
}
|
|
257
|
-
} catch (
|
|
258
|
-
if (
|
|
259
|
-
for (var
|
|
260
|
-
`),
|
|
261
|
-
`),
|
|
262
|
-
|
|
263
|
-
for (;
|
|
264
|
-
if (
|
|
265
|
-
if (
|
|
257
|
+
} catch (D) {
|
|
258
|
+
if (D && c && typeof D.stack == "string") {
|
|
259
|
+
for (var f = D.stack.split(`
|
|
260
|
+
`), R = c.stack.split(`
|
|
261
|
+
`), b = f.length - 1, E = R.length - 1; b >= 1 && E >= 0 && f[b] !== R[E]; )
|
|
262
|
+
E--;
|
|
263
|
+
for (; b >= 1 && E >= 0; b--, E--)
|
|
264
|
+
if (f[b] !== R[E]) {
|
|
265
|
+
if (b !== 1 || E !== 1)
|
|
266
266
|
do
|
|
267
|
-
if (
|
|
268
|
-
var
|
|
269
|
-
` +
|
|
270
|
-
return e.displayName &&
|
|
267
|
+
if (b--, E--, E < 0 || f[b] !== R[E]) {
|
|
268
|
+
var j = `
|
|
269
|
+
` + f[b].replace(" at new ", " at ");
|
|
270
|
+
return e.displayName && j.includes("<anonymous>") && (j = j.replace("<anonymous>", e.displayName)), typeof e == "function" && nt.set(e, j), j;
|
|
271
271
|
}
|
|
272
|
-
while (
|
|
272
|
+
while (b >= 1 && E >= 0);
|
|
273
273
|
break;
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
276
|
} finally {
|
|
277
|
-
|
|
277
|
+
mt = !1, pt.current = y, ne(), Error.prepareStackTrace = _;
|
|
278
278
|
}
|
|
279
|
-
var
|
|
280
|
-
return typeof e == "function" &&
|
|
279
|
+
var Q = e ? e.displayName || e.name : "", W = Q ? ot(Q) : "";
|
|
280
|
+
return typeof e == "function" && nt.set(e, W), W;
|
|
281
281
|
}
|
|
282
|
-
function
|
|
283
|
-
return
|
|
282
|
+
function se(e, r, a) {
|
|
283
|
+
return xt(e, !1);
|
|
284
284
|
}
|
|
285
|
-
function
|
|
286
|
-
var
|
|
287
|
-
return !!(
|
|
285
|
+
function ae(e) {
|
|
286
|
+
var r = e.prototype;
|
|
287
|
+
return !!(r && r.isReactComponent);
|
|
288
288
|
}
|
|
289
|
-
function
|
|
289
|
+
function rt(e, r, a) {
|
|
290
290
|
if (e == null)
|
|
291
291
|
return "";
|
|
292
292
|
if (typeof e == "function")
|
|
293
|
-
return
|
|
293
|
+
return xt(e, ae(e));
|
|
294
294
|
if (typeof e == "string")
|
|
295
|
-
return
|
|
295
|
+
return ot(e);
|
|
296
296
|
switch (e) {
|
|
297
|
-
case
|
|
298
|
-
return
|
|
299
|
-
case
|
|
300
|
-
return
|
|
297
|
+
case v:
|
|
298
|
+
return ot("Suspense");
|
|
299
|
+
case g:
|
|
300
|
+
return ot("SuspenseList");
|
|
301
301
|
}
|
|
302
302
|
if (typeof e == "object")
|
|
303
303
|
switch (e.$$typeof) {
|
|
304
|
-
case
|
|
305
|
-
return
|
|
306
|
-
case
|
|
307
|
-
return
|
|
308
|
-
case
|
|
309
|
-
var
|
|
304
|
+
case p:
|
|
305
|
+
return se(e.render);
|
|
306
|
+
case C:
|
|
307
|
+
return rt(e.type, r, a);
|
|
308
|
+
case P: {
|
|
309
|
+
var c = e, _ = c._payload, y = c._init;
|
|
310
310
|
try {
|
|
311
|
-
return
|
|
311
|
+
return rt(y(_), r, a);
|
|
312
312
|
} catch {
|
|
313
313
|
}
|
|
314
314
|
}
|
|
315
315
|
}
|
|
316
316
|
return "";
|
|
317
317
|
}
|
|
318
|
-
var
|
|
319
|
-
function
|
|
318
|
+
var tt = Object.prototype.hasOwnProperty, jt = {}, Lt = k.ReactDebugCurrentFrame;
|
|
319
|
+
function st(e) {
|
|
320
320
|
if (e) {
|
|
321
|
-
var
|
|
322
|
-
|
|
321
|
+
var r = e._owner, a = rt(e.type, e._source, r ? r.type : null);
|
|
322
|
+
Lt.setExtraStackFrame(a);
|
|
323
323
|
} else
|
|
324
|
-
|
|
324
|
+
Lt.setExtraStackFrame(null);
|
|
325
325
|
}
|
|
326
|
-
function
|
|
326
|
+
function he(e, r, a, c, _) {
|
|
327
327
|
{
|
|
328
|
-
var
|
|
329
|
-
for (var
|
|
330
|
-
if (
|
|
331
|
-
var
|
|
328
|
+
var y = Function.call.bind(tt);
|
|
329
|
+
for (var m in e)
|
|
330
|
+
if (y(e, m)) {
|
|
331
|
+
var f = void 0;
|
|
332
332
|
try {
|
|
333
|
-
if (typeof e[
|
|
334
|
-
var
|
|
335
|
-
throw
|
|
333
|
+
if (typeof e[m] != "function") {
|
|
334
|
+
var R = Error((c || "React class") + ": " + a + " type `" + m + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[m] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
335
|
+
throw R.name = "Invariant Violation", R;
|
|
336
336
|
}
|
|
337
|
-
|
|
338
|
-
} catch (
|
|
339
|
-
|
|
337
|
+
f = e[m](r, m, c, a, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
338
|
+
} catch (b) {
|
|
339
|
+
f = b;
|
|
340
340
|
}
|
|
341
|
-
|
|
341
|
+
f && !(f instanceof Error) && (st(_), w("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", c || "React class", a, m, typeof f), st(null)), f instanceof Error && !(f.message in jt) && (jt[f.message] = !0, st(_), w("Failed %s type: %s", a, f.message), st(null));
|
|
342
342
|
}
|
|
343
343
|
}
|
|
344
344
|
}
|
|
345
|
-
var
|
|
346
|
-
function
|
|
347
|
-
return
|
|
345
|
+
var le = Array.isArray;
|
|
346
|
+
function _t(e) {
|
|
347
|
+
return le(e);
|
|
348
348
|
}
|
|
349
|
-
function
|
|
349
|
+
function ce(e) {
|
|
350
350
|
{
|
|
351
|
-
var
|
|
352
|
-
return
|
|
351
|
+
var r = typeof Symbol == "function" && Symbol.toStringTag, a = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
352
|
+
return a;
|
|
353
353
|
}
|
|
354
354
|
}
|
|
355
|
-
function
|
|
355
|
+
function ue(e) {
|
|
356
356
|
try {
|
|
357
|
-
return
|
|
357
|
+
return kt(e), !1;
|
|
358
358
|
} catch {
|
|
359
359
|
return !0;
|
|
360
360
|
}
|
|
361
361
|
}
|
|
362
|
-
function
|
|
362
|
+
function kt(e) {
|
|
363
363
|
return "" + e;
|
|
364
364
|
}
|
|
365
|
-
function
|
|
366
|
-
if (
|
|
367
|
-
return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",
|
|
365
|
+
function At(e) {
|
|
366
|
+
if (ue(e))
|
|
367
|
+
return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", ce(e)), kt(e);
|
|
368
368
|
}
|
|
369
|
-
var
|
|
369
|
+
var et = k.ReactCurrentOwner, de = {
|
|
370
370
|
key: !0,
|
|
371
371
|
ref: !0,
|
|
372
372
|
__self: !0,
|
|
373
373
|
__source: !0
|
|
374
|
-
},
|
|
375
|
-
|
|
376
|
-
function
|
|
377
|
-
if (
|
|
378
|
-
var
|
|
379
|
-
if (
|
|
374
|
+
}, It, Nt, yt;
|
|
375
|
+
yt = {};
|
|
376
|
+
function pe(e) {
|
|
377
|
+
if (tt.call(e, "ref")) {
|
|
378
|
+
var r = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
379
|
+
if (r && r.isReactWarning)
|
|
380
380
|
return !1;
|
|
381
381
|
}
|
|
382
382
|
return e.ref !== void 0;
|
|
383
383
|
}
|
|
384
|
-
function
|
|
385
|
-
if (
|
|
386
|
-
var
|
|
387
|
-
if (
|
|
384
|
+
function fe(e) {
|
|
385
|
+
if (tt.call(e, "key")) {
|
|
386
|
+
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
387
|
+
if (r && r.isReactWarning)
|
|
388
388
|
return !1;
|
|
389
389
|
}
|
|
390
390
|
return e.key !== void 0;
|
|
391
391
|
}
|
|
392
|
-
function
|
|
393
|
-
if (typeof e.ref == "string" &&
|
|
394
|
-
var
|
|
395
|
-
|
|
392
|
+
function me(e, r) {
|
|
393
|
+
if (typeof e.ref == "string" && et.current && r && et.current.stateNode !== r) {
|
|
394
|
+
var a = L(et.current.type);
|
|
395
|
+
yt[a] || (w('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', L(et.current.type), e.ref), yt[a] = !0);
|
|
396
396
|
}
|
|
397
397
|
}
|
|
398
|
-
function
|
|
398
|
+
function _e(e, r) {
|
|
399
399
|
{
|
|
400
|
-
var
|
|
401
|
-
|
|
400
|
+
var a = function() {
|
|
401
|
+
It || (It = !0, w("%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)", r));
|
|
402
402
|
};
|
|
403
|
-
|
|
404
|
-
get:
|
|
403
|
+
a.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
404
|
+
get: a,
|
|
405
405
|
configurable: !0
|
|
406
406
|
});
|
|
407
407
|
}
|
|
408
408
|
}
|
|
409
|
-
function
|
|
409
|
+
function ye(e, r) {
|
|
410
410
|
{
|
|
411
|
-
var
|
|
412
|
-
|
|
411
|
+
var a = function() {
|
|
412
|
+
Nt || (Nt = !0, w("%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)", r));
|
|
413
413
|
};
|
|
414
|
-
|
|
415
|
-
get:
|
|
414
|
+
a.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
415
|
+
get: a,
|
|
416
416
|
configurable: !0
|
|
417
417
|
});
|
|
418
418
|
}
|
|
419
419
|
}
|
|
420
|
-
var
|
|
421
|
-
var
|
|
420
|
+
var ge = function(e, r, a, c, _, y, m) {
|
|
421
|
+
var f = {
|
|
422
422
|
// This tag allows us to uniquely identify this as a React Element
|
|
423
423
|
$$typeof: t,
|
|
424
424
|
// Built-in properties that belong on the element
|
|
425
425
|
type: e,
|
|
426
|
-
key:
|
|
427
|
-
ref:
|
|
428
|
-
props:
|
|
426
|
+
key: r,
|
|
427
|
+
ref: a,
|
|
428
|
+
props: m,
|
|
429
429
|
// Record the component responsible for creating this element.
|
|
430
|
-
_owner:
|
|
430
|
+
_owner: y
|
|
431
431
|
};
|
|
432
|
-
return
|
|
432
|
+
return f._store = {}, Object.defineProperty(f._store, "validated", {
|
|
433
433
|
configurable: !1,
|
|
434
434
|
enumerable: !1,
|
|
435
435
|
writable: !0,
|
|
436
436
|
value: !1
|
|
437
|
-
}), Object.defineProperty(
|
|
437
|
+
}), Object.defineProperty(f, "_self", {
|
|
438
438
|
configurable: !1,
|
|
439
439
|
enumerable: !1,
|
|
440
440
|
writable: !1,
|
|
441
|
-
value:
|
|
442
|
-
}), Object.defineProperty(
|
|
441
|
+
value: c
|
|
442
|
+
}), Object.defineProperty(f, "_source", {
|
|
443
443
|
configurable: !1,
|
|
444
444
|
enumerable: !1,
|
|
445
445
|
writable: !1,
|
|
446
|
-
value:
|
|
447
|
-
}), Object.freeze && (Object.freeze(
|
|
446
|
+
value: _
|
|
447
|
+
}), Object.freeze && (Object.freeze(f.props), Object.freeze(f)), f;
|
|
448
448
|
};
|
|
449
|
-
function
|
|
449
|
+
function be(e, r, a, c, _) {
|
|
450
450
|
{
|
|
451
|
-
var
|
|
452
|
-
|
|
453
|
-
for (
|
|
454
|
-
|
|
451
|
+
var y, m = {}, f = null, R = null;
|
|
452
|
+
a !== void 0 && (At(a), f = "" + a), fe(r) && (At(r.key), f = "" + r.key), pe(r) && (R = r.ref, me(r, _));
|
|
453
|
+
for (y in r)
|
|
454
|
+
tt.call(r, y) && !de.hasOwnProperty(y) && (m[y] = r[y]);
|
|
455
455
|
if (e && e.defaultProps) {
|
|
456
|
-
var
|
|
457
|
-
for (
|
|
458
|
-
|
|
456
|
+
var b = e.defaultProps;
|
|
457
|
+
for (y in b)
|
|
458
|
+
m[y] === void 0 && (m[y] = b[y]);
|
|
459
459
|
}
|
|
460
|
-
if (
|
|
461
|
-
var
|
|
462
|
-
|
|
460
|
+
if (f || R) {
|
|
461
|
+
var E = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
462
|
+
f && _e(m, E), R && ye(m, E);
|
|
463
463
|
}
|
|
464
|
-
return
|
|
464
|
+
return ge(e, f, R, _, c, et.current, m);
|
|
465
465
|
}
|
|
466
466
|
}
|
|
467
|
-
var
|
|
468
|
-
function
|
|
467
|
+
var gt = k.ReactCurrentOwner, zt = k.ReactDebugCurrentFrame;
|
|
468
|
+
function q(e) {
|
|
469
469
|
if (e) {
|
|
470
|
-
var
|
|
471
|
-
|
|
470
|
+
var r = e._owner, a = rt(e.type, e._source, r ? r.type : null);
|
|
471
|
+
zt.setExtraStackFrame(a);
|
|
472
472
|
} else
|
|
473
|
-
|
|
473
|
+
zt.setExtraStackFrame(null);
|
|
474
474
|
}
|
|
475
|
-
var
|
|
476
|
-
|
|
477
|
-
function
|
|
475
|
+
var bt;
|
|
476
|
+
bt = !1;
|
|
477
|
+
function Et(e) {
|
|
478
478
|
return typeof e == "object" && e !== null && e.$$typeof === t;
|
|
479
479
|
}
|
|
480
|
-
function
|
|
480
|
+
function Ft() {
|
|
481
481
|
{
|
|
482
|
-
if (
|
|
483
|
-
var e =
|
|
482
|
+
if (gt.current) {
|
|
483
|
+
var e = L(gt.current.type);
|
|
484
484
|
if (e)
|
|
485
485
|
return `
|
|
486
486
|
|
|
@@ -489,159 +489,159 @@ Check the render method of \`` + e + "`.";
|
|
|
489
489
|
return "";
|
|
490
490
|
}
|
|
491
491
|
}
|
|
492
|
-
function
|
|
492
|
+
function Ee(e) {
|
|
493
493
|
return "";
|
|
494
494
|
}
|
|
495
|
-
var
|
|
496
|
-
function
|
|
495
|
+
var Yt = {};
|
|
496
|
+
function ve(e) {
|
|
497
497
|
{
|
|
498
|
-
var
|
|
499
|
-
if (!
|
|
500
|
-
var
|
|
501
|
-
|
|
498
|
+
var r = Ft();
|
|
499
|
+
if (!r) {
|
|
500
|
+
var a = typeof e == "string" ? e : e.displayName || e.name;
|
|
501
|
+
a && (r = `
|
|
502
502
|
|
|
503
|
-
Check the top-level render call using <` +
|
|
503
|
+
Check the top-level render call using <` + a + ">.");
|
|
504
504
|
}
|
|
505
|
-
return
|
|
505
|
+
return r;
|
|
506
506
|
}
|
|
507
507
|
}
|
|
508
|
-
function
|
|
508
|
+
function Ut(e, r) {
|
|
509
509
|
{
|
|
510
510
|
if (!e._store || e._store.validated || e.key != null)
|
|
511
511
|
return;
|
|
512
512
|
e._store.validated = !0;
|
|
513
|
-
var
|
|
514
|
-
if (
|
|
513
|
+
var a = ve(r);
|
|
514
|
+
if (Yt[a])
|
|
515
515
|
return;
|
|
516
|
-
|
|
517
|
-
var
|
|
518
|
-
e && e._owner && e._owner !==
|
|
516
|
+
Yt[a] = !0;
|
|
517
|
+
var c = "";
|
|
518
|
+
e && e._owner && e._owner !== gt.current && (c = " It was passed a child from " + L(e._owner.type) + "."), q(e), w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', a, c), q(null);
|
|
519
519
|
}
|
|
520
520
|
}
|
|
521
|
-
function
|
|
521
|
+
function Zt(e, r) {
|
|
522
522
|
{
|
|
523
523
|
if (typeof e != "object")
|
|
524
524
|
return;
|
|
525
|
-
if (
|
|
526
|
-
for (var
|
|
527
|
-
var
|
|
528
|
-
|
|
525
|
+
if (_t(e))
|
|
526
|
+
for (var a = 0; a < e.length; a++) {
|
|
527
|
+
var c = e[a];
|
|
528
|
+
Et(c) && Ut(c, r);
|
|
529
529
|
}
|
|
530
|
-
else if (
|
|
530
|
+
else if (Et(e))
|
|
531
531
|
e._store && (e._store.validated = !0);
|
|
532
532
|
else if (e) {
|
|
533
|
-
var
|
|
534
|
-
if (typeof
|
|
535
|
-
for (var
|
|
536
|
-
|
|
533
|
+
var _ = J(e);
|
|
534
|
+
if (typeof _ == "function" && _ !== e.entries)
|
|
535
|
+
for (var y = _.call(e), m; !(m = y.next()).done; )
|
|
536
|
+
Et(m.value) && Ut(m.value, r);
|
|
537
537
|
}
|
|
538
538
|
}
|
|
539
539
|
}
|
|
540
|
-
function
|
|
540
|
+
function we(e) {
|
|
541
541
|
{
|
|
542
|
-
var
|
|
543
|
-
if (
|
|
542
|
+
var r = e.type;
|
|
543
|
+
if (r == null || typeof r == "string")
|
|
544
544
|
return;
|
|
545
|
-
var
|
|
546
|
-
if (typeof
|
|
547
|
-
|
|
548
|
-
else if (typeof
|
|
545
|
+
var a;
|
|
546
|
+
if (typeof r == "function")
|
|
547
|
+
a = r.propTypes;
|
|
548
|
+
else if (typeof r == "object" && (r.$$typeof === p || // Note: Memo only checks outer props here.
|
|
549
549
|
// Inner props are checked in the reconciler.
|
|
550
|
-
|
|
551
|
-
|
|
550
|
+
r.$$typeof === C))
|
|
551
|
+
a = r.propTypes;
|
|
552
552
|
else
|
|
553
553
|
return;
|
|
554
|
-
if (
|
|
555
|
-
var
|
|
556
|
-
|
|
557
|
-
} else if (
|
|
558
|
-
|
|
559
|
-
var
|
|
560
|
-
w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",
|
|
554
|
+
if (a) {
|
|
555
|
+
var c = L(r);
|
|
556
|
+
he(a, e.props, "prop", c, e);
|
|
557
|
+
} else if (r.PropTypes !== void 0 && !bt) {
|
|
558
|
+
bt = !0;
|
|
559
|
+
var _ = L(r);
|
|
560
|
+
w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", _ || "Unknown");
|
|
561
561
|
}
|
|
562
|
-
typeof
|
|
562
|
+
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
563
563
|
}
|
|
564
564
|
}
|
|
565
|
-
function
|
|
565
|
+
function Se(e) {
|
|
566
566
|
{
|
|
567
|
-
for (var
|
|
568
|
-
var
|
|
569
|
-
if (
|
|
570
|
-
|
|
567
|
+
for (var r = Object.keys(e.props), a = 0; a < r.length; a++) {
|
|
568
|
+
var c = r[a];
|
|
569
|
+
if (c !== "children" && c !== "key") {
|
|
570
|
+
q(e), w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", c), q(null);
|
|
571
571
|
break;
|
|
572
572
|
}
|
|
573
573
|
}
|
|
574
|
-
e.ref !== null && (
|
|
574
|
+
e.ref !== null && (q(e), w("Invalid attribute `ref` supplied to `React.Fragment`."), q(null));
|
|
575
575
|
}
|
|
576
576
|
}
|
|
577
|
-
var
|
|
578
|
-
function
|
|
577
|
+
var Vt = {};
|
|
578
|
+
function Wt(e, r, a, c, _, y) {
|
|
579
579
|
{
|
|
580
|
-
var
|
|
581
|
-
if (!
|
|
582
|
-
var
|
|
583
|
-
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (
|
|
584
|
-
var
|
|
585
|
-
|
|
586
|
-
var
|
|
587
|
-
e === null ?
|
|
580
|
+
var m = N(e);
|
|
581
|
+
if (!m) {
|
|
582
|
+
var f = "";
|
|
583
|
+
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (f += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
584
|
+
var R = Ee();
|
|
585
|
+
R ? f += R : f += Ft();
|
|
586
|
+
var b;
|
|
587
|
+
e === null ? b = "null" : _t(e) ? b = "array" : e !== void 0 && e.$$typeof === t ? (b = "<" + (L(e.type) || "Unknown") + " />", f = " Did you accidentally export a JSX literal instead of a component?") : b = typeof e, w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", b, f);
|
|
588
588
|
}
|
|
589
|
-
var
|
|
590
|
-
if (
|
|
591
|
-
return
|
|
592
|
-
if (
|
|
593
|
-
var
|
|
594
|
-
if (
|
|
595
|
-
if (
|
|
596
|
-
if (
|
|
597
|
-
for (var
|
|
598
|
-
|
|
599
|
-
Object.freeze && Object.freeze(
|
|
589
|
+
var E = be(e, r, a, _, y);
|
|
590
|
+
if (E == null)
|
|
591
|
+
return E;
|
|
592
|
+
if (m) {
|
|
593
|
+
var j = r.children;
|
|
594
|
+
if (j !== void 0)
|
|
595
|
+
if (c)
|
|
596
|
+
if (_t(j)) {
|
|
597
|
+
for (var Q = 0; Q < j.length; Q++)
|
|
598
|
+
Zt(j[Q], e);
|
|
599
|
+
Object.freeze && Object.freeze(j);
|
|
600
600
|
} else
|
|
601
601
|
w("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
602
602
|
else
|
|
603
|
-
|
|
603
|
+
Zt(j, e);
|
|
604
604
|
}
|
|
605
|
-
if (
|
|
606
|
-
var
|
|
607
|
-
return
|
|
608
|
-
}),
|
|
609
|
-
if (!
|
|
610
|
-
var
|
|
605
|
+
if (tt.call(r, "key")) {
|
|
606
|
+
var W = L(e), D = Object.keys(r).filter(function(De) {
|
|
607
|
+
return De !== "key";
|
|
608
|
+
}), vt = D.length > 0 ? "{key: someKey, " + D.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
609
|
+
if (!Vt[W + vt]) {
|
|
610
|
+
var Oe = D.length > 0 ? "{" + D.join(": ..., ") + ": ...}" : "{}";
|
|
611
611
|
w(`A props object containing a "key" prop is being spread into JSX:
|
|
612
612
|
let props = %s;
|
|
613
613
|
<%s {...props} />
|
|
614
614
|
React keys must be passed directly to JSX without using spread:
|
|
615
615
|
let props = %s;
|
|
616
|
-
<%s key={someKey} {...props} />`,
|
|
616
|
+
<%s key={someKey} {...props} />`, vt, W, Oe, W), Vt[W + vt] = !0;
|
|
617
617
|
}
|
|
618
618
|
}
|
|
619
|
-
return e ===
|
|
619
|
+
return e === o ? Se(E) : we(E), E;
|
|
620
620
|
}
|
|
621
621
|
}
|
|
622
|
-
function
|
|
623
|
-
return
|
|
622
|
+
function Te(e, r, a) {
|
|
623
|
+
return Wt(e, r, a, !0);
|
|
624
624
|
}
|
|
625
|
-
function
|
|
626
|
-
return
|
|
625
|
+
function Ce(e, r, a) {
|
|
626
|
+
return Wt(e, r, a, !1);
|
|
627
627
|
}
|
|
628
|
-
var
|
|
629
|
-
|
|
630
|
-
}()),
|
|
628
|
+
var Pe = Ce, Re = Te;
|
|
629
|
+
Gt.Fragment = o, Gt.jsx = Pe, Gt.jsxs = Re;
|
|
630
|
+
}()), Gt;
|
|
631
631
|
}
|
|
632
|
-
process.env.NODE_ENV === "production" ?
|
|
633
|
-
var
|
|
632
|
+
process.env.NODE_ENV === "production" ? je.exports = ai() : je.exports = hi();
|
|
633
|
+
var Kt = je.exports;
|
|
634
634
|
(function() {
|
|
635
635
|
try {
|
|
636
636
|
if (typeof document < "u") {
|
|
637
|
-
var
|
|
638
|
-
|
|
637
|
+
var n = document.createElement("style");
|
|
638
|
+
n.appendChild(document.createTextNode(".gizmo-default{width:100px;height:100px;position:absolute;top:0;right:0;z-index:2;cursor:pointer}")), document.head.appendChild(n);
|
|
639
639
|
}
|
|
640
640
|
} catch (t) {
|
|
641
641
|
console.error("vite-plugin-css-injected-by-js", t);
|
|
642
642
|
}
|
|
643
643
|
})();
|
|
644
|
-
var
|
|
644
|
+
var Le = { exports: {} }, Bt = {};
|
|
645
645
|
/**
|
|
646
646
|
* @license React
|
|
647
647
|
* react-jsx-runtime.production.min.js
|
|
@@ -651,21 +651,21 @@ var Oe = { exports: {} }, Nt = {};
|
|
|
651
651
|
* This source code is licensed under the MIT license found in the
|
|
652
652
|
* LICENSE file in the root directory of this source tree.
|
|
653
653
|
*/
|
|
654
|
-
var
|
|
655
|
-
function
|
|
656
|
-
if (
|
|
657
|
-
|
|
658
|
-
var
|
|
659
|
-
function
|
|
660
|
-
var
|
|
661
|
-
|
|
662
|
-
for (
|
|
663
|
-
if (
|
|
664
|
-
return { $$typeof: t, type:
|
|
665
|
-
}
|
|
666
|
-
return
|
|
654
|
+
var Fe;
|
|
655
|
+
function li() {
|
|
656
|
+
if (Fe) return Bt;
|
|
657
|
+
Fe = 1;
|
|
658
|
+
var n = ie, t = Symbol.for("react.element"), i = Symbol.for("react.fragment"), o = Object.prototype.hasOwnProperty, s = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, l = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
659
|
+
function d(u, p, v) {
|
|
660
|
+
var g, C = {}, P = null, I = null;
|
|
661
|
+
v !== void 0 && (P = "" + v), p.key !== void 0 && (P = "" + p.key), p.ref !== void 0 && (I = p.ref);
|
|
662
|
+
for (g in p) o.call(p, g) && !l.hasOwnProperty(g) && (C[g] = p[g]);
|
|
663
|
+
if (u && u.defaultProps) for (g in p = u.defaultProps, p) C[g] === void 0 && (C[g] = p[g]);
|
|
664
|
+
return { $$typeof: t, type: u, key: P, ref: I, props: C, _owner: s.current };
|
|
665
|
+
}
|
|
666
|
+
return Bt.Fragment = i, Bt.jsx = d, Bt.jsxs = d, Bt;
|
|
667
667
|
}
|
|
668
|
-
var
|
|
668
|
+
var Xt = {};
|
|
669
669
|
/**
|
|
670
670
|
* @license React
|
|
671
671
|
* react-jsx-runtime.development.js
|
|
@@ -675,54 +675,54 @@ var Ft = {};
|
|
|
675
675
|
* This source code is licensed under the MIT license found in the
|
|
676
676
|
* LICENSE file in the root directory of this source tree.
|
|
677
677
|
*/
|
|
678
|
-
var
|
|
679
|
-
function
|
|
680
|
-
return
|
|
681
|
-
var
|
|
682
|
-
function
|
|
678
|
+
var Ye;
|
|
679
|
+
function ci() {
|
|
680
|
+
return Ye || (Ye = 1, process.env.NODE_ENV !== "production" && function() {
|
|
681
|
+
var n = ie, t = Symbol.for("react.element"), i = Symbol.for("react.portal"), o = Symbol.for("react.fragment"), s = Symbol.for("react.strict_mode"), l = Symbol.for("react.profiler"), d = Symbol.for("react.provider"), u = Symbol.for("react.context"), p = Symbol.for("react.forward_ref"), v = Symbol.for("react.suspense"), g = Symbol.for("react.suspense_list"), C = Symbol.for("react.memo"), P = Symbol.for("react.lazy"), I = Symbol.for("react.offscreen"), Z = Symbol.iterator, U = "@@iterator";
|
|
682
|
+
function J(e) {
|
|
683
683
|
if (e === null || typeof e != "object")
|
|
684
684
|
return null;
|
|
685
|
-
var
|
|
686
|
-
return typeof
|
|
685
|
+
var r = Z && e[Z] || e[U];
|
|
686
|
+
return typeof r == "function" ? r : null;
|
|
687
687
|
}
|
|
688
|
-
var
|
|
688
|
+
var k = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
689
689
|
function w(e) {
|
|
690
690
|
{
|
|
691
|
-
for (var
|
|
692
|
-
|
|
693
|
-
|
|
691
|
+
for (var r = arguments.length, a = new Array(r > 1 ? r - 1 : 0), c = 1; c < r; c++)
|
|
692
|
+
a[c - 1] = arguments[c];
|
|
693
|
+
ht("error", e, a);
|
|
694
694
|
}
|
|
695
695
|
}
|
|
696
|
-
function
|
|
696
|
+
function ht(e, r, a) {
|
|
697
697
|
{
|
|
698
|
-
var
|
|
699
|
-
|
|
700
|
-
var
|
|
701
|
-
return String(
|
|
698
|
+
var c = k.ReactDebugCurrentFrame, _ = c.getStackAddendum();
|
|
699
|
+
_ !== "" && (r += "%s", a = a.concat([_]));
|
|
700
|
+
var y = a.map(function(m) {
|
|
701
|
+
return String(m);
|
|
702
702
|
});
|
|
703
|
-
|
|
703
|
+
y.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, y);
|
|
704
704
|
}
|
|
705
705
|
}
|
|
706
|
-
var
|
|
707
|
-
|
|
708
|
-
function
|
|
709
|
-
return !!(typeof e == "string" || typeof e == "function" || e ===
|
|
706
|
+
var wt = !1, lt = !1, ct = !1, ut = !1, T = !1, O;
|
|
707
|
+
O = Symbol.for("react.module.reference");
|
|
708
|
+
function N(e) {
|
|
709
|
+
return !!(typeof e == "string" || typeof e == "function" || e === o || e === l || T || e === s || e === v || e === g || ut || e === I || wt || lt || ct || typeof e == "object" && e !== null && (e.$$typeof === P || e.$$typeof === C || e.$$typeof === d || e.$$typeof === u || e.$$typeof === p || // This needs to include all possible module reference object
|
|
710
710
|
// types supported by any Flight configuration anywhere since
|
|
711
711
|
// we don't know which Flight build this will end up being used
|
|
712
712
|
// with.
|
|
713
|
-
e.$$typeof ===
|
|
713
|
+
e.$$typeof === O || e.getModuleId !== void 0));
|
|
714
714
|
}
|
|
715
|
-
function
|
|
716
|
-
var
|
|
717
|
-
if (
|
|
718
|
-
return
|
|
719
|
-
var
|
|
720
|
-
return
|
|
715
|
+
function it(e, r, a) {
|
|
716
|
+
var c = e.displayName;
|
|
717
|
+
if (c)
|
|
718
|
+
return c;
|
|
719
|
+
var _ = r.displayName || r.name || "";
|
|
720
|
+
return _ !== "" ? a + "(" + _ + ")" : a;
|
|
721
721
|
}
|
|
722
722
|
function dt(e) {
|
|
723
723
|
return e.displayName || "Context";
|
|
724
724
|
}
|
|
725
|
-
function
|
|
725
|
+
function L(e) {
|
|
726
726
|
if (e == null)
|
|
727
727
|
return null;
|
|
728
728
|
if (typeof e.tag == "number" && w("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
@@ -730,36 +730,36 @@ function ai() {
|
|
|
730
730
|
if (typeof e == "string")
|
|
731
731
|
return e;
|
|
732
732
|
switch (e) {
|
|
733
|
-
case
|
|
733
|
+
case o:
|
|
734
734
|
return "Fragment";
|
|
735
735
|
case i:
|
|
736
736
|
return "Portal";
|
|
737
|
-
case
|
|
737
|
+
case l:
|
|
738
738
|
return "Profiler";
|
|
739
|
-
case
|
|
739
|
+
case s:
|
|
740
740
|
return "StrictMode";
|
|
741
|
-
case
|
|
741
|
+
case v:
|
|
742
742
|
return "Suspense";
|
|
743
|
-
case
|
|
743
|
+
case g:
|
|
744
744
|
return "SuspenseList";
|
|
745
745
|
}
|
|
746
746
|
if (typeof e == "object")
|
|
747
747
|
switch (e.$$typeof) {
|
|
748
|
+
case u:
|
|
749
|
+
var r = e;
|
|
750
|
+
return dt(r) + ".Consumer";
|
|
748
751
|
case d:
|
|
749
|
-
var
|
|
750
|
-
return dt(
|
|
752
|
+
var a = e;
|
|
753
|
+
return dt(a._context) + ".Provider";
|
|
751
754
|
case p:
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
return
|
|
756
|
-
case
|
|
757
|
-
var
|
|
758
|
-
return h !== null ? h : x(e.type) || "Memo";
|
|
759
|
-
case M: {
|
|
760
|
-
var f = e, _ = f._payload, c = f._init;
|
|
755
|
+
return it(e, e.render, "ForwardRef");
|
|
756
|
+
case C:
|
|
757
|
+
var c = e.displayName || null;
|
|
758
|
+
return c !== null ? c : L(e.type) || "Memo";
|
|
759
|
+
case P: {
|
|
760
|
+
var _ = e, y = _._payload, m = _._init;
|
|
761
761
|
try {
|
|
762
|
-
return
|
|
762
|
+
return L(m(y));
|
|
763
763
|
} catch {
|
|
764
764
|
return null;
|
|
765
765
|
}
|
|
@@ -767,18 +767,18 @@ function ai() {
|
|
|
767
767
|
}
|
|
768
768
|
return null;
|
|
769
769
|
}
|
|
770
|
-
var
|
|
771
|
-
function
|
|
770
|
+
var V = Object.assign, G = 0, St, Tt, Ct, Pt, Rt, Ot, Dt;
|
|
771
|
+
function Mt() {
|
|
772
772
|
}
|
|
773
|
-
|
|
774
|
-
function
|
|
773
|
+
Mt.__reactDisabledLog = !0;
|
|
774
|
+
function oe() {
|
|
775
775
|
{
|
|
776
|
-
if (
|
|
777
|
-
|
|
776
|
+
if (G === 0) {
|
|
777
|
+
St = console.log, Tt = console.info, Ct = console.warn, Pt = console.error, Rt = console.group, Ot = console.groupCollapsed, Dt = console.groupEnd;
|
|
778
778
|
var e = {
|
|
779
779
|
configurable: !0,
|
|
780
780
|
enumerable: !0,
|
|
781
|
-
value:
|
|
781
|
+
value: Mt,
|
|
782
782
|
writable: !0
|
|
783
783
|
};
|
|
784
784
|
Object.defineProperties(console, {
|
|
@@ -791,336 +791,336 @@ function ai() {
|
|
|
791
791
|
groupEnd: e
|
|
792
792
|
});
|
|
793
793
|
}
|
|
794
|
-
|
|
794
|
+
G++;
|
|
795
795
|
}
|
|
796
796
|
}
|
|
797
|
-
function
|
|
797
|
+
function ne() {
|
|
798
798
|
{
|
|
799
|
-
if (
|
|
799
|
+
if (G--, G === 0) {
|
|
800
800
|
var e = {
|
|
801
801
|
configurable: !0,
|
|
802
802
|
enumerable: !0,
|
|
803
803
|
writable: !0
|
|
804
804
|
};
|
|
805
805
|
Object.defineProperties(console, {
|
|
806
|
-
log:
|
|
807
|
-
value:
|
|
806
|
+
log: V({}, e, {
|
|
807
|
+
value: St
|
|
808
808
|
}),
|
|
809
|
-
info:
|
|
810
|
-
value:
|
|
809
|
+
info: V({}, e, {
|
|
810
|
+
value: Tt
|
|
811
811
|
}),
|
|
812
|
-
warn:
|
|
813
|
-
value:
|
|
812
|
+
warn: V({}, e, {
|
|
813
|
+
value: Ct
|
|
814
814
|
}),
|
|
815
|
-
error:
|
|
816
|
-
value:
|
|
815
|
+
error: V({}, e, {
|
|
816
|
+
value: Pt
|
|
817
817
|
}),
|
|
818
|
-
group:
|
|
819
|
-
value:
|
|
818
|
+
group: V({}, e, {
|
|
819
|
+
value: Rt
|
|
820
820
|
}),
|
|
821
|
-
groupCollapsed:
|
|
822
|
-
value:
|
|
821
|
+
groupCollapsed: V({}, e, {
|
|
822
|
+
value: Ot
|
|
823
823
|
}),
|
|
824
|
-
groupEnd:
|
|
825
|
-
value:
|
|
824
|
+
groupEnd: V({}, e, {
|
|
825
|
+
value: Dt
|
|
826
826
|
})
|
|
827
827
|
});
|
|
828
828
|
}
|
|
829
|
-
|
|
829
|
+
G < 0 && w("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
830
830
|
}
|
|
831
831
|
}
|
|
832
|
-
var
|
|
833
|
-
function
|
|
832
|
+
var pt = k.ReactCurrentDispatcher, ft;
|
|
833
|
+
function ot(e, r, a) {
|
|
834
834
|
{
|
|
835
|
-
if (
|
|
835
|
+
if (ft === void 0)
|
|
836
836
|
try {
|
|
837
837
|
throw Error();
|
|
838
|
-
} catch (
|
|
839
|
-
var
|
|
840
|
-
|
|
838
|
+
} catch (_) {
|
|
839
|
+
var c = _.stack.trim().match(/\n( *(at )?)/);
|
|
840
|
+
ft = c && c[1] || "";
|
|
841
841
|
}
|
|
842
842
|
return `
|
|
843
|
-
` +
|
|
843
|
+
` + ft + e;
|
|
844
844
|
}
|
|
845
845
|
}
|
|
846
|
-
var
|
|
846
|
+
var mt = !1, nt;
|
|
847
847
|
{
|
|
848
|
-
var
|
|
849
|
-
|
|
848
|
+
var re = typeof WeakMap == "function" ? WeakMap : Map;
|
|
849
|
+
nt = new re();
|
|
850
850
|
}
|
|
851
|
-
function
|
|
852
|
-
if (!e ||
|
|
851
|
+
function xt(e, r) {
|
|
852
|
+
if (!e || mt)
|
|
853
853
|
return "";
|
|
854
854
|
{
|
|
855
|
-
var
|
|
856
|
-
if (
|
|
857
|
-
return
|
|
855
|
+
var a = nt.get(e);
|
|
856
|
+
if (a !== void 0)
|
|
857
|
+
return a;
|
|
858
858
|
}
|
|
859
|
-
var
|
|
860
|
-
|
|
861
|
-
var
|
|
859
|
+
var c;
|
|
860
|
+
mt = !0;
|
|
861
|
+
var _ = Error.prepareStackTrace;
|
|
862
862
|
Error.prepareStackTrace = void 0;
|
|
863
|
-
var
|
|
864
|
-
|
|
863
|
+
var y;
|
|
864
|
+
y = pt.current, pt.current = null, oe();
|
|
865
865
|
try {
|
|
866
|
-
if (
|
|
867
|
-
var
|
|
866
|
+
if (r) {
|
|
867
|
+
var m = function() {
|
|
868
868
|
throw Error();
|
|
869
869
|
};
|
|
870
|
-
if (Object.defineProperty(
|
|
870
|
+
if (Object.defineProperty(m.prototype, "props", {
|
|
871
871
|
set: function() {
|
|
872
872
|
throw Error();
|
|
873
873
|
}
|
|
874
874
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
875
875
|
try {
|
|
876
|
-
Reflect.construct(
|
|
877
|
-
} catch (
|
|
878
|
-
|
|
876
|
+
Reflect.construct(m, []);
|
|
877
|
+
} catch (D) {
|
|
878
|
+
c = D;
|
|
879
879
|
}
|
|
880
|
-
Reflect.construct(e, [],
|
|
880
|
+
Reflect.construct(e, [], m);
|
|
881
881
|
} else {
|
|
882
882
|
try {
|
|
883
|
-
|
|
884
|
-
} catch (
|
|
885
|
-
|
|
883
|
+
m.call();
|
|
884
|
+
} catch (D) {
|
|
885
|
+
c = D;
|
|
886
886
|
}
|
|
887
|
-
e.call(
|
|
887
|
+
e.call(m.prototype);
|
|
888
888
|
}
|
|
889
889
|
} else {
|
|
890
890
|
try {
|
|
891
891
|
throw Error();
|
|
892
|
-
} catch (
|
|
893
|
-
|
|
892
|
+
} catch (D) {
|
|
893
|
+
c = D;
|
|
894
894
|
}
|
|
895
895
|
e();
|
|
896
896
|
}
|
|
897
|
-
} catch (
|
|
898
|
-
if (
|
|
899
|
-
for (var
|
|
900
|
-
`),
|
|
901
|
-
`),
|
|
902
|
-
|
|
903
|
-
for (;
|
|
904
|
-
if (
|
|
905
|
-
if (
|
|
897
|
+
} catch (D) {
|
|
898
|
+
if (D && c && typeof D.stack == "string") {
|
|
899
|
+
for (var f = D.stack.split(`
|
|
900
|
+
`), R = c.stack.split(`
|
|
901
|
+
`), b = f.length - 1, E = R.length - 1; b >= 1 && E >= 0 && f[b] !== R[E]; )
|
|
902
|
+
E--;
|
|
903
|
+
for (; b >= 1 && E >= 0; b--, E--)
|
|
904
|
+
if (f[b] !== R[E]) {
|
|
905
|
+
if (b !== 1 || E !== 1)
|
|
906
906
|
do
|
|
907
|
-
if (
|
|
908
|
-
var
|
|
909
|
-
` +
|
|
910
|
-
return e.displayName &&
|
|
907
|
+
if (b--, E--, E < 0 || f[b] !== R[E]) {
|
|
908
|
+
var j = `
|
|
909
|
+
` + f[b].replace(" at new ", " at ");
|
|
910
|
+
return e.displayName && j.includes("<anonymous>") && (j = j.replace("<anonymous>", e.displayName)), typeof e == "function" && nt.set(e, j), j;
|
|
911
911
|
}
|
|
912
|
-
while (
|
|
912
|
+
while (b >= 1 && E >= 0);
|
|
913
913
|
break;
|
|
914
914
|
}
|
|
915
915
|
}
|
|
916
916
|
} finally {
|
|
917
|
-
|
|
917
|
+
mt = !1, pt.current = y, ne(), Error.prepareStackTrace = _;
|
|
918
918
|
}
|
|
919
|
-
var
|
|
920
|
-
return typeof e == "function" &&
|
|
919
|
+
var Q = e ? e.displayName || e.name : "", W = Q ? ot(Q) : "";
|
|
920
|
+
return typeof e == "function" && nt.set(e, W), W;
|
|
921
921
|
}
|
|
922
|
-
function
|
|
923
|
-
return
|
|
922
|
+
function se(e, r, a) {
|
|
923
|
+
return xt(e, !1);
|
|
924
924
|
}
|
|
925
|
-
function
|
|
926
|
-
var
|
|
927
|
-
return !!(
|
|
925
|
+
function ae(e) {
|
|
926
|
+
var r = e.prototype;
|
|
927
|
+
return !!(r && r.isReactComponent);
|
|
928
928
|
}
|
|
929
|
-
function
|
|
929
|
+
function rt(e, r, a) {
|
|
930
930
|
if (e == null)
|
|
931
931
|
return "";
|
|
932
932
|
if (typeof e == "function")
|
|
933
|
-
return
|
|
933
|
+
return xt(e, ae(e));
|
|
934
934
|
if (typeof e == "string")
|
|
935
|
-
return
|
|
935
|
+
return ot(e);
|
|
936
936
|
switch (e) {
|
|
937
|
-
case
|
|
938
|
-
return
|
|
939
|
-
case
|
|
940
|
-
return
|
|
937
|
+
case v:
|
|
938
|
+
return ot("Suspense");
|
|
939
|
+
case g:
|
|
940
|
+
return ot("SuspenseList");
|
|
941
941
|
}
|
|
942
942
|
if (typeof e == "object")
|
|
943
943
|
switch (e.$$typeof) {
|
|
944
|
-
case
|
|
945
|
-
return
|
|
946
|
-
case
|
|
947
|
-
return
|
|
948
|
-
case
|
|
949
|
-
var
|
|
944
|
+
case p:
|
|
945
|
+
return se(e.render);
|
|
946
|
+
case C:
|
|
947
|
+
return rt(e.type, r, a);
|
|
948
|
+
case P: {
|
|
949
|
+
var c = e, _ = c._payload, y = c._init;
|
|
950
950
|
try {
|
|
951
|
-
return
|
|
951
|
+
return rt(y(_), r, a);
|
|
952
952
|
} catch {
|
|
953
953
|
}
|
|
954
954
|
}
|
|
955
955
|
}
|
|
956
956
|
return "";
|
|
957
957
|
}
|
|
958
|
-
var
|
|
959
|
-
function
|
|
958
|
+
var tt = Object.prototype.hasOwnProperty, jt = {}, Lt = k.ReactDebugCurrentFrame;
|
|
959
|
+
function st(e) {
|
|
960
960
|
if (e) {
|
|
961
|
-
var
|
|
962
|
-
|
|
961
|
+
var r = e._owner, a = rt(e.type, e._source, r ? r.type : null);
|
|
962
|
+
Lt.setExtraStackFrame(a);
|
|
963
963
|
} else
|
|
964
|
-
|
|
964
|
+
Lt.setExtraStackFrame(null);
|
|
965
965
|
}
|
|
966
|
-
function
|
|
966
|
+
function he(e, r, a, c, _) {
|
|
967
967
|
{
|
|
968
|
-
var
|
|
969
|
-
for (var
|
|
970
|
-
if (
|
|
971
|
-
var
|
|
968
|
+
var y = Function.call.bind(tt);
|
|
969
|
+
for (var m in e)
|
|
970
|
+
if (y(e, m)) {
|
|
971
|
+
var f = void 0;
|
|
972
972
|
try {
|
|
973
|
-
if (typeof e[
|
|
974
|
-
var
|
|
975
|
-
throw
|
|
973
|
+
if (typeof e[m] != "function") {
|
|
974
|
+
var R = Error((c || "React class") + ": " + a + " type `" + m + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[m] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
975
|
+
throw R.name = "Invariant Violation", R;
|
|
976
976
|
}
|
|
977
|
-
|
|
978
|
-
} catch (
|
|
979
|
-
|
|
977
|
+
f = e[m](r, m, c, a, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
978
|
+
} catch (b) {
|
|
979
|
+
f = b;
|
|
980
980
|
}
|
|
981
|
-
|
|
981
|
+
f && !(f instanceof Error) && (st(_), w("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", c || "React class", a, m, typeof f), st(null)), f instanceof Error && !(f.message in jt) && (jt[f.message] = !0, st(_), w("Failed %s type: %s", a, f.message), st(null));
|
|
982
982
|
}
|
|
983
983
|
}
|
|
984
984
|
}
|
|
985
|
-
var
|
|
986
|
-
function
|
|
987
|
-
return
|
|
985
|
+
var le = Array.isArray;
|
|
986
|
+
function _t(e) {
|
|
987
|
+
return le(e);
|
|
988
988
|
}
|
|
989
|
-
function
|
|
989
|
+
function ce(e) {
|
|
990
990
|
{
|
|
991
|
-
var
|
|
992
|
-
return
|
|
991
|
+
var r = typeof Symbol == "function" && Symbol.toStringTag, a = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
992
|
+
return a;
|
|
993
993
|
}
|
|
994
994
|
}
|
|
995
|
-
function
|
|
995
|
+
function ue(e) {
|
|
996
996
|
try {
|
|
997
|
-
return
|
|
997
|
+
return kt(e), !1;
|
|
998
998
|
} catch {
|
|
999
999
|
return !0;
|
|
1000
1000
|
}
|
|
1001
1001
|
}
|
|
1002
|
-
function
|
|
1002
|
+
function kt(e) {
|
|
1003
1003
|
return "" + e;
|
|
1004
1004
|
}
|
|
1005
|
-
function
|
|
1006
|
-
if (
|
|
1007
|
-
return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",
|
|
1005
|
+
function At(e) {
|
|
1006
|
+
if (ue(e))
|
|
1007
|
+
return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", ce(e)), kt(e);
|
|
1008
1008
|
}
|
|
1009
|
-
var
|
|
1009
|
+
var et = k.ReactCurrentOwner, de = {
|
|
1010
1010
|
key: !0,
|
|
1011
1011
|
ref: !0,
|
|
1012
1012
|
__self: !0,
|
|
1013
1013
|
__source: !0
|
|
1014
|
-
},
|
|
1015
|
-
|
|
1016
|
-
function
|
|
1017
|
-
if (
|
|
1018
|
-
var
|
|
1019
|
-
if (
|
|
1014
|
+
}, It, Nt, yt;
|
|
1015
|
+
yt = {};
|
|
1016
|
+
function pe(e) {
|
|
1017
|
+
if (tt.call(e, "ref")) {
|
|
1018
|
+
var r = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
1019
|
+
if (r && r.isReactWarning)
|
|
1020
1020
|
return !1;
|
|
1021
1021
|
}
|
|
1022
1022
|
return e.ref !== void 0;
|
|
1023
1023
|
}
|
|
1024
|
-
function
|
|
1025
|
-
if (
|
|
1026
|
-
var
|
|
1027
|
-
if (
|
|
1024
|
+
function fe(e) {
|
|
1025
|
+
if (tt.call(e, "key")) {
|
|
1026
|
+
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
1027
|
+
if (r && r.isReactWarning)
|
|
1028
1028
|
return !1;
|
|
1029
1029
|
}
|
|
1030
1030
|
return e.key !== void 0;
|
|
1031
1031
|
}
|
|
1032
|
-
function
|
|
1033
|
-
if (typeof e.ref == "string" &&
|
|
1034
|
-
var
|
|
1035
|
-
|
|
1032
|
+
function me(e, r) {
|
|
1033
|
+
if (typeof e.ref == "string" && et.current && r && et.current.stateNode !== r) {
|
|
1034
|
+
var a = L(et.current.type);
|
|
1035
|
+
yt[a] || (w('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', L(et.current.type), e.ref), yt[a] = !0);
|
|
1036
1036
|
}
|
|
1037
1037
|
}
|
|
1038
|
-
function
|
|
1038
|
+
function _e(e, r) {
|
|
1039
1039
|
{
|
|
1040
|
-
var
|
|
1041
|
-
|
|
1040
|
+
var a = function() {
|
|
1041
|
+
It || (It = !0, w("%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)", r));
|
|
1042
1042
|
};
|
|
1043
|
-
|
|
1044
|
-
get:
|
|
1043
|
+
a.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
1044
|
+
get: a,
|
|
1045
1045
|
configurable: !0
|
|
1046
1046
|
});
|
|
1047
1047
|
}
|
|
1048
1048
|
}
|
|
1049
|
-
function
|
|
1049
|
+
function ye(e, r) {
|
|
1050
1050
|
{
|
|
1051
|
-
var
|
|
1052
|
-
|
|
1051
|
+
var a = function() {
|
|
1052
|
+
Nt || (Nt = !0, w("%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)", r));
|
|
1053
1053
|
};
|
|
1054
|
-
|
|
1055
|
-
get:
|
|
1054
|
+
a.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
1055
|
+
get: a,
|
|
1056
1056
|
configurable: !0
|
|
1057
1057
|
});
|
|
1058
1058
|
}
|
|
1059
1059
|
}
|
|
1060
|
-
var
|
|
1061
|
-
var
|
|
1060
|
+
var ge = function(e, r, a, c, _, y, m) {
|
|
1061
|
+
var f = {
|
|
1062
1062
|
// This tag allows us to uniquely identify this as a React Element
|
|
1063
1063
|
$$typeof: t,
|
|
1064
1064
|
// Built-in properties that belong on the element
|
|
1065
1065
|
type: e,
|
|
1066
|
-
key:
|
|
1067
|
-
ref:
|
|
1068
|
-
props:
|
|
1066
|
+
key: r,
|
|
1067
|
+
ref: a,
|
|
1068
|
+
props: m,
|
|
1069
1069
|
// Record the component responsible for creating this element.
|
|
1070
|
-
_owner:
|
|
1070
|
+
_owner: y
|
|
1071
1071
|
};
|
|
1072
|
-
return
|
|
1072
|
+
return f._store = {}, Object.defineProperty(f._store, "validated", {
|
|
1073
1073
|
configurable: !1,
|
|
1074
1074
|
enumerable: !1,
|
|
1075
1075
|
writable: !0,
|
|
1076
1076
|
value: !1
|
|
1077
|
-
}), Object.defineProperty(
|
|
1077
|
+
}), Object.defineProperty(f, "_self", {
|
|
1078
1078
|
configurable: !1,
|
|
1079
1079
|
enumerable: !1,
|
|
1080
1080
|
writable: !1,
|
|
1081
|
-
value:
|
|
1082
|
-
}), Object.defineProperty(
|
|
1081
|
+
value: c
|
|
1082
|
+
}), Object.defineProperty(f, "_source", {
|
|
1083
1083
|
configurable: !1,
|
|
1084
1084
|
enumerable: !1,
|
|
1085
1085
|
writable: !1,
|
|
1086
|
-
value:
|
|
1087
|
-
}), Object.freeze && (Object.freeze(
|
|
1086
|
+
value: _
|
|
1087
|
+
}), Object.freeze && (Object.freeze(f.props), Object.freeze(f)), f;
|
|
1088
1088
|
};
|
|
1089
|
-
function
|
|
1089
|
+
function be(e, r, a, c, _) {
|
|
1090
1090
|
{
|
|
1091
|
-
var
|
|
1092
|
-
|
|
1093
|
-
for (
|
|
1094
|
-
|
|
1091
|
+
var y, m = {}, f = null, R = null;
|
|
1092
|
+
a !== void 0 && (At(a), f = "" + a), fe(r) && (At(r.key), f = "" + r.key), pe(r) && (R = r.ref, me(r, _));
|
|
1093
|
+
for (y in r)
|
|
1094
|
+
tt.call(r, y) && !de.hasOwnProperty(y) && (m[y] = r[y]);
|
|
1095
1095
|
if (e && e.defaultProps) {
|
|
1096
|
-
var
|
|
1097
|
-
for (
|
|
1098
|
-
|
|
1096
|
+
var b = e.defaultProps;
|
|
1097
|
+
for (y in b)
|
|
1098
|
+
m[y] === void 0 && (m[y] = b[y]);
|
|
1099
1099
|
}
|
|
1100
|
-
if (
|
|
1101
|
-
var
|
|
1102
|
-
|
|
1100
|
+
if (f || R) {
|
|
1101
|
+
var E = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
1102
|
+
f && _e(m, E), R && ye(m, E);
|
|
1103
1103
|
}
|
|
1104
|
-
return
|
|
1104
|
+
return ge(e, f, R, _, c, et.current, m);
|
|
1105
1105
|
}
|
|
1106
1106
|
}
|
|
1107
|
-
var
|
|
1108
|
-
function
|
|
1107
|
+
var gt = k.ReactCurrentOwner, zt = k.ReactDebugCurrentFrame;
|
|
1108
|
+
function q(e) {
|
|
1109
1109
|
if (e) {
|
|
1110
|
-
var
|
|
1111
|
-
|
|
1110
|
+
var r = e._owner, a = rt(e.type, e._source, r ? r.type : null);
|
|
1111
|
+
zt.setExtraStackFrame(a);
|
|
1112
1112
|
} else
|
|
1113
|
-
|
|
1113
|
+
zt.setExtraStackFrame(null);
|
|
1114
1114
|
}
|
|
1115
|
-
var
|
|
1116
|
-
|
|
1117
|
-
function
|
|
1115
|
+
var bt;
|
|
1116
|
+
bt = !1;
|
|
1117
|
+
function Et(e) {
|
|
1118
1118
|
return typeof e == "object" && e !== null && e.$$typeof === t;
|
|
1119
1119
|
}
|
|
1120
|
-
function
|
|
1120
|
+
function Ft() {
|
|
1121
1121
|
{
|
|
1122
|
-
if (
|
|
1123
|
-
var e =
|
|
1122
|
+
if (gt.current) {
|
|
1123
|
+
var e = L(gt.current.type);
|
|
1124
1124
|
if (e)
|
|
1125
1125
|
return `
|
|
1126
1126
|
|
|
@@ -1129,168 +1129,171 @@ Check the render method of \`` + e + "`.";
|
|
|
1129
1129
|
return "";
|
|
1130
1130
|
}
|
|
1131
1131
|
}
|
|
1132
|
-
function
|
|
1132
|
+
function Ee(e) {
|
|
1133
1133
|
return "";
|
|
1134
1134
|
}
|
|
1135
|
-
var
|
|
1136
|
-
function
|
|
1135
|
+
var Yt = {};
|
|
1136
|
+
function ve(e) {
|
|
1137
1137
|
{
|
|
1138
|
-
var
|
|
1139
|
-
if (!
|
|
1140
|
-
var
|
|
1141
|
-
|
|
1138
|
+
var r = Ft();
|
|
1139
|
+
if (!r) {
|
|
1140
|
+
var a = typeof e == "string" ? e : e.displayName || e.name;
|
|
1141
|
+
a && (r = `
|
|
1142
1142
|
|
|
1143
|
-
Check the top-level render call using <` +
|
|
1143
|
+
Check the top-level render call using <` + a + ">.");
|
|
1144
1144
|
}
|
|
1145
|
-
return
|
|
1145
|
+
return r;
|
|
1146
1146
|
}
|
|
1147
1147
|
}
|
|
1148
|
-
function
|
|
1148
|
+
function Ut(e, r) {
|
|
1149
1149
|
{
|
|
1150
1150
|
if (!e._store || e._store.validated || e.key != null)
|
|
1151
1151
|
return;
|
|
1152
1152
|
e._store.validated = !0;
|
|
1153
|
-
var
|
|
1154
|
-
if (
|
|
1153
|
+
var a = ve(r);
|
|
1154
|
+
if (Yt[a])
|
|
1155
1155
|
return;
|
|
1156
|
-
|
|
1157
|
-
var
|
|
1158
|
-
e && e._owner && e._owner !==
|
|
1156
|
+
Yt[a] = !0;
|
|
1157
|
+
var c = "";
|
|
1158
|
+
e && e._owner && e._owner !== gt.current && (c = " It was passed a child from " + L(e._owner.type) + "."), q(e), w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', a, c), q(null);
|
|
1159
1159
|
}
|
|
1160
1160
|
}
|
|
1161
|
-
function
|
|
1161
|
+
function Zt(e, r) {
|
|
1162
1162
|
{
|
|
1163
1163
|
if (typeof e != "object")
|
|
1164
1164
|
return;
|
|
1165
|
-
if (
|
|
1166
|
-
for (var
|
|
1167
|
-
var
|
|
1168
|
-
|
|
1165
|
+
if (_t(e))
|
|
1166
|
+
for (var a = 0; a < e.length; a++) {
|
|
1167
|
+
var c = e[a];
|
|
1168
|
+
Et(c) && Ut(c, r);
|
|
1169
1169
|
}
|
|
1170
|
-
else if (
|
|
1170
|
+
else if (Et(e))
|
|
1171
1171
|
e._store && (e._store.validated = !0);
|
|
1172
1172
|
else if (e) {
|
|
1173
|
-
var
|
|
1174
|
-
if (typeof
|
|
1175
|
-
for (var
|
|
1176
|
-
|
|
1173
|
+
var _ = J(e);
|
|
1174
|
+
if (typeof _ == "function" && _ !== e.entries)
|
|
1175
|
+
for (var y = _.call(e), m; !(m = y.next()).done; )
|
|
1176
|
+
Et(m.value) && Ut(m.value, r);
|
|
1177
1177
|
}
|
|
1178
1178
|
}
|
|
1179
1179
|
}
|
|
1180
|
-
function
|
|
1180
|
+
function we(e) {
|
|
1181
1181
|
{
|
|
1182
|
-
var
|
|
1183
|
-
if (
|
|
1182
|
+
var r = e.type;
|
|
1183
|
+
if (r == null || typeof r == "string")
|
|
1184
1184
|
return;
|
|
1185
|
-
var
|
|
1186
|
-
if (typeof
|
|
1187
|
-
|
|
1188
|
-
else if (typeof
|
|
1185
|
+
var a;
|
|
1186
|
+
if (typeof r == "function")
|
|
1187
|
+
a = r.propTypes;
|
|
1188
|
+
else if (typeof r == "object" && (r.$$typeof === p || // Note: Memo only checks outer props here.
|
|
1189
1189
|
// Inner props are checked in the reconciler.
|
|
1190
|
-
|
|
1191
|
-
|
|
1190
|
+
r.$$typeof === C))
|
|
1191
|
+
a = r.propTypes;
|
|
1192
1192
|
else
|
|
1193
1193
|
return;
|
|
1194
|
-
if (
|
|
1195
|
-
var
|
|
1196
|
-
|
|
1197
|
-
} else if (
|
|
1198
|
-
|
|
1199
|
-
var
|
|
1200
|
-
w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",
|
|
1194
|
+
if (a) {
|
|
1195
|
+
var c = L(r);
|
|
1196
|
+
he(a, e.props, "prop", c, e);
|
|
1197
|
+
} else if (r.PropTypes !== void 0 && !bt) {
|
|
1198
|
+
bt = !0;
|
|
1199
|
+
var _ = L(r);
|
|
1200
|
+
w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", _ || "Unknown");
|
|
1201
1201
|
}
|
|
1202
|
-
typeof
|
|
1202
|
+
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
1203
1203
|
}
|
|
1204
1204
|
}
|
|
1205
|
-
function
|
|
1205
|
+
function Se(e) {
|
|
1206
1206
|
{
|
|
1207
|
-
for (var
|
|
1208
|
-
var
|
|
1209
|
-
if (
|
|
1210
|
-
|
|
1207
|
+
for (var r = Object.keys(e.props), a = 0; a < r.length; a++) {
|
|
1208
|
+
var c = r[a];
|
|
1209
|
+
if (c !== "children" && c !== "key") {
|
|
1210
|
+
q(e), w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", c), q(null);
|
|
1211
1211
|
break;
|
|
1212
1212
|
}
|
|
1213
1213
|
}
|
|
1214
|
-
e.ref !== null && (
|
|
1214
|
+
e.ref !== null && (q(e), w("Invalid attribute `ref` supplied to `React.Fragment`."), q(null));
|
|
1215
1215
|
}
|
|
1216
1216
|
}
|
|
1217
|
-
var
|
|
1218
|
-
function
|
|
1217
|
+
var Vt = {};
|
|
1218
|
+
function Wt(e, r, a, c, _, y) {
|
|
1219
1219
|
{
|
|
1220
|
-
var
|
|
1221
|
-
if (!
|
|
1222
|
-
var
|
|
1223
|
-
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (
|
|
1224
|
-
var
|
|
1225
|
-
|
|
1226
|
-
var
|
|
1227
|
-
e === null ?
|
|
1220
|
+
var m = N(e);
|
|
1221
|
+
if (!m) {
|
|
1222
|
+
var f = "";
|
|
1223
|
+
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (f += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
1224
|
+
var R = Ee();
|
|
1225
|
+
R ? f += R : f += Ft();
|
|
1226
|
+
var b;
|
|
1227
|
+
e === null ? b = "null" : _t(e) ? b = "array" : e !== void 0 && e.$$typeof === t ? (b = "<" + (L(e.type) || "Unknown") + " />", f = " Did you accidentally export a JSX literal instead of a component?") : b = typeof e, w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", b, f);
|
|
1228
1228
|
}
|
|
1229
|
-
var
|
|
1230
|
-
if (
|
|
1231
|
-
return
|
|
1232
|
-
if (
|
|
1233
|
-
var
|
|
1234
|
-
if (
|
|
1235
|
-
if (
|
|
1236
|
-
if (
|
|
1237
|
-
for (var
|
|
1238
|
-
|
|
1239
|
-
Object.freeze && Object.freeze(
|
|
1229
|
+
var E = be(e, r, a, _, y);
|
|
1230
|
+
if (E == null)
|
|
1231
|
+
return E;
|
|
1232
|
+
if (m) {
|
|
1233
|
+
var j = r.children;
|
|
1234
|
+
if (j !== void 0)
|
|
1235
|
+
if (c)
|
|
1236
|
+
if (_t(j)) {
|
|
1237
|
+
for (var Q = 0; Q < j.length; Q++)
|
|
1238
|
+
Zt(j[Q], e);
|
|
1239
|
+
Object.freeze && Object.freeze(j);
|
|
1240
1240
|
} else
|
|
1241
1241
|
w("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
1242
1242
|
else
|
|
1243
|
-
|
|
1243
|
+
Zt(j, e);
|
|
1244
1244
|
}
|
|
1245
|
-
if (
|
|
1246
|
-
var
|
|
1247
|
-
return
|
|
1248
|
-
}),
|
|
1249
|
-
if (!
|
|
1250
|
-
var
|
|
1245
|
+
if (tt.call(r, "key")) {
|
|
1246
|
+
var W = L(e), D = Object.keys(r).filter(function(De) {
|
|
1247
|
+
return De !== "key";
|
|
1248
|
+
}), vt = D.length > 0 ? "{key: someKey, " + D.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
1249
|
+
if (!Vt[W + vt]) {
|
|
1250
|
+
var Oe = D.length > 0 ? "{" + D.join(": ..., ") + ": ...}" : "{}";
|
|
1251
1251
|
w(`A props object containing a "key" prop is being spread into JSX:
|
|
1252
1252
|
let props = %s;
|
|
1253
1253
|
<%s {...props} />
|
|
1254
1254
|
React keys must be passed directly to JSX without using spread:
|
|
1255
1255
|
let props = %s;
|
|
1256
|
-
<%s key={someKey} {...props} />`,
|
|
1256
|
+
<%s key={someKey} {...props} />`, vt, W, Oe, W), Vt[W + vt] = !0;
|
|
1257
1257
|
}
|
|
1258
1258
|
}
|
|
1259
|
-
return e ===
|
|
1259
|
+
return e === o ? Se(E) : we(E), E;
|
|
1260
1260
|
}
|
|
1261
1261
|
}
|
|
1262
|
-
function
|
|
1263
|
-
return
|
|
1262
|
+
function Te(e, r, a) {
|
|
1263
|
+
return Wt(e, r, a, !0);
|
|
1264
1264
|
}
|
|
1265
|
-
function
|
|
1266
|
-
return
|
|
1265
|
+
function Ce(e, r, a) {
|
|
1266
|
+
return Wt(e, r, a, !1);
|
|
1267
1267
|
}
|
|
1268
|
-
var
|
|
1269
|
-
|
|
1270
|
-
}()),
|
|
1268
|
+
var Pe = Ce, Re = Te;
|
|
1269
|
+
Xt.Fragment = o, Xt.jsx = Pe, Xt.jsxs = Re;
|
|
1270
|
+
}()), Xt;
|
|
1271
1271
|
}
|
|
1272
|
-
process.env.NODE_ENV === "production" ?
|
|
1273
|
-
var
|
|
1274
|
-
const
|
|
1275
|
-
t.quaternion.copy(
|
|
1276
|
-
const
|
|
1277
|
-
t.position.copy(
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
},
|
|
1281
|
-
|
|
1272
|
+
process.env.NODE_ENV === "production" ? Le.exports = li() : Le.exports = ci();
|
|
1273
|
+
var ui = Le.exports;
|
|
1274
|
+
const Je = ({ sourceCamera: n, targetCamera: t, distance: i, controls: o }) => {
|
|
1275
|
+
t.quaternion.copy(n.quaternion);
|
|
1276
|
+
const s = new h.Vector3(0, 0, -1).applyQuaternion(t.quaternion).normalize(), l = i ?? n.position.length();
|
|
1277
|
+
t.position.copy(s.multiplyScalar(-l));
|
|
1278
|
+
const d = o && !o.target.equals(new h.Vector3(0, 0, 0)) ? o.target : new h.Vector3(0, 0, 0);
|
|
1279
|
+
t.lookAt(d), t.updateMatrixWorld(!0), o && o.update();
|
|
1280
|
+
}, Ue = (n, t) => {
|
|
1281
|
+
Je({ sourceCamera: t, targetCamera: n, distance: 5 });
|
|
1282
|
+
}, di = (n, t, i) => {
|
|
1283
|
+
Je({
|
|
1282
1284
|
sourceCamera: t,
|
|
1283
|
-
targetCamera:
|
|
1284
|
-
distance:
|
|
1285
|
+
targetCamera: n,
|
|
1286
|
+
distance: n.position.length(),
|
|
1287
|
+
controls: i
|
|
1285
1288
|
});
|
|
1286
|
-
},
|
|
1289
|
+
}, pi = () => {
|
|
1287
1290
|
try {
|
|
1288
|
-
const
|
|
1289
|
-
return !!(window.WebGLRenderingContext && (
|
|
1291
|
+
const n = document.createElement("canvas");
|
|
1292
|
+
return !!(window.WebGLRenderingContext && (n.getContext("webgl") || n.getContext("experimental-webgl")));
|
|
1290
1293
|
} catch {
|
|
1291
1294
|
return !1;
|
|
1292
1295
|
}
|
|
1293
|
-
},
|
|
1296
|
+
}, fi = () => pi() ? new h.WebGLRenderer({ alpha: !0, antialias: !0 }) : (console.error("WebGL is not supported in this environment."), null), Ze = { type: "change" }, ke = { type: "start" }, ti = { type: "end" }, $t = new Xe(), Ve = new $e(), mi = Math.cos(70 * qe.DEG2RAD), F = new z(), B = 2 * Math.PI, M = {
|
|
1294
1297
|
NONE: -1,
|
|
1295
1298
|
ROTATE: 0,
|
|
1296
1299
|
DOLLY: 1,
|
|
@@ -1299,10 +1302,10 @@ const qe = ({ sourceCamera: o, targetCamera: t, distance: i }) => {
|
|
|
1299
1302
|
TOUCH_PAN: 4,
|
|
1300
1303
|
TOUCH_DOLLY_PAN: 5,
|
|
1301
1304
|
TOUCH_DOLLY_ROTATE: 6
|
|
1302
|
-
},
|
|
1303
|
-
class
|
|
1305
|
+
}, Me = 1e-6;
|
|
1306
|
+
class _i extends Qe {
|
|
1304
1307
|
constructor(t, i = null) {
|
|
1305
|
-
super(t, i), this.state =
|
|
1308
|
+
super(t, i), this.state = M.NONE, this.enabled = !0, this.target = new z(), this.cursor = new z(), 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: H.ROTATE, MIDDLE: H.DOLLY, RIGHT: H.PAN }, this.touches = { ONE: $.ROTATE, TWO: $.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this._lastPosition = new z(), this._lastQuaternion = new te(), this._lastTargetPosition = new z(), this._quat = new te().setFromUnitVectors(t.up, new z(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new ee(), this._sphericalDelta = new ee(), this._scale = 1, this._panOffset = new z(), this._rotateStart = new A(), this._rotateEnd = new A(), this._rotateDelta = new A(), this._panStart = new A(), this._panEnd = new A(), this._panDelta = new A(), this._dollyStart = new A(), this._dollyEnd = new A(), this._dollyDelta = new A(), this._dollyDirection = new z(), this._mouse = new A(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = gi.bind(this), this._onPointerDown = yi.bind(this), this._onPointerUp = bi.bind(this), this._onContextMenu = Pi.bind(this), this._onMouseWheel = wi.bind(this), this._onKeyDown = Si.bind(this), this._onTouchStart = Ti.bind(this), this._onTouchMove = Ci.bind(this), this._onMouseDown = Ei.bind(this), this._onMouseMove = vi.bind(this), this._interceptControlDown = Ri.bind(this), this._interceptControlUp = Oi.bind(this), this.domElement !== null && this.connect(), this.update();
|
|
1306
1309
|
}
|
|
1307
1310
|
connect() {
|
|
1308
1311
|
this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointercancel", this._onPointerUp), this.domElement.addEventListener("contextmenu", this._onContextMenu), this.domElement.addEventListener("wheel", this._onMouseWheel, { passive: !1 }), this.domElement.getRootNode().addEventListener("keydown", this._interceptControlDown, { passive: !0, capture: !0 }), this.domElement.style.touchAction = "none";
|
|
@@ -1332,45 +1335,45 @@ class pi extends Be {
|
|
|
1332
1335
|
this.target0.copy(this.target), this.position0.copy(this.object.position), this.zoom0 = this.object.zoom;
|
|
1333
1336
|
}
|
|
1334
1337
|
reset() {
|
|
1335
|
-
this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(
|
|
1338
|
+
this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(Ze), this.update(), this.state = M.NONE;
|
|
1336
1339
|
}
|
|
1337
1340
|
update(t = null) {
|
|
1338
1341
|
const i = this.object.position;
|
|
1339
|
-
|
|
1340
|
-
let
|
|
1341
|
-
isFinite(
|
|
1342
|
-
let
|
|
1342
|
+
F.copy(i).sub(this.target), F.applyQuaternion(this._quat), this._spherical.setFromVector3(F), this.autoRotate && this.state === M.NONE && this._rotateLeft(this._getAutoRotationAngle(t)), this.enableDamping ? (this._spherical.theta += this._sphericalDelta.theta * this.dampingFactor, this._spherical.phi += this._sphericalDelta.phi * this.dampingFactor) : (this._spherical.theta += this._sphericalDelta.theta, this._spherical.phi += this._sphericalDelta.phi);
|
|
1343
|
+
let o = this.minAzimuthAngle, s = this.maxAzimuthAngle;
|
|
1344
|
+
isFinite(o) && isFinite(s) && (o < -Math.PI ? o += B : o > Math.PI && (o -= B), s < -Math.PI ? s += B : s > Math.PI && (s -= B), o <= s ? this._spherical.theta = Math.max(o, Math.min(s, this._spherical.theta)) : this._spherical.theta = this._spherical.theta > (o + s) / 2 ? Math.max(o, this._spherical.theta) : Math.min(s, this._spherical.theta)), this._spherical.phi = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, this._spherical.phi)), this._spherical.makeSafe(), this.enableDamping === !0 ? this.target.addScaledVector(this._panOffset, this.dampingFactor) : this.target.add(this._panOffset), this.target.sub(this.cursor), this.target.clampLength(this.minTargetRadius, this.maxTargetRadius), this.target.add(this.cursor);
|
|
1345
|
+
let l = !1;
|
|
1343
1346
|
if (this.zoomToCursor && this._performCursorZoom || this.object.isOrthographicCamera)
|
|
1344
1347
|
this._spherical.radius = this._clampDistance(this._spherical.radius);
|
|
1345
1348
|
else {
|
|
1346
|
-
const
|
|
1347
|
-
this._spherical.radius = this._clampDistance(this._spherical.radius * this._scale),
|
|
1349
|
+
const d = this._spherical.radius;
|
|
1350
|
+
this._spherical.radius = this._clampDistance(this._spherical.radius * this._scale), l = d != this._spherical.radius;
|
|
1348
1351
|
}
|
|
1349
|
-
if (
|
|
1350
|
-
let
|
|
1352
|
+
if (F.setFromSpherical(this._spherical), F.applyQuaternion(this._quatInverse), i.copy(this.target).add(F), this.object.lookAt(this.target), this.enableDamping === !0 ? (this._sphericalDelta.theta *= 1 - this.dampingFactor, this._sphericalDelta.phi *= 1 - this.dampingFactor, this._panOffset.multiplyScalar(1 - this.dampingFactor)) : (this._sphericalDelta.set(0, 0, 0), this._panOffset.set(0, 0, 0)), this.zoomToCursor && this._performCursorZoom) {
|
|
1353
|
+
let d = null;
|
|
1351
1354
|
if (this.object.isPerspectiveCamera) {
|
|
1352
|
-
const
|
|
1353
|
-
|
|
1354
|
-
const
|
|
1355
|
-
this.object.position.addScaledVector(this._dollyDirection,
|
|
1355
|
+
const u = F.length();
|
|
1356
|
+
d = this._clampDistance(u * this._scale);
|
|
1357
|
+
const p = u - d;
|
|
1358
|
+
this.object.position.addScaledVector(this._dollyDirection, p), this.object.updateMatrixWorld(), l = !!p;
|
|
1356
1359
|
} else if (this.object.isOrthographicCamera) {
|
|
1357
|
-
const
|
|
1358
|
-
|
|
1359
|
-
const
|
|
1360
|
-
this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), this.object.updateProjectionMatrix(),
|
|
1361
|
-
const
|
|
1362
|
-
|
|
1360
|
+
const u = new z(this._mouse.x, this._mouse.y, 0);
|
|
1361
|
+
u.unproject(this.object);
|
|
1362
|
+
const p = this.object.zoom;
|
|
1363
|
+
this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), this.object.updateProjectionMatrix(), l = p !== this.object.zoom;
|
|
1364
|
+
const v = new z(this._mouse.x, this._mouse.y, 0);
|
|
1365
|
+
v.unproject(this.object), this.object.position.sub(v).add(u), this.object.updateMatrixWorld(), d = F.length();
|
|
1363
1366
|
} else
|
|
1364
1367
|
console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), this.zoomToCursor = !1;
|
|
1365
|
-
|
|
1368
|
+
d !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(d).add(this.object.position) : ($t.origin.copy(this.object.position), $t.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot($t.direction)) < mi ? this.object.lookAt(this.target) : (Ve.setFromNormalAndCoplanarPoint(this.object.up, this.target), $t.intersectPlane(Ve, this.target))));
|
|
1366
1369
|
} else if (this.object.isOrthographicCamera) {
|
|
1367
|
-
const
|
|
1368
|
-
this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)),
|
|
1370
|
+
const d = this.object.zoom;
|
|
1371
|
+
this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), d !== this.object.zoom && (this.object.updateProjectionMatrix(), l = !0);
|
|
1369
1372
|
}
|
|
1370
|
-
return this._scale = 1, this._performCursorZoom = !1,
|
|
1373
|
+
return this._scale = 1, this._performCursorZoom = !1, l || this._lastPosition.distanceToSquared(this.object.position) > Me || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > Me || this._lastTargetPosition.distanceToSquared(this.target) > Me ? (this.dispatchEvent(Ze), this._lastPosition.copy(this.object.position), this._lastQuaternion.copy(this.object.quaternion), this._lastTargetPosition.copy(this.target), !0) : !1;
|
|
1371
1374
|
}
|
|
1372
1375
|
_getAutoRotationAngle(t) {
|
|
1373
|
-
return t !== null ?
|
|
1376
|
+
return t !== null ? B / 60 * this.autoRotateSpeed * t : B / 60 / 60 * this.autoRotateSpeed;
|
|
1374
1377
|
}
|
|
1375
1378
|
_getZoomScale(t) {
|
|
1376
1379
|
const i = Math.abs(t * 0.01);
|
|
@@ -1383,20 +1386,20 @@ class pi extends Be {
|
|
|
1383
1386
|
this._sphericalDelta.phi -= t;
|
|
1384
1387
|
}
|
|
1385
1388
|
_panLeft(t, i) {
|
|
1386
|
-
|
|
1389
|
+
F.setFromMatrixColumn(i, 0), F.multiplyScalar(-t), this._panOffset.add(F);
|
|
1387
1390
|
}
|
|
1388
1391
|
_panUp(t, i) {
|
|
1389
|
-
this.screenSpacePanning === !0 ?
|
|
1392
|
+
this.screenSpacePanning === !0 ? F.setFromMatrixColumn(i, 1) : (F.setFromMatrixColumn(i, 0), F.crossVectors(this.object.up, F)), F.multiplyScalar(t), this._panOffset.add(F);
|
|
1390
1393
|
}
|
|
1391
1394
|
// deltaX and deltaY are in pixels; right and down are positive
|
|
1392
1395
|
_pan(t, i) {
|
|
1393
|
-
const
|
|
1396
|
+
const o = this.domElement;
|
|
1394
1397
|
if (this.object.isPerspectiveCamera) {
|
|
1395
|
-
const
|
|
1396
|
-
|
|
1397
|
-
let
|
|
1398
|
-
|
|
1399
|
-
} else this.object.isOrthographicCamera ? (this._panLeft(t * (this.object.right - this.object.left) / this.object.zoom /
|
|
1398
|
+
const s = this.object.position;
|
|
1399
|
+
F.copy(s).sub(this.target);
|
|
1400
|
+
let l = F.length();
|
|
1401
|
+
l *= Math.tan(this.object.fov / 2 * Math.PI / 180), this._panLeft(2 * t * l / o.clientHeight, this.object.matrix), this._panUp(2 * i * l / o.clientHeight, this.object.matrix);
|
|
1402
|
+
} else this.object.isOrthographicCamera ? (this._panLeft(t * (this.object.right - this.object.left) / this.object.zoom / o.clientWidth, this.object.matrix), this._panUp(i * (this.object.top - this.object.bottom) / this.object.zoom / o.clientHeight, this.object.matrix)) : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."), this.enablePan = !1);
|
|
1400
1403
|
}
|
|
1401
1404
|
_dollyOut(t) {
|
|
1402
1405
|
this.object.isPerspectiveCamera || this.object.isOrthographicCamera ? this._scale /= t : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), this.enableZoom = !1);
|
|
@@ -1408,8 +1411,8 @@ class pi extends Be {
|
|
|
1408
1411
|
if (!this.zoomToCursor)
|
|
1409
1412
|
return;
|
|
1410
1413
|
this._performCursorZoom = !0;
|
|
1411
|
-
const
|
|
1412
|
-
this._mouse.x =
|
|
1414
|
+
const o = this.domElement.getBoundingClientRect(), s = t - o.left, l = i - o.top, d = o.width, u = o.height;
|
|
1415
|
+
this._mouse.x = s / d * 2 - 1, this._mouse.y = -(l / u) * 2 + 1, this._dollyDirection.set(this._mouse.x, this._mouse.y, 1).unproject(this.object).sub(this.object.position).normalize();
|
|
1413
1416
|
}
|
|
1414
1417
|
_clampDistance(t) {
|
|
1415
1418
|
return Math.max(this.minDistance, Math.min(this.maxDistance, t));
|
|
@@ -1429,7 +1432,7 @@ class pi extends Be {
|
|
|
1429
1432
|
_handleMouseMoveRotate(t) {
|
|
1430
1433
|
this._rotateEnd.set(t.clientX, t.clientY), this._rotateDelta.subVectors(this._rotateEnd, this._rotateStart).multiplyScalar(this.rotateSpeed);
|
|
1431
1434
|
const i = this.domElement;
|
|
1432
|
-
this._rotateLeft(
|
|
1435
|
+
this._rotateLeft(B * this._rotateDelta.x / i.clientHeight), this._rotateUp(B * this._rotateDelta.y / i.clientHeight), this._rotateStart.copy(this._rotateEnd), this.update();
|
|
1433
1436
|
}
|
|
1434
1437
|
_handleMouseMoveDolly(t) {
|
|
1435
1438
|
this._dollyEnd.set(t.clientX, t.clientY), this._dollyDelta.subVectors(this._dollyEnd, this._dollyStart), this._dollyDelta.y > 0 ? this._dollyOut(this._getZoomScale(this._dollyDelta.y)) : this._dollyDelta.y < 0 && this._dollyIn(this._getZoomScale(this._dollyDelta.y)), this._dollyStart.copy(this._dollyEnd), this.update();
|
|
@@ -1444,16 +1447,16 @@ class pi extends Be {
|
|
|
1444
1447
|
let i = !1;
|
|
1445
1448
|
switch (t.code) {
|
|
1446
1449
|
case this.keys.UP:
|
|
1447
|
-
t.ctrlKey || t.metaKey || t.shiftKey ? this._rotateUp(
|
|
1450
|
+
t.ctrlKey || t.metaKey || t.shiftKey ? this._rotateUp(B * this.rotateSpeed / this.domElement.clientHeight) : this._pan(0, this.keyPanSpeed), i = !0;
|
|
1448
1451
|
break;
|
|
1449
1452
|
case this.keys.BOTTOM:
|
|
1450
|
-
t.ctrlKey || t.metaKey || t.shiftKey ? this._rotateUp(-
|
|
1453
|
+
t.ctrlKey || t.metaKey || t.shiftKey ? this._rotateUp(-B * this.rotateSpeed / this.domElement.clientHeight) : this._pan(0, -this.keyPanSpeed), i = !0;
|
|
1451
1454
|
break;
|
|
1452
1455
|
case this.keys.LEFT:
|
|
1453
|
-
t.ctrlKey || t.metaKey || t.shiftKey ? this._rotateLeft(
|
|
1456
|
+
t.ctrlKey || t.metaKey || t.shiftKey ? this._rotateLeft(B * this.rotateSpeed / this.domElement.clientHeight) : this._pan(this.keyPanSpeed, 0), i = !0;
|
|
1454
1457
|
break;
|
|
1455
1458
|
case this.keys.RIGHT:
|
|
1456
|
-
t.ctrlKey || t.metaKey || t.shiftKey ? this._rotateLeft(-
|
|
1459
|
+
t.ctrlKey || t.metaKey || t.shiftKey ? this._rotateLeft(-B * this.rotateSpeed / this.domElement.clientHeight) : this._pan(-this.keyPanSpeed, 0), i = !0;
|
|
1457
1460
|
break;
|
|
1458
1461
|
}
|
|
1459
1462
|
i && (t.preventDefault(), this.update());
|
|
@@ -1462,21 +1465,21 @@ class pi extends Be {
|
|
|
1462
1465
|
if (this._pointers.length === 1)
|
|
1463
1466
|
this._rotateStart.set(t.pageX, t.pageY);
|
|
1464
1467
|
else {
|
|
1465
|
-
const i = this._getSecondPointerPosition(t),
|
|
1466
|
-
this._rotateStart.set(
|
|
1468
|
+
const i = this._getSecondPointerPosition(t), o = 0.5 * (t.pageX + i.x), s = 0.5 * (t.pageY + i.y);
|
|
1469
|
+
this._rotateStart.set(o, s);
|
|
1467
1470
|
}
|
|
1468
1471
|
}
|
|
1469
1472
|
_handleTouchStartPan(t) {
|
|
1470
1473
|
if (this._pointers.length === 1)
|
|
1471
1474
|
this._panStart.set(t.pageX, t.pageY);
|
|
1472
1475
|
else {
|
|
1473
|
-
const i = this._getSecondPointerPosition(t),
|
|
1474
|
-
this._panStart.set(
|
|
1476
|
+
const i = this._getSecondPointerPosition(t), o = 0.5 * (t.pageX + i.x), s = 0.5 * (t.pageY + i.y);
|
|
1477
|
+
this._panStart.set(o, s);
|
|
1475
1478
|
}
|
|
1476
1479
|
}
|
|
1477
1480
|
_handleTouchStartDolly(t) {
|
|
1478
|
-
const i = this._getSecondPointerPosition(t),
|
|
1479
|
-
this._dollyStart.set(0,
|
|
1481
|
+
const i = this._getSecondPointerPosition(t), o = t.pageX - i.x, s = t.pageY - i.y, l = Math.sqrt(o * o + s * s);
|
|
1482
|
+
this._dollyStart.set(0, l);
|
|
1480
1483
|
}
|
|
1481
1484
|
_handleTouchStartDollyPan(t) {
|
|
1482
1485
|
this.enableZoom && this._handleTouchStartDolly(t), this.enablePan && this._handleTouchStartPan(t);
|
|
@@ -1488,27 +1491,27 @@ class pi extends Be {
|
|
|
1488
1491
|
if (this._pointers.length == 1)
|
|
1489
1492
|
this._rotateEnd.set(t.pageX, t.pageY);
|
|
1490
1493
|
else {
|
|
1491
|
-
const
|
|
1492
|
-
this._rotateEnd.set(
|
|
1494
|
+
const o = this._getSecondPointerPosition(t), s = 0.5 * (t.pageX + o.x), l = 0.5 * (t.pageY + o.y);
|
|
1495
|
+
this._rotateEnd.set(s, l);
|
|
1493
1496
|
}
|
|
1494
1497
|
this._rotateDelta.subVectors(this._rotateEnd, this._rotateStart).multiplyScalar(this.rotateSpeed);
|
|
1495
1498
|
const i = this.domElement;
|
|
1496
|
-
this._rotateLeft(
|
|
1499
|
+
this._rotateLeft(B * this._rotateDelta.x / i.clientHeight), this._rotateUp(B * this._rotateDelta.y / i.clientHeight), this._rotateStart.copy(this._rotateEnd);
|
|
1497
1500
|
}
|
|
1498
1501
|
_handleTouchMovePan(t) {
|
|
1499
1502
|
if (this._pointers.length === 1)
|
|
1500
1503
|
this._panEnd.set(t.pageX, t.pageY);
|
|
1501
1504
|
else {
|
|
1502
|
-
const i = this._getSecondPointerPosition(t),
|
|
1503
|
-
this._panEnd.set(
|
|
1505
|
+
const i = this._getSecondPointerPosition(t), o = 0.5 * (t.pageX + i.x), s = 0.5 * (t.pageY + i.y);
|
|
1506
|
+
this._panEnd.set(o, s);
|
|
1504
1507
|
}
|
|
1505
1508
|
this._panDelta.subVectors(this._panEnd, this._panStart).multiplyScalar(this.panSpeed), this._pan(this._panDelta.x, this._panDelta.y), this._panStart.copy(this._panEnd);
|
|
1506
1509
|
}
|
|
1507
1510
|
_handleTouchMoveDolly(t) {
|
|
1508
|
-
const i = this._getSecondPointerPosition(t),
|
|
1509
|
-
this._dollyEnd.set(0,
|
|
1510
|
-
const
|
|
1511
|
-
this._updateZoomParameters(
|
|
1511
|
+
const i = this._getSecondPointerPosition(t), o = t.pageX - i.x, s = t.pageY - i.y, l = Math.sqrt(o * o + s * s);
|
|
1512
|
+
this._dollyEnd.set(0, l), this._dollyDelta.set(0, Math.pow(this._dollyEnd.y / this._dollyStart.y, this.zoomSpeed)), this._dollyOut(this._dollyDelta.y), this._dollyStart.copy(this._dollyEnd);
|
|
1513
|
+
const d = (t.pageX + i.x) * 0.5, u = (t.pageY + i.y) * 0.5;
|
|
1514
|
+
this._updateZoomParameters(d, u);
|
|
1512
1515
|
}
|
|
1513
1516
|
_handleTouchMoveDollyPan(t) {
|
|
1514
1517
|
this.enableZoom && this._handleTouchMoveDolly(t), this.enablePan && this._handleTouchMovePan(t);
|
|
@@ -1535,7 +1538,7 @@ class pi extends Be {
|
|
|
1535
1538
|
}
|
|
1536
1539
|
_trackPointer(t) {
|
|
1537
1540
|
let i = this._pointerPositions[t.pointerId];
|
|
1538
|
-
i === void 0 && (i = new
|
|
1541
|
+
i === void 0 && (i = new A(), this._pointerPositions[t.pointerId] = i), i.set(t.pageX, t.pageY);
|
|
1539
1542
|
}
|
|
1540
1543
|
_getSecondPointerPosition(t) {
|
|
1541
1544
|
const i = t.pointerId === this._pointers[0] ? this._pointers[1] : this._pointers[0];
|
|
@@ -1543,32 +1546,32 @@ class pi extends Be {
|
|
|
1543
1546
|
}
|
|
1544
1547
|
//
|
|
1545
1548
|
_customWheelEvent(t) {
|
|
1546
|
-
const i = t.deltaMode,
|
|
1549
|
+
const i = t.deltaMode, o = {
|
|
1547
1550
|
clientX: t.clientX,
|
|
1548
1551
|
clientY: t.clientY,
|
|
1549
1552
|
deltaY: t.deltaY
|
|
1550
1553
|
};
|
|
1551
1554
|
switch (i) {
|
|
1552
1555
|
case 1:
|
|
1553
|
-
|
|
1556
|
+
o.deltaY *= 16;
|
|
1554
1557
|
break;
|
|
1555
1558
|
case 2:
|
|
1556
|
-
|
|
1559
|
+
o.deltaY *= 100;
|
|
1557
1560
|
break;
|
|
1558
1561
|
}
|
|
1559
|
-
return t.ctrlKey && !this._controlActive && (
|
|
1562
|
+
return t.ctrlKey && !this._controlActive && (o.deltaY *= 10), o;
|
|
1560
1563
|
}
|
|
1561
1564
|
}
|
|
1562
|
-
function
|
|
1563
|
-
this.enabled !== !1 && (this._pointers.length === 0 && (this.domElement.setPointerCapture(
|
|
1565
|
+
function yi(n) {
|
|
1566
|
+
this.enabled !== !1 && (this._pointers.length === 0 && (this.domElement.setPointerCapture(n.pointerId), this.domElement.addEventListener("pointermove", this._onPointerMove), this.domElement.addEventListener("pointerup", this._onPointerUp)), !this._isTrackingPointer(n) && (this._addPointer(n), n.pointerType === "touch" ? this._onTouchStart(n) : this._onMouseDown(n)));
|
|
1564
1567
|
}
|
|
1565
|
-
function
|
|
1566
|
-
this.enabled !== !1 && (
|
|
1568
|
+
function gi(n) {
|
|
1569
|
+
this.enabled !== !1 && (n.pointerType === "touch" ? this._onTouchMove(n) : this._onMouseMove(n));
|
|
1567
1570
|
}
|
|
1568
|
-
function
|
|
1569
|
-
switch (this._removePointer(
|
|
1571
|
+
function bi(n) {
|
|
1572
|
+
switch (this._removePointer(n), this._pointers.length) {
|
|
1570
1573
|
case 0:
|
|
1571
|
-
this.domElement.releasePointerCapture(
|
|
1574
|
+
this.domElement.releasePointerCapture(n.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(ti), this.state = M.NONE;
|
|
1572
1575
|
break;
|
|
1573
1576
|
case 1:
|
|
1574
1577
|
const t = this._pointers[0], i = this._pointerPositions[t];
|
|
@@ -1576,9 +1579,9 @@ function _i(o) {
|
|
|
1576
1579
|
break;
|
|
1577
1580
|
}
|
|
1578
1581
|
}
|
|
1579
|
-
function
|
|
1582
|
+
function Ei(n) {
|
|
1580
1583
|
let t;
|
|
1581
|
-
switch (
|
|
1584
|
+
switch (n.button) {
|
|
1582
1585
|
case 0:
|
|
1583
1586
|
t = this.mouseButtons.LEFT;
|
|
1584
1587
|
break;
|
|
@@ -1592,212 +1595,368 @@ function yi(o) {
|
|
|
1592
1595
|
t = -1;
|
|
1593
1596
|
}
|
|
1594
1597
|
switch (t) {
|
|
1595
|
-
case
|
|
1598
|
+
case H.DOLLY:
|
|
1596
1599
|
if (this.enableZoom === !1) return;
|
|
1597
|
-
this._handleMouseDownDolly(
|
|
1600
|
+
this._handleMouseDownDolly(n), this.state = M.DOLLY;
|
|
1598
1601
|
break;
|
|
1599
|
-
case
|
|
1600
|
-
if (
|
|
1602
|
+
case H.ROTATE:
|
|
1603
|
+
if (n.ctrlKey || n.metaKey || n.shiftKey) {
|
|
1601
1604
|
if (this.enablePan === !1) return;
|
|
1602
|
-
this._handleMouseDownPan(
|
|
1605
|
+
this._handleMouseDownPan(n), this.state = M.PAN;
|
|
1603
1606
|
} else {
|
|
1604
1607
|
if (this.enableRotate === !1) return;
|
|
1605
|
-
this._handleMouseDownRotate(
|
|
1608
|
+
this._handleMouseDownRotate(n), this.state = M.ROTATE;
|
|
1606
1609
|
}
|
|
1607
1610
|
break;
|
|
1608
|
-
case
|
|
1609
|
-
if (
|
|
1611
|
+
case H.PAN:
|
|
1612
|
+
if (n.ctrlKey || n.metaKey || n.shiftKey) {
|
|
1610
1613
|
if (this.enableRotate === !1) return;
|
|
1611
|
-
this._handleMouseDownRotate(
|
|
1614
|
+
this._handleMouseDownRotate(n), this.state = M.ROTATE;
|
|
1612
1615
|
} else {
|
|
1613
1616
|
if (this.enablePan === !1) return;
|
|
1614
|
-
this._handleMouseDownPan(
|
|
1617
|
+
this._handleMouseDownPan(n), this.state = M.PAN;
|
|
1615
1618
|
}
|
|
1616
1619
|
break;
|
|
1617
1620
|
default:
|
|
1618
|
-
this.state =
|
|
1621
|
+
this.state = M.NONE;
|
|
1619
1622
|
}
|
|
1620
|
-
this.state !==
|
|
1623
|
+
this.state !== M.NONE && this.dispatchEvent(ke);
|
|
1621
1624
|
}
|
|
1622
|
-
function
|
|
1625
|
+
function vi(n) {
|
|
1623
1626
|
switch (this.state) {
|
|
1624
|
-
case
|
|
1627
|
+
case M.ROTATE:
|
|
1625
1628
|
if (this.enableRotate === !1) return;
|
|
1626
|
-
this._handleMouseMoveRotate(
|
|
1629
|
+
this._handleMouseMoveRotate(n);
|
|
1627
1630
|
break;
|
|
1628
|
-
case
|
|
1631
|
+
case M.DOLLY:
|
|
1629
1632
|
if (this.enableZoom === !1) return;
|
|
1630
|
-
this._handleMouseMoveDolly(
|
|
1633
|
+
this._handleMouseMoveDolly(n);
|
|
1631
1634
|
break;
|
|
1632
|
-
case
|
|
1635
|
+
case M.PAN:
|
|
1633
1636
|
if (this.enablePan === !1) return;
|
|
1634
|
-
this._handleMouseMovePan(
|
|
1637
|
+
this._handleMouseMovePan(n);
|
|
1635
1638
|
break;
|
|
1636
1639
|
}
|
|
1637
1640
|
}
|
|
1638
|
-
function
|
|
1639
|
-
this.enabled === !1 || this.enableZoom === !1 || this.state !==
|
|
1641
|
+
function wi(n) {
|
|
1642
|
+
this.enabled === !1 || this.enableZoom === !1 || this.state !== M.NONE || (n.preventDefault(), this.dispatchEvent(ke), this._handleMouseWheel(this._customWheelEvent(n)), this.dispatchEvent(ti));
|
|
1640
1643
|
}
|
|
1641
|
-
function
|
|
1642
|
-
this.enabled === !1 || this.enablePan === !1 || this._handleKeyDown(
|
|
1644
|
+
function Si(n) {
|
|
1645
|
+
this.enabled === !1 || this.enablePan === !1 || this._handleKeyDown(n);
|
|
1643
1646
|
}
|
|
1644
|
-
function
|
|
1645
|
-
switch (this._trackPointer(
|
|
1647
|
+
function Ti(n) {
|
|
1648
|
+
switch (this._trackPointer(n), this._pointers.length) {
|
|
1646
1649
|
case 1:
|
|
1647
1650
|
switch (this.touches.ONE) {
|
|
1648
|
-
case
|
|
1651
|
+
case $.ROTATE:
|
|
1649
1652
|
if (this.enableRotate === !1) return;
|
|
1650
|
-
this._handleTouchStartRotate(
|
|
1653
|
+
this._handleTouchStartRotate(n), this.state = M.TOUCH_ROTATE;
|
|
1651
1654
|
break;
|
|
1652
|
-
case
|
|
1655
|
+
case $.PAN:
|
|
1653
1656
|
if (this.enablePan === !1) return;
|
|
1654
|
-
this._handleTouchStartPan(
|
|
1657
|
+
this._handleTouchStartPan(n), this.state = M.TOUCH_PAN;
|
|
1655
1658
|
break;
|
|
1656
1659
|
default:
|
|
1657
|
-
this.state =
|
|
1660
|
+
this.state = M.NONE;
|
|
1658
1661
|
}
|
|
1659
1662
|
break;
|
|
1660
1663
|
case 2:
|
|
1661
1664
|
switch (this.touches.TWO) {
|
|
1662
|
-
case
|
|
1665
|
+
case $.DOLLY_PAN:
|
|
1663
1666
|
if (this.enableZoom === !1 && this.enablePan === !1) return;
|
|
1664
|
-
this._handleTouchStartDollyPan(
|
|
1667
|
+
this._handleTouchStartDollyPan(n), this.state = M.TOUCH_DOLLY_PAN;
|
|
1665
1668
|
break;
|
|
1666
|
-
case
|
|
1669
|
+
case $.DOLLY_ROTATE:
|
|
1667
1670
|
if (this.enableZoom === !1 && this.enableRotate === !1) return;
|
|
1668
|
-
this._handleTouchStartDollyRotate(
|
|
1671
|
+
this._handleTouchStartDollyRotate(n), this.state = M.TOUCH_DOLLY_ROTATE;
|
|
1669
1672
|
break;
|
|
1670
1673
|
default:
|
|
1671
|
-
this.state =
|
|
1674
|
+
this.state = M.NONE;
|
|
1672
1675
|
}
|
|
1673
1676
|
break;
|
|
1674
1677
|
default:
|
|
1675
|
-
this.state =
|
|
1678
|
+
this.state = M.NONE;
|
|
1676
1679
|
}
|
|
1677
|
-
this.state !==
|
|
1680
|
+
this.state !== M.NONE && this.dispatchEvent(ke);
|
|
1678
1681
|
}
|
|
1679
|
-
function
|
|
1680
|
-
switch (this._trackPointer(
|
|
1681
|
-
case
|
|
1682
|
+
function Ci(n) {
|
|
1683
|
+
switch (this._trackPointer(n), this.state) {
|
|
1684
|
+
case M.TOUCH_ROTATE:
|
|
1682
1685
|
if (this.enableRotate === !1) return;
|
|
1683
|
-
this._handleTouchMoveRotate(
|
|
1686
|
+
this._handleTouchMoveRotate(n), this.update();
|
|
1684
1687
|
break;
|
|
1685
|
-
case
|
|
1688
|
+
case M.TOUCH_PAN:
|
|
1686
1689
|
if (this.enablePan === !1) return;
|
|
1687
|
-
this._handleTouchMovePan(
|
|
1690
|
+
this._handleTouchMovePan(n), this.update();
|
|
1688
1691
|
break;
|
|
1689
|
-
case
|
|
1692
|
+
case M.TOUCH_DOLLY_PAN:
|
|
1690
1693
|
if (this.enableZoom === !1 && this.enablePan === !1) return;
|
|
1691
|
-
this._handleTouchMoveDollyPan(
|
|
1694
|
+
this._handleTouchMoveDollyPan(n), this.update();
|
|
1692
1695
|
break;
|
|
1693
|
-
case
|
|
1696
|
+
case M.TOUCH_DOLLY_ROTATE:
|
|
1694
1697
|
if (this.enableZoom === !1 && this.enableRotate === !1) return;
|
|
1695
|
-
this._handleTouchMoveDollyRotate(
|
|
1698
|
+
this._handleTouchMoveDollyRotate(n), this.update();
|
|
1696
1699
|
break;
|
|
1697
1700
|
default:
|
|
1698
|
-
this.state =
|
|
1701
|
+
this.state = M.NONE;
|
|
1699
1702
|
}
|
|
1700
1703
|
}
|
|
1701
|
-
function
|
|
1702
|
-
this.enabled !== !1 &&
|
|
1704
|
+
function Pi(n) {
|
|
1705
|
+
this.enabled !== !1 && n.preventDefault();
|
|
1703
1706
|
}
|
|
1704
|
-
function
|
|
1705
|
-
|
|
1707
|
+
function Ri(n) {
|
|
1708
|
+
n.key === "Control" && (this._controlActive = !0, this.domElement.getRootNode().addEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
|
|
1706
1709
|
}
|
|
1707
|
-
function
|
|
1708
|
-
|
|
1710
|
+
function Oi(n) {
|
|
1711
|
+
n.key === "Control" && (this._controlActive = !1, this.domElement.getRootNode().removeEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
|
|
1709
1712
|
}
|
|
1710
|
-
const
|
|
1711
|
-
const
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
);
|
|
1715
|
-
o.
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
skyColor: "#ffffbb",
|
|
1734
|
-
groundColor: "#080820",
|
|
1735
|
-
intensity: 1
|
|
1736
|
-
},
|
|
1737
|
-
directionalLight: {
|
|
1738
|
-
color: "#ffffff",
|
|
1739
|
-
intensity: Math.PI,
|
|
1740
|
-
position: new y.Vector3(6, 6, 6),
|
|
1741
|
-
castShadow: !0,
|
|
1742
|
-
shadow: {
|
|
1743
|
-
mapSize: {
|
|
1744
|
-
width: 512,
|
|
1745
|
-
height: 512
|
|
1746
|
-
},
|
|
1747
|
-
camera: {
|
|
1748
|
-
near: 0.5,
|
|
1749
|
-
far: 50,
|
|
1750
|
-
left: -10,
|
|
1751
|
-
right: 10,
|
|
1752
|
-
top: 10,
|
|
1753
|
-
bottom: -10
|
|
1754
|
-
},
|
|
1755
|
-
bias: -1e-3,
|
|
1756
|
-
radius: 1
|
|
1757
|
-
}
|
|
1758
|
-
}
|
|
1713
|
+
const Di = (n) => {
|
|
1714
|
+
const t = new h.AmbientLight(16777215, 1);
|
|
1715
|
+
n.add(t);
|
|
1716
|
+
const i = new h.DirectionalLight(16777215, 1);
|
|
1717
|
+
i.position.set(5, 10, 5), n.add(i);
|
|
1718
|
+
const o = new h.DirectionalLight(16777215, 1);
|
|
1719
|
+
o.position.set(-5, -10, 5), n.add(o);
|
|
1720
|
+
const s = new h.PointLight(16777215, 1, 100);
|
|
1721
|
+
s.position.set(0, 0, 5), n.add(s), i.castShadow = !1, o.castShadow = !1, s.castShadow = !1;
|
|
1722
|
+
}, S = {
|
|
1723
|
+
CUBE_SIZE: 1.8,
|
|
1724
|
+
EDGE_SECTION_SIZE: 0.35,
|
|
1725
|
+
FACE_THICKNESS: 0.35,
|
|
1726
|
+
CANVAS_SIZE: 256,
|
|
1727
|
+
FONT_SIZE: "62px",
|
|
1728
|
+
TEXT_COLOR: "#000000",
|
|
1729
|
+
TEXT_ALIGN: "center",
|
|
1730
|
+
TEXT_BASELINE: "middle",
|
|
1731
|
+
FACE_COLOR: "#EFF3F2",
|
|
1732
|
+
FACE_OPACITY: 1,
|
|
1733
|
+
EDGE_COLOR: "#EFF3F2",
|
|
1734
|
+
CORNER_COLOR: "#EFF3F2",
|
|
1735
|
+
LINE_COLOR: 0
|
|
1759
1736
|
};
|
|
1737
|
+
class ei {
|
|
1738
|
+
static createTextTexture(t) {
|
|
1739
|
+
const i = document.createElement("canvas"), o = i.getContext("2d");
|
|
1740
|
+
i.width = S.CANVAS_SIZE, i.height = S.CANVAS_SIZE, o && (o.clearRect(0, 0, i.width, i.height), o.font = `${S.FONT_SIZE} Arial`, o.fillStyle = S.TEXT_COLOR, o.textAlign = S.TEXT_ALIGN, o.textBaseline = S.TEXT_BASELINE, o.fillText(t, i.width / 2, i.height / 2));
|
|
1741
|
+
const s = new h.CanvasTexture(i);
|
|
1742
|
+
return s.needsUpdate = !0, s;
|
|
1743
|
+
}
|
|
1744
|
+
}
|
|
1745
|
+
class qt {
|
|
1746
|
+
static createWireframe([t, i, o]) {
|
|
1747
|
+
const s = new h.BoxGeometry(t, i, o), l = new h.EdgesGeometry(s), d = new h.LineBasicMaterial({ color: S.LINE_COLOR }), u = new h.LineSegments(l, d);
|
|
1748
|
+
return u.name = "Wireframe", u;
|
|
1749
|
+
}
|
|
1750
|
+
static createEdgeBox(t, i, o) {
|
|
1751
|
+
const s = S.CUBE_SIZE - S.EDGE_SECTION_SIZE, l = {
|
|
1752
|
+
x: S.EDGE_SECTION_SIZE,
|
|
1753
|
+
y: S.EDGE_SECTION_SIZE,
|
|
1754
|
+
z: S.EDGE_SECTION_SIZE
|
|
1755
|
+
};
|
|
1756
|
+
l[i] = s;
|
|
1757
|
+
const d = new h.BoxGeometry(l.x, l.y, l.z), u = new h.MeshStandardMaterial({ color: S.EDGE_COLOR }), p = new h.Mesh(d, u);
|
|
1758
|
+
return p.position.copy(t), p.name = `Edge Box ${o}`, p;
|
|
1759
|
+
}
|
|
1760
|
+
static createCornerCube(t, i) {
|
|
1761
|
+
const o = new h.BoxGeometry(
|
|
1762
|
+
S.EDGE_SECTION_SIZE,
|
|
1763
|
+
S.EDGE_SECTION_SIZE,
|
|
1764
|
+
S.EDGE_SECTION_SIZE
|
|
1765
|
+
), s = new h.MeshStandardMaterial({ color: S.CORNER_COLOR }), l = new h.Mesh(o, s);
|
|
1766
|
+
return l.position.copy(t), l.name = `Corner Cube ${i}`, l;
|
|
1767
|
+
}
|
|
1768
|
+
static createFace(t, i, o) {
|
|
1769
|
+
const s = new h.Group(), l = new h.BoxGeometry(
|
|
1770
|
+
S.CUBE_SIZE - S.EDGE_SECTION_SIZE,
|
|
1771
|
+
S.CUBE_SIZE - S.EDGE_SECTION_SIZE,
|
|
1772
|
+
S.FACE_THICKNESS
|
|
1773
|
+
), d = new h.MeshStandardMaterial({ color: S.FACE_COLOR }), u = new h.Mesh(l, d);
|
|
1774
|
+
u.name = `Face Box ${o}`, s.add(u);
|
|
1775
|
+
const p = new h.PlaneGeometry(
|
|
1776
|
+
S.CUBE_SIZE - S.EDGE_SECTION_SIZE,
|
|
1777
|
+
S.CUBE_SIZE - S.EDGE_SECTION_SIZE
|
|
1778
|
+
), v = new h.MeshStandardMaterial({
|
|
1779
|
+
map: ei.createTextTexture(o),
|
|
1780
|
+
transparent: !0,
|
|
1781
|
+
depthWrite: !1
|
|
1782
|
+
}), g = new h.Mesh(p, v);
|
|
1783
|
+
return g.position.set(0, 0, S.FACE_THICKNESS / 2 + 0.01), s.add(g), s.position.copy(t), s.rotation.copy(i), s;
|
|
1784
|
+
}
|
|
1785
|
+
}
|
|
1760
1786
|
class Mi {
|
|
1761
|
-
|
|
1787
|
+
constructor() {
|
|
1788
|
+
this.hoveredObject = null, this.originalColor = null;
|
|
1789
|
+
}
|
|
1790
|
+
get vectorToCube() {
|
|
1791
|
+
var t;
|
|
1792
|
+
return (t = this.hoveredObject) == null ? void 0 : t.userData.vectorToCube;
|
|
1793
|
+
}
|
|
1794
|
+
createTextSprite(t, i) {
|
|
1795
|
+
const o = document.createElement("canvas");
|
|
1796
|
+
o.width = 64, o.height = 64;
|
|
1797
|
+
const s = o.getContext("2d");
|
|
1798
|
+
s.fillStyle = "rgba(0, 0, 0, 0)", s.fillRect(0, 0, o.width, o.height), s.font = "Bold 48px Arial", s.fillStyle = `#${i.toString(16).padStart(6, "0")}`, s.textAlign = "center", s.textBaseline = "middle", s.fillText(t, o.width / 2, o.height / 2);
|
|
1799
|
+
const l = new h.CanvasTexture(o), d = new h.SpriteMaterial({ map: l }), u = new h.Sprite(d);
|
|
1800
|
+
return u.scale.set(0.5, 0.5, 0.5), u;
|
|
1801
|
+
}
|
|
1762
1802
|
createTextTexture(t) {
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1803
|
+
return ei.createTextTexture(t);
|
|
1804
|
+
}
|
|
1805
|
+
createWireframe() {
|
|
1806
|
+
const t = S.CUBE_SIZE + S.EDGE_SECTION_SIZE, i = qt.createWireframe([t, t, t]);
|
|
1807
|
+
return i.userData.gizmoCube = this, i;
|
|
1808
|
+
}
|
|
1809
|
+
createEdgeBox(t, i, o) {
|
|
1810
|
+
const s = qt.createEdgeBox(t, i, o);
|
|
1811
|
+
return s.userData.gizmoCube = this, s;
|
|
1812
|
+
}
|
|
1813
|
+
createCornerCube(t, i) {
|
|
1814
|
+
const o = qt.createCornerCube(t, i);
|
|
1815
|
+
return o.userData.gizmoCube = this, o;
|
|
1816
|
+
}
|
|
1817
|
+
createFace(t, i, o) {
|
|
1818
|
+
const s = qt.createFace(t, i, o), l = s.getObjectByName(`Face Box ${o}`);
|
|
1819
|
+
return l.userData.gizmoCube = this, s;
|
|
1820
|
+
}
|
|
1821
|
+
createEdges(t) {
|
|
1822
|
+
const i = S.CUBE_SIZE / 2;
|
|
1823
|
+
[
|
|
1824
|
+
{ axis: "x", pos: new h.Vector3(0, i, -i) },
|
|
1825
|
+
{ axis: "x", pos: new h.Vector3(0, i, i) },
|
|
1826
|
+
{ axis: "x", pos: new h.Vector3(0, -i, -i) },
|
|
1827
|
+
{ axis: "x", pos: new h.Vector3(0, -i, i) },
|
|
1828
|
+
{ axis: "y", pos: new h.Vector3(i, 0, -i) },
|
|
1829
|
+
{ axis: "y", pos: new h.Vector3(i, 0, i) },
|
|
1830
|
+
{ axis: "y", pos: new h.Vector3(-i, 0, -i) },
|
|
1831
|
+
{ axis: "y", pos: new h.Vector3(-i, 0, i) },
|
|
1832
|
+
{ axis: "z", pos: new h.Vector3(i, i, 0) },
|
|
1833
|
+
{ axis: "z", pos: new h.Vector3(i, -i, 0) },
|
|
1834
|
+
{ axis: "z", pos: new h.Vector3(-i, i, 0) },
|
|
1835
|
+
{ axis: "z", pos: new h.Vector3(-i, -i, 0) }
|
|
1836
|
+
].forEach(({ axis: o, pos: s }, l) => {
|
|
1837
|
+
const d = this.createEdgeBox(s, o, l + 1);
|
|
1838
|
+
t.add(d);
|
|
1839
|
+
});
|
|
1840
|
+
}
|
|
1841
|
+
createCorners(t) {
|
|
1842
|
+
const i = S.CUBE_SIZE / 2;
|
|
1843
|
+
[
|
|
1844
|
+
new h.Vector3(-i, -i, -i),
|
|
1845
|
+
new h.Vector3(-i, -i, i),
|
|
1846
|
+
new h.Vector3(-i, i, -i),
|
|
1847
|
+
new h.Vector3(-i, i, i),
|
|
1848
|
+
new h.Vector3(i, -i, -i),
|
|
1849
|
+
new h.Vector3(i, -i, i),
|
|
1850
|
+
new h.Vector3(i, i, -i),
|
|
1851
|
+
new h.Vector3(i, i, i)
|
|
1852
|
+
].forEach((o, s) => {
|
|
1853
|
+
const l = this.createCornerCube(o, s + 1);
|
|
1854
|
+
t.add(l);
|
|
1855
|
+
});
|
|
1856
|
+
}
|
|
1857
|
+
createFaces(t) {
|
|
1858
|
+
const i = S.CUBE_SIZE / 2;
|
|
1859
|
+
[
|
|
1860
|
+
{ pos: new h.Vector3(0, 0, i), rotation: new h.Euler(0, 0, 0), label: "FRONT" },
|
|
1861
|
+
{ pos: new h.Vector3(0, 0, -i), rotation: new h.Euler(0, Math.PI, 0), label: "BACK" },
|
|
1862
|
+
{ pos: new h.Vector3(i, 0, 0), rotation: new h.Euler(0, Math.PI / 2, 0), label: "RIGHT" },
|
|
1863
|
+
{ pos: new h.Vector3(-i, 0, 0), rotation: new h.Euler(0, -Math.PI / 2, 0), label: "LEFT" },
|
|
1864
|
+
{ pos: new h.Vector3(0, i, 0), rotation: new h.Euler(-Math.PI / 2, 0, 0), label: "TOP" },
|
|
1865
|
+
{ pos: new h.Vector3(0, -i, 0), rotation: new h.Euler(Math.PI / 2, 0, 0), label: "BOTTOM" }
|
|
1866
|
+
].forEach(({ pos: o, rotation: s, label: l }) => {
|
|
1867
|
+
const d = this.createFace(o, s, l);
|
|
1868
|
+
t.add(d);
|
|
1869
|
+
});
|
|
1870
|
+
}
|
|
1871
|
+
createAxis(t) {
|
|
1872
|
+
const { color: i, direction: o, length: s, origin: l, lineWidth: d, label: u } = t, p = new h.Group(), v = d / 2, g = new h.CylinderGeometry(v, v, s, 32), C = new h.MeshBasicMaterial({ color: i }), P = new h.Mesh(g, C);
|
|
1873
|
+
if (P.position.copy(l).add(o.clone().multiplyScalar(s / 2)), !o.equals(new h.Vector3(0, 1, 0))) {
|
|
1874
|
+
const Z = new h.Vector3(0, 1, 0).cross(o).normalize(), U = Math.acos(new h.Vector3(0, 1, 0).dot(o));
|
|
1875
|
+
P.setRotationFromAxisAngle(Z, U);
|
|
1876
|
+
}
|
|
1877
|
+
p.add(P);
|
|
1878
|
+
const I = this.createTextSprite(u, i);
|
|
1879
|
+
return I.position.copy(l).add(o.clone().multiplyScalar(s + 0.1)), p.add(I), p;
|
|
1880
|
+
}
|
|
1881
|
+
createCoordinateAxes() {
|
|
1882
|
+
const t = new h.Group(), i = S.CUBE_SIZE, o = S.EDGE_SECTION_SIZE, s = -(i / 2 + o / 2), l = (u) => {
|
|
1883
|
+
const p = new h.Vector3(1, 1, 1);
|
|
1884
|
+
return new h.Vector3(u, u, u).add(p.clone().normalize().negate().multiplyScalar(0.04));
|
|
1885
|
+
}, d = i + 1.25 * o;
|
|
1886
|
+
return [
|
|
1887
|
+
{
|
|
1888
|
+
color: 16711680,
|
|
1889
|
+
direction: new h.Vector3(1, 0, 0),
|
|
1890
|
+
length: d,
|
|
1891
|
+
origin: l(s),
|
|
1892
|
+
lineWidth: 0.04,
|
|
1893
|
+
// Increased line thickness
|
|
1894
|
+
label: "X"
|
|
1895
|
+
},
|
|
1896
|
+
{
|
|
1897
|
+
color: 65280,
|
|
1898
|
+
direction: new h.Vector3(0, 1, 0),
|
|
1899
|
+
length: d,
|
|
1900
|
+
origin: l(s),
|
|
1901
|
+
lineWidth: 0.04,
|
|
1902
|
+
label: "Y"
|
|
1903
|
+
},
|
|
1904
|
+
{
|
|
1905
|
+
color: 255,
|
|
1906
|
+
direction: new h.Vector3(0, 0, 1),
|
|
1907
|
+
length: d,
|
|
1908
|
+
origin: l(s),
|
|
1909
|
+
lineWidth: 0.04,
|
|
1910
|
+
label: "Z"
|
|
1911
|
+
}
|
|
1912
|
+
].forEach((u) => {
|
|
1913
|
+
const p = this.createAxis(u);
|
|
1914
|
+
t.add(p);
|
|
1915
|
+
}), t;
|
|
1778
1916
|
}
|
|
1779
1917
|
create() {
|
|
1780
|
-
|
|
1918
|
+
const t = new h.Group();
|
|
1919
|
+
t.name = "Gizmo Group";
|
|
1920
|
+
const i = this.createWireframe();
|
|
1921
|
+
t.add(i), this.createEdges(t), this.createCorners(t), this.createFaces(t);
|
|
1922
|
+
const o = this.createCoordinateAxes();
|
|
1923
|
+
return t.add(o), t;
|
|
1924
|
+
}
|
|
1925
|
+
highlightObject(t) {
|
|
1926
|
+
if (this.hoveredObject !== t)
|
|
1927
|
+
if (this.hoveredObject && this.originalColor && this.hoveredObject.material.color.set(this.originalColor), t && t instanceof h.Mesh) {
|
|
1928
|
+
const i = t.material;
|
|
1929
|
+
this.hoveredObject = t, this.originalColor = i.color.clone(), i.color.set(11519973);
|
|
1930
|
+
} else
|
|
1931
|
+
this.hoveredObject = null, this.originalColor = null;
|
|
1932
|
+
}
|
|
1933
|
+
handleClick() {
|
|
1934
|
+
if (this.hoveredObject) {
|
|
1935
|
+
let t = new h.Vector3();
|
|
1936
|
+
t = this.hoveredObject.getWorldPosition(t).clone();
|
|
1937
|
+
const i = new h.Vector3(0, 0, 0), o = t.sub(i).normalize();
|
|
1938
|
+
this.hoveredObject.userData.vectorToCube = o;
|
|
1939
|
+
}
|
|
1781
1940
|
}
|
|
1782
1941
|
}
|
|
1783
|
-
class
|
|
1942
|
+
class xi {
|
|
1784
1943
|
constructor(t) {
|
|
1785
1944
|
this.onChangeMainControlsListener = () => {
|
|
1786
1945
|
}, this.onChangeGizmoControlsListener = () => {
|
|
1787
1946
|
}, this.animationId = 0;
|
|
1788
|
-
const { gizmoParams: i, mainParams:
|
|
1789
|
-
this.gizmoDiv = i.gizmoDiv, this.gizmoScene = i.gizmoScene, this.gizmoRenderer = i.gizmoRenderer, this.gizmoCamera = i.gizmoCamera, this.mainCamera =
|
|
1947
|
+
const { gizmoParams: i, mainParams: o, syncFunctions: s } = t;
|
|
1948
|
+
this.gizmoDiv = i.gizmoDiv, this.gizmoScene = i.gizmoScene, this.gizmoRenderer = i.gizmoRenderer, this.gizmoCamera = i.gizmoCamera, this.mainCamera = o.mainCamera, this.mainControls = o.mainControls, this.renderGizmo = o.renderGizmo, this.syncFunctions = s, this.gizmoControls = new _i(this.gizmoCamera, this.gizmoRenderer.domElement), this.initializeRenderer(), this.initializeScene(), this.initializeControls(), this.startAnimationLoop();
|
|
1790
1949
|
}
|
|
1791
1950
|
initializeRenderer() {
|
|
1792
|
-
this.gizmoRenderer.setPixelRatio(window.devicePixelRatio), this.gizmoRenderer.setSize(
|
|
1951
|
+
this.gizmoRenderer.setPixelRatio(window.devicePixelRatio), this.gizmoRenderer.setSize(this.gizmoDiv.clientWidth, this.gizmoDiv.clientHeight), this.gizmoDiv.appendChild(this.gizmoRenderer.domElement);
|
|
1793
1952
|
}
|
|
1794
1953
|
initializeScene() {
|
|
1795
1954
|
const t = new Mi().create();
|
|
1796
|
-
this.gizmoScene.add(t),
|
|
1955
|
+
t && this.gizmoScene.add(t), Di(this.gizmoScene);
|
|
1797
1956
|
}
|
|
1798
1957
|
initializeControls() {
|
|
1799
|
-
this.onChangeMainControlsListener = () => this.syncFunctions.syncGizmoCameraWithMain(this.gizmoCamera, this.mainCamera), this.mainControls.addEventListener("change", this.onChangeMainControlsListener), this.gizmoControls.enableZoom = !1, this.gizmoControls.update(), this.onChangeGizmoControlsListener = () => {
|
|
1800
|
-
this.syncFunctions.syncMainCameraWithGizmo(this.mainCamera, this.gizmoCamera), this.renderGizmo();
|
|
1958
|
+
this.onChangeMainControlsListener = () => this.syncFunctions.syncGizmoCameraWithMain(this.gizmoCamera, this.mainCamera), this.mainControls.addEventListener("change", this.onChangeMainControlsListener), this.gizmoControls.enableZoom = !1, this.gizmoControls.enablePan = !1, this.gizmoControls.rotateSpeed = 0.5, this.gizmoControls.update(), this.onChangeGizmoControlsListener = () => {
|
|
1959
|
+
this.syncFunctions.syncMainCameraWithGizmo(this.mainCamera, this.gizmoCamera, this.mainControls), this.renderGizmo();
|
|
1801
1960
|
}, this.gizmoControls.addEventListener("change", this.onChangeGizmoControlsListener);
|
|
1802
1961
|
}
|
|
1803
1962
|
startAnimationLoop() {
|
|
@@ -1812,48 +1971,94 @@ class Ci {
|
|
|
1812
1971
|
this.mainControls.removeEventListener("change", this.onChangeMainControlsListener), this.gizmoControls.removeEventListener("change", this.onChangeGizmoControlsListener), this.gizmoScene.clear(), cancelAnimationFrame(this.animationId);
|
|
1813
1972
|
}
|
|
1814
1973
|
}
|
|
1815
|
-
const
|
|
1816
|
-
const
|
|
1817
|
-
|
|
1818
|
-
}, [
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1974
|
+
const ji = ({ camera: n, controls: t, className: i, render: o }) => {
|
|
1975
|
+
const s = X(null), l = X(new h.Scene()).current, d = X(fi()).current, u = X(new h.PerspectiveCamera(50, 1, 0.1, 100)).current, p = X(null), [v, g] = Ke(!1), C = X(null), P = X(null), I = X(new h.Raycaster()).current, Z = X(new h.Vector2()).current, U = at(() => {
|
|
1976
|
+
d && (o(), d.render(l, u));
|
|
1977
|
+
}, [o, d, l, u]), J = (T, O, N, it) => {
|
|
1978
|
+
const dt = performance.now(), L = () => {
|
|
1979
|
+
const V = performance.now() - dt, G = Math.min(V / N, 1);
|
|
1980
|
+
n.position.lerpVectors(T, O, G), t == null || t.update(), it(), G < 1 && requestAnimationFrame(L);
|
|
1981
|
+
};
|
|
1982
|
+
requestAnimationFrame(L);
|
|
1983
|
+
}, k = at((T) => {
|
|
1984
|
+
if (!n || !t) return;
|
|
1985
|
+
const O = n.position.length(), N = T.clone().multiplyScalar(O);
|
|
1986
|
+
J(n.position.clone(), N, 400, U), n.lookAt(new h.Vector3(0, 0, 0)), n.up.set(0, 1, 0), t.target.set(0, 0, 0);
|
|
1987
|
+
}, [n, t, U]), w = at((T) => {
|
|
1988
|
+
if (!d) return;
|
|
1989
|
+
const O = d.domElement.getBoundingClientRect();
|
|
1990
|
+
Z.x = (T.clientX - O.left) / O.width * 2 - 1, Z.y = -((T.clientY - O.top) / O.height) * 2 + 1;
|
|
1991
|
+
}, [d, Z]), ht = at(() => {
|
|
1992
|
+
var T;
|
|
1993
|
+
if (!u || !l) return null;
|
|
1994
|
+
I.setFromCamera(Z, u);
|
|
1995
|
+
const O = I.intersectObjects(l.children, !0), N = ["Wireframe", ""];
|
|
1996
|
+
return ((T = O.find((it) => !N.includes(it.object.name))) == null ? void 0 : T.object) || null;
|
|
1997
|
+
}, [u, l, I, Z]), wt = at((T) => {
|
|
1998
|
+
const O = T == null ? void 0 : T.userData.gizmoCube;
|
|
1999
|
+
if (T && O) {
|
|
2000
|
+
O.handleClick();
|
|
2001
|
+
const N = O.vectorToCube;
|
|
2002
|
+
N && k(N);
|
|
2003
|
+
}
|
|
2004
|
+
}, [k]), lt = at((T) => {
|
|
2005
|
+
C.current = Date.now(), P.current = { x: T.clientX, y: T.clientY }, g(!1);
|
|
2006
|
+
}, []), ct = at((T) => {
|
|
2007
|
+
if (!p.current) return;
|
|
2008
|
+
w(T);
|
|
2009
|
+
const O = ht();
|
|
2010
|
+
if (O && O.userData.gizmoCube)
|
|
2011
|
+
O.userData.gizmoCube.highlightObject(O);
|
|
2012
|
+
else {
|
|
2013
|
+
const N = l.children[0];
|
|
2014
|
+
N && N.userData.gizmoCube && N.userData.gizmoCube.highlightObject(null);
|
|
2015
|
+
}
|
|
2016
|
+
U();
|
|
2017
|
+
}, [w, ht, l, U]), ut = at((T) => {
|
|
2018
|
+
const O = C.current ? Date.now() - C.current : 0;
|
|
2019
|
+
if (!v && O < 200) {
|
|
2020
|
+
w(T);
|
|
2021
|
+
const N = ht();
|
|
2022
|
+
wt(N);
|
|
2023
|
+
}
|
|
2024
|
+
C.current = null, P.current = null, g(!1);
|
|
2025
|
+
}, [v, w, ht, wt]);
|
|
2026
|
+
return Jt(() => {
|
|
2027
|
+
const T = s.current;
|
|
2028
|
+
if (!T || !n || !t || !d) return;
|
|
2029
|
+
p.current && p.current.dispose();
|
|
2030
|
+
const O = {
|
|
2031
|
+
gizmoDiv: T,
|
|
2032
|
+
gizmoScene: l,
|
|
2033
|
+
gizmoRenderer: d,
|
|
2034
|
+
gizmoCamera: u
|
|
2035
|
+
}, N = {
|
|
2036
|
+
mainCamera: n,
|
|
2037
|
+
mainControls: t,
|
|
2038
|
+
renderGizmo: U
|
|
2039
|
+
}, it = {
|
|
2040
|
+
syncGizmoCameraWithMain: Ue,
|
|
2041
|
+
syncMainCameraWithGizmo: di
|
|
1835
2042
|
};
|
|
1836
|
-
return
|
|
1837
|
-
gizmoParams:
|
|
1838
|
-
mainParams:
|
|
1839
|
-
syncFunctions:
|
|
1840
|
-
}), () => {
|
|
1841
|
-
|
|
2043
|
+
return p.current = new xi({
|
|
2044
|
+
gizmoParams: O,
|
|
2045
|
+
mainParams: N,
|
|
2046
|
+
syncFunctions: it
|
|
2047
|
+
}), T.addEventListener("mousedown", lt), T.addEventListener("mousemove", ct), T.addEventListener("mouseup", ut), () => {
|
|
2048
|
+
p.current && (p.current.dispose(), p.current = null), T.removeEventListener("mousedown", lt), T.removeEventListener("mousemove", ct), T.removeEventListener("mouseup", ut);
|
|
1842
2049
|
};
|
|
1843
|
-
}, [
|
|
1844
|
-
|
|
1845
|
-
}, [
|
|
1846
|
-
const b = Xe(() => "gizmo-default" + (t ? ` ${t}` : ""), [t]);
|
|
1847
|
-
return /* @__PURE__ */ hi.jsx(
|
|
2050
|
+
}, [n, t, U, ct, lt, ut]), Jt(() => {
|
|
2051
|
+
n && (Ue(u, n), U());
|
|
2052
|
+
}, [n, U]), /* @__PURE__ */ ui.jsx(
|
|
1848
2053
|
"div",
|
|
1849
2054
|
{
|
|
1850
|
-
className:
|
|
1851
|
-
ref:
|
|
2055
|
+
className: i ? `${i}` : "gizmo-default",
|
|
2056
|
+
ref: s
|
|
1852
2057
|
}
|
|
1853
2058
|
);
|
|
1854
|
-
},
|
|
1855
|
-
window.removeEventListener("resize", i),
|
|
1856
|
-
},
|
|
2059
|
+
}, Li = (n, t, i) => {
|
|
2060
|
+
window.removeEventListener("resize", i), n.current && n.current.removeChild(t.domElement);
|
|
2061
|
+
}, ki = 1, We = 12 * ki, ii = 1e3 / 50, He = { type: "change" }, Ae = { type: "start" }, oi = { type: "end" }, Qt = new Xe(), Ge = new $e(), Ai = Math.cos(70 * qe.DEG2RAD), Y = new z(), K = 2 * Math.PI, x = {
|
|
1857
2062
|
NONE: -1,
|
|
1858
2063
|
ROTATE: 0,
|
|
1859
2064
|
DOLLY: 1,
|
|
@@ -1862,10 +2067,10 @@ const Oi = ({ camera: o, className: t, controls: i, render: r }) => {
|
|
|
1862
2067
|
TOUCH_PAN: 4,
|
|
1863
2068
|
TOUCH_DOLLY_PAN: 5,
|
|
1864
2069
|
TOUCH_DOLLY_ROTATE: 6
|
|
1865
|
-
},
|
|
1866
|
-
class
|
|
2070
|
+
}, xe = 1e-6;
|
|
2071
|
+
class ni extends Qe {
|
|
1867
2072
|
constructor(t, i = null) {
|
|
1868
|
-
super(t, i), this.state =
|
|
2073
|
+
super(t, i), this.state = x.NONE, this.enabled = !0, this.target = new z(), this.cursor = new z(), 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: H.ROTATE, MIDDLE: H.DOLLY, RIGHT: H.PAN }, this.touches = { ONE: $.ROTATE, TWO: $.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this._lastPosition = new z(), this._lastQuaternion = new te(), this._lastTargetPosition = new z(), this._quat = new te().setFromUnitVectors(t.up, new z(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new ee(), this._sphericalDelta = new ee(), this._scale = 1, this._panOffset = new z(), this._rotateStart = new A(), this._rotateEnd = new A(), this._rotateDelta = new A(), this._panStart = new A(), this._panEnd = new A(), this._panDelta = new A(), this._dollyStart = new A(), this._dollyEnd = new A(), this._dollyDelta = new A(), this._dollyDirection = new z(), this._mouse = new A(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = Ni.bind(this), this._onPointerDown = Ii.bind(this), this._onPointerUp = zi.bind(this), this._onContextMenu = Hi.bind(this), this._onMouseWheel = Ui.bind(this), this._onKeyDown = Zi.bind(this), this._onTouchStart = Vi.bind(this), this._onTouchMove = Wi.bind(this), this._onMouseDown = Fi.bind(this), this._onMouseMove = Yi.bind(this), this._interceptControlDown = Gi.bind(this), this._interceptControlUp = Bi.bind(this), this.domElement !== null && this.connect(), this.update();
|
|
1869
2074
|
}
|
|
1870
2075
|
connect() {
|
|
1871
2076
|
this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointercancel", this._onPointerUp), this.domElement.addEventListener("contextmenu", this._onContextMenu), this.domElement.addEventListener("wheel", this._onMouseWheel, { passive: !1 }), this.domElement.getRootNode().addEventListener("keydown", this._interceptControlDown, { passive: !0, capture: !0 }), this.domElement.style.touchAction = "none";
|
|
@@ -1895,45 +2100,45 @@ class ei extends Be {
|
|
|
1895
2100
|
this.target0.copy(this.target), this.position0.copy(this.object.position), this.zoom0 = this.object.zoom;
|
|
1896
2101
|
}
|
|
1897
2102
|
reset() {
|
|
1898
|
-
this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(He), this.update(), this.state =
|
|
2103
|
+
this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(He), this.update(), this.state = x.NONE;
|
|
1899
2104
|
}
|
|
1900
2105
|
update(t = null) {
|
|
1901
2106
|
const i = this.object.position;
|
|
1902
|
-
|
|
1903
|
-
let
|
|
1904
|
-
isFinite(
|
|
1905
|
-
let
|
|
2107
|
+
Y.copy(i).sub(this.target), Y.applyQuaternion(this._quat), this._spherical.setFromVector3(Y), this.autoRotate && this.state === x.NONE && this._rotateLeft(this._getAutoRotationAngle(t)), this.enableDamping ? (this._spherical.theta += this._sphericalDelta.theta * this.dampingFactor, this._spherical.phi += this._sphericalDelta.phi * this.dampingFactor) : (this._spherical.theta += this._sphericalDelta.theta, this._spherical.phi += this._sphericalDelta.phi);
|
|
2108
|
+
let o = this.minAzimuthAngle, s = this.maxAzimuthAngle;
|
|
2109
|
+
isFinite(o) && isFinite(s) && (o < -Math.PI ? o += K : o > Math.PI && (o -= K), s < -Math.PI ? s += K : s > Math.PI && (s -= K), o <= s ? this._spherical.theta = Math.max(o, Math.min(s, this._spherical.theta)) : this._spherical.theta = this._spherical.theta > (o + s) / 2 ? Math.max(o, this._spherical.theta) : Math.min(s, this._spherical.theta)), this._spherical.phi = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, this._spherical.phi)), this._spherical.makeSafe(), this.enableDamping === !0 ? this.target.addScaledVector(this._panOffset, this.dampingFactor) : this.target.add(this._panOffset), this.target.sub(this.cursor), this.target.clampLength(this.minTargetRadius, this.maxTargetRadius), this.target.add(this.cursor);
|
|
2110
|
+
let l = !1;
|
|
1906
2111
|
if (this.zoomToCursor && this._performCursorZoom || this.object.isOrthographicCamera)
|
|
1907
2112
|
this._spherical.radius = this._clampDistance(this._spherical.radius);
|
|
1908
2113
|
else {
|
|
1909
|
-
const
|
|
1910
|
-
this._spherical.radius = this._clampDistance(this._spherical.radius * this._scale),
|
|
2114
|
+
const d = this._spherical.radius;
|
|
2115
|
+
this._spherical.radius = this._clampDistance(this._spherical.radius * this._scale), l = d != this._spherical.radius;
|
|
1911
2116
|
}
|
|
1912
|
-
if (
|
|
1913
|
-
let
|
|
2117
|
+
if (Y.setFromSpherical(this._spherical), Y.applyQuaternion(this._quatInverse), i.copy(this.target).add(Y), this.object.lookAt(this.target), this.enableDamping === !0 ? (this._sphericalDelta.theta *= 1 - this.dampingFactor, this._sphericalDelta.phi *= 1 - this.dampingFactor, this._panOffset.multiplyScalar(1 - this.dampingFactor)) : (this._sphericalDelta.set(0, 0, 0), this._panOffset.set(0, 0, 0)), this.zoomToCursor && this._performCursorZoom) {
|
|
2118
|
+
let d = null;
|
|
1914
2119
|
if (this.object.isPerspectiveCamera) {
|
|
1915
|
-
const
|
|
1916
|
-
|
|
1917
|
-
const
|
|
1918
|
-
this.object.position.addScaledVector(this._dollyDirection,
|
|
2120
|
+
const u = Y.length();
|
|
2121
|
+
d = this._clampDistance(u * this._scale);
|
|
2122
|
+
const p = u - d;
|
|
2123
|
+
this.object.position.addScaledVector(this._dollyDirection, p), this.object.updateMatrixWorld(), l = !!p;
|
|
1919
2124
|
} else if (this.object.isOrthographicCamera) {
|
|
1920
|
-
const
|
|
1921
|
-
|
|
1922
|
-
const
|
|
1923
|
-
this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), this.object.updateProjectionMatrix(),
|
|
1924
|
-
const
|
|
1925
|
-
|
|
2125
|
+
const u = new z(this._mouse.x, this._mouse.y, 0);
|
|
2126
|
+
u.unproject(this.object);
|
|
2127
|
+
const p = this.object.zoom;
|
|
2128
|
+
this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), this.object.updateProjectionMatrix(), l = p !== this.object.zoom;
|
|
2129
|
+
const v = new z(this._mouse.x, this._mouse.y, 0);
|
|
2130
|
+
v.unproject(this.object), this.object.position.sub(v).add(u), this.object.updateMatrixWorld(), d = Y.length();
|
|
1926
2131
|
} else
|
|
1927
2132
|
console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), this.zoomToCursor = !1;
|
|
1928
|
-
|
|
2133
|
+
d !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(d).add(this.object.position) : (Qt.origin.copy(this.object.position), Qt.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(Qt.direction)) < Ai ? this.object.lookAt(this.target) : (Ge.setFromNormalAndCoplanarPoint(this.object.up, this.target), Qt.intersectPlane(Ge, this.target))));
|
|
1929
2134
|
} else if (this.object.isOrthographicCamera) {
|
|
1930
|
-
const
|
|
1931
|
-
this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)),
|
|
2135
|
+
const d = this.object.zoom;
|
|
2136
|
+
this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), d !== this.object.zoom && (this.object.updateProjectionMatrix(), l = !0);
|
|
1932
2137
|
}
|
|
1933
|
-
return this._scale = 1, this._performCursorZoom = !1,
|
|
2138
|
+
return this._scale = 1, this._performCursorZoom = !1, l || this._lastPosition.distanceToSquared(this.object.position) > xe || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > xe || this._lastTargetPosition.distanceToSquared(this.target) > xe ? (this.dispatchEvent(He), this._lastPosition.copy(this.object.position), this._lastQuaternion.copy(this.object.quaternion), this._lastTargetPosition.copy(this.target), !0) : !1;
|
|
1934
2139
|
}
|
|
1935
2140
|
_getAutoRotationAngle(t) {
|
|
1936
|
-
return t !== null ?
|
|
2141
|
+
return t !== null ? K / 60 * this.autoRotateSpeed * t : K / 60 / 60 * this.autoRotateSpeed;
|
|
1937
2142
|
}
|
|
1938
2143
|
_getZoomScale(t) {
|
|
1939
2144
|
const i = Math.abs(t * 0.01);
|
|
@@ -1946,20 +2151,20 @@ class ei extends Be {
|
|
|
1946
2151
|
this._sphericalDelta.phi -= t;
|
|
1947
2152
|
}
|
|
1948
2153
|
_panLeft(t, i) {
|
|
1949
|
-
|
|
2154
|
+
Y.setFromMatrixColumn(i, 0), Y.multiplyScalar(-t), this._panOffset.add(Y);
|
|
1950
2155
|
}
|
|
1951
2156
|
_panUp(t, i) {
|
|
1952
|
-
this.screenSpacePanning === !0 ?
|
|
2157
|
+
this.screenSpacePanning === !0 ? Y.setFromMatrixColumn(i, 1) : (Y.setFromMatrixColumn(i, 0), Y.crossVectors(this.object.up, Y)), Y.multiplyScalar(t), this._panOffset.add(Y);
|
|
1953
2158
|
}
|
|
1954
2159
|
// deltaX and deltaY are in pixels; right and down are positive
|
|
1955
2160
|
_pan(t, i) {
|
|
1956
|
-
const
|
|
2161
|
+
const o = this.domElement;
|
|
1957
2162
|
if (this.object.isPerspectiveCamera) {
|
|
1958
|
-
const
|
|
1959
|
-
|
|
1960
|
-
let
|
|
1961
|
-
|
|
1962
|
-
} else this.object.isOrthographicCamera ? (this._panLeft(t * (this.object.right - this.object.left) / this.object.zoom /
|
|
2163
|
+
const s = this.object.position;
|
|
2164
|
+
Y.copy(s).sub(this.target);
|
|
2165
|
+
let l = Y.length();
|
|
2166
|
+
l *= Math.tan(this.object.fov / 2 * Math.PI / 180), this._panLeft(2 * t * l / o.clientHeight, this.object.matrix), this._panUp(2 * i * l / o.clientHeight, this.object.matrix);
|
|
2167
|
+
} else this.object.isOrthographicCamera ? (this._panLeft(t * (this.object.right - this.object.left) / this.object.zoom / o.clientWidth, this.object.matrix), this._panUp(i * (this.object.top - this.object.bottom) / this.object.zoom / o.clientHeight, this.object.matrix)) : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."), this.enablePan = !1);
|
|
1963
2168
|
}
|
|
1964
2169
|
_dollyOut(t) {
|
|
1965
2170
|
this.object.isPerspectiveCamera || this.object.isOrthographicCamera ? this._scale /= t : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), this.enableZoom = !1);
|
|
@@ -1971,8 +2176,8 @@ class ei extends Be {
|
|
|
1971
2176
|
if (!this.zoomToCursor)
|
|
1972
2177
|
return;
|
|
1973
2178
|
this._performCursorZoom = !0;
|
|
1974
|
-
const
|
|
1975
|
-
this._mouse.x =
|
|
2179
|
+
const o = this.domElement.getBoundingClientRect(), s = t - o.left, l = i - o.top, d = o.width, u = o.height;
|
|
2180
|
+
this._mouse.x = s / d * 2 - 1, this._mouse.y = -(l / u) * 2 + 1, this._dollyDirection.set(this._mouse.x, this._mouse.y, 1).unproject(this.object).sub(this.object.position).normalize();
|
|
1976
2181
|
}
|
|
1977
2182
|
_clampDistance(t) {
|
|
1978
2183
|
return Math.max(this.minDistance, Math.min(this.maxDistance, t));
|
|
@@ -1992,7 +2197,7 @@ class ei extends Be {
|
|
|
1992
2197
|
_handleMouseMoveRotate(t) {
|
|
1993
2198
|
this._rotateEnd.set(t.clientX, t.clientY), this._rotateDelta.subVectors(this._rotateEnd, this._rotateStart).multiplyScalar(this.rotateSpeed);
|
|
1994
2199
|
const i = this.domElement;
|
|
1995
|
-
this._rotateLeft(
|
|
2200
|
+
this._rotateLeft(K * this._rotateDelta.x / i.clientHeight), this._rotateUp(K * this._rotateDelta.y / i.clientHeight), this._rotateStart.copy(this._rotateEnd), this.update();
|
|
1996
2201
|
}
|
|
1997
2202
|
_handleMouseMoveDolly(t) {
|
|
1998
2203
|
this._dollyEnd.set(t.clientX, t.clientY), this._dollyDelta.subVectors(this._dollyEnd, this._dollyStart), this._dollyDelta.y > 0 ? this._dollyOut(this._getZoomScale(this._dollyDelta.y)) : this._dollyDelta.y < 0 && this._dollyIn(this._getZoomScale(this._dollyDelta.y)), this._dollyStart.copy(this._dollyEnd), this.update();
|
|
@@ -2007,16 +2212,16 @@ class ei extends Be {
|
|
|
2007
2212
|
let i = !1;
|
|
2008
2213
|
switch (t.code) {
|
|
2009
2214
|
case this.keys.UP:
|
|
2010
|
-
t.ctrlKey || t.metaKey || t.shiftKey ? this._rotateUp(
|
|
2215
|
+
t.ctrlKey || t.metaKey || t.shiftKey ? this._rotateUp(K * this.rotateSpeed / this.domElement.clientHeight) : this._pan(0, this.keyPanSpeed), i = !0;
|
|
2011
2216
|
break;
|
|
2012
2217
|
case this.keys.BOTTOM:
|
|
2013
|
-
t.ctrlKey || t.metaKey || t.shiftKey ? this._rotateUp(-
|
|
2218
|
+
t.ctrlKey || t.metaKey || t.shiftKey ? this._rotateUp(-K * this.rotateSpeed / this.domElement.clientHeight) : this._pan(0, -this.keyPanSpeed), i = !0;
|
|
2014
2219
|
break;
|
|
2015
2220
|
case this.keys.LEFT:
|
|
2016
|
-
t.ctrlKey || t.metaKey || t.shiftKey ? this._rotateLeft(
|
|
2221
|
+
t.ctrlKey || t.metaKey || t.shiftKey ? this._rotateLeft(K * this.rotateSpeed / this.domElement.clientHeight) : this._pan(this.keyPanSpeed, 0), i = !0;
|
|
2017
2222
|
break;
|
|
2018
2223
|
case this.keys.RIGHT:
|
|
2019
|
-
t.ctrlKey || t.metaKey || t.shiftKey ? this._rotateLeft(-
|
|
2224
|
+
t.ctrlKey || t.metaKey || t.shiftKey ? this._rotateLeft(-K * this.rotateSpeed / this.domElement.clientHeight) : this._pan(-this.keyPanSpeed, 0), i = !0;
|
|
2020
2225
|
break;
|
|
2021
2226
|
}
|
|
2022
2227
|
i && (t.preventDefault(), this.update());
|
|
@@ -2025,21 +2230,21 @@ class ei extends Be {
|
|
|
2025
2230
|
if (this._pointers.length === 1)
|
|
2026
2231
|
this._rotateStart.set(t.pageX, t.pageY);
|
|
2027
2232
|
else {
|
|
2028
|
-
const i = this._getSecondPointerPosition(t),
|
|
2029
|
-
this._rotateStart.set(
|
|
2233
|
+
const i = this._getSecondPointerPosition(t), o = 0.5 * (t.pageX + i.x), s = 0.5 * (t.pageY + i.y);
|
|
2234
|
+
this._rotateStart.set(o, s);
|
|
2030
2235
|
}
|
|
2031
2236
|
}
|
|
2032
2237
|
_handleTouchStartPan(t) {
|
|
2033
2238
|
if (this._pointers.length === 1)
|
|
2034
2239
|
this._panStart.set(t.pageX, t.pageY);
|
|
2035
2240
|
else {
|
|
2036
|
-
const i = this._getSecondPointerPosition(t),
|
|
2037
|
-
this._panStart.set(
|
|
2241
|
+
const i = this._getSecondPointerPosition(t), o = 0.5 * (t.pageX + i.x), s = 0.5 * (t.pageY + i.y);
|
|
2242
|
+
this._panStart.set(o, s);
|
|
2038
2243
|
}
|
|
2039
2244
|
}
|
|
2040
2245
|
_handleTouchStartDolly(t) {
|
|
2041
|
-
const i = this._getSecondPointerPosition(t),
|
|
2042
|
-
this._dollyStart.set(0,
|
|
2246
|
+
const i = this._getSecondPointerPosition(t), o = t.pageX - i.x, s = t.pageY - i.y, l = Math.sqrt(o * o + s * s);
|
|
2247
|
+
this._dollyStart.set(0, l);
|
|
2043
2248
|
}
|
|
2044
2249
|
_handleTouchStartDollyPan(t) {
|
|
2045
2250
|
this.enableZoom && this._handleTouchStartDolly(t), this.enablePan && this._handleTouchStartPan(t);
|
|
@@ -2051,27 +2256,27 @@ class ei extends Be {
|
|
|
2051
2256
|
if (this._pointers.length == 1)
|
|
2052
2257
|
this._rotateEnd.set(t.pageX, t.pageY);
|
|
2053
2258
|
else {
|
|
2054
|
-
const
|
|
2055
|
-
this._rotateEnd.set(
|
|
2259
|
+
const o = this._getSecondPointerPosition(t), s = 0.5 * (t.pageX + o.x), l = 0.5 * (t.pageY + o.y);
|
|
2260
|
+
this._rotateEnd.set(s, l);
|
|
2056
2261
|
}
|
|
2057
2262
|
this._rotateDelta.subVectors(this._rotateEnd, this._rotateStart).multiplyScalar(this.rotateSpeed);
|
|
2058
2263
|
const i = this.domElement;
|
|
2059
|
-
this._rotateLeft(
|
|
2264
|
+
this._rotateLeft(K * this._rotateDelta.x / i.clientHeight), this._rotateUp(K * this._rotateDelta.y / i.clientHeight), this._rotateStart.copy(this._rotateEnd);
|
|
2060
2265
|
}
|
|
2061
2266
|
_handleTouchMovePan(t) {
|
|
2062
2267
|
if (this._pointers.length === 1)
|
|
2063
2268
|
this._panEnd.set(t.pageX, t.pageY);
|
|
2064
2269
|
else {
|
|
2065
|
-
const i = this._getSecondPointerPosition(t),
|
|
2066
|
-
this._panEnd.set(
|
|
2270
|
+
const i = this._getSecondPointerPosition(t), o = 0.5 * (t.pageX + i.x), s = 0.5 * (t.pageY + i.y);
|
|
2271
|
+
this._panEnd.set(o, s);
|
|
2067
2272
|
}
|
|
2068
2273
|
this._panDelta.subVectors(this._panEnd, this._panStart).multiplyScalar(this.panSpeed), this._pan(this._panDelta.x, this._panDelta.y), this._panStart.copy(this._panEnd);
|
|
2069
2274
|
}
|
|
2070
2275
|
_handleTouchMoveDolly(t) {
|
|
2071
|
-
const i = this._getSecondPointerPosition(t),
|
|
2072
|
-
this._dollyEnd.set(0,
|
|
2073
|
-
const
|
|
2074
|
-
this._updateZoomParameters(
|
|
2276
|
+
const i = this._getSecondPointerPosition(t), o = t.pageX - i.x, s = t.pageY - i.y, l = Math.sqrt(o * o + s * s);
|
|
2277
|
+
this._dollyEnd.set(0, l), this._dollyDelta.set(0, Math.pow(this._dollyEnd.y / this._dollyStart.y, this.zoomSpeed)), this._dollyOut(this._dollyDelta.y), this._dollyStart.copy(this._dollyEnd);
|
|
2278
|
+
const d = (t.pageX + i.x) * 0.5, u = (t.pageY + i.y) * 0.5;
|
|
2279
|
+
this._updateZoomParameters(d, u);
|
|
2075
2280
|
}
|
|
2076
2281
|
_handleTouchMoveDollyPan(t) {
|
|
2077
2282
|
this.enableZoom && this._handleTouchMoveDolly(t), this.enablePan && this._handleTouchMovePan(t);
|
|
@@ -2098,7 +2303,7 @@ class ei extends Be {
|
|
|
2098
2303
|
}
|
|
2099
2304
|
_trackPointer(t) {
|
|
2100
2305
|
let i = this._pointerPositions[t.pointerId];
|
|
2101
|
-
i === void 0 && (i = new
|
|
2306
|
+
i === void 0 && (i = new A(), this._pointerPositions[t.pointerId] = i), i.set(t.pageX, t.pageY);
|
|
2102
2307
|
}
|
|
2103
2308
|
_getSecondPointerPosition(t) {
|
|
2104
2309
|
const i = t.pointerId === this._pointers[0] ? this._pointers[1] : this._pointers[0];
|
|
@@ -2106,32 +2311,32 @@ class ei extends Be {
|
|
|
2106
2311
|
}
|
|
2107
2312
|
//
|
|
2108
2313
|
_customWheelEvent(t) {
|
|
2109
|
-
const i = t.deltaMode,
|
|
2314
|
+
const i = t.deltaMode, o = {
|
|
2110
2315
|
clientX: t.clientX,
|
|
2111
2316
|
clientY: t.clientY,
|
|
2112
2317
|
deltaY: t.deltaY
|
|
2113
2318
|
};
|
|
2114
2319
|
switch (i) {
|
|
2115
2320
|
case 1:
|
|
2116
|
-
|
|
2321
|
+
o.deltaY *= 16;
|
|
2117
2322
|
break;
|
|
2118
2323
|
case 2:
|
|
2119
|
-
|
|
2324
|
+
o.deltaY *= 100;
|
|
2120
2325
|
break;
|
|
2121
2326
|
}
|
|
2122
|
-
return t.ctrlKey && !this._controlActive && (
|
|
2327
|
+
return t.ctrlKey && !this._controlActive && (o.deltaY *= 10), o;
|
|
2123
2328
|
}
|
|
2124
2329
|
}
|
|
2125
|
-
function
|
|
2126
|
-
this.enabled !== !1 && (this._pointers.length === 0 && (this.domElement.setPointerCapture(
|
|
2330
|
+
function Ii(n) {
|
|
2331
|
+
this.enabled !== !1 && (this._pointers.length === 0 && (this.domElement.setPointerCapture(n.pointerId), this.domElement.addEventListener("pointermove", this._onPointerMove), this.domElement.addEventListener("pointerup", this._onPointerUp)), !this._isTrackingPointer(n) && (this._addPointer(n), n.pointerType === "touch" ? this._onTouchStart(n) : this._onMouseDown(n)));
|
|
2127
2332
|
}
|
|
2128
|
-
function
|
|
2129
|
-
this.enabled !== !1 && (
|
|
2333
|
+
function Ni(n) {
|
|
2334
|
+
this.enabled !== !1 && (n.pointerType === "touch" ? this._onTouchMove(n) : this._onMouseMove(n));
|
|
2130
2335
|
}
|
|
2131
|
-
function zi(
|
|
2132
|
-
switch (this._removePointer(
|
|
2336
|
+
function zi(n) {
|
|
2337
|
+
switch (this._removePointer(n), this._pointers.length) {
|
|
2133
2338
|
case 0:
|
|
2134
|
-
this.domElement.releasePointerCapture(
|
|
2339
|
+
this.domElement.releasePointerCapture(n.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(oi), this.state = x.NONE;
|
|
2135
2340
|
break;
|
|
2136
2341
|
case 1:
|
|
2137
2342
|
const t = this._pointers[0], i = this._pointerPositions[t];
|
|
@@ -2139,9 +2344,9 @@ function zi(o) {
|
|
|
2139
2344
|
break;
|
|
2140
2345
|
}
|
|
2141
2346
|
}
|
|
2142
|
-
function
|
|
2347
|
+
function Fi(n) {
|
|
2143
2348
|
let t;
|
|
2144
|
-
switch (
|
|
2349
|
+
switch (n.button) {
|
|
2145
2350
|
case 0:
|
|
2146
2351
|
t = this.mouseButtons.LEFT;
|
|
2147
2352
|
break;
|
|
@@ -2155,269 +2360,269 @@ function Ni(o) {
|
|
|
2155
2360
|
t = -1;
|
|
2156
2361
|
}
|
|
2157
2362
|
switch (t) {
|
|
2158
|
-
case
|
|
2363
|
+
case H.DOLLY:
|
|
2159
2364
|
if (this.enableZoom === !1) return;
|
|
2160
|
-
this._handleMouseDownDolly(
|
|
2365
|
+
this._handleMouseDownDolly(n), this.state = x.DOLLY;
|
|
2161
2366
|
break;
|
|
2162
|
-
case
|
|
2163
|
-
if (
|
|
2367
|
+
case H.ROTATE:
|
|
2368
|
+
if (n.ctrlKey || n.metaKey || n.shiftKey) {
|
|
2164
2369
|
if (this.enablePan === !1) return;
|
|
2165
|
-
this._handleMouseDownPan(
|
|
2370
|
+
this._handleMouseDownPan(n), this.state = x.PAN;
|
|
2166
2371
|
} else {
|
|
2167
2372
|
if (this.enableRotate === !1) return;
|
|
2168
|
-
this._handleMouseDownRotate(
|
|
2373
|
+
this._handleMouseDownRotate(n), this.state = x.ROTATE;
|
|
2169
2374
|
}
|
|
2170
2375
|
break;
|
|
2171
|
-
case
|
|
2172
|
-
if (
|
|
2376
|
+
case H.PAN:
|
|
2377
|
+
if (n.ctrlKey || n.metaKey || n.shiftKey) {
|
|
2173
2378
|
if (this.enableRotate === !1) return;
|
|
2174
|
-
this._handleMouseDownRotate(
|
|
2379
|
+
this._handleMouseDownRotate(n), this.state = x.ROTATE;
|
|
2175
2380
|
} else {
|
|
2176
2381
|
if (this.enablePan === !1) return;
|
|
2177
|
-
this._handleMouseDownPan(
|
|
2382
|
+
this._handleMouseDownPan(n), this.state = x.PAN;
|
|
2178
2383
|
}
|
|
2179
2384
|
break;
|
|
2180
2385
|
default:
|
|
2181
|
-
this.state =
|
|
2386
|
+
this.state = x.NONE;
|
|
2182
2387
|
}
|
|
2183
|
-
this.state !==
|
|
2388
|
+
this.state !== x.NONE && this.dispatchEvent(Ae);
|
|
2184
2389
|
}
|
|
2185
|
-
function
|
|
2390
|
+
function Yi(n) {
|
|
2186
2391
|
switch (this.state) {
|
|
2187
|
-
case
|
|
2392
|
+
case x.ROTATE:
|
|
2188
2393
|
if (this.enableRotate === !1) return;
|
|
2189
|
-
this._handleMouseMoveRotate(
|
|
2394
|
+
this._handleMouseMoveRotate(n);
|
|
2190
2395
|
break;
|
|
2191
|
-
case
|
|
2396
|
+
case x.DOLLY:
|
|
2192
2397
|
if (this.enableZoom === !1) return;
|
|
2193
|
-
this._handleMouseMoveDolly(
|
|
2398
|
+
this._handleMouseMoveDolly(n);
|
|
2194
2399
|
break;
|
|
2195
|
-
case
|
|
2400
|
+
case x.PAN:
|
|
2196
2401
|
if (this.enablePan === !1) return;
|
|
2197
|
-
this._handleMouseMovePan(
|
|
2402
|
+
this._handleMouseMovePan(n);
|
|
2198
2403
|
break;
|
|
2199
2404
|
}
|
|
2200
2405
|
}
|
|
2201
|
-
function
|
|
2202
|
-
this.enabled === !1 || this.enableZoom === !1 || this.state !==
|
|
2406
|
+
function Ui(n) {
|
|
2407
|
+
this.enabled === !1 || this.enableZoom === !1 || this.state !== x.NONE || (n.preventDefault(), this.dispatchEvent(Ae), this._handleMouseWheel(this._customWheelEvent(n)), this.dispatchEvent(oi));
|
|
2203
2408
|
}
|
|
2204
|
-
function
|
|
2205
|
-
this.enabled === !1 || this.enablePan === !1 || this._handleKeyDown(
|
|
2409
|
+
function Zi(n) {
|
|
2410
|
+
this.enabled === !1 || this.enablePan === !1 || this._handleKeyDown(n);
|
|
2206
2411
|
}
|
|
2207
|
-
function
|
|
2208
|
-
switch (this._trackPointer(
|
|
2412
|
+
function Vi(n) {
|
|
2413
|
+
switch (this._trackPointer(n), this._pointers.length) {
|
|
2209
2414
|
case 1:
|
|
2210
2415
|
switch (this.touches.ONE) {
|
|
2211
|
-
case
|
|
2416
|
+
case $.ROTATE:
|
|
2212
2417
|
if (this.enableRotate === !1) return;
|
|
2213
|
-
this._handleTouchStartRotate(
|
|
2418
|
+
this._handleTouchStartRotate(n), this.state = x.TOUCH_ROTATE;
|
|
2214
2419
|
break;
|
|
2215
|
-
case
|
|
2420
|
+
case $.PAN:
|
|
2216
2421
|
if (this.enablePan === !1) return;
|
|
2217
|
-
this._handleTouchStartPan(
|
|
2422
|
+
this._handleTouchStartPan(n), this.state = x.TOUCH_PAN;
|
|
2218
2423
|
break;
|
|
2219
2424
|
default:
|
|
2220
|
-
this.state =
|
|
2425
|
+
this.state = x.NONE;
|
|
2221
2426
|
}
|
|
2222
2427
|
break;
|
|
2223
2428
|
case 2:
|
|
2224
2429
|
switch (this.touches.TWO) {
|
|
2225
|
-
case
|
|
2430
|
+
case $.DOLLY_PAN:
|
|
2226
2431
|
if (this.enableZoom === !1 && this.enablePan === !1) return;
|
|
2227
|
-
this._handleTouchStartDollyPan(
|
|
2432
|
+
this._handleTouchStartDollyPan(n), this.state = x.TOUCH_DOLLY_PAN;
|
|
2228
2433
|
break;
|
|
2229
|
-
case
|
|
2434
|
+
case $.DOLLY_ROTATE:
|
|
2230
2435
|
if (this.enableZoom === !1 && this.enableRotate === !1) return;
|
|
2231
|
-
this._handleTouchStartDollyRotate(
|
|
2436
|
+
this._handleTouchStartDollyRotate(n), this.state = x.TOUCH_DOLLY_ROTATE;
|
|
2232
2437
|
break;
|
|
2233
2438
|
default:
|
|
2234
|
-
this.state =
|
|
2439
|
+
this.state = x.NONE;
|
|
2235
2440
|
}
|
|
2236
2441
|
break;
|
|
2237
2442
|
default:
|
|
2238
|
-
this.state =
|
|
2443
|
+
this.state = x.NONE;
|
|
2239
2444
|
}
|
|
2240
|
-
this.state !==
|
|
2445
|
+
this.state !== x.NONE && this.dispatchEvent(Ae);
|
|
2241
2446
|
}
|
|
2242
|
-
function
|
|
2243
|
-
switch (this._trackPointer(
|
|
2244
|
-
case
|
|
2447
|
+
function Wi(n) {
|
|
2448
|
+
switch (this._trackPointer(n), this.state) {
|
|
2449
|
+
case x.TOUCH_ROTATE:
|
|
2245
2450
|
if (this.enableRotate === !1) return;
|
|
2246
|
-
this._handleTouchMoveRotate(
|
|
2451
|
+
this._handleTouchMoveRotate(n), this.update();
|
|
2247
2452
|
break;
|
|
2248
|
-
case
|
|
2453
|
+
case x.TOUCH_PAN:
|
|
2249
2454
|
if (this.enablePan === !1) return;
|
|
2250
|
-
this._handleTouchMovePan(
|
|
2455
|
+
this._handleTouchMovePan(n), this.update();
|
|
2251
2456
|
break;
|
|
2252
|
-
case
|
|
2457
|
+
case x.TOUCH_DOLLY_PAN:
|
|
2253
2458
|
if (this.enableZoom === !1 && this.enablePan === !1) return;
|
|
2254
|
-
this._handleTouchMoveDollyPan(
|
|
2459
|
+
this._handleTouchMoveDollyPan(n), this.update();
|
|
2255
2460
|
break;
|
|
2256
|
-
case
|
|
2461
|
+
case x.TOUCH_DOLLY_ROTATE:
|
|
2257
2462
|
if (this.enableZoom === !1 && this.enableRotate === !1) return;
|
|
2258
|
-
this._handleTouchMoveDollyRotate(
|
|
2463
|
+
this._handleTouchMoveDollyRotate(n), this.update();
|
|
2259
2464
|
break;
|
|
2260
2465
|
default:
|
|
2261
|
-
this.state =
|
|
2466
|
+
this.state = x.NONE;
|
|
2262
2467
|
}
|
|
2263
2468
|
}
|
|
2264
|
-
function
|
|
2265
|
-
this.enabled !== !1 &&
|
|
2469
|
+
function Hi(n) {
|
|
2470
|
+
this.enabled !== !1 && n.preventDefault();
|
|
2266
2471
|
}
|
|
2267
|
-
function
|
|
2268
|
-
|
|
2472
|
+
function Gi(n) {
|
|
2473
|
+
n.key === "Control" && (this._controlActive = !0, this.domElement.getRootNode().addEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
|
|
2269
2474
|
}
|
|
2270
|
-
function
|
|
2271
|
-
|
|
2475
|
+
function Bi(n) {
|
|
2476
|
+
n.key === "Control" && (this._controlActive = !1, this.domElement.getRootNode().removeEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
|
|
2272
2477
|
}
|
|
2273
|
-
class
|
|
2478
|
+
class Ki extends ni {
|
|
2274
2479
|
constructor(t, i) {
|
|
2275
|
-
super(t, i), this.screenSpacePanning = !1, this.mouseButtons = { LEFT:
|
|
2480
|
+
super(t, i), this.screenSpacePanning = !1, this.mouseButtons = { LEFT: H.PAN, MIDDLE: H.DOLLY, RIGHT: H.ROTATE }, this.touches = { ONE: $.PAN, TWO: $.DOLLY_ROTATE };
|
|
2276
2481
|
}
|
|
2277
2482
|
}
|
|
2278
|
-
class
|
|
2483
|
+
class Xi {
|
|
2279
2484
|
constructor(t) {
|
|
2280
|
-
this.object = t, this.boundingBox = new
|
|
2485
|
+
this.object = t, this.boundingBox = new h.Box3().setFromObject(this.object);
|
|
2281
2486
|
}
|
|
2282
2487
|
alignToFloor() {
|
|
2283
2488
|
const t = this.calculateFloorOffset();
|
|
2284
2489
|
this.applyOffset(t);
|
|
2285
2490
|
}
|
|
2286
2491
|
calculateFloorOffset() {
|
|
2287
|
-
const t = this.boundingBox.min.y, i = this.boundingBox.max.y - t,
|
|
2288
|
-
return i > 0 ?
|
|
2492
|
+
const t = this.boundingBox.min.y, i = this.boundingBox.max.y - t, o = new h.Vector3();
|
|
2493
|
+
return i > 0 ? o.y = -t : o.y = 0, o;
|
|
2289
2494
|
}
|
|
2290
2495
|
applyOffset(t) {
|
|
2291
2496
|
this.object.position.add(t);
|
|
2292
2497
|
}
|
|
2293
2498
|
}
|
|
2294
|
-
var
|
|
2295
|
-
const
|
|
2499
|
+
var Ie = /* @__PURE__ */ ((n) => (n.MapsControls = "MapControls", n.OrbitControls = "OrbitControls", n))(Ie || {});
|
|
2500
|
+
const ri = (n, t) => {
|
|
2296
2501
|
let i;
|
|
2297
|
-
return (...
|
|
2298
|
-
i || (
|
|
2502
|
+
return (...o) => {
|
|
2503
|
+
i || (n(...o), i = !0, setTimeout(() => {
|
|
2299
2504
|
i = !1;
|
|
2300
2505
|
}, t));
|
|
2301
2506
|
};
|
|
2302
2507
|
};
|
|
2303
|
-
class
|
|
2304
|
-
constructor(t, i,
|
|
2305
|
-
this.position = t, this.size = i, this.color =
|
|
2508
|
+
class $i {
|
|
2509
|
+
constructor(t, i, o) {
|
|
2510
|
+
this.position = t, this.size = i, this.color = o;
|
|
2306
2511
|
}
|
|
2307
2512
|
createMesh() {
|
|
2308
|
-
const t = new
|
|
2309
|
-
return
|
|
2513
|
+
const t = new h.CircleGeometry(this.size, 6), i = new h.EdgesGeometry(t), o = new h.LineBasicMaterial({ color: this.color }), s = new h.LineSegments(i, o);
|
|
2514
|
+
return s.position.set(this.position.x, this.position.y, this.position.z), s.rotation.x = Math.PI / 2, s.rotation.z = Math.PI / 6, s;
|
|
2310
2515
|
}
|
|
2311
2516
|
}
|
|
2312
|
-
class
|
|
2313
|
-
constructor(t, i,
|
|
2314
|
-
this.radius = t, this.tileSize = i, this.color =
|
|
2517
|
+
class qi {
|
|
2518
|
+
constructor(t, i, o) {
|
|
2519
|
+
this.radius = t, this.tileSize = i, this.color = o;
|
|
2315
2520
|
}
|
|
2316
2521
|
generateGrid() {
|
|
2317
|
-
const t = [], i = Math.sqrt(3) * this.tileSize,
|
|
2318
|
-
for (let
|
|
2319
|
-
const
|
|
2320
|
-
for (let
|
|
2321
|
-
const
|
|
2322
|
-
t.push(
|
|
2522
|
+
const t = [], i = Math.sqrt(3) * this.tileSize, o = 2 * this.tileSize;
|
|
2523
|
+
for (let s = -this.radius; s <= this.radius; s++) {
|
|
2524
|
+
const l = Math.max(-this.radius, -s - this.radius), d = Math.min(this.radius, -s + this.radius);
|
|
2525
|
+
for (let u = l; u <= d; u++) {
|
|
2526
|
+
const p = i * (s + u / 2), v = o * 0.75 * u, g = new $i(new h.Vector3(p, -0.1, v), this.tileSize, this.color);
|
|
2527
|
+
t.push(g);
|
|
2323
2528
|
}
|
|
2324
2529
|
}
|
|
2325
2530
|
return t;
|
|
2326
2531
|
}
|
|
2327
2532
|
addToScene(t) {
|
|
2328
|
-
this.generateGrid().forEach((
|
|
2329
|
-
const
|
|
2330
|
-
t.add(
|
|
2533
|
+
this.generateGrid().forEach((o) => {
|
|
2534
|
+
const s = o.createMesh();
|
|
2535
|
+
t.add(s);
|
|
2331
2536
|
});
|
|
2332
2537
|
}
|
|
2333
2538
|
}
|
|
2334
|
-
const
|
|
2335
|
-
if (
|
|
2336
|
-
new
|
|
2337
|
-
const
|
|
2539
|
+
const Qi = (n, t, i) => {
|
|
2540
|
+
if (n.children = n.children.filter((o) => !(o instanceof h.GridHelper || o instanceof h.AxesHelper || o instanceof h.BoxHelper)), i.gridHelper) {
|
|
2541
|
+
new qi(3, 12, i.color).addToScene(n);
|
|
2542
|
+
const s = new h.PlaneGeometry(6 * We, 6 * We), l = new h.ShadowMaterial({
|
|
2338
2543
|
opacity: 0.5
|
|
2339
|
-
}),
|
|
2340
|
-
|
|
2544
|
+
}), d = new h.Mesh(s, l);
|
|
2545
|
+
d.rotation.x = -Math.PI / 2, d.position.y = 0, d.receiveShadow = !0, n.add(d);
|
|
2341
2546
|
}
|
|
2342
2547
|
if (i.axesHelper) {
|
|
2343
|
-
const
|
|
2344
|
-
|
|
2548
|
+
const o = new h.AxesHelper(5);
|
|
2549
|
+
n.add(o);
|
|
2345
2550
|
}
|
|
2346
2551
|
if (i.object3DHelper && t) {
|
|
2347
|
-
const
|
|
2348
|
-
|
|
2552
|
+
const o = new h.BoxHelper(t, new h.Color(i.color));
|
|
2553
|
+
n.add(o);
|
|
2349
2554
|
}
|
|
2350
|
-
},
|
|
2351
|
-
const i = new
|
|
2555
|
+
}, Ji = (n, t) => {
|
|
2556
|
+
const i = new h.AmbientLight(
|
|
2352
2557
|
t.ambientLight.color,
|
|
2353
2558
|
t.ambientLight.intensity
|
|
2354
2559
|
);
|
|
2355
|
-
|
|
2356
|
-
const
|
|
2560
|
+
n.add(i);
|
|
2561
|
+
const o = new h.HemisphereLight(
|
|
2357
2562
|
t.hemisphereLight.skyColor,
|
|
2358
2563
|
t.hemisphereLight.groundColor,
|
|
2359
2564
|
t.hemisphereLight.intensity
|
|
2360
2565
|
);
|
|
2361
|
-
|
|
2362
|
-
const
|
|
2566
|
+
n.add(o);
|
|
2567
|
+
const s = new h.DirectionalLight(
|
|
2363
2568
|
t.directionalLight.color,
|
|
2364
2569
|
t.directionalLight.intensity
|
|
2365
2570
|
);
|
|
2366
|
-
|
|
2367
|
-
},
|
|
2368
|
-
const i = new
|
|
2369
|
-
let
|
|
2370
|
-
|
|
2371
|
-
},
|
|
2372
|
-
const i = new
|
|
2571
|
+
s.position.copy(t.directionalLight.position), s.castShadow = t.directionalLight.castShadow, s.castShadow && (s.shadow.mapSize.width = t.directionalLight.shadow.mapSize.width, s.shadow.mapSize.height = t.directionalLight.shadow.mapSize.height, s.shadow.camera.near = t.directionalLight.shadow.camera.near, s.shadow.camera.far = t.directionalLight.shadow.camera.far, s.shadow.camera.left = t.directionalLight.shadow.camera.left, s.shadow.camera.right = t.directionalLight.shadow.camera.right, s.shadow.camera.top = t.directionalLight.shadow.camera.top, s.shadow.camera.bottom = t.directionalLight.shadow.camera.bottom, s.shadow.bias = t.directionalLight.shadow.bias, s.shadow.radius = t.directionalLight.shadow.radius), n.add(s);
|
|
2572
|
+
}, to = (n, t) => {
|
|
2573
|
+
const i = new h.Box3().setFromObject(n), o = i.getSize(new h.Vector3()), s = i.getCenter(new h.Vector3()), l = Math.max(o.x, o.y, o.z), d = t.fov * (Math.PI / 180);
|
|
2574
|
+
let u = Math.abs(l / 2 / Math.tan(d / 2));
|
|
2575
|
+
u *= 1.4, t.position.set(s.x + u, s.y + u / 3, s.z + u / 5), t.lookAt(s), t.updateProjectionMatrix();
|
|
2576
|
+
}, eo = (n, t) => {
|
|
2577
|
+
const i = new h.PerspectiveCamera(
|
|
2373
2578
|
t.cameraFov || 75,
|
|
2374
|
-
|
|
2579
|
+
n,
|
|
2375
2580
|
t.cameraNear || 0.1,
|
|
2376
2581
|
t.cameraFar || 1e5
|
|
2377
2582
|
);
|
|
2378
|
-
return t.cameraPosition && i.position.copy(new
|
|
2379
|
-
},
|
|
2380
|
-
const t = new
|
|
2381
|
-
antialias:
|
|
2382
|
-
alpha:
|
|
2583
|
+
return t.cameraPosition && i.position.copy(new h.Vector3().fromArray(t.cameraPosition)), t.cameraTarget && i.lookAt(new h.Vector3().fromArray(t.cameraTarget)), i;
|
|
2584
|
+
}, io = (n) => {
|
|
2585
|
+
const t = new h.WebGLRenderer({
|
|
2586
|
+
antialias: n.antialias,
|
|
2587
|
+
alpha: n.alpha
|
|
2383
2588
|
});
|
|
2384
|
-
return t.setPixelRatio(
|
|
2385
|
-
},
|
|
2386
|
-
const t = new
|
|
2387
|
-
return t.background = new
|
|
2388
|
-
},
|
|
2389
|
-
const { mountRef:
|
|
2390
|
-
if (!
|
|
2391
|
-
const
|
|
2392
|
-
|
|
2589
|
+
return t.setPixelRatio(n.pixelRatio), t.shadowMap.enabled = n.shadowMapEnabled, t.shadowMap.type = n.shadowMapType, n.toneMapping && (t.toneMapping = n.toneMapping), n.toneMappingExposure !== void 0 && (t.toneMappingExposure = n.toneMappingExposure), t;
|
|
2590
|
+
}, oo = (n) => {
|
|
2591
|
+
const t = new h.Scene(), i = n.backgroundColor;
|
|
2592
|
+
return t.background = new h.Color(i), t;
|
|
2593
|
+
}, no = (n, t, i) => {
|
|
2594
|
+
const { mountRef: o, sceneRef: s, rendererRef: l, cameraRef: d } = n;
|
|
2595
|
+
if (!o.current) throw new Error("Mount div is not ready");
|
|
2596
|
+
const u = oo(i), p = eo(
|
|
2597
|
+
o.current.clientWidth / o.current.clientHeight,
|
|
2393
2598
|
i.camera
|
|
2394
|
-
),
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
}), new
|
|
2398
|
-
const
|
|
2399
|
-
Object.assign(
|
|
2400
|
-
const
|
|
2401
|
-
|
|
2402
|
-
let
|
|
2403
|
-
const
|
|
2404
|
-
|
|
2599
|
+
), v = io(i.renderer);
|
|
2600
|
+
l.current = v, d.current = p, s.current = u, o.current.appendChild(v.domElement), t && (t.castShadow = !0, t.traverse((k) => {
|
|
2601
|
+
k instanceof h.Mesh && (k.castShadow = !0, k.receiveShadow = !0);
|
|
2602
|
+
}), new Xi(t).alignToFloor(), u.add(t)), Ji(u, i.lightning), Qi(u, t, i.helpers);
|
|
2603
|
+
const g = i.controls.type === Ie.MapsControls ? new Ki(p, v.domElement) : new ni(p, v.domElement);
|
|
2604
|
+
Object.assign(g, i.controls), g.update(), i.camera.autoFitToObject && to(u, p);
|
|
2605
|
+
const C = new h.Vector3();
|
|
2606
|
+
u.position.copy(C), g.target.copy(C), g.update();
|
|
2607
|
+
let P = !1;
|
|
2608
|
+
const I = () => {
|
|
2609
|
+
P || (P = !0, J(performance.now()));
|
|
2405
2610
|
}, Z = () => {
|
|
2406
|
-
|
|
2611
|
+
P = !1;
|
|
2407
2612
|
};
|
|
2408
|
-
|
|
2409
|
-
const
|
|
2410
|
-
(
|
|
2411
|
-
},
|
|
2412
|
-
!
|
|
2613
|
+
g.addEventListener("start", I), g.addEventListener("end", Z);
|
|
2614
|
+
const U = ri(() => {
|
|
2615
|
+
(P || !i.staticScene) && v.render(u, p);
|
|
2616
|
+
}, ii), J = (k) => {
|
|
2617
|
+
!P && i.staticScene || (requestAnimationFrame(J), i.animationLoop && i.animationLoop(k), g.update(), t && (v.shadowMap.needsUpdate = !0), U());
|
|
2413
2618
|
};
|
|
2414
|
-
return
|
|
2415
|
-
},
|
|
2619
|
+
return J(performance.now()), { scene: u, camera: p, renderer: v, controls: g };
|
|
2620
|
+
}, ro = (n, t, i, o) => {
|
|
2416
2621
|
if (i.current) {
|
|
2417
|
-
const
|
|
2418
|
-
|
|
2622
|
+
const s = i.current.clientWidth, l = i.current.clientHeight;
|
|
2623
|
+
n.setSize(s, l), t.aspect = s / l, t.updateProjectionMatrix(), n.render(o, t);
|
|
2419
2624
|
}
|
|
2420
|
-
},
|
|
2625
|
+
}, Be = {
|
|
2421
2626
|
staticScene: !0,
|
|
2422
2627
|
// It stops animation loop if there is no interactions
|
|
2423
2628
|
backgroundColor: "#f0f0f7",
|
|
@@ -2447,7 +2652,7 @@ const Bi = (o, t, i) => {
|
|
|
2447
2652
|
directionalLight: {
|
|
2448
2653
|
color: "#ffffff",
|
|
2449
2654
|
intensity: Math.PI,
|
|
2450
|
-
position: new
|
|
2655
|
+
position: new h.Vector3(6, 6, 6),
|
|
2451
2656
|
castShadow: !0,
|
|
2452
2657
|
shadow: {
|
|
2453
2658
|
mapSize: {
|
|
@@ -2472,12 +2677,12 @@ const Bi = (o, t, i) => {
|
|
|
2472
2677
|
alpha: !1,
|
|
2473
2678
|
shadowMapEnabled: !0,
|
|
2474
2679
|
pixelRatio: window.devicePixelRatio,
|
|
2475
|
-
shadowMapType:
|
|
2476
|
-
toneMapping:
|
|
2680
|
+
shadowMapType: h.VSMShadowMap,
|
|
2681
|
+
toneMapping: h.ACESFilmicToneMapping,
|
|
2477
2682
|
toneMappingExposure: 1
|
|
2478
2683
|
},
|
|
2479
2684
|
controls: {
|
|
2480
|
-
type:
|
|
2685
|
+
type: Ie.OrbitControls,
|
|
2481
2686
|
enabled: !0,
|
|
2482
2687
|
// Controls are used in setupScene
|
|
2483
2688
|
enableDamping: !0,
|
|
@@ -2506,50 +2711,50 @@ const Bi = (o, t, i) => {
|
|
|
2506
2711
|
controls: { current: null }
|
|
2507
2712
|
},
|
|
2508
2713
|
animationLoop: null
|
|
2509
|
-
},
|
|
2510
|
-
const i = t.threeBaseRefs.mountPoint ||
|
|
2511
|
-
|
|
2512
|
-
|
|
2714
|
+
}, ho = ({ object: n, options: t = Be }) => {
|
|
2715
|
+
const i = t.threeBaseRefs.mountPoint || X(null), o = t.threeBaseRefs.renderer || X(null), s = t.threeBaseRefs.camera || X(null), l = t.threeBaseRefs.scene || X(null), d = t.threeBaseRefs.controls || X(null), [u, p] = Ke(0);
|
|
2716
|
+
Jt(() => {
|
|
2717
|
+
p(u + 1);
|
|
2513
2718
|
}, []);
|
|
2514
|
-
const
|
|
2515
|
-
...
|
|
2719
|
+
const v = si(() => ({
|
|
2720
|
+
...Be,
|
|
2516
2721
|
...t
|
|
2517
2722
|
}), [t]);
|
|
2518
|
-
|
|
2723
|
+
Jt(() => {
|
|
2519
2724
|
if (!i.current) return;
|
|
2520
|
-
const
|
|
2521
|
-
|
|
2522
|
-
|
|
2725
|
+
const C = () => ro(
|
|
2726
|
+
o.current,
|
|
2727
|
+
s.current,
|
|
2523
2728
|
i,
|
|
2524
|
-
|
|
2525
|
-
),
|
|
2526
|
-
renderer:
|
|
2729
|
+
l.current
|
|
2730
|
+
), P = ri(C, ii), {
|
|
2731
|
+
renderer: I,
|
|
2527
2732
|
scene: Z,
|
|
2528
|
-
camera:
|
|
2529
|
-
controls:
|
|
2530
|
-
} =
|
|
2531
|
-
{ mountRef: i, rendererRef:
|
|
2532
|
-
|
|
2533
|
-
|
|
2733
|
+
camera: U,
|
|
2734
|
+
controls: J
|
|
2735
|
+
} = no(
|
|
2736
|
+
{ mountRef: i, rendererRef: o, cameraRef: s, sceneRef: l },
|
|
2737
|
+
n,
|
|
2738
|
+
v
|
|
2534
2739
|
);
|
|
2535
|
-
return
|
|
2536
|
-
}, [
|
|
2537
|
-
const
|
|
2538
|
-
|
|
2740
|
+
return o.current = I, l.current = Z, s.current = U, d.current = J, C(), window.addEventListener("resize", P), () => Li(i, I, P);
|
|
2741
|
+
}, [n, v]);
|
|
2742
|
+
const g = at(() => {
|
|
2743
|
+
o.current && o.current.render(l.current, s.current);
|
|
2539
2744
|
}, []);
|
|
2540
|
-
return /* @__PURE__ */
|
|
2541
|
-
t.helpers.addGizmo ? /* @__PURE__ */
|
|
2542
|
-
|
|
2745
|
+
return /* @__PURE__ */ Kt.jsxs(Kt.Fragment, { children: [
|
|
2746
|
+
t.helpers.addGizmo ? /* @__PURE__ */ Kt.jsx(
|
|
2747
|
+
ji,
|
|
2543
2748
|
{
|
|
2544
|
-
camera:
|
|
2545
|
-
controls:
|
|
2546
|
-
render:
|
|
2749
|
+
camera: s.current,
|
|
2750
|
+
controls: d.current,
|
|
2751
|
+
render: g
|
|
2547
2752
|
}
|
|
2548
2753
|
) : null,
|
|
2549
|
-
/* @__PURE__ */
|
|
2754
|
+
/* @__PURE__ */ Kt.jsx("div", { style: { width: "100%", height: "100%" }, ref: i })
|
|
2550
2755
|
] });
|
|
2551
2756
|
};
|
|
2552
2757
|
export {
|
|
2553
|
-
|
|
2554
|
-
|
|
2758
|
+
ho as SimpleViewer,
|
|
2759
|
+
Be as defaultOptions
|
|
2555
2760
|
};
|