hanc-webrtc-widgets 2.2.13 → 2.3.0

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.
@@ -592,7 +592,7 @@ function ye(i) {
592
592
  * Copyright 2017 Google LLC
593
593
  * SPDX-License-Identifier: BSD-3-Clause
594
594
  */
595
- function Ri(i) {
595
+ function An(i) {
596
596
  return ye({ ...i, state: !0, attribute: !1 });
597
597
  }
598
598
  /**
@@ -1532,10 +1532,10 @@ function zg(i, e) {
1532
1532
  }
1533
1533
  return i.filter((t) => t.no === e.no);
1534
1534
  }
1535
- let gi = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""), co = [];
1536
- for (let i = 0; i < gi.length; i++) co[gi[i].charCodeAt(0)] = i;
1537
- co[45] = gi.indexOf("+");
1538
- co[95] = gi.indexOf("/");
1535
+ let vi = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""), co = [];
1536
+ for (let i = 0; i < vi.length; i++) co[vi[i].charCodeAt(0)] = i;
1537
+ co[45] = vi.indexOf("+");
1538
+ co[95] = vi.indexOf("/");
1539
1539
  const Tf = {
1540
1540
  /**
1541
1541
  * Decodes a base64 string to a byte array.
@@ -1596,16 +1596,16 @@ const Tf = {
1596
1596
  for (let r = 0; r < i.length; r++)
1597
1597
  switch (n = i[r], t) {
1598
1598
  case 0:
1599
- e += gi[n >> 2], s = (n & 3) << 4, t = 1;
1599
+ e += vi[n >> 2], s = (n & 3) << 4, t = 1;
1600
1600
  break;
1601
1601
  case 1:
1602
- e += gi[s | n >> 4], s = (n & 15) << 2, t = 2;
1602
+ e += vi[s | n >> 4], s = (n & 15) << 2, t = 2;
1603
1603
  break;
1604
1604
  case 2:
1605
- e += gi[s | n >> 6], e += gi[n & 63], t = 0;
1605
+ e += vi[s | n >> 6], e += vi[n & 63], t = 0;
1606
1606
  break;
1607
1607
  }
1608
- return t && (e += gi[s], e += "=", t == 1 && (e += "=")), e;
1608
+ return t && (e += vi[s], e += "=", t == 1 && (e += "=")), e;
1609
1609
  }
1610
1610
  };
1611
1611
  function Gg(i, e, t) {
@@ -1682,14 +1682,14 @@ function pu(i, e) {
1682
1682
  break;
1683
1683
  }
1684
1684
  }
1685
- function vi(i, e) {
1685
+ function bi(i, e) {
1686
1686
  if (i === null || typeof i != "object" || !Object.getOwnPropertyNames(cd.prototype).every((n) => n in i && typeof i[n] == "function"))
1687
1687
  return !1;
1688
1688
  const t = i.getType();
1689
1689
  return t === null || typeof t != "function" || !("typeName" in t) || typeof t.typeName != "string" ? !1 : e === void 0 ? !0 : t.typeName == e.typeName;
1690
1690
  }
1691
1691
  function wf(i, e) {
1692
- return vi(e) || !i.fieldWrapper ? e : i.fieldWrapper.wrapField(e);
1692
+ return bi(e) || !i.fieldWrapper ? e : i.fieldWrapper.wrapField(e);
1693
1693
  }
1694
1694
  Z.DOUBLE, Z.FLOAT, Z.INT64, Z.UINT64, Z.INT32, Z.UINT32, Z.BOOL, Z.STRING, Z.BYTES;
1695
1695
  const mu = {
@@ -1713,7 +1713,7 @@ function jg() {
1713
1713
  makeWriteOptions: qg,
1714
1714
  readMessage(i, e, t, n) {
1715
1715
  if (e == null || Array.isArray(e) || typeof e != "object")
1716
- throw new Error("cannot decode message ".concat(i.typeName, " from JSON: ").concat(jn(e)));
1716
+ throw new Error("cannot decode message ".concat(i.typeName, " from JSON: ").concat(Xn(e)));
1717
1717
  n = n ?? new i();
1718
1718
  const s = /* @__PURE__ */ new Map(), r = t.typeRegistry;
1719
1719
  for (const [a, o] of Object.entries(e)) {
@@ -1780,10 +1780,10 @@ function jg() {
1780
1780
  if (e !== void 0 && (t || Sf(i, e)))
1781
1781
  return ka(i, e);
1782
1782
  },
1783
- debug: jn
1783
+ debug: Xn
1784
1784
  };
1785
1785
  }
1786
- function jn(i) {
1786
+ function Xn(i) {
1787
1787
  if (i === null)
1788
1788
  return "null";
1789
1789
  switch (typeof i) {
@@ -1801,11 +1801,11 @@ function vu(i, e, t, n, s) {
1801
1801
  if (kt(t.kind != "map"), e === null)
1802
1802
  return;
1803
1803
  if (!Array.isArray(e))
1804
- throw new Error("cannot decode field ".concat(s.typeName, ".").concat(t.name, " from JSON: ").concat(jn(e)));
1804
+ throw new Error("cannot decode field ".concat(s.typeName, ".").concat(t.name, " from JSON: ").concat(Xn(e)));
1805
1805
  const a = i[r];
1806
1806
  for (const o of e) {
1807
1807
  if (o === null)
1808
- throw new Error("cannot decode field ".concat(s.typeName, ".").concat(t.name, " from JSON: ").concat(jn(o)));
1808
+ throw new Error("cannot decode field ".concat(s.typeName, ".").concat(t.name, " from JSON: ").concat(Xn(o)));
1809
1809
  switch (t.kind) {
1810
1810
  case "message":
1811
1811
  a.push(t.T.fromJson(o, n));
@@ -1818,7 +1818,7 @@ function vu(i, e, t, n, s) {
1818
1818
  try {
1819
1819
  a.push(Nr(t.T, o, t.L, !0));
1820
1820
  } catch (l) {
1821
- let d = "cannot decode field ".concat(s.typeName, ".").concat(t.name, " from JSON: ").concat(jn(o));
1821
+ let d = "cannot decode field ".concat(s.typeName, ".").concat(t.name, " from JSON: ").concat(Xn(o));
1822
1822
  throw l instanceof Error && l.message.length > 0 && (d += ": ".concat(l.message)), new Error(d);
1823
1823
  }
1824
1824
  break;
@@ -1828,7 +1828,7 @@ function vu(i, e, t, n, s) {
1828
1828
  if (e === null)
1829
1829
  return;
1830
1830
  if (typeof e != "object" || Array.isArray(e))
1831
- throw new Error("cannot decode field ".concat(s.typeName, ".").concat(t.name, " from JSON: ").concat(jn(e)));
1831
+ throw new Error("cannot decode field ".concat(s.typeName, ".").concat(t.name, " from JSON: ").concat(Xn(e)));
1832
1832
  const a = i[r];
1833
1833
  for (const [o, c] of Object.entries(e)) {
1834
1834
  if (c === null)
@@ -1837,7 +1837,7 @@ function vu(i, e, t, n, s) {
1837
1837
  try {
1838
1838
  l = Xg(t.K, o);
1839
1839
  } catch (d) {
1840
- let u = "cannot decode map key for field ".concat(s.typeName, ".").concat(t.name, " from JSON: ").concat(jn(e));
1840
+ let u = "cannot decode map key for field ".concat(s.typeName, ".").concat(t.name, " from JSON: ").concat(Xn(e));
1841
1841
  throw d instanceof Error && d.message.length > 0 && (u += ": ".concat(d.message)), new Error(u);
1842
1842
  }
1843
1843
  switch (t.V.kind) {
@@ -1852,7 +1852,7 @@ function vu(i, e, t, n, s) {
1852
1852
  try {
1853
1853
  a[l] = Nr(t.V.T, c, Yi.BIGINT, !0);
1854
1854
  } catch (u) {
1855
- let h = "cannot decode map value for field ".concat(s.typeName, ".").concat(t.name, " from JSON: ").concat(jn(e));
1855
+ let h = "cannot decode map value for field ".concat(s.typeName, ".").concat(t.name, " from JSON: ").concat(Xn(e));
1856
1856
  throw u instanceof Error && u.message.length > 0 && (h += ": ".concat(u.message)), new Error(h);
1857
1857
  }
1858
1858
  break;
@@ -1867,7 +1867,7 @@ function vu(i, e, t, n, s) {
1867
1867
  if (e === null && a.typeName != "google.protobuf.Value")
1868
1868
  return;
1869
1869
  let o = i[r];
1870
- vi(o) ? o.fromJson(e, n) : (i[r] = o = a.fromJson(e, n), a.fieldWrapper && !t.oneof && (i[r] = a.fieldWrapper.unwrapField(o)));
1870
+ bi(o) ? o.fromJson(e, n) : (i[r] = o = a.fromJson(e, n), a.fieldWrapper && !t.oneof && (i[r] = a.fieldWrapper.unwrapField(o)));
1871
1871
  break;
1872
1872
  case "enum":
1873
1873
  const c = ko(t.T, e, n.ignoreUnknownFields, !1);
@@ -1894,7 +1894,7 @@ function vu(i, e, t, n, s) {
1894
1894
  break;
1895
1895
  }
1896
1896
  } catch (l) {
1897
- let d = "cannot decode field ".concat(s.typeName, ".").concat(t.name, " from JSON: ").concat(jn(e));
1897
+ let d = "cannot decode field ".concat(s.typeName, ".").concat(t.name, " from JSON: ").concat(Xn(e));
1898
1898
  throw l instanceof Error && l.message.length > 0 && (d += ": ".concat(l.message)), new Error(d);
1899
1899
  }
1900
1900
  break;
@@ -1989,7 +1989,7 @@ function ko(i, e, t, n) {
1989
1989
  return Pa;
1990
1990
  break;
1991
1991
  }
1992
- throw new Error("cannot decode enum ".concat(i.typeName, " from JSON: ").concat(jn(e)));
1992
+ throw new Error("cannot decode enum ".concat(i.typeName, " from JSON: ").concat(Xn(e)));
1993
1993
  }
1994
1994
  function $g(i) {
1995
1995
  return i.repeated || i.kind == "map" ? !0 : !(i.oneof || i.kind == "message" || i.opt || i.req);
@@ -2182,7 +2182,7 @@ function Su(i, e, t, n, s) {
2182
2182
  break;
2183
2183
  case "message":
2184
2184
  const l = t.T;
2185
- r ? i[a].push(Ia(e, new l(), s, t)) : vi(i[a]) ? Ia(e, i[a], s, t) : (i[a] = Ia(e, new l(), s, t), l.fieldWrapper && !t.oneof && !t.repeated && (i[a] = l.fieldWrapper.unwrapField(i[a])));
2185
+ r ? i[a].push(Ia(e, new l(), s, t)) : bi(i[a]) ? Ia(e, i[a], s, t) : (i[a] = Ia(e, new l(), s, t), l.fieldWrapper && !t.oneof && !t.repeated && (i[a] = l.fieldWrapper.unwrapField(i[a])));
2186
2186
  break;
2187
2187
  case "map":
2188
2188
  let [d, u] = Zg(t, e, s);
@@ -2392,7 +2392,7 @@ function nv() {
2392
2392
  continue;
2393
2393
  const c = n.findField(o);
2394
2394
  let l = a[s].value;
2395
- c && c.kind == "message" && !vi(l, c.T) ? l = new c.T(l) : c && c.kind === "scalar" && c.T === Z.BYTES && (l = mr(l)), r[s] = {
2395
+ c && c.kind == "message" && !bi(l, c.T) ? l = new c.T(l) : c && c.kind === "scalar" && c.T === Z.BYTES && (l = mr(l)), r[s] = {
2396
2396
  case: o,
2397
2397
  value: l
2398
2398
  };
@@ -2424,10 +2424,10 @@ function nv() {
2424
2424
  case "message":
2425
2425
  const u = n.T;
2426
2426
  if (n.repeated)
2427
- r[s] = a[s].map((h) => vi(h, u) ? h : new u(h));
2427
+ r[s] = a[s].map((h) => bi(h, u) ? h : new u(h));
2428
2428
  else {
2429
2429
  const h = a[s];
2430
- u.fieldWrapper ? /* We can't use BytesValue.typeName as that will create a circular import */ u.typeName === "google.protobuf.BytesValue" ? r[s] = mr(h) : r[s] = h : r[s] = vi(h, u) ? h : new u(h);
2430
+ u.fieldWrapper ? /* We can't use BytesValue.typeName as that will create a circular import */ u.typeName === "google.protobuf.BytesValue" ? r[s] = mr(h) : r[s] = h : r[s] = bi(h, u) ? h : new u(h);
2431
2431
  }
2432
2432
  break;
2433
2433
  }
@@ -2453,7 +2453,7 @@ function nv() {
2453
2453
  switch (n.kind) {
2454
2454
  case "message":
2455
2455
  let a = s, o = r;
2456
- return n.T.fieldWrapper && (a !== void 0 && !vi(a) && (a = n.T.fieldWrapper.wrapField(a)), o !== void 0 && !vi(o) && (o = n.T.fieldWrapper.wrapField(o))), n.T.equals(a, o);
2456
+ return n.T.fieldWrapper && (a !== void 0 && !bi(a) && (a = n.T.fieldWrapper.wrapField(a)), o !== void 0 && !bi(o) && (o = n.T.fieldWrapper.wrapField(o))), n.T.equals(a, o);
2457
2457
  case "enum":
2458
2458
  return ki(Z.INT32, s, r);
2459
2459
  case "scalar":
@@ -2518,7 +2518,7 @@ function nv() {
2518
2518
  function sa(i) {
2519
2519
  if (i === void 0)
2520
2520
  return i;
2521
- if (vi(i))
2521
+ if (bi(i))
2522
2522
  return i.clone();
2523
2523
  if (i instanceof Uint8Array) {
2524
2524
  const e = new Uint8Array(i.byteLength);
@@ -2915,7 +2915,7 @@ const fv = /* @__PURE__ */ z.makeMessageType("livekit.MetricsBatch", () => [{
2915
2915
  }, {
2916
2916
  no: 2,
2917
2917
  name: "REGRESSION"
2918
- }]), Ln = /* @__PURE__ */ z.makeEnum("livekit.TrackType", [{
2918
+ }]), Nn = /* @__PURE__ */ z.makeEnum("livekit.TrackType", [{
2919
2919
  no: 0,
2920
2920
  name: "AUDIO"
2921
2921
  }, {
@@ -2972,7 +2972,7 @@ const fv = /* @__PURE__ */ z.makeMessageType("livekit.MetricsBatch", () => [{
2972
2972
  }, {
2973
2973
  no: 2,
2974
2974
  name: "ENABLED"
2975
- }]), Fn = /* @__PURE__ */ z.makeEnum("livekit.DisconnectReason", [{
2975
+ }]), Bn = /* @__PURE__ */ z.makeEnum("livekit.DisconnectReason", [{
2976
2976
  no: 0,
2977
2977
  name: "UNKNOWN_REASON"
2978
2978
  }, {
@@ -3303,7 +3303,7 @@ const fv = /* @__PURE__ */ z.makeMessageType("livekit.MetricsBatch", () => [{
3303
3303
  no: 16,
3304
3304
  name: "disconnect_reason",
3305
3305
  kind: "enum",
3306
- T: z.getEnumType(Fn)
3306
+ T: z.getEnumType(Bn)
3307
3307
  }, {
3308
3308
  no: 18,
3309
3309
  name: "kind_details",
@@ -3386,7 +3386,7 @@ const fv = /* @__PURE__ */ z.makeMessageType("livekit.MetricsBatch", () => [{
3386
3386
  no: 2,
3387
3387
  name: "type",
3388
3388
  kind: "enum",
3389
- T: z.getEnumType(Ln)
3389
+ T: z.getEnumType(Nn)
3390
3390
  }, {
3391
3391
  no: 3,
3392
3392
  name: "name",
@@ -4286,7 +4286,7 @@ const fv = /* @__PURE__ */ z.makeMessageType("livekit.MetricsBatch", () => [{
4286
4286
  }
4287
4287
  }], {
4288
4288
  localName: "DataStream_Trailer"
4289
- }), Nn = /* @__PURE__ */ z.makeEnum("livekit.SignalTarget", [{
4289
+ }), Un = /* @__PURE__ */ z.makeEnum("livekit.SignalTarget", [{
4290
4290
  no: 0,
4291
4291
  name: "PUBLISHER"
4292
4292
  }, {
@@ -4377,7 +4377,7 @@ const fv = /* @__PURE__ */ z.makeMessageType("livekit.MetricsBatch", () => [{
4377
4377
  no: 13,
4378
4378
  name: "simulate",
4379
4379
  kind: "message",
4380
- T: qn,
4380
+ T: jn,
4381
4381
  oneof: "message"
4382
4382
  }, {
4383
4383
  no: 14,
@@ -4575,7 +4575,7 @@ const fv = /* @__PURE__ */ z.makeMessageType("livekit.MetricsBatch", () => [{
4575
4575
  no: 3,
4576
4576
  name: "type",
4577
4577
  kind: "enum",
4578
- T: z.getEnumType(Ln)
4578
+ T: z.getEnumType(Nn)
4579
4579
  }, {
4580
4580
  no: 4,
4581
4581
  name: "width",
@@ -4667,7 +4667,7 @@ const fv = /* @__PURE__ */ z.makeMessageType("livekit.MetricsBatch", () => [{
4667
4667
  no: 2,
4668
4668
  name: "target",
4669
4669
  kind: "enum",
4670
- T: z.getEnumType(Nn)
4670
+ T: z.getEnumType(Un)
4671
4671
  }, {
4672
4672
  no: 3,
4673
4673
  name: "final",
@@ -4934,7 +4934,7 @@ const fv = /* @__PURE__ */ z.makeMessageType("livekit.MetricsBatch", () => [{
4934
4934
  no: 2,
4935
4935
  name: "reason",
4936
4936
  kind: "enum",
4937
- T: z.getEnumType(Fn)
4937
+ T: z.getEnumType(Bn)
4938
4938
  }, {
4939
4939
  no: 3,
4940
4940
  name: "action",
@@ -5253,8 +5253,8 @@ const fv = /* @__PURE__ */ z.makeMessageType("livekit.MetricsBatch", () => [{
5253
5253
  no: 3,
5254
5254
  name: "target",
5255
5255
  kind: "enum",
5256
- T: z.getEnumType(Nn)
5257
- }]), qn = /* @__PURE__ */ z.makeMessageType("livekit.SimulateScenario", () => [{
5256
+ T: z.getEnumType(Un)
5257
+ }]), jn = /* @__PURE__ */ z.makeMessageType("livekit.SimulateScenario", () => [{
5258
5258
  no: 1,
5259
5259
  name: "speaker_update",
5260
5260
  kind: "scalar",
@@ -5545,14 +5545,14 @@ var fo = Jv(), Lc;
5545
5545
  (function(i) {
5546
5546
  i[i.trace = 0] = "trace", i[i.debug = 1] = "debug", i[i.info = 2] = "info", i[i.warn = 3] = "warn", i[i.error = 4] = "error", i[i.silent = 5] = "silent";
5547
5547
  })(Lc || (Lc = {}));
5548
- var Vn;
5548
+ var zn;
5549
5549
  (function(i) {
5550
5550
  i.Default = "livekit", i.Room = "livekit-room", i.Participant = "livekit-participant", i.Track = "livekit-track", i.Publication = "livekit-track-publication", i.Engine = "livekit-engine", i.Signal = "livekit-signal", i.PCManager = "livekit-pc-manager", i.PCTransport = "livekit-pc-transport", i.E2EE = "lk-e2ee";
5551
- })(Vn || (Vn = {}));
5551
+ })(zn || (zn = {}));
5552
5552
  let $e = fo.getLogger("livekit");
5553
- Object.values(Vn).map((i) => fo.getLogger(i));
5553
+ Object.values(zn).map((i) => fo.getLogger(i));
5554
5554
  $e.setDefaultLevel(Lc.info);
5555
- function Ci(i) {
5555
+ function Ei(i) {
5556
5556
  const e = fo.getLogger(i);
5557
5557
  return e.setDefaultLevel($e.getLevel()), e;
5558
5558
  }
@@ -5612,7 +5612,7 @@ function wu(i) {
5612
5612
  };
5613
5613
  throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.");
5614
5614
  }
5615
- function bi(i) {
5615
+ function _i(i) {
5616
5616
  if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
5617
5617
  var e = i[Symbol.asyncIterator], t;
5618
5618
  return e ? e.call(i) : (i = typeof wu == "function" ? wu(i) : i[Symbol.iterator](), t = {}, n("next"), n("throw"), n("return"), t[Symbol.asyncIterator] = function() {
@@ -5838,7 +5838,7 @@ function n0() {
5838
5838
  }
5839
5839
  return ra.exports;
5840
5840
  }
5841
- var ri = n0();
5841
+ var ai = n0();
5842
5842
  let rp = !0, ap = !0;
5843
5843
  function Rr(i, e, t) {
5844
5844
  const n = i.match(e);
@@ -7390,7 +7390,7 @@ function m0() {
7390
7390
  return typeof window.RTCRtpSender < "u" && // @ts-ignore
7391
7391
  typeof window.RTCRtpSender.prototype.createEncodedStreams < "u";
7392
7392
  }
7393
- class zE extends ri.EventEmitter {
7393
+ class zE extends ai.EventEmitter {
7394
7394
  constructor() {
7395
7395
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
7396
7396
  super(), this.onKeyRatcheted = (t, n, s) => {
@@ -7436,7 +7436,7 @@ var Ye;
7436
7436
  (function(i) {
7437
7437
  i[i.NotAllowed = 0] = "NotAllowed", i[i.ServerUnreachable = 1] = "ServerUnreachable", i[i.InternalError = 2] = "InternalError", i[i.Cancelled = 3] = "Cancelled", i[i.LeaveRequest = 4] = "LeaveRequest", i[i.Timeout = 5] = "Timeout";
7438
7438
  })(Ye || (Ye = {}));
7439
- class bt extends Pi {
7439
+ class St extends Pi {
7440
7440
  constructor(e, t, n, s) {
7441
7441
  super(1, e), this.name = "ConnectionError", this.status = n, this.reason = t, this.context = s, this.reasonName = Ye[t];
7442
7442
  }
@@ -7446,7 +7446,7 @@ class vd extends Pi {
7446
7446
  super(21, e ?? "device is unsupported"), this.name = "DeviceUnsupportedError";
7447
7447
  }
7448
7448
  }
7449
- class _i extends Pi {
7449
+ class yi extends Pi {
7450
7450
  constructor(e) {
7451
7451
  super(20, e ?? "track is invalid"), this.name = "TrackInvalidError";
7452
7452
  }
@@ -7476,13 +7476,13 @@ class Bu extends Pi {
7476
7476
  super(15, e), this.reason = t, this.reasonName = typeof t == "string" ? t : md[t];
7477
7477
  }
7478
7478
  }
7479
- var Un;
7479
+ var On;
7480
7480
  (function(i) {
7481
7481
  i[i.AlreadyOpened = 0] = "AlreadyOpened", i[i.AbnormalEnd = 1] = "AbnormalEnd", i[i.DecodeFailed = 2] = "DecodeFailed", i[i.LengthExceeded = 3] = "LengthExceeded", i[i.Incomplete = 4] = "Incomplete", i[i.HandlerAlreadyRegistered = 7] = "HandlerAlreadyRegistered";
7482
- })(Un || (Un = {}));
7482
+ })(On || (On = {}));
7483
7483
  class Gi extends Pi {
7484
7484
  constructor(e, t) {
7485
- super(16, e), this.name = "DataStreamError", this.reason = t, this.reasonName = Un[t];
7485
+ super(16, e), this.name = "DataStreamError", this.reason = t, this.reasonName = On[t];
7486
7486
  }
7487
7487
  }
7488
7488
  var Qa;
@@ -7603,7 +7603,7 @@ var _n;
7603
7603
  (function(i) {
7604
7604
  i[i.LOW = 0] = "LOW", i[i.MEDIUM = 1] = "MEDIUM", i[i.HIGH = 2] = "HIGH";
7605
7605
  })(_n || (_n = {}));
7606
- class J extends ri.EventEmitter {
7606
+ class J extends ai.EventEmitter {
7607
7607
  /**
7608
7608
  * indicates current state of stream, it'll indicate `paused` if the track
7609
7609
  * has been paused by congestion controller
@@ -7620,7 +7620,7 @@ class J extends ri.EventEmitter {
7620
7620
  var s;
7621
7621
  super(), this.attachedElements = [], this.isMuted = !1, this._streamState = J.StreamState.Active, this.isInBackground = !1, this._currentBitrate = 0, this.log = $e, this.appVisibilityChangedListener = () => {
7622
7622
  this.backgroundTimeout && clearTimeout(this.backgroundTimeout), document.visibilityState === "hidden" ? this.backgroundTimeout = setTimeout(() => this.handleAppVisibilityChanged(), T0) : this.handleAppVisibilityChanged();
7623
- }, this.log = Ci((s = n.loggerName) !== null && s !== void 0 ? s : Vn.Track), this.loggerContextCb = n.loggerContextCb, this.setMaxListeners(100), this.kind = t, this._mediaStreamTrack = e, this._mediaStreamID = e.id, this.source = J.Source.Unknown;
7623
+ }, this.log = Ei((s = n.loggerName) !== null && s !== void 0 ? s : zn.Track), this.loggerContextCb = n.loggerContextCb, this.setMaxListeners(100), this.kind = t, this._mediaStreamTrack = e, this._mediaStreamID = e.id, this.source = J.Source.Unknown;
7624
7624
  }
7625
7625
  get logContext() {
7626
7626
  var e;
@@ -7684,7 +7684,7 @@ class J extends ri.EventEmitter {
7684
7684
  }
7685
7685
  /** @internal */
7686
7686
  updateLoggerOptions(e) {
7687
- e.loggerName && (this.log = Ci(e.loggerName)), e.loggerContextCb && (this.loggerContextCb = e.loggerContextCb);
7687
+ e.loggerName && (this.log = Ei(e.loggerName)), e.loggerContextCb && (this.loggerContextCb = e.loggerContextCb);
7688
7688
  }
7689
7689
  recycleElement(e) {
7690
7690
  if (e instanceof HTMLAudioElement) {
@@ -7740,19 +7740,19 @@ function Ys(i, e) {
7740
7740
  function s(l) {
7741
7741
  switch (l) {
7742
7742
  case e.Audio:
7743
- return Ln.AUDIO;
7743
+ return Nn.AUDIO;
7744
7744
  case e.Video:
7745
- return Ln.VIDEO;
7745
+ return Nn.VIDEO;
7746
7746
  default:
7747
- return Ln.DATA;
7747
+ return Nn.DATA;
7748
7748
  }
7749
7749
  }
7750
7750
  i.kindToProto = s;
7751
7751
  function r(l) {
7752
7752
  switch (l) {
7753
- case Ln.AUDIO:
7753
+ case Nn.AUDIO:
7754
7754
  return e.Audio;
7755
- case Ln.VIDEO:
7755
+ case Nn.VIDEO:
7756
7756
  return e.Video;
7757
7757
  default:
7758
7758
  return e.Unknown;
@@ -7916,7 +7916,7 @@ function P0() {
7916
7916
  return !1;
7917
7917
  if (xs()) {
7918
7918
  const t = yn();
7919
- if (t != null && t.version && ii(t.version, "16") < 0 || (t == null ? void 0 : t.os) === "iOS" && (t != null && t.osVersion) && ii(t.osVersion, "16") < 0)
7919
+ if (t != null && t.version && si(t.version, "16") < 0 || (t == null ? void 0 : t.os) === "iOS" && (t != null && t.osVersion) && si(t.osVersion, "16") < 0)
7920
7920
  return !1;
7921
7921
  }
7922
7922
  const i = RTCRtpSender.getCapabilities("video");
@@ -7930,7 +7930,7 @@ function P0() {
7930
7930
  }
7931
7931
  return e;
7932
7932
  }
7933
- function $n(i) {
7933
+ function Kn(i) {
7934
7934
  return i === "av1" || i === "vp9";
7935
7935
  }
7936
7936
  function Xc(i) {
@@ -7953,10 +7953,10 @@ function qr() {
7953
7953
  }
7954
7954
  function I0() {
7955
7955
  const i = yn();
7956
- return (i == null ? void 0 : i.name) === "Safari" && i.version.startsWith("17.") || (i == null ? void 0 : i.os) === "iOS" && !!(i != null && i.osVersion) && ii(i.osVersion, "17") >= 0;
7956
+ return (i == null ? void 0 : i.name) === "Safari" && i.version.startsWith("17.") || (i == null ? void 0 : i.os) === "iOS" && !!(i != null && i.osVersion) && si(i.osVersion, "17") >= 0;
7957
7957
  }
7958
7958
  function D0(i) {
7959
- return i || (i = yn()), (i == null ? void 0 : i.name) === "Safari" && ii(i.version, "18.3") > 0 || (i == null ? void 0 : i.os) === "iOS" && !!(i != null && i.osVersion) && ii(i.osVersion, "18.3") > 0;
7959
+ return i || (i = yn()), (i == null ? void 0 : i.name) === "Safari" && si(i.version, "18.3") > 0 || (i == null ? void 0 : i.os) === "iOS" && !!(i != null && i.osVersion) && si(i.osVersion, "18.3") > 0;
7960
7960
  }
7961
7961
  function Op() {
7962
7962
  var i, e;
@@ -7968,12 +7968,12 @@ function Op() {
7968
7968
  function L0() {
7969
7969
  const i = yn(), e = "17.2";
7970
7970
  if (i)
7971
- return i.name !== "Safari" && i.os !== "iOS" || i.os === "iOS" && i.osVersion && ii(i.osVersion, e) >= 0 ? !0 : i.name === "Safari" && ii(i.version, e) >= 0;
7971
+ return i.name !== "Safari" && i.os !== "iOS" || i.os === "iOS" && i.osVersion && si(i.osVersion, e) >= 0 ? !0 : i.name === "Safari" && si(i.version, e) >= 0;
7972
7972
  }
7973
7973
  function un() {
7974
7974
  return typeof document < "u";
7975
7975
  }
7976
- function ni() {
7976
+ function ii() {
7977
7977
  return navigator.product == "ReactNative";
7978
7978
  }
7979
7979
  function $c(i) {
@@ -7984,7 +7984,7 @@ function Fp() {
7984
7984
  return global.LiveKitReactNativeGlobal;
7985
7985
  }
7986
7986
  function Bp() {
7987
- if (!ni())
7987
+ if (!ii())
7988
7988
  return;
7989
7989
  let i = Fp();
7990
7990
  if (i)
@@ -7993,14 +7993,14 @@ function Bp() {
7993
7993
  function Hu() {
7994
7994
  if (un())
7995
7995
  return window.devicePixelRatio;
7996
- if (ni()) {
7996
+ if (ii()) {
7997
7997
  let i = Fp();
7998
7998
  if (i)
7999
7999
  return i.devicePixelRatio;
8000
8000
  }
8001
8001
  return 1;
8002
8002
  }
8003
- function ii(i, e) {
8003
+ function si(i, e) {
8004
8004
  const t = i.split("."), n = e.split("."), s = Math.min(t.length, n.length);
8005
8005
  for (let r = 0; r < s; ++r) {
8006
8006
  const a = parseInt(t[r], 10), o = parseInt(n[r], 10);
@@ -8032,7 +8032,7 @@ function O0() {
8032
8032
  protocol: x0,
8033
8033
  version: S0
8034
8034
  });
8035
- return ni() && (e.os = (i = Bp()) !== null && i !== void 0 ? i : ""), e;
8035
+ return ii() && (e.os = (i = Bp()) !== null && i !== void 0 ? i : ""), e;
8036
8036
  }
8037
8037
  function ju() {
8038
8038
  let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 16, e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 16, t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1, n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1;
@@ -8057,7 +8057,7 @@ function Fo() {
8057
8057
  }
8058
8058
  return _r.clone();
8059
8059
  }
8060
- class Kn {
8060
+ class Yn {
8061
8061
  get isResolved() {
8062
8062
  return this._isResolved;
8063
8063
  }
@@ -8133,13 +8133,13 @@ function Xu(i) {
8133
8133
  case Ye.LeaveRequest:
8134
8134
  return i.context;
8135
8135
  case Ye.Cancelled:
8136
- return Fn.CLIENT_INITIATED;
8136
+ return Bn.CLIENT_INITIATED;
8137
8137
  case Ye.NotAllowed:
8138
- return Fn.USER_REJECTED;
8138
+ return Bn.USER_REJECTED;
8139
8139
  case Ye.ServerUnreachable:
8140
- return Fn.JOIN_FAILURE;
8140
+ return Bn.JOIN_FAILURE;
8141
8141
  default:
8142
- return Fn.UNKNOWN_REASON;
8142
+ return Bn.UNKNOWN_REASON;
8143
8143
  }
8144
8144
  }
8145
8145
  function Va(i) {
@@ -8151,7 +8151,7 @@ function cs(i) {
8151
8151
  function Js(i) {
8152
8152
  return !!i && !(i instanceof MediaStreamTrack) && i.isLocal;
8153
8153
  }
8154
- function Zn(i) {
8154
+ function Qn(i) {
8155
8155
  return !!i && i.kind == J.Kind.Audio;
8156
8156
  }
8157
8157
  function Ji(i) {
@@ -8160,8 +8160,8 @@ function Ji(i) {
8160
8160
  function Ii(i) {
8161
8161
  return Js(i) && Ji(i);
8162
8162
  }
8163
- function hi(i) {
8164
- return Js(i) && Zn(i);
8163
+ function fi(i) {
8164
+ return Js(i) && Qn(i);
8165
8165
  }
8166
8166
  function Yc(i) {
8167
8167
  return !!i && !i.isLocal;
@@ -8398,7 +8398,7 @@ function J0(i, e) {
8398
8398
  var t;
8399
8399
  return (t = i.layers) === null || t === void 0 ? void 0 : t.find((n) => n.quality === e);
8400
8400
  }
8401
- class Z0 extends ri.EventEmitter {
8401
+ class Z0 extends ai.EventEmitter {
8402
8402
  constructor(e) {
8403
8403
  super(), this.onWorkerMessage = (t) => {
8404
8404
  var n, s;
@@ -8839,7 +8839,7 @@ class yd {
8839
8839
  var n;
8840
8840
  this.rtt = 0, this.state = Mt.DISCONNECTED, this.log = $e, this._requestId = 0, this.resetCallbacks = () => {
8841
8841
  this.onAnswer = void 0, this.onLeave = void 0, this.onLocalTrackPublished = void 0, this.onLocalTrackUnpublished = void 0, this.onNegotiateRequested = void 0, this.onOffer = void 0, this.onRemoteMuteChanged = void 0, this.onSubscribedQualityUpdate = void 0, this.onTokenRefresh = void 0, this.onTrickle = void 0, this.onClose = void 0;
8842
- }, this.log = Ci((n = t.loggerName) !== null && n !== void 0 ? n : Vn.Signal), this.loggerContextCb = t.loggerContextCb, this.useJSON = e, this.requestQueue = new Q0(), this.queuedRequests = [], this.closingLock = new hn(), this.connectionLock = new hn(), this.state = Mt.DISCONNECTED;
8842
+ }, this.log = Ei((n = t.loggerName) !== null && n !== void 0 ? n : zn.Signal), this.loggerContextCb = t.loggerContextCb, this.useJSON = e, this.requestQueue = new Q0(), this.queuedRequests = [], this.closingLock = new hn(), this.connectionLock = new hn(), this.state = Mt.DISCONNECTED;
8843
8843
  }
8844
8844
  get logContext() {
8845
8845
  var e, t;
@@ -8870,9 +8870,9 @@ class yd {
8870
8870
  const u = yield this.connectionLock.lock();
8871
8871
  try {
8872
8872
  const h = () => P(this, void 0, void 0, function* () {
8873
- this.close(), clearTimeout(f), d(new bt("room connection has been cancelled (signal)", Ye.Cancelled));
8873
+ this.close(), clearTimeout(f), d(new St("room connection has been cancelled (signal)", Ye.Cancelled));
8874
8874
  }), f = setTimeout(() => {
8875
- this.close(), d(new bt("room connection has timed out (signal)", Ye.ServerUnreachable));
8875
+ this.close(), d(new St("room connection has timed out (signal)", Ye.ServerUnreachable));
8876
8876
  }, n.websocketTimeout);
8877
8877
  s != null && s.aborted && h(), s == null || s.addEventListener("abort", h);
8878
8878
  const g = new URL(o);
@@ -8888,11 +8888,11 @@ class yd {
8888
8888
  const m = yield fetch(c);
8889
8889
  if (m.status.toFixed(0).startsWith("4")) {
8890
8890
  const p = yield m.text();
8891
- d(new bt(p, Ye.NotAllowed, m.status));
8891
+ d(new St(p, Ye.NotAllowed, m.status));
8892
8892
  } else
8893
- d(new bt("Encountered unknown websocket error during connection: ".concat(v.toString()), Ye.InternalError, m.status));
8893
+ d(new St("Encountered unknown websocket error during connection: ".concat(v.toString()), Ye.InternalError, m.status));
8894
8894
  } catch (m) {
8895
- d(new bt(m instanceof Error ? m.message : "server was not reachable", Ye.ServerUnreachable));
8895
+ d(new St(m instanceof Error ? m.message : "server was not reachable", Ye.ServerUnreachable));
8896
8896
  }
8897
8897
  return;
8898
8898
  }
@@ -8916,12 +8916,12 @@ class yd {
8916
8916
  if (((m = C.message) === null || m === void 0 ? void 0 : m.case) === "join" ? (this.state = Mt.CONNECTED, s == null || s.removeEventListener("abort", h), this.pingTimeoutDuration = C.message.value.pingTimeout, this.pingIntervalDuration = C.message.value.pingInterval, this.pingTimeoutDuration && this.pingTimeoutDuration > 0 && (this.log.debug("ping config", Object.assign(Object.assign({}, this.logContext), {
8917
8917
  timeout: this.pingTimeoutDuration,
8918
8918
  interval: this.pingIntervalDuration
8919
- })), this.startPingInterval()), l(C.message.value)) : this.state === Mt.RECONNECTING && C.message.case !== "leave" ? (this.state = Mt.CONNECTED, s == null || s.removeEventListener("abort", h), this.startPingInterval(), ((p = C.message) === null || p === void 0 ? void 0 : p.case) === "reconnect" ? l(C.message.value) : (this.log.debug("declaring signal reconnected without reconnect response received", this.logContext), l(void 0), b = !0)) : this.isEstablishingConnection && C.message.case === "leave" ? d(new bt("Received leave request while trying to (re)connect", Ye.LeaveRequest, void 0, C.message.value.reason)) : n.reconnect || d(new bt("did not receive join response, got ".concat((x = C.message) === null || x === void 0 ? void 0 : x.case, " instead"), Ye.InternalError)), !b)
8919
+ })), this.startPingInterval()), l(C.message.value)) : this.state === Mt.RECONNECTING && C.message.case !== "leave" ? (this.state = Mt.CONNECTED, s == null || s.removeEventListener("abort", h), this.startPingInterval(), ((p = C.message) === null || p === void 0 ? void 0 : p.case) === "reconnect" ? l(C.message.value) : (this.log.debug("declaring signal reconnected without reconnect response received", this.logContext), l(void 0), b = !0)) : this.isEstablishingConnection && C.message.case === "leave" ? d(new St("Received leave request while trying to (re)connect", Ye.LeaveRequest, void 0, C.message.value.reason)) : n.reconnect || d(new St("did not receive join response, got ".concat((x = C.message) === null || x === void 0 ? void 0 : x.case, " instead"), Ye.InternalError)), !b)
8920
8920
  return;
8921
8921
  }
8922
8922
  this.signalLatency && (yield fn(this.signalLatency)), this.handleSignalResponse(C);
8923
8923
  }), this.ws.onclose = (v) => {
8924
- this.isEstablishingConnection && d(new bt("Websocket got closed during a (re)connection attempt", Ye.InternalError)), this.log.warn("websocket closed", Object.assign(Object.assign({}, this.logContext), {
8924
+ this.isEstablishingConnection && d(new St("Websocket got closed during a (re)connection attempt", Ye.InternalError)), this.log.warn("websocket closed", Object.assign(Object.assign({}, this.logContext), {
8925
8925
  reason: v.reason,
8926
8926
  code: v.code,
8927
8927
  wasClean: v.wasClean,
@@ -9084,7 +9084,7 @@ class yd {
9084
9084
  return this.sendRequest({
9085
9085
  case: "leave",
9086
9086
  value: new ho({
9087
- reason: Fn.CLIENT_INITIATED,
9087
+ reason: Bn.CLIENT_INITIATED,
9088
9088
  // server doesn't process this field, keeping it here to indicate the intent of a full disconnect
9089
9089
  action: $s.DISCONNECT
9090
9090
  })
@@ -9221,7 +9221,7 @@ function eo(i, e) {
9221
9221
  function rb(i, e, t) {
9222
9222
  var n;
9223
9223
  const s = new URLSearchParams();
9224
- return s.set("access_token", i), t.reconnect && (s.set("reconnect", "1"), t.sid && s.set("sid", t.sid)), s.set("auto_subscribe", t.autoSubscribe ? "1" : "0"), s.set("sdk", ni() ? "reactnative" : "js"), s.set("version", e.version), s.set("protocol", e.protocol.toString()), e.deviceModel && s.set("device_model", e.deviceModel), e.os && s.set("os", e.os), e.osVersion && s.set("os_version", e.osVersion), e.browser && s.set("browser", e.browser), e.browserVersion && s.set("browser_version", e.browserVersion), t.adaptiveStream && s.set("adaptive_stream", "1"), t.reconnectReason && s.set("reconnect_reason", t.reconnectReason.toString()), !((n = navigator.connection) === null || n === void 0) && n.type && s.set("network", navigator.connection.type), s;
9224
+ return s.set("access_token", i), t.reconnect && (s.set("reconnect", "1"), t.sid && s.set("sid", t.sid)), s.set("auto_subscribe", t.autoSubscribe ? "1" : "0"), s.set("sdk", ii() ? "reactnative" : "js"), s.set("version", e.version), s.set("protocol", e.protocol.toString()), e.deviceModel && s.set("device_model", e.deviceModel), e.os && s.set("os", e.os), e.osVersion && s.set("os_version", e.osVersion), e.browser && s.set("browser", e.browser), e.browserVersion && s.set("browser_version", e.browserVersion), t.adaptiveStream && s.set("adaptive_stream", "1"), t.reconnectReason && s.set("reconnect_reason", t.reconnectReason.toString()), !((n = navigator.connection) === null || n === void 0) && n.type && s.set("network", navigator.connection.type), s;
9225
9225
  }
9226
9226
  class Yu {
9227
9227
  constructor() {
@@ -9317,7 +9317,7 @@ class ab {
9317
9317
  return e;
9318
9318
  }
9319
9319
  }
9320
- var An = {}, zo = {}, Go = { exports: {} }, Ju;
9320
+ var Rn = {}, zo = {}, Go = { exports: {} }, Ju;
9321
9321
  function Sd() {
9322
9322
  if (Ju) return Go.exports;
9323
9323
  Ju = 1;
@@ -9902,10 +9902,10 @@ function cb() {
9902
9902
  }
9903
9903
  var eh;
9904
9904
  function lb() {
9905
- if (eh) return An;
9905
+ if (eh) return Rn;
9906
9906
  eh = 1;
9907
9907
  var i = ob(), e = cb(), t = Sd();
9908
- return An.grammar = t, An.write = e, An.parse = i.parse, An.parseParams = i.parseParams, An.parseFmtpConfig = i.parseFmtpConfig, An.parsePayloads = i.parsePayloads, An.parseRemoteCandidates = i.parseRemoteCandidates, An.parseImageAttributes = i.parseImageAttributes, An.parseSimulcastStreamList = i.parseSimulcastStreamList, An;
9908
+ return Rn.grammar = t, Rn.write = e, Rn.parse = i.parse, Rn.parseParams = i.parseParams, Rn.parseFmtpConfig = i.parseFmtpConfig, Rn.parsePayloads = i.parsePayloads, Rn.parseRemoteCandidates = i.parseRemoteCandidates, Rn.parseImageAttributes = i.parseImageAttributes, Rn.parseSimulcastStreamList = i.parseSimulcastStreamList, Rn;
9909
9909
  }
9910
9910
  var Vi = lb();
9911
9911
  function xd(i, e, t) {
@@ -9951,7 +9951,7 @@ const db = 0.7, ub = 20, Zs = {
9951
9951
  NegotiationComplete: "negotiationComplete",
9952
9952
  RTPVideoPayloadTypes: "rtpVideoPayloadTypes"
9953
9953
  };
9954
- class th extends ri.EventEmitter {
9954
+ class th extends ai.EventEmitter {
9955
9955
  get pc() {
9956
9956
  return this._pc || (this._pc = this.createPC()), this._pc;
9957
9957
  }
@@ -9970,7 +9970,7 @@ class th extends ri.EventEmitter {
9970
9970
  }
9971
9971
  }), ub), this.close = () => {
9972
9972
  this._pc && (this._pc.close(), this._pc.onconnectionstatechange = null, this._pc.oniceconnectionstatechange = null, this._pc.onicegatheringstatechange = null, this._pc.ondatachannel = null, this._pc.onnegotiationneeded = null, this._pc.onsignalingstatechange = null, this._pc.onicecandidate = null, this._pc.ondatachannel = null, this._pc.ontrack = null, this._pc.onconnectionstatechange = null, this._pc.oniceconnectionstatechange = null, this._pc = null);
9973
- }, this.log = Ci((n = t.loggerName) !== null && n !== void 0 ? n : Vn.PCTransport), this.loggerOptions = t, this.config = e, this._pc = this.createPC(), this.offerLock = new hn();
9973
+ }, this.log = Ei((n = t.loggerName) !== null && n !== void 0 ? n : zn.PCTransport), this.loggerOptions = t, this.config = e, this._pc = this.createPC(), this.offerLock = new hn();
9974
9974
  }
9975
9975
  createPC() {
9976
9976
  const e = new RTCPeerConnection(this.config);
@@ -10087,7 +10087,7 @@ class th extends ri.EventEmitter {
10087
10087
  if (!o.msid || !c.cid || !o.msid.includes(c.cid))
10088
10088
  return !1;
10089
10089
  let l = 0;
10090
- if (o.rtp.some((u) => u.codec.toUpperCase() === c.codec.toUpperCase() ? (l = u.payload, !0) : !1), l === 0 || ($n(c.codec) && !xs() && this.ensureVideoDDExtensionForSVC(o, a), c.codec !== "av1"))
10090
+ if (o.rtp.some((u) => u.codec.toUpperCase() === c.codec.toUpperCase() ? (l = u.payload, !0) : !1), l === 0 || (Kn(c.codec) && !xs() && this.ensureVideoDDExtensionForSVC(o, a), c.codec !== "av1"))
10091
10091
  return !0;
10092
10092
  const d = Math.round(c.maxbr * db);
10093
10093
  for (const u of o.fmtp)
@@ -10335,12 +10335,12 @@ class mb {
10335
10335
  var r;
10336
10336
  const a = this.state, o = this.requiredTransports.map((c) => c.getConnectionState());
10337
10337
  o.every((c) => c === "connected") ? this.state = Pt.CONNECTED : o.some((c) => c === "failed") ? this.state = Pt.FAILED : o.some((c) => c === "connecting") ? this.state = Pt.CONNECTING : o.every((c) => c === "closed") ? this.state = Pt.CLOSED : o.some((c) => c === "closed") ? this.state = Pt.CLOSING : o.every((c) => c === "new") && (this.state = Pt.NEW), a !== this.state && (this.log.debug("pc state change: from ".concat(Pt[a], " to ").concat(Pt[this.state]), this.logContext), (r = this.onStateChange) === null || r === void 0 || r.call(this, this.state, this.publisher.getConnectionState(), this.subscriber.getConnectionState()));
10338
- }, this.log = Ci((s = n.loggerName) !== null && s !== void 0 ? s : Vn.PCManager), this.loggerOptions = n, this.isPublisherConnectionRequired = !t, this.isSubscriberConnectionRequired = t, this.publisher = new th(e, n), this.subscriber = new th(e, n), this.publisher.onConnectionStateChange = this.updateState, this.subscriber.onConnectionStateChange = this.updateState, this.publisher.onIceConnectionStateChange = this.updateState, this.subscriber.onIceConnectionStateChange = this.updateState, this.publisher.onSignalingStatechange = this.updateState, this.subscriber.onSignalingStatechange = this.updateState, this.publisher.onIceCandidate = (r) => {
10338
+ }, this.log = Ei((s = n.loggerName) !== null && s !== void 0 ? s : zn.PCManager), this.loggerOptions = n, this.isPublisherConnectionRequired = !t, this.isSubscriberConnectionRequired = t, this.publisher = new th(e, n), this.subscriber = new th(e, n), this.publisher.onConnectionStateChange = this.updateState, this.subscriber.onConnectionStateChange = this.updateState, this.publisher.onIceConnectionStateChange = this.updateState, this.subscriber.onIceConnectionStateChange = this.updateState, this.publisher.onSignalingStatechange = this.updateState, this.subscriber.onSignalingStatechange = this.updateState, this.publisher.onIceCandidate = (r) => {
10339
10339
  var a;
10340
- (a = this.onIceCandidate) === null || a === void 0 || a.call(this, r, Nn.PUBLISHER);
10340
+ (a = this.onIceCandidate) === null || a === void 0 || a.call(this, r, Un.PUBLISHER);
10341
10341
  }, this.subscriber.onIceCandidate = (r) => {
10342
10342
  var a;
10343
- (a = this.onIceCandidate) === null || a === void 0 || a.call(this, r, Nn.SUBSCRIBER);
10343
+ (a = this.onIceCandidate) === null || a === void 0 || a.call(this, r, Un.SUBSCRIBER);
10344
10344
  }, this.subscriber.onDataChannel = (r) => {
10345
10345
  var a;
10346
10346
  (a = this.onDataChannel) === null || a === void 0 || a.call(this, r);
@@ -10398,7 +10398,7 @@ class mb {
10398
10398
  }
10399
10399
  addIceCandidate(e, t) {
10400
10400
  return P(this, void 0, void 0, function* () {
10401
- t === Nn.PUBLISHER ? yield this.publisher.addIceCandidate(e) : yield this.subscriber.addIceCandidate(e);
10401
+ t === Un.PUBLISHER ? yield this.publisher.addIceCandidate(e) : yield this.subscriber.addIceCandidate(e);
10402
10402
  });
10403
10403
  }
10404
10404
  createSubscriberAnswerFromOffer(e, t) {
@@ -10461,7 +10461,7 @@ class mb {
10461
10461
  * Returns the first required transport's address if no explicit target is specified
10462
10462
  */
10463
10463
  getConnectedAddress(e) {
10464
- return e === Nn.PUBLISHER ? this.publisher.getConnectedAddress() : e === Nn.SUBSCRIBER ? this.publisher.getConnectedAddress() : this.requiredTransports[0].getConnectedAddress();
10464
+ return e === Un.PUBLISHER ? this.publisher.getConnectedAddress() : e === Un.SUBSCRIBER ? this.publisher.getConnectedAddress() : this.requiredTransports[0].getConnectedAddress();
10465
10465
  }
10466
10466
  get requiredTransports() {
10467
10467
  const e = [];
@@ -10475,15 +10475,15 @@ class mb {
10475
10475
  if (n.getConnectionState() !== "connected")
10476
10476
  return new Promise((c, l) => P(r, void 0, void 0, function* () {
10477
10477
  const d = () => {
10478
- this.log.warn("abort transport connection", this.logContext), Kt.clearTimeout(u), l(new bt("room connection has been cancelled", Ye.Cancelled));
10478
+ this.log.warn("abort transport connection", this.logContext), Kt.clearTimeout(u), l(new St("room connection has been cancelled", Ye.Cancelled));
10479
10479
  };
10480
10480
  s != null && s.signal.aborted && d(), s == null || s.signal.addEventListener("abort", d);
10481
10481
  const u = Kt.setTimeout(() => {
10482
- s == null || s.signal.removeEventListener("abort", d), l(new bt("could not establish pc connection", Ye.InternalError));
10482
+ s == null || s.signal.removeEventListener("abort", d), l(new St("could not establish pc connection", Ye.InternalError));
10483
10483
  }, a);
10484
10484
  for (; this.state !== Pt.CONNECTED; )
10485
10485
  if (yield fn(50), s != null && s.signal.aborted) {
10486
- l(new bt("room connection has been cancelled", Ye.Cancelled));
10486
+ l(new St("room connection has been cancelled", Ye.Cancelled));
10487
10487
  return;
10488
10488
  }
10489
10489
  Kt.clearTimeout(u), s == null || s.signal.removeEventListener("abort", d), c();
@@ -10733,7 +10733,7 @@ class $p extends J {
10733
10733
  return r;
10734
10734
  yield fn(50);
10735
10735
  }
10736
- throw new _i("unable to get track dimensions after timeout");
10736
+ throw new yi("unable to get track dimensions after timeout");
10737
10737
  }();
10738
10738
  });
10739
10739
  }
@@ -10775,7 +10775,7 @@ class $p extends J {
10775
10775
  const n = yield this.trackChangeLock.lock();
10776
10776
  try {
10777
10777
  if (!this.sender)
10778
- throw new _i("unable to replace an unpublished track");
10778
+ throw new yi("unable to replace an unpublished track");
10779
10779
  let s, r;
10780
10780
  return typeof t == "boolean" ? s = t : t !== void 0 && (s = t.userProvidedTrack, r = t.stopProcessor), this.providedByUser = s ?? !0, this.log.debug("replace MediaStreamTrack", this.logContext), yield this.setMediaStreamTrack(e), r && this.processor && (yield this.internalStopProcessor()), this;
10781
10781
  } finally {
@@ -10854,7 +10854,7 @@ class $p extends J {
10854
10854
  }
10855
10855
  this._isUpstreamPaused = !0, this.emit(re.UpstreamPaused, this);
10856
10856
  const n = yn();
10857
- if ((n == null ? void 0 : n.name) === "Safari" && ii(n.version, "12.0") < 0)
10857
+ if ((n == null ? void 0 : n.name) === "Safari" && si(n.version, "12.0") < 0)
10858
10858
  throw new vd("pauseUpstream is not supported on Safari < 12.");
10859
10859
  ((e = this.sender.transport) === null || e === void 0 ? void 0 : e.state) !== "closed" && (yield this.sender.replaceTrack(null));
10860
10860
  } finally {
@@ -11118,7 +11118,7 @@ class to extends $p {
11118
11118
  var t;
11119
11119
  const n = yield this.trackChangeLock.lock();
11120
11120
  try {
11121
- if (!ni() && !this.audioContext)
11121
+ if (!ii() && !this.audioContext)
11122
11122
  throw Error("Audio context needs to be set on LocalAudioTrack in order to enable processors");
11123
11123
  this.processor && (yield this.internalStopProcessor());
11124
11124
  const s = {
@@ -11175,7 +11175,7 @@ function xb(i, e, t) {
11175
11175
  case "video":
11176
11176
  return new no(i, e, !1, t);
11177
11177
  default:
11178
- throw new _i("unsupported track type: ".concat(i.kind));
11178
+ throw new yi("unsupported track type: ".concat(i.kind));
11179
11179
  }
11180
11180
  }
11181
11181
  const Tb = Object.values(Wr), Cb = Object.values(Wc), Eb = Object.values(bd), Mb = [Wr.h180, Wr.h360], wb = [Wc.h180, Wc.h360], Ab = (i) => [{
@@ -11194,7 +11194,7 @@ function tl(i, e, t, n) {
11194
11194
  return [{}];
11195
11195
  a || (a = Pb(i, e, t, l), $e.debug("using video encoding", a));
11196
11196
  const d = a.maxFramerate, u = new mt(e, t, a.maxBitrate, a.maxFramerate, a.priority);
11197
- if (c && $n(l)) {
11197
+ if (c && Kn(l)) {
11198
11198
  const g = new Kp(c), v = [];
11199
11199
  if (g.spatial > 3)
11200
11200
  throw new Error("unsupported scalabilityMode: ".concat(c));
@@ -11202,7 +11202,7 @@ function tl(i, e, t, n) {
11202
11202
  if (qr() || // Even tho RN runs M114, it does not produce SVC layers when a single encoding
11203
11203
  // is provided. So we'll use the legacy SVC specification for now.
11204
11204
  // TODO: when we upstream libwebrtc, this will need additional verification
11205
- ni() || (m == null ? void 0 : m.name) === "Chrome" && ii(m == null ? void 0 : m.version, "113") < 0) {
11205
+ ii() || (m == null ? void 0 : m.name) === "Chrome" && si(m == null ? void 0 : m.version, "113") < 0) {
11206
11206
  const p = g.suffix == "h" ? 2 : 3, x = D0(m);
11207
11207
  for (let C = 0; C < g.spatial; C += 1)
11208
11208
  v.push({
@@ -11301,7 +11301,7 @@ function Wo(i, e, t, n) {
11301
11301
  d && (l.maxFramerate = d);
11302
11302
  const u = Ss() || a === 0;
11303
11303
  r.encoding.priority && u && (l.priority = r.encoding.priority, l.networkPriority = r.encoding.priority), s.push(l);
11304
- }), ni() && Bp() === "ios") {
11304
+ }), ii() && Bp() === "ios") {
11305
11305
  let r;
11306
11306
  s.forEach((o) => {
11307
11307
  r ? o.maxFramerate && o.maxFramerate > r && (r = o.maxFramerate) : r = o.maxFramerate;
@@ -11416,7 +11416,7 @@ class no extends $p {
11416
11416
  var t, n, s, r, a;
11417
11417
  yield e.pauseUpstream.call(this);
11418
11418
  try {
11419
- for (var o = !0, c = bi(this.simulcastCodecs.values()), l; l = yield c.next(), t = l.done, !t; o = !0)
11419
+ for (var o = !0, c = _i(this.simulcastCodecs.values()), l; l = yield c.next(), t = l.done, !t; o = !0)
11420
11420
  r = l.value, o = !1, yield (a = r.sender) === null || a === void 0 ? void 0 : a.replaceTrack(null);
11421
11421
  } catch (d) {
11422
11422
  n = {
@@ -11441,7 +11441,7 @@ class no extends $p {
11441
11441
  var t, n, s, r, a;
11442
11442
  yield e.resumeUpstream.call(this);
11443
11443
  try {
11444
- for (var o = !0, c = bi(this.simulcastCodecs.values()), l; l = yield c.next(), t = l.done, !t; o = !0) {
11444
+ for (var o = !0, c = _i(this.simulcastCodecs.values()), l; l = yield c.next(), t = l.done, !t; o = !0) {
11445
11445
  r = l.value, o = !1;
11446
11446
  const d = r;
11447
11447
  yield (a = d.sender) === null || a === void 0 ? void 0 : a.replaceTrack(d.mediaStreamTrack);
@@ -11538,7 +11538,7 @@ class no extends $p {
11538
11538
  quality: n,
11539
11539
  enabled: n <= e
11540
11540
  }));
11541
- this.log.debug("setting publishing quality. max quality ".concat(e), this.logContext), this.setPublishingLayers($n(this.codec), t);
11541
+ this.log.debug("setting publishing quality. max quality ".concat(e), this.logContext), this.setPublishingLayers(Kn(this.codec), t);
11542
11542
  }
11543
11543
  restartTrack(e) {
11544
11544
  return P(this, void 0, void 0, function* () {
@@ -11552,7 +11552,7 @@ class no extends $p {
11552
11552
  }
11553
11553
  yield this.restart(o), this.isCpuConstrained = !1;
11554
11554
  try {
11555
- for (var c = !0, l = bi(this.simulcastCodecs.values()), d; d = yield l.next(), t = d.done, !t; c = !0) {
11555
+ for (var c = !0, l = _i(this.simulcastCodecs.values()), d; d = yield l.next(), t = d.done, !t; c = !0) {
11556
11556
  r = d.value, c = !1;
11557
11557
  const u = r;
11558
11558
  u.sender && ((a = u.sender.transport) === null || a === void 0 ? void 0 : a.state) !== "closed" && (u.mediaStreamTrack = this.mediaStreamTrack.clone(), yield u.sender.replaceTrack(u.mediaStreamTrack));
@@ -11583,7 +11583,7 @@ class no extends $p {
11583
11583
  var a, o, c, l, d, u;
11584
11584
  if (yield t.setProcessor.call(s, n, r), !((d = s.processor) === null || d === void 0) && d.processedTrack)
11585
11585
  try {
11586
- for (var h = !0, f = bi(s.simulcastCodecs.values()), g; g = yield f.next(), a = g.done, !a; h = !0)
11586
+ for (var h = !0, f = _i(s.simulcastCodecs.values()), g; g = yield f.next(), a = g.done, !a; h = !0)
11587
11587
  l = g.value, h = !1, yield (u = l.sender) === null || u === void 0 ? void 0 : u.replaceTrack(s.processor.processedTrack);
11588
11588
  } catch (v) {
11589
11589
  o = {
@@ -11644,15 +11644,15 @@ class no extends $p {
11644
11644
  codecs: e,
11645
11645
  currentCodec: this.codec
11646
11646
  })), !this.codec && e.length > 0)
11647
- return yield this.setPublishingLayers($n(e[0].codec), e[0].qualities), [];
11647
+ return yield this.setPublishingLayers(Kn(e[0].codec), e[0].qualities), [];
11648
11648
  this.subscribedCodecs = e;
11649
11649
  const l = [];
11650
11650
  try {
11651
- for (t = !0, n = bi(e); s = yield n.next(), r = s.done, !r; t = !0) {
11651
+ for (t = !0, n = _i(e); s = yield n.next(), r = s.done, !r; t = !0) {
11652
11652
  c = s.value, t = !1;
11653
11653
  const d = c;
11654
11654
  if (!this.codec || this.codec === d.codec)
11655
- yield this.setPublishingLayers($n(d.codec), d.qualities);
11655
+ yield this.setPublishingLayers(Kn(d.codec), d.qualities);
11656
11656
  else {
11657
11657
  const u = this.simulcastCodecs.get(d.codec);
11658
11658
  if (this.log.debug("try setPublishingCodec for ".concat(d.codec), Object.assign(Object.assign({}, this.logContext), {
@@ -11663,7 +11663,7 @@ class no extends $p {
11663
11663
  l.push(d.codec);
11664
11664
  break;
11665
11665
  }
11666
- } else u.encodings && (this.log.debug("try setPublishingLayersForSender ".concat(d.codec), this.logContext), yield oh(u.sender, u.encodings, d.qualities, this.senderLock, $n(d.codec), this.log, this.logContext));
11666
+ } else u.encodings && (this.log.debug("try setPublishingLayersForSender ".concat(d.codec), this.logContext), yield oh(u.sender, u.encodings, d.qualities, this.senderLock, Kn(d.codec), this.log, this.logContext));
11667
11667
  }
11668
11668
  }
11669
11669
  } catch (d) {
@@ -11714,7 +11714,7 @@ class no extends $p {
11714
11714
  return Object.assign(Object.assign({}, n), {
11715
11715
  active: s === 0,
11716
11716
  scaleResolutionDownBy: Math.max(1, Math.ceil(((r = this.mediaStreamTrack.getSettings().height) !== null && r !== void 0 ? r : 360) / 360)),
11717
- scalabilityMode: s === 0 && $n(this.codec) ? "L1T3" : void 0,
11717
+ scalabilityMode: s === 0 && Kn(this.codec) ? "L1T3" : void 0,
11718
11718
  maxFramerate: s === 0 ? 15 : 0,
11719
11719
  maxBitrate: s === 0 ? n.maxBitrate : 0
11720
11720
  });
@@ -11824,11 +11824,11 @@ function ch(i, e, t, n) {
11824
11824
  });
11825
11825
  }
11826
11826
  const lh = "_lossy", dh = "_reliable", Lb = 2 * 1e3, qo = "leave-reconnect", Nb = 3e4;
11827
- var In;
11827
+ var Dn;
11828
11828
  (function(i) {
11829
11829
  i[i.New = 0] = "New", i[i.Connected = 1] = "Connected", i[i.Disconnected = 2] = "Disconnected", i[i.Reconnecting = 3] = "Reconnecting", i[i.Closed = 4] = "Closed";
11830
- })(In || (In = {}));
11831
- class Ub extends ri.EventEmitter {
11830
+ })(Dn || (Dn = {}));
11831
+ class Ub extends ai.EventEmitter {
11832
11832
  get isClosed() {
11833
11833
  return this._isClosed;
11834
11834
  }
@@ -11837,7 +11837,7 @@ class Ub extends ri.EventEmitter {
11837
11837
  }
11838
11838
  constructor(e) {
11839
11839
  var t;
11840
- super(), this.options = e, this.rtcConfig = {}, this.peerConnectionTimeout = Td.peerConnectionTimeout, this.fullReconnectOnNext = !1, this.latestRemoteOfferId = 0, this.subscriberPrimary = !1, this.pcState = In.New, this._isClosed = !0, this.pendingTrackResolvers = {}, this.reconnectAttempts = 0, this.reconnectStart = 0, this.attemptingReconnect = !1, this.joinAttempts = 0, this.maxJoinAttempts = 1, this.shouldFailNext = !1, this.log = $e, this.reliableDataSequence = 1, this.reliableMessageBuffer = new Yu(), this.reliableReceivedState = new ab(Nb), this.handleDataChannel = (n) => P(this, [n], void 0, function(s) {
11840
+ super(), this.options = e, this.rtcConfig = {}, this.peerConnectionTimeout = Td.peerConnectionTimeout, this.fullReconnectOnNext = !1, this.latestRemoteOfferId = 0, this.subscriberPrimary = !1, this.pcState = Dn.New, this._isClosed = !0, this.pendingTrackResolvers = {}, this.reconnectAttempts = 0, this.reconnectStart = 0, this.attemptingReconnect = !1, this.joinAttempts = 0, this.maxJoinAttempts = 1, this.shouldFailNext = !1, this.log = $e, this.reliableDataSequence = 1, this.reliableMessageBuffer = new Yu(), this.reliableReceivedState = new ab(Nb), this.handleDataChannel = (n) => P(this, [n], void 0, function(s) {
11841
11841
  var r = this;
11842
11842
  let {
11843
11843
  channel: a
@@ -11912,7 +11912,7 @@ class Ub extends ri.EventEmitter {
11912
11912
  }
11913
11913
  n === qo && (o = 0), this.log.debug("reconnecting in ".concat(o, "ms"), this.logContext), this.clearReconnectTimeout(), this.token && this.regionUrlProvider && this.regionUrlProvider.updateToken(this.token), this.reconnectTimeout = Kt.setTimeout(() => this.attemptReconnect(s).finally(() => this.reconnectTimeout = void 0), o);
11914
11914
  }, this.waitForRestarted = () => new Promise((n, s) => {
11915
- this.pcState === In.Connected && n();
11915
+ this.pcState === Dn.Connected && n();
11916
11916
  const r = () => {
11917
11917
  this.off(ce.Disconnected, a), n();
11918
11918
  }, a = () => {
@@ -11928,7 +11928,7 @@ class Ub extends ri.EventEmitter {
11928
11928
  return n === qe.RELIABLE && this.reliableMessageBuffer.alignBufferedAmount(s.bufferedAmount), s.bufferedAmount <= s.bufferedAmountLowThreshold;
11929
11929
  }, this.handleBrowserOnLine = () => {
11930
11930
  this.client.currentState === Mt.RECONNECTING && (this.clearReconnectTimeout(), this.attemptReconnect(ws.RR_SIGNAL_DISCONNECTED));
11931
- }, this.log = Ci((t = e.loggerName) !== null && t !== void 0 ? t : Vn.Engine), this.loggerOptions = {
11931
+ }, this.log = Ei((t = e.loggerName) !== null && t !== void 0 ? t : zn.Engine), this.loggerOptions = {
11932
11932
  loggerName: e.loggerName,
11933
11933
  loggerContextCb: () => this.logContext
11934
11934
  }, this.client = new yd(void 0, this.loggerOptions), this.client.signalLatency = this.options.expSignalLatency, this.reconnectPolicy = this.options.reconnectPolicy, this.registerOnLineListener(), this.closingLock = new hn(), this.dataProcessLock = new hn(), this.dcBufferStatus = /* @__PURE__ */ new Map([[qe.LOSSY, !0], [qe.RELIABLE, !0]]), this.client.onParticipantUpdate = (n) => this.emit(ce.ParticipantUpdate, n), this.client.onConnectionQuality = (n) => this.emit(ce.ConnectionQualityUpdate, n), this.client.onRoomUpdate = (n) => this.emit(ce.RoomUpdate, n), this.client.onSubscriptionError = (n) => this.emit(ce.SubscriptionError, n), this.client.onSubscriptionPermissionUpdate = (n) => this.emit(ce.SubscriptionPermissionUpdate, n), this.client.onSpeakersChanged = (n) => this.emit(ce.SpeakersChanged, n), this.client.onStreamStateUpdate = (n) => this.emit(ce.StreamStateChanged, n), this.client.onRequestResponse = (n) => this.emit(ce.SignalRequestResponse, n);
@@ -11951,7 +11951,7 @@ class Ub extends ri.EventEmitter {
11951
11951
  const r = yield this.client.join(e, t, n, s);
11952
11952
  return this._isClosed = !1, this.latestJoinResponse = r, this.subscriberPrimary = r.subscriberPrimary, this.pcManager || (yield this.configure(r)), (!this.subscriberPrimary || r.fastPublish) && this.negotiate(), this.clientConfiguration = r.clientConfiguration, this.emit(ce.SignalConnected, r), r;
11953
11953
  } catch (r) {
11954
- if (r instanceof bt && r.reason === Ye.ServerUnreachable && (this.log.warn("Couldn't connect to server, attempt ".concat(this.joinAttempts, " of ").concat(this.maxJoinAttempts), this.logContext), this.joinAttempts < this.maxJoinAttempts))
11954
+ if (r instanceof St && r.reason === Ye.ServerUnreachable && (this.log.warn("Couldn't connect to server, attempt ".concat(this.joinAttempts, " of ").concat(this.maxJoinAttempts), this.logContext), this.joinAttempts < this.maxJoinAttempts))
11955
11955
  return this.join(e, t, n, s);
11956
11956
  throw r;
11957
11957
  }
@@ -11988,10 +11988,10 @@ class Ub extends ri.EventEmitter {
11988
11988
  }
11989
11989
  addTrack(e) {
11990
11990
  if (this.pendingTrackResolvers[e.cid])
11991
- throw new _i("a track with the same ID has already been published");
11991
+ throw new yi("a track with the same ID has already been published");
11992
11992
  return new Promise((t, n) => {
11993
11993
  const s = setTimeout(() => {
11994
- delete this.pendingTrackResolvers[e.cid], n(new bt("publication of local track timed out, no response from server", Ye.Timeout));
11994
+ delete this.pendingTrackResolvers[e.cid], n(new St("publication of local track timed out, no response from server", Ye.Timeout));
11995
11995
  }, 1e4);
11996
11996
  this.pendingTrackResolvers[e.cid] = {
11997
11997
  resolve: (r) => {
@@ -12055,9 +12055,9 @@ class Ub extends ri.EventEmitter {
12055
12055
  this.client.sendOffer(r, a);
12056
12056
  }, this.pcManager.onDataChannel = this.handleDataChannel, this.pcManager.onStateChange = (r, a, o) => P(this, void 0, void 0, function* () {
12057
12057
  if (this.log.debug("primary PC state changed ".concat(r), this.logContext), ["closed", "disconnected", "failed"].includes(a) && (this.publisherConnectionPromise = void 0), r === Pt.CONNECTED) {
12058
- const d = this.pcState === In.New;
12059
- this.pcState = In.Connected, d && this.emit(ce.Connected, e);
12060
- } else r === Pt.FAILED && this.pcState === In.Connected && (this.pcState = In.Disconnected, this.handleDisconnect("peerconnection failed", o === "failed" ? ws.RR_SUBSCRIBER_FAILED : ws.RR_PUBLISHER_FAILED));
12058
+ const d = this.pcState === Dn.New;
12059
+ this.pcState = Dn.Connected, d && this.emit(ce.Connected, e);
12060
+ } else r === Pt.FAILED && this.pcState === Dn.Connected && (this.pcState = Dn.Disconnected, this.handleDisconnect("peerconnection failed", o === "failed" ? ws.RR_SUBSCRIBER_FAILED : ws.RR_PUBLISHER_FAILED));
12061
12061
  const c = this.client.isDisconnected || this.client.currentState === Mt.RECONNECTING, l = [Pt.FAILED, Pt.CLOSING, Pt.CLOSED].includes(r);
12062
12062
  c && l && !this._isClosed && this.emit(ce.Offline);
12063
12063
  }), this.pcManager.onTrack = (r) => {
@@ -12246,7 +12246,7 @@ class Ub extends ri.EventEmitter {
12246
12246
  throw this.log.warn("attempted connection restart, without signal options present", this.logContext), new As();
12247
12247
  r = yield this.join(e ?? this.url, this.token, this.signalOpts);
12248
12248
  } catch (a) {
12249
- throw a instanceof bt && a.reason === Ye.NotAllowed ? new zt("could not reconnect, token might be expired") : new As();
12249
+ throw a instanceof St && a.reason === Ye.NotAllowed ? new zt("could not reconnect, token might be expired") : new As();
12250
12250
  }
12251
12251
  if (this.shouldFailNext)
12252
12252
  throw this.shouldFailNext = !1, new Error("simulated failure");
@@ -12278,7 +12278,7 @@ class Ub extends ri.EventEmitter {
12278
12278
  let r = "";
12279
12279
  throw s instanceof Error && (r = s.message, this.log.error(s.message, Object.assign(Object.assign({}, this.logContext), {
12280
12280
  error: s
12281
- }))), s instanceof bt && s.reason === Ye.NotAllowed ? new zt("could not reconnect, token might be expired") : s instanceof bt && s.reason === Ye.LeaveRequest ? s : new As(r);
12281
+ }))), s instanceof St && s.reason === Ye.NotAllowed ? new zt("could not reconnect, token might be expired") : s instanceof St && s.reason === Ye.LeaveRequest ? s : new As(r);
12282
12282
  }
12283
12283
  if (this.emit(ce.SignalResumed), n) {
12284
12284
  const s = this.makeRTCConfiguration(n);
@@ -12301,13 +12301,13 @@ class Ub extends ri.EventEmitter {
12301
12301
  }
12302
12302
  waitForPCReconnected() {
12303
12303
  return P(this, void 0, void 0, function* () {
12304
- this.pcState = In.Reconnecting, this.log.debug("waiting for peer connection to reconnect", this.logContext);
12304
+ this.pcState = Dn.Reconnecting, this.log.debug("waiting for peer connection to reconnect", this.logContext);
12305
12305
  try {
12306
12306
  if (yield fn(Lb), !this.pcManager)
12307
12307
  throw new zt("PC manager is closed");
12308
- yield this.pcManager.ensurePCTransportConnection(void 0, this.peerConnectionTimeout), this.pcState = In.Connected;
12308
+ yield this.pcManager.ensurePCTransportConnection(void 0, this.peerConnectionTimeout), this.pcState = Dn.Connected;
12309
12309
  } catch (e) {
12310
- throw this.pcState = In.Disconnected, new bt("could not establish PC connection, ".concat(e.message), Ye.InternalError);
12310
+ throw this.pcState = Dn.Disconnected, new St("could not establish PC connection, ".concat(e.message), Ye.InternalError);
12311
12311
  }
12312
12312
  });
12313
12313
  }
@@ -12400,7 +12400,7 @@ class Ub extends ri.EventEmitter {
12400
12400
  throw new zt("PC manager is closed");
12401
12401
  const a = s ? n.pcManager.subscriber : n.pcManager.publisher, o = s ? "Subscriber" : "Publisher";
12402
12402
  if (!a)
12403
- throw new bt("".concat(o, " connection not set"), Ye.InternalError);
12403
+ throw new St("".concat(o, " connection not set"), Ye.InternalError);
12404
12404
  let c = !1;
12405
12405
  !s && !n.dataChannelForKind(t, s) && (n.createDataChannels(), c = !0), !c && !s && !n.pcManager.publisher.isICEConnected && n.pcManager.publisher.getICEConnectionState() !== "checking" && (c = !0), c && n.negotiate();
12406
12406
  const l = n.dataChannelForKind(t, s);
@@ -12412,7 +12412,7 @@ class Ub extends ri.EventEmitter {
12412
12412
  return;
12413
12413
  yield fn(50);
12414
12414
  }
12415
- throw new bt("could not establish ".concat(o, " connection, state: ").concat(a.getICEConnectionState()), Ye.InternalError);
12415
+ throw new St("could not establish ".concat(o, " connection, state: ").concat(a.getICEConnectionState()), Ye.InternalError);
12416
12416
  }();
12417
12417
  });
12418
12418
  }
@@ -12512,7 +12512,7 @@ class Ub extends ri.EventEmitter {
12512
12512
  target: s
12513
12513
  }));
12514
12514
  };
12515
- return t(this.dataChannelForKind(qe.LOSSY), Nn.PUBLISHER), t(this.dataChannelForKind(qe.RELIABLE), Nn.PUBLISHER), t(this.dataChannelForKind(qe.LOSSY, !0), Nn.SUBSCRIBER), t(this.dataChannelForKind(qe.RELIABLE, !0), Nn.SUBSCRIBER), e;
12515
+ return t(this.dataChannelForKind(qe.LOSSY), Un.PUBLISHER), t(this.dataChannelForKind(qe.RELIABLE), Un.PUBLISHER), t(this.dataChannelForKind(qe.LOSSY, !0), Un.SUBSCRIBER), t(this.dataChannelForKind(qe.RELIABLE, !0), Un.SUBSCRIBER), e;
12516
12516
  }
12517
12517
  clearReconnectTimeout() {
12518
12518
  this.reconnectTimeout && Kt.clearTimeout(this.reconnectTimeout);
@@ -12580,7 +12580,7 @@ class nl {
12580
12580
  const n = yield t.json();
12581
12581
  return this.lastUpdateAt = Date.now(), n;
12582
12582
  } else
12583
- throw new bt("Could not fetch region settings: ".concat(t.statusText), t.status === 401 ? Ye.NotAllowed : Ye.InternalError, t.status);
12583
+ throw new St("Could not fetch region settings: ".concat(t.statusText), t.status === 401 ? Ye.NotAllowed : Ye.InternalError, t.status);
12584
12584
  });
12585
12585
  }
12586
12586
  setServerReportedRegions(e) {
@@ -12599,9 +12599,9 @@ class Jp {
12599
12599
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1;
12600
12600
  if (!(typeof this.totalByteSize != "number" || this.totalByteSize === 0)) {
12601
12601
  if (e && this.bytesReceived < this.totalByteSize)
12602
- throw new Gi("Not enough chunk(s) received - expected ".concat(this.totalByteSize, " bytes of data total, only received ").concat(this.bytesReceived, " bytes"), Un.Incomplete);
12602
+ throw new Gi("Not enough chunk(s) received - expected ".concat(this.totalByteSize, " bytes of data total, only received ").concat(this.bytesReceived, " bytes"), On.Incomplete);
12603
12603
  if (this.bytesReceived > this.totalByteSize)
12604
- throw new Gi("Extra chunk(s) received - expected ".concat(this.totalByteSize, " bytes of data total, received ").concat(this.bytesReceived, " bytes"), Un.LengthExceeded);
12604
+ throw new Gi("Extra chunk(s) received - expected ".concat(this.totalByteSize, " bytes of data total, received ").concat(this.bytesReceived, " bytes"), On.LengthExceeded);
12605
12605
  }
12606
12606
  }
12607
12607
  constructor(e, t, n, s) {
@@ -12617,7 +12617,7 @@ class Vb extends Jp {
12617
12617
  }
12618
12618
  [Symbol.asyncIterator]() {
12619
12619
  const e = this.reader.getReader();
12620
- let t = new Kn(), n = null, s = null;
12620
+ let t = new Yn(), n = null, s = null;
12621
12621
  if (this.signal) {
12622
12622
  const a = this.signal;
12623
12623
  s = () => {
@@ -12685,7 +12685,7 @@ class Vb extends Jp {
12685
12685
  let o = /* @__PURE__ */ new Set();
12686
12686
  const c = t.signal ? e.withAbortSignal(t.signal) : e;
12687
12687
  try {
12688
- for (var l = !0, d = bi(c), u; u = yield d.next(), n = u.done, !n; l = !0) {
12688
+ for (var l = !0, d = _i(c), u; u = yield d.next(), n = u.done, !n; l = !0) {
12689
12689
  a = u.value, l = !1;
12690
12690
  const h = a;
12691
12691
  o.add(h);
@@ -12732,7 +12732,7 @@ class zb extends Jp {
12732
12732
  const e = this.reader.getReader(), t = new TextDecoder("utf-8", {
12733
12733
  fatal: !0
12734
12734
  });
12735
- let n = new Kn(), s = null, r = null;
12735
+ let n = new Yn(), s = null, r = null;
12736
12736
  if (this.signal) {
12737
12737
  const o = this.signal;
12738
12738
  r = () => {
@@ -12769,7 +12769,7 @@ class zb extends Jp {
12769
12769
  try {
12770
12770
  u = t.decode(d.content);
12771
12771
  } catch (h) {
12772
- throw new Gi("Cannot decode datastream chunk ".concat(d.chunkIndex, " as text: ").concat(h), Un.DecodeFailed);
12772
+ throw new Gi("Cannot decode datastream chunk ".concat(d.chunkIndex, " as text: ").concat(h), On.DecodeFailed);
12773
12773
  }
12774
12774
  return {
12775
12775
  done: !1,
@@ -12811,7 +12811,7 @@ class zb extends Jp {
12811
12811
  let o = "";
12812
12812
  const c = t.signal ? e.withAbortSignal(t.signal) : e;
12813
12813
  try {
12814
- for (var l = !0, d = bi(c), u; u = yield d.next(), n = u.done, !n; l = !0)
12814
+ for (var l = !0, d = _i(c), u; u = yield d.next(), n = u.done, !n; l = !0)
12815
12815
  a = u.value, l = !1, o += a;
12816
12816
  } catch (h) {
12817
12817
  s = {
@@ -12835,7 +12835,7 @@ class Gb {
12835
12835
  }
12836
12836
  registerTextStreamHandler(e, t) {
12837
12837
  if (this.textStreamHandlers.has(e))
12838
- throw new Gi('A text stream handler for topic "'.concat(e, '" has already been set.'), Un.HandlerAlreadyRegistered);
12838
+ throw new Gi('A text stream handler for topic "'.concat(e, '" has already been set.'), On.HandlerAlreadyRegistered);
12839
12839
  this.textStreamHandlers.set(e, t);
12840
12840
  }
12841
12841
  unregisterTextStreamHandler(e) {
@@ -12843,7 +12843,7 @@ class Gb {
12843
12843
  }
12844
12844
  registerByteStreamHandler(e, t) {
12845
12845
  if (this.byteStreamHandlers.has(e))
12846
- throw new Gi('A byte stream handler for topic "'.concat(e, '" has already been set.'), Un.HandlerAlreadyRegistered);
12846
+ throw new Gi('A byte stream handler for topic "'.concat(e, '" has already been set.'), On.HandlerAlreadyRegistered);
12847
12847
  this.byteStreamHandlers.set(e, t);
12848
12848
  }
12849
12849
  unregisterByteStreamHandler(e) {
@@ -12856,7 +12856,7 @@ class Gb {
12856
12856
  var t, n, s, r;
12857
12857
  const a = Array.from(this.textStreamControllers.entries()).filter((c) => c[1].sendingParticipantIdentity === e), o = Array.from(this.byteStreamControllers.entries()).filter((c) => c[1].sendingParticipantIdentity === e);
12858
12858
  if (a.length > 0 || o.length > 0) {
12859
- const c = new Gi("Participant ".concat(e, " unexpectedly disconnected in the middle of sending data"), Un.AbnormalEnd);
12859
+ const c = new Gi("Participant ".concat(e, " unexpectedly disconnected in the middle of sending data"), On.AbnormalEnd);
12860
12860
  for (const [l, d] of o)
12861
12861
  (n = (t = d.outOfBandFailureRejectingFuture).reject) === null || n === void 0 || n.call(t, c), this.byteStreamControllers.delete(l);
12862
12862
  for (const [l, d] of a)
@@ -12887,7 +12887,7 @@ class Gb {
12887
12887
  return;
12888
12888
  }
12889
12889
  let r;
12890
- const a = new Kn(), o = {
12890
+ const a = new Yn(), o = {
12891
12891
  id: e.streamId,
12892
12892
  name: (n = e.contentHeader.value.name) !== null && n !== void 0 ? n : "unknown",
12893
12893
  mimeType: e.mimeType,
@@ -12898,7 +12898,7 @@ class Gb {
12898
12898
  }, c = new ReadableStream({
12899
12899
  start: (l) => {
12900
12900
  if (r = l, this.textStreamControllers.has(e.streamId))
12901
- throw new Gi("A data stream read is already in progress for a stream with id ".concat(e.streamId, "."), Un.AlreadyOpened);
12901
+ throw new Gi("A data stream read is already in progress for a stream with id ".concat(e.streamId, "."), On.AlreadyOpened);
12902
12902
  this.byteStreamControllers.set(e.streamId, {
12903
12903
  info: o,
12904
12904
  controller: r,
@@ -12918,7 +12918,7 @@ class Gb {
12918
12918
  return;
12919
12919
  }
12920
12920
  let r;
12921
- const a = new Kn(), o = {
12921
+ const a = new Yn(), o = {
12922
12922
  id: e.streamId,
12923
12923
  mimeType: e.mimeType,
12924
12924
  size: e.totalLength ? Number(e.totalLength) : void 0,
@@ -12928,7 +12928,7 @@ class Gb {
12928
12928
  }, c = new ReadableStream({
12929
12929
  start: (l) => {
12930
12930
  if (r = l, this.textStreamControllers.has(e.streamId))
12931
- throw new Gi("A data stream read is already in progress for a stream with id ".concat(e.streamId, "."), Un.AlreadyOpened);
12931
+ throw new Gi("A data stream read is already in progress for a stream with id ".concat(e.streamId, "."), On.AlreadyOpened);
12932
12932
  this.textStreamControllers.set(e.streamId, {
12933
12933
  info: o,
12934
12934
  controller: r,
@@ -13308,7 +13308,7 @@ class jb extends Qp {
13308
13308
  var t;
13309
13309
  for (const n of this.attachedElements)
13310
13310
  this.audioContext ? (t = this.gainNode) === null || t === void 0 || t.gain.setTargetAtTime(e, 0, 0.1) : n.volume = e;
13311
- ni() && this._mediaStreamTrack._setVolume(e), this.elementVolume = e;
13311
+ ii() && this._mediaStreamTrack._setVolume(e), this.elementVolume = e;
13312
13312
  }
13313
13313
  /**
13314
13314
  * gets the volume of attached audio elements (loudest)
@@ -13316,7 +13316,7 @@ class jb extends Qp {
13316
13316
  getVolume() {
13317
13317
  if (this.elementVolume)
13318
13318
  return this.elementVolume;
13319
- if (ni())
13319
+ if (ii())
13320
13320
  return 1;
13321
13321
  let e = 0;
13322
13322
  return this.attachedElements.forEach((t) => {
@@ -13611,14 +13611,14 @@ function il(i, e) {
13611
13611
  i = i.offsetParent, n += i.offsetTop, s += i.offsetLeft;
13612
13612
  return n < t.pageYOffset + t.innerHeight && s < t.pageXOffset + t.innerWidth && n + a > t.pageYOffset && s + r > t.pageXOffset && !o && c !== "none";
13613
13613
  }
13614
- class mi extends ri.EventEmitter {
13614
+ class gi extends ai.EventEmitter {
13615
13615
  constructor(e, t, n, s) {
13616
13616
  var r;
13617
13617
  super(), this.metadataMuted = !1, this.encryption = bn.NONE, this.log = $e, this.handleMuted = () => {
13618
13618
  this.emit(re.Muted);
13619
13619
  }, this.handleUnmuted = () => {
13620
13620
  this.emit(re.Unmuted);
13621
- }, this.log = Ci((r = s == null ? void 0 : s.loggerName) !== null && r !== void 0 ? r : Vn.Publication), this.loggerContextCb = this.loggerContextCb, this.setMaxListeners(100), this.kind = e, this.trackSid = t, this.trackName = n, this.source = J.Source.Unknown;
13621
+ }, this.log = Ei((r = s == null ? void 0 : s.loggerName) !== null && r !== void 0 ? r : zn.Publication), this.loggerContextCb = this.loggerContextCb, this.setMaxListeners(100), this.kind = e, this.trackSid = t, this.trackName = n, this.source = J.Source.Unknown;
13622
13622
  }
13623
13623
  /** @internal */
13624
13624
  setTrack(e) {
@@ -13644,7 +13644,7 @@ class mi extends ri.EventEmitter {
13644
13644
  * an [AudioTrack] if this publication holds an audio track
13645
13645
  */
13646
13646
  get audioTrack() {
13647
- if (Zn(this.track))
13647
+ if (Qn(this.track))
13648
13648
  return this.track;
13649
13649
  }
13650
13650
  /**
@@ -13670,8 +13670,8 @@ class mi extends ri.EventEmitter {
13670
13670
  })(i.SubscriptionStatus || (i.SubscriptionStatus = {})), function(e) {
13671
13671
  e.Allowed = "allowed", e.NotAllowed = "not_allowed";
13672
13672
  }(i.PermissionStatus || (i.PermissionStatus = {}));
13673
- })(mi || (mi = {}));
13674
- class sl extends mi {
13673
+ })(gi || (gi = {}));
13674
+ class sl extends gi {
13675
13675
  get isUpstreamPaused() {
13676
13676
  var e;
13677
13677
  return (e = this.track) === null || e === void 0 ? void 0 : e.isUpstreamPaused;
@@ -13739,7 +13739,7 @@ class sl extends mi {
13739
13739
  }
13740
13740
  getTrackFeatures() {
13741
13741
  var e;
13742
- if (Zn(this.track)) {
13742
+ if (Qn(this.track)) {
13743
13743
  const t = this.track.getSourceTrackSettings(), n = /* @__PURE__ */ new Set();
13744
13744
  return t.autoGainControl && n.add(jt.TF_AUTO_GAIN_CONTROL), t.echoCancellation && n.add(jt.TF_ECHO_CANCELLATION), t.noiseSuppression && n.add(jt.TF_NOISE_SUPPRESSION), t.channelCount && t.channelCount > 1 && n.add(jt.TF_STEREO), !((e = this.options) === null || e === void 0) && e.dtx || n.add(jt.TF_NO_DTX), this.track.enhancedNoiseCancellation && n.add(jt.TF_ENHANCED_NOISE_CANCELLATION), Array.from(n.values());
13745
13745
  } else return [];
@@ -13796,7 +13796,7 @@ function mo(i, e) {
13796
13796
  deviceId: p
13797
13797
  });
13798
13798
  const x = xb(h, v, e);
13799
- return x.kind === J.Kind.Video ? x.source = J.Source.Camera : x.kind === J.Kind.Audio && (x.source = J.Source.Microphone), x.mediaStream = u, Zn(x) && n ? yield x.setProcessor(n) : Ji(x) && s && (yield x.setProcessor(s)), x;
13799
+ return x.kind === J.Kind.Video ? x.source = J.Source.Camera : x.kind === J.Kind.Audio && (x.source = J.Source.Microphone), x.mediaStream = u, Qn(x) && n ? yield x.setProcessor(n) : Ji(x) && s && (yield x.setProcessor(s)), x;
13800
13800
  })));
13801
13801
  } catch (u) {
13802
13802
  if (!t)
@@ -13842,7 +13842,7 @@ function Jb(i) {
13842
13842
  return Hi.Unknown;
13843
13843
  }
13844
13844
  }
13845
- class em extends ri.EventEmitter {
13845
+ class em extends ai.EventEmitter {
13846
13846
  get logContext() {
13847
13847
  var e, t;
13848
13848
  return Object.assign({}, (t = (e = this.loggerOptions) === null || e === void 0 ? void 0 : e.loggerContextCb) === null || t === void 0 ? void 0 : t.call(e));
@@ -13869,7 +13869,7 @@ class em extends ri.EventEmitter {
13869
13869
  constructor(e, t, n, s, r, a) {
13870
13870
  let o = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : Hr.STANDARD;
13871
13871
  var c;
13872
- super(), this.audioLevel = 0, this.isSpeaking = !1, this._connectionQuality = Hi.Unknown, this.log = $e, this.log = Ci((c = a == null ? void 0 : a.loggerName) !== null && c !== void 0 ? c : Vn.Participant), this.loggerOptions = a, this.setMaxListeners(100), this.sid = e, this.identity = t, this.name = n, this.metadata = s, this.audioTrackPublications = /* @__PURE__ */ new Map(), this.videoTrackPublications = /* @__PURE__ */ new Map(), this.trackPublications = /* @__PURE__ */ new Map(), this._kind = o, this._attributes = r ?? {};
13872
+ super(), this.audioLevel = 0, this.isSpeaking = !1, this._connectionQuality = Hi.Unknown, this.log = $e, this.log = Ei((c = a == null ? void 0 : a.loggerName) !== null && c !== void 0 ? c : zn.Participant), this.loggerOptions = a, this.setMaxListeners(100), this.sid = e, this.identity = t, this.name = n, this.metadata = s, this.audioTrackPublications = /* @__PURE__ */ new Map(), this.videoTrackPublications = /* @__PURE__ */ new Map(), this.trackPublications = /* @__PURE__ */ new Map(), this._kind = o, this._attributes = r ?? {};
13873
13873
  }
13874
13874
  getTrackPublications() {
13875
13875
  return Array.from(this.trackPublications.values());
@@ -13896,7 +13896,7 @@ class em extends ri.EventEmitter {
13896
13896
  * @returns a promise that resolves when the participant is active
13897
13897
  */
13898
13898
  waitUntilActive() {
13899
- return this.isActive ? Promise.resolve() : this.activeFuture ? this.activeFuture.promise : (this.activeFuture = new Kn(), this.once(oe.Active, () => {
13899
+ return this.isActive ? Promise.resolve() : this.activeFuture ? this.activeFuture.promise : (this.activeFuture = new Yn(), this.once(oe.Active, () => {
13900
13900
  var e, t;
13901
13901
  (t = (e = this.activeFuture) === null || e === void 0 ? void 0 : e.resolve) === null || t === void 0 || t.call(e), this.activeFuture = void 0;
13902
13902
  }), this.activeFuture.promise);
@@ -13976,7 +13976,7 @@ class em extends ri.EventEmitter {
13976
13976
  * @internal
13977
13977
  */
13978
13978
  setAudioContext(e) {
13979
- this.audioContext = e, this.audioTrackPublications.forEach((t) => Zn(t.track) && t.track.setAudioContext(e));
13979
+ this.audioContext = e, this.audioTrackPublications.forEach((t) => Qn(t.track) && t.track.setAudioContext(e));
13980
13980
  }
13981
13981
  addTrackPublication(e) {
13982
13982
  e.on(re.Muted, () => {
@@ -14013,7 +14013,7 @@ class Qb extends em {
14013
14013
  loggerName: s.loggerName,
14014
14014
  loggerContextCb: () => this.engine.logContext
14015
14015
  }), this.pendingPublishing = /* @__PURE__ */ new Set(), this.pendingPublishPromises = /* @__PURE__ */ new Map(), this.participantTrackPermissions = [], this.allParticipantsAllowedToSubscribe = !0, this.encryptionType = bn.NONE, this.enabledPublishVideoCodecs = [], this.pendingAcks = /* @__PURE__ */ new Map(), this.pendingResponses = /* @__PURE__ */ new Map(), this.handleReconnecting = () => {
14016
- this.reconnectFuture || (this.reconnectFuture = new Kn());
14016
+ this.reconnectFuture || (this.reconnectFuture = new Yn());
14017
14017
  }, this.handleReconnected = () => {
14018
14018
  var o, c;
14019
14019
  (c = (o = this.reconnectFuture) === null || o === void 0 ? void 0 : o.resolve) === null || c === void 0 || c.call(o), this.reconnectFuture = void 0, this.updateTrackSubscriptionPermissions();
@@ -14022,7 +14022,7 @@ class Qb extends em {
14022
14022
  this.reconnectFuture && (this.reconnectFuture.promise.catch((f) => this.log.warn(f.message, this.logContext)), (c = (o = this.reconnectFuture) === null || o === void 0 ? void 0 : o.reject) === null || c === void 0 || c.call(o, "Got disconnected during reconnection attempt"), this.reconnectFuture = void 0), this.signalConnectedFuture && ((d = (l = this.signalConnectedFuture).reject) === null || d === void 0 || d.call(l, "Got disconnected without signal connected"), this.signalConnectedFuture = void 0), (h = (u = this.activeAgentFuture) === null || u === void 0 ? void 0 : u.reject) === null || h === void 0 || h.call(u, "Got disconnected without active agent present"), this.activeAgentFuture = void 0, this.firstActiveAgent = void 0;
14023
14023
  }, this.handleSignalConnected = (o) => {
14024
14024
  var c, l;
14025
- o.participant && this.updateInfo(o.participant), this.signalConnectedFuture || (this.signalConnectedFuture = new Kn()), (l = (c = this.signalConnectedFuture).resolve) === null || l === void 0 || l.call(c);
14025
+ o.participant && this.updateInfo(o.participant), this.signalConnectedFuture || (this.signalConnectedFuture = new Yn()), (l = (c = this.signalConnectedFuture).resolve) === null || l === void 0 || l.call(c);
14026
14026
  }, this.handleSignalRequestResponse = (o) => {
14027
14027
  const {
14028
14028
  requestId: c,
@@ -14082,7 +14082,7 @@ class Qb extends em {
14082
14082
  return;
14083
14083
  const g = yield f.videoTrack.setPublishingCodecs(o.subscribedCodecs);
14084
14084
  try {
14085
- for (var v = !0, m = bi(g), p; p = yield m.next(), c = p.done, !c; v = !0) {
14085
+ for (var v = !0, m = _i(g), p; p = yield m.next(), c = p.done, !c; v = !0) {
14086
14086
  u = p.value, v = !1;
14087
14087
  const x = u;
14088
14088
  M0(x) && (this.log.debug("publish ".concat(x, " for ").concat(f.videoTrack.sid), Object.assign(Object.assign({}, this.logContext), Xe(f))), yield this.publishAdditionalCodecForTrack(f.videoTrack, x, f.options));
@@ -14112,7 +14112,7 @@ class Qb extends em {
14112
14112
  this.log.debug("unpublishing local track due to TrackEnded", Object.assign(Object.assign({}, this.logContext), Xe(o))), this.unpublishTrack(o);
14113
14113
  else if (o.isUserProvided)
14114
14114
  yield o.mute();
14115
- else if (hi(o) || Ii(o))
14115
+ else if (fi(o) || Ii(o))
14116
14116
  try {
14117
14117
  if (un())
14118
14118
  try {
@@ -14127,7 +14127,7 @@ class Qb extends em {
14127
14127
  }, new Error("GetUserMedia Permission denied");
14128
14128
  } catch {
14129
14129
  }
14130
- o.isMuted || (this.log.debug("track ended, attempting to use a different device", Object.assign(Object.assign({}, this.logContext), Xe(o))), hi(o) ? yield o.restartTrack({
14130
+ o.isMuted || (this.log.debug("track ended, attempting to use a different device", Object.assign(Object.assign({}, this.logContext), Xe(o))), fi(o) ? yield o.restartTrack({
14131
14131
  deviceId: "default"
14132
14132
  }) : yield o.restartTrack());
14133
14133
  } catch {
@@ -14317,7 +14317,7 @@ class Qb extends em {
14317
14317
  c = yield this.createScreenTracks(Object.assign({}, n));
14318
14318
  break;
14319
14319
  default:
14320
- throw new _i(e);
14320
+ throw new yi(e);
14321
14321
  }
14322
14322
  } catch (l) {
14323
14323
  throw c == null || c.forEach((d) => {
@@ -14326,7 +14326,7 @@ class Qb extends em {
14326
14326
  }
14327
14327
  for (const l of c) {
14328
14328
  const d = Object.assign(Object.assign({}, this.roomOptions.publishDefaults), n);
14329
- e === J.Source.Microphone && Zn(l) && d.preConnectBuffer && (this.log.info("starting preconnect buffer for microphone", Object.assign({}, this.logContext)), l.startPreConnectBuffer());
14329
+ e === J.Source.Microphone && Qn(l) && d.preConnectBuffer && (this.log.info("starting preconnect buffer for microphone", Object.assign({}, this.logContext)), l.startPreConnectBuffer());
14330
14330
  }
14331
14331
  try {
14332
14332
  const l = [];
@@ -14387,7 +14387,7 @@ class Qb extends em {
14387
14387
  return (yield mo(s, {
14388
14388
  loggerName: this.roomOptions.loggerName,
14389
14389
  loggerContextCb: () => this.logContext
14390
- })).map((o) => (Zn(o) && (this.microphoneError = void 0, o.setAudioContext(this.audioContext), o.source = J.Source.Microphone, this.emit(oe.AudioStreamAcquired)), Ji(o) && (this.cameraError = void 0, o.source = J.Source.Camera), o));
14390
+ })).map((o) => (Qn(o) && (this.microphoneError = void 0, o.setAudioContext(this.audioContext), o.source = J.Source.Microphone, this.emit(oe.AudioStreamAcquired)), Ji(o) && (this.cameraError = void 0, o.source = J.Source.Camera), o));
14391
14391
  } catch (r) {
14392
14392
  throw r instanceof Error && (e.audio && (this.microphoneError = r), e.video && (this.cameraError = r)), r;
14393
14393
  }
@@ -14405,7 +14405,7 @@ class Qb extends em {
14405
14405
  e.resolution === void 0 && !I0() && (e.resolution = bd.h1080fps30.resolution);
14406
14406
  const t = j0(e), n = yield navigator.mediaDevices.getDisplayMedia(t), s = n.getVideoTracks();
14407
14407
  if (s.length === 0)
14408
- throw new _i("no video track found");
14408
+ throw new yi("no video track found");
14409
14409
  const r = new no(s[0], void 0, !1, {
14410
14410
  loggerName: this.roomOptions.loggerName,
14411
14411
  loggerContextCb: () => this.logContext
@@ -14439,7 +14439,7 @@ class Qb extends em {
14439
14439
  let a = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1;
14440
14440
  return function* () {
14441
14441
  var o, c, l, d;
14442
- hi(n) && n.setAudioContext(r.audioContext), yield (o = r.reconnectFuture) === null || o === void 0 ? void 0 : o.promise, r.republishPromise && !a && (yield r.republishPromise), Js(n) && r.pendingPublishPromises.has(n) && (yield r.pendingPublishPromises.get(n));
14442
+ fi(n) && n.setAudioContext(r.audioContext), yield (o = r.reconnectFuture) === null || o === void 0 ? void 0 : o.promise, r.republishPromise && !a && (yield r.republishPromise), Js(n) && r.pendingPublishPromises.has(n) && (yield r.pendingPublishPromises.get(n));
14443
14443
  let u;
14444
14444
  if (n instanceof MediaStreamTrack)
14445
14445
  u = n.getConstraints();
@@ -14472,7 +14472,7 @@ class Qb extends em {
14472
14472
  });
14473
14473
  break;
14474
14474
  default:
14475
- throw new _i("unsupported MediaStreamTrack kind ".concat(n.kind));
14475
+ throw new yi("unsupported MediaStreamTrack kind ".concat(n.kind));
14476
14476
  }
14477
14477
  else
14478
14478
  n.updateLoggerOptions({
@@ -14524,7 +14524,7 @@ class Qb extends em {
14524
14524
  });
14525
14525
  }
14526
14526
  waitUntilEngineConnected() {
14527
- return this.signalConnectedFuture || (this.signalConnectedFuture = new Kn()), this.signalConnectedFuture.promise;
14527
+ return this.signalConnectedFuture || (this.signalConnectedFuture = new Yn()), this.signalConnectedFuture.promise;
14528
14528
  }
14529
14529
  hasPermissionsToPublish(e) {
14530
14530
  if (!this.permissions)
@@ -14540,11 +14540,11 @@ class Qb extends em {
14540
14540
  var s, r, a, o, c, l, d, u, h, f;
14541
14541
  if (!this.hasPermissionsToPublish(e))
14542
14542
  throw new Fu("failed to publish track, insufficient permissions", 403);
14543
- Array.from(this.trackPublications.values()).find((y) => Js(e) && y.source === e.source) && e.source !== J.Source.Unknown && this.log.info("publishing a second track with the same source: ".concat(e.source), Object.assign(Object.assign({}, this.logContext), Xe(e))), t.stopMicTrackOnMute && Zn(e) && (e.stopOnMute = !0), e.source === J.Source.ScreenShare && Ss() && (t.simulcast = !1), t.videoCodec === "av1" && !R0() && (t.videoCodec = void 0), t.videoCodec === "vp9" && !P0() && (t.videoCodec = void 0), t.videoCodec === void 0 && (t.videoCodec = Qc), this.enabledPublishVideoCodecs.length > 0 && (this.enabledPublishVideoCodecs.some((y) => t.videoCodec === Or(y.mime)) || (t.videoCodec = Or(this.enabledPublishVideoCodecs[0].mime)));
14543
+ Array.from(this.trackPublications.values()).find((y) => Js(e) && y.source === e.source) && e.source !== J.Source.Unknown && this.log.info("publishing a second track with the same source: ".concat(e.source), Object.assign(Object.assign({}, this.logContext), Xe(e))), t.stopMicTrackOnMute && Qn(e) && (e.stopOnMute = !0), e.source === J.Source.ScreenShare && Ss() && (t.simulcast = !1), t.videoCodec === "av1" && !R0() && (t.videoCodec = void 0), t.videoCodec === "vp9" && !P0() && (t.videoCodec = void 0), t.videoCodec === void 0 && (t.videoCodec = Qc), this.enabledPublishVideoCodecs.length > 0 && (this.enabledPublishVideoCodecs.some((y) => t.videoCodec === Or(y.mime)) || (t.videoCodec = Or(this.enabledPublishVideoCodecs[0].mime)));
14544
14544
  const v = t.videoCodec;
14545
14545
  e.on(re.Muted, this.onTrackMuted), e.on(re.Unmuted, this.onTrackUnmuted), e.on(re.Ended, this.handleTrackEnded), e.on(re.UpstreamPaused, this.onTrackUpstreamPaused), e.on(re.UpstreamResumed, this.onTrackUpstreamResumed), e.on(re.AudioTrackFeatureUpdate, this.onTrackFeatureUpdate);
14546
14546
  const m = [], p = !(!((s = t.dtx) !== null && s !== void 0) || s), x = e.getSourceTrackSettings();
14547
- x.autoGainControl && m.push(jt.TF_AUTO_GAIN_CONTROL), x.echoCancellation && m.push(jt.TF_ECHO_CANCELLATION), x.noiseSuppression && m.push(jt.TF_NOISE_SUPPRESSION), x.channelCount && x.channelCount > 1 && m.push(jt.TF_STEREO), p && m.push(jt.TF_NO_DTX), hi(e) && e.hasPreConnectBuffer && m.push(jt.TF_PRECONNECT_BUFFER);
14547
+ x.autoGainControl && m.push(jt.TF_AUTO_GAIN_CONTROL), x.echoCancellation && m.push(jt.TF_ECHO_CANCELLATION), x.noiseSuppression && m.push(jt.TF_NOISE_SUPPRESSION), x.channelCount && x.channelCount > 1 && m.push(jt.TF_STEREO), p && m.push(jt.TF_NO_DTX), fi(e) && e.hasPreConnectBuffer && m.push(jt.TF_PRECONNECT_BUFFER);
14548
14548
  const C = new Dc({
14549
14549
  // get local track id for use during publishing
14550
14550
  cid: e.mediaStreamTrack.id,
@@ -14577,7 +14577,7 @@ class Qb extends em {
14577
14577
  dims: y
14578
14578
  }));
14579
14579
  }
14580
- C.width = y.width, C.height = y.height, Ii(e) && ($n(v) && (e.source === J.Source.ScreenShare && (t.scalabilityMode = "L1T3", "contentHint" in e.mediaStreamTrack && (e.mediaStreamTrack.contentHint = "motion", this.log.info("forcing contentHint to motion for screenshare with SVC codecs", Object.assign(Object.assign({}, this.logContext), Xe(e))))), t.scalabilityMode = (c = t.scalabilityMode) !== null && c !== void 0 ? c : "L3T3_KEY"), C.simulcastCodecs = [new Ic({
14580
+ C.width = y.width, C.height = y.height, Ii(e) && (Kn(v) && (e.source === J.Source.ScreenShare && (t.scalabilityMode = "L1T3", "contentHint" in e.mediaStreamTrack && (e.mediaStreamTrack.contentHint = "motion", this.log.info("forcing contentHint to motion for screenshare with SVC codecs", Object.assign(Object.assign({}, this.logContext), Xe(e))))), t.scalabilityMode = (c = t.scalabilityMode) !== null && c !== void 0 ? c : "L3T3_KEY"), C.simulcastCodecs = [new Ic({
14581
14581
  codec: v,
14582
14582
  cid: e.mediaStreamTrack.id
14583
14583
  })], t.backupCodec === !0 && (t.backupCodec = {
@@ -14586,7 +14586,7 @@ class Qb extends em {
14586
14586
  C.encryption === bn.NONE && (this.roomOptions.dynacast || (this.roomOptions.dynacast = !0), C.simulcastCodecs.push(new Ic({
14587
14587
  codec: t.backupCodec.codec,
14588
14588
  cid: ""
14589
- })))), b = tl(e.source === J.Source.ScreenShare, C.width, C.height, t), C.layers = ch(C.width, C.height, b, $n(t.videoCodec));
14589
+ })))), b = tl(e.source === J.Source.ScreenShare, C.width, C.height, t), C.layers = ch(C.width, C.height, b, Kn(t.videoCodec));
14590
14590
  } else e.kind === J.Kind.Audio && (b = [{
14591
14591
  maxBitrate: (l = t.audioPreset) === null || l === void 0 ? void 0 : l.maxBitrate,
14592
14592
  priority: (u = (d = t.audioPreset) === null || d === void 0 ? void 0 : d.priority) !== null && u !== void 0 ? u : "high",
@@ -14611,7 +14611,7 @@ class Qb extends em {
14611
14611
  codec: "opus",
14612
14612
  maxbr: !((T = b[0]) === null || T === void 0) && T.maxBitrate ? b[0].maxBitrate / 1e3 : 0
14613
14613
  });
14614
- } else e.codec && $n(e.codec) && (!((R = b[0]) === null || R === void 0) && R.maxBitrate) && this.engine.pcManager.publisher.setTrackCodecBitrate({
14614
+ } else e.codec && Kn(e.codec) && (!((R = b[0]) === null || R === void 0) && R.maxBitrate) && this.engine.pcManager.publisher.setTrackCodecBitrate({
14615
14615
  cid: C.cid,
14616
14616
  codec: e.codec,
14617
14617
  maxbr: b[0].maxBitrate / 1e3
@@ -14653,7 +14653,7 @@ class Qb extends em {
14653
14653
  if (k.on(re.CpuConstrained, (y) => this.onTrackCpuConstrained(y, k)), k.options = t, e.sid = M.sid, this.log.debug("publishing ".concat(e.kind, " with encodings"), Object.assign(Object.assign({}, this.logContext), {
14654
14654
  encodings: b,
14655
14655
  trackInfo: M
14656
- })), Ii(e) ? e.startMonitor(this.engine.client) : hi(e) && e.startMonitor(), this.addTrackPublication(k), this.emit(oe.LocalTrackPublished, k), hi(e) && M.audioFeatures.includes(jt.TF_PRECONNECT_BUFFER)) {
14656
+ })), Ii(e) ? e.startMonitor(this.engine.client) : fi(e) && e.startMonitor(), this.addTrackPublication(k), this.emit(oe.LocalTrackPublished, k), fi(e) && M.audioFeatures.includes(jt.TF_PRECONNECT_BUFFER)) {
14657
14657
  const y = e.getPreConnectBuffer(), T = e.getPreConnectBufferMimeType();
14658
14658
  this.on(oe.LocalTrackSubscribed, (R) => {
14659
14659
  if (R.trackSid === M.sid) {
@@ -14683,7 +14683,7 @@ class Qb extends em {
14683
14683
  }
14684
14684
  });
14685
14685
  try {
14686
- for (var le = !0, be = bi(y), Be; Be = yield be.next(), q = Be.done, !q; le = !0) {
14686
+ for (var le = !0, be = _i(y), Be; Be = yield be.next(), q = Be.done, !q; le = !0) {
14687
14687
  W = Be.value, le = !1;
14688
14688
  const $ = W;
14689
14689
  yield ft.write($);
@@ -14729,9 +14729,9 @@ class Qb extends em {
14729
14729
  if (this.trackPublications.forEach((f) => {
14730
14730
  f.track && f.track === e && (r = f);
14731
14731
  }), !r)
14732
- throw new _i("track is not published");
14732
+ throw new yi("track is not published");
14733
14733
  if (!Ii(e))
14734
- throw new _i("track is not a video track");
14734
+ throw new yi("track is not a video track");
14735
14735
  const a = Object.assign(Object.assign({}, (s = this.roomOptions) === null || s === void 0 ? void 0 : s.publishDefaults), n), o = Rb(e, t, a);
14736
14736
  if (!o) {
14737
14737
  this.log.info("backup codec has been disabled, ignoring request to add additional codec for track", Object.assign(Object.assign({}, this.logContext), Xe(e)));
@@ -14819,7 +14819,7 @@ class Qb extends em {
14819
14819
  c.track && (t && (c.options = Object.assign(Object.assign({}, c.options), t)), o.push(c));
14820
14820
  }), yield Promise.all(o.map((c) => P(this, void 0, void 0, function* () {
14821
14821
  const l = c.track;
14822
- yield this.unpublishTrack(l, !1), s && !l.isMuted && l.source !== J.Source.ScreenShare && l.source !== J.Source.ScreenShareAudio && (hi(l) || Ii(l)) && !l.isUserProvided && (this.log.debug("restarting existing track", Object.assign(Object.assign({}, this.logContext), {
14822
+ yield this.unpublishTrack(l, !1), s && !l.isMuted && l.source !== J.Source.ScreenShare && l.source !== J.Source.ScreenShareAudio && (fi(l) || Ii(l)) && !l.isUserProvided && (this.log.debug("restarting existing track", Object.assign(Object.assign({}, this.logContext), {
14823
14823
  track: c.trackSid
14824
14824
  })), yield l.restartTrack()), yield this.publishOrRepublishTrack(l, c.options, !0);
14825
14825
  }))), r();
@@ -14987,7 +14987,7 @@ class Qb extends em {
14987
14987
  d(It.builtIn("REQUEST_PAYLOAD_TOO_LARGE"));
14988
14988
  return;
14989
14989
  }
14990
- if (!((h = (u = this.engine.latestJoinResponse) === null || u === void 0 ? void 0 : u.serverInfo) === null || h === void 0) && h.version && ii((g = (f = this.engine.latestJoinResponse) === null || f === void 0 ? void 0 : f.serverInfo) === null || g === void 0 ? void 0 : g.version, "1.8.0") < 0) {
14990
+ if (!((h = (u = this.engine.latestJoinResponse) === null || u === void 0 ? void 0 : u.serverInfo) === null || h === void 0) && h.version && si((g = (f = this.engine.latestJoinResponse) === null || f === void 0 ? void 0 : f.serverInfo) === null || g === void 0 ? void 0 : g.version, "1.8.0") < 0) {
14991
14991
  d(It.builtIn("UNSUPPORTED_SERVER"));
14992
14992
  return;
14993
14993
  }
@@ -15111,13 +15111,13 @@ class Qb extends em {
15111
15111
  this.firstActiveAgent = e, e && !this.firstActiveAgent && (this.firstActiveAgent = e), e ? (n = (t = this.activeAgentFuture) === null || t === void 0 ? void 0 : t.resolve) === null || n === void 0 || n.call(t, e) : (r = (s = this.activeAgentFuture) === null || s === void 0 ? void 0 : s.reject) === null || r === void 0 || r.call(s, "Agent disconnected"), this.activeAgentFuture = void 0;
15112
15112
  }
15113
15113
  waitUntilActiveAgentPresent() {
15114
- return this.firstActiveAgent ? Promise.resolve(this.firstActiveAgent) : (this.activeAgentFuture || (this.activeAgentFuture = new Kn()), this.activeAgentFuture.promise);
15114
+ return this.firstActiveAgent ? Promise.resolve(this.firstActiveAgent) : (this.activeAgentFuture || (this.activeAgentFuture = new Yn()), this.activeAgentFuture.promise);
15115
15115
  }
15116
15116
  getPublicationForTrack(e) {
15117
15117
  let t;
15118
15118
  return this.trackPublications.forEach((n) => {
15119
15119
  const s = n.track;
15120
- s && (e instanceof MediaStreamTrack ? (hi(s) || Ii(s)) && s.mediaStreamTrack === e && (t = n) : e === s && (t = n));
15120
+ s && (e instanceof MediaStreamTrack ? (fi(s) || Ii(s)) && s.mediaStreamTrack === e && (t = n) : e === s && (t = n));
15121
15121
  }), t;
15122
15122
  }
15123
15123
  waitForPendingPublicationOfSource(e) {
@@ -15135,7 +15135,7 @@ class Qb extends em {
15135
15135
  });
15136
15136
  }
15137
15137
  }
15138
- class e_ extends mi {
15138
+ class e_ extends gi {
15139
15139
  constructor(e, t, n, s) {
15140
15140
  super(e, t.sid, t.name, s), this.track = void 0, this.allowed = !0, this.requestedDisabled = void 0, this.visible = !0, this.handleEnded = (r) => {
15141
15141
  this.setTrack(void 0), this.emit(re.Ended, r);
@@ -15165,10 +15165,10 @@ class e_ extends mi {
15165
15165
  this.emit(re.UpdateSubscription, s), this.emitSubscriptionUpdateIfChanged(t), this.emitPermissionUpdateIfChanged(n);
15166
15166
  }
15167
15167
  get subscriptionStatus() {
15168
- return this.subscribed === !1 ? mi.SubscriptionStatus.Unsubscribed : super.isSubscribed ? mi.SubscriptionStatus.Subscribed : mi.SubscriptionStatus.Desired;
15168
+ return this.subscribed === !1 ? gi.SubscriptionStatus.Unsubscribed : super.isSubscribed ? gi.SubscriptionStatus.Subscribed : gi.SubscriptionStatus.Desired;
15169
15169
  }
15170
15170
  get permissionStatus() {
15171
- return this.allowed ? mi.PermissionStatus.Allowed : mi.PermissionStatus.NotAllowed;
15171
+ return this.allowed ? gi.PermissionStatus.Allowed : gi.PermissionStatus.NotAllowed;
15172
15172
  }
15173
15173
  /**
15174
15174
  * Returns true if track is subscribed, and ready for playback
@@ -15372,7 +15372,7 @@ class io extends em {
15372
15372
  }
15373
15373
  const c = e.kind === "video";
15374
15374
  let l;
15375
- return c ? l = new Xb(e, t, s, r) : l = new jb(e, t, s, this.audioContext, this.audioOutput), l.source = o.source, l.isMuted = o.isMuted, l.setMediaStream(n), l.start(), o.setTrack(l), this.volumeMap.has(o.source) && Yc(l) && Zn(l) && l.setVolume(this.volumeMap.get(o.source)), o;
15375
+ return c ? l = new Xb(e, t, s, r) : l = new jb(e, t, s, this.audioContext, this.audioOutput), l.source = o.source, l.isMuted = o.isMuted, l.setMediaStream(n), l.start(), o.setTrack(l), this.volumeMap.has(o.source) && Yc(l) && Qn(l) && l.setVolume(this.volumeMap.get(o.source)), o;
15376
15376
  }
15377
15377
  /** @internal */
15378
15378
  get hasMetadata() {
@@ -15442,7 +15442,7 @@ class io extends em {
15442
15442
  const t = [];
15443
15443
  this.audioTrackPublications.forEach((n) => {
15444
15444
  var s;
15445
- Zn(n.track) && Yc(n.track) && t.push(n.track.setSinkId((s = e.deviceId) !== null && s !== void 0 ? s : "default"));
15445
+ Qn(n.track) && Yc(n.track) && t.push(n.track.setSinkId((s = e.deviceId) !== null && s !== void 0 ? s : "default"));
15446
15446
  }), yield Promise.all(t);
15447
15447
  });
15448
15448
  }
@@ -15461,7 +15461,7 @@ var it;
15461
15461
  i.Disconnected = "disconnected", i.Connecting = "connecting", i.Connected = "connected", i.Reconnecting = "reconnecting", i.SignalReconnecting = "signalReconnecting";
15462
15462
  })(it || (it = {}));
15463
15463
  const t_ = 4 * 1e3;
15464
- class rr extends ri.EventEmitter {
15464
+ class rr extends ai.EventEmitter {
15465
15465
  /**
15466
15466
  * Creates a new Room, the primary construct for a LiveKit session.
15467
15467
  * @param options
@@ -15471,7 +15471,7 @@ class rr extends ri.EventEmitter {
15471
15471
  if (super(), t = this, this.state = it.Disconnected, this.activeSpeakers = [], this.isE2EEEnabled = !1, this.audioEnabled = !0, this.isVideoPlaybackBlocked = !1, this.log = $e, this.bufferedEvents = [], this.isResuming = !1, this.rpcHandlers = /* @__PURE__ */ new Map(), this.connect = (a, o, c) => P(this, void 0, void 0, function* () {
15472
15472
  var l;
15473
15473
  if (!k0())
15474
- throw ni() ? Error("WebRTC isn't detected, have you called registerGlobals?") : Error("LiveKit doesn't seem to be supported on this browser. Try to update your browser and make sure no browser extensions are disabling webRTC.");
15474
+ throw ii() ? Error("WebRTC isn't detected, have you called registerGlobals?") : Error("LiveKit doesn't seem to be supported on this browser. Try to update your browser and make sure no browser extensions are disabling webRTC.");
15475
15475
  const d = yield this.disconnectLock.lock();
15476
15476
  if (this.state === it.Connected)
15477
15477
  return this.log.info("already connected to room ".concat(this.name), this.logContext), d(), Promise.resolve();
@@ -15493,24 +15493,24 @@ class rr extends ri.EventEmitter {
15493
15493
  try {
15494
15494
  yield this.attemptConnection(v ?? a, o, c, x), this.abortController = void 0, f();
15495
15495
  } catch (C) {
15496
- if (this.regionUrlProvider && C instanceof bt && C.reason !== Ye.Cancelled && C.reason !== Ye.NotAllowed) {
15496
+ if (this.regionUrlProvider && C instanceof St && C.reason !== Ye.Cancelled && C.reason !== Ye.NotAllowed) {
15497
15497
  let b = null;
15498
15498
  try {
15499
15499
  b = yield this.regionUrlProvider.getNextBestRegionUrl((m = this.abortController) === null || m === void 0 ? void 0 : m.signal);
15500
15500
  } catch (S) {
15501
- if (S instanceof bt && (S.status === 401 || S.reason === Ye.Cancelled)) {
15501
+ if (S instanceof St && (S.status === 401 || S.reason === Ye.Cancelled)) {
15502
15502
  this.handleDisconnect(this.options.stopLocalTrackOnUnpublish), g(S);
15503
15503
  return;
15504
15504
  }
15505
15505
  }
15506
15506
  b && !(!((p = this.abortController) === null || p === void 0) && p.signal.aborted) ? (this.log.info("Initial connection failed with ConnectionError: ".concat(C.message, ". Retrying with another region: ").concat(b), this.logContext), this.recreateEngine(), yield u(f, g, b)) : (this.handleDisconnect(this.options.stopLocalTrackOnUnpublish, Xu(C)), g(C));
15507
15507
  } else {
15508
- let b = Fn.UNKNOWN_REASON;
15509
- C instanceof bt && (b = Xu(C)), this.handleDisconnect(this.options.stopLocalTrackOnUnpublish, b), g(C);
15508
+ let b = Bn.UNKNOWN_REASON;
15509
+ C instanceof St && (b = Xu(C)), this.handleDisconnect(this.options.stopLocalTrackOnUnpublish, b), g(C);
15510
15510
  }
15511
15511
  }
15512
15512
  }), h = this.regionUrl;
15513
- return this.regionUrl = void 0, this.connectFuture = new Kn((f, g) => {
15513
+ return this.regionUrl = void 0, this.connectFuture = new Yn((f, g) => {
15514
15514
  u(f, g, h);
15515
15515
  }, () => {
15516
15516
  this.clearConnectionFutures();
@@ -15557,13 +15557,13 @@ class rr extends ri.EventEmitter {
15557
15557
  this.applyJoinResponse(h), this.setupLocalParticipantEvents(), this.emit(te.SignalConnected);
15558
15558
  } catch (h) {
15559
15559
  yield this.engine.close(), this.recreateEngine();
15560
- const f = new bt("could not establish signal connection", Ye.ServerUnreachable);
15561
- throw h instanceof Error && (f.message = "".concat(f.message, ": ").concat(h.message)), h instanceof bt && (f.reason = h.reason, f.status = h.status), this.log.debug("error trying to establish signal connection", Object.assign(Object.assign({}, this.logContext), {
15560
+ const f = new St("could not establish signal connection", Ye.ServerUnreachable);
15561
+ throw h instanceof Error && (f.message = "".concat(f.message, ": ").concat(h.message)), h instanceof St && (f.reason = h.reason, f.status = h.status), this.log.debug("error trying to establish signal connection", Object.assign(Object.assign({}, this.logContext), {
15562
15562
  error: h
15563
15563
  })), f;
15564
15564
  }
15565
15565
  if (l.signal.aborted)
15566
- throw yield this.engine.close(), this.recreateEngine(), new bt("Connection attempt aborted", Ye.Cancelled);
15566
+ throw yield this.engine.close(), this.recreateEngine(), new St("Connection attempt aborted", Ye.Cancelled);
15567
15567
  try {
15568
15568
  yield this.engine.waitForPCInitialConnection(this.connOptions.peerConnectionTimeout, l);
15569
15569
  } catch (h) {
@@ -15584,7 +15584,7 @@ class rr extends ri.EventEmitter {
15584
15584
  l.log.debug("already disconnected", l.logContext);
15585
15585
  return;
15586
15586
  }
15587
- l.log.info("disconnect from room", Object.assign({}, l.logContext)), (l.state === it.Connecting || l.state === it.Reconnecting || l.isResuming) && (l.log.warn("abort connection attempt", l.logContext), (u = l.abortController) === null || u === void 0 || u.abort(), (f = (h = l.connectFuture) === null || h === void 0 ? void 0 : h.reject) === null || f === void 0 || f.call(h, new bt("Client initiated disconnect", Ye.Cancelled)), l.connectFuture = void 0), !((g = l.engine) === null || g === void 0) && g.client.isDisconnected || (yield l.engine.client.sendLeave()), l.engine && (yield l.engine.close()), l.handleDisconnect(d, Fn.CLIENT_INITIATED), l.engine = void 0;
15587
+ l.log.info("disconnect from room", Object.assign({}, l.logContext)), (l.state === it.Connecting || l.state === it.Reconnecting || l.isResuming) && (l.log.warn("abort connection attempt", l.logContext), (u = l.abortController) === null || u === void 0 || u.abort(), (f = (h = l.connectFuture) === null || h === void 0 ? void 0 : h.reject) === null || f === void 0 || f.call(h, new St("Client initiated disconnect", Ye.Cancelled)), l.connectFuture = void 0), !((g = l.engine) === null || g === void 0) && g.client.isDisconnected || (yield l.engine.client.sendLeave()), l.engine && (yield l.engine.close()), l.handleDisconnect(d, Bn.CLIENT_INITIATED), l.engine = void 0;
15588
15588
  } finally {
15589
15589
  v();
15590
15590
  }
@@ -15789,7 +15789,7 @@ class rr extends ri.EventEmitter {
15789
15789
  (o = a == null ? void 0 : a.onPublish) === null || o === void 0 || o.call(a, this);
15790
15790
  }, this.onLocalTrackPublished = (a) => P(this, void 0, void 0, function* () {
15791
15791
  var o, c, l, d, u, h;
15792
- (o = a.track) === null || o === void 0 || o.on(re.TrackProcessorUpdate, this.onTrackProcessorUpdate), (c = a.track) === null || c === void 0 || c.on(re.Restarted, this.onLocalTrackRestarted), (u = (d = (l = a.track) === null || l === void 0 ? void 0 : l.getProcessor()) === null || d === void 0 ? void 0 : d.onPublish) === null || u === void 0 || u.call(d, this), this.emit(te.LocalTrackPublished, a, this.localParticipant), hi(a.track) && (yield a.track.checkForSilence()) && this.emit(te.LocalAudioSilenceDetected, a);
15792
+ (o = a.track) === null || o === void 0 || o.on(re.TrackProcessorUpdate, this.onTrackProcessorUpdate), (c = a.track) === null || c === void 0 || c.on(re.Restarted, this.onLocalTrackRestarted), (u = (d = (l = a.track) === null || l === void 0 ? void 0 : l.getProcessor()) === null || d === void 0 ? void 0 : d.onPublish) === null || u === void 0 || u.call(d, this), this.emit(te.LocalTrackPublished, a, this.localParticipant), fi(a.track) && (yield a.track.checkForSilence()) && this.emit(te.LocalAudioSilenceDetected, a);
15793
15793
  const f = yield (h = a.track) === null || h === void 0 ? void 0 : h.getDeviceId(!1), g = Zc(a.source);
15794
15794
  g && f && f !== this.localParticipant.activeDeviceMap.get(g) && (this.localParticipant.activeDeviceMap.set(g, f), this.emit(te.ActiveDeviceChanged, g, f));
15795
15795
  }), this.onLocalTrackUnpublished = (a) => {
@@ -15806,7 +15806,7 @@ class rr extends ri.EventEmitter {
15806
15806
  this.emit(te.ParticipantPermissionsChanged, a, this.localParticipant);
15807
15807
  }, this.onLocalChatMessageSent = (a) => {
15808
15808
  this.emit(te.ChatMessage, a, this.localParticipant);
15809
- }, this.setMaxListeners(100), this.remoteParticipants = /* @__PURE__ */ new Map(), this.sidToIdentity = /* @__PURE__ */ new Map(), this.options = Object.assign(Object.assign({}, pb), e), this.log = Ci((n = this.options.loggerName) !== null && n !== void 0 ? n : Vn.Room), this.transcriptionReceivedTimes = /* @__PURE__ */ new Map(), this.options.audioCaptureDefaults = Object.assign(Object.assign({}, qp), e == null ? void 0 : e.audioCaptureDefaults), this.options.videoCaptureDefaults = Object.assign(Object.assign({}, jp), e == null ? void 0 : e.videoCaptureDefaults), this.options.publishDefaults = Object.assign(Object.assign({}, fb), e == null ? void 0 : e.publishDefaults), this.maybeCreateEngine(), this.incomingDataStreamManager = new Gb(), this.outgoingDataStreamManager = new qb(this.engine, this.log), this.disconnectLock = new hn(), this.localParticipant = new Qb("", "", this.engine, this.options, this.rpcHandlers, this.outgoingDataStreamManager), this.options.videoCaptureDefaults.deviceId && this.localParticipant.activeDeviceMap.set("videoinput", Ki(this.options.videoCaptureDefaults.deviceId)), this.options.audioCaptureDefaults.deviceId && this.localParticipant.activeDeviceMap.set("audioinput", Ki(this.options.audioCaptureDefaults.deviceId)), !((s = this.options.audioOutput) === null || s === void 0) && s.deviceId && this.switchActiveDevice("audiooutput", Ki(this.options.audioOutput.deviceId)).catch((a) => this.log.warn("Could not set audio output: ".concat(a.message), this.logContext)), this.options.e2ee && this.setupE2EE(), un()) {
15809
+ }, this.setMaxListeners(100), this.remoteParticipants = /* @__PURE__ */ new Map(), this.sidToIdentity = /* @__PURE__ */ new Map(), this.options = Object.assign(Object.assign({}, pb), e), this.log = Ei((n = this.options.loggerName) !== null && n !== void 0 ? n : zn.Room), this.transcriptionReceivedTimes = /* @__PURE__ */ new Map(), this.options.audioCaptureDefaults = Object.assign(Object.assign({}, qp), e == null ? void 0 : e.audioCaptureDefaults), this.options.videoCaptureDefaults = Object.assign(Object.assign({}, jp), e == null ? void 0 : e.videoCaptureDefaults), this.options.publishDefaults = Object.assign(Object.assign({}, fb), e == null ? void 0 : e.publishDefaults), this.maybeCreateEngine(), this.incomingDataStreamManager = new Gb(), this.outgoingDataStreamManager = new qb(this.engine, this.log), this.disconnectLock = new hn(), this.localParticipant = new Qb("", "", this.engine, this.options, this.rpcHandlers, this.outgoingDataStreamManager), this.options.videoCaptureDefaults.deviceId && this.localParticipant.activeDeviceMap.set("videoinput", Ki(this.options.videoCaptureDefaults.deviceId)), this.options.audioCaptureDefaults.deviceId && this.localParticipant.activeDeviceMap.set("audioinput", Ki(this.options.audioCaptureDefaults.deviceId)), !((s = this.options.audioOutput) === null || s === void 0) && s.deviceId && this.switchActiveDevice("audiooutput", Ki(this.options.audioOutput.deviceId)).catch((a) => this.log.warn("Could not set audio output: ".concat(a.message), this.logContext)), this.options.e2ee && this.setupE2EE(), un()) {
15810
15810
  const a = new AbortController();
15811
15811
  (r = navigator.mediaDevices) === null || r === void 0 || r.addEventListener("devicechange", this.handleDeviceChange, {
15812
15812
  signal: a.signal
@@ -16032,7 +16032,7 @@ class rr extends ri.EventEmitter {
16032
16032
  yield this.engine.client.handleOnClose("simulate disconnect");
16033
16033
  break;
16034
16034
  case "speaker":
16035
- s = new qn({
16035
+ s = new jn({
16036
16036
  scenario: {
16037
16037
  case: "speakerUpdate",
16038
16038
  value: 3
@@ -16040,7 +16040,7 @@ class rr extends ri.EventEmitter {
16040
16040
  });
16041
16041
  break;
16042
16042
  case "node-failure":
16043
- s = new qn({
16043
+ s = new jn({
16044
16044
  scenario: {
16045
16045
  case: "nodeFailure",
16046
16046
  value: !0
@@ -16048,7 +16048,7 @@ class rr extends ri.EventEmitter {
16048
16048
  });
16049
16049
  break;
16050
16050
  case "server-leave":
16051
- s = new qn({
16051
+ s = new jn({
16052
16052
  scenario: {
16053
16053
  case: "serverLeave",
16054
16054
  value: !0
@@ -16056,7 +16056,7 @@ class rr extends ri.EventEmitter {
16056
16056
  });
16057
16057
  break;
16058
16058
  case "migration":
16059
- s = new qn({
16059
+ s = new jn({
16060
16060
  scenario: {
16061
16061
  case: "migration",
16062
16062
  value: !0
@@ -16069,7 +16069,7 @@ class rr extends ri.EventEmitter {
16069
16069
  case "disconnect-signal-on-resume":
16070
16070
  n = () => P(this, void 0, void 0, function* () {
16071
16071
  yield this.engine.client.handleOnClose("simulate resume-disconnect");
16072
- }), s = new qn({
16072
+ }), s = new jn({
16073
16073
  scenario: {
16074
16074
  case: "disconnectSignalOnResume",
16075
16075
  value: !0
@@ -16079,7 +16079,7 @@ class rr extends ri.EventEmitter {
16079
16079
  case "disconnect-signal-on-resume-no-messages":
16080
16080
  n = () => P(this, void 0, void 0, function* () {
16081
16081
  yield this.engine.client.handleOnClose("simulate resume-disconnect");
16082
- }), s = new qn({
16082
+ }), s = new jn({
16083
16083
  scenario: {
16084
16084
  case: "disconnectSignalOnResumeNoMessages",
16085
16085
  value: !0
@@ -16091,7 +16091,7 @@ class rr extends ri.EventEmitter {
16091
16091
  break;
16092
16092
  case "force-tcp":
16093
16093
  case "force-tls":
16094
- s = new qn({
16094
+ s = new jn({
16095
16095
  scenario: {
16096
16096
  case: "switchCandidateProtocol",
16097
16097
  value: e === "force-tls" ? 2 : 1
@@ -16099,7 +16099,7 @@ class rr extends ri.EventEmitter {
16099
16099
  }), n = () => P(this, void 0, void 0, function* () {
16100
16100
  const r = this.engine.client.onLeave;
16101
16101
  r && r(new ho({
16102
- reason: Fn.CLIENT_INITIATED,
16102
+ reason: Bn.CLIENT_INITIATED,
16103
16103
  action: $s.RECONNECT
16104
16104
  }));
16105
16105
  });
@@ -16107,7 +16107,7 @@ class rr extends ri.EventEmitter {
16107
16107
  case "subscriber-bandwidth":
16108
16108
  if (t === void 0 || typeof t != "number")
16109
16109
  throw new Error("subscriber-bandwidth requires a number as argument");
16110
- s = new qn({
16110
+ s = new jn({
16111
16111
  scenario: {
16112
16112
  case: "subscriberBandwidth",
16113
16113
  value: cs(t)
@@ -16115,7 +16115,7 @@ class rr extends ri.EventEmitter {
16115
16115
  });
16116
16116
  break;
16117
16117
  case "leave-full-reconnect":
16118
- s = new qn({
16118
+ s = new jn({
16119
16119
  scenario: {
16120
16120
  case: "leaveRequestFullReconnect",
16121
16121
  value: !0
@@ -16428,7 +16428,7 @@ class rr extends ri.EventEmitter {
16428
16428
  closed: this.engine.isClosed,
16429
16429
  transportsConnected: this.engine.verifyTransport()
16430
16430
  } : void 0
16431
- })), e >= 3 && (this.recreateEngine(), this.handleDisconnect(this.options.stopLocalTrackOnUnpublish, Fn.STATE_MISMATCH))) : e = 0;
16431
+ })), e >= 3 && (this.recreateEngine(), this.handleDisconnect(this.options.stopLocalTrackOnUnpublish, Bn.STATE_MISMATCH))) : e = 0;
16432
16432
  }, t_);
16433
16433
  }
16434
16434
  clearConnectionReconcile() {
@@ -16489,7 +16489,7 @@ class rr extends ri.EventEmitter {
16489
16489
  const a = new sl(J.Kind.Video, new Ws({
16490
16490
  source: Ft.CAMERA,
16491
16491
  sid: Math.floor(Math.random() * 1e4).toString(),
16492
- type: Ln.AUDIO,
16492
+ type: Nn.AUDIO,
16493
16493
  name: "video-dummy"
16494
16494
  }), new no(s.useRealTracks ? (yield window.navigator.mediaDevices.getUserMedia({
16495
16495
  video: !0
@@ -16506,7 +16506,7 @@ class rr extends ri.EventEmitter {
16506
16506
  const a = new sl(J.Kind.Audio, new Ws({
16507
16507
  source: Ft.MICROPHONE,
16508
16508
  sid: Math.floor(Math.random() * 1e4).toString(),
16509
- type: Ln.AUDIO
16509
+ type: Nn.AUDIO
16510
16510
  }), new to(s.useRealTracks ? (yield navigator.mediaDevices.getUserMedia({
16511
16511
  audio: !0
16512
16512
  })).getAudioTracks()[0] : Fo(), void 0, !1, this.audioContext, {
@@ -16531,7 +16531,7 @@ class rr extends ri.EventEmitter {
16531
16531
  const l = ju(160 * ((n = r.aspectRatios[a % r.aspectRatios.length]) !== null && n !== void 0 ? n : 1), 160, !1, !0), d = new Ws({
16532
16532
  source: Ft.CAMERA,
16533
16533
  sid: Math.floor(Math.random() * 1e4).toString(),
16534
- type: Ln.AUDIO
16534
+ type: Nn.AUDIO
16535
16535
  });
16536
16536
  c.addSubscribedMediaTrack(l, d.sid, new MediaStream([l]), new RTCRtpReceiver()), o.tracks = [...o.tracks, d];
16537
16537
  }
@@ -16539,7 +16539,7 @@ class rr extends ri.EventEmitter {
16539
16539
  const l = Fo(), d = new Ws({
16540
16540
  source: Ft.MICROPHONE,
16541
16541
  sid: Math.floor(Math.random() * 1e4).toString(),
16542
- type: Ln.AUDIO
16542
+ type: Nn.AUDIO
16543
16543
  });
16544
16544
  c.addSubscribedMediaTrack(l, d.sid, new MediaStream([l]), new RTCRtpReceiver()), o.tracks = [...o.tracks, d];
16545
16545
  }
@@ -16570,26 +16570,26 @@ function tm(i) {
16570
16570
  return Array.isArray(e) ? tm(e) : typeof e == "object" ? "logContext" in e ? e.logContext : void 0 : e;
16571
16571
  });
16572
16572
  }
16573
- var Dn;
16573
+ var Ln;
16574
16574
  (function(i) {
16575
16575
  i[i.IDLE = 0] = "IDLE", i[i.RUNNING = 1] = "RUNNING", i[i.SKIPPED = 2] = "SKIPPED", i[i.SUCCESS = 3] = "SUCCESS", i[i.FAILED = 4] = "FAILED";
16576
- })(Dn || (Dn = {}));
16577
- class Zi extends ri.EventEmitter {
16576
+ })(Ln || (Ln = {}));
16577
+ class Zi extends ai.EventEmitter {
16578
16578
  constructor(e, t) {
16579
16579
  let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
16580
- super(), this.status = Dn.IDLE, this.logs = [], this.options = {}, this.url = e, this.token = t, this.name = this.constructor.name, this.room = new rr(n.roomOptions), this.connectOptions = n.connectOptions, this.options = n;
16580
+ super(), this.status = Ln.IDLE, this.logs = [], this.options = {}, this.url = e, this.token = t, this.name = this.constructor.name, this.room = new rr(n.roomOptions), this.connectOptions = n.connectOptions, this.options = n;
16581
16581
  }
16582
16582
  run(e) {
16583
16583
  return P(this, void 0, void 0, function* () {
16584
- if (this.status !== Dn.IDLE)
16584
+ if (this.status !== Ln.IDLE)
16585
16585
  throw Error("check is running already");
16586
- this.setStatus(Dn.RUNNING);
16586
+ this.setStatus(Ln.RUNNING);
16587
16587
  try {
16588
16588
  yield this.perform();
16589
16589
  } catch (t) {
16590
16590
  t instanceof Error && (this.options.errorsAsWarnings ? this.appendWarning(t.message) : this.appendError(t.message));
16591
16591
  }
16592
- return yield this.disconnect(), yield new Promise((t) => setTimeout(t, 500)), this.status !== Dn.SKIPPED && this.setStatus(this.isSuccess() ? Dn.SUCCESS : Dn.FAILED), e && e(), this.getInfo();
16592
+ return yield this.disconnect(), yield new Promise((t) => setTimeout(t, 500)), this.status !== Ln.SKIPPED && this.setStatus(this.isSuccess() ? Ln.SUCCESS : Ln.FAILED), e && e(), this.getInfo();
16593
16593
  });
16594
16594
  }
16595
16595
  isSuccess() {
@@ -16606,7 +16606,7 @@ class Zi extends ri.EventEmitter {
16606
16606
  });
16607
16607
  }
16608
16608
  skip() {
16609
- this.setStatus(Dn.SKIPPED);
16609
+ this.setStatus(Ln.SKIPPED);
16610
16610
  }
16611
16611
  switchProtocol(e) {
16612
16612
  return P(this, void 0, void 0, function* () {
@@ -16953,7 +16953,7 @@ class d_ extends Zi {
16953
16953
  });
16954
16954
  }
16955
16955
  }
16956
- class GE extends ri.EventEmitter {
16956
+ class GE extends ai.EventEmitter {
16957
16957
  constructor(e, t) {
16958
16958
  let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
16959
16959
  super(), this.options = {}, this.checkResults = /* @__PURE__ */ new Map(), this.url = e, this.token = t, this.options = n;
@@ -16962,7 +16962,7 @@ class GE extends ri.EventEmitter {
16962
16962
  const e = this.checkResults.size;
16963
16963
  return this.checkResults.set(e, {
16964
16964
  logs: [],
16965
- status: Dn.IDLE,
16965
+ status: Ln.IDLE,
16966
16966
  name: "",
16967
16967
  description: ""
16968
16968
  }), e;
@@ -16971,7 +16971,7 @@ class GE extends ri.EventEmitter {
16971
16971
  this.checkResults.set(e, t), this.emit("checkUpdate", e, t);
16972
16972
  }
16973
16973
  isSuccess() {
16974
- return Array.from(this.checkResults.values()).every((e) => e.status !== Dn.FAILED);
16974
+ return Array.from(this.checkResults.values()).every((e) => e.status !== Ln.FAILED);
16975
16975
  }
16976
16976
  getResults() {
16977
16977
  return Array.from(this.checkResults.values());
@@ -17259,13 +17259,24 @@ class wd extends EventTarget {
17259
17259
  }
17260
17260
  async makeCall({ agentId: e }) {
17261
17261
  if (this.room && this.room.state === "connected") return;
17262
- let t = null;
17263
- try {
17264
- t = await navigator.mediaDevices.getUserMedia({ audio: !0, video: !1 }), console.log("Microphone permission granted");
17265
- } catch (n) {
17266
- console.warn("Microphone permission denied or not available:", n);
17267
- }
17268
- this.updateStatus("connecting"), this.error = null, this.isReady = !1, this.room && (await this.room.disconnect(), this.room = null);
17262
+ if (this.updateStatus("connecting"), this.isAppleDevice)
17263
+ try {
17264
+ const n = new Audio(
17265
+ "data:audio/wav;base64,UklGRiQAAABXQVZFZm10IBAAAAABAAEARKwAAIhYAQACABAAZGF0YQAAAAA="
17266
+ );
17267
+ n.volume = 1e-3, n.play().then(() => {
17268
+ n.pause(), n.remove(), console.log("[LiveKit] iOS audio playback unlocked");
17269
+ }).catch(() => {
17270
+ n.remove();
17271
+ });
17272
+ } catch (n) {
17273
+ console.warn("[LiveKit] Failed to unlock iOS audio:", n);
17274
+ }
17275
+ const t = navigator.mediaDevices.getUserMedia({
17276
+ audio: !0,
17277
+ video: !1
17278
+ }).then((n) => (console.log("Microphone permission granted"), n)).catch((n) => (console.warn("Microphone permission denied or not available:", n), null));
17279
+ this.error = null, this.isReady = !1, this.room && (await this.room.disconnect(), this.room = null);
17269
17280
  try {
17270
17281
  const n = new rr({
17271
17282
  webAudioMix: !0
@@ -17299,20 +17310,34 @@ class wd extends EventTarget {
17299
17310
  );
17300
17311
  }
17301
17312
  const { token: r, url: a, room_name: o, user_identity: c } = await s.json();
17302
- this.roomName = o, this.userIdentity = c, this.reconnectAttempts = 0, this.wasConnectedBeforeHidden = !1, await this.connectWithTimeout(n, a, r, 2e4), this.updateStatus("connected"), this.isReady = !0, requestAnimationFrame(() => {
17313
+ this.roomName = o, this.userIdentity = c, this.reconnectAttempts = 0, this.wasConnectedBeforeHidden = !1, await this.connectWithTimeout(n, a, r, 2e4);
17314
+ try {
17315
+ await Promise.race([
17316
+ n.startAudio(),
17317
+ new Promise((l) => setTimeout(l, 3e3))
17318
+ ]), console.log("[LiveKit] Audio playback started");
17319
+ } catch (l) {
17320
+ console.warn("[LiveKit] Failed to start audio:", l);
17321
+ }
17322
+ this.updateStatus("connected"), this.isReady = !0, requestAnimationFrame(() => {
17303
17323
  this.scheduleTimer(async () => {
17304
17324
  if (this.isDestroyed || !this.room || this.room.state !== "connected") {
17305
- t && t.getTracks().forEach((l) => l.stop());
17325
+ t.then((d) => {
17326
+ d && d.getTracks().forEach((u) => u.stop());
17327
+ });
17306
17328
  return;
17307
17329
  }
17308
- if (t)
17330
+ const l = await Promise.race([
17331
+ t,
17332
+ new Promise((d) => setTimeout(() => d(null), 5e3))
17333
+ ]);
17334
+ if (l)
17309
17335
  try {
17310
- const l = !this.isAppleDevice;
17311
17336
  await n.localParticipant.setMicrophoneEnabled(!0, {
17312
- echoCancellation: l,
17313
- noiseSuppression: l,
17314
- autoGainControl: l
17315
- }), this.microphoneEnabled = !0, this.dispatchEvent(new CustomEvent("microphone-enabled")), t.getTracks().forEach((d) => d.stop()), this.scheduleTimer(() => {
17337
+ echoCancellation: !0,
17338
+ noiseSuppression: !0,
17339
+ autoGainControl: !this.isAppleDevice
17340
+ }), this.microphoneEnabled = !0, this.dispatchEvent(new CustomEvent("microphone-enabled")), l.getTracks().forEach((d) => d.stop()), this.scheduleTimer(() => {
17316
17341
  if (!(this.isDestroyed || !this.room || this.room.state !== "connected"))
17317
17342
  try {
17318
17343
  const d = Array.from(n.localParticipant.audioTrackPublications.values()).find((u) => u.kind === "audio");
@@ -17328,8 +17353,8 @@ class wd extends EventTarget {
17328
17353
  console.warn("[LiveKit] Error getting local audio track:", d);
17329
17354
  }
17330
17355
  }, 100);
17331
- } catch (l) {
17332
- console.warn("Could not enable microphone on connect:", l), this.microphoneEnabled = !1, this.dispatchEvent(new CustomEvent("microphone-disabled"));
17356
+ } catch (d) {
17357
+ console.warn("Could not enable microphone on connect:", d), this.microphoneEnabled = !1, this.dispatchEvent(new CustomEvent("microphone-disabled"));
17333
17358
  }
17334
17359
  else
17335
17360
  this.microphoneEnabled = !1, this.dispatchEvent(new CustomEvent("microphone-disabled"));
@@ -17340,7 +17365,9 @@ class wd extends EventTarget {
17340
17365
  })
17341
17366
  );
17342
17367
  } catch (n) {
17343
- t && t.getTracks().forEach((s) => s.stop()), this.error = `Connection failed: ${n instanceof Error ? n.message : String(n)}`, this.updateStatus("error"), this.isReady = !1, this.room = null, this.dispatchEvent(
17368
+ t.then((s) => {
17369
+ s && s.getTracks().forEach((r) => r.stop());
17370
+ }), this.error = `Connection failed: ${n instanceof Error ? n.message : String(n)}`, this.updateStatus("error"), this.isReady = !1, this.room = null, this.dispatchEvent(
17344
17371
  new CustomEvent("error", {
17345
17372
  detail: { error: this.error }
17346
17373
  })
@@ -17464,16 +17491,11 @@ class wd extends EventTarget {
17464
17491
  async toggleMicrophone() {
17465
17492
  if (this.room)
17466
17493
  try {
17467
- if (this.microphoneEnabled)
17468
- await this.room.localParticipant.setMicrophoneEnabled(!1), this.microphoneEnabled = !1, this.dispatchEvent(new CustomEvent("microphone-disabled"));
17469
- else {
17470
- const e = !this.isAppleDevice;
17471
- await this.room.localParticipant.setMicrophoneEnabled(!0, {
17472
- echoCancellation: e,
17473
- noiseSuppression: e,
17474
- autoGainControl: e
17475
- }), this.microphoneEnabled = !0, this.dispatchEvent(new CustomEvent("microphone-enabled"));
17476
- }
17494
+ this.microphoneEnabled ? (await this.room.localParticipant.setMicrophoneEnabled(!1), this.microphoneEnabled = !1, this.dispatchEvent(new CustomEvent("microphone-disabled"))) : (await this.room.localParticipant.setMicrophoneEnabled(!0, {
17495
+ echoCancellation: !0,
17496
+ noiseSuppression: !0,
17497
+ autoGainControl: !this.isAppleDevice
17498
+ }), this.microphoneEnabled = !0, this.dispatchEvent(new CustomEvent("microphone-enabled")));
17477
17499
  } catch (e) {
17478
17500
  this.error = `Failed to toggle microphone: ${e instanceof Error ? e.message : String(e)}`, this.dispatchEvent(
17479
17501
  new CustomEvent("error", {
@@ -17590,7 +17612,7 @@ class Ad {
17590
17612
  * Copyright 2010-2025 Three.js Authors
17591
17613
  * SPDX-License-Identifier: MIT
17592
17614
  */
17593
- const Rd = "182", h_ = 0, hh = 1, f_ = 2, za = 1, p_ = 2, Pr = 3, Ei = 0, nn = 1, yi = 2, xi = 0, Qs = 1, rl = 2, fh = 3, ph = 4, m_ = 5, us = 100, g_ = 101, v_ = 102, b_ = 103, __ = 104, y_ = 200, S_ = 201, x_ = 202, T_ = 203, al = 204, ol = 205, C_ = 206, E_ = 207, M_ = 208, w_ = 209, A_ = 210, R_ = 211, P_ = 212, k_ = 213, I_ = 214, cl = 0, ll = 1, dl = 2, ar = 3, ul = 4, hl = 5, fl = 6, pl = 7, nm = 0, D_ = 1, L_ = 2, Qn = 0, im = 1, sm = 2, rm = 3, am = 4, om = 5, cm = 6, lm = 7, dm = 300, Ts = 301, or = 302, ml = 303, gl = 304, go = 306, vl = 1e3, Si = 1001, bl = 1002, Yt = 1003, N_ = 1004, aa = 1005, Qt = 1006, $o = 1007, ps = 1008, Mn = 1009, um = 1010, hm = 1011, jr = 1012, Pd = 1013, si = 1014, Yn = 1015, Mi = 1016, kd = 1017, Id = 1018, Xr = 1020, fm = 35902, pm = 35899, mm = 1021, gm = 1022, Bn = 1023, wi = 1026, ms = 1027, vm = 1028, Dd = 1029, cr = 1030, Ld = 1031, Nd = 1033, Ga = 33776, Ha = 33777, Wa = 33778, qa = 33779, _l = 35840, yl = 35841, Sl = 35842, xl = 35843, Tl = 36196, Cl = 37492, El = 37496, Ml = 37488, wl = 37489, Al = 37490, Rl = 37491, Pl = 37808, kl = 37809, Il = 37810, Dl = 37811, Ll = 37812, Nl = 37813, Ul = 37814, Ol = 37815, Fl = 37816, Bl = 37817, Vl = 37818, zl = 37819, Gl = 37820, Hl = 37821, Wl = 36492, ql = 36494, jl = 36495, Xl = 36283, $l = 36284, Kl = 36285, Yl = 36286, U_ = 3200, O_ = 0, F_ = 1, Wi = "", Cn = "srgb", lr = "srgb-linear", so = "linear", lt = "srgb", Rs = 7680, mh = 519, B_ = 512, V_ = 513, z_ = 514, Ud = 515, G_ = 516, H_ = 517, Od = 518, W_ = 519, gh = 35044, vh = "300 es", Jn = 2e3, ro = 2001;
17615
+ const Rd = "182", h_ = 0, hh = 1, f_ = 2, za = 1, p_ = 2, Pr = 3, Mi = 0, nn = 1, Si = 2, Ti = 0, Qs = 1, rl = 2, fh = 3, ph = 4, m_ = 5, us = 100, g_ = 101, v_ = 102, b_ = 103, __ = 104, y_ = 200, S_ = 201, x_ = 202, T_ = 203, al = 204, ol = 205, C_ = 206, E_ = 207, M_ = 208, w_ = 209, A_ = 210, R_ = 211, P_ = 212, k_ = 213, I_ = 214, cl = 0, ll = 1, dl = 2, ar = 3, ul = 4, hl = 5, fl = 6, pl = 7, nm = 0, D_ = 1, L_ = 2, ei = 0, im = 1, sm = 2, rm = 3, am = 4, om = 5, cm = 6, lm = 7, dm = 300, Ts = 301, or = 302, ml = 303, gl = 304, go = 306, vl = 1e3, xi = 1001, bl = 1002, Yt = 1003, N_ = 1004, aa = 1005, Qt = 1006, $o = 1007, ps = 1008, Mn = 1009, um = 1010, hm = 1011, jr = 1012, Pd = 1013, ri = 1014, Jn = 1015, wi = 1016, kd = 1017, Id = 1018, Xr = 1020, fm = 35902, pm = 35899, mm = 1021, gm = 1022, Vn = 1023, Ai = 1026, ms = 1027, vm = 1028, Dd = 1029, cr = 1030, Ld = 1031, Nd = 1033, Ga = 33776, Ha = 33777, Wa = 33778, qa = 33779, _l = 35840, yl = 35841, Sl = 35842, xl = 35843, Tl = 36196, Cl = 37492, El = 37496, Ml = 37488, wl = 37489, Al = 37490, Rl = 37491, Pl = 37808, kl = 37809, Il = 37810, Dl = 37811, Ll = 37812, Nl = 37813, Ul = 37814, Ol = 37815, Fl = 37816, Bl = 37817, Vl = 37818, zl = 37819, Gl = 37820, Hl = 37821, Wl = 36492, ql = 36494, jl = 36495, Xl = 36283, $l = 36284, Kl = 36285, Yl = 36286, U_ = 3200, O_ = 0, F_ = 1, Wi = "", Cn = "srgb", lr = "srgb-linear", so = "linear", ht = "srgb", Rs = 7680, mh = 519, B_ = 512, V_ = 513, z_ = 514, Ud = 515, G_ = 516, H_ = 517, Od = 518, W_ = 519, gh = 35044, vh = "300 es", Zn = 2e3, ro = 2001;
17594
17616
  function bm(i) {
17595
17617
  for (let e = i.length - 1; e >= 0; --e)
17596
17618
  if (i[e] >= 65535) return !0;
@@ -19907,7 +19929,7 @@ function $_() {
19907
19929
  */
19908
19930
  spaces: {},
19909
19931
  convert: function(s, r, a) {
19910
- return this.enabled === !1 || r === a || !r || !a || (this.spaces[r].transfer === lt && (s.r = Ti(s.r), s.g = Ti(s.g), s.b = Ti(s.b)), this.spaces[r].primaries !== this.spaces[a].primaries && (s.applyMatrix3(this.spaces[r].toXYZ), s.applyMatrix3(this.spaces[a].fromXYZ)), this.spaces[a].transfer === lt && (s.r = er(s.r), s.g = er(s.g), s.b = er(s.b))), s;
19932
+ return this.enabled === !1 || r === a || !r || !a || (this.spaces[r].transfer === ht && (s.r = Ci(s.r), s.g = Ci(s.g), s.b = Ci(s.b)), this.spaces[r].primaries !== this.spaces[a].primaries && (s.applyMatrix3(this.spaces[r].toXYZ), s.applyMatrix3(this.spaces[a].fromXYZ)), this.spaces[a].transfer === ht && (s.r = er(s.r), s.g = er(s.g), s.b = er(s.b))), s;
19911
19933
  },
19912
19934
  workingToColorSpace: function(s, r) {
19913
19935
  return this.convert(s, this.workingColorSpace, r);
@@ -19962,7 +19984,7 @@ function $_() {
19962
19984
  [Cn]: {
19963
19985
  primaries: e,
19964
19986
  whitePoint: n,
19965
- transfer: lt,
19987
+ transfer: ht,
19966
19988
  toXYZ: Sh,
19967
19989
  fromXYZ: xh,
19968
19990
  luminanceCoefficients: t,
@@ -19971,7 +19993,7 @@ function $_() {
19971
19993
  }), i;
19972
19994
  }
19973
19995
  const Qe = /* @__PURE__ */ $_();
19974
- function Ti(i) {
19996
+ function Ci(i) {
19975
19997
  return i < 0.04045 ? i * 0.0773993808 : Math.pow(i * 0.9478672986 + 0.0521327014, 2.4);
19976
19998
  }
19977
19999
  function er(i) {
@@ -20013,12 +20035,12 @@ class K_ {
20013
20035
  n.drawImage(e, 0, 0, e.width, e.height);
20014
20036
  const s = n.getImageData(0, 0, e.width, e.height), r = s.data;
20015
20037
  for (let a = 0; a < r.length; a++)
20016
- r[a] = Ti(r[a] / 255) * 255;
20038
+ r[a] = Ci(r[a] / 255) * 255;
20017
20039
  return n.putImageData(s, 0, 0), t;
20018
20040
  } else if (e.data) {
20019
20041
  const t = e.data.slice(0);
20020
20042
  for (let n = 0; n < t.length; n++)
20021
- t instanceof Uint8Array || t instanceof Uint8ClampedArray ? t[n] = Math.floor(Ti(t[n] / 255) * 255) : t[n] = Ti(t[n]);
20043
+ t instanceof Uint8Array || t instanceof Uint8ClampedArray ? t[n] = Math.floor(Ci(t[n] / 255) * 255) : t[n] = Ci(t[n]);
20022
20044
  return {
20023
20045
  data: t,
20024
20046
  width: e.width,
@@ -20113,7 +20135,7 @@ class sn extends ur {
20113
20135
  * @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value.
20114
20136
  * @param {string} [colorSpace=NoColorSpace] - The color space.
20115
20137
  */
20116
- constructor(e = sn.DEFAULT_IMAGE, t = sn.DEFAULT_MAPPING, n = Si, s = Si, r = Qt, a = ps, o = Bn, c = Mn, l = sn.DEFAULT_ANISOTROPY, d = Wi) {
20138
+ constructor(e = sn.DEFAULT_IMAGE, t = sn.DEFAULT_MAPPING, n = xi, s = xi, r = Qt, a = ps, o = Vn, c = Mn, l = sn.DEFAULT_ANISOTROPY, d = Wi) {
20117
20139
  super(), this.isTexture = !0, Object.defineProperty(this, "id", { value: J_++ }), this.uuid = Zr(), this.name = "", this.source = new Fd(e), this.mipmaps = [], this.mapping = t, this.channel = 0, this.wrapS = n, this.wrapT = s, this.magFilter = r, this.minFilter = a, this.anisotropy = l, this.format = o, this.internalFormat = null, this.type = c, this.offset = new st(0, 0), this.repeat = new st(1, 1), this.center = new st(0, 0), this.rotation = 0, this.matrixAutoUpdate = !0, this.matrix = new ze(), this.generateMipmaps = !0, this.premultiplyAlpha = !1, this.flipY = !0, this.unpackAlignment = 4, this.colorSpace = d, this.userData = {}, this.updateRanges = [], this.version = 0, this.onUpdate = null, this.renderTarget = null, this.isRenderTargetTexture = !1, this.isArrayTexture = !!(e && e.depth && e.depth > 1), this.pmremVersion = 0;
20118
20140
  }
20119
20141
  /**
@@ -20266,7 +20288,7 @@ class sn extends ur {
20266
20288
  case vl:
20267
20289
  e.x = e.x - Math.floor(e.x);
20268
20290
  break;
20269
- case Si:
20291
+ case xi:
20270
20292
  e.x = e.x < 0 ? 0 : 1;
20271
20293
  break;
20272
20294
  case bl:
@@ -20278,7 +20300,7 @@ class sn extends ur {
20278
20300
  case vl:
20279
20301
  e.y = e.y - Math.floor(e.y);
20280
20302
  break;
20281
- case Si:
20303
+ case xi:
20282
20304
  e.y = e.y < 0 ? 0 : 1;
20283
20305
  break;
20284
20306
  case bl:
@@ -21000,7 +21022,7 @@ class Z_ extends ur {
21000
21022
  this.dispatchEvent({ type: "dispose" });
21001
21023
  }
21002
21024
  }
21003
- class ei extends Z_ {
21025
+ class ti extends Z_ {
21004
21026
  /**
21005
21027
  * Constructs a new 3D render target.
21006
21028
  *
@@ -21022,7 +21044,7 @@ class _m extends sn {
21022
21044
  * @param {number} [depth=1] - The depth of the texture.
21023
21045
  */
21024
21046
  constructor(e = null, t = 1, n = 1, s = 1) {
21025
- super(null), this.isDataArrayTexture = !0, this.image = { data: e, width: t, height: n, depth: s }, this.magFilter = Yt, this.minFilter = Yt, this.wrapR = Si, this.generateMipmaps = !1, this.flipY = !1, this.unpackAlignment = 1, this.layerUpdates = /* @__PURE__ */ new Set();
21047
+ super(null), this.isDataArrayTexture = !0, this.image = { data: e, width: t, height: n, depth: s }, this.magFilter = Yt, this.minFilter = Yt, this.wrapR = xi, this.generateMipmaps = !1, this.flipY = !1, this.unpackAlignment = 1, this.layerUpdates = /* @__PURE__ */ new Set();
21026
21048
  }
21027
21049
  /**
21028
21050
  * Describes that a specific layer of the texture needs to be updated.
@@ -21053,7 +21075,7 @@ class Q_ extends sn {
21053
21075
  * @param {number} [depth=1] - The depth of the texture.
21054
21076
  */
21055
21077
  constructor(e = null, t = 1, n = 1, s = 1) {
21056
- super(null), this.isData3DTexture = !0, this.image = { data: e, width: t, height: n, depth: s }, this.magFilter = Yt, this.minFilter = Yt, this.wrapR = Si, this.generateMipmaps = !1, this.flipY = !1, this.unpackAlignment = 1;
21078
+ super(null), this.isData3DTexture = !0, this.image = { data: e, width: t, height: n, depth: s }, this.magFilter = Yt, this.minFilter = Yt, this.wrapR = xi, this.generateMipmaps = !1, this.flipY = !1, this.unpackAlignment = 1;
21057
21079
  }
21058
21080
  }
21059
21081
  class ea {
@@ -21087,7 +21109,7 @@ class ea {
21087
21109
  setFromArray(e) {
21088
21110
  this.makeEmpty();
21089
21111
  for (let t = 0, n = e.length; t < n; t += 3)
21090
- this.expandByPoint(Rn.fromArray(e, t));
21112
+ this.expandByPoint(Pn.fromArray(e, t));
21091
21113
  return this;
21092
21114
  }
21093
21115
  /**
@@ -21100,7 +21122,7 @@ class ea {
21100
21122
  setFromBufferAttribute(e) {
21101
21123
  this.makeEmpty();
21102
21124
  for (let t = 0, n = e.count; t < n; t++)
21103
- this.expandByPoint(Rn.fromBufferAttribute(e, t));
21125
+ this.expandByPoint(Pn.fromBufferAttribute(e, t));
21104
21126
  return this;
21105
21127
  }
21106
21128
  /**
@@ -21125,7 +21147,7 @@ class ea {
21125
21147
  * @return {Box3} A reference to this bounding box.
21126
21148
  */
21127
21149
  setFromCenterAndSize(e, t) {
21128
- const n = Rn.copy(t).multiplyScalar(0.5);
21150
+ const n = Pn.copy(t).multiplyScalar(0.5);
21129
21151
  return this.min.copy(e).sub(n), this.max.copy(e).add(n), this;
21130
21152
  }
21131
21153
  /**
@@ -21244,7 +21266,7 @@ class ea {
21244
21266
  const r = n.getAttribute("position");
21245
21267
  if (t === !0 && r !== void 0 && e.isInstancedMesh !== !0)
21246
21268
  for (let a = 0, o = r.count; a < o; a++)
21247
- e.isMesh === !0 ? e.getVertexPosition(a, Rn) : Rn.fromBufferAttribute(r, a), Rn.applyMatrix4(e.matrixWorld), this.expandByPoint(Rn);
21269
+ e.isMesh === !0 ? e.getVertexPosition(a, Pn) : Pn.fromBufferAttribute(r, a), Pn.applyMatrix4(e.matrixWorld), this.expandByPoint(Pn);
21248
21270
  else
21249
21271
  e.boundingBox !== void 0 ? (e.boundingBox === null && e.computeBoundingBox(), oa.copy(e.boundingBox)) : (n.boundingBox === null && n.computeBoundingBox(), oa.copy(n.boundingBox)), oa.applyMatrix4(e.matrixWorld), this.union(oa);
21250
21272
  }
@@ -21302,7 +21324,7 @@ class ea {
21302
21324
  * @return {boolean} Whether the given bounding sphere intersects with this bounding box.
21303
21325
  */
21304
21326
  intersectsSphere(e) {
21305
- return this.clampPoint(e.center, Rn), Rn.distanceToSquared(e.center) <= e.radius * e.radius;
21327
+ return this.clampPoint(e.center, Pn), Pn.distanceToSquared(e.center) <= e.radius * e.radius;
21306
21328
  }
21307
21329
  /**
21308
21330
  * Returns `true` if the given plane intersects with this bounding box.
@@ -21373,7 +21395,7 @@ class ea {
21373
21395
  * @return {number} The euclidean distance.
21374
21396
  */
21375
21397
  distanceToPoint(e) {
21376
- return this.clampPoint(e, Rn).distanceTo(e);
21398
+ return this.clampPoint(e, Pn).distanceTo(e);
21377
21399
  }
21378
21400
  /**
21379
21401
  * Returns a bounding sphere that encloses this bounding box.
@@ -21382,7 +21404,7 @@ class ea {
21382
21404
  * @return {Sphere} The bounding sphere that encloses this bounding box.
21383
21405
  */
21384
21406
  getBoundingSphere(e) {
21385
- return this.isEmpty() ? e.makeEmpty() : (this.getCenter(e.center), e.radius = this.getSize(Rn).length() * 0.5), e;
21407
+ return this.isEmpty() ? e.makeEmpty() : (this.getCenter(e.center), e.radius = this.getSize(Pn).length() * 0.5), e;
21386
21408
  }
21387
21409
  /**
21388
21410
  * Computes the intersection of this bounding box and the given one, setting the upper
@@ -21414,7 +21436,7 @@ class ea {
21414
21436
  * @return {Box3} A reference to this bounding box.
21415
21437
  */
21416
21438
  applyMatrix4(e) {
21417
- return this.isEmpty() ? this : (oi[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(e), oi[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(e), oi[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(e), oi[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(e), oi[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(e), oi[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(e), oi[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(e), oi[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(e), this.setFromPoints(oi), this);
21439
+ return this.isEmpty() ? this : (ci[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(e), ci[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(e), ci[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(e), ci[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(e), ci[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(e), ci[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(e), ci[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(e), ci[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(e), this.setFromPoints(ci), this);
21418
21440
  }
21419
21441
  /**
21420
21442
  * Adds the given offset to both the upper and lower bounds of this bounding box,
@@ -21456,7 +21478,7 @@ class ea {
21456
21478
  return this.min.fromArray(e.min), this.max.fromArray(e.max), this;
21457
21479
  }
21458
21480
  }
21459
- const oi = [
21481
+ const ci = [
21460
21482
  /* @__PURE__ */ new B(),
21461
21483
  /* @__PURE__ */ new B(),
21462
21484
  /* @__PURE__ */ new B(),
@@ -21465,7 +21487,7 @@ const oi = [
21465
21487
  /* @__PURE__ */ new B(),
21466
21488
  /* @__PURE__ */ new B(),
21467
21489
  /* @__PURE__ */ new B()
21468
- ], Rn = /* @__PURE__ */ new B(), oa = /* @__PURE__ */ new ea(), ks = /* @__PURE__ */ new B(), Is = /* @__PURE__ */ new B(), Ds = /* @__PURE__ */ new B(), Li = /* @__PURE__ */ new B(), Ni = /* @__PURE__ */ new B(), ns = /* @__PURE__ */ new B(), xr = /* @__PURE__ */ new B(), ca = /* @__PURE__ */ new B(), la = /* @__PURE__ */ new B(), is = /* @__PURE__ */ new B();
21490
+ ], Pn = /* @__PURE__ */ new B(), oa = /* @__PURE__ */ new ea(), ks = /* @__PURE__ */ new B(), Is = /* @__PURE__ */ new B(), Ds = /* @__PURE__ */ new B(), Li = /* @__PURE__ */ new B(), Ni = /* @__PURE__ */ new B(), ns = /* @__PURE__ */ new B(), xr = /* @__PURE__ */ new B(), ca = /* @__PURE__ */ new B(), la = /* @__PURE__ */ new B(), is = /* @__PURE__ */ new B();
21469
21491
  function tc(i, e, t, n, s) {
21470
21492
  for (let r = 0, a = i.length - 3; r <= a; r += 3) {
21471
21493
  is.fromArray(i, r);
@@ -21695,7 +21717,7 @@ class Bd {
21695
21717
  return this.radius = e.radius, this.center.fromArray(e.center), this;
21696
21718
  }
21697
21719
  }
21698
- const ci = /* @__PURE__ */ new B(), ic = /* @__PURE__ */ new B(), da = /* @__PURE__ */ new B(), Ui = /* @__PURE__ */ new B(), sc = /* @__PURE__ */ new B(), ua = /* @__PURE__ */ new B(), rc = /* @__PURE__ */ new B();
21720
+ const li = /* @__PURE__ */ new B(), ic = /* @__PURE__ */ new B(), da = /* @__PURE__ */ new B(), Ui = /* @__PURE__ */ new B(), sc = /* @__PURE__ */ new B(), ua = /* @__PURE__ */ new B(), rc = /* @__PURE__ */ new B();
21699
21721
  class ty {
21700
21722
  /**
21701
21723
  * Constructs a new ray.
@@ -21751,7 +21773,7 @@ class ty {
21751
21773
  * @return {Ray} A reference to this ray.
21752
21774
  */
21753
21775
  recast(e) {
21754
- return this.origin.copy(this.at(e, ci)), this;
21776
+ return this.origin.copy(this.at(e, li)), this;
21755
21777
  }
21756
21778
  /**
21757
21779
  * Returns the point along this ray that is closest to the given point.
@@ -21781,8 +21803,8 @@ class ty {
21781
21803
  * @return {number} The squared distance.
21782
21804
  */
21783
21805
  distanceSqToPoint(e) {
21784
- const t = ci.subVectors(e, this.origin).dot(this.direction);
21785
- return t < 0 ? this.origin.distanceToSquared(e) : (ci.copy(this.origin).addScaledVector(this.direction, t), ci.distanceToSquared(e));
21806
+ const t = li.subVectors(e, this.origin).dot(this.direction);
21807
+ return t < 0 ? this.origin.distanceToSquared(e) : (li.copy(this.origin).addScaledVector(this.direction, t), li.distanceToSquared(e));
21786
21808
  }
21787
21809
  /**
21788
21810
  * Returns the squared distance between this ray and the given line segment.
@@ -21822,8 +21844,8 @@ class ty {
21822
21844
  * @return {?Vector3} The intersection point.
21823
21845
  */
21824
21846
  intersectSphere(e, t) {
21825
- ci.subVectors(e.center, this.origin);
21826
- const n = ci.dot(this.direction), s = ci.dot(ci) - n * n, r = e.radius * e.radius;
21847
+ li.subVectors(e.center, this.origin);
21848
+ const n = li.dot(this.direction), s = li.dot(li) - n * n, r = e.radius * e.radius;
21827
21849
  if (s > r) return null;
21828
21850
  const a = Math.sqrt(r - s), o = n - a, c = n + a;
21829
21851
  return c < 0 ? null : o < 0 ? this.at(c, t) : this.at(o, t);
@@ -21893,7 +21915,7 @@ class ty {
21893
21915
  * @return {boolean} Whether this ray intersects with the given box or not.
21894
21916
  */
21895
21917
  intersectsBox(e) {
21896
- return this.intersectBox(e, ci) !== null;
21918
+ return this.intersectBox(e, li) !== null;
21897
21919
  }
21898
21920
  /**
21899
21921
  * Intersects this ray with the given triangle, returning the intersection
@@ -22572,9 +22594,9 @@ class Vt {
22572
22594
  return n.set(1, 1, 1), t.identity(), this;
22573
22595
  let r = Ls.set(s[0], s[1], s[2]).length();
22574
22596
  const a = Ls.set(s[4], s[5], s[6]).length(), o = Ls.set(s[8], s[9], s[10]).length();
22575
- this.determinant() < 0 && (r = -r), Pn.copy(this);
22597
+ this.determinant() < 0 && (r = -r), kn.copy(this);
22576
22598
  const l = 1 / r, d = 1 / a, u = 1 / o;
22577
- return Pn.elements[0] *= l, Pn.elements[1] *= l, Pn.elements[2] *= l, Pn.elements[4] *= d, Pn.elements[5] *= d, Pn.elements[6] *= d, Pn.elements[8] *= u, Pn.elements[9] *= u, Pn.elements[10] *= u, t.setFromRotationMatrix(Pn), n.x = r, n.y = a, n.z = o, this;
22599
+ return kn.elements[0] *= l, kn.elements[1] *= l, kn.elements[2] *= l, kn.elements[4] *= d, kn.elements[5] *= d, kn.elements[6] *= d, kn.elements[8] *= u, kn.elements[9] *= u, kn.elements[10] *= u, t.setFromRotationMatrix(kn), n.x = r, n.y = a, n.z = o, this;
22578
22600
  }
22579
22601
  /**
22580
22602
  * Creates a perspective projection matrix. This is used internally by
@@ -22590,12 +22612,12 @@ class Vt {
22590
22612
  * @param {boolean} [reversedDepth=false] - Whether to use a reversed depth.
22591
22613
  * @return {Matrix4} A reference to this matrix.
22592
22614
  */
22593
- makePerspective(e, t, n, s, r, a, o = Jn, c = !1) {
22615
+ makePerspective(e, t, n, s, r, a, o = Zn, c = !1) {
22594
22616
  const l = this.elements, d = 2 * r / (t - e), u = 2 * r / (n - s), h = (t + e) / (t - e), f = (n + s) / (n - s);
22595
22617
  let g, v;
22596
22618
  if (c)
22597
22619
  g = r / (a - r), v = a * r / (a - r);
22598
- else if (o === Jn)
22620
+ else if (o === Zn)
22599
22621
  g = -(a + r) / (a - r), v = -2 * a * r / (a - r);
22600
22622
  else if (o === ro)
22601
22623
  g = -a / (a - r), v = -a * r / (a - r);
@@ -22617,12 +22639,12 @@ class Vt {
22617
22639
  * @param {boolean} [reversedDepth=false] - Whether to use a reversed depth.
22618
22640
  * @return {Matrix4} A reference to this matrix.
22619
22641
  */
22620
- makeOrthographic(e, t, n, s, r, a, o = Jn, c = !1) {
22642
+ makeOrthographic(e, t, n, s, r, a, o = Zn, c = !1) {
22621
22643
  const l = this.elements, d = 2 / (t - e), u = 2 / (n - s), h = -(t + e) / (t - e), f = -(n + s) / (n - s);
22622
22644
  let g, v;
22623
22645
  if (c)
22624
22646
  g = 1 / (a - r), v = a / (a - r);
22625
- else if (o === Jn)
22647
+ else if (o === Zn)
22626
22648
  g = -2 / (a - r), v = -(a + r) / (a - r);
22627
22649
  else if (o === ro)
22628
22650
  g = -1 / (a - r), v = -r / (a - r);
@@ -22667,8 +22689,8 @@ class Vt {
22667
22689
  return e[t] = n[0], e[t + 1] = n[1], e[t + 2] = n[2], e[t + 3] = n[3], e[t + 4] = n[4], e[t + 5] = n[5], e[t + 6] = n[6], e[t + 7] = n[7], e[t + 8] = n[8], e[t + 9] = n[9], e[t + 10] = n[10], e[t + 11] = n[11], e[t + 12] = n[12], e[t + 13] = n[13], e[t + 14] = n[14], e[t + 15] = n[15], e;
22668
22690
  }
22669
22691
  }
22670
- const Ls = /* @__PURE__ */ new B(), Pn = /* @__PURE__ */ new Vt(), ny = /* @__PURE__ */ new B(0, 0, 0), iy = /* @__PURE__ */ new B(1, 1, 1), Oi = /* @__PURE__ */ new B(), ha = /* @__PURE__ */ new B(), gn = /* @__PURE__ */ new B(), Th = /* @__PURE__ */ new Vt(), Ch = /* @__PURE__ */ new Qr();
22671
- class Ai {
22692
+ const Ls = /* @__PURE__ */ new B(), kn = /* @__PURE__ */ new Vt(), ny = /* @__PURE__ */ new B(0, 0, 0), iy = /* @__PURE__ */ new B(1, 1, 1), Oi = /* @__PURE__ */ new B(), ha = /* @__PURE__ */ new B(), gn = /* @__PURE__ */ new B(), Th = /* @__PURE__ */ new Vt(), Ch = /* @__PURE__ */ new Qr();
22693
+ class Ri {
22672
22694
  /**
22673
22695
  * Constructs a new euler instance.
22674
22696
  *
@@ -22677,7 +22699,7 @@ class Ai {
22677
22699
  * @param {number} [z=0] - The angle of the z axis in radians.
22678
22700
  * @param {string} [order=Euler.DEFAULT_ORDER] - A string representing the order that the rotations are applied.
22679
22701
  */
22680
- constructor(e = 0, t = 0, n = 0, s = Ai.DEFAULT_ORDER) {
22702
+ constructor(e = 0, t = 0, n = 0, s = Ri.DEFAULT_ORDER) {
22681
22703
  this.isEuler = !0, this._x = e, this._y = t, this._z = n, this._order = s;
22682
22704
  }
22683
22705
  /**
@@ -22865,7 +22887,7 @@ class Ai {
22865
22887
  yield this._x, yield this._y, yield this._z, yield this._order;
22866
22888
  }
22867
22889
  }
22868
- Ai.DEFAULT_ORDER = "XYZ";
22890
+ Ri.DEFAULT_ORDER = "XYZ";
22869
22891
  class ym {
22870
22892
  /**
22871
22893
  * Constructs a new layers instance, with membership
@@ -22939,14 +22961,14 @@ class ym {
22939
22961
  }
22940
22962
  }
22941
22963
  let sy = 0;
22942
- const Eh = /* @__PURE__ */ new B(), Ns = /* @__PURE__ */ new Qr(), li = /* @__PURE__ */ new Vt(), fa = /* @__PURE__ */ new B(), Cr = /* @__PURE__ */ new B(), ry = /* @__PURE__ */ new B(), ay = /* @__PURE__ */ new Qr(), Mh = /* @__PURE__ */ new B(1, 0, 0), wh = /* @__PURE__ */ new B(0, 1, 0), Ah = /* @__PURE__ */ new B(0, 0, 1), Rh = { type: "added" }, oy = { type: "removed" }, Us = { type: "childadded", child: null }, ac = { type: "childremoved", child: null };
22964
+ const Eh = /* @__PURE__ */ new B(), Ns = /* @__PURE__ */ new Qr(), di = /* @__PURE__ */ new Vt(), fa = /* @__PURE__ */ new B(), Cr = /* @__PURE__ */ new B(), ry = /* @__PURE__ */ new B(), ay = /* @__PURE__ */ new Qr(), Mh = /* @__PURE__ */ new B(1, 0, 0), wh = /* @__PURE__ */ new B(0, 1, 0), Ah = /* @__PURE__ */ new B(0, 0, 1), Rh = { type: "added" }, oy = { type: "removed" }, Us = { type: "childadded", child: null }, ac = { type: "childremoved", child: null };
22943
22965
  class Sn extends ur {
22944
22966
  /**
22945
22967
  * Constructs a new 3D object.
22946
22968
  */
22947
22969
  constructor() {
22948
22970
  super(), this.isObject3D = !0, Object.defineProperty(this, "id", { value: sy++ }), this.uuid = Zr(), this.name = "", this.type = "Object3D", this.parent = null, this.children = [], this.up = Sn.DEFAULT_UP.clone();
22949
- const e = new B(), t = new Ai(), n = new Qr(), s = new B(1, 1, 1);
22971
+ const e = new B(), t = new Ri(), n = new Qr(), s = new B(1, 1, 1);
22950
22972
  function r() {
22951
22973
  n.setFromEuler(t, !1);
22952
22974
  }
@@ -23223,7 +23245,7 @@ class Sn extends ur {
23223
23245
  * @return {Vector3} The converted vector.
23224
23246
  */
23225
23247
  worldToLocal(e) {
23226
- return this.updateWorldMatrix(!0, !1), e.applyMatrix4(li.copy(this.matrixWorld).invert());
23248
+ return this.updateWorldMatrix(!0, !1), e.applyMatrix4(di.copy(this.matrixWorld).invert());
23227
23249
  }
23228
23250
  /**
23229
23251
  * Rotates the object to face a point in world space.
@@ -23237,7 +23259,7 @@ class Sn extends ur {
23237
23259
  lookAt(e, t, n) {
23238
23260
  e.isVector3 ? fa.copy(e) : fa.set(e, t, n);
23239
23261
  const s = this.parent;
23240
- this.updateWorldMatrix(!0, !1), Cr.setFromMatrixPosition(this.matrixWorld), this.isCamera || this.isLight ? li.lookAt(Cr, fa, this.up) : li.lookAt(fa, Cr, this.up), this.quaternion.setFromRotationMatrix(li), s && (li.extractRotation(s.matrixWorld), Ns.setFromRotationMatrix(li), this.quaternion.premultiply(Ns.invert()));
23262
+ this.updateWorldMatrix(!0, !1), Cr.setFromMatrixPosition(this.matrixWorld), this.isCamera || this.isLight ? di.lookAt(Cr, fa, this.up) : di.lookAt(fa, Cr, this.up), this.quaternion.setFromRotationMatrix(di), s && (di.extractRotation(s.matrixWorld), Ns.setFromRotationMatrix(di), this.quaternion.premultiply(Ns.invert()));
23241
23263
  }
23242
23264
  /**
23243
23265
  * Adds the given 3D object as a child to this 3D object. An arbitrary number of
@@ -23306,7 +23328,7 @@ class Sn extends ur {
23306
23328
  * @return {Object3D} A reference to this instance.
23307
23329
  */
23308
23330
  attach(e) {
23309
- return this.updateWorldMatrix(!0, !1), li.copy(this.matrixWorld).invert(), e.parent !== null && (e.parent.updateWorldMatrix(!0, !1), li.multiply(e.parent.matrixWorld)), e.applyMatrix4(li), e.removeFromParent(), e.parent = this, this.children.push(e), e.updateWorldMatrix(!1, !0), e.dispatchEvent(Rh), Us.child = e, this.dispatchEvent(Us), Us.child = null, this;
23331
+ return this.updateWorldMatrix(!0, !1), di.copy(this.matrixWorld).invert(), e.parent !== null && (e.parent.updateWorldMatrix(!0, !1), di.multiply(e.parent.matrixWorld)), e.applyMatrix4(di), e.removeFromParent(), e.parent = this, this.children.push(e), e.updateWorldMatrix(!1, !0), e.dispatchEvent(Rh), Us.child = e, this.dispatchEvent(Us), Us.child = null, this;
23310
23332
  }
23311
23333
  /**
23312
23334
  * Searches through the 3D object and its children, starting with the 3D object
@@ -23597,8 +23619,8 @@ class Sn extends ur {
23597
23619
  Sn.DEFAULT_UP = /* @__PURE__ */ new B(0, 1, 0);
23598
23620
  Sn.DEFAULT_MATRIX_AUTO_UPDATE = !0;
23599
23621
  Sn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE = !0;
23600
- const kn = /* @__PURE__ */ new B(), di = /* @__PURE__ */ new B(), oc = /* @__PURE__ */ new B(), ui = /* @__PURE__ */ new B(), Os = /* @__PURE__ */ new B(), Fs = /* @__PURE__ */ new B(), Ph = /* @__PURE__ */ new B(), cc = /* @__PURE__ */ new B(), lc = /* @__PURE__ */ new B(), dc = /* @__PURE__ */ new B(), uc = /* @__PURE__ */ new Lt(), hc = /* @__PURE__ */ new Lt(), fc = /* @__PURE__ */ new Lt();
23601
- class On {
23622
+ const In = /* @__PURE__ */ new B(), ui = /* @__PURE__ */ new B(), oc = /* @__PURE__ */ new B(), hi = /* @__PURE__ */ new B(), Os = /* @__PURE__ */ new B(), Fs = /* @__PURE__ */ new B(), Ph = /* @__PURE__ */ new B(), cc = /* @__PURE__ */ new B(), lc = /* @__PURE__ */ new B(), dc = /* @__PURE__ */ new B(), uc = /* @__PURE__ */ new Lt(), hc = /* @__PURE__ */ new Lt(), fc = /* @__PURE__ */ new Lt();
23623
+ class Fn {
23602
23624
  /**
23603
23625
  * Constructs a new triangle.
23604
23626
  *
@@ -23619,7 +23641,7 @@ class On {
23619
23641
  * @return {Vector3} The triangle's normal.
23620
23642
  */
23621
23643
  static getNormal(e, t, n, s) {
23622
- s.subVectors(n, t), kn.subVectors(e, t), s.cross(kn);
23644
+ s.subVectors(n, t), In.subVectors(e, t), s.cross(In);
23623
23645
  const r = s.lengthSq();
23624
23646
  return r > 0 ? s.multiplyScalar(1 / Math.sqrt(r)) : s.set(0, 0, 0);
23625
23647
  }
@@ -23635,8 +23657,8 @@ class On {
23635
23657
  * @return {?Vector3} The barycentric coordinates for the given point
23636
23658
  */
23637
23659
  static getBarycoord(e, t, n, s, r) {
23638
- kn.subVectors(s, t), di.subVectors(n, t), oc.subVectors(e, t);
23639
- const a = kn.dot(kn), o = kn.dot(di), c = kn.dot(oc), l = di.dot(di), d = di.dot(oc), u = a * l - o * o;
23660
+ In.subVectors(s, t), ui.subVectors(n, t), oc.subVectors(e, t);
23661
+ const a = In.dot(In), o = In.dot(ui), c = In.dot(oc), l = ui.dot(ui), d = ui.dot(oc), u = a * l - o * o;
23640
23662
  if (u === 0)
23641
23663
  return r.set(0, 0, 0), null;
23642
23664
  const h = 1 / u, f = (l * c - o * d) * h, g = (a * d - o * c) * h;
@@ -23654,7 +23676,7 @@ class On {
23654
23676
  * triangle, lies within the triangle or not.
23655
23677
  */
23656
23678
  static containsPoint(e, t, n, s) {
23657
- return this.getBarycoord(e, t, n, s, ui) === null ? !1 : ui.x >= 0 && ui.y >= 0 && ui.x + ui.y <= 1;
23679
+ return this.getBarycoord(e, t, n, s, hi) === null ? !1 : hi.x >= 0 && hi.y >= 0 && hi.x + hi.y <= 1;
23658
23680
  }
23659
23681
  /**
23660
23682
  * Computes the value barycentrically interpolated for the given point on the
@@ -23671,7 +23693,7 @@ class On {
23671
23693
  * @return {?Vector3} The interpolated value.
23672
23694
  */
23673
23695
  static getInterpolation(e, t, n, s, r, a, o, c) {
23674
- return this.getBarycoord(e, t, n, s, ui) === null ? (c.x = 0, c.y = 0, "z" in c && (c.z = 0), "w" in c && (c.w = 0), null) : (c.setScalar(0), c.addScaledVector(r, ui.x), c.addScaledVector(a, ui.y), c.addScaledVector(o, ui.z), c);
23696
+ return this.getBarycoord(e, t, n, s, hi) === null ? (c.x = 0, c.y = 0, "z" in c && (c.z = 0), "w" in c && (c.w = 0), null) : (c.setScalar(0), c.addScaledVector(r, hi.x), c.addScaledVector(a, hi.y), c.addScaledVector(o, hi.z), c);
23675
23697
  }
23676
23698
  /**
23677
23699
  * Computes the value barycentrically interpolated for the given attribute and indices.
@@ -23697,7 +23719,7 @@ class On {
23697
23719
  * @return {boolean} Whether the triangle is oriented towards the given direction or not.
23698
23720
  */
23699
23721
  static isFrontFacing(e, t, n, s) {
23700
- return kn.subVectors(n, t), di.subVectors(e, t), kn.cross(di).dot(s) < 0;
23722
+ return In.subVectors(n, t), ui.subVectors(e, t), In.cross(ui).dot(s) < 0;
23701
23723
  }
23702
23724
  /**
23703
23725
  * Sets the triangle's vertices by copying the given values.
@@ -23757,7 +23779,7 @@ class On {
23757
23779
  * @return {number} The triangle's area.
23758
23780
  */
23759
23781
  getArea() {
23760
- return kn.subVectors(this.c, this.b), di.subVectors(this.a, this.b), kn.cross(di).length() * 0.5;
23782
+ return In.subVectors(this.c, this.b), ui.subVectors(this.a, this.b), In.cross(ui).length() * 0.5;
23761
23783
  }
23762
23784
  /**
23763
23785
  * Computes the midpoint of the triangle.
@@ -23775,7 +23797,7 @@ class On {
23775
23797
  * @return {Vector3} The triangle's normal.
23776
23798
  */
23777
23799
  getNormal(e) {
23778
- return On.getNormal(this.a, this.b, this.c, e);
23800
+ return Fn.getNormal(this.a, this.b, this.c, e);
23779
23801
  }
23780
23802
  /**
23781
23803
  * Computes a plane the triangle lies within.
@@ -23795,7 +23817,7 @@ class On {
23795
23817
  * @return {?Vector3} The barycentric coordinates for the given point
23796
23818
  */
23797
23819
  getBarycoord(e, t) {
23798
- return On.getBarycoord(e, this.a, this.b, this.c, t);
23820
+ return Fn.getBarycoord(e, this.a, this.b, this.c, t);
23799
23821
  }
23800
23822
  /**
23801
23823
  * Computes the value barycentrically interpolated for the given point on the
@@ -23809,7 +23831,7 @@ class On {
23809
23831
  * @return {?Vector3} The interpolated value.
23810
23832
  */
23811
23833
  getInterpolation(e, t, n, s, r) {
23812
- return On.getInterpolation(e, this.a, this.b, this.c, t, n, s, r);
23834
+ return Fn.getInterpolation(e, this.a, this.b, this.c, t, n, s, r);
23813
23835
  }
23814
23836
  /**
23815
23837
  * Returns `true` if the given point, when projected onto the plane of the
@@ -23820,7 +23842,7 @@ class On {
23820
23842
  * triangle, lies within the triangle or not.
23821
23843
  */
23822
23844
  containsPoint(e) {
23823
- return On.containsPoint(e, this.a, this.b, this.c);
23845
+ return Fn.containsPoint(e, this.a, this.b, this.c);
23824
23846
  }
23825
23847
  /**
23826
23848
  * Returns `true` if the triangle is oriented towards the given direction.
@@ -23829,7 +23851,7 @@ class On {
23829
23851
  * @return {boolean} Whether the triangle is oriented towards the given direction or not.
23830
23852
  */
23831
23853
  isFrontFacing(e) {
23832
- return On.isFrontFacing(this.a, this.b, this.c, e);
23854
+ return Fn.isFrontFacing(this.a, this.b, this.c, e);
23833
23855
  }
23834
23856
  /**
23835
23857
  * Returns `true` if this triangle intersects with the given box.
@@ -24225,7 +24247,7 @@ class Je {
24225
24247
  * @return {Color} A reference to this color.
24226
24248
  */
24227
24249
  copySRGBToLinear(e) {
24228
- return this.r = Ti(e.r), this.g = Ti(e.g), this.b = Ti(e.b), this;
24250
+ return this.r = Ci(e.r), this.g = Ci(e.g), this.b = Ci(e.b), this;
24229
24251
  }
24230
24252
  /**
24231
24253
  * Copies the given color into this color, and then converts this color from
@@ -24513,7 +24535,7 @@ class vo extends ur {
24513
24535
  * Constructs a new material.
24514
24536
  */
24515
24537
  constructor() {
24516
- super(), this.isMaterial = !0, Object.defineProperty(this, "id", { value: cy++ }), this.uuid = Zr(), this.name = "", this.type = "Material", this.blending = Qs, this.side = Ei, this.vertexColors = !1, this.opacity = 1, this.transparent = !1, this.alphaHash = !1, this.blendSrc = al, this.blendDst = ol, this.blendEquation = us, this.blendSrcAlpha = null, this.blendDstAlpha = null, this.blendEquationAlpha = null, this.blendColor = new Je(0, 0, 0), this.blendAlpha = 0, this.depthFunc = ar, this.depthTest = !0, this.depthWrite = !0, this.stencilWriteMask = 255, this.stencilFunc = mh, this.stencilRef = 0, this.stencilFuncMask = 255, this.stencilFail = Rs, this.stencilZFail = Rs, this.stencilZPass = Rs, this.stencilWrite = !1, this.clippingPlanes = null, this.clipIntersection = !1, this.clipShadows = !1, this.shadowSide = null, this.colorWrite = !0, this.precision = null, this.polygonOffset = !1, this.polygonOffsetFactor = 0, this.polygonOffsetUnits = 0, this.dithering = !1, this.alphaToCoverage = !1, this.premultipliedAlpha = !1, this.forceSinglePass = !1, this.allowOverride = !0, this.visible = !0, this.toneMapped = !0, this.userData = {}, this.version = 0, this._alphaTest = 0;
24538
+ super(), this.isMaterial = !0, Object.defineProperty(this, "id", { value: cy++ }), this.uuid = Zr(), this.name = "", this.type = "Material", this.blending = Qs, this.side = Mi, this.vertexColors = !1, this.opacity = 1, this.transparent = !1, this.alphaHash = !1, this.blendSrc = al, this.blendDst = ol, this.blendEquation = us, this.blendSrcAlpha = null, this.blendDstAlpha = null, this.blendEquationAlpha = null, this.blendColor = new Je(0, 0, 0), this.blendAlpha = 0, this.depthFunc = ar, this.depthTest = !0, this.depthWrite = !0, this.stencilWriteMask = 255, this.stencilFunc = mh, this.stencilRef = 0, this.stencilFuncMask = 255, this.stencilFail = Rs, this.stencilZFail = Rs, this.stencilZPass = Rs, this.stencilWrite = !1, this.clippingPlanes = null, this.clipIntersection = !1, this.clipShadows = !1, this.shadowSide = null, this.colorWrite = !0, this.precision = null, this.polygonOffset = !1, this.polygonOffsetFactor = 0, this.polygonOffsetUnits = 0, this.dithering = !1, this.alphaToCoverage = !1, this.premultipliedAlpha = !1, this.forceSinglePass = !1, this.allowOverride = !0, this.visible = !0, this.toneMapped = !0, this.userData = {}, this.version = 0, this._alphaTest = 0;
24517
24539
  }
24518
24540
  /**
24519
24541
  * Sets the alpha value to be used when running an alpha test. The material
@@ -24612,7 +24634,7 @@ class vo extends ur {
24612
24634
  generator: "Material.toJSON"
24613
24635
  }
24614
24636
  };
24615
- n.uuid = this.uuid, n.type = this.type, this.name !== "" && (n.name = this.name), this.color && this.color.isColor && (n.color = this.color.getHex()), this.roughness !== void 0 && (n.roughness = this.roughness), this.metalness !== void 0 && (n.metalness = this.metalness), this.sheen !== void 0 && (n.sheen = this.sheen), this.sheenColor && this.sheenColor.isColor && (n.sheenColor = this.sheenColor.getHex()), this.sheenRoughness !== void 0 && (n.sheenRoughness = this.sheenRoughness), this.emissive && this.emissive.isColor && (n.emissive = this.emissive.getHex()), this.emissiveIntensity !== void 0 && this.emissiveIntensity !== 1 && (n.emissiveIntensity = this.emissiveIntensity), this.specular && this.specular.isColor && (n.specular = this.specular.getHex()), this.specularIntensity !== void 0 && (n.specularIntensity = this.specularIntensity), this.specularColor && this.specularColor.isColor && (n.specularColor = this.specularColor.getHex()), this.shininess !== void 0 && (n.shininess = this.shininess), this.clearcoat !== void 0 && (n.clearcoat = this.clearcoat), this.clearcoatRoughness !== void 0 && (n.clearcoatRoughness = this.clearcoatRoughness), this.clearcoatMap && this.clearcoatMap.isTexture && (n.clearcoatMap = this.clearcoatMap.toJSON(e).uuid), this.clearcoatRoughnessMap && this.clearcoatRoughnessMap.isTexture && (n.clearcoatRoughnessMap = this.clearcoatRoughnessMap.toJSON(e).uuid), this.clearcoatNormalMap && this.clearcoatNormalMap.isTexture && (n.clearcoatNormalMap = this.clearcoatNormalMap.toJSON(e).uuid, n.clearcoatNormalScale = this.clearcoatNormalScale.toArray()), this.sheenColorMap && this.sheenColorMap.isTexture && (n.sheenColorMap = this.sheenColorMap.toJSON(e).uuid), this.sheenRoughnessMap && this.sheenRoughnessMap.isTexture && (n.sheenRoughnessMap = this.sheenRoughnessMap.toJSON(e).uuid), this.dispersion !== void 0 && (n.dispersion = this.dispersion), this.iridescence !== void 0 && (n.iridescence = this.iridescence), this.iridescenceIOR !== void 0 && (n.iridescenceIOR = this.iridescenceIOR), this.iridescenceThicknessRange !== void 0 && (n.iridescenceThicknessRange = this.iridescenceThicknessRange), this.iridescenceMap && this.iridescenceMap.isTexture && (n.iridescenceMap = this.iridescenceMap.toJSON(e).uuid), this.iridescenceThicknessMap && this.iridescenceThicknessMap.isTexture && (n.iridescenceThicknessMap = this.iridescenceThicknessMap.toJSON(e).uuid), this.anisotropy !== void 0 && (n.anisotropy = this.anisotropy), this.anisotropyRotation !== void 0 && (n.anisotropyRotation = this.anisotropyRotation), this.anisotropyMap && this.anisotropyMap.isTexture && (n.anisotropyMap = this.anisotropyMap.toJSON(e).uuid), this.map && this.map.isTexture && (n.map = this.map.toJSON(e).uuid), this.matcap && this.matcap.isTexture && (n.matcap = this.matcap.toJSON(e).uuid), this.alphaMap && this.alphaMap.isTexture && (n.alphaMap = this.alphaMap.toJSON(e).uuid), this.lightMap && this.lightMap.isTexture && (n.lightMap = this.lightMap.toJSON(e).uuid, n.lightMapIntensity = this.lightMapIntensity), this.aoMap && this.aoMap.isTexture && (n.aoMap = this.aoMap.toJSON(e).uuid, n.aoMapIntensity = this.aoMapIntensity), this.bumpMap && this.bumpMap.isTexture && (n.bumpMap = this.bumpMap.toJSON(e).uuid, n.bumpScale = this.bumpScale), this.normalMap && this.normalMap.isTexture && (n.normalMap = this.normalMap.toJSON(e).uuid, n.normalMapType = this.normalMapType, n.normalScale = this.normalScale.toArray()), this.displacementMap && this.displacementMap.isTexture && (n.displacementMap = this.displacementMap.toJSON(e).uuid, n.displacementScale = this.displacementScale, n.displacementBias = this.displacementBias), this.roughnessMap && this.roughnessMap.isTexture && (n.roughnessMap = this.roughnessMap.toJSON(e).uuid), this.metalnessMap && this.metalnessMap.isTexture && (n.metalnessMap = this.metalnessMap.toJSON(e).uuid), this.emissiveMap && this.emissiveMap.isTexture && (n.emissiveMap = this.emissiveMap.toJSON(e).uuid), this.specularMap && this.specularMap.isTexture && (n.specularMap = this.specularMap.toJSON(e).uuid), this.specularIntensityMap && this.specularIntensityMap.isTexture && (n.specularIntensityMap = this.specularIntensityMap.toJSON(e).uuid), this.specularColorMap && this.specularColorMap.isTexture && (n.specularColorMap = this.specularColorMap.toJSON(e).uuid), this.envMap && this.envMap.isTexture && (n.envMap = this.envMap.toJSON(e).uuid, this.combine !== void 0 && (n.combine = this.combine)), this.envMapRotation !== void 0 && (n.envMapRotation = this.envMapRotation.toArray()), this.envMapIntensity !== void 0 && (n.envMapIntensity = this.envMapIntensity), this.reflectivity !== void 0 && (n.reflectivity = this.reflectivity), this.refractionRatio !== void 0 && (n.refractionRatio = this.refractionRatio), this.gradientMap && this.gradientMap.isTexture && (n.gradientMap = this.gradientMap.toJSON(e).uuid), this.transmission !== void 0 && (n.transmission = this.transmission), this.transmissionMap && this.transmissionMap.isTexture && (n.transmissionMap = this.transmissionMap.toJSON(e).uuid), this.thickness !== void 0 && (n.thickness = this.thickness), this.thicknessMap && this.thicknessMap.isTexture && (n.thicknessMap = this.thicknessMap.toJSON(e).uuid), this.attenuationDistance !== void 0 && this.attenuationDistance !== 1 / 0 && (n.attenuationDistance = this.attenuationDistance), this.attenuationColor !== void 0 && (n.attenuationColor = this.attenuationColor.getHex()), this.size !== void 0 && (n.size = this.size), this.shadowSide !== null && (n.shadowSide = this.shadowSide), this.sizeAttenuation !== void 0 && (n.sizeAttenuation = this.sizeAttenuation), this.blending !== Qs && (n.blending = this.blending), this.side !== Ei && (n.side = this.side), this.vertexColors === !0 && (n.vertexColors = !0), this.opacity < 1 && (n.opacity = this.opacity), this.transparent === !0 && (n.transparent = !0), this.blendSrc !== al && (n.blendSrc = this.blendSrc), this.blendDst !== ol && (n.blendDst = this.blendDst), this.blendEquation !== us && (n.blendEquation = this.blendEquation), this.blendSrcAlpha !== null && (n.blendSrcAlpha = this.blendSrcAlpha), this.blendDstAlpha !== null && (n.blendDstAlpha = this.blendDstAlpha), this.blendEquationAlpha !== null && (n.blendEquationAlpha = this.blendEquationAlpha), this.blendColor && this.blendColor.isColor && (n.blendColor = this.blendColor.getHex()), this.blendAlpha !== 0 && (n.blendAlpha = this.blendAlpha), this.depthFunc !== ar && (n.depthFunc = this.depthFunc), this.depthTest === !1 && (n.depthTest = this.depthTest), this.depthWrite === !1 && (n.depthWrite = this.depthWrite), this.colorWrite === !1 && (n.colorWrite = this.colorWrite), this.stencilWriteMask !== 255 && (n.stencilWriteMask = this.stencilWriteMask), this.stencilFunc !== mh && (n.stencilFunc = this.stencilFunc), this.stencilRef !== 0 && (n.stencilRef = this.stencilRef), this.stencilFuncMask !== 255 && (n.stencilFuncMask = this.stencilFuncMask), this.stencilFail !== Rs && (n.stencilFail = this.stencilFail), this.stencilZFail !== Rs && (n.stencilZFail = this.stencilZFail), this.stencilZPass !== Rs && (n.stencilZPass = this.stencilZPass), this.stencilWrite === !0 && (n.stencilWrite = this.stencilWrite), this.rotation !== void 0 && this.rotation !== 0 && (n.rotation = this.rotation), this.polygonOffset === !0 && (n.polygonOffset = !0), this.polygonOffsetFactor !== 0 && (n.polygonOffsetFactor = this.polygonOffsetFactor), this.polygonOffsetUnits !== 0 && (n.polygonOffsetUnits = this.polygonOffsetUnits), this.linewidth !== void 0 && this.linewidth !== 1 && (n.linewidth = this.linewidth), this.dashSize !== void 0 && (n.dashSize = this.dashSize), this.gapSize !== void 0 && (n.gapSize = this.gapSize), this.scale !== void 0 && (n.scale = this.scale), this.dithering === !0 && (n.dithering = !0), this.alphaTest > 0 && (n.alphaTest = this.alphaTest), this.alphaHash === !0 && (n.alphaHash = !0), this.alphaToCoverage === !0 && (n.alphaToCoverage = !0), this.premultipliedAlpha === !0 && (n.premultipliedAlpha = !0), this.forceSinglePass === !0 && (n.forceSinglePass = !0), this.allowOverride === !1 && (n.allowOverride = !1), this.wireframe === !0 && (n.wireframe = !0), this.wireframeLinewidth > 1 && (n.wireframeLinewidth = this.wireframeLinewidth), this.wireframeLinecap !== "round" && (n.wireframeLinecap = this.wireframeLinecap), this.wireframeLinejoin !== "round" && (n.wireframeLinejoin = this.wireframeLinejoin), this.flatShading === !0 && (n.flatShading = !0), this.visible === !1 && (n.visible = !1), this.toneMapped === !1 && (n.toneMapped = !1), this.fog === !1 && (n.fog = !1), Object.keys(this.userData).length > 0 && (n.userData = this.userData);
24637
+ n.uuid = this.uuid, n.type = this.type, this.name !== "" && (n.name = this.name), this.color && this.color.isColor && (n.color = this.color.getHex()), this.roughness !== void 0 && (n.roughness = this.roughness), this.metalness !== void 0 && (n.metalness = this.metalness), this.sheen !== void 0 && (n.sheen = this.sheen), this.sheenColor && this.sheenColor.isColor && (n.sheenColor = this.sheenColor.getHex()), this.sheenRoughness !== void 0 && (n.sheenRoughness = this.sheenRoughness), this.emissive && this.emissive.isColor && (n.emissive = this.emissive.getHex()), this.emissiveIntensity !== void 0 && this.emissiveIntensity !== 1 && (n.emissiveIntensity = this.emissiveIntensity), this.specular && this.specular.isColor && (n.specular = this.specular.getHex()), this.specularIntensity !== void 0 && (n.specularIntensity = this.specularIntensity), this.specularColor && this.specularColor.isColor && (n.specularColor = this.specularColor.getHex()), this.shininess !== void 0 && (n.shininess = this.shininess), this.clearcoat !== void 0 && (n.clearcoat = this.clearcoat), this.clearcoatRoughness !== void 0 && (n.clearcoatRoughness = this.clearcoatRoughness), this.clearcoatMap && this.clearcoatMap.isTexture && (n.clearcoatMap = this.clearcoatMap.toJSON(e).uuid), this.clearcoatRoughnessMap && this.clearcoatRoughnessMap.isTexture && (n.clearcoatRoughnessMap = this.clearcoatRoughnessMap.toJSON(e).uuid), this.clearcoatNormalMap && this.clearcoatNormalMap.isTexture && (n.clearcoatNormalMap = this.clearcoatNormalMap.toJSON(e).uuid, n.clearcoatNormalScale = this.clearcoatNormalScale.toArray()), this.sheenColorMap && this.sheenColorMap.isTexture && (n.sheenColorMap = this.sheenColorMap.toJSON(e).uuid), this.sheenRoughnessMap && this.sheenRoughnessMap.isTexture && (n.sheenRoughnessMap = this.sheenRoughnessMap.toJSON(e).uuid), this.dispersion !== void 0 && (n.dispersion = this.dispersion), this.iridescence !== void 0 && (n.iridescence = this.iridescence), this.iridescenceIOR !== void 0 && (n.iridescenceIOR = this.iridescenceIOR), this.iridescenceThicknessRange !== void 0 && (n.iridescenceThicknessRange = this.iridescenceThicknessRange), this.iridescenceMap && this.iridescenceMap.isTexture && (n.iridescenceMap = this.iridescenceMap.toJSON(e).uuid), this.iridescenceThicknessMap && this.iridescenceThicknessMap.isTexture && (n.iridescenceThicknessMap = this.iridescenceThicknessMap.toJSON(e).uuid), this.anisotropy !== void 0 && (n.anisotropy = this.anisotropy), this.anisotropyRotation !== void 0 && (n.anisotropyRotation = this.anisotropyRotation), this.anisotropyMap && this.anisotropyMap.isTexture && (n.anisotropyMap = this.anisotropyMap.toJSON(e).uuid), this.map && this.map.isTexture && (n.map = this.map.toJSON(e).uuid), this.matcap && this.matcap.isTexture && (n.matcap = this.matcap.toJSON(e).uuid), this.alphaMap && this.alphaMap.isTexture && (n.alphaMap = this.alphaMap.toJSON(e).uuid), this.lightMap && this.lightMap.isTexture && (n.lightMap = this.lightMap.toJSON(e).uuid, n.lightMapIntensity = this.lightMapIntensity), this.aoMap && this.aoMap.isTexture && (n.aoMap = this.aoMap.toJSON(e).uuid, n.aoMapIntensity = this.aoMapIntensity), this.bumpMap && this.bumpMap.isTexture && (n.bumpMap = this.bumpMap.toJSON(e).uuid, n.bumpScale = this.bumpScale), this.normalMap && this.normalMap.isTexture && (n.normalMap = this.normalMap.toJSON(e).uuid, n.normalMapType = this.normalMapType, n.normalScale = this.normalScale.toArray()), this.displacementMap && this.displacementMap.isTexture && (n.displacementMap = this.displacementMap.toJSON(e).uuid, n.displacementScale = this.displacementScale, n.displacementBias = this.displacementBias), this.roughnessMap && this.roughnessMap.isTexture && (n.roughnessMap = this.roughnessMap.toJSON(e).uuid), this.metalnessMap && this.metalnessMap.isTexture && (n.metalnessMap = this.metalnessMap.toJSON(e).uuid), this.emissiveMap && this.emissiveMap.isTexture && (n.emissiveMap = this.emissiveMap.toJSON(e).uuid), this.specularMap && this.specularMap.isTexture && (n.specularMap = this.specularMap.toJSON(e).uuid), this.specularIntensityMap && this.specularIntensityMap.isTexture && (n.specularIntensityMap = this.specularIntensityMap.toJSON(e).uuid), this.specularColorMap && this.specularColorMap.isTexture && (n.specularColorMap = this.specularColorMap.toJSON(e).uuid), this.envMap && this.envMap.isTexture && (n.envMap = this.envMap.toJSON(e).uuid, this.combine !== void 0 && (n.combine = this.combine)), this.envMapRotation !== void 0 && (n.envMapRotation = this.envMapRotation.toArray()), this.envMapIntensity !== void 0 && (n.envMapIntensity = this.envMapIntensity), this.reflectivity !== void 0 && (n.reflectivity = this.reflectivity), this.refractionRatio !== void 0 && (n.refractionRatio = this.refractionRatio), this.gradientMap && this.gradientMap.isTexture && (n.gradientMap = this.gradientMap.toJSON(e).uuid), this.transmission !== void 0 && (n.transmission = this.transmission), this.transmissionMap && this.transmissionMap.isTexture && (n.transmissionMap = this.transmissionMap.toJSON(e).uuid), this.thickness !== void 0 && (n.thickness = this.thickness), this.thicknessMap && this.thicknessMap.isTexture && (n.thicknessMap = this.thicknessMap.toJSON(e).uuid), this.attenuationDistance !== void 0 && this.attenuationDistance !== 1 / 0 && (n.attenuationDistance = this.attenuationDistance), this.attenuationColor !== void 0 && (n.attenuationColor = this.attenuationColor.getHex()), this.size !== void 0 && (n.size = this.size), this.shadowSide !== null && (n.shadowSide = this.shadowSide), this.sizeAttenuation !== void 0 && (n.sizeAttenuation = this.sizeAttenuation), this.blending !== Qs && (n.blending = this.blending), this.side !== Mi && (n.side = this.side), this.vertexColors === !0 && (n.vertexColors = !0), this.opacity < 1 && (n.opacity = this.opacity), this.transparent === !0 && (n.transparent = !0), this.blendSrc !== al && (n.blendSrc = this.blendSrc), this.blendDst !== ol && (n.blendDst = this.blendDst), this.blendEquation !== us && (n.blendEquation = this.blendEquation), this.blendSrcAlpha !== null && (n.blendSrcAlpha = this.blendSrcAlpha), this.blendDstAlpha !== null && (n.blendDstAlpha = this.blendDstAlpha), this.blendEquationAlpha !== null && (n.blendEquationAlpha = this.blendEquationAlpha), this.blendColor && this.blendColor.isColor && (n.blendColor = this.blendColor.getHex()), this.blendAlpha !== 0 && (n.blendAlpha = this.blendAlpha), this.depthFunc !== ar && (n.depthFunc = this.depthFunc), this.depthTest === !1 && (n.depthTest = this.depthTest), this.depthWrite === !1 && (n.depthWrite = this.depthWrite), this.colorWrite === !1 && (n.colorWrite = this.colorWrite), this.stencilWriteMask !== 255 && (n.stencilWriteMask = this.stencilWriteMask), this.stencilFunc !== mh && (n.stencilFunc = this.stencilFunc), this.stencilRef !== 0 && (n.stencilRef = this.stencilRef), this.stencilFuncMask !== 255 && (n.stencilFuncMask = this.stencilFuncMask), this.stencilFail !== Rs && (n.stencilFail = this.stencilFail), this.stencilZFail !== Rs && (n.stencilZFail = this.stencilZFail), this.stencilZPass !== Rs && (n.stencilZPass = this.stencilZPass), this.stencilWrite === !0 && (n.stencilWrite = this.stencilWrite), this.rotation !== void 0 && this.rotation !== 0 && (n.rotation = this.rotation), this.polygonOffset === !0 && (n.polygonOffset = !0), this.polygonOffsetFactor !== 0 && (n.polygonOffsetFactor = this.polygonOffsetFactor), this.polygonOffsetUnits !== 0 && (n.polygonOffsetUnits = this.polygonOffsetUnits), this.linewidth !== void 0 && this.linewidth !== 1 && (n.linewidth = this.linewidth), this.dashSize !== void 0 && (n.dashSize = this.dashSize), this.gapSize !== void 0 && (n.gapSize = this.gapSize), this.scale !== void 0 && (n.scale = this.scale), this.dithering === !0 && (n.dithering = !0), this.alphaTest > 0 && (n.alphaTest = this.alphaTest), this.alphaHash === !0 && (n.alphaHash = !0), this.alphaToCoverage === !0 && (n.alphaToCoverage = !0), this.premultipliedAlpha === !0 && (n.premultipliedAlpha = !0), this.forceSinglePass === !0 && (n.forceSinglePass = !0), this.allowOverride === !1 && (n.allowOverride = !1), this.wireframe === !0 && (n.wireframe = !0), this.wireframeLinewidth > 1 && (n.wireframeLinewidth = this.wireframeLinewidth), this.wireframeLinecap !== "round" && (n.wireframeLinecap = this.wireframeLinecap), this.wireframeLinejoin !== "round" && (n.wireframeLinejoin = this.wireframeLinejoin), this.flatShading === !0 && (n.flatShading = !0), this.visible === !1 && (n.visible = !1), this.toneMapped === !1 && (n.toneMapped = !1), this.fog === !1 && (n.fog = !1), Object.keys(this.userData).length > 0 && (n.userData = this.userData);
24616
24638
  function s(r) {
24617
24639
  const a = [];
24618
24640
  for (const o in r) {
@@ -24685,7 +24707,7 @@ class xm extends vo {
24685
24707
  * by {@link Color#set}.
24686
24708
  */
24687
24709
  constructor(e) {
24688
- super(), this.isMeshBasicMaterial = !0, this.type = "MeshBasicMaterial", this.color = new Je(16777215), this.map = null, this.lightMap = null, this.lightMapIntensity = 1, this.aoMap = null, this.aoMapIntensity = 1, this.specularMap = null, this.alphaMap = null, this.envMap = null, this.envMapRotation = new Ai(), this.combine = nm, this.reflectivity = 1, this.refractionRatio = 0.98, this.wireframe = !1, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.fog = !0, this.setValues(e);
24710
+ super(), this.isMeshBasicMaterial = !0, this.type = "MeshBasicMaterial", this.color = new Je(16777215), this.map = null, this.lightMap = null, this.lightMapIntensity = 1, this.aoMap = null, this.aoMapIntensity = 1, this.specularMap = null, this.alphaMap = null, this.envMap = null, this.envMapRotation = new Ri(), this.combine = nm, this.reflectivity = 1, this.refractionRatio = 0.98, this.wireframe = !1, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.fog = !0, this.setValues(e);
24689
24711
  }
24690
24712
  copy(e) {
24691
24713
  return super.copy(e), this.color.copy(e.color), this.map = e.map, this.lightMap = e.lightMap, this.lightMapIntensity = e.lightMapIntensity, this.aoMap = e.aoMap, this.aoMapIntensity = e.aoMapIntensity, this.specularMap = e.specularMap, this.alphaMap = e.alphaMap, this.envMap = e.envMap, this.envMapRotation.copy(e.envMapRotation), this.combine = e.combine, this.reflectivity = e.reflectivity, this.refractionRatio = e.refractionRatio, this.wireframe = e.wireframe, this.wireframeLinewidth = e.wireframeLinewidth, this.wireframeLinecap = e.wireframeLinecap, this.wireframeLinejoin = e.wireframeLinejoin, this.fog = e.fog, this;
@@ -24693,7 +24715,7 @@ class xm extends vo {
24693
24715
  }
24694
24716
  const Ot = /* @__PURE__ */ new B(), ma = /* @__PURE__ */ new st();
24695
24717
  let ly = 0;
24696
- class ti {
24718
+ class ni {
24697
24719
  /**
24698
24720
  * Constructs a new buffer attribute.
24699
24721
  *
@@ -24704,7 +24726,7 @@ class ti {
24704
24726
  constructor(e, t, n = !1) {
24705
24727
  if (Array.isArray(e))
24706
24728
  throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");
24707
- this.isBufferAttribute = !0, Object.defineProperty(this, "id", { value: ly++ }), this.name = "", this.array = e, this.itemSize = t, this.count = e !== void 0 ? e.length / t : 0, this.normalized = n, this.usage = gh, this.updateRanges = [], this.gpuType = Yn, this.version = 0;
24729
+ this.isBufferAttribute = !0, Object.defineProperty(this, "id", { value: ly++ }), this.name = "", this.array = e, this.itemSize = t, this.count = e !== void 0 ? e.length / t : 0, this.normalized = n, this.usage = gh, this.updateRanges = [], this.gpuType = Jn, this.version = 0;
24708
24730
  }
24709
24731
  /**
24710
24732
  * A callback function that is executed after the renderer has transferred the attribute
@@ -25015,7 +25037,7 @@ class ti {
25015
25037
  return this.name !== "" && (e.name = this.name), this.usage !== gh && (e.usage = this.usage), e;
25016
25038
  }
25017
25039
  }
25018
- class Tm extends ti {
25040
+ class Tm extends ni {
25019
25041
  /**
25020
25042
  * Constructs a new buffer attribute.
25021
25043
  *
@@ -25027,7 +25049,7 @@ class Tm extends ti {
25027
25049
  super(new Uint16Array(e), t, n);
25028
25050
  }
25029
25051
  }
25030
- class Cm extends ti {
25052
+ class Cm extends ni {
25031
25053
  /**
25032
25054
  * Constructs a new buffer attribute.
25033
25055
  *
@@ -25039,7 +25061,7 @@ class Cm extends ti {
25039
25061
  super(new Uint32Array(e), t, n);
25040
25062
  }
25041
25063
  }
25042
- class rn extends ti {
25064
+ class rn extends ni {
25043
25065
  /**
25044
25066
  * Constructs a new buffer attribute.
25045
25067
  *
@@ -25053,7 +25075,7 @@ class rn extends ti {
25053
25075
  }
25054
25076
  let dy = 0;
25055
25077
  const Tn = /* @__PURE__ */ new Vt(), mc = /* @__PURE__ */ new Sn(), Bs = /* @__PURE__ */ new B(), vn = /* @__PURE__ */ new ea(), Er = /* @__PURE__ */ new ea(), qt = /* @__PURE__ */ new B();
25056
- class Gn extends ur {
25078
+ class Hn extends ur {
25057
25079
  /**
25058
25080
  * Constructs a new geometry.
25059
25081
  */
@@ -25369,7 +25391,7 @@ class Gn extends ur {
25369
25391
  return;
25370
25392
  }
25371
25393
  const n = t.position, s = t.normal, r = t.uv;
25372
- this.hasAttribute("tangent") === !1 && this.setAttribute("tangent", new ti(new Float32Array(4 * n.count), 4));
25394
+ this.hasAttribute("tangent") === !1 && this.setAttribute("tangent", new ni(new Float32Array(4 * n.count), 4));
25373
25395
  const a = this.getAttribute("tangent"), o = [], c = [];
25374
25396
  for (let k = 0; k < n.count; k++)
25375
25397
  o[k] = new B(), c[k] = new B();
@@ -25418,7 +25440,7 @@ class Gn extends ur {
25418
25440
  if (t !== void 0) {
25419
25441
  let n = this.getAttribute("normal");
25420
25442
  if (n === void 0)
25421
- n = new ti(new Float32Array(t.count * 3), 3), this.setAttribute("normal", n);
25443
+ n = new ni(new Float32Array(t.count * 3), 3), this.setAttribute("normal", n);
25422
25444
  else
25423
25445
  for (let h = 0, f = n.count; h < f; h++)
25424
25446
  n.setXYZ(h, 0, 0, 0);
@@ -25458,11 +25480,11 @@ class Gn extends ur {
25458
25480
  for (let p = 0; p < d; p++)
25459
25481
  h[g++] = l[f++];
25460
25482
  }
25461
- return new ti(h, d, u);
25483
+ return new ni(h, d, u);
25462
25484
  }
25463
25485
  if (this.index === null)
25464
25486
  return Oe("BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."), this;
25465
- const t = new Gn(), n = this.index.array, s = this.attributes;
25487
+ const t = new Hn(), n = this.index.array, s = this.attributes;
25466
25488
  for (const o in s) {
25467
25489
  const c = s[o], l = e(c, n);
25468
25490
  t.setAttribute(o, l);
@@ -25584,14 +25606,14 @@ class Gn extends ur {
25584
25606
  }
25585
25607
  }
25586
25608
  const kh = /* @__PURE__ */ new Vt(), ss = /* @__PURE__ */ new ty(), ga = /* @__PURE__ */ new Bd(), Ih = /* @__PURE__ */ new B(), va = /* @__PURE__ */ new B(), ba = /* @__PURE__ */ new B(), _a = /* @__PURE__ */ new B(), gc = /* @__PURE__ */ new B(), ya = /* @__PURE__ */ new B(), Dh = /* @__PURE__ */ new B(), Sa = /* @__PURE__ */ new B();
25587
- class zn extends Sn {
25609
+ class Gn extends Sn {
25588
25610
  /**
25589
25611
  * Constructs a new mesh.
25590
25612
  *
25591
25613
  * @param {BufferGeometry} [geometry] - The mesh geometry.
25592
25614
  * @param {Material|Array<Material>} [material] - The mesh material.
25593
25615
  */
25594
- constructor(e = new Gn(), t = new xm()) {
25616
+ constructor(e = new Hn(), t = new xm()) {
25595
25617
  super(), this.isMesh = !0, this.type = "Mesh", this.geometry = e, this.material = t, this.morphTargetDictionary = void 0, this.morphTargetInfluences = void 0, this.count = 1, this.updateMorphTargets();
25596
25618
  }
25597
25619
  copy(e, t) {
@@ -25685,7 +25707,7 @@ class zn extends Sn {
25685
25707
  }
25686
25708
  function uy(i, e, t, n, s, r, a, o) {
25687
25709
  let c;
25688
- if (e.side === nn ? c = n.intersectTriangle(a, r, s, !0, o) : c = n.intersectTriangle(s, r, a, e.side === Ei, o), c === null) return null;
25710
+ if (e.side === nn ? c = n.intersectTriangle(a, r, s, !0, o) : c = n.intersectTriangle(s, r, a, e.side === Mi, o), c === null) return null;
25689
25711
  Sa.copy(o), Sa.applyMatrix4(i.matrixWorld);
25690
25712
  const l = t.ray.origin.distanceTo(Sa);
25691
25713
  return l < t.near || l > t.far ? null : {
@@ -25699,7 +25721,7 @@ function xa(i, e, t, n, s, r, a, o, c, l) {
25699
25721
  const d = uy(i, e, t, n, va, ba, _a, Dh);
25700
25722
  if (d) {
25701
25723
  const u = new B();
25702
- On.getBarycoord(Dh, va, ba, _a, u), s && (d.uv = On.getInterpolatedAttribute(s, o, c, l, u, new st())), r && (d.uv1 = On.getInterpolatedAttribute(r, o, c, l, u, new st())), a && (d.normal = On.getInterpolatedAttribute(a, o, c, l, u, new B()), d.normal.dot(n.direction) > 0 && d.normal.multiplyScalar(-1));
25724
+ Fn.getBarycoord(Dh, va, ba, _a, u), s && (d.uv = Fn.getInterpolatedAttribute(s, o, c, l, u, new st())), r && (d.uv1 = Fn.getInterpolatedAttribute(r, o, c, l, u, new st())), a && (d.normal = Fn.getInterpolatedAttribute(a, o, c, l, u, new B()), d.normal.dot(n.direction) > 0 && d.normal.multiplyScalar(-1));
25703
25725
  const h = {
25704
25726
  a: o,
25705
25727
  b: c,
@@ -25707,11 +25729,11 @@ function xa(i, e, t, n, s, r, a, o, c, l) {
25707
25729
  normal: new B(),
25708
25730
  materialIndex: 0
25709
25731
  };
25710
- On.getNormal(va, ba, _a, h.normal), d.face = h, d.barycoord = u;
25732
+ Fn.getNormal(va, ba, _a, h.normal), d.face = h, d.barycoord = u;
25711
25733
  }
25712
25734
  return d;
25713
25735
  }
25714
- class ta extends Gn {
25736
+ class ta extends Hn {
25715
25737
  /**
25716
25738
  * Constructs a new box geometry.
25717
25739
  *
@@ -25872,7 +25894,7 @@ class Mm extends Sn {
25872
25894
  * Constructs a new camera.
25873
25895
  */
25874
25896
  constructor() {
25875
- super(), this.isCamera = !0, this.type = "Camera", this.matrixWorldInverse = new Vt(), this.projectionMatrix = new Vt(), this.projectionMatrixInverse = new Vt(), this.coordinateSystem = Jn, this._reversedDepth = !1;
25897
+ super(), this.isCamera = !0, this.type = "Camera", this.matrixWorldInverse = new Vt(), this.projectionMatrix = new Vt(), this.projectionMatrixInverse = new Vt(), this.coordinateSystem = Zn, this._reversedDepth = !1;
25876
25898
  }
25877
25899
  /**
25878
25900
  * The flag that indicates whether the camera uses a reversed depth buffer.
@@ -26105,7 +26127,7 @@ class gy extends Sn {
26105
26127
  updateCoordinateSystem() {
26106
26128
  const e = this.coordinateSystem, t = this.children.concat(), [n, s, r, a, o, c] = t;
26107
26129
  for (const l of t) this.remove(l);
26108
- if (e === Jn)
26130
+ if (e === Zn)
26109
26131
  n.up.set(0, 1, 0), n.lookAt(1, 0, 0), s.up.set(0, 1, 0), s.lookAt(-1, 0, 0), r.up.set(0, 0, -1), r.lookAt(0, 1, 0), a.up.set(0, 0, 1), a.lookAt(0, -1, 0), o.up.set(0, 1, 0), o.lookAt(0, 0, 1), c.up.set(0, 1, 0), c.lookAt(0, 0, -1);
26110
26132
  else if (e === ro)
26111
26133
  n.up.set(0, -1, 0), n.lookAt(-1, 0, 0), s.up.set(0, -1, 0), s.lookAt(1, 0, 0), r.up.set(0, 0, 1), r.lookAt(0, 1, 0), a.up.set(0, 0, -1), a.lookAt(0, -1, 0), o.up.set(0, -1, 0), o.lookAt(0, 0, 1), c.up.set(0, -1, 0), c.lookAt(0, 0, -1);
@@ -26161,7 +26183,7 @@ class wm extends sn {
26161
26183
  this.image = e;
26162
26184
  }
26163
26185
  }
26164
- class Am extends ei {
26186
+ class Am extends ti {
26165
26187
  /**
26166
26188
  * Constructs a new cube render target.
26167
26189
  *
@@ -26235,10 +26257,10 @@ class Am extends ei {
26235
26257
  vertexShader: n.vertexShader,
26236
26258
  fragmentShader: n.fragmentShader,
26237
26259
  side: nn,
26238
- blending: xi
26260
+ blending: Ti
26239
26261
  });
26240
26262
  r.uniforms.tEquirect.value = t;
26241
- const a = new zn(s, r), o = t.minFilter;
26263
+ const a = new Gn(s, r), o = t.minFilter;
26242
26264
  return t.minFilter === ps && (t.minFilter = Qt), new gy(1, 10, this).update(e, a), t.minFilter = o, a.geometry.dispose(), a.material.dispose(), this;
26243
26265
  }
26244
26266
  /**
@@ -26384,7 +26406,7 @@ class by extends Sn {
26384
26406
  * Constructs a new scene.
26385
26407
  */
26386
26408
  constructor() {
26387
- super(), this.isScene = !0, this.type = "Scene", this.background = null, this.environment = null, this.fog = null, this.backgroundBlurriness = 0, this.backgroundIntensity = 1, this.backgroundRotation = new Ai(), this.environmentIntensity = 1, this.environmentRotation = new Ai(), this.overrideMaterial = null, typeof __THREE_DEVTOOLS__ < "u" && __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe", { detail: this }));
26409
+ super(), this.isScene = !0, this.type = "Scene", this.background = null, this.environment = null, this.fog = null, this.backgroundBlurriness = 0, this.backgroundIntensity = 1, this.backgroundRotation = new Ri(), this.environmentIntensity = 1, this.environmentRotation = new Ri(), this.overrideMaterial = null, typeof __THREE_DEVTOOLS__ < "u" && __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe", { detail: this }));
26388
26410
  }
26389
26411
  copy(e, t) {
26390
26412
  return super.copy(e, t), e.background !== null && (this.background = e.background.clone()), e.environment !== null && (this.environment = e.environment.clone()), e.fog !== null && (this.fog = e.fog.clone()), this.backgroundBlurriness = e.backgroundBlurriness, this.backgroundIntensity = e.backgroundIntensity, this.backgroundRotation.copy(e.backgroundRotation), this.environmentIntensity = e.environmentIntensity, this.environmentRotation.copy(e.environmentRotation), e.overrideMaterial !== null && (this.overrideMaterial = e.overrideMaterial.clone()), this.matrixAutoUpdate = e.matrixAutoUpdate, this;
@@ -26676,11 +26698,11 @@ class Rm {
26676
26698
  * @param {boolean} [reversedDepth=false] - Whether to use a reversed depth.
26677
26699
  * @return {Frustum} A reference to this frustum.
26678
26700
  */
26679
- setFromProjectionMatrix(e, t = Jn, n = !1) {
26701
+ setFromProjectionMatrix(e, t = Zn, n = !1) {
26680
26702
  const s = this.planes, r = e.elements, a = r[0], o = r[1], c = r[2], l = r[3], d = r[4], u = r[5], h = r[6], f = r[7], g = r[8], v = r[9], m = r[10], p = r[11], x = r[12], C = r[13], b = r[14], S = r[15];
26681
26703
  if (s[0].setComponents(l - a, f - d, p - g, S - x).normalize(), s[1].setComponents(l + a, f + d, p + g, S + x).normalize(), s[2].setComponents(l + o, f + u, p + v, S + C).normalize(), s[3].setComponents(l - o, f - u, p - v, S - C).normalize(), n)
26682
26704
  s[4].setComponents(c, h, m, b).normalize(), s[5].setComponents(l - c, f - h, p - m, S - b).normalize();
26683
- else if (s[4].setComponents(l - c, f - h, p - m, S - b).normalize(), t === Jn)
26705
+ else if (s[4].setComponents(l - c, f - h, p - m, S - b).normalize(), t === Zn)
26684
26706
  s[5].setComponents(l + c, f + h, p + m, S + b).normalize();
26685
26707
  else if (t === ro)
26686
26708
  s[5].setComponents(c, h, m, b).normalize();
@@ -26782,8 +26804,8 @@ class Kr extends sn {
26782
26804
  * @param {number} [format=DepthFormat] - The texture format.
26783
26805
  * @param {number} [depth=1] - The depth of the texture.
26784
26806
  */
26785
- constructor(e, t, n = si, s, r, a, o = Yt, c = Yt, l, d = wi, u = 1) {
26786
- if (d !== wi && d !== ms)
26807
+ constructor(e, t, n = ri, s, r, a, o = Yt, c = Yt, l, d = Ai, u = 1) {
26808
+ if (d !== Ai && d !== ms)
26787
26809
  throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");
26788
26810
  const h = { width: e, height: t, depth: u };
26789
26811
  super(h, s, r, a, o, c, d, n, l), this.isDepthTexture = !0, this.flipY = !1, this.generateMipmaps = !1, this.compareFunction = null;
@@ -26810,7 +26832,7 @@ class Ty extends Kr {
26810
26832
  * @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value.
26811
26833
  * @param {number} [format=DepthFormat] - The texture format.
26812
26834
  */
26813
- constructor(e, t = si, n = Ts, s, r, a = Yt, o = Yt, c, l = wi) {
26835
+ constructor(e, t = ri, n = Ts, s, r, a = Yt, o = Yt, c, l = Ai) {
26814
26836
  const d = { width: e, height: e, depth: 1 }, u = [d, d, d, d, d, d];
26815
26837
  super(e, e, t, n, s, r, a, o, c, l), this.image = u, this.isCubeDepthTexture = !0, this.isCubeTexture = !0;
26816
26838
  }
@@ -26839,7 +26861,7 @@ class Pm extends sn {
26839
26861
  return super.copy(e), this.sourceTexture = e.sourceTexture, this;
26840
26862
  }
26841
26863
  }
26842
- class Vd extends Gn {
26864
+ class Vd extends Hn {
26843
26865
  /**
26844
26866
  * Constructs a new polyhedron geometry.
26845
26867
  *
@@ -27058,7 +27080,7 @@ class zd extends Vd {
27058
27080
  return new zd(e.radius, e.detail);
27059
27081
  }
27060
27082
  }
27061
- class bo extends Gn {
27083
+ class bo extends Hn {
27062
27084
  /**
27063
27085
  * Constructs a new plane geometry.
27064
27086
  *
@@ -27103,7 +27125,7 @@ class bo extends Gn {
27103
27125
  return new bo(e.width, e.height, e.widthSegments, e.heightSegments);
27104
27126
  }
27105
27127
  }
27106
- class Gd extends Gn {
27128
+ class Gd extends Hn {
27107
27129
  /**
27108
27130
  * Constructs a new sphere geometry.
27109
27131
  *
@@ -27344,7 +27366,7 @@ function Uh(i, e, t, n) {
27344
27366
  return i * e * 2 / s.components * s.byteLength;
27345
27367
  case gm:
27346
27368
  return i * e * 3 / s.components * s.byteLength;
27347
- case Bn:
27369
+ case Vn:
27348
27370
  return i * e * 4 / s.components * s.byteLength;
27349
27371
  case Nd:
27350
27372
  return i * e * 4 / s.components * s.byteLength;
@@ -27425,14 +27447,14 @@ function Ry(i) {
27425
27447
  return { byteLength: 1, components: 1 };
27426
27448
  case jr:
27427
27449
  case hm:
27428
- case Mi:
27450
+ case wi:
27429
27451
  return { byteLength: 2, components: 1 };
27430
27452
  case kd:
27431
27453
  case Id:
27432
27454
  return { byteLength: 2, components: 4 };
27433
- case si:
27455
+ case ri:
27434
27456
  case Pd:
27435
- case Yn:
27457
+ case Jn:
27436
27458
  return { byteLength: 4, components: 1 };
27437
27459
  case fm:
27438
27460
  case pm:
@@ -31437,7 +31459,7 @@ void main() {
31437
31459
  alphaMapTransform: { value: /* @__PURE__ */ new ze() },
31438
31460
  alphaTest: { value: 0 }
31439
31461
  }
31440
- }, Xn = {
31462
+ }, $n = {
31441
31463
  basic: {
31442
31464
  uniforms: /* @__PURE__ */ tn([
31443
31465
  me.common,
@@ -31661,9 +31683,9 @@ void main() {
31661
31683
  fragmentShader: Ge.shadow_frag
31662
31684
  }
31663
31685
  };
31664
- Xn.physical = {
31686
+ $n.physical = {
31665
31687
  uniforms: /* @__PURE__ */ tn([
31666
- Xn.standard.uniforms,
31688
+ $n.standard.uniforms,
31667
31689
  {
31668
31690
  clearcoat: { value: 0 },
31669
31691
  clearcoatMap: { value: null },
@@ -31714,7 +31736,7 @@ Xn.physical = {
31714
31736
  vertexShader: Ge.meshphysical_vert,
31715
31737
  fragmentShader: Ge.meshphysical_frag
31716
31738
  };
31717
- const Ea = { r: 0, b: 0, g: 0 }, as = /* @__PURE__ */ new Ai(), dT = /* @__PURE__ */ new Vt();
31739
+ const Ea = { r: 0, b: 0, g: 0 }, as = /* @__PURE__ */ new Ri(), dT = /* @__PURE__ */ new Vt();
31718
31740
  function uT(i, e, t, n, s, r, a) {
31719
31741
  const o = new Je(0);
31720
31742
  let c = r === !0 ? 0 : 1, l, d, u = null, h = 0, f = null;
@@ -31731,13 +31753,13 @@ function uT(i, e, t, n, s, r, a) {
31731
31753
  }
31732
31754
  function m(C, b) {
31733
31755
  const S = g(b);
31734
- S && (S.isCubeTexture || S.mapping === go) ? (d === void 0 && (d = new zn(
31756
+ S && (S.isCubeTexture || S.mapping === go) ? (d === void 0 && (d = new Gn(
31735
31757
  new ta(1, 1, 1),
31736
31758
  new wn({
31737
31759
  name: "BackgroundCubeMaterial",
31738
- uniforms: dr(Xn.backgroundCube.uniforms),
31739
- vertexShader: Xn.backgroundCube.vertexShader,
31740
- fragmentShader: Xn.backgroundCube.fragmentShader,
31760
+ uniforms: dr($n.backgroundCube.uniforms),
31761
+ vertexShader: $n.backgroundCube.vertexShader,
31762
+ fragmentShader: $n.backgroundCube.fragmentShader,
31741
31763
  side: nn,
31742
31764
  depthTest: !1,
31743
31765
  depthWrite: !1,
@@ -31750,14 +31772,14 @@ function uT(i, e, t, n, s, r, a) {
31750
31772
  get: function() {
31751
31773
  return this.uniforms.envMap.value;
31752
31774
  }
31753
- }), s.update(d)), as.copy(b.backgroundRotation), as.x *= -1, as.y *= -1, as.z *= -1, S.isCubeTexture && S.isRenderTargetTexture === !1 && (as.y *= -1, as.z *= -1), d.material.uniforms.envMap.value = S, d.material.uniforms.flipEnvMap.value = S.isCubeTexture && S.isRenderTargetTexture === !1 ? -1 : 1, d.material.uniforms.backgroundBlurriness.value = b.backgroundBlurriness, d.material.uniforms.backgroundIntensity.value = b.backgroundIntensity, d.material.uniforms.backgroundRotation.value.setFromMatrix4(dT.makeRotationFromEuler(as)), d.material.toneMapped = Qe.getTransfer(S.colorSpace) !== lt, (u !== S || h !== S.version || f !== i.toneMapping) && (d.material.needsUpdate = !0, u = S, h = S.version, f = i.toneMapping), d.layers.enableAll(), C.unshift(d, d.geometry, d.material, 0, 0, null)) : S && S.isTexture && (l === void 0 && (l = new zn(
31775
+ }), s.update(d)), as.copy(b.backgroundRotation), as.x *= -1, as.y *= -1, as.z *= -1, S.isCubeTexture && S.isRenderTargetTexture === !1 && (as.y *= -1, as.z *= -1), d.material.uniforms.envMap.value = S, d.material.uniforms.flipEnvMap.value = S.isCubeTexture && S.isRenderTargetTexture === !1 ? -1 : 1, d.material.uniforms.backgroundBlurriness.value = b.backgroundBlurriness, d.material.uniforms.backgroundIntensity.value = b.backgroundIntensity, d.material.uniforms.backgroundRotation.value.setFromMatrix4(dT.makeRotationFromEuler(as)), d.material.toneMapped = Qe.getTransfer(S.colorSpace) !== ht, (u !== S || h !== S.version || f !== i.toneMapping) && (d.material.needsUpdate = !0, u = S, h = S.version, f = i.toneMapping), d.layers.enableAll(), C.unshift(d, d.geometry, d.material, 0, 0, null)) : S && S.isTexture && (l === void 0 && (l = new Gn(
31754
31776
  new bo(2, 2),
31755
31777
  new wn({
31756
31778
  name: "BackgroundMaterial",
31757
- uniforms: dr(Xn.background.uniforms),
31758
- vertexShader: Xn.background.vertexShader,
31759
- fragmentShader: Xn.background.fragmentShader,
31760
- side: Ei,
31779
+ uniforms: dr($n.background.uniforms),
31780
+ vertexShader: $n.background.vertexShader,
31781
+ fragmentShader: $n.background.fragmentShader,
31782
+ side: Mi,
31761
31783
  depthTest: !1,
31762
31784
  depthWrite: !1,
31763
31785
  fog: !1,
@@ -31767,7 +31789,7 @@ function uT(i, e, t, n, s, r, a) {
31767
31789
  get: function() {
31768
31790
  return this.uniforms.t2D.value;
31769
31791
  }
31770
- }), s.update(l)), l.material.uniforms.t2D.value = S, l.material.uniforms.backgroundIntensity.value = b.backgroundIntensity, l.material.toneMapped = Qe.getTransfer(S.colorSpace) !== lt, S.matrixAutoUpdate === !0 && S.updateMatrix(), l.material.uniforms.uvTransform.value.copy(S.matrix), (u !== S || h !== S.version || f !== i.toneMapping) && (l.material.needsUpdate = !0, u = S, h = S.version, f = i.toneMapping), l.layers.enableAll(), C.unshift(l, l.geometry, l.material, 0, 0, null));
31792
+ }), s.update(l)), l.material.uniforms.t2D.value = S, l.material.uniforms.backgroundIntensity.value = b.backgroundIntensity, l.material.toneMapped = Qe.getTransfer(S.colorSpace) !== ht, S.matrixAutoUpdate === !0 && S.updateMatrix(), l.material.uniforms.uvTransform.value.copy(S.matrix), (u !== S || h !== S.version || f !== i.toneMapping) && (l.material.needsUpdate = !0, u = S, h = S.version, f = i.toneMapping), l.layers.enableAll(), C.unshift(l, l.geometry, l.material, 0, 0, null));
31771
31793
  }
31772
31794
  function p(C, b) {
31773
31795
  C.getRGB(Ea, Em(i)), n.buffers.color.setClear(Ea.r, Ea.g, Ea.b, b, a);
@@ -32053,12 +32075,12 @@ function pT(i, e, t, n) {
32053
32075
  return s;
32054
32076
  }
32055
32077
  function a(A) {
32056
- return !(A !== Bn && n.convert(A) !== i.getParameter(i.IMPLEMENTATION_COLOR_READ_FORMAT));
32078
+ return !(A !== Vn && n.convert(A) !== i.getParameter(i.IMPLEMENTATION_COLOR_READ_FORMAT));
32057
32079
  }
32058
32080
  function o(A) {
32059
- const k = A === Mi && (e.has("EXT_color_buffer_half_float") || e.has("EXT_color_buffer_float"));
32081
+ const k = A === wi && (e.has("EXT_color_buffer_half_float") || e.has("EXT_color_buffer_float"));
32060
32082
  return !(A !== Mn && n.convert(A) !== i.getParameter(i.IMPLEMENTATION_COLOR_READ_TYPE) && // Edge and Chrome Mac < 52 (#9513)
32061
- A !== Yn && !k);
32083
+ A !== Jn && !k);
32062
32084
  }
32063
32085
  function c(A) {
32064
32086
  if (A === "highp") {
@@ -32281,8 +32303,8 @@ class Bh {
32281
32303
  magFilter: Qt,
32282
32304
  minFilter: Qt,
32283
32305
  generateMipmaps: !1,
32284
- type: Mi,
32285
- format: Bn,
32306
+ type: wi,
32307
+ format: Vn,
32286
32308
  colorSpace: lr,
32287
32309
  depthBuffer: !1
32288
32310
  }, s = Vh(e, t, n);
@@ -32294,12 +32316,12 @@ class Bh {
32294
32316
  return s;
32295
32317
  }
32296
32318
  _compileMaterial(e) {
32297
- const t = new zn(new Gn(), e);
32319
+ const t = new Gn(new Hn(), e);
32298
32320
  this._renderer.compile(t, Mr);
32299
32321
  }
32300
32322
  _sceneToCubeUV(e, t, n, s, r) {
32301
32323
  const c = new En(90, 1, t, n), l = [1, -1, 1, 1, 1, 1], d = [1, 1, 1, -1, -1, -1], u = this._renderer, h = u.autoClear, f = u.toneMapping;
32302
- u.getClearColor(Fh), u.toneMapping = Qn, u.autoClear = !1, u.state.buffers.depth.getReversed() && (u.setRenderTarget(s), u.clearDepth(), u.setRenderTarget(null)), this._backgroundBox === null && (this._backgroundBox = new zn(
32324
+ u.getClearColor(Fh), u.toneMapping = ei, u.autoClear = !1, u.state.buffers.depth.getReversed() && (u.setRenderTarget(s), u.clearDepth(), u.setRenderTarget(null)), this._backgroundBox === null && (this._backgroundBox = new Gn(
32303
32325
  new ta(),
32304
32326
  new xm({
32305
32327
  name: "PMREM.Background",
@@ -32450,13 +32472,13 @@ function _T(i) {
32450
32472
  const T = [M, M, M, M, M, M];
32451
32473
  b.set(T, p * g * M);
32452
32474
  }
32453
- const S = new Gn();
32454
- S.setAttribute("position", new ti(x, v)), S.setAttribute("uv", new ti(C, m)), S.setAttribute("faceIndex", new ti(b, p)), n.push(new zn(S, null)), s > ji && s--;
32475
+ const S = new Hn();
32476
+ S.setAttribute("position", new ni(x, v)), S.setAttribute("uv", new ni(C, m)), S.setAttribute("faceIndex", new ni(b, p)), n.push(new Gn(S, null)), s > ji && s--;
32455
32477
  }
32456
32478
  return { lodMeshes: n, sizeLods: e, sigmas: t };
32457
32479
  }
32458
32480
  function Vh(i, e, t) {
32459
- const n = new ei(i, e, t);
32481
+ const n = new ti(i, e, t);
32460
32482
  return n.texture.mapping = go, n.texture.name = "PMREM.cubeUv", n.scissorTest = !0, n;
32461
32483
  }
32462
32484
  function Gs(i, e, t, n, s) {
@@ -32589,7 +32611,7 @@ function yT(i, e, t) {
32589
32611
  }
32590
32612
  `
32591
32613
  ),
32592
- blending: xi,
32614
+ blending: Ti,
32593
32615
  depthTest: !1,
32594
32616
  depthWrite: !1
32595
32617
  });
@@ -32678,7 +32700,7 @@ function ST(i, e, t) {
32678
32700
  }
32679
32701
  `
32680
32702
  ),
32681
- blending: xi,
32703
+ blending: Ti,
32682
32704
  depthTest: !1,
32683
32705
  depthWrite: !1
32684
32706
  });
@@ -32713,7 +32735,7 @@ function zh() {
32713
32735
  }
32714
32736
  `
32715
32737
  ),
32716
- blending: xi,
32738
+ blending: Ti,
32717
32739
  depthTest: !1,
32718
32740
  depthWrite: !1
32719
32741
  });
@@ -32746,7 +32768,7 @@ function Gh() {
32746
32768
  }
32747
32769
  `
32748
32770
  ),
32749
- blending: xi,
32771
+ blending: Ti,
32750
32772
  depthTest: !1,
32751
32773
  depthWrite: !1
32752
32774
  });
@@ -33032,7 +33054,7 @@ function wT(i, e, t) {
33032
33054
  let b = o.attributes.position.count * C, S = 1;
33033
33055
  b > e.maxTextureSize && (S = Math.ceil(b / e.maxTextureSize), b = e.maxTextureSize);
33034
33056
  const M = new Float32Array(b * S * 4 * u), A = new _m(M, b, S, u);
33035
- A.type = Yn, A.needsUpdate = !0;
33057
+ A.type = Jn, A.needsUpdate = !0;
33036
33058
  const k = C * 4;
33037
33059
  for (let T = 0; T < u; T++) {
33038
33060
  const R = m[T], U = p[T], F = x[T], q = b * S * 4 * T;
@@ -33094,15 +33116,15 @@ const RT = {
33094
33116
  [om]: "CUSTOM_TONE_MAPPING"
33095
33117
  };
33096
33118
  function PT(i, e, t, n, s) {
33097
- const r = new ei(e, t, {
33119
+ const r = new ti(e, t, {
33098
33120
  type: i,
33099
33121
  depthBuffer: n,
33100
33122
  stencilBuffer: s
33101
- }), a = new ei(e, t, {
33102
- type: Mi,
33123
+ }), a = new ti(e, t, {
33124
+ type: wi,
33103
33125
  depthBuffer: !1,
33104
33126
  stencilBuffer: !1
33105
- }), o = new Gn();
33127
+ }), o = new Hn();
33106
33128
  o.setAttribute("position", new rn([-1, 3, 0, -1, -1, 0, 3, -1, 0], 3)), o.setAttribute("uv", new rn([0, 2, 0, 0, 2, 0], 2));
33107
33129
  const c = new Cy({
33108
33130
  uniforms: {
@@ -33164,7 +33186,7 @@ function PT(i, e, t, n, s) {
33164
33186
  ),
33165
33187
  depthTest: !1,
33166
33188
  depthWrite: !1
33167
- }), l = new zn(o, c), d = new km(-1, 1, 1, -1, 0, 1);
33189
+ }), l = new Gn(o, c), d = new km(-1, 1, 1, -1, 0, 1);
33168
33190
  let u = null, h = null, f = !1, g, v = null, m = [], p = !1;
33169
33191
  this.setSize = function(x, C) {
33170
33192
  r.setSize(x, C), a.setSize(x, C);
@@ -33180,12 +33202,12 @@ function PT(i, e, t, n, s) {
33180
33202
  M.setSize && M.setSize(C, b);
33181
33203
  }
33182
33204
  }, this.begin = function(x, C) {
33183
- if (f || x.toneMapping === Qn && m.length === 0) return !1;
33205
+ if (f || x.toneMapping === ei && m.length === 0) return !1;
33184
33206
  if (v = C, C !== null) {
33185
33207
  const b = C.width, S = C.height;
33186
33208
  (r.width !== b || r.height !== S) && this.setSize(b, S);
33187
33209
  }
33188
- return p === !1 && x.setRenderTarget(r), g = x.toneMapping, x.toneMapping = Qn, !0;
33210
+ return p === !1 && x.setRenderTarget(r), g = x.toneMapping, x.toneMapping = ei, !0;
33189
33211
  }, this.hasRenderPass = function() {
33190
33212
  return p;
33191
33213
  }, this.end = function(x, C) {
@@ -33199,7 +33221,7 @@ function PT(i, e, t, n, s) {
33199
33221
  }
33200
33222
  }
33201
33223
  if (u !== x.outputColorSpace || h !== x.toneMapping) {
33202
- u = x.outputColorSpace, h = x.toneMapping, c.defines = {}, Qe.getTransfer(u) === lt && (c.defines.SRGB_TRANSFER = "");
33224
+ u = x.outputColorSpace, h = x.toneMapping, c.defines = {}, Qe.getTransfer(u) === ht && (c.defines.SRGB_TRANSFER = "");
33203
33225
  const M = RT[h];
33204
33226
  M && (c.defines[M] = ""), c.needsUpdate = !0;
33205
33227
  }
@@ -33730,7 +33752,7 @@ function CC(i) {
33730
33752
  switch (Qe.getTransfer(i)) {
33731
33753
  case so:
33732
33754
  return [e, "LinearTransferOETF"];
33733
- case lt:
33755
+ case ht:
33734
33756
  return [e, "sRGBTransferOETF"];
33735
33757
  default:
33736
33758
  return Oe("WebGLProgram: Unsupported color space: ", i), [e, "LinearTransferOETF"];
@@ -34129,10 +34151,10 @@ function jC(i, e, t, n) {
34129
34151
  "uniform mat4 viewMatrix;",
34130
34152
  "uniform vec3 cameraPosition;",
34131
34153
  "uniform bool isOrthographic;",
34132
- t.toneMapping !== Qn ? "#define TONE_MAPPING" : "",
34133
- t.toneMapping !== Qn ? Ge.tonemapping_pars_fragment : "",
34154
+ t.toneMapping !== ei ? "#define TONE_MAPPING" : "",
34155
+ t.toneMapping !== ei ? Ge.tonemapping_pars_fragment : "",
34134
34156
  // this code is required here because it is used by the toneMapping() function defined below
34135
- t.toneMapping !== Qn ? wC("toneMapping", t.toneMapping) : "",
34157
+ t.toneMapping !== ei ? wC("toneMapping", t.toneMapping) : "",
34136
34158
  t.dithering ? "#define DITHERING" : "",
34137
34159
  t.opaque ? "#define OPAQUE" : "",
34138
34160
  Ge.colorspace_pars_fragment,
@@ -34292,12 +34314,12 @@ function YC(i, e, t, n, s, r, a) {
34292
34314
  K.morphAttributes.position !== void 0 && (Be = 1), K.morphAttributes.normal !== void 0 && (Be = 2), K.morphAttributes.color !== void 0 && (Be = 3);
34293
34315
  let Fe, Et, ft, $;
34294
34316
  if (ge) {
34295
- const ot = Xn[ge];
34296
- Fe = ot.vertexShader, Et = ot.fragmentShader;
34317
+ const dt = $n[ge];
34318
+ Fe = dt.vertexShader, Et = dt.fragmentShader;
34297
34319
  } else
34298
34320
  Fe = y.vertexShader, Et = y.fragmentShader, c.update(y), ft = c.getVertexShaderID(y), $ = c.getFragmentShaderID(y);
34299
- const ne = i.getRenderTarget(), Te = i.state.buffers.depth.getReversed(), Ve = F.isInstancedMesh === !0, Me = F.isBatchedMesh === !0, et = !!y.map, Wt = !!y.matcap, Ze = !!W, at = !!y.aoMap, gt = !!y.lightMap, He = !!y.bumpMap, Nt = !!y.normalMap, I = !!y.displacementMap, Ut = !!y.emissiveMap, rt = !!y.metalnessMap, xt = !!y.roughnessMap, Ae = y.anisotropy > 0, w = y.clearcoat > 0, _ = y.dispersion > 0, L = y.iridescence > 0, X = y.sheen > 0, Q = y.transmission > 0, j = Ae && !!y.anisotropyMap, Pe = w && !!y.clearcoatMap, ue = w && !!y.clearcoatNormalMap, we = w && !!y.clearcoatRoughnessMap, Ne = L && !!y.iridescenceMap, se = L && !!y.iridescenceThicknessMap, fe = X && !!y.sheenColorMap, Ee = X && !!y.sheenRoughnessMap, Re = !!y.specularMap, he = !!y.specularColorMap, We = !!y.specularIntensityMap, D = Q && !!y.transmissionMap, _e = Q && !!y.thicknessMap, ae = !!y.gradientMap, Se = !!y.alphaMap, ie = y.alphaTest > 0, Y = !!y.alphaHash, de = !!y.extensions;
34300
- let Ue = Qn;
34321
+ const ne = i.getRenderTarget(), Te = i.state.buffers.depth.getReversed(), Ve = F.isInstancedMesh === !0, Me = F.isBatchedMesh === !0, et = !!y.map, Wt = !!y.matcap, Ze = !!W, lt = !!y.aoMap, _t = !!y.lightMap, He = !!y.bumpMap, Nt = !!y.normalMap, I = !!y.displacementMap, Ut = !!y.emissiveMap, rt = !!y.metalnessMap, xt = !!y.roughnessMap, Ae = y.anisotropy > 0, w = y.clearcoat > 0, _ = y.dispersion > 0, L = y.iridescence > 0, X = y.sheen > 0, Q = y.transmission > 0, j = Ae && !!y.anisotropyMap, Pe = w && !!y.clearcoatMap, ue = w && !!y.clearcoatNormalMap, we = w && !!y.clearcoatRoughnessMap, Ne = L && !!y.iridescenceMap, se = L && !!y.iridescenceThicknessMap, fe = X && !!y.sheenColorMap, Ee = X && !!y.sheenRoughnessMap, Re = !!y.specularMap, he = !!y.specularColorMap, We = !!y.specularIntensityMap, D = Q && !!y.transmissionMap, _e = Q && !!y.thicknessMap, ae = !!y.gradientMap, Se = !!y.alphaMap, ie = y.alphaTest > 0, Y = !!y.alphaHash, de = !!y.extensions;
34322
+ let Ue = ei;
34301
34323
  y.toneMapped && (ne === null || ne.isXRRenderTarget === !0) && (Ue = i.toneMapping);
34302
34324
  const Tt = {
34303
34325
  shaderID: ge,
@@ -34323,8 +34345,8 @@ function YC(i, e, t, n, s, r, a) {
34323
34345
  envMap: Ze,
34324
34346
  envMapMode: Ze && W.mapping,
34325
34347
  envMapCubeUVHeight: ee,
34326
- aoMap: at,
34327
- lightMap: gt,
34348
+ aoMap: lt,
34349
+ lightMap: _t,
34328
34350
  bumpMap: He,
34329
34351
  normalMap: Nt,
34330
34352
  displacementMap: I,
@@ -34360,8 +34382,8 @@ function YC(i, e, t, n, s, r, a) {
34360
34382
  combine: y.combine,
34361
34383
  //
34362
34384
  mapUv: et && v(y.map.channel),
34363
- aoMapUv: at && v(y.aoMap.channel),
34364
- lightMapUv: gt && v(y.lightMap.channel),
34385
+ aoMapUv: lt && v(y.aoMap.channel),
34386
+ lightMapUv: _t && v(y.lightMap.channel),
34365
34387
  bumpMapUv: He && v(y.bumpMap.channel),
34366
34388
  normalMapUv: Nt && v(y.normalMap.channel),
34367
34389
  displacementMapUv: I && v(y.displacementMap.channel),
@@ -34417,10 +34439,10 @@ function YC(i, e, t, n, s, r, a) {
34417
34439
  shadowMapEnabled: i.shadowMap.enabled && R.length > 0,
34418
34440
  shadowMapType: i.shadowMap.type,
34419
34441
  toneMapping: Ue,
34420
- decodeVideoTexture: et && y.map.isVideoTexture === !0 && Qe.getTransfer(y.map.colorSpace) === lt,
34421
- decodeVideoTextureEmissive: Ut && y.emissiveMap.isVideoTexture === !0 && Qe.getTransfer(y.emissiveMap.colorSpace) === lt,
34442
+ decodeVideoTexture: et && y.map.isVideoTexture === !0 && Qe.getTransfer(y.map.colorSpace) === ht,
34443
+ decodeVideoTextureEmissive: Ut && y.emissiveMap.isVideoTexture === !0 && Qe.getTransfer(y.emissiveMap.colorSpace) === ht,
34422
34444
  premultipliedAlpha: y.premultipliedAlpha,
34423
- doubleSided: y.side === yi,
34445
+ doubleSided: y.side === Si,
34424
34446
  flipSided: y.side === nn,
34425
34447
  useDepthPacking: y.depthPacking >= 0,
34426
34448
  depthPacking: y.depthPacking || 0,
@@ -34449,7 +34471,7 @@ function YC(i, e, t, n, s, r, a) {
34449
34471
  const T = g[y.type];
34450
34472
  let R;
34451
34473
  if (T) {
34452
- const U = Xn[T];
34474
+ const U = $n[T];
34453
34475
  R = fy.clone(U.uniforms);
34454
34476
  } else
34455
34477
  R = y.uniforms;
@@ -34887,7 +34909,7 @@ void main() {
34887
34909
  ], af = /* @__PURE__ */ new Vt(), wr = /* @__PURE__ */ new B(), Cc = /* @__PURE__ */ new B();
34888
34910
  function dE(i, e, t) {
34889
34911
  let n = new Rm();
34890
- const s = new st(), r = new st(), a = new Lt(), o = new Ey(), c = new My(), l = {}, d = t.maxTextureSize, u = { [Ei]: nn, [nn]: Ei, [yi]: yi }, h = new wn({
34912
+ const s = new st(), r = new st(), a = new Lt(), o = new Ey(), c = new My(), l = {}, d = t.maxTextureSize, u = { [Mi]: nn, [nn]: Mi, [Si]: Si }, h = new wn({
34891
34913
  defines: {
34892
34914
  VSM_SAMPLES: 8
34893
34915
  },
@@ -34900,22 +34922,22 @@ function dE(i, e, t) {
34900
34922
  fragmentShader: oE
34901
34923
  }), f = h.clone();
34902
34924
  f.defines.HORIZONTAL_PASS = 1;
34903
- const g = new Gn();
34925
+ const g = new Hn();
34904
34926
  g.setAttribute(
34905
34927
  "position",
34906
- new ti(
34928
+ new ni(
34907
34929
  new Float32Array([-1, -1, 0.5, 3, -1, 0.5, -1, 3, 0.5]),
34908
34930
  3
34909
34931
  )
34910
34932
  );
34911
- const v = new zn(g, h), m = this;
34933
+ const v = new Gn(g, h), m = this;
34912
34934
  this.enabled = !1, this.autoUpdate = !0, this.needsUpdate = !1, this.type = za;
34913
34935
  let p = this.type;
34914
34936
  this.render = function(M, A, k) {
34915
34937
  if (m.enabled === !1 || m.autoUpdate === !1 && m.needsUpdate === !1 || M.length === 0) return;
34916
34938
  M.type === p_ && (Oe("WebGLShadowMap: PCFSoftShadowMap has been deprecated. Using PCFShadowMap instead."), M.type = za);
34917
34939
  const y = i.getRenderTarget(), T = i.getActiveCubeFace(), R = i.getActiveMipmapLevel(), U = i.state;
34918
- U.setBlending(xi), U.buffers.depth.getReversed() === !0 ? U.buffers.color.setClear(0, 0, 0, 0) : U.buffers.color.setClear(1, 1, 1, 1), U.buffers.depth.setTest(!0), U.setScissorTest(!1);
34940
+ U.setBlending(Ti), U.buffers.depth.getReversed() === !0 ? U.buffers.color.setClear(0, 0, 0, 0) : U.buffers.color.setClear(1, 1, 1, 1), U.buffers.depth.setTest(!0), U.setScissorTest(!1);
34919
34941
  const F = p !== this.type;
34920
34942
  F && A.traverse(function(q) {
34921
34943
  q.material && (Array.isArray(q.material) ? q.material.forEach((K) => K.needsUpdate = !0) : q.material.needsUpdate = !0);
@@ -34935,15 +34957,15 @@ function dE(i, e, t) {
34935
34957
  Oe("WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.");
34936
34958
  continue;
34937
34959
  }
34938
- W.map = new ei(s.x, s.y, {
34960
+ W.map = new ti(s.x, s.y, {
34939
34961
  format: cr,
34940
- type: Mi,
34962
+ type: wi,
34941
34963
  minFilter: Qt,
34942
34964
  magFilter: Qt,
34943
34965
  generateMipmaps: !1
34944
- }), W.map.texture.name = H.name + ".shadowMap", W.map.depthTexture = new Kr(s.x, s.y, Yn), W.map.depthTexture.name = H.name + ".shadowMapDepth", W.map.depthTexture.format = wi, W.map.depthTexture.compareFunction = null, W.map.depthTexture.minFilter = Yt, W.map.depthTexture.magFilter = Yt;
34966
+ }), W.map.texture.name = H.name + ".shadowMap", W.map.depthTexture = new Kr(s.x, s.y, Jn), W.map.depthTexture.name = H.name + ".shadowMapDepth", W.map.depthTexture.format = Ai, W.map.depthTexture.compareFunction = null, W.map.depthTexture.minFilter = Yt, W.map.depthTexture.magFilter = Yt;
34945
34967
  } else {
34946
- H.isPointLight ? (W.map = new Am(s.x), W.map.depthTexture = new Ty(s.x, si)) : (W.map = new ei(s.x, s.y), W.map.depthTexture = new Kr(s.x, s.y, si)), W.map.depthTexture.name = H.name + ".shadowMap", W.map.depthTexture.format = wi;
34968
+ H.isPointLight ? (W.map = new Am(s.x), W.map.depthTexture = new Ty(s.x, ri)) : (W.map = new ti(s.x, s.y), W.map.depthTexture = new Kr(s.x, s.y, ri)), W.map.depthTexture.name = H.name + ".shadowMap", W.map.depthTexture.format = Ai;
34947
34969
  const le = i.state.buffers.depth.getReversed();
34948
34970
  this.type === za ? (W.map.depthTexture.compareFunction = le ? Od : Ud, W.map.depthTexture.minFilter = Qt, W.map.depthTexture.magFilter = Qt) : (W.map.depthTexture.compareFunction = null, W.map.depthTexture.minFilter = Yt, W.map.depthTexture.magFilter = Yt);
34949
34971
  }
@@ -34976,9 +34998,9 @@ function dE(i, e, t) {
34976
34998
  };
34977
34999
  function x(M, A) {
34978
35000
  const k = e.update(v);
34979
- h.defines.VSM_SAMPLES !== M.blurSamples && (h.defines.VSM_SAMPLES = M.blurSamples, f.defines.VSM_SAMPLES = M.blurSamples, h.needsUpdate = !0, f.needsUpdate = !0), M.mapPass === null && (M.mapPass = new ei(s.x, s.y, {
35001
+ h.defines.VSM_SAMPLES !== M.blurSamples && (h.defines.VSM_SAMPLES = M.blurSamples, f.defines.VSM_SAMPLES = M.blurSamples, h.needsUpdate = !0, f.needsUpdate = !0), M.mapPass === null && (M.mapPass = new ti(s.x, s.y, {
34980
35002
  format: cr,
34981
- type: Mi
35003
+ type: wi
34982
35004
  })), h.uniforms.shadow_pass.value = M.map.depthTexture, h.uniforms.resolution.value = M.mapSize, h.uniforms.radius.value = M.radius, i.setRenderTarget(M.mapPass), i.clear(), i.renderBufferDirect(A, null, k, h, v, null), f.uniforms.shadow_pass.value = M.mapPass.texture, f.uniforms.resolution.value = M.mapSize, f.uniforms.radius.value = M.radius, i.setRenderTarget(M.map), i.clear(), i.renderBufferDirect(A, null, k, f, v, null);
34983
35005
  }
34984
35006
  function C(M, A, k, y) {
@@ -35128,23 +35150,23 @@ function hE(i, e) {
35128
35150
  function s() {
35129
35151
  let D = !1, _e = null, ae = null, Se = null, ie = null, Y = null, de = null, Ue = null, Tt = null;
35130
35152
  return {
35131
- setTest: function(ot) {
35132
- D || (ot ? ne(i.STENCIL_TEST) : Te(i.STENCIL_TEST));
35153
+ setTest: function(dt) {
35154
+ D || (dt ? ne(i.STENCIL_TEST) : Te(i.STENCIL_TEST));
35133
35155
  },
35134
- setMask: function(ot) {
35135
- _e !== ot && !D && (i.stencilMask(ot), _e = ot);
35156
+ setMask: function(dt) {
35157
+ _e !== dt && !D && (i.stencilMask(dt), _e = dt);
35136
35158
  },
35137
- setFunc: function(ot, Hn, ai) {
35138
- (ae !== ot || Se !== Hn || ie !== ai) && (i.stencilFunc(ot, Hn, ai), ae = ot, Se = Hn, ie = ai);
35159
+ setFunc: function(dt, Wn, oi) {
35160
+ (ae !== dt || Se !== Wn || ie !== oi) && (i.stencilFunc(dt, Wn, oi), ae = dt, Se = Wn, ie = oi);
35139
35161
  },
35140
- setOp: function(ot, Hn, ai) {
35141
- (Y !== ot || de !== Hn || Ue !== ai) && (i.stencilOp(ot, Hn, ai), Y = ot, de = Hn, Ue = ai);
35162
+ setOp: function(dt, Wn, oi) {
35163
+ (Y !== dt || de !== Wn || Ue !== oi) && (i.stencilOp(dt, Wn, oi), Y = dt, de = Wn, Ue = oi);
35142
35164
  },
35143
- setLocked: function(ot) {
35144
- D = ot;
35165
+ setLocked: function(dt) {
35166
+ D = dt;
35145
35167
  },
35146
- setClear: function(ot) {
35147
- Tt !== ot && (i.clearStencil(ot), Tt = ot);
35168
+ setClear: function(dt) {
35169
+ Tt !== dt && (i.clearStencil(dt), Tt = dt);
35148
35170
  },
35149
35171
  reset: function() {
35150
35172
  D = !1, _e = null, ae = null, Se = null, ie = null, Y = null, de = null, Ue = null, Tt = null;
@@ -35167,7 +35189,7 @@ function hE(i, e) {
35167
35189
  return Y;
35168
35190
  }
35169
35191
  const $ = {};
35170
- $[i.TEXTURE_2D] = ft(i.TEXTURE_2D, i.TEXTURE_2D, 1), $[i.TEXTURE_CUBE_MAP] = ft(i.TEXTURE_CUBE_MAP, i.TEXTURE_CUBE_MAP_POSITIVE_X, 6), $[i.TEXTURE_2D_ARRAY] = ft(i.TEXTURE_2D_ARRAY, i.TEXTURE_2D_ARRAY, 1, 1), $[i.TEXTURE_3D] = ft(i.TEXTURE_3D, i.TEXTURE_3D, 1, 1), r.setClear(0, 0, 0, 1), a.setClear(1), o.setClear(0), ne(i.DEPTH_TEST), a.setFunc(ar), He(!1), Nt(hh), ne(i.CULL_FACE), at(xi);
35192
+ $[i.TEXTURE_2D] = ft(i.TEXTURE_2D, i.TEXTURE_2D, 1), $[i.TEXTURE_CUBE_MAP] = ft(i.TEXTURE_CUBE_MAP, i.TEXTURE_CUBE_MAP_POSITIVE_X, 6), $[i.TEXTURE_2D_ARRAY] = ft(i.TEXTURE_2D_ARRAY, i.TEXTURE_2D_ARRAY, 1, 1), $[i.TEXTURE_3D] = ft(i.TEXTURE_3D, i.TEXTURE_3D, 1, 1), r.setClear(0, 0, 0, 1), a.setClear(1), o.setClear(0), ne(i.DEPTH_TEST), a.setFunc(ar), He(!1), Nt(hh), ne(i.CULL_FACE), lt(Ti);
35171
35193
  function ne(D) {
35172
35194
  d[D] !== !0 && (i.enable(D), d[D] = !0);
35173
35195
  }
@@ -35217,14 +35239,14 @@ function hE(i, e) {
35217
35239
  [k_]: i.CONSTANT_ALPHA,
35218
35240
  [I_]: i.ONE_MINUS_CONSTANT_ALPHA
35219
35241
  };
35220
- function at(D, _e, ae, Se, ie, Y, de, Ue, Tt, ot) {
35221
- if (D === xi) {
35242
+ function lt(D, _e, ae, Se, ie, Y, de, Ue, Tt, dt) {
35243
+ if (D === Ti) {
35222
35244
  v === !0 && (Te(i.BLEND), v = !1);
35223
35245
  return;
35224
35246
  }
35225
35247
  if (v === !1 && (ne(i.BLEND), v = !0), D !== m_) {
35226
- if (D !== m || ot !== y) {
35227
- if ((p !== us || b !== us) && (i.blendEquation(i.FUNC_ADD), p = us, b = us), ot)
35248
+ if (D !== m || dt !== y) {
35249
+ if ((p !== us || b !== us) && (i.blendEquation(i.FUNC_ADD), p = us, b = us), dt)
35228
35250
  switch (D) {
35229
35251
  case Qs:
35230
35252
  i.blendFuncSeparate(i.ONE, i.ONE_MINUS_SRC_ALPHA, i.ONE, i.ONE_MINUS_SRC_ALPHA);
@@ -35260,16 +35282,16 @@ function hE(i, e) {
35260
35282
  nt("WebGLState: Invalid blending: ", D);
35261
35283
  break;
35262
35284
  }
35263
- x = null, C = null, S = null, M = null, A.set(0, 0, 0), k = 0, m = D, y = ot;
35285
+ x = null, C = null, S = null, M = null, A.set(0, 0, 0), k = 0, m = D, y = dt;
35264
35286
  }
35265
35287
  return;
35266
35288
  }
35267
35289
  ie = ie || _e, Y = Y || ae, de = de || Se, (_e !== p || ie !== b) && (i.blendEquationSeparate(Wt[_e], Wt[ie]), p = _e, b = ie), (ae !== x || Se !== C || Y !== S || de !== M) && (i.blendFuncSeparate(Ze[ae], Ze[Se], Ze[Y], Ze[de]), x = ae, C = Se, S = Y, M = de), (Ue.equals(A) === !1 || Tt !== k) && (i.blendColor(Ue.r, Ue.g, Ue.b, Tt), A.copy(Ue), k = Tt), m = D, y = !1;
35268
35290
  }
35269
- function gt(D, _e) {
35270
- D.side === yi ? Te(i.CULL_FACE) : ne(i.CULL_FACE);
35291
+ function _t(D, _e) {
35292
+ D.side === Si ? Te(i.CULL_FACE) : ne(i.CULL_FACE);
35271
35293
  let ae = D.side === nn;
35272
- _e && (ae = !ae), He(ae), D.blending === Qs && D.transparent === !1 ? at(xi) : at(D.blending, D.blendEquation, D.blendSrc, D.blendDst, D.blendEquationAlpha, D.blendSrcAlpha, D.blendDstAlpha, D.blendColor, D.blendAlpha, D.premultipliedAlpha), a.setFunc(D.depthFunc), a.setTest(D.depthTest), a.setMask(D.depthWrite), r.setMask(D.colorWrite);
35294
+ _e && (ae = !ae), He(ae), D.blending === Qs && D.transparent === !1 ? lt(Ti) : lt(D.blending, D.blendEquation, D.blendSrc, D.blendDst, D.blendEquationAlpha, D.blendSrcAlpha, D.blendDstAlpha, D.blendColor, D.blendAlpha, D.premultipliedAlpha), a.setFunc(D.depthFunc), a.setTest(D.depthTest), a.setMask(D.depthWrite), r.setMask(D.colorWrite);
35273
35295
  const Se = D.stencilWrite;
35274
35296
  o.setTest(Se), Se && (o.setMask(D.stencilWriteMask), o.setFunc(D.stencilFunc, D.stencilRef, D.stencilFuncMask), o.setOp(D.stencilFail, D.stencilZFail, D.stencilZPass)), Ut(D.polygonOffset, D.polygonOffsetFactor, D.polygonOffsetUnits), D.alphaToCoverage === !0 ? ne(i.SAMPLE_ALPHA_TO_COVERAGE) : Te(i.SAMPLE_ALPHA_TO_COVERAGE);
35275
35297
  }
@@ -35400,8 +35422,8 @@ function hE(i, e) {
35400
35422
  bindFramebuffer: Ve,
35401
35423
  drawBuffers: Me,
35402
35424
  useProgram: et,
35403
- setBlending: at,
35404
- setMaterial: gt,
35425
+ setBlending: lt,
35426
+ setMaterial: _t,
35405
35427
  setFlipSided: He,
35406
35428
  setCullFace: Nt,
35407
35429
  setLineWidth: I,
@@ -35469,13 +35491,13 @@ function fE(i, e, t, n, s, r, a) {
35469
35491
  let j = _;
35470
35492
  if (_ === i.RED && (L === i.FLOAT && (j = i.R32F), L === i.HALF_FLOAT && (j = i.R16F), L === i.UNSIGNED_BYTE && (j = i.R8)), _ === i.RED_INTEGER && (L === i.UNSIGNED_BYTE && (j = i.R8UI), L === i.UNSIGNED_SHORT && (j = i.R16UI), L === i.UNSIGNED_INT && (j = i.R32UI), L === i.BYTE && (j = i.R8I), L === i.SHORT && (j = i.R16I), L === i.INT && (j = i.R32I)), _ === i.RG && (L === i.FLOAT && (j = i.RG32F), L === i.HALF_FLOAT && (j = i.RG16F), L === i.UNSIGNED_BYTE && (j = i.RG8)), _ === i.RG_INTEGER && (L === i.UNSIGNED_BYTE && (j = i.RG8UI), L === i.UNSIGNED_SHORT && (j = i.RG16UI), L === i.UNSIGNED_INT && (j = i.RG32UI), L === i.BYTE && (j = i.RG8I), L === i.SHORT && (j = i.RG16I), L === i.INT && (j = i.RG32I)), _ === i.RGB_INTEGER && (L === i.UNSIGNED_BYTE && (j = i.RGB8UI), L === i.UNSIGNED_SHORT && (j = i.RGB16UI), L === i.UNSIGNED_INT && (j = i.RGB32UI), L === i.BYTE && (j = i.RGB8I), L === i.SHORT && (j = i.RGB16I), L === i.INT && (j = i.RGB32I)), _ === i.RGBA_INTEGER && (L === i.UNSIGNED_BYTE && (j = i.RGBA8UI), L === i.UNSIGNED_SHORT && (j = i.RGBA16UI), L === i.UNSIGNED_INT && (j = i.RGBA32UI), L === i.BYTE && (j = i.RGBA8I), L === i.SHORT && (j = i.RGBA16I), L === i.INT && (j = i.RGBA32I)), _ === i.RGB && (L === i.UNSIGNED_INT_5_9_9_9_REV && (j = i.RGB9_E5), L === i.UNSIGNED_INT_10F_11F_11F_REV && (j = i.R11F_G11F_B10F)), _ === i.RGBA) {
35471
35493
  const Pe = Q ? so : Qe.getTransfer(X);
35472
- L === i.FLOAT && (j = i.RGBA32F), L === i.HALF_FLOAT && (j = i.RGBA16F), L === i.UNSIGNED_BYTE && (j = Pe === lt ? i.SRGB8_ALPHA8 : i.RGBA8), L === i.UNSIGNED_SHORT_4_4_4_4 && (j = i.RGBA4), L === i.UNSIGNED_SHORT_5_5_5_1 && (j = i.RGB5_A1);
35494
+ L === i.FLOAT && (j = i.RGBA32F), L === i.HALF_FLOAT && (j = i.RGBA16F), L === i.UNSIGNED_BYTE && (j = Pe === ht ? i.SRGB8_ALPHA8 : i.RGBA8), L === i.UNSIGNED_SHORT_4_4_4_4 && (j = i.RGBA4), L === i.UNSIGNED_SHORT_5_5_5_1 && (j = i.RGB5_A1);
35473
35495
  }
35474
35496
  return (j === i.R16F || j === i.R32F || j === i.RG16F || j === i.RG32F || j === i.RGBA16F || j === i.RGBA32F) && e.get("EXT_color_buffer_float"), j;
35475
35497
  }
35476
35498
  function b(w, _) {
35477
35499
  let L;
35478
- return w ? _ === null || _ === si || _ === Xr ? L = i.DEPTH24_STENCIL8 : _ === Yn ? L = i.DEPTH32F_STENCIL8 : _ === jr && (L = i.DEPTH24_STENCIL8, Oe("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")) : _ === null || _ === si || _ === Xr ? L = i.DEPTH_COMPONENT24 : _ === Yn ? L = i.DEPTH_COMPONENT32F : _ === jr && (L = i.DEPTH_COMPONENT16), L;
35500
+ return w ? _ === null || _ === ri || _ === Xr ? L = i.DEPTH24_STENCIL8 : _ === Jn ? L = i.DEPTH32F_STENCIL8 : _ === jr && (L = i.DEPTH24_STENCIL8, Oe("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")) : _ === null || _ === ri || _ === Xr ? L = i.DEPTH_COMPONENT24 : _ === Jn ? L = i.DEPTH_COMPONENT32F : _ === jr && (L = i.DEPTH_COMPONENT16), L;
35479
35501
  }
35480
35502
  function S(w, _) {
35481
35503
  return m(w) === !0 || w.isFramebufferTexture && w.minFilter !== Yt && w.minFilter !== Qt ? Math.log2(Math.max(_.width, _.height)) + 1 : w.mipmaps !== void 0 && w.mipmaps.length > 0 ? w.mipmaps.length : w.isCompressedTexture && Array.isArray(w.image) ? _.mipmaps.length : 1;
@@ -35584,7 +35606,7 @@ function fE(i, e, t, n, s, r, a) {
35584
35606
  }
35585
35607
  const ge = {
35586
35608
  [vl]: i.REPEAT,
35587
- [Si]: i.CLAMP_TO_EDGE,
35609
+ [xi]: i.CLAMP_TO_EDGE,
35588
35610
  [bl]: i.MIRRORED_REPEAT
35589
35611
  }, le = {
35590
35612
  [Yt]: i.NEAREST,
@@ -35604,8 +35626,8 @@ function fE(i, e, t, n, s, r, a) {
35604
35626
  [H_]: i.NOTEQUAL
35605
35627
  };
35606
35628
  function Be(w, _) {
35607
- if (_.type === Yn && e.has("OES_texture_float_linear") === !1 && (_.magFilter === Qt || _.magFilter === $o || _.magFilter === aa || _.magFilter === ps || _.minFilter === Qt || _.minFilter === $o || _.minFilter === aa || _.minFilter === ps) && Oe("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."), i.texParameteri(w, i.TEXTURE_WRAP_S, ge[_.wrapS]), i.texParameteri(w, i.TEXTURE_WRAP_T, ge[_.wrapT]), (w === i.TEXTURE_3D || w === i.TEXTURE_2D_ARRAY) && i.texParameteri(w, i.TEXTURE_WRAP_R, ge[_.wrapR]), i.texParameteri(w, i.TEXTURE_MAG_FILTER, le[_.magFilter]), i.texParameteri(w, i.TEXTURE_MIN_FILTER, le[_.minFilter]), _.compareFunction && (i.texParameteri(w, i.TEXTURE_COMPARE_MODE, i.COMPARE_REF_TO_TEXTURE), i.texParameteri(w, i.TEXTURE_COMPARE_FUNC, be[_.compareFunction])), e.has("EXT_texture_filter_anisotropic") === !0) {
35608
- if (_.magFilter === Yt || _.minFilter !== aa && _.minFilter !== ps || _.type === Yn && e.has("OES_texture_float_linear") === !1) return;
35629
+ if (_.type === Jn && e.has("OES_texture_float_linear") === !1 && (_.magFilter === Qt || _.magFilter === $o || _.magFilter === aa || _.magFilter === ps || _.minFilter === Qt || _.minFilter === $o || _.minFilter === aa || _.minFilter === ps) && Oe("WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."), i.texParameteri(w, i.TEXTURE_WRAP_S, ge[_.wrapS]), i.texParameteri(w, i.TEXTURE_WRAP_T, ge[_.wrapT]), (w === i.TEXTURE_3D || w === i.TEXTURE_2D_ARRAY) && i.texParameteri(w, i.TEXTURE_WRAP_R, ge[_.wrapR]), i.texParameteri(w, i.TEXTURE_MAG_FILTER, le[_.magFilter]), i.texParameteri(w, i.TEXTURE_MIN_FILTER, le[_.minFilter]), _.compareFunction && (i.texParameteri(w, i.TEXTURE_COMPARE_MODE, i.COMPARE_REF_TO_TEXTURE), i.texParameteri(w, i.TEXTURE_COMPARE_FUNC, be[_.compareFunction])), e.has("EXT_texture_filter_anisotropic") === !0) {
35630
+ if (_.magFilter === Yt || _.minFilter !== aa && _.minFilter !== ps || _.type === Jn && e.has("OES_texture_float_linear") === !1) return;
35609
35631
  if (_.anisotropy > 1 || n.get(_).__currentAnisotropy) {
35610
35632
  const L = e.get("EXT_texture_filter_anisotropic");
35611
35633
  i.texParameterf(w, L.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(_.anisotropy, s.getMaxAnisotropy())), n.get(_).__currentAnisotropy = _.anisotropy;
@@ -35687,7 +35709,7 @@ function fE(i, e, t, n, s, r, a) {
35687
35709
  if (_.isCompressedArrayTexture) {
35688
35710
  D && _e && t.texStorage3D(i.TEXTURE_2D_ARRAY, Se, Re, We[0].width, We[0].height, se.depth);
35689
35711
  for (let ie = 0, Y = We.length; ie < Y; ie++)
35690
- if (he = We[ie], _.format !== Bn)
35712
+ if (he = We[ie], _.format !== Vn)
35691
35713
  if (fe !== null)
35692
35714
  if (D) {
35693
35715
  if (ae)
@@ -35712,7 +35734,7 @@ function fE(i, e, t, n, s, r, a) {
35712
35734
  } else {
35713
35735
  D && _e && t.texStorage2D(i.TEXTURE_2D, Se, Re, We[0].width, We[0].height);
35714
35736
  for (let ie = 0, Y = We.length; ie < Y; ie++)
35715
- he = We[ie], _.format !== Bn ? fe !== null ? D ? ae && t.compressedTexSubImage2D(i.TEXTURE_2D, ie, 0, 0, he.width, he.height, fe, he.data) : t.compressedTexImage2D(i.TEXTURE_2D, ie, Re, he.width, he.height, 0, he.data) : Oe("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()") : D ? ae && t.texSubImage2D(i.TEXTURE_2D, ie, 0, 0, he.width, he.height, fe, Ee, he.data) : t.texImage2D(i.TEXTURE_2D, ie, Re, he.width, he.height, 0, fe, Ee, he.data);
35737
+ he = We[ie], _.format !== Vn ? fe !== null ? D ? ae && t.compressedTexSubImage2D(i.TEXTURE_2D, ie, 0, 0, he.width, he.height, fe, he.data) : t.compressedTexImage2D(i.TEXTURE_2D, ie, Re, he.width, he.height, 0, he.data) : Oe("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()") : D ? ae && t.texSubImage2D(i.TEXTURE_2D, ie, 0, 0, he.width, he.height, fe, Ee, he.data) : t.texImage2D(i.TEXTURE_2D, ie, Re, he.width, he.height, 0, fe, Ee, he.data);
35716
35738
  }
35717
35739
  else if (_.isDataArrayTexture)
35718
35740
  if (D) {
@@ -35784,7 +35806,7 @@ function fE(i, e, t, n, s, r, a) {
35784
35806
  ie = fe[Y].mipmaps;
35785
35807
  for (let de = 0; de < ie.length; de++) {
35786
35808
  const Ue = ie[de];
35787
- _.format !== Bn ? Re !== null ? D ? ae && t.compressedTexSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + Y, de, 0, 0, Ue.width, Ue.height, Re, Ue.data) : t.compressedTexImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + Y, de, We, Ue.width, Ue.height, 0, Ue.data) : Oe("WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()") : D ? ae && t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + Y, de, 0, 0, Ue.width, Ue.height, Re, he, Ue.data) : t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + Y, de, We, Ue.width, Ue.height, 0, Re, he, Ue.data);
35809
+ _.format !== Vn ? Re !== null ? D ? ae && t.compressedTexSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + Y, de, 0, 0, Ue.width, Ue.height, Re, Ue.data) : t.compressedTexImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + Y, de, We, Ue.width, Ue.height, 0, Ue.data) : Oe("WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()") : D ? ae && t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + Y, de, 0, 0, Ue.width, Ue.height, Re, he, Ue.data) : t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + Y, de, We, Ue.width, Ue.height, 0, Re, he, Ue.data);
35788
35810
  }
35789
35811
  }
35790
35812
  } else {
@@ -35843,14 +35865,14 @@ function fE(i, e, t, n, s, r, a) {
35843
35865
  Q.__webglTexture = i.createTexture(), t.bindTexture(i.TEXTURE_CUBE_MAP, Q.__webglTexture), Be(i.TEXTURE_CUBE_MAP, _.depthTexture);
35844
35866
  const Ne = r.convert(_.depthTexture.format), se = r.convert(_.depthTexture.type);
35845
35867
  let fe;
35846
- _.depthTexture.format === wi ? fe = i.DEPTH_COMPONENT24 : _.depthTexture.format === ms && (fe = i.DEPTH24_STENCIL8);
35868
+ _.depthTexture.format === Ai ? fe = i.DEPTH_COMPONENT24 : _.depthTexture.format === ms && (fe = i.DEPTH24_STENCIL8);
35847
35869
  for (let Ee = 0; Ee < 6; Ee++)
35848
35870
  i.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + Ee, 0, fe, _.width, _.height, 0, Ne, se, null);
35849
35871
  }
35850
35872
  } else
35851
35873
  K(_.depthTexture, 0);
35852
35874
  const j = Q.__webglTexture, Pe = I(_), ue = X ? i.TEXTURE_CUBE_MAP_POSITIVE_X + L : i.TEXTURE_2D, we = _.depthTexture.format === ms ? i.DEPTH_STENCIL_ATTACHMENT : i.DEPTH_ATTACHMENT;
35853
- if (_.depthTexture.format === wi)
35875
+ if (_.depthTexture.format === Ai)
35854
35876
  Ut(_) ? o.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER, we, ue, j, 0, Pe) : i.framebufferTexture2D(i.FRAMEBUFFER, we, ue, j, 0);
35855
35877
  else if (_.depthTexture.format === ms)
35856
35878
  Ut(_) ? o.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER, we, ue, j, 0, Pe) : i.framebufferTexture2D(i.FRAMEBUFFER, we, ue, j, 0);
@@ -35964,7 +35986,7 @@ function fE(i, e, t, n, s, r, a) {
35964
35986
  }
35965
35987
  w.depthBuffer && et(w);
35966
35988
  }
35967
- function at(w) {
35989
+ function lt(w) {
35968
35990
  const _ = w.textures;
35969
35991
  for (let L = 0, X = _.length; L < X; L++) {
35970
35992
  const Q = _[L];
@@ -35974,7 +35996,7 @@ function fE(i, e, t, n, s, r, a) {
35974
35996
  }
35975
35997
  }
35976
35998
  }
35977
- const gt = [], He = [];
35999
+ const _t = [], He = [];
35978
36000
  function Nt(w) {
35979
36001
  if (w.samples > 0) {
35980
36002
  if (Ut(w) === !1) {
@@ -35993,7 +36015,7 @@ function fE(i, e, t, n, s, r, a) {
35993
36015
  const se = n.get(_[Ne]).__webglTexture;
35994
36016
  i.framebufferTexture2D(i.DRAW_FRAMEBUFFER, i.COLOR_ATTACHMENT0, i.TEXTURE_2D, se, 0);
35995
36017
  }
35996
- i.blitFramebuffer(0, 0, L, X, 0, 0, L, X, Q, i.NEAREST), c === !0 && (gt.length = 0, He.length = 0, gt.push(i.COLOR_ATTACHMENT0 + Ne), w.depthBuffer && w.resolveDepthBuffer === !1 && (gt.push(j), He.push(j), i.invalidateFramebuffer(i.DRAW_FRAMEBUFFER, He)), i.invalidateFramebuffer(i.READ_FRAMEBUFFER, gt));
36018
+ i.blitFramebuffer(0, 0, L, X, 0, 0, L, X, Q, i.NEAREST), c === !0 && (_t.length = 0, He.length = 0, _t.push(i.COLOR_ATTACHMENT0 + Ne), w.depthBuffer && w.resolveDepthBuffer === !1 && (_t.push(j), He.push(j), i.invalidateFramebuffer(i.DRAW_FRAMEBUFFER, He)), i.invalidateFramebuffer(i.READ_FRAMEBUFFER, _t));
35997
36019
  }
35998
36020
  if (t.bindFramebuffer(i.READ_FRAMEBUFFER, null), t.bindFramebuffer(i.DRAW_FRAMEBUFFER, null), ue)
35999
36021
  for (let Ne = 0; Ne < _.length; Ne++) {
@@ -36021,12 +36043,12 @@ function fE(i, e, t, n, s, r, a) {
36021
36043
  }
36022
36044
  function xt(w, _) {
36023
36045
  const L = w.colorSpace, X = w.format, Q = w.type;
36024
- return w.isCompressedTexture === !0 || w.isVideoTexture === !0 || L !== lr && L !== Wi && (Qe.getTransfer(L) === lt ? (X !== Bn || Q !== Mn) && Oe("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType.") : nt("WebGLTextures: Unsupported texture color space:", L)), _;
36046
+ return w.isCompressedTexture === !0 || w.isVideoTexture === !0 || L !== lr && L !== Wi && (Qe.getTransfer(L) === ht ? (X !== Vn || Q !== Mn) && Oe("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType.") : nt("WebGLTextures: Unsupported texture color space:", L)), _;
36025
36047
  }
36026
36048
  function Ae(w) {
36027
36049
  return typeof HTMLImageElement < "u" && w instanceof HTMLImageElement ? (l.width = w.naturalWidth || w.width, l.height = w.naturalHeight || w.height) : typeof VideoFrame < "u" && w instanceof VideoFrame ? (l.width = w.displayWidth, l.height = w.displayHeight) : (l.width = w.width, l.height = w.height), l;
36028
36050
  }
36029
- this.allocateTextureUnit = F, this.resetTextureUnits = U, this.setTexture2D = K, this.setTexture2DArray = H, this.setTexture3D = W, this.setTextureCube = ee, this.rebindTextures = Wt, this.setupRenderTarget = Ze, this.updateRenderTargetMipmap = at, this.updateMultisampleRenderTarget = Nt, this.setupDepthRenderbuffer = et, this.setupFrameBufferTexture = Te, this.useMultisampledRTT = Ut, this.isReversedDepthBuffer = function() {
36051
+ this.allocateTextureUnit = F, this.resetTextureUnits = U, this.setTexture2D = K, this.setTexture2DArray = H, this.setTexture3D = W, this.setTextureCube = ee, this.rebindTextures = Wt, this.setupRenderTarget = Ze, this.updateRenderTargetMipmap = lt, this.updateMultisampleRenderTarget = Nt, this.setupDepthRenderbuffer = et, this.setupFrameBufferTexture = Te, this.useMultisampledRTT = Ut, this.isReversedDepthBuffer = function() {
36030
36052
  return t.buffers.depth.getReversed();
36031
36053
  };
36032
36054
  }
@@ -36043,13 +36065,13 @@ function pE(i, e) {
36043
36065
  if (n === hm) return i.SHORT;
36044
36066
  if (n === jr) return i.UNSIGNED_SHORT;
36045
36067
  if (n === Pd) return i.INT;
36046
- if (n === si) return i.UNSIGNED_INT;
36047
- if (n === Yn) return i.FLOAT;
36048
- if (n === Mi) return i.HALF_FLOAT;
36068
+ if (n === ri) return i.UNSIGNED_INT;
36069
+ if (n === Jn) return i.FLOAT;
36070
+ if (n === wi) return i.HALF_FLOAT;
36049
36071
  if (n === mm) return i.ALPHA;
36050
36072
  if (n === gm) return i.RGB;
36051
- if (n === Bn) return i.RGBA;
36052
- if (n === wi) return i.DEPTH_COMPONENT;
36073
+ if (n === Vn) return i.RGBA;
36074
+ if (n === Ai) return i.DEPTH_COMPONENT;
36053
36075
  if (n === ms) return i.DEPTH_STENCIL;
36054
36076
  if (n === vm) return i.RED;
36055
36077
  if (n === Dd) return i.RED_INTEGER;
@@ -36057,7 +36079,7 @@ function pE(i, e) {
36057
36079
  if (n === Ld) return i.RG_INTEGER;
36058
36080
  if (n === Nd) return i.RGBA_INTEGER;
36059
36081
  if (n === Ga || n === Ha || n === Wa || n === qa)
36060
- if (a === lt)
36082
+ if (a === ht)
36061
36083
  if (r = e.get("WEBGL_compressed_texture_s3tc_srgb"), r !== null) {
36062
36084
  if (n === Ga) return r.COMPRESSED_SRGB_S3TC_DXT1_EXT;
36063
36085
  if (n === Ha) return r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;
@@ -36082,8 +36104,8 @@ function pE(i, e) {
36082
36104
  return null;
36083
36105
  if (n === Tl || n === Cl || n === El || n === Ml || n === wl || n === Al || n === Rl)
36084
36106
  if (r = e.get("WEBGL_compressed_texture_etc"), r !== null) {
36085
- if (n === Tl || n === Cl) return a === lt ? r.COMPRESSED_SRGB8_ETC2 : r.COMPRESSED_RGB8_ETC2;
36086
- if (n === El) return a === lt ? r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : r.COMPRESSED_RGBA8_ETC2_EAC;
36107
+ if (n === Tl || n === Cl) return a === ht ? r.COMPRESSED_SRGB8_ETC2 : r.COMPRESSED_RGB8_ETC2;
36108
+ if (n === El) return a === ht ? r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC : r.COMPRESSED_RGBA8_ETC2_EAC;
36087
36109
  if (n === Ml) return r.COMPRESSED_R11_EAC;
36088
36110
  if (n === wl) return r.COMPRESSED_SIGNED_R11_EAC;
36089
36111
  if (n === Al) return r.COMPRESSED_RG11_EAC;
@@ -36092,25 +36114,25 @@ function pE(i, e) {
36092
36114
  return null;
36093
36115
  if (n === Pl || n === kl || n === Il || n === Dl || n === Ll || n === Nl || n === Ul || n === Ol || n === Fl || n === Bl || n === Vl || n === zl || n === Gl || n === Hl)
36094
36116
  if (r = e.get("WEBGL_compressed_texture_astc"), r !== null) {
36095
- if (n === Pl) return a === lt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR : r.COMPRESSED_RGBA_ASTC_4x4_KHR;
36096
- if (n === kl) return a === lt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR : r.COMPRESSED_RGBA_ASTC_5x4_KHR;
36097
- if (n === Il) return a === lt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR : r.COMPRESSED_RGBA_ASTC_5x5_KHR;
36098
- if (n === Dl) return a === lt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR : r.COMPRESSED_RGBA_ASTC_6x5_KHR;
36099
- if (n === Ll) return a === lt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR : r.COMPRESSED_RGBA_ASTC_6x6_KHR;
36100
- if (n === Nl) return a === lt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR : r.COMPRESSED_RGBA_ASTC_8x5_KHR;
36101
- if (n === Ul) return a === lt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR : r.COMPRESSED_RGBA_ASTC_8x6_KHR;
36102
- if (n === Ol) return a === lt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR : r.COMPRESSED_RGBA_ASTC_8x8_KHR;
36103
- if (n === Fl) return a === lt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR : r.COMPRESSED_RGBA_ASTC_10x5_KHR;
36104
- if (n === Bl) return a === lt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR : r.COMPRESSED_RGBA_ASTC_10x6_KHR;
36105
- if (n === Vl) return a === lt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR : r.COMPRESSED_RGBA_ASTC_10x8_KHR;
36106
- if (n === zl) return a === lt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR : r.COMPRESSED_RGBA_ASTC_10x10_KHR;
36107
- if (n === Gl) return a === lt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR : r.COMPRESSED_RGBA_ASTC_12x10_KHR;
36108
- if (n === Hl) return a === lt ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR : r.COMPRESSED_RGBA_ASTC_12x12_KHR;
36117
+ if (n === Pl) return a === ht ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR : r.COMPRESSED_RGBA_ASTC_4x4_KHR;
36118
+ if (n === kl) return a === ht ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR : r.COMPRESSED_RGBA_ASTC_5x4_KHR;
36119
+ if (n === Il) return a === ht ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR : r.COMPRESSED_RGBA_ASTC_5x5_KHR;
36120
+ if (n === Dl) return a === ht ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR : r.COMPRESSED_RGBA_ASTC_6x5_KHR;
36121
+ if (n === Ll) return a === ht ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR : r.COMPRESSED_RGBA_ASTC_6x6_KHR;
36122
+ if (n === Nl) return a === ht ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR : r.COMPRESSED_RGBA_ASTC_8x5_KHR;
36123
+ if (n === Ul) return a === ht ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR : r.COMPRESSED_RGBA_ASTC_8x6_KHR;
36124
+ if (n === Ol) return a === ht ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR : r.COMPRESSED_RGBA_ASTC_8x8_KHR;
36125
+ if (n === Fl) return a === ht ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR : r.COMPRESSED_RGBA_ASTC_10x5_KHR;
36126
+ if (n === Bl) return a === ht ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR : r.COMPRESSED_RGBA_ASTC_10x6_KHR;
36127
+ if (n === Vl) return a === ht ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR : r.COMPRESSED_RGBA_ASTC_10x8_KHR;
36128
+ if (n === zl) return a === ht ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR : r.COMPRESSED_RGBA_ASTC_10x10_KHR;
36129
+ if (n === Gl) return a === ht ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR : r.COMPRESSED_RGBA_ASTC_12x10_KHR;
36130
+ if (n === Hl) return a === ht ? r.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR : r.COMPRESSED_RGBA_ASTC_12x12_KHR;
36109
36131
  } else
36110
36132
  return null;
36111
36133
  if (n === Wl || n === ql || n === jl)
36112
36134
  if (r = e.get("EXT_texture_compression_bptc"), r !== null) {
36113
- if (n === Wl) return a === lt ? r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT : r.COMPRESSED_RGBA_BPTC_UNORM_EXT;
36135
+ if (n === Wl) return a === ht ? r.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT : r.COMPRESSED_RGBA_BPTC_UNORM_EXT;
36114
36136
  if (n === ql) return r.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;
36115
36137
  if (n === jl) return r.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT;
36116
36138
  } else
@@ -36188,7 +36210,7 @@ class vE {
36188
36210
  depthHeight: { value: t.w }
36189
36211
  }
36190
36212
  });
36191
- this.mesh = new zn(new bo(20, 20), n);
36213
+ this.mesh = new Gn(new bo(20, 20), n);
36192
36214
  }
36193
36215
  return this.mesh;
36194
36216
  }
@@ -36276,17 +36298,17 @@ class bE extends ur {
36276
36298
  if (s = $, s !== null) {
36277
36299
  if (C = e.getRenderTarget(), s.addEventListener("select", K), s.addEventListener("selectstart", K), s.addEventListener("selectend", K), s.addEventListener("squeeze", K), s.addEventListener("squeezestart", K), s.addEventListener("squeezeend", K), s.addEventListener("end", H), s.addEventListener("inputsourceschange", W), x.xrCompatible !== !0 && await t.makeXRCompatible(), k = e.getPixelRatio(), e.getSize(A), v && "createProjectionLayer" in XRWebGLBinding.prototype) {
36278
36300
  let Te = null, Ve = null, Me = null;
36279
- x.depth && (Me = x.stencil ? t.DEPTH24_STENCIL8 : t.DEPTH_COMPONENT24, Te = x.stencil ? ms : wi, Ve = x.stencil ? Xr : si);
36301
+ x.depth && (Me = x.stencil ? t.DEPTH24_STENCIL8 : t.DEPTH_COMPONENT24, Te = x.stencil ? ms : Ai, Ve = x.stencil ? Xr : ri);
36280
36302
  const et = {
36281
36303
  colorFormat: t.RGBA8,
36282
36304
  depthFormat: Me,
36283
36305
  scaleFactor: r
36284
36306
  };
36285
- u = this.getBinding(), h = u.createProjectionLayer(et), s.updateRenderState({ layers: [h] }), e.setPixelRatio(1), e.setSize(h.textureWidth, h.textureHeight, !1), b = new ei(
36307
+ u = this.getBinding(), h = u.createProjectionLayer(et), s.updateRenderState({ layers: [h] }), e.setPixelRatio(1), e.setSize(h.textureWidth, h.textureHeight, !1), b = new ti(
36286
36308
  h.textureWidth,
36287
36309
  h.textureHeight,
36288
36310
  {
36289
- format: Bn,
36311
+ format: Vn,
36290
36312
  type: Mn,
36291
36313
  depthTexture: new Kr(h.textureWidth, h.textureHeight, Ve, void 0, void 0, void 0, void 0, void 0, void 0, Te),
36292
36314
  stencilBuffer: x.stencil,
@@ -36304,11 +36326,11 @@ class bE extends ur {
36304
36326
  stencil: x.stencil,
36305
36327
  framebufferScaleFactor: r
36306
36328
  };
36307
- f = new XRWebGLLayer(s, t, Te), s.updateRenderState({ baseLayer: f }), e.setPixelRatio(1), e.setSize(f.framebufferWidth, f.framebufferHeight, !1), b = new ei(
36329
+ f = new XRWebGLLayer(s, t, Te), s.updateRenderState({ baseLayer: f }), e.setPixelRatio(1), e.setSize(f.framebufferWidth, f.framebufferHeight, !1), b = new ti(
36308
36330
  f.framebufferWidth,
36309
36331
  f.framebufferHeight,
36310
36332
  {
36311
- format: Bn,
36333
+ format: Vn,
36312
36334
  type: Mn,
36313
36335
  colorSpace: e.outputColorSpace,
36314
36336
  stencilBuffer: x.stencil,
@@ -36351,11 +36373,11 @@ class bE extends ur {
36351
36373
  const ee = new B(), ge = new B();
36352
36374
  function le($, ne, Te) {
36353
36375
  ee.setFromMatrixPosition(ne.matrixWorld), ge.setFromMatrixPosition(Te.matrixWorld);
36354
- const Ve = ee.distanceTo(ge), Me = ne.projectionMatrix.elements, et = Te.projectionMatrix.elements, Wt = Me[14] / (Me[10] - 1), Ze = Me[14] / (Me[10] + 1), at = (Me[9] + 1) / Me[5], gt = (Me[9] - 1) / Me[5], He = (Me[8] - 1) / Me[0], Nt = (et[8] + 1) / et[0], I = Wt * He, Ut = Wt * Nt, rt = Ve / (-He + Nt), xt = rt * -He;
36376
+ const Ve = ee.distanceTo(ge), Me = ne.projectionMatrix.elements, et = Te.projectionMatrix.elements, Wt = Me[14] / (Me[10] - 1), Ze = Me[14] / (Me[10] + 1), lt = (Me[9] + 1) / Me[5], _t = (Me[9] - 1) / Me[5], He = (Me[8] - 1) / Me[0], Nt = (et[8] + 1) / et[0], I = Wt * He, Ut = Wt * Nt, rt = Ve / (-He + Nt), xt = rt * -He;
36355
36377
  if (ne.matrixWorld.decompose($.position, $.quaternion, $.scale), $.translateX(xt), $.translateZ(rt), $.matrixWorld.compose($.position, $.quaternion, $.scale), $.matrixWorldInverse.copy($.matrixWorld).invert(), Me[10] === -1)
36356
36378
  $.projectionMatrix.copy(ne.projectionMatrix), $.projectionMatrixInverse.copy(ne.projectionMatrixInverse);
36357
36379
  else {
36358
- const Ae = Wt + rt, w = Ze + rt, _ = I - xt, L = Ut + (Ve - xt), X = at * Ze / w * Ae, Q = gt * Ze / w * Ae;
36380
+ const Ae = Wt + rt, w = Ze + rt, _ = I - xt, L = Ut + (Ve - xt), X = lt * Ze / w * Ae, Q = _t * Ze / w * Ae;
36359
36381
  $.projectionMatrix.makePerspective(_, L, X, Q, Ae, w), $.projectionMatrixInverse.copy($.projectionMatrix).invert();
36360
36382
  }
36361
36383
  }
@@ -36400,20 +36422,20 @@ class bE extends ur {
36400
36422
  let Ve = !1;
36401
36423
  Te.length !== U.cameras.length && (U.cameras.length = 0, Ve = !0);
36402
36424
  for (let Ze = 0; Ze < Te.length; Ze++) {
36403
- const at = Te[Ze];
36404
- let gt = null;
36425
+ const lt = Te[Ze];
36426
+ let _t = null;
36405
36427
  if (f !== null)
36406
- gt = f.getViewport(at);
36428
+ _t = f.getViewport(lt);
36407
36429
  else {
36408
- const Nt = u.getViewSubImage(h, at);
36409
- gt = Nt.viewport, Ze === 0 && (e.setRenderTargetTextures(
36430
+ const Nt = u.getViewSubImage(h, lt);
36431
+ _t = Nt.viewport, Ze === 0 && (e.setRenderTargetTextures(
36410
36432
  b,
36411
36433
  Nt.colorTexture,
36412
36434
  Nt.depthStencilTexture
36413
36435
  ), e.setRenderTarget(b));
36414
36436
  }
36415
36437
  let He = R[Ze];
36416
- He === void 0 && (He = new En(), He.layers.enable(Ze), He.viewport = new Lt(), R[Ze] = He), He.matrix.fromArray(at.transform.matrix), He.matrix.decompose(He.position, He.quaternion, He.scale), He.projectionMatrix.fromArray(at.projectionMatrix), He.projectionMatrixInverse.copy(He.projectionMatrix).invert(), He.viewport.set(gt.x, gt.y, gt.width, gt.height), Ze === 0 && (U.matrix.copy(He.matrix), U.matrix.decompose(U.position, U.quaternion, U.scale)), Ve === !0 && U.cameras.push(He);
36438
+ He === void 0 && (He = new En(), He.layers.enable(Ze), He.viewport = new Lt(), R[Ze] = He), He.matrix.fromArray(lt.transform.matrix), He.matrix.decompose(He.position, He.quaternion, He.scale), He.projectionMatrix.fromArray(lt.projectionMatrix), He.projectionMatrixInverse.copy(He.projectionMatrix).invert(), He.viewport.set(_t.x, _t.y, _t.width, _t.height), Ze === 0 && (U.matrix.copy(He.matrix), U.matrix.decompose(U.position, U.quaternion, U.scale)), Ve === !0 && U.cameras.push(He);
36417
36439
  }
36418
36440
  const Me = s.enabledFeatures;
36419
36441
  if (Me && Me.includes("depth-sensing") && s.depthUsage == "gpu-optimized" && v) {
@@ -36424,12 +36446,12 @@ class bE extends ur {
36424
36446
  if (Me && Me.includes("camera-access") && v) {
36425
36447
  e.state.unbindTexture(), u = n.getBinding();
36426
36448
  for (let Ze = 0; Ze < Te.length; Ze++) {
36427
- const at = Te[Ze].camera;
36428
- if (at) {
36429
- let gt = p[at];
36430
- gt || (gt = new Pm(), p[at] = gt);
36431
- const He = u.getCameraImage(at);
36432
- gt.sourceTexture = He;
36449
+ const lt = Te[Ze].camera;
36450
+ if (lt) {
36451
+ let _t = p[lt];
36452
+ _t || (_t = new Pm(), p[lt] = _t);
36453
+ const He = u.getCameraImage(lt);
36454
+ _t.sourceTexture = He;
36433
36455
  }
36434
36456
  }
36435
36457
  }
@@ -36447,7 +36469,7 @@ class bE extends ur {
36447
36469
  };
36448
36470
  }
36449
36471
  }
36450
- const os = /* @__PURE__ */ new Ai(), _E = /* @__PURE__ */ new Vt();
36472
+ const os = /* @__PURE__ */ new Ri(), _E = /* @__PURE__ */ new Vt();
36451
36473
  function yE(i, e) {
36452
36474
  function t(m, p) {
36453
36475
  m.matrixAutoUpdate === !0 && m.updateMatrix(), p.value.copy(m.matrix);
@@ -37117,9 +37139,9 @@ const xE = new Uint16Array([
37117
37139
  13702,
37118
37140
  1183
37119
37141
  ]);
37120
- let Wn = null;
37142
+ let qn = null;
37121
37143
  function TE() {
37122
- return Wn === null && (Wn = new _y(xE, 16, 16, cr, Mi), Wn.name = "DFG_LUT", Wn.minFilter = Qt, Wn.magFilter = Qt, Wn.wrapS = Si, Wn.wrapT = Si, Wn.generateMipmaps = !1, Wn.needsUpdate = !0), Wn;
37144
+ return qn === null && (qn = new _y(xE, 16, 16, cr, wi), qn.name = "DFG_LUT", qn.minFilter = Qt, qn.magFilter = Qt, qn.wrapS = xi, qn.wrapT = xi, qn.generateMipmaps = !1, qn.needsUpdate = !0), qn;
37123
37145
  }
37124
37146
  class CE {
37125
37147
  /**
@@ -37156,7 +37178,7 @@ class CE {
37156
37178
  Dd
37157
37179
  ]), p = /* @__PURE__ */ new Set([
37158
37180
  Mn,
37159
- si,
37181
+ ri,
37160
37182
  jr,
37161
37183
  Xr,
37162
37184
  kd,
@@ -37176,7 +37198,7 @@ class CE {
37176
37198
  * @type {?Function}
37177
37199
  */
37178
37200
  onShaderError: null
37179
- }, this.autoClear = !0, this.autoClearColor = !0, this.autoClearDepth = !0, this.autoClearStencil = !0, this.sortObjects = !0, this.clippingPlanes = [], this.localClippingEnabled = !1, this.toneMapping = Qn, this.toneMappingExposure = 1, this.transmissionResolutionScale = 1;
37201
+ }, this.autoClear = !0, this.autoClearColor = !0, this.autoClearDepth = !0, this.autoClearStencil = !0, this.sortObjects = !0, this.clippingPlanes = [], this.localClippingEnabled = !1, this.toneMapping = ei, this.toneMappingExposure = 1, this.transmissionResolutionScale = 1;
37180
37202
  const y = this;
37181
37203
  let T = !1;
37182
37204
  this._outputColorSpace = Cn;
@@ -37189,7 +37211,7 @@ class CE {
37189
37211
  let Te = !1;
37190
37212
  const Ve = new Rm();
37191
37213
  let Me = !1, et = !1;
37192
- const Wt = new Vt(), Ze = new B(), at = new Lt(), gt = { background: null, fog: null, environment: null, overrideMaterial: null, isScene: !0 };
37214
+ const Wt = new Vt(), Ze = new B(), lt = new Lt(), _t = { background: null, fog: null, environment: null, overrideMaterial: null, isScene: !0 };
37193
37215
  let He = !1;
37194
37216
  function Nt() {
37195
37217
  return F === null ? Fe : 1;
@@ -37209,7 +37231,7 @@ class CE {
37209
37231
  powerPreference: d,
37210
37232
  failIfMajorPerformanceCaveat: u
37211
37233
  };
37212
- if ("setAttribute" in t && t.setAttribute("data-engine", `three.js r${Rd}`), t.addEventListener("webglcontextlost", Ue, !1), t.addEventListener("webglcontextrestored", Tt, !1), t.addEventListener("webglcontextcreationerror", ot, !1), I === null) {
37234
+ if ("setAttribute" in t && t.setAttribute("data-engine", `three.js r${Rd}`), t.addEventListener("webglcontextlost", Ue, !1), t.addEventListener("webglcontextrestored", Tt, !1), t.addEventListener("webglcontextcreationerror", dt, !1), I === null) {
37213
37235
  const N = "webgl2";
37214
37236
  if (I = Ut(N, E), I === null)
37215
37237
  throw Ut(N) ? new Error("Error creating WebGL context with your selected attributes.") : new Error("Error creating WebGL context.");
@@ -37310,7 +37332,7 @@ class CE {
37310
37332
  }, this.clearStencil = function() {
37311
37333
  this.clear(!1, !1, !0);
37312
37334
  }, this.dispose = function() {
37313
- t.removeEventListener("webglcontextlost", Ue, !1), t.removeEventListener("webglcontextrestored", Tt, !1), t.removeEventListener("webglcontextcreationerror", ot, !1), he.dispose(), se.dispose(), fe.dispose(), _.dispose(), X.dispose(), Q.dispose(), ue.dispose(), Se.dispose(), ie.dispose(), we.dispose(), de.dispose(), de.removeEventListener("sessionstart", Xd), de.removeEventListener("sessionend", $d), Qi.stop();
37335
+ t.removeEventListener("webglcontextlost", Ue, !1), t.removeEventListener("webglcontextrestored", Tt, !1), t.removeEventListener("webglcontextcreationerror", dt, !1), he.dispose(), se.dispose(), fe.dispose(), _.dispose(), X.dispose(), Q.dispose(), ue.dispose(), Se.dispose(), ie.dispose(), we.dispose(), de.dispose(), de.removeEventListener("sessionstart", Xd), de.removeEventListener("sessionend", $d), Qi.stop();
37314
37336
  };
37315
37337
  function Ue(E) {
37316
37338
  E.preventDefault(), _h("WebGLRenderer: Context Lost."), T = !0;
@@ -37320,14 +37342,14 @@ class CE {
37320
37342
  const E = w.autoReset, N = Re.enabled, G = Re.autoUpdate, V = Re.needsUpdate, O = Re.type;
37321
37343
  Y(), w.autoReset = E, Re.enabled = N, Re.autoUpdate = G, Re.needsUpdate = V, Re.type = O;
37322
37344
  }
37323
- function ot(E) {
37345
+ function dt(E) {
37324
37346
  nt("WebGLRenderer: A WebGL context could not be created. Reason: ", E.statusMessage);
37325
37347
  }
37326
- function Hn(E) {
37348
+ function Wn(E) {
37327
37349
  const N = E.target;
37328
- N.removeEventListener("dispose", Hn), ai(N);
37350
+ N.removeEventListener("dispose", Wn), oi(N);
37329
37351
  }
37330
- function ai(E) {
37352
+ function oi(E) {
37331
37353
  Om(E), _.remove(E);
37332
37354
  }
37333
37355
  function Om(E) {
@@ -37337,7 +37359,7 @@ class CE {
37337
37359
  }), E.isShaderMaterial && we.releaseShaderCache(E));
37338
37360
  }
37339
37361
  this.renderBufferDirect = function(E, N, G, V, O, pe) {
37340
- N === null && (N = gt);
37362
+ N === null && (N = _t);
37341
37363
  const xe = O.isMesh && O.matrixWorld.determinant() < 0, ve = Bm(E, N, G, V, O);
37342
37364
  Ae.setMaterial(V, xe);
37343
37365
  let Ce = G.index, ke = 1;
@@ -37351,33 +37373,33 @@ class CE {
37351
37373
  const At = pt - je;
37352
37374
  if (At < 0 || At === 1 / 0) return;
37353
37375
  Se.setup(O, V, ve, G, Ce);
37354
- let Rt, vt = D;
37355
- if (Ce !== null && (Rt = j.get(Ce), vt = _e, vt.setIndex(Rt)), O.isMesh)
37356
- V.wireframe === !0 ? (Ae.setLineWidth(V.wireframeLinewidth * Nt()), vt.setMode(I.LINES)) : vt.setMode(I.TRIANGLES);
37376
+ let Rt, yt = D;
37377
+ if (Ce !== null && (Rt = j.get(Ce), yt = _e, yt.setIndex(Rt)), O.isMesh)
37378
+ V.wireframe === !0 ? (Ae.setLineWidth(V.wireframeLinewidth * Nt()), yt.setMode(I.LINES)) : yt.setMode(I.TRIANGLES);
37357
37379
  else if (O.isLine) {
37358
37380
  let De = V.linewidth;
37359
- De === void 0 && (De = 1), Ae.setLineWidth(De * Nt()), O.isLineSegments ? vt.setMode(I.LINES) : O.isLineLoop ? vt.setMode(I.LINE_LOOP) : vt.setMode(I.LINE_STRIP);
37360
- } else O.isPoints ? vt.setMode(I.POINTS) : O.isSprite && vt.setMode(I.TRIANGLES);
37381
+ De === void 0 && (De = 1), Ae.setLineWidth(De * Nt()), O.isLineSegments ? yt.setMode(I.LINES) : O.isLineLoop ? yt.setMode(I.LINE_LOOP) : yt.setMode(I.LINE_STRIP);
37382
+ } else O.isPoints ? yt.setMode(I.POINTS) : O.isSprite && yt.setMode(I.TRIANGLES);
37361
37383
  if (O.isBatchedMesh)
37362
37384
  if (O._multiDrawInstances !== null)
37363
- $r("WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."), vt.renderMultiDrawInstances(O._multiDrawStarts, O._multiDrawCounts, O._multiDrawCount, O._multiDrawInstances);
37385
+ $r("WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."), yt.renderMultiDrawInstances(O._multiDrawStarts, O._multiDrawCounts, O._multiDrawCount, O._multiDrawInstances);
37364
37386
  else if (rt.get("WEBGL_multi_draw"))
37365
- vt.renderMultiDraw(O._multiDrawStarts, O._multiDrawCounts, O._multiDrawCount);
37387
+ yt.renderMultiDraw(O._multiDrawStarts, O._multiDrawCounts, O._multiDrawCount);
37366
37388
  else {
37367
- const De = O._multiDrawStarts, ct = O._multiDrawCounts, tt = O._multiDrawCount, pn = Ce ? j.get(Ce).bytesPerElement : 1, Es = _.get(V).currentProgram.getUniforms();
37389
+ const De = O._multiDrawStarts, ut = O._multiDrawCounts, tt = O._multiDrawCount, pn = Ce ? j.get(Ce).bytesPerElement : 1, Es = _.get(V).currentProgram.getUniforms();
37368
37390
  for (let mn = 0; mn < tt; mn++)
37369
- Es.setValue(I, "_gl_DrawID", mn), vt.render(De[mn] / pn, ct[mn]);
37391
+ Es.setValue(I, "_gl_DrawID", mn), yt.render(De[mn] / pn, ut[mn]);
37370
37392
  }
37371
37393
  else if (O.isInstancedMesh)
37372
- vt.renderInstances(je, At, O.count);
37394
+ yt.renderInstances(je, At, O.count);
37373
37395
  else if (G.isInstancedBufferGeometry) {
37374
- const De = G._maxInstanceCount !== void 0 ? G._maxInstanceCount : 1 / 0, ct = Math.min(G.instanceCount, De);
37375
- vt.renderInstances(je, At, ct);
37396
+ const De = G._maxInstanceCount !== void 0 ? G._maxInstanceCount : 1 / 0, ut = Math.min(G.instanceCount, De);
37397
+ yt.renderInstances(je, At, ut);
37376
37398
  } else
37377
- vt.render(je, At);
37399
+ yt.render(je, At);
37378
37400
  };
37379
37401
  function jd(E, N, G) {
37380
- E.transparent === !0 && E.side === yi && E.forceSinglePass === !1 ? (E.side = nn, E.needsUpdate = !0, ia(E, N, G), E.side = Ei, E.needsUpdate = !0, ia(E, N, G), E.side = yi) : ia(E, N, G);
37402
+ E.transparent === !0 && E.side === Si && E.forceSinglePass === !1 ? (E.side = nn, E.needsUpdate = !0, ia(E, N, G), E.side = Mi, E.needsUpdate = !0, ia(E, N, G), E.side = Si) : ia(E, N, G);
37381
37403
  }
37382
37404
  this.compile = function(E, N, G = null) {
37383
37405
  G === null && (G = E), S = fe.get(G), S.init(N), A.push(S), G.traverseVisible(function(O) {
@@ -37434,7 +37456,7 @@ class CE {
37434
37456
  }
37435
37457
  if (T === !0) return;
37436
37458
  const G = de.enabled === !0 && de.isPresenting === !0, V = k !== null && (F === null || G) && k.begin(y, F);
37437
- if (E.matrixWorldAutoUpdate === !0 && E.updateMatrixWorld(), N.parent === null && N.matrixWorldAutoUpdate === !0 && N.updateMatrixWorld(), de.enabled === !0 && de.isPresenting === !0 && (k === null || k.isCompositing() === !1) && (de.cameraAutoUpdate === !0 && de.updateCamera(N), N = de.getCamera()), E.isScene === !0 && E.onBeforeRender(y, E, N, F), S = fe.get(E, A.length), S.init(N), A.push(S), Wt.multiplyMatrices(N.projectionMatrix, N.matrixWorldInverse), Ve.setFromProjectionMatrix(Wt, Jn, N.reversedDepth), et = this.localClippingEnabled, Me = Ee.init(this.clippingPlanes, et), b = se.get(E, M.length), b.init(), M.push(b), de.enabled === !0 && de.isPresenting === !0) {
37459
+ if (E.matrixWorldAutoUpdate === !0 && E.updateMatrixWorld(), N.parent === null && N.matrixWorldAutoUpdate === !0 && N.updateMatrixWorld(), de.enabled === !0 && de.isPresenting === !0 && (k === null || k.isCompositing() === !1) && (de.cameraAutoUpdate === !0 && de.updateCamera(N), N = de.getCamera()), E.isScene === !0 && E.onBeforeRender(y, E, N, F), S = fe.get(E, A.length), S.init(N), A.push(S), Wt.multiplyMatrices(N.projectionMatrix, N.matrixWorldInverse), Ve.setFromProjectionMatrix(Wt, Zn, N.reversedDepth), et = this.localClippingEnabled, Me = Ee.init(this.clippingPlanes, et), b = se.get(E, M.length), b.init(), M.push(b), de.enabled === !0 && de.isPresenting === !0) {
37438
37460
  const xe = y.xr.getDepthSensingMesh();
37439
37461
  xe !== null && To(xe, N, -1 / 0, y.sortObjects);
37440
37462
  }
@@ -37470,19 +37492,19 @@ class CE {
37470
37492
  S.pushLight(E), E.castShadow && S.pushShadow(E);
37471
37493
  else if (E.isSprite) {
37472
37494
  if (!E.frustumCulled || Ve.intersectsSprite(E)) {
37473
- V && at.setFromMatrixPosition(E.matrixWorld).applyMatrix4(Wt);
37495
+ V && lt.setFromMatrixPosition(E.matrixWorld).applyMatrix4(Wt);
37474
37496
  const xe = ue.update(E), ve = E.material;
37475
- ve.visible && b.push(E, xe, ve, G, at.z, null);
37497
+ ve.visible && b.push(E, xe, ve, G, lt.z, null);
37476
37498
  }
37477
37499
  } else if ((E.isMesh || E.isLine || E.isPoints) && (!E.frustumCulled || Ve.intersectsObject(E))) {
37478
37500
  const xe = ue.update(E), ve = E.material;
37479
- if (V && (E.boundingSphere !== void 0 ? (E.boundingSphere === null && E.computeBoundingSphere(), at.copy(E.boundingSphere.center)) : (xe.boundingSphere === null && xe.computeBoundingSphere(), at.copy(xe.boundingSphere.center)), at.applyMatrix4(E.matrixWorld).applyMatrix4(Wt)), Array.isArray(ve)) {
37501
+ if (V && (E.boundingSphere !== void 0 ? (E.boundingSphere === null && E.computeBoundingSphere(), lt.copy(E.boundingSphere.center)) : (xe.boundingSphere === null && xe.computeBoundingSphere(), lt.copy(xe.boundingSphere.center)), lt.applyMatrix4(E.matrixWorld).applyMatrix4(Wt)), Array.isArray(ve)) {
37480
37502
  const Ce = xe.groups;
37481
37503
  for (let ke = 0, Le = Ce.length; ke < Le; ke++) {
37482
37504
  const Ie = Ce[ke], je = ve[Ie.materialIndex];
37483
- je && je.visible && b.push(E, xe, je, G, at.z, Ie);
37505
+ je && je.visible && b.push(E, xe, je, G, lt.z, Ie);
37484
37506
  }
37485
- } else ve.visible && b.push(E, xe, ve, G, at.z, null);
37507
+ } else ve.visible && b.push(E, xe, ve, G, lt.z, null);
37486
37508
  }
37487
37509
  }
37488
37510
  const pe = E.children;
@@ -37498,9 +37520,9 @@ class CE {
37498
37520
  return;
37499
37521
  if (S.state.transmissionRenderTarget[V.id] === void 0) {
37500
37522
  const je = rt.has("EXT_color_buffer_half_float") || rt.has("EXT_color_buffer_float");
37501
- S.state.transmissionRenderTarget[V.id] = new ei(1, 1, {
37523
+ S.state.transmissionRenderTarget[V.id] = new ti(1, 1, {
37502
37524
  generateMipmaps: !0,
37503
- type: je ? Mi : Mn,
37525
+ type: je ? wi : Mn,
37504
37526
  minFilter: ps,
37505
37527
  samples: xt.samples,
37506
37528
  stencilBuffer: r,
@@ -37514,15 +37536,15 @@ class CE {
37514
37536
  const ve = y.getRenderTarget(), Ce = y.getActiveCubeFace(), ke = y.getActiveMipmapLevel();
37515
37537
  y.setRenderTarget(pe), y.getClearColor(ge), le = y.getClearAlpha(), le < 1 && y.setClearColor(16777215, 0.5), y.clear(), He && he.render(G);
37516
37538
  const Le = y.toneMapping;
37517
- y.toneMapping = Qn;
37539
+ y.toneMapping = ei;
37518
37540
  const Ie = V.viewport;
37519
37541
  if (V.viewport !== void 0 && (V.viewport = void 0), S.setupLightsView(V), Me === !0 && Ee.setGlobalState(y.clippingPlanes, V), na(E, G, V), L.updateMultisampleRenderTarget(pe), L.updateRenderTargetMipmap(pe), rt.has("WEBGL_multisampled_render_to_texture") === !1) {
37520
37542
  let je = !1;
37521
37543
  for (let pt = 0, At = N.length; pt < At; pt++) {
37522
- const Rt = N[pt], { object: vt, geometry: De, material: ct, group: tt } = Rt;
37523
- if (ct.side === yi && vt.layers.test(V.layers)) {
37524
- const pn = ct.side;
37525
- ct.side = nn, ct.needsUpdate = !0, Jd(vt, G, V, De, ct, tt), ct.side = pn, ct.needsUpdate = !0, je = !0;
37544
+ const Rt = N[pt], { object: yt, geometry: De, material: ut, group: tt } = Rt;
37545
+ if (ut.side === Si && yt.layers.test(V.layers)) {
37546
+ const pn = ut.side;
37547
+ ut.side = nn, ut.needsUpdate = !0, Jd(yt, G, V, De, ut, tt), ut.side = pn, ut.needsUpdate = !0, je = !0;
37526
37548
  }
37527
37549
  }
37528
37550
  je === !0 && (L.updateMultisampleRenderTarget(pe), L.updateRenderTargetMipmap(pe));
@@ -37538,13 +37560,13 @@ class CE {
37538
37560
  }
37539
37561
  }
37540
37562
  function Jd(E, N, G, V, O, pe) {
37541
- E.onBeforeRender(y, N, G, V, O, pe), E.modelViewMatrix.multiplyMatrices(G.matrixWorldInverse, E.matrixWorld), E.normalMatrix.getNormalMatrix(E.modelViewMatrix), O.onBeforeRender(y, N, G, V, E, pe), O.transparent === !0 && O.side === yi && O.forceSinglePass === !1 ? (O.side = nn, O.needsUpdate = !0, y.renderBufferDirect(G, N, V, O, E, pe), O.side = Ei, O.needsUpdate = !0, y.renderBufferDirect(G, N, V, O, E, pe), O.side = yi) : y.renderBufferDirect(G, N, V, O, E, pe), E.onAfterRender(y, N, G, V, O, pe);
37563
+ E.onBeforeRender(y, N, G, V, O, pe), E.modelViewMatrix.multiplyMatrices(G.matrixWorldInverse, E.matrixWorld), E.normalMatrix.getNormalMatrix(E.modelViewMatrix), O.onBeforeRender(y, N, G, V, E, pe), O.transparent === !0 && O.side === Si && O.forceSinglePass === !1 ? (O.side = nn, O.needsUpdate = !0, y.renderBufferDirect(G, N, V, O, E, pe), O.side = Mi, O.needsUpdate = !0, y.renderBufferDirect(G, N, V, O, E, pe), O.side = Si) : y.renderBufferDirect(G, N, V, O, E, pe), E.onAfterRender(y, N, G, V, O, pe);
37542
37564
  }
37543
37565
  function ia(E, N, G) {
37544
- N.isScene !== !0 && (N = gt);
37566
+ N.isScene !== !0 && (N = _t);
37545
37567
  const V = _.get(E), O = S.state.lights, pe = S.state.shadowsArray, xe = O.state.version, ve = we.getParameters(E, O.state, pe, N, G), Ce = we.getProgramCacheKey(ve);
37546
37568
  let ke = V.programs;
37547
- V.environment = E.isMeshStandardMaterial ? N.environment : null, V.fog = N.fog, V.envMap = (E.isMeshStandardMaterial ? Q : X).get(E.envMap || V.environment), V.envMapRotation = V.environment !== null && E.envMap === null ? N.environmentRotation : E.envMapRotation, ke === void 0 && (E.addEventListener("dispose", Hn), ke = /* @__PURE__ */ new Map(), V.programs = ke);
37569
+ V.environment = E.isMeshStandardMaterial ? N.environment : null, V.fog = N.fog, V.envMap = (E.isMeshStandardMaterial ? Q : X).get(E.envMap || V.environment), V.envMapRotation = V.environment !== null && E.envMap === null ? N.environmentRotation : E.envMapRotation, ke === void 0 && (E.addEventListener("dispose", Wn), ke = /* @__PURE__ */ new Map(), V.programs = ke);
37548
37570
  let Le = ke.get(Ce);
37549
37571
  if (Le !== void 0) {
37550
37572
  if (V.currentProgram === Le && V.lightsStateVersion === xe)
@@ -37566,17 +37588,17 @@ class CE {
37566
37588
  G.outputColorSpace = N.outputColorSpace, G.batching = N.batching, G.batchingColor = N.batchingColor, G.instancing = N.instancing, G.instancingColor = N.instancingColor, G.instancingMorph = N.instancingMorph, G.skinning = N.skinning, G.morphTargets = N.morphTargets, G.morphNormals = N.morphNormals, G.morphColors = N.morphColors, G.morphTargetsCount = N.morphTargetsCount, G.numClippingPlanes = N.numClippingPlanes, G.numIntersection = N.numClipIntersection, G.vertexAlphas = N.vertexAlphas, G.vertexTangents = N.vertexTangents, G.toneMapping = N.toneMapping;
37567
37589
  }
37568
37590
  function Bm(E, N, G, V, O) {
37569
- N.isScene !== !0 && (N = gt), L.resetTextureUnits();
37591
+ N.isScene !== !0 && (N = _t), L.resetTextureUnits();
37570
37592
  const pe = N.fog, xe = V.isMeshStandardMaterial ? N.environment : null, ve = F === null ? y.outputColorSpace : F.isXRRenderTarget === !0 ? F.texture.colorSpace : lr, Ce = (V.isMeshStandardMaterial ? Q : X).get(V.envMap || xe), ke = V.vertexColors === !0 && !!G.attributes.color && G.attributes.color.itemSize === 4, Le = !!G.attributes.tangent && (!!V.normalMap || V.anisotropy > 0), Ie = !!G.morphAttributes.position, je = !!G.morphAttributes.normal, pt = !!G.morphAttributes.color;
37571
- let At = Qn;
37593
+ let At = ei;
37572
37594
  V.toneMapped && (F === null || F.isXRRenderTarget === !0) && (At = y.toneMapping);
37573
- const Rt = G.morphAttributes.position || G.morphAttributes.normal || G.morphAttributes.color, vt = Rt !== void 0 ? Rt.length : 0, De = _.get(V), ct = S.state.lights;
37595
+ const Rt = G.morphAttributes.position || G.morphAttributes.normal || G.morphAttributes.color, yt = Rt !== void 0 ? Rt.length : 0, De = _.get(V), ut = S.state.lights;
37574
37596
  if (Me === !0 && (et === !0 || E !== K)) {
37575
37597
  const en = E === K && V.id === q;
37576
37598
  Ee.setState(V, E, en);
37577
37599
  }
37578
37600
  let tt = !1;
37579
- V.version === De.__version ? (De.needsLights && De.lightsStateVersion !== ct.state.version || De.outputColorSpace !== ve || O.isBatchedMesh && De.batching === !1 || !O.isBatchedMesh && De.batching === !0 || O.isBatchedMesh && De.batchingColor === !0 && O.colorTexture === null || O.isBatchedMesh && De.batchingColor === !1 && O.colorTexture !== null || O.isInstancedMesh && De.instancing === !1 || !O.isInstancedMesh && De.instancing === !0 || O.isSkinnedMesh && De.skinning === !1 || !O.isSkinnedMesh && De.skinning === !0 || O.isInstancedMesh && De.instancingColor === !0 && O.instanceColor === null || O.isInstancedMesh && De.instancingColor === !1 && O.instanceColor !== null || O.isInstancedMesh && De.instancingMorph === !0 && O.morphTexture === null || O.isInstancedMesh && De.instancingMorph === !1 && O.morphTexture !== null || De.envMap !== Ce || V.fog === !0 && De.fog !== pe || De.numClippingPlanes !== void 0 && (De.numClippingPlanes !== Ee.numPlanes || De.numIntersection !== Ee.numIntersection) || De.vertexAlphas !== ke || De.vertexTangents !== Le || De.morphTargets !== Ie || De.morphNormals !== je || De.morphColors !== pt || De.toneMapping !== At || De.morphTargetsCount !== vt) && (tt = !0) : (tt = !0, De.__version = V.version);
37601
+ V.version === De.__version ? (De.needsLights && De.lightsStateVersion !== ut.state.version || De.outputColorSpace !== ve || O.isBatchedMesh && De.batching === !1 || !O.isBatchedMesh && De.batching === !0 || O.isBatchedMesh && De.batchingColor === !0 && O.colorTexture === null || O.isBatchedMesh && De.batchingColor === !1 && O.colorTexture !== null || O.isInstancedMesh && De.instancing === !1 || !O.isInstancedMesh && De.instancing === !0 || O.isSkinnedMesh && De.skinning === !1 || !O.isSkinnedMesh && De.skinning === !0 || O.isInstancedMesh && De.instancingColor === !0 && O.instanceColor === null || O.isInstancedMesh && De.instancingColor === !1 && O.instanceColor !== null || O.isInstancedMesh && De.instancingMorph === !0 && O.morphTexture === null || O.isInstancedMesh && De.instancingMorph === !1 && O.morphTexture !== null || De.envMap !== Ce || V.fog === !0 && De.fog !== pe || De.numClippingPlanes !== void 0 && (De.numClippingPlanes !== Ee.numPlanes || De.numIntersection !== Ee.numIntersection) || De.vertexAlphas !== ke || De.vertexTangents !== Le || De.morphTargets !== Ie || De.morphNormals !== je || De.morphColors !== pt || De.toneMapping !== At || De.morphTargetsCount !== yt) && (tt = !0) : (tt = !0, De.__version = V.version);
37580
37602
  let pn = De.currentProgram;
37581
37603
  tt === !0 && (pn = ia(V, N, O));
37582
37604
  let Es = !1, mn = !1, fr = !1;
@@ -37590,7 +37612,7 @@ class CE {
37590
37612
  2 / (Math.log(E.far + 1) / Math.LN2)
37591
37613
  ), (V.isMeshPhongMaterial || V.isMeshToonMaterial || V.isMeshLambertMaterial || V.isMeshBasicMaterial || V.isMeshStandardMaterial || V.isShaderMaterial) && Ct.setValue(I, "isOrthographic", E.isOrthographicCamera === !0), K !== E && (K = E, mn = !0, fr = !0);
37592
37614
  }
37593
- if (De.needsLights && (ct.state.directionalShadowMap.length > 0 && Ct.setValue(I, "directionalShadowMap", ct.state.directionalShadowMap, L), ct.state.spotShadowMap.length > 0 && Ct.setValue(I, "spotShadowMap", ct.state.spotShadowMap, L), ct.state.pointShadowMap.length > 0 && Ct.setValue(I, "pointShadowMap", ct.state.pointShadowMap, L)), O.isSkinnedMesh) {
37615
+ if (De.needsLights && (ut.state.directionalShadowMap.length > 0 && Ct.setValue(I, "directionalShadowMap", ut.state.directionalShadowMap, L), ut.state.spotShadowMap.length > 0 && Ct.setValue(I, "spotShadowMap", ut.state.spotShadowMap, L), ut.state.pointShadowMap.length > 0 && Ct.setValue(I, "pointShadowMap", ut.state.pointShadowMap, L)), O.isSkinnedMesh) {
37594
37616
  Ct.setOptional(I, O, "bindMatrix"), Ct.setOptional(I, O, "bindMatrixInverse");
37595
37617
  const en = O.skeleton;
37596
37618
  en && (en.boneTexture === null && en.computeBoneTexture(), Ct.setValue(I, "boneTexture", en.boneTexture, L));
@@ -37726,9 +37748,9 @@ class CE {
37726
37748
  xe = Math.floor(Rt.width * xn), ve = Math.floor(Rt.height * xn), E.isDataArrayTexture ? Ce = Rt.depth : E.isData3DTexture ? Ce = Math.floor(Rt.depth * xn) : Ce = 1, ke = 0, Le = 0, Ie = 0;
37727
37749
  }
37728
37750
  V !== null ? (je = V.x, pt = V.y, At = V.z) : (je = 0, pt = 0, At = 0);
37729
- const vt = ae.convert(N.format), De = ae.convert(N.type);
37730
- let ct;
37731
- N.isData3DTexture ? (L.setTexture3D(N, 0), ct = I.TEXTURE_3D) : N.isDataArrayTexture || N.isCompressedArrayTexture ? (L.setTexture2DArray(N, 0), ct = I.TEXTURE_2D_ARRAY) : (L.setTexture2D(N, 0), ct = I.TEXTURE_2D), I.pixelStorei(I.UNPACK_FLIP_Y_WEBGL, N.flipY), I.pixelStorei(I.UNPACK_PREMULTIPLY_ALPHA_WEBGL, N.premultiplyAlpha), I.pixelStorei(I.UNPACK_ALIGNMENT, N.unpackAlignment);
37751
+ const yt = ae.convert(N.format), De = ae.convert(N.type);
37752
+ let ut;
37753
+ N.isData3DTexture ? (L.setTexture3D(N, 0), ut = I.TEXTURE_3D) : N.isDataArrayTexture || N.isCompressedArrayTexture ? (L.setTexture2DArray(N, 0), ut = I.TEXTURE_2D_ARRAY) : (L.setTexture2D(N, 0), ut = I.TEXTURE_2D), I.pixelStorei(I.UNPACK_FLIP_Y_WEBGL, N.flipY), I.pixelStorei(I.UNPACK_PREMULTIPLY_ALPHA_WEBGL, N.premultiplyAlpha), I.pixelStorei(I.UNPACK_ALIGNMENT, N.unpackAlignment);
37732
37754
  const tt = I.getParameter(I.UNPACK_ROW_LENGTH), pn = I.getParameter(I.UNPACK_IMAGE_HEIGHT), Es = I.getParameter(I.UNPACK_SKIP_PIXELS), mn = I.getParameter(I.UNPACK_SKIP_ROWS), fr = I.getParameter(I.UNPACK_SKIP_IMAGES);
37733
37755
  I.pixelStorei(I.UNPACK_ROW_LENGTH, Rt.width), I.pixelStorei(I.UNPACK_IMAGE_HEIGHT, Rt.height), I.pixelStorei(I.UNPACK_SKIP_PIXELS, ke), I.pixelStorei(I.UNPACK_SKIP_ROWS, Le), I.pixelStorei(I.UNPACK_SKIP_IMAGES, Ie);
37734
37756
  const Ct = E.isDataArrayTexture || E.isData3DTexture, an = N.isDataArrayTexture || N.isData3DTexture;
@@ -37742,11 +37764,11 @@ class CE {
37742
37764
  const xn = _.get(E), en = _.get(N);
37743
37765
  Ae.bindFramebuffer(I.READ_FRAMEBUFFER, Hm), Ae.bindFramebuffer(I.DRAW_FRAMEBUFFER, Wm);
37744
37766
  for (let on = 0; on < Ce; on++)
37745
- Ct ? I.framebufferTextureLayer(I.READ_FRAMEBUFFER, I.COLOR_ATTACHMENT0, xn.__webglTexture, O, Ie + on) : I.framebufferTexture2D(I.READ_FRAMEBUFFER, I.COLOR_ATTACHMENT0, I.TEXTURE_2D, xn.__webglTexture, O), an ? I.framebufferTextureLayer(I.DRAW_FRAMEBUFFER, I.COLOR_ATTACHMENT0, en.__webglTexture, pe, At + on) : I.framebufferTexture2D(I.DRAW_FRAMEBUFFER, I.COLOR_ATTACHMENT0, I.TEXTURE_2D, en.__webglTexture, pe), O !== 0 ? I.blitFramebuffer(ke, Le, xe, ve, je, pt, xe, ve, I.COLOR_BUFFER_BIT, I.NEAREST) : an ? I.copyTexSubImage3D(ct, pe, je, pt, At + on, ke, Le, xe, ve) : I.copyTexSubImage2D(ct, pe, je, pt, ke, Le, xe, ve);
37767
+ Ct ? I.framebufferTextureLayer(I.READ_FRAMEBUFFER, I.COLOR_ATTACHMENT0, xn.__webglTexture, O, Ie + on) : I.framebufferTexture2D(I.READ_FRAMEBUFFER, I.COLOR_ATTACHMENT0, I.TEXTURE_2D, xn.__webglTexture, O), an ? I.framebufferTextureLayer(I.DRAW_FRAMEBUFFER, I.COLOR_ATTACHMENT0, en.__webglTexture, pe, At + on) : I.framebufferTexture2D(I.DRAW_FRAMEBUFFER, I.COLOR_ATTACHMENT0, I.TEXTURE_2D, en.__webglTexture, pe), O !== 0 ? I.blitFramebuffer(ke, Le, xe, ve, je, pt, xe, ve, I.COLOR_BUFFER_BIT, I.NEAREST) : an ? I.copyTexSubImage3D(ut, pe, je, pt, At + on, ke, Le, xe, ve) : I.copyTexSubImage2D(ut, pe, je, pt, ke, Le, xe, ve);
37746
37768
  Ae.bindFramebuffer(I.READ_FRAMEBUFFER, null), Ae.bindFramebuffer(I.DRAW_FRAMEBUFFER, null);
37747
37769
  } else
37748
- an ? E.isDataTexture || E.isData3DTexture ? I.texSubImage3D(ct, pe, je, pt, At, xe, ve, Ce, vt, De, Rt.data) : N.isCompressedArrayTexture ? I.compressedTexSubImage3D(ct, pe, je, pt, At, xe, ve, Ce, vt, Rt.data) : I.texSubImage3D(ct, pe, je, pt, At, xe, ve, Ce, vt, De, Rt) : E.isDataTexture ? I.texSubImage2D(I.TEXTURE_2D, pe, je, pt, xe, ve, vt, De, Rt.data) : E.isCompressedTexture ? I.compressedTexSubImage2D(I.TEXTURE_2D, pe, je, pt, Rt.width, Rt.height, vt, Rt.data) : I.texSubImage2D(I.TEXTURE_2D, pe, je, pt, xe, ve, vt, De, Rt);
37749
- I.pixelStorei(I.UNPACK_ROW_LENGTH, tt), I.pixelStorei(I.UNPACK_IMAGE_HEIGHT, pn), I.pixelStorei(I.UNPACK_SKIP_PIXELS, Es), I.pixelStorei(I.UNPACK_SKIP_ROWS, mn), I.pixelStorei(I.UNPACK_SKIP_IMAGES, fr), pe === 0 && N.generateMipmaps && I.generateMipmap(ct), Ae.unbindTexture();
37770
+ an ? E.isDataTexture || E.isData3DTexture ? I.texSubImage3D(ut, pe, je, pt, At, xe, ve, Ce, yt, De, Rt.data) : N.isCompressedArrayTexture ? I.compressedTexSubImage3D(ut, pe, je, pt, At, xe, ve, Ce, yt, Rt.data) : I.texSubImage3D(ut, pe, je, pt, At, xe, ve, Ce, yt, De, Rt) : E.isDataTexture ? I.texSubImage2D(I.TEXTURE_2D, pe, je, pt, xe, ve, yt, De, Rt.data) : E.isCompressedTexture ? I.compressedTexSubImage2D(I.TEXTURE_2D, pe, je, pt, Rt.width, Rt.height, yt, Rt.data) : I.texSubImage2D(I.TEXTURE_2D, pe, je, pt, xe, ve, yt, De, Rt);
37771
+ I.pixelStorei(I.UNPACK_ROW_LENGTH, tt), I.pixelStorei(I.UNPACK_IMAGE_HEIGHT, pn), I.pixelStorei(I.UNPACK_SKIP_PIXELS, Es), I.pixelStorei(I.UNPACK_SKIP_ROWS, mn), I.pixelStorei(I.UNPACK_SKIP_IMAGES, fr), pe === 0 && N.generateMipmaps && I.generateMipmap(ut), Ae.unbindTexture();
37750
37772
  }, this.initRenderTarget = function(E) {
37751
37773
  _.get(E).__webglFramebuffer === void 0 && L.setupRenderTarget(E);
37752
37774
  }, this.initTexture = function(E) {
@@ -37765,7 +37787,7 @@ class CE {
37765
37787
  * @readonly
37766
37788
  */
37767
37789
  get coordinateSystem() {
37768
- return Jn;
37790
+ return Zn;
37769
37791
  }
37770
37792
  /**
37771
37793
  * Defines the output color space of the renderer.
@@ -38294,8 +38316,8 @@ class Hd {
38294
38316
  uColorContrast: { value: this.config.colorContrast }
38295
38317
  },
38296
38318
  transparent: !0,
38297
- side: Ei
38298
- }), this.orb = new zn(t, this.orbMaterial), this.scene.add(this.orb);
38319
+ side: Mi
38320
+ }), this.orb = new Gn(t, this.orbMaterial), this.scene.add(this.orb);
38299
38321
  const n = new Gd(
38300
38322
  this.config.size,
38301
38323
  64,
@@ -38317,7 +38339,7 @@ class Hd {
38317
38339
  side: nn,
38318
38340
  blending: rl,
38319
38341
  depthWrite: !1
38320
- }), this.glowMesh = new zn(n, this.glowMaterial), this.scene.add(this.glowMesh);
38342
+ }), this.glowMesh = new Gn(n, this.glowMaterial), this.scene.add(this.glowMesh);
38321
38343
  }
38322
38344
  /**
38323
38345
  * Update audio data with smoothing
@@ -38803,7 +38825,7 @@ class qd {
38803
38825
  this.hasAcquired && (tr.release(), this.hasAcquired = !1);
38804
38826
  }
38805
38827
  }
38806
- const fi = {
38828
+ const pi = {
38807
38829
  default: {
38808
38830
  primary: "#6366f1",
38809
38831
  secondary: "#8b5cf6",
@@ -38881,7 +38903,7 @@ const fi = {
38881
38903
  highlight: "#dbeafe"
38882
38904
  // Light blue
38883
38905
  }
38884
- }, pi = {
38906
+ }, mi = {
38885
38907
  indigo: {
38886
38908
  primary: "#3730a3",
38887
38909
  secondary: "#4338ca",
@@ -38950,93 +38972,93 @@ const fi = {
38950
38972
  }
38951
38973
  };
38952
38974
  function HE(i, e = "dark") {
38953
- const t = e === "dark" ? fi : pi;
38975
+ const t = e === "dark" ? pi : mi;
38954
38976
  return t[i] || t[Object.keys(t)[0]];
38955
38977
  }
38956
38978
  function WE(i = "dark") {
38957
- return Object.keys(i === "dark" ? fi : pi);
38979
+ return Object.keys(i === "dark" ? pi : mi);
38958
38980
  }
38959
38981
  const Yr = {
38960
38982
  default: {
38961
38983
  dark: {
38962
- colors: fi.default,
38984
+ colors: pi.default,
38963
38985
  glowIntensity: 1.2,
38964
38986
  idleGlowMultiplier: 0.6
38965
38987
  },
38966
38988
  light: {
38967
- colors: pi.indigo,
38989
+ colors: mi.indigo,
38968
38990
  glowIntensity: 1.8,
38969
38991
  idleGlowMultiplier: 1.2
38970
38992
  }
38971
38993
  },
38972
38994
  emerald: {
38973
38995
  dark: {
38974
- colors: fi.emerald,
38996
+ colors: pi.emerald,
38975
38997
  glowIntensity: 1.2,
38976
38998
  idleGlowMultiplier: 0.6
38977
38999
  },
38978
39000
  light: {
38979
- colors: pi.teal,
39001
+ colors: mi.teal,
38980
39002
  glowIntensity: 1.8,
38981
39003
  idleGlowMultiplier: 1.2
38982
39004
  }
38983
39005
  },
38984
39006
  rose: {
38985
39007
  dark: {
38986
- colors: fi.rose,
39008
+ colors: pi.rose,
38987
39009
  glowIntensity: 1.2,
38988
39010
  idleGlowMultiplier: 0.6
38989
39011
  },
38990
39012
  light: {
38991
- colors: pi.pink,
39013
+ colors: mi.pink,
38992
39014
  glowIntensity: 1.8,
38993
39015
  idleGlowMultiplier: 1.2
38994
39016
  }
38995
39017
  },
38996
39018
  amber: {
38997
39019
  dark: {
38998
- colors: fi.amber,
39020
+ colors: pi.amber,
38999
39021
  glowIntensity: 1.2,
39000
39022
  idleGlowMultiplier: 0.6
39001
39023
  },
39002
39024
  light: {
39003
- colors: pi.orange,
39025
+ colors: mi.orange,
39004
39026
  glowIntensity: 1.8,
39005
39027
  idleGlowMultiplier: 1.2
39006
39028
  }
39007
39029
  },
39008
39030
  cyan: {
39009
39031
  dark: {
39010
- colors: fi.cyan,
39032
+ colors: pi.cyan,
39011
39033
  glowIntensity: 1.2,
39012
39034
  idleGlowMultiplier: 0.6
39013
39035
  },
39014
39036
  light: {
39015
- colors: pi.blue,
39037
+ colors: mi.blue,
39016
39038
  glowIntensity: 1.8,
39017
39039
  idleGlowMultiplier: 1.2
39018
39040
  }
39019
39041
  },
39020
39042
  purple: {
39021
39043
  dark: {
39022
- colors: fi.purple,
39044
+ colors: pi.purple,
39023
39045
  glowIntensity: 1.2,
39024
39046
  idleGlowMultiplier: 0.6
39025
39047
  },
39026
39048
  light: {
39027
- colors: pi.violet,
39049
+ colors: mi.violet,
39028
39050
  glowIntensity: 1.8,
39029
39051
  idleGlowMultiplier: 1.2
39030
39052
  }
39031
39053
  },
39032
39054
  blue: {
39033
39055
  dark: {
39034
- colors: fi.blue,
39056
+ colors: pi.blue,
39035
39057
  glowIntensity: 1.2,
39036
39058
  idleGlowMultiplier: 0.6
39037
39059
  },
39038
39060
  light: {
39039
- colors: pi.blue,
39061
+ colors: mi.blue,
39040
39062
  glowIntensity: 1.8,
39041
39063
  idleGlowMultiplier: 1.2
39042
39064
  }
@@ -39072,14 +39094,14 @@ function $E(i, e) {
39072
39094
  t.removeEventListener("change", n);
39073
39095
  };
39074
39096
  }
39075
- var IE = Object.defineProperty, DE = Object.getOwnPropertyDescriptor, _t = (i, e, t, n) => {
39097
+ var IE = Object.defineProperty, DE = Object.getOwnPropertyDescriptor, gt = (i, e, t, n) => {
39076
39098
  for (var s = n > 1 ? void 0 : n ? DE(e, t) : e, r = i.length - 1, a; r >= 0; r--)
39077
39099
  (a = i[r]) && (s = (n ? a(e, t, s) : a(s)) || s);
39078
39100
  return n && s && IE(e, t, s), s;
39079
39101
  };
39080
- let dt = class extends gs {
39102
+ let at = class extends gs {
39081
39103
  constructor() {
39082
- super(), this.callManager = new wd(), this.healthMonitor = new Ad(), this.orbRenderer = null, this.audioAnalyzer = null, this.soundManager = null, this.orbContainerRef = ad(), this.animationId = null, this.pendingTimers = /* @__PURE__ */ new Set(), this.isPageVisible = !0, this.animationStartTime = 0, this.intersectionObserver = null, this.isOrbInitialized = !1, this.intersectionTimeoutId = null, this.callStatus = "idle", this.microphoneEnabled = !1, this.serviceUnavailable = !1, this.buttonStartText = "Try to call", this.buttonConnectingText = "Connecting...", this.size = 370, this.containerPadding = 45, this.theme = "default", this.themeMode = "auto", this.orbColors = {}, this.glowIntensity = 0.8, this.idleGlowMultiplier = 0.4, this.morphStrength = 1, this.noiseScale = 1.5, this.noiseSpeed = 0.3, this.fresnelPower = 2.5, this.rotationSpeed = 0.1, this.audioReactivity = 3, this.audioSmoothing = 0.9, this.idleMorphMultiplier = 0.25, this.colorContrast = 1.5, this.soundEnabled = !0, this.soundVolume = 0.25, this.soundPreset = "1", this.handleAudioTrack = async (i) => {
39104
+ super(), this.callManager = new wd(), this.healthMonitor = new Ad(), this.orbRenderer = null, this.audioAnalyzer = null, this.soundManager = null, this.orbContainerRef = ad(), this.animationId = null, this.pendingTimers = /* @__PURE__ */ new Set(), this.isPageVisible = !0, this.animationStartTime = 0, this.intersectionObserver = null, this.isOrbInitialized = !1, this.intersectionTimeoutId = null, this.callStatus = "idle", this.microphoneEnabled = !1, this.microphoneInitialized = !1, this.serviceUnavailable = !1, this.buttonStartText = "Try to call", this.buttonConnectingText = "Connecting...", this.size = 370, this.containerPadding = 45, this.theme = "default", this.themeMode = "auto", this.orbColors = {}, this.glowIntensity = 0.8, this.idleGlowMultiplier = 0.4, this.morphStrength = 1, this.noiseScale = 1.5, this.noiseSpeed = 0.3, this.fresnelPower = 2.5, this.rotationSpeed = 0.1, this.audioReactivity = 3, this.audioSmoothing = 0.9, this.idleMorphMultiplier = 0.25, this.colorContrast = 1.5, this.soundEnabled = !0, this.soundVolume = 0.25, this.soundPreset = "1", this.handleAudioTrack = async (i) => {
39083
39105
  const t = i.detail;
39084
39106
  if (!(!t || !this.audioAnalyzer))
39085
39107
  try {
@@ -39098,9 +39120,9 @@ let dt = class extends gs {
39098
39120
  console.error("Failed to connect local audio stream:", n);
39099
39121
  }
39100
39122
  }, this.handleMicrophoneEnabled = () => {
39101
- this.microphoneEnabled = !0;
39123
+ this.microphoneEnabled = !0, this.microphoneInitialized = !0;
39102
39124
  }, this.handleMicrophoneDisabled = () => {
39103
- this.microphoneEnabled = !1;
39125
+ this.microphoneEnabled = !1, this.microphoneInitialized = !0;
39104
39126
  }, this.handleHealthChange = (i) => {
39105
39127
  const e = i.detail;
39106
39128
  this.serviceUnavailable = e === "unhealthy";
@@ -39119,7 +39141,7 @@ let dt = class extends gs {
39119
39141
  );
39120
39142
  break;
39121
39143
  case "disconnected":
39122
- this.callStatus = "idle", (n = this.orbRenderer) == null || n.setActive(!1), (s = this.audioAnalyzer) == null || s.disconnect(), this.startIdleAnimation(), this.scheduleTimer(() => {
39144
+ this.callStatus = "idle", this.microphoneInitialized = !1, (n = this.orbRenderer) == null || n.setActive(!1), (s = this.audioAnalyzer) == null || s.disconnect(), this.startIdleAnimation(), this.scheduleTimer(() => {
39123
39145
  var o;
39124
39146
  (o = this.soundManager) == null || o.playCallEndSound();
39125
39147
  }, 150), this.dispatchEvent(
@@ -39555,7 +39577,7 @@ let dt = class extends gs {
39555
39577
  @click=${this.toggleCall}
39556
39578
  ${od(this.orbContainerRef)}
39557
39579
  >
39558
- ${this.callStatus === "connected" && !this.microphoneEnabled ? Xt`
39580
+ ${this.callStatus === "connected" && this.microphoneInitialized && !this.microphoneEnabled ? Xt`
39559
39581
  <div class="microphone-indicator visible">
39560
39582
  <svg viewBox="0 0 24 24" fill="none">
39561
39583
  <path
@@ -39605,101 +39627,104 @@ let dt = class extends gs {
39605
39627
  `;
39606
39628
  }
39607
39629
  };
39608
- dt.styles = nd`
39630
+ at.styles = nd`
39609
39631
  :host {
39610
39632
  display: inline-block;
39611
39633
  contain: layout style;
39612
39634
  }
39613
39635
  `;
39614
- _t([
39636
+ gt([
39615
39637
  ye({ type: String, attribute: "agent-id" })
39616
- ], dt.prototype, "agentId", 2);
39617
- _t([
39638
+ ], at.prototype, "agentId", 2);
39639
+ gt([
39618
39640
  ye({ type: String, attribute: "voice-service-url" })
39619
- ], dt.prototype, "voiceServiceUrl", 2);
39620
- _t([
39621
- Ri()
39622
- ], dt.prototype, "callStatus", 2);
39623
- _t([
39624
- Ri()
39625
- ], dt.prototype, "microphoneEnabled", 2);
39626
- _t([
39627
- Ri()
39628
- ], dt.prototype, "serviceUnavailable", 2);
39629
- _t([
39641
+ ], at.prototype, "voiceServiceUrl", 2);
39642
+ gt([
39643
+ An()
39644
+ ], at.prototype, "callStatus", 2);
39645
+ gt([
39646
+ An()
39647
+ ], at.prototype, "microphoneEnabled", 2);
39648
+ gt([
39649
+ An()
39650
+ ], at.prototype, "microphoneInitialized", 2);
39651
+ gt([
39652
+ An()
39653
+ ], at.prototype, "serviceUnavailable", 2);
39654
+ gt([
39630
39655
  ye({ type: String, attribute: "button-start-text" })
39631
- ], dt.prototype, "buttonStartText", 2);
39632
- _t([
39656
+ ], at.prototype, "buttonStartText", 2);
39657
+ gt([
39633
39658
  ye({ type: String, attribute: "button-connecting-text" })
39634
- ], dt.prototype, "buttonConnectingText", 2);
39635
- _t([
39659
+ ], at.prototype, "buttonConnectingText", 2);
39660
+ gt([
39636
39661
  ye({ type: Number, attribute: "size" })
39637
- ], dt.prototype, "size", 2);
39638
- _t([
39662
+ ], at.prototype, "size", 2);
39663
+ gt([
39639
39664
  ye({ type: Number, attribute: "container-padding" })
39640
- ], dt.prototype, "containerPadding", 2);
39641
- _t([
39665
+ ], at.prototype, "containerPadding", 2);
39666
+ gt([
39642
39667
  ye({ type: String, attribute: "theme", reflect: !0 })
39643
- ], dt.prototype, "theme", 2);
39644
- _t([
39668
+ ], at.prototype, "theme", 2);
39669
+ gt([
39645
39670
  ye({ type: String, attribute: "theme-mode" })
39646
- ], dt.prototype, "themeMode", 2);
39647
- _t([
39671
+ ], at.prototype, "themeMode", 2);
39672
+ gt([
39648
39673
  ye({ type: Object, attribute: "orb-colors" })
39649
- ], dt.prototype, "orbColors", 2);
39650
- _t([
39674
+ ], at.prototype, "orbColors", 2);
39675
+ gt([
39651
39676
  ye({ type: Number, attribute: "glow-intensity" })
39652
- ], dt.prototype, "glowIntensity", 2);
39653
- _t([
39677
+ ], at.prototype, "glowIntensity", 2);
39678
+ gt([
39654
39679
  ye({ type: Number, attribute: "idle-glow-multiplier" })
39655
- ], dt.prototype, "idleGlowMultiplier", 2);
39656
- _t([
39680
+ ], at.prototype, "idleGlowMultiplier", 2);
39681
+ gt([
39657
39682
  ye({ type: Number, attribute: "morph-strength" })
39658
- ], dt.prototype, "morphStrength", 2);
39659
- _t([
39683
+ ], at.prototype, "morphStrength", 2);
39684
+ gt([
39660
39685
  ye({ type: Number, attribute: "noise-scale" })
39661
- ], dt.prototype, "noiseScale", 2);
39662
- _t([
39686
+ ], at.prototype, "noiseScale", 2);
39687
+ gt([
39663
39688
  ye({ type: Number, attribute: "noise-speed" })
39664
- ], dt.prototype, "noiseSpeed", 2);
39665
- _t([
39689
+ ], at.prototype, "noiseSpeed", 2);
39690
+ gt([
39666
39691
  ye({ type: Number, attribute: "fresnel-power" })
39667
- ], dt.prototype, "fresnelPower", 2);
39668
- _t([
39692
+ ], at.prototype, "fresnelPower", 2);
39693
+ gt([
39669
39694
  ye({ type: Number, attribute: "rotation-speed" })
39670
- ], dt.prototype, "rotationSpeed", 2);
39671
- _t([
39695
+ ], at.prototype, "rotationSpeed", 2);
39696
+ gt([
39672
39697
  ye({ type: Number, attribute: "audio-reactivity" })
39673
- ], dt.prototype, "audioReactivity", 2);
39674
- _t([
39698
+ ], at.prototype, "audioReactivity", 2);
39699
+ gt([
39675
39700
  ye({ type: Number, attribute: "audio-smoothing" })
39676
- ], dt.prototype, "audioSmoothing", 2);
39677
- _t([
39701
+ ], at.prototype, "audioSmoothing", 2);
39702
+ gt([
39678
39703
  ye({ type: Number, attribute: "idle-morph-multiplier" })
39679
- ], dt.prototype, "idleMorphMultiplier", 2);
39680
- _t([
39704
+ ], at.prototype, "idleMorphMultiplier", 2);
39705
+ gt([
39681
39706
  ye({ type: Number, attribute: "color-contrast" })
39682
- ], dt.prototype, "colorContrast", 2);
39683
- _t([
39707
+ ], at.prototype, "colorContrast", 2);
39708
+ gt([
39684
39709
  ye({ type: Boolean, attribute: "sound-enabled" })
39685
- ], dt.prototype, "soundEnabled", 2);
39686
- _t([
39710
+ ], at.prototype, "soundEnabled", 2);
39711
+ gt([
39687
39712
  ye({ type: Number, attribute: "sound-volume" })
39688
- ], dt.prototype, "soundVolume", 2);
39689
- _t([
39713
+ ], at.prototype, "soundVolume", 2);
39714
+ gt([
39690
39715
  ye({ type: String, attribute: "sound-preset" })
39691
- ], dt.prototype, "soundPreset", 2);
39692
- dt = _t([
39716
+ ], at.prototype, "soundPreset", 2);
39717
+ at = gt([
39693
39718
  rd("hanc-ai-inline-call")
39694
- ], dt);
39695
- var LE = Object.defineProperty, NE = Object.getOwnPropertyDescriptor, yt = (i, e, t, n) => {
39719
+ ], at);
39720
+ var LE = Object.defineProperty, NE = Object.getOwnPropertyDescriptor, vt = (i, e, t, n) => {
39696
39721
  for (var s = n > 1 ? void 0 : n ? NE(e, t) : e, r = i.length - 1, a; r >= 0; r--)
39697
39722
  (a = i[r]) && (s = (n ? a(e, t, s) : a(s)) || s);
39698
39723
  return n && s && LE(e, t, s), s;
39699
39724
  };
39700
- let ut = class extends gs {
39725
+ let ot = class extends gs {
39701
39726
  constructor() {
39702
- super(), this.callManager = new wd(), this.healthMonitor = new Ad(), this.orbRenderer = null, this.audioAnalyzer = null, this.soundManager = null, this.orbContainerRef = ad(), this.animationId = null, this.pendingTimers = /* @__PURE__ */ new Set(), this.isPageVisible = !0, this.animationStartTime = 0, this.intersectionObserver = null, this.isOrbInitialized = !1, this.callStatus = "idle", this.microphoneEnabled = !1, this.serviceUnavailable = !1, this.buttonStartText = "Call", this.buttonConnectingText = "Connecting...", this.position = "bottom-right", this.size = 120, this.theme = "default", this.themeMode = "auto", this.orbColors = {}, this.glowIntensity = 0.8, this.idleGlowMultiplier = 0.4, this.morphStrength = 1, this.noiseScale = 1.5, this.noiseSpeed = 0.3, this.fresnelPower = 2.5, this.rotationSpeed = 0.1, this.audioReactivity = 3, this.audioSmoothing = 0.9, this.idleMorphMultiplier = 0.25, this.colorContrast = 1.5, this.soundEnabled = !0, this.soundVolume = 0.25, this.soundPreset = "1", this.handleAudioTrack = async (i) => {
39727
+ super(), this.callManager = new wd(), this.healthMonitor = new Ad(), this.orbRenderer = null, this.audioAnalyzer = null, this.soundManager = null, this.orbContainerRef = ad(), this.animationId = null, this.pendingTimers = /* @__PURE__ */ new Set(), this.isPageVisible = !0, this.animationStartTime = 0, this.intersectionObserver = null, this.isOrbInitialized = !1, this.callStatus = "idle", this.microphoneEnabled = !1, this.microphoneInitialized = !1, this.serviceUnavailable = !1, this.buttonStartText = "Call", this.buttonConnectingText = "Connecting...", this.position = "bottom-right", this.size = 120, this.theme = "default", this.themeMode = "auto", this.orbColors = {}, this.glowIntensity = 0.8, this.idleGlowMultiplier = 0.4, this.morphStrength = 1, this.noiseScale = 1.5, this.noiseSpeed = 0.3, this.fresnelPower = 2.5, this.rotationSpeed = 0.1, this.audioReactivity = 3, this.audioSmoothing = 0.9, this.idleMorphMultiplier = 0.25, this.colorContrast = 1.5, this.soundEnabled = !0, this.soundVolume = 0.25, this.soundPreset = "1", this.handleAudioTrack = async (i) => {
39703
39728
  const t = i.detail;
39704
39729
  if (!(!t || !this.audioAnalyzer))
39705
39730
  try {
@@ -39718,9 +39743,9 @@ let ut = class extends gs {
39718
39743
  console.error("Failed to connect local audio stream:", n);
39719
39744
  }
39720
39745
  }, this.handleMicrophoneEnabled = () => {
39721
- this.microphoneEnabled = !0;
39746
+ this.microphoneEnabled = !0, this.microphoneInitialized = !0;
39722
39747
  }, this.handleMicrophoneDisabled = () => {
39723
- this.microphoneEnabled = !1;
39748
+ this.microphoneEnabled = !1, this.microphoneInitialized = !0;
39724
39749
  }, this.handleHealthChange = (i) => {
39725
39750
  const e = i.detail;
39726
39751
  this.serviceUnavailable = e === "unhealthy";
@@ -39739,7 +39764,7 @@ let ut = class extends gs {
39739
39764
  );
39740
39765
  break;
39741
39766
  case "disconnected":
39742
- this.callStatus = "idle", (n = this.orbRenderer) == null || n.setActive(!1), (s = this.audioAnalyzer) == null || s.disconnect(), this.startIdleAnimation(), this.scheduleTimer(() => {
39767
+ this.callStatus = "idle", this.microphoneInitialized = !1, (n = this.orbRenderer) == null || n.setActive(!1), (s = this.audioAnalyzer) == null || s.disconnect(), this.startIdleAnimation(), this.scheduleTimer(() => {
39743
39768
  var o;
39744
39769
  (o = this.soundManager) == null || o.playCallEndSound();
39745
39770
  }, 150), this.dispatchEvent(
@@ -40158,7 +40183,7 @@ let ut = class extends gs {
40158
40183
  @click=${this.toggleCall}
40159
40184
  ${od(this.orbContainerRef)}
40160
40185
  >
40161
- ${this.callStatus === "connected" && !this.microphoneEnabled ? Xt`
40186
+ ${this.callStatus === "connected" && this.microphoneInitialized && !this.microphoneEnabled ? Xt`
40162
40187
  <div class="microphone-indicator visible">
40163
40188
  <svg viewBox="0 0 24 24" fill="none">
40164
40189
  <path
@@ -40207,100 +40232,103 @@ let ut = class extends gs {
40207
40232
  `;
40208
40233
  }
40209
40234
  };
40210
- ut.styles = nd`
40235
+ ot.styles = nd`
40211
40236
  :host {
40212
40237
  display: block;
40213
40238
  }
40214
40239
  `;
40215
- yt([
40240
+ vt([
40216
40241
  ye({ type: String, attribute: "agent-id" })
40217
- ], ut.prototype, "agentId", 2);
40218
- yt([
40242
+ ], ot.prototype, "agentId", 2);
40243
+ vt([
40219
40244
  ye({ type: String, attribute: "voice-service-url" })
40220
- ], ut.prototype, "voiceServiceUrl", 2);
40221
- yt([
40222
- Ri()
40223
- ], ut.prototype, "callStatus", 2);
40224
- yt([
40225
- Ri()
40226
- ], ut.prototype, "microphoneEnabled", 2);
40227
- yt([
40228
- Ri()
40229
- ], ut.prototype, "serviceUnavailable", 2);
40230
- yt([
40245
+ ], ot.prototype, "voiceServiceUrl", 2);
40246
+ vt([
40247
+ An()
40248
+ ], ot.prototype, "callStatus", 2);
40249
+ vt([
40250
+ An()
40251
+ ], ot.prototype, "microphoneEnabled", 2);
40252
+ vt([
40253
+ An()
40254
+ ], ot.prototype, "microphoneInitialized", 2);
40255
+ vt([
40256
+ An()
40257
+ ], ot.prototype, "serviceUnavailable", 2);
40258
+ vt([
40231
40259
  ye({ type: String, attribute: "button-start-text" })
40232
- ], ut.prototype, "buttonStartText", 2);
40233
- yt([
40260
+ ], ot.prototype, "buttonStartText", 2);
40261
+ vt([
40234
40262
  ye({ type: String, attribute: "button-connecting-text" })
40235
- ], ut.prototype, "buttonConnectingText", 2);
40236
- yt([
40263
+ ], ot.prototype, "buttonConnectingText", 2);
40264
+ vt([
40237
40265
  ye({ type: String, attribute: "position" })
40238
- ], ut.prototype, "position", 2);
40239
- yt([
40266
+ ], ot.prototype, "position", 2);
40267
+ vt([
40240
40268
  ye({ type: Number, attribute: "size" })
40241
- ], ut.prototype, "size", 2);
40242
- yt([
40269
+ ], ot.prototype, "size", 2);
40270
+ vt([
40243
40271
  ye({ type: String, attribute: "theme" })
40244
- ], ut.prototype, "theme", 2);
40245
- yt([
40272
+ ], ot.prototype, "theme", 2);
40273
+ vt([
40246
40274
  ye({ type: String, attribute: "theme-mode" })
40247
- ], ut.prototype, "themeMode", 2);
40248
- yt([
40275
+ ], ot.prototype, "themeMode", 2);
40276
+ vt([
40249
40277
  ye({ type: Object, attribute: "orb-colors" })
40250
- ], ut.prototype, "orbColors", 2);
40251
- yt([
40278
+ ], ot.prototype, "orbColors", 2);
40279
+ vt([
40252
40280
  ye({ type: Number, attribute: "glow-intensity" })
40253
- ], ut.prototype, "glowIntensity", 2);
40254
- yt([
40281
+ ], ot.prototype, "glowIntensity", 2);
40282
+ vt([
40255
40283
  ye({ type: Number, attribute: "idle-glow-multiplier" })
40256
- ], ut.prototype, "idleGlowMultiplier", 2);
40257
- yt([
40284
+ ], ot.prototype, "idleGlowMultiplier", 2);
40285
+ vt([
40258
40286
  ye({ type: Number, attribute: "morph-strength" })
40259
- ], ut.prototype, "morphStrength", 2);
40260
- yt([
40287
+ ], ot.prototype, "morphStrength", 2);
40288
+ vt([
40261
40289
  ye({ type: Number, attribute: "noise-scale" })
40262
- ], ut.prototype, "noiseScale", 2);
40263
- yt([
40290
+ ], ot.prototype, "noiseScale", 2);
40291
+ vt([
40264
40292
  ye({ type: Number, attribute: "noise-speed" })
40265
- ], ut.prototype, "noiseSpeed", 2);
40266
- yt([
40293
+ ], ot.prototype, "noiseSpeed", 2);
40294
+ vt([
40267
40295
  ye({ type: Number, attribute: "fresnel-power" })
40268
- ], ut.prototype, "fresnelPower", 2);
40269
- yt([
40296
+ ], ot.prototype, "fresnelPower", 2);
40297
+ vt([
40270
40298
  ye({ type: Number, attribute: "rotation-speed" })
40271
- ], ut.prototype, "rotationSpeed", 2);
40272
- yt([
40299
+ ], ot.prototype, "rotationSpeed", 2);
40300
+ vt([
40273
40301
  ye({ type: Number, attribute: "audio-reactivity" })
40274
- ], ut.prototype, "audioReactivity", 2);
40275
- yt([
40302
+ ], ot.prototype, "audioReactivity", 2);
40303
+ vt([
40276
40304
  ye({ type: Number, attribute: "audio-smoothing" })
40277
- ], ut.prototype, "audioSmoothing", 2);
40278
- yt([
40305
+ ], ot.prototype, "audioSmoothing", 2);
40306
+ vt([
40279
40307
  ye({ type: Number, attribute: "idle-morph-multiplier" })
40280
- ], ut.prototype, "idleMorphMultiplier", 2);
40281
- yt([
40308
+ ], ot.prototype, "idleMorphMultiplier", 2);
40309
+ vt([
40282
40310
  ye({ type: Number, attribute: "color-contrast" })
40283
- ], ut.prototype, "colorContrast", 2);
40284
- yt([
40311
+ ], ot.prototype, "colorContrast", 2);
40312
+ vt([
40285
40313
  ye({ type: Boolean, attribute: "sound-enabled" })
40286
- ], ut.prototype, "soundEnabled", 2);
40287
- yt([
40314
+ ], ot.prototype, "soundEnabled", 2);
40315
+ vt([
40288
40316
  ye({ type: Number, attribute: "sound-volume" })
40289
- ], ut.prototype, "soundVolume", 2);
40290
- yt([
40317
+ ], ot.prototype, "soundVolume", 2);
40318
+ vt([
40291
40319
  ye({ type: String, attribute: "sound-preset" })
40292
- ], ut.prototype, "soundPreset", 2);
40293
- ut = yt([
40320
+ ], ot.prototype, "soundPreset", 2);
40321
+ ot = vt([
40294
40322
  rd("hanc-ai-floating-call")
40295
- ], ut);
40296
- var UE = Object.defineProperty, OE = Object.getOwnPropertyDescriptor, St = (i, e, t, n) => {
40323
+ ], ot);
40324
+ var UE = Object.defineProperty, OE = Object.getOwnPropertyDescriptor, bt = (i, e, t, n) => {
40297
40325
  for (var s = n > 1 ? void 0 : n ? OE(e, t) : e, r = i.length - 1, a; r >= 0; r--)
40298
40326
  (a = i[r]) && (s = (n ? a(e, t, s) : a(s)) || s);
40299
40327
  return n && s && UE(e, t, s), s;
40300
40328
  };
40301
- let ht = class extends gs {
40329
+ let ct = class extends gs {
40302
40330
  constructor() {
40303
- super(), this.callManager = new wd(), this.healthMonitor = new Ad(), this.orbRenderer = null, this.audioAnalyzer = null, this.soundManager = null, this.orbContainerRef = ad(), this.animationId = null, this.pendingTimers = /* @__PURE__ */ new Set(), this.isPageVisible = !0, this.animationStartTime = 0, this.intersectionObserver = null, this.isOrbInitialized = !1, this.callStatus = "idle", this.microphoneEnabled = !1, this.serviceUnavailable = !1, this.buttonStartText = "Talk to AI Agent", this.buttonConnectingText = "Connecting...", this.buttonEndText = "End call", this.orbSize = 48, this.theme = "default", this.themeMode = "auto", this.orbColors = {}, this.glowIntensity = 0.8, this.idleGlowMultiplier = 0.4, this.morphStrength = 1, this.noiseScale = 1.5, this.noiseSpeed = 0.3, this.fresnelPower = 2.5, this.rotationSpeed = 0.1, this.audioReactivity = 3, this.audioSmoothing = 0.9, this.idleMorphMultiplier = 0.25, this.colorContrast = 1.5, this.soundEnabled = !0, this.soundVolume = 0.25, this.soundPreset = "1", this.handleAudioTrack = async (i) => {
40331
+ super(), this.callManager = new wd(), this.healthMonitor = new Ad(), this.orbRenderer = null, this.audioAnalyzer = null, this.soundManager = null, this.orbContainerRef = ad(), this.animationId = null, this.pendingTimers = /* @__PURE__ */ new Set(), this.isPageVisible = !0, this.animationStartTime = 0, this.intersectionObserver = null, this.isOrbInitialized = !1, this.callStatus = "idle", this.microphoneEnabled = !1, this.microphoneInitialized = !1, this.serviceUnavailable = !1, this.buttonStartText = "Talk to AI Agent", this.buttonConnectingText = "Connecting...", this.buttonEndText = "End call", this.orbSize = 48, this.theme = "default", this.themeMode = "auto", this.orbColors = {}, this.glowIntensity = 0.8, this.idleGlowMultiplier = 0.4, this.morphStrength = 1, this.noiseScale = 1.5, this.noiseSpeed = 0.3, this.fresnelPower = 2.5, this.rotationSpeed = 0.1, this.audioReactivity = 3, this.audioSmoothing = 0.9, this.idleMorphMultiplier = 0.25, this.colorContrast = 1.5, this.soundEnabled = !0, this.soundVolume = 0.25, this.soundPreset = "1", this.handleAudioTrack = async (i) => {
40304
40332
  const t = i.detail;
40305
40333
  if (!(!t || !this.audioAnalyzer))
40306
40334
  try {
@@ -40319,9 +40347,9 @@ let ht = class extends gs {
40319
40347
  console.error("Failed to connect local audio stream:", n);
40320
40348
  }
40321
40349
  }, this.handleMicrophoneEnabled = () => {
40322
- this.microphoneEnabled = !0;
40350
+ this.microphoneEnabled = !0, this.microphoneInitialized = !0;
40323
40351
  }, this.handleMicrophoneDisabled = () => {
40324
- this.microphoneEnabled = !1;
40352
+ this.microphoneEnabled = !1, this.microphoneInitialized = !0;
40325
40353
  }, this.handleHealthChange = (i) => {
40326
40354
  const e = i.detail;
40327
40355
  this.serviceUnavailable = e === "unhealthy";
@@ -40340,7 +40368,7 @@ let ht = class extends gs {
40340
40368
  );
40341
40369
  break;
40342
40370
  case "disconnected":
40343
- this.callStatus = "idle", (n = this.orbRenderer) == null || n.setActive(!1), (s = this.audioAnalyzer) == null || s.disconnect(), this.startIdleAnimation(), this.scheduleTimer(() => {
40371
+ this.callStatus = "idle", this.microphoneInitialized = !1, (n = this.orbRenderer) == null || n.setActive(!1), (s = this.audioAnalyzer) == null || s.disconnect(), this.startIdleAnimation(), this.scheduleTimer(() => {
40344
40372
  var o;
40345
40373
  (o = this.soundManager) == null || o.playCallEndSound();
40346
40374
  }, 150), this.dispatchEvent(
@@ -40675,7 +40703,7 @@ let ht = class extends gs {
40675
40703
  part="orb-container"
40676
40704
  ${od(this.orbContainerRef)}
40677
40705
  ></div>
40678
- ${this.callStatus === "connected" && !this.microphoneEnabled ? Xt`
40706
+ ${this.callStatus === "connected" && this.microphoneInitialized && !this.microphoneEnabled ? Xt`
40679
40707
  <div class="microphone-indicator visible">
40680
40708
  <svg viewBox="0 0 24 24" fill="none">
40681
40709
  <path
@@ -40707,107 +40735,110 @@ let ht = class extends gs {
40707
40735
  `;
40708
40736
  }
40709
40737
  };
40710
- ht.styles = nd`
40738
+ ct.styles = nd`
40711
40739
  :host {
40712
40740
  display: inline-block;
40713
40741
  contain: layout style;
40714
40742
  }
40715
40743
  `;
40716
- St([
40744
+ bt([
40717
40745
  ye({ type: String, attribute: "agent-id" })
40718
- ], ht.prototype, "agentId", 2);
40719
- St([
40746
+ ], ct.prototype, "agentId", 2);
40747
+ bt([
40720
40748
  ye({ type: String, attribute: "voice-service-url" })
40721
- ], ht.prototype, "voiceServiceUrl", 2);
40722
- St([
40723
- Ri()
40724
- ], ht.prototype, "callStatus", 2);
40725
- St([
40726
- Ri()
40727
- ], ht.prototype, "microphoneEnabled", 2);
40728
- St([
40729
- Ri()
40730
- ], ht.prototype, "serviceUnavailable", 2);
40731
- St([
40749
+ ], ct.prototype, "voiceServiceUrl", 2);
40750
+ bt([
40751
+ An()
40752
+ ], ct.prototype, "callStatus", 2);
40753
+ bt([
40754
+ An()
40755
+ ], ct.prototype, "microphoneEnabled", 2);
40756
+ bt([
40757
+ An()
40758
+ ], ct.prototype, "microphoneInitialized", 2);
40759
+ bt([
40760
+ An()
40761
+ ], ct.prototype, "serviceUnavailable", 2);
40762
+ bt([
40732
40763
  ye({ type: String, attribute: "button-start-text" })
40733
- ], ht.prototype, "buttonStartText", 2);
40734
- St([
40764
+ ], ct.prototype, "buttonStartText", 2);
40765
+ bt([
40735
40766
  ye({ type: String, attribute: "button-connecting-text" })
40736
- ], ht.prototype, "buttonConnectingText", 2);
40737
- St([
40767
+ ], ct.prototype, "buttonConnectingText", 2);
40768
+ bt([
40738
40769
  ye({ type: String, attribute: "button-end-text" })
40739
- ], ht.prototype, "buttonEndText", 2);
40740
- St([
40770
+ ], ct.prototype, "buttonEndText", 2);
40771
+ bt([
40741
40772
  ye({ type: Number, attribute: "orb-size" })
40742
- ], ht.prototype, "orbSize", 2);
40743
- St([
40773
+ ], ct.prototype, "orbSize", 2);
40774
+ bt([
40744
40775
  ye({ type: String, attribute: "theme" })
40745
- ], ht.prototype, "theme", 2);
40746
- St([
40776
+ ], ct.prototype, "theme", 2);
40777
+ bt([
40747
40778
  ye({ type: String, attribute: "theme-mode" })
40748
- ], ht.prototype, "themeMode", 2);
40749
- St([
40779
+ ], ct.prototype, "themeMode", 2);
40780
+ bt([
40750
40781
  ye({ type: Object, attribute: "orb-colors" })
40751
- ], ht.prototype, "orbColors", 2);
40752
- St([
40782
+ ], ct.prototype, "orbColors", 2);
40783
+ bt([
40753
40784
  ye({ type: Number, attribute: "glow-intensity" })
40754
- ], ht.prototype, "glowIntensity", 2);
40755
- St([
40785
+ ], ct.prototype, "glowIntensity", 2);
40786
+ bt([
40756
40787
  ye({ type: Number, attribute: "idle-glow-multiplier" })
40757
- ], ht.prototype, "idleGlowMultiplier", 2);
40758
- St([
40788
+ ], ct.prototype, "idleGlowMultiplier", 2);
40789
+ bt([
40759
40790
  ye({ type: Number, attribute: "morph-strength" })
40760
- ], ht.prototype, "morphStrength", 2);
40761
- St([
40791
+ ], ct.prototype, "morphStrength", 2);
40792
+ bt([
40762
40793
  ye({ type: Number, attribute: "noise-scale" })
40763
- ], ht.prototype, "noiseScale", 2);
40764
- St([
40794
+ ], ct.prototype, "noiseScale", 2);
40795
+ bt([
40765
40796
  ye({ type: Number, attribute: "noise-speed" })
40766
- ], ht.prototype, "noiseSpeed", 2);
40767
- St([
40797
+ ], ct.prototype, "noiseSpeed", 2);
40798
+ bt([
40768
40799
  ye({ type: Number, attribute: "fresnel-power" })
40769
- ], ht.prototype, "fresnelPower", 2);
40770
- St([
40800
+ ], ct.prototype, "fresnelPower", 2);
40801
+ bt([
40771
40802
  ye({ type: Number, attribute: "rotation-speed" })
40772
- ], ht.prototype, "rotationSpeed", 2);
40773
- St([
40803
+ ], ct.prototype, "rotationSpeed", 2);
40804
+ bt([
40774
40805
  ye({ type: Number, attribute: "audio-reactivity" })
40775
- ], ht.prototype, "audioReactivity", 2);
40776
- St([
40806
+ ], ct.prototype, "audioReactivity", 2);
40807
+ bt([
40777
40808
  ye({ type: Number, attribute: "audio-smoothing" })
40778
- ], ht.prototype, "audioSmoothing", 2);
40779
- St([
40809
+ ], ct.prototype, "audioSmoothing", 2);
40810
+ bt([
40780
40811
  ye({ type: Number, attribute: "idle-morph-multiplier" })
40781
- ], ht.prototype, "idleMorphMultiplier", 2);
40782
- St([
40812
+ ], ct.prototype, "idleMorphMultiplier", 2);
40813
+ bt([
40783
40814
  ye({ type: Number, attribute: "color-contrast" })
40784
- ], ht.prototype, "colorContrast", 2);
40785
- St([
40815
+ ], ct.prototype, "colorContrast", 2);
40816
+ bt([
40786
40817
  ye({ type: Boolean, attribute: "sound-enabled" })
40787
- ], ht.prototype, "soundEnabled", 2);
40788
- St([
40818
+ ], ct.prototype, "soundEnabled", 2);
40819
+ bt([
40789
40820
  ye({ type: Number, attribute: "sound-volume" })
40790
- ], ht.prototype, "soundVolume", 2);
40791
- St([
40821
+ ], ct.prototype, "soundVolume", 2);
40822
+ bt([
40792
40823
  ye({ type: String, attribute: "sound-preset" })
40793
- ], ht.prototype, "soundPreset", 2);
40794
- ht = St([
40824
+ ], ct.prototype, "soundPreset", 2);
40825
+ ct = bt([
40795
40826
  rd("hanc-ai-pill-call")
40796
- ], ht);
40827
+ ], ct);
40797
40828
  export {
40798
- ut as FloatingCall,
40799
- dt as InlineCall,
40800
- ht as PillCall,
40829
+ ot as FloatingCall,
40830
+ at as InlineCall,
40831
+ ct as PillCall,
40801
40832
  qd as SoundManager,
40802
40833
  kE as applyTheme,
40803
- fi as darkPresets,
40834
+ pi as darkPresets,
40804
40835
  qE as darkThemes,
40805
40836
  PE as detectSystemTheme,
40806
40837
  HE as getColorPreset,
40807
40838
  WE as getPresetNames,
40808
40839
  So as getTheme,
40809
40840
  XE as getThemeNames,
40810
- pi as lightPresets,
40841
+ mi as lightPresets,
40811
40842
  jE as lightThemes,
40812
40843
  Yr as themes,
40813
40844
  $E as watchSystemTheme