@thatopen/components 2.0.3 → 2.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,39 +1,39 @@
1
- var Hn = Object.defineProperty;
2
- var kn = (l, s, t) => s in l ? Hn(l, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[s] = t;
3
- var I = (l, s, t) => (kn(l, typeof s != "symbol" ? s + "" : s, t), t);
1
+ var Wn = Object.defineProperty;
2
+ var Xn = (l, s, t) => s in l ? Wn(l, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[s] = t;
3
+ var I = (l, s, t) => (Xn(l, typeof s != "symbol" ? s + "" : s, t), t);
4
4
  import * as g from "three";
5
- import { BufferAttribute as Nn, Vector3 as w, Vector2 as pe, Plane as Ai, Line3 as Lt, Triangle as Ie, Sphere as Wn, Matrix4 as yt, Box3 as Ot, BackSide as Xn, DoubleSide as Pn, FrontSide as Mi, Mesh as v, Ray as Zn, Raycaster as Qn, Quaternion as Pt, Object3D as oi, Euler as jn, MeshBasicMaterial as Ln, LineBasicMaterial as qn, CylinderGeometry as ct, BoxGeometry as rt, BufferGeometry as Di, Float32BufferAttribute as Ui, OctahedronGeometry as Qe, Line as Dt, SphereGeometry as $n, TorusGeometry as Re, PlaneGeometry as Kn } from "three";
5
+ import { BufferAttribute as Ln, Vector3 as w, Vector2 as pe, Plane as Fi, Line3 as Lt, Triangle as Ie, Sphere as Zn, Matrix4 as yt, Box3 as Ot, BackSide as Qn, DoubleSide as yn, FrontSide as Di, Mesh as v, Ray as jn, Raycaster as qn, Quaternion as Pt, Object3D as ri, Euler as $n, MeshBasicMaterial as wn, LineBasicMaterial as Kn, CylinderGeometry as ct, BoxGeometry as rt, BufferGeometry as Ui, Float32BufferAttribute as xi, OctahedronGeometry as Qe, Line as Dt, SphereGeometry as Jn, TorusGeometry as Re, PlaneGeometry as to } from "three";
6
6
  import * as Vt from "@thatopen/fragments";
7
- import { Serializer as Jn } from "@thatopen/fragments";
7
+ import { Serializer as eo } from "@thatopen/fragments";
8
8
  import * as U from "web-ifc";
9
- const yn = 0, to = 1, eo = 2, xi = 2, Bs = 1.25, bi = 1, Ts = 6 * 4 + 4 + 4, Ds = 65535, so = Math.pow(2, -24), Ys = Symbol("SKIP_GENERATION");
10
- function io(l) {
9
+ const Mn = 0, so = 1, io = 2, bi = 2, Ys = 1.25, vi = 1, Ts = 6 * 4 + 4 + 4, Us = 65535, no = Math.pow(2, -24), Vs = Symbol("SKIP_GENERATION");
10
+ function oo(l) {
11
11
  return l.index ? l.index.count : l.attributes.position.count;
12
12
  }
13
13
  function Ce(l) {
14
- return io(l) / 3;
14
+ return oo(l) / 3;
15
15
  }
16
- function no(l, s = ArrayBuffer) {
16
+ function ro(l, s = ArrayBuffer) {
17
17
  return l > 65535 ? new Uint32Array(new s(4 * l)) : new Uint16Array(new s(2 * l));
18
18
  }
19
- function oo(l, s) {
19
+ function ao(l, s) {
20
20
  if (!l.index) {
21
- const t = l.attributes.position.count, e = s.useSharedArrayBuffer ? SharedArrayBuffer : ArrayBuffer, i = no(t, e);
22
- l.setIndex(new Nn(i, 1));
21
+ const t = l.attributes.position.count, e = s.useSharedArrayBuffer ? SharedArrayBuffer : ArrayBuffer, i = ro(t, e);
22
+ l.setIndex(new Ln(i, 1));
23
23
  for (let o = 0; o < t; o++)
24
24
  i[o] = o;
25
25
  }
26
26
  }
27
- function wn(l) {
27
+ function Dn(l) {
28
28
  const s = Ce(l), t = l.drawRange, e = t.start / 3, i = (t.start + t.count) / 3, o = Math.max(0, e), n = Math.min(s, i) - o;
29
29
  return [{
30
30
  offset: Math.floor(o),
31
31
  count: Math.floor(n)
32
32
  }];
33
33
  }
34
- function Mn(l) {
34
+ function Un(l) {
35
35
  if (!l.groups || !l.groups.length)
36
- return wn(l);
36
+ return Dn(l);
37
37
  const s = [], t = /* @__PURE__ */ new Set(), e = l.drawRange, i = e.start / 3, o = (e.start + e.count) / 3;
38
38
  for (const r of l.groups) {
39
39
  const a = r.start / 3, c = (r.start + r.count) / 3;
@@ -49,10 +49,10 @@ function Mn(l) {
49
49
  }
50
50
  return s;
51
51
  }
52
- function ro(l) {
52
+ function co(l) {
53
53
  if (l.groups.length === 0)
54
54
  return !1;
55
- const s = Ce(l), t = Mn(l).sort((o, n) => o.offset - n.offset), e = t[t.length - 1];
55
+ const s = Ce(l), t = Un(l).sort((o, n) => o.offset - n.offset), e = t[t.length - 1];
56
56
  e.count = Math.min(s - e.offset, e.count);
57
57
  let i = 0;
58
58
  return t.forEach(({ count: o }) => i += o), s !== i;
@@ -60,10 +60,10 @@ function ro(l) {
60
60
  function $(l, s, t) {
61
61
  return t.min.x = s[l], t.min.y = s[l + 1], t.min.z = s[l + 2], t.max.x = s[l + 3], t.max.y = s[l + 4], t.max.z = s[l + 5], t;
62
62
  }
63
- function ao(l) {
63
+ function lo(l) {
64
64
  l[0] = l[1] = l[2] = 1 / 0, l[3] = l[4] = l[5] = -1 / 0;
65
65
  }
66
- function vi(l) {
66
+ function Bi(l) {
67
67
  let s = -1, t = -1 / 0;
68
68
  for (let e = 0; e < 3; e++) {
69
69
  const i = l[e + 3] - l[e];
@@ -71,10 +71,10 @@ function vi(l) {
71
71
  }
72
72
  return s;
73
73
  }
74
- function Bi(l, s) {
74
+ function Yi(l, s) {
75
75
  s.set(l);
76
76
  }
77
- function Yi(l, s, t) {
77
+ function Vi(l, s, t) {
78
78
  let e, i;
79
79
  for (let o = 0; o < 3; o++) {
80
80
  const n = o + 3;
@@ -91,7 +91,7 @@ function Ae(l) {
91
91
  const s = l[3] - l[0], t = l[4] - l[1], e = l[5] - l[2];
92
92
  return 2 * (s * t + t * e + e * s);
93
93
  }
94
- function Vs(l, s, t, e, i = null) {
94
+ function Gs(l, s, t, e, i = null) {
95
95
  let o = 1 / 0, n = 1 / 0, r = 1 / 0, a = -1 / 0, c = -1 / 0, E = -1 / 0, d = 1 / 0, h = 1 / 0, u = 1 / 0, p = -1 / 0, A = -1 / 0, R = -1 / 0;
96
96
  const C = i !== null;
97
97
  for (let T = s * 6, F = (s + t) * 6; T < F; T += 6) {
@@ -104,7 +104,7 @@ function Vs(l, s, t, e, i = null) {
104
104
  }
105
105
  e[0] = o, e[1] = n, e[2] = r, e[3] = a, e[4] = c, e[5] = E, C && (i[0] = d, i[1] = h, i[2] = u, i[3] = p, i[4] = A, i[5] = R);
106
106
  }
107
- function co(l, s, t, e) {
107
+ function ho(l, s, t, e) {
108
108
  let i = 1 / 0, o = 1 / 0, n = 1 / 0, r = -1 / 0, a = -1 / 0, c = -1 / 0;
109
109
  for (let E = s * 6, d = (s + t) * 6; E < d; E += 6) {
110
110
  const h = l[E + 0];
@@ -116,8 +116,8 @@ function co(l, s, t, e) {
116
116
  }
117
117
  e[0] = i, e[1] = o, e[2] = n, e[3] = r, e[4] = a, e[5] = c;
118
118
  }
119
- function lo(l, s) {
120
- ao(s);
119
+ function Eo(l, s) {
120
+ lo(s);
121
121
  const t = l.attributes.position, e = l.index ? l.index.array : null, i = Ce(l), o = new Float32Array(i * 6), n = t.normalized, r = t.array, a = t.offset || 0;
122
122
  let c = 3;
123
123
  t.isInterleavedBufferAttribute && (c = t.data.stride);
@@ -134,27 +134,27 @@ function lo(l, s) {
134
134
  let O = T;
135
135
  F > O && (O = F), f > O && (O = f);
136
136
  const S = (O - m) / 2, _ = C * 2;
137
- o[u + _ + 0] = m + S, o[u + _ + 1] = S + (Math.abs(m) + S) * so, m < s[C] && (s[C] = m), O > s[C + 3] && (s[C + 3] = O);
137
+ o[u + _ + 0] = m + S, o[u + _ + 1] = S + (Math.abs(m) + S) * no, m < s[C] && (s[C] = m), O > s[C + 3] && (s[C + 3] = O);
138
138
  }
139
139
  }
140
140
  return o;
141
141
  }
142
- const wt = 32, ho = (l, s) => l.candidate - s.candidate, Ut = new Array(wt).fill().map(() => ({
142
+ const wt = 32, uo = (l, s) => l.candidate - s.candidate, Ut = new Array(wt).fill().map(() => ({
143
143
  count: 0,
144
144
  bounds: new Float32Array(6),
145
145
  rightCacheBounds: new Float32Array(6),
146
146
  leftCacheBounds: new Float32Array(6),
147
147
  candidate: 0
148
148
  })), qe = new Float32Array(6);
149
- function Eo(l, s, t, e, i, o) {
149
+ function Io(l, s, t, e, i, o) {
150
150
  let n = -1, r = 0;
151
- if (o === yn)
152
- n = vi(s), n !== -1 && (r = (s[n] + s[n + 3]) / 2);
153
- else if (o === to)
154
- n = vi(l), n !== -1 && (r = uo(t, e, i, n));
155
- else if (o === eo) {
151
+ if (o === Mn)
152
+ n = Bi(s), n !== -1 && (r = (s[n] + s[n + 3]) / 2);
153
+ else if (o === so)
154
+ n = Bi(l), n !== -1 && (r = fo(t, e, i, n));
155
+ else if (o === io) {
156
156
  const a = Ae(l);
157
- let c = Bs * i;
157
+ let c = Ys * i;
158
158
  const E = e * 6, d = (e + i) * 6;
159
159
  for (let h = 0; h < 3; h++) {
160
160
  const u = s[h], R = (s[h + 3] - u) / wt;
@@ -174,7 +174,7 @@ function Eo(l, s, t, e, i, o) {
174
174
  _[N] = 1 / 0, _[N + 3] = -1 / 0, S[N] = 1 / 0, S[N + 3] = -1 / 0, O[N] = 1 / 0, O[N + 3] = -1 / 0;
175
175
  je(f, t, O);
176
176
  }
177
- C.sort(ho);
177
+ C.sort(uo);
178
178
  let F = i;
179
179
  for (let f = 0; f < F; f++) {
180
180
  const m = C[f];
@@ -194,7 +194,7 @@ function Eo(l, s, t, e, i, o) {
194
194
  O !== 0 && (L = Ae(_) / a);
195
195
  let M = 0;
196
196
  S !== 0 && (M = Ae(N) / a);
197
- const y = bi + Bs * (L * O + M * S);
197
+ const y = vi + Ys * (L * O + M * S);
198
198
  y < c && (n = h, c = y, r = m.candidate);
199
199
  }
200
200
  } else {
@@ -212,20 +212,20 @@ function Eo(l, s, t, e, i, o) {
212
212
  S.count++, je(F, t, S.bounds);
213
213
  }
214
214
  const C = Ut[wt - 1];
215
- Bi(C.bounds, C.rightCacheBounds);
215
+ Yi(C.bounds, C.rightCacheBounds);
216
216
  for (let F = wt - 2; F >= 0; F--) {
217
217
  const f = Ut[F], m = Ut[F + 1];
218
- Yi(f.bounds, m.rightCacheBounds, f.rightCacheBounds);
218
+ Vi(f.bounds, m.rightCacheBounds, f.rightCacheBounds);
219
219
  }
220
220
  let T = 0;
221
221
  for (let F = 0; F < wt - 1; F++) {
222
222
  const f = Ut[F], m = f.count, O = f.bounds, _ = Ut[F + 1].rightCacheBounds;
223
- m !== 0 && (T === 0 ? Bi(O, qe) : Yi(O, qe, qe)), T += m;
223
+ m !== 0 && (T === 0 ? Yi(O, qe) : Vi(O, qe, qe)), T += m;
224
224
  let N = 0, L = 0;
225
225
  T !== 0 && (N = Ae(qe) / a);
226
226
  const M = i - T;
227
227
  M !== 0 && (L = Ae(_) / a);
228
- const y = bi + Bs * (N * T + L * M);
228
+ const y = vi + Ys * (N * T + L * M);
229
229
  y < c && (n = h, c = y, r = f.candidate);
230
230
  }
231
231
  }
@@ -234,7 +234,7 @@ function Eo(l, s, t, e, i, o) {
234
234
  console.warn(`MeshBVH: Invalid build strategy value ${o} used.`);
235
235
  return { axis: n, pos: r };
236
236
  }
237
- function uo(l, s, t, e) {
237
+ function fo(l, s, t, e) {
238
238
  let i = 0;
239
239
  for (let o = s, n = s + t; o < n; o++)
240
240
  i += l[o * 6 + e * 2];
@@ -244,7 +244,7 @@ class $e {
244
244
  constructor() {
245
245
  }
246
246
  }
247
- function Io(l, s, t, e, i, o) {
247
+ function po(l, s, t, e, i, o) {
248
248
  let n = e, r = e + i - 1;
249
249
  const a = o.pos, c = o.axis * 2;
250
250
  for (; ; ) {
@@ -266,7 +266,7 @@ function Io(l, s, t, e, i, o) {
266
266
  return n;
267
267
  }
268
268
  }
269
- function fo(l, s, t, e, i, o) {
269
+ function Co(l, s, t, e, i, o) {
270
270
  let n = e, r = e + i - 1;
271
271
  const a = o.pos, c = o.axis * 2;
272
272
  for (; ; ) {
@@ -286,23 +286,23 @@ function fo(l, s, t, e, i, o) {
286
286
  return n;
287
287
  }
288
288
  }
289
- function po(l, s) {
289
+ function To(l, s) {
290
290
  const t = (l.index ? l.index.count : l.attributes.position.count) / 3, e = t > 2 ** 16, i = e ? 4 : 2, o = s ? new SharedArrayBuffer(t * i) : new ArrayBuffer(t * i), n = e ? new Uint32Array(o) : new Uint16Array(o);
291
291
  for (let r = 0, a = n.length; r < a; r++)
292
292
  n[r] = r;
293
293
  return n;
294
294
  }
295
- function Co(l, s) {
295
+ function mo(l, s) {
296
296
  const t = l.geometry, e = t.index ? t.index.array : null, i = s.maxDepth, o = s.verbose, n = s.maxLeafTris, r = s.strategy, a = s.onProgress, c = Ce(t), E = l._indirectBuffer;
297
297
  let d = !1;
298
- const h = new Float32Array(6), u = new Float32Array(6), p = lo(t, h), A = s.indirect ? fo : Io, R = [], C = s.indirect ? wn(t) : Mn(t);
298
+ const h = new Float32Array(6), u = new Float32Array(6), p = Eo(t, h), A = s.indirect ? Co : po, R = [], C = s.indirect ? Dn(t) : Un(t);
299
299
  if (C.length === 1) {
300
300
  const f = C[0], m = new $e();
301
- m.boundingData = h, co(p, f.offset, f.count, u), F(m, f.offset, f.count, u), R.push(m);
301
+ m.boundingData = h, ho(p, f.offset, f.count, u), F(m, f.offset, f.count, u), R.push(m);
302
302
  } else
303
303
  for (let f of C) {
304
304
  const m = new $e();
305
- m.boundingData = new Float32Array(6), Vs(p, f.offset, f.count, m.boundingData, u), F(m, f.offset, f.count, u), R.push(m);
305
+ m.boundingData = new Float32Array(6), Gs(p, f.offset, f.count, m.boundingData, u), F(m, f.offset, f.count, u), R.push(m);
306
306
  }
307
307
  return R;
308
308
  function T(f) {
@@ -311,7 +311,7 @@ function Co(l, s) {
311
311
  function F(f, m, O, S = null, _ = 0) {
312
312
  if (!d && _ >= i && (d = !0, o && (console.warn(`MeshBVH: Max depth of ${i} reached when generating BVH. Consider increasing maxDepth.`), console.warn(t))), O <= n || _ >= i)
313
313
  return T(m + O), f.offset = m, f.count = O, f;
314
- const N = Eo(f.boundingData, S, p, m, O, r);
314
+ const N = Io(f.boundingData, S, p, m, O, r);
315
315
  if (N.axis === -1)
316
316
  return T(m + O), f.offset = m, f.count = O, f;
317
317
  const L = A(E, e, p, m, O, N);
@@ -320,19 +320,19 @@ function Co(l, s) {
320
320
  else {
321
321
  f.splitAxis = N.axis;
322
322
  const M = new $e(), y = m, x = L - m;
323
- f.left = M, M.boundingData = new Float32Array(6), Vs(p, y, x, M.boundingData, u), F(M, y, x, u, _ + 1);
323
+ f.left = M, M.boundingData = new Float32Array(6), Gs(p, y, x, M.boundingData, u), F(M, y, x, u, _ + 1);
324
324
  const b = new $e(), B = L, H = O - x;
325
- f.right = b, b.boundingData = new Float32Array(6), Vs(p, B, H, b.boundingData, u), F(b, B, H, u, _ + 1);
325
+ f.right = b, b.boundingData = new Float32Array(6), Gs(p, B, H, b.boundingData, u), F(b, B, H, u, _ + 1);
326
326
  }
327
327
  return f;
328
328
  }
329
329
  }
330
- function To(l, s) {
330
+ function Ro(l, s) {
331
331
  const t = l.geometry;
332
- s.indirect && (l._indirectBuffer = po(t, s.useSharedArrayBuffer), ro(t) && !s.verbose && console.warn(
332
+ s.indirect && (l._indirectBuffer = To(t, s.useSharedArrayBuffer), co(t) && !s.verbose && console.warn(
333
333
  'MeshBVH: Provided geometry contains groups that do not fully span the vertex contents while using the "indirect" option. BVH may incorrectly report intersections on unrendered portions of the geometry.'
334
- )), l._indirectBuffer || oo(t, s);
335
- const e = Co(l, s);
334
+ )), l._indirectBuffer || ao(t, s);
335
+ const e = mo(l, s);
336
336
  let i, o, n;
337
337
  const r = [], a = s.useSharedArrayBuffer ? SharedArrayBuffer : ArrayBuffer;
338
338
  for (let d = 0; d < e.length; d++) {
@@ -352,7 +352,7 @@ function To(l, s) {
352
352
  i[u + C] = R[C];
353
353
  if (A) {
354
354
  const C = h.offset, T = h.count;
355
- return o[u + 6] = C, n[p + 14] = T, n[p + 15] = Ds, d + Ts;
355
+ return o[u + 6] = C, n[p + 14] = T, n[p + 15] = Us, d + Ts;
356
356
  } else {
357
357
  const C = h.left, T = h.right, F = h.splitAxis;
358
358
  let f;
@@ -401,7 +401,7 @@ Mt.prototype.setFromBox = function() {
401
401
  this.min = n, this.max = r;
402
402
  };
403
403
  }();
404
- const mo = function() {
404
+ const Ao = function() {
405
405
  const l = new w(), s = new w(), t = new w();
406
406
  return function(i, o, n) {
407
407
  const r = i.start, a = l, c = o.start, E = s;
@@ -410,10 +410,10 @@ const mo = function() {
410
410
  let C, T;
411
411
  R !== 0 ? C = (d * h - p * u) / R : C = 0, T = (d + C * h) / u, n.x = C, n.y = T;
412
412
  };
413
- }(), Fi = function() {
413
+ }(), Oi = function() {
414
414
  const l = new pe(), s = new w(), t = new w();
415
415
  return function(i, o, n, r) {
416
- mo(i, o, l);
416
+ Ao(i, o, l);
417
417
  let a = l.x, c = l.y;
418
418
  if (a >= 0 && a <= 1 && c >= 0 && c <= 1) {
419
419
  i.at(a, n), o.at(c, r);
@@ -439,8 +439,8 @@ const mo = function() {
439
439
  }
440
440
  }
441
441
  };
442
- }(), Ro = function() {
443
- const l = new w(), s = new w(), t = new Ai(), e = new Lt();
442
+ }(), Fo = function() {
443
+ const l = new w(), s = new w(), t = new Fi(), e = new Lt();
444
444
  return function(o, n) {
445
445
  const { radius: r, center: a } = o, { a: c, b: E, c: d } = n;
446
446
  if (e.start = c, e.end = E, e.closestPointToPoint(a, !0, l).distanceTo(a) <= r || (e.start = c, e.end = d, e.closestPointToPoint(a, !0, l).distanceTo(a) <= r) || (e.start = E, e.end = d, e.closestPointToPoint(a, !0, l).distanceTo(a) <= r))
@@ -453,16 +453,16 @@ const mo = function() {
453
453
  }
454
454
  return !1;
455
455
  };
456
- }(), Ao = 1e-15;
457
- function Gs(l) {
458
- return Math.abs(l) < Ao;
456
+ }(), Oo = 1e-15;
457
+ function zs(l) {
458
+ return Math.abs(l) < Oo;
459
459
  }
460
460
  class Ft extends Ie {
461
461
  constructor(...s) {
462
- super(...s), this.isExtendedTriangle = !0, this.satAxes = new Array(4).fill().map(() => new w()), this.satBounds = new Array(4).fill().map(() => new Mt()), this.points = [this.a, this.b, this.c], this.sphere = new Wn(), this.plane = new Ai(), this.needsUpdate = !0;
462
+ super(...s), this.isExtendedTriangle = !0, this.satAxes = new Array(4).fill().map(() => new w()), this.satBounds = new Array(4).fill().map(() => new Mt()), this.points = [this.a, this.b, this.c], this.sphere = new Zn(), this.plane = new Fi(), this.needsUpdate = !0;
463
463
  }
464
464
  intersectsSphere(s) {
465
- return Ro(s, this);
465
+ return Fo(s, this);
466
466
  }
467
467
  update() {
468
468
  const s = this.a, t = this.b, e = this.c, i = this.points, o = this.satAxes, n = this.satBounds, r = o[0], a = n[0];
@@ -482,7 +482,7 @@ Ft.prototype.closestPointToSegment = function() {
482
482
  let E, d = 1 / 0;
483
483
  for (let h = 0; h < 3; h++) {
484
484
  const u = (h + 1) % 3;
485
- t.start.copy(c[h]), t.end.copy(c[u]), Fi(t, i, l, s), E = l.distanceToSquared(s), E < d && (d = E, o && o.copy(l), n && n.copy(s));
485
+ t.start.copy(c[h]), t.end.copy(c[u]), Oi(t, i, l, s), E = l.distanceToSquared(s), E < d && (d = E, o && o.copy(l), n && n.copy(s));
486
486
  }
487
487
  return this.closestPointToPoint(r, l), E = r.distanceToSquared(l), E < d && (d = E, o && o.copy(l), n && n.copy(r)), this.closestPointToPoint(a, l), E = a.distanceToSquared(l), E < d && (d = E, o && o.copy(l), n && n.copy(a)), Math.sqrt(d);
488
488
  };
@@ -495,13 +495,13 @@ Ft.prototype.intersectsTriangle = function() {
495
495
  for (let m = 0; m < 3; m++) {
496
496
  const { start: O, end: S } = E;
497
497
  O.copy(T[m]), S.copy(T[(m + 1) % 3]), E.delta(n);
498
- const _ = Gs(R.distanceToPoint(O));
499
- if (Gs(R.normal.dot(n)) && _) {
498
+ const _ = zs(R.distanceToPoint(O));
499
+ if (zs(R.normal.dot(n)) && _) {
500
500
  C.copy(E), F = 2;
501
501
  break;
502
502
  }
503
503
  const N = R.intersectLine(E, u);
504
- if (!N && _ && u.copy(O), (N || _) && !Gs(u.distanceTo(S))) {
504
+ if (!N && _ && u.copy(O), (N || _) && !zs(u.distanceTo(S))) {
505
505
  if (F <= 1)
506
506
  (F === 1 ? C.start : C.end).copy(u), _ && (f = F);
507
507
  else if (F >= 2) {
@@ -586,7 +586,7 @@ Ft.prototype.distanceToTriangle = function() {
586
586
  e.set(this[h], this[u]);
587
587
  for (let p = 0; p < 3; p++) {
588
588
  const A = t[p], R = t[(p + 1) % 3];
589
- i.set(n[A], n[R]), Fi(e, i, l, s);
589
+ i.set(n[A], n[R]), Oi(e, i, l, s);
590
590
  const C = l.distanceToSquared(s);
591
591
  C < E && (E = C, r && r.copy(l), a && a.copy(s));
592
592
  }
@@ -712,7 +712,7 @@ at.prototype.distanceToBox = function() {
712
712
  const C = s[R];
713
713
  for (let T = 0; T < 12; T++) {
714
714
  const F = t[T];
715
- Fi(C, F, e, i);
715
+ Oi(C, F, e, i);
716
716
  const f = e.distanceToSquared(i);
717
717
  if (f < p && (p = f, a && a.copy(e), c && c.copy(i), f < E))
718
718
  return Math.sqrt(f);
@@ -721,7 +721,7 @@ at.prototype.distanceToBox = function() {
721
721
  return Math.sqrt(p);
722
722
  };
723
723
  }();
724
- class Oi {
724
+ class gi {
725
725
  constructor(s) {
726
726
  this._getNewPrimitive = s, this._primitives = [];
727
727
  }
@@ -733,12 +733,12 @@ class Oi {
733
733
  this._primitives.push(s);
734
734
  }
735
735
  }
736
- class Fo extends Oi {
736
+ class go extends gi {
737
737
  constructor() {
738
738
  super(() => new Ft());
739
739
  }
740
740
  }
741
- const It = /* @__PURE__ */ new Fo();
741
+ const It = /* @__PURE__ */ new go();
742
742
  function ht(l, s) {
743
743
  return s[l + 15] === 65535;
744
744
  }
@@ -754,10 +754,10 @@ function pt(l) {
754
754
  function Ct(l, s) {
755
755
  return s[l + 6];
756
756
  }
757
- function Dn(l, s) {
757
+ function xn(l, s) {
758
758
  return s[l + 7];
759
759
  }
760
- class Oo {
760
+ class So {
761
761
  constructor() {
762
762
  this.float32Array = null, this.uint16Array = null, this.uint32Array = null;
763
763
  const s = [];
@@ -769,17 +769,17 @@ class Oo {
769
769
  };
770
770
  }
771
771
  }
772
- const Z = new Oo();
772
+ const Z = new So();
773
773
  let Yt, fe;
774
- const te = [], Ke = /* @__PURE__ */ new Oi(() => new Ot());
775
- function go(l, s, t, e, i, o) {
774
+ const te = [], Ke = /* @__PURE__ */ new gi(() => new Ot());
775
+ function _o(l, s, t, e, i, o) {
776
776
  Yt = Ke.getPrimitive(), fe = Ke.getPrimitive(), te.push(Yt, fe), Z.setBuffer(l._roots[s]);
777
- const n = ri(0, l.geometry, t, e, i, o);
777
+ const n = ai(0, l.geometry, t, e, i, o);
778
778
  Z.clearBuffer(), Ke.releasePrimitive(Yt), Ke.releasePrimitive(fe), te.pop(), te.pop();
779
779
  const r = te.length;
780
780
  return r > 0 && (fe = te[r - 1], Yt = te[r - 2]), n;
781
781
  }
782
- function ri(l, s, t, e, i = null, o = 0, n = 0) {
782
+ function ai(l, s, t, e, i = null, o = 0, n = 0) {
783
783
  const { float32Array: r, uint16Array: a, uint32Array: c } = Z;
784
784
  let E = l * 2;
785
785
  if (ht(E, a)) {
@@ -809,11 +809,11 @@ function ri(l, s, t, e, i = null, o = 0, n = 0) {
809
809
  T || (T = Yt, $(p, r, T));
810
810
  const f = ht(p * 2, a), m = t(T, f, R, n + 1, o + p);
811
811
  let O;
812
- if (m === xi) {
812
+ if (m === bi) {
813
813
  const y = L(p), b = M(p) - y;
814
814
  O = e(y, b, !0, n + 1, o + p, T);
815
815
  } else
816
- O = m && ri(
816
+ O = m && ai(
817
817
  p,
818
818
  s,
819
819
  t,
@@ -827,11 +827,11 @@ function ri(l, s, t, e, i = null, o = 0, n = 0) {
827
827
  F = fe, $(A, r, F);
828
828
  const S = ht(A * 2, a), _ = t(F, S, C, n + 1, o + A);
829
829
  let N;
830
- if (_ === xi) {
830
+ if (_ === bi) {
831
831
  const y = L(A), b = M(A) - y;
832
832
  N = e(y, b, !0, n + 1, o + A, F);
833
833
  } else
834
- N = _ && ri(
834
+ N = _ && ai(
835
835
  A,
836
836
  s,
837
837
  t,
@@ -843,8 +843,8 @@ function ri(l, s, t, e, i = null, o = 0, n = 0) {
843
843
  return !!N;
844
844
  }
845
845
  }
846
- const Fe = /* @__PURE__ */ new w(), zs = /* @__PURE__ */ new w();
847
- function So(l, s, t = {}, e = 0, i = 1 / 0) {
846
+ const Fe = /* @__PURE__ */ new w(), Hs = /* @__PURE__ */ new w();
847
+ function No(l, s, t = {}, e = 0, i = 1 / 0) {
848
848
  const o = e * e, n = i * i;
849
849
  let r = 1 / 0, a = null;
850
850
  if (l.shapecast(
@@ -854,27 +854,27 @@ function So(l, s, t = {}, e = 0, i = 1 / 0) {
854
854
  intersectsTriangle: (E, d) => {
855
855
  E.closestPointToPoint(s, Fe);
856
856
  const h = s.distanceToSquared(Fe);
857
- return h < r && (zs.copy(Fe), r = h, a = d), h < o;
857
+ return h < r && (Hs.copy(Fe), r = h, a = d), h < o;
858
858
  }
859
859
  }
860
860
  ), r === 1 / 0)
861
861
  return null;
862
862
  const c = Math.sqrt(r);
863
- return t.point ? t.point.copy(zs) : t.point = zs.clone(), t.distance = c, t.faceIndex = a, t;
863
+ return t.point ? t.point.copy(Hs) : t.point = Hs.clone(), t.distance = c, t.faceIndex = a, t;
864
864
  }
865
- const ee = /* @__PURE__ */ new w(), se = /* @__PURE__ */ new w(), ie = /* @__PURE__ */ new w(), Je = /* @__PURE__ */ new pe(), ts = /* @__PURE__ */ new pe(), es = /* @__PURE__ */ new pe(), Vi = /* @__PURE__ */ new w(), Gi = /* @__PURE__ */ new w(), zi = /* @__PURE__ */ new w(), ss = /* @__PURE__ */ new w();
866
- function _o(l, s, t, e, i, o) {
865
+ const ee = /* @__PURE__ */ new w(), se = /* @__PURE__ */ new w(), ie = /* @__PURE__ */ new w(), Je = /* @__PURE__ */ new pe(), ts = /* @__PURE__ */ new pe(), es = /* @__PURE__ */ new pe(), Gi = /* @__PURE__ */ new w(), zi = /* @__PURE__ */ new w(), Hi = /* @__PURE__ */ new w(), ss = /* @__PURE__ */ new w();
866
+ function Po(l, s, t, e, i, o) {
867
867
  let n;
868
- return o === Xn ? n = l.intersectTriangle(e, t, s, !0, i) : n = l.intersectTriangle(s, t, e, o !== Pn, i), n === null ? null : {
868
+ return o === Qn ? n = l.intersectTriangle(e, t, s, !0, i) : n = l.intersectTriangle(s, t, e, o !== yn, i), n === null ? null : {
869
869
  distance: l.origin.distanceTo(i),
870
870
  point: i.clone()
871
871
  };
872
872
  }
873
- function No(l, s, t, e, i, o, n, r, a) {
873
+ function Lo(l, s, t, e, i, o, n, r, a) {
874
874
  ee.fromBufferAttribute(s, o), se.fromBufferAttribute(s, n), ie.fromBufferAttribute(s, r);
875
- const c = _o(l, ee, se, ie, ss, a);
875
+ const c = Po(l, ee, se, ie, ss, a);
876
876
  if (c) {
877
- e && (Je.fromBufferAttribute(e, o), ts.fromBufferAttribute(e, n), es.fromBufferAttribute(e, r), c.uv = Ie.getInterpolation(ss, ee, se, ie, Je, ts, es, new pe())), i && (Je.fromBufferAttribute(i, o), ts.fromBufferAttribute(i, n), es.fromBufferAttribute(i, r), c.uv1 = Ie.getInterpolation(ss, ee, se, ie, Je, ts, es, new pe())), t && (Vi.fromBufferAttribute(t, o), Gi.fromBufferAttribute(t, n), zi.fromBufferAttribute(t, r), c.normal = Ie.getInterpolation(ss, ee, se, ie, Vi, Gi, zi, new w()), c.normal.dot(l.direction) > 0 && c.normal.multiplyScalar(-1));
877
+ e && (Je.fromBufferAttribute(e, o), ts.fromBufferAttribute(e, n), es.fromBufferAttribute(e, r), c.uv = Ie.getInterpolation(ss, ee, se, ie, Je, ts, es, new pe())), i && (Je.fromBufferAttribute(i, o), ts.fromBufferAttribute(i, n), es.fromBufferAttribute(i, r), c.uv1 = Ie.getInterpolation(ss, ee, se, ie, Je, ts, es, new pe())), t && (Gi.fromBufferAttribute(t, o), zi.fromBufferAttribute(t, n), Hi.fromBufferAttribute(t, r), c.normal = Ie.getInterpolation(ss, ee, se, ie, Gi, zi, Hi, new w()), c.normal.dot(l.direction) > 0 && c.normal.multiplyScalar(-1));
878
878
  const E = {
879
879
  a: o,
880
880
  b: n,
@@ -886,12 +886,12 @@ function No(l, s, t, e, i, o, n, r, a) {
886
886
  }
887
887
  return c;
888
888
  }
889
- function Us(l, s, t, e, i) {
889
+ function xs(l, s, t, e, i) {
890
890
  const o = e * 3;
891
891
  let n = o + 0, r = o + 1, a = o + 2;
892
892
  const c = l.index;
893
893
  l.index && (n = c.getX(n), r = c.getX(r), a = c.getX(a));
894
- const { position: E, normal: d, uv: h, uv1: u } = l.attributes, p = No(t, E, d, h, u, n, r, a, s);
894
+ const { position: E, normal: d, uv: h, uv1: u } = l.attributes, p = Lo(t, E, d, h, u, n, r, a, s);
895
895
  return p ? (p.faceIndex = e, i && i.push(p), p) : null;
896
896
  }
897
897
  function et(l, s, t, e) {
@@ -899,21 +899,21 @@ function et(l, s, t, e) {
899
899
  let r = s, a = s + 1, c = s + 2;
900
900
  t && (r = t.getX(r), a = t.getX(a), c = t.getX(c)), i.x = e.getX(r), i.y = e.getY(r), i.z = e.getZ(r), o.x = e.getX(a), o.y = e.getY(a), o.z = e.getZ(a), n.x = e.getX(c), n.y = e.getY(c), n.z = e.getZ(c);
901
901
  }
902
- function Po(l, s, t, e, i, o) {
902
+ function yo(l, s, t, e, i, o) {
903
903
  const { geometry: n, _indirectBuffer: r } = l;
904
904
  for (let a = e, c = e + i; a < c; a++)
905
- Us(n, s, t, a, o);
905
+ xs(n, s, t, a, o);
906
906
  }
907
- function Lo(l, s, t, e, i) {
907
+ function wo(l, s, t, e, i) {
908
908
  const { geometry: o, _indirectBuffer: n } = l;
909
909
  let r = 1 / 0, a = null;
910
910
  for (let c = e, E = e + i; c < E; c++) {
911
911
  let d;
912
- d = Us(o, s, t, c), d && d.distance < r && (a = d, r = d.distance);
912
+ d = xs(o, s, t, c), d && d.distance < r && (a = d, r = d.distance);
913
913
  }
914
914
  return a;
915
915
  }
916
- function yo(l, s, t, e, i, o, n) {
916
+ function Mo(l, s, t, e, i, o, n) {
917
917
  const { geometry: r } = t, { index: a } = r, c = r.attributes.position;
918
918
  for (let E = l, d = s + l; E < d; E++) {
919
919
  let h;
@@ -922,7 +922,7 @@ function yo(l, s, t, e, i, o, n) {
922
922
  }
923
923
  return !1;
924
924
  }
925
- function wo(l, s = null) {
925
+ function Do(l, s = null) {
926
926
  s && Array.isArray(s) && (s = new Set(s));
927
927
  const t = l.geometry, e = t.index ? t.index.array : null, i = t.attributes.position;
928
928
  let o, n, r, a, c = 0;
@@ -931,7 +931,7 @@ function wo(l, s = null) {
931
931
  o = E[h], n = new Uint32Array(o), r = new Uint16Array(o), a = new Float32Array(o), d(0, c), c += o.byteLength;
932
932
  function d(h, u, p = !1) {
933
933
  const A = h * 2;
934
- if (r[A + 15] === Ds) {
934
+ if (r[A + 15] === Us) {
935
935
  const C = n[h + 6], T = r[A + 14];
936
936
  let F = 1 / 0, f = 1 / 0, m = 1 / 0, O = -1 / 0, S = -1 / 0, _ = -1 / 0;
937
937
  for (let N = 3 * C, L = 3 * (C + T); N < L; N++) {
@@ -959,27 +959,27 @@ function wo(l, s = null) {
959
959
  }
960
960
  }
961
961
  }
962
- const Hi = /* @__PURE__ */ new Ot();
962
+ const ki = /* @__PURE__ */ new Ot();
963
963
  function zt(l, s, t, e) {
964
- return $(l, s, Hi), t.intersectBox(Hi, e);
964
+ return $(l, s, ki), t.intersectBox(ki, e);
965
965
  }
966
- function Mo(l, s, t, e, i, o) {
966
+ function Uo(l, s, t, e, i, o) {
967
967
  const { geometry: n, _indirectBuffer: r } = l;
968
968
  for (let a = e, c = e + i; a < c; a++) {
969
969
  let E = r ? r[a] : a;
970
- Us(n, s, t, E, o);
970
+ xs(n, s, t, E, o);
971
971
  }
972
972
  }
973
- function Do(l, s, t, e, i) {
973
+ function xo(l, s, t, e, i) {
974
974
  const { geometry: o, _indirectBuffer: n } = l;
975
975
  let r = 1 / 0, a = null;
976
976
  for (let c = e, E = e + i; c < E; c++) {
977
977
  let d;
978
- d = Us(o, s, t, n ? n[c] : c), d && d.distance < r && (a = d, r = d.distance);
978
+ d = xs(o, s, t, n ? n[c] : c), d && d.distance < r && (a = d, r = d.distance);
979
979
  }
980
980
  return a;
981
981
  }
982
- function Uo(l, s, t, e, i, o, n) {
982
+ function bo(l, s, t, e, i, o, n) {
983
983
  const { geometry: r } = t, { index: a } = r, c = r.attributes.position;
984
984
  for (let E = l, d = s + l; E < d; E++) {
985
985
  let h;
@@ -988,39 +988,39 @@ function Uo(l, s, t, e, i, o, n) {
988
988
  }
989
989
  return !1;
990
990
  }
991
- const ki = /* @__PURE__ */ new w();
992
- function xo(l, s, t, e, i) {
993
- Z.setBuffer(l._roots[s]), ai(0, l, t, e, i), Z.clearBuffer();
991
+ const Wi = /* @__PURE__ */ new w();
992
+ function vo(l, s, t, e, i) {
993
+ Z.setBuffer(l._roots[s]), ci(0, l, t, e, i), Z.clearBuffer();
994
994
  }
995
- function ai(l, s, t, e, i) {
995
+ function ci(l, s, t, e, i) {
996
996
  const { float32Array: o, uint16Array: n, uint32Array: r } = Z, a = l * 2;
997
997
  if (ht(a, n)) {
998
998
  const E = Et(l, r), d = ft(a, n);
999
- Po(s, t, e, E, d, i);
999
+ yo(s, t, e, E, d, i);
1000
1000
  } else {
1001
1001
  const E = pt(l);
1002
- zt(E, o, e, ki) && ai(E, s, t, e, i);
1002
+ zt(E, o, e, Wi) && ci(E, s, t, e, i);
1003
1003
  const d = Ct(l, r);
1004
- zt(d, o, e, ki) && ai(d, s, t, e, i);
1004
+ zt(d, o, e, Wi) && ci(d, s, t, e, i);
1005
1005
  }
1006
1006
  }
1007
- const Wi = /* @__PURE__ */ new w(), bo = ["x", "y", "z"];
1008
- function vo(l, s, t, e) {
1007
+ const Xi = /* @__PURE__ */ new w(), Bo = ["x", "y", "z"];
1008
+ function Yo(l, s, t, e) {
1009
1009
  Z.setBuffer(l._roots[s]);
1010
- const i = ci(0, l, t, e);
1010
+ const i = li(0, l, t, e);
1011
1011
  return Z.clearBuffer(), i;
1012
1012
  }
1013
- function ci(l, s, t, e) {
1013
+ function li(l, s, t, e) {
1014
1014
  const { float32Array: i, uint16Array: o, uint32Array: n } = Z;
1015
1015
  let r = l * 2;
1016
1016
  if (ht(r, o)) {
1017
1017
  const c = Et(l, n), E = ft(r, o);
1018
- return Lo(s, t, e, c, E);
1018
+ return wo(s, t, e, c, E);
1019
1019
  } else {
1020
- const c = Dn(l, n), E = bo[c], h = e.direction[E] >= 0;
1020
+ const c = xn(l, n), E = Bo[c], h = e.direction[E] >= 0;
1021
1021
  let u, p;
1022
1022
  h ? (u = pt(l), p = Ct(l, n)) : (u = Ct(l, n), p = pt(l));
1023
- const R = zt(u, i, e, Wi) ? ci(u, s, t, e) : null;
1023
+ const R = zt(u, i, e, Xi) ? li(u, s, t, e) : null;
1024
1024
  if (R) {
1025
1025
  const F = R.point[E];
1026
1026
  if (h ? F <= i[p + c] : (
@@ -1029,20 +1029,20 @@ function ci(l, s, t, e) {
1029
1029
  ))
1030
1030
  return R;
1031
1031
  }
1032
- const T = zt(p, i, e, Wi) ? ci(p, s, t, e) : null;
1032
+ const T = zt(p, i, e, Xi) ? li(p, s, t, e) : null;
1033
1033
  return R && T ? R.distance <= T.distance ? R : T : R || T || null;
1034
1034
  }
1035
1035
  }
1036
- const is = /* @__PURE__ */ new Ot(), ne = /* @__PURE__ */ new Ft(), oe = /* @__PURE__ */ new Ft(), Oe = /* @__PURE__ */ new yt(), Xi = /* @__PURE__ */ new at(), ns = /* @__PURE__ */ new at();
1037
- function Bo(l, s, t, e) {
1036
+ const is = /* @__PURE__ */ new Ot(), ne = /* @__PURE__ */ new Ft(), oe = /* @__PURE__ */ new Ft(), Oe = /* @__PURE__ */ new yt(), Zi = /* @__PURE__ */ new at(), ns = /* @__PURE__ */ new at();
1037
+ function Vo(l, s, t, e) {
1038
1038
  Z.setBuffer(l._roots[s]);
1039
- const i = li(0, l, t, e);
1039
+ const i = hi(0, l, t, e);
1040
1040
  return Z.clearBuffer(), i;
1041
1041
  }
1042
- function li(l, s, t, e, i = null) {
1042
+ function hi(l, s, t, e, i = null) {
1043
1043
  const { float32Array: o, uint16Array: n, uint32Array: r } = Z;
1044
1044
  let a = l * 2;
1045
- if (i === null && (t.boundingBox || t.computeBoundingBox(), Xi.set(t.boundingBox.min, t.boundingBox.max, e), i = Xi), ht(a, n)) {
1045
+ if (i === null && (t.boundingBox || t.computeBoundingBox(), Zi.set(t.boundingBox.min, t.boundingBox.max, e), i = Zi), ht(a, n)) {
1046
1046
  const E = s.geometry, d = E.index, h = E.attributes.position, u = t.index, p = t.attributes.position, A = Et(l, r), R = ft(a, n);
1047
1047
  if (Oe.copy(e).invert(), t.boundsTree)
1048
1048
  return $(l, o, ns), ns.matrix.copy(Oe), ns.needsUpdate = !0, t.boundsTree.shapecast({
@@ -1063,19 +1063,19 @@ function li(l, s, t, e, i = null) {
1063
1063
  }
1064
1064
  } else {
1065
1065
  const E = l + 8, d = r[l + 6];
1066
- return $(E, o, is), !!(i.intersectsBox(is) && li(E, s, t, e, i) || ($(d, o, is), i.intersectsBox(is) && li(d, s, t, e, i)));
1066
+ return $(E, o, is), !!(i.intersectsBox(is) && hi(E, s, t, e, i) || ($(d, o, is), i.intersectsBox(is) && hi(d, s, t, e, i)));
1067
1067
  }
1068
1068
  }
1069
- const os = /* @__PURE__ */ new yt(), Hs = /* @__PURE__ */ new at(), ge = /* @__PURE__ */ new at(), Yo = /* @__PURE__ */ new w(), Vo = /* @__PURE__ */ new w(), Go = /* @__PURE__ */ new w(), zo = /* @__PURE__ */ new w();
1070
- function Ho(l, s, t, e = {}, i = {}, o = 0, n = 1 / 0) {
1071
- s.boundingBox || s.computeBoundingBox(), Hs.set(s.boundingBox.min, s.boundingBox.max, t), Hs.needsUpdate = !0;
1069
+ const os = /* @__PURE__ */ new yt(), ks = /* @__PURE__ */ new at(), ge = /* @__PURE__ */ new at(), Go = /* @__PURE__ */ new w(), zo = /* @__PURE__ */ new w(), Ho = /* @__PURE__ */ new w(), ko = /* @__PURE__ */ new w();
1070
+ function Wo(l, s, t, e = {}, i = {}, o = 0, n = 1 / 0) {
1071
+ s.boundingBox || s.computeBoundingBox(), ks.set(s.boundingBox.min, s.boundingBox.max, t), ks.needsUpdate = !0;
1072
1072
  const r = l.geometry, a = r.attributes.position, c = r.index, E = s.attributes.position, d = s.index, h = It.getPrimitive(), u = It.getPrimitive();
1073
- let p = Yo, A = Vo, R = null, C = null;
1074
- i && (R = Go, C = zo);
1073
+ let p = Go, A = zo, R = null, C = null;
1074
+ i && (R = Ho, C = ko);
1075
1075
  let T = 1 / 0, F = null, f = null;
1076
1076
  return os.copy(t).invert(), ge.matrix.copy(os), l.shapecast(
1077
1077
  {
1078
- boundsTraverseOrder: (m) => Hs.distanceToBox(m),
1078
+ boundsTraverseOrder: (m) => ks.distanceToBox(m),
1079
1079
  intersectsBounds: (m, O, S) => S < T && S < n ? (O && (ge.min.copy(m.min), ge.max.copy(m.max), ge.needsUpdate = !0), !0) : !1,
1080
1080
  intersectsRange: (m, O) => {
1081
1081
  if (s.boundsTree)
@@ -1110,7 +1110,7 @@ function Ho(l, s, t, e = {}, i = {}, o = 0, n = 1 / 0) {
1110
1110
  }
1111
1111
  ), It.releasePrimitive(h), It.releasePrimitive(u), T === 1 / 0 ? null : (e.point ? e.point.copy(A) : e.point = A.clone(), e.distance = T, e.faceIndex = F, i && (i.point ? i.point.copy(C) : i.point = C.clone(), i.point.applyMatrix4(os), A.applyMatrix4(os), i.distance = A.sub(i.point).length(), i.faceIndex = f), e);
1112
1112
  }
1113
- function ko(l, s = null) {
1113
+ function Xo(l, s = null) {
1114
1114
  s && Array.isArray(s) && (s = new Set(s));
1115
1115
  const t = l.geometry, e = t.index ? t.index.array : null, i = t.attributes.position;
1116
1116
  let o, n, r, a, c = 0;
@@ -1119,7 +1119,7 @@ function ko(l, s = null) {
1119
1119
  o = E[h], n = new Uint32Array(o), r = new Uint16Array(o), a = new Float32Array(o), d(0, c), c += o.byteLength;
1120
1120
  function d(h, u, p = !1) {
1121
1121
  const A = h * 2;
1122
- if (r[A + 15] === Ds) {
1122
+ if (r[A + 15] === Us) {
1123
1123
  const C = n[h + 6], T = r[A + 14];
1124
1124
  let F = 1 / 0, f = 1 / 0, m = 1 / 0, O = -1 / 0, S = -1 / 0, _ = -1 / 0;
1125
1125
  for (let N = C, L = C + T; N < L; N++) {
@@ -1151,39 +1151,39 @@ function ko(l, s = null) {
1151
1151
  }
1152
1152
  }
1153
1153
  }
1154
- const Zi = /* @__PURE__ */ new w();
1155
- function Wo(l, s, t, e, i) {
1156
- Z.setBuffer(l._roots[s]), hi(0, l, t, e, i), Z.clearBuffer();
1154
+ const Qi = /* @__PURE__ */ new w();
1155
+ function Zo(l, s, t, e, i) {
1156
+ Z.setBuffer(l._roots[s]), Ei(0, l, t, e, i), Z.clearBuffer();
1157
1157
  }
1158
- function hi(l, s, t, e, i) {
1158
+ function Ei(l, s, t, e, i) {
1159
1159
  const { float32Array: o, uint16Array: n, uint32Array: r } = Z, a = l * 2;
1160
1160
  if (ht(a, n)) {
1161
1161
  const E = Et(l, r), d = ft(a, n);
1162
- Mo(s, t, e, E, d, i);
1162
+ Uo(s, t, e, E, d, i);
1163
1163
  } else {
1164
1164
  const E = pt(l);
1165
- zt(E, o, e, Zi) && hi(E, s, t, e, i);
1165
+ zt(E, o, e, Qi) && Ei(E, s, t, e, i);
1166
1166
  const d = Ct(l, r);
1167
- zt(d, o, e, Zi) && hi(d, s, t, e, i);
1167
+ zt(d, o, e, Qi) && Ei(d, s, t, e, i);
1168
1168
  }
1169
1169
  }
1170
- const Qi = /* @__PURE__ */ new w(), Xo = ["x", "y", "z"];
1171
- function Zo(l, s, t, e) {
1170
+ const ji = /* @__PURE__ */ new w(), Qo = ["x", "y", "z"];
1171
+ function jo(l, s, t, e) {
1172
1172
  Z.setBuffer(l._roots[s]);
1173
- const i = Ei(0, l, t, e);
1173
+ const i = di(0, l, t, e);
1174
1174
  return Z.clearBuffer(), i;
1175
1175
  }
1176
- function Ei(l, s, t, e) {
1176
+ function di(l, s, t, e) {
1177
1177
  const { float32Array: i, uint16Array: o, uint32Array: n } = Z;
1178
1178
  let r = l * 2;
1179
1179
  if (ht(r, o)) {
1180
1180
  const c = Et(l, n), E = ft(r, o);
1181
- return Do(s, t, e, c, E);
1181
+ return xo(s, t, e, c, E);
1182
1182
  } else {
1183
- const c = Dn(l, n), E = Xo[c], h = e.direction[E] >= 0;
1183
+ const c = xn(l, n), E = Qo[c], h = e.direction[E] >= 0;
1184
1184
  let u, p;
1185
1185
  h ? (u = pt(l), p = Ct(l, n)) : (u = Ct(l, n), p = pt(l));
1186
- const R = zt(u, i, e, Qi) ? Ei(u, s, t, e) : null;
1186
+ const R = zt(u, i, e, ji) ? di(u, s, t, e) : null;
1187
1187
  if (R) {
1188
1188
  const F = R.point[E];
1189
1189
  if (h ? F <= i[p + c] : (
@@ -1192,20 +1192,20 @@ function Ei(l, s, t, e) {
1192
1192
  ))
1193
1193
  return R;
1194
1194
  }
1195
- const T = zt(p, i, e, Qi) ? Ei(p, s, t, e) : null;
1195
+ const T = zt(p, i, e, ji) ? di(p, s, t, e) : null;
1196
1196
  return R && T ? R.distance <= T.distance ? R : T : R || T || null;
1197
1197
  }
1198
1198
  }
1199
- const rs = /* @__PURE__ */ new Ot(), re = /* @__PURE__ */ new Ft(), ae = /* @__PURE__ */ new Ft(), Se = /* @__PURE__ */ new yt(), ji = /* @__PURE__ */ new at(), as = /* @__PURE__ */ new at();
1200
- function Qo(l, s, t, e) {
1199
+ const rs = /* @__PURE__ */ new Ot(), re = /* @__PURE__ */ new Ft(), ae = /* @__PURE__ */ new Ft(), Se = /* @__PURE__ */ new yt(), qi = /* @__PURE__ */ new at(), as = /* @__PURE__ */ new at();
1200
+ function qo(l, s, t, e) {
1201
1201
  Z.setBuffer(l._roots[s]);
1202
- const i = di(0, l, t, e);
1202
+ const i = ui(0, l, t, e);
1203
1203
  return Z.clearBuffer(), i;
1204
1204
  }
1205
- function di(l, s, t, e, i = null) {
1205
+ function ui(l, s, t, e, i = null) {
1206
1206
  const { float32Array: o, uint16Array: n, uint32Array: r } = Z;
1207
1207
  let a = l * 2;
1208
- if (i === null && (t.boundingBox || t.computeBoundingBox(), ji.set(t.boundingBox.min, t.boundingBox.max, e), i = ji), ht(a, n)) {
1208
+ if (i === null && (t.boundingBox || t.computeBoundingBox(), qi.set(t.boundingBox.min, t.boundingBox.max, e), i = qi), ht(a, n)) {
1209
1209
  const E = s.geometry, d = E.index, h = E.attributes.position, u = t.index, p = t.attributes.position, A = Et(l, r), R = ft(a, n);
1210
1210
  if (Se.copy(e).invert(), t.boundsTree)
1211
1211
  return $(l, o, as), as.matrix.copy(Se), as.needsUpdate = !0, t.boundsTree.shapecast({
@@ -1227,19 +1227,19 @@ function di(l, s, t, e, i = null) {
1227
1227
  }
1228
1228
  } else {
1229
1229
  const E = l + 8, d = r[l + 6];
1230
- return $(E, o, rs), !!(i.intersectsBox(rs) && di(E, s, t, e, i) || ($(d, o, rs), i.intersectsBox(rs) && di(d, s, t, e, i)));
1230
+ return $(E, o, rs), !!(i.intersectsBox(rs) && ui(E, s, t, e, i) || ($(d, o, rs), i.intersectsBox(rs) && ui(d, s, t, e, i)));
1231
1231
  }
1232
1232
  }
1233
- const cs = /* @__PURE__ */ new yt(), ks = /* @__PURE__ */ new at(), _e = /* @__PURE__ */ new at(), jo = /* @__PURE__ */ new w(), qo = /* @__PURE__ */ new w(), $o = /* @__PURE__ */ new w(), Ko = /* @__PURE__ */ new w();
1234
- function Jo(l, s, t, e = {}, i = {}, o = 0, n = 1 / 0) {
1235
- s.boundingBox || s.computeBoundingBox(), ks.set(s.boundingBox.min, s.boundingBox.max, t), ks.needsUpdate = !0;
1233
+ const cs = /* @__PURE__ */ new yt(), Ws = /* @__PURE__ */ new at(), _e = /* @__PURE__ */ new at(), $o = /* @__PURE__ */ new w(), Ko = /* @__PURE__ */ new w(), Jo = /* @__PURE__ */ new w(), tr = /* @__PURE__ */ new w();
1234
+ function er(l, s, t, e = {}, i = {}, o = 0, n = 1 / 0) {
1235
+ s.boundingBox || s.computeBoundingBox(), Ws.set(s.boundingBox.min, s.boundingBox.max, t), Ws.needsUpdate = !0;
1236
1236
  const r = l.geometry, a = r.attributes.position, c = r.index, E = s.attributes.position, d = s.index, h = It.getPrimitive(), u = It.getPrimitive();
1237
- let p = jo, A = qo, R = null, C = null;
1238
- i && (R = $o, C = Ko);
1237
+ let p = $o, A = Ko, R = null, C = null;
1238
+ i && (R = Jo, C = tr);
1239
1239
  let T = 1 / 0, F = null, f = null;
1240
1240
  return cs.copy(t).invert(), _e.matrix.copy(cs), l.shapecast(
1241
1241
  {
1242
- boundsTraverseOrder: (m) => ks.distanceToBox(m),
1242
+ boundsTraverseOrder: (m) => Ws.distanceToBox(m),
1243
1243
  intersectsBounds: (m, O, S) => S < T && S < n ? (O && (_e.min.copy(m.min), _e.max.copy(m.max), _e.needsUpdate = !0), !0) : !1,
1244
1244
  intersectsRange: (m, O) => {
1245
1245
  if (s.boundsTree) {
@@ -1278,15 +1278,15 @@ function Jo(l, s, t, e = {}, i = {}, o = 0, n = 1 / 0) {
1278
1278
  }
1279
1279
  ), It.releasePrimitive(h), It.releasePrimitive(u), T === 1 / 0 ? null : (e.point ? e.point.copy(A) : e.point = A.clone(), e.distance = T, e.faceIndex = F, i && (i.point ? i.point.copy(C) : i.point = C.clone(), i.point.applyMatrix4(cs), A.applyMatrix4(cs), i.distance = A.sub(i.point).length(), i.faceIndex = f), e);
1280
1280
  }
1281
- function tr() {
1281
+ function sr() {
1282
1282
  return typeof SharedArrayBuffer < "u";
1283
1283
  }
1284
- const be = new Z.constructor(), As = new Z.constructor(), vt = new Oi(() => new Ot()), ce = new Ot(), le = new Ot(), Ws = new Ot(), Xs = new Ot();
1285
- let Zs = !1;
1286
- function er(l, s, t, e) {
1287
- if (Zs)
1284
+ const be = new Z.constructor(), As = new Z.constructor(), vt = new gi(() => new Ot()), ce = new Ot(), le = new Ot(), Xs = new Ot(), Zs = new Ot();
1285
+ let Qs = !1;
1286
+ function ir(l, s, t, e) {
1287
+ if (Qs)
1288
1288
  throw new Error("MeshBVH: Recursive calls to bvhcast not supported.");
1289
- Zs = !0;
1289
+ Qs = !0;
1290
1290
  const i = l._roots, o = s._roots;
1291
1291
  let n, r = 0, a = 0;
1292
1292
  const c = new yt().copy(t).invert();
@@ -1310,7 +1310,7 @@ function er(l, s, t, e) {
1310
1310
  if (vt.releasePrimitive(h), be.clearBuffer(), r += i[E].length, n)
1311
1311
  break;
1312
1312
  }
1313
- return Zs = !1, n;
1313
+ return Qs = !1, n;
1314
1314
  }
1315
1315
  function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, E = !1) {
1316
1316
  let d, h;
@@ -1370,8 +1370,8 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, E = !1) {
1370
1370
  ), vt.releasePrimitive(_);
1371
1371
  } else {
1372
1372
  const _ = pt(s), N = Ct(s, C);
1373
- $(_, R, Ws), $(N, R, Xs);
1374
- const L = c.intersectsBox(Ws), M = c.intersectsBox(Xs);
1373
+ $(_, R, Xs), $(N, R, Zs);
1374
+ const L = c.intersectsBox(Xs), M = c.intersectsBox(Zs);
1375
1375
  if (L && M)
1376
1376
  S = Tt(
1377
1377
  l,
@@ -1415,7 +1415,7 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, E = !1) {
1415
1415
  );
1416
1416
  else {
1417
1417
  const y = vt.getPrimitive();
1418
- y.copy(Ws).applyMatrix4(t);
1418
+ y.copy(Xs).applyMatrix4(t);
1419
1419
  const x = pt(l), b = Ct(l, p);
1420
1420
  $(x, u, ce), $(b, u, le);
1421
1421
  const B = y.intersectsBox(ce), H = y.intersectsBox(le);
@@ -1462,7 +1462,7 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, E = !1) {
1462
1462
  );
1463
1463
  else {
1464
1464
  const y = vt.getPrimitive();
1465
- y.copy(Xs).applyMatrix4(t);
1465
+ y.copy(Zs).applyMatrix4(t);
1466
1466
  const x = pt(l), b = Ct(l, p);
1467
1467
  $(x, u, ce), $(b, u, le);
1468
1468
  const B = y.intersectsBox(ce), H = y.intersectsBox(le);
@@ -1495,8 +1495,8 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, E = !1) {
1495
1495
  }
1496
1496
  return S;
1497
1497
  }
1498
- const ls = /* @__PURE__ */ new at(), qi = /* @__PURE__ */ new Ot();
1499
- class gi {
1498
+ const ls = /* @__PURE__ */ new at(), $i = /* @__PURE__ */ new Ot();
1499
+ class Si {
1500
1500
  static serialize(s, t = {}) {
1501
1501
  t = {
1502
1502
  cloneBuffers: !0,
@@ -1520,11 +1520,11 @@ class gi {
1520
1520
  indirect: !!s.indirectBuffer,
1521
1521
  ...e
1522
1522
  };
1523
- const { index: i, roots: o, indirectBuffer: n } = s, r = new gi(t, { ...e, [Ys]: !0 });
1523
+ const { index: i, roots: o, indirectBuffer: n } = s, r = new Si(t, { ...e, [Vs]: !0 });
1524
1524
  if (r._roots = o, r._indirectBuffer = n || null, e.setIndex) {
1525
1525
  const a = t.getIndex();
1526
1526
  if (a === null) {
1527
- const c = new Nn(s.index, 1, !1);
1527
+ const c = new Ln(s.index, 1, !1);
1528
1528
  t.setIndex(c);
1529
1529
  } else
1530
1530
  a.array !== i && (a.array.set(i), a.needsUpdate = !0);
@@ -1541,7 +1541,7 @@ class gi {
1541
1541
  } else
1542
1542
  throw new Error("MeshBVH: Only BufferGeometries are supported.");
1543
1543
  if (t = Object.assign({
1544
- strategy: yn,
1544
+ strategy: Mn,
1545
1545
  maxDepth: 40,
1546
1546
  maxLeafTris: 10,
1547
1547
  verbose: !0,
@@ -1551,21 +1551,21 @@ class gi {
1551
1551
  indirect: !1,
1552
1552
  // undocumented options
1553
1553
  // Whether to skip generating the tree. Used for deserialization.
1554
- [Ys]: !1
1555
- }, t), t.useSharedArrayBuffer && !tr())
1554
+ [Vs]: !1
1555
+ }, t), t.useSharedArrayBuffer && !sr())
1556
1556
  throw new Error("MeshBVH: SharedArrayBuffer is not available.");
1557
- this.geometry = s, this._roots = null, this._indirectBuffer = null, t[Ys] || (To(this, t), !s.boundingBox && t.setBoundingBox && (s.boundingBox = this.getBoundingBox(new Ot())));
1557
+ this.geometry = s, this._roots = null, this._indirectBuffer = null, t[Vs] || (Ro(this, t), !s.boundingBox && t.setBoundingBox && (s.boundingBox = this.getBoundingBox(new Ot())));
1558
1558
  const { _indirectBuffer: e } = this;
1559
1559
  this.resolveTriangleIndex = t.indirect ? (i) => e[i] : (i) => i;
1560
1560
  }
1561
1561
  refit(s = null) {
1562
- return (this.indirect ? ko : wo)(this, s);
1562
+ return (this.indirect ? Xo : Do)(this, s);
1563
1563
  }
1564
1564
  traverse(s, t = 0) {
1565
1565
  const e = this._roots[t], i = new Uint32Array(e), o = new Uint16Array(e);
1566
1566
  n(0);
1567
1567
  function n(r, a = 0) {
1568
- const c = r * 2, E = o[c + 15] === Ds;
1568
+ const c = r * 2, E = o[c + 15] === Us;
1569
1569
  if (E) {
1570
1570
  const d = i[r + 6], h = o[c + 14];
1571
1571
  s(a, E, new Float32Array(e, r * 4, 6), d, h);
@@ -1576,8 +1576,8 @@ class gi {
1576
1576
  }
1577
1577
  }
1578
1578
  /* Core Cast Functions */
1579
- raycast(s, t = Mi) {
1580
- const e = this._roots, i = this.geometry, o = [], n = t.isMaterial, r = Array.isArray(t), a = i.groups, c = n ? t.side : t, E = this.indirect ? Wo : xo;
1579
+ raycast(s, t = Di) {
1580
+ const e = this._roots, i = this.geometry, o = [], n = t.isMaterial, r = Array.isArray(t), a = i.groups, c = n ? t.side : t, E = this.indirect ? Zo : vo;
1581
1581
  for (let d = 0, h = e.length; d < h; d++) {
1582
1582
  const u = r ? t[a[d].materialIndex].side : c, p = o.length;
1583
1583
  if (E(this, d, u, s, o), r) {
@@ -1588,10 +1588,10 @@ class gi {
1588
1588
  }
1589
1589
  return o;
1590
1590
  }
1591
- raycastFirst(s, t = Mi) {
1591
+ raycastFirst(s, t = Di) {
1592
1592
  const e = this._roots, i = this.geometry, o = t.isMaterial, n = Array.isArray(t);
1593
1593
  let r = null;
1594
- const a = i.groups, c = o ? t.side : t, E = this.indirect ? Zo : vo;
1594
+ const a = i.groups, c = o ? t.side : t, E = this.indirect ? jo : Yo;
1595
1595
  for (let d = 0, h = e.length; d < h; d++) {
1596
1596
  const u = n ? t[a[d].materialIndex].side : c, p = E(this, d, u, s);
1597
1597
  p != null && (r == null || p.distance < r.distance) && (r = p, n && (p.face.materialIndex = a[d].materialIndex));
@@ -1600,13 +1600,13 @@ class gi {
1600
1600
  }
1601
1601
  intersectsGeometry(s, t) {
1602
1602
  let e = !1;
1603
- const i = this._roots, o = this.indirect ? Qo : Bo;
1603
+ const i = this._roots, o = this.indirect ? qo : Vo;
1604
1604
  for (let n = 0, r = i.length; n < r && (e = o(this, n, s, t), !e); n++)
1605
1605
  ;
1606
1606
  return e;
1607
1607
  }
1608
1608
  shapecast(s) {
1609
- const t = It.getPrimitive(), e = this.indirect ? Uo : yo;
1609
+ const t = It.getPrimitive(), e = this.indirect ? bo : Mo;
1610
1610
  let {
1611
1611
  boundsTraverseOrder: i,
1612
1612
  intersectsBounds: o,
@@ -1622,7 +1622,7 @@ class gi {
1622
1622
  const E = this._roots;
1623
1623
  for (let d = 0, h = E.length; d < h; d++) {
1624
1624
  const u = E[d];
1625
- if (a = go(this, d, o, n, i, c), a)
1625
+ if (a = _o(this, d, o, n, i, c), a)
1626
1626
  break;
1627
1627
  c += u.byteLength;
1628
1628
  }
@@ -1662,7 +1662,7 @@ class gi {
1662
1662
  } else
1663
1663
  i = p;
1664
1664
  }
1665
- return er(this, s, t, i);
1665
+ return ir(this, s, t, i);
1666
1666
  }
1667
1667
  /* Derived Cast Functions */
1668
1668
  intersectsBox(s, t) {
@@ -1682,7 +1682,7 @@ class gi {
1682
1682
  );
1683
1683
  }
1684
1684
  closestPointToGeometry(s, t, e = {}, i = {}, o = 0, n = 1 / 0) {
1685
- return (this.indirect ? Jo : Ho)(
1685
+ return (this.indirect ? er : Wo)(
1686
1686
  this,
1687
1687
  s,
1688
1688
  t,
@@ -1693,7 +1693,7 @@ class gi {
1693
1693
  );
1694
1694
  }
1695
1695
  closestPointToPoint(s, t = {}, e = 0, i = 1 / 0) {
1696
- return So(
1696
+ return No(
1697
1697
  this,
1698
1698
  s,
1699
1699
  t,
@@ -1703,37 +1703,37 @@ class gi {
1703
1703
  }
1704
1704
  getBoundingBox(s) {
1705
1705
  return s.makeEmpty(), this._roots.forEach((e) => {
1706
- $(0, new Float32Array(e), qi), s.union(qi);
1706
+ $(0, new Float32Array(e), $i), s.union($i);
1707
1707
  }), s;
1708
1708
  }
1709
1709
  }
1710
- function $i(l, s, t) {
1710
+ function Ki(l, s, t) {
1711
1711
  return l === null || (l.point.applyMatrix4(s.matrixWorld), l.distance = l.point.distanceTo(t.ray.origin), l.object = s, l.distance < t.near || l.distance > t.far) ? null : l;
1712
1712
  }
1713
- const Qs = /* @__PURE__ */ new Zn(), Ki = /* @__PURE__ */ new yt(), sr = v.prototype.raycast;
1714
- function ir(l, s) {
1713
+ const js = /* @__PURE__ */ new jn(), Ji = /* @__PURE__ */ new yt(), nr = v.prototype.raycast;
1714
+ function or(l, s) {
1715
1715
  if (this.geometry.boundsTree) {
1716
1716
  if (this.material === void 0)
1717
1717
  return;
1718
- Ki.copy(this.matrixWorld).invert(), Qs.copy(l.ray).applyMatrix4(Ki);
1718
+ Ji.copy(this.matrixWorld).invert(), js.copy(l.ray).applyMatrix4(Ji);
1719
1719
  const t = this.geometry.boundsTree;
1720
1720
  if (l.firstHitOnly === !0) {
1721
- const e = $i(t.raycastFirst(Qs, this.material), this, l);
1721
+ const e = Ki(t.raycastFirst(js, this.material), this, l);
1722
1722
  e && s.push(e);
1723
1723
  } else {
1724
- const e = t.raycast(Qs, this.material);
1724
+ const e = t.raycast(js, this.material);
1725
1725
  for (let i = 0, o = e.length; i < o; i++) {
1726
- const n = $i(e[i], this, l);
1726
+ const n = Ki(e[i], this, l);
1727
1727
  n && s.push(n);
1728
1728
  }
1729
1729
  }
1730
1730
  } else
1731
- sr.call(this, l, s);
1731
+ nr.call(this, l, s);
1732
1732
  }
1733
- function nr(l) {
1734
- return this.boundsTree = new gi(this, l), this.boundsTree;
1733
+ function rr(l) {
1734
+ return this.boundsTree = new Si(this, l), this.boundsTree;
1735
1735
  }
1736
- function or() {
1736
+ function ar() {
1737
1737
  this.boundsTree = null;
1738
1738
  }
1739
1739
  class D {
@@ -1794,7 +1794,7 @@ class Kt {
1794
1794
  this.handlers.length = 0;
1795
1795
  }
1796
1796
  }
1797
- class Si {
1797
+ class _i {
1798
1798
  constructor(s) {
1799
1799
  /** Whether is component is {@link Disposable}. */
1800
1800
  I(this, "isDisposeable", () => "dispose" in this && "onDisposed" in this);
@@ -1809,9 +1809,9 @@ class Si {
1809
1809
  this.components = s;
1810
1810
  }
1811
1811
  }
1812
- class J extends Si {
1812
+ class J extends _i {
1813
1813
  }
1814
- class _i extends Si {
1814
+ class Ni extends _i {
1815
1815
  constructor(t) {
1816
1816
  super(t);
1817
1817
  I(this, "worlds", /* @__PURE__ */ new Map());
@@ -1822,14 +1822,14 @@ class _i extends Si {
1822
1822
  });
1823
1823
  }
1824
1824
  }
1825
- class rr extends _i {
1825
+ class cr extends Ni {
1826
1826
  constructor() {
1827
1827
  super(...arguments);
1828
1828
  /** Whether is instance is {@link CameraControllable}. */
1829
1829
  I(this, "hasCameraControls", () => "controls" in this);
1830
1830
  }
1831
1831
  }
1832
- class ar extends _i {
1832
+ class lr extends Ni {
1833
1833
  constructor() {
1834
1834
  super(...arguments);
1835
1835
  /** {@link Updateable.onBeforeUpdate} */
@@ -1932,7 +1932,7 @@ const ve = class ve extends J {
1932
1932
  };
1933
1933
  I(ve, "uuid", "76e9cd8e-ad8f-4753-9ef6-cbc60f7247fe");
1934
1934
  let Ht = ve;
1935
- class cr extends _i {
1935
+ class hr extends Ni {
1936
1936
  constructor(t) {
1937
1937
  super(t);
1938
1938
  /** {@link Disposable.onDisposed} */
@@ -1948,16 +1948,16 @@ class cr extends _i {
1948
1948
  this.three.children = [], this.onDisposed.trigger(), this.onDisposed.reset();
1949
1949
  }
1950
1950
  }
1951
- const ms = 0, lr = 1, hr = new w(), Ji = new Lt(), js = new Ai(), tn = new w(), hs = new Ie();
1952
- class Er {
1951
+ const ms = 0, Er = 1, dr = new w(), tn = new Lt(), qs = new Fi(), en = new w(), hs = new Ie();
1952
+ class ur {
1953
1953
  constructor() {
1954
- this.tolerance = -1, this.faces = [], this.newFaces = [], this.assigned = new en(), this.unassigned = new en(), this.vertices = [];
1954
+ this.tolerance = -1, this.faces = [], this.newFaces = [], this.assigned = new sn(), this.unassigned = new sn(), this.vertices = [];
1955
1955
  }
1956
1956
  setFromPoints(s) {
1957
1957
  if (s.length >= 4) {
1958
1958
  this.makeEmpty();
1959
1959
  for (let t = 0, e = s.length; t < e; t++)
1960
- this.vertices.push(new dr(s[t]));
1960
+ this.vertices.push(new Ir(s[t]));
1961
1961
  this.compute();
1962
1962
  }
1963
1963
  return this;
@@ -1997,7 +1997,7 @@ class Er {
1997
1997
  return i !== -1 / 0 ? s.at(i, t) : s.at(o, t), t;
1998
1998
  }
1999
1999
  intersectsRay(s) {
2000
- return this.intersectRay(s, hr) !== null;
2000
+ return this.intersectRay(s, dr) !== null;
2001
2001
  }
2002
2002
  makeEmpty() {
2003
2003
  return this.faces = [], this.vertices = [], this;
@@ -2081,25 +2081,25 @@ class Er {
2081
2081
  }
2082
2082
  const r = e[n], a = i[n];
2083
2083
  let c, E;
2084
- o = 0, Ji.set(r.point, a.point);
2084
+ o = 0, tn.set(r.point, a.point);
2085
2085
  for (let h = 0, u = this.vertices.length; h < u; h++) {
2086
2086
  const p = s[h];
2087
2087
  if (p !== r && p !== a) {
2088
- Ji.closestPointToPoint(p.point, !0, tn);
2089
- const A = tn.distanceToSquared(p.point);
2088
+ tn.closestPointToPoint(p.point, !0, en);
2089
+ const A = en.distanceToSquared(p.point);
2090
2090
  A > o && (o = A, c = p);
2091
2091
  }
2092
2092
  }
2093
- o = -1, js.setFromCoplanarPoints(r.point, a.point, c.point);
2093
+ o = -1, qs.setFromCoplanarPoints(r.point, a.point, c.point);
2094
2094
  for (let h = 0, u = this.vertices.length; h < u; h++) {
2095
2095
  const p = s[h];
2096
2096
  if (p !== r && p !== a && p !== c) {
2097
- const A = Math.abs(js.distanceToPoint(p.point));
2097
+ const A = Math.abs(qs.distanceToPoint(p.point));
2098
2098
  A > o && (o = A, E = p);
2099
2099
  }
2100
2100
  }
2101
2101
  const d = [];
2102
- if (js.distanceToPoint(E.point) < 0) {
2102
+ if (qs.distanceToPoint(E.point) < 0) {
2103
2103
  d.push(
2104
2104
  Rt.create(r, a, c),
2105
2105
  Rt.create(E, a, r),
@@ -2164,7 +2164,7 @@ class Er {
2164
2164
  // For an edge to be part of the horizon it must join a face that can see
2165
2165
  // 'eyePoint' and a face that cannot see 'eyePoint'.
2166
2166
  computeHorizon(s, t, e, i) {
2167
- this.deleteFaceVertices(e), e.mark = lr;
2167
+ this.deleteFaceVertices(e), e.mark = Er;
2168
2168
  let o;
2169
2169
  t === null ? o = t = e.getEdge(0) : o = t.next;
2170
2170
  do {
@@ -2209,7 +2209,7 @@ class Rt {
2209
2209
  this.normal = new w(), this.midpoint = new w(), this.area = 0, this.constant = 0, this.outside = null, this.mark = ms, this.edge = null;
2210
2210
  }
2211
2211
  static create(s, t, e) {
2212
- const i = new Rt(), o = new qs(s, i), n = new qs(t, i), r = new qs(e, i);
2212
+ const i = new Rt(), o = new $s(s, i), n = new $s(t, i), r = new $s(e, i);
2213
2213
  return o.next = r.prev = n, n.next = o.prev = r, r.next = n.prev = o, i.edge = o, i.compute();
2214
2214
  }
2215
2215
  getEdge(s) {
@@ -2228,7 +2228,7 @@ class Rt {
2228
2228
  return this.normal.dot(s) - this.constant;
2229
2229
  }
2230
2230
  }
2231
- class qs {
2231
+ class $s {
2232
2232
  constructor(s, t) {
2233
2233
  this.vertex = s, this.prev = null, this.next = null, this.twin = null, this.face = t;
2234
2234
  }
@@ -2250,12 +2250,12 @@ class qs {
2250
2250
  return this.twin = s, s.twin = this, this;
2251
2251
  }
2252
2252
  }
2253
- class dr {
2253
+ class Ir {
2254
2254
  constructor(s) {
2255
2255
  this.point = s, this.prev = null, this.next = null, this.face = null;
2256
2256
  }
2257
2257
  }
2258
- class en {
2258
+ class sn {
2259
2259
  constructor() {
2260
2260
  this.head = null, this.tail = null;
2261
2261
  }
@@ -2298,35 +2298,35 @@ class en {
2298
2298
  return this.head === null;
2299
2299
  }
2300
2300
  }
2301
- const ui = [2, 2, 1], Ii = [1, 0, 0];
2301
+ const Ii = [2, 2, 1], fi = [1, 0, 0];
2302
2302
  function Nt(l, s) {
2303
2303
  return l * 3 + s;
2304
2304
  }
2305
- function ur(l) {
2305
+ function fr(l) {
2306
2306
  const s = l.elements;
2307
2307
  let t = 0;
2308
2308
  for (let e = 0; e < 9; e++)
2309
2309
  t += s[e] * s[e];
2310
2310
  return Math.sqrt(t);
2311
2311
  }
2312
- function Ir(l) {
2312
+ function pr(l) {
2313
2313
  const s = l.elements;
2314
2314
  let t = 0;
2315
2315
  for (let e = 0; e < 3; e++) {
2316
- const i = s[Nt(ui[e], Ii[e])];
2316
+ const i = s[Nt(Ii[e], fi[e])];
2317
2317
  t += 2 * i * i;
2318
2318
  }
2319
2319
  return Math.sqrt(t);
2320
2320
  }
2321
- function fr(l, s) {
2321
+ function Cr(l, s) {
2322
2322
  let t = 0, e = 1;
2323
2323
  const i = l.elements;
2324
2324
  for (let c = 0; c < 3; c++) {
2325
- const E = Math.abs(i[Nt(ui[c], Ii[c])]);
2325
+ const E = Math.abs(i[Nt(Ii[c], fi[c])]);
2326
2326
  E > t && (t = E, e = c);
2327
2327
  }
2328
2328
  let o = 1, n = 0;
2329
- const r = Ii[e], a = ui[e];
2329
+ const r = fi[e], a = Ii[e];
2330
2330
  if (Math.abs(i[Nt(a, r)]) > Number.EPSILON) {
2331
2331
  const c = i[Nt(a, a)], E = i[Nt(r, r)], d = i[Nt(a, r)], h = (c - E) / 2 / d;
2332
2332
  let u;
@@ -2334,22 +2334,22 @@ function fr(l, s) {
2334
2334
  }
2335
2335
  return s.identity(), s.elements[Nt(r, r)] = o, s.elements[Nt(a, a)] = o, s.elements[Nt(a, r)] = n, s.elements[Nt(r, a)] = -n, s;
2336
2336
  }
2337
- function pr(l, s) {
2337
+ function Tr(l, s) {
2338
2338
  let t = 0, e = 0;
2339
2339
  const i = 10;
2340
2340
  s.unitary.identity(), s.diagonal.copy(l);
2341
- const o = s.unitary, n = s.diagonal, r = new g.Matrix3(), a = new g.Matrix3(), c = Number.EPSILON * ur(n);
2342
- for (; e < i && Ir(n) > c; )
2343
- fr(n, r), a.copy(r).transpose(), n.multiply(r), n.premultiply(a), o.multiply(r), ++t > 2 && (e++, t = 0);
2341
+ const o = s.unitary, n = s.diagonal, r = new g.Matrix3(), a = new g.Matrix3(), c = Number.EPSILON * fr(n);
2342
+ for (; e < i && pr(n) > c; )
2343
+ Cr(n, r), a.copy(r).transpose(), n.multiply(r), n.premultiply(a), o.multiply(r), ++t > 2 && (e++, t = 0);
2344
2344
  return s;
2345
2345
  }
2346
- function Cr(l) {
2346
+ function mr(l) {
2347
2347
  const s = [];
2348
2348
  for (let it = 0; it < l.length - 2; it += 3) {
2349
2349
  const Zt = l[it], tt = l[it + 1], Jt = l[it + 2];
2350
2350
  s.push(new g.Vector3(Zt, tt, Jt));
2351
2351
  }
2352
- const t = new Er();
2352
+ const t = new ur();
2353
2353
  t.setFromPoints(s);
2354
2354
  const e = {
2355
2355
  unitary: new g.Matrix3(),
@@ -2362,10 +2362,10 @@ function Cr(l) {
2362
2362
  do
2363
2363
  o.push(Jt), Jt = Jt.next;
2364
2364
  while (Jt !== tt.edge);
2365
- const Gn = o.length - 2;
2366
- for (let Ze = 1, zn = Gn; Ze <= zn; Ze++) {
2367
- const xs = o[0].vertex, bs = o[Ze + 0].vertex, vs = o[Ze + 1].vertex;
2368
- n.push(xs.point.x, xs.point.y, xs.point.z), n.push(bs.point.x, bs.point.y, bs.point.z), n.push(vs.point.x, vs.point.y, vs.point.z);
2365
+ const Hn = o.length - 2;
2366
+ for (let Ze = 1, kn = Hn; Ze <= kn; Ze++) {
2367
+ const bs = o[0].vertex, vs = o[Ze + 0].vertex, Bs = o[Ze + 1].vertex;
2368
+ n.push(bs.point.x, bs.point.y, bs.point.z), n.push(vs.point.x, vs.point.y, vs.point.z), n.push(Bs.point.x, Bs.point.y, Bs.point.z);
2369
2369
  }
2370
2370
  }
2371
2371
  const r = new g.Vector3(), a = new g.Vector3(), c = new g.Vector3(), E = new g.Vector3(), d = new g.Vector3(), h = new g.Vector3(), u = new g.Vector3(), p = new g.Vector3();
@@ -2377,7 +2377,7 @@ function Cr(l) {
2377
2377
  }
2378
2378
  p.divideScalar(A), R /= A, C /= A, T /= A, F /= A, f /= A, m /= A, R -= p.x * p.x, C -= p.x * p.y, T -= p.x * p.z, F -= p.y * p.y, f -= p.y * p.z, m -= p.z * p.z;
2379
2379
  const O = new g.Matrix3();
2380
- O.elements[0] = R, O.elements[1] = C, O.elements[2] = T, O.elements[3] = C, O.elements[4] = F, O.elements[5] = f, O.elements[6] = T, O.elements[7] = f, O.elements[8] = m, pr(O, e);
2380
+ O.elements[0] = R, O.elements[1] = C, O.elements[2] = T, O.elements[3] = C, O.elements[4] = F, O.elements[5] = f, O.elements[6] = T, O.elements[7] = f, O.elements[8] = m, Tr(O, e);
2381
2381
  const S = e.unitary, _ = new g.Vector3(), N = new g.Vector3(), L = new g.Vector3();
2382
2382
  S.extractBasis(_, N, L);
2383
2383
  let M = -1 / 0, y = -1 / 0, x = -1 / 0, b = 1 / 0, B = 1 / 0, H = 1 / 0;
@@ -2392,14 +2392,14 @@ function Cr(l) {
2392
2392
  Xe.makeScale(kt * 2, Wt * 2, Xt * 2);
2393
2393
  const Te = new g.Matrix4();
2394
2394
  Te.makeTranslation(-kt, -Wt, -Xt);
2395
- const yi = new g.Matrix4();
2396
- yi.makeTranslation(q.x, q.y, q.z);
2397
2395
  const wi = new g.Matrix4();
2398
- wi.setFromMatrix3(Q);
2396
+ wi.makeTranslation(q.x, q.y, q.z);
2397
+ const Mi = new g.Matrix4();
2398
+ Mi.setFromMatrix3(Q);
2399
2399
  const me = new g.Matrix4();
2400
- return me.multiply(yi), me.multiply(wi), me.multiply(Te), me.multiply(Xe), { center: q, halfSizes: st, rotation: Q, transformation: me };
2400
+ return me.multiply(wi), me.multiply(Mi), me.multiply(Te), me.multiply(Xe), { center: q, halfSizes: st, rotation: Q, transformation: me };
2401
2401
  }
2402
- function Tr(l, s, t) {
2402
+ function Rr(l, s, t) {
2403
2403
  const e = [
2404
2404
  l[0] - s[0],
2405
2405
  l[1] - s[1],
@@ -2407,7 +2407,7 @@ function Tr(l, s, t) {
2407
2407
  ];
2408
2408
  return t[0] * e[0] + t[1] * e[1] + t[2] * e[2] > 0;
2409
2409
  }
2410
- class sn {
2410
+ class nn {
2411
2411
  static isTransparent(s) {
2412
2412
  return s.transparent && s.opacity < 1;
2413
2413
  }
@@ -2690,7 +2690,7 @@ I(K, "_lut", [
2690
2690
  "ff"
2691
2691
  ]);
2692
2692
  let ze = K;
2693
- class ea extends J {
2693
+ class sa extends J {
2694
2694
  constructor(t, e) {
2695
2695
  super(t);
2696
2696
  I(this, "onVertexFound", new D());
@@ -2839,12 +2839,12 @@ const Fs = class Fs {
2839
2839
  this._clock.stop(), this.onDisposed.trigger(), this.onDisposed.reset();
2840
2840
  }
2841
2841
  static setupBVH() {
2842
- g.BufferGeometry.prototype.computeBoundsTree = nr, g.BufferGeometry.prototype.disposeBoundsTree = or, g.Mesh.prototype.raycast = ir;
2842
+ g.BufferGeometry.prototype.computeBoundsTree = rr, g.BufferGeometry.prototype.disposeBoundsTree = ar, g.Mesh.prototype.raycast = or;
2843
2843
  }
2844
2844
  };
2845
2845
  I(Fs, "release", "1.4.21");
2846
- let fi = Fs;
2847
- class mr {
2846
+ let pi = Fs;
2847
+ class Ar {
2848
2848
  constructor(s) {
2849
2849
  I(this, "_event");
2850
2850
  I(this, "_position", new g.Vector2());
@@ -2879,7 +2879,7 @@ class mr {
2879
2879
  s ? this.dom.addEventListener("mousemove", this.updateMouseInfo) : this.dom.removeEventListener("mousemove", this.updateMouseInfo);
2880
2880
  }
2881
2881
  }
2882
- class Rr {
2882
+ class Fr {
2883
2883
  constructor(s, t) {
2884
2884
  /** {@link Component.enabled} */
2885
2885
  I(this, "enabled", !0);
@@ -2893,7 +2893,7 @@ class Rr {
2893
2893
  const e = t.renderer;
2894
2894
  if (!e)
2895
2895
  throw new Error("A renderer is needed for the raycaster to work!");
2896
- this.world = t, this.mouse = new mr(e.three.domElement), this.components = s;
2896
+ this.world = t, this.mouse = new Ar(e.three.domElement), this.components = s;
2897
2897
  }
2898
2898
  /** {@link Disposable.dispose} */
2899
2899
  dispose() {
@@ -2944,7 +2944,7 @@ const Os = class Os extends J {
2944
2944
  get(t) {
2945
2945
  if (this.list.has(t.uuid))
2946
2946
  return this.list.get(t.uuid);
2947
- const e = new Rr(this.components, t);
2947
+ const e = new Fr(this.components, t);
2948
2948
  return this.list.set(t.uuid, e), t.onDisposed.add(() => {
2949
2949
  this.delete(t);
2950
2950
  }), e;
@@ -2961,7 +2961,7 @@ const Os = class Os extends J {
2961
2961
  };
2962
2962
  I(Os, "uuid", "d5d8bdf0-db25-4952-b951-b643af207ace");
2963
2963
  let He = Os;
2964
- class Ar extends Si {
2964
+ class Or extends _i {
2965
2965
  constructor(t) {
2966
2966
  super(t);
2967
2967
  /**
@@ -3015,7 +3015,7 @@ class Ar extends Si {
3015
3015
  this._scene = null, this._camera = null, this._renderer = null, this.onDisposed.trigger();
3016
3016
  }
3017
3017
  }
3018
- class sa extends cr {
3018
+ class ia extends hr {
3019
3019
  constructor(t) {
3020
3020
  super(t);
3021
3021
  /** {@link Configurable.isSetup} */
@@ -3051,7 +3051,7 @@ class sa extends cr {
3051
3051
  this.three.add(e, i), this.isSetup = !0, this.onSetup.trigger(this);
3052
3052
  }
3053
3053
  }
3054
- class ia extends ar {
3054
+ class na extends lr {
3055
3055
  constructor(t, e, i) {
3056
3056
  super(t);
3057
3057
  I(this, "enabled", !0);
@@ -3161,17 +3161,17 @@ function Qt(l) {
3161
3161
  function bt(l) {
3162
3162
  return l.isOrthographicCamera;
3163
3163
  }
3164
- const Ee = Math.PI * 2, nn = Math.PI / 2, Un = 1e-5, Ne = Math.PI / 180;
3164
+ const Ee = Math.PI * 2, on = Math.PI / 2, bn = 1e-5, Ne = Math.PI / 180;
3165
3165
  function mt(l, s, t) {
3166
3166
  return Math.max(s, Math.min(t, l));
3167
3167
  }
3168
- function X(l, s = Un) {
3168
+ function X(l, s = bn) {
3169
3169
  return Math.abs(l) < s;
3170
3170
  }
3171
- function k(l, s, t = Un) {
3171
+ function k(l, s, t = bn) {
3172
3172
  return X(l - s, t);
3173
3173
  }
3174
- function on(l, s) {
3174
+ function rn(l, s) {
3175
3175
  return Math.round(l / s) * s;
3176
3176
  }
3177
3177
  function Pe(l) {
@@ -3191,7 +3191,7 @@ function Es(l, s, t, e, i = 1 / 0, o) {
3191
3191
  let u = s + (c + h) * a;
3192
3192
  return E - l > 0 == u > E && (u = E, t.value = (u - E) / o), u;
3193
3193
  }
3194
- function rn(l, s, t, e, i = 1 / 0, o, n) {
3194
+ function an(l, s, t, e, i = 1 / 0, o, n) {
3195
3195
  e = Math.max(1e-4, e);
3196
3196
  const r = 2 / e, a = r * o, c = 1 / (1 + a + 0.48 * a * a + 0.235 * a * a * a);
3197
3197
  let E = s.x, d = s.y, h = s.z, u = l.x - E, p = l.y - d, A = l.z - h;
@@ -3206,15 +3206,15 @@ function rn(l, s, t, e, i = 1 / 0, o, n) {
3206
3206
  const N = R - l.x, L = C - l.y, M = T - l.z, y = n.x - R, x = n.y - C, b = n.z - T;
3207
3207
  return N * y + L * x + M * b > 0 && (n.x = R, n.y = C, n.z = T, t.x = (n.x - R) / o, t.y = (n.y - C) / o, t.z = (n.z - T) / o), n;
3208
3208
  }
3209
- function $s(l, s) {
3209
+ function Ks(l, s) {
3210
3210
  s.set(0, 0), l.forEach((t) => {
3211
3211
  s.x += t.clientX, s.y += t.clientY;
3212
3212
  }), s.x /= l.length, s.y /= l.length;
3213
3213
  }
3214
- function Ks(l, s) {
3214
+ function Js(l, s) {
3215
3215
  return bt(l) ? (console.warn(`${s} is not supported in OrthographicCamera`), !0) : !1;
3216
3216
  }
3217
- class Fr {
3217
+ class gr {
3218
3218
  constructor() {
3219
3219
  this._listeners = {};
3220
3220
  }
@@ -3278,9 +3278,9 @@ class Fr {
3278
3278
  }
3279
3279
  }
3280
3280
  }
3281
- const Or = "2.7.3", ds = 1 / 8, xn = typeof window < "u", gr = xn && /Mac/.test(navigator.platform), Sr = !(xn && "PointerEvent" in window);
3282
- let Y, an, us, Js, lt, G, z, de, ye, gt, St, jt, cn, ln, dt, we, ue, hn, ti, En, ei, si, Is;
3283
- class ot extends Fr {
3281
+ const Sr = "2.7.3", ds = 1 / 8, vn = typeof window < "u", _r = vn && /Mac/.test(navigator.platform), Nr = !(vn && "PointerEvent" in window);
3282
+ let Y, cn, us, ti, lt, G, z, de, ye, gt, St, jt, ln, hn, dt, we, ue, En, ei, dn, si, ii, Is;
3283
+ class ot extends gr {
3284
3284
  /**
3285
3285
  * Injects THREE as the dependency. You can then proceed to use CameraControls.
3286
3286
  *
@@ -3322,7 +3322,7 @@ class ot extends Fr {
3322
3322
  * @category Statics
3323
3323
  */
3324
3324
  static install(s) {
3325
- Y = s.THREE, an = Object.freeze(new Y.Vector3(0, 0, 0)), us = Object.freeze(new Y.Vector3(0, 1, 0)), Js = Object.freeze(new Y.Vector3(0, 0, 1)), lt = new Y.Vector2(), G = new Y.Vector3(), z = new Y.Vector3(), de = new Y.Vector3(), ye = new Y.Vector3(), gt = new Y.Vector3(), St = new Y.Vector3(), jt = new Y.Vector3(), cn = new Y.Vector3(), ln = new Y.Vector3(), dt = new Y.Spherical(), we = new Y.Spherical(), ue = new Y.Box3(), hn = new Y.Box3(), ti = new Y.Sphere(), En = new Y.Quaternion(), ei = new Y.Quaternion(), si = new Y.Matrix4(), Is = new Y.Raycaster();
3325
+ Y = s.THREE, cn = Object.freeze(new Y.Vector3(0, 0, 0)), us = Object.freeze(new Y.Vector3(0, 1, 0)), ti = Object.freeze(new Y.Vector3(0, 0, 1)), lt = new Y.Vector2(), G = new Y.Vector3(), z = new Y.Vector3(), de = new Y.Vector3(), ye = new Y.Vector3(), gt = new Y.Vector3(), St = new Y.Vector3(), jt = new Y.Vector3(), ln = new Y.Vector3(), hn = new Y.Vector3(), dt = new Y.Spherical(), we = new Y.Spherical(), ue = new Y.Box3(), En = new Y.Box3(), ei = new Y.Sphere(), dn = new Y.Quaternion(), si = new Y.Quaternion(), ii = new Y.Matrix4(), Is = new Y.Raycaster();
3326
3326
  }
3327
3327
  /**
3328
3328
  * list all ACTIONs
@@ -3493,7 +3493,7 @@ class ot extends Fr {
3493
3493
  const N = performance.now();
3494
3494
  h - N < 1e3 && this._getClientRect(this._elementRect), h = N;
3495
3495
  }
3496
- const m = gr ? -1 : -3, O = f.deltaMode === 1 ? f.deltaY / m : f.deltaY / (m * 10), S = this.dollyToCursor ? (f.clientX - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, _ = this.dollyToCursor ? (f.clientY - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0;
3496
+ const m = _r ? -1 : -3, O = f.deltaMode === 1 ? f.deltaY / m : f.deltaY / (m * 10), S = this.dollyToCursor ? (f.clientX - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, _ = this.dollyToCursor ? (f.clientY - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0;
3497
3497
  switch (this.mouseButtons.wheel) {
3498
3498
  case P.ROTATE: {
3499
3499
  this._rotateInternal(f.deltaX, f.deltaY), this._isUserControllingRotate = !0;
@@ -3529,7 +3529,7 @@ class ot extends Fr {
3529
3529
  }, A = (f) => {
3530
3530
  if (!this._enabled)
3531
3531
  return;
3532
- if ($s(this._activePointers, lt), this._getClientRect(this._elementRect), e.copy(lt), i.copy(lt), this._activePointers.length >= 2) {
3532
+ if (Ks(this._activePointers, lt), this._getClientRect(this._elementRect), e.copy(lt), i.copy(lt), this._activePointers.length >= 2) {
3533
3533
  const O = lt.x - this._activePointers[1].clientX, S = lt.y - this._activePointers[1].clientY, _ = Math.sqrt(O * O + S * S);
3534
3534
  o.set(0, _);
3535
3535
  const N = (this._activePointers[0].clientX + this._activePointers[1].clientX) * 0.5, L = (this._activePointers[0].clientY + this._activePointers[1].clientY) * 0.5;
@@ -3555,7 +3555,7 @@ class ot extends Fr {
3555
3555
  }, R = () => {
3556
3556
  if (!this._enabled || !this._dragNeedsUpdate)
3557
3557
  return;
3558
- this._dragNeedsUpdate = !1, $s(this._activePointers, lt);
3558
+ this._dragNeedsUpdate = !1, Ks(this._activePointers, lt);
3559
3559
  const m = this._domElement && document.pointerLockElement === this._domElement ? this._lockedPointer || this._activePointers[0] : null, O = m ? -m.deltaX : i.x - lt.x, S = m ? -m.deltaY : i.y - lt.y;
3560
3560
  if (i.copy(lt), ((this._state & P.ROTATE) === P.ROTATE || (this._state & P.TOUCH_ROTATE) === P.TOUCH_ROTATE || (this._state & P.TOUCH_DOLLY_ROTATE) === P.TOUCH_DOLLY_ROTATE || (this._state & P.TOUCH_ZOOM_ROTATE) === P.TOUCH_ZOOM_ROTATE) && (this._rotateInternal(O, S), this._isUserControllingRotate = !0), (this._state & P.DOLLY) === P.DOLLY || (this._state & P.ZOOM) === P.ZOOM) {
3561
3561
  const _ = this.dollyToCursor ? (e.x - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, N = this.dollyToCursor ? (e.y - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0, L = this.dollyDragInverted ? -1 : 1;
@@ -3569,7 +3569,7 @@ class ot extends Fr {
3569
3569
  }
3570
3570
  ((this._state & P.TRUCK) === P.TRUCK || (this._state & P.TOUCH_TRUCK) === P.TOUCH_TRUCK || (this._state & P.TOUCH_DOLLY_TRUCK) === P.TOUCH_DOLLY_TRUCK || (this._state & P.TOUCH_ZOOM_TRUCK) === P.TOUCH_ZOOM_TRUCK) && (this._truckInternal(O, S, !1), this._isUserControllingTruck = !0), ((this._state & P.OFFSET) === P.OFFSET || (this._state & P.TOUCH_OFFSET) === P.TOUCH_OFFSET || (this._state & P.TOUCH_DOLLY_OFFSET) === P.TOUCH_DOLLY_OFFSET || (this._state & P.TOUCH_ZOOM_OFFSET) === P.TOUCH_ZOOM_OFFSET) && (this._truckInternal(O, S, !0), this._isUserControllingOffset = !0), this.dispatchEvent({ type: "control" });
3571
3571
  }, C = () => {
3572
- $s(this._activePointers, lt), i.copy(lt), this._dragNeedsUpdate = !1, (this._activePointers.length === 0 || this._activePointers.length === 1 && this._activePointers[0] === this._lockedPointer) && (this._isDragging = !1), this._activePointers.length === 0 && this._domElement && (this._domElement.ownerDocument.removeEventListener("pointermove", a, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("mousemove", c), this._domElement.ownerDocument.removeEventListener("pointerup", E), this._domElement.ownerDocument.removeEventListener("mouseup", d), this.dispatchEvent({ type: "controlend" }));
3572
+ Ks(this._activePointers, lt), i.copy(lt), this._dragNeedsUpdate = !1, (this._activePointers.length === 0 || this._activePointers.length === 1 && this._activePointers[0] === this._lockedPointer) && (this._isDragging = !1), this._activePointers.length === 0 && this._domElement && (this._domElement.ownerDocument.removeEventListener("pointermove", a, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("mousemove", c), this._domElement.ownerDocument.removeEventListener("pointerup", E), this._domElement.ownerDocument.removeEventListener("mouseup", d), this.dispatchEvent({ type: "controlend" }));
3573
3573
  };
3574
3574
  this.lockPointer = () => {
3575
3575
  !this._enabled || !this._domElement || (this.cancel(), this._lockedPointer = {
@@ -3589,7 +3589,7 @@ class ot extends Fr {
3589
3589
  this.unlockPointer();
3590
3590
  };
3591
3591
  this._addAllEventListeners = (f) => {
3592
- this._domElement = f, this._domElement.style.touchAction = "none", this._domElement.style.userSelect = "none", this._domElement.style.webkitUserSelect = "none", this._domElement.addEventListener("pointerdown", n), Sr && this._domElement.addEventListener("mousedown", r), this._domElement.addEventListener("pointercancel", E), this._domElement.addEventListener("wheel", u, { passive: !1 }), this._domElement.addEventListener("contextmenu", p);
3592
+ this._domElement = f, this._domElement.style.touchAction = "none", this._domElement.style.userSelect = "none", this._domElement.style.webkitUserSelect = "none", this._domElement.addEventListener("pointerdown", n), Nr && this._domElement.addEventListener("mousedown", r), this._domElement.addEventListener("pointercancel", E), this._domElement.addEventListener("wheel", u, { passive: !1 }), this._domElement.addEventListener("contextmenu", p);
3593
3593
  }, this._removeAllEventListeners = () => {
3594
3594
  this._domElement && (this._domElement.style.touchAction = "", this._domElement.style.userSelect = "", this._domElement.style.webkitUserSelect = "", this._domElement.removeEventListener("pointerdown", n), this._domElement.removeEventListener("mousedown", r), this._domElement.removeEventListener("pointercancel", E), this._domElement.removeEventListener("wheel", u, { passive: !1 }), this._domElement.removeEventListener("contextmenu", p), this._domElement.ownerDocument.removeEventListener("pointermove", a, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("mousemove", c), this._domElement.ownerDocument.removeEventListener("pointerup", E), this._domElement.ownerDocument.removeEventListener("mouseup", d), this._domElement.ownerDocument.removeEventListener("pointerlockchange", T), this._domElement.ownerDocument.removeEventListener("pointerlockerror", F));
3595
3595
  }, this.cancel = () => {
@@ -3958,12 +3958,12 @@ class ot extends Fr {
3958
3958
  fitToBox(s, t, { cover: e = !1, paddingLeft: i = 0, paddingRight: o = 0, paddingBottom: n = 0, paddingTop: r = 0 } = {}) {
3959
3959
  const a = [], c = s.isBox3 ? ue.copy(s) : ue.setFromObject(s);
3960
3960
  c.isEmpty() && (console.warn("camera-controls: fitTo() cannot be used with an empty box. Aborting"), Promise.resolve());
3961
- const E = on(this._sphericalEnd.theta, nn), d = on(this._sphericalEnd.phi, nn);
3961
+ const E = rn(this._sphericalEnd.theta, on), d = rn(this._sphericalEnd.phi, on);
3962
3962
  a.push(this.rotateTo(E, d, t));
3963
- const h = G.setFromSpherical(this._sphericalEnd).normalize(), u = En.setFromUnitVectors(h, Js), p = k(Math.abs(h.y), 1);
3964
- p && u.multiply(ei.setFromAxisAngle(us, E)), u.multiply(this._yAxisUpSpaceInverse);
3965
- const A = hn.makeEmpty();
3966
- z.copy(c.min).applyQuaternion(u), A.expandByPoint(z), z.copy(c.min).setX(c.max.x).applyQuaternion(u), A.expandByPoint(z), z.copy(c.min).setY(c.max.y).applyQuaternion(u), A.expandByPoint(z), z.copy(c.max).setZ(c.min.z).applyQuaternion(u), A.expandByPoint(z), z.copy(c.min).setZ(c.max.z).applyQuaternion(u), A.expandByPoint(z), z.copy(c.max).setY(c.min.y).applyQuaternion(u), A.expandByPoint(z), z.copy(c.max).setX(c.min.x).applyQuaternion(u), A.expandByPoint(z), z.copy(c.max).applyQuaternion(u), A.expandByPoint(z), A.min.x -= i, A.min.y -= n, A.max.x += o, A.max.y += r, u.setFromUnitVectors(Js, h), p && u.premultiply(ei.invert()), u.premultiply(this._yAxisUpSpace);
3963
+ const h = G.setFromSpherical(this._sphericalEnd).normalize(), u = dn.setFromUnitVectors(h, ti), p = k(Math.abs(h.y), 1);
3964
+ p && u.multiply(si.setFromAxisAngle(us, E)), u.multiply(this._yAxisUpSpaceInverse);
3965
+ const A = En.makeEmpty();
3966
+ z.copy(c.min).applyQuaternion(u), A.expandByPoint(z), z.copy(c.min).setX(c.max.x).applyQuaternion(u), A.expandByPoint(z), z.copy(c.min).setY(c.max.y).applyQuaternion(u), A.expandByPoint(z), z.copy(c.max).setZ(c.min.z).applyQuaternion(u), A.expandByPoint(z), z.copy(c.min).setZ(c.max.z).applyQuaternion(u), A.expandByPoint(z), z.copy(c.max).setY(c.min.y).applyQuaternion(u), A.expandByPoint(z), z.copy(c.max).setX(c.min.x).applyQuaternion(u), A.expandByPoint(z), z.copy(c.max).applyQuaternion(u), A.expandByPoint(z), A.min.x -= i, A.min.y -= n, A.max.x += o, A.max.y += r, u.setFromUnitVectors(ti, h), p && u.premultiply(si.invert()), u.premultiply(this._yAxisUpSpace);
3967
3967
  const R = A.getSize(G), C = A.getCenter(z).applyQuaternion(u);
3968
3968
  if (Qt(this._camera)) {
3969
3969
  const T = this.getDistanceToFitBox(R.x, R.y, R.z, e);
@@ -3981,7 +3981,7 @@ class ot extends Fr {
3981
3981
  * @category Methods
3982
3982
  */
3983
3983
  fitToSphere(s, t) {
3984
- const e = [], o = s instanceof Y.Sphere ? ti.copy(s) : ot.createBoundingSphere(s, ti);
3984
+ const e = [], o = s instanceof Y.Sphere ? ei.copy(s) : ot.createBoundingSphere(s, ei);
3985
3985
  if (e.push(this.moveTo(o.center.x, o.center.y, o.center.z, t)), Qt(this._camera)) {
3986
3986
  const n = this.getDistanceToFitSphere(o.radius);
3987
3987
  e.push(this.dollyTo(n, t));
@@ -4126,7 +4126,7 @@ class ot extends Fr {
4126
4126
  * @category Methods
4127
4127
  */
4128
4128
  getDistanceToFitBox(s, t, e, i = !1) {
4129
- if (Ks(this._camera, "getDistanceToFitBox"))
4129
+ if (Js(this._camera, "getDistanceToFitBox"))
4130
4130
  return this._spherical.radius;
4131
4131
  const o = s / t, n = this._camera.getEffectiveFOV() * Ne, r = this._camera.aspect;
4132
4132
  return ((i ? o > r : o < r) ? t : s / r) * 0.5 / Math.tan(n * 0.5) + e * 0.5;
@@ -4138,7 +4138,7 @@ class ot extends Fr {
4138
4138
  * @category Methods
4139
4139
  */
4140
4140
  getDistanceToFitSphere(s) {
4141
- if (Ks(this._camera, "getDistanceToFitSphere"))
4141
+ if (Js(this._camera, "getDistanceToFitSphere"))
4142
4142
  return this._spherical.radius;
4143
4143
  const t = this._camera.getEffectiveFOV() * Ne, e = Math.atan(Math.tan(t * 0.5) * this._camera.aspect) * 2, i = 1 < this._camera.aspect ? t : e;
4144
4144
  return s / Math.sin(i * 0.5);
@@ -4238,7 +4238,7 @@ class ot extends Fr {
4238
4238
  * @category Methods
4239
4239
  */
4240
4240
  update(s) {
4241
- const t = this._sphericalEnd.theta - this._spherical.theta, e = this._sphericalEnd.phi - this._spherical.phi, i = this._sphericalEnd.radius - this._spherical.radius, o = cn.subVectors(this._targetEnd, this._target), n = ln.subVectors(this._focalOffsetEnd, this._focalOffset), r = this._zoomEnd - this._zoom;
4241
+ const t = this._sphericalEnd.theta - this._spherical.theta, e = this._sphericalEnd.phi - this._spherical.phi, i = this._sphericalEnd.radius - this._spherical.radius, o = ln.subVectors(this._targetEnd, this._target), n = hn.subVectors(this._focalOffsetEnd, this._focalOffset), r = this._zoomEnd - this._zoom;
4242
4242
  if (X(t))
4243
4243
  this._thetaVelocity.value = 0, this._spherical.theta = this._sphericalEnd.theta;
4244
4244
  else {
@@ -4261,13 +4261,13 @@ class ot extends Fr {
4261
4261
  this._targetVelocity.set(0, 0, 0), this._target.copy(this._targetEnd);
4262
4262
  else {
4263
4263
  const d = this._isUserControllingTruck ? this.draggingSmoothTime : this.smoothTime;
4264
- rn(this._target, this._targetEnd, this._targetVelocity, d, this.maxSpeed, s, this._target), this._needsUpdate = !0;
4264
+ an(this._target, this._targetEnd, this._targetVelocity, d, this.maxSpeed, s, this._target), this._needsUpdate = !0;
4265
4265
  }
4266
4266
  if (X(n.x) && X(n.y) && X(n.z))
4267
4267
  this._focalOffsetVelocity.set(0, 0, 0), this._focalOffset.copy(this._focalOffsetEnd);
4268
4268
  else {
4269
4269
  const d = this._isUserControllingOffset ? this.draggingSmoothTime : this.smoothTime;
4270
- rn(this._focalOffset, this._focalOffsetEnd, this._focalOffsetVelocity, d, this.maxSpeed, s, this._focalOffset), this._needsUpdate = !0;
4270
+ an(this._focalOffset, this._focalOffsetEnd, this._focalOffsetVelocity, d, this.maxSpeed, s, this._focalOffset), this._needsUpdate = !0;
4271
4271
  }
4272
4272
  if (X(r))
4273
4273
  this._zoomVelocity.value = 0, this._zoom = this._zoomEnd;
@@ -4351,7 +4351,7 @@ class ot extends Fr {
4351
4351
  console.warn("camera-controls is already connected.");
4352
4352
  return;
4353
4353
  }
4354
- s.setAttribute("data-camera-controls-version", Or), this._addAllEventListeners(s), this._getClientRect(this._elementRect);
4354
+ s.setAttribute("data-camera-controls-version", Sr), this._addAllEventListeners(s), this._getClientRect(this._elementRect);
4355
4355
  }
4356
4356
  /**
4357
4357
  * Detach all internal event handlers to disable drag control.
@@ -4411,13 +4411,13 @@ class ot extends Fr {
4411
4411
  // lateUpdate
4412
4412
  _collisionTest() {
4413
4413
  let s = 1 / 0;
4414
- if (!(this.colliderMeshes.length >= 1) || Ks(this._camera, "_collisionTest"))
4414
+ if (!(this.colliderMeshes.length >= 1) || Js(this._camera, "_collisionTest"))
4415
4415
  return s;
4416
4416
  const e = this._getTargetDirection(ye);
4417
- si.lookAt(an, e, this._camera.up);
4417
+ ii.lookAt(cn, e, this._camera.up);
4418
4418
  for (let i = 0; i < 4; i++) {
4419
4419
  const o = z.copy(this._nearPlaneCorners[i]);
4420
- o.applyMatrix4(si);
4420
+ o.applyMatrix4(ii);
4421
4421
  const n = de.addVectors(this._target, o);
4422
4422
  Is.set(n, e), Is.far = this._spherical.radius + 1;
4423
4423
  const r = Is.intersectObjects(this.colliderMeshes);
@@ -4496,7 +4496,7 @@ class ot extends Fr {
4496
4496
  }), e.radius = Math.sqrt(o), e;
4497
4497
  }
4498
4498
  }
4499
- class ke extends rr {
4499
+ class ke extends cr {
4500
4500
  constructor(t) {
4501
4501
  super(t);
4502
4502
  /** {@link Updateable.onBeforeUpdate} */
@@ -4642,7 +4642,7 @@ const gs = class gs extends J {
4642
4642
  * @throws {Error} - Throws an error if a world with the same UUID already exists in the list.
4643
4643
  */
4644
4644
  create() {
4645
- const t = new Ar(this.components), e = t.uuid;
4645
+ const t = new Or(this.components), e = t.uuid;
4646
4646
  if (this.list.has(e))
4647
4647
  throw new Error("There is already a world with this name!");
4648
4648
  return this.list.set(e, t), this.onWorldCreated.trigger(t), t;
@@ -4668,8 +4668,8 @@ const gs = class gs extends J {
4668
4668
  * This UUID is used to register the component within the Components system.
4669
4669
  */
4670
4670
  I(gs, "uuid", "fdb61dc4-2ec1-4966-b83d-54ea795fad4a");
4671
- let pi = gs;
4672
- class _r {
4671
+ let Ci = gs;
4672
+ class Pr {
4673
4673
  constructor(s, t, e) {
4674
4674
  /** {@link Disposable.onDisposed} */
4675
4675
  I(this, "onDisposed", new D());
@@ -4815,9 +4815,9 @@ class _r {
4815
4815
  s ? t.addEventListener("update", this.updateZoom) : t.removeEventListener("update", this.updateZoom);
4816
4816
  }
4817
4817
  }
4818
- class Nr extends J {
4819
- constructor() {
4820
- super(...arguments);
4818
+ const Ss = class Ss extends J {
4819
+ constructor(t) {
4820
+ super(t);
4821
4821
  I(this, "list", /* @__PURE__ */ new Map());
4822
4822
  I(this, "onDisposed", new D());
4823
4823
  I(this, "config", {
@@ -4828,11 +4828,12 @@ class Nr extends J {
4828
4828
  });
4829
4829
  /** {@link Component.enabled} */
4830
4830
  I(this, "enabled", !0);
4831
+ t.add(Ss.uuid, this);
4831
4832
  }
4832
4833
  create(t) {
4833
4834
  if (this.list.has(t.uuid))
4834
4835
  throw new Error("This world already has a grid!");
4835
- const e = new _r(this.components, t, this.config);
4836
+ const e = new Pr(this.components, t, this.config);
4836
4837
  return this.list.set(t.uuid, e), t.onDisposed.add(() => {
4837
4838
  this.delete(t);
4838
4839
  }), e;
@@ -4844,21 +4845,22 @@ class Nr extends J {
4844
4845
  dispose() {
4845
4846
  for (const [t, e] of this.list)
4846
4847
  e.dispose();
4847
- this.list.clear(), this.onDisposed.trigger();
4848
+ this.list.clear(), this.onDisposed.trigger(), this.onDisposed.reset();
4848
4849
  }
4849
- }
4850
- I(Nr, "uuid", "d1e814d5-b81c-4452-87a2-f039375e0489");
4851
- const qt = new Qn(), nt = new w(), xt = new w(), j = new Pt(), dn = {
4850
+ };
4851
+ I(Ss, "uuid", "d1e814d5-b81c-4452-87a2-f039375e0489");
4852
+ let un = Ss;
4853
+ const qt = new qn(), nt = new w(), xt = new w(), j = new Pt(), In = {
4852
4854
  X: new w(1, 0, 0),
4853
4855
  Y: new w(0, 1, 0),
4854
4856
  Z: new w(0, 0, 1)
4855
- }, ii = { type: "change" }, un = { type: "mouseDown" }, In = { type: "mouseUp", mode: null }, fn = { type: "objectChange" };
4856
- class Pr extends oi {
4857
+ }, ni = { type: "change" }, fn = { type: "mouseDown" }, pn = { type: "mouseUp", mode: null }, Cn = { type: "objectChange" };
4858
+ class Lr extends ri {
4857
4859
  constructor(s, t) {
4858
4860
  super(), t === void 0 && (console.warn('THREE.TransformControls: The second parameter "domElement" is now mandatory.'), t = document), this.isTransformControls = !0, this.visible = !1, this.domElement = t, this.domElement.style.touchAction = "none";
4859
- const e = new Ur();
4861
+ const e = new xr();
4860
4862
  this._gizmo = e, this.add(e);
4861
- const i = new xr();
4863
+ const i = new br();
4862
4864
  this._plane = i, this.add(i);
4863
4865
  const o = this;
4864
4866
  function n(T, F) {
@@ -4868,13 +4870,13 @@ class Pr extends oi {
4868
4870
  return f !== void 0 ? f : F;
4869
4871
  },
4870
4872
  set: function(m) {
4871
- f !== m && (f = m, i[T] = m, e[T] = m, o.dispatchEvent({ type: T + "-changed", value: m }), o.dispatchEvent(ii));
4873
+ f !== m && (f = m, i[T] = m, e[T] = m, o.dispatchEvent({ type: T + "-changed", value: m }), o.dispatchEvent(ni));
4872
4874
  }
4873
4875
  }), o[T] = F, i[T] = F, e[T] = F;
4874
4876
  }
4875
4877
  n("camera", s), 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);
4876
4878
  const r = new w(), a = new w(), c = new Pt(), E = new Pt(), d = new w(), h = new Pt(), u = new w(), p = new w(), A = new w(), R = 0, C = new w();
4877
- n("worldPosition", r), n("worldPositionStart", a), n("worldQuaternion", c), n("worldQuaternionStart", E), n("cameraPosition", d), n("cameraQuaternion", h), n("pointStart", u), n("pointEnd", p), n("rotationAxis", A), n("rotationAngle", R), n("eye", C), this._offset = new w(), this._startNorm = new w(), this._endNorm = new w(), this._cameraScale = new w(), this._parentPosition = new w(), this._parentQuaternion = new Pt(), this._parentQuaternionInv = new Pt(), this._parentScale = new w(), this._worldScaleStart = new w(), this._worldQuaternionInv = new Pt(), this._worldScale = new w(), this._positionStart = new w(), this._quaternionStart = new Pt(), this._scaleStart = new w(), this._getPointer = Lr.bind(this), this._onPointerDown = wr.bind(this), this._onPointerHover = yr.bind(this), this._onPointerMove = Mr.bind(this), this._onPointerUp = Dr.bind(this), this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointermove", this._onPointerHover), this.domElement.addEventListener("pointerup", this._onPointerUp);
4879
+ n("worldPosition", r), n("worldPositionStart", a), n("worldQuaternion", c), n("worldQuaternionStart", E), n("cameraPosition", d), n("cameraQuaternion", h), n("pointStart", u), n("pointEnd", p), n("rotationAxis", A), n("rotationAngle", R), n("eye", C), this._offset = new w(), this._startNorm = new w(), this._endNorm = new w(), this._cameraScale = new w(), this._parentPosition = new w(), this._parentQuaternion = new Pt(), this._parentQuaternionInv = new Pt(), this._parentScale = new w(), this._worldScaleStart = new w(), this._worldQuaternionInv = new Pt(), this._worldScale = new w(), this._positionStart = new w(), this._quaternionStart = new Pt(), this._scaleStart = new w(), this._getPointer = yr.bind(this), this._onPointerDown = Mr.bind(this), this._onPointerHover = wr.bind(this), this._onPointerMove = Dr.bind(this), this._onPointerUp = Ur.bind(this), this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointermove", this._onPointerHover), this.domElement.addEventListener("pointerup", this._onPointerUp);
4878
4880
  }
4879
4881
  // updateMatrixWorld updates key transformation variables
4880
4882
  updateMatrixWorld() {
@@ -4884,14 +4886,14 @@ class Pr extends oi {
4884
4886
  if (this.object === void 0 || this.dragging === !0)
4885
4887
  return;
4886
4888
  qt.setFromCamera(s, this.camera);
4887
- const t = ni(this._gizmo.picker[this.mode], qt);
4889
+ const t = oi(this._gizmo.picker[this.mode], qt);
4888
4890
  t ? this.axis = t.object.name : this.axis = null;
4889
4891
  }
4890
4892
  pointerDown(s) {
4891
4893
  if (!(this.object === void 0 || this.dragging === !0 || s.button !== 0) && this.axis !== null) {
4892
4894
  qt.setFromCamera(s, this.camera);
4893
- const t = ni(this._plane, qt, !0);
4894
- t && (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(t.point).sub(this.worldPositionStart)), this.dragging = !0, un.mode = this.mode, this.dispatchEvent(un);
4895
+ const t = oi(this._plane, qt, !0);
4896
+ t && (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(t.point).sub(this.worldPositionStart)), this.dragging = !0, fn.mode = this.mode, this.dispatchEvent(fn);
4895
4897
  }
4896
4898
  }
4897
4899
  pointerMove(s) {
@@ -4900,7 +4902,7 @@ class Pr extends oi {
4900
4902
  if (e === "scale" ? o = "local" : (t === "E" || t === "XYZE" || t === "XYZ") && (o = "world"), i === void 0 || t === null || this.dragging === !1 || s.button !== -1)
4901
4903
  return;
4902
4904
  qt.setFromCamera(s, this.camera);
4903
- const n = ni(this._plane, qt, !0);
4905
+ const n = oi(this._plane, qt, !0);
4904
4906
  if (n) {
4905
4907
  if (this.pointEnd.copy(n.point).sub(this.worldPositionStart), e === "translate")
4906
4908
  this._offset.copy(this.pointEnd).sub(this.pointStart), o === "local" && t !== "XYZ" && this._offset.applyQuaternion(this._worldQuaternionInv), t.indexOf("X") === -1 && (this._offset.x = 0), t.indexOf("Y") === -1 && (this._offset.y = 0), t.indexOf("Z") === -1 && (this._offset.z = 0), o === "local" && t !== "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 && (o === "local" && (i.position.applyQuaternion(j.copy(this._quaternionStart).invert()), t.search("X") !== -1 && (i.position.x = Math.round(i.position.x / this.translationSnap) * this.translationSnap), t.search("Y") !== -1 && (i.position.y = Math.round(i.position.y / this.translationSnap) * this.translationSnap), t.search("Z") !== -1 && (i.position.z = Math.round(i.position.z / this.translationSnap) * this.translationSnap), i.position.applyQuaternion(this._quaternionStart)), o === "world" && (i.parent && i.position.add(nt.setFromMatrixPosition(i.parent.matrixWorld)), t.search("X") !== -1 && (i.position.x = Math.round(i.position.x / this.translationSnap) * this.translationSnap), t.search("Y") !== -1 && (i.position.y = Math.round(i.position.y / this.translationSnap) * this.translationSnap), t.search("Z") !== -1 && (i.position.z = Math.round(i.position.z / this.translationSnap) * this.translationSnap), i.parent && i.position.sub(nt.setFromMatrixPosition(i.parent.matrixWorld))));
@@ -4915,13 +4917,13 @@ class Pr extends oi {
4915
4917
  this._offset.copy(this.pointEnd).sub(this.pointStart);
4916
4918
  const r = 20 / this.worldPosition.distanceTo(nt.setFromMatrixPosition(this.camera.matrixWorld));
4917
4919
  let a = !1;
4918
- t === "XYZE" ? (this.rotationAxis.copy(this._offset).cross(this.eye).normalize(), this.rotationAngle = this._offset.dot(nt.copy(this.rotationAxis).cross(this.eye)) * r) : (t === "X" || t === "Y" || t === "Z") && (this.rotationAxis.copy(dn[t]), nt.copy(dn[t]), o === "local" && nt.applyQuaternion(this.worldQuaternion), nt.cross(this.eye), nt.length() === 0 ? a = !0 : this.rotationAngle = this._offset.dot(nt.normalize()) * r), (t === "E" || a) && (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), o === "local" && t !== "E" && t !== "XYZE" ? (i.quaternion.copy(this._quaternionStart), i.quaternion.multiply(j.setFromAxisAngle(this.rotationAxis, this.rotationAngle)).normalize()) : (this.rotationAxis.applyQuaternion(this._parentQuaternionInv), i.quaternion.copy(j.setFromAxisAngle(this.rotationAxis, this.rotationAngle)), i.quaternion.multiply(this._quaternionStart).normalize());
4920
+ t === "XYZE" ? (this.rotationAxis.copy(this._offset).cross(this.eye).normalize(), this.rotationAngle = this._offset.dot(nt.copy(this.rotationAxis).cross(this.eye)) * r) : (t === "X" || t === "Y" || t === "Z") && (this.rotationAxis.copy(In[t]), nt.copy(In[t]), o === "local" && nt.applyQuaternion(this.worldQuaternion), nt.cross(this.eye), nt.length() === 0 ? a = !0 : this.rotationAngle = this._offset.dot(nt.normalize()) * r), (t === "E" || a) && (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), o === "local" && t !== "E" && t !== "XYZE" ? (i.quaternion.copy(this._quaternionStart), i.quaternion.multiply(j.setFromAxisAngle(this.rotationAxis, this.rotationAngle)).normalize()) : (this.rotationAxis.applyQuaternion(this._parentQuaternionInv), i.quaternion.copy(j.setFromAxisAngle(this.rotationAxis, this.rotationAngle)), i.quaternion.multiply(this._quaternionStart).normalize());
4919
4921
  }
4920
- this.dispatchEvent(ii), this.dispatchEvent(fn);
4922
+ this.dispatchEvent(ni), this.dispatchEvent(Cn);
4921
4923
  }
4922
4924
  }
4923
4925
  pointerUp(s) {
4924
- s.button === 0 && (this.dragging && this.axis !== null && (In.mode = this.mode, this.dispatchEvent(In)), this.dragging = !1, this.axis = null);
4926
+ s.button === 0 && (this.dragging && this.axis !== null && (pn.mode = this.mode, this.dispatchEvent(pn)), this.dragging = !1, this.axis = null);
4925
4927
  }
4926
4928
  dispose() {
4927
4929
  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(s) {
@@ -4937,7 +4939,7 @@ class Pr extends oi {
4937
4939
  return this.object = void 0, this.visible = !1, this.axis = null, this;
4938
4940
  }
4939
4941
  reset() {
4940
- this.enabled && this.dragging && (this.object.position.copy(this._positionStart), this.object.quaternion.copy(this._quaternionStart), this.object.scale.copy(this._scaleStart), this.dispatchEvent(ii), this.dispatchEvent(fn), this.pointStart.copy(this.pointEnd));
4942
+ this.enabled && this.dragging && (this.object.position.copy(this._positionStart), this.object.quaternion.copy(this._quaternionStart), this.object.scale.copy(this._scaleStart), this.dispatchEvent(ni), this.dispatchEvent(Cn), this.pointStart.copy(this.pointEnd));
4941
4943
  }
4942
4944
  getRaycaster() {
4943
4945
  return qt;
@@ -4965,7 +4967,7 @@ class Pr extends oi {
4965
4967
  this.space = s;
4966
4968
  }
4967
4969
  }
4968
- function Lr(l) {
4970
+ function yr(l) {
4969
4971
  if (this.domElement.ownerDocument.pointerLockElement)
4970
4972
  return {
4971
4973
  x: 0,
@@ -4981,7 +4983,7 @@ function Lr(l) {
4981
4983
  };
4982
4984
  }
4983
4985
  }
4984
- function yr(l) {
4986
+ function wr(l) {
4985
4987
  if (this.enabled)
4986
4988
  switch (l.pointerType) {
4987
4989
  case "mouse":
@@ -4990,33 +4992,33 @@ function yr(l) {
4990
4992
  break;
4991
4993
  }
4992
4994
  }
4993
- function wr(l) {
4995
+ function Mr(l) {
4994
4996
  this.enabled && (document.pointerLockElement || this.domElement.setPointerCapture(l.pointerId), this.domElement.addEventListener("pointermove", this._onPointerMove), this.pointerHover(this._getPointer(l)), this.pointerDown(this._getPointer(l)));
4995
4997
  }
4996
- function Mr(l) {
4998
+ function Dr(l) {
4997
4999
  this.enabled && this.pointerMove(this._getPointer(l));
4998
5000
  }
4999
- function Dr(l) {
5001
+ function Ur(l) {
5000
5002
  this.enabled && (this.domElement.releasePointerCapture(l.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.pointerUp(this._getPointer(l)));
5001
5003
  }
5002
- function ni(l, s, t) {
5004
+ function oi(l, s, t) {
5003
5005
  const e = s.intersectObject(l, !0);
5004
5006
  for (let i = 0; i < e.length; i++)
5005
5007
  if (e[i].object.visible || t)
5006
5008
  return e[i];
5007
5009
  return !1;
5008
5010
  }
5009
- const fs = new jn(), W = new w(0, 1, 0), pn = new w(0, 0, 0), Cn = new yt(), ps = new Pt(), Rs = new Pt(), _t = new w(), Tn = new yt(), Ue = new w(1, 0, 0), $t = new w(0, 1, 0), xe = new w(0, 0, 1), Cs = new w(), Me = new w(), De = new w();
5010
- class Ur extends oi {
5011
+ const fs = new $n(), W = new w(0, 1, 0), Tn = new w(0, 0, 0), mn = new yt(), ps = new Pt(), Rs = new Pt(), _t = new w(), Rn = new yt(), Ue = new w(1, 0, 0), $t = new w(0, 1, 0), xe = new w(0, 0, 1), Cs = new w(), Me = new w(), De = new w();
5012
+ class xr extends ri {
5011
5013
  constructor() {
5012
5014
  super(), this.isTransformControlsGizmo = !0, this.type = "TransformControlsGizmo";
5013
- const s = new Ln({
5015
+ const s = new wn({
5014
5016
  depthTest: !1,
5015
5017
  depthWrite: !1,
5016
5018
  fog: !1,
5017
5019
  toneMapped: !1,
5018
5020
  transparent: !0
5019
- }), t = new qn({
5021
+ }), t = new Kn({
5020
5022
  depthTest: !1,
5021
5023
  depthWrite: !1,
5022
5024
  fog: !1,
@@ -5048,8 +5050,8 @@ class Ur extends oi {
5048
5050
  A.translate(0, 0.05, 0);
5049
5051
  const R = new rt(0.08, 0.08, 0.08);
5050
5052
  R.translate(0, 0.04, 0);
5051
- const C = new Di();
5052
- C.setAttribute("position", new Ui([0, 0, 0, 1, 0, 0], 3));
5053
+ const C = new Ui();
5054
+ C.setAttribute("position", new xi([0, 0, 0, 1, 0, 0], 3));
5053
5055
  const T = new ct(75e-4, 75e-4, 0.5, 3);
5054
5056
  T.translate(0, 0.25, 0);
5055
5057
  function F(B, H) {
@@ -5057,8 +5059,8 @@ class Ur extends oi {
5057
5059
  return q.rotateY(Math.PI / 2), q.rotateX(Math.PI / 2), q;
5058
5060
  }
5059
5061
  function f() {
5060
- const B = new Di();
5061
- return B.setAttribute("position", new Ui([0, 0, 0, 1, 1, 1], 3)), B;
5062
+ const B = new Ui();
5063
+ return B.setAttribute("position", new xi([0, 0, 0, 1, 1, 1], 3)), B;
5062
5064
  }
5063
5065
  const m = {
5064
5066
  X: [
@@ -5154,7 +5156,7 @@ class Ur extends oi {
5154
5156
  ]
5155
5157
  }, L = {
5156
5158
  XYZE: [
5157
- [new v(new $n(0.25, 10, 8), e)]
5159
+ [new v(new Jn(0.25, 10, 8), e)]
5158
5160
  ],
5159
5161
  X: [
5160
5162
  [new v(new Re(0.5, 0.1, 4, 24), e), [0, 0, 0], [0, -Math.PI / 2, -Math.PI / 2]]
@@ -5233,7 +5235,7 @@ class Ur extends oi {
5233
5235
  ]
5234
5236
  };
5235
5237
  function b(B) {
5236
- const H = new oi();
5238
+ const H = new ri();
5237
5239
  for (const q in B)
5238
5240
  for (let st = B[q].length; st--; ) {
5239
5241
  const Q = B[q][st][0].clone(), kt = B[q][st][1], Wt = B[q][st][2], Xt = B[q][st][3], Xe = B[q][st][4];
@@ -5256,21 +5258,21 @@ class Ur extends oi {
5256
5258
  n.visible = !0, n.rotation.set(0, 0, 0), n.position.copy(this.worldPosition);
5257
5259
  let r;
5258
5260
  if (this.camera.isOrthographicCamera ? r = (this.camera.top - this.camera.bottom) / this.camera.zoom : r = 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(r * this.size / 4), n.tag === "helper") {
5259
- n.visible = !1, n.name === "AXIS" ? (n.visible = !!this.axis, this.axis === "X" && (j.setFromEuler(fs.set(0, 0, 0)), n.quaternion.copy(e).multiply(j), Math.abs(W.copy(Ue).applyQuaternion(e).dot(this.eye)) > 0.9 && (n.visible = !1)), this.axis === "Y" && (j.setFromEuler(fs.set(0, 0, Math.PI / 2)), n.quaternion.copy(e).multiply(j), Math.abs(W.copy($t).applyQuaternion(e).dot(this.eye)) > 0.9 && (n.visible = !1)), this.axis === "Z" && (j.setFromEuler(fs.set(0, Math.PI / 2, 0)), n.quaternion.copy(e).multiply(j), Math.abs(W.copy(xe).applyQuaternion(e).dot(this.eye)) > 0.9 && (n.visible = !1)), this.axis === "XYZE" && (j.setFromEuler(fs.set(0, Math.PI / 2, 0)), W.copy(this.rotationAxis), n.quaternion.setFromRotationMatrix(Cn.lookAt(pn, W, $t)), n.quaternion.multiply(j), 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), nt.set(1e-10, 1e-10, 1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1), nt.applyQuaternion(this.worldQuaternionStart.clone().invert()), n.scale.copy(nt), n.visible = this.dragging) : (n.quaternion.copy(e), this.dragging ? n.position.copy(this.worldPositionStart) : n.position.copy(this.worldPosition), this.axis && (n.visible = this.axis.search(n.name) !== -1));
5261
+ n.visible = !1, n.name === "AXIS" ? (n.visible = !!this.axis, this.axis === "X" && (j.setFromEuler(fs.set(0, 0, 0)), n.quaternion.copy(e).multiply(j), Math.abs(W.copy(Ue).applyQuaternion(e).dot(this.eye)) > 0.9 && (n.visible = !1)), this.axis === "Y" && (j.setFromEuler(fs.set(0, 0, Math.PI / 2)), n.quaternion.copy(e).multiply(j), Math.abs(W.copy($t).applyQuaternion(e).dot(this.eye)) > 0.9 && (n.visible = !1)), this.axis === "Z" && (j.setFromEuler(fs.set(0, Math.PI / 2, 0)), n.quaternion.copy(e).multiply(j), Math.abs(W.copy(xe).applyQuaternion(e).dot(this.eye)) > 0.9 && (n.visible = !1)), this.axis === "XYZE" && (j.setFromEuler(fs.set(0, Math.PI / 2, 0)), W.copy(this.rotationAxis), n.quaternion.setFromRotationMatrix(mn.lookAt(Tn, W, $t)), n.quaternion.multiply(j), 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), nt.set(1e-10, 1e-10, 1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1), nt.applyQuaternion(this.worldQuaternionStart.clone().invert()), n.scale.copy(nt), n.visible = this.dragging) : (n.quaternion.copy(e), this.dragging ? n.position.copy(this.worldPositionStart) : n.position.copy(this.worldPosition), this.axis && (n.visible = this.axis.search(n.name) !== -1));
5260
5262
  continue;
5261
5263
  }
5262
- n.quaternion.copy(e), this.mode === "translate" || this.mode === "scale" ? (n.name === "X" && Math.abs(W.copy(Ue).applyQuaternion(e).dot(this.eye)) > 0.99 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1), n.name === "Y" && Math.abs(W.copy($t).applyQuaternion(e).dot(this.eye)) > 0.99 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1), n.name === "Z" && Math.abs(W.copy(xe).applyQuaternion(e).dot(this.eye)) > 0.99 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1), n.name === "XY" && Math.abs(W.copy(xe).applyQuaternion(e).dot(this.eye)) < 0.2 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1), n.name === "YZ" && Math.abs(W.copy(Ue).applyQuaternion(e).dot(this.eye)) < 0.2 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1), n.name === "XZ" && Math.abs(W.copy($t).applyQuaternion(e).dot(this.eye)) < 0.2 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1)) : this.mode === "rotate" && (ps.copy(e), W.copy(this.eye).applyQuaternion(j.copy(e).invert()), n.name.search("E") !== -1 && n.quaternion.setFromRotationMatrix(Cn.lookAt(this.eye, pn, $t)), n.name === "X" && (j.setFromAxisAngle(Ue, Math.atan2(-W.y, W.z)), j.multiplyQuaternions(ps, j), n.quaternion.copy(j)), n.name === "Y" && (j.setFromAxisAngle($t, Math.atan2(W.x, W.z)), j.multiplyQuaternions(ps, j), n.quaternion.copy(j)), n.name === "Z" && (j.setFromAxisAngle(xe, Math.atan2(W.y, W.x)), j.multiplyQuaternions(ps, j), n.quaternion.copy(j))), 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(a) {
5264
+ n.quaternion.copy(e), this.mode === "translate" || this.mode === "scale" ? (n.name === "X" && Math.abs(W.copy(Ue).applyQuaternion(e).dot(this.eye)) > 0.99 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1), n.name === "Y" && Math.abs(W.copy($t).applyQuaternion(e).dot(this.eye)) > 0.99 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1), n.name === "Z" && Math.abs(W.copy(xe).applyQuaternion(e).dot(this.eye)) > 0.99 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1), n.name === "XY" && Math.abs(W.copy(xe).applyQuaternion(e).dot(this.eye)) < 0.2 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1), n.name === "YZ" && Math.abs(W.copy(Ue).applyQuaternion(e).dot(this.eye)) < 0.2 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1), n.name === "XZ" && Math.abs(W.copy($t).applyQuaternion(e).dot(this.eye)) < 0.2 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1)) : this.mode === "rotate" && (ps.copy(e), W.copy(this.eye).applyQuaternion(j.copy(e).invert()), n.name.search("E") !== -1 && n.quaternion.setFromRotationMatrix(mn.lookAt(this.eye, Tn, $t)), n.name === "X" && (j.setFromAxisAngle(Ue, Math.atan2(-W.y, W.z)), j.multiplyQuaternions(ps, j), n.quaternion.copy(j)), n.name === "Y" && (j.setFromAxisAngle($t, Math.atan2(W.x, W.z)), j.multiplyQuaternions(ps, j), n.quaternion.copy(j)), n.name === "Z" && (j.setFromAxisAngle(xe, Math.atan2(W.y, W.x)), j.multiplyQuaternions(ps, j), n.quaternion.copy(j))), 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(a) {
5263
5265
  return n.name === a;
5264
5266
  })) && (n.material.color.setHex(16776960), n.material.opacity = 1);
5265
5267
  }
5266
5268
  super.updateMatrixWorld(s);
5267
5269
  }
5268
5270
  }
5269
- class xr extends v {
5271
+ class br extends v {
5270
5272
  constructor() {
5271
5273
  super(
5272
- new Kn(1e5, 1e5, 2, 2),
5273
- new Ln({ visible: !1, wireframe: !0, side: Pn, transparent: !0, opacity: 0.1, toneMapped: !1 })
5274
+ new to(1e5, 1e5, 2, 2),
5275
+ new wn({ visible: !1, wireframe: !0, side: yn, transparent: !0, opacity: 0.1, toneMapped: !1 })
5274
5276
  ), this.isTransformControlsPlane = !0, this.type = "TransformControlsPlane";
5275
5277
  }
5276
5278
  updateMatrixWorld(s) {
@@ -5307,10 +5309,10 @@ class xr extends v {
5307
5309
  default:
5308
5310
  _t.set(0, 0, 0);
5309
5311
  }
5310
- _t.length() === 0 ? this.quaternion.copy(this.cameraQuaternion) : (Tn.lookAt(nt.set(0, 0, 0), _t, W), this.quaternion.setFromRotationMatrix(Tn)), super.updateMatrixWorld(s);
5312
+ _t.length() === 0 ? this.quaternion.copy(this.cameraQuaternion) : (Rn.lookAt(nt.set(0, 0, 0), _t, W), this.quaternion.setFromRotationMatrix(Rn)), super.updateMatrixWorld(s);
5311
5313
  }
5312
5314
  }
5313
- class Ni {
5315
+ class Pi {
5314
5316
  constructor(s, t, e, i, o, n = 5, r = !0) {
5315
5317
  /** Event that fires when the user starts dragging a clipping plane. */
5316
5318
  I(this, "onDraggingStarted", new D());
@@ -5345,7 +5347,7 @@ class Ni {
5345
5347
  });
5346
5348
  if (this.components = s, this.world = t, !t.renderer)
5347
5349
  throw new Error("The given world must have a renderer!");
5348
- this.normal = i, this.origin = e, t.renderer.setPlane(!0, this.three), this._planeMesh = Ni.newPlaneMesh(n, o), this._helper = this.newHelper(), this._controls = this.newTransformControls(), this.three.setFromNormalAndCoplanarPoint(i, e), r && this.toggleControls(!0);
5350
+ this.normal = i, this.origin = e, t.renderer.setPlane(!0, this.three), this._planeMesh = Pi.newPlaneMesh(n, o), this._helper = this.newHelper(), this._controls = this.newTransformControls(), this.three.setFromNormalAndCoplanarPoint(i, e), r && this.toggleControls(!0);
5349
5351
  }
5350
5352
  get enabled() {
5351
5353
  return this._enabled;
@@ -5410,7 +5412,7 @@ class Ni {
5410
5412
  newTransformControls() {
5411
5413
  if (!this.world.renderer)
5412
5414
  throw new Error("No renderer found for clipping plane!");
5413
- const s = this.world.camera.three, t = this.world.renderer.three.domElement, e = new Pr(s, t);
5415
+ const s = this.world.camera.three, t = this.world.renderer.three.domElement, e = new Lr(s, t);
5414
5416
  return this.initializeControls(e), this.world.scene.three.add(e), e;
5415
5417
  }
5416
5418
  initializeControls(s) {
@@ -5464,7 +5466,7 @@ const Be = class Be extends J {
5464
5466
  * has to be `true` for this to apply.
5465
5467
  */
5466
5468
  I(this, "toleranceOrthogonalY", 0.7);
5467
- I(this, "Type", Ni);
5469
+ I(this, "Type", Pi);
5468
5470
  I(this, "list", []);
5469
5471
  /** The material used in all the clipping planes. */
5470
5472
  I(this, "_material", new g.MeshBasicMaterial({
@@ -5624,7 +5626,7 @@ const Be = class Be extends J {
5624
5626
  return o.onDraggingStarted.add(this._onStartDragging), o.onDraggingEnded.add(this._onEndDragging), this.list.push(o), this.onAfterCreate.trigger(o), o;
5625
5627
  }
5626
5628
  updateMaterialsAndPlanes() {
5627
- const t = this.components.get(pi);
5629
+ const t = this.components.get(Ci);
5628
5630
  for (const [e, i] of t.list) {
5629
5631
  if (!i.renderer)
5630
5632
  continue;
@@ -5640,8 +5642,8 @@ const Be = class Be extends J {
5640
5642
  }
5641
5643
  };
5642
5644
  I(Be, "uuid", "66290bc5-18c4-4cd1-9379-2e17a0617611");
5643
- let mn = Be;
5644
- function br(l, s, t, e) {
5645
+ let An = Be;
5646
+ function vr(l, s, t, e) {
5645
5647
  return new Promise((i, o) => {
5646
5648
  function n() {
5647
5649
  const r = l.clientWaitSync(s, t, 0);
@@ -5658,15 +5660,15 @@ function br(l, s, t, e) {
5658
5660
  n();
5659
5661
  });
5660
5662
  }
5661
- async function vr(l, s, t, e, i, o, n) {
5663
+ async function Br(l, s, t, e, i, o, n) {
5662
5664
  const r = l.fenceSync(l.SYNC_GPU_COMMANDS_COMPLETE, 0);
5663
- l.flush(), await br(l, r, 0, 10), l.deleteSync(r), l.bindBuffer(s, t), l.getBufferSubData(s, e, i, o, n), l.bindBuffer(s, null);
5665
+ l.flush(), await vr(l, r, 0, 10), l.deleteSync(r), l.bindBuffer(s, t), l.getBufferSubData(s, e, i, o, n), l.bindBuffer(s, null);
5664
5666
  }
5665
- async function Br(l, s, t, e, i, o, n, r) {
5667
+ async function Yr(l, s, t, e, i, o, n, r) {
5666
5668
  const a = l.createBuffer();
5667
- return l.bindBuffer(l.PIXEL_PACK_BUFFER, a), l.bufferData(l.PIXEL_PACK_BUFFER, r.byteLength, l.STREAM_READ), l.readPixels(s, t, e, i, o, n, 0), l.bindBuffer(l.PIXEL_PACK_BUFFER, null), await vr(l, l.PIXEL_PACK_BUFFER, a, 0, r), l.deleteBuffer(a), r;
5669
+ return l.bindBuffer(l.PIXEL_PACK_BUFFER, a), l.bufferData(l.PIXEL_PACK_BUFFER, r.byteLength, l.STREAM_READ), l.readPixels(s, t, e, i, o, n, 0), l.bindBuffer(l.PIXEL_PACK_BUFFER, null), await Br(l, l.PIXEL_PACK_BUFFER, a, 0, r), l.deleteBuffer(a), r;
5668
5670
  }
5669
- class Yr {
5671
+ class Vr {
5670
5672
  constructor(s, t, e) {
5671
5673
  /** {@link Disposable.onDisposed} */
5672
5674
  I(this, "onDisposed", new D());
@@ -5716,7 +5718,7 @@ class Yr {
5716
5718
  const t = this.world.camera.three;
5717
5719
  t.updateMatrix(), this.renderer.setSize(this._width, this._height), this.renderer.setRenderTarget(this.renderTarget), this.renderer.render(this.scene, t);
5718
5720
  const e = this.renderer.getContext();
5719
- await Br(
5721
+ await Yr(
5720
5722
  e,
5721
5723
  0,
5722
5724
  0,
@@ -5788,7 +5790,7 @@ class Yr {
5788
5790
  s && (s.updateInterval !== void 0 && (this.updateInterval = s.updateInterval), s.height !== void 0 && (this._height = s.height), s.width !== void 0 && (this._width = s.width), s.autoUpdate !== void 0 && (this.autoUpdate = s.autoUpdate));
5789
5791
  }
5790
5792
  }
5791
- class Vr extends Yr {
5793
+ class Gr extends Vr {
5792
5794
  constructor(t, e, i) {
5793
5795
  super(t, e, i);
5794
5796
  /* Pixels in screen a geometry must occupy to be considered "seen". */
@@ -5853,13 +5855,13 @@ class Vr extends Yr {
5853
5855
  let d = !0;
5854
5856
  const h = [];
5855
5857
  for (const u of o)
5856
- sn.isTransparent(u) ? h.push(this._transparentMat) : (d = !1, h.push(n));
5858
+ nn.isTransparent(u) ? h.push(this._transparentMat) : (d = !1, h.push(n));
5857
5859
  if (d) {
5858
5860
  n.dispose(), this.isProcessing = !1;
5859
5861
  return;
5860
5862
  }
5861
5863
  a = h;
5862
- } else if (sn.isTransparent(o)) {
5864
+ } else if (nn.isTransparent(o)) {
5863
5865
  n.dispose(), this.isProcessing = !1;
5864
5866
  return;
5865
5867
  } else
@@ -5945,7 +5947,7 @@ const Ye = class Ye extends J {
5945
5947
  create(t, e) {
5946
5948
  if (this.list.has(t.uuid))
5947
5949
  return this.list.get(t.uuid);
5948
- const i = new Vr(this.components, t, e);
5950
+ const i = new Gr(this.components, t, e);
5949
5951
  return this.list.set(t.uuid, i), i;
5950
5952
  }
5951
5953
  delete(t) {
@@ -5964,8 +5966,8 @@ const Ye = class Ye extends J {
5964
5966
  * A unique identifier for the Cullers component.
5965
5967
  */
5966
5968
  I(Ye, "uuid", "69f2a50d-c266-44fc-b1bd-fa4d34be89e6");
5967
- let Ci = Ye;
5968
- class Gr {
5969
+ let Ti = Ye;
5970
+ class zr {
5969
5971
  constructor(s) {
5970
5972
  /** {@link Disposable.onDisposed} */
5971
5973
  I(this, "onDisposed", new D());
@@ -6055,7 +6057,7 @@ class Gr {
6055
6057
  this._camera.left = e * t / -2, this._camera.right = e * t / 2, this._camera.top = e / 2, this._camera.bottom = -e / 2, this._camera.updateProjectionMatrix(), this.onResize.trigger(s);
6056
6058
  }
6057
6059
  }
6058
- const Ss = class Ss extends J {
6060
+ const _s = class _s extends J {
6059
6061
  constructor(t) {
6060
6062
  super(t);
6061
6063
  I(this, "onAfterUpdate", new D());
@@ -6063,12 +6065,12 @@ const Ss = class Ss extends J {
6063
6065
  I(this, "onDisposed", new D());
6064
6066
  I(this, "enabled", !0);
6065
6067
  I(this, "list", /* @__PURE__ */ new Map());
6066
- this.components.add(Ss.uuid, this);
6068
+ this.components.add(_s.uuid, this);
6067
6069
  }
6068
6070
  create(t) {
6069
6071
  if (this.list.has(t.uuid))
6070
6072
  throw new Error("This world already has a minimap!");
6071
- const e = new Gr(t);
6073
+ const e = new zr(t);
6072
6074
  return this.list.set(t.uuid, e), e;
6073
6075
  }
6074
6076
  delete(t) {
@@ -6085,9 +6087,9 @@ const Ss = class Ss extends J {
6085
6087
  e.update();
6086
6088
  }
6087
6089
  };
6088
- I(Ss, "uuid", "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f");
6089
- let Rn = Ss;
6090
- class zr {
6090
+ I(_s, "uuid", "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f");
6091
+ let Fn = _s;
6092
+ class Hr {
6091
6093
  constructor(s) {
6092
6094
  /** {@link NavigationMode.enabled} */
6093
6095
  I(this, "enabled", !1);
@@ -6114,7 +6116,7 @@ class zr {
6114
6116
  ), s.truckSpeed = 50, s.mouseButtons.wheel = ot.ACTION.DOLLY, s.touches.two = ot.ACTION.TOUCH_ZOOM_TRUCK;
6115
6117
  }
6116
6118
  }
6117
- class Hr {
6119
+ class kr {
6118
6120
  constructor(s) {
6119
6121
  /** {@link NavigationMode.enabled} */
6120
6122
  I(this, "enabled", !0);
@@ -6137,7 +6139,7 @@ class Hr {
6137
6139
  s.moveTo(n.x, n.y, n.z);
6138
6140
  }
6139
6141
  }
6140
- class kr {
6142
+ class Wr {
6141
6143
  constructor(s) {
6142
6144
  /** {@link NavigationMode.enabled} */
6143
6145
  I(this, "enabled", !1);
@@ -6157,7 +6159,7 @@ class kr {
6157
6159
  t.azimuthRotateSpeed = s ? 0 : this.defaultAzimuthSpeed, t.polarRotateSpeed = s ? 0 : this.defaultPolarSpeed, this.mouseInitialized || (this.mouseAction1 = t.touches.one, this.mouseAction2 = t.touches.two, this.mouseInitialized = !0), s ? (t.mouseButtons.left = ot.ACTION.TRUCK, t.touches.one = ot.ACTION.TOUCH_TRUCK, t.touches.two = ot.ACTION.TOUCH_ZOOM) : (t.mouseButtons.left = ot.ACTION.ROTATE, t.touches.one = this.mouseAction1, t.touches.two = this.mouseAction2);
6158
6160
  }
6159
6161
  }
6160
- class Wr {
6162
+ class Xr {
6161
6163
  constructor(s) {
6162
6164
  /**
6163
6165
  * Event that fires when the {@link CameraProjection} changes.
@@ -6224,7 +6226,7 @@ class Wr {
6224
6226
  s.position.copy(t.position), s.quaternion.copy(t.quaternion), this._component.controls.mouseButtons.wheel = ot.ACTION.DOLLY, this.matchOrthoDistanceEnabled ? this._component.controls.distance = this.getDistance() : this._component.controls.distance = this._previousDistance, await this._component.controls.zoomTo(1), s.updateProjectionMatrix(), this._component.controls.camera = s, this.camera = s, this.current = "Perspective";
6225
6227
  }
6226
6228
  }
6227
- class na extends ke {
6229
+ class oa extends ke {
6228
6230
  constructor(t) {
6229
6231
  super(t);
6230
6232
  /**
@@ -6238,14 +6240,14 @@ class na extends ke {
6238
6240
  I(this, "_frustumSize", 50);
6239
6241
  I(this, "_navigationModes", /* @__PURE__ */ new Map());
6240
6242
  I(this, "previousSize", null);
6241
- this.threePersp = this.three, this.threeOrtho = this.newOrthoCamera(), this.projection = new Wr(this), this.onAspectUpdated.add(() => {
6243
+ this.threePersp = this.three, this.threeOrtho = this.newOrthoCamera(), this.projection = new Xr(this), this.onAspectUpdated.add(() => {
6242
6244
  this.setOrthoPerspCameraAspect();
6243
6245
  }), this.projection.onChanged.add(
6244
6246
  (e) => {
6245
6247
  this.three = e, this.updateAspect();
6246
6248
  }
6247
6249
  ), this.onWorldChanged.add(({ action: e }) => {
6248
- e === "added" && (this._navigationModes.clear(), this._navigationModes.set("Orbit", new Hr(this)), this._navigationModes.set("FirstPerson", new zr(this)), this._navigationModes.set("Plan", new kr(this)), this._mode = this._navigationModes.get("Orbit"), this.mode.set(!0, { preventTargetAdjustment: !0 }), this.currentWorld && this.currentWorld.renderer && (this.previousSize = this.currentWorld.renderer.getSize().clone()));
6250
+ e === "added" && (this._navigationModes.clear(), this._navigationModes.set("Orbit", new kr(this)), this._navigationModes.set("FirstPerson", new Hr(this)), this._navigationModes.set("Plan", new Wr(this)), this._mode = this._navigationModes.get("Orbit"), this.mode.set(!0, { preventTargetAdjustment: !0 }), this.currentWorld && this.currentWorld.renderer && (this.previousSize = this.currentWorld.renderer.getSize().clone()));
6249
6251
  });
6250
6252
  }
6251
6253
  get mode() {
@@ -6416,8 +6418,8 @@ const At = class At extends J {
6416
6418
  }
6417
6419
  };
6418
6420
  I(At, "uuid", "d1444724-dba6-4cdd-a0c7-68ee1450d166");
6419
- let An = At;
6420
- const Pi = /* @__PURE__ */ new Set([
6421
+ let On = At;
6422
+ const Li = /* @__PURE__ */ new Set([
6421
6423
  1123145078,
6422
6424
  574549367,
6423
6425
  1675464909,
@@ -6551,12 +6553,12 @@ const Pi = /* @__PURE__ */ new Set([
6551
6553
  2513912981,
6552
6554
  2830218821,
6553
6555
  427810014
6554
- ]), _s = class _s extends J {
6556
+ ]), Ns = class Ns extends J {
6555
6557
  constructor(t) {
6556
6558
  super(t);
6557
6559
  /** {@link Component.enabled} */
6558
6560
  I(this, "enabled", !0);
6559
- t.add(_s.uuid, this);
6561
+ t.add(Ns.uuid, this);
6560
6562
  }
6561
6563
  /**
6562
6564
  * Exports all the properties of an IFC into an array of JS objects.
@@ -6577,7 +6579,7 @@ const Pi = /* @__PURE__ */ new Set([
6577
6579
  for (const c of a)
6578
6580
  r.add(c);
6579
6581
  for (const c of r) {
6580
- if (Pi.has(c))
6582
+ if (Li.has(c))
6581
6583
  continue;
6582
6584
  const E = a.has(c) && o, d = t.GetLineIDsWithType(e, c);
6583
6585
  for (const h of d) {
@@ -6588,9 +6590,9 @@ const Pi = /* @__PURE__ */ new Set([
6588
6590
  return n;
6589
6591
  }
6590
6592
  };
6591
- I(_s, "uuid", "b32c4332-cd67-436e-ba7f-196646c7a635");
6592
- let Ti = _s;
6593
- const Ns = class Ns extends J {
6593
+ I(Ns, "uuid", "b32c4332-cd67-436e-ba7f-196646c7a635");
6594
+ let mi = Ns;
6595
+ const Ps = class Ps extends J {
6594
6596
  constructor(t) {
6595
6597
  super(t);
6596
6598
  /** {@link Disposable.onDisposed} */
@@ -6603,8 +6605,8 @@ const Ns = class Ns extends J {
6603
6605
  /** {@link Component.enabled} */
6604
6606
  I(this, "enabled", !0);
6605
6607
  I(this, "baseCoordinationModel", "");
6606
- I(this, "_loader", new Jn());
6607
- this.components.add(Ns.uuid, this);
6608
+ I(this, "_loader", new eo());
6609
+ this.components.add(Ps.uuid, this);
6608
6610
  }
6609
6611
  /** The list of meshes of the created fragments. */
6610
6612
  get meshes() {
@@ -6668,9 +6670,9 @@ const Ns = class Ns extends J {
6668
6670
  o !== i && (o.position.set(0, 0, 0), o.rotation.set(0, 0, 0), o.scale.set(1, 1, 1), o.updateMatrix(), o.applyMatrix4(o.coordinationMatrix.clone().invert()), o.applyMatrix4(i.coordinationMatrix));
6669
6671
  }
6670
6672
  };
6671
- I(Ns, "uuid", "fef46874-46a3-461b-8c44-2922ab77c806");
6672
- let ut = Ns;
6673
- const Xr = {
6673
+ I(Ps, "uuid", "fef46874-46a3-461b-8c44-2922ab77c806");
6674
+ let ut = Ps;
6675
+ const Zr = {
6674
6676
  103090709: "IFCPROJECT",
6675
6677
  4097777520: "IFCSITE",
6676
6678
  4031249490: "IFCBUILDING",
@@ -6809,9 +6811,9 @@ const Xr = {
6809
6811
  4292641817: "IFCUNITARYEQUIPMENT",
6810
6812
  3009204131: "IFCGRID"
6811
6813
  };
6812
- class oa {
6814
+ class ra {
6813
6815
  getAll(s, t) {
6814
- const e = {}, i = Object.keys(Xr).map((o) => parseInt(o, 10));
6816
+ const e = {}, i = Object.keys(Zr).map((o) => parseInt(o, 10));
6815
6817
  for (let o = 0; o < i.length; o++) {
6816
6818
  const n = i[o], r = s.GetLineIDsWithType(t, n), a = r.size();
6817
6819
  for (let c = 0; c < a; c++)
@@ -6820,7 +6822,7 @@ class oa {
6820
6822
  return e;
6821
6823
  }
6822
6824
  }
6823
- const bn = {
6825
+ const Bn = {
6824
6826
  950732822: "IFCURIREFERENCE",
6825
6827
  4075327185: "IFCTIME",
6826
6828
  1209108979: "IFCTEMPERATURERATEOFCHANGEMEASURE",
@@ -8058,7 +8060,7 @@ class Gt {
8058
8060
  return i === null || e[i] === void 0 || e[i] === null ? o = null : o = e[i].value, { key: i, value: o };
8059
8061
  }
8060
8062
  static isRel(s) {
8061
- return bn[s].startsWith("IFCREL");
8063
+ return Bn[s].startsWith("IFCREL");
8062
8064
  }
8063
8065
  static async attributeExists(s, t, e) {
8064
8066
  const i = await s.getProperties(t);
@@ -8097,7 +8099,7 @@ class Gt {
8097
8099
  // return propertyInstance;
8098
8100
  // }
8099
8101
  }
8100
- const Zr = /* @__PURE__ */ new Map([
8102
+ const Qr = /* @__PURE__ */ new Map([
8101
8103
  [
8102
8104
  U.IFCRELAGGREGATES,
8103
8105
  {
@@ -8161,7 +8163,7 @@ const Zr = /* @__PURE__ */ new Map([
8161
8163
  I(this, "onDisposed", new D());
8162
8164
  I(this, "enabled", !0);
8163
8165
  I(this, "onRelationsIndexed", new D());
8164
- I(this, "_relToAttributesMap", Zr);
8166
+ I(this, "_relToAttributesMap", Qr);
8165
8167
  I(this, "_inverseAttributes", [
8166
8168
  "IsDecomposedBy",
8167
8169
  "Decomposes",
@@ -8406,7 +8408,7 @@ const Zr = /* @__PURE__ */ new Map([
8406
8408
  };
8407
8409
  I(Ve, "uuid", "23a889ab-83b3-44a4-8bee-ead83438370b");
8408
8410
  let We = Ve;
8409
- class Qr {
8411
+ class jr {
8410
8412
  constructor() {
8411
8413
  I(this, "factor", 1);
8412
8414
  I(this, "complement", 1);
@@ -8464,10 +8466,10 @@ class Qr {
8464
8466
  ]);
8465
8467
  }
8466
8468
  }
8467
- class vn {
8469
+ class Yn {
8468
8470
  constructor() {
8469
8471
  I(this, "itemsByFloor", {});
8470
- I(this, "_units", new Qr());
8472
+ I(this, "_units", new jr());
8471
8473
  }
8472
8474
  // TODO: Maybe make this more flexible so that it also support more exotic spatial structures?
8473
8475
  setUp(s) {
@@ -8534,7 +8536,7 @@ class vn {
8534
8536
  this.itemsByFloor = {};
8535
8537
  }
8536
8538
  }
8537
- class Li {
8539
+ class yi {
8538
8540
  constructor() {
8539
8541
  /** Whether to extract the IFC properties into a JSON. */
8540
8542
  I(this, "includeProperties", !0);
@@ -8564,7 +8566,7 @@ class Li {
8564
8566
  I(this, "customLocateFileHandler", null);
8565
8567
  }
8566
8568
  }
8567
- class Bn {
8569
+ class Vn {
8568
8570
  constructor() {
8569
8571
  I(this, "defLineMat", new g.LineBasicMaterial({ color: 16777215 }));
8570
8572
  }
@@ -8615,7 +8617,7 @@ class Bn {
8615
8617
  return e;
8616
8618
  }
8617
8619
  }
8618
- class Yn {
8620
+ class Gn {
8619
8621
  get(s, t) {
8620
8622
  let e = "";
8621
8623
  const i = s.GetHeaderLine(0, t) || "";
@@ -8638,14 +8640,14 @@ const Ge = class Ge extends J {
8638
8640
  I(this, "onSetup", new D());
8639
8641
  /** {@link Disposable.onDisposed} */
8640
8642
  I(this, "onDisposed", new D());
8641
- I(this, "settings", new Li());
8643
+ I(this, "settings", new yi());
8642
8644
  I(this, "enabled", !0);
8643
8645
  I(this, "webIfc", new U.IfcAPI());
8644
8646
  I(this, "_material", new g.MeshLambertMaterial());
8645
- I(this, "_spatialTree", new vn());
8646
- I(this, "_metaData", new Yn());
8647
+ I(this, "_spatialTree", new Yn());
8648
+ I(this, "_metaData", new Gn());
8647
8649
  I(this, "_fragmentInstances", /* @__PURE__ */ new Map());
8648
- I(this, "_civil", new Bn());
8650
+ I(this, "_civil", new Vn());
8649
8651
  I(this, "_visitedFragments", /* @__PURE__ */ new Map());
8650
8652
  I(this, "_materialT", new g.MeshLambertMaterial({
8651
8653
  transparent: !0,
@@ -8662,7 +8664,7 @@ const Ge = class Ge extends J {
8662
8664
  async load(t, e = !0) {
8663
8665
  const i = performance.now();
8664
8666
  this.onIfcStartedLoading.trigger(), await this.readIfcFile(t);
8665
- const o = await this.getAllGeometries(), r = await this.components.get(Ti).export(this.webIfc, 0);
8667
+ const o = await this.getAllGeometries(), r = await this.components.get(mi).export(this.webIfc, 0);
8666
8668
  o.setLocalProperties(r), this.cleanUp();
8667
8669
  const a = this.components.get(ut);
8668
8670
  a.groups.set(o.uuid, o);
@@ -8765,7 +8767,7 @@ const Ge = class Ge extends J {
8765
8767
  }
8766
8768
  async autoSetWasm() {
8767
8769
  const t = await fetch(
8768
- `https://unpkg.com/openbim-components@${fi.release}/package.json`
8770
+ `https://unpkg.com/openbim-components@${pi.release}/package.json`
8769
8771
  );
8770
8772
  if (!t.ok) {
8771
8773
  console.warn(
@@ -8785,7 +8787,7 @@ const Ge = class Ge extends J {
8785
8787
  }
8786
8788
  };
8787
8789
  I(Ge, "uuid", "a659add7-1418-4771-a0d6-7d4d438e4624");
8788
- let mi = Ge;
8790
+ let Ri = Ge;
8789
8791
  const Bt = class Bt extends J {
8790
8792
  constructor(t) {
8791
8793
  super(t);
@@ -8927,7 +8929,7 @@ const Bt = class Bt extends J {
8927
8929
  }
8928
8930
  }
8929
8931
  async saveToIfc(t, e) {
8930
- const i = this.components.get(mi), o = i.webIfc, n = await i.readIfcFile(e), r = this.changeMap[t.uuid] ?? [];
8932
+ const i = this.components.get(Ri), o = i.webIfc, n = await i.readIfcFile(e), r = this.changeMap[t.uuid] ?? [];
8931
8933
  for (const c of r) {
8932
8934
  const E = await t.getProperties(c);
8933
8935
  if (E)
@@ -8972,8 +8974,8 @@ const Bt = class Bt extends J {
8972
8974
  }
8973
8975
  };
8974
8976
  I(Bt, "uuid", "58c2d9f0-183c-48d6-a402-dfcf5b9a34df");
8975
- let Fn = Bt;
8976
- const Ps = class Ps extends J {
8977
+ let gn = Bt;
8978
+ const Ls = class Ls extends J {
8977
8979
  constructor(t) {
8978
8980
  super(t);
8979
8981
  /** {@link Component.enabled} */
@@ -8996,7 +8998,7 @@ const Ps = class Ps extends J {
8996
8998
  }
8997
8999
  }
8998
9000
  });
8999
- t.add(Ps.uuid, this), t.get(ut).onFragmentsDisposed.add(this.onFragmentsDisposed);
9001
+ t.add(Ls.uuid, this), t.get(ut).onFragmentsDisposed.add(this.onFragmentsDisposed);
9000
9002
  }
9001
9003
  dispose() {
9002
9004
  this.list = {}, this.components.get(ut).onFragmentsDisposed.remove(this.onFragmentsDisposed), this.onDisposed.trigger(), this.onDisposed.reset();
@@ -9086,7 +9088,7 @@ const Ps = class Ps extends J {
9086
9088
  byEntity(t) {
9087
9089
  this.list.entities || (this.list.entities = {});
9088
9090
  for (const [e, i] of t.data) {
9089
- const n = i[1][1], r = bn[n];
9091
+ const n = i[1][1], r = Bn[n];
9090
9092
  this.saveItem(t, "entities", r, e);
9091
9093
  }
9092
9094
  }
@@ -9172,9 +9174,9 @@ const Ps = class Ps extends J {
9172
9174
  }
9173
9175
  }
9174
9176
  };
9175
- I(Ps, "uuid", "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7");
9176
- let Ri = Ps;
9177
- const Ls = class Ls extends J {
9177
+ I(Ls, "uuid", "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7");
9178
+ let Ai = Ls;
9179
+ const ys = class ys extends J {
9178
9180
  constructor(t) {
9179
9181
  super(t);
9180
9182
  I(this, "enabled", !0);
@@ -9183,7 +9185,7 @@ const Ls = class Ls extends J {
9183
9185
  /** {@link Disposable.onDisposed} */
9184
9186
  I(this, "onDisposed", new D());
9185
9187
  I(this, "list", /* @__PURE__ */ new Set());
9186
- t.add(Ls.uuid, this);
9188
+ t.add(ys.uuid, this);
9187
9189
  }
9188
9190
  dispose() {
9189
9191
  this.list.clear(), this.onDisposed.trigger(), this.onDisposed.reset();
@@ -9191,7 +9193,7 @@ const Ls = class Ls extends J {
9191
9193
  set(t) {
9192
9194
  if (!this.enabled)
9193
9195
  return;
9194
- const e = this.components.get(Ri), i = this.components.get(ut), o = t ? 1 : -1;
9196
+ const e = this.components.get(Ai), i = this.components.get(ut), o = t ? 1 : -1;
9195
9197
  let n = 0;
9196
9198
  const r = e.list[this.groupName], a = new g.Matrix4();
9197
9199
  for (const c in r) {
@@ -9208,13 +9210,13 @@ const Ls = class Ls extends J {
9208
9210
  }
9209
9211
  }
9210
9212
  };
9211
- I(Ls, "uuid", "d260618b-ce88-4c7d-826c-6debb91de3e2");
9212
- let On = Ls;
9213
- const ys = class ys extends J {
9213
+ I(ys, "uuid", "d260618b-ce88-4c7d-826c-6debb91de3e2");
9214
+ let Sn = ys;
9215
+ const ws = class ws extends J {
9214
9216
  constructor(t) {
9215
9217
  super(t);
9216
9218
  I(this, "enabled", !0);
9217
- this.components.add(ys.uuid, this);
9219
+ this.components.add(ws.uuid, this);
9218
9220
  }
9219
9221
  set(t, e) {
9220
9222
  const i = this.components.get(ut);
@@ -9234,29 +9236,29 @@ const ys = class ys extends J {
9234
9236
  this.set(!1), this.set(!0, t);
9235
9237
  }
9236
9238
  updateCulledVisibility(t) {
9237
- const e = this.components.get(Ci);
9239
+ const e = this.components.get(Ti);
9238
9240
  for (const [i, o] of e.list) {
9239
9241
  const n = o.colorMeshes.get(t.id);
9240
9242
  n && (n.count = t.mesh.count);
9241
9243
  }
9242
9244
  }
9243
9245
  };
9244
- I(ys, "uuid", "dd9ccf2d-8a21-4821-b7f6-2949add16a29");
9245
- let gn = ys;
9246
- class jr extends Li {
9246
+ I(ws, "uuid", "dd9ccf2d-8a21-4821-b7f6-2949add16a29");
9247
+ let _n = ws;
9248
+ class qr extends yi {
9247
9249
  constructor() {
9248
9250
  super(...arguments);
9249
9251
  I(this, "minGeometrySize", 10);
9250
9252
  I(this, "minAssetsSize", 1e3);
9251
9253
  }
9252
9254
  }
9253
- class Vn extends Li {
9255
+ class zn extends yi {
9254
9256
  constructor() {
9255
9257
  super(...arguments);
9256
9258
  I(this, "propertiesSize", 100);
9257
9259
  }
9258
9260
  }
9259
- class qr extends J {
9261
+ class $r extends J {
9260
9262
  constructor() {
9261
9263
  super(...arguments);
9262
9264
  I(this, "onPropertiesStreamed", new Kt());
@@ -9265,7 +9267,7 @@ class qr extends J {
9265
9267
  /** {@link Disposable.onDisposed} */
9266
9268
  I(this, "onDisposed", new D());
9267
9269
  I(this, "enabled", !0);
9268
- I(this, "settings", new Vn());
9270
+ I(this, "settings", new zn());
9269
9271
  I(this, "webIfc", new U.IfcAPI());
9270
9272
  }
9271
9273
  async dispose() {
@@ -9306,7 +9308,7 @@ class qr extends J {
9306
9308
  e.add(E);
9307
9309
  let r = 0.01, a = 0;
9308
9310
  for (const E of e) {
9309
- if (a++, Pi.has(E))
9311
+ if (a++, Li.has(E))
9310
9312
  continue;
9311
9313
  const d = n.has(E), h = this.webIfc.GetLineIDsWithType(0, E), u = h.size();
9312
9314
  let p = 0;
@@ -9370,8 +9372,8 @@ class qr extends J {
9370
9372
  this.webIfc = null, this.webIfc = new U.IfcAPI();
9371
9373
  }
9372
9374
  }
9373
- I(qr, "uuid", "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b");
9374
- const ws = class ws extends J {
9375
+ I($r, "uuid", "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b");
9376
+ const Ms = class Ms extends J {
9375
9377
  constructor(t) {
9376
9378
  super(t);
9377
9379
  I(this, "onGeometryStreamed", new D());
@@ -9380,20 +9382,20 @@ const ws = class ws extends J {
9380
9382
  I(this, "onIfcLoaded", new D());
9381
9383
  /** {@link Disposable.onDisposed} */
9382
9384
  I(this, "onDisposed", new D());
9383
- I(this, "settings", new jr());
9385
+ I(this, "settings", new qr());
9384
9386
  I(this, "enabled", !0);
9385
9387
  I(this, "webIfc", new U.IfcAPI());
9386
- I(this, "_spatialTree", new vn());
9387
- I(this, "_metaData", new Yn());
9388
+ I(this, "_spatialTree", new Yn());
9389
+ I(this, "_metaData", new Gn());
9388
9390
  I(this, "_visitedGeometries", /* @__PURE__ */ new Map());
9389
9391
  I(this, "_streamSerializer", new Vt.StreamSerializer());
9390
9392
  I(this, "_geometries", /* @__PURE__ */ new Map());
9391
9393
  I(this, "_geometryCount", 0);
9392
- I(this, "_civil", new Bn());
9394
+ I(this, "_civil", new Vn());
9393
9395
  I(this, "_groupSerializer", new Vt.Serializer());
9394
9396
  I(this, "_assets", []);
9395
9397
  I(this, "_meshesWithHoles", /* @__PURE__ */ new Set());
9396
- this.components.add(ws.uuid, this), this.settings.excludedCategories.add(U.IFCOPENINGELEMENT);
9398
+ this.components.add(Ms.uuid, this), this.settings.excludedCategories.add(U.IFCOPENINGELEMENT);
9397
9399
  }
9398
9400
  dispose() {
9399
9401
  this.onIfcLoaded.reset(), this.onGeometryStreamed.reset(), this.onAssetStreamed.reset(), this.webIfc = null, this.onDisposed.trigger(), this.onDisposed.reset();
@@ -9495,11 +9497,11 @@ const ws = class ws extends J {
9495
9497
  ), r = new Float32Array(n.length / 2), a = new Float32Array(n.length / 2);
9496
9498
  for (let u = 0; u < n.length; u += 6)
9497
9499
  r[u / 2] = n[u], r[u / 2 + 1] = n[u + 1], r[u / 2 + 2] = n[u + 2], a[u / 2] = n[u + 3], a[u / 2 + 1] = n[u + 4], a[u / 2 + 2] = n[u + 5];
9498
- const c = Cr(r), E = new Float32Array(c.transformation.elements), d = [c.center.x, c.center.y, c.center.z];
9500
+ const c = mr(r), E = new Float32Array(c.transformation.elements), d = [c.center.x, c.center.y, c.center.z];
9499
9501
  let h = !1;
9500
9502
  for (let u = 0; u < r.length - 2; u += 3) {
9501
9503
  const p = r[u], A = r[u + 1], R = r[u + 2], C = a[u], T = a[u + 1], F = a[u + 2];
9502
- if (Tr(d, [p, A, R], [C, T, F])) {
9504
+ if (Rr(d, [p, A, R], [C, T, F])) {
9503
9505
  h = !0;
9504
9506
  break;
9505
9507
  }
@@ -9522,9 +9524,9 @@ const ws = class ws extends J {
9522
9524
  this.onGeometryStreamed.trigger({ data: e, buffer: t }), e = null, t = null, this._geometries.clear(), this._geometryCount = 0;
9523
9525
  }
9524
9526
  };
9525
- I(ws, "uuid", "d9999a00-e1f5-4d3f-8cfe-c56e08609764");
9526
- let Sn = ws;
9527
- class $r extends J {
9527
+ I(Ms, "uuid", "d9999a00-e1f5-4d3f-8cfe-c56e08609764");
9528
+ let Nn = Ms;
9529
+ class Kr extends J {
9528
9530
  constructor() {
9529
9531
  super(...arguments);
9530
9532
  I(this, "onPropertiesStreamed", new Kt());
@@ -9533,7 +9535,7 @@ class $r extends J {
9533
9535
  /** {@link Disposable.onDisposed} */
9534
9536
  I(this, "onDisposed", new D());
9535
9537
  I(this, "enabled", !0);
9536
- I(this, "settings", new Vn());
9538
+ I(this, "settings", new zn());
9537
9539
  I(this, "webIfc", new U.IfcAPI());
9538
9540
  }
9539
9541
  async dispose() {
@@ -9567,7 +9569,7 @@ class $r extends J {
9567
9569
  e.add(c);
9568
9570
  let o = 0.01, n = 0;
9569
9571
  for (const c of e) {
9570
- if (n++, Pi.has(c))
9572
+ if (n++, Li.has(c))
9571
9573
  continue;
9572
9574
  const E = i.has(c), d = this.webIfc.GetLineIDsWithType(0, c), h = d.size();
9573
9575
  let u = 0;
@@ -9608,12 +9610,12 @@ class $r extends J {
9608
9610
  this.webIfc = null, this.webIfc = new U.IfcAPI();
9609
9611
  }
9610
9612
  }
9611
- I($r, "uuid", "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b");
9612
- const Ms = class Ms extends J {
9613
+ I(Kr, "uuid", "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b");
9614
+ const Ds = class Ds extends J {
9613
9615
  constructor(t) {
9614
9616
  super(t);
9615
9617
  I(this, "enabled", !0);
9616
- t.add(Ms.uuid, this);
9618
+ t.add(Ds.uuid, this);
9617
9619
  }
9618
9620
  getFace(t, e, i) {
9619
9621
  if (!t.geometry.index)
@@ -9739,60 +9741,60 @@ const Ms = class Ms extends J {
9739
9741
  t.x = Math.trunc(t.x * 1e3) / 1e3, t.y = Math.trunc(t.y * 1e3) / 1e3, t.z = Math.trunc(t.z * 1e3) / 1e3;
9740
9742
  }
9741
9743
  };
9742
- I(Ms, "uuid", "267ca032-672f-4cb0-afa9-d24e904f39d6");
9743
- let _n = Ms;
9744
+ I(Ds, "uuid", "267ca032-672f-4cb0-afa9-d24e904f39d6");
9745
+ let Pn = Ds;
9744
9746
  export {
9745
9747
  Kt as AsyncEvent,
9746
- Si as Base,
9747
- rr as BaseCamera,
9748
- ar as BaseRenderer,
9749
- cr as BaseScene,
9750
- _i as BaseWorldItem,
9751
- An as BoundingBoxer,
9752
- Ri as Classifier,
9753
- mn as Clipper,
9748
+ _i as Base,
9749
+ cr as BaseCamera,
9750
+ lr as BaseRenderer,
9751
+ hr as BaseScene,
9752
+ Ni as BaseWorldItem,
9753
+ On as BoundingBoxer,
9754
+ Ai as Classifier,
9755
+ An as Clipper,
9754
9756
  J as Component,
9755
- fi as Components,
9756
- Yr as CullerRenderer,
9757
- Ci as Cullers,
9757
+ pi as Components,
9758
+ Vr as CullerRenderer,
9759
+ Ti as Cullers,
9758
9760
  Ht as Disposer,
9759
9761
  D as Event,
9760
- On as Exploder,
9761
- zr as FirstPersonMode,
9762
- qr as FragmentPropsStreamConverter,
9762
+ Sn as Exploder,
9763
+ Hr as FirstPersonMode,
9764
+ $r as FragmentPropsStreamConverter,
9763
9765
  ut as FragmentsManager,
9764
- Nr as Grids,
9765
- gn as Hider,
9766
- oa as IfcCategories,
9767
- bn as IfcCategoryMap,
9768
- Xr as IfcElements,
9769
- Sn as IfcGeometryTiler,
9770
- Ti as IfcJsonExporter,
9771
- mi as IfcLoader,
9772
- Fn as IfcPropertiesManager,
9773
- $r as IfcPropertiesTiler,
9766
+ un as Grids,
9767
+ _n as Hider,
9768
+ ra as IfcCategories,
9769
+ Bn as IfcCategoryMap,
9770
+ Zr as IfcElements,
9771
+ Nn as IfcGeometryTiler,
9772
+ mi as IfcJsonExporter,
9773
+ Ri as IfcLoader,
9774
+ gn as IfcPropertiesManager,
9775
+ Kr as IfcPropertiesTiler,
9774
9776
  Gt as IfcPropertiesUtils,
9775
9777
  We as IfcRelationsIndexer,
9776
- jr as IfcStreamingSettings,
9777
- sn as MaterialsUtils,
9778
- _n as MeasurementUtils,
9779
- Vr as MeshCullerRenderer,
9780
- Rn as MiniMaps,
9781
- Hr as OrbitMode,
9782
- na as OrthoPerspectiveCamera,
9783
- kr as PlanMode,
9784
- Wr as ProjectionManager,
9785
- Vn as PropertiesStreamingSettings,
9778
+ qr as IfcStreamingSettings,
9779
+ nn as MaterialsUtils,
9780
+ Pn as MeasurementUtils,
9781
+ Gr as MeshCullerRenderer,
9782
+ Fn as MiniMaps,
9783
+ kr as OrbitMode,
9784
+ oa as OrthoPerspectiveCamera,
9785
+ Wr as PlanMode,
9786
+ Xr as ProjectionManager,
9787
+ zn as PropertiesStreamingSettings,
9786
9788
  He as Raycasters,
9787
9789
  ke as SimpleCamera,
9788
- Ni as SimplePlane,
9789
- ia as SimpleRenderer,
9790
- sa as SimpleScene,
9791
- Ar as SimpleWorld,
9790
+ Pi as SimplePlane,
9791
+ na as SimpleRenderer,
9792
+ ia as SimpleScene,
9793
+ Or as SimpleWorld,
9792
9794
  ze as UUID,
9793
- ea as VertexPicker,
9794
- pi as Worlds,
9795
- Tr as isPointInFrontOfPlane,
9796
- Cr as obbFromPoints,
9797
- Br as readPixelsAsync
9795
+ sa as VertexPicker,
9796
+ Ci as Worlds,
9797
+ Rr as isPointInFrontOfPlane,
9798
+ mr as obbFromPoints,
9799
+ Yr as readPixelsAsync
9798
9800
  };