aptechka 0.7.2 → 0.7.3

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.
Files changed (35) hide show
  1. package/lib/accordion/AccordionElement.d.ts +0 -3
  2. package/lib/accordion/index.cjs +1 -1
  3. package/lib/accordion/index.js +60 -71
  4. package/lib/en3/core/En3Raycaster.d.ts +1 -0
  5. package/lib/en3/helpers/{En3Controls.d.ts → En3Helpers.d.ts} +1 -1
  6. package/lib/en3/helpers/En3Object3dManager.d.ts +2 -0
  7. package/lib/en3/helpers/En3ParametersManager.d.ts +5 -0
  8. package/lib/en3/helpers/index.cjs +1 -1
  9. package/lib/en3/helpers/index.d.ts +1 -1
  10. package/lib/en3/helpers/index.js +1203 -669
  11. package/lib/en3/index.cjs +1 -1
  12. package/lib/en3/index.js +1 -1
  13. package/lib/en3/loaders/index.cjs +1 -1
  14. package/lib/en3/loaders/index.js +1 -1
  15. package/lib/en3/utils/index.cjs +1 -1
  16. package/lib/en3/utils/index.js +15 -38
  17. package/lib/en3-BQMd-J6t.cjs +8 -0
  18. package/lib/{en3-hbkN1OPu.js → en3-CsNHRA0v.js} +22 -22
  19. package/lib/events-BGwqaxVW.cjs +1 -0
  20. package/lib/{events-_C2CztxR.js → events-C_coq1Mk.js} +9 -0
  21. package/lib/{index-BAH_fO2N.js → index-CoOTQk9H.js} +40 -40
  22. package/lib/{index-D1LQUR-R.cjs → index-DVUk3T-y.cjs} +2 -2
  23. package/lib/select/index.cjs +1 -1
  24. package/lib/select/index.js +1 -1
  25. package/lib/traverseMaterials-B87RMkV0.js +29 -0
  26. package/lib/traverseMaterials-Crv7f9BJ.cjs +1 -0
  27. package/lib/tweaker/index.cjs +3 -3
  28. package/lib/tweaker/index.js +314 -296
  29. package/lib/tweaker/tweakerStorage.d.ts +2 -0
  30. package/lib/utils/events.d.ts +2 -0
  31. package/lib/utils/index.cjs +1 -1
  32. package/lib/utils/index.js +65 -64
  33. package/package.json +1 -1
  34. package/lib/en3-C4mzaF6q.cjs +0 -8
  35. package/lib/events-Crwi8fz6.cjs +0 -1
@@ -1,157 +1,655 @@
1
- var pe = (d, o, a) => {
2
- if (!o.has(d))
3
- throw TypeError("Cannot " + a);
1
+ var Cn = Object.defineProperty;
2
+ var $t = Object.getOwnPropertySymbols;
3
+ var Zn = Object.prototype.hasOwnProperty, Fn = Object.prototype.propertyIsEnumerable;
4
+ var Jt = (p, n, o) => n in p ? Cn(p, n, { enumerable: !0, configurable: !0, writable: !0, value: o }) : p[n] = o, ut = (p, n) => {
5
+ for (var o in n || (n = {}))
6
+ Zn.call(n, o) && Jt(p, o, n[o]);
7
+ if ($t)
8
+ for (var o of $t(n))
9
+ Fn.call(n, o) && Jt(p, o, n[o]);
10
+ return p;
4
11
  };
5
- var s = (d, o, a) => (pe(d, o, "read from private field"), a ? a.call(d) : o.get(d)), m = (d, o, a) => {
6
- if (o.has(d))
12
+ var At = (p, n, o) => {
13
+ if (!n.has(p))
14
+ throw TypeError("Cannot " + o);
15
+ };
16
+ var s = (p, n, o) => (At(p, n, "read from private field"), o ? o.call(p) : n.get(p)), u = (p, n, o) => {
17
+ if (n.has(p))
7
18
  throw TypeError("Cannot add the same private member more than once");
8
- o instanceof WeakSet ? o.add(d) : o.set(d, a);
9
- }, S = (d, o, a, t) => (pe(d, o, "write to private field"), t ? t.call(d, a) : o.set(d, a), a);
10
- var te = (d, o, a) => (pe(d, o, "access private method"), a);
11
- import { e as L } from "../../en3-hbkN1OPu.js";
12
- import { S as ot } from "../../Store-BI2xxXOA.js";
13
- import { Ray as hn, Plane as pn, MathUtils as dn, EventDispatcher as un, Vector3 as p, MOUSE as _t, TOUCH as vt, Quaternion as G, Spherical as je, Vector2 as U, Raycaster as mn, Object3D as fe, Euler as fn, Matrix4 as Fe, MeshBasicMaterial as qe, LineBasicMaterial as yn, CylinderGeometry as z, BoxGeometry as k, BufferGeometry as Oe, Float32BufferAttribute as De, Mesh as c, OctahedronGeometry as ee, Line as at, SphereGeometry as wn, TorusGeometry as kt, PlaneGeometry as bn, DoubleSide as gn, GridHelper as En } from "three";
14
- import { C as Pn } from "../../Composed-DmLYTh1b.js";
15
- var F, mt, ft, yt, Ht, Tt, ae;
16
- class Ge {
17
- constructor(o, a) {
18
- m(this, Tt);
19
- m(this, F, void 0);
20
- m(this, mt, void 0);
21
- m(this, ft, void 0);
22
- m(this, yt, void 0);
23
- m(this, Ht, !0);
24
- var n;
25
- S(this, F, o), s(this, F).userData.controlled = !0;
26
- const t = (a == null ? void 0 : a.step) || 1e-4, i = o.name || "Unnamed", l = ((n = o.userData) == null ? void 0 : n.box) || o;
27
- S(this, mt, new ot([l.position.x, l.position.y, l.position.z], {
19
+ n instanceof WeakSet ? n.add(p) : n.set(p, o);
20
+ }, P = (p, n, o, e) => (At(p, n, "write to private field"), e ? e.call(p, o) : n.set(p, o), o);
21
+ var I = (p, n, o) => (At(p, n, "access private method"), o);
22
+ import { e as x } from "../../en3-CsNHRA0v.js";
23
+ import { S as F } from "../../Store-BI2xxXOA.js";
24
+ import * as q from "three";
25
+ import { Light as Nn, PointLight as Qn, PointLightHelper as qn, DirectionalLight as Gn, DirectionalLightHelper as Wn, SpotLight as Un, SpotLightHelper as Kn, HemisphereLight as Bn, HemisphereLightHelper as Vn, Camera as $n, CameraHelper as Jn, Ray as ei, Plane as ti, MathUtils as ni, EventDispatcher as ii, Vector3 as d, MOUSE as Oe, TOUCH as ke, Quaternion as V, Spherical as en, Vector2 as J, Raycaster as oi, Object3D as Rt, Euler as si, Matrix4 as fn, MeshBasicMaterial as yn, LineBasicMaterial as ai, CylinderGeometry as N, BoxGeometry as Z, BufferGeometry as tn, Float32BufferAttribute as nn, Mesh as h, OctahedronGeometry as ft, Line as me, SphereGeometry as ri, TorusGeometry as Fe, PlaneGeometry as li, DoubleSide as ci, GridHelper as hi } from "three";
26
+ import { t as pi } from "../../traverseMaterials-B87RMkV0.js";
27
+ import { ticker as on } from "../../ticker/index.js";
28
+ import { C as mi } from "../../Composed-DmLYTh1b.js";
29
+ const di = [
30
+ "AddEquation",
31
+ "SubtractEquation",
32
+ "ReverseSubtractEquation",
33
+ "MinEquation",
34
+ "MaxEquation"
35
+ ], wn = [
36
+ "ZeroFactor",
37
+ "OneFactor",
38
+ "SrcColorFactor",
39
+ "OneMinusSrcColorFactor",
40
+ "SrcAlphaFactor",
41
+ "OneMinusSrcAlphaFactor",
42
+ "DstAlphaFactor",
43
+ "OneMinusDstAlphaFactor",
44
+ "DstColorFactor",
45
+ "OneMinusDstColorFactor",
46
+ "SrcAlphaSaturateFactor",
47
+ "ConstantColorFactor",
48
+ "OneMinusConstantColorFactor",
49
+ "ConstantAlphaFactor",
50
+ "OneMinusConstantAlphaFactor"
51
+ ], ui = [...wn, "SrcAlphaSaturateFactor"], fi = [
52
+ "NoBlending",
53
+ "NormalBlending",
54
+ "AdditiveBlending",
55
+ "SubtractiveBlending",
56
+ "MultiplyBlending",
57
+ "CustomBlending"
58
+ ], yi = [
59
+ "NeverDepth",
60
+ "AlwaysDepth",
61
+ "EqualDepth",
62
+ "LessDepth",
63
+ "LessEqualDepth ",
64
+ "GreaterEqualDepth ",
65
+ "GreaterDepth",
66
+ "NotEqualDepth"
67
+ ], wi = [
68
+ "NeverStencilFunc",
69
+ "LessStencilFunc",
70
+ "EqualStencilFunc",
71
+ "LessEqualStencilFunc ",
72
+ "GreaterStencilFunc",
73
+ "NotEqualStencilFunc ",
74
+ "GreaterEqualStencilFunc",
75
+ "AlwaysStencilFunc"
76
+ ], Lt = [
77
+ "ZeroStencilOp",
78
+ "KeepStencilOp",
79
+ "ReplaceStencilOp",
80
+ "IncrementStencilOp",
81
+ "DecrementStencilOp",
82
+ "IncrementWrapStencilOp",
83
+ "DecrementWrapStencilOp",
84
+ "InvertStencilOp"
85
+ ], bi = ["FrontSide", "BackSide", "DoubleSide"], gi = ["TangentSpaceNormalMap", "ObjectSpaceNormalMap"], Ei = ["round", "bevel", "miter"], Mi = [
86
+ "NoToneMapping",
87
+ "LinearToneMapping",
88
+ "ReinhardToneMapping",
89
+ "CineonToneMapping",
90
+ "ACESFilmicToneMapping",
91
+ "AgXToneMapping",
92
+ "NeutralToneMapping",
93
+ "CustomToneMapping"
94
+ ], Si = [
95
+ "BasicShadowMap",
96
+ "PCFShadowMap",
97
+ "PCFSoftShadowMap",
98
+ "VSMShadowMap"
99
+ ], Ne = {
100
+ intensity: {
101
+ type: "number",
102
+ min: 0,
103
+ max: 20,
104
+ step: 1e-4
105
+ },
106
+ renderOrder: {
107
+ type: "number",
108
+ step: 1
109
+ },
110
+ alphaTest: {
111
+ type: "number",
112
+ min: 0,
113
+ max: 1,
114
+ step: 1e-3
115
+ },
116
+ blendAlpha: {
117
+ type: "number",
118
+ min: 0,
119
+ max: 1,
120
+ step: 1e-3
121
+ },
122
+ blendDst: {
123
+ type: "select",
124
+ variants: ui
125
+ },
126
+ blendDstAlpha: {
127
+ type: "number",
128
+ min: 0,
129
+ max: 1,
130
+ step: 1e-3
131
+ },
132
+ blendEquation: {
133
+ type: "select",
134
+ variants: di
135
+ },
136
+ blendEquationAlpha: {
137
+ type: "number",
138
+ min: 0,
139
+ max: 1,
140
+ step: 1e-3
141
+ },
142
+ blending: {
143
+ type: "select",
144
+ variants: fi
145
+ },
146
+ blendSrc: {
147
+ type: "select",
148
+ variants: wn
149
+ },
150
+ blendSrcAlpha: {
151
+ type: "number",
152
+ min: 0,
153
+ max: 1,
154
+ step: 1e-3
155
+ },
156
+ depthFunc: {
157
+ type: "select",
158
+ variants: yi
159
+ },
160
+ stencilFunc: {
161
+ type: "select",
162
+ variants: wi
163
+ },
164
+ stencilRef: {
165
+ type: "number",
166
+ min: 0,
167
+ step: 1
168
+ },
169
+ stencilFail: {
170
+ type: "select",
171
+ variants: Lt
172
+ },
173
+ stencilZFail: {
174
+ type: "select",
175
+ variants: Lt
176
+ },
177
+ stencilZPass: {
178
+ type: "select",
179
+ variants: Lt
180
+ },
181
+ opacity: {
182
+ type: "number",
183
+ min: 0,
184
+ max: 1,
185
+ step: 1e-4
186
+ },
187
+ side: {
188
+ type: "select",
189
+ variants: bi
190
+ },
191
+ roughness: {
192
+ type: "number",
193
+ min: 0,
194
+ max: 1,
195
+ step: 1e-4
196
+ },
197
+ metalness: {
198
+ type: "number",
199
+ min: 0,
200
+ max: 1,
201
+ step: 1e-4
202
+ },
203
+ lightMapIntensity: {
204
+ type: "number",
205
+ min: 0,
206
+ max: 20,
207
+ step: 1e-4
208
+ },
209
+ aoMapIntensity: {
210
+ type: "number",
211
+ min: 0,
212
+ max: 20,
213
+ step: 1e-4
214
+ },
215
+ bumpScale: {
216
+ type: "number",
217
+ min: 0,
218
+ step: 1e-4
219
+ },
220
+ normalMapType: {
221
+ type: "select",
222
+ variants: gi
223
+ },
224
+ wireframeLinejoin: {
225
+ type: "select",
226
+ variants: Ei
227
+ },
228
+ envMapIntensity: {
229
+ type: "number",
230
+ min: 0,
231
+ max: 20,
232
+ step: 1e-4
233
+ },
234
+ emissiveIntensity: {
235
+ type: "number",
236
+ min: 0,
237
+ max: 20,
238
+ step: 1e-4
239
+ },
240
+ fov: {
241
+ type: "number",
242
+ min: 0,
243
+ max: 180,
244
+ step: 1
245
+ },
246
+ zoom: {
247
+ type: "number",
248
+ min: 0,
249
+ step: 1e-4
250
+ },
251
+ near: {
252
+ type: "number",
253
+ min: 0,
254
+ step: 1e-4
255
+ },
256
+ far: {
257
+ type: "number",
258
+ min: 0,
259
+ step: 1
260
+ },
261
+ filmGauge: {
262
+ type: "number",
263
+ min: 0,
264
+ step: 1e-4
265
+ },
266
+ filmOffset: {
267
+ type: "number",
268
+ min: 0,
269
+ step: 1e-4
270
+ },
271
+ distance: {
272
+ type: "number",
273
+ min: 0,
274
+ step: 0.1
275
+ },
276
+ decay: {
277
+ type: "number",
278
+ min: 0,
279
+ step: 1e-5,
280
+ ease: 1e-3
281
+ },
282
+ focus: {
283
+ type: "number",
284
+ min: 0,
285
+ max: 1,
286
+ step: 1e-5
287
+ },
288
+ bias: {
289
+ type: "number",
290
+ min: 0,
291
+ max: 0.01,
292
+ step: 1e-6,
293
+ ease: 0.01
294
+ },
295
+ blurSamples: {
296
+ type: "number",
297
+ min: 0,
298
+ step: 1
299
+ },
300
+ normalBias: {
301
+ type: "number",
302
+ min: 0,
303
+ step: 1e-3,
304
+ ease: 0.01
305
+ },
306
+ radius: {
307
+ type: "number",
308
+ min: 0,
309
+ step: 1e-3,
310
+ ease: 0.01
311
+ },
312
+ penumbra: {
313
+ type: "number",
314
+ min: 0,
315
+ max: 1,
316
+ step: 1e-6
317
+ },
318
+ power: {
319
+ type: "number",
320
+ min: 0,
321
+ step: 1e-3,
322
+ ease: 0.01
323
+ },
324
+ angle: {
325
+ type: "number",
326
+ min: 0,
327
+ step: 1e-6,
328
+ ease: 1e-3
329
+ },
330
+ toneMapping: {
331
+ type: "select",
332
+ variants: Mi
333
+ },
334
+ toneMappingExposure: {
335
+ type: "number",
336
+ min: 0,
337
+ step: 1e-3,
338
+ ease: 0.1
339
+ },
340
+ mapSize: {
341
+ type: "number",
342
+ min: 0,
343
+ step: 1
344
+ }
345
+ }, Pi = {
346
+ type: {
347
+ type: "select",
348
+ variants: Si
349
+ }
350
+ }, xi = /* @__PURE__ */ new Set([
351
+ "stencilFuncMask",
352
+ "needsUpdate",
353
+ "version",
354
+ "wireframeLinewidth",
355
+ "position",
356
+ "scale",
357
+ "rotation",
358
+ "coordinateSystem",
359
+ "aspect",
360
+ "autoUpdate",
361
+ "up"
362
+ ]);
363
+ var D, le, ce, Ee, St, gn, Pt, En, xt, Mn, vt, Sn, Ue, Yt;
364
+ class bn {
365
+ constructor(n) {
366
+ u(this, ce);
367
+ u(this, St);
368
+ u(this, Pt);
369
+ u(this, xt);
370
+ u(this, vt);
371
+ u(this, Ue);
372
+ u(this, D, void 0);
373
+ u(this, le, []);
374
+ if (P(this, D, n), s(this, D) instanceof q.Object3D) {
375
+ if (I(this, ce, Ee).call(this, s(this, D), `${s(this, D).name}.Parameters`, Ne, s(this, D) instanceof q.Camera ? () => {
376
+ x.view.resize();
377
+ } : void 0), s(this, D) instanceof q.Mesh) {
378
+ const o = s(this, D).material;
379
+ o instanceof q.Material && I(this, ce, Ee).call(this, o, `${s(this, D).name}.Parameters.Material`, Ne, () => {
380
+ o.needsUpdate = !0;
381
+ });
382
+ } else if (s(this, D) instanceof q.Light) {
383
+ const o = s(this, D).shadow;
384
+ if (o) {
385
+ I(this, ce, Ee).call(this, o, `${s(this, D).name}.Parameters.Shadow`, Ne, () => {
386
+ o.needsUpdate = !0;
387
+ });
388
+ const e = o.camera;
389
+ e && I(this, ce, Ee).call(this, e, `${s(this, D).name}.Parameters.Shadow.Camera`, Ne, () => {
390
+ o.camera.updateProjectionMatrix();
391
+ });
392
+ }
393
+ }
394
+ } else if (s(this, D) instanceof q.WebGLRenderer) {
395
+ const o = s(this, D);
396
+ I(this, ce, Ee).call(this, o, "Renderer", Ne), I(this, ce, Ee).call(this, o.shadowMap, "Renderer.shadowMap", Pi, () => {
397
+ o.shadowMap.needsUpdate = !0, pi(x.scene, (e) => {
398
+ e.needsUpdate = !0;
399
+ });
400
+ });
401
+ }
402
+ }
403
+ destroy() {
404
+ s(this, le).forEach((n) => {
405
+ n.close();
406
+ });
407
+ }
408
+ }
409
+ D = new WeakMap(), le = new WeakMap(), ce = new WeakSet(), Ee = function(n, o, e, a) {
410
+ for (const r in n) {
411
+ if (r.startsWith("_") || xi.has(r))
412
+ continue;
413
+ const i = n[r], l = `${o}.${r}`, m = e[r];
414
+ typeof i == "number" ? (m == null ? void 0 : m.type) === "select" ? I(this, Ue, Yt).call(this, l, i, n, r, m, a) : I(this, St, gn).call(this, l, i, n, r, m, a) : i instanceof q.Vector2 || i instanceof q.Vector3 ? I(this, Pt, En).call(this, l, i, n, r, m, a) : typeof i == "boolean" && !r.startsWith("is") && !r.startsWith("matrix") ? I(this, xt, Mn).call(this, l, i, n, r, a) : i instanceof q.Color ? I(this, vt, Sn).call(this, l, i, n, r, a) : m && (m == null ? void 0 : m.type) === "select" && I(this, Ue, Yt).call(this, l, i, n, r, m, a);
415
+ }
416
+ }, St = new WeakSet(), gn = function(n, o, e, a, r, i) {
417
+ const l = new F(o, {
418
+ passport: {
419
+ name: n,
420
+ manager: ut({
421
+ type: "number"
422
+ }, r)
423
+ }
424
+ });
425
+ l.subscribe((m) => {
426
+ e[a] = m.current, i == null || i();
427
+ }), s(this, le).push(l);
428
+ }, Pt = new WeakSet(), En = function(n, o, e, a, r, i) {
429
+ const l = (f) => {
430
+ const w = [f.x, f.y];
431
+ return f instanceof q.Vector3 && w.push(f.z), w;
432
+ }, m = new F(l(o), {
433
+ passport: {
434
+ name: n,
435
+ manager: ut({
436
+ type: "number"
437
+ }, r)
438
+ }
439
+ });
440
+ m.subscribe((f) => {
441
+ e[a].set(...f.current), i == null || i();
442
+ }), s(this, le).push(m);
443
+ }, xt = new WeakSet(), Mn = function(n, o, e, a, r) {
444
+ const i = new F(o, {
445
+ passport: {
446
+ name: n,
447
+ manager: {
448
+ type: "boolean"
449
+ }
450
+ }
451
+ });
452
+ i.subscribe((l) => {
453
+ e[a] = l.current, r == null || r();
454
+ }), s(this, le).push(i);
455
+ }, vt = new WeakSet(), Sn = function(n, o, e, a, r) {
456
+ const i = new F(`#${o.getHexString()}`, {
457
+ passport: {
458
+ name: n,
459
+ manager: {
460
+ type: "color"
461
+ }
462
+ }
463
+ });
464
+ i.subscribe((l) => {
465
+ e[a] = new q.Color(l.current), r == null || r();
466
+ }), s(this, le).push(i);
467
+ }, Ue = new WeakSet(), Yt = function(n, o, e, a, r, i) {
468
+ const l = r.variants;
469
+ let m = null;
470
+ for (const w of l)
471
+ o === q[w] && (m = w);
472
+ const f = new F(m || o, {
473
+ passport: {
474
+ name: n,
475
+ manager: ut({}, r)
476
+ }
477
+ });
478
+ f.subscribe((w) => {
479
+ typeof w.current == "string" && (w.current[0] === w.current[0].toUpperCase() ? e[a] = q[w.current] : e[a] = w.current), i == null || i();
480
+ }), s(this, le).push(f);
481
+ };
482
+ var E, Ke, Se, Pe, xe, Be, ee, Re, Et, Ve;
483
+ class Pn {
484
+ constructor(n, o) {
485
+ u(this, Re);
486
+ u(this, E, void 0);
487
+ u(this, Ke, null);
488
+ u(this, Se, void 0);
489
+ u(this, Pe, void 0);
490
+ u(this, xe, void 0);
491
+ u(this, Be, !0);
492
+ u(this, ee, []);
493
+ u(this, Ve, () => {
494
+ s(this, ee).forEach((n) => {
495
+ "update" in n && n.update();
496
+ });
497
+ });
498
+ var l, m;
499
+ P(this, E, n);
500
+ let e = !1;
501
+ n.name.startsWith("T.") && (n.name = n.name.slice(2)), n.name.includes("P.") && (e = !0, n.name = n.name.replace("P.", ""));
502
+ const a = n.name;
503
+ s(this, E).userData.controlled = !0;
504
+ const r = (o == null ? void 0 : o.step) || 1e-4, i = ((l = n.userData) == null ? void 0 : l.box) || n;
505
+ if (s(this, E) instanceof Nn) {
506
+ let f;
507
+ s(this, E) instanceof Qn ? f = new qn(s(this, E), 100) : s(this, E) instanceof Gn ? (s(this, E).scale.setScalar(100), f = new Wn(s(this, E), 1)) : s(this, E) instanceof Un ? f = new Kn(s(this, E)) : s(this, E) instanceof Bn && (f = new Vn(s(this, E), 100)), s(this, ee).push(f);
508
+ const w = (m = s(this, E).shadow) == null ? void 0 : m.camera;
509
+ if (w instanceof $n) {
510
+ const H = new Jn(w);
511
+ s(this, ee).push(H);
512
+ }
513
+ }
514
+ s(this, ee).forEach((f) => {
515
+ x.view.add(f);
516
+ }), P(this, Se, new F([i.position.x, i.position.y, i.position.z], {
28
517
  passport: {
29
- name: `${i}.Position`,
518
+ name: `${a}.Transformation.Position`,
30
519
  manager: {
31
520
  type: "number",
32
- step: t
521
+ step: r
33
522
  }
34
523
  }
35
- })), S(this, ft, new ot([l.rotation.x, l.rotation.y, l.rotation.z], {
524
+ })), P(this, Pe, new F([i.rotation.x, i.rotation.y, i.rotation.z], {
36
525
  passport: {
37
- name: `${i}.Rotation`,
526
+ name: `${a}.Transformation.Rotation`,
38
527
  manager: {
39
528
  type: "number",
40
- step: t,
529
+ step: r,
41
530
  ease: 0.01
42
531
  }
43
532
  }
44
- })), S(this, yt, new ot([l.scale.x, l.scale.y, l.scale.z], {
533
+ })), P(this, xe, new F([i.scale.x, i.scale.y, i.scale.z], {
45
534
  passport: {
46
- name: `${i}.Scale`,
535
+ name: `${a}.Transformation.Scale`,
47
536
  manager: {
48
537
  type: "number",
49
- step: t
538
+ step: r
50
539
  }
51
540
  }
52
- })), this.save(), S(this, Ht, !1), s(this, mt).subscribe((h) => {
53
- te(this, Tt, ae).call(this, "position", h.current);
54
- }), s(this, ft).subscribe((h) => {
55
- te(this, Tt, ae).call(this, "rotation", h.current);
56
- }), s(this, yt).subscribe((h) => {
57
- te(this, Tt, ae).call(this, "scale", h.current);
58
- });
541
+ })), this.save(), P(this, Be, !1), s(this, Se).subscribe((f) => {
542
+ I(this, Re, Et).call(this, "position", f.current);
543
+ }), s(this, Pe).subscribe((f) => {
544
+ I(this, Re, Et).call(this, "rotation", f.current);
545
+ }), s(this, xe).subscribe((f) => {
546
+ I(this, Re, Et).call(this, "scale", f.current);
547
+ }), e && P(this, Ke, new bn(s(this, E))), s(this, ee).length && on.subscribe(s(this, Ve));
59
548
  }
60
549
  get object3d() {
61
- return s(this, F);
550
+ return s(this, E);
551
+ }
552
+ get helpers() {
553
+ return s(this, ee);
554
+ }
555
+ get raycasterTarget() {
556
+ return s(this, ee)[0] || s(this, E);
62
557
  }
63
558
  destroy() {
64
- s(this, mt).close(), s(this, ft).close(), s(this, yt).close(), s(this, F).userData.controlled = !1;
559
+ var n;
560
+ (n = s(this, Ke)) == null || n.destroy(), s(this, Se).close(), s(this, Pe).close(), s(this, xe).close(), s(this, E).userData.controlled = !1, s(this, ee).forEach((o) => {
561
+ o && "dispose" in o && (o.dispose(), x.view.remove(o));
562
+ }), on.unsubscribe(s(this, Ve));
65
563
  }
66
564
  save() {
67
- const o = (a, t) => {
68
- (!s(this, Ht) || a.initial === a.current) && (a.current = [t.x, t.y, t.z]);
565
+ const n = (o, e) => {
566
+ (!s(this, Be) || o.initial === o.current) && (o.current = [e.x, e.y, e.z]);
69
567
  };
70
- o(s(this, mt), s(this, F).position), o(s(this, ft), s(this, F).rotation), o(s(this, yt), s(this, F).scale);
568
+ n(s(this, Se), s(this, E).position), n(s(this, Pe), s(this, E).rotation), n(s(this, xe), s(this, E).scale);
71
569
  }
72
570
  }
73
- F = new WeakMap(), mt = new WeakMap(), ft = new WeakMap(), yt = new WeakMap(), Ht = new WeakMap(), Tt = new WeakSet(), ae = function(o, a) {
74
- const t = s(this, F).userData.box;
75
- if (t) {
76
- const i = (l) => ({
77
- x: a[0] - l.x,
78
- y: a[1] - l.y,
79
- z: a[2] - l.z
571
+ E = new WeakMap(), Ke = new WeakMap(), Se = new WeakMap(), Pe = new WeakMap(), xe = new WeakMap(), Be = new WeakMap(), ee = new WeakMap(), Re = new WeakSet(), Et = function(n, o) {
572
+ const e = s(this, E).userData.box;
573
+ if (e) {
574
+ const a = (r) => ({
575
+ x: o[0] - r.x,
576
+ y: o[1] - r.y,
577
+ z: o[2] - r.z
80
578
  });
81
- o === "position" ? t.setPositionStep(
579
+ n === "position" ? e.setPositionStep(
82
580
  "_manager",
83
581
  "+",
84
- i(t.getIncludedPositionSteps("_manager"))
85
- ) : o === "rotation" ? t.setRotationStep(
582
+ a(e.getIncludedPositionSteps("_manager"))
583
+ ) : n === "rotation" ? e.setRotationStep(
86
584
  "_manager",
87
585
  "+",
88
- i(t.getIncludedRotationSteps("_manager"))
89
- ) : o === "scale" && t.setScaleStep(
586
+ a(e.getIncludedRotationSteps("_manager"))
587
+ ) : n === "scale" && e.setScaleStep(
90
588
  "_manager",
91
589
  "+",
92
- i(t.getIncludedScaleSteps("_manager"))
590
+ a(e.getIncludedScaleSteps("_manager"))
93
591
  );
94
592
  } else
95
- s(this, F)[o].set(...a);
96
- };
97
- const Ye = { type: "change" }, de = { type: "start" }, ke = { type: "end" }, ne = new hn(), Re = new pn(), Mn = Math.cos(70 * dn.DEG2RAD);
98
- class Sn extends un {
99
- constructor(o, a) {
100
- super(), this.object = o, this.domElement = a, this.domElement.style.touchAction = "none", this.enabled = !0, this.target = new p(), this.cursor = new p(), 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: _t.ROTATE, MIDDLE: _t.DOLLY, RIGHT: _t.PAN }, this.touches = { ONE: vt.ROTATE, TWO: vt.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this.getPolarAngle = function() {
101
- return h.phi;
593
+ s(this, E)[n].set(...o);
594
+ }, Ve = new WeakMap();
595
+ const sn = { type: "change" }, Dt = { type: "start" }, an = { type: "end" }, yt = new ei(), rn = new ti(), vi = Math.cos(70 * ni.DEG2RAD);
596
+ class _i extends ii {
597
+ constructor(n, o) {
598
+ super(), this.object = n, this.domElement = o, this.domElement.style.touchAction = "none", this.enabled = !0, this.target = new d(), this.cursor = new d(), 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: Oe.ROTATE, MIDDLE: Oe.DOLLY, RIGHT: Oe.PAN }, this.touches = { ONE: ke.ROTATE, TWO: ke.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this.getPolarAngle = function() {
599
+ return l.phi;
102
600
  }, this.getAzimuthalAngle = function() {
103
- return h.theta;
601
+ return l.theta;
104
602
  }, this.getDistance = function() {
105
603
  return this.object.position.distanceTo(this.target);
106
- }, this.listenToKeyEvents = function(e) {
107
- e.addEventListener("keydown", he), this._domElementKeyEvents = e;
604
+ }, this.listenToKeyEvents = function(t) {
605
+ t.addEventListener("keydown", It), this._domElementKeyEvents = t;
108
606
  }, this.stopListenToKeyEvents = function() {
109
- this._domElementKeyEvents.removeEventListener("keydown", he), this._domElementKeyEvents = null;
607
+ this._domElementKeyEvents.removeEventListener("keydown", It), this._domElementKeyEvents = null;
110
608
  }, this.saveState = function() {
111
- t.target0.copy(t.target), t.position0.copy(t.object.position), t.zoom0 = t.object.zoom;
609
+ e.target0.copy(e.target), e.position0.copy(e.object.position), e.zoom0 = e.object.zoom;
112
610
  }, this.reset = function() {
113
- t.target.copy(t.target0), t.object.position.copy(t.position0), t.object.zoom = t.zoom0, t.object.updateProjectionMatrix(), t.dispatchEvent(Ye), t.update(), l = i.NONE;
611
+ e.target.copy(e.target0), e.object.position.copy(e.position0), e.object.zoom = e.zoom0, e.object.updateProjectionMatrix(), e.dispatchEvent(sn), e.update(), r = a.NONE;
114
612
  }, this.update = function() {
115
- const e = new p(), r = new G().setFromUnitVectors(o.up, new p(0, 1, 0)), u = r.clone().invert(), y = new p(), Y = new G(), st = new p(), Q = 2 * Math.PI;
116
- return function(cn = null) {
117
- const Ae = t.object.position;
118
- e.copy(Ae).sub(t.target), e.applyQuaternion(r), h.setFromVector3(e), t.autoRotate && l === i.NONE && ht(le(cn)), t.enableDamping ? (h.theta += b.theta * t.dampingFactor, h.phi += b.phi * t.dampingFactor) : (h.theta += b.theta, h.phi += b.phi);
119
- let tt = t.minAzimuthAngle, et = t.maxAzimuthAngle;
120
- isFinite(tt) && isFinite(et) && (tt < -Math.PI ? tt += Q : tt > Math.PI && (tt -= Q), et < -Math.PI ? et += Q : et > Math.PI && (et -= Q), tt <= et ? h.theta = Math.max(tt, Math.min(et, h.theta)) : h.theta = h.theta > (tt + et) / 2 ? Math.max(tt, h.theta) : Math.min(et, h.theta)), h.phi = Math.max(t.minPolarAngle, Math.min(t.maxPolarAngle, h.phi)), h.makeSafe(), t.enableDamping === !0 ? t.target.addScaledVector(C, t.dampingFactor) : t.target.add(C), t.target.sub(t.cursor), t.target.clampLength(t.minTargetRadius, t.maxTargetRadius), t.target.add(t.cursor);
121
- let Dt = !1;
122
- if (t.zoomToCursor && Et || t.object.isOrthographicCamera)
123
- h.radius = it(h.radius);
613
+ const t = new d(), c = new V().setFromUnitVectors(n.up, new d(0, 1, 0)), y = c.clone().invert(), g = new d(), C = new V(), pe = new d(), U = 2 * Math.PI;
614
+ return function(Xn = null) {
615
+ const Bt = e.object.position;
616
+ t.copy(Bt).sub(e.target), t.applyQuaternion(c), l.setFromVector3(t), e.autoRotate && r === a.NONE && we(_t(Xn)), e.enableDamping ? (l.theta += m.theta * e.dampingFactor, l.phi += m.phi * e.dampingFactor) : (l.theta += m.theta, l.phi += m.phi);
617
+ let se = e.minAzimuthAngle, ae = e.maxAzimuthAngle;
618
+ isFinite(se) && isFinite(ae) && (se < -Math.PI ? se += U : se > Math.PI && (se -= U), ae < -Math.PI ? ae += U : ae > Math.PI && (ae -= U), se <= ae ? l.theta = Math.max(se, Math.min(ae, l.theta)) : l.theta = l.theta > (se + ae) / 2 ? Math.max(se, l.theta) : Math.min(ae, l.theta)), l.phi = Math.max(e.minPolarAngle, Math.min(e.maxPolarAngle, l.phi)), l.makeSafe(), e.enableDamping === !0 ? e.target.addScaledVector(w, e.dampingFactor) : e.target.add(w), e.target.sub(e.cursor), e.target.clampLength(e.minTargetRadius, e.maxTargetRadius), e.target.add(e.cursor);
619
+ let Ce = !1;
620
+ if (e.zoomToCursor && Te || e.object.isOrthographicCamera)
621
+ l.radius = he(l.radius);
124
622
  else {
125
- const nt = h.radius;
126
- h.radius = it(h.radius * j), Dt = nt != h.radius;
623
+ const re = l.radius;
624
+ l.radius = he(l.radius * f), Ce = re != l.radius;
127
625
  }
128
- if (e.setFromSpherical(h), e.applyQuaternion(u), Ae.copy(t.target).add(e), t.object.lookAt(t.target), t.enableDamping === !0 ? (b.theta *= 1 - t.dampingFactor, b.phi *= 1 - t.dampingFactor, C.multiplyScalar(1 - t.dampingFactor)) : (b.set(0, 0, 0), C.set(0, 0, 0)), t.zoomToCursor && Et) {
129
- let nt = null;
130
- if (t.object.isPerspectiveCamera) {
131
- const Yt = e.length();
132
- nt = it(Yt * j);
133
- const Jt = Yt - nt;
134
- t.object.position.addScaledVector($, Jt), t.object.updateMatrixWorld(), Dt = !!Jt;
135
- } else if (t.object.isOrthographicCamera) {
136
- const Yt = new p(I.x, I.y, 0);
137
- Yt.unproject(t.object);
138
- const Jt = t.object.zoom;
139
- t.object.zoom = Math.max(t.minZoom, Math.min(t.maxZoom, t.object.zoom / j)), t.object.updateProjectionMatrix(), Dt = Jt !== t.object.zoom;
140
- const Le = new p(I.x, I.y, 0);
141
- Le.unproject(t.object), t.object.position.sub(Le).add(Yt), t.object.updateMatrixWorld(), nt = e.length();
626
+ if (t.setFromSpherical(l), t.applyQuaternion(y), Bt.copy(e.target).add(t), e.object.lookAt(e.target), e.enableDamping === !0 ? (m.theta *= 1 - e.dampingFactor, m.phi *= 1 - e.dampingFactor, w.multiplyScalar(1 - e.dampingFactor)) : (m.set(0, 0, 0), w.set(0, 0, 0)), e.zoomToCursor && Te) {
627
+ let re = null;
628
+ if (e.object.isPerspectiveCamera) {
629
+ const Ze = t.length();
630
+ re = he(Ze * f);
631
+ const dt = Ze - re;
632
+ e.object.position.addScaledVector(ie, dt), e.object.updateMatrixWorld(), Ce = !!dt;
633
+ } else if (e.object.isOrthographicCamera) {
634
+ const Ze = new d(R.x, R.y, 0);
635
+ Ze.unproject(e.object);
636
+ const dt = e.object.zoom;
637
+ e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom / f)), e.object.updateProjectionMatrix(), Ce = dt !== e.object.zoom;
638
+ const Vt = new d(R.x, R.y, 0);
639
+ Vt.unproject(e.object), e.object.position.sub(Vt).add(Ze), e.object.updateMatrixWorld(), re = t.length();
142
640
  } else
143
- console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), t.zoomToCursor = !1;
144
- nt !== null && (this.screenSpacePanning ? t.target.set(0, 0, -1).transformDirection(t.object.matrix).multiplyScalar(nt).add(t.object.position) : (ne.origin.copy(t.object.position), ne.direction.set(0, 0, -1).transformDirection(t.object.matrix), Math.abs(t.object.up.dot(ne.direction)) < Mn ? o.lookAt(t.target) : (Re.setFromNormalAndCoplanarPoint(t.object.up, t.target), ne.intersectPlane(Re, t.target))));
145
- } else if (t.object.isOrthographicCamera) {
146
- const nt = t.object.zoom;
147
- t.object.zoom = Math.max(t.minZoom, Math.min(t.maxZoom, t.object.zoom / j)), nt !== t.object.zoom && (t.object.updateProjectionMatrix(), Dt = !0);
641
+ console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), e.zoomToCursor = !1;
642
+ re !== null && (this.screenSpacePanning ? e.target.set(0, 0, -1).transformDirection(e.object.matrix).multiplyScalar(re).add(e.object.position) : (yt.origin.copy(e.object.position), yt.direction.set(0, 0, -1).transformDirection(e.object.matrix), Math.abs(e.object.up.dot(yt.direction)) < vi ? n.lookAt(e.target) : (rn.setFromNormalAndCoplanarPoint(e.object.up, e.target), yt.intersectPlane(rn, e.target))));
643
+ } else if (e.object.isOrthographicCamera) {
644
+ const re = e.object.zoom;
645
+ e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom / f)), re !== e.object.zoom && (e.object.updateProjectionMatrix(), Ce = !0);
148
646
  }
149
- return j = 1, Et = !1, Dt || y.distanceToSquared(t.object.position) > n || 8 * (1 - Y.dot(t.object.quaternion)) > n || st.distanceToSquared(t.target) > n ? (t.dispatchEvent(Ye), y.copy(t.object.position), Y.copy(t.object.quaternion), st.copy(t.target), !0) : !1;
647
+ return f = 1, Te = !1, Ce || g.distanceToSquared(e.object.position) > i || 8 * (1 - C.dot(e.object.quaternion)) > i || pe.distanceToSquared(e.target) > i ? (e.dispatchEvent(sn), g.copy(e.object.position), C.copy(e.object.quaternion), pe.copy(e.target), !0) : !1;
150
648
  };
151
649
  }(), this.dispose = function() {
152
- t.domElement.removeEventListener("contextmenu", Te), t.domElement.removeEventListener("pointerdown", Me), t.domElement.removeEventListener("pointercancel", Ot), t.domElement.removeEventListener("wheel", Se), t.domElement.removeEventListener("pointermove", ce), t.domElement.removeEventListener("pointerup", Ot), t.domElement.getRootNode().removeEventListener("keydown", xe, { capture: !0 }), t._domElementKeyEvents !== null && (t._domElementKeyEvents.removeEventListener("keydown", he), t._domElementKeyEvents = null);
650
+ e.domElement.removeEventListener("contextmenu", Ut), e.domElement.removeEventListener("pointerdown", Nt), e.domElement.removeEventListener("pointercancel", Xe), e.domElement.removeEventListener("wheel", Qt), e.domElement.removeEventListener("pointermove", Tt), e.domElement.removeEventListener("pointerup", Xe), e.domElement.getRootNode().removeEventListener("keydown", qt, { capture: !0 }), e._domElementKeyEvents !== null && (e._domElementKeyEvents.removeEventListener("keydown", It), e._domElementKeyEvents = null);
153
651
  };
154
- const t = this, i = {
652
+ const e = this, a = {
155
653
  NONE: -1,
156
654
  ROTATE: 0,
157
655
  DOLLY: 1,
@@ -161,840 +659,840 @@ class Sn extends un {
161
659
  TOUCH_DOLLY_PAN: 5,
162
660
  TOUCH_DOLLY_ROTATE: 6
163
661
  };
164
- let l = i.NONE;
165
- const n = 1e-6, h = new je(), b = new je();
166
- let j = 1;
167
- const C = new p(), X = new U(), H = new U(), V = new U(), Z = new U(), x = new U(), T = new U(), _ = new U(), g = new U(), E = new U(), $ = new p(), I = new U();
168
- let Et = !1;
169
- const P = [], ct = {};
170
- let jt = !1;
171
- function le(e) {
172
- return e !== null ? 2 * Math.PI / 60 * t.autoRotateSpeed * e : 2 * Math.PI / 60 / 60 * t.autoRotateSpeed;
662
+ let r = a.NONE;
663
+ const i = 1e-6, l = new en(), m = new en();
664
+ let f = 1;
665
+ const w = new d(), H = new J(), Q = new J(), ne = new J(), G = new J(), A = new J(), k = new J(), L = new J(), S = new J(), v = new J(), ie = new d(), R = new J();
666
+ let Te = !1;
667
+ const _ = [], ye = {};
668
+ let ze = !1;
669
+ function _t(t) {
670
+ return t !== null ? 2 * Math.PI / 60 * e.autoRotateSpeed * t : 2 * Math.PI / 60 / 60 * e.autoRotateSpeed;
173
671
  }
174
- function Pt(e) {
175
- const r = Math.abs(e * 0.01);
176
- return Math.pow(0.95, t.zoomSpeed * r);
672
+ function Ie(t) {
673
+ const c = Math.abs(t * 0.01);
674
+ return Math.pow(0.95, e.zoomSpeed * c);
177
675
  }
178
- function ht(e) {
179
- b.theta -= e;
676
+ function we(t) {
677
+ m.theta -= t;
180
678
  }
181
- function Mt(e) {
182
- b.phi -= e;
679
+ function Ae(t) {
680
+ m.phi -= t;
183
681
  }
184
- const N = function() {
185
- const e = new p();
186
- return function(u, y) {
187
- e.setFromMatrixColumn(y, 0), e.multiplyScalar(-u), C.add(e);
682
+ const W = function() {
683
+ const t = new d();
684
+ return function(y, g) {
685
+ t.setFromMatrixColumn(g, 0), t.multiplyScalar(-y), w.add(t);
188
686
  };
189
- }(), O = function() {
190
- const e = new p();
191
- return function(u, y) {
192
- t.screenSpacePanning === !0 ? e.setFromMatrixColumn(y, 1) : (e.setFromMatrixColumn(y, 0), e.crossVectors(t.object.up, e)), e.multiplyScalar(u), C.add(e);
687
+ }(), z = function() {
688
+ const t = new d();
689
+ return function(y, g) {
690
+ e.screenSpacePanning === !0 ? t.setFromMatrixColumn(g, 1) : (t.setFromMatrixColumn(g, 0), t.crossVectors(e.object.up, t)), t.multiplyScalar(y), w.add(t);
193
691
  };
194
- }(), W = function() {
195
- const e = new p();
196
- return function(u, y) {
197
- const Y = t.domElement;
198
- if (t.object.isPerspectiveCamera) {
199
- const st = t.object.position;
200
- e.copy(st).sub(t.target);
201
- let Q = e.length();
202
- Q *= Math.tan(t.object.fov / 2 * Math.PI / 180), N(2 * u * Q / Y.clientHeight, t.object.matrix), O(2 * y * Q / Y.clientHeight, t.object.matrix);
692
+ }(), $ = function() {
693
+ const t = new d();
694
+ return function(y, g) {
695
+ const C = e.domElement;
696
+ if (e.object.isPerspectiveCamera) {
697
+ const pe = e.object.position;
698
+ t.copy(pe).sub(e.target);
699
+ let U = t.length();
700
+ U *= Math.tan(e.object.fov / 2 * Math.PI / 180), W(2 * y * U / C.clientHeight, e.object.matrix), z(2 * g * U / C.clientHeight, e.object.matrix);
203
701
  } else
204
- t.object.isOrthographicCamera ? (N(u * (t.object.right - t.object.left) / t.object.zoom / Y.clientWidth, t.object.matrix), O(y * (t.object.top - t.object.bottom) / t.object.zoom / Y.clientHeight, t.object.matrix)) : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."), t.enablePan = !1);
702
+ e.object.isOrthographicCamera ? (W(y * (e.object.right - e.object.left) / e.object.zoom / C.clientWidth, e.object.matrix), z(g * (e.object.top - e.object.bottom) / e.object.zoom / C.clientHeight, e.object.matrix)) : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."), e.enablePan = !1);
205
703
  };
206
704
  }();
207
- function D(e) {
208
- t.object.isPerspectiveCamera || t.object.isOrthographicCamera ? j /= e : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), t.enableZoom = !1);
705
+ function X(t) {
706
+ e.object.isPerspectiveCamera || e.object.isOrthographicCamera ? f /= t : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), e.enableZoom = !1);
209
707
  }
210
- function J(e) {
211
- t.object.isPerspectiveCamera || t.object.isOrthographicCamera ? j *= e : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), t.enableZoom = !1);
708
+ function oe(t) {
709
+ e.object.isPerspectiveCamera || e.object.isOrthographicCamera ? f *= t : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), e.enableZoom = !1);
212
710
  }
213
- function M(e, r) {
214
- if (!t.zoomToCursor)
711
+ function T(t, c) {
712
+ if (!e.zoomToCursor)
215
713
  return;
216
- Et = !0;
217
- const u = t.domElement.getBoundingClientRect(), y = e - u.left, Y = r - u.top, st = u.width, Q = u.height;
218
- I.x = y / st * 2 - 1, I.y = -(Y / Q) * 2 + 1, $.set(I.x, I.y, 1).unproject(t.object).sub(t.object.position).normalize();
714
+ Te = !0;
715
+ const y = e.domElement.getBoundingClientRect(), g = t - y.left, C = c - y.top, pe = y.width, U = y.height;
716
+ R.x = g / pe * 2 - 1, R.y = -(C / U) * 2 + 1, ie.set(R.x, R.y, 1).unproject(e.object).sub(e.object.position).normalize();
219
717
  }
220
- function it(e) {
221
- return Math.max(t.minDistance, Math.min(t.maxDistance, e));
718
+ function he(t) {
719
+ return Math.max(e.minDistance, Math.min(e.maxDistance, t));
222
720
  }
223
- function pt(e) {
224
- X.set(e.clientX, e.clientY);
721
+ function be(t) {
722
+ H.set(t.clientX, t.clientY);
225
723
  }
226
- function St(e) {
227
- M(e.clientX, e.clientX), _.set(e.clientX, e.clientY);
724
+ function Le(t) {
725
+ T(t.clientX, t.clientX), L.set(t.clientX, t.clientY);
228
726
  }
229
- function Vt(e) {
230
- Z.set(e.clientX, e.clientY);
727
+ function pt(t) {
728
+ G.set(t.clientX, t.clientY);
231
729
  }
232
- function $t(e) {
233
- H.set(e.clientX, e.clientY), V.subVectors(H, X).multiplyScalar(t.rotateSpeed);
234
- const r = t.domElement;
235
- ht(2 * Math.PI * V.x / r.clientHeight), Mt(2 * Math.PI * V.y / r.clientHeight), X.copy(H), t.update();
730
+ function mt(t) {
731
+ Q.set(t.clientX, t.clientY), ne.subVectors(Q, H).multiplyScalar(e.rotateSpeed);
732
+ const c = e.domElement;
733
+ we(2 * Math.PI * ne.x / c.clientHeight), Ae(2 * Math.PI * ne.y / c.clientHeight), H.copy(Q), e.update();
236
734
  }
237
- function We(e) {
238
- g.set(e.clientX, e.clientY), E.subVectors(g, _), E.y > 0 ? D(Pt(E.y)) : E.y < 0 && J(Pt(E.y)), _.copy(g), t.update();
735
+ function xn(t) {
736
+ S.set(t.clientX, t.clientY), v.subVectors(S, L), v.y > 0 ? X(Ie(v.y)) : v.y < 0 && oe(Ie(v.y)), L.copy(S), e.update();
239
737
  }
240
- function Ue(e) {
241
- x.set(e.clientX, e.clientY), T.subVectors(x, Z).multiplyScalar(t.panSpeed), W(T.x, T.y), Z.copy(x), t.update();
738
+ function vn(t) {
739
+ A.set(t.clientX, t.clientY), k.subVectors(A, G).multiplyScalar(e.panSpeed), $(k.x, k.y), G.copy(A), e.update();
242
740
  }
243
- function Ke(e) {
244
- M(e.clientX, e.clientY), e.deltaY < 0 ? J(Pt(e.deltaY)) : e.deltaY > 0 && D(Pt(e.deltaY)), t.update();
741
+ function _n(t) {
742
+ T(t.clientX, t.clientY), t.deltaY < 0 ? oe(Ie(t.deltaY)) : t.deltaY > 0 && X(Ie(t.deltaY)), e.update();
245
743
  }
246
- function Be(e) {
247
- let r = !1;
248
- switch (e.code) {
249
- case t.keys.UP:
250
- e.ctrlKey || e.metaKey || e.shiftKey ? Mt(2 * Math.PI * t.rotateSpeed / t.domElement.clientHeight) : W(0, t.keyPanSpeed), r = !0;
744
+ function Tn(t) {
745
+ let c = !1;
746
+ switch (t.code) {
747
+ case e.keys.UP:
748
+ t.ctrlKey || t.metaKey || t.shiftKey ? Ae(2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : $(0, e.keyPanSpeed), c = !0;
251
749
  break;
252
- case t.keys.BOTTOM:
253
- e.ctrlKey || e.metaKey || e.shiftKey ? Mt(-2 * Math.PI * t.rotateSpeed / t.domElement.clientHeight) : W(0, -t.keyPanSpeed), r = !0;
750
+ case e.keys.BOTTOM:
751
+ t.ctrlKey || t.metaKey || t.shiftKey ? Ae(-2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : $(0, -e.keyPanSpeed), c = !0;
254
752
  break;
255
- case t.keys.LEFT:
256
- e.ctrlKey || e.metaKey || e.shiftKey ? ht(2 * Math.PI * t.rotateSpeed / t.domElement.clientHeight) : W(t.keyPanSpeed, 0), r = !0;
753
+ case e.keys.LEFT:
754
+ t.ctrlKey || t.metaKey || t.shiftKey ? we(2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : $(e.keyPanSpeed, 0), c = !0;
257
755
  break;
258
- case t.keys.RIGHT:
259
- e.ctrlKey || e.metaKey || e.shiftKey ? ht(-2 * Math.PI * t.rotateSpeed / t.domElement.clientHeight) : W(-t.keyPanSpeed, 0), r = !0;
756
+ case e.keys.RIGHT:
757
+ t.ctrlKey || t.metaKey || t.shiftKey ? we(-2 * Math.PI * e.rotateSpeed / e.domElement.clientHeight) : $(-e.keyPanSpeed, 0), c = !0;
260
758
  break;
261
759
  }
262
- r && (e.preventDefault(), t.update());
760
+ c && (t.preventDefault(), e.update());
263
761
  }
264
- function ye(e) {
265
- if (P.length === 1)
266
- X.set(e.pageX, e.pageY);
762
+ function Ht(t) {
763
+ if (_.length === 1)
764
+ H.set(t.pageX, t.pageY);
267
765
  else {
268
- const r = xt(e), u = 0.5 * (e.pageX + r.x), y = 0.5 * (e.pageY + r.y);
269
- X.set(u, y);
766
+ const c = De(t), y = 0.5 * (t.pageX + c.x), g = 0.5 * (t.pageY + c.y);
767
+ H.set(y, g);
270
768
  }
271
769
  }
272
- function we(e) {
273
- if (P.length === 1)
274
- Z.set(e.pageX, e.pageY);
770
+ function zt(t) {
771
+ if (_.length === 1)
772
+ G.set(t.pageX, t.pageY);
275
773
  else {
276
- const r = xt(e), u = 0.5 * (e.pageX + r.x), y = 0.5 * (e.pageY + r.y);
277
- Z.set(u, y);
774
+ const c = De(t), y = 0.5 * (t.pageX + c.x), g = 0.5 * (t.pageY + c.y);
775
+ G.set(y, g);
278
776
  }
279
777
  }
280
- function be(e) {
281
- const r = xt(e), u = e.pageX - r.x, y = e.pageY - r.y, Y = Math.sqrt(u * u + y * y);
282
- _.set(0, Y);
778
+ function Xt(t) {
779
+ const c = De(t), y = t.pageX - c.x, g = t.pageY - c.y, C = Math.sqrt(y * y + g * g);
780
+ L.set(0, C);
283
781
  }
284
- function Ve(e) {
285
- t.enableZoom && be(e), t.enablePan && we(e);
782
+ function In(t) {
783
+ e.enableZoom && Xt(t), e.enablePan && zt(t);
286
784
  }
287
- function $e(e) {
288
- t.enableZoom && be(e), t.enableRotate && ye(e);
785
+ function An(t) {
786
+ e.enableZoom && Xt(t), e.enableRotate && Ht(t);
289
787
  }
290
- function ge(e) {
291
- if (P.length == 1)
292
- H.set(e.pageX, e.pageY);
788
+ function Ct(t) {
789
+ if (_.length == 1)
790
+ Q.set(t.pageX, t.pageY);
293
791
  else {
294
- const u = xt(e), y = 0.5 * (e.pageX + u.x), Y = 0.5 * (e.pageY + u.y);
295
- H.set(y, Y);
792
+ const y = De(t), g = 0.5 * (t.pageX + y.x), C = 0.5 * (t.pageY + y.y);
793
+ Q.set(g, C);
296
794
  }
297
- V.subVectors(H, X).multiplyScalar(t.rotateSpeed);
298
- const r = t.domElement;
299
- ht(2 * Math.PI * V.x / r.clientHeight), Mt(2 * Math.PI * V.y / r.clientHeight), X.copy(H);
795
+ ne.subVectors(Q, H).multiplyScalar(e.rotateSpeed);
796
+ const c = e.domElement;
797
+ we(2 * Math.PI * ne.x / c.clientHeight), Ae(2 * Math.PI * ne.y / c.clientHeight), H.copy(Q);
300
798
  }
301
- function Ee(e) {
302
- if (P.length === 1)
303
- x.set(e.pageX, e.pageY);
799
+ function Zt(t) {
800
+ if (_.length === 1)
801
+ A.set(t.pageX, t.pageY);
304
802
  else {
305
- const r = xt(e), u = 0.5 * (e.pageX + r.x), y = 0.5 * (e.pageY + r.y);
306
- x.set(u, y);
803
+ const c = De(t), y = 0.5 * (t.pageX + c.x), g = 0.5 * (t.pageY + c.y);
804
+ A.set(y, g);
307
805
  }
308
- T.subVectors(x, Z).multiplyScalar(t.panSpeed), W(T.x, T.y), Z.copy(x);
806
+ k.subVectors(A, G).multiplyScalar(e.panSpeed), $(k.x, k.y), G.copy(A);
309
807
  }
310
- function Pe(e) {
311
- const r = xt(e), u = e.pageX - r.x, y = e.pageY - r.y, Y = Math.sqrt(u * u + y * y);
312
- g.set(0, Y), E.set(0, Math.pow(g.y / _.y, t.zoomSpeed)), D(E.y), _.copy(g);
313
- const st = (e.pageX + r.x) * 0.5, Q = (e.pageY + r.y) * 0.5;
314
- M(st, Q);
808
+ function Ft(t) {
809
+ const c = De(t), y = t.pageX - c.x, g = t.pageY - c.y, C = Math.sqrt(y * y + g * g);
810
+ S.set(0, C), v.set(0, Math.pow(S.y / L.y, e.zoomSpeed)), X(v.y), L.copy(S);
811
+ const pe = (t.pageX + c.x) * 0.5, U = (t.pageY + c.y) * 0.5;
812
+ T(pe, U);
315
813
  }
316
- function Je(e) {
317
- t.enableZoom && Pe(e), t.enablePan && Ee(e);
814
+ function Ln(t) {
815
+ e.enableZoom && Ft(t), e.enablePan && Zt(t);
318
816
  }
319
- function tn(e) {
320
- t.enableZoom && Pe(e), t.enableRotate && ge(e);
817
+ function Dn(t) {
818
+ e.enableZoom && Ft(t), e.enableRotate && Ct(t);
321
819
  }
322
- function Me(e) {
323
- t.enabled !== !1 && (P.length === 0 && (t.domElement.setPointerCapture(e.pointerId), t.domElement.addEventListener("pointermove", ce), t.domElement.addEventListener("pointerup", Ot)), !ln(e) && (an(e), e.pointerType === "touch" ? ve(e) : en(e)));
820
+ function Nt(t) {
821
+ e.enabled !== !1 && (_.length === 0 && (e.domElement.setPointerCapture(t.pointerId), e.domElement.addEventListener("pointermove", Tt), e.domElement.addEventListener("pointerup", Xe)), !zn(t) && (jn(t), t.pointerType === "touch" ? Wt(t) : On(t)));
324
822
  }
325
- function ce(e) {
326
- t.enabled !== !1 && (e.pointerType === "touch" ? sn(e) : nn(e));
823
+ function Tt(t) {
824
+ e.enabled !== !1 && (t.pointerType === "touch" ? Yn(t) : kn(t));
327
825
  }
328
- function Ot(e) {
329
- switch (rn(e), P.length) {
826
+ function Xe(t) {
827
+ switch (Hn(t), _.length) {
330
828
  case 0:
331
- t.domElement.releasePointerCapture(e.pointerId), t.domElement.removeEventListener("pointermove", ce), t.domElement.removeEventListener("pointerup", Ot), t.dispatchEvent(ke), l = i.NONE;
829
+ e.domElement.releasePointerCapture(t.pointerId), e.domElement.removeEventListener("pointermove", Tt), e.domElement.removeEventListener("pointerup", Xe), e.dispatchEvent(an), r = a.NONE;
332
830
  break;
333
831
  case 1:
334
- const r = P[0], u = ct[r];
335
- ve({ pointerId: r, pageX: u.x, pageY: u.y });
832
+ const c = _[0], y = ye[c];
833
+ Wt({ pointerId: c, pageX: y.x, pageY: y.y });
336
834
  break;
337
835
  }
338
836
  }
339
- function en(e) {
340
- let r;
341
- switch (e.button) {
837
+ function On(t) {
838
+ let c;
839
+ switch (t.button) {
342
840
  case 0:
343
- r = t.mouseButtons.LEFT;
841
+ c = e.mouseButtons.LEFT;
344
842
  break;
345
843
  case 1:
346
- r = t.mouseButtons.MIDDLE;
844
+ c = e.mouseButtons.MIDDLE;
347
845
  break;
348
846
  case 2:
349
- r = t.mouseButtons.RIGHT;
847
+ c = e.mouseButtons.RIGHT;
350
848
  break;
351
849
  default:
352
- r = -1;
850
+ c = -1;
353
851
  }
354
- switch (r) {
355
- case _t.DOLLY:
356
- if (t.enableZoom === !1)
852
+ switch (c) {
853
+ case Oe.DOLLY:
854
+ if (e.enableZoom === !1)
357
855
  return;
358
- St(e), l = i.DOLLY;
856
+ Le(t), r = a.DOLLY;
359
857
  break;
360
- case _t.ROTATE:
361
- if (e.ctrlKey || e.metaKey || e.shiftKey) {
362
- if (t.enablePan === !1)
858
+ case Oe.ROTATE:
859
+ if (t.ctrlKey || t.metaKey || t.shiftKey) {
860
+ if (e.enablePan === !1)
363
861
  return;
364
- Vt(e), l = i.PAN;
862
+ pt(t), r = a.PAN;
365
863
  } else {
366
- if (t.enableRotate === !1)
864
+ if (e.enableRotate === !1)
367
865
  return;
368
- pt(e), l = i.ROTATE;
866
+ be(t), r = a.ROTATE;
369
867
  }
370
868
  break;
371
- case _t.PAN:
372
- if (e.ctrlKey || e.metaKey || e.shiftKey) {
373
- if (t.enableRotate === !1)
869
+ case Oe.PAN:
870
+ if (t.ctrlKey || t.metaKey || t.shiftKey) {
871
+ if (e.enableRotate === !1)
374
872
  return;
375
- pt(e), l = i.ROTATE;
873
+ be(t), r = a.ROTATE;
376
874
  } else {
377
- if (t.enablePan === !1)
875
+ if (e.enablePan === !1)
378
876
  return;
379
- Vt(e), l = i.PAN;
877
+ pt(t), r = a.PAN;
380
878
  }
381
879
  break;
382
880
  default:
383
- l = i.NONE;
881
+ r = a.NONE;
384
882
  }
385
- l !== i.NONE && t.dispatchEvent(de);
883
+ r !== a.NONE && e.dispatchEvent(Dt);
386
884
  }
387
- function nn(e) {
388
- switch (l) {
389
- case i.ROTATE:
390
- if (t.enableRotate === !1)
885
+ function kn(t) {
886
+ switch (r) {
887
+ case a.ROTATE:
888
+ if (e.enableRotate === !1)
391
889
  return;
392
- $t(e);
890
+ mt(t);
393
891
  break;
394
- case i.DOLLY:
395
- if (t.enableZoom === !1)
892
+ case a.DOLLY:
893
+ if (e.enableZoom === !1)
396
894
  return;
397
- We(e);
895
+ xn(t);
398
896
  break;
399
- case i.PAN:
400
- if (t.enablePan === !1)
897
+ case a.PAN:
898
+ if (e.enablePan === !1)
401
899
  return;
402
- Ue(e);
900
+ vn(t);
403
901
  break;
404
902
  }
405
903
  }
406
- function Se(e) {
407
- t.enabled === !1 || t.enableZoom === !1 || l !== i.NONE || (e.preventDefault(), t.dispatchEvent(de), Ke(on(e)), t.dispatchEvent(ke));
904
+ function Qt(t) {
905
+ e.enabled === !1 || e.enableZoom === !1 || r !== a.NONE || (t.preventDefault(), e.dispatchEvent(Dt), _n(Rn(t)), e.dispatchEvent(an));
408
906
  }
409
- function on(e) {
410
- const r = e.deltaMode, u = {
411
- clientX: e.clientX,
412
- clientY: e.clientY,
413
- deltaY: e.deltaY
907
+ function Rn(t) {
908
+ const c = t.deltaMode, y = {
909
+ clientX: t.clientX,
910
+ clientY: t.clientY,
911
+ deltaY: t.deltaY
414
912
  };
415
- switch (r) {
913
+ switch (c) {
416
914
  case 1:
417
- u.deltaY *= 16;
915
+ y.deltaY *= 16;
418
916
  break;
419
917
  case 2:
420
- u.deltaY *= 100;
918
+ y.deltaY *= 100;
421
919
  break;
422
920
  }
423
- return e.ctrlKey && !jt && (u.deltaY *= 10), u;
921
+ return t.ctrlKey && !ze && (y.deltaY *= 10), y;
424
922
  }
425
- function xe(e) {
426
- e.key === "Control" && (jt = !0, t.domElement.getRootNode().addEventListener("keyup", _e, { passive: !0, capture: !0 }));
923
+ function qt(t) {
924
+ t.key === "Control" && (ze = !0, e.domElement.getRootNode().addEventListener("keyup", Gt, { passive: !0, capture: !0 }));
427
925
  }
428
- function _e(e) {
429
- e.key === "Control" && (jt = !1, t.domElement.getRootNode().removeEventListener("keyup", _e, { passive: !0, capture: !0 }));
926
+ function Gt(t) {
927
+ t.key === "Control" && (ze = !1, e.domElement.getRootNode().removeEventListener("keyup", Gt, { passive: !0, capture: !0 }));
430
928
  }
431
- function he(e) {
432
- t.enabled === !1 || t.enablePan === !1 || Be(e);
929
+ function It(t) {
930
+ e.enabled === !1 || e.enablePan === !1 || Tn(t);
433
931
  }
434
- function ve(e) {
435
- switch (Ie(e), P.length) {
932
+ function Wt(t) {
933
+ switch (Kt(t), _.length) {
436
934
  case 1:
437
- switch (t.touches.ONE) {
438
- case vt.ROTATE:
439
- if (t.enableRotate === !1)
935
+ switch (e.touches.ONE) {
936
+ case ke.ROTATE:
937
+ if (e.enableRotate === !1)
440
938
  return;
441
- ye(e), l = i.TOUCH_ROTATE;
939
+ Ht(t), r = a.TOUCH_ROTATE;
442
940
  break;
443
- case vt.PAN:
444
- if (t.enablePan === !1)
941
+ case ke.PAN:
942
+ if (e.enablePan === !1)
445
943
  return;
446
- we(e), l = i.TOUCH_PAN;
944
+ zt(t), r = a.TOUCH_PAN;
447
945
  break;
448
946
  default:
449
- l = i.NONE;
947
+ r = a.NONE;
450
948
  }
451
949
  break;
452
950
  case 2:
453
- switch (t.touches.TWO) {
454
- case vt.DOLLY_PAN:
455
- if (t.enableZoom === !1 && t.enablePan === !1)
951
+ switch (e.touches.TWO) {
952
+ case ke.DOLLY_PAN:
953
+ if (e.enableZoom === !1 && e.enablePan === !1)
456
954
  return;
457
- Ve(e), l = i.TOUCH_DOLLY_PAN;
955
+ In(t), r = a.TOUCH_DOLLY_PAN;
458
956
  break;
459
- case vt.DOLLY_ROTATE:
460
- if (t.enableZoom === !1 && t.enableRotate === !1)
957
+ case ke.DOLLY_ROTATE:
958
+ if (e.enableZoom === !1 && e.enableRotate === !1)
461
959
  return;
462
- $e(e), l = i.TOUCH_DOLLY_ROTATE;
960
+ An(t), r = a.TOUCH_DOLLY_ROTATE;
463
961
  break;
464
962
  default:
465
- l = i.NONE;
963
+ r = a.NONE;
466
964
  }
467
965
  break;
468
966
  default:
469
- l = i.NONE;
967
+ r = a.NONE;
470
968
  }
471
- l !== i.NONE && t.dispatchEvent(de);
969
+ r !== a.NONE && e.dispatchEvent(Dt);
472
970
  }
473
- function sn(e) {
474
- switch (Ie(e), l) {
475
- case i.TOUCH_ROTATE:
476
- if (t.enableRotate === !1)
971
+ function Yn(t) {
972
+ switch (Kt(t), r) {
973
+ case a.TOUCH_ROTATE:
974
+ if (e.enableRotate === !1)
477
975
  return;
478
- ge(e), t.update();
976
+ Ct(t), e.update();
479
977
  break;
480
- case i.TOUCH_PAN:
481
- if (t.enablePan === !1)
978
+ case a.TOUCH_PAN:
979
+ if (e.enablePan === !1)
482
980
  return;
483
- Ee(e), t.update();
981
+ Zt(t), e.update();
484
982
  break;
485
- case i.TOUCH_DOLLY_PAN:
486
- if (t.enableZoom === !1 && t.enablePan === !1)
983
+ case a.TOUCH_DOLLY_PAN:
984
+ if (e.enableZoom === !1 && e.enablePan === !1)
487
985
  return;
488
- Je(e), t.update();
986
+ Ln(t), e.update();
489
987
  break;
490
- case i.TOUCH_DOLLY_ROTATE:
491
- if (t.enableZoom === !1 && t.enableRotate === !1)
988
+ case a.TOUCH_DOLLY_ROTATE:
989
+ if (e.enableZoom === !1 && e.enableRotate === !1)
492
990
  return;
493
- tn(e), t.update();
991
+ Dn(t), e.update();
494
992
  break;
495
993
  default:
496
- l = i.NONE;
994
+ r = a.NONE;
497
995
  }
498
996
  }
499
- function Te(e) {
500
- t.enabled !== !1 && e.preventDefault();
997
+ function Ut(t) {
998
+ e.enabled !== !1 && t.preventDefault();
501
999
  }
502
- function an(e) {
503
- P.push(e.pointerId);
1000
+ function jn(t) {
1001
+ _.push(t.pointerId);
504
1002
  }
505
- function rn(e) {
506
- delete ct[e.pointerId];
507
- for (let r = 0; r < P.length; r++)
508
- if (P[r] == e.pointerId) {
509
- P.splice(r, 1);
1003
+ function Hn(t) {
1004
+ delete ye[t.pointerId];
1005
+ for (let c = 0; c < _.length; c++)
1006
+ if (_[c] == t.pointerId) {
1007
+ _.splice(c, 1);
510
1008
  return;
511
1009
  }
512
1010
  }
513
- function ln(e) {
514
- for (let r = 0; r < P.length; r++)
515
- if (P[r] == e.pointerId)
1011
+ function zn(t) {
1012
+ for (let c = 0; c < _.length; c++)
1013
+ if (_[c] == t.pointerId)
516
1014
  return !0;
517
1015
  return !1;
518
1016
  }
519
- function Ie(e) {
520
- let r = ct[e.pointerId];
521
- r === void 0 && (r = new U(), ct[e.pointerId] = r), r.set(e.pageX, e.pageY);
1017
+ function Kt(t) {
1018
+ let c = ye[t.pointerId];
1019
+ c === void 0 && (c = new J(), ye[t.pointerId] = c), c.set(t.pageX, t.pageY);
522
1020
  }
523
- function xt(e) {
524
- const r = e.pointerId === P[0] ? P[1] : P[0];
525
- return ct[r];
1021
+ function De(t) {
1022
+ const c = t.pointerId === _[0] ? _[1] : _[0];
1023
+ return ye[c];
526
1024
  }
527
- t.domElement.addEventListener("contextmenu", Te), t.domElement.addEventListener("pointerdown", Me), t.domElement.addEventListener("pointercancel", Ot), t.domElement.addEventListener("wheel", Se, { passive: !1 }), t.domElement.getRootNode().addEventListener("keydown", xe, { passive: !0, capture: !0 }), this.update();
1025
+ e.domElement.addEventListener("contextmenu", Ut), e.domElement.addEventListener("pointerdown", Nt), e.domElement.addEventListener("pointercancel", Xe), e.domElement.addEventListener("wheel", Qt, { passive: !1 }), e.domElement.getRootNode().addEventListener("keydown", qt, { passive: !0, capture: !0 }), this.update();
528
1026
  }
529
1027
  }
530
- const dt = new mn(), A = new p(), rt = new p(), w = new G(), ze = {
531
- X: new p(1, 0, 0),
532
- Y: new p(0, 1, 0),
533
- Z: new p(0, 0, 1)
534
- }, ue = { type: "change" }, Ce = { type: "mouseDown", mode: null }, Xe = { type: "mouseUp", mode: null }, He = { type: "objectChange" };
535
- class xn extends fe {
536
- constructor(o, a) {
537
- super(), a === void 0 && (console.warn('THREE.TransformControls: The second parameter "domElement" is now mandatory.'), a = document), this.isTransformControls = !0, this.visible = !1, this.domElement = a, this.domElement.style.touchAction = "none";
538
- const t = new Ln();
539
- this._gizmo = t, this.add(t);
540
- const i = new jn();
541
- this._plane = i, this.add(i);
542
- const l = this;
543
- function n(g, E) {
544
- let $ = E;
545
- Object.defineProperty(l, g, {
1028
+ const ge = new oi(), j = new d(), de = new d(), M = new V(), ln = {
1029
+ X: new d(1, 0, 0),
1030
+ Y: new d(0, 1, 0),
1031
+ Z: new d(0, 0, 1)
1032
+ }, Ot = { type: "change" }, cn = { type: "mouseDown", mode: null }, hn = { type: "mouseUp", mode: null }, pn = { type: "objectChange" };
1033
+ class Ti extends Rt {
1034
+ constructor(n, o) {
1035
+ super(), o === void 0 && (console.warn('THREE.TransformControls: The second parameter "domElement" is now mandatory.'), o = document), this.isTransformControls = !0, this.visible = !1, this.domElement = o, this.domElement.style.touchAction = "none";
1036
+ const e = new ki();
1037
+ this._gizmo = e, this.add(e);
1038
+ const a = new Ri();
1039
+ this._plane = a, this.add(a);
1040
+ const r = this;
1041
+ function i(S, v) {
1042
+ let ie = v;
1043
+ Object.defineProperty(r, S, {
546
1044
  get: function() {
547
- return $ !== void 0 ? $ : E;
1045
+ return ie !== void 0 ? ie : v;
548
1046
  },
549
- set: function(I) {
550
- $ !== I && ($ = I, i[g] = I, t[g] = I, l.dispatchEvent({ type: g + "-changed", value: I }), l.dispatchEvent(ue));
1047
+ set: function(R) {
1048
+ ie !== R && (ie = R, a[S] = R, e[S] = R, r.dispatchEvent({ type: S + "-changed", value: R }), r.dispatchEvent(Ot));
551
1049
  }
552
- }), l[g] = E, i[g] = E, t[g] = E;
1050
+ }), r[S] = v, a[S] = v, e[S] = v;
553
1051
  }
554
- n("camera", o), n("object", void 0), n("enabled", !0), n("axis", null), n("mode", "translate"), n("translationSnap", null), n("rotationSnap", null), n("scaleSnap", null), n("space", "world"), n("size", 1), n("dragging", !1), n("showX", !0), n("showY", !0), n("showZ", !0);
555
- const h = new p(), b = new p(), j = new G(), C = new G(), X = new p(), H = new G(), V = new p(), Z = new p(), x = new p(), T = 0, _ = new p();
556
- n("worldPosition", h), n("worldPositionStart", b), n("worldQuaternion", j), n("worldQuaternionStart", C), n("cameraPosition", X), n("cameraQuaternion", H), n("pointStart", V), n("pointEnd", Z), n("rotationAxis", x), n("rotationAngle", T), n("eye", _), this._offset = new p(), this._startNorm = new p(), this._endNorm = new p(), this._cameraScale = new p(), this._parentPosition = new p(), this._parentQuaternion = new G(), this._parentQuaternionInv = new G(), this._parentScale = new p(), this._worldScaleStart = new p(), this._worldQuaternionInv = new G(), this._worldScale = new p(), this._positionStart = new p(), this._quaternionStart = new G(), this._scaleStart = new p(), this._getPointer = _n.bind(this), this._onPointerDown = Tn.bind(this), this._onPointerHover = vn.bind(this), this._onPointerMove = In.bind(this), this._onPointerUp = An.bind(this), this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointermove", this._onPointerHover), this.domElement.addEventListener("pointerup", this._onPointerUp);
1052
+ i("camera", n), i("object", void 0), i("enabled", !0), i("axis", null), i("mode", "translate"), i("translationSnap", null), i("rotationSnap", null), i("scaleSnap", null), i("space", "world"), i("size", 1), i("dragging", !1), i("showX", !0), i("showY", !0), i("showZ", !0);
1053
+ const l = new d(), m = new d(), f = new V(), w = new V(), H = new d(), Q = new V(), ne = new d(), G = new d(), A = new d(), k = 0, L = new d();
1054
+ i("worldPosition", l), i("worldPositionStart", m), i("worldQuaternion", f), i("worldQuaternionStart", w), i("cameraPosition", H), i("cameraQuaternion", Q), i("pointStart", ne), i("pointEnd", G), i("rotationAxis", A), i("rotationAngle", k), i("eye", L), this._offset = new d(), this._startNorm = new d(), this._endNorm = new d(), this._cameraScale = new d(), this._parentPosition = new d(), this._parentQuaternion = new V(), this._parentQuaternionInv = new V(), this._parentScale = new d(), this._worldScaleStart = new d(), this._worldQuaternionInv = new V(), this._worldScale = new d(), this._positionStart = new d(), this._quaternionStart = new V(), this._scaleStart = new d(), this._getPointer = Ii.bind(this), this._onPointerDown = Li.bind(this), this._onPointerHover = Ai.bind(this), this._onPointerMove = Di.bind(this), this._onPointerUp = Oi.bind(this), this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointermove", this._onPointerHover), this.domElement.addEventListener("pointerup", this._onPointerUp);
557
1055
  }
558
1056
  // updateMatrixWorld updates key transformation variables
559
- updateMatrixWorld(o) {
560
- this.object !== void 0 && (this.object.updateMatrixWorld(), this.object.parent === null ? console.error("TransformControls: The attached 3D object must be a part of the scene graph.") : this.object.parent.matrixWorld.decompose(this._parentPosition, this._parentQuaternion, this._parentScale), this.object.matrixWorld.decompose(this.worldPosition, this.worldQuaternion, this._worldScale), this._parentQuaternionInv.copy(this._parentQuaternion).invert(), this._worldQuaternionInv.copy(this.worldQuaternion).invert()), this.camera.updateMatrixWorld(), this.camera.matrixWorld.decompose(this.cameraPosition, this.cameraQuaternion, this._cameraScale), this.camera.isOrthographicCamera ? this.camera.getWorldDirection(this.eye).negate() : this.eye.copy(this.cameraPosition).sub(this.worldPosition).normalize(), super.updateMatrixWorld(o);
1057
+ updateMatrixWorld(n) {
1058
+ this.object !== void 0 && (this.object.updateMatrixWorld(), this.object.parent === null ? console.error("TransformControls: The attached 3D object must be a part of the scene graph.") : this.object.parent.matrixWorld.decompose(this._parentPosition, this._parentQuaternion, this._parentScale), this.object.matrixWorld.decompose(this.worldPosition, this.worldQuaternion, this._worldScale), this._parentQuaternionInv.copy(this._parentQuaternion).invert(), this._worldQuaternionInv.copy(this.worldQuaternion).invert()), this.camera.updateMatrixWorld(), this.camera.matrixWorld.decompose(this.cameraPosition, this.cameraQuaternion, this._cameraScale), this.camera.isOrthographicCamera ? this.camera.getWorldDirection(this.eye).negate() : this.eye.copy(this.cameraPosition).sub(this.worldPosition).normalize(), super.updateMatrixWorld(n);
561
1059
  }
562
- pointerHover(o) {
1060
+ pointerHover(n) {
563
1061
  if (this.object === void 0 || this.dragging === !0)
564
1062
  return;
565
- o !== null && dt.setFromCamera(o, this.camera);
566
- const a = me(this._gizmo.picker[this.mode], dt);
567
- a ? this.axis = a.object.name : this.axis = null;
1063
+ n !== null && ge.setFromCamera(n, this.camera);
1064
+ const o = kt(this._gizmo.picker[this.mode], ge);
1065
+ o ? this.axis = o.object.name : this.axis = null;
568
1066
  }
569
- pointerDown(o) {
570
- if (!(this.object === void 0 || this.dragging === !0 || o != null && o.button !== 0) && this.axis !== null) {
571
- o !== null && dt.setFromCamera(o, this.camera);
572
- const a = me(this._plane, dt, !0);
573
- a && (this.object.updateMatrixWorld(), this.object.parent.updateMatrixWorld(), this._positionStart.copy(this.object.position), this._quaternionStart.copy(this.object.quaternion), this._scaleStart.copy(this.object.scale), this.object.matrixWorld.decompose(this.worldPositionStart, this.worldQuaternionStart, this._worldScaleStart), this.pointStart.copy(a.point).sub(this.worldPositionStart)), this.dragging = !0, Ce.mode = this.mode, this.dispatchEvent(Ce);
1067
+ pointerDown(n) {
1068
+ if (!(this.object === void 0 || this.dragging === !0 || n != null && n.button !== 0) && this.axis !== null) {
1069
+ n !== null && ge.setFromCamera(n, this.camera);
1070
+ const o = kt(this._plane, ge, !0);
1071
+ o && (this.object.updateMatrixWorld(), this.object.parent.updateMatrixWorld(), this._positionStart.copy(this.object.position), this._quaternionStart.copy(this.object.quaternion), this._scaleStart.copy(this.object.scale), this.object.matrixWorld.decompose(this.worldPositionStart, this.worldQuaternionStart, this._worldScaleStart), this.pointStart.copy(o.point).sub(this.worldPositionStart)), this.dragging = !0, cn.mode = this.mode, this.dispatchEvent(cn);
574
1072
  }
575
1073
  }
576
- pointerMove(o) {
577
- const a = this.axis, t = this.mode, i = this.object;
578
- let l = this.space;
579
- if (t === "scale" ? l = "local" : (a === "E" || a === "XYZE" || a === "XYZ") && (l = "world"), i === void 0 || a === null || this.dragging === !1 || o !== null && o.button !== -1)
1074
+ pointerMove(n) {
1075
+ const o = this.axis, e = this.mode, a = this.object;
1076
+ let r = this.space;
1077
+ if (e === "scale" ? r = "local" : (o === "E" || o === "XYZE" || o === "XYZ") && (r = "world"), a === void 0 || o === null || this.dragging === !1 || n !== null && n.button !== -1)
580
1078
  return;
581
- o !== null && dt.setFromCamera(o, this.camera);
582
- const n = me(this._plane, dt, !0);
583
- if (n) {
584
- if (this.pointEnd.copy(n.point).sub(this.worldPositionStart), t === "translate")
585
- this._offset.copy(this.pointEnd).sub(this.pointStart), l === "local" && a !== "XYZ" && this._offset.applyQuaternion(this._worldQuaternionInv), a.indexOf("X") === -1 && (this._offset.x = 0), a.indexOf("Y") === -1 && (this._offset.y = 0), a.indexOf("Z") === -1 && (this._offset.z = 0), l === "local" && a !== "XYZ" ? this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale) : this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale), i.position.copy(this._offset).add(this._positionStart), this.translationSnap && (l === "local" && (i.position.applyQuaternion(w.copy(this._quaternionStart).invert()), a.search("X") !== -1 && (i.position.x = Math.round(i.position.x / this.translationSnap) * this.translationSnap), a.search("Y") !== -1 && (i.position.y = Math.round(i.position.y / this.translationSnap) * this.translationSnap), a.search("Z") !== -1 && (i.position.z = Math.round(i.position.z / this.translationSnap) * this.translationSnap), i.position.applyQuaternion(this._quaternionStart)), l === "world" && (i.parent && i.position.add(A.setFromMatrixPosition(i.parent.matrixWorld)), a.search("X") !== -1 && (i.position.x = Math.round(i.position.x / this.translationSnap) * this.translationSnap), a.search("Y") !== -1 && (i.position.y = Math.round(i.position.y / this.translationSnap) * this.translationSnap), a.search("Z") !== -1 && (i.position.z = Math.round(i.position.z / this.translationSnap) * this.translationSnap), i.parent && i.position.sub(A.setFromMatrixPosition(i.parent.matrixWorld))));
586
- else if (t === "scale") {
587
- if (a.search("XYZ") !== -1) {
588
- let h = this.pointEnd.length() / this.pointStart.length();
589
- this.pointEnd.dot(this.pointStart) < 0 && (h *= -1), rt.set(h, h, h);
1079
+ n !== null && ge.setFromCamera(n, this.camera);
1080
+ const i = kt(this._plane, ge, !0);
1081
+ if (i) {
1082
+ if (this.pointEnd.copy(i.point).sub(this.worldPositionStart), e === "translate")
1083
+ this._offset.copy(this.pointEnd).sub(this.pointStart), r === "local" && o !== "XYZ" && this._offset.applyQuaternion(this._worldQuaternionInv), o.indexOf("X") === -1 && (this._offset.x = 0), o.indexOf("Y") === -1 && (this._offset.y = 0), o.indexOf("Z") === -1 && (this._offset.z = 0), r === "local" && o !== "XYZ" ? this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale) : this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale), a.position.copy(this._offset).add(this._positionStart), this.translationSnap && (r === "local" && (a.position.applyQuaternion(M.copy(this._quaternionStart).invert()), o.search("X") !== -1 && (a.position.x = Math.round(a.position.x / this.translationSnap) * this.translationSnap), o.search("Y") !== -1 && (a.position.y = Math.round(a.position.y / this.translationSnap) * this.translationSnap), o.search("Z") !== -1 && (a.position.z = Math.round(a.position.z / this.translationSnap) * this.translationSnap), a.position.applyQuaternion(this._quaternionStart)), r === "world" && (a.parent && a.position.add(j.setFromMatrixPosition(a.parent.matrixWorld)), o.search("X") !== -1 && (a.position.x = Math.round(a.position.x / this.translationSnap) * this.translationSnap), o.search("Y") !== -1 && (a.position.y = Math.round(a.position.y / this.translationSnap) * this.translationSnap), o.search("Z") !== -1 && (a.position.z = Math.round(a.position.z / this.translationSnap) * this.translationSnap), a.parent && a.position.sub(j.setFromMatrixPosition(a.parent.matrixWorld))));
1084
+ else if (e === "scale") {
1085
+ if (o.search("XYZ") !== -1) {
1086
+ let l = this.pointEnd.length() / this.pointStart.length();
1087
+ this.pointEnd.dot(this.pointStart) < 0 && (l *= -1), de.set(l, l, l);
590
1088
  } else
591
- A.copy(this.pointStart), rt.copy(this.pointEnd), A.applyQuaternion(this._worldQuaternionInv), rt.applyQuaternion(this._worldQuaternionInv), rt.divide(A), a.search("X") === -1 && (rt.x = 1), a.search("Y") === -1 && (rt.y = 1), a.search("Z") === -1 && (rt.z = 1);
592
- i.scale.copy(this._scaleStart).multiply(rt), this.scaleSnap && (a.search("X") !== -1 && (i.scale.x = Math.round(i.scale.x / this.scaleSnap) * this.scaleSnap || this.scaleSnap), a.search("Y") !== -1 && (i.scale.y = Math.round(i.scale.y / this.scaleSnap) * this.scaleSnap || this.scaleSnap), a.search("Z") !== -1 && (i.scale.z = Math.round(i.scale.z / this.scaleSnap) * this.scaleSnap || this.scaleSnap));
593
- } else if (t === "rotate") {
1089
+ j.copy(this.pointStart), de.copy(this.pointEnd), j.applyQuaternion(this._worldQuaternionInv), de.applyQuaternion(this._worldQuaternionInv), de.divide(j), o.search("X") === -1 && (de.x = 1), o.search("Y") === -1 && (de.y = 1), o.search("Z") === -1 && (de.z = 1);
1090
+ a.scale.copy(this._scaleStart).multiply(de), this.scaleSnap && (o.search("X") !== -1 && (a.scale.x = Math.round(a.scale.x / this.scaleSnap) * this.scaleSnap || this.scaleSnap), o.search("Y") !== -1 && (a.scale.y = Math.round(a.scale.y / this.scaleSnap) * this.scaleSnap || this.scaleSnap), o.search("Z") !== -1 && (a.scale.z = Math.round(a.scale.z / this.scaleSnap) * this.scaleSnap || this.scaleSnap));
1091
+ } else if (e === "rotate") {
594
1092
  this._offset.copy(this.pointEnd).sub(this.pointStart);
595
- const h = 20 / this.worldPosition.distanceTo(A.setFromMatrixPosition(this.camera.matrixWorld));
596
- let b = !1;
597
- a === "XYZE" ? (this.rotationAxis.copy(this._offset).cross(this.eye).normalize(), this.rotationAngle = this._offset.dot(A.copy(this.rotationAxis).cross(this.eye)) * h) : (a === "X" || a === "Y" || a === "Z") && (this.rotationAxis.copy(ze[a]), A.copy(ze[a]), l === "local" && A.applyQuaternion(this.worldQuaternion), A.cross(this.eye), A.length() === 0 ? b = !0 : this.rotationAngle = this._offset.dot(A.normalize()) * h), (a === "E" || b) && (this.rotationAxis.copy(this.eye), this.rotationAngle = this.pointEnd.angleTo(this.pointStart), this._startNorm.copy(this.pointStart).normalize(), this._endNorm.copy(this.pointEnd).normalize(), this.rotationAngle *= this._endNorm.cross(this._startNorm).dot(this.eye) < 0 ? 1 : -1), this.rotationSnap && (this.rotationAngle = Math.round(this.rotationAngle / this.rotationSnap) * this.rotationSnap), l === "local" && a !== "E" && a !== "XYZE" ? (i.quaternion.copy(this._quaternionStart), i.quaternion.multiply(w.setFromAxisAngle(this.rotationAxis, this.rotationAngle)).normalize()) : (this.rotationAxis.applyQuaternion(this._parentQuaternionInv), i.quaternion.copy(w.setFromAxisAngle(this.rotationAxis, this.rotationAngle)), i.quaternion.multiply(this._quaternionStart).normalize());
1093
+ const l = 20 / this.worldPosition.distanceTo(j.setFromMatrixPosition(this.camera.matrixWorld));
1094
+ let m = !1;
1095
+ o === "XYZE" ? (this.rotationAxis.copy(this._offset).cross(this.eye).normalize(), this.rotationAngle = this._offset.dot(j.copy(this.rotationAxis).cross(this.eye)) * l) : (o === "X" || o === "Y" || o === "Z") && (this.rotationAxis.copy(ln[o]), j.copy(ln[o]), r === "local" && j.applyQuaternion(this.worldQuaternion), j.cross(this.eye), j.length() === 0 ? m = !0 : this.rotationAngle = this._offset.dot(j.normalize()) * l), (o === "E" || m) && (this.rotationAxis.copy(this.eye), this.rotationAngle = this.pointEnd.angleTo(this.pointStart), this._startNorm.copy(this.pointStart).normalize(), this._endNorm.copy(this.pointEnd).normalize(), this.rotationAngle *= this._endNorm.cross(this._startNorm).dot(this.eye) < 0 ? 1 : -1), this.rotationSnap && (this.rotationAngle = Math.round(this.rotationAngle / this.rotationSnap) * this.rotationSnap), r === "local" && o !== "E" && o !== "XYZE" ? (a.quaternion.copy(this._quaternionStart), a.quaternion.multiply(M.setFromAxisAngle(this.rotationAxis, this.rotationAngle)).normalize()) : (this.rotationAxis.applyQuaternion(this._parentQuaternionInv), a.quaternion.copy(M.setFromAxisAngle(this.rotationAxis, this.rotationAngle)), a.quaternion.multiply(this._quaternionStart).normalize());
598
1096
  }
599
- this.dispatchEvent(ue), this.dispatchEvent(He);
1097
+ this.dispatchEvent(Ot), this.dispatchEvent(pn);
600
1098
  }
601
1099
  }
602
- pointerUp(o) {
603
- o !== null && o.button !== 0 || (this.dragging && this.axis !== null && (Xe.mode = this.mode, this.dispatchEvent(Xe)), this.dragging = !1, this.axis = null);
1100
+ pointerUp(n) {
1101
+ n !== null && n.button !== 0 || (this.dragging && this.axis !== null && (hn.mode = this.mode, this.dispatchEvent(hn)), this.dragging = !1, this.axis = null);
604
1102
  }
605
1103
  dispose() {
606
- this.domElement.removeEventListener("pointerdown", this._onPointerDown), this.domElement.removeEventListener("pointermove", this._onPointerHover), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.traverse(function(o) {
607
- o.geometry && o.geometry.dispose(), o.material && o.material.dispose();
1104
+ this.domElement.removeEventListener("pointerdown", this._onPointerDown), this.domElement.removeEventListener("pointermove", this._onPointerHover), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.traverse(function(n) {
1105
+ n.geometry && n.geometry.dispose(), n.material && n.material.dispose();
608
1106
  });
609
1107
  }
610
1108
  // Set current object
611
- attach(o) {
612
- return this.object = o, this.visible = !0, this;
1109
+ attach(n) {
1110
+ return this.object = n, this.visible = !0, this;
613
1111
  }
614
1112
  // Detach from object
615
1113
  detach() {
616
1114
  return this.object = void 0, this.visible = !1, this.axis = null, this;
617
1115
  }
618
1116
  reset() {
619
- this.enabled && this.dragging && (this.object.position.copy(this._positionStart), this.object.quaternion.copy(this._quaternionStart), this.object.scale.copy(this._scaleStart), this.dispatchEvent(ue), this.dispatchEvent(He), this.pointStart.copy(this.pointEnd));
1117
+ this.enabled && this.dragging && (this.object.position.copy(this._positionStart), this.object.quaternion.copy(this._quaternionStart), this.object.scale.copy(this._scaleStart), this.dispatchEvent(Ot), this.dispatchEvent(pn), this.pointStart.copy(this.pointEnd));
620
1118
  }
621
1119
  getRaycaster() {
622
- return dt;
1120
+ return ge;
623
1121
  }
624
1122
  // TODO: deprecate
625
1123
  getMode() {
626
1124
  return this.mode;
627
1125
  }
628
- setMode(o) {
629
- this.mode = o;
1126
+ setMode(n) {
1127
+ this.mode = n;
630
1128
  }
631
- setTranslationSnap(o) {
632
- this.translationSnap = o;
1129
+ setTranslationSnap(n) {
1130
+ this.translationSnap = n;
633
1131
  }
634
- setRotationSnap(o) {
635
- this.rotationSnap = o;
1132
+ setRotationSnap(n) {
1133
+ this.rotationSnap = n;
636
1134
  }
637
- setScaleSnap(o) {
638
- this.scaleSnap = o;
1135
+ setScaleSnap(n) {
1136
+ this.scaleSnap = n;
639
1137
  }
640
- setSize(o) {
641
- this.size = o;
1138
+ setSize(n) {
1139
+ this.size = n;
642
1140
  }
643
- setSpace(o) {
644
- this.space = o;
1141
+ setSpace(n) {
1142
+ this.space = n;
645
1143
  }
646
1144
  }
647
- function _n(d) {
1145
+ function Ii(p) {
648
1146
  if (this.domElement.ownerDocument.pointerLockElement)
649
1147
  return {
650
1148
  x: 0,
651
1149
  y: 0,
652
- button: d.button
1150
+ button: p.button
653
1151
  };
654
1152
  {
655
- const o = this.domElement.getBoundingClientRect();
1153
+ const n = this.domElement.getBoundingClientRect();
656
1154
  return {
657
- x: (d.clientX - o.left) / o.width * 2 - 1,
658
- y: -(d.clientY - o.top) / o.height * 2 + 1,
659
- button: d.button
1155
+ x: (p.clientX - n.left) / n.width * 2 - 1,
1156
+ y: -(p.clientY - n.top) / n.height * 2 + 1,
1157
+ button: p.button
660
1158
  };
661
1159
  }
662
1160
  }
663
- function vn(d) {
1161
+ function Ai(p) {
664
1162
  if (this.enabled)
665
- switch (d.pointerType) {
1163
+ switch (p.pointerType) {
666
1164
  case "mouse":
667
1165
  case "pen":
668
- this.pointerHover(this._getPointer(d));
1166
+ this.pointerHover(this._getPointer(p));
669
1167
  break;
670
1168
  }
671
1169
  }
672
- function Tn(d) {
673
- this.enabled && (document.pointerLockElement || this.domElement.setPointerCapture(d.pointerId), this.domElement.addEventListener("pointermove", this._onPointerMove), this.pointerHover(this._getPointer(d)), this.pointerDown(this._getPointer(d)));
1170
+ function Li(p) {
1171
+ this.enabled && (document.pointerLockElement || this.domElement.setPointerCapture(p.pointerId), this.domElement.addEventListener("pointermove", this._onPointerMove), this.pointerHover(this._getPointer(p)), this.pointerDown(this._getPointer(p)));
674
1172
  }
675
- function In(d) {
676
- this.enabled && this.pointerMove(this._getPointer(d));
1173
+ function Di(p) {
1174
+ this.enabled && this.pointerMove(this._getPointer(p));
677
1175
  }
678
- function An(d) {
679
- this.enabled && (this.domElement.releasePointerCapture(d.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.pointerUp(this._getPointer(d)));
1176
+ function Oi(p) {
1177
+ this.enabled && (this.domElement.releasePointerCapture(p.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.pointerUp(this._getPointer(p)));
680
1178
  }
681
- function me(d, o, a) {
682
- const t = o.intersectObject(d, !0);
683
- for (let i = 0; i < t.length; i++)
684
- if (t[i].object.visible || a)
685
- return t[i];
1179
+ function kt(p, n, o) {
1180
+ const e = n.intersectObject(p, !0);
1181
+ for (let a = 0; a < e.length; a++)
1182
+ if (e[a].object.visible || o)
1183
+ return e[a];
686
1184
  return !1;
687
1185
  }
688
- const oe = new fn(), f = new p(0, 1, 0), Ze = new p(0, 0, 0), Ne = new Fe(), ie = new G(), re = new G(), B = new p(), Qe = new Fe(), Ct = new p(1, 0, 0), ut = new p(0, 1, 0), Xt = new p(0, 0, 1), se = new p(), Rt = new p(), zt = new p();
689
- class Ln extends fe {
1186
+ const wt = new si(), b = new d(0, 1, 0), mn = new d(0, 0, 0), dn = new fn(), bt = new V(), Mt = new V(), te = new d(), un = new fn(), Ge = new d(1, 0, 0), Me = new d(0, 1, 0), We = new d(0, 0, 1), gt = new d(), Qe = new d(), qe = new d();
1187
+ class ki extends Rt {
690
1188
  constructor() {
691
1189
  super(), this.isTransformControlsGizmo = !0, this.type = "TransformControlsGizmo";
692
- const o = new qe({
1190
+ const n = new yn({
693
1191
  depthTest: !1,
694
1192
  depthWrite: !1,
695
1193
  fog: !1,
696
1194
  toneMapped: !1,
697
1195
  transparent: !0
698
- }), a = new yn({
1196
+ }), o = new ai({
699
1197
  depthTest: !1,
700
1198
  depthWrite: !1,
701
1199
  fog: !1,
702
1200
  toneMapped: !1,
703
1201
  transparent: !0
704
- }), t = o.clone();
705
- t.opacity = 0.15;
706
- const i = a.clone();
707
- i.opacity = 0.5;
708
- const l = o.clone();
709
- l.color.setHex(16711680);
710
- const n = o.clone();
711
- n.color.setHex(65280);
712
- const h = o.clone();
713
- h.color.setHex(255);
714
- const b = o.clone();
715
- b.color.setHex(16711680), b.opacity = 0.5;
716
- const j = o.clone();
717
- j.color.setHex(65280), j.opacity = 0.5;
718
- const C = o.clone();
719
- C.color.setHex(255), C.opacity = 0.5;
720
- const X = o.clone();
721
- X.opacity = 0.25;
722
- const H = o.clone();
723
- H.color.setHex(16776960), H.opacity = 0.25, o.clone().color.setHex(16776960);
724
- const Z = o.clone();
725
- Z.color.setHex(7895160);
726
- const x = new z(0, 0.04, 0.1, 12);
727
- x.translate(0, 0.05, 0);
728
- const T = new k(0.08, 0.08, 0.08);
729
- T.translate(0, 0.04, 0);
730
- const _ = new Oe();
731
- _.setAttribute("position", new De([0, 0, 0, 1, 0, 0], 3));
732
- const g = new z(75e-4, 75e-4, 0.5, 3);
733
- g.translate(0, 0.25, 0);
734
- function E(O, W) {
735
- const D = new kt(O, 75e-4, 3, 64, W * Math.PI * 2);
736
- return D.rotateY(Math.PI / 2), D.rotateX(Math.PI / 2), D;
1202
+ }), e = n.clone();
1203
+ e.opacity = 0.15;
1204
+ const a = o.clone();
1205
+ a.opacity = 0.5;
1206
+ const r = n.clone();
1207
+ r.color.setHex(16711680);
1208
+ const i = n.clone();
1209
+ i.color.setHex(65280);
1210
+ const l = n.clone();
1211
+ l.color.setHex(255);
1212
+ const m = n.clone();
1213
+ m.color.setHex(16711680), m.opacity = 0.5;
1214
+ const f = n.clone();
1215
+ f.color.setHex(65280), f.opacity = 0.5;
1216
+ const w = n.clone();
1217
+ w.color.setHex(255), w.opacity = 0.5;
1218
+ const H = n.clone();
1219
+ H.opacity = 0.25;
1220
+ const Q = n.clone();
1221
+ Q.color.setHex(16776960), Q.opacity = 0.25, n.clone().color.setHex(16776960);
1222
+ const G = n.clone();
1223
+ G.color.setHex(7895160);
1224
+ const A = new N(0, 0.04, 0.1, 12);
1225
+ A.translate(0, 0.05, 0);
1226
+ const k = new Z(0.08, 0.08, 0.08);
1227
+ k.translate(0, 0.04, 0);
1228
+ const L = new tn();
1229
+ L.setAttribute("position", new nn([0, 0, 0, 1, 0, 0], 3));
1230
+ const S = new N(75e-4, 75e-4, 0.5, 3);
1231
+ S.translate(0, 0.25, 0);
1232
+ function v(z, $) {
1233
+ const X = new Fe(z, 75e-4, 3, 64, $ * Math.PI * 2);
1234
+ return X.rotateY(Math.PI / 2), X.rotateX(Math.PI / 2), X;
737
1235
  }
738
- function $() {
739
- const O = new Oe();
740
- return O.setAttribute("position", new De([0, 0, 0, 1, 1, 1], 3)), O;
1236
+ function ie() {
1237
+ const z = new tn();
1238
+ return z.setAttribute("position", new nn([0, 0, 0, 1, 1, 1], 3)), z;
741
1239
  }
742
- const I = {
1240
+ const R = {
743
1241
  X: [
744
- [new c(x, l), [0.5, 0, 0], [0, 0, -Math.PI / 2]],
745
- [new c(x, l), [-0.5, 0, 0], [0, 0, Math.PI / 2]],
746
- [new c(g, l), [0, 0, 0], [0, 0, -Math.PI / 2]]
1242
+ [new h(A, r), [0.5, 0, 0], [0, 0, -Math.PI / 2]],
1243
+ [new h(A, r), [-0.5, 0, 0], [0, 0, Math.PI / 2]],
1244
+ [new h(S, r), [0, 0, 0], [0, 0, -Math.PI / 2]]
747
1245
  ],
748
1246
  Y: [
749
- [new c(x, n), [0, 0.5, 0]],
750
- [new c(x, n), [0, -0.5, 0], [Math.PI, 0, 0]],
751
- [new c(g, n)]
1247
+ [new h(A, i), [0, 0.5, 0]],
1248
+ [new h(A, i), [0, -0.5, 0], [Math.PI, 0, 0]],
1249
+ [new h(S, i)]
752
1250
  ],
753
1251
  Z: [
754
- [new c(x, h), [0, 0, 0.5], [Math.PI / 2, 0, 0]],
755
- [new c(x, h), [0, 0, -0.5], [-Math.PI / 2, 0, 0]],
756
- [new c(g, h), null, [Math.PI / 2, 0, 0]]
1252
+ [new h(A, l), [0, 0, 0.5], [Math.PI / 2, 0, 0]],
1253
+ [new h(A, l), [0, 0, -0.5], [-Math.PI / 2, 0, 0]],
1254
+ [new h(S, l), null, [Math.PI / 2, 0, 0]]
757
1255
  ],
758
1256
  XYZ: [
759
- [new c(new ee(0.1, 0), X.clone()), [0, 0, 0]]
1257
+ [new h(new ft(0.1, 0), H.clone()), [0, 0, 0]]
760
1258
  ],
761
1259
  XY: [
762
- [new c(new k(0.15, 0.15, 0.01), C.clone()), [0.15, 0.15, 0]]
1260
+ [new h(new Z(0.15, 0.15, 0.01), w.clone()), [0.15, 0.15, 0]]
763
1261
  ],
764
1262
  YZ: [
765
- [new c(new k(0.15, 0.15, 0.01), b.clone()), [0, 0.15, 0.15], [0, Math.PI / 2, 0]]
1263
+ [new h(new Z(0.15, 0.15, 0.01), m.clone()), [0, 0.15, 0.15], [0, Math.PI / 2, 0]]
766
1264
  ],
767
1265
  XZ: [
768
- [new c(new k(0.15, 0.15, 0.01), j.clone()), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
1266
+ [new h(new Z(0.15, 0.15, 0.01), f.clone()), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
769
1267
  ]
770
- }, Et = {
1268
+ }, Te = {
771
1269
  X: [
772
- [new c(new z(0.2, 0, 0.6, 4), t), [0.3, 0, 0], [0, 0, -Math.PI / 2]],
773
- [new c(new z(0.2, 0, 0.6, 4), t), [-0.3, 0, 0], [0, 0, Math.PI / 2]]
1270
+ [new h(new N(0.2, 0, 0.6, 4), e), [0.3, 0, 0], [0, 0, -Math.PI / 2]],
1271
+ [new h(new N(0.2, 0, 0.6, 4), e), [-0.3, 0, 0], [0, 0, Math.PI / 2]]
774
1272
  ],
775
1273
  Y: [
776
- [new c(new z(0.2, 0, 0.6, 4), t), [0, 0.3, 0]],
777
- [new c(new z(0.2, 0, 0.6, 4), t), [0, -0.3, 0], [0, 0, Math.PI]]
1274
+ [new h(new N(0.2, 0, 0.6, 4), e), [0, 0.3, 0]],
1275
+ [new h(new N(0.2, 0, 0.6, 4), e), [0, -0.3, 0], [0, 0, Math.PI]]
778
1276
  ],
779
1277
  Z: [
780
- [new c(new z(0.2, 0, 0.6, 4), t), [0, 0, 0.3], [Math.PI / 2, 0, 0]],
781
- [new c(new z(0.2, 0, 0.6, 4), t), [0, 0, -0.3], [-Math.PI / 2, 0, 0]]
1278
+ [new h(new N(0.2, 0, 0.6, 4), e), [0, 0, 0.3], [Math.PI / 2, 0, 0]],
1279
+ [new h(new N(0.2, 0, 0.6, 4), e), [0, 0, -0.3], [-Math.PI / 2, 0, 0]]
782
1280
  ],
783
1281
  XYZ: [
784
- [new c(new ee(0.2, 0), t)]
1282
+ [new h(new ft(0.2, 0), e)]
785
1283
  ],
786
1284
  XY: [
787
- [new c(new k(0.2, 0.2, 0.01), t), [0.15, 0.15, 0]]
1285
+ [new h(new Z(0.2, 0.2, 0.01), e), [0.15, 0.15, 0]]
788
1286
  ],
789
1287
  YZ: [
790
- [new c(new k(0.2, 0.2, 0.01), t), [0, 0.15, 0.15], [0, Math.PI / 2, 0]]
1288
+ [new h(new Z(0.2, 0.2, 0.01), e), [0, 0.15, 0.15], [0, Math.PI / 2, 0]]
791
1289
  ],
792
1290
  XZ: [
793
- [new c(new k(0.2, 0.2, 0.01), t), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
1291
+ [new h(new Z(0.2, 0.2, 0.01), e), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
794
1292
  ]
795
- }, P = {
1293
+ }, _ = {
796
1294
  START: [
797
- [new c(new ee(0.01, 2), i), null, null, null, "helper"]
1295
+ [new h(new ft(0.01, 2), a), null, null, null, "helper"]
798
1296
  ],
799
1297
  END: [
800
- [new c(new ee(0.01, 2), i), null, null, null, "helper"]
1298
+ [new h(new ft(0.01, 2), a), null, null, null, "helper"]
801
1299
  ],
802
1300
  DELTA: [
803
- [new at($(), i), null, null, null, "helper"]
1301
+ [new me(ie(), a), null, null, null, "helper"]
804
1302
  ],
805
1303
  X: [
806
- [new at(_, i.clone()), [-1e3, 0, 0], null, [1e6, 1, 1], "helper"]
1304
+ [new me(L, a.clone()), [-1e3, 0, 0], null, [1e6, 1, 1], "helper"]
807
1305
  ],
808
1306
  Y: [
809
- [new at(_, i.clone()), [0, -1e3, 0], [0, 0, Math.PI / 2], [1e6, 1, 1], "helper"]
1307
+ [new me(L, a.clone()), [0, -1e3, 0], [0, 0, Math.PI / 2], [1e6, 1, 1], "helper"]
810
1308
  ],
811
1309
  Z: [
812
- [new at(_, i.clone()), [0, 0, -1e3], [0, -Math.PI / 2, 0], [1e6, 1, 1], "helper"]
1310
+ [new me(L, a.clone()), [0, 0, -1e3], [0, -Math.PI / 2, 0], [1e6, 1, 1], "helper"]
813
1311
  ]
814
- }, ct = {
1312
+ }, ye = {
815
1313
  XYZE: [
816
- [new c(E(0.5, 1), Z), null, [0, Math.PI / 2, 0]]
1314
+ [new h(v(0.5, 1), G), null, [0, Math.PI / 2, 0]]
817
1315
  ],
818
1316
  X: [
819
- [new c(E(0.5, 0.5), l)]
1317
+ [new h(v(0.5, 0.5), r)]
820
1318
  ],
821
1319
  Y: [
822
- [new c(E(0.5, 0.5), n), null, [0, 0, -Math.PI / 2]]
1320
+ [new h(v(0.5, 0.5), i), null, [0, 0, -Math.PI / 2]]
823
1321
  ],
824
1322
  Z: [
825
- [new c(E(0.5, 0.5), h), null, [0, Math.PI / 2, 0]]
1323
+ [new h(v(0.5, 0.5), l), null, [0, Math.PI / 2, 0]]
826
1324
  ],
827
1325
  E: [
828
- [new c(E(0.75, 1), H), null, [0, Math.PI / 2, 0]]
1326
+ [new h(v(0.75, 1), Q), null, [0, Math.PI / 2, 0]]
829
1327
  ]
830
- }, jt = {
1328
+ }, ze = {
831
1329
  AXIS: [
832
- [new at(_, i.clone()), [-1e3, 0, 0], null, [1e6, 1, 1], "helper"]
1330
+ [new me(L, a.clone()), [-1e3, 0, 0], null, [1e6, 1, 1], "helper"]
833
1331
  ]
834
- }, le = {
1332
+ }, _t = {
835
1333
  XYZE: [
836
- [new c(new wn(0.25, 10, 8), t)]
1334
+ [new h(new ri(0.25, 10, 8), e)]
837
1335
  ],
838
1336
  X: [
839
- [new c(new kt(0.5, 0.1, 4, 24), t), [0, 0, 0], [0, -Math.PI / 2, -Math.PI / 2]]
1337
+ [new h(new Fe(0.5, 0.1, 4, 24), e), [0, 0, 0], [0, -Math.PI / 2, -Math.PI / 2]]
840
1338
  ],
841
1339
  Y: [
842
- [new c(new kt(0.5, 0.1, 4, 24), t), [0, 0, 0], [Math.PI / 2, 0, 0]]
1340
+ [new h(new Fe(0.5, 0.1, 4, 24), e), [0, 0, 0], [Math.PI / 2, 0, 0]]
843
1341
  ],
844
1342
  Z: [
845
- [new c(new kt(0.5, 0.1, 4, 24), t), [0, 0, 0], [0, 0, -Math.PI / 2]]
1343
+ [new h(new Fe(0.5, 0.1, 4, 24), e), [0, 0, 0], [0, 0, -Math.PI / 2]]
846
1344
  ],
847
1345
  E: [
848
- [new c(new kt(0.75, 0.1, 2, 24), t)]
1346
+ [new h(new Fe(0.75, 0.1, 2, 24), e)]
849
1347
  ]
850
- }, Pt = {
1348
+ }, Ie = {
851
1349
  X: [
852
- [new c(T, l), [0.5, 0, 0], [0, 0, -Math.PI / 2]],
853
- [new c(g, l), [0, 0, 0], [0, 0, -Math.PI / 2]],
854
- [new c(T, l), [-0.5, 0, 0], [0, 0, Math.PI / 2]]
1350
+ [new h(k, r), [0.5, 0, 0], [0, 0, -Math.PI / 2]],
1351
+ [new h(S, r), [0, 0, 0], [0, 0, -Math.PI / 2]],
1352
+ [new h(k, r), [-0.5, 0, 0], [0, 0, Math.PI / 2]]
855
1353
  ],
856
1354
  Y: [
857
- [new c(T, n), [0, 0.5, 0]],
858
- [new c(g, n)],
859
- [new c(T, n), [0, -0.5, 0], [0, 0, Math.PI]]
1355
+ [new h(k, i), [0, 0.5, 0]],
1356
+ [new h(S, i)],
1357
+ [new h(k, i), [0, -0.5, 0], [0, 0, Math.PI]]
860
1358
  ],
861
1359
  Z: [
862
- [new c(T, h), [0, 0, 0.5], [Math.PI / 2, 0, 0]],
863
- [new c(g, h), [0, 0, 0], [Math.PI / 2, 0, 0]],
864
- [new c(T, h), [0, 0, -0.5], [-Math.PI / 2, 0, 0]]
1360
+ [new h(k, l), [0, 0, 0.5], [Math.PI / 2, 0, 0]],
1361
+ [new h(S, l), [0, 0, 0], [Math.PI / 2, 0, 0]],
1362
+ [new h(k, l), [0, 0, -0.5], [-Math.PI / 2, 0, 0]]
865
1363
  ],
866
1364
  XY: [
867
- [new c(new k(0.15, 0.15, 0.01), C), [0.15, 0.15, 0]]
1365
+ [new h(new Z(0.15, 0.15, 0.01), w), [0.15, 0.15, 0]]
868
1366
  ],
869
1367
  YZ: [
870
- [new c(new k(0.15, 0.15, 0.01), b), [0, 0.15, 0.15], [0, Math.PI / 2, 0]]
1368
+ [new h(new Z(0.15, 0.15, 0.01), m), [0, 0.15, 0.15], [0, Math.PI / 2, 0]]
871
1369
  ],
872
1370
  XZ: [
873
- [new c(new k(0.15, 0.15, 0.01), j), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
1371
+ [new h(new Z(0.15, 0.15, 0.01), f), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
874
1372
  ],
875
1373
  XYZ: [
876
- [new c(new k(0.1, 0.1, 0.1), X.clone())]
1374
+ [new h(new Z(0.1, 0.1, 0.1), H.clone())]
877
1375
  ]
878
- }, ht = {
1376
+ }, we = {
879
1377
  X: [
880
- [new c(new z(0.2, 0, 0.6, 4), t), [0.3, 0, 0], [0, 0, -Math.PI / 2]],
881
- [new c(new z(0.2, 0, 0.6, 4), t), [-0.3, 0, 0], [0, 0, Math.PI / 2]]
1378
+ [new h(new N(0.2, 0, 0.6, 4), e), [0.3, 0, 0], [0, 0, -Math.PI / 2]],
1379
+ [new h(new N(0.2, 0, 0.6, 4), e), [-0.3, 0, 0], [0, 0, Math.PI / 2]]
882
1380
  ],
883
1381
  Y: [
884
- [new c(new z(0.2, 0, 0.6, 4), t), [0, 0.3, 0]],
885
- [new c(new z(0.2, 0, 0.6, 4), t), [0, -0.3, 0], [0, 0, Math.PI]]
1382
+ [new h(new N(0.2, 0, 0.6, 4), e), [0, 0.3, 0]],
1383
+ [new h(new N(0.2, 0, 0.6, 4), e), [0, -0.3, 0], [0, 0, Math.PI]]
886
1384
  ],
887
1385
  Z: [
888
- [new c(new z(0.2, 0, 0.6, 4), t), [0, 0, 0.3], [Math.PI / 2, 0, 0]],
889
- [new c(new z(0.2, 0, 0.6, 4), t), [0, 0, -0.3], [-Math.PI / 2, 0, 0]]
1386
+ [new h(new N(0.2, 0, 0.6, 4), e), [0, 0, 0.3], [Math.PI / 2, 0, 0]],
1387
+ [new h(new N(0.2, 0, 0.6, 4), e), [0, 0, -0.3], [-Math.PI / 2, 0, 0]]
890
1388
  ],
891
1389
  XY: [
892
- [new c(new k(0.2, 0.2, 0.01), t), [0.15, 0.15, 0]]
1390
+ [new h(new Z(0.2, 0.2, 0.01), e), [0.15, 0.15, 0]]
893
1391
  ],
894
1392
  YZ: [
895
- [new c(new k(0.2, 0.2, 0.01), t), [0, 0.15, 0.15], [0, Math.PI / 2, 0]]
1393
+ [new h(new Z(0.2, 0.2, 0.01), e), [0, 0.15, 0.15], [0, Math.PI / 2, 0]]
896
1394
  ],
897
1395
  XZ: [
898
- [new c(new k(0.2, 0.2, 0.01), t), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
1396
+ [new h(new Z(0.2, 0.2, 0.01), e), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
899
1397
  ],
900
1398
  XYZ: [
901
- [new c(new k(0.2, 0.2, 0.2), t), [0, 0, 0]]
1399
+ [new h(new Z(0.2, 0.2, 0.2), e), [0, 0, 0]]
902
1400
  ]
903
- }, Mt = {
1401
+ }, Ae = {
904
1402
  X: [
905
- [new at(_, i.clone()), [-1e3, 0, 0], null, [1e6, 1, 1], "helper"]
1403
+ [new me(L, a.clone()), [-1e3, 0, 0], null, [1e6, 1, 1], "helper"]
906
1404
  ],
907
1405
  Y: [
908
- [new at(_, i.clone()), [0, -1e3, 0], [0, 0, Math.PI / 2], [1e6, 1, 1], "helper"]
1406
+ [new me(L, a.clone()), [0, -1e3, 0], [0, 0, Math.PI / 2], [1e6, 1, 1], "helper"]
909
1407
  ],
910
1408
  Z: [
911
- [new at(_, i.clone()), [0, 0, -1e3], [0, -Math.PI / 2, 0], [1e6, 1, 1], "helper"]
1409
+ [new me(L, a.clone()), [0, 0, -1e3], [0, -Math.PI / 2, 0], [1e6, 1, 1], "helper"]
912
1410
  ]
913
1411
  };
914
- function N(O) {
915
- const W = new fe();
916
- for (const D in O)
917
- for (let J = O[D].length; J--; ) {
918
- const M = O[D][J][0].clone(), it = O[D][J][1], pt = O[D][J][2], St = O[D][J][3], Vt = O[D][J][4];
919
- M.name = D, M.tag = Vt, it && M.position.set(it[0], it[1], it[2]), pt && M.rotation.set(pt[0], pt[1], pt[2]), St && M.scale.set(St[0], St[1], St[2]), M.updateMatrix();
920
- const $t = M.geometry.clone();
921
- $t.applyMatrix4(M.matrix), M.geometry = $t, M.renderOrder = 1 / 0, M.position.set(0, 0, 0), M.rotation.set(0, 0, 0), M.scale.set(1, 1, 1), W.add(M);
1412
+ function W(z) {
1413
+ const $ = new Rt();
1414
+ for (const X in z)
1415
+ for (let oe = z[X].length; oe--; ) {
1416
+ const T = z[X][oe][0].clone(), he = z[X][oe][1], be = z[X][oe][2], Le = z[X][oe][3], pt = z[X][oe][4];
1417
+ T.name = X, T.tag = pt, he && T.position.set(he[0], he[1], he[2]), be && T.rotation.set(be[0], be[1], be[2]), Le && T.scale.set(Le[0], Le[1], Le[2]), T.updateMatrix();
1418
+ const mt = T.geometry.clone();
1419
+ mt.applyMatrix4(T.matrix), T.geometry = mt, T.renderOrder = 1 / 0, T.position.set(0, 0, 0), T.rotation.set(0, 0, 0), T.scale.set(1, 1, 1), $.add(T);
922
1420
  }
923
- return W;
1421
+ return $;
924
1422
  }
925
- this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate = N(I)), this.add(this.gizmo.rotate = N(ct)), this.add(this.gizmo.scale = N(Pt)), this.add(this.picker.translate = N(Et)), this.add(this.picker.rotate = N(le)), this.add(this.picker.scale = N(ht)), this.add(this.helper.translate = N(P)), this.add(this.helper.rotate = N(jt)), this.add(this.helper.scale = N(Mt)), this.picker.translate.visible = !1, this.picker.rotate.visible = !1, this.picker.scale.visible = !1;
1423
+ this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate = W(R)), this.add(this.gizmo.rotate = W(ye)), this.add(this.gizmo.scale = W(Ie)), this.add(this.picker.translate = W(Te)), this.add(this.picker.rotate = W(_t)), this.add(this.picker.scale = W(we)), this.add(this.helper.translate = W(_)), this.add(this.helper.rotate = W(ze)), this.add(this.helper.scale = W(Ae)), this.picker.translate.visible = !1, this.picker.rotate.visible = !1, this.picker.scale.visible = !1;
926
1424
  }
927
1425
  // updateMatrixWorld will update transformations and appearance of individual handles
928
- updateMatrixWorld(o) {
929
- const t = (this.mode === "scale" ? "local" : this.space) === "local" ? this.worldQuaternion : re;
1426
+ updateMatrixWorld(n) {
1427
+ const e = (this.mode === "scale" ? "local" : this.space) === "local" ? this.worldQuaternion : Mt;
930
1428
  this.gizmo.translate.visible = this.mode === "translate", this.gizmo.rotate.visible = this.mode === "rotate", this.gizmo.scale.visible = this.mode === "scale", this.helper.translate.visible = this.mode === "translate", this.helper.rotate.visible = this.mode === "rotate", this.helper.scale.visible = this.mode === "scale";
931
- let i = [];
932
- i = i.concat(this.picker[this.mode].children), i = i.concat(this.gizmo[this.mode].children), i = i.concat(this.helper[this.mode].children);
933
- for (let l = 0; l < i.length; l++) {
934
- const n = i[l];
935
- n.visible = !0, n.rotation.set(0, 0, 0), n.position.copy(this.worldPosition);
936
- let h;
937
- if (this.camera.isOrthographicCamera ? h = (this.camera.top - this.camera.bottom) / this.camera.zoom : h = this.worldPosition.distanceTo(this.cameraPosition) * Math.min(1.9 * Math.tan(Math.PI * this.camera.fov / 360) / this.camera.zoom, 7), n.scale.set(1, 1, 1).multiplyScalar(h * this.size / 4), n.tag === "helper") {
938
- n.visible = !1, n.name === "AXIS" ? (n.visible = !!this.axis, this.axis === "X" && (w.setFromEuler(oe.set(0, 0, 0)), n.quaternion.copy(t).multiply(w), Math.abs(f.copy(Ct).applyQuaternion(t).dot(this.eye)) > 0.9 && (n.visible = !1)), this.axis === "Y" && (w.setFromEuler(oe.set(0, 0, Math.PI / 2)), n.quaternion.copy(t).multiply(w), Math.abs(f.copy(ut).applyQuaternion(t).dot(this.eye)) > 0.9 && (n.visible = !1)), this.axis === "Z" && (w.setFromEuler(oe.set(0, Math.PI / 2, 0)), n.quaternion.copy(t).multiply(w), Math.abs(f.copy(Xt).applyQuaternion(t).dot(this.eye)) > 0.9 && (n.visible = !1)), this.axis === "XYZE" && (w.setFromEuler(oe.set(0, Math.PI / 2, 0)), f.copy(this.rotationAxis), n.quaternion.setFromRotationMatrix(Ne.lookAt(Ze, f, ut)), n.quaternion.multiply(w), n.visible = this.dragging), this.axis === "E" && (n.visible = !1)) : n.name === "START" ? (n.position.copy(this.worldPositionStart), n.visible = this.dragging) : n.name === "END" ? (n.position.copy(this.worldPosition), n.visible = this.dragging) : n.name === "DELTA" ? (n.position.copy(this.worldPositionStart), n.quaternion.copy(this.worldQuaternionStart), A.set(1e-10, 1e-10, 1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1), A.applyQuaternion(this.worldQuaternionStart.clone().invert()), n.scale.copy(A), n.visible = this.dragging) : (n.quaternion.copy(t), this.dragging ? n.position.copy(this.worldPositionStart) : n.position.copy(this.worldPosition), this.axis && (n.visible = this.axis.search(n.name) !== -1));
1429
+ let a = [];
1430
+ a = a.concat(this.picker[this.mode].children), a = a.concat(this.gizmo[this.mode].children), a = a.concat(this.helper[this.mode].children);
1431
+ for (let r = 0; r < a.length; r++) {
1432
+ const i = a[r];
1433
+ i.visible = !0, i.rotation.set(0, 0, 0), i.position.copy(this.worldPosition);
1434
+ let l;
1435
+ if (this.camera.isOrthographicCamera ? l = (this.camera.top - this.camera.bottom) / this.camera.zoom : l = this.worldPosition.distanceTo(this.cameraPosition) * Math.min(1.9 * Math.tan(Math.PI * this.camera.fov / 360) / this.camera.zoom, 7), i.scale.set(1, 1, 1).multiplyScalar(l * this.size / 4), i.tag === "helper") {
1436
+ i.visible = !1, i.name === "AXIS" ? (i.visible = !!this.axis, this.axis === "X" && (M.setFromEuler(wt.set(0, 0, 0)), i.quaternion.copy(e).multiply(M), Math.abs(b.copy(Ge).applyQuaternion(e).dot(this.eye)) > 0.9 && (i.visible = !1)), this.axis === "Y" && (M.setFromEuler(wt.set(0, 0, Math.PI / 2)), i.quaternion.copy(e).multiply(M), Math.abs(b.copy(Me).applyQuaternion(e).dot(this.eye)) > 0.9 && (i.visible = !1)), this.axis === "Z" && (M.setFromEuler(wt.set(0, Math.PI / 2, 0)), i.quaternion.copy(e).multiply(M), Math.abs(b.copy(We).applyQuaternion(e).dot(this.eye)) > 0.9 && (i.visible = !1)), this.axis === "XYZE" && (M.setFromEuler(wt.set(0, Math.PI / 2, 0)), b.copy(this.rotationAxis), i.quaternion.setFromRotationMatrix(dn.lookAt(mn, b, Me)), i.quaternion.multiply(M), i.visible = this.dragging), this.axis === "E" && (i.visible = !1)) : i.name === "START" ? (i.position.copy(this.worldPositionStart), i.visible = this.dragging) : i.name === "END" ? (i.position.copy(this.worldPosition), i.visible = this.dragging) : i.name === "DELTA" ? (i.position.copy(this.worldPositionStart), i.quaternion.copy(this.worldQuaternionStart), j.set(1e-10, 1e-10, 1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1), j.applyQuaternion(this.worldQuaternionStart.clone().invert()), i.scale.copy(j), i.visible = this.dragging) : (i.quaternion.copy(e), this.dragging ? i.position.copy(this.worldPositionStart) : i.position.copy(this.worldPosition), this.axis && (i.visible = this.axis.search(i.name) !== -1));
939
1437
  continue;
940
1438
  }
941
- n.quaternion.copy(t), this.mode === "translate" || this.mode === "scale" ? (n.name === "X" && Math.abs(f.copy(Ct).applyQuaternion(t).dot(this.eye)) > 0.99 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1), n.name === "Y" && Math.abs(f.copy(ut).applyQuaternion(t).dot(this.eye)) > 0.99 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1), n.name === "Z" && Math.abs(f.copy(Xt).applyQuaternion(t).dot(this.eye)) > 0.99 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1), n.name === "XY" && Math.abs(f.copy(Xt).applyQuaternion(t).dot(this.eye)) < 0.2 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1), n.name === "YZ" && Math.abs(f.copy(Ct).applyQuaternion(t).dot(this.eye)) < 0.2 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1), n.name === "XZ" && Math.abs(f.copy(ut).applyQuaternion(t).dot(this.eye)) < 0.2 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1)) : this.mode === "rotate" && (ie.copy(t), f.copy(this.eye).applyQuaternion(w.copy(t).invert()), n.name.search("E") !== -1 && n.quaternion.setFromRotationMatrix(Ne.lookAt(this.eye, Ze, ut)), n.name === "X" && (w.setFromAxisAngle(Ct, Math.atan2(-f.y, f.z)), w.multiplyQuaternions(ie, w), n.quaternion.copy(w)), n.name === "Y" && (w.setFromAxisAngle(ut, Math.atan2(f.x, f.z)), w.multiplyQuaternions(ie, w), n.quaternion.copy(w)), n.name === "Z" && (w.setFromAxisAngle(Xt, Math.atan2(f.y, f.x)), w.multiplyQuaternions(ie, w), n.quaternion.copy(w))), n.visible = n.visible && (n.name.indexOf("X") === -1 || this.showX), n.visible = n.visible && (n.name.indexOf("Y") === -1 || this.showY), n.visible = n.visible && (n.name.indexOf("Z") === -1 || this.showZ), n.visible = n.visible && (n.name.indexOf("E") === -1 || this.showX && this.showY && this.showZ), n.material._color = n.material._color || n.material.color.clone(), n.material._opacity = n.material._opacity || n.material.opacity, n.material.color.copy(n.material._color), n.material.opacity = n.material._opacity, this.enabled && this.axis && (n.name === this.axis || this.axis.split("").some(function(b) {
942
- return n.name === b;
943
- })) && (n.material.color.setHex(16776960), n.material.opacity = 1);
1439
+ i.quaternion.copy(e), this.mode === "translate" || this.mode === "scale" ? (i.name === "X" && Math.abs(b.copy(Ge).applyQuaternion(e).dot(this.eye)) > 0.99 && (i.scale.set(1e-10, 1e-10, 1e-10), i.visible = !1), i.name === "Y" && Math.abs(b.copy(Me).applyQuaternion(e).dot(this.eye)) > 0.99 && (i.scale.set(1e-10, 1e-10, 1e-10), i.visible = !1), i.name === "Z" && Math.abs(b.copy(We).applyQuaternion(e).dot(this.eye)) > 0.99 && (i.scale.set(1e-10, 1e-10, 1e-10), i.visible = !1), i.name === "XY" && Math.abs(b.copy(We).applyQuaternion(e).dot(this.eye)) < 0.2 && (i.scale.set(1e-10, 1e-10, 1e-10), i.visible = !1), i.name === "YZ" && Math.abs(b.copy(Ge).applyQuaternion(e).dot(this.eye)) < 0.2 && (i.scale.set(1e-10, 1e-10, 1e-10), i.visible = !1), i.name === "XZ" && Math.abs(b.copy(Me).applyQuaternion(e).dot(this.eye)) < 0.2 && (i.scale.set(1e-10, 1e-10, 1e-10), i.visible = !1)) : this.mode === "rotate" && (bt.copy(e), b.copy(this.eye).applyQuaternion(M.copy(e).invert()), i.name.search("E") !== -1 && i.quaternion.setFromRotationMatrix(dn.lookAt(this.eye, mn, Me)), i.name === "X" && (M.setFromAxisAngle(Ge, Math.atan2(-b.y, b.z)), M.multiplyQuaternions(bt, M), i.quaternion.copy(M)), i.name === "Y" && (M.setFromAxisAngle(Me, Math.atan2(b.x, b.z)), M.multiplyQuaternions(bt, M), i.quaternion.copy(M)), i.name === "Z" && (M.setFromAxisAngle(We, Math.atan2(b.y, b.x)), M.multiplyQuaternions(bt, M), i.quaternion.copy(M))), i.visible = i.visible && (i.name.indexOf("X") === -1 || this.showX), i.visible = i.visible && (i.name.indexOf("Y") === -1 || this.showY), i.visible = i.visible && (i.name.indexOf("Z") === -1 || this.showZ), i.visible = i.visible && (i.name.indexOf("E") === -1 || this.showX && this.showY && this.showZ), i.material._color = i.material._color || i.material.color.clone(), i.material._opacity = i.material._opacity || i.material.opacity, i.material.color.copy(i.material._color), i.material.opacity = i.material._opacity, this.enabled && this.axis && (i.name === this.axis || this.axis.split("").some(function(m) {
1440
+ return i.name === m;
1441
+ })) && (i.material.color.setHex(16776960), i.material.opacity = 1);
944
1442
  }
945
- super.updateMatrixWorld(o);
1443
+ super.updateMatrixWorld(n);
946
1444
  }
947
1445
  }
948
- class jn extends c {
1446
+ class Ri extends h {
949
1447
  constructor() {
950
1448
  super(
951
- new bn(1e5, 1e5, 2, 2),
952
- new qe({ visible: !1, wireframe: !0, side: gn, transparent: !0, opacity: 0.1, toneMapped: !1 })
1449
+ new li(1e5, 1e5, 2, 2),
1450
+ new yn({ visible: !1, wireframe: !0, side: ci, transparent: !0, opacity: 0.1, toneMapped: !1 })
953
1451
  ), this.isTransformControlsPlane = !0, this.type = "TransformControlsPlane";
954
1452
  }
955
- updateMatrixWorld(o) {
956
- let a = this.space;
957
- switch (this.position.copy(this.worldPosition), this.mode === "scale" && (a = "local"), se.copy(Ct).applyQuaternion(a === "local" ? this.worldQuaternion : re), Rt.copy(ut).applyQuaternion(a === "local" ? this.worldQuaternion : re), zt.copy(Xt).applyQuaternion(a === "local" ? this.worldQuaternion : re), f.copy(Rt), this.mode) {
1453
+ updateMatrixWorld(n) {
1454
+ let o = this.space;
1455
+ switch (this.position.copy(this.worldPosition), this.mode === "scale" && (o = "local"), gt.copy(Ge).applyQuaternion(o === "local" ? this.worldQuaternion : Mt), Qe.copy(Me).applyQuaternion(o === "local" ? this.worldQuaternion : Mt), qe.copy(We).applyQuaternion(o === "local" ? this.worldQuaternion : Mt), b.copy(Qe), this.mode) {
958
1456
  case "translate":
959
1457
  case "scale":
960
1458
  switch (this.axis) {
961
1459
  case "X":
962
- f.copy(this.eye).cross(se), B.copy(se).cross(f);
1460
+ b.copy(this.eye).cross(gt), te.copy(gt).cross(b);
963
1461
  break;
964
1462
  case "Y":
965
- f.copy(this.eye).cross(Rt), B.copy(Rt).cross(f);
1463
+ b.copy(this.eye).cross(Qe), te.copy(Qe).cross(b);
966
1464
  break;
967
1465
  case "Z":
968
- f.copy(this.eye).cross(zt), B.copy(zt).cross(f);
1466
+ b.copy(this.eye).cross(qe), te.copy(qe).cross(b);
969
1467
  break;
970
1468
  case "XY":
971
- B.copy(zt);
1469
+ te.copy(qe);
972
1470
  break;
973
1471
  case "YZ":
974
- B.copy(se);
1472
+ te.copy(gt);
975
1473
  break;
976
1474
  case "XZ":
977
- f.copy(zt), B.copy(Rt);
1475
+ b.copy(qe), te.copy(Qe);
978
1476
  break;
979
1477
  case "XYZ":
980
1478
  case "E":
981
- B.set(0, 0, 0);
1479
+ te.set(0, 0, 0);
982
1480
  break;
983
1481
  }
984
1482
  break;
985
1483
  case "rotate":
986
1484
  default:
987
- B.set(0, 0, 0);
1485
+ te.set(0, 0, 0);
988
1486
  }
989
- B.length() === 0 ? this.quaternion.copy(this.cameraQuaternion) : (Qe.lookAt(A.set(0, 0, 0), B, f), this.quaternion.setFromRotationMatrix(Qe)), super.updateMatrixWorld(o);
1487
+ te.length() === 0 ? this.quaternion.copy(this.cameraQuaternion) : (un.lookAt(j.set(0, 0, 0), te, b), this.quaternion.setFromRotationMatrix(un)), super.updateMatrixWorld(n);
990
1488
  }
991
1489
  }
992
- var q, wt;
993
- class On {
1490
+ var K, ve;
1491
+ class Yi {
994
1492
  constructor() {
995
- m(this, q, void 0);
996
- m(this, wt, void 0);
997
- S(this, q, new Sn(L.camera, L.webglRenderer.domElement)), S(this, wt, new ot([0, 0, 0], {
1493
+ u(this, K, void 0);
1494
+ u(this, ve, void 0);
1495
+ P(this, K, new _i(x.camera, x.webglRenderer.domElement)), P(this, ve, new F([0, 0, 0], {
998
1496
  passport: {
999
1497
  name: "Controls.OrbitControls.Target",
1000
1498
  manager: {
@@ -1004,30 +1502,30 @@ class On {
1004
1502
  }
1005
1503
  }
1006
1504
  }));
1007
- let o = !0;
1008
- s(this, wt).subscribe((a) => {
1009
- s(this, q).target.set(...a.current), o && s(this, q).update();
1010
- }), s(this, q).addEventListener("change", () => {
1011
- o = !1, s(this, wt).current = [
1012
- s(this, q).target.x,
1013
- s(this, q).target.y,
1014
- s(this, q).target.z
1015
- ], o = !0;
1505
+ let n = !0;
1506
+ s(this, ve).subscribe((o) => {
1507
+ s(this, K).target.set(...o.current), n && s(this, K).update();
1508
+ }), s(this, K).addEventListener("change", () => {
1509
+ n = !1, s(this, ve).current = [
1510
+ s(this, K).target.x,
1511
+ s(this, K).target.y,
1512
+ s(this, K).target.z
1513
+ ], n = !0;
1016
1514
  });
1017
1515
  }
1018
1516
  get controls() {
1019
- return s(this, q);
1517
+ return s(this, K);
1020
1518
  }
1021
1519
  destroy() {
1022
- s(this, q).dispose(), s(this, wt).close();
1520
+ s(this, K).dispose(), s(this, ve).close();
1023
1521
  }
1024
1522
  }
1025
- q = new WeakMap(), wt = new WeakMap();
1026
- var R, Zt, Nt, Qt, Ft, qt, Gt, Wt;
1027
- class Dn {
1523
+ K = new WeakMap(), ve = new WeakMap();
1524
+ var Y, $e, Je, et, tt, nt, it, ot, st;
1525
+ class ji {
1028
1526
  constructor() {
1029
- m(this, R, null);
1030
- m(this, Zt, new ot(L.camera.far, {
1527
+ u(this, Y, null);
1528
+ u(this, $e, new F(x.camera.far, {
1031
1529
  passport: {
1032
1530
  name: "Helpers.Grid.Size",
1033
1531
  manager: {
@@ -1036,7 +1534,7 @@ class Dn {
1036
1534
  }
1037
1535
  }
1038
1536
  }));
1039
- m(this, Nt, new ot(100, {
1537
+ u(this, Je, new F(100, {
1040
1538
  passport: {
1041
1539
  name: "Helpers.Grid.Divisions",
1042
1540
  manager: {
@@ -1044,7 +1542,7 @@ class Dn {
1044
1542
  }
1045
1543
  }
1046
1544
  }));
1047
- m(this, Qt, new ot("#0000ff", {
1545
+ u(this, et, new F("#0000ff", {
1048
1546
  passport: {
1049
1547
  name: "Helpers.Grid.Color 1",
1050
1548
  manager: {
@@ -1052,7 +1550,7 @@ class Dn {
1052
1550
  }
1053
1551
  }
1054
1552
  }));
1055
- m(this, Ft, new ot("#808080", {
1553
+ u(this, tt, new F("#808080", {
1056
1554
  passport: {
1057
1555
  name: "Helpers.Grid.Color 2",
1058
1556
  manager: {
@@ -1060,7 +1558,7 @@ class Dn {
1060
1558
  }
1061
1559
  }
1062
1560
  }));
1063
- m(this, qt, new ot(!1, {
1561
+ u(this, nt, new F(!1, {
1064
1562
  passport: {
1065
1563
  name: "Helpers.Grid.Vertical",
1066
1564
  manager: {
@@ -1068,98 +1566,134 @@ class Dn {
1068
1566
  }
1069
1567
  }
1070
1568
  }));
1071
- m(this, Gt, void 0);
1072
- m(this, Wt, (o) => {
1073
- o.key === "g" && (s(this, R).visible = !s(this, R).visible);
1569
+ u(this, it, new F(!0, {
1570
+ passport: {
1571
+ name: "Helpers.Grid.Visible",
1572
+ manager: {
1573
+ type: "boolean"
1574
+ }
1575
+ }
1576
+ }));
1577
+ u(this, ot, void 0);
1578
+ u(this, st, (n) => {
1579
+ n.key === "g" && (s(this, Y).visible = !s(this, Y).visible);
1074
1580
  });
1075
- S(this, Gt, new Pn(
1076
- [s(this, Zt), s(this, Nt), s(this, Qt), s(this, Ft), s(this, qt)],
1581
+ P(this, ot, new mi(
1582
+ [
1583
+ s(this, $e),
1584
+ s(this, Je),
1585
+ s(this, et),
1586
+ s(this, tt),
1587
+ s(this, nt),
1588
+ s(this, it)
1589
+ ],
1077
1590
  () => {
1078
- s(this, R) && (L.view.remove(s(this, R)), s(this, R).dispose()), S(this, R, new En(
1079
- s(this, Zt).current,
1080
- s(this, Nt).current,
1081
- s(this, Qt).current,
1082
- s(this, Ft).current
1083
- )), s(this, R).rotation.x = s(this, qt).current ? Math.PI / 2 : 0, L.view.add(s(this, R));
1591
+ s(this, Y) && (x.view.remove(s(this, Y)), s(this, Y).dispose()), P(this, Y, new hi(
1592
+ s(this, $e).current,
1593
+ s(this, Je).current,
1594
+ s(this, et).current,
1595
+ s(this, tt).current
1596
+ )), s(this, Y).rotation.x = s(this, nt).current ? Math.PI / 2 : 0, s(this, Y).visible = s(this, it).current, x.view.add(s(this, Y));
1084
1597
  }
1085
- )), addEventListener("keydown", s(this, Wt));
1598
+ )), addEventListener("keydown", s(this, st));
1086
1599
  }
1087
1600
  get helper() {
1088
- return s(this, R);
1601
+ return s(this, Y);
1089
1602
  }
1090
1603
  destroy() {
1091
- s(this, Gt).close(), s(this, R) && (L.view.remove(s(this, R)), s(this, R).dispose()), removeEventListener("keydown", s(this, Wt));
1604
+ s(this, ot).close(), s(this, Y) && (x.view.remove(s(this, Y)), s(this, Y).dispose()), removeEventListener("keydown", s(this, st));
1092
1605
  }
1093
1606
  }
1094
- R = new WeakMap(), Zt = new WeakMap(), Nt = new WeakMap(), Qt = new WeakMap(), Ft = new WeakMap(), qt = new WeakMap(), Gt = new WeakMap(), Wt = new WeakMap();
1095
- var v, K, lt, bt, Ut, It, Kt;
1096
- class Yn {
1607
+ Y = new WeakMap(), $e = new WeakMap(), Je = new WeakMap(), et = new WeakMap(), tt = new WeakMap(), nt = new WeakMap(), it = new WeakMap(), ot = new WeakMap(), st = new WeakMap();
1608
+ var O, B, ue, fe, at, Ye, rt, lt, jt;
1609
+ class Hi {
1097
1610
  constructor() {
1098
- m(this, v, void 0);
1099
- m(this, K, []);
1100
- m(this, lt, null);
1101
- m(this, bt, (o) => {
1102
- o.child.name && !s(this, K).find((a) => a.object3d === o.child) && (s(this, K).push(new Ge(o.child)), L.raycaster.add(o.child), o.child.addEventListener("pointerDown", s(this, It)), o.child.addEventListener("childadded", s(this, bt)));
1611
+ u(this, lt);
1612
+ u(this, O, void 0);
1613
+ u(this, B, []);
1614
+ u(this, ue, null);
1615
+ u(this, fe, (n) => {
1616
+ if (n.child.name.startsWith("T.") && !s(this, B).find((o) => o.object3d === n.child)) {
1617
+ const o = new Pn(n.child);
1618
+ s(this, B).push(o), x.raycaster.add(o.raycasterTarget, {
1619
+ eventDispatcher: o.raycasterTarget
1620
+ }), o.raycasterTarget.addEventListener(
1621
+ "pointerDown",
1622
+ s(this, Ye)
1623
+ ), o.object3d.addEventListener("childadded", s(this, fe));
1624
+ }
1103
1625
  });
1104
- m(this, Ut, (o) => {
1105
- const a = s(this, K).find(
1106
- (t) => t.object3d === o.child
1107
- );
1108
- a && (a.destroy(), L.raycaster.remove(o.child), a.object3d.removeEventListener(
1626
+ u(this, at, (n) => {
1627
+ const o = I(this, lt, jt).call(this, n.child);
1628
+ o && (x.raycaster.remove(o.raycasterTarget), o.destroy(), o.raycasterTarget.removeEventListener(
1109
1629
  "pointerDown",
1110
- s(this, It)
1111
- ), o.child.removeEventListener("childadded", s(this, bt)), S(this, K, s(this, K).filter(
1112
- (t) => t !== a
1113
- )));
1630
+ s(this, Ye)
1631
+ ), o.object3d.removeEventListener(
1632
+ "childadded",
1633
+ s(this, fe)
1634
+ ), P(this, B, s(this, B).filter((e) => e !== o)));
1114
1635
  });
1115
- m(this, It, (o) => {
1116
- S(this, lt, s(this, K).find((a) => a.object3d === o.object) || null), s(this, lt) && s(this, v).attach(s(this, lt).object3d);
1636
+ u(this, Ye, (n) => {
1637
+ const o = I(this, lt, jt).call(this, n.target);
1638
+ o && (P(this, ue, s(this, B).find((e) => e.object3d === (o == null ? void 0 : o.object3d)) || null), s(this, ue) && s(this, O).attach(s(this, ue).object3d));
1117
1639
  });
1118
- m(this, Kt, (o) => {
1119
- o.key === "t" ? s(this, v).setMode("translate") : o.key === "r" ? s(this, v).setMode("rotate") : o.key === "s" ? s(this, v).setMode("scale") : o.key === "Escape" ? s(this, v).detach() : o.key === "+" || o.key === "=" ? s(this, v).setSize(s(this, v).size + 0.1) : (o.key === "-" || o.key === "_") && s(this, v).setSize(s(this, v).size - 0.1);
1640
+ u(this, rt, (n) => {
1641
+ n.key === "t" ? s(this, O).setMode("translate") : n.key === "r" ? s(this, O).setMode("rotate") : n.key === "s" ? s(this, O).setMode("scale") : n.key === "Escape" ? s(this, O).detach() : n.key === "+" || n.key === "=" ? s(this, O).setSize(s(this, O).size + 0.1) : n.key === "-" || n.key === "_" ? s(this, O).setSize(s(this, O).size - 0.1) : n.key === "h" && s(this, B).forEach((o) => {
1642
+ o.helpers.forEach((e) => {
1643
+ e.visible = !e.visible;
1644
+ });
1645
+ });
1120
1646
  });
1121
- S(this, v, new xn(
1122
- L.camera,
1123
- L.webglRenderer.domElement
1124
- )), s(this, v).addEventListener("objectChange", (o) => {
1125
- s(this, lt) && s(this, lt).save();
1126
- }), L.view.add(s(this, v)), L.scene.addEventListener("childadded", s(this, bt)), L.scene.addEventListener("childremoved", s(this, Ut)), window.addEventListener("keydown", s(this, Kt));
1647
+ P(this, O, new Ti(
1648
+ x.camera,
1649
+ x.webglRenderer.domElement
1650
+ )), s(this, O).addEventListener("objectChange", (n) => {
1651
+ s(this, ue) && s(this, ue).save();
1652
+ }), x.view.add(s(this, O)), x.scene.addEventListener("childadded", s(this, fe)), x.scene.addEventListener("childremoved", s(this, at)), window.addEventListener("keydown", s(this, rt));
1127
1653
  }
1128
1654
  get controls() {
1129
- return s(this, v);
1655
+ return s(this, O);
1130
1656
  }
1131
1657
  destroy() {
1132
- L.scene.removeEventListener("childadded", s(this, bt)), L.scene.removeEventListener("childremoved", s(this, Ut)), window.removeEventListener("keydown", s(this, Kt)), s(this, v).dispose(), s(this, K).forEach((o) => {
1133
- o.destroy(), o.object3d.removeEventListener(
1658
+ x.scene.removeEventListener("childadded", s(this, fe)), x.scene.removeEventListener("childremoved", s(this, at)), window.removeEventListener("keydown", s(this, rt)), s(this, O).dispose(), s(this, B).forEach((n) => {
1659
+ n.raycasterTarget.removeEventListener(
1134
1660
  "pointerDown",
1135
- s(this, It)
1136
- );
1137
- }), S(this, K, []);
1661
+ s(this, Ye)
1662
+ ), n.object3d.removeEventListener(
1663
+ "childadded",
1664
+ s(this, fe)
1665
+ ), n.destroy();
1666
+ }), P(this, B, []);
1138
1667
  }
1139
1668
  }
1140
- v = new WeakMap(), K = new WeakMap(), lt = new WeakMap(), bt = new WeakMap(), Ut = new WeakMap(), It = new WeakMap(), Kt = new WeakMap();
1141
- var Bt, At, gt, Lt;
1142
- class Nn {
1669
+ O = new WeakMap(), B = new WeakMap(), ue = new WeakMap(), fe = new WeakMap(), at = new WeakMap(), Ye = new WeakMap(), rt = new WeakMap(), lt = new WeakSet(), jt = function(n) {
1670
+ return s(this, B).find(
1671
+ (e) => e.object3d === n || e.raycasterTarget === n
1672
+ );
1673
+ };
1674
+ var ct, ht, je, _e, He;
1675
+ class Wi {
1143
1676
  constructor() {
1144
- m(this, Bt, void 0);
1145
- m(this, At, void 0);
1146
- m(this, gt, void 0);
1147
- m(this, Lt, void 0);
1148
- S(this, Bt, new Dn()), S(this, At, new Ge(L.camera)), S(this, gt, new On()), s(this, gt).controls.addEventListener("change", () => {
1149
- s(this, At).save();
1150
- }), S(this, Lt, new Yn()), s(this, Lt).controls.addEventListener(
1677
+ u(this, ct, void 0);
1678
+ u(this, ht, void 0);
1679
+ u(this, je, void 0);
1680
+ u(this, _e, void 0);
1681
+ u(this, He, void 0);
1682
+ P(this, ct, new bn(x.webglRenderer)), P(this, ht, new ji()), P(this, je, new Pn(x.camera)), P(this, _e, new Yi()), s(this, _e).controls.addEventListener("change", () => {
1683
+ s(this, je).save();
1684
+ }), P(this, He, new Hi()), s(this, He).controls.addEventListener(
1151
1685
  "dragging-changed",
1152
- (o) => {
1153
- s(this, gt).controls.enabled = !o.value;
1686
+ (n) => {
1687
+ s(this, _e).controls.enabled = !n.value;
1154
1688
  }
1155
1689
  );
1156
1690
  }
1157
1691
  destroy() {
1158
- s(this, Bt).destroy(), s(this, At).destroy(), s(this, gt).destroy(), s(this, Lt).destroy();
1692
+ s(this, ct).destroy(), s(this, ht).destroy(), s(this, je).destroy(), s(this, _e).destroy(), s(this, He).destroy();
1159
1693
  }
1160
1694
  }
1161
- Bt = new WeakMap(), At = new WeakMap(), gt = new WeakMap(), Lt = new WeakMap();
1695
+ ct = new WeakMap(), ht = new WeakMap(), je = new WeakMap(), _e = new WeakMap(), He = new WeakMap();
1162
1696
  export {
1163
- Nn as En3Controls,
1164
- Ge as En3Object3dManager
1697
+ Wi as En3Helpers,
1698
+ Pn as En3Object3dManager
1165
1699
  };