@thatopen/components 2.1.5 → 2.1.6

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,8 +1,8 @@
1
1
  var kn = Object.defineProperty;
2
2
  var Wn = (l, s, t) => s in l ? kn(l, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[s] = t;
3
3
  var I = (l, s, t) => (Wn(l, typeof s != "symbol" ? s + "" : s, t), t);
4
- import * as g from "three";
5
- import { BufferAttribute as Pn, Vector3 as M, Vector2 as fe, Plane as Fi, Line3 as Lt, Triangle as ue, Sphere as Xn, Matrix4 as yt, Box3 as Ot, BackSide as Zn, DoubleSide as Ln, FrontSide as wi, Mesh as v, Ray as Qn, Raycaster as jn, Quaternion as Pt, Object3D as ri, Euler as qn, MeshBasicMaterial as yn, LineBasicMaterial as Kn, CylinderGeometry as ct, BoxGeometry as rt, BufferGeometry as Di, Float32BufferAttribute as Ui, OctahedronGeometry as Ze, Line as Dt, SphereGeometry as $n, TorusGeometry as me, PlaneGeometry as Jn } from "three";
4
+ import * as O from "three";
5
+ import { BufferAttribute as Pn, Vector3 as M, Vector2 as fe, Plane as Fi, Line3 as yt, Triangle as ue, Sphere as Xn, Matrix4 as Lt, Box3 as gt, BackSide as Zn, DoubleSide as yn, FrontSide as wi, Mesh as v, Ray as Qn, Raycaster as jn, Quaternion as Pt, Object3D as ri, Euler as qn, MeshBasicMaterial as Ln, LineBasicMaterial as Kn, CylinderGeometry as ct, BoxGeometry as rt, BufferGeometry as Di, Float32BufferAttribute as Ui, OctahedronGeometry as Ze, Line as Dt, SphereGeometry as $n, TorusGeometry as Re, PlaneGeometry as Jn } from "three";
6
6
  import * as Vt from "@thatopen/fragments";
7
7
  import { Serializer as to } from "@thatopen/fragments";
8
8
  import * as b from "web-ifc";
@@ -10,7 +10,7 @@ const Mn = 0, eo = 1, so = 2, xi = 2, Ys = 1.25, bi = 1, Cs = 6 * 4 + 4 + 4, Us
10
10
  function no(l) {
11
11
  return l.index ? l.index.count : l.attributes.position.count;
12
12
  }
13
- function pe(l) {
13
+ function Ce(l) {
14
14
  return no(l) / 3;
15
15
  }
16
16
  function oo(l, s = ArrayBuffer) {
@@ -25,7 +25,7 @@ function ro(l, s) {
25
25
  }
26
26
  }
27
27
  function wn(l) {
28
- const s = pe(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;
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)
@@ -52,7 +52,7 @@ function Dn(l) {
52
52
  function ao(l) {
53
53
  if (l.groups.length === 0)
54
54
  return !1;
55
- const s = pe(l), t = Dn(l).sort((o, n) => o.offset - n.offset), e = t[t.length - 1];
55
+ const s = Ce(l), t = Dn(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;
@@ -87,7 +87,7 @@ function Qe(l, s, t) {
87
87
  n < t[e] && (t[e] = n), r > t[e + 3] && (t[e + 3] = r);
88
88
  }
89
89
  }
90
- function Re(l) {
90
+ 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
  }
@@ -95,12 +95,12 @@ 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, h = -1 / 0, d = 1 / 0, E = 1 / 0, u = 1 / 0, f = -1 / 0, R = -1 / 0, m = -1 / 0;
96
96
  const C = i !== null;
97
97
  for (let A = s * 6, F = (s + t) * 6; A < F; A += 6) {
98
- const p = l[A + 0], T = l[A + 1], O = p - T, _ = p + T;
99
- O < o && (o = O), _ > a && (a = _), C && p < d && (d = p), C && p > f && (f = p);
100
- const S = l[A + 2], N = l[A + 3], L = S - N, w = S + N;
101
- L < n && (n = L), w > c && (c = w), C && S < E && (E = S), C && S > R && (R = S);
102
- const y = l[A + 4], U = l[A + 5], x = y - U, B = y + U;
103
- x < r && (r = x), B > h && (h = B), C && y < u && (u = y), C && y > m && (m = y);
98
+ const p = l[A + 0], T = l[A + 1], g = p - T, _ = p + T;
99
+ g < o && (o = g), _ > a && (a = _), C && p < d && (d = p), C && p > f && (f = p);
100
+ const S = l[A + 2], N = l[A + 3], y = S - N, w = S + N;
101
+ y < n && (n = y), w > c && (c = w), C && S < E && (E = S), C && S > R && (R = S);
102
+ const L = l[A + 4], U = l[A + 5], x = L - U, B = L + U;
103
+ x < r && (r = x), B > h && (h = B), C && L < u && (u = L), C && L > m && (m = L);
104
104
  }
105
105
  e[0] = o, e[1] = n, e[2] = r, e[3] = a, e[4] = c, e[5] = h, C && (i[0] = d, i[1] = E, i[2] = u, i[3] = f, i[4] = R, i[5] = m);
106
106
  }
@@ -118,7 +118,7 @@ function lo(l, s, t, e) {
118
118
  }
119
119
  function ho(l, s) {
120
120
  co(s);
121
- const t = l.attributes.position, e = l.index ? l.index.array : null, i = pe(l), o = new Float32Array(i * 6), n = t.normalized, r = t.array, a = t.offset || 0;
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);
124
124
  const h = ["getX", "getY", "getZ"];
@@ -131,10 +131,10 @@ function ho(l, s) {
131
131
  n ? (A = t[h[C]](f), F = t[h[C]](R), p = t[h[C]](m)) : (A = r[f + C], F = r[R + C], p = r[m + C]);
132
132
  let T = A;
133
133
  F < T && (T = F), p < T && (T = p);
134
- let O = A;
135
- F > O && (O = F), p > O && (O = p);
136
- const _ = (O - T) / 2, S = C * 2;
137
- o[u + S + 0] = T + _, o[u + S + 1] = _ + (Math.abs(T) + _) * io, T < s[C] && (s[C] = T), O > s[C + 3] && (s[C + 3] = O);
134
+ let g = A;
135
+ F > g && (g = F), p > g && (g = p);
136
+ const _ = (g - T) / 2, S = C * 2;
137
+ o[u + S + 0] = T + _, o[u + S + 1] = _ + (Math.abs(T) + _) * io, T < s[C] && (s[C] = T), g > s[C + 3] && (s[C + 3] = g);
138
138
  }
139
139
  }
140
140
  return o;
@@ -153,7 +153,7 @@ function uo(l, s, t, e, i, o) {
153
153
  else if (o === eo)
154
154
  n = vi(l), n !== -1 && (r = Io(t, e, i, n));
155
155
  else if (o === so) {
156
- const a = Re(l);
156
+ const a = Ae(l);
157
157
  let c = Ys * i;
158
158
  const h = e * 6, d = (e + i) * 6;
159
159
  for (let E = 0; E < 3; E++) {
@@ -166,13 +166,13 @@ function uo(l, s, t, e, i, o) {
166
166
  const T = C[A];
167
167
  T.candidate = t[p + 2 * E], T.count = 0;
168
168
  const {
169
- bounds: O,
169
+ bounds: g,
170
170
  leftCacheBounds: _,
171
171
  rightCacheBounds: S
172
172
  } = T;
173
173
  for (let N = 0; N < 3; N++)
174
- S[N] = 1 / 0, S[N + 3] = -1 / 0, _[N] = 1 / 0, _[N + 3] = -1 / 0, O[N] = 1 / 0, O[N + 3] = -1 / 0;
175
- Qe(p, t, O);
174
+ S[N] = 1 / 0, S[N + 3] = -1 / 0, _[N] = 1 / 0, _[N + 3] = -1 / 0, g[N] = 1 / 0, g[N + 3] = -1 / 0;
175
+ Qe(p, t, g);
176
176
  }
177
177
  C.sort(Eo);
178
178
  let F = i;
@@ -183,32 +183,32 @@ function uo(l, s, t, e, i, o) {
183
183
  }
184
184
  for (let p = h; p < d; p += 6) {
185
185
  const T = t[p + 2 * E];
186
- for (let O = 0; O < F; O++) {
187
- const _ = C[O];
186
+ for (let g = 0; g < F; g++) {
187
+ const _ = C[g];
188
188
  T >= _.candidate ? Qe(p, t, _.rightCacheBounds) : (Qe(p, t, _.leftCacheBounds), _.count++);
189
189
  }
190
190
  }
191
191
  for (let p = 0; p < F; p++) {
192
- const T = C[p], O = T.count, _ = i - T.count, S = T.leftCacheBounds, N = T.rightCacheBounds;
193
- let L = 0;
194
- O !== 0 && (L = Re(S) / a);
192
+ const T = C[p], g = T.count, _ = i - T.count, S = T.leftCacheBounds, N = T.rightCacheBounds;
193
+ let y = 0;
194
+ g !== 0 && (y = Ae(S) / a);
195
195
  let w = 0;
196
- _ !== 0 && (w = Re(N) / a);
197
- const y = bi + Ys * (L * O + w * _);
198
- y < c && (n = E, c = y, r = T.candidate);
196
+ _ !== 0 && (w = Ae(N) / a);
197
+ const L = bi + Ys * (y * g + w * _);
198
+ L < c && (n = E, c = L, r = T.candidate);
199
199
  }
200
200
  } else {
201
201
  for (let F = 0; F < Mt; F++) {
202
202
  const p = Ut[F];
203
203
  p.count = 0, p.candidate = u + m + F * m;
204
204
  const T = p.bounds;
205
- for (let O = 0; O < 3; O++)
206
- T[O] = 1 / 0, T[O + 3] = -1 / 0;
205
+ for (let g = 0; g < 3; g++)
206
+ T[g] = 1 / 0, T[g + 3] = -1 / 0;
207
207
  }
208
208
  for (let F = h; F < d; F += 6) {
209
- let O = ~~((t[F + 2 * E] - u) / m);
210
- O >= Mt && (O = Mt - 1);
211
- const _ = Ut[O];
209
+ let g = ~~((t[F + 2 * E] - u) / m);
210
+ g >= Mt && (g = Mt - 1);
211
+ const _ = Ut[g];
212
212
  _.count++, Qe(F, t, _.bounds);
213
213
  }
214
214
  const C = Ut[Mt - 1];
@@ -219,14 +219,14 @@ function uo(l, s, t, e, i, o) {
219
219
  }
220
220
  let A = 0;
221
221
  for (let F = 0; F < Mt - 1; F++) {
222
- const p = Ut[F], T = p.count, O = p.bounds, S = Ut[F + 1].rightCacheBounds;
223
- T !== 0 && (A === 0 ? Bi(O, je) : Yi(O, je, je)), A += T;
224
- let N = 0, L = 0;
225
- A !== 0 && (N = Re(je) / a);
222
+ const p = Ut[F], T = p.count, g = p.bounds, S = Ut[F + 1].rightCacheBounds;
223
+ T !== 0 && (A === 0 ? Bi(g, je) : Yi(g, je, je)), A += T;
224
+ let N = 0, y = 0;
225
+ A !== 0 && (N = Ae(je) / a);
226
226
  const w = i - A;
227
- w !== 0 && (L = Re(S) / a);
228
- const y = bi + Ys * (N * A + L * w);
229
- y < c && (n = E, c = y, r = p.candidate);
227
+ w !== 0 && (y = Ae(S) / a);
228
+ const L = bi + Ys * (N * A + y * w);
229
+ L < c && (n = E, c = L, r = p.candidate);
230
230
  }
231
231
  }
232
232
  }
@@ -293,7 +293,7 @@ function Co(l, s) {
293
293
  return n;
294
294
  }
295
295
  function To(l, s) {
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 = pe(t), h = l._indirectBuffer;
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), h = l._indirectBuffer;
297
297
  let d = !1;
298
298
  const E = new Float32Array(6), u = new Float32Array(6), f = ho(t, E), R = s.indirect ? po : fo, m = [], C = s.indirect ? wn(t) : Dn(t);
299
299
  if (C.length === 1) {
@@ -308,20 +308,20 @@ function To(l, s) {
308
308
  function A(p) {
309
309
  a && a(p / c);
310
310
  }
311
- function F(p, T, O, _ = null, S = 0) {
312
- if (!d && S >= i && (d = !0, o && (console.warn(`MeshBVH: Max depth of ${i} reached when generating BVH. Consider increasing maxDepth.`), console.warn(t))), O <= n || S >= i)
313
- return A(T + O), p.offset = T, p.count = O, p;
314
- const N = uo(p.boundingData, _, f, T, O, r);
311
+ function F(p, T, g, _ = null, S = 0) {
312
+ if (!d && S >= i && (d = !0, o && (console.warn(`MeshBVH: Max depth of ${i} reached when generating BVH. Consider increasing maxDepth.`), console.warn(t))), g <= n || S >= i)
313
+ return A(T + g), p.offset = T, p.count = g, p;
314
+ const N = uo(p.boundingData, _, f, T, g, r);
315
315
  if (N.axis === -1)
316
- return A(T + O), p.offset = T, p.count = O, p;
317
- const L = R(h, e, f, T, O, N);
318
- if (L === T || L === T + O)
319
- A(T + O), p.offset = T, p.count = O;
316
+ return A(T + g), p.offset = T, p.count = g, p;
317
+ const y = R(h, e, f, T, g, N);
318
+ if (y === T || y === T + g)
319
+ A(T + g), p.offset = T, p.count = g;
320
320
  else {
321
321
  p.splitAxis = N.axis;
322
- const w = new qe(), y = T, U = L - T;
323
- p.left = w, w.boundingData = new Float32Array(6), Gs(f, y, U, w.boundingData, u), F(w, y, U, u, S + 1);
324
- const x = new qe(), B = L, H = O - U;
322
+ const w = new qe(), L = T, U = y - T;
323
+ p.left = w, w.boundingData = new Float32Array(6), Gs(f, L, U, w.boundingData, u), F(w, L, U, u, S + 1);
324
+ const x = new qe(), B = y, H = g - U;
325
325
  p.right = x, x.boundingData = new Float32Array(6), Gs(f, B, H, x.boundingData, u), F(x, B, H, u, S + 1);
326
326
  }
327
327
  return p;
@@ -410,7 +410,7 @@ const Ro = function() {
410
410
  let C, A;
411
411
  m !== 0 ? C = (d * E - f * u) / m : C = 0, A = (d + C * E) / u, n.x = C, n.y = A;
412
412
  };
413
- }(), Oi = function() {
413
+ }(), gi = function() {
414
414
  const l = new fe(), s = new M(), t = new M();
415
415
  return function(i, o, n, r) {
416
416
  Ro(i, o, l);
@@ -440,7 +440,7 @@ const Ro = function() {
440
440
  }
441
441
  };
442
442
  }(), Ao = function() {
443
- const l = new M(), s = new M(), t = new Fi(), e = new Lt();
443
+ const l = new M(), s = new M(), t = new Fi(), e = new yt();
444
444
  return function(o, n) {
445
445
  const { radius: r, center: a } = o, { a: c, b: h, c: d } = n;
446
446
  if (e.start = c, e.end = h, e.closestPointToPoint(a, !0, l).distanceTo(a) <= r || (e.start = c, e.end = d, e.closestPointToPoint(a, !0, l).distanceTo(a) <= r) || (e.start = h, e.end = d, e.closestPointToPoint(a, !0, l).distanceTo(a) <= r))
@@ -476,32 +476,32 @@ class Ft extends ue {
476
476
  }
477
477
  }
478
478
  Ft.prototype.closestPointToSegment = function() {
479
- const l = new M(), s = new M(), t = new Lt();
479
+ const l = new M(), s = new M(), t = new yt();
480
480
  return function(i, o = null, n = null) {
481
481
  const { start: r, end: a } = i, c = this.points;
482
482
  let h, d = 1 / 0;
483
483
  for (let E = 0; E < 3; E++) {
484
484
  const u = (E + 1) % 3;
485
- t.start.copy(c[E]), t.end.copy(c[u]), Oi(t, i, l, s), h = l.distanceToSquared(s), h < d && (d = h, o && o.copy(l), n && n.copy(s));
485
+ t.start.copy(c[E]), t.end.copy(c[u]), gi(t, i, l, s), h = l.distanceToSquared(s), h < d && (d = h, o && o.copy(l), n && n.copy(s));
486
486
  }
487
487
  return this.closestPointToPoint(r, l), h = r.distanceToSquared(l), h < d && (d = h, o && o.copy(l), n && n.copy(r)), this.closestPointToPoint(a, l), h = a.distanceToSquared(l), h < d && (d = h, o && o.copy(l), n && n.copy(a)), Math.sqrt(d);
488
488
  };
489
489
  }();
490
490
  Ft.prototype.intersectsTriangle = function() {
491
- const l = new Ft(), s = new Array(3), t = new Array(3), e = new wt(), i = new wt(), o = new M(), n = new M(), r = new M(), a = new M(), c = new M(), h = new Lt(), d = new Lt(), E = new Lt(), u = new M();
491
+ const l = new Ft(), s = new Array(3), t = new Array(3), e = new wt(), i = new wt(), o = new M(), n = new M(), r = new M(), a = new M(), c = new M(), h = new yt(), d = new yt(), E = new yt(), u = new M();
492
492
  function f(R, m, C) {
493
493
  const A = R.points;
494
494
  let F = 0, p = -1;
495
495
  for (let T = 0; T < 3; T++) {
496
- const { start: O, end: _ } = h;
497
- O.copy(A[T]), _.copy(A[(T + 1) % 3]), h.delta(n);
498
- const S = zs(m.distanceToPoint(O));
496
+ const { start: g, end: _ } = h;
497
+ g.copy(A[T]), _.copy(A[(T + 1) % 3]), h.delta(n);
498
+ const S = zs(m.distanceToPoint(g));
499
499
  if (zs(m.normal.dot(n)) && S) {
500
500
  C.copy(h), F = 2;
501
501
  break;
502
502
  }
503
503
  const N = m.intersectLine(h, u);
504
- if (!N && S && u.copy(O), (N || S) && !zs(u.distanceTo(_))) {
504
+ if (!N && S && u.copy(g), (N || S) && !zs(u.distanceTo(_))) {
505
505
  if (F <= 1)
506
506
  (F === 1 ? C.start : C.end).copy(u), S && (p = F);
507
507
  else if (F >= 2) {
@@ -518,25 +518,25 @@ Ft.prototype.intersectsTriangle = function() {
518
518
  this.needsUpdate && this.update(), m.isExtendedTriangle ? m.needsUpdate && m.update() : (l.copy(m), l.update(), m = l);
519
519
  const F = this.plane, p = m.plane;
520
520
  if (Math.abs(F.normal.dot(p.normal)) > 1 - 1e-10) {
521
- const T = this.satBounds, O = this.satAxes;
521
+ const T = this.satBounds, g = this.satAxes;
522
522
  t[0] = m.a, t[1] = m.b, t[2] = m.c;
523
523
  for (let N = 0; N < 4; N++) {
524
- const L = T[N], w = O[N];
525
- if (e.setFromPoints(w, t), L.isSeparated(e))
524
+ const y = T[N], w = g[N];
525
+ if (e.setFromPoints(w, t), y.isSeparated(e))
526
526
  return !1;
527
527
  }
528
528
  const _ = m.satBounds, S = m.satAxes;
529
529
  s[0] = this.a, s[1] = this.b, s[2] = this.c;
530
530
  for (let N = 0; N < 4; N++) {
531
- const L = _[N], w = S[N];
532
- if (e.setFromPoints(w, s), L.isSeparated(e))
531
+ const y = _[N], w = S[N];
532
+ if (e.setFromPoints(w, s), y.isSeparated(e))
533
533
  return !1;
534
534
  }
535
535
  for (let N = 0; N < 4; N++) {
536
- const L = O[N];
536
+ const y = g[N];
537
537
  for (let w = 0; w < 4; w++) {
538
- const y = S[w];
539
- if (o.crossVectors(L, y), e.setFromPoints(o, s), i.setFromPoints(o, t), e.isSeparated(i))
538
+ const L = S[w];
539
+ if (o.crossVectors(y, L), e.setFromPoints(o, s), i.setFromPoints(o, t), e.isSeparated(i))
540
540
  return !1;
541
541
  }
542
542
  }
@@ -547,17 +547,17 @@ Ft.prototype.intersectsTriangle = function() {
547
547
  return C && (C.start.copy(d.end), C.end.copy(d.end)), !0;
548
548
  if (T !== 2)
549
549
  return !1;
550
- const O = f(m, F, E);
551
- if (O === 1 && this.containsPoint(E.end))
550
+ const g = f(m, F, E);
551
+ if (g === 1 && this.containsPoint(E.end))
552
552
  return C && (C.start.copy(E.end), C.end.copy(E.end)), !0;
553
- if (O !== 2)
553
+ if (g !== 2)
554
554
  return !1;
555
555
  if (d.delta(r), E.delta(a), r.dot(a) < 0) {
556
556
  let U = E.start;
557
557
  E.start = E.end, E.end = U;
558
558
  }
559
- const _ = d.start.dot(r), S = d.end.dot(r), N = E.start.dot(r), L = E.end.dot(r), w = S < N, y = _ < L;
560
- return _ !== L && N !== S && w === y ? !1 : (C && (c.subVectors(d.start, E.start), c.dot(r) > 0 ? C.start.copy(d.start) : C.start.copy(E.start), c.subVectors(d.end, E.end), c.dot(r) < 0 ? C.end.copy(d.end) : C.end.copy(E.end)), !0);
559
+ const _ = d.start.dot(r), S = d.end.dot(r), N = E.start.dot(r), y = E.end.dot(r), w = S < N, L = _ < y;
560
+ return _ !== y && N !== S && w === L ? !1 : (C && (c.subVectors(d.start, E.start), c.dot(r) > 0 ? C.start.copy(d.start) : C.start.copy(E.start), c.subVectors(d.end, E.end), c.dot(r) < 0 ? C.end.copy(d.end) : C.end.copy(E.end)), !0);
561
561
  }
562
562
  };
563
563
  }();
@@ -568,7 +568,7 @@ Ft.prototype.distanceToPoint = function() {
568
568
  };
569
569
  }();
570
570
  Ft.prototype.distanceToTriangle = function() {
571
- const l = new M(), s = new M(), t = ["a", "b", "c"], e = new Lt(), i = new Lt();
571
+ const l = new M(), s = new M(), t = ["a", "b", "c"], e = new yt(), i = new yt();
572
572
  return function(n, r = null, a = null) {
573
573
  const c = r || a ? e : null;
574
574
  if (this.intersectsTriangle(n, c))
@@ -586,7 +586,7 @@ Ft.prototype.distanceToTriangle = function() {
586
586
  e.set(this[E], this[u]);
587
587
  for (let f = 0; f < 3; f++) {
588
588
  const R = t[f], m = t[(f + 1) % 3];
589
- i.set(n[R], n[m]), Oi(e, i, l, s);
589
+ i.set(n[R], n[m]), gi(e, i, l, s);
590
590
  const C = l.distanceToSquared(s);
591
591
  C < h && (h = C, r && r.copy(l), a && a.copy(s));
592
592
  }
@@ -596,7 +596,7 @@ Ft.prototype.distanceToTriangle = function() {
596
596
  }();
597
597
  class at {
598
598
  constructor(s, t, e) {
599
- this.isOrientedBox = !0, this.min = new M(), this.max = new M(), this.matrix = new yt(), this.invMatrix = new yt(), this.points = new Array(8).fill().map(() => new M()), this.satAxes = new Array(3).fill().map(() => new M()), this.satBounds = new Array(3).fill().map(() => new wt()), this.alignedSatBounds = new Array(3).fill().map(() => new wt()), this.needsUpdate = !1, s && this.min.copy(s), t && this.max.copy(t), e && this.matrix.copy(e);
599
+ this.isOrientedBox = !0, this.min = new M(), this.max = new M(), this.matrix = new Lt(), this.invMatrix = new Lt(), this.points = new Array(8).fill().map(() => new M()), this.satAxes = new Array(3).fill().map(() => new M()), this.satBounds = new Array(3).fill().map(() => new wt()), this.alignedSatBounds = new Array(3).fill().map(() => new wt()), this.needsUpdate = !1, s && this.min.copy(s), t && this.max.copy(t), e && this.matrix.copy(e);
600
600
  }
601
601
  set(s, t, e) {
602
602
  this.min.copy(s), this.max.copy(t), this.matrix.copy(e), this.needsUpdate = !0;
@@ -678,7 +678,7 @@ at.prototype.distanceToPoint = function() {
678
678
  };
679
679
  }();
680
680
  at.prototype.distanceToBox = function() {
681
- const l = ["x", "y", "z"], s = new Array(12).fill().map(() => new Lt()), t = new Array(12).fill().map(() => new Lt()), e = new M(), i = new M();
681
+ const l = ["x", "y", "z"], s = new Array(12).fill().map(() => new yt()), t = new Array(12).fill().map(() => new yt()), e = new M(), i = new M();
682
682
  return function(n, r = 0, a = null, c = null) {
683
683
  if (this.needsUpdate && this.update(), this.intersectsBox(n))
684
684
  return (a || c) && (n.getCenter(i), this.closestPointToPoint(i, e), n.closestPointToPoint(e, i), a && a.copy(e), c && c.copy(i)), 0;
@@ -695,10 +695,10 @@ at.prototype.distanceToBox = function() {
695
695
  for (let m = 0; m < 3; m++)
696
696
  for (let C = 0; C <= 1; C++)
697
697
  for (let A = 0; A <= 1; A++) {
698
- const F = (m + 1) % 3, p = (m + 2) % 3, T = C << F | A << p, O = 1 << m | C << F | A << p, _ = u[T], S = u[O];
698
+ const F = (m + 1) % 3, p = (m + 2) % 3, T = C << F | A << p, g = 1 << m | C << F | A << p, _ = u[T], S = u[g];
699
699
  s[R].set(_, S);
700
- const L = l[m], w = l[F], y = l[p], U = t[R], x = U.start, B = U.end;
701
- x[L] = d[L], x[w] = C ? d[w] : E[w], x[y] = A ? d[y] : E[w], B[L] = E[L], B[w] = C ? d[w] : E[w], B[y] = A ? d[y] : E[w], R++;
700
+ const y = l[m], w = l[F], L = l[p], U = t[R], x = U.start, B = U.end;
701
+ x[y] = d[y], x[w] = C ? d[w] : E[w], x[L] = A ? d[L] : E[w], B[y] = E[y], B[w] = C ? d[w] : E[w], B[L] = A ? d[L] : E[w], R++;
702
702
  }
703
703
  for (let m = 0; m <= 1; m++)
704
704
  for (let C = 0; C <= 1; C++)
@@ -712,7 +712,7 @@ at.prototype.distanceToBox = function() {
712
712
  const C = s[m];
713
713
  for (let A = 0; A < 12; A++) {
714
714
  const F = t[A];
715
- Oi(C, F, e, i);
715
+ gi(C, F, e, i);
716
716
  const p = e.distanceToSquared(i);
717
717
  if (p < f && (f = p, a && a.copy(e), c && c.copy(i), p < h))
718
718
  return Math.sqrt(p);
@@ -721,7 +721,7 @@ at.prototype.distanceToBox = function() {
721
721
  return Math.sqrt(f);
722
722
  };
723
723
  }();
724
- class gi {
724
+ class Oi {
725
725
  constructor(s) {
726
726
  this._getNewPrimitive = s, this._primitives = [];
727
727
  }
@@ -733,12 +733,12 @@ class gi {
733
733
  this._primitives.push(s);
734
734
  }
735
735
  }
736
- class Oo extends gi {
736
+ class go extends Oi {
737
737
  constructor() {
738
738
  super(() => new Ft());
739
739
  }
740
740
  }
741
- const It = /* @__PURE__ */ new Oo();
741
+ const It = /* @__PURE__ */ new go();
742
742
  function Et(l, s) {
743
743
  return s[l + 15] === 65535;
744
744
  }
@@ -757,7 +757,7 @@ function Ct(l, s) {
757
757
  function Un(l, s) {
758
758
  return s[l + 7];
759
759
  }
760
- class go {
760
+ class Oo {
761
761
  constructor() {
762
762
  this.float32Array = null, this.uint16Array = null, this.uint32Array = null;
763
763
  const s = [];
@@ -769,9 +769,9 @@ class go {
769
769
  };
770
770
  }
771
771
  }
772
- const Z = new go();
772
+ const Z = new Oo();
773
773
  let Yt, Ie;
774
- const Jt = [], Ke = /* @__PURE__ */ new gi(() => new Ot());
774
+ const Jt = [], Ke = /* @__PURE__ */ new Oi(() => new gt());
775
775
  function _o(l, s, t, e, i, o) {
776
776
  Yt = Ke.getPrimitive(), Ie = Ke.getPrimitive(), Jt.push(Yt, Ie), Z.setBuffer(l._roots[s]);
777
777
  const n = ai(0, l.geometry, t, e, i, o);
@@ -786,34 +786,34 @@ function ai(l, s, t, e, i = null, o = 0, n = 0) {
786
786
  const E = dt(l, c), u = ft(h, a);
787
787
  return K(l, r, Yt), e(E, u, !1, n, o + l, Yt);
788
788
  } else {
789
- let L = function(y) {
789
+ let y = function(L) {
790
790
  const { uint16Array: U, uint32Array: x } = Z;
791
- let B = y * 2;
791
+ let B = L * 2;
792
792
  for (; !Et(B, U); )
793
- y = pt(y), B = y * 2;
794
- return dt(y, x);
795
- }, w = function(y) {
793
+ L = pt(L), B = L * 2;
794
+ return dt(L, x);
795
+ }, w = function(L) {
796
796
  const { uint16Array: U, uint32Array: x } = Z;
797
- let B = y * 2;
797
+ let B = L * 2;
798
798
  for (; !Et(B, U); )
799
- y = Ct(y, x), B = y * 2;
800
- return dt(y, x) + ft(B, U);
799
+ L = Ct(L, x), B = L * 2;
800
+ return dt(L, x) + ft(B, U);
801
801
  };
802
802
  const E = pt(l), u = Ct(l, c);
803
803
  let f = E, R = u, m, C, A, F;
804
804
  if (i && (A = Yt, F = Ie, K(f, r, A), K(R, r, F), m = i(A), C = i(F), C < m)) {
805
805
  f = u, R = E;
806
- const y = m;
807
- m = C, C = y, A = F;
806
+ const L = m;
807
+ m = C, C = L, A = F;
808
808
  }
809
809
  A || (A = Yt, K(f, r, A));
810
810
  const p = Et(f * 2, a), T = t(A, p, m, n + 1, o + f);
811
- let O;
811
+ let g;
812
812
  if (T === xi) {
813
- const y = L(f), x = w(f) - y;
814
- O = e(y, x, !0, n + 1, o + f, A);
813
+ const L = y(f), x = w(f) - L;
814
+ g = e(L, x, !0, n + 1, o + f, A);
815
815
  } else
816
- O = T && ai(
816
+ g = T && ai(
817
817
  f,
818
818
  s,
819
819
  t,
@@ -822,14 +822,14 @@ function ai(l, s, t, e, i = null, o = 0, n = 0) {
822
822
  o,
823
823
  n + 1
824
824
  );
825
- if (O)
825
+ if (g)
826
826
  return !0;
827
827
  F = Ie, K(R, r, F);
828
828
  const _ = Et(R * 2, a), S = t(F, _, C, n + 1, o + R);
829
829
  let N;
830
830
  if (S === xi) {
831
- const y = L(R), x = w(R) - y;
832
- N = e(y, x, !0, n + 1, o + R, F);
831
+ const L = y(R), x = w(R) - L;
832
+ N = e(L, x, !0, n + 1, o + R, F);
833
833
  } else
834
834
  N = S && ai(
835
835
  R,
@@ -843,18 +843,18 @@ function ai(l, s, t, e, i = null, o = 0, n = 0) {
843
843
  return !!N;
844
844
  }
845
845
  }
846
- const Ae = /* @__PURE__ */ new M(), Hs = /* @__PURE__ */ new M();
846
+ const Fe = /* @__PURE__ */ new M(), Hs = /* @__PURE__ */ new M();
847
847
  function So(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(
851
851
  {
852
- boundsTraverseOrder: (h) => (Ae.copy(s).clamp(h.min, h.max), Ae.distanceToSquared(s)),
852
+ boundsTraverseOrder: (h) => (Fe.copy(s).clamp(h.min, h.max), Fe.distanceToSquared(s)),
853
853
  intersectsBounds: (h, d, E) => E < r && E < n,
854
854
  intersectsTriangle: (h, d) => {
855
- h.closestPointToPoint(s, Ae);
856
- const E = s.distanceToSquared(Ae);
857
- return E < r && (Hs.copy(Ae), r = E, a = d), E < o;
855
+ h.closestPointToPoint(s, Fe);
856
+ const E = s.distanceToSquared(Fe);
857
+ return E < r && (Hs.copy(Fe), r = E, a = d), E < o;
858
858
  }
859
859
  }
860
860
  ), r === 1 / 0)
@@ -865,7 +865,7 @@ function So(l, s, t = {}, e = 0, i = 1 / 0) {
865
865
  const te = /* @__PURE__ */ new M(), ee = /* @__PURE__ */ new M(), se = /* @__PURE__ */ new M(), $e = /* @__PURE__ */ new fe(), Je = /* @__PURE__ */ new fe(), ts = /* @__PURE__ */ new fe(), Vi = /* @__PURE__ */ new M(), Gi = /* @__PURE__ */ new M(), zi = /* @__PURE__ */ new M(), es = /* @__PURE__ */ new M();
866
866
  function No(l, s, t, e, i, o) {
867
867
  let n;
868
- return o === Zn ? n = l.intersectTriangle(e, t, s, !0, i) : n = l.intersectTriangle(s, t, e, o !== Ln, i), n === null ? null : {
868
+ return o === Zn ? 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
  };
@@ -899,12 +899,12 @@ function tt(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 Lo(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
905
  xs(n, s, t, a, o);
906
906
  }
907
- function yo(l, s, t, e, i) {
907
+ function Lo(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, h = e + i; c < h; c++) {
@@ -933,33 +933,33 @@ function wo(l, s = null) {
933
933
  const R = E * 2;
934
934
  if (r[R + 15] === Us) {
935
935
  const C = n[E + 6], A = r[R + 14];
936
- let F = 1 / 0, p = 1 / 0, T = 1 / 0, O = -1 / 0, _ = -1 / 0, S = -1 / 0;
937
- for (let N = 3 * C, L = 3 * (C + A); N < L; N++) {
936
+ let F = 1 / 0, p = 1 / 0, T = 1 / 0, g = -1 / 0, _ = -1 / 0, S = -1 / 0;
937
+ for (let N = 3 * C, y = 3 * (C + A); N < y; N++) {
938
938
  let w = e[N];
939
- const y = i.getX(w), U = i.getY(w), x = i.getZ(w);
940
- y < F && (F = y), y > O && (O = y), U < p && (p = U), U > _ && (_ = U), x < T && (T = x), x > S && (S = x);
939
+ const L = i.getX(w), U = i.getY(w), x = i.getZ(w);
940
+ L < F && (F = L), L > g && (g = L), U < p && (p = U), U > _ && (_ = U), x < T && (T = x), x > S && (S = x);
941
941
  }
942
- return a[E + 0] !== F || a[E + 1] !== p || a[E + 2] !== T || a[E + 3] !== O || a[E + 4] !== _ || a[E + 5] !== S ? (a[E + 0] = F, a[E + 1] = p, a[E + 2] = T, a[E + 3] = O, a[E + 4] = _, a[E + 5] = S, !0) : !1;
942
+ return a[E + 0] !== F || a[E + 1] !== p || a[E + 2] !== T || a[E + 3] !== g || a[E + 4] !== _ || a[E + 5] !== S ? (a[E + 0] = F, a[E + 1] = p, a[E + 2] = T, a[E + 3] = g, a[E + 4] = _, a[E + 5] = S, !0) : !1;
943
943
  } else {
944
944
  const C = E + 8, A = n[E + 6], F = C + u, p = A + u;
945
- let T = f, O = !1, _ = !1;
946
- s ? T || (O = s.has(F), _ = s.has(p), T = !O && !_) : (O = !0, _ = !0);
947
- const S = T || O, N = T || _;
948
- let L = !1;
949
- S && (L = d(C, u, T));
945
+ let T = f, g = !1, _ = !1;
946
+ s ? T || (g = s.has(F), _ = s.has(p), T = !g && !_) : (g = !0, _ = !0);
947
+ const S = T || g, N = T || _;
948
+ let y = !1;
949
+ S && (y = d(C, u, T));
950
950
  let w = !1;
951
951
  N && (w = d(A, u, T));
952
- const y = L || w;
953
- if (y)
952
+ const L = y || w;
953
+ if (L)
954
954
  for (let U = 0; U < 3; U++) {
955
955
  const x = C + U, B = A + U, H = a[x], q = a[x + 3], st = a[B], Q = a[B + 3];
956
956
  a[E + U] = H < st ? H : st, a[E + U + 3] = q > Q ? q : Q;
957
957
  }
958
- return y;
958
+ return L;
959
959
  }
960
960
  }
961
961
  }
962
- const Hi = /* @__PURE__ */ new Ot();
962
+ const Hi = /* @__PURE__ */ new gt();
963
963
  function Gt(l, s, t, e) {
964
964
  return K(l, s, Hi), t.intersectBox(Hi, e);
965
965
  }
@@ -996,7 +996,7 @@ function ci(l, s, t, e, i) {
996
996
  const { float32Array: o, uint16Array: n, uint32Array: r } = Z, a = l * 2;
997
997
  if (Et(a, n)) {
998
998
  const h = dt(l, r), d = ft(a, n);
999
- Lo(s, t, e, h, d, i);
999
+ yo(s, t, e, h, d, i);
1000
1000
  } else {
1001
1001
  const h = pt(l);
1002
1002
  Gt(h, o, e, ki) && ci(h, s, t, e, i);
@@ -1015,7 +1015,7 @@ function li(l, s, t, e) {
1015
1015
  let r = l * 2;
1016
1016
  if (Et(r, o)) {
1017
1017
  const c = dt(l, n), h = ft(r, o);
1018
- return yo(s, t, e, c, h);
1018
+ return Lo(s, t, e, c, h);
1019
1019
  } else {
1020
1020
  const c = Un(l, n), h = vo[c], E = e.direction[h] >= 0;
1021
1021
  let u, f;
@@ -1033,7 +1033,7 @@ function li(l, s, t, e) {
1033
1033
  return m && A ? m.distance <= A.distance ? m : A : m || A || null;
1034
1034
  }
1035
1035
  }
1036
- const ss = /* @__PURE__ */ new Ot(), ie = /* @__PURE__ */ new Ft(), ne = /* @__PURE__ */ new Ft(), Fe = /* @__PURE__ */ new yt(), Xi = /* @__PURE__ */ new at(), is = /* @__PURE__ */ new at();
1036
+ const ss = /* @__PURE__ */ new gt(), ie = /* @__PURE__ */ new Ft(), ne = /* @__PURE__ */ new Ft(), ge = /* @__PURE__ */ new Lt(), Xi = /* @__PURE__ */ new at(), is = /* @__PURE__ */ new at();
1037
1037
  function Yo(l, s, t, e) {
1038
1038
  Z.setBuffer(l._roots[s]);
1039
1039
  const i = hi(0, l, t, e);
@@ -1044,8 +1044,8 @@ function hi(l, s, t, e, i = null) {
1044
1044
  let a = l * 2;
1045
1045
  if (i === null && (t.boundingBox || t.computeBoundingBox(), Xi.set(t.boundingBox.min, t.boundingBox.max, e), i = Xi), Et(a, n)) {
1046
1046
  const h = s.geometry, d = h.index, E = h.attributes.position, u = t.index, f = t.attributes.position, R = dt(l, r), m = ft(a, n);
1047
- if (Fe.copy(e).invert(), t.boundsTree)
1048
- return K(l, o, is), is.matrix.copy(Fe), is.needsUpdate = !0, t.boundsTree.shapecast({
1047
+ if (ge.copy(e).invert(), t.boundsTree)
1048
+ return K(l, o, is), is.matrix.copy(ge), is.needsUpdate = !0, t.boundsTree.shapecast({
1049
1049
  intersectsBounds: (A) => is.intersectsBox(A),
1050
1050
  intersectsTriangle: (A) => {
1051
1051
  A.a.applyMatrix4(e), A.b.applyMatrix4(e), A.c.applyMatrix4(e), A.needsUpdate = !0;
@@ -1056,7 +1056,7 @@ function hi(l, s, t, e, i = null) {
1056
1056
  }
1057
1057
  });
1058
1058
  for (let C = R * 3, A = (m + R) * 3; C < A; C += 3) {
1059
- tt(ie, C, d, E), ie.a.applyMatrix4(Fe), ie.b.applyMatrix4(Fe), ie.c.applyMatrix4(Fe), ie.needsUpdate = !0;
1059
+ tt(ie, C, d, E), ie.a.applyMatrix4(ge), ie.b.applyMatrix4(ge), ie.c.applyMatrix4(ge), ie.needsUpdate = !0;
1060
1060
  for (let F = 0, p = u.count; F < p; F += 3)
1061
1061
  if (tt(ne, F, u, f), ne.needsUpdate = !0, ie.intersectsTriangle(ne))
1062
1062
  return !0;
@@ -1066,7 +1066,7 @@ function hi(l, s, t, e, i = null) {
1066
1066
  return K(h, o, ss), !!(i.intersectsBox(ss) && hi(h, s, t, e, i) || (K(d, o, ss), i.intersectsBox(ss) && hi(d, s, t, e, i)));
1067
1067
  }
1068
1068
  }
1069
- const ns = /* @__PURE__ */ new yt(), ks = /* @__PURE__ */ new at(), Oe = /* @__PURE__ */ new at(), Vo = /* @__PURE__ */ new M(), Go = /* @__PURE__ */ new M(), zo = /* @__PURE__ */ new M(), Ho = /* @__PURE__ */ new M();
1069
+ const ns = /* @__PURE__ */ new Lt(), ks = /* @__PURE__ */ new at(), Oe = /* @__PURE__ */ new at(), Vo = /* @__PURE__ */ new M(), Go = /* @__PURE__ */ new M(), zo = /* @__PURE__ */ new M(), Ho = /* @__PURE__ */ new M();
1070
1070
  function ko(l, s, t, e = {}, i = {}, o = 0, n = 1 / 0) {
1071
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, h = s.attributes.position, d = s.index, E = It.getPrimitive(), u = It.getPrimitive();
@@ -1076,32 +1076,32 @@ function ko(l, s, t, e = {}, i = {}, o = 0, n = 1 / 0) {
1076
1076
  return ns.copy(t).invert(), Oe.matrix.copy(ns), l.shapecast(
1077
1077
  {
1078
1078
  boundsTraverseOrder: (T) => ks.distanceToBox(T),
1079
- intersectsBounds: (T, O, _) => _ < A && _ < n ? (O && (Oe.min.copy(T.min), Oe.max.copy(T.max), Oe.needsUpdate = !0), !0) : !1,
1080
- intersectsRange: (T, O) => {
1079
+ intersectsBounds: (T, g, _) => _ < A && _ < n ? (g && (Oe.min.copy(T.min), Oe.max.copy(T.max), Oe.needsUpdate = !0), !0) : !1,
1080
+ intersectsRange: (T, g) => {
1081
1081
  if (s.boundsTree)
1082
1082
  return s.boundsTree.shapecast({
1083
1083
  boundsTraverseOrder: (S) => Oe.distanceToBox(S),
1084
- intersectsBounds: (S, N, L) => L < A && L < n,
1084
+ intersectsBounds: (S, N, y) => y < A && y < n,
1085
1085
  intersectsRange: (S, N) => {
1086
- for (let L = S, w = S + N; L < w; L++) {
1087
- tt(u, 3 * L, d, h), u.a.applyMatrix4(t), u.b.applyMatrix4(t), u.c.applyMatrix4(t), u.needsUpdate = !0;
1088
- for (let y = T, U = T + O; y < U; y++) {
1089
- tt(E, 3 * y, c, a), E.needsUpdate = !0;
1086
+ for (let y = S, w = S + N; y < w; y++) {
1087
+ tt(u, 3 * y, d, h), u.a.applyMatrix4(t), u.b.applyMatrix4(t), u.c.applyMatrix4(t), u.needsUpdate = !0;
1088
+ for (let L = T, U = T + g; L < U; L++) {
1089
+ tt(E, 3 * L, c, a), E.needsUpdate = !0;
1090
1090
  const x = E.distanceToTriangle(u, f, m);
1091
- if (x < A && (R.copy(f), C && C.copy(m), A = x, F = y, p = L), x < o)
1091
+ if (x < A && (R.copy(f), C && C.copy(m), A = x, F = L, p = y), x < o)
1092
1092
  return !0;
1093
1093
  }
1094
1094
  }
1095
1095
  }
1096
1096
  });
1097
1097
  {
1098
- const _ = pe(s);
1098
+ const _ = Ce(s);
1099
1099
  for (let S = 0, N = _; S < N; S++) {
1100
1100
  tt(u, 3 * S, d, h), u.a.applyMatrix4(t), u.b.applyMatrix4(t), u.c.applyMatrix4(t), u.needsUpdate = !0;
1101
- for (let L = T, w = T + O; L < w; L++) {
1102
- tt(E, 3 * L, c, a), E.needsUpdate = !0;
1103
- const y = E.distanceToTriangle(u, f, m);
1104
- if (y < A && (R.copy(f), C && C.copy(m), A = y, F = L, p = S), y < o)
1101
+ for (let y = T, w = T + g; y < w; y++) {
1102
+ tt(E, 3 * y, c, a), E.needsUpdate = !0;
1103
+ const L = E.distanceToTriangle(u, f, m);
1104
+ if (L < A && (R.copy(f), C && C.copy(m), A = L, F = y, p = S), L < o)
1105
1105
  return !0;
1106
1106
  }
1107
1107
  }
@@ -1121,33 +1121,33 @@ function Wo(l, s = null) {
1121
1121
  const R = E * 2;
1122
1122
  if (r[R + 15] === Us) {
1123
1123
  const C = n[E + 6], A = r[R + 14];
1124
- let F = 1 / 0, p = 1 / 0, T = 1 / 0, O = -1 / 0, _ = -1 / 0, S = -1 / 0;
1125
- for (let N = C, L = C + A; N < L; N++) {
1124
+ let F = 1 / 0, p = 1 / 0, T = 1 / 0, g = -1 / 0, _ = -1 / 0, S = -1 / 0;
1125
+ for (let N = C, y = C + A; N < y; N++) {
1126
1126
  const w = 3 * l.resolveTriangleIndex(N);
1127
- for (let y = 0; y < 3; y++) {
1128
- let U = w + y;
1127
+ for (let L = 0; L < 3; L++) {
1128
+ let U = w + L;
1129
1129
  U = e ? e[U] : U;
1130
1130
  const x = i.getX(U), B = i.getY(U), H = i.getZ(U);
1131
- x < F && (F = x), x > O && (O = x), B < p && (p = B), B > _ && (_ = B), H < T && (T = H), H > S && (S = H);
1131
+ x < F && (F = x), x > g && (g = x), B < p && (p = B), B > _ && (_ = B), H < T && (T = H), H > S && (S = H);
1132
1132
  }
1133
1133
  }
1134
- return a[E + 0] !== F || a[E + 1] !== p || a[E + 2] !== T || a[E + 3] !== O || a[E + 4] !== _ || a[E + 5] !== S ? (a[E + 0] = F, a[E + 1] = p, a[E + 2] = T, a[E + 3] = O, a[E + 4] = _, a[E + 5] = S, !0) : !1;
1134
+ return a[E + 0] !== F || a[E + 1] !== p || a[E + 2] !== T || a[E + 3] !== g || a[E + 4] !== _ || a[E + 5] !== S ? (a[E + 0] = F, a[E + 1] = p, a[E + 2] = T, a[E + 3] = g, a[E + 4] = _, a[E + 5] = S, !0) : !1;
1135
1135
  } else {
1136
1136
  const C = E + 8, A = n[E + 6], F = C + u, p = A + u;
1137
- let T = f, O = !1, _ = !1;
1138
- s ? T || (O = s.has(F), _ = s.has(p), T = !O && !_) : (O = !0, _ = !0);
1139
- const S = T || O, N = T || _;
1140
- let L = !1;
1141
- S && (L = d(C, u, T));
1137
+ let T = f, g = !1, _ = !1;
1138
+ s ? T || (g = s.has(F), _ = s.has(p), T = !g && !_) : (g = !0, _ = !0);
1139
+ const S = T || g, N = T || _;
1140
+ let y = !1;
1141
+ S && (y = d(C, u, T));
1142
1142
  let w = !1;
1143
1143
  N && (w = d(A, u, T));
1144
- const y = L || w;
1145
- if (y)
1144
+ const L = y || w;
1145
+ if (L)
1146
1146
  for (let U = 0; U < 3; U++) {
1147
1147
  const x = C + U, B = A + U, H = a[x], q = a[x + 3], st = a[B], Q = a[B + 3];
1148
1148
  a[E + U] = H < st ? H : st, a[E + U + 3] = q > Q ? q : Q;
1149
1149
  }
1150
- return y;
1150
+ return L;
1151
1151
  }
1152
1152
  }
1153
1153
  }
@@ -1196,7 +1196,7 @@ function di(l, s, t, e) {
1196
1196
  return m && A ? m.distance <= A.distance ? m : A : m || A || null;
1197
1197
  }
1198
1198
  }
1199
- const os = /* @__PURE__ */ new Ot(), oe = /* @__PURE__ */ new Ft(), re = /* @__PURE__ */ new Ft(), ge = /* @__PURE__ */ new yt(), ji = /* @__PURE__ */ new at(), rs = /* @__PURE__ */ new at();
1199
+ const os = /* @__PURE__ */ new gt(), oe = /* @__PURE__ */ new Ft(), re = /* @__PURE__ */ new Ft(), _e = /* @__PURE__ */ new Lt(), ji = /* @__PURE__ */ new at(), rs = /* @__PURE__ */ new at();
1200
1200
  function jo(l, s, t, e) {
1201
1201
  Z.setBuffer(l._roots[s]);
1202
1202
  const i = ui(0, l, t, e);
@@ -1207,8 +1207,8 @@ function ui(l, s, t, e, i = null) {
1207
1207
  let a = l * 2;
1208
1208
  if (i === null && (t.boundingBox || t.computeBoundingBox(), ji.set(t.boundingBox.min, t.boundingBox.max, e), i = ji), Et(a, n)) {
1209
1209
  const h = s.geometry, d = h.index, E = h.attributes.position, u = t.index, f = t.attributes.position, R = dt(l, r), m = ft(a, n);
1210
- if (ge.copy(e).invert(), t.boundsTree)
1211
- return K(l, o, rs), rs.matrix.copy(ge), rs.needsUpdate = !0, t.boundsTree.shapecast({
1210
+ if (_e.copy(e).invert(), t.boundsTree)
1211
+ return K(l, o, rs), rs.matrix.copy(_e), rs.needsUpdate = !0, t.boundsTree.shapecast({
1212
1212
  intersectsBounds: (A) => rs.intersectsBox(A),
1213
1213
  intersectsTriangle: (A) => {
1214
1214
  A.a.applyMatrix4(e), A.b.applyMatrix4(e), A.c.applyMatrix4(e), A.needsUpdate = !0;
@@ -1220,7 +1220,7 @@ function ui(l, s, t, e, i = null) {
1220
1220
  });
1221
1221
  for (let C = R, A = m + R; C < A; C++) {
1222
1222
  const F = s.resolveTriangleIndex(C);
1223
- tt(oe, 3 * F, d, E), oe.a.applyMatrix4(ge), oe.b.applyMatrix4(ge), oe.c.applyMatrix4(ge), oe.needsUpdate = !0;
1223
+ tt(oe, 3 * F, d, E), oe.a.applyMatrix4(_e), oe.b.applyMatrix4(_e), oe.c.applyMatrix4(_e), oe.needsUpdate = !0;
1224
1224
  for (let p = 0, T = u.count; p < T; p += 3)
1225
1225
  if (tt(re, p, u, f), re.needsUpdate = !0, oe.intersectsTriangle(re))
1226
1226
  return !0;
@@ -1230,46 +1230,46 @@ function ui(l, s, t, e, i = null) {
1230
1230
  return K(h, o, os), !!(i.intersectsBox(os) && ui(h, s, t, e, i) || (K(d, o, os), i.intersectsBox(os) && ui(d, s, t, e, i)));
1231
1231
  }
1232
1232
  }
1233
- const as = /* @__PURE__ */ new yt(), Ws = /* @__PURE__ */ new at(), _e = /* @__PURE__ */ new at(), qo = /* @__PURE__ */ new M(), Ko = /* @__PURE__ */ new M(), $o = /* @__PURE__ */ new M(), Jo = /* @__PURE__ */ new M();
1233
+ const as = /* @__PURE__ */ new Lt(), Ws = /* @__PURE__ */ new at(), Se = /* @__PURE__ */ new at(), qo = /* @__PURE__ */ new M(), Ko = /* @__PURE__ */ new M(), $o = /* @__PURE__ */ new M(), Jo = /* @__PURE__ */ new M();
1234
1234
  function tr(l, s, t, e = {}, i = {}, o = 0, n = 1 / 0) {
1235
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, h = s.attributes.position, d = s.index, E = It.getPrimitive(), u = It.getPrimitive();
1237
1237
  let f = qo, R = Ko, m = null, C = null;
1238
1238
  i && (m = $o, C = Jo);
1239
1239
  let A = 1 / 0, F = null, p = null;
1240
- return as.copy(t).invert(), _e.matrix.copy(as), l.shapecast(
1240
+ return as.copy(t).invert(), Se.matrix.copy(as), l.shapecast(
1241
1241
  {
1242
1242
  boundsTraverseOrder: (T) => Ws.distanceToBox(T),
1243
- intersectsBounds: (T, O, _) => _ < A && _ < n ? (O && (_e.min.copy(T.min), _e.max.copy(T.max), _e.needsUpdate = !0), !0) : !1,
1244
- intersectsRange: (T, O) => {
1243
+ intersectsBounds: (T, g, _) => _ < A && _ < n ? (g && (Se.min.copy(T.min), Se.max.copy(T.max), Se.needsUpdate = !0), !0) : !1,
1244
+ intersectsRange: (T, g) => {
1245
1245
  if (s.boundsTree) {
1246
1246
  const _ = s.boundsTree;
1247
1247
  return _.shapecast({
1248
- boundsTraverseOrder: (S) => _e.distanceToBox(S),
1249
- intersectsBounds: (S, N, L) => L < A && L < n,
1248
+ boundsTraverseOrder: (S) => Se.distanceToBox(S),
1249
+ intersectsBounds: (S, N, y) => y < A && y < n,
1250
1250
  intersectsRange: (S, N) => {
1251
- for (let L = S, w = S + N; L < w; L++) {
1252
- const y = _.resolveTriangleIndex(L);
1253
- tt(u, 3 * y, d, h), u.a.applyMatrix4(t), u.b.applyMatrix4(t), u.c.applyMatrix4(t), u.needsUpdate = !0;
1254
- for (let U = T, x = T + O; U < x; U++) {
1251
+ for (let y = S, w = S + N; y < w; y++) {
1252
+ const L = _.resolveTriangleIndex(y);
1253
+ tt(u, 3 * L, d, h), u.a.applyMatrix4(t), u.b.applyMatrix4(t), u.c.applyMatrix4(t), u.needsUpdate = !0;
1254
+ for (let U = T, x = T + g; U < x; U++) {
1255
1255
  const B = l.resolveTriangleIndex(U);
1256
1256
  tt(E, 3 * B, c, a), E.needsUpdate = !0;
1257
1257
  const H = E.distanceToTriangle(u, f, m);
1258
- if (H < A && (R.copy(f), C && C.copy(m), A = H, F = U, p = L), H < o)
1258
+ if (H < A && (R.copy(f), C && C.copy(m), A = H, F = U, p = y), H < o)
1259
1259
  return !0;
1260
1260
  }
1261
1261
  }
1262
1262
  }
1263
1263
  });
1264
1264
  } else {
1265
- const _ = pe(s);
1265
+ const _ = Ce(s);
1266
1266
  for (let S = 0, N = _; S < N; S++) {
1267
1267
  tt(u, 3 * S, d, h), u.a.applyMatrix4(t), u.b.applyMatrix4(t), u.c.applyMatrix4(t), u.needsUpdate = !0;
1268
- for (let L = T, w = T + O; L < w; L++) {
1269
- const y = l.resolveTriangleIndex(L);
1270
- tt(E, 3 * y, c, a), E.needsUpdate = !0;
1268
+ for (let y = T, w = T + g; y < w; y++) {
1269
+ const L = l.resolveTriangleIndex(y);
1270
+ tt(E, 3 * L, c, a), E.needsUpdate = !0;
1271
1271
  const U = E.distanceToTriangle(u, f, m);
1272
- if (U < A && (R.copy(f), C && C.copy(m), A = U, F = L, p = S), U < o)
1272
+ if (U < A && (R.copy(f), C && C.copy(m), A = U, F = y, p = S), U < o)
1273
1273
  return !0;
1274
1274
  }
1275
1275
  }
@@ -1281,7 +1281,7 @@ function tr(l, s, t, e = {}, i = {}, o = 0, n = 1 / 0) {
1281
1281
  function er() {
1282
1282
  return typeof SharedArrayBuffer < "u";
1283
1283
  }
1284
- const xe = new Z.constructor(), As = new Z.constructor(), vt = new gi(() => new Ot()), ae = new Ot(), ce = new Ot(), Xs = new Ot(), Zs = new Ot();
1284
+ const be = new Z.constructor(), As = new Z.constructor(), vt = new Oi(() => new gt()), ae = new gt(), ce = new gt(), Xs = new gt(), Zs = new gt();
1285
1285
  let Qs = !1;
1286
1286
  function sr(l, s, t, e) {
1287
1287
  if (Qs)
@@ -1289,11 +1289,11 @@ function sr(l, s, t, e) {
1289
1289
  Qs = !0;
1290
1290
  const i = l._roots, o = s._roots;
1291
1291
  let n, r = 0, a = 0;
1292
- const c = new yt().copy(t).invert();
1292
+ const c = new Lt().copy(t).invert();
1293
1293
  for (let h = 0, d = i.length; h < d; h++) {
1294
- xe.setBuffer(i[h]), a = 0;
1294
+ be.setBuffer(i[h]), a = 0;
1295
1295
  const E = vt.getPrimitive();
1296
- K(0, xe.float32Array, E), E.applyMatrix4(c);
1296
+ K(0, be.float32Array, E), E.applyMatrix4(c);
1297
1297
  for (let u = 0, f = o.length; u < f && (As.setBuffer(o[h]), n = Tt(
1298
1298
  0,
1299
1299
  0,
@@ -1307,17 +1307,17 @@ function sr(l, s, t, e) {
1307
1307
  E
1308
1308
  ), As.clearBuffer(), a += o[u].length, !n); u++)
1309
1309
  ;
1310
- if (vt.releasePrimitive(E), xe.clearBuffer(), r += i[h].length, n)
1310
+ if (vt.releasePrimitive(E), be.clearBuffer(), r += i[h].length, n)
1311
1311
  break;
1312
1312
  }
1313
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, h = !1) {
1316
1316
  let d, E;
1317
- h ? (d = As, E = xe) : (d = xe, E = As);
1318
- const u = d.float32Array, f = d.uint32Array, R = d.uint16Array, m = E.float32Array, C = E.uint32Array, A = E.uint16Array, F = l * 2, p = s * 2, T = Et(F, R), O = Et(p, A);
1317
+ h ? (d = As, E = be) : (d = be, E = As);
1318
+ const u = d.float32Array, f = d.uint32Array, R = d.uint16Array, m = E.float32Array, C = E.uint32Array, A = E.uint16Array, F = l * 2, p = s * 2, T = Et(F, R), g = Et(p, A);
1319
1319
  let _ = !1;
1320
- if (O && T)
1320
+ if (g && T)
1321
1321
  h ? _ = i(
1322
1322
  dt(s, C),
1323
1323
  ft(s * 2, A),
@@ -1337,12 +1337,12 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, h = !1) {
1337
1337
  a,
1338
1338
  n + s
1339
1339
  );
1340
- else if (O) {
1340
+ else if (g) {
1341
1341
  const S = vt.getPrimitive();
1342
1342
  K(s, m, S), S.applyMatrix4(t);
1343
- const N = pt(l), L = Ct(l, f);
1344
- K(N, u, ae), K(L, u, ce);
1345
- const w = S.intersectsBox(ae), y = S.intersectsBox(ce);
1343
+ const N = pt(l), y = Ct(l, f);
1344
+ K(N, u, ae), K(y, u, ce);
1345
+ const w = S.intersectsBox(ae), L = S.intersectsBox(ce);
1346
1346
  _ = w && Tt(
1347
1347
  s,
1348
1348
  N,
@@ -1355,9 +1355,9 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, h = !1) {
1355
1355
  r + 1,
1356
1356
  S,
1357
1357
  !h
1358
- ) || y && Tt(
1358
+ ) || L && Tt(
1359
1359
  s,
1360
- L,
1360
+ y,
1361
1361
  e,
1362
1362
  t,
1363
1363
  i,
@@ -1371,8 +1371,8 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, h = !1) {
1371
1371
  } else {
1372
1372
  const S = pt(s), N = Ct(s, C);
1373
1373
  K(S, m, Xs), K(N, m, Zs);
1374
- const L = c.intersectsBox(Xs), w = c.intersectsBox(Zs);
1375
- if (L && w)
1374
+ const y = c.intersectsBox(Xs), w = c.intersectsBox(Zs);
1375
+ if (y && w)
1376
1376
  _ = Tt(
1377
1377
  l,
1378
1378
  S,
@@ -1398,7 +1398,7 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, h = !1) {
1398
1398
  c,
1399
1399
  h
1400
1400
  );
1401
- else if (L)
1401
+ else if (y)
1402
1402
  if (T)
1403
1403
  _ = Tt(
1404
1404
  l,
@@ -1414,11 +1414,11 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, h = !1) {
1414
1414
  h
1415
1415
  );
1416
1416
  else {
1417
- const y = vt.getPrimitive();
1418
- y.copy(Xs).applyMatrix4(t);
1417
+ const L = vt.getPrimitive();
1418
+ L.copy(Xs).applyMatrix4(t);
1419
1419
  const U = pt(l), x = Ct(l, f);
1420
1420
  K(U, u, ae), K(x, u, ce);
1421
- const B = y.intersectsBox(ae), H = y.intersectsBox(ce);
1421
+ const B = L.intersectsBox(ae), H = L.intersectsBox(ce);
1422
1422
  _ = B && Tt(
1423
1423
  S,
1424
1424
  U,
@@ -1429,7 +1429,7 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, h = !1) {
1429
1429
  o,
1430
1430
  a,
1431
1431
  r + 1,
1432
- y,
1432
+ L,
1433
1433
  !h
1434
1434
  ) || H && Tt(
1435
1435
  S,
@@ -1441,9 +1441,9 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, h = !1) {
1441
1441
  o,
1442
1442
  a,
1443
1443
  r + 1,
1444
- y,
1444
+ L,
1445
1445
  !h
1446
- ), vt.releasePrimitive(y);
1446
+ ), vt.releasePrimitive(L);
1447
1447
  }
1448
1448
  else if (w)
1449
1449
  if (T)
@@ -1461,11 +1461,11 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, h = !1) {
1461
1461
  h
1462
1462
  );
1463
1463
  else {
1464
- const y = vt.getPrimitive();
1465
- y.copy(Zs).applyMatrix4(t);
1464
+ const L = vt.getPrimitive();
1465
+ L.copy(Zs).applyMatrix4(t);
1466
1466
  const U = pt(l), x = Ct(l, f);
1467
1467
  K(U, u, ae), K(x, u, ce);
1468
- const B = y.intersectsBox(ae), H = y.intersectsBox(ce);
1468
+ const B = L.intersectsBox(ae), H = L.intersectsBox(ce);
1469
1469
  _ = B && Tt(
1470
1470
  N,
1471
1471
  U,
@@ -1476,7 +1476,7 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, h = !1) {
1476
1476
  o,
1477
1477
  a,
1478
1478
  r + 1,
1479
- y,
1479
+ L,
1480
1480
  !h
1481
1481
  ) || H && Tt(
1482
1482
  N,
@@ -1488,14 +1488,14 @@ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, h = !1) {
1488
1488
  o,
1489
1489
  a,
1490
1490
  r + 1,
1491
- y,
1491
+ L,
1492
1492
  !h
1493
- ), vt.releasePrimitive(y);
1493
+ ), vt.releasePrimitive(L);
1494
1494
  }
1495
1495
  }
1496
1496
  return _;
1497
1497
  }
1498
- const cs = /* @__PURE__ */ new at(), qi = /* @__PURE__ */ new Ot();
1498
+ const cs = /* @__PURE__ */ new at(), qi = /* @__PURE__ */ new gt();
1499
1499
  class _i {
1500
1500
  static serialize(s, t = {}) {
1501
1501
  t = {
@@ -1554,7 +1554,7 @@ class _i {
1554
1554
  [Vs]: !1
1555
1555
  }, t), t.useSharedArrayBuffer && !er())
1556
1556
  throw new Error("MeshBVH: SharedArrayBuffer is not available.");
1557
- this.geometry = s, this._roots = null, this._indirectBuffer = null, t[Vs] || (mo(this, t), !s.boundingBox && t.setBoundingBox && (s.boundingBox = this.getBoundingBox(new Ot())));
1557
+ this.geometry = s, this._roots = null, this._indirectBuffer = null, t[Vs] || (mo(this, t), !s.boundingBox && t.setBoundingBox && (s.boundingBox = this.getBoundingBox(new gt())));
1558
1558
  const { _indirectBuffer: e } = this;
1559
1559
  this.resolveTriangleIndex = t.indirect ? (i) => e[i] : (i) => i;
1560
1560
  }
@@ -1645,19 +1645,19 @@ class _i {
1645
1645
  tt(h, f * 3, d, E);
1646
1646
  };
1647
1647
  if (o) {
1648
- const f = (R, m, C, A, F, p, T, O) => {
1648
+ const f = (R, m, C, A, F, p, T, g) => {
1649
1649
  for (let _ = C, S = C + A; _ < S; _++) {
1650
1650
  u(_), h.a.applyMatrix4(t), h.b.applyMatrix4(t), h.c.applyMatrix4(t), h.needsUpdate = !0;
1651
- for (let N = R, L = R + m; N < L; N++)
1652
- if (c(N), n.needsUpdate = !0, o(n, h, N, _, F, p, T, O))
1651
+ for (let N = R, y = R + m; N < y; N++)
1652
+ if (c(N), n.needsUpdate = !0, o(n, h, N, _, F, p, T, g))
1653
1653
  return !0;
1654
1654
  }
1655
1655
  return !1;
1656
1656
  };
1657
1657
  if (i) {
1658
1658
  const R = i;
1659
- i = function(m, C, A, F, p, T, O, _) {
1660
- return R(m, C, A, F, p, T, O, _) ? !0 : f(m, C, A, F, p, T, O, _);
1659
+ i = function(m, C, A, F, p, T, g, _) {
1660
+ return R(m, C, A, F, p, T, g, _) ? !0 : f(m, C, A, F, p, T, g, _);
1661
1661
  };
1662
1662
  } else
1663
1663
  i = f;
@@ -1710,7 +1710,7 @@ class _i {
1710
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 js = /* @__PURE__ */ new Qn(), $i = /* @__PURE__ */ new yt(), ir = v.prototype.raycast;
1713
+ const js = /* @__PURE__ */ new Qn(), $i = /* @__PURE__ */ new Lt(), ir = v.prototype.raycast;
1714
1714
  function nr(l, s) {
1715
1715
  if (this.geometry.boundsTree) {
1716
1716
  if (this.material === void 0)
@@ -1893,13 +1893,13 @@ class cr extends Ni {
1893
1893
  );
1894
1894
  }
1895
1895
  }
1896
- const be = class be extends et {
1896
+ const ve = class ve extends et {
1897
1897
  constructor(t) {
1898
1898
  super(t);
1899
1899
  I(this, "_disposedComponents", /* @__PURE__ */ new Set());
1900
1900
  /** {@link Component.enabled} */
1901
1901
  I(this, "enabled", !0);
1902
- t.add(be.uuid, this);
1902
+ t.add(ve.uuid, this);
1903
1903
  }
1904
1904
  // TODO: Remove this?
1905
1905
  /**
@@ -1937,7 +1937,7 @@ const be = class be extends et {
1937
1937
  }
1938
1938
  disposeGeometryAndMaterials(t, e) {
1939
1939
  const i = t;
1940
- i.geometry && this.disposeGeometry(i.geometry), e && i.material && be.disposeMaterial(i), i.material = [], i.geometry = null;
1940
+ i.geometry && this.disposeGeometry(i.geometry), e && i.material && ve.disposeMaterial(i), i.material = [], i.geometry = null;
1941
1941
  }
1942
1942
  disposeChildren(t) {
1943
1943
  for (const e of t.children)
@@ -1956,8 +1956,8 @@ const be = class be extends et {
1956
1956
  * A unique identifier for the component.
1957
1957
  * This UUID is used to register the component within the Components system.
1958
1958
  */
1959
- I(be, "uuid", "76e9cd8e-ad8f-4753-9ef6-cbc60f7247fe");
1960
- let zt = be;
1959
+ I(ve, "uuid", "76e9cd8e-ad8f-4753-9ef6-cbc60f7247fe");
1960
+ let zt = ve;
1961
1961
  class lr extends Ni {
1962
1962
  constructor(t) {
1963
1963
  super(t);
@@ -1974,7 +1974,7 @@ class lr extends Ni {
1974
1974
  this.three.children = [], this.onDisposed.trigger(), this.onDisposed.reset();
1975
1975
  }
1976
1976
  }
1977
- const ms = 0, hr = 1, Er = new M(), Ji = new Lt(), qs = new Fi(), tn = new M(), ls = new ue();
1977
+ const ms = 0, hr = 1, Er = new M(), Ji = new yt(), qs = new Fi(), tn = new M(), ls = new ue();
1978
1978
  class dr {
1979
1979
  constructor() {
1980
1980
  this.tolerance = -1, this.faces = [], this.newFaces = [], this.assigned = new en(), this.unassigned = new en(), this.vertices = [];
@@ -2364,7 +2364,7 @@ function Cr(l, s) {
2364
2364
  let t = 0, e = 0;
2365
2365
  const i = 10;
2366
2366
  s.unitary.identity(), s.diagonal.copy(l);
2367
- const o = s.unitary, n = s.diagonal, r = new g.Matrix3(), a = new g.Matrix3(), c = Number.EPSILON * Ir(n);
2367
+ const o = s.unitary, n = s.diagonal, r = new O.Matrix3(), a = new O.Matrix3(), c = Number.EPSILON * Ir(n);
2368
2368
  for (; e < i && fr(n) > c; )
2369
2369
  pr(n, r), a.copy(r).transpose(), n.multiply(r), n.premultiply(a), o.multiply(r), ++t > 2 && (e++, t = 0);
2370
2370
  return s;
@@ -2373,13 +2373,13 @@ function Tr(l) {
2373
2373
  const s = [];
2374
2374
  for (let it = 0; it < l.length - 2; it += 3) {
2375
2375
  const Xt = l[it], J = l[it + 1], $t = l[it + 2];
2376
- s.push(new g.Vector3(Xt, J, $t));
2376
+ s.push(new O.Vector3(Xt, J, $t));
2377
2377
  }
2378
2378
  const t = new dr();
2379
2379
  t.setFromPoints(s);
2380
2380
  const e = {
2381
- unitary: new g.Matrix3(),
2382
- diagonal: new g.Matrix3()
2381
+ unitary: new O.Matrix3(),
2382
+ diagonal: new O.Matrix3()
2383
2383
  }, i = t.faces, o = [], n = [];
2384
2384
  for (let it = 0, Xt = i.length; it < Xt; it++) {
2385
2385
  const J = i[it];
@@ -2394,7 +2394,7 @@ function Tr(l) {
2394
2394
  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);
2395
2395
  }
2396
2396
  }
2397
- const r = new g.Vector3(), a = new g.Vector3(), c = new g.Vector3(), h = new g.Vector3(), d = new g.Vector3(), E = new g.Vector3(), u = new g.Vector3(), f = new g.Vector3();
2397
+ const r = new O.Vector3(), a = new O.Vector3(), c = new O.Vector3(), h = new O.Vector3(), d = new O.Vector3(), E = new O.Vector3(), u = new O.Vector3(), f = new O.Vector3();
2398
2398
  let R = 0, m = 0, C = 0, A = 0, F = 0, p = 0, T = 0;
2399
2399
  for (let it = 0, Xt = n.length; it < Xt; it += 9) {
2400
2400
  r.fromArray(n, it), a.fromArray(n, it + 3), c.fromArray(n, it + 6), u.set(0, 0, 0), u.add(r).add(a).add(c).divideScalar(3), h.subVectors(a, r), d.subVectors(c, r);
@@ -2402,28 +2402,28 @@ function Tr(l) {
2402
2402
  f.add(E.copy(u).multiplyScalar(J)), R += J, m += (9 * u.x * u.x + r.x * r.x + a.x * a.x + c.x * c.x) * (J / 12), C += (9 * u.x * u.y + r.x * r.y + a.x * a.y + c.x * c.y) * (J / 12), A += (9 * u.x * u.z + r.x * r.z + a.x * a.z + c.x * c.z) * (J / 12), F += (9 * u.y * u.y + r.y * r.y + a.y * a.y + c.y * c.y) * (J / 12), p += (9 * u.y * u.z + r.y * r.z + a.y * a.z + c.y * c.z) * (J / 12), T += (9 * u.z * u.z + r.z * r.z + a.z * a.z + c.z * c.z) * (J / 12);
2403
2403
  }
2404
2404
  f.divideScalar(R), m /= R, C /= R, A /= R, F /= R, p /= R, T /= R, m -= f.x * f.x, C -= f.x * f.y, A -= f.x * f.z, F -= f.y * f.y, p -= f.y * f.z, T -= f.z * f.z;
2405
- const O = new g.Matrix3();
2406
- O.elements[0] = m, O.elements[1] = C, O.elements[2] = A, O.elements[3] = C, O.elements[4] = F, O.elements[5] = p, O.elements[6] = A, O.elements[7] = p, O.elements[8] = T, Cr(O, e);
2407
- const _ = e.unitary, S = new g.Vector3(), N = new g.Vector3(), L = new g.Vector3();
2408
- _.extractBasis(S, N, L);
2409
- let w = -1 / 0, y = -1 / 0, U = -1 / 0, x = 1 / 0, B = 1 / 0, H = 1 / 0;
2405
+ const g = new O.Matrix3();
2406
+ g.elements[0] = m, g.elements[1] = C, g.elements[2] = A, g.elements[3] = C, g.elements[4] = F, g.elements[5] = p, g.elements[6] = A, g.elements[7] = p, g.elements[8] = T, Cr(g, e);
2407
+ const _ = e.unitary, S = new O.Vector3(), N = new O.Vector3(), y = new O.Vector3();
2408
+ _.extractBasis(S, N, y);
2409
+ let w = -1 / 0, L = -1 / 0, U = -1 / 0, x = 1 / 0, B = 1 / 0, H = 1 / 0;
2410
2410
  for (let it = 0, Xt = s.length; it < Xt; it++) {
2411
2411
  const J = s[it];
2412
- w = Math.max(S.dot(J), w), y = Math.max(N.dot(J), y), U = Math.max(L.dot(J), U), x = Math.min(S.dot(J), x), B = Math.min(N.dot(J), B), H = Math.min(L.dot(J), H);
2412
+ w = Math.max(S.dot(J), w), L = Math.max(N.dot(J), L), U = Math.max(y.dot(J), U), x = Math.min(S.dot(J), x), B = Math.min(N.dot(J), B), H = Math.min(y.dot(J), H);
2413
2413
  }
2414
- S.multiplyScalar(0.5 * (x + w)), N.multiplyScalar(0.5 * (B + y)), L.multiplyScalar(0.5 * (H + U));
2415
- const q = new g.Vector3(), st = new g.Vector3(), Q = new g.Matrix3();
2416
- q.add(S).add(N).add(L), st.x = w - x, st.y = y - B, st.z = U - H, st.multiplyScalar(0.5), Q.copy(_);
2417
- const { x: Ht, y: kt, z: Wt } = st, We = new g.Matrix4();
2414
+ S.multiplyScalar(0.5 * (x + w)), N.multiplyScalar(0.5 * (B + L)), y.multiplyScalar(0.5 * (H + U));
2415
+ const q = new O.Vector3(), st = new O.Vector3(), Q = new O.Matrix3();
2416
+ q.add(S).add(N).add(y), st.x = w - x, st.y = L - B, st.z = U - H, st.multiplyScalar(0.5), Q.copy(_);
2417
+ const { x: Ht, y: kt, z: Wt } = st, We = new O.Matrix4();
2418
2418
  We.makeScale(Ht * 2, kt * 2, Wt * 2);
2419
- const Ce = new g.Matrix4();
2420
- Ce.makeTranslation(-Ht, -kt, -Wt);
2421
- const yi = new g.Matrix4();
2422
- yi.makeTranslation(q.x, q.y, q.z);
2423
- const Mi = new g.Matrix4();
2419
+ const Te = new O.Matrix4();
2420
+ Te.makeTranslation(-Ht, -kt, -Wt);
2421
+ const Li = new O.Matrix4();
2422
+ Li.makeTranslation(q.x, q.y, q.z);
2423
+ const Mi = new O.Matrix4();
2424
2424
  Mi.setFromMatrix3(Q);
2425
- const Te = new g.Matrix4();
2426
- return Te.multiply(yi), Te.multiply(Mi), Te.multiply(Ce), Te.multiply(We), { center: q, halfSizes: st, rotation: Q, transformation: Te };
2425
+ const me = new O.Matrix4();
2426
+ return me.multiply(Li), me.multiply(Mi), me.multiply(Te), me.multiply(We), { center: q, halfSizes: st, rotation: Q, transformation: me };
2427
2427
  }
2428
2428
  function mr(l, s, t) {
2429
2429
  const e = [
@@ -2715,7 +2715,7 @@ I($, "_lut", [
2715
2715
  "fe",
2716
2716
  "ff"
2717
2717
  ]);
2718
- let Ge = $;
2718
+ let ze = $;
2719
2719
  class ea extends et {
2720
2720
  constructor(t, e) {
2721
2721
  super(t);
@@ -2825,14 +2825,14 @@ class ea extends et {
2825
2825
  get(t) {
2826
2826
  if (!this.enabled)
2827
2827
  return this._pickedPoint;
2828
- const o = this.components.get(ze).get(t).castRay();
2828
+ const o = this.components.get(He).get(t).castRay();
2829
2829
  if (!o)
2830
2830
  return this._pickedPoint !== null && (this.onVertexLost.trigger(), this._pickedPoint = null), this._pickedPoint;
2831
2831
  const n = this.getClosestVertex(o);
2832
2832
  return n ? (this.workingPlane ? Math.abs(this.workingPlane.distanceToPoint(n)) < 1e-3 : !0) ? ((this._pickedPoint === null || !this._pickedPoint.equals(n)) && (this._pickedPoint = n.clone(), this.onVertexFound.trigger(this._pickedPoint)), this._pickedPoint) : (this._pickedPoint = null, this._pickedPoint) : (this._pickedPoint !== null && (this.onVertexLost.trigger(), this._pickedPoint = null), this._pickedPoint);
2833
2833
  }
2834
2834
  getClosestVertex(t) {
2835
- let e = new g.Vector3(), i = !1, o = Number.MAX_SAFE_INTEGER;
2835
+ let e = new O.Vector3(), i = !1, o = Number.MAX_SAFE_INTEGER;
2836
2836
  const n = this.getVertices(t);
2837
2837
  if (n === null)
2838
2838
  return null;
@@ -2848,7 +2848,7 @@ class ea extends et {
2848
2848
  const e = t.object;
2849
2849
  if (!t.face || !e)
2850
2850
  return null;
2851
- const i = e.geometry, o = new g.Matrix4(), { instanceId: n } = t, r = n !== void 0, a = e instanceof g.InstancedMesh;
2851
+ const i = e.geometry, o = new O.Matrix4(), { instanceId: n } = t, r = n !== void 0, a = e instanceof O.InstancedMesh;
2852
2852
  return a && r && e.getMatrixAt(n, o), [
2853
2853
  this.getVertex(t.face.a, i),
2854
2854
  this.getVertex(t.face.b, i),
@@ -2859,7 +2859,7 @@ class ea extends et {
2859
2859
  if (t === void 0)
2860
2860
  return null;
2861
2861
  const i = e.attributes.position;
2862
- return new g.Vector3(
2862
+ return new O.Vector3(
2863
2863
  i.getX(t),
2864
2864
  i.getY(t),
2865
2865
  i.getZ(t)
@@ -2889,7 +2889,7 @@ const Fs = class Fs {
2889
2889
  e.enabled && e.isUpdateable() && e.update(s);
2890
2890
  requestAnimationFrame(this.update);
2891
2891
  });
2892
- this._clock = new g.Clock(), Fs.setupBVH();
2892
+ this._clock = new O.Clock(), Fs.setupBVH();
2893
2893
  }
2894
2894
  /**
2895
2895
  * Adds a component to the list of components.
@@ -2907,7 +2907,7 @@ const Fs = class Fs {
2907
2907
  throw new Error(
2908
2908
  "You're trying to add a component that already exists in the components instance. Use Components.get() instead."
2909
2909
  );
2910
- Ge.validate(s), this.list.set(s, t);
2910
+ ze.validate(s), this.list.set(s, t);
2911
2911
  }
2912
2912
  /**
2913
2913
  * Retrieves a component instance by its constructor function.
@@ -2962,18 +2962,18 @@ const Fs = class Fs {
2962
2962
  this._clock.stop(), this.onDisposed.trigger(), this.onDisposed.reset();
2963
2963
  }
2964
2964
  static setupBVH() {
2965
- g.BufferGeometry.prototype.computeBoundsTree = or, g.BufferGeometry.prototype.disposeBoundsTree = rr, g.Mesh.prototype.raycast = nr;
2965
+ O.BufferGeometry.prototype.computeBoundsTree = or, O.BufferGeometry.prototype.disposeBoundsTree = rr, O.Mesh.prototype.raycast = nr;
2966
2966
  }
2967
2967
  };
2968
2968
  /**
2969
2969
  * The version of the @thatopen/components library.
2970
2970
  */
2971
- I(Fs, "release", "2.1.5");
2971
+ I(Fs, "release", "2.1.6");
2972
2972
  let pi = Fs;
2973
2973
  class Rr {
2974
2974
  constructor(s) {
2975
2975
  I(this, "_event");
2976
- I(this, "_position", new g.Vector2());
2976
+ I(this, "_position", new O.Vector2());
2977
2977
  /** {@link Disposable.onDisposed} */
2978
2978
  I(this, "onDisposed", new D());
2979
2979
  I(this, "updateMouseInfo", (s) => {
@@ -3019,7 +3019,7 @@ class Ar {
3019
3019
  * A reference to the Three.js Raycaster instance.
3020
3020
  * This is used for raycasting operations.
3021
3021
  */
3022
- I(this, "three", new g.Raycaster());
3022
+ I(this, "three", new O.Raycaster());
3023
3023
  /**
3024
3024
  * A reference to the world instance to which this Raycaster belongs.
3025
3025
  * This is used to access the camera and meshes.
@@ -3077,7 +3077,7 @@ class Ar {
3077
3077
  );
3078
3078
  }
3079
3079
  }
3080
- const Os = class Os extends et {
3080
+ const gs = class gs extends et {
3081
3081
  constructor(t) {
3082
3082
  super(t);
3083
3083
  /** {@link Component.enabled} */
@@ -3089,7 +3089,7 @@ const Os = class Os extends et {
3089
3089
  I(this, "list", /* @__PURE__ */ new Map());
3090
3090
  /** {@link Disposable.onDisposed} */
3091
3091
  I(this, "onDisposed", new D());
3092
- t.add(Os.uuid, this);
3092
+ t.add(gs.uuid, this);
3093
3093
  }
3094
3094
  /**
3095
3095
  * Retrieves a SimpleRaycaster instance for the given world.
@@ -3129,8 +3129,8 @@ const Os = class Os extends et {
3129
3129
  * A unique identifier for the component.
3130
3130
  * This UUID is used to register the component within the Components system.
3131
3131
  */
3132
- I(Os, "uuid", "d5d8bdf0-db25-4952-b951-b643af207ace");
3133
- let ze = Os;
3132
+ I(gs, "uuid", "d5d8bdf0-db25-4952-b951-b643af207ace");
3133
+ let He = gs;
3134
3134
  class Fr extends Si {
3135
3135
  constructor() {
3136
3136
  super(...arguments);
@@ -3156,7 +3156,7 @@ class Fr extends Si {
3156
3156
  /**
3157
3157
  * A unique identifier for the world.
3158
3158
  */
3159
- I(this, "uuid", Ge.create());
3159
+ I(this, "uuid", ze.create());
3160
3160
  /**
3161
3161
  * An optional name for the world.
3162
3162
  */
@@ -3249,26 +3249,26 @@ class sa extends lr {
3249
3249
  */
3250
3250
  I(this, "config", {
3251
3251
  directionalLight: {
3252
- color: new g.Color("white"),
3252
+ color: new O.Color("white"),
3253
3253
  intensity: 1.5,
3254
- position: new g.Vector3(5, 10, 3)
3254
+ position: new O.Vector3(5, 10, 3)
3255
3255
  },
3256
3256
  ambientLight: {
3257
- color: new g.Color("white"),
3257
+ color: new O.Color("white"),
3258
3258
  intensity: 1
3259
3259
  }
3260
3260
  });
3261
- this.three = new g.Scene(), this.three.background = new g.Color(2107698);
3261
+ this.three = new O.Scene(), this.three.background = new O.Color(2107698);
3262
3262
  }
3263
3263
  /** {@link Configurable.setup} */
3264
3264
  setup(t) {
3265
3265
  this.config = { ...this.config, ...t };
3266
- const e = new g.DirectionalLight(
3266
+ const e = new O.DirectionalLight(
3267
3267
  this.config.directionalLight.color,
3268
3268
  this.config.directionalLight.intensity
3269
3269
  );
3270
3270
  e.position.copy(this.config.directionalLight.position);
3271
- const i = new g.AmbientLight(
3271
+ const i = new O.AmbientLight(
3272
3272
  this.config.ambientLight.color,
3273
3273
  this.config.ambientLight.intensity
3274
3274
  );
@@ -3309,7 +3309,7 @@ class ia extends cr {
3309
3309
  return;
3310
3310
  this._resizing = !0, this.onContainerUpdated.trigger();
3311
3311
  const e = t ? t.x : this.container.clientWidth, i = t ? t.y : this.container.clientHeight;
3312
- this.three.setSize(e, i), this.onResize.trigger(new g.Vector2(e, i)), this._resizing = !1;
3312
+ this.three.setSize(e, i), this.onResize.trigger(new O.Vector2(e, i)), this._resizing = !1;
3313
3313
  });
3314
3314
  I(this, "resizeEvent", () => {
3315
3315
  this.resize();
@@ -3318,14 +3318,14 @@ class ia extends cr {
3318
3318
  t.preventDefault(), this.enabled = !1;
3319
3319
  });
3320
3320
  I(this, "onContextBack", () => {
3321
- this.three.setRenderTarget(null), this.three.dispose(), this.three = new g.WebGLRenderer({
3321
+ this.three.setRenderTarget(null), this.three.dispose(), this.three = new O.WebGLRenderer({
3322
3322
  canvas: this._canvas,
3323
3323
  antialias: !0,
3324
3324
  alpha: !0,
3325
3325
  ...this._parameters
3326
3326
  }), this.enabled = !0;
3327
3327
  });
3328
- this.container = e, this._parameters = i, this.three = new g.WebGLRenderer({
3328
+ this.container = e, this._parameters = i, this.three = new O.WebGLRenderer({
3329
3329
  antialias: !0,
3330
3330
  alpha: !0,
3331
3331
  ...i
@@ -3347,7 +3347,7 @@ class ia extends cr {
3347
3347
  }
3348
3348
  /** {@link Resizeable.getSize}. */
3349
3349
  getSize() {
3350
- return new g.Vector2(
3350
+ return new O.Vector2(
3351
3351
  this.three.domElement.clientWidth,
3352
3352
  this.three.domElement.clientHeight
3353
3353
  );
@@ -3408,7 +3408,7 @@ function Zt(l) {
3408
3408
  function bt(l) {
3409
3409
  return l.isOrthographicCamera;
3410
3410
  }
3411
- const he = Math.PI * 2, nn = Math.PI / 2, xn = 1e-5, Se = Math.PI / 180;
3411
+ const he = Math.PI * 2, nn = Math.PI / 2, xn = 1e-5, Ne = Math.PI / 180;
3412
3412
  function mt(l, s, t) {
3413
3413
  return Math.max(s, Math.min(t, l));
3414
3414
  }
@@ -3421,10 +3421,10 @@ function k(l, s, t = xn) {
3421
3421
  function on(l, s) {
3422
3422
  return Math.round(l / s) * s;
3423
3423
  }
3424
- function Ne(l) {
3424
+ function Pe(l) {
3425
3425
  return isFinite(l) ? l : l < 0 ? -Number.MAX_VALUE : Number.MAX_VALUE;
3426
3426
  }
3427
- function Pe(l) {
3427
+ function ye(l) {
3428
3428
  return Math.abs(l) < Number.MAX_VALUE ? l : l * (1 / 0);
3429
3429
  }
3430
3430
  function hs(l, s, t, e, i = 1 / 0, o) {
@@ -3448,10 +3448,10 @@ function rn(l, s, t, e, i = 1 / 0, o, n) {
3448
3448
  u = u / B * F, f = f / B * F, R = R / B * F;
3449
3449
  }
3450
3450
  h = l.x - u, d = l.y - f, E = l.z - R;
3451
- const O = (t.x + r * u) * o, _ = (t.y + r * f) * o, S = (t.z + r * R) * o;
3452
- t.x = (t.x - r * O) * c, t.y = (t.y - r * _) * c, t.z = (t.z - r * S) * c, n.x = h + (u + O) * c, n.y = d + (f + _) * c, n.z = E + (R + S) * c;
3453
- const N = m - l.x, L = C - l.y, w = A - l.z, y = n.x - m, U = n.y - C, x = n.z - A;
3454
- return N * y + L * U + w * x > 0 && (n.x = m, n.y = C, n.z = A, t.x = (n.x - m) / o, t.y = (n.y - C) / o, t.z = (n.z - A) / o), n;
3451
+ const g = (t.x + r * u) * o, _ = (t.y + r * f) * o, S = (t.z + r * R) * o;
3452
+ t.x = (t.x - r * g) * c, t.y = (t.y - r * _) * c, t.z = (t.z - r * S) * c, n.x = h + (u + g) * c, n.y = d + (f + _) * c, n.z = E + (R + S) * c;
3453
+ const N = m - l.x, y = C - l.y, w = A - l.z, L = n.x - m, U = n.y - C, x = n.z - A;
3454
+ return N * L + y * U + w * x > 0 && (n.x = m, n.y = C, n.z = A, t.x = (n.x - m) / o, t.y = (n.y - C) / o, t.z = (n.z - A) / o), n;
3455
3455
  }
3456
3456
  function $s(l, s) {
3457
3457
  s.set(0, 0), l.forEach((t) => {
@@ -3461,7 +3461,7 @@ function $s(l, s) {
3461
3461
  function Js(l, s) {
3462
3462
  return bt(l) ? (console.warn(`${s} is not supported in OrthographicCamera`), !0) : !1;
3463
3463
  }
3464
- class Or {
3464
+ class gr {
3465
3465
  constructor() {
3466
3466
  this._listeners = {};
3467
3467
  }
@@ -3525,9 +3525,9 @@ class Or {
3525
3525
  }
3526
3526
  }
3527
3527
  }
3528
- const gr = "2.7.3", Es = 1 / 8, bn = typeof window < "u", _r = bn && /Mac/.test(navigator.platform), Sr = !(bn && "PointerEvent" in window);
3529
- let Y, an, ds, ti, lt, G, z, Ee, Le, gt, _t, Qt, cn, ln, ut, ye, de, hn, ei, En, si, ii, us;
3530
- class ot extends Or {
3528
+ const Or = "2.7.3", Es = 1 / 8, bn = typeof window < "u", _r = bn && /Mac/.test(navigator.platform), Sr = !(bn && "PointerEvent" in window);
3529
+ let Y, an, ds, ti, lt, G, z, Ee, Le, Ot, _t, Qt, cn, ln, ut, Me, de, hn, ei, En, si, ii, us;
3530
+ class ot extends gr {
3531
3531
  /**
3532
3532
  * Injects THREE as the dependency. You can then proceed to use CameraControls.
3533
3533
  *
@@ -3569,7 +3569,7 @@ class ot extends Or {
3569
3569
  * @category Statics
3570
3570
  */
3571
3571
  static install(s) {
3572
- Y = s.THREE, an = Object.freeze(new Y.Vector3(0, 0, 0)), ds = 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(), Ee = new Y.Vector3(), Le = new Y.Vector3(), gt = new Y.Vector3(), _t = new Y.Vector3(), Qt = new Y.Vector3(), cn = new Y.Vector3(), ln = new Y.Vector3(), ut = new Y.Spherical(), ye = new Y.Spherical(), de = new Y.Box3(), hn = new Y.Box3(), ei = new Y.Sphere(), En = new Y.Quaternion(), si = new Y.Quaternion(), ii = new Y.Matrix4(), us = new Y.Raycaster();
3572
+ Y = s.THREE, an = Object.freeze(new Y.Vector3(0, 0, 0)), ds = 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(), Ee = new Y.Vector3(), Le = new Y.Vector3(), Ot = new Y.Vector3(), _t = new Y.Vector3(), Qt = new Y.Vector3(), cn = new Y.Vector3(), ln = new Y.Vector3(), ut = new Y.Spherical(), Me = new Y.Spherical(), de = new Y.Box3(), hn = new Y.Box3(), ei = new Y.Sphere(), En = new Y.Quaternion(), si = new Y.Quaternion(), ii = new Y.Matrix4(), us = new Y.Raycaster();
3573
3573
  }
3574
3574
  /**
3575
3575
  * list all ACTIONs
@@ -3597,26 +3597,26 @@ class ot extends Or {
3597
3597
  */
3598
3598
  constructor(s, t) {
3599
3599
  super(), this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -1 / 0, this.maxAzimuthAngle = 1 / 0, this.minDistance = Number.EPSILON, this.maxDistance = 1 / 0, this.infinityDolly = !1, this.minZoom = 0.01, this.maxZoom = 1 / 0, this.smoothTime = 0.25, this.draggingSmoothTime = 0.125, this.maxSpeed = 1 / 0, this.azimuthRotateSpeed = 1, this.polarRotateSpeed = 1, this.dollySpeed = 1, this.dollyDragInverted = !1, this.truckSpeed = 2, this.dollyToCursor = !1, this.dragToOffset = !1, this.verticalDragToForward = !1, this.boundaryFriction = 0, this.restThreshold = 0.01, this.colliderMeshes = [], this.cancel = () => {
3600
- }, this._enabled = !0, this._state = P.NONE, this._viewport = null, this._changedDolly = 0, this._changedZoom = 0, this._hasRested = !0, this._boundaryEnclosesCamera = !1, this._needsUpdate = !0, this._updatedLastTime = !1, this._elementRect = new DOMRect(), this._isDragging = !1, this._dragNeedsUpdate = !0, this._activePointers = [], this._lockedPointer = null, this._interactiveArea = new DOMRect(0, 0, 1, 1), this._isUserControllingRotate = !1, this._isUserControllingDolly = !1, this._isUserControllingTruck = !1, this._isUserControllingOffset = !1, this._isUserControllingZoom = !1, this._lastDollyDirection = le.NONE, this._thetaVelocity = { value: 0 }, this._phiVelocity = { value: 0 }, this._radiusVelocity = { value: 0 }, this._targetVelocity = new Y.Vector3(), this._focalOffsetVelocity = new Y.Vector3(), this._zoomVelocity = { value: 0 }, this._truckInternal = (p, T, O) => {
3600
+ }, this._enabled = !0, this._state = P.NONE, this._viewport = null, this._changedDolly = 0, this._changedZoom = 0, this._hasRested = !0, this._boundaryEnclosesCamera = !1, this._needsUpdate = !0, this._updatedLastTime = !1, this._elementRect = new DOMRect(), this._isDragging = !1, this._dragNeedsUpdate = !0, this._activePointers = [], this._lockedPointer = null, this._interactiveArea = new DOMRect(0, 0, 1, 1), this._isUserControllingRotate = !1, this._isUserControllingDolly = !1, this._isUserControllingTruck = !1, this._isUserControllingOffset = !1, this._isUserControllingZoom = !1, this._lastDollyDirection = le.NONE, this._thetaVelocity = { value: 0 }, this._phiVelocity = { value: 0 }, this._radiusVelocity = { value: 0 }, this._targetVelocity = new Y.Vector3(), this._focalOffsetVelocity = new Y.Vector3(), this._zoomVelocity = { value: 0 }, this._truckInternal = (p, T, g) => {
3601
3601
  let _, S;
3602
3602
  if (Zt(this._camera)) {
3603
- const N = G.copy(this._camera.position).sub(this._target), L = this._camera.getEffectiveFOV() * Se, w = N.length() * Math.tan(L * 0.5);
3603
+ const N = G.copy(this._camera.position).sub(this._target), y = this._camera.getEffectiveFOV() * Ne, w = N.length() * Math.tan(y * 0.5);
3604
3604
  _ = this.truckSpeed * p * w / this._elementRect.height, S = this.truckSpeed * T * w / this._elementRect.height;
3605
3605
  } else if (bt(this._camera)) {
3606
3606
  const N = this._camera;
3607
3607
  _ = p * (N.right - N.left) / N.zoom / this._elementRect.width, S = T * (N.top - N.bottom) / N.zoom / this._elementRect.height;
3608
3608
  } else
3609
3609
  return;
3610
- this.verticalDragToForward ? (O ? this.setFocalOffset(this._focalOffsetEnd.x + _, this._focalOffsetEnd.y, this._focalOffsetEnd.z, !0) : this.truck(_, 0, !0), this.forward(-S, !0)) : O ? this.setFocalOffset(this._focalOffsetEnd.x + _, this._focalOffsetEnd.y + S, this._focalOffsetEnd.z, !0) : this.truck(_, S, !0);
3610
+ this.verticalDragToForward ? (g ? this.setFocalOffset(this._focalOffsetEnd.x + _, this._focalOffsetEnd.y, this._focalOffsetEnd.z, !0) : this.truck(_, 0, !0), this.forward(-S, !0)) : g ? this.setFocalOffset(this._focalOffsetEnd.x + _, this._focalOffsetEnd.y + S, this._focalOffsetEnd.z, !0) : this.truck(_, S, !0);
3611
3611
  }, this._rotateInternal = (p, T) => {
3612
- const O = he * this.azimuthRotateSpeed * p / this._elementRect.height, _ = he * this.polarRotateSpeed * T / this._elementRect.height;
3613
- this.rotate(O, _, !0);
3614
- }, this._dollyInternal = (p, T, O) => {
3615
- const _ = Math.pow(0.95, -p * this.dollySpeed), S = this._sphericalEnd.radius, N = this._sphericalEnd.radius * _, L = mt(N, this.minDistance, this.maxDistance), w = L - N;
3616
- this.infinityDolly && this.dollyToCursor ? this._dollyToNoClamp(N, !0) : this.infinityDolly && !this.dollyToCursor ? (this.dollyInFixed(w, !0), this._dollyToNoClamp(L, !0)) : this._dollyToNoClamp(L, !0), this.dollyToCursor && (this._changedDolly += (this.infinityDolly ? N : L) - S, this._dollyControlCoord.set(T, O)), this._lastDollyDirection = Math.sign(-p);
3617
- }, this._zoomInternal = (p, T, O) => {
3612
+ const g = he * this.azimuthRotateSpeed * p / this._elementRect.height, _ = he * this.polarRotateSpeed * T / this._elementRect.height;
3613
+ this.rotate(g, _, !0);
3614
+ }, this._dollyInternal = (p, T, g) => {
3615
+ const _ = Math.pow(0.95, -p * this.dollySpeed), S = this._sphericalEnd.radius, N = this._sphericalEnd.radius * _, y = mt(N, this.minDistance, this.maxDistance), w = y - N;
3616
+ this.infinityDolly && this.dollyToCursor ? this._dollyToNoClamp(N, !0) : this.infinityDolly && !this.dollyToCursor ? (this.dollyInFixed(w, !0), this._dollyToNoClamp(y, !0)) : this._dollyToNoClamp(y, !0), this.dollyToCursor && (this._changedDolly += (this.infinityDolly ? N : y) - S, this._dollyControlCoord.set(T, g)), this._lastDollyDirection = Math.sign(-p);
3617
+ }, this._zoomInternal = (p, T, g) => {
3618
3618
  const _ = Math.pow(0.95, p * this.dollySpeed), S = this._zoom, N = this._zoom * _;
3619
- this.zoomTo(N, !0), this.dollyToCursor && (this._changedZoom += N - S, this._dollyControlCoord.set(T, O));
3619
+ this.zoomTo(N, !0), this.dollyToCursor && (this._changedZoom += N - S, this._dollyControlCoord.set(T, g));
3620
3620
  }, typeof Y > "u" && console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."), this._camera = s, this._yAxisUpSpace = new Y.Quaternion().setFromUnitVectors(this._camera.up, ds), this._yAxisUpSpaceInverse = this._yAxisUpSpace.clone().invert(), this._state = P.NONE, this._target = new Y.Vector3(), this._targetEnd = this._target.clone(), this._focalOffset = new Y.Vector3(), this._focalOffsetEnd = this._focalOffset.clone(), this._spherical = new Y.Spherical().setFromVector3(G.copy(this._camera.position).applyQuaternion(this._yAxisUpSpace)), this._sphericalEnd = this._spherical.clone(), this._lastDistance = this._spherical.radius, this._zoom = this._camera.zoom, this._zoomEnd = this._zoom, this._lastZoom = this._zoom, this._nearPlaneCorners = [
3621
3621
  new Y.Vector3(),
3622
3622
  new Y.Vector3(),
@@ -3647,7 +3647,7 @@ class ot extends Or {
3647
3647
  }
3648
3648
  if ((p.buttons & V.LEFT) === V.LEFT && this._lockedPointer)
3649
3649
  return;
3650
- const O = {
3650
+ const g = {
3651
3651
  pointerId: p.pointerId,
3652
3652
  clientX: p.clientX,
3653
3653
  clientY: p.clientY,
@@ -3655,7 +3655,7 @@ class ot extends Or {
3655
3655
  deltaY: 0,
3656
3656
  mouseButton: T
3657
3657
  };
3658
- this._activePointers.push(O), this._domElement.ownerDocument.removeEventListener("pointermove", a, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("pointerup", h), this._domElement.ownerDocument.addEventListener("pointermove", a, { passive: !1 }), this._domElement.ownerDocument.addEventListener("pointerup", h), this._isDragging = !0, R(p);
3658
+ this._activePointers.push(g), this._domElement.ownerDocument.removeEventListener("pointermove", a, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("pointerup", h), this._domElement.ownerDocument.addEventListener("pointermove", a, { passive: !1 }), this._domElement.ownerDocument.addEventListener("pointerup", h), this._isDragging = !0, R(p);
3659
3659
  }, r = (p) => {
3660
3660
  if (!this._enabled || !this._domElement || this._lockedPointer)
3661
3661
  return;
@@ -3669,7 +3669,7 @@ class ot extends Or {
3669
3669
  const _ = this._findPointerByMouseButton(T);
3670
3670
  _ && this._disposePointer(_);
3671
3671
  }
3672
- const O = {
3672
+ const g = {
3673
3673
  pointerId: 1,
3674
3674
  clientX: p.clientX,
3675
3675
  clientY: p.clientY,
@@ -3677,12 +3677,12 @@ class ot extends Or {
3677
3677
  deltaY: 0,
3678
3678
  mouseButton: (p.buttons & V.LEFT) === V.LEFT ? V.LEFT : (p.buttons & V.MIDDLE) === V.LEFT ? V.MIDDLE : (p.buttons & V.RIGHT) === V.LEFT ? V.RIGHT : null
3679
3679
  };
3680
- this._activePointers.push(O), this._domElement.ownerDocument.removeEventListener("mousemove", c), this._domElement.ownerDocument.removeEventListener("mouseup", d), this._domElement.ownerDocument.addEventListener("mousemove", c), this._domElement.ownerDocument.addEventListener("mouseup", d), this._isDragging = !0, R(p);
3680
+ this._activePointers.push(g), this._domElement.ownerDocument.removeEventListener("mousemove", c), this._domElement.ownerDocument.removeEventListener("mouseup", d), this._domElement.ownerDocument.addEventListener("mousemove", c), this._domElement.ownerDocument.addEventListener("mouseup", d), this._isDragging = !0, R(p);
3681
3681
  }, a = (p) => {
3682
3682
  p.cancelable && p.preventDefault();
3683
- const T = p.pointerId, O = this._lockedPointer || this._findPointerById(T);
3684
- if (O) {
3685
- if (O.clientX = p.clientX, O.clientY = p.clientY, O.deltaX = p.movementX, O.deltaY = p.movementY, this._state = 0, p.pointerType === "touch")
3683
+ const T = p.pointerId, g = this._lockedPointer || this._findPointerById(T);
3684
+ if (g) {
3685
+ if (g.clientX = p.clientX, g.clientY = p.clientY, g.deltaX = p.movementX, g.deltaY = p.movementY, this._state = 0, p.pointerType === "touch")
3686
3686
  switch (this._activePointers.length) {
3687
3687
  case 1:
3688
3688
  this._state = this.touches.one;
@@ -3732,15 +3732,15 @@ class ot extends Or {
3732
3732
  if (!this._domElement || !this._enabled || this.mouseButtons.wheel === P.NONE)
3733
3733
  return;
3734
3734
  if (this._interactiveArea.left !== 0 || this._interactiveArea.top !== 0 || this._interactiveArea.width !== 1 || this._interactiveArea.height !== 1) {
3735
- const N = this._domElement.getBoundingClientRect(), L = p.clientX / N.width, w = p.clientY / N.height;
3736
- if (L < this._interactiveArea.left || L > this._interactiveArea.right || w < this._interactiveArea.top || w > this._interactiveArea.bottom)
3735
+ const N = this._domElement.getBoundingClientRect(), y = p.clientX / N.width, w = p.clientY / N.height;
3736
+ if (y < this._interactiveArea.left || y > this._interactiveArea.right || w < this._interactiveArea.top || w > this._interactiveArea.bottom)
3737
3737
  return;
3738
3738
  }
3739
3739
  if (p.preventDefault(), this.dollyToCursor || this.mouseButtons.wheel === P.ROTATE || this.mouseButtons.wheel === P.TRUCK) {
3740
3740
  const N = performance.now();
3741
3741
  E - N < 1e3 && this._getClientRect(this._elementRect), E = N;
3742
3742
  }
3743
- const T = _r ? -1 : -3, O = p.deltaMode === 1 ? p.deltaY / T : p.deltaY / (T * 10), _ = this.dollyToCursor ? (p.clientX - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, S = this.dollyToCursor ? (p.clientY - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0;
3743
+ const T = _r ? -1 : -3, g = p.deltaMode === 1 ? p.deltaY / T : p.deltaY / (T * 10), _ = this.dollyToCursor ? (p.clientX - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, S = this.dollyToCursor ? (p.clientY - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0;
3744
3744
  switch (this.mouseButtons.wheel) {
3745
3745
  case P.ROTATE: {
3746
3746
  this._rotateInternal(p.deltaX, p.deltaY), this._isUserControllingRotate = !0;
@@ -3755,11 +3755,11 @@ class ot extends Or {
3755
3755
  break;
3756
3756
  }
3757
3757
  case P.DOLLY: {
3758
- this._dollyInternal(-O, _, S), this._isUserControllingDolly = !0;
3758
+ this._dollyInternal(-g, _, S), this._isUserControllingDolly = !0;
3759
3759
  break;
3760
3760
  }
3761
3761
  case P.ZOOM: {
3762
- this._zoomInternal(-O, _, S), this._isUserControllingZoom = !0;
3762
+ this._zoomInternal(-g, _, S), this._isUserControllingZoom = !0;
3763
3763
  break;
3764
3764
  }
3765
3765
  }
@@ -3767,8 +3767,8 @@ class ot extends Or {
3767
3767
  }, f = (p) => {
3768
3768
  if (!(!this._domElement || !this._enabled)) {
3769
3769
  if (this.mouseButtons.right === ot.ACTION.NONE) {
3770
- const T = p instanceof PointerEvent ? p.pointerId : (p instanceof MouseEvent, 0), O = this._findPointerById(T);
3771
- O && this._disposePointer(O), this._domElement.ownerDocument.removeEventListener("pointermove", a, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("pointerup", h), this._domElement.ownerDocument.removeEventListener("mousemove", c), this._domElement.ownerDocument.removeEventListener("mouseup", d);
3770
+ const T = p instanceof PointerEvent ? p.pointerId : (p instanceof MouseEvent, 0), g = this._findPointerById(T);
3771
+ g && this._disposePointer(g), this._domElement.ownerDocument.removeEventListener("pointermove", a, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("pointerup", h), this._domElement.ownerDocument.removeEventListener("mousemove", c), this._domElement.ownerDocument.removeEventListener("mouseup", d);
3772
3772
  return;
3773
3773
  }
3774
3774
  p.preventDefault();
@@ -3777,10 +3777,10 @@ class ot extends Or {
3777
3777
  if (!this._enabled)
3778
3778
  return;
3779
3779
  if ($s(this._activePointers, lt), this._getClientRect(this._elementRect), e.copy(lt), i.copy(lt), this._activePointers.length >= 2) {
3780
- const O = lt.x - this._activePointers[1].clientX, _ = lt.y - this._activePointers[1].clientY, S = Math.sqrt(O * O + _ * _);
3780
+ const g = lt.x - this._activePointers[1].clientX, _ = lt.y - this._activePointers[1].clientY, S = Math.sqrt(g * g + _ * _);
3781
3781
  o.set(0, S);
3782
- const N = (this._activePointers[0].clientX + this._activePointers[1].clientX) * 0.5, L = (this._activePointers[0].clientY + this._activePointers[1].clientY) * 0.5;
3783
- i.set(N, L);
3782
+ const N = (this._activePointers[0].clientX + this._activePointers[1].clientX) * 0.5, y = (this._activePointers[0].clientY + this._activePointers[1].clientY) * 0.5;
3783
+ i.set(N, y);
3784
3784
  }
3785
3785
  if (this._state = 0, !p)
3786
3786
  this._lockedPointer && (this._state = this._state | this.mouseButtons.left);
@@ -3803,18 +3803,18 @@ class ot extends Or {
3803
3803
  if (!this._enabled || !this._dragNeedsUpdate)
3804
3804
  return;
3805
3805
  this._dragNeedsUpdate = !1, $s(this._activePointers, lt);
3806
- const T = this._domElement && document.pointerLockElement === this._domElement ? this._lockedPointer || this._activePointers[0] : null, O = T ? -T.deltaX : i.x - lt.x, _ = T ? -T.deltaY : i.y - lt.y;
3807
- 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, _), this._isUserControllingRotate = !0), (this._state & P.DOLLY) === P.DOLLY || (this._state & P.ZOOM) === P.ZOOM) {
3808
- const S = 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;
3809
- (this._state & P.DOLLY) === P.DOLLY ? (this._dollyInternal(L * _ * Es, S, N), this._isUserControllingDolly = !0) : (this._zoomInternal(L * _ * Es, S, N), this._isUserControllingZoom = !0);
3806
+ const T = this._domElement && document.pointerLockElement === this._domElement ? this._lockedPointer || this._activePointers[0] : null, g = T ? -T.deltaX : i.x - lt.x, _ = T ? -T.deltaY : i.y - lt.y;
3807
+ 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(g, _), this._isUserControllingRotate = !0), (this._state & P.DOLLY) === P.DOLLY || (this._state & P.ZOOM) === P.ZOOM) {
3808
+ const S = 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, y = this.dollyDragInverted ? -1 : 1;
3809
+ (this._state & P.DOLLY) === P.DOLLY ? (this._dollyInternal(y * _ * Es, S, N), this._isUserControllingDolly = !0) : (this._zoomInternal(y * _ * Es, S, N), this._isUserControllingZoom = !0);
3810
3810
  }
3811
3811
  if ((this._state & P.TOUCH_DOLLY) === P.TOUCH_DOLLY || (this._state & P.TOUCH_ZOOM) === P.TOUCH_ZOOM || (this._state & P.TOUCH_DOLLY_TRUCK) === P.TOUCH_DOLLY_TRUCK || (this._state & P.TOUCH_ZOOM_TRUCK) === P.TOUCH_ZOOM_TRUCK || (this._state & P.TOUCH_DOLLY_OFFSET) === P.TOUCH_DOLLY_OFFSET || (this._state & P.TOUCH_ZOOM_OFFSET) === P.TOUCH_ZOOM_OFFSET || (this._state & P.TOUCH_DOLLY_ROTATE) === P.TOUCH_DOLLY_ROTATE || (this._state & P.TOUCH_ZOOM_ROTATE) === P.TOUCH_ZOOM_ROTATE) {
3812
- const S = lt.x - this._activePointers[1].clientX, N = lt.y - this._activePointers[1].clientY, L = Math.sqrt(S * S + N * N), w = o.y - L;
3813
- o.set(0, L);
3814
- const y = this.dollyToCursor ? (i.x - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, U = this.dollyToCursor ? (i.y - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0;
3815
- (this._state & P.TOUCH_DOLLY) === P.TOUCH_DOLLY || (this._state & P.TOUCH_DOLLY_ROTATE) === P.TOUCH_DOLLY_ROTATE || (this._state & P.TOUCH_DOLLY_TRUCK) === P.TOUCH_DOLLY_TRUCK || (this._state & P.TOUCH_DOLLY_OFFSET) === P.TOUCH_DOLLY_OFFSET ? (this._dollyInternal(w * Es, y, U), this._isUserControllingDolly = !0) : (this._zoomInternal(w * Es, y, U), this._isUserControllingZoom = !0);
3812
+ const S = lt.x - this._activePointers[1].clientX, N = lt.y - this._activePointers[1].clientY, y = Math.sqrt(S * S + N * N), w = o.y - y;
3813
+ o.set(0, y);
3814
+ const L = this.dollyToCursor ? (i.x - this._elementRect.x) / this._elementRect.width * 2 - 1 : 0, U = this.dollyToCursor ? (i.y - this._elementRect.y) / this._elementRect.height * -2 + 1 : 0;
3815
+ (this._state & P.TOUCH_DOLLY) === P.TOUCH_DOLLY || (this._state & P.TOUCH_DOLLY_ROTATE) === P.TOUCH_DOLLY_ROTATE || (this._state & P.TOUCH_DOLLY_TRUCK) === P.TOUCH_DOLLY_TRUCK || (this._state & P.TOUCH_DOLLY_OFFSET) === P.TOUCH_DOLLY_OFFSET ? (this._dollyInternal(w * Es, L, U), this._isUserControllingDolly = !0) : (this._zoomInternal(w * Es, L, U), this._isUserControllingZoom = !0);
3816
3816
  }
3817
- ((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, _, !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, _, !0), this._isUserControllingOffset = !0), this.dispatchEvent({ type: "control" });
3817
+ ((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(g, _, !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(g, _, !0), this._isUserControllingOffset = !0), this.dispatchEvent({ type: "control" });
3818
3818
  }, C = () => {
3819
3819
  $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", h), this._domElement.ownerDocument.removeEventListener("mouseup", d), this.dispatchEvent({ type: "controlend" }));
3820
3820
  };
@@ -4137,8 +4137,8 @@ class ot extends Or {
4137
4137
  * @category Methods
4138
4138
  */
4139
4139
  truck(s, t, e = !1) {
4140
- this._camera.updateMatrix(), gt.setFromMatrixColumn(this._camera.matrix, 0), _t.setFromMatrixColumn(this._camera.matrix, 1), gt.multiplyScalar(s), _t.multiplyScalar(-t);
4141
- const i = G.copy(gt).add(_t), o = z.copy(this._targetEnd).add(i);
4140
+ this._camera.updateMatrix(), Ot.setFromMatrixColumn(this._camera.matrix, 0), _t.setFromMatrixColumn(this._camera.matrix, 1), Ot.multiplyScalar(s), _t.multiplyScalar(-t);
4141
+ const i = G.copy(Ot).add(_t), o = z.copy(this._targetEnd).add(i);
4142
4142
  return this.moveTo(o.x, o.y, o.z, e);
4143
4143
  }
4144
4144
  /**
@@ -4279,11 +4279,11 @@ class ot extends Or {
4279
4279
  const R = G.set(i, o, n), m = z.set(s, t, e);
4280
4280
  ut.setFromVector3(m.sub(R).applyQuaternion(this._yAxisUpSpace));
4281
4281
  const C = Ee.set(h, d, E), A = z.set(r, a, c);
4282
- ye.setFromVector3(A.sub(C).applyQuaternion(this._yAxisUpSpace)), this._targetEnd.copy(R.lerp(C, u));
4283
- const F = ye.theta - ut.theta, p = ye.phi - ut.phi, T = ye.radius - ut.radius;
4282
+ Me.setFromVector3(A.sub(C).applyQuaternion(this._yAxisUpSpace)), this._targetEnd.copy(R.lerp(C, u));
4283
+ const F = Me.theta - ut.theta, p = Me.phi - ut.phi, T = Me.radius - ut.radius;
4284
4284
  this._sphericalEnd.set(ut.radius + T * u, ut.phi + p * u, ut.theta + F * u), this.normalizeRotations(), this._needsUpdate = !0, f || (this._target.copy(this._targetEnd), this._spherical.copy(this._sphericalEnd));
4285
- const O = !f || k(this._target.x, this._targetEnd.x, this.restThreshold) && k(this._target.y, this._targetEnd.y, this.restThreshold) && k(this._target.z, this._targetEnd.z, this.restThreshold) && k(this._spherical.theta, this._sphericalEnd.theta, this.restThreshold) && k(this._spherical.phi, this._sphericalEnd.phi, this.restThreshold) && k(this._spherical.radius, this._sphericalEnd.radius, this.restThreshold);
4286
- return this._createOnRestPromise(O);
4285
+ const g = !f || k(this._target.x, this._targetEnd.x, this.restThreshold) && k(this._target.y, this._targetEnd.y, this.restThreshold) && k(this._target.z, this._targetEnd.z, this.restThreshold) && k(this._spherical.theta, this._sphericalEnd.theta, this.restThreshold) && k(this._spherical.phi, this._sphericalEnd.phi, this.restThreshold) && k(this._spherical.radius, this._sphericalEnd.radius, this.restThreshold);
4286
+ return this._createOnRestPromise(g);
4287
4287
  }
4288
4288
  /**
4289
4289
  * Set angle and distance by given position.
@@ -4332,9 +4332,9 @@ class ot extends Or {
4332
4332
  * @category Methods
4333
4333
  */
4334
4334
  setOrbitPoint(s, t, e) {
4335
- this._camera.updateMatrixWorld(), gt.setFromMatrixColumn(this._camera.matrixWorldInverse, 0), _t.setFromMatrixColumn(this._camera.matrixWorldInverse, 1), Qt.setFromMatrixColumn(this._camera.matrixWorldInverse, 2);
4335
+ this._camera.updateMatrixWorld(), Ot.setFromMatrixColumn(this._camera.matrixWorldInverse, 0), _t.setFromMatrixColumn(this._camera.matrixWorldInverse, 1), Qt.setFromMatrixColumn(this._camera.matrixWorldInverse, 2);
4336
4336
  const i = G.set(s, t, e), o = i.distanceTo(this._camera.position), n = i.sub(this._camera.position);
4337
- gt.multiplyScalar(n.x), _t.multiplyScalar(n.y), Qt.multiplyScalar(n.z), G.copy(gt).add(_t).add(Qt), G.z = G.z + o, this.dollyTo(o, !1), this.setFocalOffset(-G.x, G.y, -G.z, !1), this.moveTo(s, t, e, !1);
4337
+ Ot.multiplyScalar(n.x), _t.multiplyScalar(n.y), Qt.multiplyScalar(n.z), G.copy(Ot).add(_t).add(Qt), G.z = G.z + o, this.dollyTo(o, !1), this.setFocalOffset(-G.x, G.y, -G.z, !1), this.moveTo(s, t, e, !1);
4338
4338
  }
4339
4339
  /**
4340
4340
  * Set the boundary box that encloses the target of the camera. box3 is in THREE.Box3
@@ -4375,7 +4375,7 @@ class ot extends Or {
4375
4375
  getDistanceToFitBox(s, t, e, i = !1) {
4376
4376
  if (Js(this._camera, "getDistanceToFitBox"))
4377
4377
  return this._spherical.radius;
4378
- const o = s / t, n = this._camera.getEffectiveFOV() * Se, r = this._camera.aspect;
4378
+ const o = s / t, n = this._camera.getEffectiveFOV() * Ne, r = this._camera.aspect;
4379
4379
  return ((i ? o > r : o < r) ? t : s / r) * 0.5 / Math.tan(n * 0.5) + e * 0.5;
4380
4380
  }
4381
4381
  /**
@@ -4387,7 +4387,7 @@ class ot extends Or {
4387
4387
  getDistanceToFitSphere(s) {
4388
4388
  if (Js(this._camera, "getDistanceToFitSphere"))
4389
4389
  return this._spherical.radius;
4390
- const t = this._camera.getEffectiveFOV() * Se, e = Math.atan(Math.tan(t * 0.5) * this._camera.aspect) * 2, i = 1 < this._camera.aspect ? t : e;
4390
+ 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;
4391
4391
  return s / Math.sin(i * 0.5);
4392
4392
  }
4393
4393
  /**
@@ -4526,8 +4526,8 @@ class ot extends Or {
4526
4526
  if (Zt(this._camera) && this._changedDolly !== 0) {
4527
4527
  const d = this._spherical.radius - this._lastDistance, E = this._camera, u = this._getCameraDirection(Le), f = G.copy(u).cross(E.up).normalize();
4528
4528
  f.lengthSq() === 0 && (f.x = 1);
4529
- const R = z.crossVectors(f, u), m = this._sphericalEnd.radius * Math.tan(E.getEffectiveFOV() * Se * 0.5), A = (this._sphericalEnd.radius - d - this._sphericalEnd.radius) / this._sphericalEnd.radius, F = Ee.copy(this._targetEnd).add(f.multiplyScalar(this._dollyControlCoord.x * m * E.aspect)).add(R.multiplyScalar(this._dollyControlCoord.y * m)), p = G.copy(this._targetEnd).lerp(F, A), T = this._lastDollyDirection === le.IN && this._spherical.radius <= this.minDistance, O = this._lastDollyDirection === le.OUT && this.maxDistance <= this._spherical.radius;
4530
- if (this.infinityDolly && (T || O)) {
4529
+ const R = z.crossVectors(f, u), m = this._sphericalEnd.radius * Math.tan(E.getEffectiveFOV() * Ne * 0.5), A = (this._sphericalEnd.radius - d - this._sphericalEnd.radius) / this._sphericalEnd.radius, F = Ee.copy(this._targetEnd).add(f.multiplyScalar(this._dollyControlCoord.x * m * E.aspect)).add(R.multiplyScalar(this._dollyControlCoord.y * m)), p = G.copy(this._targetEnd).lerp(F, A), T = this._lastDollyDirection === le.IN && this._spherical.radius <= this.minDistance, g = this._lastDollyDirection === le.OUT && this.maxDistance <= this._spherical.radius;
4530
+ if (this.infinityDolly && (T || g)) {
4531
4531
  this._sphericalEnd.radius -= d, this._spherical.radius -= d;
4532
4532
  const S = z.copy(u).multiplyScalar(-d);
4533
4533
  p.add(S);
@@ -4536,15 +4536,15 @@ class ot extends Or {
4536
4536
  const _ = z.subVectors(p, this._targetEnd);
4537
4537
  this._targetEnd.copy(p), this._target.add(_), this._changedDolly -= d, X(this._changedDolly) && (this._changedDolly = 0);
4538
4538
  } else if (bt(this._camera) && this._changedZoom !== 0) {
4539
- const d = this._zoom - this._lastZoom, E = this._camera, u = G.set(this._dollyControlCoord.x, this._dollyControlCoord.y, (E.near + E.far) / (E.near - E.far)).unproject(E), f = z.set(0, 0, -1).applyQuaternion(E.quaternion), R = Ee.copy(u).add(f.multiplyScalar(-u.dot(E.up))), C = -(this._zoom - d - this._zoom) / this._zoom, A = this._getCameraDirection(Le), F = this._targetEnd.dot(A), p = G.copy(this._targetEnd).lerp(R, C), T = p.dot(A), O = A.multiplyScalar(T - F);
4540
- p.sub(O), this._boundary.clampPoint(p, p);
4539
+ const d = this._zoom - this._lastZoom, E = this._camera, u = G.set(this._dollyControlCoord.x, this._dollyControlCoord.y, (E.near + E.far) / (E.near - E.far)).unproject(E), f = z.set(0, 0, -1).applyQuaternion(E.quaternion), R = Ee.copy(u).add(f.multiplyScalar(-u.dot(E.up))), C = -(this._zoom - d - this._zoom) / this._zoom, A = this._getCameraDirection(Le), F = this._targetEnd.dot(A), p = G.copy(this._targetEnd).lerp(R, C), T = p.dot(A), g = A.multiplyScalar(T - F);
4540
+ p.sub(g), this._boundary.clampPoint(p, p);
4541
4541
  const _ = z.subVectors(p, this._targetEnd);
4542
4542
  this._targetEnd.copy(p), this._target.add(_), this._changedZoom -= d, X(this._changedZoom) && (this._changedZoom = 0);
4543
4543
  }
4544
4544
  }
4545
4545
  this._camera.zoom !== this._zoom && (this._camera.zoom = this._zoom, this._camera.updateProjectionMatrix(), this._updateNearPlaneCorners(), this._needsUpdate = !0), this._dragNeedsUpdate = !0;
4546
4546
  const a = this._collisionTest();
4547
- this._spherical.radius = Math.min(this._spherical.radius, a), this._spherical.makeSafe(), this._camera.position.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(this._target), this._camera.lookAt(this._target), (!X(this._focalOffset.x) || !X(this._focalOffset.y) || !X(this._focalOffset.z)) && (this._camera.updateMatrixWorld(), gt.setFromMatrixColumn(this._camera.matrix, 0), _t.setFromMatrixColumn(this._camera.matrix, 1), Qt.setFromMatrixColumn(this._camera.matrix, 2), gt.multiplyScalar(this._focalOffset.x), _t.multiplyScalar(-this._focalOffset.y), Qt.multiplyScalar(this._focalOffset.z), G.copy(gt).add(_t).add(Qt), this._camera.position.add(G)), this._boundaryEnclosesCamera && this._encloseToBoundary(this._camera.position.copy(this._target), G.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse), 1);
4547
+ this._spherical.radius = Math.min(this._spherical.radius, a), this._spherical.makeSafe(), this._camera.position.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(this._target), this._camera.lookAt(this._target), (!X(this._focalOffset.x) || !X(this._focalOffset.y) || !X(this._focalOffset.z)) && (this._camera.updateMatrixWorld(), Ot.setFromMatrixColumn(this._camera.matrix, 0), _t.setFromMatrixColumn(this._camera.matrix, 1), Qt.setFromMatrixColumn(this._camera.matrix, 2), Ot.multiplyScalar(this._focalOffset.x), _t.multiplyScalar(-this._focalOffset.y), Qt.multiplyScalar(this._focalOffset.z), G.copy(Ot).add(_t).add(Qt), this._camera.position.add(G)), this._boundaryEnclosesCamera && this._encloseToBoundary(this._camera.position.copy(this._target), G.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse), 1);
4548
4548
  const h = this._needsUpdate;
4549
4549
  return h && !this._updatedLastTime ? (this._hasRested = !1, this.dispatchEvent({ type: "wake" }), this.dispatchEvent({ type: "update" })) : h ? (this.dispatchEvent({ type: "update" }), X(t, this.restThreshold) && X(e, this.restThreshold) && X(i, this.restThreshold) && X(o.x, this.restThreshold) && X(o.y, this.restThreshold) && X(o.z, this.restThreshold) && X(n.x, this.restThreshold) && X(n.y, this.restThreshold) && X(n.z, this.restThreshold) && X(r, this.restThreshold) && !this._hasRested && (this._hasRested = !0, this.dispatchEvent({ type: "rest" }))) : !h && this._updatedLastTime && this.dispatchEvent({ type: "sleep" }), this._lastDistance = this._spherical.radius, this._lastZoom = this._zoom, this._updatedLastTime = h, this._needsUpdate = !1, h;
4550
4550
  }
@@ -4556,13 +4556,13 @@ class ot extends Or {
4556
4556
  return JSON.stringify({
4557
4557
  enabled: this._enabled,
4558
4558
  minDistance: this.minDistance,
4559
- maxDistance: Ne(this.maxDistance),
4559
+ maxDistance: Pe(this.maxDistance),
4560
4560
  minZoom: this.minZoom,
4561
- maxZoom: Ne(this.maxZoom),
4561
+ maxZoom: Pe(this.maxZoom),
4562
4562
  minPolarAngle: this.minPolarAngle,
4563
- maxPolarAngle: Ne(this.maxPolarAngle),
4564
- minAzimuthAngle: Ne(this.minAzimuthAngle),
4565
- maxAzimuthAngle: Ne(this.maxAzimuthAngle),
4563
+ maxPolarAngle: Pe(this.maxPolarAngle),
4564
+ minAzimuthAngle: Pe(this.minAzimuthAngle),
4565
+ maxAzimuthAngle: Pe(this.maxAzimuthAngle),
4566
4566
  smoothTime: this.smoothTime,
4567
4567
  draggingSmoothTime: this.draggingSmoothTime,
4568
4568
  dollySpeed: this.dollySpeed,
@@ -4587,7 +4587,7 @@ class ot extends Or {
4587
4587
  */
4588
4588
  fromJSON(s, t = !1) {
4589
4589
  const e = JSON.parse(s);
4590
- this.enabled = e.enabled, this.minDistance = e.minDistance, this.maxDistance = Pe(e.maxDistance), this.minZoom = e.minZoom, this.maxZoom = Pe(e.maxZoom), this.minPolarAngle = e.minPolarAngle, this.maxPolarAngle = Pe(e.maxPolarAngle), this.minAzimuthAngle = Pe(e.minAzimuthAngle), this.maxAzimuthAngle = Pe(e.maxAzimuthAngle), this.smoothTime = e.smoothTime, this.draggingSmoothTime = e.draggingSmoothTime, this.dollySpeed = e.dollySpeed, this.truckSpeed = e.truckSpeed, this.dollyToCursor = e.dollyToCursor, this.verticalDragToForward = e.verticalDragToForward, this._target0.fromArray(e.target0), this._position0.fromArray(e.position0), this._zoom0 = e.zoom0, this._focalOffset0.fromArray(e.focalOffset0), this.moveTo(e.target[0], e.target[1], e.target[2], t), ut.setFromVector3(G.fromArray(e.position).sub(this._targetEnd).applyQuaternion(this._yAxisUpSpace)), this.rotateTo(ut.theta, ut.phi, t), this.dollyTo(ut.radius, t), this.zoomTo(e.zoom, t), this.setFocalOffset(e.focalOffset[0], e.focalOffset[1], e.focalOffset[2], t), this._needsUpdate = !0;
4590
+ this.enabled = e.enabled, this.minDistance = e.minDistance, this.maxDistance = ye(e.maxDistance), this.minZoom = e.minZoom, this.maxZoom = ye(e.maxZoom), this.minPolarAngle = e.minPolarAngle, this.maxPolarAngle = ye(e.maxPolarAngle), this.minAzimuthAngle = ye(e.minAzimuthAngle), this.maxAzimuthAngle = ye(e.maxAzimuthAngle), this.smoothTime = e.smoothTime, this.draggingSmoothTime = e.draggingSmoothTime, this.dollySpeed = e.dollySpeed, this.truckSpeed = e.truckSpeed, this.dollyToCursor = e.dollyToCursor, this.verticalDragToForward = e.verticalDragToForward, this._target0.fromArray(e.target0), this._position0.fromArray(e.position0), this._zoom0 = e.zoom0, this._focalOffset0.fromArray(e.focalOffset0), this.moveTo(e.target[0], e.target[1], e.target[2], t), ut.setFromVector3(G.fromArray(e.position).sub(this._targetEnd).applyQuaternion(this._yAxisUpSpace)), this.rotateTo(ut.theta, ut.phi, t), this.dollyTo(ut.radius, t), this.zoomTo(e.zoom, t), this.setFocalOffset(e.focalOffset[0], e.focalOffset[1], e.focalOffset[2], t), this._needsUpdate = !0;
4591
4591
  }
4592
4592
  /**
4593
4593
  * Attach all internal event handlers to enable drag control.
@@ -4598,7 +4598,7 @@ class ot extends Or {
4598
4598
  console.warn("camera-controls is already connected.");
4599
4599
  return;
4600
4600
  }
4601
- s.setAttribute("data-camera-controls-version", gr), this._addAllEventListeners(s), this._getClientRect(this._elementRect);
4601
+ s.setAttribute("data-camera-controls-version", Or), this._addAllEventListeners(s), this._getClientRect(this._elementRect);
4602
4602
  }
4603
4603
  /**
4604
4604
  * Detach all internal event handlers to disable drag control.
@@ -4648,7 +4648,7 @@ class ot extends Or {
4648
4648
  }
4649
4649
  _updateNearPlaneCorners() {
4650
4650
  if (Zt(this._camera)) {
4651
- const s = this._camera, t = s.near, e = s.getEffectiveFOV() * Se, i = Math.tan(e * 0.5) * t, o = i * s.aspect;
4651
+ const s = this._camera, t = s.near, e = s.getEffectiveFOV() * Ne, i = Math.tan(e * 0.5) * t, o = i * s.aspect;
4652
4652
  this._nearPlaneCorners[0].set(-o, -i, 0), this._nearPlaneCorners[1].set(o, -i, 0), this._nearPlaneCorners[2].set(o, i, 0), this._nearPlaneCorners[3].set(-o, i, 0);
4653
4653
  } else if (bt(this._camera)) {
4654
4654
  const s = this._camera, t = 1 / s.zoom, e = s.left * t, i = s.right * t, o = s.top * t, n = s.bottom * t;
@@ -4743,7 +4743,7 @@ class ot extends Or {
4743
4743
  }), e.radius = Math.sqrt(o), e;
4744
4744
  }
4745
4745
  }
4746
- class He extends ar {
4746
+ class ke extends ar {
4747
4747
  constructor(t) {
4748
4748
  super(t);
4749
4749
  /** {@link Updateable.onBeforeUpdate} */
@@ -4770,7 +4770,7 @@ class He extends ar {
4770
4770
  I(this, "updateAspect", () => {
4771
4771
  var t;
4772
4772
  if (!(!this.currentWorld || !this.currentWorld.renderer)) {
4773
- if (this.three instanceof g.OrthographicCamera) {
4773
+ if (this.three instanceof O.OrthographicCamera) {
4774
4774
  this.onAspectUpdated.trigger();
4775
4775
  return;
4776
4776
  }
@@ -4835,15 +4835,15 @@ class He extends ar {
4835
4835
  this.enabled && (this.onBeforeUpdate.trigger(this), this.controls.update(t), this.onAfterUpdate.trigger(this));
4836
4836
  }
4837
4837
  setupCamera() {
4838
- const t = window.innerWidth / window.innerHeight, e = new g.PerspectiveCamera(60, t, 1, 1e3);
4839
- return e.position.set(50, 50, 50), e.lookAt(new g.Vector3(0, 0, 0)), e;
4838
+ const t = window.innerWidth / window.innerHeight, e = new O.PerspectiveCamera(60, t, 1, 1e3);
4839
+ return e.position.set(50, 50, 50), e.lookAt(new O.Vector3(0, 0, 0)), e;
4840
4840
  }
4841
4841
  newCameraControls() {
4842
4842
  if (!this.currentWorld)
4843
4843
  throw new Error("This camera needs a world to work!");
4844
4844
  if (!this.currentWorld.renderer)
4845
4845
  throw new Error("This camera needs a renderer to work!");
4846
- ot.install({ THREE: He.getSubsetOfThree() });
4846
+ ot.install({ THREE: ke.getSubsetOfThree() });
4847
4847
  const { domElement: t } = this.currentWorld.renderer.three, e = new ot(this.three, t);
4848
4848
  return e.smoothTime = 0.2, e.dollyToCursor = !0, e.infinityDolly = !0, e;
4849
4849
  }
@@ -4852,21 +4852,21 @@ class He extends ar {
4852
4852
  }
4853
4853
  static getSubsetOfThree() {
4854
4854
  return {
4855
- MOUSE: g.MOUSE,
4856
- Vector2: g.Vector2,
4857
- Vector3: g.Vector3,
4858
- Vector4: g.Vector4,
4859
- Quaternion: g.Quaternion,
4860
- Matrix4: g.Matrix4,
4861
- Spherical: g.Spherical,
4862
- Box3: g.Box3,
4863
- Sphere: g.Sphere,
4864
- Raycaster: g.Raycaster,
4865
- MathUtils: g.MathUtils
4855
+ MOUSE: O.MOUSE,
4856
+ Vector2: O.Vector2,
4857
+ Vector3: O.Vector3,
4858
+ Vector4: O.Vector4,
4859
+ Quaternion: O.Quaternion,
4860
+ Matrix4: O.Matrix4,
4861
+ Spherical: O.Spherical,
4862
+ Box3: O.Box3,
4863
+ Sphere: O.Sphere,
4864
+ Raycaster: O.Raycaster,
4865
+ MathUtils: O.MathUtils
4866
4866
  };
4867
4867
  }
4868
4868
  }
4869
- const gs = class gs extends et {
4869
+ const Os = class Os extends et {
4870
4870
  constructor(t) {
4871
4871
  super(t);
4872
4872
  /** {@link Updateable.onAfterUpdate} */
@@ -4892,7 +4892,7 @@ const gs = class gs extends et {
4892
4892
  I(this, "list", /* @__PURE__ */ new Map());
4893
4893
  /** {@link Component.enabled} */
4894
4894
  I(this, "enabled", !0);
4895
- t.add(gs.uuid, this);
4895
+ t.add(Os.uuid, this);
4896
4896
  }
4897
4897
  /**
4898
4898
  * Creates a new instance of a SimpleWorld and adds it to the list of worlds.
@@ -4948,8 +4948,8 @@ const gs = class gs extends et {
4948
4948
  * A unique identifier for the component.
4949
4949
  * This UUID is used to register the component within the Components system.
4950
4950
  */
4951
- I(gs, "uuid", "fdb61dc4-2ec1-4966-b83d-54ea795fad4a");
4952
- let Ci = gs;
4951
+ I(Os, "uuid", "fdb61dc4-2ec1-4966-b83d-54ea795fad4a");
4952
+ let Ci = Os;
4953
4953
  class Nr {
4954
4954
  constructor(s, t, e) {
4955
4955
  /** {@link Disposable.onDisposed} */
@@ -4962,13 +4962,13 @@ class Nr {
4962
4962
  I(this, "three");
4963
4963
  I(this, "_fade", 3);
4964
4964
  I(this, "updateZoom", () => {
4965
- this.world.camera instanceof He && (this.material.uniforms.uZoom.value = this.world.camera.three.zoom);
4965
+ this.world.camera instanceof ke && (this.material.uniforms.uZoom.value = this.world.camera.three.zoom);
4966
4966
  });
4967
4967
  this.world = t;
4968
4968
  const { color: i, size1: o, size2: n, distance: r } = e;
4969
4969
  this.components = s;
4970
- const a = new g.PlaneGeometry(2, 2, 1, 1), c = new g.ShaderMaterial({
4971
- side: g.DoubleSide,
4970
+ const a = new O.PlaneGeometry(2, 2, 1, 1), c = new O.ShaderMaterial({
4971
+ side: O.DoubleSide,
4972
4972
  uniforms: {
4973
4973
  uSize1: {
4974
4974
  value: o
@@ -5057,7 +5057,7 @@ class Nr {
5057
5057
  derivatives: !0
5058
5058
  }
5059
5059
  });
5060
- this.three = new g.Mesh(a, c), this.three.frustumCulled = !1, t.scene.three.add(this.three), this.setupEvents(!0);
5060
+ this.three = new O.Mesh(a, c), this.three.frustumCulled = !1, t.scene.three.add(this.three), this.setupEvents(!0);
5061
5061
  }
5062
5062
  /** {@link Hideable.visible} */
5063
5063
  get visible() {
@@ -5090,7 +5090,7 @@ class Nr {
5090
5090
  this.setupEvents(!1), this.components.get(zt).destroy(this.three), this.onDisposed.trigger(), this.onDisposed.reset(), this.world = null, this.components = null;
5091
5091
  }
5092
5092
  setupEvents(s) {
5093
- if (this.world.isDisposing || !(this.world.camera instanceof He))
5093
+ if (this.world.isDisposing || !(this.world.camera instanceof ke))
5094
5094
  return;
5095
5095
  const t = this.world.camera.controls;
5096
5096
  s ? t.addEventListener("update", this.updateZoom) : t.removeEventListener("update", this.updateZoom);
@@ -5107,7 +5107,7 @@ const _s = class _s extends et {
5107
5107
  * The default configuration for grid creation.
5108
5108
  */
5109
5109
  I(this, "config", {
5110
- color: new g.Color(12303291),
5110
+ color: new O.Color(12303291),
5111
5111
  size1: 1,
5112
5112
  size2: 10,
5113
5113
  distance: 500
@@ -5188,7 +5188,7 @@ class Pr extends ri {
5188
5188
  }
5189
5189
  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);
5190
5190
  const r = new M(), a = new M(), c = new Pt(), h = new Pt(), d = new M(), E = new Pt(), u = new M(), f = new M(), R = new M(), m = 0, C = new M();
5191
- n("worldPosition", r), n("worldPositionStart", a), n("worldQuaternion", c), n("worldQuaternionStart", h), n("cameraPosition", d), n("cameraQuaternion", E), n("pointStart", u), n("pointEnd", f), n("rotationAxis", R), n("rotationAngle", m), n("eye", C), this._offset = new M(), this._startNorm = new M(), this._endNorm = new M(), this._cameraScale = new M(), this._parentPosition = new M(), this._parentQuaternion = new Pt(), this._parentQuaternionInv = new Pt(), this._parentScale = new M(), this._worldScaleStart = new M(), this._worldQuaternionInv = new Pt(), this._worldScale = new M(), this._positionStart = new M(), this._quaternionStart = new Pt(), this._scaleStart = new M(), this._getPointer = Lr.bind(this), this._onPointerDown = Mr.bind(this), this._onPointerHover = yr.bind(this), this._onPointerMove = wr.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);
5191
+ n("worldPosition", r), n("worldPositionStart", a), n("worldQuaternion", c), n("worldQuaternionStart", h), n("cameraPosition", d), n("cameraQuaternion", E), n("pointStart", u), n("pointEnd", f), n("rotationAxis", R), n("rotationAngle", m), n("eye", C), this._offset = new M(), this._startNorm = new M(), this._endNorm = new M(), this._cameraScale = new M(), this._parentPosition = new M(), this._parentQuaternion = new Pt(), this._parentQuaternionInv = new Pt(), this._parentScale = new M(), this._worldScaleStart = new M(), this._worldQuaternionInv = new Pt(), this._worldScale = new M(), this._positionStart = new M(), this._quaternionStart = new Pt(), this._scaleStart = new M(), this._getPointer = yr.bind(this), this._onPointerDown = Mr.bind(this), this._onPointerHover = Lr.bind(this), this._onPointerMove = wr.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);
5192
5192
  }
5193
5193
  // updateMatrixWorld updates key transformation variables
5194
5194
  updateMatrixWorld() {
@@ -5279,7 +5279,7 @@ class Pr extends ri {
5279
5279
  this.space = s;
5280
5280
  }
5281
5281
  }
5282
- function Lr(l) {
5282
+ function yr(l) {
5283
5283
  if (this.domElement.ownerDocument.pointerLockElement)
5284
5284
  return {
5285
5285
  x: 0,
@@ -5295,7 +5295,7 @@ function Lr(l) {
5295
5295
  };
5296
5296
  }
5297
5297
  }
5298
- function yr(l) {
5298
+ function Lr(l) {
5299
5299
  if (this.enabled)
5300
5300
  switch (l.pointerType) {
5301
5301
  case "mouse":
@@ -5320,11 +5320,11 @@ function oi(l, s, t) {
5320
5320
  return e[i];
5321
5321
  return !1;
5322
5322
  }
5323
- const Is = new qn(), W = new M(0, 1, 0), Cn = new M(0, 0, 0), Tn = new yt(), fs = new Pt(), Rs = new Pt(), St = new M(), mn = new yt(), De = new M(1, 0, 0), qt = new M(0, 1, 0), Ue = new M(0, 0, 1), ps = new M(), Me = new M(), we = new M();
5323
+ const Is = new qn(), W = new M(0, 1, 0), Cn = new M(0, 0, 0), Tn = new Lt(), fs = new Pt(), Rs = new Pt(), St = new M(), mn = new Lt(), Ue = new M(1, 0, 0), qt = new M(0, 1, 0), xe = new M(0, 0, 1), ps = new M(), we = new M(), De = new M();
5324
5324
  class Ur extends ri {
5325
5325
  constructor() {
5326
5326
  super(), this.isTransformControlsGizmo = !0, this.type = "TransformControlsGizmo";
5327
- const s = new yn({
5327
+ const s = new Ln({
5328
5328
  depthTest: !1,
5329
5329
  depthWrite: !1,
5330
5330
  fog: !1,
@@ -5367,7 +5367,7 @@ class Ur extends ri {
5367
5367
  const A = new ct(75e-4, 75e-4, 0.5, 3);
5368
5368
  A.translate(0, 0.25, 0);
5369
5369
  function F(B, H) {
5370
- const q = new me(B, 75e-4, 3, 64, H * Math.PI * 2);
5370
+ const q = new Re(B, 75e-4, 3, 64, H * Math.PI * 2);
5371
5371
  return q.rotateY(Math.PI / 2), q.rotateX(Math.PI / 2), q;
5372
5372
  }
5373
5373
  function p() {
@@ -5402,7 +5402,7 @@ class Ur extends ri {
5402
5402
  XZ: [
5403
5403
  [new v(new rt(0.15, 0.15, 0.01), c.clone()), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
5404
5404
  ]
5405
- }, O = {
5405
+ }, g = {
5406
5406
  X: [
5407
5407
  [new v(new ct(0.2, 0, 0.6, 4), e), [0.3, 0, 0], [0, 0, -Math.PI / 2]],
5408
5408
  [new v(new ct(0.2, 0, 0.6, 4), e), [-0.3, 0, 0], [0, 0, Math.PI / 2]]
@@ -5466,21 +5466,21 @@ class Ur extends ri {
5466
5466
  AXIS: [
5467
5467
  [new Dt(C, i.clone()), [-1e3, 0, 0], null, [1e6, 1, 1], "helper"]
5468
5468
  ]
5469
- }, L = {
5469
+ }, y = {
5470
5470
  XYZE: [
5471
5471
  [new v(new $n(0.25, 10, 8), e)]
5472
5472
  ],
5473
5473
  X: [
5474
- [new v(new me(0.5, 0.1, 4, 24), e), [0, 0, 0], [0, -Math.PI / 2, -Math.PI / 2]]
5474
+ [new v(new Re(0.5, 0.1, 4, 24), e), [0, 0, 0], [0, -Math.PI / 2, -Math.PI / 2]]
5475
5475
  ],
5476
5476
  Y: [
5477
- [new v(new me(0.5, 0.1, 4, 24), e), [0, 0, 0], [Math.PI / 2, 0, 0]]
5477
+ [new v(new Re(0.5, 0.1, 4, 24), e), [0, 0, 0], [Math.PI / 2, 0, 0]]
5478
5478
  ],
5479
5479
  Z: [
5480
- [new v(new me(0.5, 0.1, 4, 24), e), [0, 0, 0], [0, 0, -Math.PI / 2]]
5480
+ [new v(new Re(0.5, 0.1, 4, 24), e), [0, 0, 0], [0, 0, -Math.PI / 2]]
5481
5481
  ],
5482
5482
  E: [
5483
- [new v(new me(0.75, 0.1, 2, 24), e)]
5483
+ [new v(new Re(0.75, 0.1, 2, 24), e)]
5484
5484
  ]
5485
5485
  }, w = {
5486
5486
  X: [
@@ -5510,7 +5510,7 @@ class Ur extends ri {
5510
5510
  XYZ: [
5511
5511
  [new v(new rt(0.1, 0.1, 0.1), d.clone())]
5512
5512
  ]
5513
- }, y = {
5513
+ }, L = {
5514
5514
  X: [
5515
5515
  [new v(new ct(0.2, 0, 0.6, 4), e), [0.3, 0, 0], [0, 0, -Math.PI / 2]],
5516
5516
  [new v(new ct(0.2, 0, 0.6, 4), e), [-0.3, 0, 0], [0, 0, Math.PI / 2]]
@@ -5552,12 +5552,12 @@ class Ur extends ri {
5552
5552
  for (let st = B[q].length; st--; ) {
5553
5553
  const Q = B[q][st][0].clone(), Ht = B[q][st][1], kt = B[q][st][2], Wt = B[q][st][3], We = B[q][st][4];
5554
5554
  Q.name = q, Q.tag = We, Ht && Q.position.set(Ht[0], Ht[1], Ht[2]), kt && Q.rotation.set(kt[0], kt[1], kt[2]), Wt && Q.scale.set(Wt[0], Wt[1], Wt[2]), Q.updateMatrix();
5555
- const Ce = Q.geometry.clone();
5556
- Ce.applyMatrix4(Q.matrix), Q.geometry = Ce, Q.renderOrder = 1 / 0, Q.position.set(0, 0, 0), Q.rotation.set(0, 0, 0), Q.scale.set(1, 1, 1), H.add(Q);
5555
+ const Te = Q.geometry.clone();
5556
+ Te.applyMatrix4(Q.matrix), Q.geometry = Te, Q.renderOrder = 1 / 0, Q.position.set(0, 0, 0), Q.rotation.set(0, 0, 0), Q.scale.set(1, 1, 1), H.add(Q);
5557
5557
  }
5558
5558
  return H;
5559
5559
  }
5560
- this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate = x(T)), this.add(this.gizmo.rotate = x(S)), this.add(this.gizmo.scale = x(w)), this.add(this.picker.translate = x(O)), this.add(this.picker.rotate = x(L)), this.add(this.picker.scale = x(y)), this.add(this.helper.translate = x(_)), this.add(this.helper.rotate = x(N)), this.add(this.helper.scale = x(U)), this.picker.translate.visible = !1, this.picker.rotate.visible = !1, this.picker.scale.visible = !1;
5560
+ this.gizmo = {}, this.picker = {}, this.helper = {}, this.add(this.gizmo.translate = x(T)), this.add(this.gizmo.rotate = x(S)), this.add(this.gizmo.scale = x(w)), this.add(this.picker.translate = x(g)), this.add(this.picker.rotate = x(y)), this.add(this.picker.scale = x(L)), this.add(this.helper.translate = x(_)), this.add(this.helper.rotate = x(N)), this.add(this.helper.scale = x(U)), this.picker.translate.visible = !1, this.picker.rotate.visible = !1, this.picker.scale.visible = !1;
5561
5561
  }
5562
5562
  // updateMatrixWorld will update transformations and appearance of individual handles
5563
5563
  updateMatrixWorld(s) {
@@ -5570,10 +5570,10 @@ class Ur extends ri {
5570
5570
  n.visible = !0, n.rotation.set(0, 0, 0), n.position.copy(this.worldPosition);
5571
5571
  let r;
5572
5572
  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") {
5573
- n.visible = !1, n.name === "AXIS" ? (n.visible = !!this.axis, this.axis === "X" && (j.setFromEuler(Is.set(0, 0, 0)), n.quaternion.copy(e).multiply(j), Math.abs(W.copy(De).applyQuaternion(e).dot(this.eye)) > 0.9 && (n.visible = !1)), this.axis === "Y" && (j.setFromEuler(Is.set(0, 0, Math.PI / 2)), n.quaternion.copy(e).multiply(j), Math.abs(W.copy(qt).applyQuaternion(e).dot(this.eye)) > 0.9 && (n.visible = !1)), this.axis === "Z" && (j.setFromEuler(Is.set(0, Math.PI / 2, 0)), n.quaternion.copy(e).multiply(j), Math.abs(W.copy(Ue).applyQuaternion(e).dot(this.eye)) > 0.9 && (n.visible = !1)), this.axis === "XYZE" && (j.setFromEuler(Is.set(0, Math.PI / 2, 0)), W.copy(this.rotationAxis), n.quaternion.setFromRotationMatrix(Tn.lookAt(Cn, W, qt)), 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));
5573
+ n.visible = !1, n.name === "AXIS" ? (n.visible = !!this.axis, this.axis === "X" && (j.setFromEuler(Is.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(Is.set(0, 0, Math.PI / 2)), n.quaternion.copy(e).multiply(j), Math.abs(W.copy(qt).applyQuaternion(e).dot(this.eye)) > 0.9 && (n.visible = !1)), this.axis === "Z" && (j.setFromEuler(Is.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(Is.set(0, Math.PI / 2, 0)), W.copy(this.rotationAxis), n.quaternion.setFromRotationMatrix(Tn.lookAt(Cn, W, qt)), 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));
5574
5574
  continue;
5575
5575
  }
5576
- n.quaternion.copy(e), this.mode === "translate" || this.mode === "scale" ? (n.name === "X" && Math.abs(W.copy(De).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(qt).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(Ue).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(Ue).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(De).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(qt).applyQuaternion(e).dot(this.eye)) < 0.2 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1)) : this.mode === "rotate" && (fs.copy(e), W.copy(this.eye).applyQuaternion(j.copy(e).invert()), n.name.search("E") !== -1 && n.quaternion.setFromRotationMatrix(Tn.lookAt(this.eye, Cn, qt)), n.name === "X" && (j.setFromAxisAngle(De, Math.atan2(-W.y, W.z)), j.multiplyQuaternions(fs, j), n.quaternion.copy(j)), n.name === "Y" && (j.setFromAxisAngle(qt, Math.atan2(W.x, W.z)), j.multiplyQuaternions(fs, j), n.quaternion.copy(j)), n.name === "Z" && (j.setFromAxisAngle(Ue, Math.atan2(W.y, W.x)), j.multiplyQuaternions(fs, 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) {
5576
+ 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(qt).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(qt).applyQuaternion(e).dot(this.eye)) < 0.2 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1)) : this.mode === "rotate" && (fs.copy(e), W.copy(this.eye).applyQuaternion(j.copy(e).invert()), n.name.search("E") !== -1 && n.quaternion.setFromRotationMatrix(Tn.lookAt(this.eye, Cn, qt)), n.name === "X" && (j.setFromAxisAngle(Ue, Math.atan2(-W.y, W.z)), j.multiplyQuaternions(fs, j), n.quaternion.copy(j)), n.name === "Y" && (j.setFromAxisAngle(qt, Math.atan2(W.x, W.z)), j.multiplyQuaternions(fs, j), n.quaternion.copy(j)), n.name === "Z" && (j.setFromAxisAngle(xe, Math.atan2(W.y, W.x)), j.multiplyQuaternions(fs, 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) {
5577
5577
  return n.name === a;
5578
5578
  })) && (n.material.color.setHex(16776960), n.material.opacity = 1);
5579
5579
  }
@@ -5584,12 +5584,12 @@ class xr extends v {
5584
5584
  constructor() {
5585
5585
  super(
5586
5586
  new Jn(1e5, 1e5, 2, 2),
5587
- new yn({ visible: !1, wireframe: !0, side: Ln, transparent: !0, opacity: 0.1, toneMapped: !1 })
5587
+ new Ln({ visible: !1, wireframe: !0, side: yn, transparent: !0, opacity: 0.1, toneMapped: !1 })
5588
5588
  ), this.isTransformControlsPlane = !0, this.type = "TransformControlsPlane";
5589
5589
  }
5590
5590
  updateMatrixWorld(s) {
5591
5591
  let t = this.space;
5592
- switch (this.position.copy(this.worldPosition), this.mode === "scale" && (t = "local"), ps.copy(De).applyQuaternion(t === "local" ? this.worldQuaternion : Rs), Me.copy(qt).applyQuaternion(t === "local" ? this.worldQuaternion : Rs), we.copy(Ue).applyQuaternion(t === "local" ? this.worldQuaternion : Rs), W.copy(Me), this.mode) {
5592
+ switch (this.position.copy(this.worldPosition), this.mode === "scale" && (t = "local"), ps.copy(Ue).applyQuaternion(t === "local" ? this.worldQuaternion : Rs), we.copy(qt).applyQuaternion(t === "local" ? this.worldQuaternion : Rs), De.copy(xe).applyQuaternion(t === "local" ? this.worldQuaternion : Rs), W.copy(we), this.mode) {
5593
5593
  case "translate":
5594
5594
  case "scale":
5595
5595
  switch (this.axis) {
@@ -5597,19 +5597,19 @@ class xr extends v {
5597
5597
  W.copy(this.eye).cross(ps), St.copy(ps).cross(W);
5598
5598
  break;
5599
5599
  case "Y":
5600
- W.copy(this.eye).cross(Me), St.copy(Me).cross(W);
5600
+ W.copy(this.eye).cross(we), St.copy(we).cross(W);
5601
5601
  break;
5602
5602
  case "Z":
5603
- W.copy(this.eye).cross(we), St.copy(we).cross(W);
5603
+ W.copy(this.eye).cross(De), St.copy(De).cross(W);
5604
5604
  break;
5605
5605
  case "XY":
5606
- St.copy(we);
5606
+ St.copy(De);
5607
5607
  break;
5608
5608
  case "YZ":
5609
5609
  St.copy(ps);
5610
5610
  break;
5611
5611
  case "XZ":
5612
- W.copy(we), St.copy(Me);
5612
+ W.copy(De), St.copy(we);
5613
5613
  break;
5614
5614
  case "XYZ":
5615
5615
  case "E":
@@ -5643,7 +5643,7 @@ class Pi {
5643
5643
  /**
5644
5644
  * The THREE.js Plane object representing the clipping plane.
5645
5645
  */
5646
- I(this, "three", new g.Plane());
5646
+ I(this, "three", new O.Plane());
5647
5647
  /** The components instance to which this plane belongs. */
5648
5648
  I(this, "components");
5649
5649
  /** The world instance to which this plane belongs. */
@@ -5654,10 +5654,10 @@ class Pi {
5654
5654
  I(this, "_visible", !0);
5655
5655
  I(this, "_enabled", !0);
5656
5656
  I(this, "_controlsActive", !1);
5657
- I(this, "_arrowBoundBox", new g.Mesh());
5657
+ I(this, "_arrowBoundBox", new O.Mesh());
5658
5658
  I(this, "_planeMesh");
5659
5659
  I(this, "_controls");
5660
- I(this, "_hiddenMaterial", new g.MeshBasicMaterial({
5660
+ I(this, "_hiddenMaterial", new O.MeshBasicMaterial({
5661
5661
  visible: !1
5662
5662
  }));
5663
5663
  /** {@link Updateable.update} */
@@ -5747,7 +5747,7 @@ class Pi {
5747
5747
  this._enabled = !1, this.onDraggingStarted.reset(), this.onDraggingEnded.reset(), this._helper.removeFromParent(), this.world.renderer && this.world.renderer.setPlane(!1, this.three), this._arrowBoundBox.removeFromParent(), this._arrowBoundBox.geometry.dispose(), this._planeMesh.geometry.dispose(), this._controls.removeFromParent(), this._controls.dispose(), this.onDisposed.trigger(), this.onDisposed.reset();
5748
5748
  }
5749
5749
  reset() {
5750
- const s = new g.Vector3(1, 0, 0), t = new g.Vector3();
5750
+ const s = new O.Vector3(1, 0, 0), t = new O.Vector3();
5751
5751
  this.normal.equals(s) || (this.normal.copy(s), this._helper.lookAt(s)), this.origin.copy(t), this._helper.position.copy(t), this._helper.updateMatrix();
5752
5752
  }
5753
5753
  toggleControls(s) {
@@ -5769,7 +5769,7 @@ class Pi {
5769
5769
  s.attach(this._helper), s.showX = !1, s.showY = !1, s.setSpace("local"), this.createArrowBoundingBox(), s.children[0].children[0].add(this._arrowBoundBox);
5770
5770
  }
5771
5771
  createArrowBoundingBox() {
5772
- this._arrowBoundBox.geometry = new g.CylinderGeometry(0.18, 0.18, 1.2), this._arrowBoundBox.material = this._hiddenMaterial, this._arrowBoundBox.rotateX(Math.PI / 2), this._arrowBoundBox.updateMatrix(), this._arrowBoundBox.geometry.applyMatrix4(this._arrowBoundBox.matrix);
5772
+ this._arrowBoundBox.geometry = new O.CylinderGeometry(0.18, 0.18, 1.2), this._arrowBoundBox.material = this._hiddenMaterial, this._arrowBoundBox.rotateX(Math.PI / 2), this._arrowBoundBox.updateMatrix(), this._arrowBoundBox.geometry.applyMatrix4(this._arrowBoundBox.matrix);
5773
5773
  }
5774
5774
  notifyDraggingChanged(s) {
5775
5775
  s.value ? this.onDraggingStarted.trigger() : this.onDraggingEnded.trigger();
@@ -5778,15 +5778,15 @@ class Pi {
5778
5778
  this.world.camera.enabled = this._visible;
5779
5779
  }
5780
5780
  newHelper() {
5781
- const s = new g.Object3D();
5781
+ const s = new O.Object3D();
5782
5782
  return s.lookAt(this.normal), s.position.copy(this.origin), this._planeMesh.position.z += 0.01, s.add(this._planeMesh), this.world.scene.three.add(s), s;
5783
5783
  }
5784
5784
  static newPlaneMesh(s, t) {
5785
- const e = new g.PlaneGeometry(1), i = new g.Mesh(e, t);
5785
+ const e = new O.PlaneGeometry(1), i = new O.Mesh(e, t);
5786
5786
  return i.scale.set(s, s, s), i;
5787
5787
  }
5788
5788
  }
5789
- const ve = class ve extends et {
5789
+ const Be = class Be extends et {
5790
5790
  constructor(t) {
5791
5791
  super(t);
5792
5792
  /** Event that fires when the user starts dragging a clipping plane. */
@@ -5844,9 +5844,9 @@ const ve = class ve extends et {
5844
5844
  */
5845
5845
  I(this, "list", []);
5846
5846
  /** The material used in all the clipping planes. */
5847
- I(this, "_material", new g.MeshBasicMaterial({
5847
+ I(this, "_material", new O.MeshBasicMaterial({
5848
5848
  color: 12255487,
5849
- side: g.DoubleSide,
5849
+ side: O.DoubleSide,
5850
5850
  transparent: !0,
5851
5851
  opacity: 0.2
5852
5852
  }));
@@ -5859,7 +5859,7 @@ const ve = class ve extends et {
5859
5859
  I(this, "_onEndDragging", () => {
5860
5860
  this.onAfterDrag.trigger();
5861
5861
  });
5862
- this.components.add(ve.uuid, this);
5862
+ this.components.add(Be.uuid, this);
5863
5863
  }
5864
5864
  /** {@link Component.enabled} */
5865
5865
  get enabled() {
@@ -5907,11 +5907,11 @@ const ve = class ve extends et {
5907
5907
  this._enabled = !1;
5908
5908
  for (const t of this.list)
5909
5909
  t.dispose();
5910
- this.list.length = 0, this._material.dispose(), this.onBeforeCreate.reset(), this.onBeforeCancel.reset(), this.onBeforeDelete.reset(), this.onBeforeDrag.reset(), this.onAfterCreate.reset(), this.onAfterCancel.reset(), this.onAfterDelete.reset(), this.onAfterDrag.reset(), this.onDisposed.trigger(ve.uuid), this.onDisposed.reset();
5910
+ this.list.length = 0, this._material.dispose(), this.onBeforeCreate.reset(), this.onBeforeCancel.reset(), this.onBeforeDelete.reset(), this.onBeforeDrag.reset(), this.onAfterCreate.reset(), this.onAfterCancel.reset(), this.onAfterDelete.reset(), this.onAfterDrag.reset(), this.onDisposed.trigger(Be.uuid), this.onDisposed.reset();
5911
5911
  }
5912
5912
  /** {@link Createable.create} */
5913
5913
  create(t) {
5914
- const o = this.components.get(ze).get(t).castRay();
5914
+ const o = this.components.get(He).get(t).castRay();
5915
5915
  return o ? this.createPlaneFromIntersection(t, o) : null;
5916
5916
  }
5917
5917
  /**
@@ -5960,7 +5960,7 @@ const ve = class ve extends et {
5960
5960
  }
5961
5961
  }
5962
5962
  pickPlane(t) {
5963
- const i = this.components.get(ze).get(t), o = this.getAllPlaneMeshes(), n = i.castRay(o);
5963
+ const i = this.components.get(He).get(t), o = this.getAllPlaneMeshes(), n = i.castRay(o);
5964
5964
  if (n) {
5965
5965
  const r = n.object;
5966
5966
  return this.list.find((a) => a.meshes.includes(r));
@@ -5976,7 +5976,7 @@ const ve = class ve extends et {
5976
5976
  var a;
5977
5977
  if (!t.renderer)
5978
5978
  throw new Error("The given world must have a renderer!");
5979
- const i = e.point.distanceTo(new g.Vector3(0, 0, 0)), o = (a = e.face) == null ? void 0 : a.normal;
5979
+ const i = e.point.distanceTo(new O.Vector3(0, 0, 0)), o = (a = e.face) == null ? void 0 : a.normal;
5980
5980
  if (!i || !o)
5981
5981
  return null;
5982
5982
  const n = this.getWorldNormal(e, o), r = this.newPlane(t, e.point, n.negate());
@@ -5985,11 +5985,11 @@ const ve = class ve extends et {
5985
5985
  getWorldNormal(t, e) {
5986
5986
  const i = t.object;
5987
5987
  let o = t.object.matrixWorld.clone();
5988
- if (i instanceof g.InstancedMesh && t.instanceId !== void 0) {
5989
- const c = new g.Matrix4();
5988
+ if (i instanceof O.InstancedMesh && t.instanceId !== void 0) {
5989
+ const c = new O.Matrix4();
5990
5990
  i.getMatrixAt(t.instanceId, c), o = c.multiply(o);
5991
5991
  }
5992
- const r = new g.Matrix3().getNormalMatrix(o), a = e.clone().applyMatrix3(r).normalize();
5992
+ const r = new O.Matrix3().getNormalMatrix(o), a = e.clone().applyMatrix3(r).normalize();
5993
5993
  return this.normalizePlaneDirectionY(a), a;
5994
5994
  }
5995
5995
  normalizePlaneDirectionY(t) {
@@ -6026,8 +6026,8 @@ const ve = class ve extends et {
6026
6026
  * A unique identifier for the component.
6027
6027
  * This UUID is used to register the component within the Components system.
6028
6028
  */
6029
- I(ve, "uuid", "66290bc5-18c4-4cd1-9379-2e17a0617611");
6030
- let Rn = ve;
6029
+ I(Be, "uuid", "66290bc5-18c4-4cd1-9379-2e17a0617611");
6030
+ let Rn = Be;
6031
6031
  function br(l, s, t, e) {
6032
6032
  return new Promise((i, o) => {
6033
6033
  function n() {
@@ -6086,7 +6086,7 @@ class Yr {
6086
6086
  I(this, "autoUpdate", !0);
6087
6087
  I(this, "updateInterval", 1e3);
6088
6088
  I(this, "worker");
6089
- I(this, "scene", new g.Scene());
6089
+ I(this, "scene", new O.Scene());
6090
6090
  I(this, "_width", 512);
6091
6091
  I(this, "_height", 512);
6092
6092
  I(this, "_availableColor", 1);
@@ -6123,7 +6123,7 @@ class Yr {
6123
6123
  });
6124
6124
  if (!t.renderer)
6125
6125
  throw new Error("The given world must have a renderer!");
6126
- this.components = s, this.applySettings(e), this.world = t, this.renderer = new g.WebGLRenderer(), this.renderTarget = new g.WebGLRenderTarget(this._width, this._height), this.bufferSize = this._width * this._height * 4, this._buffer = new Uint8Array(this.bufferSize), this.renderer.clippingPlanes = t.renderer.clippingPlanes;
6126
+ this.components = s, this.applySettings(e), this.world = t, this.renderer = new O.WebGLRenderer(), this.renderTarget = new O.WebGLRenderTarget(this._width, this._height), this.bufferSize = this._width * this._height * 4, this._buffer = new Uint8Array(this.bufferSize), this.renderer.clippingPlanes = t.renderer.clippingPlanes;
6127
6127
  const i = `
6128
6128
  addEventListener("message", (event) => {
6129
6129
  const { buffer } = event.data;
@@ -6208,7 +6208,7 @@ class Vr extends Yr {
6208
6208
  I(this, "_currentVisibleMeshes", /* @__PURE__ */ new Set());
6209
6209
  I(this, "_recentlyHiddenMeshes", /* @__PURE__ */ new Set());
6210
6210
  I(this, "_intervalID", null);
6211
- I(this, "_transparentMat", new g.MeshBasicMaterial({
6211
+ I(this, "_transparentMat", new O.MeshBasicMaterial({
6212
6212
  transparent: !0,
6213
6213
  opacity: 0
6214
6214
  }));
@@ -6260,7 +6260,7 @@ class Vr extends Yr {
6260
6260
  return;
6261
6261
  }
6262
6262
  this.isProcessing = !0;
6263
- const e = t instanceof g.InstancedMesh, { geometry: i, material: o } = t, { colorMaterial: n, code: r } = this.getAvailableMaterial();
6263
+ const e = t instanceof O.InstancedMesh, { geometry: i, material: o } = t, { colorMaterial: n, code: r } = this.getAvailableMaterial();
6264
6264
  let a;
6265
6265
  if (Array.isArray(o)) {
6266
6266
  let d = !0;
@@ -6278,8 +6278,8 @@ class Vr extends Yr {
6278
6278
  } else
6279
6279
  a = n;
6280
6280
  this._colorCodeMeshMap.set(r, t), this._meshIDColorCodeMap.set(t.uuid, r);
6281
- const c = e ? t.count : 1, h = new g.InstancedMesh(i, a, c);
6282
- e ? h.instanceMatrix = t.instanceMatrix : h.setMatrixAt(0, new g.Matrix4()), t.visible = !1, t.updateWorldMatrix(!0, !1), h.applyMatrix4(t.matrixWorld), h.updateMatrix(), this.scene.add(h), this.colorMeshes.set(t.uuid, h), this.increaseColor(), this.isProcessing = !1;
6281
+ const c = e ? t.count : 1, h = new O.InstancedMesh(i, a, c);
6282
+ e ? h.instanceMatrix = t.instanceMatrix : h.setMatrixAt(0, new O.Matrix4()), t.visible = !1, t.updateWorldMatrix(!0, !1), h.applyMatrix4(t.matrixWorld), h.updateMatrix(), this.scene.add(h), this.colorMeshes.set(t.uuid, h), this.increaseColor(), this.isProcessing = !1;
6283
6283
  }
6284
6284
  /**
6285
6285
  * Removes a mesh from the culler, so its visibility is not controlled by the culler anymore.
@@ -6303,20 +6303,20 @@ class Vr extends Yr {
6303
6303
  this._colorCodeMeshMap.delete(o), this._meshIDColorCodeMap.delete(t.uuid), this.colorMeshes.delete(t.uuid), i.geometry = void 0, i.material = [], e.destroy(i, !0), this._recentlyHiddenMeshes.delete(t), this._currentVisibleMeshes.delete(t), this.isProcessing = !1;
6304
6304
  }
6305
6305
  getAvailableMaterial() {
6306
- const { r: t, g: e, b: i, code: o } = this.getAvailableColor(), n = g.ColorManagement.enabled;
6307
- g.ColorManagement.enabled = !1;
6308
- const r = new g.Color(`rgb(${t}, ${e}, ${i})`);
6306
+ const { r: t, g: e, b: i, code: o } = this.getAvailableColor(), n = O.ColorManagement.enabled;
6307
+ O.ColorManagement.enabled = !1;
6308
+ const r = new O.Color(`rgb(${t}, ${e}, ${i})`);
6309
6309
  if (!this.world.renderer)
6310
6310
  throw new Error("Renderer not found in the world!");
6311
- const a = this.world.renderer.clippingPlanes, c = new g.MeshBasicMaterial({
6311
+ const a = this.world.renderer.clippingPlanes, c = new O.MeshBasicMaterial({
6312
6312
  color: r,
6313
6313
  clippingPlanes: a,
6314
- side: g.DoubleSide
6314
+ side: O.DoubleSide
6315
6315
  });
6316
- return g.ColorManagement.enabled = n, { colorMaterial: c, code: o };
6316
+ return O.ColorManagement.enabled = n, { colorMaterial: c, code: o };
6317
6317
  }
6318
6318
  }
6319
- const Be = class Be extends et {
6319
+ const Ye = class Ye extends et {
6320
6320
  constructor(t) {
6321
6321
  super(t);
6322
6322
  /**
@@ -6328,7 +6328,7 @@ const Be = class Be extends et {
6328
6328
  * A map of MeshCullerRenderer instances, keyed by their world UUIDs.
6329
6329
  */
6330
6330
  I(this, "list", /* @__PURE__ */ new Map());
6331
- t.add(Be.uuid, this);
6331
+ t.add(Ye.uuid, this);
6332
6332
  }
6333
6333
  /** {@link Component.enabled} */
6334
6334
  get enabled() {
@@ -6369,7 +6369,7 @@ const Be = class Be extends et {
6369
6369
  }
6370
6370
  /** {@link Disposable.dispose} */
6371
6371
  dispose() {
6372
- this.enabled = !1, this.onDisposed.trigger(Be.uuid), this.onDisposed.reset();
6372
+ this.enabled = !1, this.onDisposed.trigger(Ye.uuid), this.onDisposed.reset();
6373
6373
  for (const [t, e] of this.list)
6374
6374
  e.dispose();
6375
6375
  this.list.clear();
@@ -6379,8 +6379,8 @@ const Be = class Be extends et {
6379
6379
  * A unique identifier for the component.
6380
6380
  * This UUID is used to register the component within the Components system.
6381
6381
  */
6382
- I(Be, "uuid", "69f2a50d-c266-44fc-b1bd-fa4d34be89e6");
6383
- let Ti = Be;
6382
+ I(Ye, "uuid", "69f2a50d-c266-44fc-b1bd-fa4d34be89e6");
6383
+ let Ti = Ye;
6384
6384
  class Gr {
6385
6385
  constructor(s) {
6386
6386
  /** {@link Disposable.onDisposed} */
@@ -6401,12 +6401,12 @@ class Gr {
6401
6401
  * The override material for the minimap.
6402
6402
  * It is used to render the depth information of the world onto the minimap.
6403
6403
  */
6404
- I(this, "overrideMaterial", new g.MeshDepthMaterial());
6404
+ I(this, "overrideMaterial", new O.MeshDepthMaterial());
6405
6405
  /**
6406
6406
  * The background color of the minimap.
6407
6407
  * It is used to set the background color of the minimap's renderer.
6408
6408
  */
6409
- I(this, "backgroundColor", new g.Color(395274));
6409
+ I(this, "backgroundColor", new O.Color(395274));
6410
6410
  /**
6411
6411
  * The WebGL renderer for the minimap.
6412
6412
  * It is used to render the minimap onto the screen.
@@ -6425,11 +6425,11 @@ class Gr {
6425
6425
  I(this, "_lockRotation", !0);
6426
6426
  I(this, "_camera");
6427
6427
  I(this, "_plane");
6428
- I(this, "_size", new g.Vector2(320, 160));
6429
- I(this, "_tempVector1", new g.Vector3());
6430
- I(this, "_tempVector2", new g.Vector3());
6431
- I(this, "_tempTarget", new g.Vector3());
6432
- I(this, "down", new g.Vector3(0, -1, 0));
6428
+ I(this, "_size", new O.Vector2(320, 160));
6429
+ I(this, "_tempVector1", new O.Vector3());
6430
+ I(this, "_tempVector2", new O.Vector3());
6431
+ I(this, "_tempTarget", new O.Vector3());
6432
+ I(this, "down", new O.Vector3(0, -1, 0));
6433
6433
  I(this, "updatePlanes", () => {
6434
6434
  if (!this.world.renderer)
6435
6435
  throw new Error("The given world must have a renderer!");
@@ -6440,14 +6440,14 @@ class Gr {
6440
6440
  });
6441
6441
  if (this.world = s, !this.world.renderer)
6442
6442
  throw new Error("The given world must have a renderer!");
6443
- this.renderer = new g.WebGLRenderer(), this.renderer.setSize(this._size.x, this._size.y);
6443
+ this.renderer = new O.WebGLRenderer(), this.renderer.setSize(this._size.x, this._size.y);
6444
6444
  const t = 1, e = this._size.x / this._size.y;
6445
- this._camera = new g.OrthographicCamera(
6445
+ this._camera = new O.OrthographicCamera(
6446
6446
  t * e / -2,
6447
6447
  t * e / 2,
6448
6448
  t / 2,
6449
6449
  t / -2
6450
- ), this.world.renderer.onClippingPlanesUpdated.add(this.updatePlanes), this._camera.position.set(0, 200, 0), this._camera.zoom = 0.1, this._camera.rotation.x = -Math.PI / 2, this._plane = new g.Plane(this.down, 200), this.updatePlanes();
6450
+ ), this.world.renderer.onClippingPlanesUpdated.add(this.updatePlanes), this._camera.position.set(0, 200, 0), this._camera.zoom = 0.1, this._camera.rotation.x = -Math.PI / 2, this._plane = new O.Plane(this.down, 200), this.updatePlanes();
6451
6451
  }
6452
6452
  /**
6453
6453
  * Gets or sets whether the minimap rotation is locked.
@@ -6496,7 +6496,7 @@ class Gr {
6496
6496
  const s = this.world.scene.three, t = this.world.camera;
6497
6497
  if (!t.hasCameraControls())
6498
6498
  throw new Error("The given world must use camera controls!");
6499
- if (!(s instanceof g.Scene))
6499
+ if (!(s instanceof O.Scene))
6500
6500
  throw new Error("The given world must have a THREE.Scene as a root!");
6501
6501
  const e = t.controls;
6502
6502
  if (e.getPosition(this._tempVector1), this._camera.position.x = this._tempVector1.x, this._camera.position.z = this._tempVector1.z, this.frontOffset !== 0 && (e.getTarget(this._tempVector2), this._tempVector2.sub(this._tempVector1), this._tempVector2.normalize().multiplyScalar(this.frontOffset), this._camera.position.x += this._tempVector2.x, this._camera.position.z += this._tempVector2.z), !this._lockRotation) {
@@ -6601,7 +6601,7 @@ class zr {
6601
6601
  }
6602
6602
  }
6603
6603
  setupFirstPersonCamera() {
6604
- const s = this.camera.controls, t = new g.Vector3();
6604
+ const s = this.camera.controls, t = new O.Vector3();
6605
6605
  s.distance--, s.getPosition(t), s.minDistance = 1, s.maxDistance = 1, s.distance = 1, s.moveTo(
6606
6606
  t.x,
6607
6607
  t.y,
@@ -6624,11 +6624,11 @@ class Hr {
6624
6624
  activateOrbitControls() {
6625
6625
  const s = this.camera.controls;
6626
6626
  s.minDistance = 1, s.maxDistance = 300;
6627
- const t = new g.Vector3();
6627
+ const t = new O.Vector3();
6628
6628
  s.getPosition(t);
6629
6629
  const e = t.length();
6630
6630
  s.distance = e, s.truckSpeed = 2;
6631
- const { rotation: i } = this.camera.three, o = new g.Vector3(0, 0, -1).applyEuler(i), n = t.addScaledVector(o, e);
6631
+ const { rotation: i } = this.camera.three, o = new O.Vector3(0, 0, -1).applyEuler(i), n = t.addScaledVector(o, e);
6632
6632
  s.moveTo(n.x, n.y, n.z);
6633
6633
  }
6634
6634
  }
@@ -6705,9 +6705,9 @@ class Wr {
6705
6705
  const s = this._component.currentWorld;
6706
6706
  if (!s || !s.renderer)
6707
6707
  return null;
6708
- const t = new g.Vector3();
6708
+ const t = new O.Vector3();
6709
6709
  this._component.threePersp.getWorldDirection(t);
6710
- const e = new g.Vector3();
6710
+ const e = new O.Vector3();
6711
6711
  this._component.controls.getTarget(e);
6712
6712
  const o = e.clone().sub(this._component.threePersp.position).dot(t), n = s.renderer.getSize(), r = n.x / n.y, a = this._component.threePersp, c = o * 2 * Math.atan(a.fov * (Math.PI / 180) / 2);
6713
6713
  return { width: c * r, height: c };
@@ -6727,7 +6727,7 @@ class Wr {
6727
6727
  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";
6728
6728
  }
6729
6729
  }
6730
- class na extends He {
6730
+ class na extends ke {
6731
6731
  constructor(t) {
6732
6732
  super(t);
6733
6733
  /**
@@ -6798,16 +6798,16 @@ class na extends He {
6798
6798
  async fit(t, e = 1.5) {
6799
6799
  if (!this.enabled)
6800
6800
  return;
6801
- const i = Number.MAX_VALUE, o = Number.MIN_VALUE, n = new g.Vector3(i, i, i), r = new g.Vector3(o, o, o);
6801
+ const i = Number.MAX_VALUE, o = Number.MIN_VALUE, n = new O.Vector3(i, i, i), r = new O.Vector3(o, o, o);
6802
6802
  for (const u of t) {
6803
- const f = new g.Box3().setFromObject(u);
6803
+ const f = new O.Box3().setFromObject(u);
6804
6804
  f.min.x < n.x && (n.x = f.min.x), f.min.y < n.y && (n.y = f.min.y), f.min.z < n.z && (n.z = f.min.z), f.max.x > r.x && (r.x = f.max.x), f.max.y > r.y && (r.y = f.max.y), f.max.z > r.z && (r.z = f.max.z);
6805
6805
  }
6806
- const a = new g.Box3(n, r), c = new g.Vector3();
6806
+ const a = new O.Box3(n, r), c = new O.Vector3();
6807
6807
  a.getSize(c);
6808
- const h = new g.Vector3();
6808
+ const h = new O.Vector3();
6809
6809
  a.getCenter(h);
6810
- const d = Math.max(c.x, c.y, c.z) * e, E = new g.Sphere(h, d);
6810
+ const d = Math.max(c.x, c.y, c.z) * e, E = new O.Sphere(h, d);
6811
6811
  await this.controls.fitToSphere(E, !0);
6812
6812
  }
6813
6813
  /**
@@ -6826,7 +6826,7 @@ class na extends He {
6826
6826
  }
6827
6827
  newOrthoCamera() {
6828
6828
  const t = window.innerWidth / window.innerHeight;
6829
- return new g.OrthographicCamera(
6829
+ return new O.OrthographicCamera(
6830
6830
  this._frustumSize * t / -2,
6831
6831
  this._frustumSize * t / 2,
6832
6832
  this._frustumSize / 2,
@@ -6899,7 +6899,7 @@ const Xr = /* @__PURE__ */ new Map([
6899
6899
  forRelating: "ContainsElements"
6900
6900
  }
6901
6901
  ]
6902
- ]), Ye = class Ye extends et {
6902
+ ]), Ve = class Ve extends et {
6903
6903
  constructor(t) {
6904
6904
  super(t);
6905
6905
  /** {@link Disposable.onDisposed} */
@@ -6954,7 +6954,7 @@ const Xr = /* @__PURE__ */ new Map([
6954
6954
  I(this, "onFragmentsDisposed", (t) => {
6955
6955
  delete this.relationMaps[t.groupID];
6956
6956
  });
6957
- this.components.add(Ye.uuid, this), t.get(ht).onFragmentsDisposed.add(this.onFragmentsDisposed);
6957
+ this.components.add(Ve.uuid, this), t.get(ht).onFragmentsDisposed.add(this.onFragmentsDisposed);
6958
6958
  }
6959
6959
  indexRelations(t, e, i, o) {
6960
6960
  const n = Object.keys(e).find(
@@ -6964,13 +6964,20 @@ const Xr = /* @__PURE__ */ new Map([
6964
6964
  );
6965
6965
  if (!(n && r))
6966
6966
  return;
6967
- const a = e[n].value, c = e[r].map((E) => E.value), h = t.get(a) ?? /* @__PURE__ */ new Map(), d = this._inverseAttributes.indexOf(o);
6968
- h.set(d, c), t.set(a, h);
6967
+ const a = e[n].value, c = e[r].map((E) => E.value), h = t.get(a) ?? /* @__PURE__ */ new Map(), d = this.getAttributeIndex(o);
6968
+ d && (h.set(d, c), t.set(a, h));
6969
6969
  for (const E of c) {
6970
- const u = t.get(E) ?? /* @__PURE__ */ new Map(), f = this._inverseAttributes.indexOf(i), R = u.get(f) ?? [];
6970
+ const u = t.get(E) ?? /* @__PURE__ */ new Map(), f = this.getAttributeIndex(i);
6971
+ if (!f)
6972
+ continue;
6973
+ const R = u.get(f) ?? [];
6971
6974
  R.push(a), u.set(f, R), t.set(E, u);
6972
6975
  }
6973
6976
  }
6977
+ getAttributeIndex(t) {
6978
+ const e = this._inverseAttributes.indexOf(t);
6979
+ return e === -1 ? null : e;
6980
+ }
6974
6981
  /**
6975
6982
  * Adds a relation map to the model's relations map.
6976
6983
  *
@@ -7065,9 +7072,11 @@ const Xr = /* @__PURE__ */ new Map([
7065
7072
  getEntityRelations(t, e, i) {
7066
7073
  const o = this.relationMaps[t.uuid];
7067
7074
  if (!o)
7068
- return null;
7069
- const n = o.get(e), r = this._inverseAttributes.indexOf(i);
7070
- if (!n || r === -1)
7075
+ throw new Error(
7076
+ `IfcRelationsIndexer: model ${t.uuid} has no relations indexed.`
7077
+ );
7078
+ const n = o.get(e), r = this.getAttributeIndex(i);
7079
+ if (!(n && r))
7071
7080
  return null;
7072
7081
  const a = n.get(r);
7073
7082
  return a || null;
@@ -7152,30 +7161,62 @@ const Xr = /* @__PURE__ */ new Map([
7152
7161
  }
7153
7162
  /** {@link Disposable.dispose} */
7154
7163
  dispose() {
7155
- this.relationMaps = {}, this.components.get(ht).onFragmentsDisposed.remove(this.onFragmentsDisposed), this.onDisposed.trigger(Ye.uuid), this.onDisposed.reset();
7164
+ this.relationMaps = {}, this.components.get(ht).onFragmentsDisposed.remove(this.onFragmentsDisposed), this.onDisposed.trigger(Ve.uuid), this.onDisposed.reset();
7165
+ }
7166
+ /**
7167
+ * Adds relations between an entity and other entities in a BIM model.
7168
+ *
7169
+ * @param model - The BIM model to which the relations will be added.
7170
+ * @param expressID - The expressID of the entity within the model.
7171
+ * @param relationName - The IFC schema inverse attribute of the relation to add (e.g., "IsDefinedBy", "ContainsElements").
7172
+ * @param relIDs - The expressIDs of the related entities within the model.
7173
+ *
7174
+ * @throws An error if the relation name is not a valid relation name.
7175
+ */
7176
+ addEntityRelations(t, e, i, ...o) {
7177
+ const n = this.getEntityRelations(
7178
+ t,
7179
+ e,
7180
+ i
7181
+ );
7182
+ if (n)
7183
+ n.push(...o);
7184
+ else {
7185
+ const r = this.getAttributeIndex(i);
7186
+ if (!r)
7187
+ throw new Error(
7188
+ `IfcRelationsIndexer: ${i} is not a valid relation name.`
7189
+ );
7190
+ const a = this.relationMaps[t.uuid].get(e);
7191
+ a == null || a.set(r, o);
7192
+ }
7156
7193
  }
7157
7194
  /**
7158
7195
  * Gets the children of the given element recursively. E.g. in a model with project - site - building - storeys - rooms, passing a storey will include all its children and the children of the rooms contained in it.
7159
7196
  *
7160
7197
  * @param model The BIM model whose children to get.
7161
- * @param id The expressID of the item whose children to get.
7198
+ * @param expressID The expressID of the item whose children to get.
7162
7199
  * @param found An optional parameter that includes a set of expressIDs where the found element IDs will be added.
7163
7200
  *
7164
7201
  * @returns A `Set` with the expressIDs of the found items.
7165
7202
  */
7166
- getElementsChildren(t, e, i = /* @__PURE__ */ new Set()) {
7203
+ getEntityChildren(t, e, i = /* @__PURE__ */ new Set()) {
7167
7204
  if (i.add(e), this.relationMaps[t.uuid] === void 0)
7168
7205
  throw new Error(
7169
7206
  "The provided model has no indices. You have to generate them first."
7170
7207
  );
7171
- const n = this.getEntityRelations(t, e, "IsDecomposedBy");
7208
+ const n = this.getEntityRelations(
7209
+ t,
7210
+ e,
7211
+ "IsDecomposedBy"
7212
+ );
7172
7213
  if (n)
7173
7214
  for (const a of n)
7174
- this.getElementsChildren(t, a, i);
7215
+ this.getEntityChildren(t, a, i);
7175
7216
  const r = this.getEntityRelations(t, e, "ContainsElements");
7176
7217
  if (r)
7177
7218
  for (const a of r)
7178
- this.getElementsChildren(t, a, i);
7219
+ this.getEntityChildren(t, a, i);
7179
7220
  return i;
7180
7221
  }
7181
7222
  };
@@ -7183,8 +7224,8 @@ const Xr = /* @__PURE__ */ new Map([
7183
7224
  * A unique identifier for the component.
7184
7225
  * This UUID is used to register the component within the Components system.
7185
7226
  */
7186
- I(Ye, "uuid", "23a889ab-83b3-44a4-8bee-ead83438370b");
7187
- let ke = Ye;
7227
+ I(Ve, "uuid", "23a889ab-83b3-44a4-8bee-ead83438370b");
7228
+ let pe = Ve;
7188
7229
  const Ns = class Ns extends et {
7189
7230
  constructor(t) {
7190
7231
  super(t);
@@ -7209,7 +7250,7 @@ const Ns = class Ns extends et {
7209
7250
  */
7210
7251
  I(this, "groups", /* @__PURE__ */ new Map());
7211
7252
  I(this, "baseCoordinationModel", "");
7212
- I(this, "baseCoordinationMatrix", new g.Matrix4());
7253
+ I(this, "baseCoordinationMatrix", new O.Matrix4());
7213
7254
  /** {@link Component.enabled} */
7214
7255
  I(this, "enabled", !0);
7215
7256
  I(this, "_loader", new to());
@@ -7261,7 +7302,7 @@ const Ns = class Ns extends et {
7261
7302
  r && (h.name = r);
7262
7303
  for (const d of h.items)
7263
7304
  d.group = h, this.list.set(d.id, d);
7264
- return n && this.coordinate([h]), this.groups.set(h.uuid, h), a && h.setLocalProperties(a), c && this.components.get(ke).setRelationMap(h, c), this.onFragmentsLoaded.trigger(h), h;
7305
+ return n && this.coordinate([h]), this.groups.set(h.uuid, h), a && h.setLocalProperties(a), c && this.components.get(pe).setRelationMap(h, c), this.onFragmentsLoaded.trigger(h), h;
7265
7306
  }
7266
7307
  /**
7267
7308
  * Export the specified fragmentsgroup to binary data.
@@ -7357,7 +7398,7 @@ const At = class At extends et {
7357
7398
  * @returns An object containing the width, height, depth, and center of the bounding box.
7358
7399
  */
7359
7400
  static getDimensions(t) {
7360
- const { min: e, max: i } = t, o = Math.abs(i.x - e.x), n = Math.abs(i.y - e.y), r = Math.abs(i.z - e.z), a = new g.Vector3();
7401
+ const { min: e, max: i } = t, o = Math.abs(i.x - e.x), n = Math.abs(i.y - e.y), r = Math.abs(i.z - e.z), a = new O.Vector3();
7361
7402
  return a.subVectors(i, e).divideScalar(2).add(e), { width: o, height: n, depth: r, center: a };
7362
7403
  }
7363
7404
  /**
@@ -7382,7 +7423,7 @@ const At = class At extends et {
7382
7423
  */
7383
7424
  static newBound(t) {
7384
7425
  const e = t ? 1 : -1;
7385
- return new g.Vector3(
7426
+ return new O.Vector3(
7386
7427
  e * Number.MAX_VALUE,
7387
7428
  e * Number.MAX_VALUE,
7388
7429
  e * Number.MAX_VALUE
@@ -7416,7 +7457,7 @@ const At = class At extends et {
7416
7457
  const o = i || this.newBound(!1), n = e || this.newBound(!0);
7417
7458
  for (const r of t)
7418
7459
  r.x < n.x && (n.x = r.x), r.y < n.y && (n.y = r.y), r.z < n.z && (n.z = r.z), r.x > o.x && (o.x = r.x), r.y > o.y && (o.y = r.y), r.z > o.z && (o.z = r.z);
7419
- return new g.Box3(e, i);
7460
+ return new O.Box3(e, i);
7420
7461
  }
7421
7462
  /** {@link Disposable.dispose} */
7422
7463
  dispose() {
@@ -7442,7 +7483,7 @@ const At = class At extends et {
7442
7483
  */
7443
7484
  get() {
7444
7485
  const t = this._absoluteMin.clone(), e = this._absoluteMax.clone();
7445
- return new g.Box3(t, e);
7486
+ return new O.Box3(t, e);
7446
7487
  }
7447
7488
  /**
7448
7489
  * Calculates and returns a sphere that encompasses the entire bounding box.
@@ -7463,8 +7504,8 @@ const At = class At extends et {
7463
7504
  * ```
7464
7505
  */
7465
7506
  getSphere() {
7466
- const t = this._absoluteMin.clone(), e = this._absoluteMax.clone(), i = Math.abs((e.x - t.x) / 2), o = Math.abs((e.y - t.y) / 2), n = Math.abs((e.z - t.z) / 2), r = new g.Vector3(t.x + i, t.y + o, t.z + n), a = r.distanceTo(t);
7467
- return new g.Sphere(r, a);
7507
+ const t = this._absoluteMin.clone(), e = this._absoluteMax.clone(), i = Math.abs((e.x - t.x) / 2), o = Math.abs((e.y - t.y) / 2), n = Math.abs((e.z - t.z) / 2), r = new O.Vector3(t.x + i, t.y + o, t.z + n), a = r.distanceTo(t);
7508
+ return new O.Sphere(r, a);
7468
7509
  }
7469
7510
  /**
7470
7511
  * Returns a THREE.Mesh instance representing the bounding box.
@@ -7486,7 +7527,7 @@ const At = class At extends et {
7486
7527
  * ```
7487
7528
  */
7488
7529
  getMesh() {
7489
- const t = new g.Box3(this._absoluteMin, this._absoluteMax), e = At.getDimensions(t), { width: i, height: o, depth: n, center: r } = e, a = new g.BoxGeometry(i, o, n), c = new g.Mesh(a);
7530
+ const t = new O.Box3(this._absoluteMin, this._absoluteMax), e = At.getDimensions(t), { width: i, height: o, depth: n, center: r } = e, a = new O.BoxGeometry(i, o, n), c = new O.Mesh(a);
7490
7531
  return this._meshes.push(c), c.position.copy(r), c;
7491
7532
  }
7492
7533
  /**
@@ -7549,7 +7590,7 @@ const At = class At extends et {
7549
7590
  return;
7550
7591
  const i = At.getFragmentBounds(t);
7551
7592
  t.updateMatrixWorld();
7552
- const o = t.matrixWorld, n = new g.Matrix4(), r = t instanceof g.InstancedMesh, a = /* @__PURE__ */ new Set();
7593
+ const o = t.matrixWorld, n = new O.Matrix4(), r = t instanceof O.InstancedMesh, a = /* @__PURE__ */ new Set();
7553
7594
  if (e && t instanceof Vt.FragmentMesh)
7554
7595
  for (const c of e) {
7555
7596
  const h = t.fragment.getInstancesIDs(c);
@@ -7597,7 +7638,7 @@ const At = class At extends et {
7597
7638
  }
7598
7639
  }
7599
7640
  static getFragmentBounds(t) {
7600
- const e = t.geometry.attributes.position, i = Number.MAX_VALUE, o = -i, n = new g.Vector3(i, i, i), r = new g.Vector3(o, o, o);
7641
+ const e = t.geometry.attributes.position, i = Number.MAX_VALUE, o = -i, n = new O.Vector3(i, i, i), r = new O.Vector3(o, o, o);
7601
7642
  if (!t.geometry.index)
7602
7643
  throw new Error("Geometry must be indexed!");
7603
7644
  const a = Array.from(t.geometry.index.array);
@@ -7609,7 +7650,7 @@ const At = class At extends et {
7609
7650
  const h = a[c], d = e.getX(h), E = e.getY(h), u = e.getZ(h);
7610
7651
  d < n.x && (n.x = d), E < n.y && (n.y = E), u < n.z && (n.z = u), d > r.x && (r.x = d), E > r.y && (r.y = E), u > r.z && (r.z = u);
7611
7652
  }
7612
- return new g.Box3(n, r);
7653
+ return new O.Box3(n, r);
7613
7654
  }
7614
7655
  };
7615
7656
  I(At, "uuid", "d1444724-dba6-4cdd-a0c7-68ee1450d166");
@@ -9255,7 +9296,7 @@ class Qr {
9255
9296
  }
9256
9297
  getScaleMatrix() {
9257
9298
  const s = this.factor;
9258
- return new g.Matrix4().fromArray([
9299
+ return new O.Matrix4().fromArray([
9259
9300
  s,
9260
9301
  0,
9261
9302
  0,
@@ -9345,7 +9386,7 @@ class Yn {
9345
9386
  this.itemsByFloor = {};
9346
9387
  }
9347
9388
  }
9348
- class Li {
9389
+ class yi {
9349
9390
  constructor() {
9350
9391
  /** Whether to extract the IFC properties into a JSON. */
9351
9392
  I(this, "includeProperties", !0);
@@ -9391,7 +9432,7 @@ class Li {
9391
9432
  }
9392
9433
  class Vn {
9393
9434
  constructor() {
9394
- I(this, "defLineMat", new g.LineBasicMaterial({ color: 16777215 }));
9435
+ I(this, "defLineMat", new O.LineBasicMaterial({ color: 16777215 }));
9395
9436
  }
9396
9437
  read(s) {
9397
9438
  const t = s.GetAllAlignments(0), e = s.GetAllCrossSections2D(0), i = s.GetAllCrossSections3D(0), o = {
@@ -9408,7 +9449,7 @@ class Vn {
9408
9449
  const i = new Vt.Alignment();
9409
9450
  i.absolute = this.getCurves(e.curve3D, i), i.horizontal = this.getCurves(e.horizontal, i), i.vertical = this.getCurves(e.vertical, i), t.set(t.size, i);
9410
9451
  }
9411
- return { alignments: t, coordinationMatrix: new g.Matrix4() };
9452
+ return { alignments: t, coordinationMatrix: new O.Matrix4() };
9412
9453
  }
9413
9454
  }
9414
9455
  getCurves(s, t) {
@@ -9426,7 +9467,7 @@ class Vn {
9426
9467
  const { x: u, y: f, z: R } = r[E];
9427
9468
  a[E * 3] = u, a[E * 3 + 1] = f, a[E * 3 + 2] = R || 0;
9428
9469
  }
9429
- const c = new g.BufferAttribute(a, 3), h = new g.EdgesGeometry();
9470
+ const c = new O.BufferAttribute(a, 3), h = new O.EdgesGeometry();
9430
9471
  h.setAttribute("position", c);
9431
9472
  const d = new Vt.CurveMesh(
9432
9473
  i,
@@ -9475,7 +9516,7 @@ class Gn {
9475
9516
  return o != null && o.value && (t.implementationLevel = o.value), t;
9476
9517
  }
9477
9518
  }
9478
- const Ve = class Ve extends et {
9519
+ const Ge = class Ge extends et {
9479
9520
  constructor(t) {
9480
9521
  super(t);
9481
9522
  /** {@link Disposable.onDisposed} */
@@ -9492,28 +9533,28 @@ const Ve = class Ve extends et {
9492
9533
  * The settings for the IfcLoader.
9493
9534
  * It includes options for excluding categories, setting WASM paths, and more.
9494
9535
  */
9495
- I(this, "settings", new Li());
9536
+ I(this, "settings", new yi());
9496
9537
  /**
9497
9538
  * The instance of the Web-IFC library used for handling IFC data.
9498
9539
  */
9499
9540
  I(this, "webIfc", new b.IfcAPI());
9500
9541
  /** {@link Component.enabled} */
9501
9542
  I(this, "enabled", !0);
9502
- I(this, "_material", new g.MeshLambertMaterial());
9543
+ I(this, "_material", new O.MeshLambertMaterial());
9503
9544
  I(this, "_spatialTree", new Yn());
9504
9545
  I(this, "_metaData", new Gn());
9505
9546
  I(this, "_fragmentInstances", /* @__PURE__ */ new Map());
9506
9547
  I(this, "_civil", new Vn());
9507
9548
  I(this, "_visitedFragments", /* @__PURE__ */ new Map());
9508
- I(this, "_materialT", new g.MeshLambertMaterial({
9549
+ I(this, "_materialT", new O.MeshLambertMaterial({
9509
9550
  transparent: !0,
9510
9551
  opacity: 0.5
9511
9552
  }));
9512
- this.components.add(Ve.uuid, this), this.settings.excludedCategories.add(b.IFCOPENINGELEMENT);
9553
+ this.components.add(Ge.uuid, this), this.settings.excludedCategories.add(b.IFCOPENINGELEMENT);
9513
9554
  }
9514
9555
  /** {@link Disposable.dispose} */
9515
9556
  dispose() {
9516
- this.webIfc.Dispose(), this.webIfc = null, this.onDisposed.trigger(Ve.uuid), this.onDisposed.reset();
9557
+ this.webIfc.Dispose(), this.webIfc = null, this.onDisposed.trigger(Ge.uuid), this.onDisposed.reset();
9517
9558
  }
9518
9559
  /**
9519
9560
  * Sets up the IfcLoader component with the provided configuration.
@@ -9653,12 +9694,12 @@ const Ve = class Ve extends et {
9653
9694
  for (let n = 0; n < i; n++) {
9654
9695
  const r = t.geometries.get(n), { x: a, y: c, z: h, w: d } = r.color, E = d !== 1, { geometryExpressID: u } = r, f = `${u}-${E}`;
9655
9696
  if (!this._visitedFragments.has(f)) {
9656
- const T = this.getGeometry(this.webIfc, u), O = E ? this._materialT : this._material, _ = new Vt.Fragment(T, O, 1);
9697
+ const T = this.getGeometry(this.webIfc, u), g = E ? this._materialT : this._material, _ = new Vt.Fragment(T, g, 1);
9657
9698
  e.add(_.mesh), e.items.push(_);
9658
9699
  const S = this._visitedFragments.size;
9659
9700
  this._visitedFragments.set(f, { index: S, fragment: _ });
9660
9701
  }
9661
- const R = new g.Color().setRGB(a, c, h, "srgb"), m = new g.Matrix4();
9702
+ const R = new O.Color().setRGB(a, c, h, "srgb"), m = new O.Matrix4();
9662
9703
  m.fromArray(r.flatTransformation);
9663
9704
  const C = this._visitedFragments.get(f);
9664
9705
  if (C === void 0)
@@ -9691,7 +9732,7 @@ const Ve = class Ve extends et {
9691
9732
  ), r = new Float32Array(n.length / 2), a = new Float32Array(n.length / 2);
9692
9733
  for (let E = 0; E < n.length; E += 6)
9693
9734
  r[E / 2] = n[E], r[E / 2 + 1] = n[E + 1], r[E / 2 + 2] = n[E + 2], a[E / 2] = n[E + 3], a[E / 2 + 1] = n[E + 4], a[E / 2 + 2] = n[E + 5];
9694
- const c = new g.BufferGeometry(), h = new g.BufferAttribute(r, 3), d = new g.BufferAttribute(a, 3);
9735
+ const c = new O.BufferGeometry(), h = new O.BufferAttribute(r, 3), d = new O.BufferAttribute(a, 3);
9695
9736
  return c.setAttribute("position", h), c.setAttribute("normal", d), c.setIndex(Array.from(o)), i.delete(), c;
9696
9737
  }
9697
9738
  async autoSetWasm() {
@@ -9719,8 +9760,8 @@ const Ve = class Ve extends et {
9719
9760
  * A unique identifier for the component.
9720
9761
  * This UUID is used to register the component within the Components system.
9721
9762
  */
9722
- I(Ve, "uuid", "a659add7-1418-4771-a0d6-7d4d438e4624");
9723
- let Ri = Ve;
9763
+ I(Ge, "uuid", "a659add7-1418-4771-a0d6-7d4d438e4624");
9764
+ let Ri = Ge;
9724
9765
  const Bt = class Bt extends et {
9725
9766
  constructor(t) {
9726
9767
  super(t);
@@ -9798,7 +9839,7 @@ const Bt = class Bt extends et {
9798
9839
  * Each object must have an `expressID` property, which is the express ID of the entity in the model.
9799
9840
  * The rest of the properties will be set as the properties of the entity.
9800
9841
  *
9801
- * @returns {Promise<void>} A promise that resolves when all the properties have been set.
9842
+ * @returns A promise that resolves when all the properties have been set.
9802
9843
  *
9803
9844
  * @throws Will throw an error if any of the `expressID` properties are missing in the `dataToSave` array.
9804
9845
  */
@@ -9845,7 +9886,7 @@ const Bt = class Bt extends et {
9845
9886
  * @param model - The FragmentsGroup model from which to remove the Pset.
9846
9887
  * @param psetID - The express IDs of the Psets to be removed.
9847
9888
  *
9848
- * @returns {Promise<void>} A promise that resolves when all the Psets have been removed.
9889
+ * @returns A promise that resolves when all the Psets have been removed.
9849
9890
  *
9850
9891
  * @throws Will throw an error if any of the `expressID` properties are missing in the `psetID` array.
9851
9892
  * @throws Will throw an error if the Pset to be removed is not of type `IFCPROPERTYSET`.
@@ -9919,7 +9960,7 @@ const Bt = class Bt extends et {
9919
9960
  * @param psetID - The express ID of the Pset from which to remove the property.
9920
9961
  * @param propID - The express ID of the property to be removed.
9921
9962
  *
9922
- * @returns {Promise<void>} A promise that resolves when the property has been removed.
9963
+ * @returns A promise that resolves when the property has been removed.
9923
9964
  *
9924
9965
  * @throws Will throw an error if the Pset or the property to be removed are not found in the model.
9925
9966
  * @throws Will throw an error if the Pset to be removed is not of type `IFCPROPERTYSET`.
@@ -9933,17 +9974,20 @@ const Bt = class Bt extends et {
9933
9974
  if (!o)
9934
9975
  return;
9935
9976
  const n = await t.getProperties(o);
9936
- if (n) {
9937
- for (const r of i) {
9938
- const a = new b.Handle(r);
9939
- n.RelatedObjects.push(a), this.onElementToPset.trigger({
9940
- model: t,
9941
- psetID: e,
9942
- elementID: r
9943
- });
9944
- }
9945
- this.registerChange(t, e);
9977
+ if (!n)
9978
+ return;
9979
+ for (const a of i) {
9980
+ const c = new b.Handle(a);
9981
+ n.RelatedObjects.push(c), this.onElementToPset.trigger({
9982
+ model: t,
9983
+ psetID: e,
9984
+ elementID: a
9985
+ });
9946
9986
  }
9987
+ this.registerChange(t, e);
9988
+ const r = this.components.get(pe);
9989
+ for (const a of i)
9990
+ r.addEntityRelations(t, a, "IsDefinedBy", e);
9947
9991
  }
9948
9992
  /**
9949
9993
  * Adds elements to a Property Set (Pset) in the given model.
@@ -9952,7 +9996,7 @@ const Bt = class Bt extends et {
9952
9996
  * @param psetID - The express ID of the Pset to which to add the elements.
9953
9997
  * @param elementID - The express IDs of the elements to be added.
9954
9998
  *
9955
- * @returns {Promise<void>} A promise that resolves when all the elements have been added.
9999
+ * @returns A promise that resolves when all the elements have been added.
9956
10000
  *
9957
10001
  * @throws Will throw an error if the Pset or the elements to be added are not found in the model.
9958
10002
  * @throws Will throw an error if the Pset to be added to is not of type `IFCPROPERTYSET`.
@@ -10043,7 +10087,7 @@ const Bt = class Bt extends et {
10043
10087
  }
10044
10088
  newGUID(t) {
10045
10089
  const e = Bt.getIFCSchema(t);
10046
- return new b[e].IfcGloballyUniqueId(Ge.create());
10090
+ return new b[e].IfcGloballyUniqueId(ze.create());
10047
10091
  }
10048
10092
  async getOwnerHistory(t) {
10049
10093
  const e = await t.getAllPropertiesOfType(
@@ -10074,8 +10118,8 @@ const Bt = class Bt extends et {
10074
10118
  * This UUID is used to register the component within the Components system.
10075
10119
  */
10076
10120
  I(Bt, "uuid", "58c2d9f0-183c-48d6-a402-dfcf5b9a34df");
10077
- let On = Bt;
10078
- const Ls = class Ls extends et {
10121
+ let gn = Bt;
10122
+ const ys = class ys extends et {
10079
10123
  constructor(t) {
10080
10124
  super(t);
10081
10125
  /** {@link Component.enabled} */
@@ -10102,7 +10146,7 @@ const Ls = class Ls extends et {
10102
10146
  }
10103
10147
  }
10104
10148
  });
10105
- t.add(Ls.uuid, this), t.get(ht).onFragmentsDisposed.add(this.onFragmentsDisposed);
10149
+ t.add(ys.uuid, this), t.get(ht).onFragmentsDisposed.add(this.onFragmentsDisposed);
10106
10150
  }
10107
10151
  /** {@link Disposable.dispose} */
10108
10152
  dispose() {
@@ -10309,7 +10353,7 @@ const Ls = class Ls extends et {
10309
10353
  */
10310
10354
  async bySpatialStructure(t, e = { useProperties: !0 }) {
10311
10355
  var r, a;
10312
- const i = this.components.get(ke), o = i.relationMaps[t.uuid];
10356
+ const i = this.components.get(pe), o = i.relationMaps[t.uuid];
10313
10357
  if (!o)
10314
10358
  throw new Error(
10315
10359
  `Classifier: model relations of ${t.name || t.uuid} have to exists to group by spatial structure.`
@@ -10420,9 +10464,9 @@ const Ls = class Ls extends et {
10420
10464
  * A unique identifier for the component.
10421
10465
  * This UUID is used to register the component within the Components system.
10422
10466
  */
10423
- I(Ls, "uuid", "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7");
10424
- let Ai = Ls;
10425
- const ys = class ys extends et {
10467
+ I(ys, "uuid", "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7");
10468
+ let Ai = ys;
10469
+ const Ls = class Ls extends et {
10426
10470
  constructor(t) {
10427
10471
  super(t);
10428
10472
  /** {@link Disposable.onDisposed} */
@@ -10446,7 +10490,7 @@ const ys = class ys extends et {
10446
10490
  * This set is used to keep track of which items have been exploded.
10447
10491
  */
10448
10492
  I(this, "list", /* @__PURE__ */ new Set());
10449
- t.add(ys.uuid, this);
10493
+ t.add(Ls.uuid, this);
10450
10494
  }
10451
10495
  /** {@link Disposable.dispose} */
10452
10496
  dispose() {
@@ -10471,7 +10515,7 @@ const ys = class ys extends et {
10471
10515
  return;
10472
10516
  const e = this.components.get(Ai), i = this.components.get(ht), o = t ? 1 : -1;
10473
10517
  let n = 0;
10474
- const r = e.list[this.groupName], a = new g.Matrix4();
10518
+ const r = e.list[this.groupName], a = new O.Matrix4();
10475
10519
  for (const c in r) {
10476
10520
  a.elements[13] = n * o * this.height;
10477
10521
  for (const h in r[c].map) {
@@ -10490,8 +10534,8 @@ const ys = class ys extends et {
10490
10534
  * A unique identifier for the component.
10491
10535
  * This UUID is used to register the component within the Components system.
10492
10536
  */
10493
- I(ys, "uuid", "d260618b-ce88-4c7d-826c-6debb91de3e2");
10494
- let gn = ys;
10537
+ I(Ls, "uuid", "d260618b-ce88-4c7d-826c-6debb91de3e2");
10538
+ let On = Ls;
10495
10539
  const Ms = class Ms extends et {
10496
10540
  constructor(t) {
10497
10541
  super(t);
@@ -10548,7 +10592,7 @@ const Ms = class Ms extends et {
10548
10592
  */
10549
10593
  I(Ms, "uuid", "dd9ccf2d-8a21-4821-b7f6-2949add16a29");
10550
10594
  let _n = Ms;
10551
- class jr extends Li {
10595
+ class jr extends yi {
10552
10596
  constructor() {
10553
10597
  super(...arguments);
10554
10598
  /**
@@ -10681,8 +10725,8 @@ const ws = class ws extends et {
10681
10725
  const _ = (T == null ? void 0 : T.GlobalId.value) || (T == null ? void 0 : T.GlobalId);
10682
10726
  n.globalToExpressIDs.set(_, p);
10683
10727
  }
10684
- const O = this._spatialTree.itemsByFloor[p] || 0;
10685
- n.data.set(p, [[], [O, m]]), r++;
10728
+ const g = this._spatialTree.itemsByFloor[p] || 0;
10729
+ n.data.set(p, [[], [g, m]]), r++;
10686
10730
  }
10687
10731
  }
10688
10732
  this._spatialTree.cleanUp();
@@ -10717,8 +10761,8 @@ const ws = class ws extends et {
10717
10761
  const c = e.geometries.get(a), h = c.geometryExpressID, d = c.color.w === 1 ? 1 : -1, E = h * d;
10718
10762
  if (!this._visitedGeometries.has(E)) {
10719
10763
  this._visitedGeometries.has(h) || this.getGeometry(t, h);
10720
- const T = this._visitedGeometries.size, O = g.MathUtils.generateUUID();
10721
- this._visitedGeometries.set(E, { uuid: O, index: T });
10764
+ const T = this._visitedGeometries.size, g = O.MathUtils.generateUUID();
10765
+ this._visitedGeometries.set(E, { uuid: g, index: T });
10722
10766
  }
10723
10767
  const u = this._visitedGeometries.get(E);
10724
10768
  if (u === void 0)
@@ -10775,7 +10819,7 @@ const ws = class ws extends et {
10775
10819
  */
10776
10820
  I(ws, "uuid", "d9999a00-e1f5-4d3f-8cfe-c56e08609764");
10777
10821
  let Sn = ws;
10778
- class qr extends Li {
10822
+ class qr extends yi {
10779
10823
  constructor() {
10780
10824
  super(...arguments);
10781
10825
  /**
@@ -10892,7 +10936,7 @@ class Kr extends et {
10892
10936
  n / e.size > o && (o = Math.round(o * 100) / 100, await this.onProgress.trigger(o), o += 0.01);
10893
10937
  }
10894
10938
  await this.onProgress.trigger(1);
10895
- const a = await this.components.get(ke).processFromWebIfc(this.webIfc, 0);
10939
+ const a = await this.components.get(pe).processFromWebIfc(this.webIfc, 0);
10896
10940
  await this.onIndicesStreamed.trigger(a);
10897
10941
  }
10898
10942
  cleanUp() {
@@ -10921,7 +10965,7 @@ const Ds = class Ds extends et {
10921
10965
  * @returns The distance from the point to the line segment.
10922
10966
  */
10923
10967
  static distanceFromPointToLine(t, e, i, o = !1) {
10924
- const n = new g.Line3(), r = new g.Vector3();
10968
+ const n = new O.Line3(), r = new O.Vector3();
10925
10969
  return n.set(e, i), n.closestPointToPoint(t, o, r), r.distanceTo(t);
10926
10970
  }
10927
10971
  /**
@@ -10955,14 +10999,14 @@ const Ds = class Ds extends et {
10955
10999
  const f = /* @__PURE__ */ new Map();
10956
11000
  for (const { id: T } of u)
10957
11001
  if (h.has(T)) {
10958
- const O = h.get(T);
10959
- f.set(T, O);
11002
+ const g = h.get(T);
11003
+ f.set(T, g);
10960
11004
  }
10961
11005
  const R = u.map((T) => T.id);
10962
11006
  if (!f.size) {
10963
11007
  const T = c++;
10964
- for (const { id: O } of u)
10965
- h.set(O, T);
11008
+ for (const { id: g } of u)
11009
+ h.set(g, T);
10966
11010
  d.set(T, {
10967
11011
  edges: new Set(R),
10968
11012
  indices: /* @__PURE__ */ new Set([E])
@@ -10971,9 +11015,9 @@ const Ds = class Ds extends et {
10971
11015
  }
10972
11016
  let m = null;
10973
11017
  const C = /* @__PURE__ */ new Set(), A = new Set(R);
10974
- for (const [T, O] of f) {
10975
- m === null ? m = O : O !== m && C.add(O), h.delete(T);
10976
- const { edges: _ } = d.get(O);
11018
+ for (const [T, g] of f) {
11019
+ m === null ? m = g : g !== m && C.add(g), h.delete(T);
11020
+ const { edges: _ } = d.get(g);
10977
11021
  _.delete(T), A.delete(T);
10978
11022
  }
10979
11023
  if (m === null)
@@ -10982,15 +11026,15 @@ const Ds = class Ds extends et {
10982
11026
  p.add(E);
10983
11027
  for (const T of A) {
10984
11028
  h.set(T, m);
10985
- const { edges: O } = F;
10986
- O.add(T);
11029
+ const { edges: g } = F;
11030
+ g.add(T);
10987
11031
  }
10988
11032
  for (const T of C) {
10989
- const O = d.get(T), { edges: _, indices: S } = O, N = d.get(m), { edges: L, indices: w } = N;
10990
- for (const y of _)
10991
- L.add(y), h.set(y, m);
10992
- for (const y of S)
10993
- w.add(y);
11033
+ const g = d.get(T), { edges: _, indices: S } = g, N = d.get(m), { edges: y, indices: w } = N;
11034
+ for (const L of _)
11035
+ y.add(L), h.set(L, m);
11036
+ for (const L of S)
11037
+ w.add(L);
10994
11038
  d.delete(T);
10995
11039
  }
10996
11040
  }
@@ -11018,12 +11062,12 @@ const Ds = class Ds extends et {
11018
11062
  getVerticesAndNormal(t, e, i) {
11019
11063
  if (!t.geometry.index)
11020
11064
  throw new Error("Geometry must be indexed!");
11021
- const o = t.geometry.index.array, n = t.geometry.attributes.position.array, r = t.geometry.attributes.normal.array, a = o[e * 3] * 3, c = o[e * 3 + 1] * 3, h = o[e * 3 + 2] * 3, d = new g.Vector3(n[a], n[a + 1], n[a + 2]), E = new g.Vector3(n[c], n[c + 1], n[c + 2]), u = new g.Vector3(n[h], n[h + 1], n[h + 2]), f = new g.Vector3(r[a], r[a + 1], r[a + 2]), R = new g.Vector3(r[c], r[c + 1], r[c + 2]), m = new g.Vector3(r[h], r[h + 1], r[h + 2]), C = (f.x + R.x + m.x) / 3, A = (f.y + R.y + m.y) / 3, F = (f.z + R.z + m.z) / 3, p = new g.Vector3(C, A, F);
11022
- if (i !== void 0 && t instanceof g.InstancedMesh) {
11023
- const T = new g.Matrix4();
11065
+ const o = t.geometry.index.array, n = t.geometry.attributes.position.array, r = t.geometry.attributes.normal.array, a = o[e * 3] * 3, c = o[e * 3 + 1] * 3, h = o[e * 3 + 2] * 3, d = new O.Vector3(n[a], n[a + 1], n[a + 2]), E = new O.Vector3(n[c], n[c + 1], n[c + 2]), u = new O.Vector3(n[h], n[h + 1], n[h + 2]), f = new O.Vector3(r[a], r[a + 1], r[a + 2]), R = new O.Vector3(r[c], r[c + 1], r[c + 2]), m = new O.Vector3(r[h], r[h + 1], r[h + 2]), C = (f.x + R.x + m.x) / 3, A = (f.y + R.y + m.y) / 3, F = (f.z + R.z + m.z) / 3, p = new O.Vector3(C, A, F);
11066
+ if (i !== void 0 && t instanceof O.InstancedMesh) {
11067
+ const T = new O.Matrix4();
11024
11068
  t.getMatrixAt(i, T);
11025
- const O = new g.Matrix4();
11026
- O.extractRotation(T), p.applyMatrix4(O), d.applyMatrix4(T), E.applyMatrix4(T), u.applyMatrix4(T);
11069
+ const g = new O.Matrix4();
11070
+ g.extractRotation(T), p.applyMatrix4(g), d.applyMatrix4(T), E.applyMatrix4(T), u.applyMatrix4(T);
11027
11071
  }
11028
11072
  return { p1: d, p2: E, p3: u, faceNormal: p };
11029
11073
  }
@@ -11051,7 +11095,7 @@ const Ds = class Ds extends et {
11051
11095
  * @throws Will throw an error if the fragment manager is not available.
11052
11096
  */
11053
11097
  getVolumeFromFragments(t) {
11054
- const e = this.components.get(ht), i = new g.Matrix4(), o = [];
11098
+ const e = this.components.get(ht), i = new O.Matrix4(), o = [];
11055
11099
  for (const r in t) {
11056
11100
  const a = e.list.get(r);
11057
11101
  if (!a)
@@ -11062,7 +11106,7 @@ const Ds = class Ds extends et {
11062
11106
  const f = a.getInstancesIDs(u);
11063
11107
  f && (h += f.size);
11064
11108
  }
11065
- const d = new g.InstancedMesh(
11109
+ const d = new O.InstancedMesh(
11066
11110
  a.mesh.geometry,
11067
11111
  void 0,
11068
11112
  h
@@ -11127,23 +11171,23 @@ const Ds = class Ds extends et {
11127
11171
  distance: E.distanceTo(m),
11128
11172
  points: [E, m]
11129
11173
  }
11130
- ], A = new g.Plane();
11174
+ ], A = new O.Plane();
11131
11175
  return A.setFromNormalAndCoplanarPoint(c, n), A.constant = Math.round(A.constant * 10) / 10, { plane: A, edges: C };
11132
11176
  }
11133
11177
  // https://stackoverflow.com/a/1568551
11134
11178
  getVolumeOfMesh(t) {
11135
11179
  let e = 0;
11136
- const i = new g.Vector3(), o = new g.Vector3(), n = new g.Vector3(), { index: r } = t.geometry, a = t.geometry.attributes.position.array;
11180
+ const i = new O.Vector3(), o = new O.Vector3(), n = new O.Vector3(), { index: r } = t.geometry, a = t.geometry.attributes.position.array;
11137
11181
  if (!r)
11138
11182
  return console.warn("Geometry must be indexed to compute its volume!"), 0;
11139
11183
  const c = [];
11140
- if (t instanceof g.InstancedMesh)
11184
+ if (t instanceof O.InstancedMesh)
11141
11185
  for (let d = 0; d < t.count; d++) {
11142
- const E = new g.Matrix4();
11186
+ const E = new O.Matrix4();
11143
11187
  t.getMatrixAt(d, E), c.push(E);
11144
11188
  }
11145
11189
  else
11146
- c.push(new g.Matrix4().identity());
11190
+ c.push(new O.Matrix4().identity());
11147
11191
  const { matrixWorld: h } = t;
11148
11192
  for (let d = 0; d < r.array.length - 2; d += 3)
11149
11193
  for (const E of c) {
@@ -11179,7 +11223,7 @@ export {
11179
11223
  Ti as Cullers,
11180
11224
  zt as Disposer,
11181
11225
  D as Event,
11182
- gn as Exploder,
11226
+ On as Exploder,
11183
11227
  zr as FirstPersonMode,
11184
11228
  ht as FragmentsManager,
11185
11229
  vn as GeometryTypes,
@@ -11188,14 +11232,14 @@ export {
11188
11232
  oa as IfcCategories,
11189
11233
  Bn as IfcCategoryMap,
11190
11234
  Zr as IfcElements,
11191
- Li as IfcFragmentSettings,
11235
+ yi as IfcFragmentSettings,
11192
11236
  Sn as IfcGeometryTiler,
11193
11237
  mi as IfcJsonExporter,
11194
11238
  Ri as IfcLoader,
11195
- On as IfcPropertiesManager,
11239
+ gn as IfcPropertiesManager,
11196
11240
  Kr as IfcPropertiesTiler,
11197
11241
  Kt as IfcPropertiesUtils,
11198
- ke as IfcRelationsIndexer,
11242
+ pe as IfcRelationsIndexer,
11199
11243
  jr as IfcStreamingSettings,
11200
11244
  sn as MaterialsUtils,
11201
11245
  Nn as MeasurementUtils,
@@ -11208,15 +11252,15 @@ export {
11208
11252
  kr as PlanMode,
11209
11253
  Wr as ProjectionManager,
11210
11254
  qr as PropertiesStreamingSettings,
11211
- ze as Raycasters,
11212
- He as SimpleCamera,
11255
+ He as Raycasters,
11256
+ ke as SimpleCamera,
11213
11257
  Nr as SimpleGrid,
11214
11258
  Pi as SimplePlane,
11215
11259
  Ar as SimpleRaycaster,
11216
11260
  ia as SimpleRenderer,
11217
11261
  sa as SimpleScene,
11218
11262
  Fr as SimpleWorld,
11219
- Ge as UUID,
11263
+ ze as UUID,
11220
11264
  ea as VertexPicker,
11221
11265
  Ci as Worlds,
11222
11266
  mr as isPointInFrontOfPlane,