@needle-tools/engine 4.9.1 → 4.9.3-next.002c20b

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/{needle-engine.bundle-O7rlGMn7.js → needle-engine.bundle-BR5JPeY6.js} +1991 -1946
  3. package/dist/{needle-engine.bundle-BuTUhZAc.umd.cjs → needle-engine.bundle-BcceMKjs.umd.cjs} +120 -98
  4. package/dist/{needle-engine.bundle-DoywABnJ.min.js → needle-engine.bundle-D3RtScQB.min.js} +128 -106
  5. package/dist/needle-engine.js +2 -2
  6. package/dist/needle-engine.min.js +1 -1
  7. package/dist/needle-engine.umd.cjs +1 -1
  8. package/dist/{postprocessing-B_FzkwDz.min.js → postprocessing-BZOSD1ln.min.js} +53 -53
  9. package/dist/{postprocessing-DTX5VXrj.umd.cjs → postprocessing-Bb5StX0o.umd.cjs} +76 -76
  10. package/dist/{postprocessing-DP1U_BpT.js → postprocessing-BzFF7i-7.js} +212 -190
  11. package/dist/{vendor-8le8g4MS.umd.cjs → vendor-BtJpSuCj.umd.cjs} +1 -1
  12. package/dist/{vendor-yDFiCnCw.min.js → vendor-XJ9xiwrv.min.js} +1 -1
  13. package/dist/{vendor-Msb9AgYE.js → vendor-k9i6CeGi.js} +871 -870
  14. package/lib/engine/webcomponents/needle-engine.loading.js +59 -23
  15. package/lib/engine/webcomponents/needle-engine.loading.js.map +1 -1
  16. package/lib/engine/xr/NeedleXRSession.d.ts +1 -0
  17. package/lib/engine/xr/NeedleXRSession.js +25 -11
  18. package/lib/engine/xr/NeedleXRSession.js.map +1 -1
  19. package/lib/engine-components/Animation.js +1 -1
  20. package/lib/engine-components/Animation.js.map +1 -1
  21. package/lib/engine-components/Renderer.js +12 -5
  22. package/lib/engine-components/Renderer.js.map +1 -1
  23. package/lib/engine-components/SpriteRenderer.js +4 -1
  24. package/lib/engine-components/SpriteRenderer.js.map +1 -1
  25. package/package.json +3 -3
  26. package/plugins/vite/alias.js +5 -3
  27. package/plugins/vite/poster-client.js +22 -21
  28. package/src/engine/webcomponents/needle-engine.loading.ts +63 -24
  29. package/src/engine/xr/NeedleXRSession.ts +25 -10
  30. package/src/engine-components/Animation.ts +1 -1
  31. package/src/engine-components/Renderer.ts +12 -5
  32. package/src/engine-components/SpriteRenderer.ts +3 -1
@@ -1,4 +1,4 @@
1
- import { PlaneGeometry as zo, ShaderChunk as Ga, Object3D as Oo, Layers as Ur, MeshBasicMaterial as Ts, DoubleSide as Fn, AdditiveBlending as Bo, InstancedBufferAttribute as we, DynamicDrawUsage as gt, InstancedBufferGeometry as ja, Uniform$1 as Vt, ShaderMaterial as Dn, BufferGeometry as Pi, BufferAttribute as Mt, Mesh as hs, MeshStandardMaterial as $a, MeshPhysicalMaterial as qa, Triangle as Ue, Vector3 as N, Plane as Io, Line3 as me, Vector2 as Ke, Sphere as No, Matrix4 as Gt, Box3 as te, BackSide as Xa, REVISION as Ha, FrontSide as Cs, BatchedMesh as Wa, Ray as Ya, Matrix3 as Za, Vector4 as us, SkinnedMesh as Ka, InterpolateDiscrete as Qa, InterpolateLinear as Uo, AnimationClip as tc, QuaternionKeyframeTrack as ec, ColorKeyframeTrack as ic, VectorKeyframeTrack as rc, NumberKeyframeTrack as nc, PropertyBinding as Ms } from "./three-CsHK73Zc.js";
1
+ import { PlaneGeometry as zo, ShaderChunk as Ga, Object3D as Oo, Layers as Ur, MeshBasicMaterial as Ts, DoubleSide as Fn, AdditiveBlending as Bo, InstancedBufferAttribute as we, DynamicDrawUsage as gt, InstancedBufferGeometry as ja, Uniform$1 as Vt, ShaderMaterial as Dn, BufferGeometry as Pi, BufferAttribute as Mt, Mesh as us, MeshStandardMaterial as $a, MeshPhysicalMaterial as qa, Triangle as Ue, Vector3 as N, Plane as Io, Line3 as me, Vector2 as Ke, Sphere as No, Matrix4 as Gt, Box3 as te, BackSide as Xa, REVISION as Ha, FrontSide as Cs, BatchedMesh as Wa, Ray as Ya, Matrix3 as Za, Vector4 as hs, SkinnedMesh as Ka, InterpolateDiscrete as Qa, InterpolateLinear as Uo, AnimationClip as tc, QuaternionKeyframeTrack as ec, ColorKeyframeTrack as ic, VectorKeyframeTrack as rc, NumberKeyframeTrack as nc, PropertyBinding as Ms } from "./three-CsHK73Zc.js";
2
2
  const ot = {
3
3
  ComponentState: Object.freeze({
4
4
  DEFAULT: "default",
@@ -27,7 +27,7 @@ async function Fo(n) {
27
27
  async function sc(n) {
28
28
  return await Fo(`${n}/profilesList.json`);
29
29
  }
30
- async function Ou(n, t, e = null, i = !0) {
30
+ async function Oh(n, t, e = null, i = !0) {
31
31
  if (!n)
32
32
  throw new Error("No xrInputSource supplied");
33
33
  const r = await sc(t);
@@ -152,7 +152,7 @@ class lc {
152
152
  });
153
153
  }
154
154
  }
155
- class Bu {
155
+ class Bh {
156
156
  /**
157
157
  * @param {Object} xrInputSource - The XRInputSource to build the MotionController around
158
158
  * @param {Object} profile - The best matched profile description for the supplied xrInputSource
@@ -192,7 +192,7 @@ class Bu {
192
192
  });
193
193
  }
194
194
  }
195
- const on = 2, Zt = 4, de = 4, hc = 4, be = new Int32Array(2), Ps = new Float32Array(be.buffer), ws = new Float64Array(be.buffer), ur = new Uint16Array(new Uint8Array([1, 0]).buffer)[0] === 1;
195
+ const on = 2, Zt = 4, de = 4, uc = 4, be = new Int32Array(2), Ps = new Float32Array(be.buffer), ws = new Float64Array(be.buffer), hr = new Uint16Array(new Uint8Array([1, 0]).buffer)[0] === 1;
196
196
  class ye {
197
197
  constructor(t, e) {
198
198
  this.low = t | 0, this.high = e | 0;
@@ -280,7 +280,7 @@ class Gr {
280
280
  return be[0] = this.readInt32(t), Ps[0];
281
281
  }
282
282
  readFloat64(t) {
283
- return be[ur ? 0 : 1] = this.readInt32(t), be[ur ? 1 : 0] = this.readInt32(t + 4), ws[0];
283
+ return be[hr ? 0 : 1] = this.readInt32(t), be[hr ? 1 : 0] = this.readInt32(t + 4), ws[0];
284
284
  }
285
285
  writeInt8(t, e) {
286
286
  this.bytes_[t] = e;
@@ -310,7 +310,7 @@ class Gr {
310
310
  Ps[0] = e, this.writeInt32(t, be[0]);
311
311
  }
312
312
  writeFloat64(t, e) {
313
- ws[0] = e, this.writeInt32(t, be[ur ? 0 : 1]), this.writeInt32(t + 4, be[ur ? 1 : 0]);
313
+ ws[0] = e, this.writeInt32(t, be[hr ? 0 : 1]), this.writeInt32(t + 4, be[hr ? 1 : 0]);
314
314
  }
315
315
  /**
316
316
  * Return the file identifier. Behavior is undefined for FlatBuffers whose
@@ -371,8 +371,8 @@ class Gr {
371
371
  if (o < 240)
372
372
  a = (o & 15) << 12 | (c & 63) << 6 | l & 63;
373
373
  else {
374
- const h = this.readUint8(t + s++);
375
- a = (o & 7) << 18 | (c & 63) << 12 | (l & 63) << 6 | h & 63;
374
+ const u = this.readUint8(t + s++);
375
+ a = (o & 7) << 18 | (c & 63) << 12 | (l & 63) << 6 | u & 63;
376
376
  }
377
377
  }
378
378
  }
@@ -697,7 +697,7 @@ class Do {
697
697
  * Finalize a buffer, poiting to the given `root_table`.
698
698
  */
699
699
  finish(t, e, i) {
700
- const r = i ? hc : 0;
700
+ const r = i ? uc : 0;
701
701
  if (e) {
702
702
  const s = e;
703
703
  if (this.prep(this.minalign, Zt + de + r), s.length != de)
@@ -869,7 +869,7 @@ function ks() {
869
869
  })(an)), an.exports;
870
870
  }
871
871
  var cn, Rs;
872
- function uc() {
872
+ function hc() {
873
873
  if (Rs) return cn;
874
874
  Rs = 1;
875
875
  var n = ks().BufferBuilder, t = ks().binaryFeatures, e = {
@@ -987,24 +987,24 @@ function uc() {
987
987
  var c = this.dataBuffer.slice(this.index, this.index + o);
988
988
  return this.index += o, c;
989
989
  }, i.prototype.unpack_string = function(o) {
990
- for (var c = this.read(o), l = 0, h = "", u, f; l < o; )
991
- u = c[l], u < 128 ? (h += String.fromCharCode(u), l++) : (u ^ 192) < 32 ? (f = (u ^ 192) << 6 | c[l + 1] & 63, h += String.fromCharCode(f), l += 2) : (f = (u & 15) << 12 | (c[l + 1] & 63) << 6 | c[l + 2] & 63, h += String.fromCharCode(f), l += 3);
992
- return this.index += o, h;
990
+ for (var c = this.read(o), l = 0, u = "", h, f; l < o; )
991
+ h = c[l], h < 128 ? (u += String.fromCharCode(h), l++) : (h ^ 192) < 32 ? (f = (h ^ 192) << 6 | c[l + 1] & 63, u += String.fromCharCode(f), l += 2) : (f = (h & 15) << 12 | (c[l + 1] & 63) << 6 | c[l + 2] & 63, u += String.fromCharCode(f), l += 3);
992
+ return this.index += o, u;
993
993
  }, i.prototype.unpack_array = function(o) {
994
994
  for (var c = new Array(o), l = 0; l < o; l++)
995
995
  c[l] = this.unpack();
996
996
  return c;
997
997
  }, i.prototype.unpack_map = function(o) {
998
998
  for (var c = {}, l = 0; l < o; l++) {
999
- var h = this.unpack(), u = this.unpack();
1000
- c[h] = u;
999
+ var u = this.unpack(), h = this.unpack();
1000
+ c[u] = h;
1001
1001
  }
1002
1002
  return c;
1003
1003
  }, i.prototype.unpack_float = function() {
1004
- var o = this.unpack_uint32(), c = o >> 31, l = (o >> 23 & 255) - 127, h = o & 8388607 | 8388608;
1005
- return (c === 0 ? 1 : -1) * h * Math.pow(2, l - 23);
1004
+ var o = this.unpack_uint32(), c = o >> 31, l = (o >> 23 & 255) - 127, u = o & 8388607 | 8388608;
1005
+ return (c === 0 ? 1 : -1) * u * Math.pow(2, l - 23);
1006
1006
  }, i.prototype.unpack_double = function() {
1007
- var o = this.unpack_uint32(), c = this.unpack_uint32(), l = o >> 31, h = (o >> 20 & 2047) - 1023, u = o & 1048575 | 1048576, f = u * Math.pow(2, h - 20) + c * Math.pow(2, h - 52);
1007
+ var o = this.unpack_uint32(), c = this.unpack_uint32(), l = o >> 31, u = (o >> 20 & 2047) - 1023, h = o & 1048575 | 1048576, f = h * Math.pow(2, u - 20) + c * Math.pow(2, u - 52);
1008
1008
  return (l === 0 ? 1 : -1) * f;
1009
1009
  }, i.prototype.read = function(o) {
1010
1010
  var c = this.index;
@@ -1110,7 +1110,7 @@ function uc() {
1110
1110
  }, r.prototype.pack_double = function(o) {
1111
1111
  var c = 0;
1112
1112
  o < 0 && (c = 1, o = -o);
1113
- var l = Math.floor(Math.log(o) / Math.LN2), h = o / Math.pow(2, l) - 1, u = Math.floor(h * Math.pow(2, 52)), f = Math.pow(2, 32), d = c << 31 | l + 1023 << 20 | u / f & 1048575, y = u % f;
1113
+ var l = Math.floor(Math.log(o) / Math.LN2), u = o / Math.pow(2, l) - 1, h = Math.floor(u * Math.pow(2, 52)), f = Math.pow(2, 32), d = c << 31 | l + 1023 << 20 | h / f & 1048575, y = h % f;
1114
1114
  this.bufferBuilder.append(203), this.pack_int32(d), this.pack_int32(y);
1115
1115
  }, r.prototype.pack_object = function(o) {
1116
1116
  var c = Object.keys(o), l = c.length;
@@ -1122,8 +1122,8 @@ function uc() {
1122
1122
  this.bufferBuilder.append(223), this.pack_uint32(l);
1123
1123
  else
1124
1124
  throw new Error("Invalid length");
1125
- for (var h in o)
1126
- o.hasOwnProperty(h) && (this.pack(h), this.pack(o[h]));
1125
+ for (var u in o)
1126
+ o.hasOwnProperty(u) && (this.pack(u), this.pack(o[u]));
1127
1127
  }, r.prototype.pack_uint8 = function(o) {
1128
1128
  this.bufferBuilder.append(o);
1129
1129
  }, r.prototype.pack_uint16 = function(o) {
@@ -1153,7 +1153,7 @@ function uc() {
1153
1153
  }
1154
1154
  return cn;
1155
1155
  }
1156
- var fc = uc();
1156
+ var fc = hc();
1157
1157
  const As = /* @__PURE__ */ Kr(fc);
1158
1158
  let Lo = !0, Vo = !0;
1159
1159
  function bi(n, t, e) {
@@ -1168,8 +1168,8 @@ function ri(n, t, e) {
1168
1168
  if (a !== t)
1169
1169
  return r.apply(this, arguments);
1170
1170
  const c = (l) => {
1171
- const h = e(l);
1172
- h && (o.handleEvent ? o.handleEvent(h) : o(h));
1171
+ const u = e(l);
1172
+ u && (o.handleEvent ? o.handleEvent(u) : o(u));
1173
1173
  };
1174
1174
  return this._eventMap = this._eventMap || {}, this._eventMap[t] || (this._eventMap[t] = /* @__PURE__ */ new Map()), this._eventMap[t].set(o, c), r.apply(this, [
1175
1175
  a,
@@ -1294,41 +1294,41 @@ function Go(n, t) {
1294
1294
  return Object.keys(o).forEach((l) => {
1295
1295
  if (l === "require" || l === "advanced" || l === "mediaSource")
1296
1296
  return;
1297
- const h = typeof o[l] == "object" ? o[l] : { ideal: o[l] };
1298
- h.exact !== void 0 && typeof h.exact == "number" && (h.min = h.max = h.exact);
1299
- const u = function(f, d) {
1297
+ const u = typeof o[l] == "object" ? o[l] : { ideal: o[l] };
1298
+ u.exact !== void 0 && typeof u.exact == "number" && (u.min = u.max = u.exact);
1299
+ const h = function(f, d) {
1300
1300
  return f ? f + d.charAt(0).toUpperCase() + d.slice(1) : d === "deviceId" ? "sourceId" : d;
1301
1301
  };
1302
- if (h.ideal !== void 0) {
1302
+ if (u.ideal !== void 0) {
1303
1303
  c.optional = c.optional || [];
1304
1304
  let f = {};
1305
- typeof h.ideal == "number" ? (f[u("min", l)] = h.ideal, c.optional.push(f), f = {}, f[u("max", l)] = h.ideal, c.optional.push(f)) : (f[u("", l)] = h.ideal, c.optional.push(f));
1305
+ typeof u.ideal == "number" ? (f[h("min", l)] = u.ideal, c.optional.push(f), f = {}, f[h("max", l)] = u.ideal, c.optional.push(f)) : (f[h("", l)] = u.ideal, c.optional.push(f));
1306
1306
  }
1307
- h.exact !== void 0 && typeof h.exact != "number" ? (c.mandatory = c.mandatory || {}, c.mandatory[u("", l)] = h.exact) : ["min", "max"].forEach((f) => {
1308
- h[f] !== void 0 && (c.mandatory = c.mandatory || {}, c.mandatory[u(f, l)] = h[f]);
1307
+ u.exact !== void 0 && typeof u.exact != "number" ? (c.mandatory = c.mandatory || {}, c.mandatory[h("", l)] = u.exact) : ["min", "max"].forEach((f) => {
1308
+ u[f] !== void 0 && (c.mandatory = c.mandatory || {}, c.mandatory[h(f, l)] = u[f]);
1309
1309
  });
1310
1310
  }), o.advanced && (c.optional = (c.optional || []).concat(o.advanced)), c;
1311
1311
  }, r = function(o, c) {
1312
1312
  if (t.version >= 61)
1313
1313
  return c(o);
1314
1314
  if (o = JSON.parse(JSON.stringify(o)), o && typeof o.audio == "object") {
1315
- const l = function(h, u, f) {
1316
- u in h && !(f in h) && (h[f] = h[u], delete h[u]);
1315
+ const l = function(u, h, f) {
1316
+ h in u && !(f in u) && (u[f] = u[h], delete u[h]);
1317
1317
  };
1318
1318
  o = JSON.parse(JSON.stringify(o)), l(o.audio, "autoGainControl", "googAutoGainControl"), l(o.audio, "noiseSuppression", "googNoiseSuppression"), o.audio = i(o.audio);
1319
1319
  }
1320
1320
  if (o && typeof o.video == "object") {
1321
1321
  let l = o.video.facingMode;
1322
1322
  l = l && (typeof l == "object" ? l : { ideal: l });
1323
- const h = t.version < 66;
1324
- if (l && (l.exact === "user" || l.exact === "environment" || l.ideal === "user" || l.ideal === "environment") && !(e.mediaDevices.getSupportedConstraints && e.mediaDevices.getSupportedConstraints().facingMode && !h)) {
1323
+ const u = t.version < 66;
1324
+ if (l && (l.exact === "user" || l.exact === "environment" || l.ideal === "user" || l.ideal === "environment") && !(e.mediaDevices.getSupportedConstraints && e.mediaDevices.getSupportedConstraints().facingMode && !u)) {
1325
1325
  delete o.video.facingMode;
1326
- let u;
1327
- if (l.exact === "environment" || l.ideal === "environment" ? u = ["back", "rear"] : (l.exact === "user" || l.ideal === "user") && (u = ["front"]), u)
1326
+ let h;
1327
+ if (l.exact === "environment" || l.ideal === "environment" ? h = ["back", "rear"] : (l.exact === "user" || l.ideal === "user") && (h = ["front"]), h)
1328
1328
  return e.mediaDevices.enumerateDevices().then((f) => {
1329
1329
  f = f.filter((y) => y.kind === "videoinput");
1330
- let d = f.find((y) => u.some((_) => y.label.toLowerCase().includes(_)));
1331
- return !d && f.length && u.includes("back") && (d = f[f.length - 1]), d && (o.video.deviceId = l.exact ? { exact: d.deviceId } : { ideal: d.deviceId }), o.video = i(o.video), Bs("chrome: " + JSON.stringify(o)), c(o);
1330
+ let d = f.find((y) => h.some((_) => y.label.toLowerCase().includes(_)));
1331
+ return !d && f.length && h.includes("back") && (d = f[f.length - 1]), d && (o.video.deviceId = l.exact ? { exact: d.deviceId } : { ideal: d.deviceId }), o.video = i(o.video), Bs("chrome: " + JSON.stringify(o)), c(o);
1332
1332
  });
1333
1333
  }
1334
1334
  o.video = i(o.video);
@@ -1356,22 +1356,22 @@ function Go(n, t) {
1356
1356
  }
1357
1357
  };
1358
1358
  }, a = function(o, c, l) {
1359
- r(o, (h) => {
1360
- e.webkitGetUserMedia(h, c, (u) => {
1361
- l && l(s(u));
1359
+ r(o, (u) => {
1360
+ e.webkitGetUserMedia(u, c, (h) => {
1361
+ l && l(s(h));
1362
1362
  });
1363
1363
  });
1364
1364
  };
1365
1365
  if (e.getUserMedia = a.bind(e), e.mediaDevices.getUserMedia) {
1366
1366
  const o = e.mediaDevices.getUserMedia.bind(e.mediaDevices);
1367
1367
  Object.getOwnPropertyDescriptor(e.mediaDevices, "getUserMedia")?.writable && (e.mediaDevices.getUserMedia = function(c) {
1368
- return r(c, (l) => o(l).then((h) => {
1369
- if (l.audio && !h.getAudioTracks().length || l.video && !h.getVideoTracks().length)
1370
- throw h.getTracks().forEach((u) => {
1371
- u.stop();
1368
+ return r(c, (l) => o(l).then((u) => {
1369
+ if (l.audio && !u.getAudioTracks().length || l.video && !u.getVideoTracks().length)
1370
+ throw u.getTracks().forEach((h) => {
1371
+ h.stop();
1372
1372
  }), new DOMException("", "NotFoundError");
1373
- return h;
1374
- }, (h) => Promise.reject(s(h))));
1373
+ return u;
1374
+ }, (u) => Promise.reject(s(u))));
1375
1375
  });
1376
1376
  }
1377
1377
  }
@@ -1497,17 +1497,17 @@ function Xo(n) {
1497
1497
  return t.apply(this, []);
1498
1498
  const a = function(c) {
1499
1499
  const l = {};
1500
- return c.result().forEach((u) => {
1500
+ return c.result().forEach((h) => {
1501
1501
  const f = {
1502
- id: u.id,
1503
- timestamp: u.timestamp,
1502
+ id: h.id,
1503
+ timestamp: h.timestamp,
1504
1504
  type: {
1505
1505
  localcandidate: "local-candidate",
1506
1506
  remotecandidate: "remote-candidate"
1507
- }[u.type] || u.type
1507
+ }[h.type] || h.type
1508
1508
  };
1509
- u.names().forEach((d) => {
1510
- f[d] = u.stat(d);
1509
+ h.names().forEach((d) => {
1510
+ f[d] = h.stat(d);
1511
1511
  }), l[f.id] = f;
1512
1512
  }), l;
1513
1513
  }, o = function(c) {
@@ -1524,8 +1524,8 @@ function Xo(n) {
1524
1524
  }
1525
1525
  return new Promise((c, l) => {
1526
1526
  t.apply(this, [
1527
- function(h) {
1528
- c(o(a(h)));
1527
+ function(u) {
1528
+ c(o(a(u)));
1529
1529
  },
1530
1530
  l
1531
1531
  ]);
@@ -1601,7 +1601,7 @@ function Wo(n) {
1601
1601
  const e = n.RTCPeerConnection.prototype.addStream;
1602
1602
  n.RTCPeerConnection.prototype.addStream = function(a) {
1603
1603
  this._shimmedLocalStreams = this._shimmedLocalStreams || {}, a.getTracks().forEach((l) => {
1604
- if (this.getSenders().find((u) => u.track === l))
1604
+ if (this.getSenders().find((h) => h.track === l))
1605
1605
  throw new DOMException(
1606
1606
  "Track already exists.",
1607
1607
  "InvalidAccessError"
@@ -1631,85 +1631,85 @@ function Yo(n, t) {
1631
1631
  return Wo(n);
1632
1632
  const e = n.RTCPeerConnection.prototype.getLocalStreams;
1633
1633
  n.RTCPeerConnection.prototype.getLocalStreams = function() {
1634
- const h = e.apply(this);
1635
- return this._reverseStreams = this._reverseStreams || {}, h.map((u) => this._reverseStreams[u.id]);
1634
+ const u = e.apply(this);
1635
+ return this._reverseStreams = this._reverseStreams || {}, u.map((h) => this._reverseStreams[h.id]);
1636
1636
  };
1637
1637
  const i = n.RTCPeerConnection.prototype.addStream;
1638
- n.RTCPeerConnection.prototype.addStream = function(h) {
1639
- if (this._streams = this._streams || {}, this._reverseStreams = this._reverseStreams || {}, h.getTracks().forEach((u) => {
1640
- if (this.getSenders().find((d) => d.track === u))
1638
+ n.RTCPeerConnection.prototype.addStream = function(u) {
1639
+ if (this._streams = this._streams || {}, this._reverseStreams = this._reverseStreams || {}, u.getTracks().forEach((h) => {
1640
+ if (this.getSenders().find((d) => d.track === h))
1641
1641
  throw new DOMException(
1642
1642
  "Track already exists.",
1643
1643
  "InvalidAccessError"
1644
1644
  );
1645
- }), !this._reverseStreams[h.id]) {
1646
- const u = new n.MediaStream(h.getTracks());
1647
- this._streams[h.id] = u, this._reverseStreams[u.id] = h, h = u;
1645
+ }), !this._reverseStreams[u.id]) {
1646
+ const h = new n.MediaStream(u.getTracks());
1647
+ this._streams[u.id] = h, this._reverseStreams[h.id] = u, u = h;
1648
1648
  }
1649
- i.apply(this, [h]);
1649
+ i.apply(this, [u]);
1650
1650
  };
1651
1651
  const r = n.RTCPeerConnection.prototype.removeStream;
1652
- n.RTCPeerConnection.prototype.removeStream = function(h) {
1653
- this._streams = this._streams || {}, this._reverseStreams = this._reverseStreams || {}, r.apply(this, [this._streams[h.id] || h]), delete this._reverseStreams[this._streams[h.id] ? this._streams[h.id].id : h.id], delete this._streams[h.id];
1654
- }, n.RTCPeerConnection.prototype.addTrack = function(h, u) {
1652
+ n.RTCPeerConnection.prototype.removeStream = function(u) {
1653
+ this._streams = this._streams || {}, this._reverseStreams = this._reverseStreams || {}, r.apply(this, [this._streams[u.id] || u]), delete this._reverseStreams[this._streams[u.id] ? this._streams[u.id].id : u.id], delete this._streams[u.id];
1654
+ }, n.RTCPeerConnection.prototype.addTrack = function(u, h) {
1655
1655
  if (this.signalingState === "closed")
1656
1656
  throw new DOMException(
1657
1657
  "The RTCPeerConnection's signalingState is 'closed'.",
1658
1658
  "InvalidStateError"
1659
1659
  );
1660
1660
  const f = [].slice.call(arguments, 1);
1661
- if (f.length !== 1 || !f[0].getTracks().find((_) => _ === h))
1661
+ if (f.length !== 1 || !f[0].getTracks().find((_) => _ === u))
1662
1662
  throw new DOMException(
1663
1663
  "The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.",
1664
1664
  "NotSupportedError"
1665
1665
  );
1666
- if (this.getSenders().find((_) => _.track === h))
1666
+ if (this.getSenders().find((_) => _.track === u))
1667
1667
  throw new DOMException(
1668
1668
  "Track already exists.",
1669
1669
  "InvalidAccessError"
1670
1670
  );
1671
1671
  this._streams = this._streams || {}, this._reverseStreams = this._reverseStreams || {};
1672
- const y = this._streams[u.id];
1672
+ const y = this._streams[h.id];
1673
1673
  if (y)
1674
- y.addTrack(h), Promise.resolve().then(() => {
1674
+ y.addTrack(u), Promise.resolve().then(() => {
1675
1675
  this.dispatchEvent(new Event("negotiationneeded"));
1676
1676
  });
1677
1677
  else {
1678
- const _ = new n.MediaStream([h]);
1679
- this._streams[u.id] = _, this._reverseStreams[_.id] = u, this.addStream(_);
1678
+ const _ = new n.MediaStream([u]);
1679
+ this._streams[h.id] = _, this._reverseStreams[_.id] = h, this.addStream(_);
1680
1680
  }
1681
- return this.getSenders().find((_) => _.track === h);
1681
+ return this.getSenders().find((_) => _.track === u);
1682
1682
  };
1683
- function s(l, h) {
1684
- let u = h.sdp;
1683
+ function s(l, u) {
1684
+ let h = u.sdp;
1685
1685
  return Object.keys(l._reverseStreams || []).forEach((f) => {
1686
1686
  const d = l._reverseStreams[f], y = l._streams[d.id];
1687
- u = u.replace(
1687
+ h = h.replace(
1688
1688
  new RegExp(y.id, "g"),
1689
1689
  d.id
1690
1690
  );
1691
1691
  }), new RTCSessionDescription({
1692
- type: h.type,
1693
- sdp: u
1692
+ type: u.type,
1693
+ sdp: h
1694
1694
  });
1695
1695
  }
1696
- function a(l, h) {
1697
- let u = h.sdp;
1696
+ function a(l, u) {
1697
+ let h = u.sdp;
1698
1698
  return Object.keys(l._reverseStreams || []).forEach((f) => {
1699
1699
  const d = l._reverseStreams[f], y = l._streams[d.id];
1700
- u = u.replace(
1700
+ h = h.replace(
1701
1701
  new RegExp(d.id, "g"),
1702
1702
  y.id
1703
1703
  );
1704
1704
  }), new RTCSessionDescription({
1705
- type: h.type,
1706
- sdp: u
1705
+ type: u.type,
1706
+ sdp: h
1707
1707
  });
1708
1708
  }
1709
1709
  ["createOffer", "createAnswer"].forEach(function(l) {
1710
- const h = n.RTCPeerConnection.prototype[l], u = { [l]() {
1710
+ const u = n.RTCPeerConnection.prototype[l], h = { [l]() {
1711
1711
  const f = arguments;
1712
- return arguments.length && typeof arguments[0] == "function" ? h.apply(this, [
1712
+ return arguments.length && typeof arguments[0] == "function" ? u.apply(this, [
1713
1713
  (y) => {
1714
1714
  const _ = s(this, y);
1715
1715
  f[0].apply(null, [_]);
@@ -1718,9 +1718,9 @@ function Yo(n, t) {
1718
1718
  f[1] && f[1].apply(null, y);
1719
1719
  },
1720
1720
  arguments[2]
1721
- ]) : h.apply(this, arguments).then((y) => s(this, y));
1721
+ ]) : u.apply(this, arguments).then((y) => s(this, y));
1722
1722
  } };
1723
- n.RTCPeerConnection.prototype[l] = u[l];
1723
+ n.RTCPeerConnection.prototype[l] = h[l];
1724
1724
  });
1725
1725
  const o = n.RTCPeerConnection.prototype.setLocalDescription;
1726
1726
  n.RTCPeerConnection.prototype.setLocalDescription = function() {
@@ -1739,15 +1739,15 @@ function Yo(n, t) {
1739
1739
  return l.type === "" ? l : s(this, l);
1740
1740
  }
1741
1741
  }
1742
- ), n.RTCPeerConnection.prototype.removeTrack = function(h) {
1742
+ ), n.RTCPeerConnection.prototype.removeTrack = function(u) {
1743
1743
  if (this.signalingState === "closed")
1744
1744
  throw new DOMException(
1745
1745
  "The RTCPeerConnection's signalingState is 'closed'.",
1746
1746
  "InvalidStateError"
1747
1747
  );
1748
- if (!h._pc)
1748
+ if (!u._pc)
1749
1749
  throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.", "TypeError");
1750
- if (!(h._pc === this))
1750
+ if (!(u._pc === this))
1751
1751
  throw new DOMException(
1752
1752
  "Sender was not created by this connection.",
1753
1753
  "InvalidAccessError"
@@ -1755,8 +1755,8 @@ function Yo(n, t) {
1755
1755
  this._streams = this._streams || {};
1756
1756
  let f;
1757
1757
  Object.keys(this._streams).forEach((d) => {
1758
- this._streams[d].getTracks().find((_) => h.track === _) && (f = this._streams[d]);
1759
- }), f && (f.getTracks().length === 1 ? this.removeStream(this._reverseStreams[f.id]) : f.removeTrack(h.track), this.dispatchEvent(new Event("negotiationneeded")));
1758
+ this._streams[d].getTracks().find((_) => u.track === _) && (f = this._streams[d]);
1759
+ }), f && (f.getTracks().length === 1 ? this.removeStream(this._reverseStreams[f.id]) : f.removeTrack(u.track), this.dispatchEvent(new Event("negotiationneeded")));
1760
1760
  };
1761
1761
  }
1762
1762
  function Jn(n, t) {
@@ -2018,11 +2018,11 @@ a=ice-pwd:` + e.password + `\r
2018
2018
  "a=rtpmap:" + o + " "
2019
2019
  )[0];
2020
2020
  if (c) {
2021
- var l = t.parseRtpMap(c), h = t.matchPrefix(
2021
+ var l = t.parseRtpMap(c), u = t.matchPrefix(
2022
2022
  e,
2023
2023
  "a=fmtp:" + o + " "
2024
2024
  );
2025
- switch (l.parameters = h.length ? t.parseFmtp(h[0]) : {}, l.rtcpFeedback = t.matchPrefix(
2025
+ switch (l.parameters = u.length ? t.parseFmtp(u[0]) : {}, l.rtcpFeedback = t.matchPrefix(
2026
2026
  e,
2027
2027
  "a=rtcp-fb:" + o + " "
2028
2028
  ).map(t.parseRtcpFb), i.codecs.push(l), l.name.toUpperCase()) {
@@ -2033,8 +2033,8 @@ a=ice-pwd:` + e.password + `\r
2033
2033
  }
2034
2034
  }
2035
2035
  }
2036
- return t.matchPrefix(e, "a=extmap:").forEach(function(u) {
2037
- i.headerExtensions.push(t.parseExtmap(u));
2036
+ return t.matchPrefix(e, "a=extmap:").forEach(function(h) {
2037
+ i.headerExtensions.push(t.parseExtmap(h));
2038
2038
  }), i;
2039
2039
  }, t.writeRtpDescription = function(e, i) {
2040
2040
  var r = "";
@@ -2059,13 +2059,13 @@ a=ice-pwd:` + e.password + `\r
2059
2059
  return t.parseSsrcMedia(f);
2060
2060
  }).filter(function(f) {
2061
2061
  return f.attribute === "cname";
2062
- }), c = o.length > 0 && o[0].ssrc, l, h = t.matchPrefix(e, "a=ssrc-group:FID").map(function(f) {
2062
+ }), c = o.length > 0 && o[0].ssrc, l, u = t.matchPrefix(e, "a=ssrc-group:FID").map(function(f) {
2063
2063
  var d = f.substr(17).split(" ");
2064
2064
  return d.map(function(y) {
2065
2065
  return parseInt(y, 10);
2066
2066
  });
2067
2067
  });
2068
- h.length > 0 && h[0].length > 1 && h[0][0] === c && (l = h[0][1]), r.codecs.forEach(function(f) {
2068
+ u.length > 0 && u[0].length > 1 && u[0][0] === c && (l = u[0][1]), r.codecs.forEach(function(f) {
2069
2069
  if (f.name.toUpperCase() === "RTX" && f.parameters.apt) {
2070
2070
  var d = {
2071
2071
  ssrc: c,
@@ -2079,9 +2079,9 @@ a=ice-pwd:` + e.password + `\r
2079
2079
  }), i.length === 0 && c && i.push({
2080
2080
  ssrc: c
2081
2081
  });
2082
- var u = t.matchPrefix(e, "b=");
2083
- return u.length && (u[0].indexOf("b=TIAS:") === 0 ? u = parseInt(u[0].substr(7), 10) : u[0].indexOf("b=AS:") === 0 ? u = parseInt(u[0].substr(5), 10) * 1e3 * 0.95 - 2e3 * 8 : u = void 0, i.forEach(function(f) {
2084
- f.maxBitrate = u;
2082
+ var h = t.matchPrefix(e, "b=");
2083
+ return h.length && (h[0].indexOf("b=TIAS:") === 0 ? h = parseInt(h[0].substr(7), 10) : h[0].indexOf("b=AS:") === 0 ? h = parseInt(h[0].substr(5), 10) * 1e3 * 0.95 - 2e3 * 8 : h = void 0, i.forEach(function(f) {
2084
+ f.maxBitrate = h;
2085
2085
  })), i;
2086
2086
  }, t.parseRtcpParameters = function(e) {
2087
2087
  var i = {}, r = t.matchPrefix(e, "a=ssrc:").map(function(o) {
@@ -2218,9 +2218,9 @@ t=0 0\r
2218
2218
  }, n.exports = t;
2219
2219
  })(ln)), ln.exports;
2220
2220
  }
2221
- var hn, Us;
2221
+ var un, Us;
2222
2222
  function vc() {
2223
- if (Us) return hn;
2223
+ if (Us) return un;
2224
2224
  Us = 1;
2225
2225
  var n = Ko();
2226
2226
  function t(c) {
@@ -2232,13 +2232,13 @@ function vc() {
2232
2232
  remotecandidate: "remote-candidate"
2233
2233
  }[c.type] || c.type;
2234
2234
  }
2235
- function e(c, l, h, u, f) {
2235
+ function e(c, l, u, h, f) {
2236
2236
  var d = n.writeRtpDescription(c.kind, l);
2237
2237
  if (d += n.writeIceParameters(
2238
2238
  c.iceGatherer.getLocalParameters()
2239
2239
  ), d += n.writeDtlsParameters(
2240
2240
  c.dtlsTransport.getLocalParameters(),
2241
- h === "offer" ? "actpass" : f || "active"
2241
+ u === "offer" ? "actpass" : f || "active"
2242
2242
  ), d += "a=mid:" + c.mid + `\r
2243
2243
  `, c.rtpSender && c.rtpReceiver ? d += `a=sendrecv\r
2244
2244
  ` : c.rtpSender ? d += `a=sendonly\r
@@ -2247,7 +2247,7 @@ function vc() {
2247
2247
  `, c.rtpSender) {
2248
2248
  var y = c.rtpSender._initialTrackId || c.rtpSender.track.id;
2249
2249
  c.rtpSender._initialTrackId = y;
2250
- var _ = "msid:" + (u ? u.id : "-") + " " + y + `\r
2250
+ var _ = "msid:" + (h ? h.id : "-") + " " + y + `\r
2251
2251
  `;
2252
2252
  d += "a=" + _, d += "a=ssrc:" + c.sendEncodingParameters[0].ssrc + " " + _, c.sendEncodingParameters[0].rtx && (d += "a=ssrc:" + c.sendEncodingParameters[0].rtx.ssrc + " " + _, d += "a=ssrc-group:FID " + c.sendEncodingParameters[0].ssrc + " " + c.sendEncodingParameters[0].rtx.ssrc + `\r
2253
2253
  `);
@@ -2257,31 +2257,31 @@ function vc() {
2257
2257
  `), d;
2258
2258
  }
2259
2259
  function i(c, l) {
2260
- var h = !1;
2261
- return c = JSON.parse(JSON.stringify(c)), c.filter(function(u) {
2262
- if (u && (u.urls || u.url)) {
2263
- var f = u.urls || u.url;
2264
- u.url && !u.urls && console.warn("RTCIceServer.url is deprecated! Use urls instead.");
2260
+ var u = !1;
2261
+ return c = JSON.parse(JSON.stringify(c)), c.filter(function(h) {
2262
+ if (h && (h.urls || h.url)) {
2263
+ var f = h.urls || h.url;
2264
+ h.url && !h.urls && console.warn("RTCIceServer.url is deprecated! Use urls instead.");
2265
2265
  var d = typeof f == "string";
2266
2266
  return d && (f = [f]), f = f.filter(function(y) {
2267
- var _ = y.indexOf("turn:") === 0 && y.indexOf("transport=udp") !== -1 && y.indexOf("turn:[") === -1 && !h;
2268
- return _ ? (h = !0, !0) : y.indexOf("stun:") === 0 && l >= 14393 && y.indexOf("?transport=udp") === -1;
2269
- }), delete u.url, u.urls = d ? f[0] : f, !!f.length;
2267
+ var _ = y.indexOf("turn:") === 0 && y.indexOf("transport=udp") !== -1 && y.indexOf("turn:[") === -1 && !u;
2268
+ return _ ? (u = !0, !0) : y.indexOf("stun:") === 0 && l >= 14393 && y.indexOf("?transport=udp") === -1;
2269
+ }), delete h.url, h.urls = d ? f[0] : f, !!f.length;
2270
2270
  }
2271
2271
  });
2272
2272
  }
2273
2273
  function r(c, l) {
2274
- var h = {
2274
+ var u = {
2275
2275
  codecs: [],
2276
2276
  headerExtensions: [],
2277
2277
  fecMechanisms: []
2278
- }, u = function(d, y) {
2278
+ }, h = function(d, y) {
2279
2279
  d = parseInt(d, 10);
2280
2280
  for (var _ = 0; _ < y.length; _++)
2281
2281
  if (y[_].payloadType === d || y[_].preferredPayloadType === d)
2282
2282
  return y[_];
2283
2283
  }, f = function(d, y, _, p) {
2284
- var m = u(d.parameters.apt, _), v = u(y.parameters.apt, p);
2284
+ var m = h(d.parameters.apt, _), v = h(y.parameters.apt, p);
2285
2285
  return m && v && m.name.toLowerCase() === v.name.toLowerCase();
2286
2286
  };
2287
2287
  return c.codecs.forEach(function(d) {
@@ -2298,7 +2298,7 @@ function vc() {
2298
2298
  _ = JSON.parse(JSON.stringify(_)), _.numChannels = Math.min(
2299
2299
  d.numChannels,
2300
2300
  _.numChannels
2301
- ), h.codecs.push(_), _.rtcpFeedback = _.rtcpFeedback.filter(function(p) {
2301
+ ), u.codecs.push(_), _.rtcpFeedback = _.rtcpFeedback.filter(function(p) {
2302
2302
  for (var m = 0; m < d.rtcpFeedback.length; m++)
2303
2303
  if (d.rtcpFeedback[m].type === p.type && d.rtcpFeedback[m].parameter === p.parameter)
2304
2304
  return !0;
@@ -2311,13 +2311,13 @@ function vc() {
2311
2311
  for (var y = 0; y < l.headerExtensions.length; y++) {
2312
2312
  var _ = l.headerExtensions[y];
2313
2313
  if (d.uri === _.uri) {
2314
- h.headerExtensions.push(_);
2314
+ u.headerExtensions.push(_);
2315
2315
  break;
2316
2316
  }
2317
2317
  }
2318
- }), h;
2318
+ }), u;
2319
2319
  }
2320
- function s(c, l, h) {
2320
+ function s(c, l, u) {
2321
2321
  return {
2322
2322
  offer: {
2323
2323
  setLocalDescription: ["stable", "have-local-offer"],
@@ -2327,32 +2327,32 @@ function vc() {
2327
2327
  setLocalDescription: ["have-remote-offer", "have-local-pranswer"],
2328
2328
  setRemoteDescription: ["have-local-offer", "have-remote-pranswer"]
2329
2329
  }
2330
- }[l][c].indexOf(h) !== -1;
2330
+ }[l][c].indexOf(u) !== -1;
2331
2331
  }
2332
2332
  function a(c, l) {
2333
- var h = c.getRemoteCandidates().find(function(u) {
2334
- return l.foundation === u.foundation && l.ip === u.ip && l.port === u.port && l.priority === u.priority && l.protocol === u.protocol && l.type === u.type;
2333
+ var u = c.getRemoteCandidates().find(function(h) {
2334
+ return l.foundation === h.foundation && l.ip === h.ip && l.port === h.port && l.priority === h.priority && l.protocol === h.protocol && l.type === h.type;
2335
2335
  });
2336
- return h || c.addRemoteCandidate(l), !h;
2336
+ return u || c.addRemoteCandidate(l), !u;
2337
2337
  }
2338
2338
  function o(c, l) {
2339
- var h = new Error(l);
2340
- return h.name = c, h.code = {
2339
+ var u = new Error(l);
2340
+ return u.name = c, u.code = {
2341
2341
  NotSupportedError: 9,
2342
2342
  InvalidStateError: 11,
2343
2343
  InvalidAccessError: 15,
2344
2344
  TypeError: void 0,
2345
2345
  OperationError: void 0
2346
- }[c], h;
2346
+ }[c], u;
2347
2347
  }
2348
- return hn = function(c, l) {
2349
- function h(p, m) {
2348
+ return un = function(c, l) {
2349
+ function u(p, m) {
2350
2350
  m.addTrack(p), m.dispatchEvent(new c.MediaStreamTrackEvent(
2351
2351
  "addtrack",
2352
2352
  { track: p }
2353
2353
  ));
2354
2354
  }
2355
- function u(p, m) {
2355
+ function h(p, m) {
2356
2356
  m.removeTrack(p), m.dispatchEvent(new c.MediaStreamTrackEvent(
2357
2357
  "removetrack",
2358
2358
  { track: p }
@@ -2776,13 +2776,13 @@ function vc() {
2776
2776
  get: function() {
2777
2777
  return U.track;
2778
2778
  }
2779
- }), bt = v[U.stream]) : (v.default || (v.default = new c.MediaStream()), bt = v.default)), bt && (h(W, bt), I.associatedRemoteMediaStreams.push(bt)), g.push([W, tt, bt]);
2779
+ }), bt = v[U.stream]) : (v.default || (v.default = new c.MediaStream()), bt = v.default)), bt && (u(W, bt), I.associatedRemoteMediaStreams.push(bt)), g.push([W, tt, bt]);
2780
2780
  }
2781
2781
  } else I.rtpReceiver && I.rtpReceiver.track && (I.associatedRemoteMediaStreams.forEach(function(Y) {
2782
2782
  var Xt = Y.getTracks().find(function(se) {
2783
2783
  return se.id === I.rtpReceiver.track.id;
2784
2784
  });
2785
- Xt && u(Xt, Y);
2785
+ Xt && h(Xt, Y);
2786
2786
  }), I.associatedRemoteMediaStreams = []);
2787
2787
  I.localCapabilities = nt, I.remoteCapabilities = $, I.rtpReceiver = tt, I.rtcpParameters = $t, I.sendEncodingParameters = mt, I.recvEncodingParameters = yt, m._transceive(
2788
2788
  m.transceivers[C],
@@ -2807,7 +2807,7 @@ function vc() {
2807
2807
  I,
2808
2808
  z === "sendrecv" || z === "recvonly",
2809
2809
  z === "sendrecv" || z === "sendonly"
2810
- ), tt && (z === "sendrecv" || z === "sendonly") ? (W = tt.track, U ? (v[U.stream] || (v[U.stream] = new c.MediaStream()), h(W, v[U.stream]), g.push([W, tt, v[U.stream]])) : (v.default || (v.default = new c.MediaStream()), h(W, v.default), g.push([W, tt, v.default]))) : delete I.rtpReceiver;
2810
+ ), tt && (z === "sendrecv" || z === "sendonly") ? (W = tt.track, U ? (v[U.stream] || (v[U.stream] = new c.MediaStream()), u(W, v[U.stream]), g.push([W, tt, v[U.stream]])) : (v.default || (v.default = new c.MediaStream()), u(W, v.default), g.push([W, tt, v.default]))) : delete I.rtpReceiver;
2811
2811
  }
2812
2812
  }), m._dtlsRole === void 0 && (m._dtlsRole = p.type === "offer" ? "active" : "passive"), m._remoteDescription = {
2813
2813
  type: p.type,
@@ -3155,7 +3155,7 @@ a=mid:` + b.mid + `\r
3155
3155
  }) : m.apply(this, arguments);
3156
3156
  };
3157
3157
  }), d;
3158
- }, hn;
3158
+ }, un;
3159
3159
  }
3160
3160
  var _c = vc();
3161
3161
  const xc = /* @__PURE__ */ Kr(_c);
@@ -3292,9 +3292,9 @@ function jn(n, t) {
3292
3292
  } catch (l) {
3293
3293
  if (l.name !== "TypeError")
3294
3294
  throw l;
3295
- c.forEach((h, u) => {
3296
- c.set(u, Object.assign({}, h, {
3297
- type: e[h.type] || h.type
3295
+ c.forEach((u, h) => {
3296
+ c.set(h, Object.assign({}, u, {
3297
+ type: e[u.type] || u.type
3298
3298
  }));
3299
3299
  });
3300
3300
  }
@@ -3378,7 +3378,7 @@ function la(n) {
3378
3378
  return "encodings" in i || (i.encodings = [].concat(this.sendEncodings || [{}])), i;
3379
3379
  });
3380
3380
  }
3381
- function ha(n) {
3381
+ function ua(n) {
3382
3382
  if (!(typeof n == "object" && n.RTCPeerConnection))
3383
3383
  return;
3384
3384
  const t = n.RTCPeerConnection.prototype.createOffer;
@@ -3388,7 +3388,7 @@ function ha(n) {
3388
3388
  }) : t.apply(this, arguments);
3389
3389
  };
3390
3390
  }
3391
- function ua(n) {
3391
+ function ha(n) {
3392
3392
  if (!(typeof n == "object" && n.RTCPeerConnection))
3393
3393
  return;
3394
3394
  const t = n.RTCPeerConnection.prototype.createAnswer;
@@ -3401,8 +3401,8 @@ function ua(n) {
3401
3401
  const Ds = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3402
3402
  __proto__: null,
3403
3403
  shimAddTransceiver: ca,
3404
- shimCreateAnswer: ua,
3405
- shimCreateOffer: ha,
3404
+ shimCreateAnswer: ha,
3405
+ shimCreateOffer: ua,
3406
3406
  shimGetDisplayMedia: bc,
3407
3407
  shimGetParameters: la,
3408
3408
  shimGetUserMedia: ia,
@@ -3487,23 +3487,23 @@ function pa(n) {
3487
3487
  if (typeof n != "object" || !n.RTCPeerConnection)
3488
3488
  return;
3489
3489
  const t = n.RTCPeerConnection.prototype, e = t.createOffer, i = t.createAnswer, r = t.setLocalDescription, s = t.setRemoteDescription, a = t.addIceCandidate;
3490
- t.createOffer = function(l, h) {
3491
- const u = arguments.length >= 2 ? arguments[2] : arguments[0], f = e.apply(this, [u]);
3492
- return h ? (f.then(l, h), Promise.resolve()) : f;
3493
- }, t.createAnswer = function(l, h) {
3494
- const u = arguments.length >= 2 ? arguments[2] : arguments[0], f = i.apply(this, [u]);
3495
- return h ? (f.then(l, h), Promise.resolve()) : f;
3490
+ t.createOffer = function(l, u) {
3491
+ const h = arguments.length >= 2 ? arguments[2] : arguments[0], f = e.apply(this, [h]);
3492
+ return u ? (f.then(l, u), Promise.resolve()) : f;
3493
+ }, t.createAnswer = function(l, u) {
3494
+ const h = arguments.length >= 2 ? arguments[2] : arguments[0], f = i.apply(this, [h]);
3495
+ return u ? (f.then(l, u), Promise.resolve()) : f;
3496
3496
  };
3497
- let o = function(c, l, h) {
3498
- const u = r.apply(this, [c]);
3499
- return h ? (u.then(l, h), Promise.resolve()) : u;
3497
+ let o = function(c, l, u) {
3498
+ const h = r.apply(this, [c]);
3499
+ return u ? (h.then(l, u), Promise.resolve()) : h;
3500
3500
  };
3501
- t.setLocalDescription = o, o = function(c, l, h) {
3502
- const u = s.apply(this, [c]);
3503
- return h ? (u.then(l, h), Promise.resolve()) : u;
3504
- }, t.setRemoteDescription = o, o = function(c, l, h) {
3505
- const u = a.apply(this, [c]);
3506
- return h ? (u.then(l, h), Promise.resolve()) : u;
3501
+ t.setLocalDescription = o, o = function(c, l, u) {
3502
+ const h = s.apply(this, [c]);
3503
+ return u ? (h.then(l, u), Promise.resolve()) : h;
3504
+ }, t.setRemoteDescription = o, o = function(c, l, u) {
3505
+ const h = a.apply(this, [c]);
3506
+ return u ? (h.then(l, u), Promise.resolve()) : h;
3507
3507
  }, t.addIceCandidate = o;
3508
3508
  }
3509
3509
  function ma(n) {
@@ -3618,8 +3618,8 @@ function Si(n, t) {
3618
3618
  return !1;
3619
3619
  const c = Fr.splitSections(o.sdp);
3620
3620
  return c.shift(), c.some((l) => {
3621
- const h = Fr.parseMLine(l);
3622
- return h && h.kind === "application" && h.protocol.indexOf("SCTP") !== -1;
3621
+ const u = Fr.parseMLine(l);
3622
+ return u && u.kind === "application" && u.protocol.indexOf("SCTP") !== -1;
3623
3623
  });
3624
3624
  }, i = function(o) {
3625
3625
  const c = o.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);
@@ -3633,11 +3633,11 @@ function Si(n, t) {
3633
3633
  }, s = function(o, c) {
3634
3634
  let l = 65536;
3635
3635
  t.browser === "firefox" && t.version === 57 && (l = 65535);
3636
- const h = Fr.matchPrefix(
3636
+ const u = Fr.matchPrefix(
3637
3637
  o.sdp,
3638
3638
  "a=max-message-size:"
3639
3639
  );
3640
- return h.length > 0 ? l = parseInt(h[0].substr(19), 10) : t.browser === "firefox" && c !== -1 && (l = 2147483637), l;
3640
+ return u.length > 0 ? l = parseInt(u[0].substr(19), 10) : t.browser === "firefox" && c !== -1 && (l = 2147483637), l;
3641
3641
  }, a = n.RTCPeerConnection.prototype.setRemoteDescription;
3642
3642
  n.RTCPeerConnection.prototype.setRemoteDescription = function() {
3643
3643
  if (this._sctp = null, t.browser === "chrome" && t.version >= 76) {
@@ -3651,13 +3651,13 @@ function Si(n, t) {
3651
3651
  });
3652
3652
  }
3653
3653
  if (e(arguments[0])) {
3654
- const c = i(arguments[0]), l = r(c), h = s(arguments[0], c);
3655
- let u;
3656
- l === 0 && h === 0 ? u = Number.POSITIVE_INFINITY : l === 0 || h === 0 ? u = Math.max(l, h) : u = Math.min(l, h);
3654
+ const c = i(arguments[0]), l = r(c), u = s(arguments[0], c);
3655
+ let h;
3656
+ l === 0 && u === 0 ? h = Number.POSITIVE_INFINITY : l === 0 || u === 0 ? h = Math.max(l, u) : h = Math.min(l, u);
3657
3657
  const f = {};
3658
3658
  Object.defineProperty(f, "maxMessageSize", {
3659
3659
  get() {
3660
- return u;
3660
+ return h;
3661
3661
  }
3662
3662
  }), this._sctp = f;
3663
3663
  }
@@ -3787,7 +3787,7 @@ function Cc({ window: n } = {}, t = {
3787
3787
  case "firefox":
3788
3788
  if (!Ds || !jn || !t.shimFirefox)
3789
3789
  return e("Firefox shim is not included in this adapter release."), r;
3790
- e("adapter.js shimming firefox."), r.browserShim = Ds, Lr(n, i), ia(n, i), jn(n, i), ra(n), oa(n), na(n), sa(n), aa(n), ca(n), la(n), ha(n), ua(n), Dr(n), $n(n), Si(n, i), Ti(n);
3790
+ e("adapter.js shimming firefox."), r.browserShim = Ds, Lr(n, i), ia(n, i), jn(n, i), ra(n), oa(n), na(n), sa(n), aa(n), ca(n), la(n), ua(n), ha(n), Dr(n), $n(n), Si(n, i), Ti(n);
3791
3791
  break;
3792
3792
  case "edge":
3793
3793
  if (!Fs || !Gn || !t.shimEdge)
@@ -3809,10 +3809,10 @@ const Vs = Cc({ window: typeof window > "u" ? void 0 : window });
3809
3809
  function ee(n, t, e, i) {
3810
3810
  Object.defineProperty(n, t, { get: e, set: i, enumerable: !0, configurable: !0 });
3811
3811
  }
3812
- var un = (
3812
+ var hn = (
3813
3813
  //@ts-ignore
3814
3814
  Vs.default || Vs
3815
- ), hi = new /** @class */
3815
+ ), ui = new /** @class */
3816
3816
  ((function() {
3817
3817
  function n() {
3818
3818
  this.isIOS = [
@@ -3831,11 +3831,11 @@ var un = (
3831
3831
  var t = this.getBrowser(), e = this.getVersion(), i = this.supportedBrowsers.includes(t);
3832
3832
  return i ? t === "chrome" ? e >= this.minChromeVersion : t === "firefox" ? e >= this.minFirefoxVersion : t === "safari" ? !this.isIOS && e >= this.minSafariVersion : !1 : !1;
3833
3833
  }, n.prototype.getBrowser = function() {
3834
- return un.browserDetails.browser;
3834
+ return hn.browserDetails.browser;
3835
3835
  }, n.prototype.getVersion = function() {
3836
- return un.browserDetails.version || 0;
3836
+ return hn.browserDetails.version || 0;
3837
3837
  }, n.prototype.isUnifiedPlanSupported = function() {
3838
- var t = this.getBrowser(), e = un.browserDetails.version || 0;
3838
+ var t = this.getBrowser(), e = hn.browserDetails.version || 0;
3839
3839
  if (t === "chrome" && e < this.minChromeVersion) return !1;
3840
3840
  if (t === "firefox" && e >= this.minFirefoxVersion) return !0;
3841
3841
  if (!window.RTCRtpTransceiver || !("currentDirection" in RTCRtpTransceiver.prototype)) return !1;
@@ -3878,10 +3878,10 @@ var un = (
3878
3878
  this.CLOUD_HOST = "0.peerjs.com", this.CLOUD_PORT = 443, this.chunkedBrowsers = {
3879
3879
  Chrome: 1,
3880
3880
  chrome: 1
3881
- }, this.chunkedMTU = 16300, this.defaultConfig = Js, this.browser = hi.getBrowser(), this.browserVersion = hi.getVersion(), this.supports = (function() {
3881
+ }, this.chunkedMTU = 16300, this.defaultConfig = Js, this.browser = ui.getBrowser(), this.browserVersion = ui.getVersion(), this.supports = (function() {
3882
3882
  var t = {
3883
- browser: hi.isBrowserSupported(),
3884
- webRTC: hi.isWebRTCSupported(),
3883
+ browser: ui.isBrowserSupported(),
3884
+ webRTC: ui.isWebRTCSupported(),
3885
3885
  audioVideo: !1,
3886
3886
  data: !1,
3887
3887
  binaryBlob: !1,
@@ -3897,7 +3897,7 @@ var un = (
3897
3897
  ordered: !0
3898
3898
  }), t.data = !0, t.reliable = !!i.ordered;
3899
3899
  try {
3900
- i.binaryType = "blob", t.binaryBlob = !hi.isIOS;
3900
+ i.binaryType = "blob", t.binaryBlob = !ui.isIOS;
3901
3901
  } catch {
3902
3902
  }
3903
3903
  } catch {
@@ -3984,7 +3984,7 @@ dt.prototype.listenerCount = function(t) {
3984
3984
  dt.prototype.emit = function(t, e, i, r, s, a) {
3985
3985
  var o = _t ? _t + t : t;
3986
3986
  if (!this._events[o]) return !1;
3987
- var c = this._events[o], l = arguments.length, h, u;
3987
+ var c = this._events[o], l = arguments.length, u, h;
3988
3988
  if (c.fn) {
3989
3989
  switch (c.once && this.removeListener(t, c.fn, void 0, !0), l) {
3990
3990
  case 1:
@@ -4000,27 +4000,27 @@ dt.prototype.emit = function(t, e, i, r, s, a) {
4000
4000
  case 6:
4001
4001
  return c.fn.call(c.context, e, i, r, s, a), !0;
4002
4002
  }
4003
- for (u = 1, h = new Array(l - 1); u < l; u++) h[u - 1] = arguments[u];
4004
- c.fn.apply(c.context, h);
4003
+ for (h = 1, u = new Array(l - 1); h < l; h++) u[h - 1] = arguments[h];
4004
+ c.fn.apply(c.context, u);
4005
4005
  } else {
4006
4006
  var f = c.length, d;
4007
- for (u = 0; u < f; u++)
4008
- switch (c[u].once && this.removeListener(t, c[u].fn, void 0, !0), l) {
4007
+ for (h = 0; h < f; h++)
4008
+ switch (c[h].once && this.removeListener(t, c[h].fn, void 0, !0), l) {
4009
4009
  case 1:
4010
- c[u].fn.call(c[u].context);
4010
+ c[h].fn.call(c[h].context);
4011
4011
  break;
4012
4012
  case 2:
4013
- c[u].fn.call(c[u].context, e);
4013
+ c[h].fn.call(c[h].context, e);
4014
4014
  break;
4015
4015
  case 3:
4016
- c[u].fn.call(c[u].context, e, i);
4016
+ c[h].fn.call(c[h].context, e, i);
4017
4017
  break;
4018
4018
  case 4:
4019
- c[u].fn.call(c[u].context, e, i, r);
4019
+ c[h].fn.call(c[h].context, e, i, r);
4020
4020
  break;
4021
4021
  default:
4022
- if (!h) for (d = 1, h = new Array(l - 1); d < l; d++) h[d - 1] = arguments[d];
4023
- c[u].fn.apply(c[u].context, h);
4022
+ if (!u) for (d = 1, u = new Array(l - 1); d < l; d++) u[d - 1] = arguments[d];
4023
+ c[h].fn.apply(c[h].context, u);
4024
4024
  }
4025
4025
  }
4026
4026
  return !0;
@@ -4146,10 +4146,10 @@ var pe;
4146
4146
  (function(n) {
4147
4147
  n.Message = "message", n.Disconnected = "disconnected", n.Error = "error", n.Close = "close";
4148
4148
  })(pe || (pe = {}));
4149
- var ut;
4149
+ var ht;
4150
4150
  (function(n) {
4151
4151
  n.Heartbeat = "HEARTBEAT", n.Candidate = "CANDIDATE", n.Offer = "OFFER", n.Answer = "ANSWER", n.Open = "OPEN", n.Error = "ERROR", n.IdTaken = "ID-TAKEN", n.InvalidKey = "INVALID-KEY", n.Leave = "LEAVE", n.Expire = "EXPIRE";
4152
- })(ut || (ut = {}));
4152
+ })(ht || (ht = {}));
4153
4153
  var ds = {};
4154
4154
  ds = JSON.parse('{"name":"peerjs","version":"1.4.7","keywords":["peerjs","webrtc","p2p","rtc"],"description":"PeerJS client","homepage":"https://peerjs.com","bugs":{"url":"https://github.com/peers/peerjs/issues"},"repository":{"type":"git","url":"https://github.com/peers/peerjs"},"license":"MIT","contributors":["Michelle Bu <michelle@michellebu.com>","afrokick <devbyru@gmail.com>","ericz <really.ez@gmail.com>","Jairo <kidandcat@gmail.com>","Jonas Gloning <34194370+jonasgloning@users.noreply.github.com>","Jairo Caro-Accino Viciana <jairo@galax.be>","Carlos Caballero <carlos.caballero.gonzalez@gmail.com>","hc <hheennrryy@gmail.com>","Muhammad Asif <capripio@gmail.com>","PrashoonB <prashoonbhattacharjee@gmail.com>","Harsh Bardhan Mishra <47351025+HarshCasper@users.noreply.github.com>","akotynski <aleksanderkotbury@gmail.com>","lmb <i@lmb.io>","Jairooo <jairocaro@msn.com>","Moritz Stückler <moritz.stueckler@gmail.com>","Simon <crydotsnakegithub@gmail.com>","Denis Lukov <denismassters@gmail.com>","Philipp Hancke <fippo@andyet.net>","Hans Oksendahl <hansoksendahl@gmail.com>","Jess <jessachandler@gmail.com>","khankuan <khankuan@gmail.com>","DUODVK <kurmanov.work@gmail.com>","XiZhao <kwang1imsa@gmail.com>","Matthias Lohr <matthias@lohr.me>","=frank tree <=frnktrb@googlemail.com>","Andre Eckardt <aeckardt@outlook.com>","Chris Cowan <agentme49@gmail.com>","Alex Chuev <alex@chuev.com>","alxnull <alxnull@e.mail.de>","Yemel Jardi <angel.jardi@gmail.com>","Ben Parnell <benjaminparnell.94@gmail.com>","Benny Lichtner <bennlich@gmail.com>","fresheneesz <bitetrudpublic@gmail.com>","bob.barstead@exaptive.com <bob.barstead@exaptive.com>","chandika <chandika@gmail.com>","emersion <contact@emersion.fr>","Christopher Van <cvan@users.noreply.github.com>","eddieherm <edhermoso@gmail.com>","Eduardo Pinho <enet4mikeenet@gmail.com>","Evandro Zanatta <ezanatta@tray.net.br>","Gardner Bickford <gardner@users.noreply.github.com>","Gian Luca <gianluca.cecchi@cynny.com>","PatrickJS <github@gdi2290.com>","jonnyf <github@jonathanfoss.co.uk>","Hizkia Felix <hizkifw@gmail.com>","Hristo Oskov <hristo.oskov@gmail.com>","Isaac Madwed <i.madwed@gmail.com>","Ilya Konanykhin <ilya.konanykhin@gmail.com>","jasonbarry <jasbarry@me.com>","Jonathan Burke <jonathan.burke.1311@googlemail.com>","Josh Hamit <josh.hamit@gmail.com>","Jordan Austin <jrax86@gmail.com>","Joel Wetzell <jwetzell@yahoo.com>","xizhao <kevin.wang@cloudera.com>","Alberto Torres <kungfoobar@gmail.com>","Jonathan Mayol <mayoljonathan@gmail.com>","Jefferson Felix <me@jsfelix.dev>","Rolf Erik Lekang <me@rolflekang.com>","Kevin Mai-Husan Chia <mhchia@users.noreply.github.com>","Pepijn de Vos <pepijndevos@gmail.com>","JooYoung <qkdlql@naver.com>","Tobias Speicher <rootcommander@gmail.com>","Steve Blaurock <sblaurock@gmail.com>","Kyrylo Shegeda <shegeda@ualberta.ca>","Diwank Singh Tomer <singh@diwank.name>","Sören Balko <Soeren.Balko@gmail.com>","Arpit Solanki <solankiarpit1997@gmail.com>","Yuki Ito <yuki@gnnk.net>","Artur Zayats <zag2art@gmail.com>"],"funding":{"type":"opencollective","url":"https://opencollective.com/peer"},"collective":{"type":"opencollective","url":"https://opencollective.com/peer"},"files":["dist/*"],"sideEffects":["lib/global.ts","lib/supports.ts"],"main":"dist/bundler.cjs","module":"dist/bundler.mjs","browser-minified":"dist/peerjs.min.js","browser-unminified":"dist/peerjs.js","types":"dist/types.d.ts","engines":{"node":">= 10"},"targets":{"types":{"source":"lib/exports.ts"},"main":{"source":"lib/exports.ts","sourceMap":{"inlineSources":true}},"module":{"source":"lib/exports.ts","includeNodeModules":["eventemitter3"],"sourceMap":{"inlineSources":true}},"browser-minified":{"context":"browser","outputFormat":"global","optimize":true,"engines":{"browsers":"cover 99%, not dead"},"source":"lib/global.ts"},"browser-unminified":{"context":"browser","outputFormat":"global","optimize":false,"engines":{"browsers":"cover 99%, not dead"},"source":"lib/global.ts"}},"scripts":{"contributors":"git-authors-cli --print=false && prettier --write package.json && git add package.json package-lock.json && git commit -m \\"chore(contributors): update and sort contributors list\\"","check":"tsc --noEmit","watch":"parcel watch","build":"rm -rf dist && parcel build","prepublishOnly":"npm run build","test":"mocha -r ts-node/register -r jsdom-global/register test/**/*.ts","format":"prettier --write .","semantic-release":"semantic-release"},"devDependencies":{"@parcel/config-default":"^2.5.0","@parcel/packager-ts":"^2.5.0","@parcel/transformer-typescript-tsc":"^2.5.0","@parcel/transformer-typescript-types":"^2.5.0","@semantic-release/changelog":"^6.0.1","@semantic-release/git":"^10.0.1","@types/chai":"^4.3.0","@types/mocha":"^9.1.0","@types/node":"^17.0.18","chai":"^4.3.6","git-authors-cli":"^1.0.40","jsdom":"^19.0.0","jsdom-global":"^3.0.2","mocha":"^9.2.0","mock-socket":"8.0.5","parcel":"^2.5.0","parcel-transformer-tsc-sourcemaps":"^1.0.2","prettier":"^2.6.2","semantic-release":"^19.0.2","standard":"^16.0.4","ts-node":"^10.5.0","typescript":"^4.5.5"},"dependencies":{"@swc/helpers":"^0.3.13","eventemitter3":"^4.0.7","peerjs-js-binarypack":"1.0.1","webrtc-adapter":"^7.7.1"}}');
4155
4155
  var Rc = /* @__PURE__ */ (function() {
@@ -4244,7 +4244,7 @@ var Rc = /* @__PURE__ */ (function() {
4244
4244
  return;
4245
4245
  }
4246
4246
  var e = JSON.stringify({
4247
- type: ut.Heartbeat
4247
+ type: ht.Heartbeat
4248
4248
  });
4249
4249
  this._socket.send(e), this._scheduleHeartbeat();
4250
4250
  }, t.prototype._wsOpen = function() {
@@ -4308,22 +4308,22 @@ var jr = function() {
4308
4308
  });
4309
4309
  }
4310
4310
  return new (e || (e = Promise))(function(s, a) {
4311
- function o(h) {
4311
+ function o(u) {
4312
4312
  try {
4313
- l(i.next(h));
4314
- } catch (u) {
4315
- a(u);
4313
+ l(i.next(u));
4314
+ } catch (h) {
4315
+ a(h);
4316
4316
  }
4317
4317
  }
4318
- function c(h) {
4318
+ function c(u) {
4319
4319
  try {
4320
- l(i.throw(h));
4321
- } catch (u) {
4322
- a(u);
4320
+ l(i.throw(u));
4321
+ } catch (h) {
4322
+ a(h);
4323
4323
  }
4324
4324
  }
4325
- function l(h) {
4326
- h.done ? s(h.value) : r(h.value).then(o, c);
4325
+ function l(u) {
4326
+ u.done ? s(u.value) : r(u.value).then(o, c);
4327
4327
  }
4328
4328
  l((i = i.apply(n, t || [])).next());
4329
4329
  });
@@ -4345,10 +4345,10 @@ var jr = function() {
4345
4345
  return this;
4346
4346
  }), a;
4347
4347
  function o(l) {
4348
- return function(h) {
4348
+ return function(u) {
4349
4349
  return c([
4350
4350
  l,
4351
- h
4351
+ u
4352
4352
  ]);
4353
4353
  };
4354
4354
  }
@@ -4398,10 +4398,10 @@ var jr = function() {
4398
4398
  continue;
4399
4399
  }
4400
4400
  l = t.call(n, e);
4401
- } catch (h) {
4401
+ } catch (u) {
4402
4402
  l = [
4403
4403
  6,
4404
- h
4404
+ u
4405
4405
  ], r = 0;
4406
4406
  } finally {
4407
4407
  i = s = 0;
@@ -4437,7 +4437,7 @@ var jr = function() {
4437
4437
  var e = this, i = this.connection.peer, r = this.connection.connectionId, s = this.connection.type, a = this.connection.provider;
4438
4438
  O.default.log("Listening for ICE candidates."), t.onicecandidate = function(o) {
4439
4439
  !o.candidate || !o.candidate.candidate || (O.default.log("Received ICE candidates for ".concat(i, ":"), o.candidate), a.socket.send({
4440
- type: ut.Candidate,
4440
+ type: ht.Candidate,
4441
4441
  payload: {
4442
4442
  candidate: o.candidate,
4443
4443
  type: s,
@@ -4469,8 +4469,8 @@ var jr = function() {
4469
4469
  O.default.log("Received remote stream");
4470
4470
  var c = o.streams[0], l = a.getConnection(i, r);
4471
4471
  if (l.type === Jt.Media) {
4472
- var h = l;
4473
- e._addStreamToMediaConnection(c, h);
4472
+ var u = l;
4473
+ e._addStreamToMediaConnection(c, u);
4474
4474
  }
4475
4475
  };
4476
4476
  }, n.prototype.cleanup = function() {
@@ -4527,7 +4527,7 @@ var jr = function() {
4527
4527
  reliable: s.reliable,
4528
4528
  serialization: s.serialization
4529
4529
  })), e.socket.send({
4530
- type: ut.Offer,
4530
+ type: ht.Offer,
4531
4531
  payload: r,
4532
4532
  dst: this.connection.peer
4533
4533
  }), [
@@ -4588,7 +4588,7 @@ var jr = function() {
4588
4588
  ];
4589
4589
  case 4:
4590
4590
  return a.sent(), O.default.log("Set localDescription:", i, "for:".concat(this.connection.peer)), e.socket.send({
4591
- type: ut.Answer,
4591
+ type: ht.Answer,
4592
4592
  payload: {
4593
4593
  sdp: i,
4594
4594
  type: this.connection.type,
@@ -4824,10 +4824,10 @@ var Bc = /* @__PURE__ */ (function() {
4824
4824
  }, t.prototype.handleMessage = function(e) {
4825
4825
  var i = e.type, r = e.payload;
4826
4826
  switch (e.type) {
4827
- case ut.Answer:
4827
+ case ht.Answer:
4828
4828
  this._negotiator.handleSDP(i, r.sdp), this._open = !0;
4829
4829
  break;
4830
- case ut.Candidate:
4830
+ case ht.Candidate:
4831
4831
  this._negotiator.handleCandidate(r.candidate);
4832
4832
  break;
4833
4833
  default:
@@ -4849,9 +4849,9 @@ var Bc = /* @__PURE__ */ (function() {
4849
4849
  var l = c.value;
4850
4850
  this.handleMessage(l);
4851
4851
  }
4852
- } catch (h) {
4852
+ } catch (u) {
4853
4853
  r = {
4854
- error: h
4854
+ error: u
4855
4855
  };
4856
4856
  } finally {
4857
4857
  try {
@@ -5003,8 +5003,8 @@ var Uc = /* @__PURE__ */ (function() {
5003
5003
  if (a) {
5004
5004
  if (s === Blob) {
5005
5005
  D.blobToArrayBuffer(r, function(l) {
5006
- var h = D.unpack(l);
5007
- i.emit("data", h);
5006
+ var u = D.unpack(l);
5007
+ i.emit("data", u);
5008
5008
  });
5009
5009
  return;
5010
5010
  } else if (s === ArrayBuffer) o = D.unpack(r);
@@ -5089,10 +5089,10 @@ var Uc = /* @__PURE__ */ (function() {
5089
5089
  }, t.prototype.handleMessage = function(e) {
5090
5090
  var i = e.payload;
5091
5091
  switch (e.type) {
5092
- case ut.Answer:
5092
+ case ht.Answer:
5093
5093
  this._negotiator.handleSDP(e.type, i.sdp);
5094
5094
  break;
5095
- case ut.Candidate:
5095
+ case ht.Candidate:
5096
5096
  this._negotiator.handleCandidate(i.candidate);
5097
5097
  break;
5098
5098
  default:
@@ -5110,22 +5110,22 @@ var Ys = function(n, t, e, i) {
5110
5110
  });
5111
5111
  }
5112
5112
  return new (e || (e = Promise))(function(s, a) {
5113
- function o(h) {
5113
+ function o(u) {
5114
5114
  try {
5115
- l(i.next(h));
5116
- } catch (u) {
5117
- a(u);
5115
+ l(i.next(u));
5116
+ } catch (h) {
5117
+ a(h);
5118
5118
  }
5119
5119
  }
5120
- function c(h) {
5120
+ function c(u) {
5121
5121
  try {
5122
- l(i.throw(h));
5123
- } catch (u) {
5124
- a(u);
5122
+ l(i.throw(u));
5123
+ } catch (h) {
5124
+ a(h);
5125
5125
  }
5126
5126
  }
5127
- function l(h) {
5128
- h.done ? s(h.value) : r(h.value).then(o, c);
5127
+ function l(u) {
5128
+ u.done ? s(u.value) : r(u.value).then(o, c);
5129
5129
  }
5130
5130
  l((i = i.apply(n, t || [])).next());
5131
5131
  });
@@ -5147,10 +5147,10 @@ var Ys = function(n, t, e, i) {
5147
5147
  return this;
5148
5148
  }), a;
5149
5149
  function o(l) {
5150
- return function(h) {
5150
+ return function(u) {
5151
5151
  return c([
5152
5152
  l,
5153
- h
5153
+ u
5154
5154
  ]);
5155
5155
  };
5156
5156
  }
@@ -5200,10 +5200,10 @@ var Ys = function(n, t, e, i) {
5200
5200
  continue;
5201
5201
  }
5202
5202
  l = t.call(n, e);
5203
- } catch (h) {
5203
+ } catch (u) {
5204
5204
  l = [
5205
5205
  6,
5206
- h
5206
+ u
5207
5207
  ], r = 0;
5208
5208
  } finally {
5209
5209
  i = s = 0;
@@ -5316,7 +5316,7 @@ var Ys = function(n, t, e, i) {
5316
5316
  }
5317
5317
  return n;
5318
5318
  }, wi.apply(this, arguments);
5319
- }, ui = function(n) {
5319
+ }, hi = function(n) {
5320
5320
  var t = typeof Symbol == "function" && Symbol.iterator, e = t && n[t], i = 0;
5321
5321
  if (e) return e.call(n);
5322
5322
  if (n && typeof n.length == "number") return {
@@ -5405,13 +5405,13 @@ var Ys = function(n, t, e, i) {
5405
5405
  get: function() {
5406
5406
  var e, i, r = /* @__PURE__ */ Object.create(null);
5407
5407
  try {
5408
- for (var s = ui(this._connections), a = s.next(); !a.done; a = s.next()) {
5408
+ for (var s = hi(this._connections), a = s.next(); !a.done; a = s.next()) {
5409
5409
  var o = Vc(a.value, 2), c = o[0], l = o[1];
5410
5410
  r[c] = l;
5411
5411
  }
5412
- } catch (h) {
5412
+ } catch (u) {
5413
5413
  e = {
5414
- error: h
5414
+ error: u
5415
5415
  };
5416
5416
  } finally {
5417
5417
  try {
@@ -5458,25 +5458,25 @@ var Ys = function(n, t, e, i) {
5458
5458
  }, t.prototype._handleMessage = function(e) {
5459
5459
  var i, r, s = e.type, a = e.payload, o = e.src;
5460
5460
  switch (s) {
5461
- case ut.Open:
5461
+ case ht.Open:
5462
5462
  this._lastServerId = this.id, this._open = !0, this.emit("open", this.id);
5463
5463
  break;
5464
- case ut.Error:
5464
+ case ht.Error:
5465
5465
  this._abort(Q.ServerError, a.msg);
5466
5466
  break;
5467
- case ut.IdTaken:
5467
+ case ht.IdTaken:
5468
5468
  this._abort(Q.UnavailableID, 'ID "'.concat(this.id, '" is taken'));
5469
5469
  break;
5470
- case ut.InvalidKey:
5470
+ case ht.InvalidKey:
5471
5471
  this._abort(Q.InvalidKey, 'API KEY "'.concat(this._options.key, '" is invalid'));
5472
5472
  break;
5473
- case ut.Leave:
5473
+ case ht.Leave:
5474
5474
  O.default.log("Received leave message from ".concat(o)), this._cleanupPeer(o), this._connections.delete(o);
5475
5475
  break;
5476
- case ut.Expire:
5476
+ case ht.Expire:
5477
5477
  this.emitError(Q.PeerUnavailable, "Could not connect to peer ".concat(o));
5478
5478
  break;
5479
- case ut.Offer:
5479
+ case ht.Offer:
5480
5480
  var y = a.connectionId, _ = this.getConnection(o, y);
5481
5481
  if (_ && (_.close(), O.default.warn("Offer received for existing Connection ID:".concat(y))), a.type === Jt.Media) {
5482
5482
  var c = new Xn.MediaConnection(o, this, {
@@ -5499,9 +5499,9 @@ var Ys = function(n, t, e, i) {
5499
5499
  O.default.warn("Received malformed connection type:".concat(a.type));
5500
5500
  return;
5501
5501
  }
5502
- var h = this._getMessages(y);
5502
+ var u = this._getMessages(y);
5503
5503
  try {
5504
- for (var u = ui(h), f = u.next(); !f.done; f = u.next()) {
5504
+ for (var h = hi(u), f = h.next(); !f.done; f = h.next()) {
5505
5505
  var d = f.value;
5506
5506
  _.handleMessage(d);
5507
5507
  }
@@ -5511,7 +5511,7 @@ var Ys = function(n, t, e, i) {
5511
5511
  };
5512
5512
  } finally {
5513
5513
  try {
5514
- f && !f.done && (r = u.return) && r.call(u);
5514
+ f && !f.done && (r = h.return) && r.call(h);
5515
5515
  } finally {
5516
5516
  if (i) throw i.error;
5517
5517
  }
@@ -5564,13 +5564,13 @@ var Ys = function(n, t, e, i) {
5564
5564
  var r, s, a = this._connections.get(e);
5565
5565
  if (!a) return null;
5566
5566
  try {
5567
- for (var o = ui(a), c = o.next(); !c.done; c = o.next()) {
5567
+ for (var o = hi(a), c = o.next(); !c.done; c = o.next()) {
5568
5568
  var l = c.value;
5569
5569
  if (l.connectionId === i) return l;
5570
5570
  }
5571
- } catch (h) {
5571
+ } catch (u) {
5572
5572
  r = {
5573
- error: h
5573
+ error: u
5574
5574
  };
5575
5575
  } finally {
5576
5576
  try {
@@ -5596,7 +5596,7 @@ var Ys = function(n, t, e, i) {
5596
5596
  }, t.prototype._cleanup = function() {
5597
5597
  var e, i;
5598
5598
  try {
5599
- for (var r = ui(this._connections.keys()), s = r.next(); !s.done; s = r.next()) {
5599
+ for (var r = hi(this._connections.keys()), s = r.next(); !s.done; s = r.next()) {
5600
5600
  var a = s.value;
5601
5601
  this._cleanupPeer(a), this._connections.delete(a);
5602
5602
  }
@@ -5616,7 +5616,7 @@ var Ys = function(n, t, e, i) {
5616
5616
  var i, r, s = this._connections.get(e);
5617
5617
  if (s)
5618
5618
  try {
5619
- for (var a = ui(s), o = a.next(); !o.done; o = a.next()) {
5619
+ for (var a = hi(s), o = a.next(); !o.done; o = a.next()) {
5620
5620
  var c = o.value;
5621
5621
  c.close();
5622
5622
  }
@@ -5656,7 +5656,7 @@ var Ys = function(n, t, e, i) {
5656
5656
  }, t.DEFAULT_KEY = "peerjs", t;
5657
5657
  })(lr.EventEmitter)
5658
5658
  ), Jc = ba.Peer;
5659
- const Iu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
5659
+ const Ih = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
5660
5660
  __proto__: null,
5661
5661
  get Peer() {
5662
5662
  return Wn;
@@ -5667,11 +5667,11 @@ const Iu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
5667
5667
  function jc(n) {
5668
5668
  return typeof n == "string" && Gc.test(n);
5669
5669
  }
5670
- const ht = [];
5670
+ const ut = [];
5671
5671
  for (let n = 0; n < 256; ++n)
5672
- ht.push((n + 256).toString(16).slice(1));
5672
+ ut.push((n + 256).toString(16).slice(1));
5673
5673
  function $c(n, t = 0) {
5674
- return ht[n[t + 0]] + ht[n[t + 1]] + ht[n[t + 2]] + ht[n[t + 3]] + "-" + ht[n[t + 4]] + ht[n[t + 5]] + "-" + ht[n[t + 6]] + ht[n[t + 7]] + "-" + ht[n[t + 8]] + ht[n[t + 9]] + "-" + ht[n[t + 10]] + ht[n[t + 11]] + ht[n[t + 12]] + ht[n[t + 13]] + ht[n[t + 14]] + ht[n[t + 15]];
5674
+ return ut[n[t + 0]] + ut[n[t + 1]] + ut[n[t + 2]] + ut[n[t + 3]] + "-" + ut[n[t + 4]] + ut[n[t + 5]] + "-" + ut[n[t + 6]] + ut[n[t + 7]] + "-" + ut[n[t + 8]] + ut[n[t + 9]] + "-" + ut[n[t + 10]] + ut[n[t + 11]] + ut[n[t + 12]] + ut[n[t + 13]] + ut[n[t + 14]] + ut[n[t + 15]];
5675
5675
  }
5676
5676
  function qc(n) {
5677
5677
  if (!jc(n))
@@ -5696,8 +5696,8 @@ function Yc(n, t, e) {
5696
5696
  let l = new Uint8Array(16 + r.length);
5697
5697
  if (l.set(s), l.set(r, s.length), l = e(l), l[6] = l[6] & 15 | t, l[8] = l[8] & 63 | 128, a) {
5698
5698
  o = o || 0;
5699
- for (let h = 0; h < 16; ++h)
5700
- a[o + h] = l[h];
5699
+ for (let u = 0; u < 16; ++u)
5700
+ a[o + u] = l[u];
5701
5701
  return a;
5702
5702
  }
5703
5703
  return $c(l);
@@ -5746,16 +5746,16 @@ function Kc(n) {
5746
5746
  o[d] = s[a][d];
5747
5747
  for (let d = 16; d < 80; ++d)
5748
5748
  o[d] = fn(o[d - 3] ^ o[d - 8] ^ o[d - 14] ^ o[d - 16], 1);
5749
- let c = e[0], l = e[1], h = e[2], u = e[3], f = e[4];
5749
+ let c = e[0], l = e[1], u = e[2], h = e[3], f = e[4];
5750
5750
  for (let d = 0; d < 80; ++d) {
5751
- const y = Math.floor(d / 20), _ = fn(c, 5) + Zc(y, l, h, u) + f + t[y] + o[d] >>> 0;
5752
- f = u, u = h, h = fn(l, 30) >>> 0, l = c, c = _;
5751
+ const y = Math.floor(d / 20), _ = fn(c, 5) + Zc(y, l, u, h) + f + t[y] + o[d] >>> 0;
5752
+ f = h, h = u, u = fn(l, 30) >>> 0, l = c, c = _;
5753
5753
  }
5754
- e[0] = e[0] + c >>> 0, e[1] = e[1] + l >>> 0, e[2] = e[2] + h >>> 0, e[3] = e[3] + u >>> 0, e[4] = e[4] + f >>> 0;
5754
+ e[0] = e[0] + c >>> 0, e[1] = e[1] + l >>> 0, e[2] = e[2] + u >>> 0, e[3] = e[3] + h >>> 0, e[4] = e[4] + f >>> 0;
5755
5755
  }
5756
5756
  return [e[0] >> 24 & 255, e[0] >> 16 & 255, e[0] >> 8 & 255, e[0] & 255, e[1] >> 24 & 255, e[1] >> 16 & 255, e[1] >> 8 & 255, e[1] & 255, e[2] >> 24 & 255, e[2] >> 16 & 255, e[2] >> 8 & 255, e[2] & 255, e[3] >> 24 & 255, e[3] >> 16 & 255, e[3] >> 8 & 255, e[3] & 255, e[4] >> 24 & 255, e[4] >> 16 & 255, e[4] >> 8 & 255, e[4] & 255];
5757
5757
  }
5758
- const Nu = Yc("v5", 80, Kc);
5758
+ const Nh = Yc("v5", 80, Kc);
5759
5759
  var dn = { exports: {} }, pn = { exports: {} }, Qs;
5760
5760
  function Qc() {
5761
5761
  return Qs || (Qs = 1, (function() {
@@ -5883,27 +5883,27 @@ function el() {
5883
5883
  return ro || (ro = 1, (function() {
5884
5884
  var n = Qc(), t = eo().utf8, e = tl(), i = eo().bin, r = function(s, a) {
5885
5885
  s.constructor == String ? a && a.encoding === "binary" ? s = i.stringToBytes(s) : s = t.stringToBytes(s) : e(s) ? s = Array.prototype.slice.call(s, 0) : !Array.isArray(s) && s.constructor !== Uint8Array && (s = s.toString());
5886
- for (var o = n.bytesToWords(s), c = s.length * 8, l = 1732584193, h = -271733879, u = -1732584194, f = 271733878, d = 0; d < o.length; d++)
5886
+ for (var o = n.bytesToWords(s), c = s.length * 8, l = 1732584193, u = -271733879, h = -1732584194, f = 271733878, d = 0; d < o.length; d++)
5887
5887
  o[d] = (o[d] << 8 | o[d] >>> 24) & 16711935 | (o[d] << 24 | o[d] >>> 8) & 4278255360;
5888
5888
  o[c >>> 5] |= 128 << c % 32, o[(c + 64 >>> 9 << 4) + 14] = c;
5889
5889
  for (var y = r._ff, _ = r._gg, p = r._hh, m = r._ii, d = 0; d < o.length; d += 16) {
5890
- var v = l, g = h, b = u, x = f;
5891
- l = y(l, h, u, f, o[d + 0], 7, -680876936), f = y(f, l, h, u, o[d + 1], 12, -389564586), u = y(u, f, l, h, o[d + 2], 17, 606105819), h = y(h, u, f, l, o[d + 3], 22, -1044525330), l = y(l, h, u, f, o[d + 4], 7, -176418897), f = y(f, l, h, u, o[d + 5], 12, 1200080426), u = y(u, f, l, h, o[d + 6], 17, -1473231341), h = y(h, u, f, l, o[d + 7], 22, -45705983), l = y(l, h, u, f, o[d + 8], 7, 1770035416), f = y(f, l, h, u, o[d + 9], 12, -1958414417), u = y(u, f, l, h, o[d + 10], 17, -42063), h = y(h, u, f, l, o[d + 11], 22, -1990404162), l = y(l, h, u, f, o[d + 12], 7, 1804603682), f = y(f, l, h, u, o[d + 13], 12, -40341101), u = y(u, f, l, h, o[d + 14], 17, -1502002290), h = y(h, u, f, l, o[d + 15], 22, 1236535329), l = _(l, h, u, f, o[d + 1], 5, -165796510), f = _(f, l, h, u, o[d + 6], 9, -1069501632), u = _(u, f, l, h, o[d + 11], 14, 643717713), h = _(h, u, f, l, o[d + 0], 20, -373897302), l = _(l, h, u, f, o[d + 5], 5, -701558691), f = _(f, l, h, u, o[d + 10], 9, 38016083), u = _(u, f, l, h, o[d + 15], 14, -660478335), h = _(h, u, f, l, o[d + 4], 20, -405537848), l = _(l, h, u, f, o[d + 9], 5, 568446438), f = _(f, l, h, u, o[d + 14], 9, -1019803690), u = _(u, f, l, h, o[d + 3], 14, -187363961), h = _(h, u, f, l, o[d + 8], 20, 1163531501), l = _(l, h, u, f, o[d + 13], 5, -1444681467), f = _(f, l, h, u, o[d + 2], 9, -51403784), u = _(u, f, l, h, o[d + 7], 14, 1735328473), h = _(h, u, f, l, o[d + 12], 20, -1926607734), l = p(l, h, u, f, o[d + 5], 4, -378558), f = p(f, l, h, u, o[d + 8], 11, -2022574463), u = p(u, f, l, h, o[d + 11], 16, 1839030562), h = p(h, u, f, l, o[d + 14], 23, -35309556), l = p(l, h, u, f, o[d + 1], 4, -1530992060), f = p(f, l, h, u, o[d + 4], 11, 1272893353), u = p(u, f, l, h, o[d + 7], 16, -155497632), h = p(h, u, f, l, o[d + 10], 23, -1094730640), l = p(l, h, u, f, o[d + 13], 4, 681279174), f = p(f, l, h, u, o[d + 0], 11, -358537222), u = p(u, f, l, h, o[d + 3], 16, -722521979), h = p(h, u, f, l, o[d + 6], 23, 76029189), l = p(l, h, u, f, o[d + 9], 4, -640364487), f = p(f, l, h, u, o[d + 12], 11, -421815835), u = p(u, f, l, h, o[d + 15], 16, 530742520), h = p(h, u, f, l, o[d + 2], 23, -995338651), l = m(l, h, u, f, o[d + 0], 6, -198630844), f = m(f, l, h, u, o[d + 7], 10, 1126891415), u = m(u, f, l, h, o[d + 14], 15, -1416354905), h = m(h, u, f, l, o[d + 5], 21, -57434055), l = m(l, h, u, f, o[d + 12], 6, 1700485571), f = m(f, l, h, u, o[d + 3], 10, -1894986606), u = m(u, f, l, h, o[d + 10], 15, -1051523), h = m(h, u, f, l, o[d + 1], 21, -2054922799), l = m(l, h, u, f, o[d + 8], 6, 1873313359), f = m(f, l, h, u, o[d + 15], 10, -30611744), u = m(u, f, l, h, o[d + 6], 15, -1560198380), h = m(h, u, f, l, o[d + 13], 21, 1309151649), l = m(l, h, u, f, o[d + 4], 6, -145523070), f = m(f, l, h, u, o[d + 11], 10, -1120210379), u = m(u, f, l, h, o[d + 2], 15, 718787259), h = m(h, u, f, l, o[d + 9], 21, -343485551), l = l + v >>> 0, h = h + g >>> 0, u = u + b >>> 0, f = f + x >>> 0;
5890
+ var v = l, g = u, b = h, x = f;
5891
+ l = y(l, u, h, f, o[d + 0], 7, -680876936), f = y(f, l, u, h, o[d + 1], 12, -389564586), h = y(h, f, l, u, o[d + 2], 17, 606105819), u = y(u, h, f, l, o[d + 3], 22, -1044525330), l = y(l, u, h, f, o[d + 4], 7, -176418897), f = y(f, l, u, h, o[d + 5], 12, 1200080426), h = y(h, f, l, u, o[d + 6], 17, -1473231341), u = y(u, h, f, l, o[d + 7], 22, -45705983), l = y(l, u, h, f, o[d + 8], 7, 1770035416), f = y(f, l, u, h, o[d + 9], 12, -1958414417), h = y(h, f, l, u, o[d + 10], 17, -42063), u = y(u, h, f, l, o[d + 11], 22, -1990404162), l = y(l, u, h, f, o[d + 12], 7, 1804603682), f = y(f, l, u, h, o[d + 13], 12, -40341101), h = y(h, f, l, u, o[d + 14], 17, -1502002290), u = y(u, h, f, l, o[d + 15], 22, 1236535329), l = _(l, u, h, f, o[d + 1], 5, -165796510), f = _(f, l, u, h, o[d + 6], 9, -1069501632), h = _(h, f, l, u, o[d + 11], 14, 643717713), u = _(u, h, f, l, o[d + 0], 20, -373897302), l = _(l, u, h, f, o[d + 5], 5, -701558691), f = _(f, l, u, h, o[d + 10], 9, 38016083), h = _(h, f, l, u, o[d + 15], 14, -660478335), u = _(u, h, f, l, o[d + 4], 20, -405537848), l = _(l, u, h, f, o[d + 9], 5, 568446438), f = _(f, l, u, h, o[d + 14], 9, -1019803690), h = _(h, f, l, u, o[d + 3], 14, -187363961), u = _(u, h, f, l, o[d + 8], 20, 1163531501), l = _(l, u, h, f, o[d + 13], 5, -1444681467), f = _(f, l, u, h, o[d + 2], 9, -51403784), h = _(h, f, l, u, o[d + 7], 14, 1735328473), u = _(u, h, f, l, o[d + 12], 20, -1926607734), l = p(l, u, h, f, o[d + 5], 4, -378558), f = p(f, l, u, h, o[d + 8], 11, -2022574463), h = p(h, f, l, u, o[d + 11], 16, 1839030562), u = p(u, h, f, l, o[d + 14], 23, -35309556), l = p(l, u, h, f, o[d + 1], 4, -1530992060), f = p(f, l, u, h, o[d + 4], 11, 1272893353), h = p(h, f, l, u, o[d + 7], 16, -155497632), u = p(u, h, f, l, o[d + 10], 23, -1094730640), l = p(l, u, h, f, o[d + 13], 4, 681279174), f = p(f, l, u, h, o[d + 0], 11, -358537222), h = p(h, f, l, u, o[d + 3], 16, -722521979), u = p(u, h, f, l, o[d + 6], 23, 76029189), l = p(l, u, h, f, o[d + 9], 4, -640364487), f = p(f, l, u, h, o[d + 12], 11, -421815835), h = p(h, f, l, u, o[d + 15], 16, 530742520), u = p(u, h, f, l, o[d + 2], 23, -995338651), l = m(l, u, h, f, o[d + 0], 6, -198630844), f = m(f, l, u, h, o[d + 7], 10, 1126891415), h = m(h, f, l, u, o[d + 14], 15, -1416354905), u = m(u, h, f, l, o[d + 5], 21, -57434055), l = m(l, u, h, f, o[d + 12], 6, 1700485571), f = m(f, l, u, h, o[d + 3], 10, -1894986606), h = m(h, f, l, u, o[d + 10], 15, -1051523), u = m(u, h, f, l, o[d + 1], 21, -2054922799), l = m(l, u, h, f, o[d + 8], 6, 1873313359), f = m(f, l, u, h, o[d + 15], 10, -30611744), h = m(h, f, l, u, o[d + 6], 15, -1560198380), u = m(u, h, f, l, o[d + 13], 21, 1309151649), l = m(l, u, h, f, o[d + 4], 6, -145523070), f = m(f, l, u, h, o[d + 11], 10, -1120210379), h = m(h, f, l, u, o[d + 2], 15, 718787259), u = m(u, h, f, l, o[d + 9], 21, -343485551), l = l + v >>> 0, u = u + g >>> 0, h = h + b >>> 0, f = f + x >>> 0;
5892
5892
  }
5893
- return n.endian([l, h, u, f]);
5893
+ return n.endian([l, u, h, f]);
5894
5894
  };
5895
- r._ff = function(s, a, o, c, l, h, u) {
5896
- var f = s + (a & o | ~a & c) + (l >>> 0) + u;
5897
- return (f << h | f >>> 32 - h) + a;
5898
- }, r._gg = function(s, a, o, c, l, h, u) {
5899
- var f = s + (a & c | o & ~c) + (l >>> 0) + u;
5900
- return (f << h | f >>> 32 - h) + a;
5901
- }, r._hh = function(s, a, o, c, l, h, u) {
5902
- var f = s + (a ^ o ^ c) + (l >>> 0) + u;
5903
- return (f << h | f >>> 32 - h) + a;
5904
- }, r._ii = function(s, a, o, c, l, h, u) {
5905
- var f = s + (o ^ (a | ~c)) + (l >>> 0) + u;
5906
- return (f << h | f >>> 32 - h) + a;
5895
+ r._ff = function(s, a, o, c, l, u, h) {
5896
+ var f = s + (a & o | ~a & c) + (l >>> 0) + h;
5897
+ return (f << u | f >>> 32 - u) + a;
5898
+ }, r._gg = function(s, a, o, c, l, u, h) {
5899
+ var f = s + (a & c | o & ~c) + (l >>> 0) + h;
5900
+ return (f << u | f >>> 32 - u) + a;
5901
+ }, r._hh = function(s, a, o, c, l, u, h) {
5902
+ var f = s + (a ^ o ^ c) + (l >>> 0) + h;
5903
+ return (f << u | f >>> 32 - u) + a;
5904
+ }, r._ii = function(s, a, o, c, l, u, h) {
5905
+ var f = s + (o ^ (a | ~c)) + (l >>> 0) + h;
5906
+ return (f << u | f >>> 32 - u) + a;
5907
5907
  }, r._blocksize = 16, r._digestsize = 16, dn.exports = function(s, a) {
5908
5908
  if (s == null)
5909
5909
  throw new Error("Illegal argument " + s);
@@ -5913,7 +5913,7 @@ function el() {
5913
5913
  })()), dn.exports;
5914
5914
  }
5915
5915
  var il = el();
5916
- const Uu = /* @__PURE__ */ Kr(il), ft = ["00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "0a", "0b", "0c", "0d", "0e", "0f", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "1a", "1b", "1c", "1d", "1e", "1f", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "2a", "2b", "2c", "2d", "2e", "2f", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "3a", "3b", "3c", "3d", "3e", "3f", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "4a", "4b", "4c", "4d", "4e", "4f", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "5a", "5b", "5c", "5d", "5e", "5f", "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "6a", "6b", "6c", "6d", "6e", "6f", "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "7a", "7b", "7c", "7d", "7e", "7f", "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "8a", "8b", "8c", "8d", "8e", "8f", "90", "91", "92", "93", "94", "95", "96", "97", "98", "99", "9a", "9b", "9c", "9d", "9e", "9f", "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "aa", "ab", "ac", "ad", "ae", "af", "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "b9", "ba", "bb", "bc", "bd", "be", "bf", "c0", "c1", "c2", "c3", "c4", "c5", "c6", "c7", "c8", "c9", "ca", "cb", "cc", "cd", "ce", "cf", "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7", "d8", "d9", "da", "db", "dc", "dd", "de", "df", "e0", "e1", "e2", "e3", "e4", "e5", "e6", "e7", "e8", "e9", "ea", "eb", "ec", "ed", "ee", "ef", "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "fa", "fb", "fc", "fd", "fe", "ff"];
5916
+ const Uh = /* @__PURE__ */ Kr(il), ft = ["00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "0a", "0b", "0c", "0d", "0e", "0f", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "1a", "1b", "1c", "1d", "1e", "1f", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "2a", "2b", "2c", "2d", "2e", "2f", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "3a", "3b", "3c", "3d", "3e", "3f", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "4a", "4b", "4c", "4d", "4e", "4f", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "5a", "5b", "5c", "5d", "5e", "5f", "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "6a", "6b", "6c", "6d", "6e", "6f", "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "7a", "7b", "7c", "7d", "7e", "7f", "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "8a", "8b", "8c", "8d", "8e", "8f", "90", "91", "92", "93", "94", "95", "96", "97", "98", "99", "9a", "9b", "9c", "9d", "9e", "9f", "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "aa", "ab", "ac", "ad", "ae", "af", "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "b9", "ba", "bb", "bc", "bd", "be", "bf", "c0", "c1", "c2", "c3", "c4", "c5", "c6", "c7", "c8", "c9", "ca", "cb", "cc", "cd", "ce", "cf", "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7", "d8", "d9", "da", "db", "dc", "dd", "de", "df", "e0", "e1", "e2", "e3", "e4", "e5", "e6", "e7", "e8", "e9", "ea", "eb", "ec", "ed", "ee", "ef", "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "fa", "fb", "fc", "fd", "fe", "ff"];
5917
5917
  let no = 1234567;
5918
5918
  const Pa = Math.PI / 180, wa = 180 / Math.PI;
5919
5919
  function rl() {
@@ -5947,10 +5947,10 @@ function cl(n, t, e) {
5947
5947
  function ll(n, t, e) {
5948
5948
  return n <= t ? 0 : n >= e ? 1 : (n = (n - t) / (e - t), n * n * n * (n * (n * 6 - 15) + 10));
5949
5949
  }
5950
- function hl(n, t) {
5950
+ function ul(n, t) {
5951
5951
  return n + Math.floor(Math.random() * (t - n + 1));
5952
5952
  }
5953
- function ul(n, t) {
5953
+ function hl(n, t) {
5954
5954
  return n + Math.random() * (t - n);
5955
5955
  }
5956
5956
  function fl(n) {
@@ -5977,25 +5977,25 @@ function vl(n) {
5977
5977
  return Math.pow(2, Math.floor(Math.log(n) / Math.LN2));
5978
5978
  }
5979
5979
  function _l(n, t, e, i, r) {
5980
- const s = Math.cos, a = Math.sin, o = s(e / 2), c = a(e / 2), l = s((t + i) / 2), h = a((t + i) / 2), u = s((t - i) / 2), f = a((t - i) / 2), d = s((i - t) / 2), y = a((i - t) / 2);
5980
+ const s = Math.cos, a = Math.sin, o = s(e / 2), c = a(e / 2), l = s((t + i) / 2), u = a((t + i) / 2), h = s((t - i) / 2), f = a((t - i) / 2), d = s((i - t) / 2), y = a((i - t) / 2);
5981
5981
  switch (r) {
5982
5982
  case "XYX":
5983
- n.set(o * h, c * u, c * f, o * l);
5983
+ n.set(o * u, c * h, c * f, o * l);
5984
5984
  break;
5985
5985
  case "YZY":
5986
- n.set(c * f, o * h, c * u, o * l);
5986
+ n.set(c * f, o * u, c * h, o * l);
5987
5987
  break;
5988
5988
  case "ZXZ":
5989
- n.set(c * u, c * f, o * h, o * l);
5989
+ n.set(c * h, c * f, o * u, o * l);
5990
5990
  break;
5991
5991
  case "XZX":
5992
- n.set(o * h, c * y, c * d, o * l);
5992
+ n.set(o * u, c * y, c * d, o * l);
5993
5993
  break;
5994
5994
  case "YXY":
5995
- n.set(c * d, o * h, c * y, o * l);
5995
+ n.set(c * d, o * u, c * y, o * l);
5996
5996
  break;
5997
5997
  case "ZYZ":
5998
- n.set(c * y, c * d, o * h, o * l);
5998
+ n.set(c * y, c * d, o * u, o * l);
5999
5999
  break;
6000
6000
  default:
6001
6001
  console.warn("../math.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: " + r);
@@ -6054,8 +6054,8 @@ const ni = {
6054
6054
  pingpong: al,
6055
6055
  smoothstep: cl,
6056
6056
  smootherstep: ll,
6057
- randInt: hl,
6058
- randFloat: ul,
6057
+ randInt: ul,
6058
+ randFloat: hl,
6059
6059
  randFloatSpread: fl,
6060
6060
  seededRandom: dl,
6061
6061
  degToRad: pl,
@@ -6072,34 +6072,34 @@ class G {
6072
6072
  this.isQuaternion = !0, this._x = t, this._y = e, this._z = i, this._w = r;
6073
6073
  }
6074
6074
  static slerpFlat(t, e, i, r, s, a, o) {
6075
- let c = i[r + 0], l = i[r + 1], h = i[r + 2], u = i[r + 3];
6075
+ let c = i[r + 0], l = i[r + 1], u = i[r + 2], h = i[r + 3];
6076
6076
  const f = s[a + 0], d = s[a + 1], y = s[a + 2], _ = s[a + 3];
6077
6077
  if (o === 0) {
6078
- t[e + 0] = c, t[e + 1] = l, t[e + 2] = h, t[e + 3] = u;
6078
+ t[e + 0] = c, t[e + 1] = l, t[e + 2] = u, t[e + 3] = h;
6079
6079
  return;
6080
6080
  }
6081
6081
  if (o === 1) {
6082
6082
  t[e + 0] = f, t[e + 1] = d, t[e + 2] = y, t[e + 3] = _;
6083
6083
  return;
6084
6084
  }
6085
- if (u !== _ || c !== f || l !== d || h !== y) {
6085
+ if (h !== _ || c !== f || l !== d || u !== y) {
6086
6086
  let p = 1 - o;
6087
- const m = c * f + l * d + h * y + u * _, v = m >= 0 ? 1 : -1, g = 1 - m * m;
6087
+ const m = c * f + l * d + u * y + h * _, v = m >= 0 ? 1 : -1, g = 1 - m * m;
6088
6088
  if (g > Number.EPSILON) {
6089
6089
  const x = Math.sqrt(g), S = Math.atan2(x, m * v);
6090
6090
  p = Math.sin(p * S) / x, o = Math.sin(o * S) / x;
6091
6091
  }
6092
6092
  const b = o * v;
6093
- if (c = c * p + f * b, l = l * p + d * b, h = h * p + y * b, u = u * p + _ * b, p === 1 - o) {
6094
- const x = 1 / Math.sqrt(c * c + l * l + h * h + u * u);
6095
- c *= x, l *= x, h *= x, u *= x;
6093
+ if (c = c * p + f * b, l = l * p + d * b, u = u * p + y * b, h = h * p + _ * b, p === 1 - o) {
6094
+ const x = 1 / Math.sqrt(c * c + l * l + u * u + h * h);
6095
+ c *= x, l *= x, u *= x, h *= x;
6096
6096
  }
6097
6097
  }
6098
- t[e] = c, t[e + 1] = l, t[e + 2] = h, t[e + 3] = u;
6098
+ t[e] = c, t[e + 1] = l, t[e + 2] = u, t[e + 3] = h;
6099
6099
  }
6100
6100
  static multiplyQuaternionsFlat(t, e, i, r, s, a) {
6101
- const o = i[r], c = i[r + 1], l = i[r + 2], h = i[r + 3], u = s[a], f = s[a + 1], d = s[a + 2], y = s[a + 3];
6102
- return t[e] = o * y + h * u + c * d - l * f, t[e + 1] = c * y + h * f + l * u - o * d, t[e + 2] = l * y + h * d + o * f - c * u, t[e + 3] = h * y - o * u - c * f - l * d, t;
6101
+ const o = i[r], c = i[r + 1], l = i[r + 2], u = i[r + 3], h = s[a], f = s[a + 1], d = s[a + 2], y = s[a + 3];
6102
+ return t[e] = o * y + u * h + c * d - l * f, t[e + 1] = c * y + u * f + l * h - o * d, t[e + 2] = l * y + u * d + o * f - c * h, t[e + 3] = u * y - o * h - c * f - l * d, t;
6103
6103
  }
6104
6104
  get x() {
6105
6105
  return this._x;
@@ -6135,25 +6135,25 @@ class G {
6135
6135
  return this._x = t.x, this._y = t.y, this._z = t.z, this._w = t.w, this._onChangeCallback(), this;
6136
6136
  }
6137
6137
  setFromEuler(t, e = !0) {
6138
- const i = t._x, r = t._y, s = t._z, a = t._order, o = Math.cos, c = Math.sin, l = o(i / 2), h = o(r / 2), u = o(s / 2), f = c(i / 2), d = c(r / 2), y = c(s / 2);
6138
+ const i = t._x, r = t._y, s = t._z, a = t._order, o = Math.cos, c = Math.sin, l = o(i / 2), u = o(r / 2), h = o(s / 2), f = c(i / 2), d = c(r / 2), y = c(s / 2);
6139
6139
  switch (a) {
6140
6140
  case "XYZ":
6141
- this._x = f * h * u + l * d * y, this._y = l * d * u - f * h * y, this._z = l * h * y + f * d * u, this._w = l * h * u - f * d * y;
6141
+ this._x = f * u * h + l * d * y, this._y = l * d * h - f * u * y, this._z = l * u * y + f * d * h, this._w = l * u * h - f * d * y;
6142
6142
  break;
6143
6143
  case "YXZ":
6144
- this._x = f * h * u + l * d * y, this._y = l * d * u - f * h * y, this._z = l * h * y - f * d * u, this._w = l * h * u + f * d * y;
6144
+ this._x = f * u * h + l * d * y, this._y = l * d * h - f * u * y, this._z = l * u * y - f * d * h, this._w = l * u * h + f * d * y;
6145
6145
  break;
6146
6146
  case "ZXY":
6147
- this._x = f * h * u - l * d * y, this._y = l * d * u + f * h * y, this._z = l * h * y + f * d * u, this._w = l * h * u - f * d * y;
6147
+ this._x = f * u * h - l * d * y, this._y = l * d * h + f * u * y, this._z = l * u * y + f * d * h, this._w = l * u * h - f * d * y;
6148
6148
  break;
6149
6149
  case "ZYX":
6150
- this._x = f * h * u - l * d * y, this._y = l * d * u + f * h * y, this._z = l * h * y - f * d * u, this._w = l * h * u + f * d * y;
6150
+ this._x = f * u * h - l * d * y, this._y = l * d * h + f * u * y, this._z = l * u * y - f * d * h, this._w = l * u * h + f * d * y;
6151
6151
  break;
6152
6152
  case "YZX":
6153
- this._x = f * h * u + l * d * y, this._y = l * d * u + f * h * y, this._z = l * h * y - f * d * u, this._w = l * h * u - f * d * y;
6153
+ this._x = f * u * h + l * d * y, this._y = l * d * h + f * u * y, this._z = l * u * y - f * d * h, this._w = l * u * h - f * d * y;
6154
6154
  break;
6155
6155
  case "XZY":
6156
- this._x = f * h * u - l * d * y, this._y = l * d * u - f * h * y, this._z = l * h * y + f * d * u, this._w = l * h * u + f * d * y;
6156
+ this._x = f * u * h - l * d * y, this._y = l * d * h - f * u * y, this._z = l * u * y + f * d * h, this._w = l * u * h + f * d * y;
6157
6157
  break;
6158
6158
  default:
6159
6159
  console.warn("../math.Quaternion: .setFromEuler() encountered an unknown order: " + a);
@@ -6165,19 +6165,19 @@ class G {
6165
6165
  return this._x = t.x * r, this._y = t.y * r, this._z = t.z * r, this._w = Math.cos(i), this._onChangeCallback(), this;
6166
6166
  }
6167
6167
  setFromRotationMatrix(t) {
6168
- const e = t.elements, i = e[0], r = e[4], s = e[8], a = e[1], o = e[5], c = e[9], l = e[2], h = e[6], u = e[10], f = i + o + u;
6168
+ const e = t.elements, i = e[0], r = e[4], s = e[8], a = e[1], o = e[5], c = e[9], l = e[2], u = e[6], h = e[10], f = i + o + h;
6169
6169
  if (f > 0) {
6170
6170
  const d = 0.5 / Math.sqrt(f + 1);
6171
- this._w = 0.25 / d, this._x = (h - c) * d, this._y = (s - l) * d, this._z = (a - r) * d;
6172
- } else if (i > o && i > u) {
6173
- const d = 2 * Math.sqrt(1 + i - o - u);
6174
- this._w = (h - c) / d, this._x = 0.25 * d, this._y = (r + a) / d, this._z = (s + l) / d;
6175
- } else if (o > u) {
6176
- const d = 2 * Math.sqrt(1 + o - i - u);
6177
- this._w = (s - l) / d, this._x = (r + a) / d, this._y = 0.25 * d, this._z = (c + h) / d;
6171
+ this._w = 0.25 / d, this._x = (u - c) * d, this._y = (s - l) * d, this._z = (a - r) * d;
6172
+ } else if (i > o && i > h) {
6173
+ const d = 2 * Math.sqrt(1 + i - o - h);
6174
+ this._w = (u - c) / d, this._x = 0.25 * d, this._y = (r + a) / d, this._z = (s + l) / d;
6175
+ } else if (o > h) {
6176
+ const d = 2 * Math.sqrt(1 + o - i - h);
6177
+ this._w = (s - l) / d, this._x = (r + a) / d, this._y = 0.25 * d, this._z = (c + u) / d;
6178
6178
  } else {
6179
- const d = 2 * Math.sqrt(1 + u - i - o);
6180
- this._w = (a - r) / d, this._x = (s + l) / d, this._y = (c + h) / d, this._z = 0.25 * d;
6179
+ const d = 2 * Math.sqrt(1 + h - i - o);
6180
+ this._w = (a - r) / d, this._x = (s + l) / d, this._y = (c + u) / d, this._z = 0.25 * d;
6181
6181
  }
6182
6182
  return this._onChangeCallback(), this;
6183
6183
  }
@@ -6224,8 +6224,8 @@ class G {
6224
6224
  return this.multiplyQuaternions(t, this);
6225
6225
  }
6226
6226
  multiplyQuaternions(t, e) {
6227
- const i = t._x, r = t._y, s = t._z, a = t._w, o = e._x, c = e._y, l = e._z, h = e._w;
6228
- return this._x = i * h + a * o + r * l - s * c, this._y = r * h + a * c + s * o - i * l, this._z = s * h + a * l + i * c - r * o, this._w = a * h - i * o - r * c - s * l, this._onChangeCallback(), this;
6227
+ const i = t._x, r = t._y, s = t._z, a = t._w, o = e._x, c = e._y, l = e._z, u = e._w;
6228
+ return this._x = i * u + a * o + r * l - s * c, this._y = r * u + a * c + s * o - i * l, this._z = s * u + a * l + i * c - r * o, this._w = a * u - i * o - r * c - s * l, this._onChangeCallback(), this;
6229
6229
  }
6230
6230
  slerp(t, e) {
6231
6231
  if (e === 0)
@@ -6241,8 +6241,8 @@ class G {
6241
6241
  const d = 1 - e;
6242
6242
  return this._w = d * a + e * this._w, this._x = d * i + e * this._x, this._y = d * r + e * this._y, this._z = d * s + e * this._z, this.normalize(), this;
6243
6243
  }
6244
- const l = Math.sqrt(c), h = Math.atan2(l, o), u = Math.sin((1 - e) * h) / l, f = Math.sin(e * h) / l;
6245
- return this._w = a * u + this._w * f, this._x = i * u + this._x * f, this._y = r * u + this._y * f, this._z = s * u + this._z * f, this._onChangeCallback(), this;
6244
+ const l = Math.sqrt(c), u = Math.atan2(l, o), h = Math.sin((1 - e) * u) / l, f = Math.sin(e * u) / l;
6245
+ return this._w = a * h + this._w * f, this._x = i * h + this._x * f, this._y = r * h + this._y * f, this._z = s * h + this._z * f, this._onChangeCallback(), this;
6246
6246
  }
6247
6247
  slerpQuaternions(t, e, i) {
6248
6248
  return this.copy(t).slerp(e, i);
@@ -6373,8 +6373,8 @@ class B {
6373
6373
  return this.x = (s[0] * e + s[4] * i + s[8] * r + s[12]) * a, this.y = (s[1] * e + s[5] * i + s[9] * r + s[13]) * a, this.z = (s[2] * e + s[6] * i + s[10] * r + s[14]) * a, this;
6374
6374
  }
6375
6375
  applyQuaternion(t) {
6376
- const e = this.x, i = this.y, r = this.z, s = t.x, a = t.y, o = t.z, c = t.w, l = 2 * (a * r - o * i), h = 2 * (o * e - s * r), u = 2 * (s * i - a * e);
6377
- return this.x = e + c * l + a * u - o * h, this.y = i + c * h + o * l - s * u, this.z = r + c * u + s * h - a * l, this;
6376
+ const e = this.x, i = this.y, r = this.z, s = t.x, a = t.y, o = t.z, c = t.w, l = 2 * (a * r - o * i), u = 2 * (o * e - s * r), h = 2 * (s * i - a * e);
6377
+ return this.x = e + c * l + a * h - o * u, this.y = i + c * u + o * l - s * h, this.z = r + c * h + s * u - a * l, this;
6378
6378
  }
6379
6379
  transformDirection(t) {
6380
6380
  const e = this.x, i = this.y, r = this.z, s = t.elements;
@@ -6527,8 +6527,8 @@ class B {
6527
6527
  }
6528
6528
  const gn = new B(), so = new G(), pr = 2e3, oo = 2001;
6529
6529
  class Qt {
6530
- constructor(t, e, i, r, s, a, o, c, l, h, u, f, d, y, _, p) {
6531
- this.isMatrix4 = !0, Qt.prototype.isMatrix4 = !0, this.elements = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], t !== void 0 && this.set(t, e, i, r, s, a, o, c, l, h, u, f, d, y, _, p);
6530
+ constructor(t, e, i, r, s, a, o, c, l, u, h, f, d, y, _, p) {
6531
+ this.isMatrix4 = !0, Qt.prototype.isMatrix4 = !0, this.elements = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1], t !== void 0 && this.set(t, e, i, r, s, a, o, c, l, u, h, f, d, y, _, p);
6532
6532
  }
6533
6533
  extractPosition(t) {
6534
6534
  return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."), this.copyPosition(t);
@@ -6539,9 +6539,9 @@ class Qt {
6539
6539
  setRotationFromQuaternion(t) {
6540
6540
  return this.makeRotationFromQuaternion(t);
6541
6541
  }
6542
- set(t, e, i, r, s, a, o, c, l, h, u, f, d, y, _, p) {
6542
+ set(t, e, i, r, s, a, o, c, l, u, h, f, d, y, _, p) {
6543
6543
  const m = this.elements;
6544
- return m[0] = t, m[4] = e, m[8] = i, m[12] = r, m[1] = s, m[5] = a, m[9] = o, m[13] = c, m[2] = l, m[6] = h, m[10] = u, m[14] = f, m[3] = d, m[7] = y, m[11] = _, m[15] = p, this;
6544
+ return m[0] = t, m[4] = e, m[8] = i, m[12] = r, m[1] = s, m[5] = a, m[9] = o, m[13] = c, m[2] = l, m[6] = u, m[10] = h, m[14] = f, m[3] = d, m[7] = y, m[11] = _, m[15] = p, this;
6545
6545
  }
6546
6546
  identity() {
6547
6547
  return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this;
@@ -6572,25 +6572,25 @@ class Qt {
6572
6572
  return e[0] = i[0] * r, e[1] = i[1] * r, e[2] = i[2] * r, e[3] = 0, e[4] = i[4] * s, e[5] = i[5] * s, e[6] = i[6] * s, e[7] = 0, e[8] = i[8] * a, e[9] = i[9] * a, e[10] = i[10] * a, e[11] = 0, e[12] = 0, e[13] = 0, e[14] = 0, e[15] = 1, this;
6573
6573
  }
6574
6574
  makeRotationFromEuler(t) {
6575
- const e = this.elements, i = t.x, r = t.y, s = t.z, a = Math.cos(i), o = Math.sin(i), c = Math.cos(r), l = Math.sin(r), h = Math.cos(s), u = Math.sin(s);
6575
+ const e = this.elements, i = t.x, r = t.y, s = t.z, a = Math.cos(i), o = Math.sin(i), c = Math.cos(r), l = Math.sin(r), u = Math.cos(s), h = Math.sin(s);
6576
6576
  if (t.order === "XYZ") {
6577
- const f = a * h, d = a * u, y = o * h, _ = o * u;
6578
- e[0] = c * h, e[4] = -c * u, e[8] = l, e[1] = d + y * l, e[5] = f - _ * l, e[9] = -o * c, e[2] = _ - f * l, e[6] = y + d * l, e[10] = a * c;
6577
+ const f = a * u, d = a * h, y = o * u, _ = o * h;
6578
+ e[0] = c * u, e[4] = -c * h, e[8] = l, e[1] = d + y * l, e[5] = f - _ * l, e[9] = -o * c, e[2] = _ - f * l, e[6] = y + d * l, e[10] = a * c;
6579
6579
  } else if (t.order === "YXZ") {
6580
- const f = c * h, d = c * u, y = l * h, _ = l * u;
6581
- e[0] = f + _ * o, e[4] = y * o - d, e[8] = a * l, e[1] = a * u, e[5] = a * h, e[9] = -o, e[2] = d * o - y, e[6] = _ + f * o, e[10] = a * c;
6580
+ const f = c * u, d = c * h, y = l * u, _ = l * h;
6581
+ e[0] = f + _ * o, e[4] = y * o - d, e[8] = a * l, e[1] = a * h, e[5] = a * u, e[9] = -o, e[2] = d * o - y, e[6] = _ + f * o, e[10] = a * c;
6582
6582
  } else if (t.order === "ZXY") {
6583
- const f = c * h, d = c * u, y = l * h, _ = l * u;
6584
- e[0] = f - _ * o, e[4] = -a * u, e[8] = y + d * o, e[1] = d + y * o, e[5] = a * h, e[9] = _ - f * o, e[2] = -a * l, e[6] = o, e[10] = a * c;
6583
+ const f = c * u, d = c * h, y = l * u, _ = l * h;
6584
+ e[0] = f - _ * o, e[4] = -a * h, e[8] = y + d * o, e[1] = d + y * o, e[5] = a * u, e[9] = _ - f * o, e[2] = -a * l, e[6] = o, e[10] = a * c;
6585
6585
  } else if (t.order === "ZYX") {
6586
- const f = a * h, d = a * u, y = o * h, _ = o * u;
6587
- e[0] = c * h, e[4] = y * l - d, e[8] = f * l + _, e[1] = c * u, e[5] = _ * l + f, e[9] = d * l - y, e[2] = -l, e[6] = o * c, e[10] = a * c;
6586
+ const f = a * u, d = a * h, y = o * u, _ = o * h;
6587
+ e[0] = c * u, e[4] = y * l - d, e[8] = f * l + _, e[1] = c * h, e[5] = _ * l + f, e[9] = d * l - y, e[2] = -l, e[6] = o * c, e[10] = a * c;
6588
6588
  } else if (t.order === "YZX") {
6589
6589
  const f = a * c, d = a * l, y = o * c, _ = o * l;
6590
- e[0] = c * h, e[4] = _ - f * u, e[8] = y * u + d, e[1] = u, e[5] = a * h, e[9] = -o * h, e[2] = -l * h, e[6] = d * u + y, e[10] = f - _ * u;
6590
+ e[0] = c * u, e[4] = _ - f * h, e[8] = y * h + d, e[1] = h, e[5] = a * u, e[9] = -o * u, e[2] = -l * u, e[6] = d * h + y, e[10] = f - _ * h;
6591
6591
  } else if (t.order === "XZY") {
6592
6592
  const f = a * c, d = a * l, y = o * c, _ = o * l;
6593
- e[0] = c * h, e[4] = -u, e[8] = l * h, e[1] = f * u + _, e[5] = a * h, e[9] = d * u - y, e[2] = y * u - d, e[6] = o * h, e[10] = _ * u + f;
6593
+ e[0] = c * u, e[4] = -h, e[8] = l * u, e[1] = f * h + _, e[5] = a * u, e[9] = d * h - y, e[2] = y * h - d, e[6] = o * u, e[10] = _ * h + f;
6594
6594
  }
6595
6595
  return e[3] = 0, e[7] = 0, e[11] = 0, e[12] = 0, e[13] = 0, e[14] = 0, e[15] = 1, this;
6596
6596
  }
@@ -6608,16 +6608,16 @@ class Qt {
6608
6608
  return this.multiplyMatrices(t, this);
6609
6609
  }
6610
6610
  multiplyMatrices(t, e) {
6611
- const i = t.elements, r = e.elements, s = this.elements, a = i[0], o = i[4], c = i[8], l = i[12], h = i[1], u = i[5], f = i[9], d = i[13], y = i[2], _ = i[6], p = i[10], m = i[14], v = i[3], g = i[7], b = i[11], x = i[15], S = r[0], T = r[4], P = r[8], M = r[12], C = r[1], E = r[5], w = r[9], k = r[13], R = r[2], z = r[6], U = r[10], L = r[14], I = r[3], H = r[7], K = r[11], rt = r[15];
6612
- return s[0] = a * S + o * C + c * R + l * I, s[4] = a * T + o * E + c * z + l * H, s[8] = a * P + o * w + c * U + l * K, s[12] = a * M + o * k + c * L + l * rt, s[1] = h * S + u * C + f * R + d * I, s[5] = h * T + u * E + f * z + d * H, s[9] = h * P + u * w + f * U + d * K, s[13] = h * M + u * k + f * L + d * rt, s[2] = y * S + _ * C + p * R + m * I, s[6] = y * T + _ * E + p * z + m * H, s[10] = y * P + _ * w + p * U + m * K, s[14] = y * M + _ * k + p * L + m * rt, s[3] = v * S + g * C + b * R + x * I, s[7] = v * T + g * E + b * z + x * H, s[11] = v * P + g * w + b * U + x * K, s[15] = v * M + g * k + b * L + x * rt, this;
6611
+ const i = t.elements, r = e.elements, s = this.elements, a = i[0], o = i[4], c = i[8], l = i[12], u = i[1], h = i[5], f = i[9], d = i[13], y = i[2], _ = i[6], p = i[10], m = i[14], v = i[3], g = i[7], b = i[11], x = i[15], S = r[0], T = r[4], P = r[8], M = r[12], C = r[1], E = r[5], w = r[9], k = r[13], R = r[2], z = r[6], U = r[10], L = r[14], I = r[3], H = r[7], K = r[11], rt = r[15];
6612
+ return s[0] = a * S + o * C + c * R + l * I, s[4] = a * T + o * E + c * z + l * H, s[8] = a * P + o * w + c * U + l * K, s[12] = a * M + o * k + c * L + l * rt, s[1] = u * S + h * C + f * R + d * I, s[5] = u * T + h * E + f * z + d * H, s[9] = u * P + h * w + f * U + d * K, s[13] = u * M + h * k + f * L + d * rt, s[2] = y * S + _ * C + p * R + m * I, s[6] = y * T + _ * E + p * z + m * H, s[10] = y * P + _ * w + p * U + m * K, s[14] = y * M + _ * k + p * L + m * rt, s[3] = v * S + g * C + b * R + x * I, s[7] = v * T + g * E + b * z + x * H, s[11] = v * P + g * w + b * U + x * K, s[15] = v * M + g * k + b * L + x * rt, this;
6613
6613
  }
6614
6614
  multiplyScalar(t) {
6615
6615
  const e = this.elements;
6616
6616
  return e[0] *= t, e[4] *= t, e[8] *= t, e[12] *= t, e[1] *= t, e[5] *= t, e[9] *= t, e[13] *= t, e[2] *= t, e[6] *= t, e[10] *= t, e[14] *= t, e[3] *= t, e[7] *= t, e[11] *= t, e[15] *= t, this;
6617
6617
  }
6618
6618
  determinant() {
6619
- const t = this.elements, e = t[0], i = t[4], r = t[8], s = t[12], a = t[1], o = t[5], c = t[9], l = t[13], h = t[2], u = t[6], f = t[10], d = t[14], y = t[3], _ = t[7], p = t[11], m = t[15];
6620
- return y * (+s * c * u - r * l * u - s * o * f + i * l * f + r * o * d - i * c * d) + _ * (+e * c * d - e * l * f + s * a * f - r * a * d + r * l * h - s * c * h) + p * (+e * l * u - e * o * d - s * a * u + i * a * d + s * o * h - i * l * h) + m * (-r * o * h - e * c * u + e * o * f + r * a * u - i * a * f + i * c * h);
6619
+ const t = this.elements, e = t[0], i = t[4], r = t[8], s = t[12], a = t[1], o = t[5], c = t[9], l = t[13], u = t[2], h = t[6], f = t[10], d = t[14], y = t[3], _ = t[7], p = t[11], m = t[15];
6620
+ return y * (+s * c * h - r * l * h - s * o * f + i * l * f + r * o * d - i * c * d) + _ * (+e * c * d - e * l * f + s * a * f - r * a * d + r * l * u - s * c * u) + p * (+e * l * h - e * o * d - s * a * h + i * a * d + s * o * u - i * l * u) + m * (-r * o * u - e * c * h + e * o * f + r * a * h - i * a * f + i * c * u);
6621
6621
  }
6622
6622
  transpose() {
6623
6623
  const t = this.elements;
@@ -6629,11 +6629,11 @@ class Qt {
6629
6629
  return t.isVector3 ? (r[12] = t.x, r[13] = t.y, r[14] = t.z) : (r[12] = t, r[13] = e, r[14] = i), this;
6630
6630
  }
6631
6631
  invert() {
6632
- const t = this.elements, e = t[0], i = t[1], r = t[2], s = t[3], a = t[4], o = t[5], c = t[6], l = t[7], h = t[8], u = t[9], f = t[10], d = t[11], y = t[12], _ = t[13], p = t[14], m = t[15], v = u * p * l - _ * f * l + _ * c * d - o * p * d - u * c * m + o * f * m, g = y * f * l - h * p * l - y * c * d + a * p * d + h * c * m - a * f * m, b = h * _ * l - y * u * l + y * o * d - a * _ * d - h * o * m + a * u * m, x = y * u * c - h * _ * c - y * o * f + a * _ * f + h * o * p - a * u * p, S = e * v + i * g + r * b + s * x;
6632
+ const t = this.elements, e = t[0], i = t[1], r = t[2], s = t[3], a = t[4], o = t[5], c = t[6], l = t[7], u = t[8], h = t[9], f = t[10], d = t[11], y = t[12], _ = t[13], p = t[14], m = t[15], v = h * p * l - _ * f * l + _ * c * d - o * p * d - h * c * m + o * f * m, g = y * f * l - u * p * l - y * c * d + a * p * d + u * c * m - a * f * m, b = u * _ * l - y * h * l + y * o * d - a * _ * d - u * o * m + a * h * m, x = y * h * c - u * _ * c - y * o * f + a * _ * f + u * o * p - a * h * p, S = e * v + i * g + r * b + s * x;
6633
6633
  if (S === 0)
6634
6634
  return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
6635
6635
  const T = 1 / S;
6636
- return t[0] = v * T, t[1] = (_ * f * s - u * p * s - _ * r * d + i * p * d + u * r * m - i * f * m) * T, t[2] = (o * p * s - _ * c * s + _ * r * l - i * p * l - o * r * m + i * c * m) * T, t[3] = (u * c * s - o * f * s - u * r * l + i * f * l + o * r * d - i * c * d) * T, t[4] = g * T, t[5] = (h * p * s - y * f * s + y * r * d - e * p * d - h * r * m + e * f * m) * T, t[6] = (y * c * s - a * p * s - y * r * l + e * p * l + a * r * m - e * c * m) * T, t[7] = (a * f * s - h * c * s + h * r * l - e * f * l - a * r * d + e * c * d) * T, t[8] = b * T, t[9] = (y * u * s - h * _ * s - y * i * d + e * _ * d + h * i * m - e * u * m) * T, t[10] = (a * _ * s - y * o * s + y * i * l - e * _ * l - a * i * m + e * o * m) * T, t[11] = (h * o * s - a * u * s - h * i * l + e * u * l + a * i * d - e * o * d) * T, t[12] = x * T, t[13] = (h * _ * r - y * u * r + y * i * f - e * _ * f - h * i * p + e * u * p) * T, t[14] = (y * o * r - a * _ * r - y * i * c + e * _ * c + a * i * p - e * o * p) * T, t[15] = (a * u * r - h * o * r + h * i * c - e * u * c - a * i * f + e * o * f) * T, this;
6636
+ return t[0] = v * T, t[1] = (_ * f * s - h * p * s - _ * r * d + i * p * d + h * r * m - i * f * m) * T, t[2] = (o * p * s - _ * c * s + _ * r * l - i * p * l - o * r * m + i * c * m) * T, t[3] = (h * c * s - o * f * s - h * r * l + i * f * l + o * r * d - i * c * d) * T, t[4] = g * T, t[5] = (u * p * s - y * f * s + y * r * d - e * p * d - u * r * m + e * f * m) * T, t[6] = (y * c * s - a * p * s - y * r * l + e * p * l + a * r * m - e * c * m) * T, t[7] = (a * f * s - u * c * s + u * r * l - e * f * l - a * r * d + e * c * d) * T, t[8] = b * T, t[9] = (y * h * s - u * _ * s - y * i * d + e * _ * d + u * i * m - e * h * m) * T, t[10] = (a * _ * s - y * o * s + y * i * l - e * _ * l - a * i * m + e * o * m) * T, t[11] = (u * o * s - a * h * s - u * i * l + e * h * l + a * i * d - e * o * d) * T, t[12] = x * T, t[13] = (u * _ * r - y * h * r + y * i * f - e * _ * f - u * i * p + e * h * p) * T, t[14] = (y * o * r - a * _ * r - y * i * c + e * _ * c + a * i * p - e * o * p) * T, t[15] = (a * h * r - u * o * r + u * i * c - e * h * c - a * i * f + e * o * f) * T, this;
6637
6637
  }
6638
6638
  scale(t) {
6639
6639
  const e = this.elements, i = t.x, r = t.y, s = t.z;
@@ -6659,8 +6659,8 @@ class Qt {
6659
6659
  return this.set(e, -i, 0, 0, i, e, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this;
6660
6660
  }
6661
6661
  makeRotationAxis(t, e) {
6662
- const i = Math.cos(e), r = Math.sin(e), s = 1 - i, a = t.x, o = t.y, c = t.z, l = s * a, h = s * o;
6663
- return this.set(l * a + i, l * o - r * c, l * c + r * o, 0, l * o + r * c, h * o + i, h * c - r * a, 0, l * c - r * o, h * c + r * a, s * c * c + i, 0, 0, 0, 0, 1), this;
6662
+ const i = Math.cos(e), r = Math.sin(e), s = 1 - i, a = t.x, o = t.y, c = t.z, l = s * a, u = s * o;
6663
+ return this.set(l * a + i, l * o - r * c, l * c + r * o, 0, l * o + r * c, u * o + i, u * c - r * a, 0, l * c - r * o, u * c + r * a, s * c * c + i, 0, 0, 0, 0, 1), this;
6664
6664
  }
6665
6665
  makeScale(t, e, i) {
6666
6666
  return this.set(t, 0, 0, 0, 0, e, 0, 0, 0, 0, i, 0, 0, 0, 0, 1), this;
@@ -6669,7 +6669,7 @@ class Qt {
6669
6669
  return this.set(1, i, s, 0, t, 1, a, 0, e, r, 1, 0, 0, 0, 0, 1), this;
6670
6670
  }
6671
6671
  compose(t, e, i) {
6672
- const r = this.elements, s = e._x, a = e._y, o = e._z, c = e._w, l = s + s, h = a + a, u = o + o, f = s * l, d = s * h, y = s * u, _ = a * h, p = a * u, m = o * u, v = c * l, g = c * h, b = c * u, x = i.x, S = i.y, T = i.z;
6672
+ const r = this.elements, s = e._x, a = e._y, o = e._z, c = e._w, l = s + s, u = a + a, h = o + o, f = s * l, d = s * u, y = s * h, _ = a * u, p = a * h, m = o * h, v = c * l, g = c * u, b = c * h, x = i.x, S = i.y, T = i.z;
6673
6673
  return r[0] = (1 - (_ + m)) * x, r[1] = (d + b) * x, r[2] = (y - g) * x, r[3] = 0, r[4] = (d - b) * S, r[5] = (1 - (f + m)) * S, r[6] = (p + v) * S, r[7] = 0, r[8] = (y + g) * T, r[9] = (p - v) * T, r[10] = (1 - (f + _)) * T, r[11] = 0, r[12] = t.x, r[13] = t.y, r[14] = t.z, r[15] = 1, this;
6674
6674
  }
6675
6675
  decompose(t, e, i) {
@@ -6677,11 +6677,11 @@ class Qt {
6677
6677
  let s = Je.set(r[0], r[1], r[2]).length();
6678
6678
  const a = Je.set(r[4], r[5], r[6]).length(), o = Je.set(r[8], r[9], r[10]).length();
6679
6679
  this.determinant() < 0 && (s = -s), t.x = r[12], t.y = r[13], t.z = r[14], Dt.copy(this);
6680
- const l = 1 / s, h = 1 / a, u = 1 / o;
6681
- return Dt.elements[0] *= l, Dt.elements[1] *= l, Dt.elements[2] *= l, Dt.elements[4] *= h, Dt.elements[5] *= h, Dt.elements[6] *= h, Dt.elements[8] *= u, Dt.elements[9] *= u, Dt.elements[10] *= u, e.setFromRotationMatrix(Dt), i.x = s, i.y = a, i.z = o, this;
6680
+ const l = 1 / s, u = 1 / a, h = 1 / o;
6681
+ return Dt.elements[0] *= l, Dt.elements[1] *= l, Dt.elements[2] *= l, Dt.elements[4] *= u, Dt.elements[5] *= u, Dt.elements[6] *= u, Dt.elements[8] *= h, Dt.elements[9] *= h, Dt.elements[10] *= h, e.setFromRotationMatrix(Dt), i.x = s, i.y = a, i.z = o, this;
6682
6682
  }
6683
6683
  makePerspective(t, e, i, r, s, a, o = pr) {
6684
- const c = this.elements, l = 2 * s / (e - t), h = 2 * s / (i - r), u = (e + t) / (e - t), f = (i + r) / (i - r);
6684
+ const c = this.elements, l = 2 * s / (e - t), u = 2 * s / (i - r), h = (e + t) / (e - t), f = (i + r) / (i - r);
6685
6685
  let d, y;
6686
6686
  if (o === pr)
6687
6687
  d = -(a + s) / (a - s), y = -2 * a * s / (a - s);
@@ -6689,18 +6689,18 @@ class Qt {
6689
6689
  d = -a / (a - s), y = -a * s / (a - s);
6690
6690
  else
6691
6691
  throw new Error("Matrix4.makePerspective(): Invalid coordinate system: " + o);
6692
- return c[0] = l, c[4] = 0, c[8] = u, c[12] = 0, c[1] = 0, c[5] = h, c[9] = f, c[13] = 0, c[2] = 0, c[6] = 0, c[10] = d, c[14] = y, c[3] = 0, c[7] = 0, c[11] = -1, c[15] = 0, this;
6692
+ return c[0] = l, c[4] = 0, c[8] = h, c[12] = 0, c[1] = 0, c[5] = u, c[9] = f, c[13] = 0, c[2] = 0, c[6] = 0, c[10] = d, c[14] = y, c[3] = 0, c[7] = 0, c[11] = -1, c[15] = 0, this;
6693
6693
  }
6694
6694
  makeOrthographic(t, e, i, r, s, a, o = pr) {
6695
- const c = this.elements, l = 1 / (e - t), h = 1 / (i - r), u = 1 / (a - s), f = (e + t) * l, d = (i + r) * h;
6695
+ const c = this.elements, l = 1 / (e - t), u = 1 / (i - r), h = 1 / (a - s), f = (e + t) * l, d = (i + r) * u;
6696
6696
  let y, _;
6697
6697
  if (o === pr)
6698
- y = (a + s) * u, _ = -2 * u;
6698
+ y = (a + s) * h, _ = -2 * h;
6699
6699
  else if (o === oo)
6700
- y = s * u, _ = -1 * u;
6700
+ y = s * h, _ = -1 * h;
6701
6701
  else
6702
6702
  throw new Error("../math.Matrix4.makeOrthographic(): Invalid coordinate system: " + o);
6703
- return c[0] = 2 * l, c[4] = 0, c[8] = 0, c[12] = -f, c[1] = 0, c[5] = 2 * h, c[9] = 0, c[13] = -d, c[2] = 0, c[6] = 0, c[10] = _, c[14] = -y, c[3] = 0, c[7] = 0, c[11] = 0, c[15] = 1, this;
6703
+ return c[0] = 2 * l, c[4] = 0, c[8] = 0, c[12] = -f, c[1] = 0, c[5] = 2 * u, c[9] = 0, c[13] = -d, c[2] = 0, c[6] = 0, c[10] = _, c[14] = -y, c[3] = 0, c[7] = 0, c[11] = 0, c[15] = 1, this;
6704
6704
  }
6705
6705
  equals(t) {
6706
6706
  const e = this.elements, i = t.elements;
@@ -6758,25 +6758,25 @@ class Ai {
6758
6758
  return this._x = t._x, this._y = t._y, this._z = t._z, this._order = t._order, this._onChangeCallback(), this;
6759
6759
  }
6760
6760
  setFromRotationMatrix(t, e = this._order, i = !0) {
6761
- const r = t.elements, s = r[0], a = r[4], o = r[8], c = r[1], l = r[5], h = r[9], u = r[2], f = r[6], d = r[10];
6761
+ const r = t.elements, s = r[0], a = r[4], o = r[8], c = r[1], l = r[5], u = r[9], h = r[2], f = r[6], d = r[10];
6762
6762
  switch (e) {
6763
6763
  case "XYZ":
6764
- this._y = Math.asin(Yt(o, -1, 1)), Math.abs(o) < 0.9999999 ? (this._x = Math.atan2(-h, d), this._z = Math.atan2(-a, s)) : (this._x = Math.atan2(f, l), this._z = 0);
6764
+ this._y = Math.asin(Yt(o, -1, 1)), Math.abs(o) < 0.9999999 ? (this._x = Math.atan2(-u, d), this._z = Math.atan2(-a, s)) : (this._x = Math.atan2(f, l), this._z = 0);
6765
6765
  break;
6766
6766
  case "YXZ":
6767
- this._x = Math.asin(-Yt(h, -1, 1)), Math.abs(h) < 0.9999999 ? (this._y = Math.atan2(o, d), this._z = Math.atan2(c, l)) : (this._y = Math.atan2(-u, s), this._z = 0);
6767
+ this._x = Math.asin(-Yt(u, -1, 1)), Math.abs(u) < 0.9999999 ? (this._y = Math.atan2(o, d), this._z = Math.atan2(c, l)) : (this._y = Math.atan2(-h, s), this._z = 0);
6768
6768
  break;
6769
6769
  case "ZXY":
6770
- this._x = Math.asin(Yt(f, -1, 1)), Math.abs(f) < 0.9999999 ? (this._y = Math.atan2(-u, d), this._z = Math.atan2(-a, l)) : (this._y = 0, this._z = Math.atan2(c, s));
6770
+ this._x = Math.asin(Yt(f, -1, 1)), Math.abs(f) < 0.9999999 ? (this._y = Math.atan2(-h, d), this._z = Math.atan2(-a, l)) : (this._y = 0, this._z = Math.atan2(c, s));
6771
6771
  break;
6772
6772
  case "ZYX":
6773
- this._y = Math.asin(-Yt(u, -1, 1)), Math.abs(u) < 0.9999999 ? (this._x = Math.atan2(f, d), this._z = Math.atan2(c, s)) : (this._x = 0, this._z = Math.atan2(-a, l));
6773
+ this._y = Math.asin(-Yt(h, -1, 1)), Math.abs(h) < 0.9999999 ? (this._x = Math.atan2(f, d), this._z = Math.atan2(c, s)) : (this._x = 0, this._z = Math.atan2(-a, l));
6774
6774
  break;
6775
6775
  case "YZX":
6776
- this._z = Math.asin(Yt(c, -1, 1)), Math.abs(c) < 0.9999999 ? (this._x = Math.atan2(-h, l), this._y = Math.atan2(-u, s)) : (this._x = 0, this._y = Math.atan2(o, d));
6776
+ this._z = Math.asin(Yt(c, -1, 1)), Math.abs(c) < 0.9999999 ? (this._x = Math.atan2(-u, l), this._y = Math.atan2(-h, s)) : (this._x = 0, this._y = Math.atan2(o, d));
6777
6777
  break;
6778
6778
  case "XZY":
6779
- this._z = Math.asin(-Yt(a, -1, 1)), Math.abs(a) < 0.9999999 ? (this._x = Math.atan2(f, l), this._y = Math.atan2(o, s)) : (this._x = Math.atan2(-h, d), this._y = 0);
6779
+ this._z = Math.asin(-Yt(a, -1, 1)), Math.abs(a) < 0.9999999 ? (this._x = Math.atan2(f, l), this._y = Math.atan2(o, s)) : (this._x = Math.atan2(-u, d), this._y = 0);
6780
6780
  break;
6781
6781
  default:
6782
6782
  console.warn("../math.Euler: .setFromRotationMatrix() encountered an unknown order: " + e);
@@ -7118,16 +7118,16 @@ class wt {
7118
7118
  }
7119
7119
  setAxisAngleFromRotationMatrix(t) {
7120
7120
  let e, i, r, s;
7121
- const c = t.elements, l = c[0], h = c[4], u = c[8], f = c[1], d = c[5], y = c[9], _ = c[2], p = c[6], m = c[10];
7122
- if (Math.abs(h - f) < 0.01 && Math.abs(u - _) < 0.01 && Math.abs(y - p) < 0.01) {
7123
- if (Math.abs(h + f) < 0.1 && Math.abs(u + _) < 0.1 && Math.abs(y + p) < 0.1 && Math.abs(l + d + m - 3) < 0.1)
7121
+ const c = t.elements, l = c[0], u = c[4], h = c[8], f = c[1], d = c[5], y = c[9], _ = c[2], p = c[6], m = c[10];
7122
+ if (Math.abs(u - f) < 0.01 && Math.abs(h - _) < 0.01 && Math.abs(y - p) < 0.01) {
7123
+ if (Math.abs(u + f) < 0.1 && Math.abs(h + _) < 0.1 && Math.abs(y + p) < 0.1 && Math.abs(l + d + m - 3) < 0.1)
7124
7124
  return this.set(1, 0, 0, 0), this;
7125
7125
  e = Math.PI;
7126
- const g = (l + 1) / 2, b = (d + 1) / 2, x = (m + 1) / 2, S = (h + f) / 4, T = (u + _) / 4, P = (y + p) / 4;
7126
+ const g = (l + 1) / 2, b = (d + 1) / 2, x = (m + 1) / 2, S = (u + f) / 4, T = (h + _) / 4, P = (y + p) / 4;
7127
7127
  return g > b && g > x ? g < 0.01 ? (i = 0, r = 0.707106781, s = 0.707106781) : (i = Math.sqrt(g), r = S / i, s = T / i) : b > x ? b < 0.01 ? (i = 0.707106781, r = 0, s = 0.707106781) : (r = Math.sqrt(b), i = S / r, s = P / r) : x < 0.01 ? (i = 0.707106781, r = 0.707106781, s = 0) : (s = Math.sqrt(x), i = T / s, r = P / s), this.set(i, r, s, e), this;
7128
7128
  }
7129
- let v = Math.sqrt((p - y) * (p - y) + (u - _) * (u - _) + (f - h) * (f - h));
7130
- return Math.abs(v) < 1e-3 && (v = 1), this.x = (p - y) / v, this.y = (u - _) / v, this.z = (f - h) / v, this.w = Math.acos((l + d + m - 1) / 2), this;
7129
+ let v = Math.sqrt((p - y) * (p - y) + (h - _) * (h - _) + (f - u) * (f - u));
7130
+ return Math.abs(v) < 1e-3 && (v = 1), this.x = (p - y) / v, this.y = (h - _) / v, this.z = (f - u) / v, this.w = Math.acos((l + d + m - 1) / 2), this;
7131
7131
  }
7132
7132
  min(t) {
7133
7133
  return this.x = Math.min(this.x, t.x), this.y = Math.min(this.y, t.y), this.z = Math.min(this.z, t.z), this.w = Math.min(this.w, t.w), this;
@@ -7205,8 +7205,8 @@ class Kt {
7205
7205
  Kt.prototype.isMatrix3 = !0, this.elements = [1, 0, 0, 0, 1, 0, 0, 0, 1], t !== void 0 && this.set(t, e, i, r, s, a, o, c, l);
7206
7206
  }
7207
7207
  set(t, e, i, r, s, a, o, c, l) {
7208
- const h = this.elements;
7209
- return h[0] = t, h[1] = r, h[2] = o, h[3] = e, h[4] = s, h[5] = c, h[6] = i, h[7] = a, h[8] = l, this;
7208
+ const u = this.elements;
7209
+ return u[0] = t, u[1] = r, u[2] = o, u[3] = e, u[4] = s, u[5] = c, u[6] = i, u[7] = a, u[8] = l, this;
7210
7210
  }
7211
7211
  identity() {
7212
7212
  return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1), this;
@@ -7229,23 +7229,23 @@ class Kt {
7229
7229
  return this.multiplyMatrices(t, this);
7230
7230
  }
7231
7231
  multiplyMatrices(t, e) {
7232
- const i = t.elements, r = e.elements, s = this.elements, a = i[0], o = i[3], c = i[6], l = i[1], h = i[4], u = i[7], f = i[2], d = i[5], y = i[8], _ = r[0], p = r[3], m = r[6], v = r[1], g = r[4], b = r[7], x = r[2], S = r[5], T = r[8];
7233
- return s[0] = a * _ + o * v + c * x, s[3] = a * p + o * g + c * S, s[6] = a * m + o * b + c * T, s[1] = l * _ + h * v + u * x, s[4] = l * p + h * g + u * S, s[7] = l * m + h * b + u * T, s[2] = f * _ + d * v + y * x, s[5] = f * p + d * g + y * S, s[8] = f * m + d * b + y * T, this;
7232
+ const i = t.elements, r = e.elements, s = this.elements, a = i[0], o = i[3], c = i[6], l = i[1], u = i[4], h = i[7], f = i[2], d = i[5], y = i[8], _ = r[0], p = r[3], m = r[6], v = r[1], g = r[4], b = r[7], x = r[2], S = r[5], T = r[8];
7233
+ return s[0] = a * _ + o * v + c * x, s[3] = a * p + o * g + c * S, s[6] = a * m + o * b + c * T, s[1] = l * _ + u * v + h * x, s[4] = l * p + u * g + h * S, s[7] = l * m + u * b + h * T, s[2] = f * _ + d * v + y * x, s[5] = f * p + d * g + y * S, s[8] = f * m + d * b + y * T, this;
7234
7234
  }
7235
7235
  multiplyScalar(t) {
7236
7236
  const e = this.elements;
7237
7237
  return e[0] *= t, e[3] *= t, e[6] *= t, e[1] *= t, e[4] *= t, e[7] *= t, e[2] *= t, e[5] *= t, e[8] *= t, this;
7238
7238
  }
7239
7239
  determinant() {
7240
- const t = this.elements, e = t[0], i = t[1], r = t[2], s = t[3], a = t[4], o = t[5], c = t[6], l = t[7], h = t[8];
7241
- return e * a * h - e * o * l - i * s * h + i * o * c + r * s * l - r * a * c;
7240
+ const t = this.elements, e = t[0], i = t[1], r = t[2], s = t[3], a = t[4], o = t[5], c = t[6], l = t[7], u = t[8];
7241
+ return e * a * u - e * o * l - i * s * u + i * o * c + r * s * l - r * a * c;
7242
7242
  }
7243
7243
  invert() {
7244
- const t = this.elements, e = t[0], i = t[1], r = t[2], s = t[3], a = t[4], o = t[5], c = t[6], l = t[7], h = t[8], u = h * a - o * l, f = o * c - h * s, d = l * s - a * c, y = e * u + i * f + r * d;
7244
+ const t = this.elements, e = t[0], i = t[1], r = t[2], s = t[3], a = t[4], o = t[5], c = t[6], l = t[7], u = t[8], h = u * a - o * l, f = o * c - u * s, d = l * s - a * c, y = e * h + i * f + r * d;
7245
7245
  if (y === 0)
7246
7246
  return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0);
7247
7247
  const _ = 1 / y;
7248
- return t[0] = u * _, t[1] = (r * l - h * i) * _, t[2] = (o * i - r * a) * _, t[3] = f * _, t[4] = (h * e - r * c) * _, t[5] = (r * s - o * e) * _, t[6] = d * _, t[7] = (i * c - l * e) * _, t[8] = (a * e - i * s) * _, this;
7248
+ return t[0] = h * _, t[1] = (r * l - u * i) * _, t[2] = (o * i - r * a) * _, t[3] = f * _, t[4] = (u * e - r * c) * _, t[5] = (r * s - o * e) * _, t[6] = d * _, t[7] = (i * c - l * e) * _, t[8] = (a * e - i * s) * _, this;
7249
7249
  }
7250
7250
  transpose() {
7251
7251
  let t;
@@ -7307,7 +7307,7 @@ var vt;
7307
7307
  (function(n) {
7308
7308
  n[n.Random = 0] = "Random", n[n.Loop = 1] = "Loop", n[n.PingPong = 2] = "PingPong", n[n.Burst = 3] = "Burst";
7309
7309
  })(vt || (vt = {}));
7310
- function hr(n, t, e, i) {
7310
+ function ur(n, t, e, i) {
7311
7311
  let r;
7312
7312
  switch (vt.Random === n ? t = Math.random() : vt.Burst === n && i.isBursting && (t = i.burstParticleIndex / i.burstParticleCount), e > 0 ? r = Math.floor(t / e) * e : r = t, n) {
7313
7313
  case vt.Loop:
@@ -7886,7 +7886,7 @@ class Ui {
7886
7886
  vt.Random != this.mode && (this.currentValue += this.speed.genValue(this.memory, t.emissionState.time / t.duration) * e);
7887
7887
  }
7888
7888
  initialize(t, e) {
7889
- const i = hr(this.mode, this.currentValue, this.spread, e), r = ni.lerp(1 - this.thickness, 1, Math.random()), s = i * this.arc, a = Math.sqrt(r), o = Math.sin(s), c = Math.cos(s);
7889
+ const i = ur(this.mode, this.currentValue, this.spread, e), r = ni.lerp(1 - this.thickness, 1, Math.random()), s = i * this.arc, a = Math.sqrt(r), o = Math.sin(s), c = Math.cos(s);
7890
7890
  t.position.x = a * c, t.position.y = a * o, t.position.z = 0;
7891
7891
  const l = this.angle * a;
7892
7892
  t.velocity.set(0, 0, Math.cos(l)).addScaledVector(t.position, Math.sin(l)).multiplyScalar(t.startSpeed), t.position.multiplyScalar(this.radius);
@@ -7935,7 +7935,7 @@ class Fi {
7935
7935
  this.currentValue += this.speed.genValue(this.memory, t.emissionState.time / t.duration) * e;
7936
7936
  }
7937
7937
  initialize(t, e) {
7938
- const i = hr(this.mode, this.currentValue, this.spread, e), r = ni.lerp(1 - this.thickness, 1, Math.random()), s = i * this.arc;
7938
+ const i = ur(this.mode, this.currentValue, this.spread, e), r = ni.lerp(1 - this.thickness, 1, Math.random()), s = i * this.arc;
7939
7939
  t.position.x = Math.cos(s), t.position.y = Math.sin(s), t.position.z = 0, t.velocity.copy(t.position).multiplyScalar(t.startSpeed), t.position.multiplyScalar(this.radius * r);
7940
7940
  }
7941
7941
  toJSON() {
@@ -7983,7 +7983,7 @@ class Di {
7983
7983
  vt.Random != this.mode && (this.currentValue += this.speed.genValue(this.memory, t.emissionState.time / t.duration) * e);
7984
7984
  }
7985
7985
  initialize(t, e) {
7986
- const i = hr(this.mode, this.currentValue, this.spread, e), r = Math.random(), s = ni.lerp(1 - this.thickness, 1, Math.random()), a = i * this.arc, o = r * Math.PI * 2, c = Math.sin(a), l = Math.cos(a);
7986
+ const i = ur(this.mode, this.currentValue, this.spread, e), r = Math.random(), s = ni.lerp(1 - this.thickness, 1, Math.random()), a = i * this.arc, o = r * Math.PI * 2, c = Math.sin(a), l = Math.cos(a);
7987
7987
  t.position.x = this.radius * l, t.position.y = this.radius * c, t.position.z = 0, t.velocity.z = this.donutRadius * s * Math.sin(o), t.velocity.x = this.donutRadius * s * Math.cos(o) * l, t.velocity.y = this.donutRadius * s * Math.cos(o) * c, t.position.add(t.velocity), t.velocity.normalize().multiplyScalar(t.startSpeed), t.rotation instanceof G && (this._m1.lookAt(en, t.velocity, tn), t.rotation.setFromRotationMatrix(this._m1));
7988
7988
  }
7989
7989
  toJSON() {
@@ -8028,8 +8028,8 @@ class Li {
8028
8028
  update(t, e) {
8029
8029
  }
8030
8030
  initialize(t) {
8031
- const e = Math.random(), i = Math.random(), r = e * Math.PI * 2, s = Math.acos(2 * i - 1), a = Math.cbrt(Math.random()), o = Math.sin(r), c = Math.cos(r), l = Math.sin(s), h = Math.cos(s);
8032
- t.velocity.x = a * l * c, t.velocity.y = a * l * o, t.velocity.z = a * h, t.velocity.multiplyScalar(t.startSpeed), t.position.setScalar(0), t.rotation instanceof G && (this._m1.lookAt(en, t.position, tn), t.rotation.setFromRotationMatrix(this._m1));
8031
+ const e = Math.random(), i = Math.random(), r = e * Math.PI * 2, s = Math.acos(2 * i - 1), a = Math.cbrt(Math.random()), o = Math.sin(r), c = Math.cos(r), l = Math.sin(s), u = Math.cos(s);
8032
+ t.velocity.x = a * l * c, t.velocity.y = a * l * o, t.velocity.z = a * u, t.velocity.multiplyScalar(t.startSpeed), t.position.setScalar(0), t.rotation instanceof G && (this._m1.lookAt(en, t.position, tn), t.rotation.setFromRotationMatrix(this._m1));
8033
8033
  }
8034
8034
  toJSON() {
8035
8035
  return {
@@ -8052,8 +8052,8 @@ class ii {
8052
8052
  vt.Random != this.mode && (this.currentValue += this.speed.genValue(this.memory, t.emissionState.time / t.duration) * e);
8053
8053
  }
8054
8054
  initialize(t, e) {
8055
- const i = hr(this.mode, this.currentValue, this.spread, e), r = Math.random(), s = ni.lerp(1 - this.thickness, 1, Math.random()), a = i * this.arc, o = Math.acos(2 * r - 1), c = Math.sin(a), l = Math.cos(a), h = Math.sin(o), u = Math.cos(o);
8056
- t.position.x = h * l, t.position.y = h * c, t.position.z = u, t.velocity.copy(t.position).multiplyScalar(t.startSpeed), t.position.multiplyScalar(this.radius * s), t.rotation instanceof G && (this._m1.lookAt(en, t.position, tn), t.rotation.setFromRotationMatrix(this._m1));
8055
+ const i = ur(this.mode, this.currentValue, this.spread, e), r = Math.random(), s = ni.lerp(1 - this.thickness, 1, Math.random()), a = i * this.arc, o = Math.acos(2 * r - 1), c = Math.sin(a), l = Math.cos(a), u = Math.sin(o), h = Math.cos(o);
8056
+ t.position.x = u * l, t.position.y = u * c, t.position.z = h, t.velocity.copy(t.position).multiplyScalar(t.startSpeed), t.position.multiplyScalar(this.radius * s), t.rotation instanceof G && (this._m1.lookAt(en, t.position, tn), t.rotation.setFromRotationMatrix(this._m1));
8057
8057
  }
8058
8058
  toJSON() {
8059
8059
  return {
@@ -8096,8 +8096,8 @@ class Vi {
8096
8096
  vt.Random != this.mode && (this.currentValue += this.speed.genValue(this.memory, t.emissionState.time / t.duration) * e);
8097
8097
  }
8098
8098
  initialize(t, e) {
8099
- const i = hr(this.mode, this.currentValue, this.spread, e), r = Math.random(), s = ni.lerp(1 - this.thickness, 1, Math.random()), a = i * this.arc, o = Math.acos(r), c = Math.sin(a), l = Math.cos(a), h = Math.sin(o), u = Math.cos(o);
8100
- t.position.x = h * l, t.position.y = h * c, t.position.z = u, t.velocity.copy(t.position).multiplyScalar(t.startSpeed), t.position.multiplyScalar(this.radius * s), t.rotation instanceof G && (this._m1.lookAt(en, t.position, tn), t.rotation.setFromRotationMatrix(this._m1));
8099
+ const i = ur(this.mode, this.currentValue, this.spread, e), r = Math.random(), s = ni.lerp(1 - this.thickness, 1, Math.random()), a = i * this.arc, o = Math.acos(r), c = Math.sin(a), l = Math.cos(a), u = Math.sin(o), h = Math.cos(o);
8100
+ t.position.x = u * l, t.position.y = u * c, t.position.z = h, t.velocity.copy(t.position).multiplyScalar(t.startSpeed), t.position.multiplyScalar(this.radius * s), t.rotation instanceof G && (this._m1.lookAt(en, t.position, tn), t.rotation.setFromRotationMatrix(this._m1));
8101
8101
  }
8102
8102
  toJSON() {
8103
8103
  return {
@@ -8936,10 +8936,10 @@ class Aa {
8936
8936
  noise2D(t, e) {
8937
8937
  const i = this.permMod12, r = this.perm;
8938
8938
  let s = 0, a = 0, o = 0;
8939
- const c = (t + e) * Ol, l = Math.floor(t + c), h = Math.floor(e + c), u = (l + h) * fi, f = l - u, d = h - u, y = t - f, _ = e - d;
8939
+ const c = (t + e) * Ol, l = Math.floor(t + c), u = Math.floor(e + c), h = (l + u) * fi, f = l - h, d = u - h, y = t - f, _ = e - d;
8940
8940
  let p, m;
8941
8941
  y > _ ? (p = 1, m = 0) : (p = 0, m = 1);
8942
- const v = y - p + fi, g = _ - m + fi, b = y - 1 + 2 * fi, x = _ - 1 + 2 * fi, S = l & 255, T = h & 255;
8942
+ const v = y - p + fi, g = _ - m + fi, b = y - 1 + 2 * fi, x = _ - 1 + 2 * fi, S = l & 255, T = u & 255;
8943
8943
  let P = 0.5 - y * y - _ * _;
8944
8944
  if (P >= 0) {
8945
8945
  const E = i[S + r[T]] * 3;
@@ -8960,10 +8960,10 @@ class Aa {
8960
8960
  noise3D(t, e, i) {
8961
8961
  const r = this.permMod12, s = this.perm;
8962
8962
  let a, o, c, l;
8963
- const h = (t + e + i) * Bl, u = Math.floor(t + h), f = Math.floor(e + h), d = Math.floor(i + h), y = (u + f + d) * Ht, _ = u - y, p = f - y, m = d - y, v = t - _, g = e - p, b = i - m;
8963
+ const u = (t + e + i) * Bl, h = Math.floor(t + u), f = Math.floor(e + u), d = Math.floor(i + u), y = (h + f + d) * Ht, _ = h - y, p = f - y, m = d - y, v = t - _, g = e - p, b = i - m;
8964
8964
  let x, S, T, P, M, C;
8965
8965
  v >= g ? g >= b ? (x = 1, S = 0, T = 0, P = 1, M = 1, C = 0) : v >= b ? (x = 1, S = 0, T = 0, P = 1, M = 0, C = 1) : (x = 0, S = 0, T = 1, P = 1, M = 0, C = 1) : g < b ? (x = 0, S = 0, T = 1, P = 0, M = 1, C = 1) : v < b ? (x = 0, S = 1, T = 0, P = 0, M = 1, C = 1) : (x = 0, S = 1, T = 0, P = 1, M = 1, C = 0);
8966
- const E = v - x + Ht, w = g - S + Ht, k = b - T + Ht, R = v - P + 2 * Ht, z = g - M + 2 * Ht, U = b - C + 2 * Ht, L = v - 1 + 3 * Ht, I = g - 1 + 3 * Ht, H = b - 1 + 3 * Ht, K = u & 255, rt = f & 255, tt = d & 255;
8966
+ const E = v - x + Ht, w = g - S + Ht, k = b - T + Ht, R = v - P + 2 * Ht, z = g - M + 2 * Ht, U = b - C + 2 * Ht, L = v - 1 + 3 * Ht, I = g - 1 + 3 * Ht, H = b - 1 + 3 * Ht, K = h & 255, rt = f & 255, tt = d & 255;
8967
8967
  let mt = 0.6 - v * v - g * g - b * b;
8968
8968
  if (mt < 0)
8969
8969
  a = 0;
@@ -8996,17 +8996,17 @@ class Aa {
8996
8996
  }
8997
8997
  noise4D(t, e, i, r) {
8998
8998
  const s = this.perm;
8999
- let a, o, c, l, h;
9000
- const u = (t + e + i + r) * Il, f = Math.floor(t + u), d = Math.floor(e + u), y = Math.floor(i + u), _ = Math.floor(r + u), p = (f + d + y + _) * at, m = f - p, v = d - p, g = y - p, b = _ - p, x = t - m, S = e - v, T = i - g, P = r - b;
8999
+ let a, o, c, l, u;
9000
+ const h = (t + e + i + r) * Il, f = Math.floor(t + h), d = Math.floor(e + h), y = Math.floor(i + h), _ = Math.floor(r + h), p = (f + d + y + _) * at, m = f - p, v = d - p, g = y - p, b = _ - p, x = t - m, S = e - v, T = i - g, P = r - b;
9001
9001
  let M = 0, C = 0, E = 0, w = 0;
9002
9002
  x > S ? M++ : C++, x > T ? M++ : E++, x > P ? M++ : w++, S > T ? C++ : E++, S > P ? C++ : w++, T > P ? E++ : w++;
9003
9003
  const k = M >= 3 ? 1 : 0, R = C >= 3 ? 1 : 0, z = E >= 3 ? 1 : 0, U = w >= 3 ? 1 : 0, L = M >= 2 ? 1 : 0, I = C >= 2 ? 1 : 0, H = E >= 2 ? 1 : 0, K = w >= 2 ? 1 : 0, rt = M >= 1 ? 1 : 0, tt = C >= 1 ? 1 : 0, mt = E >= 1 ? 1 : 0, yt = w >= 1 ? 1 : 0, nt = x - k + at, W = S - R + at, $ = T - z + at, ie = P - U + at, jt = x - L + 2 * at, $t = S - I + 2 * at, qt = T - H + 2 * at, xt = P - K + 2 * at, Bt = x - rt + 3 * at, bt = S - tt + 3 * at, re = T - mt + 3 * at, ne = P - yt + 3 * at, Y = x - 1 + 4 * at, Xt = S - 1 + 4 * at, se = T - 1 + 4 * at, Pe = P - 1 + 4 * at, oe = f & 255, ae = d & 255, ce = y & 255, le = _ & 255;
9004
- let he = 0.6 - x * x - S * S - T * T - P * P;
9005
- if (he < 0)
9004
+ let ue = 0.6 - x * x - S * S - T * T - P * P;
9005
+ if (ue < 0)
9006
9006
  a = 0;
9007
9007
  else {
9008
9008
  const V = s[oe + s[ae + s[ce + s[le]]]] % 32 * 4;
9009
- he *= he, a = he * he * (et[V] * x + et[V + 1] * S + et[V + 2] * T + et[V + 3] * P);
9009
+ ue *= ue, a = ue * ue * (et[V] * x + et[V + 1] * S + et[V + 2] * T + et[V + 3] * P);
9010
9010
  }
9011
9011
  let It = 0.6 - nt * nt - W * W - $ * $ - ie * ie;
9012
9012
  if (It < 0)
@@ -9031,12 +9031,12 @@ class Aa {
9031
9031
  }
9032
9032
  let Ft = 0.6 - Y * Y - Xt * Xt - se * se - Pe * Pe;
9033
9033
  if (Ft < 0)
9034
- h = 0;
9034
+ u = 0;
9035
9035
  else {
9036
9036
  const V = s[oe + 1 + s[ae + 1 + s[ce + 1 + s[le + 1]]]] % 32 * 4;
9037
- Ft *= Ft, h = Ft * Ft * (et[V] * Y + et[V + 1] * Xt + et[V + 2] * se + et[V + 3] * Pe);
9037
+ Ft *= Ft, u = Ft * Ft * (et[V] * Y + et[V + 1] * Xt + et[V + 2] * se + et[V + 3] * Pe);
9038
9038
  }
9039
- return 27 * (a + o + c + l + h);
9039
+ return 27 * (a + o + c + l + u);
9040
9040
  }
9041
9041
  }
9042
9042
  function Nl(n) {
@@ -9984,7 +9984,7 @@ var A;
9984
9984
  (function(n) {
9985
9985
  n[n.BillBoard = 0] = "BillBoard", n[n.StretchedBillBoard = 1] = "StretchedBillBoard", n[n.Mesh = 2] = "Mesh", n[n.Trail = 3] = "Trail", n[n.HorizontalBillBoard = 4] = "HorizontalBillBoard", n[n.VerticalBillBoard = 5] = "VerticalBillBoard";
9986
9986
  })(A || (A = {}));
9987
- class za extends hs {
9987
+ class za extends us {
9988
9988
  constructor(t) {
9989
9989
  super(), this.type = "VFXBatch", this.maxParticles = 1e3, this.systems = /* @__PURE__ */ new Set();
9990
9990
  const e = new Ur();
@@ -10015,9 +10015,9 @@ class za extends hs {
10015
10015
  e && e.value !== t && (e.value = t, this.material.needsUpdate = !0);
10016
10016
  }
10017
10017
  }
10018
- const Kl = new B(0, 0, 1), Tn = new G(), Ql = new B(), th = new B();
10018
+ const Kl = new B(0, 0, 1), Tn = new G(), Ql = new B(), tu = new B();
10019
10019
  new B();
10020
- const ho = 60, eh = new zo(1, 1, 1, 1);
10020
+ const uo = 60, eu = new zo(1, 1, 1, 1);
10021
10021
  class Kn {
10022
10022
  set time(t) {
10023
10023
  this.emissionState.time = t;
@@ -10123,13 +10123,13 @@ class Kn {
10123
10123
  this.rendererSettings.material.blending = t, this.neededToUpdateRender = !0;
10124
10124
  }
10125
10125
  constructor(t) {
10126
- var e, i, r, s, a, o, c, l, h, u, f, d, y, _, p, m, v, g, b, x, S, T, P, M, C, E;
10127
- if (this.temp = new B(), this.travelDistance = 0, this.normalMatrix = new Kt(), this.memory = [], this.listeners = {}, this.firstTimeUpdate = !0, this.autoDestroy = t.autoDestroy === void 0 ? !1 : t.autoDestroy, this.duration = (e = t.duration) !== null && e !== void 0 ? e : 1, this.looping = t.looping === void 0 ? !0 : t.looping, this.prewarm = t.prewarm === void 0 ? !1 : t.prewarm, this.startLife = (i = t.startLife) !== null && i !== void 0 ? i : new J(5), this.startSpeed = (r = t.startSpeed) !== null && r !== void 0 ? r : new J(0), this.startRotation = (s = t.startRotation) !== null && s !== void 0 ? s : new J(0), this.startSize = (a = t.startSize) !== null && a !== void 0 ? a : new J(1), this.startColor = (o = t.startColor) !== null && o !== void 0 ? o : new ei(new wt(1, 1, 1, 1)), this.emissionOverTime = (c = t.emissionOverTime) !== null && c !== void 0 ? c : new J(10), this.emissionOverDistance = (l = t.emissionOverDistance) !== null && l !== void 0 ? l : new J(0), this.emissionBursts = (h = t.emissionBursts) !== null && h !== void 0 ? h : [], this.onlyUsedByOther = (u = t.onlyUsedByOther) !== null && u !== void 0 ? u : !1, this.emitterShape = (f = t.shape) !== null && f !== void 0 ? f : new ii(), this.behaviors = (d = t.behaviors) !== null && d !== void 0 ? d : new Array(), this.worldSpace = (y = t.worldSpace) !== null && y !== void 0 ? y : !1, this.rendererEmitterSettings = (_ = t.rendererEmitterSettings) !== null && _ !== void 0 ? _ : {}, t.renderMode === A.StretchedBillBoard) {
10126
+ var e, i, r, s, a, o, c, l, u, h, f, d, y, _, p, m, v, g, b, x, S, T, P, M, C, E;
10127
+ if (this.temp = new B(), this.travelDistance = 0, this.normalMatrix = new Kt(), this.memory = [], this.listeners = {}, this.firstTimeUpdate = !0, this.autoDestroy = t.autoDestroy === void 0 ? !1 : t.autoDestroy, this.duration = (e = t.duration) !== null && e !== void 0 ? e : 1, this.looping = t.looping === void 0 ? !0 : t.looping, this.prewarm = t.prewarm === void 0 ? !1 : t.prewarm, this.startLife = (i = t.startLife) !== null && i !== void 0 ? i : new J(5), this.startSpeed = (r = t.startSpeed) !== null && r !== void 0 ? r : new J(0), this.startRotation = (s = t.startRotation) !== null && s !== void 0 ? s : new J(0), this.startSize = (a = t.startSize) !== null && a !== void 0 ? a : new J(1), this.startColor = (o = t.startColor) !== null && o !== void 0 ? o : new ei(new wt(1, 1, 1, 1)), this.emissionOverTime = (c = t.emissionOverTime) !== null && c !== void 0 ? c : new J(10), this.emissionOverDistance = (l = t.emissionOverDistance) !== null && l !== void 0 ? l : new J(0), this.emissionBursts = (u = t.emissionBursts) !== null && u !== void 0 ? u : [], this.onlyUsedByOther = (h = t.onlyUsedByOther) !== null && h !== void 0 ? h : !1, this.emitterShape = (f = t.shape) !== null && f !== void 0 ? f : new ii(), this.behaviors = (d = t.behaviors) !== null && d !== void 0 ? d : new Array(), this.worldSpace = (y = t.worldSpace) !== null && y !== void 0 ? y : !1, this.rendererEmitterSettings = (_ = t.rendererEmitterSettings) !== null && _ !== void 0 ? _ : {}, t.renderMode === A.StretchedBillBoard) {
10128
10128
  const w = this.rendererEmitterSettings;
10129
10129
  t.speedFactor !== void 0 && (w.speedFactor = t.speedFactor), w.speedFactor = (p = w.speedFactor) !== null && p !== void 0 ? p : 0, w.lengthFactor = (m = w.lengthFactor) !== null && m !== void 0 ? m : 0;
10130
10130
  }
10131
10131
  this.rendererSettings = {
10132
- instancingGeometry: (v = t.instancingGeometry) !== null && v !== void 0 ? v : eh,
10132
+ instancingGeometry: (v = t.instancingGeometry) !== null && v !== void 0 ? v : eu,
10133
10133
  renderMode: (g = t.renderMode) !== null && g !== void 0 ? g : A.BillBoard,
10134
10134
  renderOrder: (b = t.renderOrder) !== null && b !== void 0 ? b : 0,
10135
10135
  material: t.material,
@@ -10162,7 +10162,7 @@ class Kn {
10162
10162
  }
10163
10163
  spawn(t, e, i) {
10164
10164
  Tn.setFromRotationMatrix(i);
10165
- const r = Ql, s = Tn, a = th;
10165
+ const r = Ql, s = Tn, a = tu;
10166
10166
  i.decompose(r, s, a);
10167
10167
  for (let o = 0; o < t; o++) {
10168
10168
  for (e.burstParticleIndex = o, this.particleNum++; this.particles.length < this.particleNum; )
@@ -10217,8 +10217,8 @@ class Kn {
10217
10217
  }
10218
10218
  if (this.looping && this.prewarm && !this.prewarmed) {
10219
10219
  this.prewarmed = !0;
10220
- for (let i = 0; i < this.duration * ho; i++)
10221
- this.update(1 / ho);
10220
+ for (let i = 0; i < this.duration * uo; i++)
10221
+ this.update(1 / uo);
10222
10222
  }
10223
10223
  t > 0.1 && (t = 0.1), this.neededToUpdateRender && (this._renderer && this._renderer.updateSystem(this), this.neededToUpdateRender = !1), this.onlyUsedByOther || this.emit(t, this.emissionState, this.emitter.matrixWorld), this.emitterShape.update(this, t);
10224
10224
  for (let i = 0; i < this.behaviors.length; i++) {
@@ -10329,10 +10329,10 @@ class Kn {
10329
10329
  const a = kl(t.shape, e);
10330
10330
  let o;
10331
10331
  if (t.renderMode === A.Trail) {
10332
- const h = t.rendererEmitterSettings;
10332
+ const u = t.rendererEmitterSettings;
10333
10333
  o = {
10334
- startLength: h.startLength != null ? F(h.startLength) : new J(30),
10335
- followLocalOrigin: h.followLocalOrigin
10334
+ startLength: u.startLength != null ? F(u.startLength) : new J(30),
10335
+ followLocalOrigin: u.followLocalOrigin
10336
10336
  };
10337
10337
  } else t.renderMode === A.Mesh ? o = {} : t.renderMode === A.StretchedBillBoard ? (o = t.rendererEmitterSettings, t.speedFactor != null && (o.speedFactor = t.speedFactor)) : o = {};
10338
10338
  const c = new Ur();
@@ -10350,14 +10350,14 @@ class Kn {
10350
10350
  startColor: ys(t.startColor),
10351
10351
  emissionOverTime: F(t.emissionOverTime),
10352
10352
  emissionOverDistance: F(t.emissionOverDistance),
10353
- emissionBursts: (r = t.emissionBursts) === null || r === void 0 ? void 0 : r.map((h) => {
10354
- var u, f, d;
10353
+ emissionBursts: (r = t.emissionBursts) === null || r === void 0 ? void 0 : r.map((u) => {
10354
+ var h, f, d;
10355
10355
  return {
10356
- time: h.time,
10357
- count: typeof h.count == "number" ? new J(h.count) : F(h.count),
10358
- probability: (u = h.probability) !== null && u !== void 0 ? u : 1,
10359
- interval: (f = h.interval) !== null && f !== void 0 ? f : 0.1,
10360
- cycle: (d = h.cycle) !== null && d !== void 0 ? d : 1
10356
+ time: u.time,
10357
+ count: typeof u.count == "number" ? new J(u.count) : F(u.count),
10358
+ probability: (h = u.probability) !== null && h !== void 0 ? h : 1,
10359
+ interval: (f = u.interval) !== null && f !== void 0 ? f : 0.1,
10360
+ cycle: (d = u.cycle) !== null && d !== void 0 ? d : 1
10361
10361
  };
10362
10362
  }),
10363
10363
  onlyUsedByOther: t.onlyUsedByOther,
@@ -10387,9 +10387,9 @@ class Kn {
10387
10387
  behaviors: [],
10388
10388
  worldSpace: t.worldSpace
10389
10389
  });
10390
- return l.behaviors = t.behaviors.map((h) => {
10391
- const u = Dl(h, l);
10392
- return u.type === "EmitSubParticleSystem" && (i[h.subParticleSystem] = u), u;
10390
+ return l.behaviors = t.behaviors.map((u) => {
10391
+ const h = Dl(u, l);
10392
+ return h.type === "EmitSubParticleSystem" && (i[u.subParticleSystem] = h), h;
10393
10393
  }), l;
10394
10394
  }
10395
10395
  addBehavior(t) {
@@ -10663,7 +10663,7 @@ outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoat
10663
10663
  #include <fog_fragment>
10664
10664
  #include <premultiplied_alpha_fragment>
10665
10665
  #include <dithering_fragment>
10666
- }`, ih = `
10666
+ }`, iu = `
10667
10667
  #include <common>
10668
10668
  #include <color_pars_vertex>
10669
10669
  #include <logdepthbuf_pars_vertex>
@@ -10709,7 +10709,7 @@ void main() {
10709
10709
  #include <tile_vertex>
10710
10710
  #include <soft_vertex>
10711
10711
  }
10712
- `, rh = `
10712
+ `, ru = `
10713
10713
  #include <common>
10714
10714
  #include <color_pars_vertex>
10715
10715
  #include <logdepthbuf_pars_vertex>
@@ -10831,7 +10831,7 @@ void main() {
10831
10831
  vWorldPosition = worldPosition.xyz;
10832
10832
  #endif
10833
10833
  }
10834
- `, nh = `
10834
+ `, nu = `
10835
10835
  #include <common>
10836
10836
  #include <color_pars_vertex>
10837
10837
  #include <logdepthbuf_pars_vertex>
@@ -10876,7 +10876,7 @@ void main() {
10876
10876
  function Qn(n) {
10877
10877
  return n === 0 ? "uv" : `uv${n}`;
10878
10878
  }
10879
- class sh extends $a {
10879
+ class su extends $a {
10880
10880
  constructor(t) {
10881
10881
  super(t);
10882
10882
  }
@@ -10884,7 +10884,7 @@ class sh extends $a {
10884
10884
  super.onBeforeCompile(t, e), t.vertexShader = vs, t.fragmentShader = gs;
10885
10885
  }
10886
10886
  }
10887
- class oh extends qa {
10887
+ class ou extends qa {
10888
10888
  constructor(t) {
10889
10889
  super(t);
10890
10890
  }
@@ -10892,7 +10892,7 @@ class oh extends qa {
10892
10892
  super.onBeforeCompile(t, e), t.vertexShader = vs, t.fragmentShader = gs;
10893
10893
  }
10894
10894
  }
10895
- class ah extends za {
10895
+ class au extends za {
10896
10896
  constructor(t) {
10897
10897
  super(t), this.vector_ = new B(), this.vector2_ = new B(), this.vector3_ = new B(), this.quaternion_ = new G(), this.quaternion2_ = new G(), this.quaternion3_ = new G(), this.rotationMat_ = new Kt(), this.rotationMat2_ = new Kt(), this.maxParticles = 1e3, this.setupBuffers(), this.rebuildMaterial();
10898
10898
  }
@@ -10919,16 +10919,16 @@ class ah extends za {
10919
10919
  const o = this.settings.softNearFade, c = 1 / (this.settings.softFarFade - this.settings.softNearFade);
10920
10920
  t.softParams = new Vt(new Qe(o, c)), t.depthTexture = new Vt(null);
10921
10921
  const l = t.projParams = new Vt(new wt());
10922
- s = (h, u, f) => {
10922
+ s = (u, h, f) => {
10923
10923
  l.value.set(f.near, f.far, 0, 0);
10924
10924
  };
10925
10925
  }
10926
10926
  let a = !1;
10927
10927
  if (this.settings.renderMode === A.BillBoard || this.settings.renderMode === A.VerticalBillBoard || this.settings.renderMode === A.HorizontalBillBoard || this.settings.renderMode === A.Mesh) {
10928
10928
  let o, c;
10929
- this.settings.renderMode === A.Mesh ? this.settings.material.type === "MeshStandardMaterial" || this.settings.material.type === "MeshPhysicalMaterial" ? (e.USE_COLOR = "", o = vs, c = gs, a = !0) : (o = rh, c = Cn) : (o = ih, c = Cn), this.settings.renderMode === A.VerticalBillBoard ? e.VERTICAL = "" : this.settings.renderMode === A.HorizontalBillBoard && (e.HORIZONTAL = "");
10929
+ this.settings.renderMode === A.Mesh ? this.settings.material.type === "MeshStandardMaterial" || this.settings.material.type === "MeshPhysicalMaterial" ? (e.USE_COLOR = "", o = vs, c = gs, a = !0) : (o = ru, c = Cn) : (o = iu, c = Cn), this.settings.renderMode === A.VerticalBillBoard ? e.VERTICAL = "" : this.settings.renderMode === A.HorizontalBillBoard && (e.HORIZONTAL = "");
10930
10930
  let l = !1;
10931
- this.settings.renderMode === A.Mesh && (this.settings.material.type === "MeshStandardMaterial" ? (this.material = new sh({}), this.material.copy(this.settings.material), this.material.uniforms = t, this.material.defines = e, l = !0) : this.settings.material.type === "MeshPhysicalMaterial" && (this.material = new oh({}), this.material.copy(this.settings.material), this.material.uniforms = t, this.material.defines = e, l = !0)), l || (this.material = new Dn({
10931
+ this.settings.renderMode === A.Mesh && (this.settings.material.type === "MeshStandardMaterial" ? (this.material = new su({}), this.material.copy(this.settings.material), this.material.uniforms = t, this.material.defines = e, l = !0) : this.settings.material.type === "MeshPhysicalMaterial" && (this.material = new ou({}), this.material.copy(this.settings.material), this.material.uniforms = t, this.material.defines = e, l = !0)), l || (this.material = new Dn({
10932
10932
  uniforms: t,
10933
10933
  defines: e,
10934
10934
  vertexShader: o,
@@ -10949,7 +10949,7 @@ class ah extends za {
10949
10949
  t.speedFactor = new Vt(1), this.material = new Dn({
10950
10950
  uniforms: t,
10951
10951
  defines: e,
10952
- vertexShader: nh,
10952
+ vertexShader: nu,
10953
10953
  fragmentShader: Cn,
10954
10954
  transparent: this.settings.material.transparent,
10955
10955
  depthWrite: !this.settings.material.transparent,
@@ -10975,24 +10975,24 @@ class ah extends za {
10975
10975
  const r = i.particles, s = i.particleNum, a = this.quaternion2_, o = this.vector2_, c = this.vector3_;
10976
10976
  i.emitter.matrixWorld.decompose(o, a, c), this.rotationMat_.setFromMatrix4(i.emitter.matrixWorld);
10977
10977
  for (let l = 0; l < s; l++, t++) {
10978
- const h = r[l];
10978
+ const u = r[l];
10979
10979
  if (this.settings.renderMode === A.Mesh) {
10980
10980
  let f;
10981
10981
  if (i.worldSpace)
10982
- f = h.rotation;
10982
+ f = u.rotation;
10983
10983
  else {
10984
10984
  let d;
10985
- h.parentMatrix ? d = this.quaternion3_.setFromRotationMatrix(h.parentMatrix) : d = a, f = this.quaternion_, f.copy(d).multiply(h.rotation);
10985
+ u.parentMatrix ? d = this.quaternion3_.setFromRotationMatrix(u.parentMatrix) : d = a, f = this.quaternion_, f.copy(d).multiply(u.rotation);
10986
10986
  }
10987
10987
  this.rotationBuffer.setXYZW(t, f.x, f.y, f.z, f.w);
10988
- } else (this.settings.renderMode === A.StretchedBillBoard || this.settings.renderMode === A.VerticalBillBoard || this.settings.renderMode === A.HorizontalBillBoard || this.settings.renderMode === A.BillBoard) && this.rotationBuffer.setX(t, h.rotation);
10989
- let u;
10990
- if (i.worldSpace ? u = h.position : (u = this.vector_, h.parentMatrix ? u.copy(h.position).applyMatrix4(h.parentMatrix) : u.copy(h.position).applyMatrix4(i.emitter.matrixWorld)), this.offsetBuffer.setXYZ(t, u.x, u.y, u.z), this.colorBuffer.setXYZW(t, h.color.x, h.color.y, h.color.z, h.color.w), i.worldSpace ? this.sizeBuffer.setXYZ(t, h.size.x, h.size.y, h.size.z) : h.parentMatrix ? this.sizeBuffer.setXYZ(t, h.size.x, h.size.y, h.size.z) : this.sizeBuffer.setXYZ(t, h.size.x * Math.abs(c.x), h.size.y * Math.abs(c.y), h.size.z * Math.abs(c.z)), this.uvTileBuffer.setX(t, h.uvTile), this.settings.renderMode === A.StretchedBillBoard && this.velocityBuffer) {
10988
+ } else (this.settings.renderMode === A.StretchedBillBoard || this.settings.renderMode === A.VerticalBillBoard || this.settings.renderMode === A.HorizontalBillBoard || this.settings.renderMode === A.BillBoard) && this.rotationBuffer.setX(t, u.rotation);
10989
+ let h;
10990
+ if (i.worldSpace ? h = u.position : (h = this.vector_, u.parentMatrix ? h.copy(u.position).applyMatrix4(u.parentMatrix) : h.copy(u.position).applyMatrix4(i.emitter.matrixWorld)), this.offsetBuffer.setXYZ(t, h.x, h.y, h.z), this.colorBuffer.setXYZW(t, u.color.x, u.color.y, u.color.z, u.color.w), i.worldSpace ? this.sizeBuffer.setXYZ(t, u.size.x, u.size.y, u.size.z) : u.parentMatrix ? this.sizeBuffer.setXYZ(t, u.size.x, u.size.y, u.size.z) : this.sizeBuffer.setXYZ(t, u.size.x * Math.abs(c.x), u.size.y * Math.abs(c.y), u.size.z * Math.abs(c.z)), this.uvTileBuffer.setX(t, u.uvTile), this.settings.renderMode === A.StretchedBillBoard && this.velocityBuffer) {
10991
10991
  let f = i.rendererEmitterSettings.speedFactor;
10992
10992
  f === 0 && (f = 1e-3);
10993
10993
  const d = i.rendererEmitterSettings.lengthFactor;
10994
10994
  let y;
10995
- i.worldSpace ? y = h.velocity : (y = this.vector_, h.parentMatrix ? (this.rotationMat2_.setFromMatrix4(h.parentMatrix), y.copy(h.velocity).applyMatrix3(this.rotationMat2_)) : y.copy(h.velocity).applyMatrix3(this.rotationMat_)), this.velocityBuffer.setXYZW(t, y.x * f, y.y * f, y.z * f, d);
10995
+ i.worldSpace ? y = u.velocity : (y = this.vector_, u.parentMatrix ? (this.rotationMat2_.setFromMatrix4(u.parentMatrix), y.copy(u.velocity).applyMatrix3(this.rotationMat2_)) : y.copy(u.velocity).applyMatrix3(this.rotationMat_)), this.velocityBuffer.setXYZW(t, y.x * f, y.y * f, y.z * f, d);
10996
10996
  }
10997
10997
  }
10998
10998
  }), this.geometry.instanceCount = t, t > 0 && (this.offsetBuffer.clearUpdateRanges(), this.offsetBuffer.addUpdateRange(0, t * 3), this.offsetBuffer.needsUpdate = !0, this.sizeBuffer.clearUpdateRanges(), this.sizeBuffer.addUpdateRange(0, t * 3), this.sizeBuffer.needsUpdate = !0, this.colorBuffer.clearUpdateRanges(), this.colorBuffer.addUpdateRange(0, t * 4), this.colorBuffer.needsUpdate = !0, this.uvTileBuffer.clearUpdateRanges(), this.uvTileBuffer.addUpdateRange(0, t), this.uvTileBuffer.needsUpdate = !0, this.settings.renderMode === A.StretchedBillBoard && this.velocityBuffer && (this.velocityBuffer.clearUpdateRanges(), this.velocityBuffer.addUpdateRange(0, t * 4), this.velocityBuffer.needsUpdate = !0), this.settings.renderMode === A.Mesh ? (this.rotationBuffer.clearUpdateRanges(), this.rotationBuffer.addUpdateRange(0, t * 4), this.rotationBuffer.needsUpdate = !0) : (this.settings.renderMode === A.StretchedBillBoard || this.settings.renderMode === A.HorizontalBillBoard || this.settings.renderMode === A.VerticalBillBoard || this.settings.renderMode === A.BillBoard) && (this.rotationBuffer.clearUpdateRanges(), this.rotationBuffer.addUpdateRange(0, t), this.rotationBuffer.needsUpdate = !0));
@@ -11001,7 +11001,7 @@ class ah extends za {
11001
11001
  this.geometry.dispose();
11002
11002
  }
11003
11003
  }
11004
- var ch = `
11004
+ var cu = `
11005
11005
 
11006
11006
  #include <common>
11007
11007
  #include <tile_pars_fragment>
@@ -11034,7 +11034,7 @@ void main() {
11034
11034
 
11035
11035
  #include <fog_fragment>
11036
11036
  #include <tonemapping_fragment>
11037
- }`, lh = `
11037
+ }`, lu = `
11038
11038
  #include <common>
11039
11039
  #include <tile_pars_vertex>
11040
11040
  #include <color_pars_vertex>
@@ -11110,7 +11110,7 @@ void main() {
11110
11110
 
11111
11111
  #include <fog_vertex>
11112
11112
  }`;
11113
- class hh extends za {
11113
+ class uu extends za {
11114
11114
  constructor(t) {
11115
11115
  super(t), this.vector_ = new B(), this.vector2_ = new B(), this.vector3_ = new B(), this.quaternion_ = new G(), this.maxParticles = 1e4, this.setupBuffers(), this.rebuildMaterial();
11116
11116
  }
@@ -11139,8 +11139,8 @@ class hh extends za {
11139
11139
  this.material = new Dn({
11140
11140
  uniforms: t,
11141
11141
  defines: e,
11142
- vertexShader: lh,
11143
- fragmentShader: ch,
11142
+ vertexShader: lu,
11143
+ fragmentShader: cu,
11144
11144
  transparent: this.settings.material.transparent,
11145
11145
  depthWrite: !this.settings.material.transparent,
11146
11146
  side: this.settings.material.side,
@@ -11162,9 +11162,9 @@ class hh extends za {
11162
11162
  r.emitter.updateMatrixWorld && (r.emitter.updateWorldMatrix(!0, !1), r.emitter.updateMatrixWorld(!0));
11163
11163
  const s = this.quaternion_, a = this.vector2_, o = this.vector3_;
11164
11164
  r.emitter.matrixWorld.decompose(a, s, o);
11165
- const c = r.particles, l = r.particleNum, h = this.settings.uTileCount, u = this.settings.vTileCount, f = 1 / h, d = 1 / u;
11165
+ const c = r.particles, l = r.particleNum, u = this.settings.uTileCount, h = this.settings.vTileCount, f = 1 / u, d = 1 / h;
11166
11166
  for (let y = 0; y < l; y++) {
11167
- const _ = c[y], p = _.uvTile % u, m = Math.floor(_.uvTile / u + 1e-3), v = _.previous.values();
11167
+ const _ = c[y], p = _.uvTile % h, m = Math.floor(_.uvTile / h + 1e-3), v = _.previous.values();
11168
11168
  let g = v.next(), b = g.value, x = b;
11169
11169
  g.done || (g = v.next());
11170
11170
  let S;
@@ -11178,7 +11178,7 @@ class hh extends za {
11178
11178
  const P = (Math.abs(o.x) + Math.abs(o.y) + Math.abs(o.z)) / 3;
11179
11179
  this.widthBuffer.setX(t, x.size * P), this.widthBuffer.setX(t + 1, x.size * P);
11180
11180
  }
11181
- this.uvBuffer.setXY(t, (T / _.previous.length + p) * f, (u - m - 1) * d), this.uvBuffer.setXY(t + 1, (T / _.previous.length + p) * f, (u - m) * d), this.colorBuffer.setXYZW(t, x.color.x, x.color.y, x.color.z, x.color.w), this.colorBuffer.setXYZW(t + 1, x.color.x, x.color.y, x.color.z, x.color.w), T + 1 < _.previous.length && (this.indexBuffer.setX(e * 3, t), this.indexBuffer.setX(e * 3 + 1, t + 1), this.indexBuffer.setX(e * 3 + 2, t + 2), e++, this.indexBuffer.setX(e * 3, t + 2), this.indexBuffer.setX(e * 3 + 1, t + 1), this.indexBuffer.setX(e * 3 + 2, t + 3), e++), b = x, x = S, g.done || (g = v.next(), g.value !== void 0 && (S = g.value));
11181
+ this.uvBuffer.setXY(t, (T / _.previous.length + p) * f, (h - m - 1) * d), this.uvBuffer.setXY(t + 1, (T / _.previous.length + p) * f, (h - m) * d), this.colorBuffer.setXYZW(t, x.color.x, x.color.y, x.color.z, x.color.w), this.colorBuffer.setXYZW(t + 1, x.color.x, x.color.y, x.color.z, x.color.w), T + 1 < _.previous.length && (this.indexBuffer.setX(e * 3, t), this.indexBuffer.setX(e * 3 + 1, t + 1), this.indexBuffer.setX(e * 3 + 2, t + 2), e++, this.indexBuffer.setX(e * 3, t + 2), this.indexBuffer.setX(e * 3 + 1, t + 1), this.indexBuffer.setX(e * 3 + 2, t + 3), e++), b = x, x = S, g.done || (g = v.next(), g.value !== void 0 && (S = g.value));
11182
11182
  }
11183
11183
  }
11184
11184
  }), this.positionBuffer.clearUpdateRanges(), this.positionBuffer.addUpdateRange(0, t * 3), this.positionBuffer.needsUpdate = !0, this.previousBuffer.clearUpdateRanges(), this.previousBuffer.addUpdateRange(0, t * 3), this.previousBuffer.needsUpdate = !0, this.nextBuffer.clearUpdateRanges(), this.nextBuffer.addUpdateRange(0, t * 3), this.nextBuffer.needsUpdate = !0, this.sideBuffer.clearUpdateRanges(), this.sideBuffer.addUpdateRange(0, t), this.sideBuffer.needsUpdate = !0, this.widthBuffer.clearUpdateRanges(), this.widthBuffer.addUpdateRange(0, t), this.widthBuffer.needsUpdate = !0, this.uvBuffer.clearUpdateRanges(), this.uvBuffer.addUpdateRange(0, t * 2), this.uvBuffer.needsUpdate = !0, this.colorBuffer.clearUpdateRanges(), this.colorBuffer.addUpdateRange(0, t * 4), this.colorBuffer.needsUpdate = !0, this.indexBuffer.clearUpdateRanges(), this.indexBuffer.addUpdateRange(0, e * 3), this.indexBuffer.needsUpdate = !0, this.geometry.setDrawRange(0, e * 3);
@@ -11223,8 +11223,8 @@ class cr {
11223
11223
  }
11224
11224
  let o = Math.random(), c = Math.random();
11225
11225
  o + c > 1 && (o = 1 - o, c = 1 - c);
11226
- const l = e.getIndex().array[r * 3], h = e.getIndex().array[r * 3 + 1], u = e.getIndex().array[r * 3 + 2], f = e.getAttribute("position");
11227
- this._tempA.fromBufferAttribute(f, l), this._tempB.fromBufferAttribute(f, h), this._tempC.fromBufferAttribute(f, u), this._tempB.sub(this._tempA), this._tempC.sub(this._tempA), this._tempA.addScaledVector(this._tempB, o).addScaledVector(this._tempC, c), t.position.copy(this._tempA), this._tempA.copy(this._tempB).cross(this._tempC).normalize(), t.velocity.copy(this._tempA).normalize().multiplyScalar(t.startSpeed);
11226
+ const l = e.getIndex().array[r * 3], u = e.getIndex().array[r * 3 + 1], h = e.getIndex().array[r * 3 + 2], f = e.getAttribute("position");
11227
+ this._tempA.fromBufferAttribute(f, l), this._tempB.fromBufferAttribute(f, u), this._tempC.fromBufferAttribute(f, h), this._tempB.sub(this._tempA), this._tempC.sub(this._tempA), this._tempA.addScaledVector(this._tempB, o).addScaledVector(this._tempC, c), t.position.copy(this._tempA), this._tempA.copy(this._tempB).cross(this._tempC).normalize(), t.velocity.copy(this._tempA).normalize().multiplyScalar(t.startSpeed);
11228
11228
  }
11229
11229
  toJSON() {
11230
11230
  return {
@@ -11269,14 +11269,14 @@ class _s extends Oo {
11269
11269
  let i;
11270
11270
  switch (e.renderMode) {
11271
11271
  case A.Trail:
11272
- i = new hh(e);
11272
+ i = new uu(e);
11273
11273
  break;
11274
11274
  case A.Mesh:
11275
11275
  case A.BillBoard:
11276
11276
  case A.VerticalBillBoard:
11277
11277
  case A.HorizontalBillBoard:
11278
11278
  case A.StretchedBillBoard:
11279
- i = new ah(e);
11279
+ i = new au(e);
11280
11280
  break;
11281
11281
  }
11282
11282
  this.depthTexture && i.applyDepthTexture(this.depthTexture), i.addSystem(t), this.batches.push(i), this.systemToBatchIndex.set(t, this.batches.length - 1), this.add(i);
@@ -11301,10 +11301,10 @@ class _s extends Oo {
11301
11301
  this.batches[e].update();
11302
11302
  }
11303
11303
  }
11304
- const Fu = _s;
11304
+ const Fh = _s;
11305
11305
  Yl();
11306
11306
  console.log("%c Particle system powered by three.quarks. https://quarks.art/", "font-size: 14px; font-weight: bold;");
11307
- const Oa = /* @__PURE__ */ Math.sqrt(5), uh = (Oa - 1) / 4, ct = (5 - Oa) / 20, vr = (n) => Math.floor(n) | 0, _r = /* @__PURE__ */ new Float64Array([
11307
+ const Oa = /* @__PURE__ */ Math.sqrt(5), hu = (Oa - 1) / 4, ct = (5 - Oa) / 20, vr = (n) => Math.floor(n) | 0, _r = /* @__PURE__ */ new Float64Array([
11308
11308
  0,
11309
11309
  1,
11310
11310
  1,
@@ -11434,20 +11434,20 @@ const Oa = /* @__PURE__ */ Math.sqrt(5), uh = (Oa - 1) / 4, ct = (5 - Oa) / 20,
11434
11434
  -1,
11435
11435
  0
11436
11436
  ]);
11437
- function Du(n = Math.random) {
11438
- const t = fh(n), e = new Float64Array(t).map((a) => _r[a % 32 * 4]), i = new Float64Array(t).map((a) => _r[a % 32 * 4 + 1]), r = new Float64Array(t).map((a) => _r[a % 32 * 4 + 2]), s = new Float64Array(t).map((a) => _r[a % 32 * 4 + 3]);
11439
- return function(o, c, l, h) {
11440
- let u, f, d, y, _;
11441
- const p = (o + c + l + h) * uh, m = vr(o + p), v = vr(c + p), g = vr(l + p), b = vr(h + p), x = (m + v + g + b) * ct, S = m - x, T = v - x, P = g - x, M = b - x, C = o - S, E = c - T, w = l - P, k = h - M;
11437
+ function Dh(n = Math.random) {
11438
+ const t = fu(n), e = new Float64Array(t).map((a) => _r[a % 32 * 4]), i = new Float64Array(t).map((a) => _r[a % 32 * 4 + 1]), r = new Float64Array(t).map((a) => _r[a % 32 * 4 + 2]), s = new Float64Array(t).map((a) => _r[a % 32 * 4 + 3]);
11439
+ return function(o, c, l, u) {
11440
+ let h, f, d, y, _;
11441
+ const p = (o + c + l + u) * hu, m = vr(o + p), v = vr(c + p), g = vr(l + p), b = vr(u + p), x = (m + v + g + b) * ct, S = m - x, T = v - x, P = g - x, M = b - x, C = o - S, E = c - T, w = l - P, k = u - M;
11442
11442
  let R = 0, z = 0, U = 0, L = 0;
11443
11443
  C > E ? R++ : z++, C > w ? R++ : U++, C > k ? R++ : L++, E > w ? z++ : U++, E > k ? z++ : L++, w > k ? U++ : L++;
11444
- const I = R >= 3 ? 1 : 0, H = z >= 3 ? 1 : 0, K = U >= 3 ? 1 : 0, rt = L >= 3 ? 1 : 0, tt = R >= 2 ? 1 : 0, mt = z >= 2 ? 1 : 0, yt = U >= 2 ? 1 : 0, nt = L >= 2 ? 1 : 0, W = R >= 1 ? 1 : 0, $ = z >= 1 ? 1 : 0, ie = U >= 1 ? 1 : 0, jt = L >= 1 ? 1 : 0, $t = C - I + ct, qt = E - H + ct, xt = w - K + ct, Bt = k - rt + ct, bt = C - tt + 2 * ct, re = E - mt + 2 * ct, ne = w - yt + 2 * ct, Y = k - nt + 2 * ct, Xt = C - W + 3 * ct, se = E - $ + 3 * ct, Pe = w - ie + 3 * ct, oe = k - jt + 3 * ct, ae = C - 1 + 4 * ct, ce = E - 1 + 4 * ct, le = w - 1 + 4 * ct, he = k - 1 + 4 * ct, It = m & 255, Nt = v & 255, Ut = g & 255, Ft = b & 255;
11444
+ const I = R >= 3 ? 1 : 0, H = z >= 3 ? 1 : 0, K = U >= 3 ? 1 : 0, rt = L >= 3 ? 1 : 0, tt = R >= 2 ? 1 : 0, mt = z >= 2 ? 1 : 0, yt = U >= 2 ? 1 : 0, nt = L >= 2 ? 1 : 0, W = R >= 1 ? 1 : 0, $ = z >= 1 ? 1 : 0, ie = U >= 1 ? 1 : 0, jt = L >= 1 ? 1 : 0, $t = C - I + ct, qt = E - H + ct, xt = w - K + ct, Bt = k - rt + ct, bt = C - tt + 2 * ct, re = E - mt + 2 * ct, ne = w - yt + 2 * ct, Y = k - nt + 2 * ct, Xt = C - W + 3 * ct, se = E - $ + 3 * ct, Pe = w - ie + 3 * ct, oe = k - jt + 3 * ct, ae = C - 1 + 4 * ct, ce = E - 1 + 4 * ct, le = w - 1 + 4 * ct, ue = k - 1 + 4 * ct, It = m & 255, Nt = v & 255, Ut = g & 255, Ft = b & 255;
11445
11445
  let V = 0.6 - C * C - E * E - w * w - k * k;
11446
11446
  if (V < 0)
11447
- u = 0;
11447
+ h = 0;
11448
11448
  else {
11449
11449
  const X = It + t[Nt + t[Ut + t[Ft]]];
11450
- V *= V, u = V * V * (e[X] * C + i[X] * E + r[X] * w + s[X] * k);
11450
+ V *= V, h = V * V * (e[X] * C + i[X] * E + r[X] * w + s[X] * k);
11451
11451
  }
11452
11452
  let oi = 0.6 - $t * $t - qt * qt - xt * xt - Bt * Bt;
11453
11453
  if (oi < 0)
@@ -11470,17 +11470,17 @@ function Du(n = Math.random) {
11470
11470
  const X = It + W + t[Nt + $ + t[Ut + ie + t[Ft + jt]]];
11471
11471
  ci *= ci, y = ci * ci * (e[X] * Xt + i[X] * se + r[X] * Pe + s[X] * oe);
11472
11472
  }
11473
- let li = 0.6 - ae * ae - ce * ce - le * le - he * he;
11473
+ let li = 0.6 - ae * ae - ce * ce - le * le - ue * ue;
11474
11474
  if (li < 0)
11475
11475
  _ = 0;
11476
11476
  else {
11477
11477
  const X = It + 1 + t[Nt + 1 + t[Ut + 1 + t[Ft + 1]]];
11478
- li *= li, _ = li * li * (e[X] * ae + i[X] * ce + r[X] * le + s[X] * he);
11478
+ li *= li, _ = li * li * (e[X] * ae + i[X] * ce + r[X] * le + s[X] * ue);
11479
11479
  }
11480
- return 27 * (u + f + d + y + _);
11480
+ return 27 * (h + f + d + y + _);
11481
11481
  };
11482
11482
  }
11483
- function fh(n) {
11483
+ function fu(n) {
11484
11484
  const e = new Uint8Array(512);
11485
11485
  for (let i = 0; i < 512 / 2; i++)
11486
11486
  e[i] = i;
@@ -11492,7 +11492,7 @@ function fh(n) {
11492
11492
  e[i] = e[i - 256];
11493
11493
  return e;
11494
11494
  }
11495
- class dh {
11495
+ class du {
11496
11496
  /**
11497
11497
  * Creates a new ExponentialBackoff.
11498
11498
  * @param base the base of the exponentiation
@@ -11531,7 +11531,7 @@ class Ba {
11531
11531
  * @param options optional options to use.
11532
11532
  */
11533
11533
  constructor(t, e, i) {
11534
- var r, s, a, o, c, l, h, u, f, d, y, _, p, m, v;
11534
+ var r, s, a, o, c, l, u, h, f, d, y, _, p, m, v;
11535
11535
  this._closedByUser = !1, this.handleOpenEvent = (g) => this.handleEvent(j.open, g), this.handleErrorEvent = (g) => this.handleEvent(j.error, g), this.handleCloseEvent = (g) => this.handleEvent(j.close, g), this.handleMessageEvent = (g) => this.handleEvent(j.message, g), this._url = t, this._protocols = e, this._options = {
11536
11536
  buffer: i?.buffer,
11537
11537
  retry: {
@@ -11541,8 +11541,8 @@ class Ba {
11541
11541
  },
11542
11542
  listeners: {
11543
11543
  open: [...(c = (o = i?.listeners) === null || o === void 0 ? void 0 : o.open) !== null && c !== void 0 ? c : []],
11544
- close: [...(h = (l = i?.listeners) === null || l === void 0 ? void 0 : l.close) !== null && h !== void 0 ? h : []],
11545
- error: [...(f = (u = i?.listeners) === null || u === void 0 ? void 0 : u.error) !== null && f !== void 0 ? f : []],
11544
+ close: [...(u = (l = i?.listeners) === null || l === void 0 ? void 0 : l.close) !== null && u !== void 0 ? u : []],
11545
+ error: [...(f = (h = i?.listeners) === null || h === void 0 ? void 0 : h.error) !== null && f !== void 0 ? f : []],
11546
11546
  message: [...(y = (d = i?.listeners) === null || d === void 0 ? void 0 : d.message) !== null && y !== void 0 ? y : []],
11547
11547
  retry: [...(p = (_ = i?.listeners) === null || _ === void 0 ? void 0 : _.retry) !== null && p !== void 0 ? p : []],
11548
11548
  reconnect: [...(v = (m = i?.listeners) === null || m === void 0 ? void 0 : m.reconnect) !== null && v !== void 0 ? v : []]
@@ -11799,7 +11799,7 @@ class Ba {
11799
11799
  globalThis.clearTimeout(this.retryTimeout);
11800
11800
  }
11801
11801
  }
11802
- class ph {
11802
+ class pu {
11803
11803
  /**
11804
11804
  * Creates a new WebsocketBuilder.
11805
11805
  *
@@ -11979,11 +11979,11 @@ class ph {
11979
11979
  * @param options the listener options
11980
11980
  */
11981
11981
  addListener(t, e, i) {
11982
- var r, s, a, o, c, l, h, u, f, d, y, _, p, m, v, g, b, x, S, T, P;
11982
+ var r, s, a, o, c, l, u, h, f, d, y, _, p, m, v, g, b, x, S, T, P;
11983
11983
  return this._options = Object.assign(Object.assign({}, this._options), { listeners: {
11984
11984
  open: (a = (s = (r = this._options) === null || r === void 0 ? void 0 : r.listeners) === null || s === void 0 ? void 0 : s.open) !== null && a !== void 0 ? a : [],
11985
11985
  close: (l = (c = (o = this._options) === null || o === void 0 ? void 0 : o.listeners) === null || c === void 0 ? void 0 : c.close) !== null && l !== void 0 ? l : [],
11986
- error: (f = (u = (h = this._options) === null || h === void 0 ? void 0 : h.listeners) === null || u === void 0 ? void 0 : u.error) !== null && f !== void 0 ? f : [],
11986
+ error: (f = (h = (u = this._options) === null || u === void 0 ? void 0 : u.listeners) === null || h === void 0 ? void 0 : h.error) !== null && f !== void 0 ? f : [],
11987
11987
  message: (_ = (y = (d = this._options) === null || d === void 0 ? void 0 : d.listeners) === null || y === void 0 ? void 0 : y.message) !== null && _ !== void 0 ? _ : [],
11988
11988
  retry: (v = (m = (p = this._options) === null || p === void 0 ? void 0 : p.listeners) === null || m === void 0 ? void 0 : m.retry) !== null && v !== void 0 ? v : [],
11989
11989
  reconnect: (x = (b = (g = this._options) === null || g === void 0 ? void 0 : g.listeners) === null || b === void 0 ? void 0 : b.reconnect) !== null && x !== void 0 ? x : [],
@@ -11994,27 +11994,27 @@ class ph {
11994
11994
  } }), this;
11995
11995
  }
11996
11996
  }
11997
- const Lu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11997
+ const Lh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
11998
11998
  __proto__: null,
11999
- ExponentialBackoff: dh,
11999
+ ExponentialBackoff: du,
12000
12000
  Websocket: Ba,
12001
- WebsocketBuilder: ph,
12001
+ WebsocketBuilder: pu,
12002
12002
  get WebsocketEvent() {
12003
12003
  return j;
12004
12004
  }
12005
- }, Symbol.toStringTag, { value: "Module" })), xs = 0, Ia = 1, Na = 2, ts = 2, Mn = 1.25, uo = 1, Ei = 32, rn = 65535, mh = Math.pow(2, -24), Pn = Symbol("SKIP_GENERATION");
12006
- function yh(n) {
12005
+ }, Symbol.toStringTag, { value: "Module" })), xs = 0, Ia = 1, Na = 2, ts = 2, Mn = 1.25, ho = 1, Ei = 32, rn = 65535, mu = Math.pow(2, -24), Pn = Symbol("SKIP_GENERATION");
12006
+ function yu(n) {
12007
12007
  return n.index ? n.index.count : n.attributes.position.count;
12008
12008
  }
12009
12009
  function si(n) {
12010
- return yh(n) / 3;
12010
+ return yu(n) / 3;
12011
12011
  }
12012
- function gh(n, t = ArrayBuffer) {
12012
+ function gu(n, t = ArrayBuffer) {
12013
12013
  return n > 65535 ? new Uint32Array(new t(4 * n)) : new Uint16Array(new t(2 * n));
12014
12014
  }
12015
- function vh(n, t) {
12015
+ function vu(n, t) {
12016
12016
  if (!n.index) {
12017
- const e = n.attributes.position.count, i = t.useSharedArrayBuffer ? SharedArrayBuffer : ArrayBuffer, r = gh(e, i);
12017
+ const e = n.attributes.position.count, i = t.useSharedArrayBuffer ? SharedArrayBuffer : ArrayBuffer, r = gu(e, i);
12018
12018
  n.setIndex(new Mt(r, 1));
12019
12019
  for (let s = 0; s < e; s++)
12020
12020
  r[s] = s;
@@ -12032,49 +12032,49 @@ function Fa(n, t) {
12032
12032
  return Ua(n, t);
12033
12033
  const e = [], i = /* @__PURE__ */ new Set(), r = t || n.drawRange, s = r.start / 3, a = (r.start + r.count) / 3;
12034
12034
  for (const c of n.groups) {
12035
- const l = c.start / 3, h = (c.start + c.count) / 3;
12036
- i.add(Math.max(s, l)), i.add(Math.min(a, h));
12035
+ const l = c.start / 3, u = (c.start + c.count) / 3;
12036
+ i.add(Math.max(s, l)), i.add(Math.min(a, u));
12037
12037
  }
12038
12038
  const o = Array.from(i.values()).sort((c, l) => c - l);
12039
12039
  for (let c = 0; c < o.length - 1; c++) {
12040
- const l = o[c], h = o[c + 1];
12040
+ const l = o[c], u = o[c + 1];
12041
12041
  e.push({
12042
12042
  offset: Math.floor(l),
12043
- count: Math.floor(h - l)
12043
+ count: Math.floor(u - l)
12044
12044
  });
12045
12045
  }
12046
12046
  return e;
12047
12047
  }
12048
- function _h(n, t) {
12048
+ function _u(n, t) {
12049
12049
  const e = si(n), i = Fa(n, t).sort((a, o) => a.offset - o.offset), r = i[i.length - 1];
12050
12050
  r.count = Math.min(e - r.offset, r.count);
12051
12051
  let s = 0;
12052
12052
  return i.forEach(({ count: a }) => s += a), e !== s;
12053
12053
  }
12054
12054
  function wn(n, t, e, i, r) {
12055
- let s = 1 / 0, a = 1 / 0, o = 1 / 0, c = -1 / 0, l = -1 / 0, h = -1 / 0, u = 1 / 0, f = 1 / 0, d = 1 / 0, y = -1 / 0, _ = -1 / 0, p = -1 / 0;
12055
+ let s = 1 / 0, a = 1 / 0, o = 1 / 0, c = -1 / 0, l = -1 / 0, u = -1 / 0, h = 1 / 0, f = 1 / 0, d = 1 / 0, y = -1 / 0, _ = -1 / 0, p = -1 / 0;
12056
12056
  for (let m = t * 6, v = (t + e) * 6; m < v; m += 6) {
12057
12057
  const g = n[m + 0], b = n[m + 1], x = g - b, S = g + b;
12058
- x < s && (s = x), S > c && (c = S), g < u && (u = g), g > y && (y = g);
12058
+ x < s && (s = x), S > c && (c = S), g < h && (h = g), g > y && (y = g);
12059
12059
  const T = n[m + 2], P = n[m + 3], M = T - P, C = T + P;
12060
12060
  M < a && (a = M), C > l && (l = C), T < f && (f = T), T > _ && (_ = T);
12061
12061
  const E = n[m + 4], w = n[m + 5], k = E - w, R = E + w;
12062
- k < o && (o = k), R > h && (h = R), E < d && (d = E), E > p && (p = E);
12062
+ k < o && (o = k), R > u && (u = R), E < d && (d = E), E > p && (p = E);
12063
12063
  }
12064
- i[0] = s, i[1] = a, i[2] = o, i[3] = c, i[4] = l, i[5] = h, r[0] = u, r[1] = f, r[2] = d, r[3] = y, r[4] = _, r[5] = p;
12064
+ i[0] = s, i[1] = a, i[2] = o, i[3] = c, i[4] = l, i[5] = u, r[0] = h, r[1] = f, r[2] = d, r[3] = y, r[4] = _, r[5] = p;
12065
12065
  }
12066
- function xh(n, t = null, e = null, i = null) {
12066
+ function xu(n, t = null, e = null, i = null) {
12067
12067
  const r = n.attributes.position, s = n.index ? n.index.array : null, a = si(n), o = r.normalized;
12068
12068
  let c;
12069
12069
  t === null ? (c = new Float32Array(a * 6), e = 0, i = a) : (c = t, e = e || 0, i = i || a);
12070
- const l = r.array, h = r.offset || 0;
12071
- let u = 3;
12072
- r.isInterleavedBufferAttribute && (u = r.data.stride);
12070
+ const l = r.array, u = r.offset || 0;
12071
+ let h = 3;
12072
+ r.isInterleavedBufferAttribute && (h = r.data.stride);
12073
12073
  const f = ["getX", "getY", "getZ"];
12074
12074
  for (let d = e; d < e + i; d++) {
12075
12075
  const y = d * 3, _ = d * 6;
12076
12076
  let p = y + 0, m = y + 1, v = y + 2;
12077
- s && (p = s[p], m = s[m], v = s[v]), o || (p = p * u + h, m = m * u + h, v = v * u + h);
12077
+ s && (p = s[p], m = s[m], v = s[v]), o || (p = p * h + u, m = m * h + u, v = v * h + u);
12078
12078
  for (let g = 0; g < 3; g++) {
12079
12079
  let b, x, S;
12080
12080
  o ? (b = r[f[g]](p), x = r[f[g]](m), S = r[f[g]](v)) : (b = l[p + g], x = l[m + g], S = l[v + g]);
@@ -12083,7 +12083,7 @@ function xh(n, t = null, e = null, i = null) {
12083
12083
  let P = b;
12084
12084
  x > P && (P = x), S > P && (P = S);
12085
12085
  const M = (P - T) / 2, C = g * 2;
12086
- c[_ + C + 0] = T + M, c[_ + C + 1] = M + (Math.abs(T) + M) * mh;
12086
+ c[_ + C + 0] = T + M, c[_ + C + 1] = M + (Math.abs(T) + M) * mu;
12087
12087
  }
12088
12088
  }
12089
12089
  return c;
@@ -12119,30 +12119,30 @@ function di(n) {
12119
12119
  const t = n[3] - n[0], e = n[4] - n[1], i = n[5] - n[2];
12120
12120
  return 2 * (t * e + e * i + i * t);
12121
12121
  }
12122
- const ue = 32, bh = (n, t) => n.candidate - t.candidate, xe = new Array(ue).fill().map(() => ({
12122
+ const he = 32, bu = (n, t) => n.candidate - t.candidate, xe = new Array(he).fill().map(() => ({
12123
12123
  count: 0,
12124
12124
  bounds: new Float32Array(6),
12125
12125
  rightCacheBounds: new Float32Array(6),
12126
12126
  leftCacheBounds: new Float32Array(6),
12127
12127
  candidate: 0
12128
12128
  })), br = new Float32Array(6);
12129
- function Sh(n, t, e, i, r, s) {
12129
+ function Su(n, t, e, i, r, s) {
12130
12130
  let a = -1, o = 0;
12131
12131
  if (s === xs)
12132
12132
  a = fo(t), a !== -1 && (o = (t[a] + t[a + 3]) / 2);
12133
12133
  else if (s === Ia)
12134
- a = fo(n), a !== -1 && (o = Th(e, i, r, a));
12134
+ a = fo(n), a !== -1 && (o = Tu(e, i, r, a));
12135
12135
  else if (s === Na) {
12136
12136
  const c = di(n);
12137
12137
  let l = Mn * r;
12138
- const h = i * 6, u = (i + r) * 6;
12138
+ const u = i * 6, h = (i + r) * 6;
12139
12139
  for (let f = 0; f < 3; f++) {
12140
- const d = t[f], p = (t[f + 3] - d) / ue;
12141
- if (r < ue / 4) {
12140
+ const d = t[f], p = (t[f + 3] - d) / he;
12141
+ if (r < he / 4) {
12142
12142
  const m = [...xe];
12143
12143
  m.length = r;
12144
12144
  let v = 0;
12145
- for (let b = h; b < u; b += 6, v++) {
12145
+ for (let b = u; b < h; b += 6, v++) {
12146
12146
  const x = m[v];
12147
12147
  x.candidate = e[b + 2 * f], x.count = 0;
12148
12148
  const {
@@ -12154,14 +12154,14 @@ function Sh(n, t, e, i, r, s) {
12154
12154
  P[M] = 1 / 0, P[M + 3] = -1 / 0, T[M] = 1 / 0, T[M + 3] = -1 / 0, S[M] = 1 / 0, S[M + 3] = -1 / 0;
12155
12155
  xr(b, e, S);
12156
12156
  }
12157
- m.sort(bh);
12157
+ m.sort(bu);
12158
12158
  let g = r;
12159
12159
  for (let b = 0; b < g; b++) {
12160
12160
  const x = m[b];
12161
12161
  for (; b + 1 < g && m[b + 1].candidate === x.candidate; )
12162
12162
  m.splice(b + 1, 1), g--;
12163
12163
  }
12164
- for (let b = h; b < u; b += 6) {
12164
+ for (let b = u; b < h; b += 6) {
12165
12165
  const x = e[b + 2 * f];
12166
12166
  for (let S = 0; S < g; S++) {
12167
12167
  const T = m[S];
@@ -12174,38 +12174,38 @@ function Sh(n, t, e, i, r, s) {
12174
12174
  S !== 0 && (C = di(P) / c);
12175
12175
  let E = 0;
12176
12176
  T !== 0 && (E = di(M) / c);
12177
- const w = uo + Mn * (C * S + E * T);
12177
+ const w = ho + Mn * (C * S + E * T);
12178
12178
  w < l && (a = f, l = w, o = x.candidate);
12179
12179
  }
12180
12180
  } else {
12181
- for (let g = 0; g < ue; g++) {
12181
+ for (let g = 0; g < he; g++) {
12182
12182
  const b = xe[g];
12183
12183
  b.count = 0, b.candidate = d + p + g * p;
12184
12184
  const x = b.bounds;
12185
12185
  for (let S = 0; S < 3; S++)
12186
12186
  x[S] = 1 / 0, x[S + 3] = -1 / 0;
12187
12187
  }
12188
- for (let g = h; g < u; g += 6) {
12188
+ for (let g = u; g < h; g += 6) {
12189
12189
  let S = ~~((e[g + 2 * f] - d) / p);
12190
- S >= ue && (S = ue - 1);
12190
+ S >= he && (S = he - 1);
12191
12191
  const T = xe[S];
12192
12192
  T.count++, xr(g, e, T.bounds);
12193
12193
  }
12194
- const m = xe[ue - 1];
12194
+ const m = xe[he - 1];
12195
12195
  po(m.bounds, m.rightCacheBounds);
12196
- for (let g = ue - 2; g >= 0; g--) {
12196
+ for (let g = he - 2; g >= 0; g--) {
12197
12197
  const b = xe[g], x = xe[g + 1];
12198
12198
  mo(b.bounds, x.rightCacheBounds, b.rightCacheBounds);
12199
12199
  }
12200
12200
  let v = 0;
12201
- for (let g = 0; g < ue - 1; g++) {
12201
+ for (let g = 0; g < he - 1; g++) {
12202
12202
  const b = xe[g], x = b.count, S = b.bounds, P = xe[g + 1].rightCacheBounds;
12203
12203
  x !== 0 && (v === 0 ? po(S, br) : mo(S, br, br)), v += x;
12204
12204
  let M = 0, C = 0;
12205
12205
  v !== 0 && (M = di(br) / c);
12206
12206
  const E = r - v;
12207
12207
  E !== 0 && (C = di(P) / c);
12208
- const w = uo + Mn * (M * v + C * E);
12208
+ const w = ho + Mn * (M * v + C * E);
12209
12209
  w < l && (a = f, l = w, o = b.candidate);
12210
12210
  }
12211
12211
  }
@@ -12214,7 +12214,7 @@ function Sh(n, t, e, i, r, s) {
12214
12214
  console.warn(`MeshBVH: Invalid build strategy value ${s} used.`);
12215
12215
  return { axis: a, pos: o };
12216
12216
  }
12217
- function Th(n, t, e, i) {
12217
+ function Tu(n, t, e, i) {
12218
12218
  let r = 0;
12219
12219
  for (let s = t, a = t + e; s < a; s++)
12220
12220
  r += n[s * 6 + i * 2];
@@ -12225,7 +12225,7 @@ class En {
12225
12225
  this.boundingData = new Float32Array(6);
12226
12226
  }
12227
12227
  }
12228
- function Ch(n, t, e, i, r, s) {
12228
+ function Cu(n, t, e, i, r, s) {
12229
12229
  let a = i, o = i + r - 1;
12230
12230
  const c = s.pos, l = s.axis * 2;
12231
12231
  for (; ; ) {
@@ -12234,20 +12234,20 @@ function Ch(n, t, e, i, r, s) {
12234
12234
  for (; a <= o && e[o * 6 + l] >= c; )
12235
12235
  o--;
12236
12236
  if (a < o) {
12237
- for (let h = 0; h < 3; h++) {
12238
- let u = t[a * 3 + h];
12239
- t[a * 3 + h] = t[o * 3 + h], t[o * 3 + h] = u;
12237
+ for (let u = 0; u < 3; u++) {
12238
+ let h = t[a * 3 + u];
12239
+ t[a * 3 + u] = t[o * 3 + u], t[o * 3 + u] = h;
12240
12240
  }
12241
- for (let h = 0; h < 6; h++) {
12242
- let u = e[a * 6 + h];
12243
- e[a * 6 + h] = e[o * 6 + h], e[o * 6 + h] = u;
12241
+ for (let u = 0; u < 6; u++) {
12242
+ let h = e[a * 6 + u];
12243
+ e[a * 6 + u] = e[o * 6 + u], e[o * 6 + u] = h;
12244
12244
  }
12245
12245
  a++, o--;
12246
12246
  } else
12247
12247
  return a;
12248
12248
  }
12249
12249
  }
12250
- function Mh(n, t, e, i, r, s) {
12250
+ function Mu(n, t, e, i, r, s) {
12251
12251
  let a = i, o = i + r - 1;
12252
12252
  const c = s.pos, l = s.axis * 2;
12253
12253
  for (; ; ) {
@@ -12256,11 +12256,11 @@ function Mh(n, t, e, i, r, s) {
12256
12256
  for (; a <= o && e[o * 6 + l] >= c; )
12257
12257
  o--;
12258
12258
  if (a < o) {
12259
- let h = n[a];
12260
- n[a] = n[o], n[o] = h;
12261
- for (let u = 0; u < 6; u++) {
12262
- let f = e[a * 6 + u];
12263
- e[a * 6 + u] = e[o * 6 + u], e[o * 6 + u] = f;
12259
+ let u = n[a];
12260
+ n[a] = n[o], n[o] = u;
12261
+ for (let h = 0; h < 6; h++) {
12262
+ let f = e[a * 6 + h];
12263
+ e[a * 6 + h] = e[o * 6 + h], e[o * 6 + h] = f;
12264
12264
  }
12265
12265
  a++, o--;
12266
12266
  } else
@@ -12286,11 +12286,11 @@ function Da(n, t) {
12286
12286
  return t[n + 7];
12287
12287
  }
12288
12288
  let La, Ci, Jr, Va;
12289
- const Ph = Math.pow(2, 32);
12289
+ const Pu = Math.pow(2, 32);
12290
12290
  function es(n) {
12291
12291
  return "count" in n ? 1 : 1 + es(n.left) + es(n.right);
12292
12292
  }
12293
- function wh(n, t, e) {
12293
+ function wu(n, t, e) {
12294
12294
  return La = new Float32Array(e), Ci = new Uint32Array(e), Jr = new Uint16Array(e), Va = new Uint8Array(e), is(n, t);
12295
12295
  }
12296
12296
  function is(n, t) {
@@ -12313,26 +12313,26 @@ function is(n, t) {
12313
12313
  else {
12314
12314
  const a = t.left, o = t.right, c = t.splitAxis;
12315
12315
  let l;
12316
- if (l = is(n + Ei, a), l / 4 > Ph)
12316
+ if (l = is(n + Ei, a), l / 4 > Pu)
12317
12317
  throw new Error("MeshBVH: Cannot store child pointer greater than 32 bits.");
12318
12318
  return Ci[e + 6] = l / 4, l = is(l, o), Ci[e + 7] = c, l;
12319
12319
  }
12320
12320
  }
12321
- function Eh(n, t) {
12321
+ function Eu(n, t) {
12322
12322
  const e = (n.index ? n.index.count : n.attributes.position.count) / 3, i = e > 2 ** 16, r = i ? 4 : 2, s = t ? new SharedArrayBuffer(e * r) : new ArrayBuffer(e * r), a = i ? new Uint32Array(s) : new Uint16Array(s);
12323
12323
  for (let o = 0, c = a.length; o < c; o++)
12324
12324
  a[o] = o;
12325
12325
  return a;
12326
12326
  }
12327
- function kh(n, t, e, i, r) {
12327
+ function ku(n, t, e, i, r) {
12328
12328
  const {
12329
12329
  maxDepth: s,
12330
12330
  verbose: a,
12331
12331
  maxLeafTris: o,
12332
12332
  strategy: c,
12333
12333
  onProgress: l,
12334
- indirect: h
12335
- } = r, u = n._indirectBuffer, f = n.geometry, d = f.index ? f.index.array : null, y = h ? Mh : Ch, _ = si(f), p = new Float32Array(6);
12334
+ indirect: u
12335
+ } = r, h = n._indirectBuffer, f = n.geometry, d = f.index ? f.index.array : null, y = u ? Mu : Cu, _ = si(f), p = new Float32Array(6);
12336
12336
  let m = !1;
12337
12337
  const v = new En();
12338
12338
  return wn(t, e, i, v.boundingData, p), b(v, e, i, p), v;
@@ -12342,10 +12342,10 @@ function kh(n, t, e, i, r) {
12342
12342
  function b(x, S, T, P = null, M = 0) {
12343
12343
  if (!m && M >= s && (m = !0, a && (console.warn(`MeshBVH: Max depth of ${s} reached when generating BVH. Consider increasing maxDepth.`), console.warn(f))), T <= o || M >= s)
12344
12344
  return g(S + T), x.offset = S, x.count = T, x;
12345
- const C = Sh(x.boundingData, P, t, S, T, c);
12345
+ const C = Su(x.boundingData, P, t, S, T, c);
12346
12346
  if (C.axis === -1)
12347
12347
  return g(S + T), x.offset = S, x.count = T, x;
12348
- const E = y(u, d, t, S, T, C);
12348
+ const E = y(h, d, t, S, T, C);
12349
12349
  if (E === S || E === S + T)
12350
12350
  g(S + T), x.offset = S, x.count = T;
12351
12351
  else {
@@ -12358,15 +12358,15 @@ function kh(n, t, e, i, r) {
12358
12358
  return x;
12359
12359
  }
12360
12360
  }
12361
- function Rh(n, t) {
12361
+ function Ru(n, t) {
12362
12362
  const e = n.geometry;
12363
- t.indirect && (n._indirectBuffer = Eh(e, t.useSharedArrayBuffer), _h(e, t.range) && !t.verbose && console.warn(
12363
+ t.indirect && (n._indirectBuffer = Eu(e, t.useSharedArrayBuffer), _u(e, t.range) && !t.verbose && console.warn(
12364
12364
  'MeshBVH: Provided geometry contains groups or a range that do not fully span the vertex contents while using the "indirect" option. BVH may incorrectly report intersections on unrendered portions of the geometry.'
12365
- )), n._indirectBuffer || vh(e, t);
12366
- const i = t.useSharedArrayBuffer ? SharedArrayBuffer : ArrayBuffer, r = xh(e), s = t.indirect ? Ua(e, t.range) : Fa(e, t.range);
12365
+ )), n._indirectBuffer || vu(e, t);
12366
+ const i = t.useSharedArrayBuffer ? SharedArrayBuffer : ArrayBuffer, r = xu(e), s = t.indirect ? Ua(e, t.range) : Fa(e, t.range);
12367
12367
  n._roots = s.map((a) => {
12368
- const o = kh(n, r, a.offset, a.count, t), c = es(o), l = new i(Ei * c);
12369
- return wh(0, o, l), l;
12368
+ const o = ku(n, r, a.offset, a.count, t), c = es(o), l = new i(Ei * c);
12369
+ return wu(0, o, l), l;
12370
12370
  });
12371
12371
  }
12372
12372
  class ge {
@@ -12400,27 +12400,27 @@ ge.prototype.setFromBox = (function() {
12400
12400
  let a = 1 / 0, o = -1 / 0;
12401
12401
  for (let c = 0; c <= 1; c++)
12402
12402
  for (let l = 0; l <= 1; l++)
12403
- for (let h = 0; h <= 1; h++) {
12404
- n.x = r.x * c + s.x * (1 - c), n.y = r.y * l + s.y * (1 - l), n.z = r.z * h + s.z * (1 - h);
12405
- const u = e.dot(n);
12406
- a = Math.min(u, a), o = Math.max(u, o);
12403
+ for (let u = 0; u <= 1; u++) {
12404
+ n.x = r.x * c + s.x * (1 - c), n.y = r.y * l + s.y * (1 - l), n.z = r.z * u + s.z * (1 - u);
12405
+ const h = e.dot(n);
12406
+ a = Math.min(h, a), o = Math.max(h, o);
12407
12407
  }
12408
12408
  this.min = a, this.max = o;
12409
12409
  };
12410
12410
  })();
12411
- const Ah = (function() {
12411
+ const Au = (function() {
12412
12412
  const n = new N(), t = new N(), e = new N();
12413
12413
  return function(r, s, a) {
12414
- const o = r.start, c = n, l = s.start, h = t;
12414
+ const o = r.start, c = n, l = s.start, u = t;
12415
12415
  e.subVectors(o, l), n.subVectors(r.end, r.start), t.subVectors(s.end, s.start);
12416
- const u = e.dot(h), f = h.dot(c), d = h.dot(h), y = e.dot(c), p = c.dot(c) * d - f * f;
12416
+ const h = e.dot(u), f = u.dot(c), d = u.dot(u), y = e.dot(c), p = c.dot(c) * d - f * f;
12417
12417
  let m, v;
12418
- p !== 0 ? m = (u * f - y * d) / p : m = 0, v = (u + m * f) / d, a.x = m, a.y = v;
12418
+ p !== 0 ? m = (h * f - y * d) / p : m = 0, v = (h + m * f) / d, a.x = m, a.y = v;
12419
12419
  };
12420
12420
  })(), bs = (function() {
12421
12421
  const n = new Ke(), t = new N(), e = new N();
12422
12422
  return function(r, s, a, o) {
12423
- Ah(r, s, n);
12423
+ Au(r, s, n);
12424
12424
  let c = n.x, l = n.y;
12425
12425
  if (c >= 0 && c <= 1 && l >= 0 && l <= 1) {
12426
12426
  r.at(c, a), s.at(l, o);
@@ -12432,25 +12432,25 @@ const Ah = (function() {
12432
12432
  c < 0 ? r.at(0, a) : r.at(1, a), s.closestPointToPoint(a, !0, o);
12433
12433
  return;
12434
12434
  } else {
12435
- let h;
12436
- c < 0 ? h = r.start : h = r.end;
12437
12435
  let u;
12438
- l < 0 ? u = s.start : u = s.end;
12436
+ c < 0 ? u = r.start : u = r.end;
12437
+ let h;
12438
+ l < 0 ? h = s.start : h = s.end;
12439
12439
  const f = t, d = e;
12440
- if (r.closestPointToPoint(u, !0, t), s.closestPointToPoint(h, !0, e), f.distanceToSquared(u) <= d.distanceToSquared(h)) {
12441
- a.copy(f), o.copy(u);
12440
+ if (r.closestPointToPoint(h, !0, t), s.closestPointToPoint(u, !0, e), f.distanceToSquared(h) <= d.distanceToSquared(u)) {
12441
+ a.copy(f), o.copy(h);
12442
12442
  return;
12443
12443
  } else {
12444
- a.copy(h), o.copy(d);
12444
+ a.copy(u), o.copy(d);
12445
12445
  return;
12446
12446
  }
12447
12447
  }
12448
12448
  };
12449
- })(), zh = (function() {
12449
+ })(), zu = (function() {
12450
12450
  const n = new N(), t = new N(), e = new Io(), i = new me();
12451
12451
  return function(s, a) {
12452
- const { radius: o, center: c } = s, { a: l, b: h, c: u } = a;
12453
- if (i.start = l, i.end = h, i.closestPointToPoint(c, !0, n).distanceTo(c) <= o || (i.start = l, i.end = u, i.closestPointToPoint(c, !0, n).distanceTo(c) <= o) || (i.start = h, i.end = u, i.closestPointToPoint(c, !0, n).distanceTo(c) <= o)) return !0;
12452
+ const { radius: o, center: c } = s, { a: l, b: u, c: h } = a;
12453
+ if (i.start = l, i.end = u, i.closestPointToPoint(c, !0, n).distanceTo(c) <= o || (i.start = l, i.end = h, i.closestPointToPoint(c, !0, n).distanceTo(c) <= o) || (i.start = u, i.end = h, i.closestPointToPoint(c, !0, n).distanceTo(c) <= o)) return !0;
12454
12454
  const _ = a.getPlane(e);
12455
12455
  if (Math.abs(_.distanceToPoint(c)) <= o) {
12456
12456
  const m = _.projectPoint(c, t);
@@ -12458,24 +12458,24 @@ const Ah = (function() {
12458
12458
  }
12459
12459
  return !1;
12460
12460
  };
12461
- })(), Oh = 1e-15;
12461
+ })(), Ou = 1e-15;
12462
12462
  function kn(n) {
12463
- return Math.abs(n) < Oh;
12463
+ return Math.abs(n) < Ou;
12464
12464
  }
12465
12465
  class Ot extends Ue {
12466
12466
  constructor(...t) {
12467
12467
  super(...t), this.isExtendedTriangle = !0, this.satAxes = new Array(4).fill().map(() => new N()), this.satBounds = new Array(4).fill().map(() => new ge()), this.points = [this.a, this.b, this.c], this.sphere = new No(), this.plane = new Io(), this.needsUpdate = !0;
12468
12468
  }
12469
12469
  intersectsSphere(t) {
12470
- return zh(t, this);
12470
+ return zu(t, this);
12471
12471
  }
12472
12472
  update() {
12473
12473
  const t = this.a, e = this.b, i = this.c, r = this.points, s = this.satAxes, a = this.satBounds, o = s[0], c = a[0];
12474
12474
  this.getNormal(o), c.setFromPoints(o, r);
12475
- const l = s[1], h = a[1];
12476
- l.subVectors(t, e), h.setFromPoints(l, r);
12477
- const u = s[2], f = a[2];
12478
- u.subVectors(e, i), f.setFromPoints(u, r);
12475
+ const l = s[1], u = a[1];
12476
+ l.subVectors(t, e), u.setFromPoints(l, r);
12477
+ const h = s[2], f = a[2];
12478
+ h.subVectors(e, i), f.setFromPoints(h, r);
12479
12479
  const d = s[3], y = a[3];
12480
12480
  d.subVectors(i, t), y.setFromPoints(d, r), this.sphere.setFromPoints(this.points), this.plane.setFromNormalAndCoplanarPoint(o, t), this.needsUpdate = !1;
12481
12481
  }
@@ -12484,28 +12484,28 @@ Ot.prototype.closestPointToSegment = (function() {
12484
12484
  const n = new N(), t = new N(), e = new me();
12485
12485
  return function(r, s = null, a = null) {
12486
12486
  const { start: o, end: c } = r, l = this.points;
12487
- let h, u = 1 / 0;
12487
+ let u, h = 1 / 0;
12488
12488
  for (let f = 0; f < 3; f++) {
12489
12489
  const d = (f + 1) % 3;
12490
- e.start.copy(l[f]), e.end.copy(l[d]), bs(e, r, n, t), h = n.distanceToSquared(t), h < u && (u = h, s && s.copy(n), a && a.copy(t));
12490
+ e.start.copy(l[f]), e.end.copy(l[d]), bs(e, r, n, t), u = n.distanceToSquared(t), u < h && (h = u, s && s.copy(n), a && a.copy(t));
12491
12491
  }
12492
- return this.closestPointToPoint(o, n), h = o.distanceToSquared(n), h < u && (u = h, s && s.copy(n), a && a.copy(o)), this.closestPointToPoint(c, n), h = c.distanceToSquared(n), h < u && (u = h, s && s.copy(n), a && a.copy(c)), Math.sqrt(u);
12492
+ return this.closestPointToPoint(o, n), u = o.distanceToSquared(n), u < h && (h = u, s && s.copy(n), a && a.copy(o)), this.closestPointToPoint(c, n), u = c.distanceToSquared(n), u < h && (h = u, s && s.copy(n), a && a.copy(c)), Math.sqrt(h);
12493
12493
  };
12494
12494
  })();
12495
12495
  Ot.prototype.intersectsTriangle = (function() {
12496
- const n = new Ot(), t = new Array(3), e = new Array(3), i = new ge(), r = new ge(), s = new N(), a = new N(), o = new N(), c = new N(), l = new N(), h = new me(), u = new me(), f = new me(), d = new N();
12496
+ const n = new Ot(), t = new Array(3), e = new Array(3), i = new ge(), r = new ge(), s = new N(), a = new N(), o = new N(), c = new N(), l = new N(), u = new me(), h = new me(), f = new me(), d = new N();
12497
12497
  function y(_, p, m) {
12498
12498
  const v = _.points;
12499
12499
  let g = 0, b = -1;
12500
12500
  for (let x = 0; x < 3; x++) {
12501
- const { start: S, end: T } = h;
12502
- S.copy(v[x]), T.copy(v[(x + 1) % 3]), h.delta(a);
12501
+ const { start: S, end: T } = u;
12502
+ S.copy(v[x]), T.copy(v[(x + 1) % 3]), u.delta(a);
12503
12503
  const P = kn(p.distanceToPoint(S));
12504
12504
  if (kn(p.normal.dot(a)) && P) {
12505
- m.copy(h), g = 2;
12505
+ m.copy(u), g = 2;
12506
12506
  break;
12507
12507
  }
12508
- const M = p.intersectLine(h, d);
12508
+ const M = p.intersectLine(u, d);
12509
12509
  if (!M && P && d.copy(S), (M || P) && !kn(d.distanceTo(T))) {
12510
12510
  if (g <= 1)
12511
12511
  (g === 1 ? m.start : m.end).copy(d), P && (b = g);
@@ -12544,9 +12544,9 @@ Ot.prototype.intersectsTriangle = (function() {
12544
12544
  }
12545
12545
  return m && (v || console.warn("ExtendedTriangle.intersectsTriangle: Triangles are coplanar which does not support an output edge. Setting edge to 0, 0, 0."), m.start.set(0, 0, 0), m.end.set(0, 0, 0)), !0;
12546
12546
  } else {
12547
- const x = y(this, b, u);
12548
- if (x === 1 && p.containsPoint(u.end))
12549
- return m && (m.start.copy(u.end), m.end.copy(u.end)), !0;
12547
+ const x = y(this, b, h);
12548
+ if (x === 1 && p.containsPoint(h.end))
12549
+ return m && (m.start.copy(h.end), m.end.copy(h.end)), !0;
12550
12550
  if (x !== 2)
12551
12551
  return !1;
12552
12552
  const S = y(p, g, f);
@@ -12554,12 +12554,12 @@ Ot.prototype.intersectsTriangle = (function() {
12554
12554
  return m && (m.start.copy(f.end), m.end.copy(f.end)), !0;
12555
12555
  if (S !== 2)
12556
12556
  return !1;
12557
- if (u.delta(o), f.delta(c), o.dot(c) < 0) {
12557
+ if (h.delta(o), f.delta(c), o.dot(c) < 0) {
12558
12558
  let k = f.start;
12559
12559
  f.start = f.end, f.end = k;
12560
12560
  }
12561
- const T = u.start.dot(o), P = u.end.dot(o), M = f.start.dot(o), C = f.end.dot(o), E = P < M, w = T < C;
12562
- return T !== C && M !== P && E === w ? !1 : (m && (l.subVectors(u.start, f.start), l.dot(o) > 0 ? m.start.copy(u.start) : m.start.copy(f.start), l.subVectors(u.end, f.end), l.dot(o) < 0 ? m.end.copy(u.end) : m.end.copy(f.end)), !0);
12561
+ const T = h.start.dot(o), P = h.end.dot(o), M = f.start.dot(o), C = f.end.dot(o), E = P < M, w = T < C;
12562
+ return T !== C && M !== P && E === w ? !1 : (m && (l.subVectors(h.start, f.start), l.dot(o) > 0 ? m.start.copy(h.start) : m.start.copy(f.start), l.subVectors(h.end, f.end), l.dot(o) < 0 ? m.end.copy(h.end) : m.end.copy(f.end)), !0);
12563
12563
  }
12564
12564
  };
12565
12565
  })();
@@ -12575,25 +12575,25 @@ Ot.prototype.distanceToTriangle = (function() {
12575
12575
  const l = o || c ? i : null;
12576
12576
  if (this.intersectsTriangle(a, l))
12577
12577
  return (o || c) && (o && l.getCenter(o), c && l.getCenter(c)), 0;
12578
- let h = 1 / 0;
12579
- for (let u = 0; u < 3; u++) {
12578
+ let u = 1 / 0;
12579
+ for (let h = 0; h < 3; h++) {
12580
12580
  let f;
12581
- const d = e[u], y = a[d];
12582
- this.closestPointToPoint(y, n), f = y.distanceToSquared(n), f < h && (h = f, o && o.copy(n), c && c.copy(y));
12581
+ const d = e[h], y = a[d];
12582
+ this.closestPointToPoint(y, n), f = y.distanceToSquared(n), f < u && (u = f, o && o.copy(n), c && c.copy(y));
12583
12583
  const _ = this[d];
12584
- a.closestPointToPoint(_, n), f = _.distanceToSquared(n), f < h && (h = f, o && o.copy(_), c && c.copy(n));
12584
+ a.closestPointToPoint(_, n), f = _.distanceToSquared(n), f < u && (u = f, o && o.copy(_), c && c.copy(n));
12585
12585
  }
12586
- for (let u = 0; u < 3; u++) {
12587
- const f = e[u], d = e[(u + 1) % 3];
12586
+ for (let h = 0; h < 3; h++) {
12587
+ const f = e[h], d = e[(h + 1) % 3];
12588
12588
  i.set(this[f], this[d]);
12589
12589
  for (let y = 0; y < 3; y++) {
12590
12590
  const _ = e[y], p = e[(y + 1) % 3];
12591
12591
  r.set(a[_], a[p]), bs(i, r, n, t);
12592
12592
  const m = n.distanceToSquared(t);
12593
- m < h && (h = m, o && o.copy(n), c && c.copy(t));
12593
+ m < u && (u = m, o && o.copy(n), c && c.copy(t));
12594
12594
  }
12595
12595
  }
12596
- return Math.sqrt(h);
12596
+ return Math.sqrt(u);
12597
12597
  };
12598
12598
  })();
12599
12599
  class pt {
@@ -12611,15 +12611,15 @@ pt.prototype.update = /* @__PURE__ */ (function() {
12611
12611
  return function() {
12612
12612
  const t = this.matrix, e = this.min, i = this.max, r = this.points;
12613
12613
  for (let l = 0; l <= 1; l++)
12614
- for (let h = 0; h <= 1; h++)
12615
- for (let u = 0; u <= 1; u++) {
12616
- const f = 1 * l | 2 * h | 4 * u, d = r[f];
12617
- d.x = l ? i.x : e.x, d.y = h ? i.y : e.y, d.z = u ? i.z : e.z, d.applyMatrix4(t);
12614
+ for (let u = 0; u <= 1; u++)
12615
+ for (let h = 0; h <= 1; h++) {
12616
+ const f = 1 * l | 2 * u | 4 * h, d = r[f];
12617
+ d.x = l ? i.x : e.x, d.y = u ? i.y : e.y, d.z = h ? i.z : e.z, d.applyMatrix4(t);
12618
12618
  }
12619
12619
  const s = this.satBounds, a = this.satAxes, o = r[0];
12620
12620
  for (let l = 0; l < 3; l++) {
12621
- const h = a[l], u = s[l], f = 1 << l, d = r[f];
12622
- h.subVectors(o, d), u.setFromPoints(h, r);
12621
+ const u = a[l], h = s[l], f = 1 << l, d = r[f];
12622
+ u.subVectors(o, d), h.setFromPoints(u, r);
12623
12623
  }
12624
12624
  const c = this.alignedSatBounds;
12625
12625
  c[0].setFromPointsField(r, "x"), c[1].setFromPointsField(r, "y"), c[2].setFromPointsField(r, "z"), this.invMatrix.copy(this.matrix).invert(), this.needsUpdate = !1;
@@ -12632,8 +12632,8 @@ pt.prototype.intersectsBox = (function() {
12632
12632
  const i = e.min, r = e.max, s = this.satBounds, a = this.satAxes, o = this.alignedSatBounds;
12633
12633
  if (n.min = i.x, n.max = r.x, o[0].isSeparated(n) || (n.min = i.y, n.max = r.y, o[1].isSeparated(n)) || (n.min = i.z, n.max = r.z, o[2].isSeparated(n))) return !1;
12634
12634
  for (let c = 0; c < 3; c++) {
12635
- const l = a[c], h = s[c];
12636
- if (n.setFromBox(l, e), h.isSeparated(n)) return !1;
12635
+ const l = a[c], u = s[c];
12636
+ if (n.setFromBox(l, e), u.isSeparated(n)) return !1;
12637
12637
  }
12638
12638
  return !0;
12639
12639
  };
@@ -12648,16 +12648,16 @@ pt.prototype.intersectsTriangle = (function() {
12648
12648
  const d = o[f], y = c[f];
12649
12649
  if (e.setFromPoints(y, t), d.isSeparated(e)) return !1;
12650
12650
  }
12651
- const l = a.satBounds, h = a.satAxes, u = this.points;
12651
+ const l = a.satBounds, u = a.satAxes, h = this.points;
12652
12652
  for (let f = 0; f < 3; f++) {
12653
- const d = l[f], y = h[f];
12654
- if (e.setFromPoints(y, u), d.isSeparated(e)) return !1;
12653
+ const d = l[f], y = u[f];
12654
+ if (e.setFromPoints(y, h), d.isSeparated(e)) return !1;
12655
12655
  }
12656
12656
  for (let f = 0; f < 3; f++) {
12657
12657
  const d = c[f];
12658
12658
  for (let y = 0; y < 4; y++) {
12659
- const _ = h[y];
12660
- if (r.crossVectors(d, _), e.setFromPoints(r, t), i.setFromPoints(r, u), e.isSeparated(i)) return !1;
12659
+ const _ = u[y];
12660
+ if (r.crossVectors(d, _), e.setFromPoints(r, t), i.setFromPoints(r, h), e.isSeparated(i)) return !1;
12661
12661
  }
12662
12662
  }
12663
12663
  return !0;
@@ -12679,13 +12679,13 @@ pt.prototype.distanceToBox = (function() {
12679
12679
  return function(a, o = 0, c = null, l = null) {
12680
12680
  if (this.needsUpdate && this.update(), this.intersectsBox(a))
12681
12681
  return (c || l) && (a.getCenter(r), this.closestPointToPoint(r, i), a.closestPointToPoint(i, r), c && c.copy(i), l && l.copy(r)), 0;
12682
- const h = o * o, u = a.min, f = a.max, d = this.points;
12682
+ const u = o * o, h = a.min, f = a.max, d = this.points;
12683
12683
  let y = 1 / 0;
12684
12684
  for (let p = 0; p < 8; p++) {
12685
12685
  const m = d[p];
12686
- r.copy(m).clamp(u, f);
12686
+ r.copy(m).clamp(h, f);
12687
12687
  const v = m.distanceToSquared(r);
12688
- if (v < y && (y = v, c && c.copy(m), l && l.copy(r), v < h))
12688
+ if (v < y && (y = v, c && c.copy(m), l && l.copy(r), v < u))
12689
12689
  return Math.sqrt(v);
12690
12690
  }
12691
12691
  let _ = 0;
@@ -12695,14 +12695,14 @@ pt.prototype.distanceToBox = (function() {
12695
12695
  const g = (p + 1) % 3, b = (p + 2) % 3, x = m << g | v << b, S = 1 << p | m << g | v << b, T = d[x], P = d[S];
12696
12696
  t[_].set(T, P);
12697
12697
  const C = n[p], E = n[g], w = n[b], k = e[_], R = k.start, z = k.end;
12698
- R[C] = u[C], R[E] = m ? u[E] : f[E], R[w] = v ? u[w] : f[E], z[C] = f[C], z[E] = m ? u[E] : f[E], z[w] = v ? u[w] : f[E], _++;
12698
+ R[C] = h[C], R[E] = m ? h[E] : f[E], R[w] = v ? h[w] : f[E], z[C] = f[C], z[E] = m ? h[E] : f[E], z[w] = v ? h[w] : f[E], _++;
12699
12699
  }
12700
12700
  for (let p = 0; p <= 1; p++)
12701
12701
  for (let m = 0; m <= 1; m++)
12702
12702
  for (let v = 0; v <= 1; v++) {
12703
- r.x = p ? f.x : u.x, r.y = m ? f.y : u.y, r.z = v ? f.z : u.z, this.closestPointToPoint(r, i);
12703
+ r.x = p ? f.x : h.x, r.y = m ? f.y : h.y, r.z = v ? f.z : h.z, this.closestPointToPoint(r, i);
12704
12704
  const g = r.distanceToSquared(i);
12705
- if (g < y && (y = g, c && c.copy(i), l && l.copy(r), g < h))
12705
+ if (g < y && (y = g, c && c.copy(i), l && l.copy(r), g < u))
12706
12706
  return Math.sqrt(g);
12707
12707
  }
12708
12708
  for (let p = 0; p < 12; p++) {
@@ -12711,7 +12711,7 @@ pt.prototype.distanceToBox = (function() {
12711
12711
  const g = e[v];
12712
12712
  bs(m, g, i, r);
12713
12713
  const b = i.distanceToSquared(r);
12714
- if (b < y && (y = b, c && c.copy(i), l && l.copy(r), b < h))
12714
+ if (b < y && (y = b, c && c.copy(i), l && l.copy(r), b < u))
12715
12715
  return Math.sqrt(b);
12716
12716
  }
12717
12717
  }
@@ -12730,13 +12730,13 @@ class Ss {
12730
12730
  this._primitives.push(t);
12731
12731
  }
12732
12732
  }
12733
- class Bh extends Ss {
12733
+ class Bu extends Ss {
12734
12734
  constructor() {
12735
12735
  super(() => new Ot());
12736
12736
  }
12737
12737
  }
12738
- const zt = /* @__PURE__ */ new Bh();
12739
- class Ih {
12738
+ const zt = /* @__PURE__ */ new Bu();
12739
+ class Iu {
12740
12740
  constructor() {
12741
12741
  this.float32Array = null, this.uint16Array = null, this.uint32Array = null;
12742
12742
  const t = [];
@@ -12748,10 +12748,10 @@ class Ih {
12748
12748
  };
12749
12749
  }
12750
12750
  }
12751
- const q = new Ih();
12751
+ const q = new Iu();
12752
12752
  let Ce, Ze;
12753
12753
  const Ge = [], Sr = /* @__PURE__ */ new Ss(() => new te());
12754
- function Nh(n, t, e, i, r, s) {
12754
+ function Nu(n, t, e, i, r, s) {
12755
12755
  Ce = Sr.getPrimitive(), Ze = Sr.getPrimitive(), Ge.push(Ce, Ze), q.setBuffer(n._roots[t]);
12756
12756
  const a = rs(0, n.geometry, e, i, r, s);
12757
12757
  q.clearBuffer(), Sr.releasePrimitive(Ce), Sr.releasePrimitive(Ze), Ge.pop(), Ge.pop();
@@ -12760,9 +12760,9 @@ function Nh(n, t, e, i, r, s) {
12760
12760
  }
12761
12761
  function rs(n, t, e, i, r = null, s = 0, a = 0) {
12762
12762
  const { float32Array: o, uint16Array: c, uint32Array: l } = q;
12763
- let h = n * 2;
12764
- if (Tt(h, c)) {
12765
- const f = Pt(n, l), d = kt(h, c);
12763
+ let u = n * 2;
12764
+ if (Tt(u, c)) {
12765
+ const f = Pt(n, l), d = kt(u, c);
12766
12766
  return Z(n, o, Ce), i(f, d, !1, a, s + n, Ce);
12767
12767
  } else {
12768
12768
  let C = function(w) {
@@ -12822,25 +12822,25 @@ function rs(n, t, e, i, r = null, s = 0, a = 0) {
12822
12822
  }
12823
12823
  }
12824
12824
  const pi = /* @__PURE__ */ new N(), Rn = /* @__PURE__ */ new N();
12825
- function Uh(n, t, e = {}, i = 0, r = 1 / 0) {
12825
+ function Uu(n, t, e = {}, i = 0, r = 1 / 0) {
12826
12826
  const s = i * i, a = r * r;
12827
12827
  let o = 1 / 0, c = null;
12828
12828
  if (n.shapecast(
12829
12829
  {
12830
- boundsTraverseOrder: (h) => (pi.copy(t).clamp(h.min, h.max), pi.distanceToSquared(t)),
12831
- intersectsBounds: (h, u, f) => f < o && f < a,
12832
- intersectsTriangle: (h, u) => {
12833
- h.closestPointToPoint(t, pi);
12830
+ boundsTraverseOrder: (u) => (pi.copy(t).clamp(u.min, u.max), pi.distanceToSquared(t)),
12831
+ intersectsBounds: (u, h, f) => f < o && f < a,
12832
+ intersectsTriangle: (u, h) => {
12833
+ u.closestPointToPoint(t, pi);
12834
12834
  const f = t.distanceToSquared(pi);
12835
- return f < o && (Rn.copy(pi), o = f, c = u), f < s;
12835
+ return f < o && (Rn.copy(pi), o = f, c = h), f < s;
12836
12836
  }
12837
12837
  }
12838
12838
  ), o === 1 / 0) return null;
12839
12839
  const l = Math.sqrt(o);
12840
12840
  return e.point ? e.point.copy(Rn) : e.point = Rn.clone(), e.distance = l, e.faceIndex = c, e;
12841
12841
  }
12842
- const Fh = parseInt(Ha) >= 169, Re = /* @__PURE__ */ new N(), Ae = /* @__PURE__ */ new N(), ze = /* @__PURE__ */ new N(), Tr = /* @__PURE__ */ new Ke(), Cr = /* @__PURE__ */ new Ke(), Mr = /* @__PURE__ */ new Ke(), yo = /* @__PURE__ */ new N(), go = /* @__PURE__ */ new N(), vo = /* @__PURE__ */ new N(), mi = /* @__PURE__ */ new N();
12843
- function Dh(n, t, e, i, r, s, a, o) {
12842
+ const Fu = parseInt(Ha) >= 169, Re = /* @__PURE__ */ new N(), Ae = /* @__PURE__ */ new N(), ze = /* @__PURE__ */ new N(), Tr = /* @__PURE__ */ new Ke(), Cr = /* @__PURE__ */ new Ke(), Mr = /* @__PURE__ */ new Ke(), yo = /* @__PURE__ */ new N(), go = /* @__PURE__ */ new N(), vo = /* @__PURE__ */ new N(), mi = /* @__PURE__ */ new N();
12843
+ function Du(n, t, e, i, r, s, a, o) {
12844
12844
  let c;
12845
12845
  if (s === Xa ? c = n.intersectTriangle(i, e, t, !0, r) : c = n.intersectTriangle(t, e, i, s !== Fn, r), c === null) return null;
12846
12846
  const l = n.origin.distanceTo(r);
@@ -12849,12 +12849,12 @@ function Dh(n, t, e, i, r, s, a, o) {
12849
12849
  point: r.clone()
12850
12850
  };
12851
12851
  }
12852
- function Lh(n, t, e, i, r, s, a, o, c, l, h) {
12852
+ function Lu(n, t, e, i, r, s, a, o, c, l, u) {
12853
12853
  Re.fromBufferAttribute(t, s), Ae.fromBufferAttribute(t, a), ze.fromBufferAttribute(t, o);
12854
- const u = Dh(n, Re, Ae, ze, mi, c, l, h);
12855
- if (u) {
12854
+ const h = Du(n, Re, Ae, ze, mi, c, l, u);
12855
+ if (h) {
12856
12856
  const f = new N();
12857
- Ue.getBarycoord(mi, Re, Ae, ze, f), i && (Tr.fromBufferAttribute(i, s), Cr.fromBufferAttribute(i, a), Mr.fromBufferAttribute(i, o), u.uv = Ue.getInterpolation(mi, Re, Ae, ze, Tr, Cr, Mr, new Ke())), r && (Tr.fromBufferAttribute(r, s), Cr.fromBufferAttribute(r, a), Mr.fromBufferAttribute(r, o), u.uv1 = Ue.getInterpolation(mi, Re, Ae, ze, Tr, Cr, Mr, new Ke())), e && (yo.fromBufferAttribute(e, s), go.fromBufferAttribute(e, a), vo.fromBufferAttribute(e, o), u.normal = Ue.getInterpolation(mi, Re, Ae, ze, yo, go, vo, new N()), u.normal.dot(n.direction) > 0 && u.normal.multiplyScalar(-1));
12857
+ Ue.getBarycoord(mi, Re, Ae, ze, f), i && (Tr.fromBufferAttribute(i, s), Cr.fromBufferAttribute(i, a), Mr.fromBufferAttribute(i, o), h.uv = Ue.getInterpolation(mi, Re, Ae, ze, Tr, Cr, Mr, new Ke())), r && (Tr.fromBufferAttribute(r, s), Cr.fromBufferAttribute(r, a), Mr.fromBufferAttribute(r, o), h.uv1 = Ue.getInterpolation(mi, Re, Ae, ze, Tr, Cr, Mr, new Ke())), e && (yo.fromBufferAttribute(e, s), go.fromBufferAttribute(e, a), vo.fromBufferAttribute(e, o), h.normal = Ue.getInterpolation(mi, Re, Ae, ze, yo, go, vo, new N()), h.normal.dot(n.direction) > 0 && h.normal.multiplyScalar(-1));
12858
12858
  const d = {
12859
12859
  a: s,
12860
12860
  b: a,
@@ -12862,16 +12862,16 @@ function Lh(n, t, e, i, r, s, a, o, c, l, h) {
12862
12862
  normal: new N(),
12863
12863
  materialIndex: 0
12864
12864
  };
12865
- Ue.getNormal(Re, Ae, ze, d.normal), u.face = d, u.faceIndex = s, Fh && (u.barycoord = f);
12865
+ Ue.getNormal(Re, Ae, ze, d.normal), h.face = d, h.faceIndex = s, Fu && (h.barycoord = f);
12866
12866
  }
12867
- return u;
12867
+ return h;
12868
12868
  }
12869
12869
  function nn(n, t, e, i, r, s, a) {
12870
12870
  const o = i * 3;
12871
- let c = o + 0, l = o + 1, h = o + 2;
12872
- const u = n.index;
12873
- n.index && (c = u.getX(c), l = u.getX(l), h = u.getX(h));
12874
- const { position: f, normal: d, uv: y, uv1: _ } = n.attributes, p = Lh(e, f, d, y, _, c, l, h, t, s, a);
12871
+ let c = o + 0, l = o + 1, u = o + 2;
12872
+ const h = n.index;
12873
+ n.index && (c = h.getX(c), l = h.getX(l), u = h.getX(u));
12874
+ const { position: f, normal: d, uv: y, uv1: _ } = n.attributes, p = Lu(e, f, d, y, _, c, l, u, t, s, a);
12875
12875
  return p ? (p.faceIndex = i, r && r.push(p), p) : null;
12876
12876
  }
12877
12877
  function it(n, t, e, i) {
@@ -12879,37 +12879,37 @@ function it(n, t, e, i) {
12879
12879
  let o = t, c = t + 1, l = t + 2;
12880
12880
  e && (o = e.getX(o), c = e.getX(c), l = e.getX(l)), r.x = i.getX(o), r.y = i.getY(o), r.z = i.getZ(o), s.x = i.getX(c), s.y = i.getY(c), s.z = i.getZ(c), a.x = i.getX(l), a.y = i.getY(l), a.z = i.getZ(l);
12881
12881
  }
12882
- function Vh(n, t, e, i, r, s, a, o) {
12882
+ function Vu(n, t, e, i, r, s, a, o) {
12883
12883
  const { geometry: c, _indirectBuffer: l } = n;
12884
- for (let h = i, u = i + r; h < u; h++)
12885
- nn(c, t, e, h, s, a, o);
12884
+ for (let u = i, h = i + r; u < h; u++)
12885
+ nn(c, t, e, u, s, a, o);
12886
12886
  }
12887
- function Jh(n, t, e, i, r, s, a) {
12887
+ function Ju(n, t, e, i, r, s, a) {
12888
12888
  const { geometry: o, _indirectBuffer: c } = n;
12889
- let l = 1 / 0, h = null;
12890
- for (let u = i, f = i + r; u < f; u++) {
12889
+ let l = 1 / 0, u = null;
12890
+ for (let h = i, f = i + r; h < f; h++) {
12891
12891
  let d;
12892
- d = nn(o, t, e, u, null, s, a), d && d.distance < l && (h = d, l = d.distance);
12892
+ d = nn(o, t, e, h, null, s, a), d && d.distance < l && (u = d, l = d.distance);
12893
12893
  }
12894
- return h;
12894
+ return u;
12895
12895
  }
12896
- function Gh(n, t, e, i, r, s, a) {
12896
+ function Gu(n, t, e, i, r, s, a) {
12897
12897
  const { geometry: o } = e, { index: c } = o, l = o.attributes.position;
12898
- for (let h = n, u = t + n; h < u; h++) {
12898
+ for (let u = n, h = t + n; u < h; u++) {
12899
12899
  let f;
12900
- if (f = h, it(a, f * 3, c, l), a.needsUpdate = !0, i(a, f, r, s))
12900
+ if (f = u, it(a, f * 3, c, l), a.needsUpdate = !0, i(a, f, r, s))
12901
12901
  return !0;
12902
12902
  }
12903
12903
  return !1;
12904
12904
  }
12905
- function jh(n, t = null) {
12905
+ function ju(n, t = null) {
12906
12906
  t && Array.isArray(t) && (t = new Set(t));
12907
12907
  const e = n.geometry, i = e.index ? e.index.array : null, r = e.attributes.position;
12908
12908
  let s, a, o, c, l = 0;
12909
- const h = n._roots;
12910
- for (let f = 0, d = h.length; f < d; f++)
12911
- s = h[f], a = new Uint32Array(s), o = new Uint16Array(s), c = new Float32Array(s), u(0, l), l += s.byteLength;
12912
- function u(f, d, y = !1) {
12909
+ const u = n._roots;
12910
+ for (let f = 0, d = u.length; f < d; f++)
12911
+ s = u[f], a = new Uint32Array(s), o = new Uint16Array(s), c = new Float32Array(s), h(0, l), l += s.byteLength;
12912
+ function h(f, d, y = !1) {
12913
12913
  const _ = f * 2;
12914
12914
  if (o[_ + 15] === rn) {
12915
12915
  const m = a[f + 6], v = o[_ + 14];
@@ -12926,9 +12926,9 @@ function jh(n, t = null) {
12926
12926
  t ? x || (S = t.has(g), T = t.has(b), x = !S && !T) : (S = !0, T = !0);
12927
12927
  const P = x || S, M = x || T;
12928
12928
  let C = !1;
12929
- P && (C = u(m, d, x));
12929
+ P && (C = h(m, d, x));
12930
12930
  let E = !1;
12931
- M && (E = u(v, d, x));
12931
+ M && (E = h(v, d, x));
12932
12932
  const w = C || E;
12933
12933
  if (w)
12934
12934
  for (let k = 0; k < 3; k++) {
@@ -12940,44 +12940,44 @@ function jh(n, t = null) {
12940
12940
  }
12941
12941
  }
12942
12942
  function Me(n, t, e, i, r) {
12943
- let s, a, o, c, l, h;
12944
- const u = 1 / e.direction.x, f = 1 / e.direction.y, d = 1 / e.direction.z, y = e.origin.x, _ = e.origin.y, p = e.origin.z;
12943
+ let s, a, o, c, l, u;
12944
+ const h = 1 / e.direction.x, f = 1 / e.direction.y, d = 1 / e.direction.z, y = e.origin.x, _ = e.origin.y, p = e.origin.z;
12945
12945
  let m = t[n], v = t[n + 3], g = t[n + 1], b = t[n + 3 + 1], x = t[n + 2], S = t[n + 3 + 2];
12946
- return u >= 0 ? (s = (m - y) * u, a = (v - y) * u) : (s = (v - y) * u, a = (m - y) * u), f >= 0 ? (o = (g - _) * f, c = (b - _) * f) : (o = (b - _) * f, c = (g - _) * f), s > c || o > a || ((o > s || isNaN(s)) && (s = o), (c < a || isNaN(a)) && (a = c), d >= 0 ? (l = (x - p) * d, h = (S - p) * d) : (l = (S - p) * d, h = (x - p) * d), s > h || l > a) ? !1 : ((l > s || s !== s) && (s = l), (h < a || a !== a) && (a = h), s <= r && a >= i);
12946
+ return h >= 0 ? (s = (m - y) * h, a = (v - y) * h) : (s = (v - y) * h, a = (m - y) * h), f >= 0 ? (o = (g - _) * f, c = (b - _) * f) : (o = (b - _) * f, c = (g - _) * f), s > c || o > a || ((o > s || isNaN(s)) && (s = o), (c < a || isNaN(a)) && (a = c), d >= 0 ? (l = (x - p) * d, u = (S - p) * d) : (l = (S - p) * d, u = (x - p) * d), s > u || l > a) ? !1 : ((l > s || s !== s) && (s = l), (u < a || a !== a) && (a = u), s <= r && a >= i);
12947
12947
  }
12948
- function $h(n, t, e, i, r, s, a, o) {
12948
+ function $u(n, t, e, i, r, s, a, o) {
12949
12949
  const { geometry: c, _indirectBuffer: l } = n;
12950
- for (let h = i, u = i + r; h < u; h++) {
12951
- let f = l ? l[h] : h;
12950
+ for (let u = i, h = i + r; u < h; u++) {
12951
+ let f = l ? l[u] : u;
12952
12952
  nn(c, t, e, f, s, a, o);
12953
12953
  }
12954
12954
  }
12955
- function qh(n, t, e, i, r, s, a) {
12955
+ function qu(n, t, e, i, r, s, a) {
12956
12956
  const { geometry: o, _indirectBuffer: c } = n;
12957
- let l = 1 / 0, h = null;
12958
- for (let u = i, f = i + r; u < f; u++) {
12957
+ let l = 1 / 0, u = null;
12958
+ for (let h = i, f = i + r; h < f; h++) {
12959
12959
  let d;
12960
- d = nn(o, t, e, c ? c[u] : u, null, s, a), d && d.distance < l && (h = d, l = d.distance);
12960
+ d = nn(o, t, e, c ? c[h] : h, null, s, a), d && d.distance < l && (u = d, l = d.distance);
12961
12961
  }
12962
- return h;
12962
+ return u;
12963
12963
  }
12964
- function Xh(n, t, e, i, r, s, a) {
12964
+ function Xu(n, t, e, i, r, s, a) {
12965
12965
  const { geometry: o } = e, { index: c } = o, l = o.attributes.position;
12966
- for (let h = n, u = t + n; h < u; h++) {
12966
+ for (let u = n, h = t + n; u < h; u++) {
12967
12967
  let f;
12968
- if (f = e.resolveTriangleIndex(h), it(a, f * 3, c, l), a.needsUpdate = !0, i(a, f, r, s))
12968
+ if (f = e.resolveTriangleIndex(u), it(a, f * 3, c, l), a.needsUpdate = !0, i(a, f, r, s))
12969
12969
  return !0;
12970
12970
  }
12971
12971
  return !1;
12972
12972
  }
12973
- function Hh(n, t, e, i, r, s, a) {
12973
+ function Hu(n, t, e, i, r, s, a) {
12974
12974
  q.setBuffer(n._roots[t]), ns(0, n, e, i, r, s, a), q.clearBuffer();
12975
12975
  }
12976
12976
  function ns(n, t, e, i, r, s, a) {
12977
- const { float32Array: o, uint16Array: c, uint32Array: l } = q, h = n * 2;
12978
- if (Tt(h, c)) {
12979
- const f = Pt(n, l), d = kt(h, c);
12980
- Vh(t, e, i, f, d, r, s, a);
12977
+ const { float32Array: o, uint16Array: c, uint32Array: l } = q, u = n * 2;
12978
+ if (Tt(u, c)) {
12979
+ const f = Pt(n, l), d = kt(u, c);
12980
+ Vu(t, e, i, f, d, r, s, a);
12981
12981
  } else {
12982
12982
  const f = Rt(n);
12983
12983
  Me(f, o, i, s, a) && ns(f, t, e, i, r, s, a);
@@ -12985,8 +12985,8 @@ function ns(n, t, e, i, r, s, a) {
12985
12985
  Me(d, o, i, s, a) && ns(d, t, e, i, r, s, a);
12986
12986
  }
12987
12987
  }
12988
- const Wh = ["x", "y", "z"];
12989
- function Yh(n, t, e, i, r, s) {
12988
+ const Wu = ["x", "y", "z"];
12989
+ function Yu(n, t, e, i, r, s) {
12990
12990
  q.setBuffer(n._roots[t]);
12991
12991
  const a = ss(0, n, e, i, r, s);
12992
12992
  return q.clearBuffer(), a;
@@ -12995,18 +12995,18 @@ function ss(n, t, e, i, r, s) {
12995
12995
  const { float32Array: a, uint16Array: o, uint32Array: c } = q;
12996
12996
  let l = n * 2;
12997
12997
  if (Tt(l, o)) {
12998
- const u = Pt(n, c), f = kt(l, o);
12999
- return Jh(t, e, i, u, f, r, s);
12998
+ const h = Pt(n, c), f = kt(l, o);
12999
+ return Ju(t, e, i, h, f, r, s);
13000
13000
  } else {
13001
- const u = Da(n, c), f = Wh[u], y = i.direction[f] >= 0;
13001
+ const h = Da(n, c), f = Wu[h], y = i.direction[f] >= 0;
13002
13002
  let _, p;
13003
13003
  y ? (_ = Rt(n), p = At(n, c)) : (_ = At(n, c), p = Rt(n));
13004
13004
  const v = Me(_, a, i, r, s) ? ss(_, t, e, i, r, s) : null;
13005
13005
  if (v) {
13006
13006
  const x = v.point[f];
13007
- if (y ? x <= a[p + u] : (
13007
+ if (y ? x <= a[p + h] : (
13008
13008
  // min bounding data
13009
- x >= a[p + u + 3]
13009
+ x >= a[p + h + 3]
13010
13010
  ))
13011
13011
  return v;
13012
13012
  }
@@ -13015,7 +13015,7 @@ function ss(n, t, e, i, r, s) {
13015
13015
  }
13016
13016
  }
13017
13017
  const Pr = /* @__PURE__ */ new te(), je = /* @__PURE__ */ new Ot(), $e = /* @__PURE__ */ new Ot(), yi = /* @__PURE__ */ new Gt(), _o = /* @__PURE__ */ new pt(), wr = /* @__PURE__ */ new pt();
13018
- function Zh(n, t, e, i) {
13018
+ function Zu(n, t, e, i) {
13019
13019
  q.setBuffer(n._roots[t]);
13020
13020
  const r = os(0, n, e, i);
13021
13021
  return q.clearBuffer(), r;
@@ -13024,35 +13024,35 @@ function os(n, t, e, i, r = null) {
13024
13024
  const { float32Array: s, uint16Array: a, uint32Array: o } = q;
13025
13025
  let c = n * 2;
13026
13026
  if (r === null && (e.boundingBox || e.computeBoundingBox(), _o.set(e.boundingBox.min, e.boundingBox.max, i), r = _o), Tt(c, a)) {
13027
- const h = t.geometry, u = h.index, f = h.attributes.position, d = e.index, y = e.attributes.position, _ = Pt(n, o), p = kt(c, a);
13027
+ const u = t.geometry, h = u.index, f = u.attributes.position, d = e.index, y = e.attributes.position, _ = Pt(n, o), p = kt(c, a);
13028
13028
  if (yi.copy(i).invert(), e.boundsTree)
13029
13029
  return Z(n, s, wr), wr.matrix.copy(yi), wr.needsUpdate = !0, e.boundsTree.shapecast({
13030
13030
  intersectsBounds: (v) => wr.intersectsBox(v),
13031
13031
  intersectsTriangle: (v) => {
13032
13032
  v.a.applyMatrix4(i), v.b.applyMatrix4(i), v.c.applyMatrix4(i), v.needsUpdate = !0;
13033
13033
  for (let g = _ * 3, b = (p + _) * 3; g < b; g += 3)
13034
- if (it($e, g, u, f), $e.needsUpdate = !0, v.intersectsTriangle($e))
13034
+ if (it($e, g, h, f), $e.needsUpdate = !0, v.intersectsTriangle($e))
13035
13035
  return !0;
13036
13036
  return !1;
13037
13037
  }
13038
13038
  });
13039
13039
  for (let m = _ * 3, v = (p + _) * 3; m < v; m += 3) {
13040
- it(je, m, u, f), je.a.applyMatrix4(yi), je.b.applyMatrix4(yi), je.c.applyMatrix4(yi), je.needsUpdate = !0;
13040
+ it(je, m, h, f), je.a.applyMatrix4(yi), je.b.applyMatrix4(yi), je.c.applyMatrix4(yi), je.needsUpdate = !0;
13041
13041
  for (let g = 0, b = d.count; g < b; g += 3)
13042
13042
  if (it($e, g, d, y), $e.needsUpdate = !0, je.intersectsTriangle($e))
13043
13043
  return !0;
13044
13044
  }
13045
13045
  } else {
13046
- const h = n + 8, u = o[n + 6];
13047
- return Z(h, s, Pr), !!(r.intersectsBox(Pr) && os(h, t, e, i, r) || (Z(u, s, Pr), r.intersectsBox(Pr) && os(u, t, e, i, r)));
13046
+ const u = n + 8, h = o[n + 6];
13047
+ return Z(u, s, Pr), !!(r.intersectsBox(Pr) && os(u, t, e, i, r) || (Z(h, s, Pr), r.intersectsBox(Pr) && os(h, t, e, i, r)));
13048
13048
  }
13049
13049
  }
13050
- const Er = /* @__PURE__ */ new Gt(), An = /* @__PURE__ */ new pt(), gi = /* @__PURE__ */ new pt(), Kh = /* @__PURE__ */ new N(), Qh = /* @__PURE__ */ new N(), tu = /* @__PURE__ */ new N(), eu = /* @__PURE__ */ new N();
13051
- function iu(n, t, e, i = {}, r = {}, s = 0, a = 1 / 0) {
13050
+ const Er = /* @__PURE__ */ new Gt(), An = /* @__PURE__ */ new pt(), gi = /* @__PURE__ */ new pt(), Ku = /* @__PURE__ */ new N(), Qu = /* @__PURE__ */ new N(), th = /* @__PURE__ */ new N(), eh = /* @__PURE__ */ new N();
13051
+ function ih(n, t, e, i = {}, r = {}, s = 0, a = 1 / 0) {
13052
13052
  t.boundingBox || t.computeBoundingBox(), An.set(t.boundingBox.min, t.boundingBox.max, e), An.needsUpdate = !0;
13053
- const o = n.geometry, c = o.attributes.position, l = o.index, h = t.attributes.position, u = t.index, f = zt.getPrimitive(), d = zt.getPrimitive();
13054
- let y = Kh, _ = Qh, p = null, m = null;
13055
- r && (p = tu, m = eu);
13053
+ const o = n.geometry, c = o.attributes.position, l = o.index, u = t.attributes.position, h = t.index, f = zt.getPrimitive(), d = zt.getPrimitive();
13054
+ let y = Ku, _ = Qu, p = null, m = null;
13055
+ r && (p = th, m = eh);
13056
13056
  let v = 1 / 0, g = null, b = null;
13057
13057
  return Er.copy(e).invert(), gi.matrix.copy(Er), n.shapecast(
13058
13058
  {
@@ -13065,7 +13065,7 @@ function iu(n, t, e, i = {}, r = {}, s = 0, a = 1 / 0) {
13065
13065
  intersectsBounds: (P, M, C) => C < v && C < a,
13066
13066
  intersectsRange: (P, M) => {
13067
13067
  for (let C = P, E = P + M; C < E; C++) {
13068
- it(d, 3 * C, u, h), d.a.applyMatrix4(e), d.b.applyMatrix4(e), d.c.applyMatrix4(e), d.needsUpdate = !0;
13068
+ it(d, 3 * C, h, u), d.a.applyMatrix4(e), d.b.applyMatrix4(e), d.c.applyMatrix4(e), d.needsUpdate = !0;
13069
13069
  for (let w = x, k = x + S; w < k; w++) {
13070
13070
  it(f, 3 * w, l, c), f.needsUpdate = !0;
13071
13071
  const R = f.distanceToTriangle(d, y, p);
@@ -13078,7 +13078,7 @@ function iu(n, t, e, i = {}, r = {}, s = 0, a = 1 / 0) {
13078
13078
  {
13079
13079
  const T = si(t);
13080
13080
  for (let P = 0, M = T; P < M; P++) {
13081
- it(d, 3 * P, u, h), d.a.applyMatrix4(e), d.b.applyMatrix4(e), d.c.applyMatrix4(e), d.needsUpdate = !0;
13081
+ it(d, 3 * P, h, u), d.a.applyMatrix4(e), d.b.applyMatrix4(e), d.c.applyMatrix4(e), d.needsUpdate = !0;
13082
13082
  for (let C = x, E = x + S; C < E; C++) {
13083
13083
  it(f, 3 * C, l, c), f.needsUpdate = !0;
13084
13084
  const w = f.distanceToTriangle(d, y, p);
@@ -13091,14 +13091,14 @@ function iu(n, t, e, i = {}, r = {}, s = 0, a = 1 / 0) {
13091
13091
  }
13092
13092
  ), zt.releasePrimitive(f), zt.releasePrimitive(d), v === 1 / 0 ? null : (i.point ? i.point.copy(_) : i.point = _.clone(), i.distance = v, i.faceIndex = g, r && (r.point ? r.point.copy(m) : r.point = m.clone(), r.point.applyMatrix4(Er), _.applyMatrix4(Er), r.distance = _.sub(r.point).length(), r.faceIndex = b), i);
13093
13093
  }
13094
- function ru(n, t = null) {
13094
+ function rh(n, t = null) {
13095
13095
  t && Array.isArray(t) && (t = new Set(t));
13096
13096
  const e = n.geometry, i = e.index ? e.index.array : null, r = e.attributes.position;
13097
13097
  let s, a, o, c, l = 0;
13098
- const h = n._roots;
13099
- for (let f = 0, d = h.length; f < d; f++)
13100
- s = h[f], a = new Uint32Array(s), o = new Uint16Array(s), c = new Float32Array(s), u(0, l), l += s.byteLength;
13101
- function u(f, d, y = !1) {
13098
+ const u = n._roots;
13099
+ for (let f = 0, d = u.length; f < d; f++)
13100
+ s = u[f], a = new Uint32Array(s), o = new Uint16Array(s), c = new Float32Array(s), h(0, l), l += s.byteLength;
13101
+ function h(f, d, y = !1) {
13102
13102
  const _ = f * 2;
13103
13103
  if (o[_ + 15] === rn) {
13104
13104
  const m = a[f + 6], v = o[_ + 14];
@@ -13119,9 +13119,9 @@ function ru(n, t = null) {
13119
13119
  t ? x || (S = t.has(g), T = t.has(b), x = !S && !T) : (S = !0, T = !0);
13120
13120
  const P = x || S, M = x || T;
13121
13121
  let C = !1;
13122
- P && (C = u(m, d, x));
13122
+ P && (C = h(m, d, x));
13123
13123
  let E = !1;
13124
- M && (E = u(v, d, x));
13124
+ M && (E = h(v, d, x));
13125
13125
  const w = C || E;
13126
13126
  if (w)
13127
13127
  for (let k = 0; k < 3; k++) {
@@ -13132,14 +13132,14 @@ function ru(n, t = null) {
13132
13132
  }
13133
13133
  }
13134
13134
  }
13135
- function nu(n, t, e, i, r, s, a) {
13135
+ function nh(n, t, e, i, r, s, a) {
13136
13136
  q.setBuffer(n._roots[t]), as(0, n, e, i, r, s, a), q.clearBuffer();
13137
13137
  }
13138
13138
  function as(n, t, e, i, r, s, a) {
13139
- const { float32Array: o, uint16Array: c, uint32Array: l } = q, h = n * 2;
13140
- if (Tt(h, c)) {
13141
- const f = Pt(n, l), d = kt(h, c);
13142
- $h(t, e, i, f, d, r, s, a);
13139
+ const { float32Array: o, uint16Array: c, uint32Array: l } = q, u = n * 2;
13140
+ if (Tt(u, c)) {
13141
+ const f = Pt(n, l), d = kt(u, c);
13142
+ $u(t, e, i, f, d, r, s, a);
13143
13143
  } else {
13144
13144
  const f = Rt(n);
13145
13145
  Me(f, o, i, s, a) && as(f, t, e, i, r, s, a);
@@ -13147,8 +13147,8 @@ function as(n, t, e, i, r, s, a) {
13147
13147
  Me(d, o, i, s, a) && as(d, t, e, i, r, s, a);
13148
13148
  }
13149
13149
  }
13150
- const su = ["x", "y", "z"];
13151
- function ou(n, t, e, i, r, s) {
13150
+ const sh = ["x", "y", "z"];
13151
+ function oh(n, t, e, i, r, s) {
13152
13152
  q.setBuffer(n._roots[t]);
13153
13153
  const a = cs(0, n, e, i, r, s);
13154
13154
  return q.clearBuffer(), a;
@@ -13157,18 +13157,18 @@ function cs(n, t, e, i, r, s) {
13157
13157
  const { float32Array: a, uint16Array: o, uint32Array: c } = q;
13158
13158
  let l = n * 2;
13159
13159
  if (Tt(l, o)) {
13160
- const u = Pt(n, c), f = kt(l, o);
13161
- return qh(t, e, i, u, f, r, s);
13160
+ const h = Pt(n, c), f = kt(l, o);
13161
+ return qu(t, e, i, h, f, r, s);
13162
13162
  } else {
13163
- const u = Da(n, c), f = su[u], y = i.direction[f] >= 0;
13163
+ const h = Da(n, c), f = sh[h], y = i.direction[f] >= 0;
13164
13164
  let _, p;
13165
13165
  y ? (_ = Rt(n), p = At(n, c)) : (_ = At(n, c), p = Rt(n));
13166
13166
  const v = Me(_, a, i, r, s) ? cs(_, t, e, i, r, s) : null;
13167
13167
  if (v) {
13168
13168
  const x = v.point[f];
13169
- if (y ? x <= a[p + u] : (
13169
+ if (y ? x <= a[p + h] : (
13170
13170
  // min bounding data
13171
- x >= a[p + u + 3]
13171
+ x >= a[p + h + 3]
13172
13172
  ))
13173
13173
  return v;
13174
13174
  }
@@ -13177,7 +13177,7 @@ function cs(n, t, e, i, r, s) {
13177
13177
  }
13178
13178
  }
13179
13179
  const kr = /* @__PURE__ */ new te(), qe = /* @__PURE__ */ new Ot(), Xe = /* @__PURE__ */ new Ot(), vi = /* @__PURE__ */ new Gt(), xo = /* @__PURE__ */ new pt(), Rr = /* @__PURE__ */ new pt();
13180
- function au(n, t, e, i) {
13180
+ function ah(n, t, e, i) {
13181
13181
  q.setBuffer(n._roots[t]);
13182
13182
  const r = ls(0, n, e, i);
13183
13183
  return q.clearBuffer(), r;
@@ -13186,36 +13186,36 @@ function ls(n, t, e, i, r = null) {
13186
13186
  const { float32Array: s, uint16Array: a, uint32Array: o } = q;
13187
13187
  let c = n * 2;
13188
13188
  if (r === null && (e.boundingBox || e.computeBoundingBox(), xo.set(e.boundingBox.min, e.boundingBox.max, i), r = xo), Tt(c, a)) {
13189
- const h = t.geometry, u = h.index, f = h.attributes.position, d = e.index, y = e.attributes.position, _ = Pt(n, o), p = kt(c, a);
13189
+ const u = t.geometry, h = u.index, f = u.attributes.position, d = e.index, y = e.attributes.position, _ = Pt(n, o), p = kt(c, a);
13190
13190
  if (vi.copy(i).invert(), e.boundsTree)
13191
13191
  return Z(n, s, Rr), Rr.matrix.copy(vi), Rr.needsUpdate = !0, e.boundsTree.shapecast({
13192
13192
  intersectsBounds: (v) => Rr.intersectsBox(v),
13193
13193
  intersectsTriangle: (v) => {
13194
13194
  v.a.applyMatrix4(i), v.b.applyMatrix4(i), v.c.applyMatrix4(i), v.needsUpdate = !0;
13195
13195
  for (let g = _, b = p + _; g < b; g++)
13196
- if (it(Xe, 3 * t.resolveTriangleIndex(g), u, f), Xe.needsUpdate = !0, v.intersectsTriangle(Xe))
13196
+ if (it(Xe, 3 * t.resolveTriangleIndex(g), h, f), Xe.needsUpdate = !0, v.intersectsTriangle(Xe))
13197
13197
  return !0;
13198
13198
  return !1;
13199
13199
  }
13200
13200
  });
13201
13201
  for (let m = _, v = p + _; m < v; m++) {
13202
13202
  const g = t.resolveTriangleIndex(m);
13203
- it(qe, 3 * g, u, f), qe.a.applyMatrix4(vi), qe.b.applyMatrix4(vi), qe.c.applyMatrix4(vi), qe.needsUpdate = !0;
13203
+ it(qe, 3 * g, h, f), qe.a.applyMatrix4(vi), qe.b.applyMatrix4(vi), qe.c.applyMatrix4(vi), qe.needsUpdate = !0;
13204
13204
  for (let b = 0, x = d.count; b < x; b += 3)
13205
13205
  if (it(Xe, b, d, y), Xe.needsUpdate = !0, qe.intersectsTriangle(Xe))
13206
13206
  return !0;
13207
13207
  }
13208
13208
  } else {
13209
- const h = n + 8, u = o[n + 6];
13210
- return Z(h, s, kr), !!(r.intersectsBox(kr) && ls(h, t, e, i, r) || (Z(u, s, kr), r.intersectsBox(kr) && ls(u, t, e, i, r)));
13209
+ const u = n + 8, h = o[n + 6];
13210
+ return Z(u, s, kr), !!(r.intersectsBox(kr) && ls(u, t, e, i, r) || (Z(h, s, kr), r.intersectsBox(kr) && ls(h, t, e, i, r)));
13211
13211
  }
13212
13212
  }
13213
- const Ar = /* @__PURE__ */ new Gt(), zn = /* @__PURE__ */ new pt(), _i = /* @__PURE__ */ new pt(), cu = /* @__PURE__ */ new N(), lu = /* @__PURE__ */ new N(), hu = /* @__PURE__ */ new N(), uu = /* @__PURE__ */ new N();
13214
- function fu(n, t, e, i = {}, r = {}, s = 0, a = 1 / 0) {
13213
+ const Ar = /* @__PURE__ */ new Gt(), zn = /* @__PURE__ */ new pt(), _i = /* @__PURE__ */ new pt(), ch = /* @__PURE__ */ new N(), lh = /* @__PURE__ */ new N(), uh = /* @__PURE__ */ new N(), hh = /* @__PURE__ */ new N();
13214
+ function fh(n, t, e, i = {}, r = {}, s = 0, a = 1 / 0) {
13215
13215
  t.boundingBox || t.computeBoundingBox(), zn.set(t.boundingBox.min, t.boundingBox.max, e), zn.needsUpdate = !0;
13216
- const o = n.geometry, c = o.attributes.position, l = o.index, h = t.attributes.position, u = t.index, f = zt.getPrimitive(), d = zt.getPrimitive();
13217
- let y = cu, _ = lu, p = null, m = null;
13218
- r && (p = hu, m = uu);
13216
+ const o = n.geometry, c = o.attributes.position, l = o.index, u = t.attributes.position, h = t.index, f = zt.getPrimitive(), d = zt.getPrimitive();
13217
+ let y = ch, _ = lh, p = null, m = null;
13218
+ r && (p = uh, m = hh);
13219
13219
  let v = 1 / 0, g = null, b = null;
13220
13220
  return Ar.copy(e).invert(), _i.matrix.copy(Ar), n.shapecast(
13221
13221
  {
@@ -13230,7 +13230,7 @@ function fu(n, t, e, i = {}, r = {}, s = 0, a = 1 / 0) {
13230
13230
  intersectsRange: (P, M) => {
13231
13231
  for (let C = P, E = P + M; C < E; C++) {
13232
13232
  const w = T.resolveTriangleIndex(C);
13233
- it(d, 3 * w, u, h), d.a.applyMatrix4(e), d.b.applyMatrix4(e), d.c.applyMatrix4(e), d.needsUpdate = !0;
13233
+ it(d, 3 * w, h, u), d.a.applyMatrix4(e), d.b.applyMatrix4(e), d.c.applyMatrix4(e), d.needsUpdate = !0;
13234
13234
  for (let k = x, R = x + S; k < R; k++) {
13235
13235
  const z = n.resolveTriangleIndex(k);
13236
13236
  it(f, 3 * z, l, c), f.needsUpdate = !0;
@@ -13244,7 +13244,7 @@ function fu(n, t, e, i = {}, r = {}, s = 0, a = 1 / 0) {
13244
13244
  } else {
13245
13245
  const T = si(t);
13246
13246
  for (let P = 0, M = T; P < M; P++) {
13247
- it(d, 3 * P, u, h), d.a.applyMatrix4(e), d.b.applyMatrix4(e), d.c.applyMatrix4(e), d.needsUpdate = !0;
13247
+ it(d, 3 * P, h, u), d.a.applyMatrix4(e), d.b.applyMatrix4(e), d.c.applyMatrix4(e), d.needsUpdate = !0;
13248
13248
  for (let C = x, E = x + S; C < E; C++) {
13249
13249
  const w = n.resolveTriangleIndex(C);
13250
13250
  it(f, 3 * w, l, c), f.needsUpdate = !0;
@@ -13258,20 +13258,20 @@ function fu(n, t, e, i = {}, r = {}, s = 0, a = 1 / 0) {
13258
13258
  }
13259
13259
  ), zt.releasePrimitive(f), zt.releasePrimitive(d), v === 1 / 0 ? null : (i.point ? i.point.copy(_) : i.point = _.clone(), i.distance = v, i.faceIndex = g, r && (r.point ? r.point.copy(m) : r.point = m.clone(), r.point.applyMatrix4(Ar), _.applyMatrix4(Ar), r.distance = _.sub(r.point).length(), r.faceIndex = b), i);
13260
13260
  }
13261
- function du() {
13261
+ function dh() {
13262
13262
  return typeof SharedArrayBuffer < "u";
13263
13263
  }
13264
13264
  const ki = new q.constructor(), Zr = new q.constructor(), Se = new Ss(() => new te()), He = new te(), We = new te(), On = new te(), Bn = new te();
13265
13265
  let In = !1;
13266
- function pu(n, t, e, i) {
13266
+ function ph(n, t, e, i) {
13267
13267
  if (In)
13268
13268
  throw new Error("MeshBVH: Recursive calls to bvhcast not supported.");
13269
13269
  In = !0;
13270
13270
  const r = n._roots, s = t._roots;
13271
13271
  let a, o = 0, c = 0;
13272
13272
  const l = new Gt().copy(e).invert();
13273
- for (let h = 0, u = r.length; h < u; h++) {
13274
- ki.setBuffer(r[h]), c = 0;
13273
+ for (let u = 0, h = r.length; u < h; u++) {
13274
+ ki.setBuffer(r[u]), c = 0;
13275
13275
  const f = Se.getPrimitive();
13276
13276
  Z(0, ki.float32Array, f), f.applyMatrix4(l);
13277
13277
  for (let d = 0, y = s.length; d < y && (Zr.setBuffer(s[d]), a = Lt(
@@ -13287,18 +13287,18 @@ function pu(n, t, e, i) {
13287
13287
  f
13288
13288
  ), Zr.clearBuffer(), c += s[d].length, !a); d++)
13289
13289
  ;
13290
- if (Se.releasePrimitive(f), ki.clearBuffer(), o += r[h].length, a)
13290
+ if (Se.releasePrimitive(f), ki.clearBuffer(), o += r[u].length, a)
13291
13291
  break;
13292
13292
  }
13293
13293
  return In = !1, a;
13294
13294
  }
13295
- function Lt(n, t, e, i, r, s = 0, a = 0, o = 0, c = 0, l = null, h = !1) {
13296
- let u, f;
13297
- h ? (u = Zr, f = ki) : (u = ki, f = Zr);
13298
- const d = u.float32Array, y = u.uint32Array, _ = u.uint16Array, p = f.float32Array, m = f.uint32Array, v = f.uint16Array, g = n * 2, b = t * 2, x = Tt(g, _), S = Tt(b, v);
13295
+ function Lt(n, t, e, i, r, s = 0, a = 0, o = 0, c = 0, l = null, u = !1) {
13296
+ let h, f;
13297
+ u ? (h = Zr, f = ki) : (h = ki, f = Zr);
13298
+ const d = h.float32Array, y = h.uint32Array, _ = h.uint16Array, p = f.float32Array, m = f.uint32Array, v = f.uint16Array, g = n * 2, b = t * 2, x = Tt(g, _), S = Tt(b, v);
13299
13299
  let T = !1;
13300
13300
  if (S && x)
13301
- h ? T = r(
13301
+ u ? T = r(
13302
13302
  Pt(t, m),
13303
13303
  kt(t * 2, v),
13304
13304
  Pt(n, y),
@@ -13334,7 +13334,7 @@ function Lt(n, t, e, i, r, s = 0, a = 0, o = 0, c = 0, l = null, h = !1) {
13334
13334
  c,
13335
13335
  o + 1,
13336
13336
  P,
13337
- !h
13337
+ !u
13338
13338
  ) || w && Lt(
13339
13339
  t,
13340
13340
  C,
@@ -13346,7 +13346,7 @@ function Lt(n, t, e, i, r, s = 0, a = 0, o = 0, c = 0, l = null, h = !1) {
13346
13346
  c,
13347
13347
  o + 1,
13348
13348
  P,
13349
- !h
13349
+ !u
13350
13350
  ), Se.releasePrimitive(P);
13351
13351
  } else {
13352
13352
  const P = Rt(t), M = At(t, m);
@@ -13364,7 +13364,7 @@ function Lt(n, t, e, i, r, s = 0, a = 0, o = 0, c = 0, l = null, h = !1) {
13364
13364
  o,
13365
13365
  c + 1,
13366
13366
  l,
13367
- h
13367
+ u
13368
13368
  ) || Lt(
13369
13369
  n,
13370
13370
  M,
@@ -13376,7 +13376,7 @@ function Lt(n, t, e, i, r, s = 0, a = 0, o = 0, c = 0, l = null, h = !1) {
13376
13376
  o,
13377
13377
  c + 1,
13378
13378
  l,
13379
- h
13379
+ u
13380
13380
  );
13381
13381
  else if (C)
13382
13382
  if (x)
@@ -13391,7 +13391,7 @@ function Lt(n, t, e, i, r, s = 0, a = 0, o = 0, c = 0, l = null, h = !1) {
13391
13391
  o,
13392
13392
  c + 1,
13393
13393
  l,
13394
- h
13394
+ u
13395
13395
  );
13396
13396
  else {
13397
13397
  const w = Se.getPrimitive();
@@ -13410,7 +13410,7 @@ function Lt(n, t, e, i, r, s = 0, a = 0, o = 0, c = 0, l = null, h = !1) {
13410
13410
  c,
13411
13411
  o + 1,
13412
13412
  w,
13413
- !h
13413
+ !u
13414
13414
  ) || U && Lt(
13415
13415
  P,
13416
13416
  R,
@@ -13422,7 +13422,7 @@ function Lt(n, t, e, i, r, s = 0, a = 0, o = 0, c = 0, l = null, h = !1) {
13422
13422
  c,
13423
13423
  o + 1,
13424
13424
  w,
13425
- !h
13425
+ !u
13426
13426
  ), Se.releasePrimitive(w);
13427
13427
  }
13428
13428
  else if (E)
@@ -13438,7 +13438,7 @@ function Lt(n, t, e, i, r, s = 0, a = 0, o = 0, c = 0, l = null, h = !1) {
13438
13438
  o,
13439
13439
  c + 1,
13440
13440
  l,
13441
- h
13441
+ u
13442
13442
  );
13443
13443
  else {
13444
13444
  const w = Se.getPrimitive();
@@ -13457,7 +13457,7 @@ function Lt(n, t, e, i, r, s = 0, a = 0, o = 0, c = 0, l = null, h = !1) {
13457
13457
  c,
13458
13458
  o + 1,
13459
13459
  w,
13460
- !h
13460
+ !u
13461
13461
  ) || U && Lt(
13462
13462
  M,
13463
13463
  R,
@@ -13469,13 +13469,13 @@ function Lt(n, t, e, i, r, s = 0, a = 0, o = 0, c = 0, l = null, h = !1) {
13469
13469
  c,
13470
13470
  o + 1,
13471
13471
  w,
13472
- !h
13472
+ !u
13473
13473
  ), Se.releasePrimitive(w);
13474
13474
  }
13475
13475
  }
13476
13476
  return T;
13477
13477
  }
13478
- const zr = /* @__PURE__ */ new pt(), bo = /* @__PURE__ */ new te(), mu = {
13478
+ const zr = /* @__PURE__ */ new pt(), bo = /* @__PURE__ */ new te(), mh = {
13479
13479
  strategy: xs,
13480
13480
  maxDepth: 40,
13481
13481
  maxLeafTris: 10,
@@ -13529,38 +13529,38 @@ class sn {
13529
13529
  throw new Error("MeshBVH: InterleavedBufferAttribute is not supported for the index attribute.");
13530
13530
  } else throw new Error("MeshBVH: Only BufferGeometries are supported.");
13531
13531
  if (e = Object.assign({
13532
- ...mu,
13532
+ ...mh,
13533
13533
  // undocumented options
13534
13534
  // Whether to skip generating the tree. Used for deserialization.
13535
13535
  [Pn]: !1
13536
- }, e), e.useSharedArrayBuffer && !du())
13536
+ }, e), e.useSharedArrayBuffer && !dh())
13537
13537
  throw new Error("MeshBVH: SharedArrayBuffer is not available.");
13538
- this.geometry = t, this._roots = null, this._indirectBuffer = null, e[Pn] || (Rh(this, e), !t.boundingBox && e.setBoundingBox && (t.boundingBox = this.getBoundingBox(new te()))), this.resolveTriangleIndex = e.indirect ? (i) => this._indirectBuffer[i] : (i) => i;
13538
+ this.geometry = t, this._roots = null, this._indirectBuffer = null, e[Pn] || (Ru(this, e), !t.boundingBox && e.setBoundingBox && (t.boundingBox = this.getBoundingBox(new te()))), this.resolveTriangleIndex = e.indirect ? (i) => this._indirectBuffer[i] : (i) => i;
13539
13539
  }
13540
13540
  refit(t = null) {
13541
- return (this.indirect ? ru : jh)(this, t);
13541
+ return (this.indirect ? rh : ju)(this, t);
13542
13542
  }
13543
13543
  traverse(t, e = 0) {
13544
13544
  const i = this._roots[e], r = new Uint32Array(i), s = new Uint16Array(i);
13545
13545
  a(0);
13546
13546
  function a(o, c = 0) {
13547
- const l = o * 2, h = s[l + 15] === rn;
13548
- if (h) {
13549
- const u = r[o + 6], f = s[l + 14];
13550
- t(c, h, new Float32Array(i, o * 4, 6), u, f);
13547
+ const l = o * 2, u = s[l + 15] === rn;
13548
+ if (u) {
13549
+ const h = r[o + 6], f = s[l + 14];
13550
+ t(c, u, new Float32Array(i, o * 4, 6), h, f);
13551
13551
  } else {
13552
- const u = o + Ei / 4, f = r[o + 6], d = r[o + 7];
13553
- t(c, h, new Float32Array(i, o * 4, 6), d) || (a(u, c + 1), a(f, c + 1));
13552
+ const h = o + Ei / 4, f = r[o + 6], d = r[o + 7];
13553
+ t(c, u, new Float32Array(i, o * 4, 6), d) || (a(h, c + 1), a(f, c + 1));
13554
13554
  }
13555
13555
  }
13556
13556
  }
13557
13557
  /* Core Cast Functions */
13558
13558
  raycast(t, e = Cs, i = 0, r = 1 / 0) {
13559
- const s = this._roots, a = this.geometry, o = [], c = e.isMaterial, l = Array.isArray(e), h = a.groups, u = c ? e.side : e, f = this.indirect ? nu : Hh;
13559
+ const s = this._roots, a = this.geometry, o = [], c = e.isMaterial, l = Array.isArray(e), u = a.groups, h = c ? e.side : e, f = this.indirect ? nh : Hu;
13560
13560
  for (let d = 0, y = s.length; d < y; d++) {
13561
- const _ = l ? e[h[d].materialIndex].side : u, p = o.length;
13561
+ const _ = l ? e[u[d].materialIndex].side : h, p = o.length;
13562
13562
  if (f(this, d, _, t, o, i, r), l) {
13563
- const m = h[d].materialIndex;
13563
+ const m = u[d].materialIndex;
13564
13564
  for (let v = p, g = o.length; v < g; v++)
13565
13565
  o[v].face.materialIndex = m;
13566
13566
  }
@@ -13570,22 +13570,22 @@ class sn {
13570
13570
  raycastFirst(t, e = Cs, i = 0, r = 1 / 0) {
13571
13571
  const s = this._roots, a = this.geometry, o = e.isMaterial, c = Array.isArray(e);
13572
13572
  let l = null;
13573
- const h = a.groups, u = o ? e.side : e, f = this.indirect ? ou : Yh;
13573
+ const u = a.groups, h = o ? e.side : e, f = this.indirect ? oh : Yu;
13574
13574
  for (let d = 0, y = s.length; d < y; d++) {
13575
- const _ = c ? e[h[d].materialIndex].side : u, p = f(this, d, _, t, i, r);
13576
- p != null && (l == null || p.distance < l.distance) && (l = p, c && (p.face.materialIndex = h[d].materialIndex));
13575
+ const _ = c ? e[u[d].materialIndex].side : h, p = f(this, d, _, t, i, r);
13576
+ p != null && (l == null || p.distance < l.distance) && (l = p, c && (p.face.materialIndex = u[d].materialIndex));
13577
13577
  }
13578
13578
  return l;
13579
13579
  }
13580
13580
  intersectsGeometry(t, e) {
13581
13581
  let i = !1;
13582
- const r = this._roots, s = this.indirect ? au : Zh;
13582
+ const r = this._roots, s = this.indirect ? ah : Zu;
13583
13583
  for (let a = 0, o = r.length; a < o && (i = s(this, a, t, e), !i); a++)
13584
13584
  ;
13585
13585
  return i;
13586
13586
  }
13587
13587
  shapecast(t) {
13588
- const e = zt.getPrimitive(), i = this.indirect ? Xh : Gh;
13588
+ const e = zt.getPrimitive(), i = this.indirect ? Xu : Gu;
13589
13589
  let {
13590
13590
  boundsTraverseOrder: r,
13591
13591
  intersectsBounds: s,
@@ -13593,14 +13593,14 @@ class sn {
13593
13593
  intersectsTriangle: o
13594
13594
  } = t;
13595
13595
  if (a && o) {
13596
- const u = a;
13597
- a = (f, d, y, _, p) => u(f, d, y, _, p) ? !0 : i(f, d, this, o, y, _, e);
13598
- } else a || (o ? a = (u, f, d, y) => i(u, f, this, o, d, y, e) : a = (u, f, d) => d);
13596
+ const h = a;
13597
+ a = (f, d, y, _, p) => h(f, d, y, _, p) ? !0 : i(f, d, this, o, y, _, e);
13598
+ } else a || (o ? a = (h, f, d, y) => i(h, f, this, o, d, y, e) : a = (h, f, d) => d);
13599
13599
  let c = !1, l = 0;
13600
- const h = this._roots;
13601
- for (let u = 0, f = h.length; u < f; u++) {
13602
- const d = h[u];
13603
- if (c = Nh(this, u, s, a, r, l), c)
13600
+ const u = this._roots;
13601
+ for (let h = 0, f = u.length; h < f; h++) {
13602
+ const d = u[h];
13603
+ if (c = Nu(this, h, s, a, r, l), c)
13604
13604
  break;
13605
13605
  l += d.byteLength;
13606
13606
  }
@@ -13616,18 +13616,18 @@ class sn {
13616
13616
  it(a, _ * 3, o, c);
13617
13617
  } : (y) => {
13618
13618
  it(a, y * 3, o, c);
13619
- }, h = zt.getPrimitive(), u = t.geometry.index, f = t.geometry.attributes.position, d = t.indirect ? (y) => {
13619
+ }, u = zt.getPrimitive(), h = t.geometry.index, f = t.geometry.attributes.position, d = t.indirect ? (y) => {
13620
13620
  const _ = t.resolveTriangleIndex(y);
13621
- it(h, _ * 3, u, f);
13621
+ it(u, _ * 3, h, f);
13622
13622
  } : (y) => {
13623
- it(h, y * 3, u, f);
13623
+ it(u, y * 3, h, f);
13624
13624
  };
13625
13625
  if (s) {
13626
13626
  const y = (_, p, m, v, g, b, x, S) => {
13627
13627
  for (let T = m, P = m + v; T < P; T++) {
13628
- d(T), h.a.applyMatrix4(e), h.b.applyMatrix4(e), h.c.applyMatrix4(e), h.needsUpdate = !0;
13628
+ d(T), u.a.applyMatrix4(e), u.b.applyMatrix4(e), u.c.applyMatrix4(e), u.needsUpdate = !0;
13629
13629
  for (let M = _, C = _ + p; M < C; M++)
13630
- if (l(M), a.needsUpdate = !0, s(a, h, M, T, g, b, x, S))
13630
+ if (l(M), a.needsUpdate = !0, s(a, u, M, T, g, b, x, S))
13631
13631
  return !0;
13632
13632
  }
13633
13633
  return !1;
@@ -13640,7 +13640,7 @@ class sn {
13640
13640
  } else
13641
13641
  r = y;
13642
13642
  }
13643
- return pu(this, t, e, r);
13643
+ return ph(this, t, e, r);
13644
13644
  }
13645
13645
  /* Derived Cast Functions */
13646
13646
  intersectsBox(t, e) {
@@ -13660,7 +13660,7 @@ class sn {
13660
13660
  );
13661
13661
  }
13662
13662
  closestPointToGeometry(t, e, i = {}, r = {}, s = 0, a = 1 / 0) {
13663
- return (this.indirect ? fu : iu)(
13663
+ return (this.indirect ? fh : ih)(
13664
13664
  this,
13665
13665
  t,
13666
13666
  e,
@@ -13671,7 +13671,7 @@ class sn {
13671
13671
  );
13672
13672
  }
13673
13673
  closestPointToPoint(t, e = {}, i = 0, r = 1 / 0) {
13674
- return Uh(
13674
+ return Uu(
13675
13675
  this,
13676
13676
  t,
13677
13677
  e,
@@ -13688,11 +13688,11 @@ class sn {
13688
13688
  function So(n, t, e) {
13689
13689
  return n === null ? null : (n.point.applyMatrix4(t.matrixWorld), n.distance = n.point.distanceTo(e.ray.origin), n.object = t, n);
13690
13690
  }
13691
- const Or = /* @__PURE__ */ new Ya(), To = /* @__PURE__ */ new N(), Co = /* @__PURE__ */ new Gt(), yu = hs.prototype.raycast, gu = Wa.prototype.raycast, Mo = /* @__PURE__ */ new N(), lt = /* @__PURE__ */ new hs(), Br = [];
13692
- function vu(n, t) {
13693
- this.isBatchedMesh ? _u.call(this, n, t) : xu.call(this, n, t);
13691
+ const Or = /* @__PURE__ */ new Ya(), To = /* @__PURE__ */ new N(), Co = /* @__PURE__ */ new Gt(), yh = us.prototype.raycast, gh = Wa.prototype.raycast, Mo = /* @__PURE__ */ new N(), lt = /* @__PURE__ */ new us(), Br = [];
13692
+ function vh(n, t) {
13693
+ this.isBatchedMesh ? _h.call(this, n, t) : xh.call(this, n, t);
13694
13694
  }
13695
- function _u(n, t) {
13695
+ function _h(n, t) {
13696
13696
  if (this.boundsTrees) {
13697
13697
  const e = this.boundsTrees, i = this._drawInfo || this._instanceInfo, r = this._drawRanges || this._geometryInfo, s = this.matrixWorld;
13698
13698
  lt.material = this.material, lt.geometry = this.geometry;
@@ -13701,24 +13701,24 @@ function _u(n, t) {
13701
13701
  for (let c = 0, l = i.length; c < l; c++) {
13702
13702
  if (!this.getVisibleAt(c))
13703
13703
  continue;
13704
- const h = i[c].geometryIndex;
13705
- if (lt.geometry.boundsTree = e[h], this.getMatrixAt(c, lt.matrixWorld).premultiply(s), !lt.geometry.boundsTree) {
13706
- this.getBoundingBoxAt(h, lt.geometry.boundingBox), this.getBoundingSphereAt(h, lt.geometry.boundingSphere);
13707
- const u = r[h];
13708
- lt.geometry.setDrawRange(u.start, u.count);
13704
+ const u = i[c].geometryIndex;
13705
+ if (lt.geometry.boundsTree = e[u], this.getMatrixAt(c, lt.matrixWorld).premultiply(s), !lt.geometry.boundsTree) {
13706
+ this.getBoundingBoxAt(u, lt.geometry.boundingBox), this.getBoundingSphereAt(u, lt.geometry.boundingSphere);
13707
+ const h = r[u];
13708
+ lt.geometry.setDrawRange(h.start, h.count);
13709
13709
  }
13710
13710
  lt.raycast(n, Br);
13711
- for (let u = 0, f = Br.length; u < f; u++) {
13712
- const d = Br[u];
13711
+ for (let h = 0, f = Br.length; h < f; h++) {
13712
+ const d = Br[h];
13713
13713
  d.object = this, d.batchId = c, t.push(d);
13714
13714
  }
13715
13715
  Br.length = 0;
13716
13716
  }
13717
13717
  lt.geometry.boundsTree = a, lt.geometry.drawRange = o, lt.material = null, lt.geometry = null;
13718
13718
  } else
13719
- gu.call(this, n, t);
13719
+ gh.call(this, n, t);
13720
13720
  }
13721
- function xu(n, t) {
13721
+ function xh(n, t) {
13722
13722
  if (this.geometry.boundsTree) {
13723
13723
  if (this.material === void 0) return;
13724
13724
  Co.copy(this.matrixWorld).invert(), Or.copy(n.ray).applyMatrix4(Co), Mo.setFromMatrixScale(this.matrixWorld), To.copy(Or.direction).multiply(Mo);
@@ -13734,12 +13734,12 @@ function xu(n, t) {
13734
13734
  }
13735
13735
  }
13736
13736
  } else
13737
- yu.call(this, n, t);
13737
+ yh.call(this, n, t);
13738
13738
  }
13739
- function bu(n = {}) {
13739
+ function bh(n = {}) {
13740
13740
  return this.boundsTree = new sn(this, n), this.boundsTree;
13741
13741
  }
13742
- const Oe = /* @__PURE__ */ new N(), Be = /* @__PURE__ */ new N(), Ie = /* @__PURE__ */ new N(), Po = /* @__PURE__ */ new us(), Ir = /* @__PURE__ */ new N(), Nn = /* @__PURE__ */ new N(), wo = /* @__PURE__ */ new us(), Eo = /* @__PURE__ */ new us(), Nr = /* @__PURE__ */ new Gt(), ko = /* @__PURE__ */ new Gt();
13742
+ const Oe = /* @__PURE__ */ new N(), Be = /* @__PURE__ */ new N(), Ie = /* @__PURE__ */ new N(), Po = /* @__PURE__ */ new hs(), Ir = /* @__PURE__ */ new N(), Nn = /* @__PURE__ */ new N(), wo = /* @__PURE__ */ new hs(), Eo = /* @__PURE__ */ new hs(), Nr = /* @__PURE__ */ new Gt(), ko = /* @__PURE__ */ new Gt();
13743
13743
  function xi(n, t) {
13744
13744
  if (!n && !t)
13745
13745
  return;
@@ -13763,7 +13763,7 @@ function Ja(n, t, e = 0) {
13763
13763
  new r(i.buffer, s, n.array.length).set(n.array);
13764
13764
  }
13765
13765
  }
13766
- function Su(n, t, e) {
13766
+ function Sh(n, t, e) {
13767
13767
  const i = n.elements, r = t.elements;
13768
13768
  for (let s = 0, a = r.length; s < a; s++)
13769
13769
  i[s] += r[s] * e;
@@ -13775,7 +13775,7 @@ function Ro(n, t, e) {
13775
13775
  const c = Eo.getComponent(o);
13776
13776
  if (c !== 0) {
13777
13777
  const l = wo.getComponent(o);
13778
- ko.multiplyMatrices(s[l].matrixWorld, a[l]), Su(Nr, ko, c);
13778
+ ko.multiplyMatrices(s[l].matrixWorld, a[l]), Sh(Nr, ko, c);
13779
13779
  }
13780
13780
  }
13781
13781
  return Nr.multiply(n.bindMatrix).premultiply(n.bindMatrixInverse), e.transformDirection(Nr), e;
@@ -13788,71 +13788,71 @@ function Un(n, t, e, i, r) {
13788
13788
  }
13789
13789
  r.add(Ir);
13790
13790
  }
13791
- function Tu(n, t = { useGroups: !1, updateIndex: !1, skipAttributes: [] }, e = new Pi()) {
13791
+ function Th(n, t = { useGroups: !1, updateIndex: !1, skipAttributes: [] }, e = new Pi()) {
13792
13792
  const i = n[0].index !== null, { useGroups: r = !1, updateIndex: s = !1, skipAttributes: a = [] } = t, o = new Set(Object.keys(n[0].attributes)), c = {};
13793
13793
  let l = 0;
13794
13794
  e.clearGroups();
13795
- for (let h = 0; h < n.length; ++h) {
13796
- const u = n[h];
13795
+ for (let u = 0; u < n.length; ++u) {
13796
+ const h = n[u];
13797
13797
  let f = 0;
13798
- if (i !== (u.index !== null))
13798
+ if (i !== (h.index !== null))
13799
13799
  throw new Error("StaticGeometryGenerator: All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them.");
13800
- for (const d in u.attributes) {
13800
+ for (const d in h.attributes) {
13801
13801
  if (!o.has(d))
13802
13802
  throw new Error('StaticGeometryGenerator: All geometries must have compatible attributes; make sure "' + d + '" attribute exists among all geometries, or in none of them.');
13803
- c[d] === void 0 && (c[d] = []), c[d].push(u.attributes[d]), f++;
13803
+ c[d] === void 0 && (c[d] = []), c[d].push(h.attributes[d]), f++;
13804
13804
  }
13805
13805
  if (f !== o.size)
13806
13806
  throw new Error("StaticGeometryGenerator: Make sure all geometries have the same number of attributes.");
13807
13807
  if (r) {
13808
13808
  let d;
13809
13809
  if (i)
13810
- d = u.index.count;
13811
- else if (u.attributes.position !== void 0)
13812
- d = u.attributes.position.count;
13810
+ d = h.index.count;
13811
+ else if (h.attributes.position !== void 0)
13812
+ d = h.attributes.position.count;
13813
13813
  else
13814
13814
  throw new Error("StaticGeometryGenerator: The geometry must have either an index or a position attribute");
13815
- e.addGroup(l, d, h), l += d;
13815
+ e.addGroup(l, d, u), l += d;
13816
13816
  }
13817
13817
  }
13818
13818
  if (i) {
13819
- let h = !1;
13819
+ let u = !1;
13820
13820
  if (!e.index) {
13821
- let u = 0;
13821
+ let h = 0;
13822
13822
  for (let f = 0; f < n.length; ++f)
13823
- u += n[f].index.count;
13824
- e.setIndex(new Mt(new Uint32Array(u), 1, !1)), h = !0;
13823
+ h += n[f].index.count;
13824
+ e.setIndex(new Mt(new Uint32Array(h), 1, !1)), u = !0;
13825
13825
  }
13826
- if (s || h) {
13827
- const u = e.index;
13826
+ if (s || u) {
13827
+ const h = e.index;
13828
13828
  let f = 0, d = 0;
13829
13829
  for (let y = 0; y < n.length; ++y) {
13830
13830
  const _ = n[y], p = _.index;
13831
13831
  if (a[y] !== !0)
13832
13832
  for (let m = 0; m < p.count; ++m)
13833
- u.setX(f, p.getX(m) + d), f++;
13833
+ h.setX(f, p.getX(m) + d), f++;
13834
13834
  d += _.attributes.position.count;
13835
13835
  }
13836
13836
  }
13837
13837
  }
13838
- for (const h in c) {
13839
- const u = c[h];
13840
- if (!(h in e.attributes)) {
13838
+ for (const u in c) {
13839
+ const h = c[u];
13840
+ if (!(u in e.attributes)) {
13841
13841
  let y = 0;
13842
- for (const _ in u)
13843
- y += u[_].count;
13844
- e.setAttribute(h, Mi(c[h][0], y));
13842
+ for (const _ in h)
13843
+ y += h[_].count;
13844
+ e.setAttribute(u, Mi(c[u][0], y));
13845
13845
  }
13846
- const f = e.attributes[h];
13846
+ const f = e.attributes[u];
13847
13847
  let d = 0;
13848
- for (let y = 0, _ = u.length; y < _; y++) {
13849
- const p = u[y];
13848
+ for (let y = 0, _ = h.length; y < _; y++) {
13849
+ const p = h[y];
13850
13850
  a[y] !== !0 && Ja(p, f, d), d += p.count;
13851
13851
  }
13852
13852
  }
13853
13853
  return e;
13854
13854
  }
13855
- function Cu(n, t) {
13855
+ function Ch(n, t) {
13856
13856
  if (n === null || t === null)
13857
13857
  return n === t;
13858
13858
  if (n.length !== t.length)
@@ -13862,7 +13862,7 @@ function Cu(n, t) {
13862
13862
  return !1;
13863
13863
  return !0;
13864
13864
  }
13865
- function Mu(n) {
13865
+ function Mh(n) {
13866
13866
  const { index: t, attributes: e } = n;
13867
13867
  if (t)
13868
13868
  for (let i = 0, r = t.count; i < r; i += 3) {
@@ -13874,13 +13874,13 @@ function Mu(n) {
13874
13874
  const r = e[i], s = r.itemSize;
13875
13875
  for (let a = 0, o = r.count; a < o; a += 3)
13876
13876
  for (let c = 0; c < s; c++) {
13877
- const l = r.getComponent(a, c), h = r.getComponent(a + 2, c);
13878
- r.setComponent(a, c, h), r.setComponent(a + 2, c, l);
13877
+ const l = r.getComponent(a, c), u = r.getComponent(a + 2, c);
13878
+ r.setComponent(a, c, u), r.setComponent(a + 2, c, l);
13879
13879
  }
13880
13880
  }
13881
13881
  return n;
13882
13882
  }
13883
- class Pu {
13883
+ class Ph {
13884
13884
  constructor(t) {
13885
13885
  this.matrixWorld = new Gt(), this.geometryHash = null, this.boneMatrices = null, this.primitiveCount = -1, this.mesh = t, this.update();
13886
13886
  }
@@ -13895,10 +13895,10 @@ class Pu {
13895
13895
  }
13896
13896
  didChange() {
13897
13897
  const t = this.mesh, e = t.geometry, i = (e.index ? e.index.count : e.attributes.position.count) / 3;
13898
- return !(this.matrixWorld.equals(t.matrixWorld) && this.geometryHash === e.attributes.position.version && Cu(t.skeleton && t.skeleton.boneMatrices || null, this.boneMatrices) && this.primitiveCount === i);
13898
+ return !(this.matrixWorld.equals(t.matrixWorld) && this.geometryHash === e.attributes.position.version && Ch(t.skeleton && t.skeleton.boneMatrices || null, this.boneMatrices) && this.primitiveCount === i);
13899
13899
  }
13900
13900
  }
13901
- class wu {
13901
+ class wh {
13902
13902
  constructor(t) {
13903
13903
  Array.isArray(t) || (t = [t]);
13904
13904
  const e = [];
@@ -13918,8 +13918,8 @@ class wu {
13918
13918
  let e = [];
13919
13919
  const { meshes: i, useGroups: r, _intermediateGeometry: s, _diffMap: a } = this;
13920
13920
  for (let o = 0, c = i.length; o < c; o++) {
13921
- const l = i[o], h = s[o], u = a.get(l);
13922
- !u || u.didChange(l) ? (this._convertToStaticGeometry(l, h), e.push(!1), u ? u.update() : a.set(l, new Pu(l))) : e.push(!0);
13921
+ const l = i[o], u = s[o], h = a.get(l);
13922
+ !h || h.didChange(l) ? (this._convertToStaticGeometry(l, u), e.push(!1), h ? h.update() : a.set(l, new Ph(l))) : e.push(!0);
13923
13923
  }
13924
13924
  if (s.length === 0) {
13925
13925
  t.setIndex(null);
@@ -13929,7 +13929,7 @@ class wu {
13929
13929
  for (const c in this.attributes)
13930
13930
  t.setAttribute(this.attributes[c], new Mt(new Float32Array(0), 4, !1));
13931
13931
  } else
13932
- Tu(s, { useGroups: r, skipAttributes: e }, t);
13932
+ Th(s, { useGroups: r, skipAttributes: e }, t);
13933
13933
  for (const o in t.attributes)
13934
13934
  t.attributes[o].needsUpdate = !0;
13935
13935
  return t;
@@ -13937,18 +13937,18 @@ class wu {
13937
13937
  _convertToStaticGeometry(t, e = new Pi()) {
13938
13938
  const i = t.geometry, r = this.applyWorldTransforms, s = this.attributes.includes("normal"), a = this.attributes.includes("tangent"), o = i.attributes, c = e.attributes;
13939
13939
  !e.index && i.index && (e.index = i.index.clone()), c.position || e.setAttribute("position", Mi(o.position)), s && !c.normal && o.normal && e.setAttribute("normal", Mi(o.normal)), a && !c.tangent && o.tangent && e.setAttribute("tangent", Mi(o.tangent)), xi(i.index, e.index), xi(o.position, c.position), s && xi(o.normal, c.normal), a && xi(o.tangent, c.tangent);
13940
- const l = o.position, h = s ? o.normal : null, u = a ? o.tangent : null, f = i.morphAttributes.position, d = i.morphAttributes.normal, y = i.morphAttributes.tangent, _ = i.morphTargetsRelative, p = t.morphTargetInfluences, m = new Za();
13940
+ const l = o.position, u = s ? o.normal : null, h = a ? o.tangent : null, f = i.morphAttributes.position, d = i.morphAttributes.normal, y = i.morphAttributes.tangent, _ = i.morphTargetsRelative, p = t.morphTargetInfluences, m = new Za();
13941
13941
  m.getNormalMatrix(t.matrixWorld), i.index && e.index.array.set(i.index.array);
13942
13942
  for (let v = 0, g = o.position.count; v < g; v++)
13943
- Oe.fromBufferAttribute(l, v), h && Be.fromBufferAttribute(h, v), u && (Po.fromBufferAttribute(u, v), Ie.fromBufferAttribute(u, v)), p && (f && Un(f, p, _, v, Oe), d && Un(d, p, _, v, Be), y && Un(y, p, _, v, Ie)), t.isSkinnedMesh && (t.applyBoneTransform(v, Oe), h && Ro(t, v, Be), u && Ro(t, v, Ie)), r && Oe.applyMatrix4(t.matrixWorld), c.position.setXYZ(v, Oe.x, Oe.y, Oe.z), h && (r && Be.applyNormalMatrix(m), c.normal.setXYZ(v, Be.x, Be.y, Be.z)), u && (r && Ie.transformDirection(t.matrixWorld), c.tangent.setXYZW(v, Ie.x, Ie.y, Ie.z, Po.w));
13943
+ Oe.fromBufferAttribute(l, v), u && Be.fromBufferAttribute(u, v), h && (Po.fromBufferAttribute(h, v), Ie.fromBufferAttribute(h, v)), p && (f && Un(f, p, _, v, Oe), d && Un(d, p, _, v, Be), y && Un(y, p, _, v, Ie)), t.isSkinnedMesh && (t.applyBoneTransform(v, Oe), u && Ro(t, v, Be), h && Ro(t, v, Ie)), r && Oe.applyMatrix4(t.matrixWorld), c.position.setXYZ(v, Oe.x, Oe.y, Oe.z), u && (r && Be.applyNormalMatrix(m), c.normal.setXYZ(v, Be.x, Be.y, Be.z)), h && (r && Ie.transformDirection(t.matrixWorld), c.tangent.setXYZW(v, Ie.x, Ie.y, Ie.z, Po.w));
13944
13944
  for (const v in this.attributes) {
13945
13945
  const g = this.attributes[v];
13946
13946
  g === "position" || g === "tangent" || g === "normal" || !(g in o) || (c[g] || e.setAttribute(g, Mi(o[g])), xi(o[g], c[g]), Ja(o[g], c[g]));
13947
13947
  }
13948
- return t.matrixWorld.determinant() < 0 && Mu(e), e;
13948
+ return t.matrixWorld.determinant() < 0 && Mh(e), e;
13949
13949
  }
13950
13950
  }
13951
- const Vu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
13951
+ const Vh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
13952
13952
  __proto__: null,
13953
13953
  AVERAGE: Ia,
13954
13954
  CENTER: xs,
@@ -13957,11 +13957,11 @@ const Vu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
13957
13957
  MeshBVH: sn,
13958
13958
  OrientedBox: pt,
13959
13959
  SAH: Na,
13960
- StaticGeometryGenerator: wu,
13961
- acceleratedRaycast: vu,
13962
- computeBoundsTree: bu
13960
+ StaticGeometryGenerator: wh,
13961
+ acceleratedRaycast: vh,
13962
+ computeBoundsTree: bh
13963
13963
  }, Symbol.toStringTag, { value: "Module" }));
13964
- class Ju {
13964
+ class Jh {
13965
13965
  constructor(t) {
13966
13966
  this.name = "WorkerBase", this.running = !1, this.worker = t, this.worker.onerror = (e) => {
13967
13967
  throw e.message ? new Error(`${this.name}: Could not create Web Worker with error "${e.message}"`) : new Error(`${this.name}: Could not create Web Worker.`);
@@ -13989,14 +13989,14 @@ const Et = {
13989
13989
  material: "material",
13990
13990
  camera: "camera",
13991
13991
  light: "light"
13992
- }, Ne = "KHR_animation_pointer", Eu = {
13992
+ }, Ne = "KHR_animation_pointer", Eh = {
13993
13993
  // We use a custom interpolant (GLTFCubicSplineInterpolation) for CUBICSPLINE tracks. Each
13994
13994
  // keyframe track will be initialized with a default interpolation type, then modified.
13995
13995
  CUBICSPLINE: void 0,
13996
13996
  LINEAR: Uo,
13997
13997
  STEP: Qa
13998
13998
  };
13999
- class ku {
13999
+ class kh {
14000
14000
  /** @type {import("three/examples/jsm/loaders/GLTFLoader").GLTFParser} */
14001
14001
  constructor(t) {
14002
14002
  this.name = Ne, this.parser = t, this.animationPointerResolver = null;
@@ -14013,7 +14013,7 @@ class ku {
14013
14013
  return this.parser.getDependency("node", i);
14014
14014
  }
14015
14015
  loadAnimationTargetFromChannelWithAnimationPointer(t) {
14016
- Au();
14016
+ Ah();
14017
14017
  const e = t.target, i = e.extensions && e.extensions[Ne] && e.path && e.path === "pointer";
14018
14018
  if (!i) return null;
14019
14019
  let r, s = Et.node, a;
@@ -14030,8 +14030,8 @@ class ku {
14030
14030
  }
14031
14031
  switch (s) {
14032
14032
  case Et.material:
14033
- const h = ("/materials/" + a.toString() + "/").length, u = l.substring(0, h);
14034
- switch (r = l.substring(h), r) {
14033
+ const u = ("/materials/" + a.toString() + "/").length, h = l.substring(0, u);
14034
+ switch (r = l.substring(u), r) {
14035
14035
  // Core Spec PBR Properties
14036
14036
  case "pbrMetallicRoughness/baseColorFactor":
14037
14037
  r = "color";
@@ -14125,7 +14125,7 @@ class ku {
14125
14125
  r = "specularColor";
14126
14126
  break;
14127
14127
  }
14128
- l = u + r;
14128
+ l = h + r;
14129
14129
  break;
14130
14130
  case Et.node:
14131
14131
  const f = ("/nodes/" + a.toString() + "/").length, d = l.substring(0, f);
@@ -14209,8 +14209,8 @@ class ku {
14209
14209
  const c = [];
14210
14210
  o = o.replaceAll("/", ".");
14211
14211
  const l = o.split(".");
14212
- var u = t.name !== void 0 && t.name !== null ? t.name : t.uuid;
14213
- if (l[2] = u, l[3] === "morphTargetInfluences" && t.type === "Group") {
14212
+ var h = t.name !== void 0 && t.name !== null ? t.name : t.uuid;
14213
+ if (l[2] = h, l[3] === "morphTargetInfluences" && t.type === "Group") {
14214
14214
  for (const d of t.children)
14215
14215
  d instanceof Ka && d.morphTargetInfluences && (l[3] = d.name, l[4] = "morphTargetInfluences", f(this.parser));
14216
14216
  return c;
@@ -14235,7 +14235,7 @@ class ku {
14235
14235
  console.warn("Unsupported output accessor format", i);
14236
14236
  return;
14237
14237
  }
14238
- const _ = r.interpolation !== void 0 ? Eu[r.interpolation] : Uo;
14238
+ const _ = r.interpolation !== void 0 ? Eh[r.interpolation] : Uo;
14239
14239
  let p = d._getArrayFromAccessor(i);
14240
14240
  o.endsWith(".fov") && (p = p.map((v) => v / Math.PI * 180));
14241
14241
  const m = new y(
@@ -14270,18 +14270,18 @@ class ku {
14270
14270
  * @return {Promise<AnimationClip>}
14271
14271
  */
14272
14272
  loadAnimation(t) {
14273
- const e = this, i = this.parser.json, r = this.parser, s = i.animations[t], a = s.name ? s.name : "animation_" + t, o = [], c = [], l = [], h = [], u = [];
14273
+ const e = this, i = this.parser.json, r = this.parser, s = i.animations[t], a = s.name ? s.name : "animation_" + t, o = [], c = [], l = [], u = [], h = [];
14274
14274
  for (let f = 0, d = s.channels.length; f < d; f++) {
14275
14275
  const y = s.channels[f], _ = s.samplers[y.sampler], p = y.target, m = s.parameters !== void 0 ? s.parameters[_.input] : _.input, v = s.parameters !== void 0 ? s.parameters[_.output] : _.output;
14276
14276
  let g = e.loadAnimationTargetFromChannelWithAnimationPointer(y);
14277
- g || (g = e.loadAnimationTargetFromChannel(y)), o.push(g), c.push(r.getDependency("accessor", m)), l.push(r.getDependency("accessor", v)), h.push(_), u.push(p);
14277
+ g || (g = e.loadAnimationTargetFromChannel(y)), o.push(g), c.push(r.getDependency("accessor", m)), l.push(r.getDependency("accessor", v)), u.push(_), h.push(p);
14278
14278
  }
14279
14279
  return Promise.all([
14280
14280
  Promise.all(o),
14281
14281
  Promise.all(c),
14282
14282
  Promise.all(l),
14283
- Promise.all(h),
14284
- Promise.all(u)
14283
+ Promise.all(u),
14284
+ Promise.all(h)
14285
14285
  ]).then(function(f) {
14286
14286
  const d = f[0], y = f[1], _ = f[2], p = f[3], m = f[4], v = [];
14287
14287
  for (let g = 0, b = d.length; g < b; g++) {
@@ -14297,12 +14297,13 @@ class ku {
14297
14297
  });
14298
14298
  }
14299
14299
  }
14300
- let Ao = !1, Ru = null;
14301
- function Au() {
14300
+ let Ao = !1, Rh = null;
14301
+ function Ah() {
14302
14302
  if (Ao) return;
14303
14303
  Ao = !0;
14304
- const n = Ru ||= Ms.findNode;
14304
+ const n = Rh ||= Ms.findNode;
14305
14305
  Ms.findNode = function(t, e) {
14306
+ if (!e) return n(t, e);
14306
14307
  if (e.startsWith(".materials.")) {
14307
14308
  const i = e.substring(11).substring(e.indexOf(".")), r = i.indexOf("."), s = r < 0 ? i : i.substring(0, r);
14308
14309
  let a = null;
@@ -14334,32 +14335,32 @@ function Au() {
14334
14335
  return n(t, e);
14335
14336
  };
14336
14337
  }
14337
- const Gu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
14338
+ const Gh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
14338
14339
  __proto__: null,
14339
- GLTFAnimationPointerExtension: ku
14340
+ GLTFAnimationPointerExtension: kh
14340
14341
  }, Symbol.toStringTag, { value: "Module" }));
14341
14342
  export {
14342
14343
  Jc as $70d766613f57b014$export$2e2bcd8739ae039,
14343
- Fu as BatchedParticleRenderer,
14344
+ Fh as BatchedParticleRenderer,
14344
14345
  Do as Builder,
14345
14346
  Gr as ByteBuffer,
14346
14347
  ei as ConstantColor,
14347
14348
  J as ConstantValue,
14348
14349
  Qt as Matrix4,
14349
14350
  sn as MeshBVH,
14350
- Bu as MotionController,
14351
+ Bh as MotionController,
14351
14352
  Kn as ParticleSystem,
14352
14353
  A as RenderMode,
14353
- hc as SIZE_PREFIX_LENGTH,
14354
+ uc as SIZE_PREFIX_LENGTH,
14354
14355
  Zn as TrailParticle,
14355
14356
  wt as Vector4,
14356
- Ju as WorkerBase,
14357
- Iu as bundler,
14358
- Du as createNoise4D,
14359
- Ou as fetchProfile,
14360
- Lu as index,
14361
- Vu as index$1,
14362
- Gu as index$2,
14363
- Uu as md5,
14364
- Nu as v5
14357
+ Jh as WorkerBase,
14358
+ Ih as bundler,
14359
+ Dh as createNoise4D,
14360
+ Oh as fetchProfile,
14361
+ Lh as index,
14362
+ Vh as index$1,
14363
+ Gh as index$2,
14364
+ Uh as md5,
14365
+ Nh as v5
14365
14366
  };