@thatopen/components 2.0.0-alpha.15 → 2.0.0-alpha.16

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,131 +1,131 @@
1
1
  var Hn = Object.defineProperty;
2
- var kn = (c, s, t) => s in c ? Hn(c, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : c[s] = t;
3
- var I = (c, s, t) => (kn(c, typeof s != "symbol" ? s + "" : s, t), t);
2
+ var kn = (l, s, t) => s in l ? Hn(l, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[s] = t;
3
+ var u = (l, s, t) => (kn(l, typeof s != "symbol" ? s + "" : s, t), t);
4
4
  import * as g from "three";
5
- import { BufferAttribute as Nn, Vector3 as w, Vector2 as pe, Plane as Ai, Line3 as Lt, Triangle as Ie, Sphere as Wn, Matrix4 as yt, Box3 as Ot, BackSide as Xn, DoubleSide as Pn, FrontSide as Mi, Mesh as v, Ray as Zn, Raycaster as Qn, Quaternion as Pt, Object3D as oi, Euler as jn, MeshBasicMaterial as Ln, LineBasicMaterial as qn, CylinderGeometry as ct, BoxGeometry as rt, BufferGeometry as Di, Float32BufferAttribute as Ui, OctahedronGeometry as Ze, Line as Dt, SphereGeometry as $n, TorusGeometry as Re, PlaneGeometry as Kn } from "three";
5
+ import { BufferAttribute as Nn, Vector3 as w, Vector2 as pe, Plane as Ai, Line3 as Lt, Triangle as ue, Sphere as Wn, Matrix4 as yt, Box3 as Ot, BackSide as Xn, DoubleSide as Pn, FrontSide as Mi, Mesh as v, Ray as Zn, Raycaster as Qn, Quaternion as Pt, Object3D as oi, Euler as jn, MeshBasicMaterial as Ln, LineBasicMaterial as qn, CylinderGeometry as ct, BoxGeometry as rt, BufferGeometry as Di, Float32BufferAttribute as Ui, OctahedronGeometry as Ze, Line as Dt, SphereGeometry as $n, TorusGeometry as Re, PlaneGeometry as Kn } from "three";
6
6
  import * as Vt from "@thatopen/fragments";
7
7
  import { Serializer as Jn } from "@thatopen/fragments";
8
8
  import * as D from "web-ifc";
9
9
  const yn = 0, to = 1, eo = 2, xi = 2, Bs = 1.25, bi = 1, Cs = 6 * 4 + 4 + 4, Ds = 65535, so = Math.pow(2, -24), Ys = Symbol("SKIP_GENERATION");
10
- function io(c) {
11
- return c.index ? c.index.count : c.attributes.position.count;
10
+ function io(l) {
11
+ return l.index ? l.index.count : l.attributes.position.count;
12
12
  }
13
- function Ce(c) {
14
- return io(c) / 3;
13
+ function Ce(l) {
14
+ return io(l) / 3;
15
15
  }
16
- function no(c, s = ArrayBuffer) {
17
- return c > 65535 ? new Uint32Array(new s(4 * c)) : new Uint16Array(new s(2 * c));
16
+ function no(l, s = ArrayBuffer) {
17
+ return l > 65535 ? new Uint32Array(new s(4 * l)) : new Uint16Array(new s(2 * l));
18
18
  }
19
- function oo(c, s) {
20
- if (!c.index) {
21
- const t = c.attributes.position.count, e = s.useSharedArrayBuffer ? SharedArrayBuffer : ArrayBuffer, i = no(t, e);
22
- c.setIndex(new Nn(i, 1));
19
+ function oo(l, s) {
20
+ if (!l.index) {
21
+ const t = l.attributes.position.count, e = s.useSharedArrayBuffer ? SharedArrayBuffer : ArrayBuffer, i = no(t, e);
22
+ l.setIndex(new Nn(i, 1));
23
23
  for (let o = 0; o < t; o++)
24
24
  i[o] = o;
25
25
  }
26
26
  }
27
- function wn(c) {
28
- const s = Ce(c), t = c.drawRange, e = t.start / 3, i = (t.start + t.count) / 3, o = Math.max(0, e), n = Math.min(s, i) - o;
27
+ function wn(l) {
28
+ const s = Ce(l), t = l.drawRange, e = t.start / 3, i = (t.start + t.count) / 3, o = Math.max(0, e), n = Math.min(s, i) - o;
29
29
  return [{
30
30
  offset: Math.floor(o),
31
31
  count: Math.floor(n)
32
32
  }];
33
33
  }
34
- function Mn(c) {
35
- if (!c.groups || !c.groups.length)
36
- return wn(c);
37
- const s = [], t = /* @__PURE__ */ new Set(), e = c.drawRange, i = e.start / 3, o = (e.start + e.count) / 3;
38
- for (const r of c.groups) {
39
- const a = r.start / 3, l = (r.start + r.count) / 3;
40
- t.add(Math.max(i, a)), t.add(Math.min(o, l));
34
+ function Mn(l) {
35
+ if (!l.groups || !l.groups.length)
36
+ return wn(l);
37
+ const s = [], t = /* @__PURE__ */ new Set(), e = l.drawRange, i = e.start / 3, o = (e.start + e.count) / 3;
38
+ for (const r of l.groups) {
39
+ const a = r.start / 3, c = (r.start + r.count) / 3;
40
+ t.add(Math.max(i, a)), t.add(Math.min(o, c));
41
41
  }
42
42
  const n = Array.from(t.values()).sort((r, a) => r - a);
43
43
  for (let r = 0; r < n.length - 1; r++) {
44
- const a = n[r], l = n[r + 1];
44
+ const a = n[r], c = n[r + 1];
45
45
  s.push({
46
46
  offset: Math.floor(a),
47
- count: Math.floor(l - a)
47
+ count: Math.floor(c - a)
48
48
  });
49
49
  }
50
50
  return s;
51
51
  }
52
- function ro(c) {
53
- if (c.groups.length === 0)
52
+ function ro(l) {
53
+ if (l.groups.length === 0)
54
54
  return !1;
55
- const s = Ce(c), t = Mn(c).sort((o, n) => o.offset - n.offset), e = t[t.length - 1];
55
+ const s = Ce(l), t = Mn(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;
59
59
  }
60
- function $(c, s, t) {
61
- return t.min.x = s[c], t.min.y = s[c + 1], t.min.z = s[c + 2], t.max.x = s[c + 3], t.max.y = s[c + 4], t.max.z = s[c + 5], t;
60
+ function $(l, s, t) {
61
+ return t.min.x = s[l], t.min.y = s[l + 1], t.min.z = s[l + 2], t.max.x = s[l + 3], t.max.y = s[l + 4], t.max.z = s[l + 5], t;
62
62
  }
63
- function ao(c) {
64
- c[0] = c[1] = c[2] = 1 / 0, c[3] = c[4] = c[5] = -1 / 0;
63
+ function ao(l) {
64
+ l[0] = l[1] = l[2] = 1 / 0, l[3] = l[4] = l[5] = -1 / 0;
65
65
  }
66
- function vi(c) {
66
+ function vi(l) {
67
67
  let s = -1, t = -1 / 0;
68
68
  for (let e = 0; e < 3; e++) {
69
- const i = c[e + 3] - c[e];
69
+ const i = l[e + 3] - l[e];
70
70
  i > t && (t = i, s = e);
71
71
  }
72
72
  return s;
73
73
  }
74
- function Bi(c, s) {
75
- s.set(c);
74
+ function Bi(l, s) {
75
+ s.set(l);
76
76
  }
77
- function Yi(c, s, t) {
77
+ function Yi(l, s, t) {
78
78
  let e, i;
79
79
  for (let o = 0; o < 3; o++) {
80
80
  const n = o + 3;
81
- e = c[o], i = s[o], t[o] = e < i ? e : i, e = c[n], i = s[n], t[n] = e > i ? e : i;
81
+ e = l[o], i = s[o], t[o] = e < i ? e : i, e = l[n], i = s[n], t[n] = e > i ? e : i;
82
82
  }
83
83
  }
84
- function Qe(c, s, t) {
84
+ function Qe(l, s, t) {
85
85
  for (let e = 0; e < 3; e++) {
86
- const i = s[c + 2 * e], o = s[c + 2 * e + 1], n = i - o, r = i + o;
86
+ const i = s[l + 2 * e], o = s[l + 2 * e + 1], n = i - o, r = i + o;
87
87
  n < t[e] && (t[e] = n), r > t[e + 3] && (t[e + 3] = r);
88
88
  }
89
89
  }
90
- function Ae(c) {
91
- const s = c[3] - c[0], t = c[4] - c[1], e = c[5] - c[2];
90
+ function Ae(l) {
91
+ const s = l[3] - l[0], t = l[4] - l[1], e = l[5] - l[2];
92
92
  return 2 * (s * t + t * e + e * s);
93
93
  }
94
- function Vs(c, s, t, e, i = null) {
95
- let o = 1 / 0, n = 1 / 0, r = 1 / 0, a = -1 / 0, l = -1 / 0, E = -1 / 0, d = 1 / 0, h = 1 / 0, u = 1 / 0, p = -1 / 0, A = -1 / 0, R = -1 / 0;
94
+ function Vs(l, s, t, e, i = null) {
95
+ let o = 1 / 0, n = 1 / 0, r = 1 / 0, a = -1 / 0, c = -1 / 0, E = -1 / 0, d = 1 / 0, h = 1 / 0, I = 1 / 0, p = -1 / 0, A = -1 / 0, R = -1 / 0;
96
96
  const C = i !== null;
97
97
  for (let T = s * 6, F = (s + t) * 6; T < F; T += 6) {
98
- const f = c[T + 0], m = c[T + 1], O = f - m, S = f + m;
98
+ const f = l[T + 0], m = l[T + 1], O = f - m, S = f + m;
99
99
  O < o && (o = O), S > a && (a = S), C && f < d && (d = f), C && f > p && (p = f);
100
- const _ = c[T + 2], N = c[T + 3], L = _ - N, M = _ + N;
101
- L < n && (n = L), M > l && (l = M), C && _ < h && (h = _), C && _ > A && (A = _);
102
- const y = c[T + 4], x = c[T + 5], b = y - x, B = y + x;
103
- b < r && (r = b), B > E && (E = B), C && y < u && (u = y), C && y > R && (R = y);
100
+ const _ = l[T + 2], N = l[T + 3], L = _ - N, M = _ + N;
101
+ L < n && (n = L), M > c && (c = M), C && _ < h && (h = _), C && _ > A && (A = _);
102
+ const y = l[T + 4], x = l[T + 5], b = y - x, B = y + x;
103
+ b < r && (r = b), B > E && (E = B), C && y < I && (I = y), C && y > R && (R = y);
104
104
  }
105
- e[0] = o, e[1] = n, e[2] = r, e[3] = a, e[4] = l, e[5] = E, C && (i[0] = d, i[1] = h, i[2] = u, i[3] = p, i[4] = A, i[5] = R);
105
+ e[0] = o, e[1] = n, e[2] = r, e[3] = a, e[4] = c, e[5] = E, C && (i[0] = d, i[1] = h, i[2] = I, i[3] = p, i[4] = A, i[5] = R);
106
106
  }
107
- function co(c, s, t, e) {
108
- let i = 1 / 0, o = 1 / 0, n = 1 / 0, r = -1 / 0, a = -1 / 0, l = -1 / 0;
107
+ function co(l, s, t, e) {
108
+ let i = 1 / 0, o = 1 / 0, n = 1 / 0, r = -1 / 0, a = -1 / 0, c = -1 / 0;
109
109
  for (let E = s * 6, d = (s + t) * 6; E < d; E += 6) {
110
- const h = c[E + 0];
110
+ const h = l[E + 0];
111
111
  h < i && (i = h), h > r && (r = h);
112
- const u = c[E + 2];
113
- u < o && (o = u), u > a && (a = u);
114
- const p = c[E + 4];
115
- p < n && (n = p), p > l && (l = p);
112
+ const I = l[E + 2];
113
+ I < o && (o = I), I > a && (a = I);
114
+ const p = l[E + 4];
115
+ p < n && (n = p), p > c && (c = p);
116
116
  }
117
- e[0] = i, e[1] = o, e[2] = n, e[3] = r, e[4] = a, e[5] = l;
117
+ e[0] = i, e[1] = o, e[2] = n, e[3] = r, e[4] = a, e[5] = c;
118
118
  }
119
- function lo(c, s) {
119
+ function lo(l, s) {
120
120
  ao(s);
121
- const t = c.attributes.position, e = c.index ? c.index.array : null, i = Ce(c), o = new Float32Array(i * 6), n = t.normalized, r = t.array, a = t.offset || 0;
122
- let l = 3;
123
- t.isInterleavedBufferAttribute && (l = t.data.stride);
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
+ let c = 3;
123
+ t.isInterleavedBufferAttribute && (c = t.data.stride);
124
124
  const E = ["getX", "getY", "getZ"];
125
125
  for (let d = 0; d < i; d++) {
126
- const h = d * 3, u = d * 6;
126
+ const h = d * 3, I = d * 6;
127
127
  let p = h + 0, A = h + 1, R = h + 2;
128
- e && (p = e[p], A = e[A], R = e[R]), n || (p = p * l + a, A = A * l + a, R = R * l + a);
128
+ e && (p = e[p], A = e[A], R = e[R]), n || (p = p * c + a, A = A * c + a, R = R * c + a);
129
129
  for (let C = 0; C < 3; C++) {
130
130
  let T, F, f;
131
131
  n ? (T = t[E[C]](p), F = t[E[C]](A), f = t[E[C]](R)) : (T = r[p + C], F = r[A + C], f = r[R + C]);
@@ -134,30 +134,30 @@ function lo(c, s) {
134
134
  let O = T;
135
135
  F > O && (O = F), f > O && (O = f);
136
136
  const S = (O - m) / 2, _ = C * 2;
137
- o[u + _ + 0] = m + S, o[u + _ + 1] = S + (Math.abs(m) + S) * so, m < s[C] && (s[C] = m), O > s[C + 3] && (s[C + 3] = O);
137
+ o[I + _ + 0] = m + S, o[I + _ + 1] = S + (Math.abs(m) + S) * so, m < s[C] && (s[C] = m), O > s[C + 3] && (s[C + 3] = O);
138
138
  }
139
139
  }
140
140
  return o;
141
141
  }
142
- const wt = 32, ho = (c, s) => c.candidate - s.candidate, Ut = new Array(wt).fill().map(() => ({
142
+ const wt = 32, ho = (l, s) => l.candidate - s.candidate, Ut = new Array(wt).fill().map(() => ({
143
143
  count: 0,
144
144
  bounds: new Float32Array(6),
145
145
  rightCacheBounds: new Float32Array(6),
146
146
  leftCacheBounds: new Float32Array(6),
147
147
  candidate: 0
148
148
  })), je = new Float32Array(6);
149
- function Eo(c, s, t, e, i, o) {
149
+ function Eo(l, s, t, e, i, o) {
150
150
  let n = -1, r = 0;
151
151
  if (o === yn)
152
152
  n = vi(s), n !== -1 && (r = (s[n] + s[n + 3]) / 2);
153
153
  else if (o === to)
154
- n = vi(c), n !== -1 && (r = uo(t, e, i, n));
154
+ n = vi(l), n !== -1 && (r = Io(t, e, i, n));
155
155
  else if (o === eo) {
156
- const a = Ae(c);
157
- let l = Bs * i;
156
+ const a = Ae(l);
157
+ let c = Bs * i;
158
158
  const E = e * 6, d = (e + i) * 6;
159
159
  for (let h = 0; h < 3; h++) {
160
- const u = s[h], R = (s[h + 3] - u) / wt;
160
+ const I = s[h], R = (s[h + 3] - I) / wt;
161
161
  if (i < wt / 4) {
162
162
  const C = [...Ut];
163
163
  C.length = i;
@@ -195,18 +195,18 @@ function Eo(c, s, t, e, i, o) {
195
195
  let M = 0;
196
196
  S !== 0 && (M = Ae(N) / a);
197
197
  const y = bi + Bs * (L * O + M * S);
198
- y < l && (n = h, l = y, r = m.candidate);
198
+ y < c && (n = h, c = y, r = m.candidate);
199
199
  }
200
200
  } else {
201
201
  for (let F = 0; F < wt; F++) {
202
202
  const f = Ut[F];
203
- f.count = 0, f.candidate = u + R + F * R;
203
+ f.count = 0, f.candidate = I + R + F * R;
204
204
  const m = f.bounds;
205
205
  for (let O = 0; O < 3; O++)
206
206
  m[O] = 1 / 0, m[O + 3] = -1 / 0;
207
207
  }
208
208
  for (let F = E; F < d; F += 6) {
209
- let O = ~~((t[F + 2 * h] - u) / R);
209
+ let O = ~~((t[F + 2 * h] - I) / R);
210
210
  O >= wt && (O = wt - 1);
211
211
  const S = Ut[O];
212
212
  S.count++, Qe(F, t, S.bounds);
@@ -226,7 +226,7 @@ function Eo(c, s, t, e, i, o) {
226
226
  const M = i - T;
227
227
  M !== 0 && (L = Ae(_) / a);
228
228
  const y = bi + Bs * (N * T + L * M);
229
- y < l && (n = h, l = y, r = f.candidate);
229
+ y < c && (n = h, c = y, r = f.candidate);
230
230
  }
231
231
  }
232
232
  }
@@ -234,23 +234,23 @@ function Eo(c, s, t, e, i, o) {
234
234
  console.warn(`MeshBVH: Invalid build strategy value ${o} used.`);
235
235
  return { axis: n, pos: r };
236
236
  }
237
- function uo(c, s, t, e) {
237
+ function Io(l, s, t, e) {
238
238
  let i = 0;
239
239
  for (let o = s, n = s + t; o < n; o++)
240
- i += c[o * 6 + e * 2];
240
+ i += l[o * 6 + e * 2];
241
241
  return i / t;
242
242
  }
243
243
  class qe {
244
244
  constructor() {
245
245
  }
246
246
  }
247
- function Io(c, s, t, e, i, o) {
247
+ function uo(l, s, t, e, i, o) {
248
248
  let n = e, r = e + i - 1;
249
- const a = o.pos, l = o.axis * 2;
249
+ const a = o.pos, c = o.axis * 2;
250
250
  for (; ; ) {
251
- for (; n <= r && t[n * 6 + l] < a; )
251
+ for (; n <= r && t[n * 6 + c] < a; )
252
252
  n++;
253
- for (; n <= r && t[r * 6 + l] >= a; )
253
+ for (; n <= r && t[r * 6 + c] >= a; )
254
254
  r--;
255
255
  if (n < r) {
256
256
  for (let E = 0; E < 3; E++) {
@@ -266,17 +266,17 @@ function Io(c, s, t, e, i, o) {
266
266
  return n;
267
267
  }
268
268
  }
269
- function fo(c, s, t, e, i, o) {
269
+ function fo(l, s, t, e, i, o) {
270
270
  let n = e, r = e + i - 1;
271
- const a = o.pos, l = o.axis * 2;
271
+ const a = o.pos, c = o.axis * 2;
272
272
  for (; ; ) {
273
- for (; n <= r && t[n * 6 + l] < a; )
273
+ for (; n <= r && t[n * 6 + c] < a; )
274
274
  n++;
275
- for (; n <= r && t[r * 6 + l] >= a; )
275
+ for (; n <= r && t[r * 6 + c] >= a; )
276
276
  r--;
277
277
  if (n < r) {
278
- let E = c[n];
279
- c[n] = c[r], c[r] = E;
278
+ let E = l[n];
279
+ l[n] = l[r], l[r] = E;
280
280
  for (let d = 0; d < 6; d++) {
281
281
  let h = t[n * 6 + d];
282
282
  t[n * 6 + d] = t[r * 6 + d], t[r * 6 + d] = h;
@@ -286,27 +286,27 @@ function fo(c, s, t, e, i, o) {
286
286
  return n;
287
287
  }
288
288
  }
289
- function po(c, s) {
290
- const t = (c.index ? c.index.count : c.attributes.position.count) / 3, e = t > 2 ** 16, i = e ? 4 : 2, o = s ? new SharedArrayBuffer(t * i) : new ArrayBuffer(t * i), n = e ? new Uint32Array(o) : new Uint16Array(o);
289
+ function po(l, s) {
290
+ const t = (l.index ? l.index.count : l.attributes.position.count) / 3, e = t > 2 ** 16, i = e ? 4 : 2, o = s ? new SharedArrayBuffer(t * i) : new ArrayBuffer(t * i), n = e ? new Uint32Array(o) : new Uint16Array(o);
291
291
  for (let r = 0, a = n.length; r < a; r++)
292
292
  n[r] = r;
293
293
  return n;
294
294
  }
295
- function Co(c, s) {
296
- const t = c.geometry, e = t.index ? t.index.array : null, i = s.maxDepth, o = s.verbose, n = s.maxLeafTris, r = s.strategy, a = s.onProgress, l = Ce(t), E = c._indirectBuffer;
295
+ function Co(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 = Ce(t), E = l._indirectBuffer;
297
297
  let d = !1;
298
- const h = new Float32Array(6), u = new Float32Array(6), p = lo(t, h), A = s.indirect ? fo : Io, R = [], C = s.indirect ? wn(t) : Mn(t);
298
+ const h = new Float32Array(6), I = new Float32Array(6), p = lo(t, h), A = s.indirect ? fo : uo, R = [], C = s.indirect ? wn(t) : Mn(t);
299
299
  if (C.length === 1) {
300
300
  const f = C[0], m = new qe();
301
- m.boundingData = h, co(p, f.offset, f.count, u), F(m, f.offset, f.count, u), R.push(m);
301
+ m.boundingData = h, co(p, f.offset, f.count, I), F(m, f.offset, f.count, I), R.push(m);
302
302
  } else
303
303
  for (let f of C) {
304
304
  const m = new qe();
305
- m.boundingData = new Float32Array(6), Vs(p, f.offset, f.count, m.boundingData, u), F(m, f.offset, f.count, u), R.push(m);
305
+ m.boundingData = new Float32Array(6), Vs(p, f.offset, f.count, m.boundingData, I), F(m, f.offset, f.count, I), R.push(m);
306
306
  }
307
307
  return R;
308
308
  function T(f) {
309
- a && a(f / l);
309
+ a && a(f / c);
310
310
  }
311
311
  function F(f, m, O, S = null, _ = 0) {
312
312
  if (!d && _ >= i && (d = !0, o && (console.warn(`MeshBVH: Max depth of ${i} reached when generating BVH. Consider increasing maxDepth.`), console.warn(t))), O <= n || _ >= i)
@@ -320,45 +320,45 @@ function Co(c, s) {
320
320
  else {
321
321
  f.splitAxis = N.axis;
322
322
  const M = new qe(), y = m, x = L - m;
323
- f.left = M, M.boundingData = new Float32Array(6), Vs(p, y, x, M.boundingData, u), F(M, y, x, u, _ + 1);
323
+ f.left = M, M.boundingData = new Float32Array(6), Vs(p, y, x, M.boundingData, I), F(M, y, x, I, _ + 1);
324
324
  const b = new qe(), B = L, H = O - x;
325
- f.right = b, b.boundingData = new Float32Array(6), Vs(p, B, H, b.boundingData, u), F(b, B, H, u, _ + 1);
325
+ f.right = b, b.boundingData = new Float32Array(6), Vs(p, B, H, b.boundingData, I), F(b, B, H, I, _ + 1);
326
326
  }
327
327
  return f;
328
328
  }
329
329
  }
330
- function To(c, s) {
331
- const t = c.geometry;
332
- s.indirect && (c._indirectBuffer = po(t, s.useSharedArrayBuffer), ro(t) && !s.verbose && console.warn(
330
+ function To(l, s) {
331
+ const t = l.geometry;
332
+ s.indirect && (l._indirectBuffer = po(t, s.useSharedArrayBuffer), ro(t) && !s.verbose && console.warn(
333
333
  'MeshBVH: Provided geometry contains groups that do not fully span the vertex contents while using the "indirect" option. BVH may incorrectly report intersections on unrendered portions of the geometry.'
334
- )), c._indirectBuffer || oo(t, s);
335
- const e = Co(c, s);
334
+ )), l._indirectBuffer || oo(t, s);
335
+ const e = Co(l, s);
336
336
  let i, o, n;
337
337
  const r = [], a = s.useSharedArrayBuffer ? SharedArrayBuffer : ArrayBuffer;
338
338
  for (let d = 0; d < e.length; d++) {
339
339
  const h = e[d];
340
- let u = l(h);
341
- const p = new a(Cs * u);
340
+ let I = c(h);
341
+ const p = new a(Cs * I);
342
342
  i = new Float32Array(p), o = new Uint32Array(p), n = new Uint16Array(p), E(0, h), r.push(p);
343
343
  }
344
- c._roots = r;
344
+ l._roots = r;
345
345
  return;
346
- function l(d) {
347
- return d.count ? 1 : 1 + l(d.left) + l(d.right);
346
+ function c(d) {
347
+ return d.count ? 1 : 1 + c(d.left) + c(d.right);
348
348
  }
349
349
  function E(d, h) {
350
- const u = d / 4, p = d / 2, A = !!h.count, R = h.boundingData;
350
+ const I = d / 4, p = d / 2, A = !!h.count, R = h.boundingData;
351
351
  for (let C = 0; C < 6; C++)
352
- i[u + C] = R[C];
352
+ i[I + C] = R[C];
353
353
  if (A) {
354
354
  const C = h.offset, T = h.count;
355
- return o[u + 6] = C, n[p + 14] = T, n[p + 15] = Ds, d + Cs;
355
+ return o[I + 6] = C, n[p + 14] = T, n[p + 15] = Ds, d + Cs;
356
356
  } else {
357
357
  const C = h.left, T = h.right, F = h.splitAxis;
358
358
  let f;
359
359
  if (f = E(d + Cs, C), f / 4 > Math.pow(2, 32))
360
360
  throw new Error("MeshBVH: Cannot store child pointer greater than 32 bits.");
361
- return o[u + 6] = f / 4, f = E(f, T), o[u + 7] = F, f;
361
+ return o[I + 6] = f / 4, f = E(f, T), o[I + 7] = F, f;
362
362
  }
363
363
  }
364
364
  }
@@ -387,63 +387,63 @@ class Mt {
387
387
  }
388
388
  }
389
389
  Mt.prototype.setFromBox = function() {
390
- const c = new w();
390
+ const l = new w();
391
391
  return function(t, e) {
392
392
  const i = e.min, o = e.max;
393
393
  let n = 1 / 0, r = -1 / 0;
394
394
  for (let a = 0; a <= 1; a++)
395
- for (let l = 0; l <= 1; l++)
395
+ for (let c = 0; c <= 1; c++)
396
396
  for (let E = 0; E <= 1; E++) {
397
- c.x = i.x * a + o.x * (1 - a), c.y = i.y * l + o.y * (1 - l), c.z = i.z * E + o.z * (1 - E);
398
- const d = t.dot(c);
397
+ l.x = i.x * a + o.x * (1 - a), l.y = i.y * c + o.y * (1 - c), l.z = i.z * E + o.z * (1 - E);
398
+ const d = t.dot(l);
399
399
  n = Math.min(d, n), r = Math.max(d, r);
400
400
  }
401
401
  this.min = n, this.max = r;
402
402
  };
403
403
  }();
404
404
  const mo = function() {
405
- const c = new w(), s = new w(), t = new w();
405
+ const l = new w(), s = new w(), t = new w();
406
406
  return function(i, o, n) {
407
- const r = i.start, a = c, l = o.start, E = s;
408
- t.subVectors(r, l), c.subVectors(i.end, i.start), s.subVectors(o.end, o.start);
409
- const d = t.dot(E), h = E.dot(a), u = E.dot(E), p = t.dot(a), R = a.dot(a) * u - h * h;
407
+ const r = i.start, a = l, c = o.start, E = s;
408
+ t.subVectors(r, c), l.subVectors(i.end, i.start), s.subVectors(o.end, o.start);
409
+ const d = t.dot(E), h = E.dot(a), I = E.dot(E), p = t.dot(a), R = a.dot(a) * I - h * h;
410
410
  let C, T;
411
- R !== 0 ? C = (d * h - p * u) / R : C = 0, T = (d + C * h) / u, n.x = C, n.y = T;
411
+ R !== 0 ? C = (d * h - p * I) / R : C = 0, T = (d + C * h) / I, n.x = C, n.y = T;
412
412
  };
413
413
  }(), Fi = function() {
414
- const c = new pe(), s = new w(), t = new w();
414
+ const l = new pe(), s = new w(), t = new w();
415
415
  return function(i, o, n, r) {
416
- mo(i, o, c);
417
- let a = c.x, l = c.y;
418
- if (a >= 0 && a <= 1 && l >= 0 && l <= 1) {
419
- i.at(a, n), o.at(l, r);
416
+ mo(i, o, l);
417
+ let a = l.x, c = l.y;
418
+ if (a >= 0 && a <= 1 && c >= 0 && c <= 1) {
419
+ i.at(a, n), o.at(c, r);
420
420
  return;
421
421
  } else if (a >= 0 && a <= 1) {
422
- l < 0 ? o.at(0, r) : o.at(1, r), i.closestPointToPoint(r, !0, n);
422
+ c < 0 ? o.at(0, r) : o.at(1, r), i.closestPointToPoint(r, !0, n);
423
423
  return;
424
- } else if (l >= 0 && l <= 1) {
424
+ } else if (c >= 0 && c <= 1) {
425
425
  a < 0 ? i.at(0, n) : i.at(1, n), o.closestPointToPoint(n, !0, r);
426
426
  return;
427
427
  } else {
428
428
  let E;
429
429
  a < 0 ? E = i.start : E = i.end;
430
430
  let d;
431
- l < 0 ? d = o.start : d = o.end;
432
- const h = s, u = t;
433
- if (i.closestPointToPoint(d, !0, s), o.closestPointToPoint(E, !0, t), h.distanceToSquared(d) <= u.distanceToSquared(E)) {
431
+ c < 0 ? d = o.start : d = o.end;
432
+ const h = s, I = t;
433
+ if (i.closestPointToPoint(d, !0, s), o.closestPointToPoint(E, !0, t), h.distanceToSquared(d) <= I.distanceToSquared(E)) {
434
434
  n.copy(h), r.copy(d);
435
435
  return;
436
436
  } else {
437
- n.copy(E), r.copy(u);
437
+ n.copy(E), r.copy(I);
438
438
  return;
439
439
  }
440
440
  }
441
441
  };
442
442
  }(), Ro = function() {
443
- const c = new w(), s = new w(), t = new Ai(), e = new Lt();
443
+ const l = new w(), s = new w(), t = new Ai(), e = new Lt();
444
444
  return function(o, n) {
445
- const { radius: r, center: a } = o, { a: l, b: E, c: d } = n;
446
- if (e.start = l, e.end = E, e.closestPointToPoint(a, !0, c).distanceTo(a) <= r || (e.start = l, e.end = d, e.closestPointToPoint(a, !0, c).distanceTo(a) <= r) || (e.start = E, e.end = d, e.closestPointToPoint(a, !0, c).distanceTo(a) <= r))
445
+ const { radius: r, center: a } = o, { a: c, b: E, c: d } = n;
446
+ if (e.start = c, e.end = E, e.closestPointToPoint(a, !0, l).distanceTo(a) <= r || (e.start = c, e.end = d, e.closestPointToPoint(a, !0, l).distanceTo(a) <= r) || (e.start = E, e.end = d, e.closestPointToPoint(a, !0, l).distanceTo(a) <= r))
447
447
  return !0;
448
448
  const A = n.getPlane(t);
449
449
  if (Math.abs(A.distanceToPoint(a)) <= r) {
@@ -454,10 +454,10 @@ const mo = function() {
454
454
  return !1;
455
455
  };
456
456
  }(), Ao = 1e-15;
457
- function Gs(c) {
458
- return Math.abs(c) < Ao;
457
+ function Gs(l) {
458
+ return Math.abs(l) < Ao;
459
459
  }
460
- class Ft extends Ie {
460
+ class Ft extends ue {
461
461
  constructor(...s) {
462
462
  super(...s), this.isExtendedTriangle = !0, this.satAxes = new Array(4).fill().map(() => new w()), this.satBounds = new Array(4).fill().map(() => new Mt()), this.points = [this.a, this.b, this.c], this.sphere = new Wn(), this.plane = new Ai(), this.needsUpdate = !0;
463
463
  }
@@ -467,28 +467,28 @@ class Ft extends Ie {
467
467
  update() {
468
468
  const s = this.a, t = this.b, e = this.c, i = this.points, o = this.satAxes, n = this.satBounds, r = o[0], a = n[0];
469
469
  this.getNormal(r), a.setFromPoints(r, i);
470
- const l = o[1], E = n[1];
471
- l.subVectors(s, t), E.setFromPoints(l, i);
470
+ const c = o[1], E = n[1];
471
+ c.subVectors(s, t), E.setFromPoints(c, i);
472
472
  const d = o[2], h = n[2];
473
473
  d.subVectors(t, e), h.setFromPoints(d, i);
474
- const u = o[3], p = n[3];
475
- u.subVectors(e, s), p.setFromPoints(u, i), this.sphere.setFromPoints(this.points), this.plane.setFromNormalAndCoplanarPoint(r, s), this.needsUpdate = !1;
474
+ const I = o[3], p = n[3];
475
+ I.subVectors(e, s), p.setFromPoints(I, i), this.sphere.setFromPoints(this.points), this.plane.setFromNormalAndCoplanarPoint(r, s), this.needsUpdate = !1;
476
476
  }
477
477
  }
478
478
  Ft.prototype.closestPointToSegment = function() {
479
- const c = new w(), s = new w(), t = new Lt();
479
+ const l = new w(), s = new w(), t = new Lt();
480
480
  return function(i, o = null, n = null) {
481
- const { start: r, end: a } = i, l = this.points;
481
+ const { start: r, end: a } = i, c = this.points;
482
482
  let E, d = 1 / 0;
483
483
  for (let h = 0; h < 3; h++) {
484
- const u = (h + 1) % 3;
485
- t.start.copy(l[h]), t.end.copy(l[u]), Fi(t, i, c, s), E = c.distanceToSquared(s), E < d && (d = E, o && o.copy(c), n && n.copy(s));
484
+ const I = (h + 1) % 3;
485
+ t.start.copy(c[h]), t.end.copy(c[I]), Fi(t, i, l, s), E = l.distanceToSquared(s), E < d && (d = E, o && o.copy(l), n && n.copy(s));
486
486
  }
487
- return this.closestPointToPoint(r, c), E = r.distanceToSquared(c), E < d && (d = E, o && o.copy(c), n && n.copy(r)), this.closestPointToPoint(a, c), E = a.distanceToSquared(c), E < d && (d = E, o && o.copy(c), n && n.copy(a)), Math.sqrt(d);
487
+ return this.closestPointToPoint(r, l), E = r.distanceToSquared(l), E < d && (d = E, o && o.copy(l), n && n.copy(r)), this.closestPointToPoint(a, l), E = a.distanceToSquared(l), E < d && (d = E, o && o.copy(l), n && n.copy(a)), Math.sqrt(d);
488
488
  };
489
489
  }();
490
490
  Ft.prototype.intersectsTriangle = function() {
491
- const c = new Ft(), s = new Array(3), t = new Array(3), e = new Mt(), i = new Mt(), o = new w(), n = new w(), r = new w(), a = new w(), l = new w(), E = new Lt(), d = new Lt(), h = new Lt(), u = new w();
491
+ const l = new Ft(), s = new Array(3), t = new Array(3), e = new Mt(), i = new Mt(), o = new w(), n = new w(), r = new w(), a = new w(), c = new w(), E = new Lt(), d = new Lt(), h = new Lt(), I = new w();
492
492
  function p(A, R, C) {
493
493
  const T = A.points;
494
494
  let F = 0, f = -1;
@@ -500,12 +500,12 @@ Ft.prototype.intersectsTriangle = function() {
500
500
  C.copy(E), F = 2;
501
501
  break;
502
502
  }
503
- const N = R.intersectLine(E, u);
504
- if (!N && _ && u.copy(O), (N || _) && !Gs(u.distanceTo(S))) {
503
+ const N = R.intersectLine(E, I);
504
+ if (!N && _ && I.copy(O), (N || _) && !Gs(I.distanceTo(S))) {
505
505
  if (F <= 1)
506
- (F === 1 ? C.start : C.end).copy(u), _ && (f = F);
506
+ (F === 1 ? C.start : C.end).copy(I), _ && (f = F);
507
507
  else if (F >= 2) {
508
- (f === 1 ? C.start : C.end).copy(u), F = 2;
508
+ (f === 1 ? C.start : C.end).copy(I), F = 2;
509
509
  break;
510
510
  }
511
511
  if (F++, F === 2 && f === -1)
@@ -515,7 +515,7 @@ Ft.prototype.intersectsTriangle = function() {
515
515
  return F;
516
516
  }
517
517
  return function(R, C = null, T = !1) {
518
- this.needsUpdate && this.update(), R.isExtendedTriangle ? R.needsUpdate && R.update() : (c.copy(R), c.update(), R = c);
518
+ this.needsUpdate && this.update(), R.isExtendedTriangle ? R.needsUpdate && R.update() : (l.copy(R), l.update(), R = l);
519
519
  const F = this.plane, f = R.plane;
520
520
  if (Math.abs(F.normal.dot(f.normal)) > 1 - 1e-10) {
521
521
  const m = this.satBounds, O = this.satAxes;
@@ -557,38 +557,38 @@ Ft.prototype.intersectsTriangle = function() {
557
557
  h.start = h.end, h.end = x;
558
558
  }
559
559
  const S = d.start.dot(r), _ = d.end.dot(r), N = h.start.dot(r), L = h.end.dot(r), M = _ < N, y = S < L;
560
- return S !== L && N !== _ && M === y ? !1 : (C && (l.subVectors(d.start, h.start), l.dot(r) > 0 ? C.start.copy(d.start) : C.start.copy(h.start), l.subVectors(d.end, h.end), l.dot(r) < 0 ? C.end.copy(d.end) : C.end.copy(h.end)), !0);
560
+ return S !== L && N !== _ && M === y ? !1 : (C && (c.subVectors(d.start, h.start), c.dot(r) > 0 ? C.start.copy(d.start) : C.start.copy(h.start), c.subVectors(d.end, h.end), c.dot(r) < 0 ? C.end.copy(d.end) : C.end.copy(h.end)), !0);
561
561
  }
562
562
  };
563
563
  }();
564
564
  Ft.prototype.distanceToPoint = function() {
565
- const c = new w();
565
+ const l = new w();
566
566
  return function(t) {
567
- return this.closestPointToPoint(t, c), t.distanceTo(c);
567
+ return this.closestPointToPoint(t, l), t.distanceTo(l);
568
568
  };
569
569
  }();
570
570
  Ft.prototype.distanceToTriangle = function() {
571
- const c = new w(), s = new w(), t = ["a", "b", "c"], e = new Lt(), i = new Lt();
571
+ const l = new w(), s = new w(), t = ["a", "b", "c"], e = new Lt(), i = new Lt();
572
572
  return function(n, r = null, a = null) {
573
- const l = r || a ? e : null;
574
- if (this.intersectsTriangle(n, l))
575
- return (r || a) && (r && l.getCenter(r), a && l.getCenter(a)), 0;
573
+ const c = r || a ? e : null;
574
+ if (this.intersectsTriangle(n, c))
575
+ return (r || a) && (r && c.getCenter(r), a && c.getCenter(a)), 0;
576
576
  let E = 1 / 0;
577
577
  for (let d = 0; d < 3; d++) {
578
578
  let h;
579
- const u = t[d], p = n[u];
580
- this.closestPointToPoint(p, c), h = p.distanceToSquared(c), h < E && (E = h, r && r.copy(c), a && a.copy(p));
581
- const A = this[u];
582
- n.closestPointToPoint(A, c), h = A.distanceToSquared(c), h < E && (E = h, r && r.copy(A), a && a.copy(c));
579
+ const I = t[d], p = n[I];
580
+ this.closestPointToPoint(p, l), h = p.distanceToSquared(l), h < E && (E = h, r && r.copy(l), a && a.copy(p));
581
+ const A = this[I];
582
+ n.closestPointToPoint(A, l), h = A.distanceToSquared(l), h < E && (E = h, r && r.copy(A), a && a.copy(l));
583
583
  }
584
584
  for (let d = 0; d < 3; d++) {
585
- const h = t[d], u = t[(d + 1) % 3];
586
- e.set(this[h], this[u]);
585
+ const h = t[d], I = t[(d + 1) % 3];
586
+ e.set(this[h], this[I]);
587
587
  for (let p = 0; p < 3; p++) {
588
588
  const A = t[p], R = t[(p + 1) % 3];
589
- i.set(n[A], n[R]), Fi(e, i, c, s);
590
- const C = c.distanceToSquared(s);
591
- C < E && (E = C, r && r.copy(c), a && a.copy(s));
589
+ i.set(n[A], n[R]), Fi(e, i, l, s);
590
+ const C = l.distanceToSquared(s);
591
+ C < E && (E = C, r && r.copy(l), a && a.copy(s));
592
592
  }
593
593
  }
594
594
  return Math.sqrt(E);
@@ -608,58 +608,58 @@ class at {
608
608
  at.prototype.update = /* @__PURE__ */ function() {
609
609
  return function() {
610
610
  const s = this.matrix, t = this.min, e = this.max, i = this.points;
611
- for (let l = 0; l <= 1; l++)
611
+ for (let c = 0; c <= 1; c++)
612
612
  for (let E = 0; E <= 1; E++)
613
613
  for (let d = 0; d <= 1; d++) {
614
- const h = 1 * l | 2 * E | 4 * d, u = i[h];
615
- u.x = l ? e.x : t.x, u.y = E ? e.y : t.y, u.z = d ? e.z : t.z, u.applyMatrix4(s);
614
+ const h = 1 * c | 2 * E | 4 * d, I = i[h];
615
+ I.x = c ? e.x : t.x, I.y = E ? e.y : t.y, I.z = d ? e.z : t.z, I.applyMatrix4(s);
616
616
  }
617
617
  const o = this.satBounds, n = this.satAxes, r = i[0];
618
- for (let l = 0; l < 3; l++) {
619
- const E = n[l], d = o[l], h = 1 << l, u = i[h];
620
- E.subVectors(r, u), d.setFromPoints(E, i);
618
+ for (let c = 0; c < 3; c++) {
619
+ const E = n[c], d = o[c], h = 1 << c, I = i[h];
620
+ E.subVectors(r, I), d.setFromPoints(E, i);
621
621
  }
622
622
  const a = this.alignedSatBounds;
623
623
  a[0].setFromPointsField(i, "x"), a[1].setFromPointsField(i, "y"), a[2].setFromPointsField(i, "z"), this.invMatrix.copy(this.matrix).invert(), this.needsUpdate = !1;
624
624
  };
625
625
  }();
626
626
  at.prototype.intersectsBox = function() {
627
- const c = new Mt();
627
+ const l = new Mt();
628
628
  return function(t) {
629
629
  this.needsUpdate && this.update();
630
630
  const e = t.min, i = t.max, o = this.satBounds, n = this.satAxes, r = this.alignedSatBounds;
631
- if (c.min = e.x, c.max = i.x, r[0].isSeparated(c) || (c.min = e.y, c.max = i.y, r[1].isSeparated(c)) || (c.min = e.z, c.max = i.z, r[2].isSeparated(c)))
631
+ if (l.min = e.x, l.max = i.x, r[0].isSeparated(l) || (l.min = e.y, l.max = i.y, r[1].isSeparated(l)) || (l.min = e.z, l.max = i.z, r[2].isSeparated(l)))
632
632
  return !1;
633
633
  for (let a = 0; a < 3; a++) {
634
- const l = n[a], E = o[a];
635
- if (c.setFromBox(l, t), E.isSeparated(c))
634
+ const c = n[a], E = o[a];
635
+ if (l.setFromBox(c, t), E.isSeparated(l))
636
636
  return !1;
637
637
  }
638
638
  return !0;
639
639
  };
640
640
  }();
641
641
  at.prototype.intersectsTriangle = function() {
642
- const c = new Ft(), s = new Array(3), t = new Mt(), e = new Mt(), i = new w();
642
+ const l = new Ft(), s = new Array(3), t = new Mt(), e = new Mt(), i = new w();
643
643
  return function(n) {
644
- this.needsUpdate && this.update(), n.isExtendedTriangle ? n.needsUpdate && n.update() : (c.copy(n), c.update(), n = c);
644
+ this.needsUpdate && this.update(), n.isExtendedTriangle ? n.needsUpdate && n.update() : (l.copy(n), l.update(), n = l);
645
645
  const r = this.satBounds, a = this.satAxes;
646
646
  s[0] = n.a, s[1] = n.b, s[2] = n.c;
647
647
  for (let h = 0; h < 3; h++) {
648
- const u = r[h], p = a[h];
649
- if (t.setFromPoints(p, s), u.isSeparated(t))
648
+ const I = r[h], p = a[h];
649
+ if (t.setFromPoints(p, s), I.isSeparated(t))
650
650
  return !1;
651
651
  }
652
- const l = n.satBounds, E = n.satAxes, d = this.points;
652
+ const c = n.satBounds, E = n.satAxes, d = this.points;
653
653
  for (let h = 0; h < 3; h++) {
654
- const u = l[h], p = E[h];
655
- if (t.setFromPoints(p, d), u.isSeparated(t))
654
+ const I = c[h], p = E[h];
655
+ if (t.setFromPoints(p, d), I.isSeparated(t))
656
656
  return !1;
657
657
  }
658
658
  for (let h = 0; h < 3; h++) {
659
- const u = a[h];
659
+ const I = a[h];
660
660
  for (let p = 0; p < 4; p++) {
661
661
  const A = E[p];
662
- if (i.crossVectors(u, A), t.setFromPoints(i, s), e.setFromPoints(i, d), t.isSeparated(e))
662
+ if (i.crossVectors(I, A), t.setFromPoints(i, s), e.setFromPoints(i, d), t.isSeparated(e))
663
663
  return !1;
664
664
  }
665
665
  }
@@ -672,32 +672,32 @@ at.prototype.closestPointToPoint = /* @__PURE__ */ function() {
672
672
  };
673
673
  }();
674
674
  at.prototype.distanceToPoint = function() {
675
- const c = new w();
675
+ const l = new w();
676
676
  return function(t) {
677
- return this.closestPointToPoint(t, c), t.distanceTo(c);
677
+ return this.closestPointToPoint(t, l), t.distanceTo(l);
678
678
  };
679
679
  }();
680
680
  at.prototype.distanceToBox = function() {
681
- const c = ["x", "y", "z"], s = new Array(12).fill().map(() => new Lt()), t = new Array(12).fill().map(() => new Lt()), e = new w(), i = new w();
682
- return function(n, r = 0, a = null, l = null) {
681
+ const l = ["x", "y", "z"], s = new Array(12).fill().map(() => new Lt()), t = new Array(12).fill().map(() => new Lt()), e = new w(), i = new w();
682
+ return function(n, r = 0, a = null, c = null) {
683
683
  if (this.needsUpdate && this.update(), this.intersectsBox(n))
684
- return (a || l) && (n.getCenter(i), this.closestPointToPoint(i, e), n.closestPointToPoint(e, i), a && a.copy(e), l && l.copy(i)), 0;
685
- const E = r * r, d = n.min, h = n.max, u = this.points;
684
+ return (a || c) && (n.getCenter(i), this.closestPointToPoint(i, e), n.closestPointToPoint(e, i), a && a.copy(e), c && c.copy(i)), 0;
685
+ const E = r * r, d = n.min, h = n.max, I = this.points;
686
686
  let p = 1 / 0;
687
687
  for (let R = 0; R < 8; R++) {
688
- const C = u[R];
688
+ const C = I[R];
689
689
  i.copy(C).clamp(d, h);
690
690
  const T = C.distanceToSquared(i);
691
- if (T < p && (p = T, a && a.copy(C), l && l.copy(i), T < E))
691
+ if (T < p && (p = T, a && a.copy(C), c && c.copy(i), T < E))
692
692
  return Math.sqrt(T);
693
693
  }
694
694
  let A = 0;
695
695
  for (let R = 0; R < 3; R++)
696
696
  for (let C = 0; C <= 1; C++)
697
697
  for (let T = 0; T <= 1; T++) {
698
- const F = (R + 1) % 3, f = (R + 2) % 3, m = C << F | T << f, O = 1 << R | C << F | T << f, S = u[m], _ = u[O];
698
+ const F = (R + 1) % 3, f = (R + 2) % 3, m = C << F | T << f, O = 1 << R | C << F | T << f, S = I[m], _ = I[O];
699
699
  s[A].set(S, _);
700
- const L = c[R], M = c[F], y = c[f], x = t[A], b = x.start, B = x.end;
700
+ const L = l[R], M = l[F], y = l[f], x = t[A], b = x.start, B = x.end;
701
701
  b[L] = d[L], b[M] = C ? d[M] : h[M], b[y] = T ? d[y] : h[M], B[L] = h[L], B[M] = C ? d[M] : h[M], B[y] = T ? d[y] : h[M], A++;
702
702
  }
703
703
  for (let R = 0; R <= 1; R++)
@@ -705,7 +705,7 @@ at.prototype.distanceToBox = function() {
705
705
  for (let T = 0; T <= 1; T++) {
706
706
  i.x = R ? h.x : d.x, i.y = C ? h.y : d.y, i.z = T ? h.z : d.z, this.closestPointToPoint(i, e);
707
707
  const F = i.distanceToSquared(e);
708
- if (F < p && (p = F, a && a.copy(e), l && l.copy(i), F < E))
708
+ if (F < p && (p = F, a && a.copy(e), c && c.copy(i), F < E))
709
709
  return Math.sqrt(F);
710
710
  }
711
711
  for (let R = 0; R < 12; R++) {
@@ -714,7 +714,7 @@ at.prototype.distanceToBox = function() {
714
714
  const F = t[T];
715
715
  Fi(C, F, e, i);
716
716
  const f = e.distanceToSquared(i);
717
- if (f < p && (p = f, a && a.copy(e), l && l.copy(i), f < E))
717
+ if (f < p && (p = f, a && a.copy(e), c && c.copy(i), f < E))
718
718
  return Math.sqrt(f);
719
719
  }
720
720
  }
@@ -738,24 +738,24 @@ class Fo extends Oi {
738
738
  super(() => new Ft());
739
739
  }
740
740
  }
741
- const It = /* @__PURE__ */ new Fo();
742
- function ht(c, s) {
743
- return s[c + 15] === 65535;
741
+ const ut = /* @__PURE__ */ new Fo();
742
+ function ht(l, s) {
743
+ return s[l + 15] === 65535;
744
744
  }
745
- function Et(c, s) {
746
- return s[c + 6];
745
+ function Et(l, s) {
746
+ return s[l + 6];
747
747
  }
748
- function ft(c, s) {
749
- return s[c + 14];
748
+ function ft(l, s) {
749
+ return s[l + 14];
750
750
  }
751
- function pt(c) {
752
- return c + 8;
751
+ function pt(l) {
752
+ return l + 8;
753
753
  }
754
- function Ct(c, s) {
755
- return s[c + 6];
754
+ function Ct(l, s) {
755
+ return s[l + 6];
756
756
  }
757
- function Dn(c, s) {
758
- return s[c + 7];
757
+ function Dn(l, s) {
758
+ return s[l + 7];
759
759
  }
760
760
  class Oo {
761
761
  constructor() {
@@ -772,19 +772,19 @@ class Oo {
772
772
  const Z = new Oo();
773
773
  let Yt, fe;
774
774
  const te = [], $e = /* @__PURE__ */ new Oi(() => new Ot());
775
- function go(c, s, t, e, i, o) {
776
- Yt = $e.getPrimitive(), fe = $e.getPrimitive(), te.push(Yt, fe), Z.setBuffer(c._roots[s]);
777
- const n = ri(0, c.geometry, t, e, i, o);
775
+ function go(l, s, t, e, i, o) {
776
+ Yt = $e.getPrimitive(), fe = $e.getPrimitive(), te.push(Yt, fe), Z.setBuffer(l._roots[s]);
777
+ const n = ri(0, l.geometry, t, e, i, o);
778
778
  Z.clearBuffer(), $e.releasePrimitive(Yt), $e.releasePrimitive(fe), te.pop(), te.pop();
779
779
  const r = te.length;
780
780
  return r > 0 && (fe = te[r - 1], Yt = te[r - 2]), n;
781
781
  }
782
- function ri(c, s, t, e, i = null, o = 0, n = 0) {
783
- const { float32Array: r, uint16Array: a, uint32Array: l } = Z;
784
- let E = c * 2;
782
+ function ri(l, s, t, e, i = null, o = 0, n = 0) {
783
+ const { float32Array: r, uint16Array: a, uint32Array: c } = Z;
784
+ let E = l * 2;
785
785
  if (ht(E, a)) {
786
- const h = Et(c, l), u = ft(E, a);
787
- return $(c, r, Yt), e(h, u, !1, n, o + c, Yt);
786
+ const h = Et(l, c), I = ft(E, a);
787
+ return $(l, r, Yt), e(h, I, !1, n, o + l, Yt);
788
788
  } else {
789
789
  let L = function(y) {
790
790
  const { uint16Array: x, uint32Array: b } = Z;
@@ -799,10 +799,10 @@ function ri(c, s, t, e, i = null, o = 0, n = 0) {
799
799
  y = Ct(y, b), B = y * 2;
800
800
  return Et(y, b) + ft(B, x);
801
801
  };
802
- const h = pt(c), u = Ct(c, l);
803
- let p = h, A = u, R, C, T, F;
802
+ const h = pt(l), I = Ct(l, c);
803
+ let p = h, A = I, R, C, T, F;
804
804
  if (i && (T = Yt, F = fe, $(p, r, T), $(A, r, F), R = i(T), C = i(F), C < R)) {
805
- p = u, A = h;
805
+ p = I, A = h;
806
806
  const y = R;
807
807
  R = C, C = y, T = F;
808
808
  }
@@ -844,10 +844,10 @@ function ri(c, s, t, e, i = null, o = 0, n = 0) {
844
844
  }
845
845
  }
846
846
  const Fe = /* @__PURE__ */ new w(), zs = /* @__PURE__ */ new w();
847
- function So(c, s, t = {}, e = 0, i = 1 / 0) {
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
- if (c.shapecast(
850
+ if (l.shapecast(
851
851
  {
852
852
  boundsTraverseOrder: (E) => (Fe.copy(s).clamp(E.min, E.max), Fe.distanceToSquared(s)),
853
853
  intersectsBounds: (E, d, h) => h < r && h < n,
@@ -859,22 +859,22 @@ function So(c, s, t = {}, e = 0, i = 1 / 0) {
859
859
  }
860
860
  ), r === 1 / 0)
861
861
  return null;
862
- const l = Math.sqrt(r);
863
- return t.point ? t.point.copy(zs) : t.point = zs.clone(), t.distance = l, t.faceIndex = a, t;
862
+ const c = Math.sqrt(r);
863
+ return t.point ? t.point.copy(zs) : t.point = zs.clone(), t.distance = c, t.faceIndex = a, t;
864
864
  }
865
865
  const ee = /* @__PURE__ */ new w(), se = /* @__PURE__ */ new w(), ie = /* @__PURE__ */ new w(), Ke = /* @__PURE__ */ new pe(), Je = /* @__PURE__ */ new pe(), ts = /* @__PURE__ */ new pe(), Vi = /* @__PURE__ */ new w(), Gi = /* @__PURE__ */ new w(), zi = /* @__PURE__ */ new w(), es = /* @__PURE__ */ new w();
866
- function _o(c, s, t, e, i, o) {
866
+ function _o(l, s, t, e, i, o) {
867
867
  let n;
868
- return o === Xn ? n = c.intersectTriangle(e, t, s, !0, i) : n = c.intersectTriangle(s, t, e, o !== Pn, i), n === null ? null : {
869
- distance: c.origin.distanceTo(i),
868
+ return o === Xn ? n = l.intersectTriangle(e, t, s, !0, i) : n = l.intersectTriangle(s, t, e, o !== Pn, i), n === null ? null : {
869
+ distance: l.origin.distanceTo(i),
870
870
  point: i.clone()
871
871
  };
872
872
  }
873
- function No(c, s, t, e, i, o, n, r, a) {
873
+ function No(l, s, t, e, i, o, n, r, a) {
874
874
  ee.fromBufferAttribute(s, o), se.fromBufferAttribute(s, n), ie.fromBufferAttribute(s, r);
875
- const l = _o(c, ee, se, ie, es, a);
876
- if (l) {
877
- e && (Ke.fromBufferAttribute(e, o), Je.fromBufferAttribute(e, n), ts.fromBufferAttribute(e, r), l.uv = Ie.getInterpolation(es, ee, se, ie, Ke, Je, ts, new pe())), i && (Ke.fromBufferAttribute(i, o), Je.fromBufferAttribute(i, n), ts.fromBufferAttribute(i, r), l.uv1 = Ie.getInterpolation(es, ee, se, ie, Ke, Je, ts, new pe())), t && (Vi.fromBufferAttribute(t, o), Gi.fromBufferAttribute(t, n), zi.fromBufferAttribute(t, r), l.normal = Ie.getInterpolation(es, ee, se, ie, Vi, Gi, zi, new w()), l.normal.dot(c.direction) > 0 && l.normal.multiplyScalar(-1));
875
+ const c = _o(l, ee, se, ie, es, a);
876
+ if (c) {
877
+ e && (Ke.fromBufferAttribute(e, o), Je.fromBufferAttribute(e, n), ts.fromBufferAttribute(e, r), c.uv = ue.getInterpolation(es, ee, se, ie, Ke, Je, ts, new pe())), i && (Ke.fromBufferAttribute(i, o), Je.fromBufferAttribute(i, n), ts.fromBufferAttribute(i, r), c.uv1 = ue.getInterpolation(es, ee, se, ie, Ke, Je, ts, new pe())), t && (Vi.fromBufferAttribute(t, o), Gi.fromBufferAttribute(t, n), zi.fromBufferAttribute(t, r), c.normal = ue.getInterpolation(es, ee, se, ie, Vi, Gi, zi, new w()), c.normal.dot(l.direction) > 0 && c.normal.multiplyScalar(-1));
878
878
  const E = {
879
879
  a: o,
880
880
  b: n,
@@ -882,54 +882,54 @@ function No(c, s, t, e, i, o, n, r, a) {
882
882
  normal: new w(),
883
883
  materialIndex: 0
884
884
  };
885
- Ie.getNormal(ee, se, ie, E.normal), l.face = E, l.faceIndex = o;
885
+ ue.getNormal(ee, se, ie, E.normal), c.face = E, c.faceIndex = o;
886
886
  }
887
- return l;
887
+ return c;
888
888
  }
889
- function Us(c, s, t, e, i) {
889
+ function Us(l, s, t, e, i) {
890
890
  const o = e * 3;
891
891
  let n = o + 0, r = o + 1, a = o + 2;
892
- const l = c.index;
893
- c.index && (n = l.getX(n), r = l.getX(r), a = l.getX(a));
894
- const { position: E, normal: d, uv: h, uv1: u } = c.attributes, p = No(t, E, d, h, u, n, r, a, s);
892
+ const c = l.index;
893
+ l.index && (n = c.getX(n), r = c.getX(r), a = c.getX(a));
894
+ const { position: E, normal: d, uv: h, uv1: I } = l.attributes, p = No(t, E, d, h, I, n, r, a, s);
895
895
  return p ? (p.faceIndex = e, i && i.push(p), p) : null;
896
896
  }
897
- function et(c, s, t, e) {
898
- const i = c.a, o = c.b, n = c.c;
899
- let r = s, a = s + 1, l = s + 2;
900
- t && (r = t.getX(r), a = t.getX(a), l = t.getX(l)), 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(l), n.y = e.getY(l), n.z = e.getZ(l);
897
+ function et(l, s, t, e) {
898
+ const i = l.a, o = l.b, n = l.c;
899
+ let r = s, a = s + 1, c = s + 2;
900
+ t && (r = t.getX(r), a = t.getX(a), c = t.getX(c)), i.x = e.getX(r), i.y = e.getY(r), i.z = e.getZ(r), o.x = e.getX(a), o.y = e.getY(a), o.z = e.getZ(a), n.x = e.getX(c), n.y = e.getY(c), n.z = e.getZ(c);
901
901
  }
902
- function Po(c, s, t, e, i, o) {
903
- const { geometry: n, _indirectBuffer: r } = c;
904
- for (let a = e, l = e + i; a < l; a++)
902
+ function Po(l, s, t, e, i, o) {
903
+ const { geometry: n, _indirectBuffer: r } = l;
904
+ for (let a = e, c = e + i; a < c; a++)
905
905
  Us(n, s, t, a, o);
906
906
  }
907
- function Lo(c, s, t, e, i) {
908
- const { geometry: o, _indirectBuffer: n } = c;
907
+ function Lo(l, s, t, e, i) {
908
+ const { geometry: o, _indirectBuffer: n } = l;
909
909
  let r = 1 / 0, a = null;
910
- for (let l = e, E = e + i; l < E; l++) {
910
+ for (let c = e, E = e + i; c < E; c++) {
911
911
  let d;
912
- d = Us(o, s, t, l), d && d.distance < r && (a = d, r = d.distance);
912
+ d = Us(o, s, t, c), d && d.distance < r && (a = d, r = d.distance);
913
913
  }
914
914
  return a;
915
915
  }
916
- function yo(c, s, t, e, i, o, n) {
917
- const { geometry: r } = t, { index: a } = r, l = r.attributes.position;
918
- for (let E = c, d = s + c; E < d; E++) {
916
+ function yo(l, s, t, e, i, o, n) {
917
+ const { geometry: r } = t, { index: a } = r, c = r.attributes.position;
918
+ for (let E = l, d = s + l; E < d; E++) {
919
919
  let h;
920
- if (h = E, et(n, h * 3, a, l), n.needsUpdate = !0, e(n, h, i, o))
920
+ if (h = E, et(n, h * 3, a, c), n.needsUpdate = !0, e(n, h, i, o))
921
921
  return !0;
922
922
  }
923
923
  return !1;
924
924
  }
925
- function wo(c, s = null) {
925
+ function wo(l, s = null) {
926
926
  s && Array.isArray(s) && (s = new Set(s));
927
- const t = c.geometry, e = t.index ? t.index.array : null, i = t.attributes.position;
928
- let o, n, r, a, l = 0;
929
- const E = c._roots;
930
- for (let h = 0, u = E.length; h < u; h++)
931
- o = E[h], n = new Uint32Array(o), r = new Uint16Array(o), a = new Float32Array(o), d(0, l), l += o.byteLength;
932
- function d(h, u, p = !1) {
927
+ const t = l.geometry, e = t.index ? t.index.array : null, i = t.attributes.position;
928
+ let o, n, r, a, c = 0;
929
+ const E = l._roots;
930
+ for (let h = 0, I = E.length; h < I; h++)
931
+ o = E[h], n = new Uint32Array(o), r = new Uint16Array(o), a = new Float32Array(o), d(0, c), c += o.byteLength;
932
+ function d(h, I, p = !1) {
933
933
  const A = h * 2;
934
934
  if (r[A + 15] === Ds) {
935
935
  const C = n[h + 6], T = r[A + 14];
@@ -941,14 +941,14 @@ function wo(c, s = null) {
941
941
  }
942
942
  return a[h + 0] !== F || a[h + 1] !== f || a[h + 2] !== m || a[h + 3] !== O || a[h + 4] !== S || a[h + 5] !== _ ? (a[h + 0] = F, a[h + 1] = f, a[h + 2] = m, a[h + 3] = O, a[h + 4] = S, a[h + 5] = _, !0) : !1;
943
943
  } else {
944
- const C = h + 8, T = n[h + 6], F = C + u, f = T + u;
944
+ const C = h + 8, T = n[h + 6], F = C + I, f = T + I;
945
945
  let m = p, O = !1, S = !1;
946
946
  s ? m || (O = s.has(F), S = s.has(f), m = !O && !S) : (O = !0, S = !0);
947
947
  const _ = m || O, N = m || S;
948
948
  let L = !1;
949
- _ && (L = d(C, u, m));
949
+ _ && (L = d(C, I, m));
950
950
  let M = !1;
951
- N && (M = d(T, u, m));
951
+ N && (M = d(T, I, m));
952
952
  const y = L || M;
953
953
  if (y)
954
954
  for (let x = 0; x < 3; x++) {
@@ -960,72 +960,72 @@ function wo(c, s = null) {
960
960
  }
961
961
  }
962
962
  const Hi = /* @__PURE__ */ new Ot();
963
- function zt(c, s, t, e) {
964
- return $(c, s, Hi), t.intersectBox(Hi, e);
963
+ function zt(l, s, t, e) {
964
+ return $(l, s, Hi), t.intersectBox(Hi, e);
965
965
  }
966
- function Mo(c, s, t, e, i, o) {
967
- const { geometry: n, _indirectBuffer: r } = c;
968
- for (let a = e, l = e + i; a < l; a++) {
966
+ function Mo(l, s, t, e, i, o) {
967
+ const { geometry: n, _indirectBuffer: r } = l;
968
+ for (let a = e, c = e + i; a < c; a++) {
969
969
  let E = r ? r[a] : a;
970
970
  Us(n, s, t, E, o);
971
971
  }
972
972
  }
973
- function Do(c, s, t, e, i) {
974
- const { geometry: o, _indirectBuffer: n } = c;
973
+ function Do(l, s, t, e, i) {
974
+ const { geometry: o, _indirectBuffer: n } = l;
975
975
  let r = 1 / 0, a = null;
976
- for (let l = e, E = e + i; l < E; l++) {
976
+ for (let c = e, E = e + i; c < E; c++) {
977
977
  let d;
978
- d = Us(o, s, t, n ? n[l] : l), d && d.distance < r && (a = d, r = d.distance);
978
+ d = Us(o, s, t, n ? n[c] : c), d && d.distance < r && (a = d, r = d.distance);
979
979
  }
980
980
  return a;
981
981
  }
982
- function Uo(c, s, t, e, i, o, n) {
983
- const { geometry: r } = t, { index: a } = r, l = r.attributes.position;
984
- for (let E = c, d = s + c; E < d; E++) {
982
+ function Uo(l, s, t, e, i, o, n) {
983
+ const { geometry: r } = t, { index: a } = r, c = r.attributes.position;
984
+ for (let E = l, d = s + l; E < d; E++) {
985
985
  let h;
986
- if (h = t.resolveTriangleIndex(E), et(n, h * 3, a, l), n.needsUpdate = !0, e(n, h, i, o))
986
+ if (h = t.resolveTriangleIndex(E), et(n, h * 3, a, c), n.needsUpdate = !0, e(n, h, i, o))
987
987
  return !0;
988
988
  }
989
989
  return !1;
990
990
  }
991
991
  const ki = /* @__PURE__ */ new w();
992
- function xo(c, s, t, e, i) {
993
- Z.setBuffer(c._roots[s]), ai(0, c, t, e, i), Z.clearBuffer();
992
+ function xo(l, s, t, e, i) {
993
+ Z.setBuffer(l._roots[s]), ai(0, l, t, e, i), Z.clearBuffer();
994
994
  }
995
- function ai(c, s, t, e, i) {
996
- const { float32Array: o, uint16Array: n, uint32Array: r } = Z, a = c * 2;
995
+ function ai(l, s, t, e, i) {
996
+ const { float32Array: o, uint16Array: n, uint32Array: r } = Z, a = l * 2;
997
997
  if (ht(a, n)) {
998
- const E = Et(c, r), d = ft(a, n);
998
+ const E = Et(l, r), d = ft(a, n);
999
999
  Po(s, t, e, E, d, i);
1000
1000
  } else {
1001
- const E = pt(c);
1001
+ const E = pt(l);
1002
1002
  zt(E, o, e, ki) && ai(E, s, t, e, i);
1003
- const d = Ct(c, r);
1003
+ const d = Ct(l, r);
1004
1004
  zt(d, o, e, ki) && ai(d, s, t, e, i);
1005
1005
  }
1006
1006
  }
1007
1007
  const Wi = /* @__PURE__ */ new w(), bo = ["x", "y", "z"];
1008
- function vo(c, s, t, e) {
1009
- Z.setBuffer(c._roots[s]);
1010
- const i = ci(0, c, t, e);
1008
+ function vo(l, s, t, e) {
1009
+ Z.setBuffer(l._roots[s]);
1010
+ const i = ci(0, l, t, e);
1011
1011
  return Z.clearBuffer(), i;
1012
1012
  }
1013
- function ci(c, s, t, e) {
1013
+ function ci(l, s, t, e) {
1014
1014
  const { float32Array: i, uint16Array: o, uint32Array: n } = Z;
1015
- let r = c * 2;
1015
+ let r = l * 2;
1016
1016
  if (ht(r, o)) {
1017
- const l = Et(c, n), E = ft(r, o);
1018
- return Lo(s, t, e, l, E);
1017
+ const c = Et(l, n), E = ft(r, o);
1018
+ return Lo(s, t, e, c, E);
1019
1019
  } else {
1020
- const l = Dn(c, n), E = bo[l], h = e.direction[E] >= 0;
1021
- let u, p;
1022
- h ? (u = pt(c), p = Ct(c, n)) : (u = Ct(c, n), p = pt(c));
1023
- const R = zt(u, i, e, Wi) ? ci(u, s, t, e) : null;
1020
+ const c = Dn(l, n), E = bo[c], h = e.direction[E] >= 0;
1021
+ let I, p;
1022
+ h ? (I = pt(l), p = Ct(l, n)) : (I = Ct(l, n), p = pt(l));
1023
+ const R = zt(I, i, e, Wi) ? ci(I, s, t, e) : null;
1024
1024
  if (R) {
1025
1025
  const F = R.point[E];
1026
- if (h ? F <= i[p + l] : (
1026
+ if (h ? F <= i[p + c] : (
1027
1027
  // min bounding data
1028
- F >= i[p + l + 3]
1028
+ F >= i[p + c + 3]
1029
1029
  ))
1030
1030
  return R;
1031
1031
  }
@@ -1034,18 +1034,18 @@ function ci(c, s, t, e) {
1034
1034
  }
1035
1035
  }
1036
1036
  const ss = /* @__PURE__ */ new Ot(), ne = /* @__PURE__ */ new Ft(), oe = /* @__PURE__ */ new Ft(), Oe = /* @__PURE__ */ new yt(), Xi = /* @__PURE__ */ new at(), is = /* @__PURE__ */ new at();
1037
- function Bo(c, s, t, e) {
1038
- Z.setBuffer(c._roots[s]);
1039
- const i = li(0, c, t, e);
1037
+ function Bo(l, s, t, e) {
1038
+ Z.setBuffer(l._roots[s]);
1039
+ const i = li(0, l, t, e);
1040
1040
  return Z.clearBuffer(), i;
1041
1041
  }
1042
- function li(c, s, t, e, i = null) {
1042
+ function li(l, s, t, e, i = null) {
1043
1043
  const { float32Array: o, uint16Array: n, uint32Array: r } = Z;
1044
- let a = c * 2;
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), ht(a, n)) {
1046
- const E = s.geometry, d = E.index, h = E.attributes.position, u = t.index, p = t.attributes.position, A = Et(c, r), R = ft(a, n);
1046
+ const E = s.geometry, d = E.index, h = E.attributes.position, I = t.index, p = t.attributes.position, A = Et(l, r), R = ft(a, n);
1047
1047
  if (Oe.copy(e).invert(), t.boundsTree)
1048
- return $(c, o, is), is.matrix.copy(Oe), is.needsUpdate = !0, t.boundsTree.shapecast({
1048
+ return $(l, o, is), is.matrix.copy(Oe), is.needsUpdate = !0, t.boundsTree.shapecast({
1049
1049
  intersectsBounds: (T) => is.intersectsBox(T),
1050
1050
  intersectsTriangle: (T) => {
1051
1051
  T.a.applyMatrix4(e), T.b.applyMatrix4(e), T.c.applyMatrix4(e), T.needsUpdate = !0;
@@ -1057,23 +1057,23 @@ function li(c, s, t, e, i = null) {
1057
1057
  });
1058
1058
  for (let C = A * 3, T = (R + A) * 3; C < T; C += 3) {
1059
1059
  et(ne, C, d, h), ne.a.applyMatrix4(Oe), ne.b.applyMatrix4(Oe), ne.c.applyMatrix4(Oe), ne.needsUpdate = !0;
1060
- for (let F = 0, f = u.count; F < f; F += 3)
1061
- if (et(oe, F, u, p), oe.needsUpdate = !0, ne.intersectsTriangle(oe))
1060
+ for (let F = 0, f = I.count; F < f; F += 3)
1061
+ if (et(oe, F, I, p), oe.needsUpdate = !0, ne.intersectsTriangle(oe))
1062
1062
  return !0;
1063
1063
  }
1064
1064
  } else {
1065
- const E = c + 8, d = r[c + 6];
1065
+ const E = l + 8, d = r[l + 6];
1066
1066
  return $(E, o, ss), !!(i.intersectsBox(ss) && li(E, s, t, e, i) || ($(d, o, ss), i.intersectsBox(ss) && li(d, s, t, e, i)));
1067
1067
  }
1068
1068
  }
1069
1069
  const ns = /* @__PURE__ */ new yt(), Hs = /* @__PURE__ */ new at(), ge = /* @__PURE__ */ new at(), Yo = /* @__PURE__ */ new w(), Vo = /* @__PURE__ */ new w(), Go = /* @__PURE__ */ new w(), zo = /* @__PURE__ */ new w();
1070
- function Ho(c, s, t, e = {}, i = {}, o = 0, n = 1 / 0) {
1070
+ function Ho(l, s, t, e = {}, i = {}, o = 0, n = 1 / 0) {
1071
1071
  s.boundingBox || s.computeBoundingBox(), Hs.set(s.boundingBox.min, s.boundingBox.max, t), Hs.needsUpdate = !0;
1072
- const r = c.geometry, a = r.attributes.position, l = r.index, E = s.attributes.position, d = s.index, h = It.getPrimitive(), u = It.getPrimitive();
1072
+ const r = l.geometry, a = r.attributes.position, c = r.index, E = s.attributes.position, d = s.index, h = ut.getPrimitive(), I = ut.getPrimitive();
1073
1073
  let p = Yo, A = Vo, R = null, C = null;
1074
1074
  i && (R = Go, C = zo);
1075
1075
  let T = 1 / 0, F = null, f = null;
1076
- return ns.copy(t).invert(), ge.matrix.copy(ns), c.shapecast(
1076
+ return ns.copy(t).invert(), ge.matrix.copy(ns), l.shapecast(
1077
1077
  {
1078
1078
  boundsTraverseOrder: (m) => Hs.distanceToBox(m),
1079
1079
  intersectsBounds: (m, O, S) => S < T && S < n ? (O && (ge.min.copy(m.min), ge.max.copy(m.max), ge.needsUpdate = !0), !0) : !1,
@@ -1084,10 +1084,10 @@ function Ho(c, s, t, e = {}, i = {}, o = 0, n = 1 / 0) {
1084
1084
  intersectsBounds: (_, N, L) => L < T && L < n,
1085
1085
  intersectsRange: (_, N) => {
1086
1086
  for (let L = _, M = _ + N; L < M; L++) {
1087
- et(u, 3 * L, d, E), u.a.applyMatrix4(t), u.b.applyMatrix4(t), u.c.applyMatrix4(t), u.needsUpdate = !0;
1087
+ et(I, 3 * L, d, E), I.a.applyMatrix4(t), I.b.applyMatrix4(t), I.c.applyMatrix4(t), I.needsUpdate = !0;
1088
1088
  for (let y = m, x = m + O; y < x; y++) {
1089
- et(h, 3 * y, l, a), h.needsUpdate = !0;
1090
- const b = h.distanceToTriangle(u, p, R);
1089
+ et(h, 3 * y, c, a), h.needsUpdate = !0;
1090
+ const b = h.distanceToTriangle(I, p, R);
1091
1091
  if (b < T && (A.copy(p), C && C.copy(R), T = b, F = y, f = L), b < o)
1092
1092
  return !0;
1093
1093
  }
@@ -1097,10 +1097,10 @@ function Ho(c, s, t, e = {}, i = {}, o = 0, n = 1 / 0) {
1097
1097
  {
1098
1098
  const S = Ce(s);
1099
1099
  for (let _ = 0, N = S; _ < N; _++) {
1100
- et(u, 3 * _, d, E), u.a.applyMatrix4(t), u.b.applyMatrix4(t), u.c.applyMatrix4(t), u.needsUpdate = !0;
1100
+ et(I, 3 * _, d, E), I.a.applyMatrix4(t), I.b.applyMatrix4(t), I.c.applyMatrix4(t), I.needsUpdate = !0;
1101
1101
  for (let L = m, M = m + O; L < M; L++) {
1102
- et(h, 3 * L, l, a), h.needsUpdate = !0;
1103
- const y = h.distanceToTriangle(u, p, R);
1102
+ et(h, 3 * L, c, a), h.needsUpdate = !0;
1103
+ const y = h.distanceToTriangle(I, p, R);
1104
1104
  if (y < T && (A.copy(p), C && C.copy(R), T = y, F = L, f = _), y < o)
1105
1105
  return !0;
1106
1106
  }
@@ -1108,22 +1108,22 @@ function Ho(c, s, t, e = {}, i = {}, o = 0, n = 1 / 0) {
1108
1108
  }
1109
1109
  }
1110
1110
  }
1111
- ), It.releasePrimitive(h), It.releasePrimitive(u), T === 1 / 0 ? null : (e.point ? e.point.copy(A) : e.point = A.clone(), e.distance = T, e.faceIndex = F, i && (i.point ? i.point.copy(C) : i.point = C.clone(), i.point.applyMatrix4(ns), A.applyMatrix4(ns), i.distance = A.sub(i.point).length(), i.faceIndex = f), e);
1111
+ ), ut.releasePrimitive(h), ut.releasePrimitive(I), T === 1 / 0 ? null : (e.point ? e.point.copy(A) : e.point = A.clone(), e.distance = T, e.faceIndex = F, i && (i.point ? i.point.copy(C) : i.point = C.clone(), i.point.applyMatrix4(ns), A.applyMatrix4(ns), i.distance = A.sub(i.point).length(), i.faceIndex = f), e);
1112
1112
  }
1113
- function ko(c, s = null) {
1113
+ function ko(l, s = null) {
1114
1114
  s && Array.isArray(s) && (s = new Set(s));
1115
- const t = c.geometry, e = t.index ? t.index.array : null, i = t.attributes.position;
1116
- let o, n, r, a, l = 0;
1117
- const E = c._roots;
1118
- for (let h = 0, u = E.length; h < u; h++)
1119
- o = E[h], n = new Uint32Array(o), r = new Uint16Array(o), a = new Float32Array(o), d(0, l), l += o.byteLength;
1120
- function d(h, u, p = !1) {
1115
+ const t = l.geometry, e = t.index ? t.index.array : null, i = t.attributes.position;
1116
+ let o, n, r, a, c = 0;
1117
+ const E = l._roots;
1118
+ for (let h = 0, I = E.length; h < I; h++)
1119
+ o = E[h], n = new Uint32Array(o), r = new Uint16Array(o), a = new Float32Array(o), d(0, c), c += o.byteLength;
1120
+ function d(h, I, p = !1) {
1121
1121
  const A = h * 2;
1122
1122
  if (r[A + 15] === Ds) {
1123
1123
  const C = n[h + 6], T = r[A + 14];
1124
1124
  let F = 1 / 0, f = 1 / 0, m = 1 / 0, O = -1 / 0, S = -1 / 0, _ = -1 / 0;
1125
1125
  for (let N = C, L = C + T; N < L; N++) {
1126
- const M = 3 * c.resolveTriangleIndex(N);
1126
+ const M = 3 * l.resolveTriangleIndex(N);
1127
1127
  for (let y = 0; y < 3; y++) {
1128
1128
  let x = M + y;
1129
1129
  x = e ? e[x] : x;
@@ -1133,14 +1133,14 @@ function ko(c, s = null) {
1133
1133
  }
1134
1134
  return a[h + 0] !== F || a[h + 1] !== f || a[h + 2] !== m || a[h + 3] !== O || a[h + 4] !== S || a[h + 5] !== _ ? (a[h + 0] = F, a[h + 1] = f, a[h + 2] = m, a[h + 3] = O, a[h + 4] = S, a[h + 5] = _, !0) : !1;
1135
1135
  } else {
1136
- const C = h + 8, T = n[h + 6], F = C + u, f = T + u;
1136
+ const C = h + 8, T = n[h + 6], F = C + I, f = T + I;
1137
1137
  let m = p, O = !1, S = !1;
1138
1138
  s ? m || (O = s.has(F), S = s.has(f), m = !O && !S) : (O = !0, S = !0);
1139
1139
  const _ = m || O, N = m || S;
1140
1140
  let L = !1;
1141
- _ && (L = d(C, u, m));
1141
+ _ && (L = d(C, I, m));
1142
1142
  let M = !1;
1143
- N && (M = d(T, u, m));
1143
+ N && (M = d(T, I, m));
1144
1144
  const y = L || M;
1145
1145
  if (y)
1146
1146
  for (let x = 0; x < 3; x++) {
@@ -1152,43 +1152,43 @@ function ko(c, s = null) {
1152
1152
  }
1153
1153
  }
1154
1154
  const Zi = /* @__PURE__ */ new w();
1155
- function Wo(c, s, t, e, i) {
1156
- Z.setBuffer(c._roots[s]), hi(0, c, t, e, i), Z.clearBuffer();
1155
+ function Wo(l, s, t, e, i) {
1156
+ Z.setBuffer(l._roots[s]), hi(0, l, t, e, i), Z.clearBuffer();
1157
1157
  }
1158
- function hi(c, s, t, e, i) {
1159
- const { float32Array: o, uint16Array: n, uint32Array: r } = Z, a = c * 2;
1158
+ function hi(l, s, t, e, i) {
1159
+ const { float32Array: o, uint16Array: n, uint32Array: r } = Z, a = l * 2;
1160
1160
  if (ht(a, n)) {
1161
- const E = Et(c, r), d = ft(a, n);
1161
+ const E = Et(l, r), d = ft(a, n);
1162
1162
  Mo(s, t, e, E, d, i);
1163
1163
  } else {
1164
- const E = pt(c);
1164
+ const E = pt(l);
1165
1165
  zt(E, o, e, Zi) && hi(E, s, t, e, i);
1166
- const d = Ct(c, r);
1166
+ const d = Ct(l, r);
1167
1167
  zt(d, o, e, Zi) && hi(d, s, t, e, i);
1168
1168
  }
1169
1169
  }
1170
1170
  const Qi = /* @__PURE__ */ new w(), Xo = ["x", "y", "z"];
1171
- function Zo(c, s, t, e) {
1172
- Z.setBuffer(c._roots[s]);
1173
- const i = Ei(0, c, t, e);
1171
+ function Zo(l, s, t, e) {
1172
+ Z.setBuffer(l._roots[s]);
1173
+ const i = Ei(0, l, t, e);
1174
1174
  return Z.clearBuffer(), i;
1175
1175
  }
1176
- function Ei(c, s, t, e) {
1176
+ function Ei(l, s, t, e) {
1177
1177
  const { float32Array: i, uint16Array: o, uint32Array: n } = Z;
1178
- let r = c * 2;
1178
+ let r = l * 2;
1179
1179
  if (ht(r, o)) {
1180
- const l = Et(c, n), E = ft(r, o);
1181
- return Do(s, t, e, l, E);
1180
+ const c = Et(l, n), E = ft(r, o);
1181
+ return Do(s, t, e, c, E);
1182
1182
  } else {
1183
- const l = Dn(c, n), E = Xo[l], h = e.direction[E] >= 0;
1184
- let u, p;
1185
- h ? (u = pt(c), p = Ct(c, n)) : (u = Ct(c, n), p = pt(c));
1186
- const R = zt(u, i, e, Qi) ? Ei(u, s, t, e) : null;
1183
+ const c = Dn(l, n), E = Xo[c], h = e.direction[E] >= 0;
1184
+ let I, p;
1185
+ h ? (I = pt(l), p = Ct(l, n)) : (I = Ct(l, n), p = pt(l));
1186
+ const R = zt(I, i, e, Qi) ? Ei(I, s, t, e) : null;
1187
1187
  if (R) {
1188
1188
  const F = R.point[E];
1189
- if (h ? F <= i[p + l] : (
1189
+ if (h ? F <= i[p + c] : (
1190
1190
  // min bounding data
1191
- F >= i[p + l + 3]
1191
+ F >= i[p + c + 3]
1192
1192
  ))
1193
1193
  return R;
1194
1194
  }
@@ -1197,18 +1197,18 @@ function Ei(c, s, t, e) {
1197
1197
  }
1198
1198
  }
1199
1199
  const os = /* @__PURE__ */ new Ot(), re = /* @__PURE__ */ new Ft(), ae = /* @__PURE__ */ new Ft(), Se = /* @__PURE__ */ new yt(), ji = /* @__PURE__ */ new at(), rs = /* @__PURE__ */ new at();
1200
- function Qo(c, s, t, e) {
1201
- Z.setBuffer(c._roots[s]);
1202
- const i = di(0, c, t, e);
1200
+ function Qo(l, s, t, e) {
1201
+ Z.setBuffer(l._roots[s]);
1202
+ const i = di(0, l, t, e);
1203
1203
  return Z.clearBuffer(), i;
1204
1204
  }
1205
- function di(c, s, t, e, i = null) {
1205
+ function di(l, s, t, e, i = null) {
1206
1206
  const { float32Array: o, uint16Array: n, uint32Array: r } = Z;
1207
- let a = c * 2;
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), ht(a, n)) {
1209
- const E = s.geometry, d = E.index, h = E.attributes.position, u = t.index, p = t.attributes.position, A = Et(c, r), R = ft(a, n);
1209
+ const E = s.geometry, d = E.index, h = E.attributes.position, I = t.index, p = t.attributes.position, A = Et(l, r), R = ft(a, n);
1210
1210
  if (Se.copy(e).invert(), t.boundsTree)
1211
- return $(c, o, rs), rs.matrix.copy(Se), rs.needsUpdate = !0, t.boundsTree.shapecast({
1211
+ return $(l, o, rs), rs.matrix.copy(Se), rs.needsUpdate = !0, t.boundsTree.shapecast({
1212
1212
  intersectsBounds: (T) => rs.intersectsBox(T),
1213
1213
  intersectsTriangle: (T) => {
1214
1214
  T.a.applyMatrix4(e), T.b.applyMatrix4(e), T.c.applyMatrix4(e), T.needsUpdate = !0;
@@ -1221,23 +1221,23 @@ function di(c, s, t, e, i = null) {
1221
1221
  for (let C = A, T = R + A; C < T; C++) {
1222
1222
  const F = s.resolveTriangleIndex(C);
1223
1223
  et(re, 3 * F, d, h), re.a.applyMatrix4(Se), re.b.applyMatrix4(Se), re.c.applyMatrix4(Se), re.needsUpdate = !0;
1224
- for (let f = 0, m = u.count; f < m; f += 3)
1225
- if (et(ae, f, u, p), ae.needsUpdate = !0, re.intersectsTriangle(ae))
1224
+ for (let f = 0, m = I.count; f < m; f += 3)
1225
+ if (et(ae, f, I, p), ae.needsUpdate = !0, re.intersectsTriangle(ae))
1226
1226
  return !0;
1227
1227
  }
1228
1228
  } else {
1229
- const E = c + 8, d = r[c + 6];
1229
+ const E = l + 8, d = r[l + 6];
1230
1230
  return $(E, o, os), !!(i.intersectsBox(os) && di(E, s, t, e, i) || ($(d, o, os), i.intersectsBox(os) && di(d, s, t, e, i)));
1231
1231
  }
1232
1232
  }
1233
1233
  const as = /* @__PURE__ */ new yt(), ks = /* @__PURE__ */ new at(), _e = /* @__PURE__ */ new at(), jo = /* @__PURE__ */ new w(), qo = /* @__PURE__ */ new w(), $o = /* @__PURE__ */ new w(), Ko = /* @__PURE__ */ new w();
1234
- function Jo(c, s, t, e = {}, i = {}, o = 0, n = 1 / 0) {
1234
+ function Jo(l, s, t, e = {}, i = {}, o = 0, n = 1 / 0) {
1235
1235
  s.boundingBox || s.computeBoundingBox(), ks.set(s.boundingBox.min, s.boundingBox.max, t), ks.needsUpdate = !0;
1236
- const r = c.geometry, a = r.attributes.position, l = r.index, E = s.attributes.position, d = s.index, h = It.getPrimitive(), u = It.getPrimitive();
1236
+ const r = l.geometry, a = r.attributes.position, c = r.index, E = s.attributes.position, d = s.index, h = ut.getPrimitive(), I = ut.getPrimitive();
1237
1237
  let p = jo, A = qo, R = null, C = null;
1238
1238
  i && (R = $o, C = Ko);
1239
1239
  let T = 1 / 0, F = null, f = null;
1240
- return as.copy(t).invert(), _e.matrix.copy(as), c.shapecast(
1240
+ return as.copy(t).invert(), _e.matrix.copy(as), l.shapecast(
1241
1241
  {
1242
1242
  boundsTraverseOrder: (m) => ks.distanceToBox(m),
1243
1243
  intersectsBounds: (m, O, S) => S < T && S < n ? (O && (_e.min.copy(m.min), _e.max.copy(m.max), _e.needsUpdate = !0), !0) : !1,
@@ -1250,11 +1250,11 @@ function Jo(c, s, t, e = {}, i = {}, o = 0, n = 1 / 0) {
1250
1250
  intersectsRange: (_, N) => {
1251
1251
  for (let L = _, M = _ + N; L < M; L++) {
1252
1252
  const y = S.resolveTriangleIndex(L);
1253
- et(u, 3 * y, d, E), u.a.applyMatrix4(t), u.b.applyMatrix4(t), u.c.applyMatrix4(t), u.needsUpdate = !0;
1253
+ et(I, 3 * y, d, E), I.a.applyMatrix4(t), I.b.applyMatrix4(t), I.c.applyMatrix4(t), I.needsUpdate = !0;
1254
1254
  for (let x = m, b = m + O; x < b; x++) {
1255
- const B = c.resolveTriangleIndex(x);
1256
- et(h, 3 * B, l, a), h.needsUpdate = !0;
1257
- const H = h.distanceToTriangle(u, p, R);
1255
+ const B = l.resolveTriangleIndex(x);
1256
+ et(h, 3 * B, c, a), h.needsUpdate = !0;
1257
+ const H = h.distanceToTriangle(I, p, R);
1258
1258
  if (H < T && (A.copy(p), C && C.copy(R), T = H, F = x, f = L), H < o)
1259
1259
  return !0;
1260
1260
  }
@@ -1264,11 +1264,11 @@ function Jo(c, s, t, e = {}, i = {}, o = 0, n = 1 / 0) {
1264
1264
  } else {
1265
1265
  const S = Ce(s);
1266
1266
  for (let _ = 0, N = S; _ < N; _++) {
1267
- et(u, 3 * _, d, E), u.a.applyMatrix4(t), u.b.applyMatrix4(t), u.c.applyMatrix4(t), u.needsUpdate = !0;
1267
+ et(I, 3 * _, d, E), I.a.applyMatrix4(t), I.b.applyMatrix4(t), I.c.applyMatrix4(t), I.needsUpdate = !0;
1268
1268
  for (let L = m, M = m + O; L < M; L++) {
1269
- const y = c.resolveTriangleIndex(L);
1270
- et(h, 3 * y, l, a), h.needsUpdate = !0;
1271
- const x = h.distanceToTriangle(u, p, R);
1269
+ const y = l.resolveTriangleIndex(L);
1270
+ et(h, 3 * y, c, a), h.needsUpdate = !0;
1271
+ const x = h.distanceToTriangle(I, p, R);
1272
1272
  if (x < T && (A.copy(p), C && C.copy(R), T = x, F = L, f = _), x < o)
1273
1273
  return !0;
1274
1274
  }
@@ -1276,72 +1276,72 @@ function Jo(c, s, t, e = {}, i = {}, o = 0, n = 1 / 0) {
1276
1276
  }
1277
1277
  }
1278
1278
  }
1279
- ), It.releasePrimitive(h), It.releasePrimitive(u), T === 1 / 0 ? null : (e.point ? e.point.copy(A) : e.point = A.clone(), e.distance = T, e.faceIndex = F, i && (i.point ? i.point.copy(C) : i.point = C.clone(), i.point.applyMatrix4(as), A.applyMatrix4(as), i.distance = A.sub(i.point).length(), i.faceIndex = f), e);
1279
+ ), ut.releasePrimitive(h), ut.releasePrimitive(I), T === 1 / 0 ? null : (e.point ? e.point.copy(A) : e.point = A.clone(), e.distance = T, e.faceIndex = F, i && (i.point ? i.point.copy(C) : i.point = C.clone(), i.point.applyMatrix4(as), A.applyMatrix4(as), i.distance = A.sub(i.point).length(), i.faceIndex = f), e);
1280
1280
  }
1281
1281
  function tr() {
1282
1282
  return typeof SharedArrayBuffer < "u";
1283
1283
  }
1284
1284
  const be = new Z.constructor(), Rs = new Z.constructor(), vt = new Oi(() => new Ot()), ce = new Ot(), le = new Ot(), Ws = new Ot(), Xs = new Ot();
1285
1285
  let Zs = !1;
1286
- function er(c, s, t, e) {
1286
+ function er(l, s, t, e) {
1287
1287
  if (Zs)
1288
1288
  throw new Error("MeshBVH: Recursive calls to bvhcast not supported.");
1289
1289
  Zs = !0;
1290
- const i = c._roots, o = s._roots;
1290
+ const i = l._roots, o = s._roots;
1291
1291
  let n, r = 0, a = 0;
1292
- const l = new yt().copy(t).invert();
1292
+ const c = new yt().copy(t).invert();
1293
1293
  for (let E = 0, d = i.length; E < d; E++) {
1294
1294
  be.setBuffer(i[E]), a = 0;
1295
1295
  const h = vt.getPrimitive();
1296
- $(0, be.float32Array, h), h.applyMatrix4(l);
1297
- for (let u = 0, p = o.length; u < p && (Rs.setBuffer(o[E]), n = Tt(
1296
+ $(0, be.float32Array, h), h.applyMatrix4(c);
1297
+ for (let I = 0, p = o.length; I < p && (Rs.setBuffer(o[E]), n = Tt(
1298
1298
  0,
1299
1299
  0,
1300
1300
  t,
1301
- l,
1301
+ c,
1302
1302
  e,
1303
1303
  r,
1304
1304
  a,
1305
1305
  0,
1306
1306
  0,
1307
1307
  h
1308
- ), Rs.clearBuffer(), a += o[u].length, !n); u++)
1308
+ ), Rs.clearBuffer(), a += o[I].length, !n); I++)
1309
1309
  ;
1310
1310
  if (vt.releasePrimitive(h), be.clearBuffer(), r += i[E].length, n)
1311
1311
  break;
1312
1312
  }
1313
1313
  return Zs = !1, n;
1314
1314
  }
1315
- function Tt(c, s, t, e, i, o = 0, n = 0, r = 0, a = 0, l = null, E = !1) {
1315
+ function Tt(l, s, t, e, i, o = 0, n = 0, r = 0, a = 0, c = null, E = !1) {
1316
1316
  let d, h;
1317
1317
  E ? (d = Rs, h = be) : (d = be, h = Rs);
1318
- const u = d.float32Array, p = d.uint32Array, A = d.uint16Array, R = h.float32Array, C = h.uint32Array, T = h.uint16Array, F = c * 2, f = s * 2, m = ht(F, A), O = ht(f, T);
1318
+ const I = d.float32Array, p = d.uint32Array, A = d.uint16Array, R = h.float32Array, C = h.uint32Array, T = h.uint16Array, F = l * 2, f = s * 2, m = ht(F, A), O = ht(f, T);
1319
1319
  let S = !1;
1320
1320
  if (O && m)
1321
1321
  E ? S = i(
1322
1322
  Et(s, C),
1323
1323
  ft(s * 2, T),
1324
- Et(c, p),
1325
- ft(c * 2, A),
1324
+ Et(l, p),
1325
+ ft(l * 2, A),
1326
1326
  a,
1327
1327
  n + s,
1328
1328
  r,
1329
- o + c
1329
+ o + l
1330
1330
  ) : S = i(
1331
- Et(c, p),
1332
- ft(c * 2, A),
1331
+ Et(l, p),
1332
+ ft(l * 2, A),
1333
1333
  Et(s, C),
1334
1334
  ft(s * 2, T),
1335
1335
  r,
1336
- o + c,
1336
+ o + l,
1337
1337
  a,
1338
1338
  n + s
1339
1339
  );
1340
1340
  else if (O) {
1341
1341
  const _ = vt.getPrimitive();
1342
1342
  $(s, R, _), _.applyMatrix4(t);
1343
- const N = pt(c), L = Ct(c, p);
1344
- $(N, u, ce), $(L, u, le);
1343
+ const N = pt(l), L = Ct(l, p);
1344
+ $(N, I, ce), $(L, I, le);
1345
1345
  const M = _.intersectsBox(ce), y = _.intersectsBox(le);
1346
1346
  S = M && Tt(
1347
1347
  s,
@@ -1371,10 +1371,10 @@ function Tt(c, s, t, e, i, o = 0, n = 0, r = 0, a = 0, l = null, E = !1) {
1371
1371
  } else {
1372
1372
  const _ = pt(s), N = Ct(s, C);
1373
1373
  $(_, R, Ws), $(N, R, Xs);
1374
- const L = l.intersectsBox(Ws), M = l.intersectsBox(Xs);
1374
+ const L = c.intersectsBox(Ws), M = c.intersectsBox(Xs);
1375
1375
  if (L && M)
1376
1376
  S = Tt(
1377
- c,
1377
+ l,
1378
1378
  _,
1379
1379
  t,
1380
1380
  e,
@@ -1383,10 +1383,10 @@ function Tt(c, s, t, e, i, o = 0, n = 0, r = 0, a = 0, l = null, E = !1) {
1383
1383
  n,
1384
1384
  r,
1385
1385
  a + 1,
1386
- l,
1386
+ c,
1387
1387
  E
1388
1388
  ) || Tt(
1389
- c,
1389
+ l,
1390
1390
  N,
1391
1391
  t,
1392
1392
  e,
@@ -1395,13 +1395,13 @@ function Tt(c, s, t, e, i, o = 0, n = 0, r = 0, a = 0, l = null, E = !1) {
1395
1395
  n,
1396
1396
  r,
1397
1397
  a + 1,
1398
- l,
1398
+ c,
1399
1399
  E
1400
1400
  );
1401
1401
  else if (L)
1402
1402
  if (m)
1403
1403
  S = Tt(
1404
- c,
1404
+ l,
1405
1405
  _,
1406
1406
  t,
1407
1407
  e,
@@ -1410,14 +1410,14 @@ function Tt(c, s, t, e, i, o = 0, n = 0, r = 0, a = 0, l = null, E = !1) {
1410
1410
  n,
1411
1411
  r,
1412
1412
  a + 1,
1413
- l,
1413
+ c,
1414
1414
  E
1415
1415
  );
1416
1416
  else {
1417
1417
  const y = vt.getPrimitive();
1418
1418
  y.copy(Ws).applyMatrix4(t);
1419
- const x = pt(c), b = Ct(c, p);
1420
- $(x, u, ce), $(b, u, le);
1419
+ const x = pt(l), b = Ct(l, p);
1420
+ $(x, I, ce), $(b, I, le);
1421
1421
  const B = y.intersectsBox(ce), H = y.intersectsBox(le);
1422
1422
  S = B && Tt(
1423
1423
  _,
@@ -1448,7 +1448,7 @@ function Tt(c, s, t, e, i, o = 0, n = 0, r = 0, a = 0, l = null, E = !1) {
1448
1448
  else if (M)
1449
1449
  if (m)
1450
1450
  S = Tt(
1451
- c,
1451
+ l,
1452
1452
  N,
1453
1453
  t,
1454
1454
  e,
@@ -1457,14 +1457,14 @@ function Tt(c, s, t, e, i, o = 0, n = 0, r = 0, a = 0, l = null, E = !1) {
1457
1457
  n,
1458
1458
  r,
1459
1459
  a + 1,
1460
- l,
1460
+ c,
1461
1461
  E
1462
1462
  );
1463
1463
  else {
1464
1464
  const y = vt.getPrimitive();
1465
1465
  y.copy(Xs).applyMatrix4(t);
1466
- const x = pt(c), b = Ct(c, p);
1467
- $(x, u, ce), $(b, u, le);
1466
+ const x = pt(l), b = Ct(l, p);
1467
+ $(x, I, ce), $(b, I, le);
1468
1468
  const B = y.intersectsBox(ce), H = y.intersectsBox(le);
1469
1469
  S = B && Tt(
1470
1470
  N,
@@ -1524,8 +1524,8 @@ class gi {
1524
1524
  if (r._roots = o, r._indirectBuffer = n || null, e.setIndex) {
1525
1525
  const a = t.getIndex();
1526
1526
  if (a === null) {
1527
- const l = new Nn(s.index, 1, !1);
1528
- t.setIndex(l);
1527
+ const c = new Nn(s.index, 1, !1);
1528
+ t.setIndex(c);
1529
1529
  } else
1530
1530
  a.array !== i && (a.array.set(i), a.needsUpdate = !0);
1531
1531
  }
@@ -1565,22 +1565,22 @@ class gi {
1565
1565
  const e = this._roots[t], i = new Uint32Array(e), o = new Uint16Array(e);
1566
1566
  n(0);
1567
1567
  function n(r, a = 0) {
1568
- const l = r * 2, E = o[l + 15] === Ds;
1568
+ const c = r * 2, E = o[c + 15] === Ds;
1569
1569
  if (E) {
1570
- const d = i[r + 6], h = o[l + 14];
1570
+ const d = i[r + 6], h = o[c + 14];
1571
1571
  s(a, E, new Float32Array(e, r * 4, 6), d, h);
1572
1572
  } else {
1573
- const d = r + Cs / 4, h = i[r + 6], u = i[r + 7];
1574
- s(a, E, new Float32Array(e, r * 4, 6), u) || (n(d, a + 1), n(h, a + 1));
1573
+ const d = r + Cs / 4, h = i[r + 6], I = i[r + 7];
1574
+ s(a, E, new Float32Array(e, r * 4, 6), I) || (n(d, a + 1), n(h, a + 1));
1575
1575
  }
1576
1576
  }
1577
1577
  }
1578
1578
  /* Core Cast Functions */
1579
1579
  raycast(s, t = Mi) {
1580
- const e = this._roots, i = this.geometry, o = [], n = t.isMaterial, r = Array.isArray(t), a = i.groups, l = n ? t.side : t, E = this.indirect ? Wo : xo;
1580
+ const e = this._roots, i = this.geometry, o = [], n = t.isMaterial, r = Array.isArray(t), a = i.groups, c = n ? t.side : t, E = this.indirect ? Wo : xo;
1581
1581
  for (let d = 0, h = e.length; d < h; d++) {
1582
- const u = r ? t[a[d].materialIndex].side : l, p = o.length;
1583
- if (E(this, d, u, s, o), r) {
1582
+ const I = r ? t[a[d].materialIndex].side : c, p = o.length;
1583
+ if (E(this, d, I, s, o), r) {
1584
1584
  const A = a[d].materialIndex;
1585
1585
  for (let R = p, C = o.length; R < C; R++)
1586
1586
  o[R].face.materialIndex = A;
@@ -1591,9 +1591,9 @@ class gi {
1591
1591
  raycastFirst(s, t = Mi) {
1592
1592
  const e = this._roots, i = this.geometry, o = t.isMaterial, n = Array.isArray(t);
1593
1593
  let r = null;
1594
- const a = i.groups, l = o ? t.side : t, E = this.indirect ? Zo : vo;
1594
+ const a = i.groups, c = o ? t.side : t, E = this.indirect ? Zo : vo;
1595
1595
  for (let d = 0, h = e.length; d < h; d++) {
1596
- const u = n ? t[a[d].materialIndex].side : l, p = E(this, d, u, s);
1596
+ const I = n ? t[a[d].materialIndex].side : c, p = E(this, d, I, s);
1597
1597
  p != null && (r == null || p.distance < r.distance) && (r = p, n && (p.face.materialIndex = a[d].materialIndex));
1598
1598
  }
1599
1599
  return r;
@@ -1606,7 +1606,7 @@ class gi {
1606
1606
  return e;
1607
1607
  }
1608
1608
  shapecast(s) {
1609
- const t = It.getPrimitive(), e = this.indirect ? Uo : yo;
1609
+ const t = ut.getPrimitive(), e = this.indirect ? Uo : yo;
1610
1610
  let {
1611
1611
  boundsTraverseOrder: i,
1612
1612
  intersectsBounds: o,
@@ -1615,30 +1615,30 @@ class gi {
1615
1615
  } = s;
1616
1616
  if (n && r) {
1617
1617
  const d = n;
1618
- n = (h, u, p, A, R) => d(h, u, p, A, R) ? !0 : e(h, u, this, r, p, A, t);
1618
+ n = (h, I, p, A, R) => d(h, I, p, A, R) ? !0 : e(h, I, this, r, p, A, t);
1619
1619
  } else
1620
- n || (r ? n = (d, h, u, p) => e(d, h, this, r, u, p, t) : n = (d, h, u) => u);
1621
- let a = !1, l = 0;
1620
+ n || (r ? n = (d, h, I, p) => e(d, h, this, r, I, p, t) : n = (d, h, I) => I);
1621
+ let a = !1, c = 0;
1622
1622
  const E = this._roots;
1623
1623
  for (let d = 0, h = E.length; d < h; d++) {
1624
- const u = E[d];
1625
- if (a = go(this, d, o, n, i, l), a)
1624
+ const I = E[d];
1625
+ if (a = go(this, d, o, n, i, c), a)
1626
1626
  break;
1627
- l += u.byteLength;
1627
+ c += I.byteLength;
1628
1628
  }
1629
- return It.releasePrimitive(t), a;
1629
+ return ut.releasePrimitive(t), a;
1630
1630
  }
1631
1631
  bvhcast(s, t, e) {
1632
1632
  let {
1633
1633
  intersectsRanges: i,
1634
1634
  intersectsTriangles: o
1635
1635
  } = e;
1636
- const n = It.getPrimitive(), r = this.geometry.index, a = this.geometry.attributes.position, l = this.indirect ? (p) => {
1636
+ const n = ut.getPrimitive(), r = this.geometry.index, a = this.geometry.attributes.position, c = this.indirect ? (p) => {
1637
1637
  const A = this.resolveTriangleIndex(p);
1638
1638
  et(n, A * 3, r, a);
1639
1639
  } : (p) => {
1640
1640
  et(n, p * 3, r, a);
1641
- }, E = It.getPrimitive(), d = s.geometry.index, h = s.geometry.attributes.position, u = s.indirect ? (p) => {
1641
+ }, E = ut.getPrimitive(), d = s.geometry.index, h = s.geometry.attributes.position, I = s.indirect ? (p) => {
1642
1642
  const A = s.resolveTriangleIndex(p);
1643
1643
  et(E, A * 3, d, h);
1644
1644
  } : (p) => {
@@ -1647,9 +1647,9 @@ class gi {
1647
1647
  if (o) {
1648
1648
  const p = (A, R, C, T, F, f, m, O) => {
1649
1649
  for (let S = C, _ = C + T; S < _; S++) {
1650
- u(S), E.a.applyMatrix4(t), E.b.applyMatrix4(t), E.c.applyMatrix4(t), E.needsUpdate = !0;
1650
+ I(S), E.a.applyMatrix4(t), E.b.applyMatrix4(t), E.c.applyMatrix4(t), E.needsUpdate = !0;
1651
1651
  for (let N = A, L = A + R; N < L; N++)
1652
- if (l(N), n.needsUpdate = !0, o(n, E, N, S, F, f, m, O))
1652
+ if (c(N), n.needsUpdate = !0, o(n, E, N, S, F, f, m, O))
1653
1653
  return !0;
1654
1654
  }
1655
1655
  return !1;
@@ -1707,31 +1707,31 @@ class gi {
1707
1707
  }), s;
1708
1708
  }
1709
1709
  }
1710
- function $i(c, s, t) {
1711
- return c === null || (c.point.applyMatrix4(s.matrixWorld), c.distance = c.point.distanceTo(t.ray.origin), c.object = s, c.distance < t.near || c.distance > t.far) ? null : c;
1710
+ function $i(l, s, t) {
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
1713
  const Qs = /* @__PURE__ */ new Zn(), Ki = /* @__PURE__ */ new yt(), sr = v.prototype.raycast;
1714
- function ir(c, s) {
1714
+ function ir(l, s) {
1715
1715
  if (this.geometry.boundsTree) {
1716
1716
  if (this.material === void 0)
1717
1717
  return;
1718
- Ki.copy(this.matrixWorld).invert(), Qs.copy(c.ray).applyMatrix4(Ki);
1718
+ Ki.copy(this.matrixWorld).invert(), Qs.copy(l.ray).applyMatrix4(Ki);
1719
1719
  const t = this.geometry.boundsTree;
1720
- if (c.firstHitOnly === !0) {
1721
- const e = $i(t.raycastFirst(Qs, this.material), this, c);
1720
+ if (l.firstHitOnly === !0) {
1721
+ const e = $i(t.raycastFirst(Qs, this.material), this, l);
1722
1722
  e && s.push(e);
1723
1723
  } else {
1724
1724
  const e = t.raycast(Qs, this.material);
1725
1725
  for (let i = 0, o = e.length; i < o; i++) {
1726
- const n = $i(e[i], this, c);
1726
+ const n = $i(e[i], this, l);
1727
1727
  n && s.push(n);
1728
1728
  }
1729
1729
  }
1730
1730
  } else
1731
- sr.call(this, c, s);
1731
+ sr.call(this, l, s);
1732
1732
  }
1733
- function nr(c) {
1734
- return this.boundsTree = new gi(this, c), this.boundsTree;
1733
+ function nr(l) {
1734
+ return this.boundsTree = new gi(this, l), this.boundsTree;
1735
1735
  }
1736
1736
  function or() {
1737
1737
  this.boundsTree = null;
@@ -1739,12 +1739,12 @@ function or() {
1739
1739
  class U {
1740
1740
  constructor() {
1741
1741
  /** Triggers all the callbacks assigned to this event. */
1742
- I(this, "trigger", (s) => {
1742
+ u(this, "trigger", (s) => {
1743
1743
  const t = this.handlers.slice(0);
1744
1744
  for (const e of t)
1745
1745
  e(s);
1746
1746
  });
1747
- I(this, "handlers", []);
1747
+ u(this, "handlers", []);
1748
1748
  }
1749
1749
  /**
1750
1750
  * Add a callback to this event instance.
@@ -1768,12 +1768,12 @@ class U {
1768
1768
  class Kt {
1769
1769
  constructor() {
1770
1770
  /** Triggers all the callbacks assigned to this event. */
1771
- I(this, "trigger", async (s) => {
1771
+ u(this, "trigger", async (s) => {
1772
1772
  const t = this.handlers.slice(0);
1773
1773
  for (const e of t)
1774
1774
  await e(s);
1775
1775
  });
1776
- I(this, "handlers", []);
1776
+ u(this, "handlers", []);
1777
1777
  }
1778
1778
  /**
1779
1779
  * Add a callback to this event instance.
@@ -1797,15 +1797,15 @@ class Kt {
1797
1797
  class Si {
1798
1798
  constructor(s) {
1799
1799
  /** Whether is component is {@link Disposable}. */
1800
- I(this, "isDisposeable", () => "dispose" in this && "onDisposed" in this);
1800
+ u(this, "isDisposeable", () => "dispose" in this && "onDisposed" in this);
1801
1801
  /** Whether is component is {@link Resizeable}. */
1802
- I(this, "isResizeable", () => "resize" in this && "getSize" in this);
1802
+ u(this, "isResizeable", () => "resize" in this && "getSize" in this);
1803
1803
  /** Whether is component is {@link Updateable}. */
1804
- I(this, "isUpdateable", () => "onAfterUpdate" in this && "onBeforeUpdate" in this && "update" in this);
1804
+ u(this, "isUpdateable", () => "onAfterUpdate" in this && "onBeforeUpdate" in this && "update" in this);
1805
1805
  /** Whether is component is {@link Hideable}. */
1806
- I(this, "isHideable", () => "visible" in this);
1806
+ u(this, "isHideable", () => "visible" in this);
1807
1807
  /** Whether is component is {@link Configurable}. */
1808
- I(this, "isConfigurable", () => "setup" in this && "config" in this && "onSetup" in this);
1808
+ u(this, "isConfigurable", () => "setup" in this && "config" in this && "onSetup" in this);
1809
1809
  this.components = s;
1810
1810
  }
1811
1811
  }
@@ -1814,9 +1814,9 @@ class J extends Si {
1814
1814
  class _i extends Si {
1815
1815
  constructor(t) {
1816
1816
  super(t);
1817
- I(this, "worlds", /* @__PURE__ */ new Map());
1818
- I(this, "onWorldChanged", new U());
1819
- I(this, "currentWorld", null);
1817
+ u(this, "worlds", /* @__PURE__ */ new Map());
1818
+ u(this, "onWorldChanged", new U());
1819
+ u(this, "currentWorld", null);
1820
1820
  this.onWorldChanged.add(({ world: e, action: i }) => {
1821
1821
  i === "removed" && this.worlds.delete(e.uuid);
1822
1822
  });
@@ -1826,29 +1826,29 @@ class rr extends _i {
1826
1826
  constructor() {
1827
1827
  super(...arguments);
1828
1828
  /** Whether is instance is {@link CameraControllable}. */
1829
- I(this, "hasCameraControls", () => "controls" in this);
1829
+ u(this, "hasCameraControls", () => "controls" in this);
1830
1830
  }
1831
1831
  }
1832
1832
  class ar extends _i {
1833
1833
  constructor() {
1834
1834
  super(...arguments);
1835
1835
  /** {@link Updateable.onBeforeUpdate} */
1836
- I(this, "onAfterUpdate", new U());
1836
+ u(this, "onAfterUpdate", new U());
1837
1837
  /** {@link Updateable.onAfterUpdate} */
1838
- I(this, "onBeforeUpdate", new U());
1838
+ u(this, "onBeforeUpdate", new U());
1839
1839
  /** {@link Disposable.onDisposed} */
1840
- I(this, "onDisposed", new U());
1841
- I(this, "onResize", new U());
1840
+ u(this, "onDisposed", new U());
1841
+ u(this, "onResize", new U());
1842
1842
  /**
1843
1843
  * Event that fires when there has been a change to the list of clipping
1844
1844
  * planes used by the active renderer.
1845
1845
  */
1846
- I(this, "onClippingPlanesUpdated", new U());
1846
+ u(this, "onClippingPlanesUpdated", new U());
1847
1847
  /**
1848
1848
  * The list of [clipping planes](https://threejs.org/docs/#api/en/renderers/WebGLRenderer.clippingPlanes) used by this
1849
1849
  * instance of the renderer.
1850
1850
  */
1851
- I(this, "clippingPlanes", []);
1851
+ u(this, "clippingPlanes", []);
1852
1852
  }
1853
1853
  /**
1854
1854
  * Forces the update of the clipping planes and all components that depend
@@ -1873,9 +1873,9 @@ class ar extends _i {
1873
1873
  const ve = class ve extends J {
1874
1874
  constructor(t) {
1875
1875
  super(t);
1876
- I(this, "_disposedComponents", /* @__PURE__ */ new Set());
1876
+ u(this, "_disposedComponents", /* @__PURE__ */ new Set());
1877
1877
  /** {@link Component.enabled} */
1878
- I(this, "enabled", !0);
1878
+ u(this, "enabled", !0);
1879
1879
  t.add(ve.uuid, this);
1880
1880
  }
1881
1881
  /**
@@ -1930,13 +1930,13 @@ const ve = class ve extends J {
1930
1930
  t.material.dispose();
1931
1931
  }
1932
1932
  };
1933
- I(ve, "uuid", "76e9cd8e-ad8f-4753-9ef6-cbc60f7247fe");
1933
+ u(ve, "uuid", "76e9cd8e-ad8f-4753-9ef6-cbc60f7247fe");
1934
1934
  let Ht = ve;
1935
1935
  class cr extends _i {
1936
1936
  constructor(t) {
1937
1937
  super(t);
1938
1938
  /** {@link Disposable.onDisposed} */
1939
- I(this, "onDisposed", new U());
1939
+ u(this, "onDisposed", new U());
1940
1940
  }
1941
1941
  /** {@link Disposable.dispose} */
1942
1942
  dispose() {
@@ -1948,7 +1948,7 @@ class cr extends _i {
1948
1948
  this.three.children = [], this.onDisposed.trigger(), this.onDisposed.reset();
1949
1949
  }
1950
1950
  }
1951
- const Ts = 0, lr = 1, hr = new w(), Ji = new Lt(), js = new Ai(), tn = new w(), ls = new Ie();
1951
+ const Ts = 0, lr = 1, hr = new w(), Ji = new Lt(), js = new Ai(), tn = new w(), ls = new ue();
1952
1952
  class Er {
1953
1953
  constructor() {
1954
1954
  this.tolerance = -1, this.faces = [], this.newFaces = [], this.assigned = new en(), this.unassigned = new en(), this.vertices = [];
@@ -1987,10 +1987,10 @@ class Er {
1987
1987
  const e = this.faces;
1988
1988
  let i = -1 / 0, o = 1 / 0;
1989
1989
  for (let n = 0, r = e.length; n < r; n++) {
1990
- const a = e[n], l = a.distanceToPoint(s.origin), E = a.normal.dot(s.direction);
1991
- if (l > 0 && E >= 0)
1990
+ const a = e[n], c = a.distanceToPoint(s.origin), E = a.normal.dot(s.direction);
1991
+ if (c > 0 && E >= 0)
1992
1992
  return null;
1993
- const d = E !== 0 ? -l / E : 0;
1993
+ const d = E !== 0 ? -c / E : 0;
1994
1994
  if (!(d <= 0) && (E > 0 ? o = Math.min(d, o) : i = Math.max(d, i), i > o))
1995
1995
  return null;
1996
1996
  }
@@ -2063,10 +2063,10 @@ class Er {
2063
2063
  s.copy(this.vertices[0].point), t.copy(this.vertices[0].point);
2064
2064
  for (let o = 0, n = this.vertices.length; o < n; o++) {
2065
2065
  const r = this.vertices[o], a = r.point;
2066
- for (let l = 0; l < 3; l++)
2067
- a.getComponent(l) < s.getComponent(l) && (s.setComponent(l, a.getComponent(l)), e[l] = r);
2068
- for (let l = 0; l < 3; l++)
2069
- a.getComponent(l) > t.getComponent(l) && (t.setComponent(l, a.getComponent(l)), i[l] = r);
2066
+ for (let c = 0; c < 3; c++)
2067
+ a.getComponent(c) < s.getComponent(c) && (s.setComponent(c, a.getComponent(c)), e[c] = r);
2068
+ for (let c = 0; c < 3; c++)
2069
+ a.getComponent(c) > t.getComponent(c) && (t.setComponent(c, a.getComponent(c)), i[c] = r);
2070
2070
  }
2071
2071
  return this.tolerance = 3 * Number.EPSILON * (Math.max(Math.abs(s.x), Math.abs(t.x)) + Math.max(Math.abs(s.y), Math.abs(t.y)) + Math.max(Math.abs(s.z), Math.abs(t.z))), { min: e, max: i };
2072
2072
  }
@@ -2076,24 +2076,24 @@ class Er {
2076
2076
  const s = this.vertices, t = this.computeExtremes(), e = t.min, i = t.max;
2077
2077
  let o = 0, n = 0;
2078
2078
  for (let h = 0; h < 3; h++) {
2079
- const u = i[h].point.getComponent(h) - e[h].point.getComponent(h);
2080
- u > o && (o = u, n = h);
2079
+ const I = i[h].point.getComponent(h) - e[h].point.getComponent(h);
2080
+ I > o && (o = I, n = h);
2081
2081
  }
2082
2082
  const r = e[n], a = i[n];
2083
- let l, E;
2083
+ let c, E;
2084
2084
  o = 0, Ji.set(r.point, a.point);
2085
- for (let h = 0, u = this.vertices.length; h < u; h++) {
2085
+ for (let h = 0, I = this.vertices.length; h < I; h++) {
2086
2086
  const p = s[h];
2087
2087
  if (p !== r && p !== a) {
2088
2088
  Ji.closestPointToPoint(p.point, !0, tn);
2089
2089
  const A = tn.distanceToSquared(p.point);
2090
- A > o && (o = A, l = p);
2090
+ A > o && (o = A, c = p);
2091
2091
  }
2092
2092
  }
2093
- o = -1, js.setFromCoplanarPoints(r.point, a.point, l.point);
2094
- for (let h = 0, u = this.vertices.length; h < u; h++) {
2093
+ o = -1, js.setFromCoplanarPoints(r.point, a.point, c.point);
2094
+ for (let h = 0, I = this.vertices.length; h < I; h++) {
2095
2095
  const p = s[h];
2096
- if (p !== r && p !== a && p !== l) {
2096
+ if (p !== r && p !== a && p !== c) {
2097
2097
  const A = Math.abs(js.distanceToPoint(p.point));
2098
2098
  A > o && (o = A, E = p);
2099
2099
  }
@@ -2101,32 +2101,32 @@ class Er {
2101
2101
  const d = [];
2102
2102
  if (js.distanceToPoint(E.point) < 0) {
2103
2103
  d.push(
2104
- Rt.create(r, a, l),
2104
+ Rt.create(r, a, c),
2105
2105
  Rt.create(E, a, r),
2106
- Rt.create(E, l, a),
2107
- Rt.create(E, r, l)
2106
+ Rt.create(E, c, a),
2107
+ Rt.create(E, r, c)
2108
2108
  );
2109
2109
  for (let h = 0; h < 3; h++) {
2110
- const u = (h + 1) % 3;
2111
- d[h + 1].getEdge(2).setTwin(d[0].getEdge(u)), d[h + 1].getEdge(1).setTwin(d[u + 1].getEdge(0));
2110
+ const I = (h + 1) % 3;
2111
+ d[h + 1].getEdge(2).setTwin(d[0].getEdge(I)), d[h + 1].getEdge(1).setTwin(d[I + 1].getEdge(0));
2112
2112
  }
2113
2113
  } else {
2114
2114
  d.push(
2115
- Rt.create(r, l, a),
2115
+ Rt.create(r, c, a),
2116
2116
  Rt.create(E, r, a),
2117
- Rt.create(E, a, l),
2118
- Rt.create(E, l, r)
2117
+ Rt.create(E, a, c),
2118
+ Rt.create(E, c, r)
2119
2119
  );
2120
2120
  for (let h = 0; h < 3; h++) {
2121
- const u = (h + 1) % 3;
2122
- d[h + 1].getEdge(2).setTwin(d[0].getEdge((3 - h) % 3)), d[h + 1].getEdge(0).setTwin(d[u + 1].getEdge(1));
2121
+ const I = (h + 1) % 3;
2122
+ d[h + 1].getEdge(2).setTwin(d[0].getEdge((3 - h) % 3)), d[h + 1].getEdge(0).setTwin(d[I + 1].getEdge(1));
2123
2123
  }
2124
2124
  }
2125
2125
  for (let h = 0; h < 4; h++)
2126
2126
  this.faces.push(d[h]);
2127
- for (let h = 0, u = s.length; h < u; h++) {
2127
+ for (let h = 0, I = s.length; h < I; h++) {
2128
2128
  const p = s[h];
2129
- if (p !== r && p !== a && p !== l && p !== E) {
2129
+ if (p !== r && p !== a && p !== c && p !== E) {
2130
2130
  o = this.tolerance;
2131
2131
  let A = null;
2132
2132
  for (let R = 0; R < 4; R++) {
@@ -2298,55 +2298,55 @@ class en {
2298
2298
  return this.head === null;
2299
2299
  }
2300
2300
  }
2301
- const ui = [2, 2, 1], Ii = [1, 0, 0];
2302
- function Nt(c, s) {
2303
- return c * 3 + s;
2301
+ const Ii = [2, 2, 1], ui = [1, 0, 0];
2302
+ function Nt(l, s) {
2303
+ return l * 3 + s;
2304
2304
  }
2305
- function ur(c) {
2306
- const s = c.elements;
2305
+ function Ir(l) {
2306
+ const s = l.elements;
2307
2307
  let t = 0;
2308
2308
  for (let e = 0; e < 9; e++)
2309
2309
  t += s[e] * s[e];
2310
2310
  return Math.sqrt(t);
2311
2311
  }
2312
- function Ir(c) {
2313
- const s = c.elements;
2312
+ function ur(l) {
2313
+ const s = l.elements;
2314
2314
  let t = 0;
2315
2315
  for (let e = 0; e < 3; e++) {
2316
- const i = s[Nt(ui[e], Ii[e])];
2316
+ const i = s[Nt(Ii[e], ui[e])];
2317
2317
  t += 2 * i * i;
2318
2318
  }
2319
2319
  return Math.sqrt(t);
2320
2320
  }
2321
- function fr(c, s) {
2321
+ function fr(l, s) {
2322
2322
  let t = 0, e = 1;
2323
- const i = c.elements;
2324
- for (let l = 0; l < 3; l++) {
2325
- const E = Math.abs(i[Nt(ui[l], Ii[l])]);
2326
- E > t && (t = E, e = l);
2323
+ const i = l.elements;
2324
+ for (let c = 0; c < 3; c++) {
2325
+ const E = Math.abs(i[Nt(Ii[c], ui[c])]);
2326
+ E > t && (t = E, e = c);
2327
2327
  }
2328
2328
  let o = 1, n = 0;
2329
- const r = Ii[e], a = ui[e];
2329
+ const r = ui[e], a = Ii[e];
2330
2330
  if (Math.abs(i[Nt(a, r)]) > Number.EPSILON) {
2331
- const l = i[Nt(a, a)], E = i[Nt(r, r)], d = i[Nt(a, r)], h = (l - E) / 2 / d;
2332
- let u;
2333
- h < 0 ? u = -1 / (-h + Math.sqrt(1 + h * h)) : u = 1 / (h + Math.sqrt(1 + h * h)), o = 1 / Math.sqrt(1 + u * u), n = u * o;
2331
+ const c = i[Nt(a, a)], E = i[Nt(r, r)], d = i[Nt(a, r)], h = (c - E) / 2 / d;
2332
+ let I;
2333
+ h < 0 ? I = -1 / (-h + Math.sqrt(1 + h * h)) : I = 1 / (h + Math.sqrt(1 + h * h)), o = 1 / Math.sqrt(1 + I * I), n = I * o;
2334
2334
  }
2335
2335
  return s.identity(), s.elements[Nt(r, r)] = o, s.elements[Nt(a, a)] = o, s.elements[Nt(a, r)] = n, s.elements[Nt(r, a)] = -n, s;
2336
2336
  }
2337
- function pr(c, s) {
2337
+ function pr(l, s) {
2338
2338
  let t = 0, e = 0;
2339
2339
  const i = 10;
2340
- s.unitary.identity(), s.diagonal.copy(c);
2341
- const o = s.unitary, n = s.diagonal, r = new g.Matrix3(), a = new g.Matrix3(), l = Number.EPSILON * ur(n);
2342
- for (; e < i && Ir(n) > l; )
2340
+ s.unitary.identity(), s.diagonal.copy(l);
2341
+ const o = s.unitary, n = s.diagonal, r = new g.Matrix3(), a = new g.Matrix3(), c = Number.EPSILON * Ir(n);
2342
+ for (; e < i && ur(n) > c; )
2343
2343
  fr(n, r), a.copy(r).transpose(), n.multiply(r), n.premultiply(a), o.multiply(r), ++t > 2 && (e++, t = 0);
2344
2344
  return s;
2345
2345
  }
2346
- function Cr(c) {
2346
+ function Cr(l) {
2347
2347
  const s = [];
2348
- for (let it = 0; it < c.length - 2; it += 3) {
2349
- const Zt = c[it], tt = c[it + 1], Jt = c[it + 2];
2348
+ for (let it = 0; it < l.length - 2; it += 3) {
2349
+ const Zt = l[it], tt = l[it + 1], Jt = l[it + 2];
2350
2350
  s.push(new g.Vector3(Zt, tt, Jt));
2351
2351
  }
2352
2352
  const t = new Er();
@@ -2368,12 +2368,12 @@ function Cr(c) {
2368
2368
  n.push(xs.point.x, xs.point.y, xs.point.z), n.push(bs.point.x, bs.point.y, bs.point.z), n.push(vs.point.x, vs.point.y, vs.point.z);
2369
2369
  }
2370
2370
  }
2371
- const r = new g.Vector3(), a = new g.Vector3(), l = new g.Vector3(), E = new g.Vector3(), d = new g.Vector3(), h = new g.Vector3(), u = new g.Vector3(), p = new g.Vector3();
2371
+ const r = new g.Vector3(), a = new g.Vector3(), c = new g.Vector3(), E = new g.Vector3(), d = new g.Vector3(), h = new g.Vector3(), I = new g.Vector3(), p = new g.Vector3();
2372
2372
  let A = 0, R = 0, C = 0, T = 0, F = 0, f = 0, m = 0;
2373
2373
  for (let it = 0, Zt = n.length; it < Zt; it += 9) {
2374
- r.fromArray(n, it), a.fromArray(n, it + 3), l.fromArray(n, it + 6), u.set(0, 0, 0), u.add(r).add(a).add(l).divideScalar(3), E.subVectors(a, r), d.subVectors(l, r);
2374
+ r.fromArray(n, it), a.fromArray(n, it + 3), c.fromArray(n, it + 6), I.set(0, 0, 0), I.add(r).add(a).add(c).divideScalar(3), E.subVectors(a, r), d.subVectors(c, r);
2375
2375
  const tt = h.crossVectors(E, d).length() / 2;
2376
- p.add(h.copy(u).multiplyScalar(tt)), A += tt, R += (9 * u.x * u.x + r.x * r.x + a.x * a.x + l.x * l.x) * (tt / 12), C += (9 * u.x * u.y + r.x * r.y + a.x * a.y + l.x * l.y) * (tt / 12), T += (9 * u.x * u.z + r.x * r.z + a.x * a.z + l.x * l.z) * (tt / 12), F += (9 * u.y * u.y + r.y * r.y + a.y * a.y + l.y * l.y) * (tt / 12), f += (9 * u.y * u.z + r.y * r.z + a.y * a.z + l.y * l.z) * (tt / 12), m += (9 * u.z * u.z + r.z * r.z + a.z * a.z + l.z * l.z) * (tt / 12);
2376
+ p.add(h.copy(I).multiplyScalar(tt)), A += tt, R += (9 * I.x * I.x + r.x * r.x + a.x * a.x + c.x * c.x) * (tt / 12), C += (9 * I.x * I.y + r.x * r.y + a.x * a.y + c.x * c.y) * (tt / 12), T += (9 * I.x * I.z + r.x * r.z + a.x * a.z + c.x * c.z) * (tt / 12), F += (9 * I.y * I.y + r.y * r.y + a.y * a.y + c.y * c.y) * (tt / 12), f += (9 * I.y * I.z + r.y * r.z + a.y * a.z + c.y * c.z) * (tt / 12), m += (9 * I.z * I.z + r.z * r.z + a.z * a.z + c.z * c.z) * (tt / 12);
2377
2377
  }
2378
2378
  p.divideScalar(A), R /= A, C /= A, T /= A, F /= A, f /= A, m /= A, R -= p.x * p.x, C -= p.x * p.y, T -= p.x * p.z, F -= p.y * p.y, f -= p.y * p.z, m -= p.z * p.z;
2379
2379
  const O = new g.Matrix3();
@@ -2399,11 +2399,11 @@ function Cr(c) {
2399
2399
  const me = new g.Matrix4();
2400
2400
  return me.multiply(yi), me.multiply(wi), me.multiply(Te), me.multiply(We), { center: q, halfSizes: st, rotation: Q, transformation: me };
2401
2401
  }
2402
- function Tr(c, s, t) {
2402
+ function Tr(l, s, t) {
2403
2403
  const e = [
2404
- c[0] - s[0],
2405
- c[1] - s[1],
2406
- c[2] - s[2]
2404
+ l[0] - s[0],
2405
+ l[1] - s[1],
2406
+ l[2] - s[2]
2407
2407
  ];
2408
2408
  return t[0] * e[0] + t[1] * e[1] + t[2] * e[2] > 0;
2409
2409
  }
@@ -2430,8 +2430,8 @@ const K = class K {
2430
2430
  );
2431
2431
  }
2432
2432
  };
2433
- I(K, "_pattern", /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/), // prettier-ignore
2434
- I(K, "_lut", [
2433
+ u(K, "_pattern", /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/), // prettier-ignore
2434
+ u(K, "_lut", [
2435
2435
  "00",
2436
2436
  "01",
2437
2437
  "02",
@@ -2693,13 +2693,13 @@ let ze = K;
2693
2693
  class ea extends J {
2694
2694
  constructor(t, e) {
2695
2695
  super(t);
2696
- I(this, "onVertexFound", new U());
2697
- I(this, "onVertexLost", new U());
2698
- I(this, "components");
2699
- I(this, "_pickedPoint", null);
2700
- I(this, "_config");
2701
- I(this, "_enabled", !1);
2702
- I(this, "_workingPlane", null);
2696
+ u(this, "onVertexFound", new U());
2697
+ u(this, "onVertexLost", new U());
2698
+ u(this, "components");
2699
+ u(this, "_pickedPoint", null);
2700
+ u(this, "_config");
2701
+ u(this, "_enabled", !1);
2702
+ u(this, "_workingPlane", null);
2703
2703
  this.components = t, this.config = {
2704
2704
  snapDistance: 0.25,
2705
2705
  showOnlyVertex: !1,
@@ -2771,13 +2771,13 @@ class ea extends J {
2771
2771
  const Fs = class Fs {
2772
2772
  constructor() {
2773
2773
  /** {@link Disposable.onDisposed} */
2774
- I(this, "onDisposed", new U());
2774
+ u(this, "onDisposed", new U());
2775
2775
  /** The list of components created in this app. */
2776
- I(this, "list", /* @__PURE__ */ new Map());
2776
+ u(this, "list", /* @__PURE__ */ new Map());
2777
2777
  /** If disabled, the animation loop will be stopped. */
2778
- I(this, "enabled", !1);
2779
- I(this, "_clock");
2780
- I(this, "update", () => {
2778
+ u(this, "enabled", !1);
2779
+ u(this, "_clock");
2780
+ u(this, "update", () => {
2781
2781
  if (!this.enabled)
2782
2782
  return;
2783
2783
  const s = this._clock.getDelta();
@@ -2842,15 +2842,15 @@ const Fs = class Fs {
2842
2842
  g.BufferGeometry.prototype.computeBoundsTree = nr, g.BufferGeometry.prototype.disposeBoundsTree = or, g.Mesh.prototype.raycast = ir;
2843
2843
  }
2844
2844
  };
2845
- I(Fs, "release", "1.4.21");
2845
+ u(Fs, "release", "1.4.21");
2846
2846
  let fi = Fs;
2847
2847
  class mr {
2848
2848
  constructor(s) {
2849
- I(this, "_event");
2850
- I(this, "_position", new g.Vector2());
2849
+ u(this, "_event");
2850
+ u(this, "_position", new g.Vector2());
2851
2851
  /** {@link Disposable.onDisposed} */
2852
- I(this, "onDisposed", new U());
2853
- I(this, "updateMouseInfo", (s) => {
2852
+ u(this, "onDisposed", new U());
2853
+ u(this, "updateMouseInfo", (s) => {
2854
2854
  this._event = s;
2855
2855
  });
2856
2856
  this.dom = s, this.setupEvents(!0);
@@ -2882,14 +2882,14 @@ class mr {
2882
2882
  class Rr {
2883
2883
  constructor(s, t) {
2884
2884
  /** {@link Component.enabled} */
2885
- I(this, "enabled", !0);
2886
- I(this, "components");
2885
+ u(this, "enabled", !0);
2886
+ u(this, "components");
2887
2887
  /** {@link Disposable.onDisposed} */
2888
- I(this, "onDisposed", new U());
2888
+ u(this, "onDisposed", new U());
2889
2889
  /** The position of the mouse in the screen. */
2890
- I(this, "mouse");
2891
- I(this, "three", new g.Raycaster());
2892
- I(this, "world");
2890
+ u(this, "mouse");
2891
+ u(this, "three", new g.Raycaster());
2892
+ u(this, "world");
2893
2893
  const e = t.renderer;
2894
2894
  if (!e)
2895
2895
  throw new Error("A renderer is needed for the raycaster to work!");
@@ -2936,9 +2936,9 @@ class Rr {
2936
2936
  const Os = class Os extends J {
2937
2937
  constructor(t) {
2938
2938
  super(t);
2939
- I(this, "enabled", !0);
2940
- I(this, "list", /* @__PURE__ */ new Map());
2941
- I(this, "onDisposed", new U());
2939
+ u(this, "enabled", !0);
2940
+ u(this, "list", /* @__PURE__ */ new Map());
2941
+ u(this, "onDisposed", new U());
2942
2942
  t.add(Os.uuid, this);
2943
2943
  }
2944
2944
  get(t) {
@@ -2959,7 +2959,7 @@ const Os = class Os extends J {
2959
2959
  this.list.clear(), this.onDisposed.trigger();
2960
2960
  }
2961
2961
  };
2962
- I(Os, "uuid", "d5d8bdf0-db25-4952-b951-b643af207ace");
2962
+ u(Os, "uuid", "d5d8bdf0-db25-4952-b951-b643af207ace");
2963
2963
  let He = Os;
2964
2964
  class Ar extends Si {
2965
2965
  constructor(t) {
@@ -2967,15 +2967,15 @@ class Ar extends Si {
2967
2967
  /**
2968
2968
  * All the loaded [meshes](https://threejs.org/docs/#api/en/objects/Mesh).
2969
2969
  */
2970
- I(this, "meshes", /* @__PURE__ */ new Set());
2971
- I(this, "onAfterUpdate", new U());
2972
- I(this, "onBeforeUpdate", new U());
2973
- I(this, "enabled", !0);
2974
- I(this, "uuid", ze.create());
2975
- I(this, "onDisposed", new U());
2976
- I(this, "_scene");
2977
- I(this, "_camera");
2978
- I(this, "_renderer", null);
2970
+ u(this, "meshes", /* @__PURE__ */ new Set());
2971
+ u(this, "onAfterUpdate", new U());
2972
+ u(this, "onBeforeUpdate", new U());
2973
+ u(this, "enabled", !0);
2974
+ u(this, "uuid", ze.create());
2975
+ u(this, "onDisposed", new U());
2976
+ u(this, "_scene");
2977
+ u(this, "_camera");
2978
+ u(this, "_renderer", null);
2979
2979
  }
2980
2980
  get scene() {
2981
2981
  if (!this._scene)
@@ -3017,11 +3017,11 @@ class sa extends cr {
3017
3017
  constructor(t) {
3018
3018
  super(t);
3019
3019
  /** {@link Configurable.isSetup} */
3020
- I(this, "isSetup", !1);
3021
- I(this, "three");
3020
+ u(this, "isSetup", !1);
3021
+ u(this, "three");
3022
3022
  /** {@link Configurable.onSetup} */
3023
- I(this, "onSetup", new U());
3024
- I(this, "config", {
3023
+ u(this, "onSetup", new U());
3024
+ u(this, "config", {
3025
3025
  directionalLight: {
3026
3026
  color: new g.Color("white"),
3027
3027
  intensity: 1.5,
@@ -3052,27 +3052,27 @@ class sa extends cr {
3052
3052
  class ia extends ar {
3053
3053
  constructor(t, e, i) {
3054
3054
  super(t);
3055
- I(this, "enabled", !0);
3055
+ u(this, "enabled", !0);
3056
3056
  /** The HTML container of the THREE.js canvas where the scene is rendered. */
3057
- I(this, "container");
3058
- I(this, "three");
3059
- I(this, "_canvas");
3060
- I(this, "_parameters");
3061
- I(this, "_resizeObserver", null);
3062
- I(this, "onContainerUpdated", new U());
3057
+ u(this, "container");
3058
+ u(this, "three");
3059
+ u(this, "_canvas");
3060
+ u(this, "_parameters");
3061
+ u(this, "_resizeObserver", null);
3062
+ u(this, "onContainerUpdated", new U());
3063
3063
  /** {@link Resizeable.resize} */
3064
- I(this, "resize", (t) => {
3064
+ u(this, "resize", (t) => {
3065
3065
  this.onContainerUpdated.trigger();
3066
3066
  const e = t ? t.x : this.container.clientWidth, i = t ? t.y : this.container.clientHeight;
3067
3067
  this.three.setSize(e, i), this.onResize.trigger(new g.Vector2(e, i));
3068
3068
  });
3069
- I(this, "resizeEvent", () => {
3069
+ u(this, "resizeEvent", () => {
3070
3070
  this.resize();
3071
3071
  });
3072
- I(this, "onContextLost", (t) => {
3072
+ u(this, "onContextLost", (t) => {
3073
3073
  t.preventDefault(), this.enabled = !1;
3074
3074
  });
3075
- I(this, "onContextBack", () => {
3075
+ u(this, "onContextBack", () => {
3076
3076
  this.three.setRenderTarget(null), this.three.dispose(), this.three = new g.WebGLRenderer({
3077
3077
  canvas: this._canvas,
3078
3078
  antialias: !0,
@@ -3150,64 +3150,64 @@ const V = {
3150
3150
  IN: 1,
3151
3151
  OUT: -1
3152
3152
  };
3153
- function Qt(c) {
3154
- return c.isPerspectiveCamera;
3153
+ function Qt(l) {
3154
+ return l.isPerspectiveCamera;
3155
3155
  }
3156
- function bt(c) {
3157
- return c.isOrthographicCamera;
3156
+ function bt(l) {
3157
+ return l.isOrthographicCamera;
3158
3158
  }
3159
3159
  const Ee = Math.PI * 2, nn = Math.PI / 2, Un = 1e-5, Ne = Math.PI / 180;
3160
- function mt(c, s, t) {
3161
- return Math.max(s, Math.min(t, c));
3160
+ function mt(l, s, t) {
3161
+ return Math.max(s, Math.min(t, l));
3162
3162
  }
3163
- function X(c, s = Un) {
3164
- return Math.abs(c) < s;
3163
+ function X(l, s = Un) {
3164
+ return Math.abs(l) < s;
3165
3165
  }
3166
- function k(c, s, t = Un) {
3167
- return X(c - s, t);
3166
+ function k(l, s, t = Un) {
3167
+ return X(l - s, t);
3168
3168
  }
3169
- function on(c, s) {
3170
- return Math.round(c / s) * s;
3169
+ function on(l, s) {
3170
+ return Math.round(l / s) * s;
3171
3171
  }
3172
- function Pe(c) {
3173
- return isFinite(c) ? c : c < 0 ? -Number.MAX_VALUE : Number.MAX_VALUE;
3172
+ function Pe(l) {
3173
+ return isFinite(l) ? l : l < 0 ? -Number.MAX_VALUE : Number.MAX_VALUE;
3174
3174
  }
3175
- function Le(c) {
3176
- return Math.abs(c) < Number.MAX_VALUE ? c : c * (1 / 0);
3175
+ function Le(l) {
3176
+ return Math.abs(l) < Number.MAX_VALUE ? l : l * (1 / 0);
3177
3177
  }
3178
- function hs(c, s, t, e, i = 1 / 0, o) {
3178
+ function hs(l, s, t, e, i = 1 / 0, o) {
3179
3179
  e = Math.max(1e-4, e);
3180
3180
  const n = 2 / e, r = n * o, a = 1 / (1 + r + 0.48 * r * r + 0.235 * r * r * r);
3181
- let l = c - s;
3181
+ let c = l - s;
3182
3182
  const E = s, d = i * e;
3183
- l = mt(l, -d, d), s = c - l;
3184
- const h = (t.value + n * l) * o;
3183
+ c = mt(c, -d, d), s = l - c;
3184
+ const h = (t.value + n * c) * o;
3185
3185
  t.value = (t.value - n * h) * a;
3186
- let u = s + (l + h) * a;
3187
- return E - c > 0 == u > E && (u = E, t.value = (u - E) / o), u;
3186
+ let I = s + (c + h) * a;
3187
+ return E - l > 0 == I > E && (I = E, t.value = (I - E) / o), I;
3188
3188
  }
3189
- function rn(c, s, t, e, i = 1 / 0, o, n) {
3189
+ function rn(l, s, t, e, i = 1 / 0, o, n) {
3190
3190
  e = Math.max(1e-4, e);
3191
- const r = 2 / e, a = r * o, l = 1 / (1 + a + 0.48 * a * a + 0.235 * a * a * a);
3192
- let E = s.x, d = s.y, h = s.z, u = c.x - E, p = c.y - d, A = c.z - h;
3193
- const R = E, C = d, T = h, F = i * e, f = F * F, m = u * u + p * p + A * A;
3191
+ const r = 2 / e, a = r * o, c = 1 / (1 + a + 0.48 * a * a + 0.235 * a * a * a);
3192
+ let E = s.x, d = s.y, h = s.z, I = l.x - E, p = l.y - d, A = l.z - h;
3193
+ const R = E, C = d, T = h, F = i * e, f = F * F, m = I * I + p * p + A * A;
3194
3194
  if (m > f) {
3195
3195
  const B = Math.sqrt(m);
3196
- u = u / B * F, p = p / B * F, A = A / B * F;
3196
+ I = I / B * F, p = p / B * F, A = A / B * F;
3197
3197
  }
3198
- E = c.x - u, d = c.y - p, h = c.z - A;
3199
- const O = (t.x + r * u) * o, S = (t.y + r * p) * o, _ = (t.z + r * A) * o;
3200
- t.x = (t.x - r * O) * l, t.y = (t.y - r * S) * l, t.z = (t.z - r * _) * l, n.x = E + (u + O) * l, n.y = d + (p + S) * l, n.z = h + (A + _) * l;
3201
- const N = R - c.x, L = C - c.y, M = T - c.z, y = n.x - R, x = n.y - C, b = n.z - T;
3198
+ E = l.x - I, d = l.y - p, h = l.z - A;
3199
+ const O = (t.x + r * I) * o, S = (t.y + r * p) * o, _ = (t.z + r * A) * o;
3200
+ t.x = (t.x - r * O) * c, t.y = (t.y - r * S) * c, t.z = (t.z - r * _) * c, n.x = E + (I + O) * c, n.y = d + (p + S) * c, n.z = h + (A + _) * c;
3201
+ const N = R - l.x, L = C - l.y, M = T - l.z, y = n.x - R, x = n.y - C, b = n.z - T;
3202
3202
  return N * y + L * x + M * b > 0 && (n.x = R, n.y = C, n.z = T, t.x = (n.x - R) / o, t.y = (n.y - C) / o, t.z = (n.z - T) / o), n;
3203
3203
  }
3204
- function $s(c, s) {
3205
- s.set(0, 0), c.forEach((t) => {
3204
+ function $s(l, s) {
3205
+ s.set(0, 0), l.forEach((t) => {
3206
3206
  s.x += t.clientX, s.y += t.clientY;
3207
- }), s.x /= c.length, s.y /= c.length;
3207
+ }), s.x /= l.length, s.y /= l.length;
3208
3208
  }
3209
- function Ks(c, s) {
3210
- return bt(c) ? (console.warn(`${s} is not supported in OrthographicCamera`), !0) : !1;
3209
+ function Ks(l, s) {
3210
+ return bt(l) ? (console.warn(`${s} is not supported in OrthographicCamera`), !0) : !1;
3211
3211
  }
3212
3212
  class Fr {
3213
3213
  constructor() {
@@ -3274,7 +3274,7 @@ class Fr {
3274
3274
  }
3275
3275
  }
3276
3276
  const Or = "2.7.3", Es = 1 / 8, xn = typeof window < "u", gr = xn && /Mac/.test(navigator.platform), Sr = !(xn && "PointerEvent" in window);
3277
- let Y, an, ds, Js, lt, G, z, de, ye, gt, St, jt, cn, ln, dt, we, ue, hn, ti, En, ei, si, us;
3277
+ let Y, an, ds, Js, lt, G, z, de, ye, gt, St, jt, cn, ln, dt, we, Ie, hn, ti, En, ei, si, Is;
3278
3278
  class ot extends Fr {
3279
3279
  /**
3280
3280
  * Injects THREE as the dependency. You can then proceed to use CameraControls.
@@ -3317,7 +3317,7 @@ class ot extends Fr {
3317
3317
  * @category Statics
3318
3318
  */
3319
3319
  static install(s) {
3320
- Y = s.THREE, an = Object.freeze(new Y.Vector3(0, 0, 0)), ds = Object.freeze(new Y.Vector3(0, 1, 0)), Js = Object.freeze(new Y.Vector3(0, 0, 1)), lt = new Y.Vector2(), G = new Y.Vector3(), z = new Y.Vector3(), de = new Y.Vector3(), ye = new Y.Vector3(), gt = new Y.Vector3(), St = new Y.Vector3(), jt = new Y.Vector3(), cn = new Y.Vector3(), ln = new Y.Vector3(), dt = new Y.Spherical(), we = new Y.Spherical(), ue = new Y.Box3(), hn = new Y.Box3(), ti = new Y.Sphere(), En = new Y.Quaternion(), ei = new Y.Quaternion(), si = new Y.Matrix4(), us = new Y.Raycaster();
3320
+ Y = s.THREE, an = Object.freeze(new Y.Vector3(0, 0, 0)), ds = Object.freeze(new Y.Vector3(0, 1, 0)), Js = Object.freeze(new Y.Vector3(0, 0, 1)), lt = new Y.Vector2(), G = new Y.Vector3(), z = new Y.Vector3(), de = new Y.Vector3(), ye = new Y.Vector3(), gt = new Y.Vector3(), St = new Y.Vector3(), jt = new Y.Vector3(), cn = new Y.Vector3(), ln = new Y.Vector3(), dt = new Y.Spherical(), we = new Y.Spherical(), Ie = new Y.Box3(), hn = new Y.Box3(), ti = new Y.Sphere(), En = new Y.Quaternion(), ei = new Y.Quaternion(), si = new Y.Matrix4(), Is = new Y.Raycaster();
3321
3321
  }
3322
3322
  /**
3323
3323
  * list all ACTIONs
@@ -3425,7 +3425,7 @@ class ot extends Fr {
3425
3425
  deltaY: 0,
3426
3426
  mouseButton: (f.buttons & V.LEFT) === V.LEFT ? V.LEFT : (f.buttons & V.MIDDLE) === V.LEFT ? V.MIDDLE : (f.buttons & V.RIGHT) === V.LEFT ? V.RIGHT : null
3427
3427
  };
3428
- this._activePointers.push(O), this._domElement.ownerDocument.removeEventListener("mousemove", l), this._domElement.ownerDocument.removeEventListener("mouseup", d), this._domElement.ownerDocument.addEventListener("mousemove", l), this._domElement.ownerDocument.addEventListener("mouseup", d), this._isDragging = !0, A(f);
3428
+ 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, A(f);
3429
3429
  }, a = (f) => {
3430
3430
  f.cancelable && f.preventDefault();
3431
3431
  const m = f.pointerId, O = this._lockedPointer || this._findPointerById(m);
@@ -3446,7 +3446,7 @@ class ot extends Fr {
3446
3446
  (!this._isDragging && this._lockedPointer || this._isDragging && (f.buttons & V.LEFT) === V.LEFT) && (this._state = this._state | this.mouseButtons.left), this._isDragging && (f.buttons & V.MIDDLE) === V.MIDDLE && (this._state = this._state | this.mouseButtons.middle), this._isDragging && (f.buttons & V.RIGHT) === V.RIGHT && (this._state = this._state | this.mouseButtons.right);
3447
3447
  R();
3448
3448
  }
3449
- }, l = (f) => {
3449
+ }, c = (f) => {
3450
3450
  const m = this._lockedPointer || this._findPointerById(1);
3451
3451
  m && (m.clientX = f.clientX, m.clientY = f.clientY, m.deltaX = f.movementX, m.deltaY = f.movementY, this._state = 0, (this._lockedPointer || (f.buttons & V.LEFT) === V.LEFT) && (this._state = this._state | this.mouseButtons.left), (f.buttons & V.MIDDLE) === V.MIDDLE && (this._state = this._state | this.mouseButtons.middle), (f.buttons & V.RIGHT) === V.RIGHT && (this._state = this._state | this.mouseButtons.right), R());
3452
3452
  }, E = (f) => {
@@ -3476,7 +3476,7 @@ class ot extends Fr {
3476
3476
  f && f === this._lockedPointer || (f && this._disposePointer(f), this._state = P.NONE, C());
3477
3477
  };
3478
3478
  let h = -1;
3479
- const u = (f) => {
3479
+ const I = (f) => {
3480
3480
  if (!this._domElement || !this._enabled || this.mouseButtons.wheel === P.NONE)
3481
3481
  return;
3482
3482
  if (this._interactiveArea.left !== 0 || this._interactiveArea.top !== 0 || this._interactiveArea.width !== 1 || this._interactiveArea.height !== 1) {
@@ -3516,7 +3516,7 @@ class ot extends Fr {
3516
3516
  if (!(!this._domElement || !this._enabled)) {
3517
3517
  if (this.mouseButtons.right === ot.ACTION.NONE) {
3518
3518
  const m = f instanceof PointerEvent ? f.pointerId : (f instanceof MouseEvent, 0), O = this._findPointerById(m);
3519
- O && this._disposePointer(O), this._domElement.ownerDocument.removeEventListener("pointermove", a, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("pointerup", E), this._domElement.ownerDocument.removeEventListener("mousemove", l), this._domElement.ownerDocument.removeEventListener("mouseup", d);
3519
+ O && this._disposePointer(O), this._domElement.ownerDocument.removeEventListener("pointermove", a, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("pointerup", E), this._domElement.ownerDocument.removeEventListener("mousemove", c), this._domElement.ownerDocument.removeEventListener("mouseup", d);
3520
3520
  return;
3521
3521
  }
3522
3522
  f.preventDefault();
@@ -3564,7 +3564,7 @@ class ot extends Fr {
3564
3564
  }
3565
3565
  ((this._state & P.TRUCK) === P.TRUCK || (this._state & P.TOUCH_TRUCK) === P.TOUCH_TRUCK || (this._state & P.TOUCH_DOLLY_TRUCK) === P.TOUCH_DOLLY_TRUCK || (this._state & P.TOUCH_ZOOM_TRUCK) === P.TOUCH_ZOOM_TRUCK) && (this._truckInternal(O, S, !1), this._isUserControllingTruck = !0), ((this._state & P.OFFSET) === P.OFFSET || (this._state & P.TOUCH_OFFSET) === P.TOUCH_OFFSET || (this._state & P.TOUCH_DOLLY_OFFSET) === P.TOUCH_DOLLY_OFFSET || (this._state & P.TOUCH_ZOOM_OFFSET) === P.TOUCH_ZOOM_OFFSET) && (this._truckInternal(O, S, !0), this._isUserControllingOffset = !0), this.dispatchEvent({ type: "control" });
3566
3566
  }, C = () => {
3567
- $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", l), this._domElement.ownerDocument.removeEventListener("pointerup", E), this._domElement.ownerDocument.removeEventListener("mouseup", d), this.dispatchEvent({ type: "controlend" }));
3567
+ $s(this._activePointers, lt), i.copy(lt), this._dragNeedsUpdate = !1, (this._activePointers.length === 0 || this._activePointers.length === 1 && this._activePointers[0] === this._lockedPointer) && (this._isDragging = !1), this._activePointers.length === 0 && this._domElement && (this._domElement.ownerDocument.removeEventListener("pointermove", a, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("mousemove", c), this._domElement.ownerDocument.removeEventListener("pointerup", E), this._domElement.ownerDocument.removeEventListener("mouseup", d), this.dispatchEvent({ type: "controlend" }));
3568
3568
  };
3569
3569
  this.lockPointer = () => {
3570
3570
  !this._enabled || !this._domElement || (this.cancel(), this._lockedPointer = {
@@ -3584,9 +3584,9 @@ class ot extends Fr {
3584
3584
  this.unlockPointer();
3585
3585
  };
3586
3586
  this._addAllEventListeners = (f) => {
3587
- this._domElement = f, this._domElement.style.touchAction = "none", this._domElement.style.userSelect = "none", this._domElement.style.webkitUserSelect = "none", this._domElement.addEventListener("pointerdown", n), Sr && this._domElement.addEventListener("mousedown", r), this._domElement.addEventListener("pointercancel", E), this._domElement.addEventListener("wheel", u, { passive: !1 }), this._domElement.addEventListener("contextmenu", p);
3587
+ this._domElement = f, this._domElement.style.touchAction = "none", this._domElement.style.userSelect = "none", this._domElement.style.webkitUserSelect = "none", this._domElement.addEventListener("pointerdown", n), Sr && this._domElement.addEventListener("mousedown", r), this._domElement.addEventListener("pointercancel", E), this._domElement.addEventListener("wheel", I, { passive: !1 }), this._domElement.addEventListener("contextmenu", p);
3588
3588
  }, this._removeAllEventListeners = () => {
3589
- this._domElement && (this._domElement.style.touchAction = "", this._domElement.style.userSelect = "", this._domElement.style.webkitUserSelect = "", this._domElement.removeEventListener("pointerdown", n), this._domElement.removeEventListener("mousedown", r), this._domElement.removeEventListener("pointercancel", E), this._domElement.removeEventListener("wheel", u, { passive: !1 }), this._domElement.removeEventListener("contextmenu", p), this._domElement.ownerDocument.removeEventListener("pointermove", a, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("mousemove", l), this._domElement.ownerDocument.removeEventListener("pointerup", E), this._domElement.ownerDocument.removeEventListener("mouseup", d), this._domElement.ownerDocument.removeEventListener("pointerlockchange", T), this._domElement.ownerDocument.removeEventListener("pointerlockerror", F));
3589
+ this._domElement && (this._domElement.style.touchAction = "", this._domElement.style.userSelect = "", this._domElement.style.webkitUserSelect = "", this._domElement.removeEventListener("pointerdown", n), this._domElement.removeEventListener("mousedown", r), this._domElement.removeEventListener("pointercancel", E), this._domElement.removeEventListener("wheel", I, { passive: !1 }), this._domElement.removeEventListener("contextmenu", p), this._domElement.ownerDocument.removeEventListener("pointermove", a, { passive: !1 }), this._domElement.ownerDocument.removeEventListener("mousemove", c), this._domElement.ownerDocument.removeEventListener("pointerup", E), this._domElement.ownerDocument.removeEventListener("mouseup", d), this._domElement.ownerDocument.removeEventListener("pointerlockchange", T), this._domElement.ownerDocument.removeEventListener("pointerlockerror", F));
3590
3590
  }, this.cancel = () => {
3591
3591
  this._state !== P.NONE && (this._state = P.NONE, this._activePointers.length = 0, C());
3592
3592
  }, t && this.connect(t), this.update(0);
@@ -3951,15 +3951,15 @@ class ot extends Fr {
3951
3951
  * @category Methods
3952
3952
  */
3953
3953
  fitToBox(s, t, { cover: e = !1, paddingLeft: i = 0, paddingRight: o = 0, paddingBottom: n = 0, paddingTop: r = 0 } = {}) {
3954
- const a = [], l = s.isBox3 ? ue.copy(s) : ue.setFromObject(s);
3955
- l.isEmpty() && (console.warn("camera-controls: fitTo() cannot be used with an empty box. Aborting"), Promise.resolve());
3954
+ const a = [], c = s.isBox3 ? Ie.copy(s) : Ie.setFromObject(s);
3955
+ c.isEmpty() && (console.warn("camera-controls: fitTo() cannot be used with an empty box. Aborting"), Promise.resolve());
3956
3956
  const E = on(this._sphericalEnd.theta, nn), d = on(this._sphericalEnd.phi, nn);
3957
3957
  a.push(this.rotateTo(E, d, t));
3958
- const h = G.setFromSpherical(this._sphericalEnd).normalize(), u = En.setFromUnitVectors(h, Js), p = k(Math.abs(h.y), 1);
3959
- p && u.multiply(ei.setFromAxisAngle(ds, E)), u.multiply(this._yAxisUpSpaceInverse);
3958
+ const h = G.setFromSpherical(this._sphericalEnd).normalize(), I = En.setFromUnitVectors(h, Js), p = k(Math.abs(h.y), 1);
3959
+ p && I.multiply(ei.setFromAxisAngle(ds, E)), I.multiply(this._yAxisUpSpaceInverse);
3960
3960
  const A = hn.makeEmpty();
3961
- z.copy(l.min).applyQuaternion(u), A.expandByPoint(z), z.copy(l.min).setX(l.max.x).applyQuaternion(u), A.expandByPoint(z), z.copy(l.min).setY(l.max.y).applyQuaternion(u), A.expandByPoint(z), z.copy(l.max).setZ(l.min.z).applyQuaternion(u), A.expandByPoint(z), z.copy(l.min).setZ(l.max.z).applyQuaternion(u), A.expandByPoint(z), z.copy(l.max).setY(l.min.y).applyQuaternion(u), A.expandByPoint(z), z.copy(l.max).setX(l.min.x).applyQuaternion(u), A.expandByPoint(z), z.copy(l.max).applyQuaternion(u), A.expandByPoint(z), A.min.x -= i, A.min.y -= n, A.max.x += o, A.max.y += r, u.setFromUnitVectors(Js, h), p && u.premultiply(ei.invert()), u.premultiply(this._yAxisUpSpace);
3962
- const R = A.getSize(G), C = A.getCenter(z).applyQuaternion(u);
3961
+ z.copy(c.min).applyQuaternion(I), A.expandByPoint(z), z.copy(c.min).setX(c.max.x).applyQuaternion(I), A.expandByPoint(z), z.copy(c.min).setY(c.max.y).applyQuaternion(I), A.expandByPoint(z), z.copy(c.max).setZ(c.min.z).applyQuaternion(I), A.expandByPoint(z), z.copy(c.min).setZ(c.max.z).applyQuaternion(I), A.expandByPoint(z), z.copy(c.max).setY(c.min.y).applyQuaternion(I), A.expandByPoint(z), z.copy(c.max).setX(c.min.x).applyQuaternion(I), A.expandByPoint(z), z.copy(c.max).applyQuaternion(I), A.expandByPoint(z), A.min.x -= i, A.min.y -= n, A.max.x += o, A.max.y += r, I.setFromUnitVectors(Js, h), p && I.premultiply(ei.invert()), I.premultiply(this._yAxisUpSpace);
3962
+ const R = A.getSize(G), C = A.getCenter(z).applyQuaternion(I);
3963
3963
  if (Qt(this._camera)) {
3964
3964
  const T = this.getDistanceToFitBox(R.x, R.y, R.z, e);
3965
3965
  a.push(this.moveTo(C.x, C.y, C.z, t)), a.push(this.dollyTo(T, t)), a.push(this.setFocalOffset(0, 0, 0, t));
@@ -3981,8 +3981,8 @@ class ot extends Fr {
3981
3981
  const n = this.getDistanceToFitSphere(o.radius);
3982
3982
  e.push(this.dollyTo(n, t));
3983
3983
  } else if (bt(this._camera)) {
3984
- const n = this._camera.right - this._camera.left, r = this._camera.top - this._camera.bottom, a = 2 * o.radius, l = Math.min(n / a, r / a);
3985
- e.push(this.zoomTo(l, t));
3984
+ const n = this._camera.right - this._camera.left, r = this._camera.top - this._camera.bottom, a = 2 * o.radius, c = Math.min(n / a, r / a);
3985
+ e.push(this.zoomTo(c, t));
3986
3986
  }
3987
3987
  return e.push(this.setFocalOffset(0, 0, 0, t)), Promise.all(e);
3988
3988
  }
@@ -3999,8 +3999,8 @@ class ot extends Fr {
3999
3999
  */
4000
4000
  setLookAt(s, t, e, i, o, n, r = !1) {
4001
4001
  this._isUserControllingRotate = !1, this._isUserControllingDolly = !1, this._isUserControllingTruck = !1, this._lastDollyDirection = he.NONE, this._changedDolly = 0;
4002
- const a = z.set(i, o, n), l = G.set(s, t, e);
4003
- this._targetEnd.copy(a), this._sphericalEnd.setFromVector3(l.sub(a).applyQuaternion(this._yAxisUpSpace)), this.normalizeRotations(), this._needsUpdate = !0, r || (this._target.copy(this._targetEnd), this._spherical.copy(this._sphericalEnd));
4002
+ const a = z.set(i, o, n), c = G.set(s, t, e);
4003
+ this._targetEnd.copy(a), this._sphericalEnd.setFromVector3(c.sub(a).applyQuaternion(this._yAxisUpSpace)), this.normalizeRotations(), this._needsUpdate = !0, r || (this._target.copy(this._targetEnd), this._spherical.copy(this._sphericalEnd));
4004
4004
  const E = !r || 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);
4005
4005
  return this._createOnRestPromise(E);
4006
4006
  }
@@ -4022,14 +4022,14 @@ class ot extends Fr {
4022
4022
  * @param enableTransition
4023
4023
  * @category Methods
4024
4024
  */
4025
- lerpLookAt(s, t, e, i, o, n, r, a, l, E, d, h, u, p = !1) {
4025
+ lerpLookAt(s, t, e, i, o, n, r, a, c, E, d, h, I, p = !1) {
4026
4026
  this._isUserControllingRotate = !1, this._isUserControllingDolly = !1, this._isUserControllingTruck = !1, this._lastDollyDirection = he.NONE, this._changedDolly = 0;
4027
4027
  const A = G.set(i, o, n), R = z.set(s, t, e);
4028
4028
  dt.setFromVector3(R.sub(A).applyQuaternion(this._yAxisUpSpace));
4029
- const C = de.set(E, d, h), T = z.set(r, a, l);
4030
- we.setFromVector3(T.sub(C).applyQuaternion(this._yAxisUpSpace)), this._targetEnd.copy(A.lerp(C, u));
4029
+ const C = de.set(E, d, h), T = z.set(r, a, c);
4030
+ we.setFromVector3(T.sub(C).applyQuaternion(this._yAxisUpSpace)), this._targetEnd.copy(A.lerp(C, I));
4031
4031
  const F = we.theta - dt.theta, f = we.phi - dt.phi, m = we.radius - dt.radius;
4032
- this._sphericalEnd.set(dt.radius + m * u, dt.phi + f * u, dt.theta + F * u), this.normalizeRotations(), this._needsUpdate = !0, p || (this._target.copy(this._targetEnd), this._spherical.copy(this._sphericalEnd));
4032
+ this._sphericalEnd.set(dt.radius + m * I, dt.phi + f * I, dt.theta + F * I), this.normalizeRotations(), this._needsUpdate = !0, p || (this._target.copy(this._targetEnd), this._spherical.copy(this._sphericalEnd));
4033
4033
  const O = !p || 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);
4034
4034
  return this._createOnRestPromise(O);
4035
4035
  }
@@ -4272,19 +4272,19 @@ class ot extends Fr {
4272
4272
  }
4273
4273
  if (this.dollyToCursor) {
4274
4274
  if (Qt(this._camera) && this._changedDolly !== 0) {
4275
- const d = this._spherical.radius - this._lastDistance, h = this._camera, u = this._getCameraDirection(ye), p = G.copy(u).cross(h.up).normalize();
4275
+ const d = this._spherical.radius - this._lastDistance, h = this._camera, I = this._getCameraDirection(ye), p = G.copy(I).cross(h.up).normalize();
4276
4276
  p.lengthSq() === 0 && (p.x = 1);
4277
- const A = z.crossVectors(p, u), R = this._sphericalEnd.radius * Math.tan(h.getEffectiveFOV() * Ne * 0.5), T = (this._sphericalEnd.radius - d - this._sphericalEnd.radius) / this._sphericalEnd.radius, F = de.copy(this._targetEnd).add(p.multiplyScalar(this._dollyControlCoord.x * R * h.aspect)).add(A.multiplyScalar(this._dollyControlCoord.y * R)), f = G.copy(this._targetEnd).lerp(F, T), m = this._lastDollyDirection === he.IN && this._spherical.radius <= this.minDistance, O = this._lastDollyDirection === he.OUT && this.maxDistance <= this._spherical.radius;
4277
+ const A = z.crossVectors(p, I), R = this._sphericalEnd.radius * Math.tan(h.getEffectiveFOV() * Ne * 0.5), T = (this._sphericalEnd.radius - d - this._sphericalEnd.radius) / this._sphericalEnd.radius, F = de.copy(this._targetEnd).add(p.multiplyScalar(this._dollyControlCoord.x * R * h.aspect)).add(A.multiplyScalar(this._dollyControlCoord.y * R)), f = G.copy(this._targetEnd).lerp(F, T), m = this._lastDollyDirection === he.IN && this._spherical.radius <= this.minDistance, O = this._lastDollyDirection === he.OUT && this.maxDistance <= this._spherical.radius;
4278
4278
  if (this.infinityDolly && (m || O)) {
4279
4279
  this._sphericalEnd.radius -= d, this._spherical.radius -= d;
4280
- const _ = z.copy(u).multiplyScalar(-d);
4280
+ const _ = z.copy(I).multiplyScalar(-d);
4281
4281
  f.add(_);
4282
4282
  }
4283
4283
  this._boundary.clampPoint(f, f);
4284
4284
  const S = z.subVectors(f, this._targetEnd);
4285
4285
  this._targetEnd.copy(f), this._target.add(S), this._changedDolly -= d, X(this._changedDolly) && (this._changedDolly = 0);
4286
4286
  } else if (bt(this._camera) && this._changedZoom !== 0) {
4287
- const d = this._zoom - this._lastZoom, h = this._camera, u = G.set(this._dollyControlCoord.x, this._dollyControlCoord.y, (h.near + h.far) / (h.near - h.far)).unproject(h), p = z.set(0, 0, -1).applyQuaternion(h.quaternion), A = de.copy(u).add(p.multiplyScalar(-u.dot(h.up))), C = -(this._zoom - d - this._zoom) / this._zoom, T = this._getCameraDirection(ye), F = this._targetEnd.dot(T), f = G.copy(this._targetEnd).lerp(A, C), m = f.dot(T), O = T.multiplyScalar(m - F);
4287
+ const d = this._zoom - this._lastZoom, h = this._camera, I = G.set(this._dollyControlCoord.x, this._dollyControlCoord.y, (h.near + h.far) / (h.near - h.far)).unproject(h), p = z.set(0, 0, -1).applyQuaternion(h.quaternion), A = de.copy(I).add(p.multiplyScalar(-I.dot(h.up))), C = -(this._zoom - d - this._zoom) / this._zoom, T = this._getCameraDirection(ye), F = this._targetEnd.dot(T), f = G.copy(this._targetEnd).lerp(A, C), m = f.dot(T), O = T.multiplyScalar(m - F);
4288
4288
  f.sub(O), this._boundary.clampPoint(f, f);
4289
4289
  const S = z.subVectors(f, this._targetEnd);
4290
4290
  this._targetEnd.copy(f), this._target.add(S), this._changedZoom -= d, X(this._changedZoom) && (this._changedZoom = 0);
@@ -4390,8 +4390,8 @@ class ot extends Fr {
4390
4390
  if (e === 0)
4391
4391
  return s.add(t).add(r);
4392
4392
  {
4393
- const l = 1 + e * a / t.dot(r);
4394
- return s.add(z.copy(t).multiplyScalar(l)).add(r.multiplyScalar(1 - e));
4393
+ const c = 1 + e * a / t.dot(r);
4394
+ return s.add(z.copy(t).multiplyScalar(c)).add(r.multiplyScalar(1 - e));
4395
4395
  }
4396
4396
  }
4397
4397
  _updateNearPlaneCorners() {
@@ -4414,8 +4414,8 @@ class ot extends Fr {
4414
4414
  const o = z.copy(this._nearPlaneCorners[i]);
4415
4415
  o.applyMatrix4(si);
4416
4416
  const n = de.addVectors(this._target, o);
4417
- us.set(n, e), us.far = this._spherical.radius + 1;
4418
- const r = us.intersectObjects(this.colliderMeshes);
4417
+ Is.set(n, e), Is.far = this._spherical.radius + 1;
4418
+ const r = Is.intersectObjects(this.colliderMeshes);
4419
4419
  r.length !== 0 && r[0].distance < s && (s = r[0].distance);
4420
4420
  }
4421
4421
  return s;
@@ -4476,9 +4476,9 @@ class ot extends Fr {
4476
4476
  }
4477
4477
  static createBoundingSphere(s, t = new Y.Sphere()) {
4478
4478
  const e = t, i = e.center;
4479
- ue.makeEmpty(), s.traverseVisible((n) => {
4480
- n.isMesh && ue.expandByObject(n);
4481
- }), ue.getCenter(i);
4479
+ Ie.makeEmpty(), s.traverseVisible((n) => {
4480
+ n.isMesh && Ie.expandByObject(n);
4481
+ }), Ie.getCenter(i);
4482
4482
  let o = 0;
4483
4483
  return s.traverseVisible((n) => {
4484
4484
  if (!n.isMesh)
@@ -4495,23 +4495,29 @@ class ke extends rr {
4495
4495
  constructor(t) {
4496
4496
  super(t);
4497
4497
  /** {@link Updateable.onBeforeUpdate} */
4498
- I(this, "onBeforeUpdate", new U());
4498
+ u(this, "onBeforeUpdate", new U());
4499
4499
  /** {@link Updateable.onAfterUpdate} */
4500
- I(this, "onAfterUpdate", new U());
4501
- I(this, "onAspectUpdated", new U());
4500
+ u(this, "onAfterUpdate", new U());
4501
+ u(this, "onAspectUpdated", new U());
4502
4502
  /** {@link Disposable.onDisposed} */
4503
- I(this, "onDisposed", new U());
4504
- I(this, "three");
4505
- I(this, "_allControls", /* @__PURE__ */ new Map());
4503
+ u(this, "onDisposed", new U());
4504
+ u(this, "three");
4505
+ u(this, "_allControls", /* @__PURE__ */ new Map());
4506
4506
  /**
4507
4507
  * Updates the aspect of the camera to match the size of the
4508
4508
  * {@link Components.renderer}.
4509
4509
  */
4510
- I(this, "updateAspect", () => {
4510
+ u(this, "updateAspect", () => {
4511
4511
  var t;
4512
- if (!(!this.currentWorld || !this.currentWorld.renderer) && !(this.three instanceof g.OrthographicCamera) && (t = this.currentWorld.renderer) != null && t.isResizeable()) {
4513
- const e = this.currentWorld.renderer.getSize();
4514
- this.three.aspect = e.width / e.height, this.three.updateProjectionMatrix(), this.onAspectUpdated.trigger();
4512
+ if (!(!this.currentWorld || !this.currentWorld.renderer)) {
4513
+ if (this.three instanceof g.OrthographicCamera) {
4514
+ this.onAspectUpdated.trigger();
4515
+ return;
4516
+ }
4517
+ if ((t = this.currentWorld.renderer) != null && t.isResizeable()) {
4518
+ const e = this.currentWorld.renderer.getSize();
4519
+ this.three.aspect = e.width / e.height, this.three.updateProjectionMatrix(), this.onAspectUpdated.trigger();
4520
+ }
4515
4521
  }
4516
4522
  });
4517
4523
  this.three = this.setupCamera(), this.setupEvents(!0), this.onWorldChanged.add(({ action: e, world: i }) => {
@@ -4592,13 +4598,44 @@ class ke extends rr {
4592
4598
  const gs = class gs extends J {
4593
4599
  constructor(t) {
4594
4600
  super(t);
4595
- I(this, "onAfterUpdate", new U());
4596
- I(this, "onBeforeUpdate", new U());
4597
- I(this, "onDisposed", new U());
4598
- I(this, "list", /* @__PURE__ */ new Map());
4599
- I(this, "enabled", !0);
4601
+ /**
4602
+ * Event triggered after the update process of all worlds.
4603
+ * Subscribers can listen to this event to perform actions post-update.
4604
+ */
4605
+ u(this, "onAfterUpdate", new U());
4606
+ /**
4607
+ * Event triggered before the update process of all worlds.
4608
+ * Subscribers can listen to this event to perform actions pre-update.
4609
+ */
4610
+ u(this, "onBeforeUpdate", new U());
4611
+ /**
4612
+ * Event triggered when the Worlds component is disposed.
4613
+ * Subscribers can listen to this event to perform cleanup actions.
4614
+ */
4615
+ u(this, "onDisposed", new U());
4616
+ /**
4617
+ * A collection of worlds managed by this component.
4618
+ * The key is the unique identifier (UUID) of the world, and the value is the World instance.
4619
+ */
4620
+ u(this, "list", /* @__PURE__ */ new Map());
4621
+ /**
4622
+ * A flag indicating whether the Worlds component is enabled.
4623
+ * If false, the update process will be skipped.
4624
+ */
4625
+ u(this, "enabled", !0);
4600
4626
  t.add(gs.uuid, this);
4601
4627
  }
4628
+ /**
4629
+ * Creates a new instance of a SimpleWorld and adds it to the list of worlds.
4630
+ *
4631
+ * @template T - The type of the scene, extending from BaseScene. Defaults to BaseScene.
4632
+ * @template U - The type of the camera, extending from BaseCamera. Defaults to BaseCamera.
4633
+ * @template S - The type of the renderer, extending from BaseRenderer. Defaults to BaseRenderer.
4634
+ *
4635
+ * @returns {SimpleWorld<T, U, S>} - The newly created SimpleWorld instance.
4636
+ *
4637
+ * @throws {Error} - Throws an error if a world with the same UUID already exists in the list.
4638
+ */
4602
4639
  create() {
4603
4640
  const t = new Ar(this.components), e = t.uuid;
4604
4641
  if (this.list.has(e))
@@ -4620,23 +4657,27 @@ const gs = class gs extends J {
4620
4657
  i.update(t);
4621
4658
  }
4622
4659
  };
4623
- I(gs, "uuid", "fdb61dc4-2ec1-4966-b83d-54ea795fad4a");
4660
+ /**
4661
+ * A unique identifier for the component.
4662
+ * This UUID is used to register the component within the Components system.
4663
+ */
4664
+ u(gs, "uuid", "fdb61dc4-2ec1-4966-b83d-54ea795fad4a");
4624
4665
  let pi = gs;
4625
4666
  class _r {
4626
4667
  constructor(s, t, e) {
4627
4668
  /** {@link Disposable.onDisposed} */
4628
- I(this, "onDisposed", new U());
4629
- I(this, "world");
4630
- I(this, "components");
4631
- I(this, "three");
4632
- I(this, "_fade", 3);
4633
- I(this, "updateZoom", () => {
4669
+ u(this, "onDisposed", new U());
4670
+ u(this, "world");
4671
+ u(this, "components");
4672
+ u(this, "three");
4673
+ u(this, "_fade", 3);
4674
+ u(this, "updateZoom", () => {
4634
4675
  this.world.camera instanceof ke && (this.material.uniforms.uZoom.value = this.world.camera.three.zoom);
4635
4676
  });
4636
4677
  this.world = t;
4637
4678
  const { color: i, size1: o, size2: n, distance: r } = e;
4638
4679
  this.components = s;
4639
- const a = new g.PlaneGeometry(2, 2, 1, 1), l = new g.ShaderMaterial({
4680
+ const a = new g.PlaneGeometry(2, 2, 1, 1), c = new g.ShaderMaterial({
4640
4681
  side: g.DoubleSide,
4641
4682
  uniforms: {
4642
4683
  uSize1: {
@@ -4726,7 +4767,7 @@ class _r {
4726
4767
  derivatives: !0
4727
4768
  }
4728
4769
  });
4729
- this.three = new g.Mesh(a, l), this.three.frustumCulled = !1, t.scene.three.add(this.three), this.setupEvents(!0);
4770
+ this.three = new g.Mesh(a, c), this.three.frustumCulled = !1, t.scene.three.add(this.three), this.setupEvents(!0);
4730
4771
  }
4731
4772
  /** {@link Hideable.visible} */
4732
4773
  get visible() {
@@ -4771,16 +4812,16 @@ class _r {
4771
4812
  class Nr extends J {
4772
4813
  constructor() {
4773
4814
  super(...arguments);
4774
- I(this, "list", /* @__PURE__ */ new Map());
4775
- I(this, "onDisposed", new U());
4776
- I(this, "config", {
4815
+ u(this, "list", /* @__PURE__ */ new Map());
4816
+ u(this, "onDisposed", new U());
4817
+ u(this, "config", {
4777
4818
  color: new g.Color(12303291),
4778
4819
  size1: 1,
4779
4820
  size2: 10,
4780
4821
  distance: 500
4781
4822
  });
4782
4823
  /** {@link Component.enabled} */
4783
- I(this, "enabled", !0);
4824
+ u(this, "enabled", !0);
4784
4825
  }
4785
4826
  create(t) {
4786
4827
  if (this.list.has(t.uuid))
@@ -4800,12 +4841,12 @@ class Nr extends J {
4800
4841
  this.list.clear(), this.onDisposed.trigger();
4801
4842
  }
4802
4843
  }
4803
- I(Nr, "uuid", "d1e814d5-b81c-4452-87a2-f039375e0489");
4844
+ u(Nr, "uuid", "d1e814d5-b81c-4452-87a2-f039375e0489");
4804
4845
  const qt = new Qn(), nt = new w(), xt = new w(), j = new Pt(), dn = {
4805
4846
  X: new w(1, 0, 0),
4806
4847
  Y: new w(0, 1, 0),
4807
4848
  Z: new w(0, 0, 1)
4808
- }, ii = { type: "change" }, un = { type: "mouseDown" }, In = { type: "mouseUp", mode: null }, fn = { type: "objectChange" };
4849
+ }, ii = { type: "change" }, In = { type: "mouseDown" }, un = { type: "mouseUp", mode: null }, fn = { type: "objectChange" };
4809
4850
  class Pr extends oi {
4810
4851
  constructor(s, t) {
4811
4852
  super(), t === void 0 && (console.warn('THREE.TransformControls: The second parameter "domElement" is now mandatory.'), t = document), this.isTransformControls = !0, this.visible = !1, this.domElement = t, this.domElement.style.touchAction = "none";
@@ -4826,8 +4867,8 @@ class Pr extends oi {
4826
4867
  }), o[T] = F, i[T] = F, e[T] = F;
4827
4868
  }
4828
4869
  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);
4829
- const r = new w(), a = new w(), l = new Pt(), E = new Pt(), d = new w(), h = new Pt(), u = new w(), p = new w(), A = new w(), R = 0, C = new w();
4830
- n("worldPosition", r), n("worldPositionStart", a), n("worldQuaternion", l), n("worldQuaternionStart", E), n("cameraPosition", d), n("cameraQuaternion", h), n("pointStart", u), n("pointEnd", p), n("rotationAxis", A), n("rotationAngle", R), n("eye", C), this._offset = new w(), this._startNorm = new w(), this._endNorm = new w(), this._cameraScale = new w(), this._parentPosition = new w(), this._parentQuaternion = new Pt(), this._parentQuaternionInv = new Pt(), this._parentScale = new w(), this._worldScaleStart = new w(), this._worldQuaternionInv = new Pt(), this._worldScale = new w(), this._positionStart = new w(), this._quaternionStart = new Pt(), this._scaleStart = new w(), this._getPointer = Lr.bind(this), this._onPointerDown = wr.bind(this), this._onPointerHover = yr.bind(this), this._onPointerMove = Mr.bind(this), this._onPointerUp = Dr.bind(this), this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointermove", this._onPointerHover), this.domElement.addEventListener("pointerup", this._onPointerUp);
4870
+ const r = new w(), a = new w(), c = new Pt(), E = new Pt(), d = new w(), h = new Pt(), I = new w(), p = new w(), A = new w(), R = 0, C = new w();
4871
+ n("worldPosition", r), n("worldPositionStart", a), n("worldQuaternion", c), n("worldQuaternionStart", E), n("cameraPosition", d), n("cameraQuaternion", h), n("pointStart", I), n("pointEnd", p), n("rotationAxis", A), n("rotationAngle", R), n("eye", C), this._offset = new w(), this._startNorm = new w(), this._endNorm = new w(), this._cameraScale = new w(), this._parentPosition = new w(), this._parentQuaternion = new Pt(), this._parentQuaternionInv = new Pt(), this._parentScale = new w(), this._worldScaleStart = new w(), this._worldQuaternionInv = new Pt(), this._worldScale = new w(), this._positionStart = new w(), this._quaternionStart = new Pt(), this._scaleStart = new w(), this._getPointer = Lr.bind(this), this._onPointerDown = wr.bind(this), this._onPointerHover = yr.bind(this), this._onPointerMove = Mr.bind(this), this._onPointerUp = Dr.bind(this), this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointermove", this._onPointerHover), this.domElement.addEventListener("pointerup", this._onPointerUp);
4831
4872
  }
4832
4873
  // updateMatrixWorld updates key transformation variables
4833
4874
  updateMatrixWorld() {
@@ -4844,7 +4885,7 @@ class Pr extends oi {
4844
4885
  if (!(this.object === void 0 || this.dragging === !0 || s.button !== 0) && this.axis !== null) {
4845
4886
  qt.setFromCamera(s, this.camera);
4846
4887
  const t = ni(this._plane, qt, !0);
4847
- t && (this.object.updateMatrixWorld(), this.object.parent.updateMatrixWorld(), this._positionStart.copy(this.object.position), this._quaternionStart.copy(this.object.quaternion), this._scaleStart.copy(this.object.scale), this.object.matrixWorld.decompose(this.worldPositionStart, this.worldQuaternionStart, this._worldScaleStart), this.pointStart.copy(t.point).sub(this.worldPositionStart)), this.dragging = !0, un.mode = this.mode, this.dispatchEvent(un);
4888
+ t && (this.object.updateMatrixWorld(), this.object.parent.updateMatrixWorld(), this._positionStart.copy(this.object.position), this._quaternionStart.copy(this.object.quaternion), this._scaleStart.copy(this.object.scale), this.object.matrixWorld.decompose(this.worldPositionStart, this.worldQuaternionStart, this._worldScaleStart), this.pointStart.copy(t.point).sub(this.worldPositionStart)), this.dragging = !0, In.mode = this.mode, this.dispatchEvent(In);
4848
4889
  }
4849
4890
  }
4850
4891
  pointerMove(s) {
@@ -4874,7 +4915,7 @@ class Pr extends oi {
4874
4915
  }
4875
4916
  }
4876
4917
  pointerUp(s) {
4877
- s.button === 0 && (this.dragging && this.axis !== null && (In.mode = this.mode, this.dispatchEvent(In)), this.dragging = !1, this.axis = null);
4918
+ s.button === 0 && (this.dragging && this.axis !== null && (un.mode = this.mode, this.dispatchEvent(un)), this.dragging = !1, this.axis = null);
4878
4919
  }
4879
4920
  dispose() {
4880
4921
  this.domElement.removeEventListener("pointerdown", this._onPointerDown), this.domElement.removeEventListener("pointermove", this._onPointerHover), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.traverse(function(s) {
@@ -4918,48 +4959,48 @@ class Pr extends oi {
4918
4959
  this.space = s;
4919
4960
  }
4920
4961
  }
4921
- function Lr(c) {
4962
+ function Lr(l) {
4922
4963
  if (this.domElement.ownerDocument.pointerLockElement)
4923
4964
  return {
4924
4965
  x: 0,
4925
4966
  y: 0,
4926
- button: c.button
4967
+ button: l.button
4927
4968
  };
4928
4969
  {
4929
4970
  const s = this.domElement.getBoundingClientRect();
4930
4971
  return {
4931
- x: (c.clientX - s.left) / s.width * 2 - 1,
4932
- y: -(c.clientY - s.top) / s.height * 2 + 1,
4933
- button: c.button
4972
+ x: (l.clientX - s.left) / s.width * 2 - 1,
4973
+ y: -(l.clientY - s.top) / s.height * 2 + 1,
4974
+ button: l.button
4934
4975
  };
4935
4976
  }
4936
4977
  }
4937
- function yr(c) {
4978
+ function yr(l) {
4938
4979
  if (this.enabled)
4939
- switch (c.pointerType) {
4980
+ switch (l.pointerType) {
4940
4981
  case "mouse":
4941
4982
  case "pen":
4942
- this.pointerHover(this._getPointer(c));
4983
+ this.pointerHover(this._getPointer(l));
4943
4984
  break;
4944
4985
  }
4945
4986
  }
4946
- function wr(c) {
4947
- this.enabled && (document.pointerLockElement || this.domElement.setPointerCapture(c.pointerId), this.domElement.addEventListener("pointermove", this._onPointerMove), this.pointerHover(this._getPointer(c)), this.pointerDown(this._getPointer(c)));
4987
+ function wr(l) {
4988
+ this.enabled && (document.pointerLockElement || this.domElement.setPointerCapture(l.pointerId), this.domElement.addEventListener("pointermove", this._onPointerMove), this.pointerHover(this._getPointer(l)), this.pointerDown(this._getPointer(l)));
4948
4989
  }
4949
- function Mr(c) {
4950
- this.enabled && this.pointerMove(this._getPointer(c));
4990
+ function Mr(l) {
4991
+ this.enabled && this.pointerMove(this._getPointer(l));
4951
4992
  }
4952
- function Dr(c) {
4953
- this.enabled && (this.domElement.releasePointerCapture(c.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.pointerUp(this._getPointer(c)));
4993
+ function Dr(l) {
4994
+ this.enabled && (this.domElement.releasePointerCapture(l.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.pointerUp(this._getPointer(l)));
4954
4995
  }
4955
- function ni(c, s, t) {
4956
- const e = s.intersectObject(c, !0);
4996
+ function ni(l, s, t) {
4997
+ const e = s.intersectObject(l, !0);
4957
4998
  for (let i = 0; i < e.length; i++)
4958
4999
  if (e[i].object.visible || t)
4959
5000
  return e[i];
4960
5001
  return !1;
4961
5002
  }
4962
- const Is = new jn(), W = new w(0, 1, 0), pn = new w(0, 0, 0), Cn = new yt(), fs = new Pt(), ms = new Pt(), _t = new w(), Tn = new yt(), Ue = new w(1, 0, 0), $t = new w(0, 1, 0), xe = new w(0, 0, 1), ps = new w(), Me = new w(), De = new w();
5003
+ const us = new jn(), W = new w(0, 1, 0), pn = new w(0, 0, 0), Cn = new yt(), fs = new Pt(), ms = new Pt(), _t = new w(), Tn = new yt(), Ue = new w(1, 0, 0), $t = new w(0, 1, 0), xe = new w(0, 0, 1), ps = new w(), Me = new w(), De = new w();
4963
5004
  class Ur extends oi {
4964
5005
  constructor() {
4965
5006
  super(), this.isTransformControlsGizmo = !0, this.type = "TransformControlsGizmo";
@@ -4987,8 +5028,8 @@ class Ur extends oi {
4987
5028
  r.color.setHex(255);
4988
5029
  const a = s.clone();
4989
5030
  a.color.setHex(16711680), a.opacity = 0.5;
4990
- const l = s.clone();
4991
- l.color.setHex(65280), l.opacity = 0.5;
5031
+ const c = s.clone();
5032
+ c.color.setHex(65280), c.opacity = 0.5;
4992
5033
  const E = s.clone();
4993
5034
  E.color.setHex(255), E.opacity = 0.5;
4994
5035
  const d = s.clone();
@@ -5039,7 +5080,7 @@ class Ur extends oi {
5039
5080
  [new v(new rt(0.15, 0.15, 0.01), a.clone()), [0, 0.15, 0.15], [0, Math.PI / 2, 0]]
5040
5081
  ],
5041
5082
  XZ: [
5042
- [new v(new rt(0.15, 0.15, 0.01), l.clone()), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
5083
+ [new v(new rt(0.15, 0.15, 0.01), c.clone()), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
5043
5084
  ]
5044
5085
  }, O = {
5045
5086
  X: [
@@ -5144,7 +5185,7 @@ class Ur extends oi {
5144
5185
  [new v(new rt(0.15, 0.15, 0.01), a), [0, 0.15, 0.15], [0, Math.PI / 2, 0]]
5145
5186
  ],
5146
5187
  XZ: [
5147
- [new v(new rt(0.15, 0.15, 0.01), l), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
5188
+ [new v(new rt(0.15, 0.15, 0.01), c), [0.15, 0, 0.15], [-Math.PI / 2, 0, 0]]
5148
5189
  ],
5149
5190
  XYZ: [
5150
5191
  [new v(new rt(0.1, 0.1, 0.1), d.clone())]
@@ -5209,7 +5250,7 @@ class Ur extends oi {
5209
5250
  n.visible = !0, n.rotation.set(0, 0, 0), n.position.copy(this.worldPosition);
5210
5251
  let r;
5211
5252
  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") {
5212
- 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($t).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(Cn.lookAt(pn, W, $t)), n.quaternion.multiply(j), n.visible = this.dragging), this.axis === "E" && (n.visible = !1)) : n.name === "START" ? (n.position.copy(this.worldPositionStart), n.visible = this.dragging) : n.name === "END" ? (n.position.copy(this.worldPosition), n.visible = this.dragging) : n.name === "DELTA" ? (n.position.copy(this.worldPositionStart), n.quaternion.copy(this.worldQuaternionStart), nt.set(1e-10, 1e-10, 1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1), nt.applyQuaternion(this.worldQuaternionStart.clone().invert()), n.scale.copy(nt), n.visible = this.dragging) : (n.quaternion.copy(e), this.dragging ? n.position.copy(this.worldPositionStart) : n.position.copy(this.worldPosition), this.axis && (n.visible = this.axis.search(n.name) !== -1));
5253
+ n.visible = !1, n.name === "AXIS" ? (n.visible = !!this.axis, this.axis === "X" && (j.setFromEuler(us.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(us.set(0, 0, Math.PI / 2)), n.quaternion.copy(e).multiply(j), Math.abs(W.copy($t).applyQuaternion(e).dot(this.eye)) > 0.9 && (n.visible = !1)), this.axis === "Z" && (j.setFromEuler(us.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(us.set(0, Math.PI / 2, 0)), W.copy(this.rotationAxis), n.quaternion.setFromRotationMatrix(Cn.lookAt(pn, W, $t)), n.quaternion.multiply(j), n.visible = this.dragging), this.axis === "E" && (n.visible = !1)) : n.name === "START" ? (n.position.copy(this.worldPositionStart), n.visible = this.dragging) : n.name === "END" ? (n.position.copy(this.worldPosition), n.visible = this.dragging) : n.name === "DELTA" ? (n.position.copy(this.worldPositionStart), n.quaternion.copy(this.worldQuaternionStart), nt.set(1e-10, 1e-10, 1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1), nt.applyQuaternion(this.worldQuaternionStart.clone().invert()), n.scale.copy(nt), n.visible = this.dragging) : (n.quaternion.copy(e), this.dragging ? n.position.copy(this.worldPositionStart) : n.position.copy(this.worldPosition), this.axis && (n.visible = this.axis.search(n.name) !== -1));
5213
5254
  continue;
5214
5255
  }
5215
5256
  n.quaternion.copy(e), this.mode === "translate" || this.mode === "scale" ? (n.name === "X" && Math.abs(W.copy(Ue).applyQuaternion(e).dot(this.eye)) > 0.99 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1), n.name === "Y" && Math.abs(W.copy($t).applyQuaternion(e).dot(this.eye)) > 0.99 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1), n.name === "Z" && Math.abs(W.copy(xe).applyQuaternion(e).dot(this.eye)) > 0.99 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1), n.name === "XY" && Math.abs(W.copy(xe).applyQuaternion(e).dot(this.eye)) < 0.2 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1), n.name === "YZ" && Math.abs(W.copy(Ue).applyQuaternion(e).dot(this.eye)) < 0.2 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1), n.name === "XZ" && Math.abs(W.copy($t).applyQuaternion(e).dot(this.eye)) < 0.2 && (n.scale.set(1e-10, 1e-10, 1e-10), n.visible = !1)) : this.mode === "rotate" && (fs.copy(e), W.copy(this.eye).applyQuaternion(j.copy(e).invert()), n.name.search("E") !== -1 && n.quaternion.setFromRotationMatrix(Cn.lookAt(this.eye, pn, $t)), n.name === "X" && (j.setFromAxisAngle(Ue, Math.atan2(-W.y, W.z)), j.multiplyQuaternions(fs, j), n.quaternion.copy(j)), n.name === "Y" && (j.setFromAxisAngle($t, 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) {
@@ -5266,34 +5307,34 @@ class xr extends v {
5266
5307
  class Ni {
5267
5308
  constructor(s, t, e, i, o, n = 5, r = !0) {
5268
5309
  /** Event that fires when the user starts dragging a clipping plane. */
5269
- I(this, "onDraggingStarted", new U());
5310
+ u(this, "onDraggingStarted", new U());
5270
5311
  /** Event that fires when the user stops dragging a clipping plane. */
5271
- I(this, "onDraggingEnded", new U());
5312
+ u(this, "onDraggingEnded", new U());
5272
5313
  /** {@link Disposable.onDisposed} */
5273
- I(this, "onDisposed", new U());
5274
- I(this, "normal");
5275
- I(this, "origin");
5276
- I(this, "three", new g.Plane());
5277
- I(this, "_helper");
5278
- I(this, "_visible", !0);
5279
- I(this, "_enabled", !0);
5280
- I(this, "components");
5281
- I(this, "world");
5282
- I(this, "_controlsActive", !1);
5283
- I(this, "_arrowBoundBox", new g.Mesh());
5284
- I(this, "_planeMesh");
5285
- I(this, "_controls");
5286
- I(this, "_hiddenMaterial", new g.MeshBasicMaterial({
5314
+ u(this, "onDisposed", new U());
5315
+ u(this, "normal");
5316
+ u(this, "origin");
5317
+ u(this, "three", new g.Plane());
5318
+ u(this, "_helper");
5319
+ u(this, "_visible", !0);
5320
+ u(this, "_enabled", !0);
5321
+ u(this, "components");
5322
+ u(this, "world");
5323
+ u(this, "_controlsActive", !1);
5324
+ u(this, "_arrowBoundBox", new g.Mesh());
5325
+ u(this, "_planeMesh");
5326
+ u(this, "_controls");
5327
+ u(this, "_hiddenMaterial", new g.MeshBasicMaterial({
5287
5328
  visible: !1
5288
5329
  }));
5289
5330
  /** {@link Updateable.update} */
5290
- I(this, "update", () => {
5331
+ u(this, "update", () => {
5291
5332
  this._enabled && this.three.setFromNormalAndCoplanarPoint(
5292
5333
  this.normal,
5293
5334
  this._helper.position
5294
5335
  );
5295
5336
  });
5296
- I(this, "changeDrag", (s) => {
5337
+ u(this, "changeDrag", (s) => {
5297
5338
  this._visible = !s.value, this.preventCameraMovement(), this.notifyDraggingChanged(s);
5298
5339
  });
5299
5340
  if (this.components = s, this.world = t, !t.renderer)
@@ -5391,48 +5432,48 @@ const Be = class Be extends J {
5391
5432
  constructor(t) {
5392
5433
  super(t);
5393
5434
  /** {@link Createable.onAfterCreate} */
5394
- I(this, "onAfterCreate", new U());
5435
+ u(this, "onAfterCreate", new U());
5395
5436
  /** {@link Createable.onAfterDelete} */
5396
- I(this, "onAfterDelete", new U());
5437
+ u(this, "onAfterDelete", new U());
5397
5438
  /** Event that fires when the user starts dragging a clipping plane. */
5398
- I(this, "onBeforeDrag", new U());
5439
+ u(this, "onBeforeDrag", new U());
5399
5440
  /** Event that fires when the user stops dragging a clipping plane. */
5400
- I(this, "onAfterDrag", new U());
5401
- I(this, "onBeforeCreate", new U());
5402
- I(this, "onBeforeCancel", new U());
5403
- I(this, "onAfterCancel", new U());
5404
- I(this, "onBeforeDelete", new U());
5441
+ u(this, "onAfterDrag", new U());
5442
+ u(this, "onBeforeCreate", new U());
5443
+ u(this, "onBeforeCancel", new U());
5444
+ u(this, "onAfterCancel", new U());
5445
+ u(this, "onBeforeDelete", new U());
5405
5446
  /** {@link Disposable.onDisposed} */
5406
- I(this, "onDisposed", new U());
5447
+ u(this, "onDisposed", new U());
5407
5448
  /**
5408
5449
  * Whether to force the clipping plane to be orthogonal in the Y direction
5409
5450
  * (up). This is desirable when clipping a building horizontally and a
5410
5451
  * clipping plane is created in its roof, which might have a slight
5411
5452
  * slope for draining purposes.
5412
5453
  */
5413
- I(this, "orthogonalY", !1);
5454
+ u(this, "orthogonalY", !1);
5414
5455
  /**
5415
5456
  * The tolerance that determines whether an almost-horizontal clipping plane
5416
5457
  * will be forced to be orthogonal to the Y direction. {@link orthogonalY}
5417
5458
  * has to be `true` for this to apply.
5418
5459
  */
5419
- I(this, "toleranceOrthogonalY", 0.7);
5420
- I(this, "Type", Ni);
5421
- I(this, "list", []);
5460
+ u(this, "toleranceOrthogonalY", 0.7);
5461
+ u(this, "Type", Ni);
5462
+ u(this, "list", []);
5422
5463
  /** The material used in all the clipping planes. */
5423
- I(this, "_material", new g.MeshBasicMaterial({
5464
+ u(this, "_material", new g.MeshBasicMaterial({
5424
5465
  color: 12255487,
5425
5466
  side: g.DoubleSide,
5426
5467
  transparent: !0,
5427
5468
  opacity: 0.2
5428
5469
  }));
5429
- I(this, "_size", 5);
5430
- I(this, "_enabled", !1);
5431
- I(this, "_visible", !0);
5432
- I(this, "_onStartDragging", () => {
5470
+ u(this, "_size", 5);
5471
+ u(this, "_enabled", !1);
5472
+ u(this, "_visible", !0);
5473
+ u(this, "_onStartDragging", () => {
5433
5474
  this.onBeforeDrag.trigger();
5434
5475
  });
5435
- I(this, "_onEndDragging", () => {
5476
+ u(this, "_onEndDragging", () => {
5436
5477
  this.onAfterDrag.trigger();
5437
5478
  });
5438
5479
  this.components.add(Be.uuid, this);
@@ -5557,8 +5598,8 @@ const Be = class Be extends J {
5557
5598
  const i = t.object;
5558
5599
  let o = t.object.matrixWorld.clone();
5559
5600
  if (i instanceof g.InstancedMesh && t.instanceId !== void 0) {
5560
- const l = new g.Matrix4();
5561
- i.getMatrixAt(t.instanceId, l), o = l.multiply(o);
5601
+ const c = new g.Matrix4();
5602
+ i.getMatrixAt(t.instanceId, c), o = c.multiply(o);
5562
5603
  }
5563
5604
  const r = new g.Matrix3().getNormalMatrix(o), a = e.clone().applyMatrix3(r).normalize();
5564
5605
  return this.normalizePlaneDirectionY(a), a;
@@ -5592,17 +5633,17 @@ const Be = class Be extends J {
5592
5633
  }
5593
5634
  }
5594
5635
  };
5595
- I(Be, "uuid", "66290bc5-18c4-4cd1-9379-2e17a0617611");
5636
+ u(Be, "uuid", "66290bc5-18c4-4cd1-9379-2e17a0617611");
5596
5637
  let mn = Be;
5597
- function br(c, s, t, e) {
5638
+ function br(l, s, t, e) {
5598
5639
  return new Promise((i, o) => {
5599
5640
  function n() {
5600
- const r = c.clientWaitSync(s, t, 0);
5601
- if (r === c.WAIT_FAILED) {
5641
+ const r = l.clientWaitSync(s, t, 0);
5642
+ if (r === l.WAIT_FAILED) {
5602
5643
  o();
5603
5644
  return;
5604
5645
  }
5605
- if (r === c.TIMEOUT_EXPIRED) {
5646
+ if (r === l.TIMEOUT_EXPIRED) {
5606
5647
  setTimeout(n, e);
5607
5648
  return;
5608
5649
  }
@@ -5611,58 +5652,58 @@ function br(c, s, t, e) {
5611
5652
  n();
5612
5653
  });
5613
5654
  }
5614
- async function vr(c, s, t, e, i, o, n) {
5615
- const r = c.fenceSync(c.SYNC_GPU_COMMANDS_COMPLETE, 0);
5616
- c.flush(), await br(c, r, 0, 10), c.deleteSync(r), c.bindBuffer(s, t), c.getBufferSubData(s, e, i, o, n), c.bindBuffer(s, null);
5655
+ async function vr(l, s, t, e, i, o, n) {
5656
+ const r = l.fenceSync(l.SYNC_GPU_COMMANDS_COMPLETE, 0);
5657
+ l.flush(), await br(l, r, 0, 10), l.deleteSync(r), l.bindBuffer(s, t), l.getBufferSubData(s, e, i, o, n), l.bindBuffer(s, null);
5617
5658
  }
5618
- async function Br(c, s, t, e, i, o, n, r) {
5619
- const a = c.createBuffer();
5620
- return c.bindBuffer(c.PIXEL_PACK_BUFFER, a), c.bufferData(c.PIXEL_PACK_BUFFER, r.byteLength, c.STREAM_READ), c.readPixels(s, t, e, i, o, n, 0), c.bindBuffer(c.PIXEL_PACK_BUFFER, null), await vr(c, c.PIXEL_PACK_BUFFER, a, 0, r), c.deleteBuffer(a), r;
5659
+ async function Br(l, s, t, e, i, o, n, r) {
5660
+ const a = l.createBuffer();
5661
+ return l.bindBuffer(l.PIXEL_PACK_BUFFER, a), l.bufferData(l.PIXEL_PACK_BUFFER, r.byteLength, l.STREAM_READ), l.readPixels(s, t, e, i, o, n, 0), l.bindBuffer(l.PIXEL_PACK_BUFFER, null), await vr(l, l.PIXEL_PACK_BUFFER, a, 0, r), l.deleteBuffer(a), r;
5621
5662
  }
5622
5663
  class Yr {
5623
5664
  constructor(s, t, e) {
5624
5665
  /** {@link Disposable.onDisposed} */
5625
- I(this, "onDisposed", new U());
5666
+ u(this, "onDisposed", new U());
5626
5667
  /**
5627
5668
  * Fires after making the visibility check to the meshes. It lists the
5628
5669
  * meshes that are currently visible, and the ones that were visible
5629
5670
  * just before but not anymore.
5630
5671
  */
5631
- I(this, "onViewUpdated", new Kt());
5672
+ u(this, "onViewUpdated", new Kt());
5632
5673
  /** {@link Component.enabled} */
5633
- I(this, "enabled", !0);
5674
+ u(this, "enabled", !0);
5634
5675
  /**
5635
5676
  * Needs to check whether there are objects that need to be hidden or shown.
5636
5677
  * You can bind this to the camera movement, to a certain interval, etc.
5637
5678
  */
5638
- I(this, "needsUpdate", !1);
5679
+ u(this, "needsUpdate", !1);
5639
5680
  /**
5640
5681
  * Render the internal scene used to determine the object visibility. Used
5641
5682
  * for debugging purposes.
5642
5683
  */
5643
- I(this, "renderDebugFrame", !1);
5644
- I(this, "components");
5645
- I(this, "world");
5646
- I(this, "renderer");
5647
- I(this, "autoUpdate", !0);
5648
- I(this, "updateInterval", 1e3);
5649
- I(this, "worker");
5650
- I(this, "scene", new g.Scene());
5651
- I(this, "_width", 512);
5652
- I(this, "_height", 512);
5653
- I(this, "_availableColor", 1);
5654
- I(this, "renderTarget");
5655
- I(this, "bufferSize");
5656
- I(this, "_buffer");
5684
+ u(this, "renderDebugFrame", !1);
5685
+ u(this, "components");
5686
+ u(this, "world");
5687
+ u(this, "renderer");
5688
+ u(this, "autoUpdate", !0);
5689
+ u(this, "updateInterval", 1e3);
5690
+ u(this, "worker");
5691
+ u(this, "scene", new g.Scene());
5692
+ u(this, "_width", 512);
5693
+ u(this, "_height", 512);
5694
+ u(this, "_availableColor", 1);
5695
+ u(this, "renderTarget");
5696
+ u(this, "bufferSize");
5697
+ u(this, "_buffer");
5657
5698
  // Prevents worker being fired multiple times
5658
- I(this, "_isWorkerBusy", !1);
5699
+ u(this, "_isWorkerBusy", !1);
5659
5700
  /**
5660
5701
  * The function that the culler uses to reprocess the scene. Generally it's
5661
5702
  * better to call needsUpdate, but you can also call this to force it.
5662
5703
  * @param force if true, it will refresh the scene even if needsUpdate is
5663
5704
  * not true.
5664
5705
  */
5665
- I(this, "updateVisibility", async (s) => {
5706
+ u(this, "updateVisibility", async (s) => {
5666
5707
  if (!this.enabled || !this.needsUpdate && !s || this._isWorkerBusy)
5667
5708
  return;
5668
5709
  this._isWorkerBusy = !0;
@@ -5745,20 +5786,20 @@ class Vr extends Yr {
5745
5786
  constructor(t, e, i) {
5746
5787
  super(t, e, i);
5747
5788
  /* Pixels in screen a geometry must occupy to be considered "seen". */
5748
- I(this, "threshold", 100);
5749
- I(this, "onViewUpdated", new U());
5750
- I(this, "colorMeshes", /* @__PURE__ */ new Map());
5751
- I(this, "isProcessing", !1);
5752
- I(this, "_colorCodeMeshMap", /* @__PURE__ */ new Map());
5753
- I(this, "_meshIDColorCodeMap", /* @__PURE__ */ new Map());
5754
- I(this, "_currentVisibleMeshes", /* @__PURE__ */ new Set());
5755
- I(this, "_recentlyHiddenMeshes", /* @__PURE__ */ new Set());
5756
- I(this, "_intervalID", null);
5757
- I(this, "_transparentMat", new g.MeshBasicMaterial({
5789
+ u(this, "threshold", 100);
5790
+ u(this, "onViewUpdated", new U());
5791
+ u(this, "colorMeshes", /* @__PURE__ */ new Map());
5792
+ u(this, "isProcessing", !1);
5793
+ u(this, "_colorCodeMeshMap", /* @__PURE__ */ new Map());
5794
+ u(this, "_meshIDColorCodeMap", /* @__PURE__ */ new Map());
5795
+ u(this, "_currentVisibleMeshes", /* @__PURE__ */ new Set());
5796
+ u(this, "_recentlyHiddenMeshes", /* @__PURE__ */ new Set());
5797
+ u(this, "_intervalID", null);
5798
+ u(this, "_transparentMat", new g.MeshBasicMaterial({
5758
5799
  transparent: !0,
5759
5800
  opacity: 0
5760
5801
  }));
5761
- I(this, "handleWorkerMessage", async (t) => {
5802
+ u(this, "handleWorkerMessage", async (t) => {
5762
5803
  if (this.isProcessing)
5763
5804
  return;
5764
5805
  const e = t.data.colors;
@@ -5805,8 +5846,8 @@ class Vr extends Yr {
5805
5846
  if (Array.isArray(o)) {
5806
5847
  let d = !0;
5807
5848
  const h = [];
5808
- for (const u of o)
5809
- sn.isTransparent(u) ? h.push(this._transparentMat) : (d = !1, h.push(n));
5849
+ for (const I of o)
5850
+ sn.isTransparent(I) ? h.push(this._transparentMat) : (d = !1, h.push(n));
5810
5851
  if (d) {
5811
5852
  n.dispose(), this.isProcessing = !1;
5812
5853
  return;
@@ -5818,7 +5859,7 @@ class Vr extends Yr {
5818
5859
  } else
5819
5860
  a = n;
5820
5861
  this._colorCodeMeshMap.set(r, t), this._meshIDColorCodeMap.set(t.uuid, r);
5821
- const l = e ? t.count : 1, E = new g.InstancedMesh(i, a, l);
5862
+ const c = e ? t.count : 1, E = new g.InstancedMesh(i, a, c);
5822
5863
  e ? E.instanceMatrix = t.instanceMatrix : E.setMatrixAt(0, new g.Matrix4()), t.visible = !1, E.applyMatrix4(t.matrix), E.updateMatrix(), this.scene.add(E), this.colorMeshes.set(t.uuid, E), this.increaseColor(), this.isProcessing = !1;
5823
5864
  }
5824
5865
  remove(t) {
@@ -5842,32 +5883,59 @@ class Vr extends Yr {
5842
5883
  const r = new g.Color(`rgb(${t}, ${e}, ${i})`);
5843
5884
  if (!this.world.renderer)
5844
5885
  throw new Error("Renderer not found in the world!");
5845
- const a = this.world.renderer.clippingPlanes, l = new g.MeshBasicMaterial({
5886
+ const a = this.world.renderer.clippingPlanes, c = new g.MeshBasicMaterial({
5846
5887
  color: r,
5847
5888
  clippingPlanes: a,
5848
5889
  side: g.DoubleSide
5849
5890
  });
5850
- return g.ColorManagement.enabled = n, { colorMaterial: l, code: o };
5891
+ return g.ColorManagement.enabled = n, { colorMaterial: c, code: o };
5851
5892
  }
5852
5893
  }
5853
5894
  const Ye = class Ye extends J {
5854
5895
  constructor(t) {
5855
5896
  super(t);
5856
- I(this, "_enabled", !0);
5857
- I(this, "list", /* @__PURE__ */ new Map());
5858
- /** {@link Disposable.onDisposed} */
5859
- I(this, "onDisposed", new U());
5897
+ /**
5898
+ * Indicates whether the Cullers component is enabled.
5899
+ */
5900
+ u(this, "_enabled", !0);
5901
+ /**
5902
+ * A map of MeshCullerRenderer instances, keyed by their world UUIDs.
5903
+ */
5904
+ u(this, "list", /* @__PURE__ */ new Map());
5905
+ /**
5906
+ * An event that is triggered when the Cullers component is disposed.
5907
+ */
5908
+ u(this, "onDisposed", new U());
5860
5909
  t.add(Ye.uuid, this);
5861
5910
  }
5862
- /** {@link Component.enabled} */
5911
+ /**
5912
+ * Gets the enabled state of the Cullers component.
5913
+ *
5914
+ * @returns The current enabled state.
5915
+ */
5863
5916
  get enabled() {
5864
5917
  return this._enabled;
5865
5918
  }
5919
+ /**
5920
+ * Sets the enabled state of the Cullers component.
5921
+ * Also sets the enabled state of all MeshCullerRenderer instances.
5922
+ *
5923
+ * @param value - The new enabled state.
5924
+ */
5866
5925
  set enabled(t) {
5867
5926
  this._enabled = t;
5868
5927
  for (const [e, i] of this.list)
5869
5928
  i.enabled = t;
5870
5929
  }
5930
+ /**
5931
+ * Creates a new MeshCullerRenderer for the given world.
5932
+ * If a MeshCullerRenderer already exists for the world, it will return the existing one.
5933
+ *
5934
+ * @param world - The world for which to create the MeshCullerRenderer.
5935
+ * @param config - Optional configuration settings for the MeshCullerRenderer.
5936
+ *
5937
+ * @returns The newly created or existing MeshCullerRenderer for the given world.
5938
+ */
5871
5939
  create(t, e) {
5872
5940
  if (this.list.has(t.uuid))
5873
5941
  return this.list.get(t.uuid);
@@ -5886,31 +5954,34 @@ const Ye = class Ye extends J {
5886
5954
  this.list.clear();
5887
5955
  }
5888
5956
  };
5889
- I(Ye, "uuid", "69f2a50d-c266-44fc-b1bd-fa4d34be89e6");
5957
+ /**
5958
+ * A unique identifier for the Cullers component.
5959
+ */
5960
+ u(Ye, "uuid", "69f2a50d-c266-44fc-b1bd-fa4d34be89e6");
5890
5961
  let Ci = Ye;
5891
5962
  class Gr {
5892
5963
  constructor(s) {
5893
5964
  /** {@link Disposable.onDisposed} */
5894
- I(this, "onDisposed", new U());
5895
- I(this, "onAfterUpdate", new U());
5896
- I(this, "onBeforeUpdate", new U());
5897
- I(this, "onResize", new U());
5965
+ u(this, "onDisposed", new U());
5966
+ u(this, "onAfterUpdate", new U());
5967
+ u(this, "onBeforeUpdate", new U());
5968
+ u(this, "onResize", new U());
5898
5969
  // By pushing the map to the front, what the user sees on screen corresponds with what they see on the map
5899
- I(this, "frontOffset", 0);
5900
- I(this, "overrideMaterial", new g.MeshDepthMaterial());
5901
- I(this, "backgroundColor", new g.Color(395274));
5902
- I(this, "renderer");
5903
- I(this, "enabled", !0);
5904
- I(this, "world");
5905
- I(this, "_lockRotation", !0);
5906
- I(this, "_camera");
5907
- I(this, "_plane");
5908
- I(this, "_size", new g.Vector2(320, 160));
5909
- I(this, "_tempVector1", new g.Vector3());
5910
- I(this, "_tempVector2", new g.Vector3());
5911
- I(this, "_tempTarget", new g.Vector3());
5912
- I(this, "down", new g.Vector3(0, -1, 0));
5913
- I(this, "updatePlanes", () => {
5970
+ u(this, "frontOffset", 0);
5971
+ u(this, "overrideMaterial", new g.MeshDepthMaterial());
5972
+ u(this, "backgroundColor", new g.Color(395274));
5973
+ u(this, "renderer");
5974
+ u(this, "enabled", !0);
5975
+ u(this, "world");
5976
+ u(this, "_lockRotation", !0);
5977
+ u(this, "_camera");
5978
+ u(this, "_plane");
5979
+ u(this, "_size", new g.Vector2(320, 160));
5980
+ u(this, "_tempVector1", new g.Vector3());
5981
+ u(this, "_tempVector2", new g.Vector3());
5982
+ u(this, "_tempTarget", new g.Vector3());
5983
+ u(this, "down", new g.Vector3(0, -1, 0));
5984
+ u(this, "updatePlanes", () => {
5914
5985
  if (!this.world.renderer)
5915
5986
  throw new Error("The given world must have a renderer!");
5916
5987
  const s = [], t = this.world.renderer.three;
@@ -5983,11 +6054,11 @@ class Gr {
5983
6054
  const Ss = class Ss extends J {
5984
6055
  constructor(t) {
5985
6056
  super(t);
5986
- I(this, "onAfterUpdate", new U());
5987
- I(this, "onBeforeUpdate", new U());
5988
- I(this, "onDisposed", new U());
5989
- I(this, "enabled", !0);
5990
- I(this, "list", /* @__PURE__ */ new Map());
6057
+ u(this, "onAfterUpdate", new U());
6058
+ u(this, "onBeforeUpdate", new U());
6059
+ u(this, "onDisposed", new U());
6060
+ u(this, "enabled", !0);
6061
+ u(this, "list", /* @__PURE__ */ new Map());
5991
6062
  this.components.add(Ss.uuid, this);
5992
6063
  }
5993
6064
  create(t) {
@@ -6010,14 +6081,14 @@ const Ss = class Ss extends J {
6010
6081
  e.update();
6011
6082
  }
6012
6083
  };
6013
- I(Ss, "uuid", "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f");
6084
+ u(Ss, "uuid", "39ad6aad-84c8-4adf-a1e0-7f25313a9e7f");
6014
6085
  let Rn = Ss;
6015
6086
  class zr {
6016
6087
  constructor(s) {
6017
6088
  /** {@link NavigationMode.enabled} */
6018
- I(this, "enabled", !1);
6089
+ u(this, "enabled", !1);
6019
6090
  /** {@link NavigationMode.id} */
6020
- I(this, "id", "FirstPerson");
6091
+ u(this, "id", "FirstPerson");
6021
6092
  this.camera = s;
6022
6093
  }
6023
6094
  /** {@link NavigationMode.set} */
@@ -6042,9 +6113,9 @@ class zr {
6042
6113
  class Hr {
6043
6114
  constructor(s) {
6044
6115
  /** {@link NavigationMode.enabled} */
6045
- I(this, "enabled", !0);
6116
+ u(this, "enabled", !0);
6046
6117
  /** {@link NavigationMode.id} */
6047
- I(this, "id", "Orbit");
6118
+ u(this, "id", "Orbit");
6048
6119
  this.camera = s, this.activateOrbitControls();
6049
6120
  }
6050
6121
  /** {@link NavigationMode.set} */
@@ -6065,14 +6136,14 @@ class Hr {
6065
6136
  class kr {
6066
6137
  constructor(s) {
6067
6138
  /** {@link NavigationMode.enabled} */
6068
- I(this, "enabled", !1);
6139
+ u(this, "enabled", !1);
6069
6140
  /** {@link NavigationMode.id} */
6070
- I(this, "id", "Plan");
6071
- I(this, "mouseAction1");
6072
- I(this, "mouseAction2");
6073
- I(this, "mouseInitialized", !1);
6074
- I(this, "defaultAzimuthSpeed");
6075
- I(this, "defaultPolarSpeed");
6141
+ u(this, "id", "Plan");
6142
+ u(this, "mouseAction1");
6143
+ u(this, "mouseAction2");
6144
+ u(this, "mouseInitialized", !1);
6145
+ u(this, "defaultAzimuthSpeed");
6146
+ u(this, "defaultPolarSpeed");
6076
6147
  this.camera = s, this.defaultAzimuthSpeed = s.controls.azimuthRotateSpeed, this.defaultPolarSpeed = s.controls.polarRotateSpeed;
6077
6148
  }
6078
6149
  /** {@link NavigationMode.set} */
@@ -6087,13 +6158,13 @@ class Wr {
6087
6158
  /**
6088
6159
  * Event that fires when the {@link CameraProjection} changes.
6089
6160
  */
6090
- I(this, "onChanged", new U());
6091
- I(this, "current", "Perspective");
6092
- I(this, "camera");
6093
- I(this, "_component");
6094
- I(this, "_previousDistance", -1);
6161
+ u(this, "onChanged", new U());
6162
+ u(this, "current", "Perspective");
6163
+ u(this, "camera");
6164
+ u(this, "_component");
6165
+ u(this, "_previousDistance", -1);
6095
6166
  /** Match Ortho zoom with Perspective distance when changing projection mode */
6096
- I(this, "matchOrthoDistanceEnabled", !1);
6167
+ u(this, "matchOrthoDistanceEnabled", !1);
6097
6168
  this._component = s, this.camera = s.three;
6098
6169
  }
6099
6170
  /**
@@ -6131,8 +6202,8 @@ class Wr {
6131
6202
  this._component.threePersp.getWorldDirection(t);
6132
6203
  const e = new g.Vector3();
6133
6204
  this._component.controls.getTarget(e);
6134
- const o = e.clone().sub(this._component.threePersp.position).dot(t), n = s.renderer.getSize(), r = n.x / n.y, a = this._component.threePersp, l = o * 2 * Math.atan(a.fov * (Math.PI / 180) / 2);
6135
- return { width: l * r, height: l };
6205
+ 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);
6206
+ return { width: c * r, height: c };
6136
6207
  }
6137
6208
  setupOrthoCamera(s, t) {
6138
6209
  this._component.controls.mouseButtons.wheel = ot.ACTION.ZOOM, this._component.controls.mouseButtons.middle = ot.ACTION.ZOOM;
@@ -6155,13 +6226,13 @@ class na extends ke {
6155
6226
  /**
6156
6227
  * The current {@link NavigationMode}.
6157
6228
  */
6158
- I(this, "_mode", null);
6159
- I(this, "projection");
6160
- I(this, "threeOrtho");
6161
- I(this, "threePersp");
6162
- I(this, "_userInputButtons", {});
6163
- I(this, "_frustumSize", 50);
6164
- I(this, "_navigationModes", /* @__PURE__ */ new Map());
6229
+ u(this, "_mode", null);
6230
+ u(this, "projection");
6231
+ u(this, "threeOrtho");
6232
+ u(this, "threePersp");
6233
+ u(this, "_userInputButtons", {});
6234
+ u(this, "_frustumSize", 50);
6235
+ u(this, "_navigationModes", /* @__PURE__ */ new Map());
6165
6236
  this.threePersp = this.three, this.threeOrtho = this.newOrthoCamera(), this.projection = new Wr(this), this.onAspectUpdated.add(() => {
6166
6237
  this.setOrthoCameraAspect();
6167
6238
  }), this.projection.onChanged.add(
@@ -6204,15 +6275,15 @@ class na extends ke {
6204
6275
  if (!this.enabled)
6205
6276
  return;
6206
6277
  const i = Number.MAX_VALUE, o = Number.MIN_VALUE, n = new g.Vector3(i, i, i), r = new g.Vector3(o, o, o);
6207
- for (const u of t) {
6208
- const p = new g.Box3().setFromObject(u);
6278
+ for (const I of t) {
6279
+ const p = new g.Box3().setFromObject(I);
6209
6280
  p.min.x < n.x && (n.x = p.min.x), p.min.y < n.y && (n.y = p.min.y), p.min.z < n.z && (n.z = p.min.z), p.max.x > r.x && (r.x = p.max.x), p.max.y > r.y && (r.y = p.max.y), p.max.z > r.z && (r.z = p.max.z);
6210
6281
  }
6211
- const a = new g.Box3(n, r), l = new g.Vector3();
6212
- a.getSize(l);
6282
+ const a = new g.Box3(n, r), c = new g.Vector3();
6283
+ a.getSize(c);
6213
6284
  const E = new g.Vector3();
6214
6285
  a.getCenter(E);
6215
- const d = Math.max(l.x, l.y, l.z) * e, h = new g.Sphere(E, d);
6286
+ const d = Math.max(c.x, c.y, c.z) * e, h = new g.Sphere(E, d);
6216
6287
  await this.controls.fitToSphere(h, !0);
6217
6288
  }
6218
6289
  /**
@@ -6243,20 +6314,24 @@ class na extends ke {
6243
6314
  setOrthoCameraAspect() {
6244
6315
  if (!this.currentWorld || !this.currentWorld.renderer)
6245
6316
  return;
6246
- const t = this.currentWorld.renderer.getSize(), e = t.x / t.y;
6247
- this.threeOrtho.left = -this._frustumSize * e / 2, this.threeOrtho.right = this._frustumSize * e / 2, this.threeOrtho.top = this._frustumSize / 2, this.threeOrtho.bottom = -this._frustumSize / 2, this.threeOrtho.updateProjectionMatrix();
6317
+ const t = new g.Vector3();
6318
+ this.threePersp.getWorldDirection(t);
6319
+ const e = new g.Vector3();
6320
+ this.controls.getTarget(e);
6321
+ const o = e.clone().sub(this.threePersp.position).dot(t), n = this.currentWorld.renderer.getSize(), r = n.x / n.y, a = this.threePersp, c = o * 2 * Math.atan(a.fov * (Math.PI / 180) / 2), E = c * r;
6322
+ this.threeOrtho.zoom = 1, this.threeOrtho.left = E / -2, this.threeOrtho.right = E / 2, this.threeOrtho.top = c / 2, this.threeOrtho.bottom = c / -2, this.threeOrtho.updateProjectionMatrix();
6248
6323
  }
6249
6324
  }
6250
6325
  const At = class At extends J {
6251
6326
  constructor(t) {
6252
6327
  super(t);
6253
6328
  /** {@link Component.enabled} */
6254
- I(this, "enabled", !0);
6329
+ u(this, "enabled", !0);
6255
6330
  /** {@link Disposable.onDisposed} */
6256
- I(this, "onDisposed", new U());
6257
- I(this, "_absoluteMin");
6258
- I(this, "_absoluteMax");
6259
- I(this, "_meshes", []);
6331
+ u(this, "onDisposed", new U());
6332
+ u(this, "_absoluteMin");
6333
+ u(this, "_absoluteMax");
6334
+ u(this, "_meshes", []);
6260
6335
  this.components.add(At.uuid, this), this._absoluteMin = At.newBound(!0), this._absoluteMax = At.newBound(!1);
6261
6336
  }
6262
6337
  static getDimensions(t) {
@@ -6293,8 +6368,8 @@ const At = class At extends J {
6293
6368
  return new g.Sphere(r, a);
6294
6369
  }
6295
6370
  getMesh() {
6296
- 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), l = new g.Mesh(a);
6297
- return this._meshes.push(l), l.position.copy(r), l;
6371
+ 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);
6372
+ return this._meshes.push(c), c.position.copy(r), c;
6298
6373
  }
6299
6374
  reset() {
6300
6375
  this._absoluteMin = At.newBound(!0), this._absoluteMax = At.newBound(!1);
@@ -6310,17 +6385,17 @@ const At = class At extends J {
6310
6385
  t.updateMatrixWorld();
6311
6386
  const o = t.matrixWorld, n = new g.Matrix4(), r = t instanceof g.InstancedMesh, a = /* @__PURE__ */ new Set();
6312
6387
  if (e && t instanceof Vt.FragmentMesh)
6313
- for (const l of e) {
6314
- const E = t.fragment.getInstancesIDs(l);
6388
+ for (const c of e) {
6389
+ const E = t.fragment.getInstancesIDs(c);
6315
6390
  if (E)
6316
6391
  for (const d of E)
6317
6392
  a.add(d);
6318
6393
  }
6319
6394
  else
6320
6395
  a.add(0);
6321
- for (const l of a) {
6396
+ for (const c of a) {
6322
6397
  const E = i.min.clone(), d = i.max.clone();
6323
- r && (t.getMatrixAt(l, n), E.applyMatrix4(n), d.applyMatrix4(n)), E.applyMatrix4(o), d.applyMatrix4(o), E.x < this._absoluteMin.x && (this._absoluteMin.x = E.x), E.y < this._absoluteMin.y && (this._absoluteMin.y = E.y), E.z < this._absoluteMin.z && (this._absoluteMin.z = E.z), E.x > this._absoluteMax.x && (this._absoluteMax.x = E.x), E.y > this._absoluteMax.y && (this._absoluteMax.y = E.y), E.z > this._absoluteMax.z && (this._absoluteMax.z = E.z), d.x > this._absoluteMax.x && (this._absoluteMax.x = d.x), d.y > this._absoluteMax.y && (this._absoluteMax.y = d.y), d.z > this._absoluteMax.z && (this._absoluteMax.z = d.z), d.x < this._absoluteMin.x && (this._absoluteMin.x = d.x), d.y < this._absoluteMin.y && (this._absoluteMin.y = d.y), d.z < this._absoluteMin.z && (this._absoluteMin.z = d.z);
6398
+ r && (t.getMatrixAt(c, n), E.applyMatrix4(n), d.applyMatrix4(n)), E.applyMatrix4(o), d.applyMatrix4(o), E.x < this._absoluteMin.x && (this._absoluteMin.x = E.x), E.y < this._absoluteMin.y && (this._absoluteMin.y = E.y), E.z < this._absoluteMin.z && (this._absoluteMin.z = E.z), E.x > this._absoluteMax.x && (this._absoluteMax.x = E.x), E.y > this._absoluteMax.y && (this._absoluteMax.y = E.y), E.z > this._absoluteMax.z && (this._absoluteMax.z = E.z), d.x > this._absoluteMax.x && (this._absoluteMax.x = d.x), d.y > this._absoluteMax.y && (this._absoluteMax.y = d.y), d.z > this._absoluteMax.z && (this._absoluteMax.z = d.z), d.x < this._absoluteMin.x && (this._absoluteMin.x = d.x), d.y < this._absoluteMin.y && (this._absoluteMin.y = d.y), d.z < this._absoluteMin.z && (this._absoluteMin.z = d.z);
6324
6399
  }
6325
6400
  }
6326
6401
  static getFragmentBounds(t) {
@@ -6328,18 +6403,18 @@ const At = class At extends J {
6328
6403
  if (!t.geometry.index)
6329
6404
  throw new Error("Geometry must be indexed!");
6330
6405
  const a = Array.from(t.geometry.index.array);
6331
- for (let l = 0; l < a.length; l++) {
6332
- if (l % 3 === 0 && a[l] === 0 && a[l + 1] === 0 && a[l + 2] === 0) {
6333
- l += 2;
6406
+ for (let c = 0; c < a.length; c++) {
6407
+ if (c % 3 === 0 && a[c] === 0 && a[c + 1] === 0 && a[c + 2] === 0) {
6408
+ c += 2;
6334
6409
  continue;
6335
6410
  }
6336
- const E = a[l], d = e.getX(E), h = e.getY(E), u = e.getZ(E);
6337
- d < n.x && (n.x = d), h < n.y && (n.y = h), u < n.z && (n.z = u), d > r.x && (r.x = d), h > r.y && (r.y = h), u > r.z && (r.z = u);
6411
+ const E = a[c], d = e.getX(E), h = e.getY(E), I = e.getZ(E);
6412
+ d < n.x && (n.x = d), h < n.y && (n.y = h), I < n.z && (n.z = I), d > r.x && (r.x = d), h > r.y && (r.y = h), I > r.z && (r.z = I);
6338
6413
  }
6339
6414
  return new g.Box3(n, r);
6340
6415
  }
6341
6416
  };
6342
- I(At, "uuid", "d1444724-dba6-4cdd-a0c7-68ee1450d166");
6417
+ u(At, "uuid", "d1444724-dba6-4cdd-a0c7-68ee1450d166");
6343
6418
  let An = At;
6344
6419
  const Pi = /* @__PURE__ */ new Set([
6345
6420
  1123145078,
@@ -6479,7 +6554,7 @@ const Pi = /* @__PURE__ */ new Set([
6479
6554
  constructor(t) {
6480
6555
  super(t);
6481
6556
  /** {@link Component.enabled} */
6482
- I(this, "enabled", !0);
6557
+ u(this, "enabled", !0);
6483
6558
  t.add(_s.uuid, this);
6484
6559
  }
6485
6560
  /**
@@ -6498,36 +6573,36 @@ const Pi = /* @__PURE__ */ new Set([
6498
6573
  D.IFCBUILDINGSTOREY,
6499
6574
  D.IFCSPACE
6500
6575
  ]);
6501
- for (const l of a)
6502
- r.add(l);
6503
- for (const l of r) {
6504
- if (Pi.has(l))
6576
+ for (const c of a)
6577
+ r.add(c);
6578
+ for (const c of r) {
6579
+ if (Pi.has(c))
6505
6580
  continue;
6506
- const E = a.has(l) && o, d = t.GetLineIDsWithType(e, l);
6581
+ const E = a.has(c) && o, d = t.GetLineIDsWithType(e, c);
6507
6582
  for (const h of d) {
6508
- const u = t.GetLine(0, h, E, i);
6509
- n[u.expressID] = u;
6583
+ const I = t.GetLine(0, h, E, i);
6584
+ n[I.expressID] = I;
6510
6585
  }
6511
6586
  }
6512
6587
  return n;
6513
6588
  }
6514
6589
  };
6515
- I(_s, "uuid", "b32c4332-cd67-436e-ba7f-196646c7a635");
6590
+ u(_s, "uuid", "b32c4332-cd67-436e-ba7f-196646c7a635");
6516
6591
  let Ti = _s;
6517
6592
  const Ns = class Ns extends J {
6518
6593
  constructor(t) {
6519
6594
  super(t);
6520
6595
  /** {@link Disposable.onDisposed} */
6521
- I(this, "onDisposed", new U());
6522
- I(this, "onFragmentsLoaded", new U());
6523
- I(this, "onFragmentsDisposed", new U());
6596
+ u(this, "onDisposed", new U());
6597
+ u(this, "onFragmentsLoaded", new U());
6598
+ u(this, "onFragmentsDisposed", new U());
6524
6599
  /** All the created [fragments](https://github.com/ThatOpen/engine_fragment). */
6525
- I(this, "list", /* @__PURE__ */ new Map());
6526
- I(this, "groups", /* @__PURE__ */ new Map());
6600
+ u(this, "list", /* @__PURE__ */ new Map());
6601
+ u(this, "groups", /* @__PURE__ */ new Map());
6527
6602
  /** {@link Component.enabled} */
6528
- I(this, "enabled", !0);
6529
- I(this, "baseCoordinationModel", "");
6530
- I(this, "_loader", new Jn());
6603
+ u(this, "enabled", !0);
6604
+ u(this, "baseCoordinationModel", "");
6605
+ u(this, "_loader", new Jn());
6531
6606
  this.components.add(Ns.uuid, this);
6532
6607
  }
6533
6608
  /** The list of meshes of the created fragments. */
@@ -6561,10 +6636,10 @@ const Ns = class Ns extends J {
6561
6636
  * @returns The loaded FragmentsGroup.
6562
6637
  */
6563
6638
  load(t, e) {
6564
- const o = { ...{ coordinate: !0 }, ...e }, { coordinate: n, properties: r, relationsMap: a } = o, l = this._loader.import(t);
6565
- for (const E of l.items)
6566
- E.group = l, this.list.set(E.id, E);
6567
- return n && this.coordinate([l]), this.groups.set(l.uuid, l), r && l.setLocalProperties(r), a && this.components.get(As).setRelationMap(l, a), this.onFragmentsLoaded.trigger(l), l;
6639
+ const o = { ...{ coordinate: !0 }, ...e }, { coordinate: n, properties: r, relationsMap: a } = o, c = this._loader.import(t);
6640
+ for (const E of c.items)
6641
+ E.group = c, this.list.set(E.id, E);
6642
+ return n && this.coordinate([c]), this.groups.set(c.uuid, c), r && c.setLocalProperties(r), a && this.components.get(As).setRelationMap(c, a), this.onFragmentsLoaded.trigger(c), c;
6568
6643
  }
6569
6644
  /**
6570
6645
  * Export the specified fragments.
@@ -6592,8 +6667,8 @@ const Ns = class Ns extends J {
6592
6667
  o !== i && (o.position.set(0, 0, 0), o.rotation.set(0, 0, 0), o.scale.set(1, 1, 1), o.updateMatrix(), o.applyMatrix4(o.coordinationMatrix.clone().invert()), o.applyMatrix4(i.coordinationMatrix));
6593
6668
  }
6594
6669
  };
6595
- I(Ns, "uuid", "fef46874-46a3-461b-8c44-2922ab77c806");
6596
- let ut = Ns;
6670
+ u(Ns, "uuid", "fef46874-46a3-461b-8c44-2922ab77c806");
6671
+ let It = Ns;
6597
6672
  const Xr = {
6598
6673
  103090709: "IFCPROJECT",
6599
6674
  4097777520: "IFCSITE",
@@ -6738,8 +6813,8 @@ class oa {
6738
6813
  const e = {}, i = Object.keys(Xr).map((o) => parseInt(o, 10));
6739
6814
  for (let o = 0; o < i.length; o++) {
6740
6815
  const n = i[o], r = s.GetLineIDsWithType(t, n), a = r.size();
6741
- for (let l = 0; l < a; l++)
6742
- e[r.get(l)] = n;
6816
+ for (let c = 0; c < a; c++)
6817
+ e[r.get(c)] = n;
6743
6818
  }
6744
6819
  return e;
6745
6820
  }
@@ -7918,18 +7993,18 @@ class Gt {
7918
7993
  var a;
7919
7994
  const o = e ?? (() => {
7920
7995
  }), n = {}, r = s.getAllPropertiesIDs();
7921
- for (const l of r) {
7922
- const E = await s.getProperties(l);
7996
+ for (const c of r) {
7997
+ const E = await s.getProperties(c);
7923
7998
  if (!E)
7924
7999
  continue;
7925
8000
  const d = E.type === t, h = Object.keys(E).find(
7926
8001
  (C) => C.startsWith("Relating")
7927
- ), u = Object.keys(E).find(
8002
+ ), I = Object.keys(E).find(
7928
8003
  (C) => C.startsWith("Related")
7929
8004
  );
7930
- if (!(d && h && u))
8005
+ if (!(d && h && I))
7931
8006
  continue;
7932
- const p = await s.getProperties((a = E[h]) == null ? void 0 : a.value), A = E[u];
8007
+ const p = await s.getProperties((a = E[h]) == null ? void 0 : a.value), A = E[I];
7933
8008
  if (!p || !A || !(A && Array.isArray(A)))
7934
8009
  continue;
7935
8010
  const R = A.map((C) => C.value);
@@ -7940,12 +8015,12 @@ class Gt {
7940
8015
  static async getQsetQuantities(s, t, e) {
7941
8016
  const o = e ?? (() => {
7942
8017
  }), n = await s.getProperties(t);
7943
- return !n || n.type !== D.IFCELEMENTQUANTITY ? null : (n.Quantities ?? [{}]).map((l) => (l.value && o(l.value), l.value)).filter((l) => l !== null);
8018
+ return !n || n.type !== D.IFCELEMENTQUANTITY ? null : (n.Quantities ?? [{}]).map((c) => (c.value && o(c.value), c.value)).filter((c) => c !== null);
7944
8019
  }
7945
8020
  static async getPsetProps(s, t, e) {
7946
8021
  const o = e ?? (() => {
7947
8022
  }), n = await s.getProperties(t);
7948
- return !n || n.type !== D.IFCPROPERTYSET ? null : (n.HasProperties ?? [{}]).map((l) => (l.value && o(l.value), l.value)).filter((l) => l !== null);
8023
+ return !n || n.type !== D.IFCPROPERTYSET ? null : (n.HasProperties ?? [{}]).map((c) => (c.value && o(c.value), c.value)).filter((c) => c !== null);
7949
8024
  }
7950
8025
  static async getPsetRel(s, t) {
7951
8026
  var r;
@@ -8082,11 +8157,11 @@ const Zr = /* @__PURE__ */ new Map([
8082
8157
  constructor(t) {
8083
8158
  super(t);
8084
8159
  /** {@link Disposable.onDisposed} */
8085
- I(this, "onDisposed", new U());
8086
- I(this, "enabled", !0);
8087
- I(this, "onRelationsIndexed", new U());
8088
- I(this, "_relToAttributesMap", Zr);
8089
- I(this, "_inverseAttributes", [
8160
+ u(this, "onDisposed", new U());
8161
+ u(this, "enabled", !0);
8162
+ u(this, "onRelationsIndexed", new U());
8163
+ u(this, "_relToAttributesMap", Zr);
8164
+ u(this, "_inverseAttributes", [
8090
8165
  "IsDecomposedBy",
8091
8166
  "Decomposes",
8092
8167
  "AssociatedTo",
@@ -8102,7 +8177,7 @@ const Zr = /* @__PURE__ */ new Map([
8102
8177
  "ContainedInStructure",
8103
8178
  "ContainsElements"
8104
8179
  ]);
8105
- I(this, "_ifcRels", [
8180
+ u(this, "_ifcRels", [
8106
8181
  D.IFCRELAGGREGATES,
8107
8182
  D.IFCRELASSOCIATESMATERIAL,
8108
8183
  D.IFCRELASSOCIATESCLASSIFICATION,
@@ -8120,11 +8195,11 @@ const Zr = /* @__PURE__ */ new Map([
8120
8195
  * that are related through that relation type. This structure allows for efficient querying
8121
8196
  * of entity relationships within a model.
8122
8197
  */
8123
- I(this, "relationMaps", {});
8124
- I(this, "onFragmentsDisposed", (t) => {
8198
+ u(this, "relationMaps", {});
8199
+ u(this, "onFragmentsDisposed", (t) => {
8125
8200
  delete this.relationMaps[t.groupID];
8126
8201
  });
8127
- this.components.add(Ve.uuid, this), t.get(ut).onFragmentsDisposed.add(this.onFragmentsDisposed);
8202
+ this.components.add(Ve.uuid, this), t.get(It).onFragmentsDisposed.add(this.onFragmentsDisposed);
8128
8203
  }
8129
8204
  /**
8130
8205
  * Adds a relation map to the model's relations map.
@@ -8171,11 +8246,11 @@ const Zr = /* @__PURE__ */ new Map([
8171
8246
  const r = this._relToAttributesMap.get(i);
8172
8247
  if (!r)
8173
8248
  return;
8174
- const { forRelated: a, forRelating: l } = r, E = e.get(o) ?? /* @__PURE__ */ new Map(), d = this._inverseAttributes.indexOf(l);
8249
+ const { forRelated: a, forRelating: c } = r, E = e.get(o) ?? /* @__PURE__ */ new Map(), d = this._inverseAttributes.indexOf(c);
8175
8250
  E.set(d, n), e.set(o, E);
8176
8251
  for (const h of n) {
8177
- const u = e.get(h) ?? /* @__PURE__ */ new Map(), p = this._inverseAttributes.indexOf(a), A = u.get(p) ?? [];
8178
- A.push(o), u.set(p, A), e.set(h, u);
8252
+ const I = e.get(h) ?? /* @__PURE__ */ new Map(), p = this._inverseAttributes.indexOf(a), A = I.get(p) ?? [];
8253
+ A.push(o), I.set(p, A), e.set(h, I);
8179
8254
  }
8180
8255
  }
8181
8256
  );
@@ -8195,19 +8270,19 @@ const Zr = /* @__PURE__ */ new Map([
8195
8270
  const n = this._relToAttributesMap.get(o);
8196
8271
  if (!n)
8197
8272
  continue;
8198
- const { forRelated: r, forRelating: a } = n, l = t.GetLineIDsWithType(e, o);
8199
- for (let E = 0; E < l.size(); E++) {
8273
+ const { forRelated: r, forRelating: a } = n, c = t.GetLineIDsWithType(e, o);
8274
+ for (let E = 0; E < c.size(); E++) {
8200
8275
  const d = await t.properties.getItemProperties(
8201
8276
  e,
8202
- l.get(E)
8277
+ c.get(E)
8203
8278
  ), h = Object.keys(d).find(
8204
8279
  (T) => T.startsWith("Relating")
8205
- ), u = Object.keys(d).find(
8280
+ ), I = Object.keys(d).find(
8206
8281
  (T) => T.startsWith("Related")
8207
8282
  );
8208
- if (!(h && u))
8283
+ if (!(h && I))
8209
8284
  continue;
8210
- const p = d[h].value, A = d[u].map((T) => T.value), R = i.get(p) ?? /* @__PURE__ */ new Map(), C = this._inverseAttributes.indexOf(a);
8285
+ const p = d[h].value, A = d[I].map((T) => T.value), R = i.get(p) ?? /* @__PURE__ */ new Map(), C = this._inverseAttributes.indexOf(a);
8211
8286
  R.set(C, A), i.set(p, R);
8212
8287
  for (const T of A) {
8213
8288
  const F = i.get(T) ?? /* @__PURE__ */ new Map(), f = this._inverseAttributes.indexOf(r), m = F.get(f) ?? [];
@@ -8290,8 +8365,8 @@ const Zr = /* @__PURE__ */ new Map([
8290
8365
  const i = this.relationMaps[e], o = {};
8291
8366
  for (const [n, r] of i.entries()) {
8292
8367
  o[n] || (o[n] = {});
8293
- for (const [a, l] of r.entries())
8294
- o[n][a] = l;
8368
+ for (const [a, c] of r.entries())
8369
+ o[n][a] = c;
8295
8370
  }
8296
8371
  t[e] = o;
8297
8372
  }
@@ -8325,15 +8400,15 @@ const Zr = /* @__PURE__ */ new Map([
8325
8400
  * references that could prevent garbage collection.
8326
8401
  */
8327
8402
  dispose() {
8328
- this.relationMaps = {}, this.components.get(ut).onFragmentsDisposed.remove(this.onFragmentsDisposed), this.onDisposed.trigger(Ve.uuid), this.onDisposed.reset();
8403
+ this.relationMaps = {}, this.components.get(It).onFragmentsDisposed.remove(this.onFragmentsDisposed), this.onDisposed.trigger(Ve.uuid), this.onDisposed.reset();
8329
8404
  }
8330
8405
  };
8331
- I(Ve, "uuid", "23a889ab-83b3-44a4-8bee-ead83438370b");
8406
+ u(Ve, "uuid", "23a889ab-83b3-44a4-8bee-ead83438370b");
8332
8407
  let As = Ve;
8333
8408
  class Qr {
8334
8409
  constructor() {
8335
- I(this, "factor", 1);
8336
- I(this, "complement", 1);
8410
+ u(this, "factor", 1);
8411
+ u(this, "complement", 1);
8337
8412
  }
8338
8413
  apply(s) {
8339
8414
  const e = this.getScaleMatrix().multiply(s);
@@ -8390,8 +8465,8 @@ class Qr {
8390
8465
  }
8391
8466
  class vn {
8392
8467
  constructor() {
8393
- I(this, "itemsByFloor", {});
8394
- I(this, "_units", new Qr());
8468
+ u(this, "itemsByFloor", {});
8469
+ u(this, "_units", new Qr());
8395
8470
  }
8396
8471
  // TODO: Maybe make this more flexible so that it also support more exotic spatial structures?
8397
8472
  setUp(s) {
@@ -8401,51 +8476,51 @@ class vn {
8401
8476
  0,
8402
8477
  D.IFCRELCONTAINEDINSPATIALSTRUCTURE
8403
8478
  ), e = /* @__PURE__ */ new Set(), i = s.GetLineIDsWithType(0, D.IFCSPACE);
8404
- for (let l = 0; l < i.size(); l++)
8405
- e.add(i.get(l));
8479
+ for (let c = 0; c < i.size(); c++)
8480
+ e.add(i.get(c));
8406
8481
  const o = s.GetLineIDsWithType(0, D.IFCRELAGGREGATES), n = o.size();
8407
- for (let l = 0; l < n; l++) {
8408
- const E = o.get(l), d = s.GetLine(0, E);
8482
+ for (let c = 0; c < n; c++) {
8483
+ const E = o.get(c), d = s.GetLine(0, E);
8409
8484
  if (!d || !d.RelatingObject || !d.RelatedObjects)
8410
8485
  continue;
8411
- const h = d.RelatingObject.value, u = d.RelatedObjects;
8412
- for (const p of u) {
8486
+ const h = d.RelatingObject.value, I = d.RelatedObjects;
8487
+ for (const p of I) {
8413
8488
  const A = p.value;
8414
8489
  e.has(A) && (this.itemsByFloor[A] = h);
8415
8490
  }
8416
8491
  }
8417
8492
  const r = {}, a = t.size();
8418
- for (let l = 0; l < a; l++) {
8419
- const E = t.get(l), d = s.GetLine(0, E);
8493
+ for (let c = 0; c < a; c++) {
8494
+ const E = t.get(c), d = s.GetLine(0, E);
8420
8495
  if (!d || !d.RelatingStructure || !d.RelatedElements)
8421
8496
  continue;
8422
- const h = d.RelatingStructure.value, u = d.RelatedElements;
8497
+ const h = d.RelatingStructure.value, I = d.RelatedElements;
8423
8498
  if (e.has(h))
8424
- for (const p of u) {
8499
+ for (const p of I) {
8425
8500
  r[h] || (r[h] = []);
8426
8501
  const A = p.value;
8427
8502
  r[h].push(A);
8428
8503
  }
8429
8504
  else
8430
- for (const p of u) {
8505
+ for (const p of I) {
8431
8506
  const A = p.value;
8432
8507
  this.itemsByFloor[A] = h;
8433
8508
  }
8434
8509
  }
8435
- for (const l in r) {
8436
- const E = this.itemsByFloor[l];
8510
+ for (const c in r) {
8511
+ const E = this.itemsByFloor[c];
8437
8512
  if (E !== void 0) {
8438
- const d = r[l];
8513
+ const d = r[c];
8439
8514
  for (const h of d)
8440
8515
  this.itemsByFloor[h] = E;
8441
8516
  }
8442
8517
  }
8443
- for (let l = 0; l < n; l++) {
8444
- const E = o.get(l), d = s.GetLine(0, E);
8518
+ for (let c = 0; c < n; c++) {
8519
+ const E = o.get(c), d = s.GetLine(0, E);
8445
8520
  if (!d || !d.RelatingObject || !d.RelatedObjects)
8446
8521
  continue;
8447
- const h = d.RelatingObject.value, u = d.RelatedObjects;
8448
- for (const p of u) {
8522
+ const h = d.RelatingObject.value, I = d.RelatedObjects;
8523
+ for (const p of I) {
8449
8524
  const A = p.value, R = this.itemsByFloor[h];
8450
8525
  R !== void 0 && (this.itemsByFloor[A] = R);
8451
8526
  }
@@ -8461,36 +8536,36 @@ class vn {
8461
8536
  class Li {
8462
8537
  constructor() {
8463
8538
  /** Whether to extract the IFC properties into a JSON. */
8464
- I(this, "includeProperties", !0);
8539
+ u(this, "includeProperties", !0);
8465
8540
  /**
8466
8541
  * Generate the geometry for categories that are not included by default,
8467
8542
  * like IFCSPACE.
8468
8543
  */
8469
- I(this, "optionalCategories", [D.IFCSPACE]);
8544
+ u(this, "optionalCategories", [D.IFCSPACE]);
8470
8545
  /** Whether to use the coordination data coming from the IFC files. */
8471
- I(this, "coordinate", !0);
8546
+ u(this, "coordinate", !0);
8472
8547
  /** Path of the WASM for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
8473
- I(this, "wasm", {
8548
+ u(this, "wasm", {
8474
8549
  path: "",
8475
8550
  absolute: !1,
8476
8551
  logLevel: D.LogLevel.LOG_LEVEL_OFF
8477
8552
  });
8478
8553
  /** List of categories that won't be converted to fragments. */
8479
- I(this, "excludedCategories", /* @__PURE__ */ new Set());
8554
+ u(this, "excludedCategories", /* @__PURE__ */ new Set());
8480
8555
  /** Whether to save the absolute location of all IFC items. */
8481
- I(this, "saveLocations", !1);
8556
+ u(this, "saveLocations", !1);
8482
8557
  /** Loader settings for [web-ifc](https://github.com/ThatOpen/engine_web-ifc). */
8483
- I(this, "webIfc", {
8558
+ u(this, "webIfc", {
8484
8559
  COORDINATE_TO_ORIGIN: !0,
8485
8560
  OPTIMIZE_PROFILES: !0
8486
8561
  });
8487
- I(this, "autoSetWasm", !0);
8488
- I(this, "customLocateFileHandler", null);
8562
+ u(this, "autoSetWasm", !0);
8563
+ u(this, "customLocateFileHandler", null);
8489
8564
  }
8490
8565
  }
8491
8566
  class Bn {
8492
8567
  constructor() {
8493
- I(this, "defLineMat", new g.LineBasicMaterial({ color: 16777215 }));
8568
+ u(this, "defLineMat", new g.LineBasicMaterial({ color: 16777215 }));
8494
8569
  }
8495
8570
  read(s) {
8496
8571
  const t = s.GetAllAlignments(0), e = s.GetAllCrossSections2D(0), i = s.GetAllCrossSections3D(0), o = {
@@ -8517,16 +8592,16 @@ class Bn {
8517
8592
  const n = {};
8518
8593
  if (o.data)
8519
8594
  for (const h of o.data) {
8520
- const [u, p] = h.split(": "), A = parseFloat(p);
8521
- n[u] = A || p;
8595
+ const [I, p] = h.split(": "), A = parseFloat(p);
8596
+ n[I] = A || p;
8522
8597
  }
8523
8598
  const { points: r } = o, a = new Float32Array(r.length * 3);
8524
8599
  for (let h = 0; h < r.length; h++) {
8525
- const { x: u, y: p, z: A } = r[h];
8526
- a[h * 3] = u, a[h * 3 + 1] = p, a[h * 3 + 2] = A || 0;
8600
+ const { x: I, y: p, z: A } = r[h];
8601
+ a[h * 3] = I, a[h * 3 + 1] = p, a[h * 3 + 2] = A || 0;
8527
8602
  }
8528
- const l = new g.BufferAttribute(a, 3), E = new g.EdgesGeometry();
8529
- E.setAttribute("position", l);
8603
+ const c = new g.BufferAttribute(a, 3), E = new g.EdgesGeometry();
8604
+ E.setAttribute("position", c);
8530
8605
  const d = new Vt.CurveMesh(
8531
8606
  i,
8532
8607
  n,
@@ -8558,20 +8633,20 @@ class Yn {
8558
8633
  const Ge = class Ge extends J {
8559
8634
  constructor(t) {
8560
8635
  super(t);
8561
- I(this, "onIfcStartedLoading", new U());
8562
- I(this, "onSetup", new U());
8636
+ u(this, "onIfcStartedLoading", new U());
8637
+ u(this, "onSetup", new U());
8563
8638
  /** {@link Disposable.onDisposed} */
8564
- I(this, "onDisposed", new U());
8565
- I(this, "settings", new Li());
8566
- I(this, "enabled", !0);
8567
- I(this, "webIfc", new D.IfcAPI());
8568
- I(this, "_material", new g.MeshLambertMaterial());
8569
- I(this, "_spatialTree", new vn());
8570
- I(this, "_metaData", new Yn());
8571
- I(this, "_fragmentInstances", /* @__PURE__ */ new Map());
8572
- I(this, "_civil", new Bn());
8573
- I(this, "_visitedFragments", /* @__PURE__ */ new Map());
8574
- I(this, "_materialT", new g.MeshLambertMaterial({
8639
+ u(this, "onDisposed", new U());
8640
+ u(this, "settings", new Li());
8641
+ u(this, "enabled", !0);
8642
+ u(this, "webIfc", new D.IfcAPI());
8643
+ u(this, "_material", new g.MeshLambertMaterial());
8644
+ u(this, "_spatialTree", new vn());
8645
+ u(this, "_metaData", new Yn());
8646
+ u(this, "_fragmentInstances", /* @__PURE__ */ new Map());
8647
+ u(this, "_civil", new Bn());
8648
+ u(this, "_visitedFragments", /* @__PURE__ */ new Map());
8649
+ u(this, "_materialT", new g.MeshLambertMaterial({
8575
8650
  transparent: !0,
8576
8651
  opacity: 0.5
8577
8652
  }));
@@ -8588,10 +8663,10 @@ const Ge = class Ge extends J {
8588
8663
  this.onIfcStartedLoading.trigger(), await this.readIfcFile(t);
8589
8664
  const o = await this.getAllGeometries(), r = await this.components.get(Ti).export(this.webIfc, 0);
8590
8665
  o.setLocalProperties(r), this.cleanUp();
8591
- const a = this.components.get(ut);
8666
+ const a = this.components.get(It);
8592
8667
  a.groups.set(o.uuid, o);
8593
- for (const l of o.items)
8594
- a.list.set(l.id, l), l.mesh.uuid = l.id, l.group = o;
8668
+ for (const c of o.items)
8669
+ a.list.set(c.id, c), c.mesh.uuid = c.id, c.group = o;
8595
8670
  return a.onFragmentsLoaded.trigger(o), e && a.coordinate([o]), console.log(`Streaming the IFC took ${performance.now() - i} ms!`), o;
8596
8671
  }
8597
8672
  async readIfcFile(t) {
@@ -8611,27 +8686,27 @@ const Ge = class Ge extends J {
8611
8686
  for (const a of t) {
8612
8687
  if (!this.webIfc.IsIfcElement(a) && a !== D.IFCSPACE || this.settings.excludedCategories.has(a))
8613
8688
  continue;
8614
- const l = this.webIfc.GetLineIDsWithType(0, a), E = l.size();
8689
+ const c = this.webIfc.GetLineIDsWithType(0, a), E = c.size();
8615
8690
  for (let d = 0; d < E; d++) {
8616
- const h = l.get(d);
8691
+ const h = c.get(d);
8617
8692
  n.push(h);
8618
- const u = this._spatialTree.itemsByFloor[h] || 0;
8619
- e.data.set(h, [[], [u, a]]);
8693
+ const I = this._spatialTree.itemsByFloor[h] || 0;
8694
+ e.data.set(h, [[], [I, a]]);
8620
8695
  }
8621
8696
  }
8622
8697
  this._spatialTree.cleanUp(), this.webIfc.StreamMeshes(0, n, (a) => {
8623
8698
  this.getMesh(a, e);
8624
8699
  });
8625
8700
  for (const a of this._visitedFragments) {
8626
- const { index: l, fragment: E } = a[1];
8627
- e.keyFragments.set(l, E.id);
8701
+ const { index: c, fragment: E } = a[1];
8702
+ e.keyFragments.set(c, E.id);
8628
8703
  }
8629
8704
  for (const a of e.items) {
8630
- const l = this._fragmentInstances.get(a.id);
8631
- if (!l)
8705
+ const c = this._fragmentInstances.get(a.id);
8706
+ if (!c)
8632
8707
  throw new Error("Fragment not found!");
8633
8708
  const E = [];
8634
- for (const [d, h] of l)
8709
+ for (const [d, h] of c)
8635
8710
  E.push(h);
8636
8711
  a.add(E);
8637
8712
  }
@@ -8644,14 +8719,14 @@ const Ge = class Ge extends J {
8644
8719
  getMesh(t, e) {
8645
8720
  const i = t.geometries.size(), o = t.expressID;
8646
8721
  for (let n = 0; n < i; n++) {
8647
- const r = t.geometries.get(n), { x: a, y: l, z: E, w: d } = r.color, h = d !== 1, { geometryExpressID: u } = r, p = `${u}-${h}`;
8722
+ const r = t.geometries.get(n), { x: a, y: c, z: E, w: d } = r.color, h = d !== 1, { geometryExpressID: I } = r, p = `${I}-${h}`;
8648
8723
  if (!this._visitedFragments.has(p)) {
8649
- const m = this.getGeometry(this.webIfc, u), O = h ? this._materialT : this._material, S = new Vt.Fragment(m, O, 1);
8724
+ const m = this.getGeometry(this.webIfc, I), O = h ? this._materialT : this._material, S = new Vt.Fragment(m, O, 1);
8650
8725
  e.add(S.mesh), e.items.push(S);
8651
8726
  const _ = this._visitedFragments.size;
8652
8727
  this._visitedFragments.set(p, { index: _, fragment: S });
8653
8728
  }
8654
- const A = new g.Color().setRGB(a, l, E, "srgb"), R = new g.Matrix4();
8729
+ const A = new g.Color().setRGB(a, c, E, "srgb"), R = new g.Matrix4();
8655
8730
  R.fromArray(r.flatTransformation);
8656
8731
  const C = this._visitedFragments.get(p);
8657
8732
  if (C === void 0)
@@ -8684,8 +8759,8 @@ const Ge = class Ge extends J {
8684
8759
  ), r = new Float32Array(n.length / 2), a = new Float32Array(n.length / 2);
8685
8760
  for (let h = 0; h < n.length; h += 6)
8686
8761
  r[h / 2] = n[h], r[h / 2 + 1] = n[h + 1], r[h / 2 + 2] = n[h + 2], a[h / 2] = n[h + 3], a[h / 2 + 1] = n[h + 4], a[h / 2 + 2] = n[h + 5];
8687
- const l = new g.BufferGeometry(), E = new g.BufferAttribute(r, 3), d = new g.BufferAttribute(a, 3);
8688
- return l.setAttribute("position", E), l.setAttribute("normal", d), l.setIndex(Array.from(o)), i.delete(), l;
8762
+ const c = new g.BufferGeometry(), E = new g.BufferAttribute(r, 3), d = new g.BufferAttribute(a, 3);
8763
+ return c.setAttribute("position", E), c.setAttribute("normal", d), c.setIndex(Array.from(o)), i.delete(), c;
8689
8764
  }
8690
8765
  async autoSetWasm() {
8691
8766
  const t = await fetch(
@@ -8708,27 +8783,27 @@ const Ge = class Ge extends J {
8708
8783
  }
8709
8784
  }
8710
8785
  };
8711
- I(Ge, "uuid", "a659add7-1418-4771-a0d6-7d4d438e4624");
8786
+ u(Ge, "uuid", "a659add7-1418-4771-a0d6-7d4d438e4624");
8712
8787
  let mi = Ge;
8713
8788
  const Bt = class Bt extends J {
8714
8789
  constructor(t) {
8715
8790
  super(t);
8716
8791
  /** {@link Disposable.onDisposed} */
8717
- I(this, "onDisposed", new U());
8718
- I(this, "onRequestFile", new U());
8719
- I(this, "ifcToExport", null);
8720
- I(this, "onElementToPset", new U());
8721
- I(this, "onPropToPset", new U());
8722
- I(this, "onPsetRemoved", new U());
8723
- I(this, "onDataChanged", new U());
8724
- I(this, "wasm", {
8792
+ u(this, "onDisposed", new U());
8793
+ u(this, "onRequestFile", new U());
8794
+ u(this, "ifcToExport", null);
8795
+ u(this, "onElementToPset", new U());
8796
+ u(this, "onPropToPset", new U());
8797
+ u(this, "onPsetRemoved", new U());
8798
+ u(this, "onDataChanged", new U());
8799
+ u(this, "wasm", {
8725
8800
  path: "/",
8726
8801
  absolute: !1
8727
8802
  });
8728
- I(this, "enabled", !0);
8729
- I(this, "attributeListeners", {});
8730
- I(this, "selectedModel");
8731
- I(this, "changeMap", {});
8803
+ u(this, "enabled", !0);
8804
+ u(this, "attributeListeners", {});
8805
+ u(this, "selectedModel");
8806
+ u(this, "changeMap", {});
8732
8807
  this.components.add(Bt.uuid, this);
8733
8808
  }
8734
8809
  dispose() {
@@ -8768,11 +8843,11 @@ const Bt = class Bt extends J {
8768
8843
  }
8769
8844
  }
8770
8845
  async newPset(t, e, i) {
8771
- const o = Bt.getIFCSchema(t), { ownerHistoryHandle: n } = await this.getOwnerHistory(t), r = this.newGUID(t), a = new D[o].IfcLabel(e), l = i ? new D[o].IfcText(i) : null, E = new D[o].IfcPropertySet(
8846
+ const o = Bt.getIFCSchema(t), { ownerHistoryHandle: n } = await this.getOwnerHistory(t), r = this.newGUID(t), a = new D[o].IfcLabel(e), c = i ? new D[o].IfcText(i) : null, E = new D[o].IfcPropertySet(
8772
8847
  r,
8773
8848
  n,
8774
8849
  a,
8775
- l,
8850
+ c,
8776
8851
  []
8777
8852
  );
8778
8853
  E.expressID = this.increaseMaxID(t);
@@ -8800,13 +8875,13 @@ const Bt = class Bt extends J {
8800
8875
  }
8801
8876
  }
8802
8877
  async newSingleProperty(t, e, i, o) {
8803
- const n = Bt.getIFCSchema(t), r = new D[n].IfcIdentifier(i), a = new D[n][e](o), l = new D[n].IfcPropertySingleValue(
8878
+ const n = Bt.getIFCSchema(t), r = new D[n].IfcIdentifier(i), a = new D[n][e](o), c = new D[n].IfcPropertySingleValue(
8804
8879
  r,
8805
8880
  null,
8806
8881
  a,
8807
8882
  null
8808
8883
  );
8809
- return l.expressID = this.increaseMaxID(t), await this.setData(t, l), l;
8884
+ return c.expressID = this.increaseMaxID(t), await this.setData(t, c), c;
8810
8885
  }
8811
8886
  newSingleStringProperty(t, e, i, o) {
8812
8887
  return this.newSingleProperty(t, e, i, o);
@@ -8852,8 +8927,8 @@ const Bt = class Bt extends J {
8852
8927
  }
8853
8928
  async saveToIfc(t, e) {
8854
8929
  const i = this.components.get(mi), o = i.webIfc, n = await i.readIfcFile(e), r = this.changeMap[t.uuid] ?? [];
8855
- for (const l of r) {
8856
- const E = await t.getProperties(l);
8930
+ for (const c of r) {
8931
+ const E = await t.getProperties(c);
8857
8932
  if (E)
8858
8933
  try {
8859
8934
  o.WriteLine(n, E);
@@ -8861,7 +8936,7 @@ const Bt = class Bt extends J {
8861
8936
  }
8862
8937
  else
8863
8938
  try {
8864
- o.DeleteLine(n, l);
8939
+ o.DeleteLine(n, c);
8865
8940
  } catch {
8866
8941
  }
8867
8942
  }
@@ -8884,28 +8959,28 @@ const Bt = class Bt extends J {
8884
8959
  const a = r.value;
8885
8960
  if (a === void 0 || a == null)
8886
8961
  throw new Error(`Attribute ${i} has a badly defined handle.`);
8887
- const l = new U();
8962
+ const c = new U();
8888
8963
  return Object.defineProperty(n[i], "value", {
8889
8964
  get() {
8890
8965
  return this._value;
8891
8966
  },
8892
8967
  async set(E) {
8893
- this._value = E, l.trigger(E);
8968
+ this._value = E, c.trigger(E);
8894
8969
  }
8895
- }), n[i].value = a, this.attributeListeners[t.uuid][e] || (this.attributeListeners[t.uuid][e] = {}), this.attributeListeners[t.uuid][e][i] = l, l;
8970
+ }), n[i].value = a, this.attributeListeners[t.uuid][e] || (this.attributeListeners[t.uuid][e] = {}), this.attributeListeners[t.uuid][e][i] = c, c;
8896
8971
  }
8897
8972
  };
8898
- I(Bt, "uuid", "58c2d9f0-183c-48d6-a402-dfcf5b9a34df");
8973
+ u(Bt, "uuid", "58c2d9f0-183c-48d6-a402-dfcf5b9a34df");
8899
8974
  let Fn = Bt;
8900
8975
  const Ps = class Ps extends J {
8901
8976
  constructor(t) {
8902
8977
  super(t);
8903
8978
  /** {@link Component.enabled} */
8904
- I(this, "enabled", !0);
8905
- I(this, "list", {});
8979
+ u(this, "enabled", !0);
8980
+ u(this, "list", {});
8906
8981
  /** {@link Disposable.onDisposed} */
8907
- I(this, "onDisposed", new U());
8908
- I(this, "onFragmentsDisposed", (t) => {
8982
+ u(this, "onDisposed", new U());
8983
+ u(this, "onFragmentsDisposed", (t) => {
8909
8984
  const { groupID: e, fragmentIDs: i } = t;
8910
8985
  for (const o in this.list) {
8911
8986
  const n = this.list[o], r = Object.keys(n);
@@ -8913,17 +8988,17 @@ const Ps = class Ps extends J {
8913
8988
  delete n[e], Object.values(n).length === 0 && delete this.list[o];
8914
8989
  else
8915
8990
  for (const a of r) {
8916
- const l = n[a];
8991
+ const c = n[a];
8917
8992
  for (const E of i)
8918
- delete l[E];
8919
- Object.values(l).length === 0 && delete n[a];
8993
+ delete c[E];
8994
+ Object.values(c).length === 0 && delete n[a];
8920
8995
  }
8921
8996
  }
8922
8997
  });
8923
- t.add(Ps.uuid, this), t.get(ut).onFragmentsDisposed.add(this.onFragmentsDisposed);
8998
+ t.add(Ps.uuid, this), t.get(It).onFragmentsDisposed.add(this.onFragmentsDisposed);
8924
8999
  }
8925
9000
  dispose() {
8926
- this.list = {}, this.components.get(ut).onFragmentsDisposed.remove(this.onFragmentsDisposed), this.onDisposed.trigger(), this.onDisposed.reset();
9001
+ this.list = {}, this.components.get(It).onFragmentsDisposed.remove(this.onFragmentsDisposed), this.onDisposed.trigger(), this.onDisposed.reset();
8927
9002
  }
8928
9003
  remove(t) {
8929
9004
  for (const e in this.list) {
@@ -8935,11 +9010,11 @@ const Ps = class Ps extends J {
8935
9010
  }
8936
9011
  }
8937
9012
  find(t) {
8938
- const e = this.components.get(ut);
9013
+ const e = this.components.get(It);
8939
9014
  if (!t) {
8940
9015
  const r = {};
8941
- for (const [a, l] of e.list)
8942
- r[a] = new Set(l.ids);
9016
+ for (const [a, c] of e.list)
9017
+ r[a] = new Set(c.ids);
8943
9018
  return r;
8944
9019
  }
8945
9020
  const i = Object.keys(t).length, o = {};
@@ -8949,14 +9024,14 @@ const Ps = class Ps extends J {
8949
9024
  console.warn(`Classification ${r} does not exist.`);
8950
9025
  continue;
8951
9026
  }
8952
- for (const l of a) {
8953
- const E = this.list[r][l];
9027
+ for (const c of a) {
9028
+ const E = this.list[r][c];
8954
9029
  if (E)
8955
9030
  for (const d in E) {
8956
9031
  o[d] || (o[d] = /* @__PURE__ */ new Map());
8957
9032
  for (const h of E[d]) {
8958
- const u = o[d].get(h);
8959
- u === void 0 ? o[d].set(h, 1) : o[d].set(h, u + 1);
9033
+ const I = o[d].get(h);
9034
+ I === void 0 ? o[d].set(h, 1) : o[d].set(h, I + 1);
8960
9035
  }
8961
9036
  }
8962
9037
  }
@@ -8964,10 +9039,10 @@ const Ps = class Ps extends J {
8964
9039
  const n = {};
8965
9040
  for (const r in o) {
8966
9041
  const a = o[r];
8967
- for (const [l, E] of a) {
9042
+ for (const [c, E] of a) {
8968
9043
  if (E === void 0)
8969
9044
  throw new Error("Malformed fragments map!");
8970
- E === i && (n[r] || (n[r] = /* @__PURE__ */ new Set()), n[r].add(l));
9045
+ E === i && (n[r] || (n[r] = /* @__PURE__ */ new Set()), n[r].add(c));
8971
9046
  }
8972
9047
  }
8973
9048
  return n;
@@ -8979,8 +9054,8 @@ const Ps = class Ps extends J {
8979
9054
  const o = i[t];
8980
9055
  for (const [n, r] of e.data) {
8981
9056
  const a = r[0];
8982
- for (const l of a) {
8983
- const E = e.keyFragments.get(l);
9057
+ for (const c of a) {
9058
+ const E = e.keyFragments.get(c);
8984
9059
  E && (o[E] || (o[E] = /* @__PURE__ */ new Set()), o[E].add(n));
8985
9060
  }
8986
9061
  }
@@ -8995,14 +9070,14 @@ const Ps = class Ps extends J {
8995
9070
  continue;
8996
9071
  const a = String((o = r.PredefinedType) == null ? void 0 : o.value).toUpperCase();
8997
9072
  e[a] || (e[a] = {});
8998
- const l = e[a];
9073
+ const c = e[a];
8999
9074
  for (const [E, d] of t.data) {
9000
9075
  const h = d[0];
9001
- for (const u of h) {
9002
- const p = t.keyFragments.get(u);
9076
+ for (const I of h) {
9077
+ const p = t.keyFragments.get(I);
9003
9078
  if (!p)
9004
9079
  throw new Error("Fragment ID not found!");
9005
- l[p] || (l[p] = /* @__PURE__ */ new Set()), l[p].add(r.expressID);
9080
+ c[p] || (c[p] = /* @__PURE__ */ new Set()), c[p].add(r.expressID);
9006
9081
  }
9007
9082
  }
9008
9083
  }
@@ -9040,7 +9115,7 @@ const Ps = class Ps extends J {
9040
9115
  );
9041
9116
  }
9042
9117
  setColor(t, e, i = !1) {
9043
- const o = this.components.get(ut);
9118
+ const o = this.components.get(It);
9044
9119
  for (const n in t) {
9045
9120
  const r = o.list.get(n);
9046
9121
  if (!r)
@@ -9050,7 +9125,7 @@ const Ps = class Ps extends J {
9050
9125
  }
9051
9126
  }
9052
9127
  resetColor(t) {
9053
- const e = this.components.get(ut);
9128
+ const e = this.components.get(It);
9054
9129
  for (const i in t) {
9055
9130
  const o = e.list.get(i);
9056
9131
  if (!o)
@@ -9066,23 +9141,23 @@ const Ps = class Ps extends J {
9066
9141
  for (const r of n[0]) {
9067
9142
  const a = t.keyFragments.get(r);
9068
9143
  if (a) {
9069
- const l = this.list[e];
9070
- l[i] || (l[i] = {}), l[i][a] || (l[i][a] = /* @__PURE__ */ new Set()), l[i][a].add(o);
9144
+ const c = this.list[e];
9145
+ c[i] || (c[i] = {}), c[i][a] || (c[i][a] = /* @__PURE__ */ new Set()), c[i][a].add(o);
9071
9146
  }
9072
9147
  }
9073
9148
  }
9074
9149
  };
9075
- I(Ps, "uuid", "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7");
9150
+ u(Ps, "uuid", "e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7");
9076
9151
  let Ri = Ps;
9077
9152
  const Ls = class Ls extends J {
9078
9153
  constructor(t) {
9079
9154
  super(t);
9080
- I(this, "enabled", !0);
9081
- I(this, "height", 10);
9082
- I(this, "groupName", "storeys");
9155
+ u(this, "enabled", !0);
9156
+ u(this, "height", 10);
9157
+ u(this, "groupName", "storeys");
9083
9158
  /** {@link Disposable.onDisposed} */
9084
- I(this, "onDisposed", new U());
9085
- I(this, "list", /* @__PURE__ */ new Set());
9159
+ u(this, "onDisposed", new U());
9160
+ u(this, "list", /* @__PURE__ */ new Set());
9086
9161
  t.add(Ls.uuid, this);
9087
9162
  }
9088
9163
  dispose() {
@@ -9091,33 +9166,33 @@ const Ls = class Ls extends J {
9091
9166
  set(t) {
9092
9167
  if (!this.enabled)
9093
9168
  return;
9094
- const e = this.components.get(Ri), i = this.components.get(ut), o = t ? 1 : -1;
9169
+ const e = this.components.get(Ri), i = this.components.get(It), o = t ? 1 : -1;
9095
9170
  let n = 0;
9096
9171
  const r = e.list[this.groupName], a = new g.Matrix4();
9097
- for (const l in r) {
9172
+ for (const c in r) {
9098
9173
  a.elements[13] = n * o * this.height;
9099
- for (const E in r[l]) {
9100
- const d = i.list.get(E), h = l + E, u = this.list.has(h);
9101
- if (!d || t && u || !t && !u)
9174
+ for (const E in r[c]) {
9175
+ const d = i.list.get(E), h = c + E, I = this.list.has(h);
9176
+ if (!d || t && I || !t && !I)
9102
9177
  continue;
9103
9178
  t ? this.list.add(h) : this.list.delete(h);
9104
- const p = r[l][E];
9179
+ const p = r[c][E];
9105
9180
  d.applyTransform(p, a);
9106
9181
  }
9107
9182
  n++;
9108
9183
  }
9109
9184
  }
9110
9185
  };
9111
- I(Ls, "uuid", "d260618b-ce88-4c7d-826c-6debb91de3e2");
9186
+ u(Ls, "uuid", "d260618b-ce88-4c7d-826c-6debb91de3e2");
9112
9187
  let On = Ls;
9113
9188
  const ys = class ys extends J {
9114
9189
  constructor(t) {
9115
9190
  super(t);
9116
- I(this, "enabled", !0);
9191
+ u(this, "enabled", !0);
9117
9192
  this.components.add(ys.uuid, this);
9118
9193
  }
9119
9194
  set(t, e) {
9120
- const i = this.components.get(ut);
9195
+ const i = this.components.get(It);
9121
9196
  if (!e) {
9122
9197
  for (const o in i.list) {
9123
9198
  const n = i.list.get(o);
@@ -9141,32 +9216,32 @@ const ys = class ys extends J {
9141
9216
  }
9142
9217
  }
9143
9218
  };
9144
- I(ys, "uuid", "dd9ccf2d-8a21-4821-b7f6-2949add16a29");
9219
+ u(ys, "uuid", "dd9ccf2d-8a21-4821-b7f6-2949add16a29");
9145
9220
  let gn = ys;
9146
9221
  class jr extends Li {
9147
9222
  constructor() {
9148
9223
  super(...arguments);
9149
- I(this, "minGeometrySize", 10);
9150
- I(this, "minAssetsSize", 1e3);
9224
+ u(this, "minGeometrySize", 10);
9225
+ u(this, "minAssetsSize", 1e3);
9151
9226
  }
9152
9227
  }
9153
9228
  class Vn extends Li {
9154
9229
  constructor() {
9155
9230
  super(...arguments);
9156
- I(this, "propertiesSize", 100);
9231
+ u(this, "propertiesSize", 100);
9157
9232
  }
9158
9233
  }
9159
9234
  class qr extends J {
9160
9235
  constructor() {
9161
9236
  super(...arguments);
9162
- I(this, "onPropertiesStreamed", new Kt());
9163
- I(this, "onProgress", new Kt());
9164
- I(this, "onIndicesStreamed", new Kt());
9237
+ u(this, "onPropertiesStreamed", new Kt());
9238
+ u(this, "onProgress", new Kt());
9239
+ u(this, "onIndicesStreamed", new Kt());
9165
9240
  /** {@link Disposable.onDisposed} */
9166
- I(this, "onDisposed", new U());
9167
- I(this, "enabled", !0);
9168
- I(this, "settings", new Vn());
9169
- I(this, "webIfc", new D.IfcAPI());
9241
+ u(this, "onDisposed", new U());
9242
+ u(this, "enabled", !0);
9243
+ u(this, "settings", new Vn());
9244
+ u(this, "webIfc", new D.IfcAPI());
9170
9245
  }
9171
9246
  async dispose() {
9172
9247
  this.onIndicesStreamed.reset(), this.onPropertiesStreamed.reset(), this.webIfc = null, this.onDisposed.reset();
@@ -9208,9 +9283,9 @@ class qr extends J {
9208
9283
  for (const E of e) {
9209
9284
  if (a++, Pi.has(E))
9210
9285
  continue;
9211
- const d = n.has(E), h = this.webIfc.GetLineIDsWithType(0, E), u = h.size();
9286
+ const d = n.has(E), h = this.webIfc.GetLineIDsWithType(0, E), I = h.size();
9212
9287
  let p = 0;
9213
- for (let R = 0; R < u - t; R += t) {
9288
+ for (let R = 0; R < I - t; R += t) {
9214
9289
  const C = {};
9215
9290
  for (let T = 0; T < t; T++) {
9216
9291
  p++;
@@ -9224,9 +9299,9 @@ class qr extends J {
9224
9299
  }
9225
9300
  await this.onPropertiesStreamed.trigger({ type: E, data: C });
9226
9301
  }
9227
- if (p !== u) {
9302
+ if (p !== I) {
9228
9303
  const R = {};
9229
- for (let C = p; C < u; C++) {
9304
+ for (let C = p; C < I; C++) {
9230
9305
  const T = h.get(C);
9231
9306
  try {
9232
9307
  const F = this.webIfc.GetLine(0, T, d);
@@ -9240,10 +9315,10 @@ class qr extends J {
9240
9315
  const A = a / e.size;
9241
9316
  A > r && (r += 0.01, r = Math.max(r, A), await this.onProgress.trigger(Math.round(r * 100) / 100));
9242
9317
  }
9243
- const l = [];
9318
+ const c = [];
9244
9319
  for (const [E, d] of o)
9245
- l.push([E, ...d]);
9246
- await this.onIndicesStreamed.trigger(l);
9320
+ c.push([E, ...d]);
9321
+ await this.onIndicesStreamed.trigger(c);
9247
9322
  }
9248
9323
  getIndices(t, e, i) {
9249
9324
  const o = t.RelatedObjects || t.RelatedElements;
@@ -9262,37 +9337,37 @@ class qr extends J {
9262
9337
  for (const a of o) {
9263
9338
  if (a.value === void 0 || a.value === null)
9264
9339
  continue;
9265
- const l = a.value;
9266
- i.has(l) || i.set(l, /* @__PURE__ */ new Set()), i.get(l).add(r);
9340
+ const c = a.value;
9341
+ i.has(c) || i.set(c, /* @__PURE__ */ new Set()), i.get(c).add(r);
9267
9342
  }
9268
9343
  }
9269
9344
  cleanUp() {
9270
9345
  this.webIfc = null, this.webIfc = new D.IfcAPI();
9271
9346
  }
9272
9347
  }
9273
- I(qr, "uuid", "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b");
9348
+ u(qr, "uuid", "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b");
9274
9349
  const ws = class ws extends J {
9275
9350
  constructor(t) {
9276
9351
  super(t);
9277
- I(this, "onGeometryStreamed", new U());
9278
- I(this, "onAssetStreamed", new U());
9279
- I(this, "onProgress", new U());
9280
- I(this, "onIfcLoaded", new U());
9352
+ u(this, "onGeometryStreamed", new U());
9353
+ u(this, "onAssetStreamed", new U());
9354
+ u(this, "onProgress", new U());
9355
+ u(this, "onIfcLoaded", new U());
9281
9356
  /** {@link Disposable.onDisposed} */
9282
- I(this, "onDisposed", new U());
9283
- I(this, "settings", new jr());
9284
- I(this, "enabled", !0);
9285
- I(this, "webIfc", new D.IfcAPI());
9286
- I(this, "_spatialTree", new vn());
9287
- I(this, "_metaData", new Yn());
9288
- I(this, "_visitedGeometries", /* @__PURE__ */ new Map());
9289
- I(this, "_streamSerializer", new Vt.StreamSerializer());
9290
- I(this, "_geometries", /* @__PURE__ */ new Map());
9291
- I(this, "_geometryCount", 0);
9292
- I(this, "_civil", new Bn());
9293
- I(this, "_groupSerializer", new Vt.Serializer());
9294
- I(this, "_assets", []);
9295
- I(this, "_meshesWithHoles", /* @__PURE__ */ new Set());
9357
+ u(this, "onDisposed", new U());
9358
+ u(this, "settings", new jr());
9359
+ u(this, "enabled", !0);
9360
+ u(this, "webIfc", new D.IfcAPI());
9361
+ u(this, "_spatialTree", new vn());
9362
+ u(this, "_metaData", new Yn());
9363
+ u(this, "_visitedGeometries", /* @__PURE__ */ new Map());
9364
+ u(this, "_streamSerializer", new Vt.StreamSerializer());
9365
+ u(this, "_geometries", /* @__PURE__ */ new Map());
9366
+ u(this, "_geometryCount", 0);
9367
+ u(this, "_civil", new Bn());
9368
+ u(this, "_groupSerializer", new Vt.Serializer());
9369
+ u(this, "_assets", []);
9370
+ u(this, "_meshesWithHoles", /* @__PURE__ */ new Set());
9296
9371
  this.components.add(ws.uuid, this), this.settings.excludedCategories.add(D.IFCOPENINGELEMENT);
9297
9372
  }
9298
9373
  dispose() {
@@ -9324,18 +9399,18 @@ const ws = class ws extends J {
9324
9399
  schema: this.webIfc.GetModelSchema(0) || "IFC2X3",
9325
9400
  maxExpressID: this.webIfc.GetMaxExpressID(0)
9326
9401
  };
9327
- let l = 0, E = 0;
9402
+ let c = 0, E = 0;
9328
9403
  for (const T of i) {
9329
9404
  if (!this.webIfc.IsIfcElement(T) && T !== D.IFCSPACE || this.settings.excludedCategories.has(T))
9330
9405
  continue;
9331
9406
  const F = this.webIfc.GetLineIDsWithType(0, T), f = F.size();
9332
9407
  console.log(f);
9333
9408
  for (let m = 0; m < f; m++) {
9334
- l > t && (l = 0, E++, o.push([]));
9409
+ c > t && (c = 0, E++, o.push([]));
9335
9410
  const O = F.get(m);
9336
9411
  o[E].push(O);
9337
9412
  const S = this._spatialTree.itemsByFloor[O] || 0;
9338
- n.data.set(O, [[], [S, T]]), l++;
9413
+ n.data.set(O, [[], [S, T]]), c++;
9339
9414
  }
9340
9415
  }
9341
9416
  this._spatialTree.cleanUp();
@@ -9348,9 +9423,9 @@ const ws = class ws extends J {
9348
9423
  F > d && (d += 0.01, d = Math.max(d, F), this.onProgress.trigger(Math.round(d * 100) / 100));
9349
9424
  }
9350
9425
  this._geometryCount && await this.streamGeometries(), this._assets.length && await this.streamAssets();
9351
- const { opaque: u, transparent: p } = n.geometryIDs;
9426
+ const { opaque: I, transparent: p } = n.geometryIDs;
9352
9427
  for (const [T, { index: F, uuid: f }] of this._visitedGeometries)
9353
- n.keyFragments.set(F, f), (T > 1 ? u : p).set(T, F);
9428
+ n.keyFragments.set(F, f), (T > 1 ? I : p).set(T, F);
9354
9429
  const A = n.data.keys();
9355
9430
  for (const T of A) {
9356
9431
  const [F] = n.data.get(T);
@@ -9367,20 +9442,20 @@ const ws = class ws extends J {
9367
9442
  getMesh(t, e, i) {
9368
9443
  const o = e.geometries.size(), n = e.expressID, r = { id: n, geometries: [] };
9369
9444
  for (let a = 0; a < o; a++) {
9370
- const l = e.geometries.get(a), E = l.geometryExpressID, d = l.color.w === 1 ? 1 : -1, h = E * d;
9445
+ const c = e.geometries.get(a), E = c.geometryExpressID, d = c.color.w === 1 ? 1 : -1, h = E * d;
9371
9446
  if (!this._visitedGeometries.has(h)) {
9372
9447
  this._visitedGeometries.has(E) || this.getGeometry(t, E);
9373
9448
  const m = this._visitedGeometries.size, O = g.MathUtils.generateUUID();
9374
9449
  this._visitedGeometries.set(h, { uuid: O, index: m });
9375
9450
  }
9376
- const u = this._visitedGeometries.get(h);
9377
- if (u === void 0)
9451
+ const I = this._visitedGeometries.get(h);
9452
+ if (I === void 0)
9378
9453
  throw new Error("Error getting geometry data for streaming!");
9379
9454
  const p = i.data.get(n);
9380
9455
  if (!p)
9381
9456
  throw new Error("Data not found!");
9382
- p[0].push(u.index);
9383
- const { x: A, y: R, z: C, w: T } = l.color, F = [A, R, C, T], f = l.flatTransformation;
9457
+ p[0].push(I.index);
9458
+ const { x: A, y: R, z: C, w: T } = c.color, F = [A, R, C, T], f = c.flatTransformation;
9384
9459
  r.geometries.push({ color: F, geometryID: E, transformation: f });
9385
9460
  }
9386
9461
  this._assets.push(r);
@@ -9393,12 +9468,12 @@ const ws = class ws extends J {
9393
9468
  i.GetVertexData(),
9394
9469
  i.GetVertexDataSize()
9395
9470
  ), r = new Float32Array(n.length / 2), a = new Float32Array(n.length / 2);
9396
- for (let u = 0; u < n.length; u += 6)
9397
- r[u / 2] = n[u], r[u / 2 + 1] = n[u + 1], r[u / 2 + 2] = n[u + 2], a[u / 2] = n[u + 3], a[u / 2 + 1] = n[u + 4], a[u / 2 + 2] = n[u + 5];
9398
- const l = Cr(r), E = new Float32Array(l.transformation.elements), d = [l.center.x, l.center.y, l.center.z];
9471
+ for (let I = 0; I < n.length; I += 6)
9472
+ r[I / 2] = n[I], r[I / 2 + 1] = n[I + 1], r[I / 2 + 2] = n[I + 2], a[I / 2] = n[I + 3], a[I / 2 + 1] = n[I + 4], a[I / 2 + 2] = n[I + 5];
9473
+ const c = Cr(r), E = new Float32Array(c.transformation.elements), d = [c.center.x, c.center.y, c.center.z];
9399
9474
  let h = !1;
9400
- for (let u = 0; u < r.length - 2; u += 3) {
9401
- const p = r[u], A = r[u + 1], R = r[u + 2], C = a[u], T = a[u + 1], F = a[u + 2];
9475
+ for (let I = 0; I < r.length - 2; I += 3) {
9476
+ const p = r[I], A = r[I + 1], R = r[I + 2], C = a[I], T = a[I + 1], F = a[I + 2];
9402
9477
  if (Tr(d, [p, A, R], [C, T, F])) {
9403
9478
  h = !0;
9404
9479
  break;
@@ -9422,19 +9497,19 @@ const ws = class ws extends J {
9422
9497
  this.onGeometryStreamed.trigger({ data: e, buffer: t }), e = null, t = null, this._geometries.clear(), this._geometryCount = 0;
9423
9498
  }
9424
9499
  };
9425
- I(ws, "uuid", "d9999a00-e1f5-4d3f-8cfe-c56e08609764");
9500
+ u(ws, "uuid", "d9999a00-e1f5-4d3f-8cfe-c56e08609764");
9426
9501
  let Sn = ws;
9427
9502
  class $r extends J {
9428
9503
  constructor() {
9429
9504
  super(...arguments);
9430
- I(this, "onPropertiesStreamed", new Kt());
9431
- I(this, "onProgress", new Kt());
9432
- I(this, "onIndicesStreamed", new Kt());
9505
+ u(this, "onPropertiesStreamed", new Kt());
9506
+ u(this, "onProgress", new Kt());
9507
+ u(this, "onIndicesStreamed", new Kt());
9433
9508
  /** {@link Disposable.onDisposed} */
9434
- I(this, "onDisposed", new U());
9435
- I(this, "enabled", !0);
9436
- I(this, "settings", new Vn());
9437
- I(this, "webIfc", new D.IfcAPI());
9509
+ u(this, "onDisposed", new U());
9510
+ u(this, "enabled", !0);
9511
+ u(this, "settings", new Vn());
9512
+ u(this, "webIfc", new D.IfcAPI());
9438
9513
  }
9439
9514
  async dispose() {
9440
9515
  this.onIndicesStreamed.reset(), this.onPropertiesStreamed.reset(), this.webIfc = null, this.onDisposed.reset();
@@ -9463,18 +9538,18 @@ class $r extends J {
9463
9538
  D.IFCBUILDINGSTOREY,
9464
9539
  D.IFCSPACE
9465
9540
  ]);
9466
- for (const l of i)
9467
- e.add(l);
9541
+ for (const c of i)
9542
+ e.add(c);
9468
9543
  let o = 0.01, n = 0;
9469
- for (const l of e) {
9470
- if (n++, Pi.has(l))
9544
+ for (const c of e) {
9545
+ if (n++, Pi.has(c))
9471
9546
  continue;
9472
- const E = i.has(l), d = this.webIfc.GetLineIDsWithType(0, l), h = d.size();
9473
- let u = 0;
9547
+ const E = i.has(c), d = this.webIfc.GetLineIDsWithType(0, c), h = d.size();
9548
+ let I = 0;
9474
9549
  for (let A = 0; A < h - t; A += t) {
9475
9550
  const R = {};
9476
9551
  for (let C = 0; C < t; C++) {
9477
- u++;
9552
+ I++;
9478
9553
  const T = d.get(A + C);
9479
9554
  try {
9480
9555
  const F = this.webIfc.GetLine(0, T, E);
@@ -9483,11 +9558,11 @@ class $r extends J {
9483
9558
  console.log(`Could not get property: ${T}`);
9484
9559
  }
9485
9560
  }
9486
- await this.onPropertiesStreamed.trigger({ type: l, data: R });
9561
+ await this.onPropertiesStreamed.trigger({ type: c, data: R });
9487
9562
  }
9488
- if (u !== h) {
9563
+ if (I !== h) {
9489
9564
  const A = {};
9490
- for (let R = u; R < h; R++) {
9565
+ for (let R = I; R < h; R++) {
9491
9566
  const C = d.get(R);
9492
9567
  try {
9493
9568
  const T = this.webIfc.GetLine(0, C, E);
@@ -9496,7 +9571,7 @@ class $r extends J {
9496
9571
  console.log(`Could not get property: ${C}`);
9497
9572
  }
9498
9573
  }
9499
- await this.onPropertiesStreamed.trigger({ type: l, data: A });
9574
+ await this.onPropertiesStreamed.trigger({ type: c, data: A });
9500
9575
  }
9501
9576
  const p = n / e.size;
9502
9577
  p > o && (o += 0.01, o = Math.max(o, p), await this.onProgress.trigger(Math.round(o * 100) / 100));
@@ -9508,11 +9583,11 @@ class $r extends J {
9508
9583
  this.webIfc = null, this.webIfc = new D.IfcAPI();
9509
9584
  }
9510
9585
  }
9511
- I($r, "uuid", "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b");
9586
+ u($r, "uuid", "88d2c89c-ce32-47d7-8cb6-d51e4b311a0b");
9512
9587
  const Ms = class Ms extends J {
9513
9588
  constructor(t) {
9514
9589
  super(t);
9515
- I(this, "enabled", !0);
9590
+ u(this, "enabled", !0);
9516
9591
  t.add(Ms.uuid, this);
9517
9592
  }
9518
9593
  getFace(t, e, i) {
@@ -9524,26 +9599,26 @@ const Ms = class Ms extends J {
9524
9599
  t
9525
9600
  ), a = [];
9526
9601
  for (let h = 0; h < n.length / 3; h++) {
9527
- const { plane: u, edges: p } = this.getFaceData(h, i, t);
9528
- if (u.equals(r)) {
9602
+ const { plane: I, edges: p } = this.getFaceData(h, i, t);
9603
+ if (I.equals(r)) {
9529
9604
  a.push({ index: h, edges: p });
9530
9605
  for (const { id: A, points: R, distance: C } of p)
9531
9606
  o.set(A, { points: R, distance: C });
9532
9607
  }
9533
9608
  }
9534
- let l = 0;
9609
+ let c = 0;
9535
9610
  const E = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map();
9536
- for (const { index: h, edges: u } of a) {
9611
+ for (const { index: h, edges: I } of a) {
9537
9612
  const p = /* @__PURE__ */ new Map();
9538
- for (const { id: m } of u)
9613
+ for (const { id: m } of I)
9539
9614
  if (E.has(m)) {
9540
9615
  const O = E.get(m);
9541
9616
  p.set(m, O);
9542
9617
  }
9543
- const A = u.map((m) => m.id);
9618
+ const A = I.map((m) => m.id);
9544
9619
  if (!p.size) {
9545
- const m = l++;
9546
- for (const { id: O } of u)
9620
+ const m = c++;
9621
+ for (const { id: O } of I)
9547
9622
  E.set(O, m);
9548
9623
  d.set(m, {
9549
9624
  edges: new Set(A),
@@ -9576,14 +9651,14 @@ const Ms = class Ms extends J {
9576
9651
  d.delete(m);
9577
9652
  }
9578
9653
  }
9579
- for (const [h, { indices: u, edges: p }] of d)
9580
- if (u.has(e)) {
9654
+ for (const [h, { indices: I, edges: p }] of d)
9655
+ if (I.has(e)) {
9581
9656
  const A = [];
9582
9657
  for (const R of p) {
9583
9658
  const C = o.get(R);
9584
9659
  A.push(C);
9585
9660
  }
9586
- return { edges: A, indices: u };
9661
+ return { edges: A, indices: I };
9587
9662
  }
9588
9663
  return null;
9589
9664
  }
@@ -9592,8 +9667,8 @@ const Ms = class Ms extends J {
9592
9667
  return n.set(e, i), n.closestPointToPoint(t, o, r), r.distanceTo(t);
9593
9668
  }
9594
9669
  getFaceData(t, e, i) {
9595
- const o = this.getVerticesAndNormal(i, t, e), { p1: n, p2: r, p3: a, faceNormal: l } = o;
9596
- this.round(n), this.round(r), this.round(a), this.round(l);
9670
+ const o = this.getVerticesAndNormal(i, t, e), { p1: n, p2: r, p3: a, faceNormal: c } = o;
9671
+ this.round(n), this.round(r), this.round(a), this.round(c);
9597
9672
  const E = [
9598
9673
  { id: `${n.x}|${n.y}|${n.z}`, value: n },
9599
9674
  { id: `${r.x}|${r.y}|${r.z}`, value: r },
@@ -9602,16 +9677,16 @@ const Ms = class Ms extends J {
9602
9677
  E.sort((F, f) => F.id < f.id ? -1 : F.id > f.id ? 1 : 0);
9603
9678
  const [
9604
9679
  { id: d, value: h },
9605
- { id: u, value: p },
9680
+ { id: I, value: p },
9606
9681
  { id: A, value: R }
9607
9682
  ] = E, C = [
9608
9683
  {
9609
- id: `${d}|${u}`,
9684
+ id: `${d}|${I}`,
9610
9685
  distance: h.distanceTo(p),
9611
9686
  points: [h, p]
9612
9687
  },
9613
9688
  {
9614
- id: `${u}|${A}`,
9689
+ id: `${I}|${A}`,
9615
9690
  distance: p.distanceTo(R),
9616
9691
  points: [p, R]
9617
9692
  },
@@ -9621,25 +9696,25 @@ const Ms = class Ms extends J {
9621
9696
  points: [h, R]
9622
9697
  }
9623
9698
  ], T = new g.Plane();
9624
- return T.setFromNormalAndCoplanarPoint(l, n), T.constant = Math.round(T.constant * 10) / 10, { plane: T, edges: C };
9699
+ return T.setFromNormalAndCoplanarPoint(c, n), T.constant = Math.round(T.constant * 10) / 10, { plane: T, edges: C };
9625
9700
  }
9626
9701
  getVerticesAndNormal(t, e, i) {
9627
9702
  if (!t.geometry.index)
9628
9703
  throw new Error("Geometry must be indexed!");
9629
- const o = t.geometry.index.array, n = t.geometry.attributes.position.array, r = t.geometry.attributes.normal.array, a = o[e * 3] * 3, l = o[e * 3 + 1] * 3, E = o[e * 3 + 2] * 3, d = new g.Vector3(n[a], n[a + 1], n[a + 2]), h = new g.Vector3(n[l], n[l + 1], n[l + 2]), u = new g.Vector3(n[E], n[E + 1], n[E + 2]), p = new g.Vector3(r[a], r[a + 1], r[a + 2]), A = new g.Vector3(r[l], r[l + 1], r[l + 2]), R = new g.Vector3(r[E], r[E + 1], r[E + 2]), C = (p.x + A.x + R.x) / 3, T = (p.y + A.y + R.y) / 3, F = (p.z + A.z + R.z) / 3, f = new g.Vector3(C, T, F);
9704
+ 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, E = o[e * 3 + 2] * 3, d = new g.Vector3(n[a], n[a + 1], n[a + 2]), h = new g.Vector3(n[c], n[c + 1], n[c + 2]), I = new g.Vector3(n[E], n[E + 1], n[E + 2]), p = new g.Vector3(r[a], r[a + 1], r[a + 2]), A = new g.Vector3(r[c], r[c + 1], r[c + 2]), R = new g.Vector3(r[E], r[E + 1], r[E + 2]), C = (p.x + A.x + R.x) / 3, T = (p.y + A.y + R.y) / 3, F = (p.z + A.z + R.z) / 3, f = new g.Vector3(C, T, F);
9630
9705
  if (!f.x && !f.y && !f.z && console.log("hey"), i !== void 0 && t instanceof g.InstancedMesh) {
9631
9706
  const m = new g.Matrix4();
9632
9707
  t.getMatrixAt(i, m);
9633
9708
  const O = new g.Matrix4();
9634
- O.extractRotation(m), f.applyMatrix4(O), d.applyMatrix4(m), h.applyMatrix4(m), u.applyMatrix4(m);
9709
+ O.extractRotation(m), f.applyMatrix4(O), d.applyMatrix4(m), h.applyMatrix4(m), I.applyMatrix4(m);
9635
9710
  }
9636
- return { p1: d, p2: h, p3: u, faceNormal: f };
9711
+ return { p1: d, p2: h, p3: I, faceNormal: f };
9637
9712
  }
9638
9713
  round(t) {
9639
9714
  t.x = Math.trunc(t.x * 1e3) / 1e3, t.y = Math.trunc(t.y * 1e3) / 1e3, t.z = Math.trunc(t.z * 1e3) / 1e3;
9640
9715
  }
9641
9716
  };
9642
- I(Ms, "uuid", "267ca032-672f-4cb0-afa9-d24e904f39d6");
9717
+ u(Ms, "uuid", "267ca032-672f-4cb0-afa9-d24e904f39d6");
9643
9718
  let _n = Ms;
9644
9719
  export {
9645
9720
  Kt as AsyncEvent,
@@ -9661,7 +9736,7 @@ export {
9661
9736
  zr as FirstPersonMode,
9662
9737
  gn as FragmentHider,
9663
9738
  qr as FragmentPropsStreamConverter,
9664
- ut as FragmentsManager,
9739
+ It as FragmentsManager,
9665
9740
  Nr as Grids,
9666
9741
  oa as IfcCategories,
9667
9742
  bn as IfcCategoryMap,