@cloudflare/realtimekit 1.2.1-staging.3 → 1.2.1-staging.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,12 +1,12 @@
1
1
  var tv = Object.defineProperty, sv = Object.defineProperties;
2
2
  var rv = Object.getOwnPropertyDescriptors;
3
3
  var Kc = Object.getOwnPropertySymbols, iv = Object.getPrototypeOf, Xh = Object.prototype.hasOwnProperty, Zh = Object.prototype.propertyIsEnumerable, nv = Reflect.get;
4
- var ep = Math.pow, Zl = (s, t, e) => t in s ? tv(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e, D = (s, t) => {
4
+ var ep = Math.pow, eu = (s, t, e) => t in s ? tv(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e, D = (s, t) => {
5
5
  for (var e in t || (t = {}))
6
- Xh.call(t, e) && Zl(s, e, t[e]);
6
+ Xh.call(t, e) && eu(s, e, t[e]);
7
7
  if (Kc)
8
8
  for (var e of Kc(t))
9
- Zh.call(t, e) && Zl(s, e, t[e]);
9
+ Zh.call(t, e) && eu(s, e, t[e]);
10
10
  return s;
11
11
  }, H = (s, t) => sv(s, rv(t));
12
12
  var ro = (s, t) => {
@@ -18,16 +18,16 @@ var ro = (s, t) => {
18
18
  t.indexOf(r) < 0 && Zh.call(s, r) && (e[r] = s[r]);
19
19
  return e;
20
20
  };
21
- var h = (s, t, e) => (Zl(s, typeof t != "symbol" ? t + "" : t, e), e), eu = (s, t, e) => {
21
+ var h = (s, t, e) => (eu(s, typeof t != "symbol" ? t + "" : t, e), e), tu = (s, t, e) => {
22
22
  if (!t.has(s))
23
23
  throw TypeError("Cannot " + e);
24
24
  };
25
- var n = (s, t, e) => (eu(s, t, "read from private field"), e ? e.call(s) : t.get(s)), m = (s, t, e) => {
25
+ var n = (s, t, e) => (tu(s, t, "read from private field"), e ? e.call(s) : t.get(s)), m = (s, t, e) => {
26
26
  if (t.has(s))
27
27
  throw TypeError("Cannot add the same private member more than once");
28
28
  t instanceof WeakSet ? t.add(s) : t.set(s, e);
29
- }, f = (s, t, e, r) => (eu(s, t, "write to private field"), r ? r.call(s, e) : t.set(s, e), e);
30
- var x = (s, t, e) => (eu(s, t, "access private method"), e), tp = (s, t, e) => nv(iv(s), e, t);
29
+ }, f = (s, t, e, r) => (tu(s, t, "write to private field"), r ? r.call(s, e) : t.set(s, e), e);
30
+ var x = (s, t, e) => (tu(s, t, "access private method"), e), tp = (s, t, e) => nv(iv(s), e, t);
31
31
  var u = (s, t, e) => new Promise((r, i) => {
32
32
  var a = (d) => {
33
33
  try {
@@ -48,7 +48,7 @@ import { v4 as nn, validate as zg } from "uuid";
48
48
  import Yg from "bowser";
49
49
  import { MessageType as T, PbLong as io, typeofJsonValue as av } from "@protobuf-ts/runtime";
50
50
  import * as nd from "worker-timers";
51
- import * as us from "sdp-transform";
51
+ import * as hs from "sdp-transform";
52
52
  function ov(s) {
53
53
  const { length: t } = this, e = s >= 0 ? s : t + s;
54
54
  return e < 0 || e >= t ? void 0 : this[e];
@@ -595,7 +595,7 @@ oe.prototype._events = void 0;
595
595
  oe.prototype._eventsCount = 0;
596
596
  oe.prototype._maxListeners = void 0;
597
597
  var rp = 10;
598
- function kl(s) {
598
+ function Il(s) {
599
599
  if (typeof s != "function")
600
600
  throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof s);
601
601
  }
@@ -651,7 +651,7 @@ oe.prototype.emit = function(t) {
651
651
  };
652
652
  function am(s, t, e, r) {
653
653
  var i, a, o;
654
- if (kl(e), a = s._events, a === void 0 ? (a = s._events = /* @__PURE__ */ Object.create(null), s._eventsCount = 0) : (a.newListener !== void 0 && (s.emit(
654
+ if (Il(e), a = s._events, a === void 0 ? (a = s._events = /* @__PURE__ */ Object.create(null), s._eventsCount = 0) : (a.newListener !== void 0 && (s.emit(
655
655
  "newListener",
656
656
  t,
657
657
  e.listener ? e.listener : e
@@ -680,14 +680,14 @@ function om(s, t, e) {
680
680
  return i.listener = e, r.wrapFn = i, i;
681
681
  }
682
682
  oe.prototype.once = function(t, e) {
683
- return kl(e), this.on(t, om(this, t, e)), this;
683
+ return Il(e), this.on(t, om(this, t, e)), this;
684
684
  };
685
685
  oe.prototype.prependOnceListener = function(t, e) {
686
- return kl(e), this.prependListener(t, om(this, t, e)), this;
686
+ return Il(e), this.prependListener(t, om(this, t, e)), this;
687
687
  };
688
688
  oe.prototype.removeListener = function(t, e) {
689
689
  var r, i, a, o, c;
690
- if (kl(e), i = this._events, i === void 0)
690
+ if (Il(e), i = this._events, i === void 0)
691
691
  return this;
692
692
  if (r = i[t], r === void 0)
693
693
  return this;
@@ -935,7 +935,7 @@ function Ed({ packetsLost: s, packetsSent: t }) {
935
935
  function _d({ packetsLost: s, packetsReceived: t }) {
936
936
  return t + s > 0 ? s * 100 / (t + s) : 0;
937
937
  }
938
- const hm = 240, pm = 720, gm = 8, mm = 3, Il = 10, Al = 0.02, Ml = 0.03;
938
+ const hm = 240, pm = 720, gm = 8, mm = 3, Al = 10, Ml = 0.02, Dl = 0.03;
939
939
  function fr({ stat: s, weight: t, rangeMin: e, rangeMax: r, rangeRankingDirection: i }) {
940
940
  return s == null ? t : e === r ? i === "UP" ? s <= e ? t : 0 : s >= r ? t : 0 : i === "UP" ? (1 - Math.max(Math.min(r, Math.abs(s)) - e, 0) / (r - e)) * t : i === "DOWN" ? Math.max(Math.min(r, Math.abs(s)) - e, 0) / (r - e) * t : t;
941
941
  }
@@ -954,13 +954,13 @@ function vm({ packetsLost: s, packetsSent: t, jitter: e }) {
954
954
  }),
955
955
  weight: 0.7,
956
956
  rangeMin: 0,
957
- rangeMax: Il,
957
+ rangeMax: Al,
958
958
  rangeRankingDirection: "UP"
959
959
  }), o = fr({
960
960
  stat: e,
961
961
  weight: 0.3,
962
- rangeMin: Al,
963
- rangeMax: Ml,
962
+ rangeMin: Ml,
963
+ rangeMax: Dl,
964
964
  rangeRankingDirection: "UP"
965
965
  });
966
966
  return i + o;
@@ -982,13 +982,13 @@ function Tm({ frameWidth: s, framesPerSecond: t, packetsLost: e, packetsSent: r,
982
982
  }),
983
983
  weight: 1,
984
984
  rangeMin: 0,
985
- rangeMax: Il,
985
+ rangeMax: Al,
986
986
  rangeRankingDirection: "UP"
987
987
  }), d = fr({
988
988
  stat: i,
989
989
  weight: 1,
990
- rangeMin: Al,
991
- rangeMax: Ml,
990
+ rangeMin: Ml,
991
+ rangeMax: Dl,
992
992
  rangeRankingDirection: "UP"
993
993
  }), l = bv({
994
994
  frameWidth: s,
@@ -1025,13 +1025,13 @@ function Em({ concealmentEvents: s, packetsLost: t, packetsReceived: e, jitter:
1025
1025
  }),
1026
1026
  weight: o,
1027
1027
  rangeMin: 0,
1028
- rangeMax: Il,
1028
+ rangeMax: Al,
1029
1029
  rangeRankingDirection: "UP"
1030
1030
  }), l = fr({
1031
1031
  stat: r,
1032
1032
  weight: 0.3,
1033
- rangeMin: Al,
1034
- rangeMax: Ml,
1033
+ rangeMin: Ml,
1034
+ rangeMax: Dl,
1035
1035
  rangeRankingDirection: "UP"
1036
1036
  });
1037
1037
  return a + c + l;
@@ -1053,13 +1053,13 @@ function _m({ frameWidth: s, framesPerSecond: t, packetsLost: e, packetsReceived
1053
1053
  }),
1054
1054
  weight: 1,
1055
1055
  rangeMin: 0,
1056
- rangeMax: Il,
1056
+ rangeMax: Al,
1057
1057
  rangeRankingDirection: "UP"
1058
1058
  }), d = fr({
1059
1059
  stat: i,
1060
1060
  weight: 1,
1061
- rangeMin: Al,
1062
- rangeMax: Ml,
1061
+ rangeMin: Ml,
1062
+ rangeMax: Dl,
1063
1063
  rangeRankingDirection: "UP"
1064
1064
  }), l = Dv({
1065
1065
  frameWidth: s,
@@ -1519,7 +1519,7 @@ class wm extends lt {
1519
1519
  }) || e[e.length - 1];
1520
1520
  }
1521
1521
  parseRTCReport(e, r = [], i = !1, a = void 0, o = void 0) {
1522
- var P, C, w, $, F, N, B, G, re, tt, cs, ii, ds;
1522
+ var P, C, w, $, F, N, B, G, re, tt, ds, ii, ls;
1523
1523
  const c = e, d = new Cm(), l = r.length ? new Set(r) : void 0, p = [], g = [], S = [], v = /* @__PURE__ */ new Map(), _ = /* @__PURE__ */ new Map();
1524
1524
  for (const A of c.values()) {
1525
1525
  if (l) {
@@ -1792,12 +1792,12 @@ class wm extends lt {
1792
1792
  }), _.set(R, {
1793
1793
  score: +(I.score * 10).toFixed(),
1794
1794
  packetsLostPercentage: _d({
1795
- packetsLost: (I.packetsLost || 0) - (((cs = this.audioConsumerToStatsMap.get(R)) == null ? void 0 : cs.packetsLost) || 0),
1795
+ packetsLost: (I.packetsLost || 0) - (((ds = this.audioConsumerToStatsMap.get(R)) == null ? void 0 : ds.packetsLost) || 0),
1796
1796
  packetsReceived: (I.packetsReceived || 0) - (((ii = this.audioConsumerToStatsMap.get(R)) == null ? void 0 : ii.packetsReceived) || 0)
1797
1797
  }),
1798
1798
  jitter: I.jitter || 0,
1799
1799
  isScreenShare: this.screenShareConsumers.has(R),
1800
- bitrate: ((I.bytesReceived || 0) - (((ds = this.audioConsumerToStatsMap.get(R)) == null ? void 0 : ds.bytesReceived) || 0)) * 8 / 7
1800
+ bitrate: ((I.bytesReceived || 0) - (((ls = this.audioConsumerToStatsMap.get(R)) == null ? void 0 : ls.bytesReceived) || 0)) * 8 / 7
1801
1801
  // Bytes received in last 7 seconds
1802
1802
  }), this.audioConsumerToStatsMap.set(R, I), d.inboundAudioRtp.set(A.id, I), d.consumerStreamMap.get(R).inboundAudioRtpId.push(A.id), this.processInboundConsumerAudioStats(R, fe, I);
1803
1803
  }
@@ -1811,8 +1811,8 @@ class wm extends lt {
1811
1811
  var R, L, fe, xe, V, I, Ue, Cr, qs, qa, ja, Ga, Wa, Ja, Ka, za, Ya, Qa, Xa, Za, eo, to, so;
1812
1812
  if (A.outboundVideoRtpId.length > 0) {
1813
1813
  const le = [];
1814
- A.outboundVideoRtpId.forEach((Xl) => {
1815
- le.push(d.outboundVideoRtp.get(Xl));
1814
+ A.outboundVideoRtpId.forEach((Zl) => {
1815
+ le.push(d.outboundVideoRtp.get(Zl));
1816
1816
  });
1817
1817
  const se = this.getWorkingSimulcastVideoStats(le);
1818
1818
  se.score = Tm({
@@ -2170,7 +2170,7 @@ class Rm extends wm {
2170
2170
  };
2171
2171
  }
2172
2172
  parseRTCReport(e, r = [], i = !1, a = void 0, o = void 0) {
2173
- var P, C, w, $, F, N, B, G, re, tt, cs, ii, ds;
2173
+ var P, C, w, $, F, N, B, G, re, tt, ds, ii, ls;
2174
2174
  const c = e, d = new Cm(), l = r.length ? new Set(r) : void 0, p = [], g = [], S = [], v = /* @__PURE__ */ new Map(), _ = /* @__PURE__ */ new Map();
2175
2175
  for (const A of c.values()) {
2176
2176
  if (l) {
@@ -2439,12 +2439,12 @@ class Rm extends wm {
2439
2439
  }), _.set(R, {
2440
2440
  score: +(I.score * 10).toFixed(),
2441
2441
  packetsLostPercentage: _d({
2442
- packetsLost: (I.packetsLost || 0) - (((cs = this.audioConsumerToStatsMap.get(R)) == null ? void 0 : cs.packetsLost) || 0),
2442
+ packetsLost: (I.packetsLost || 0) - (((ds = this.audioConsumerToStatsMap.get(R)) == null ? void 0 : ds.packetsLost) || 0),
2443
2443
  packetsReceived: (I.packetsReceived || 0) - (((ii = this.audioConsumerToStatsMap.get(R)) == null ? void 0 : ii.packetsReceived) || 0)
2444
2444
  }),
2445
2445
  jitter: I.jitter || 0,
2446
2446
  isScreenShare: this.screenShareConsumers.has(R),
2447
- bitrate: ((I.bytesReceived || 0) - (((ds = this.audioConsumerToStatsMap.get(R)) == null ? void 0 : ds.bytesReceived) || 0)) * 8 / 7
2447
+ bitrate: ((I.bytesReceived || 0) - (((ls = this.audioConsumerToStatsMap.get(R)) == null ? void 0 : ls.bytesReceived) || 0)) * 8 / 7
2448
2448
  // Bytes received in last 7 seconds
2449
2449
  }), this.audioConsumerToStatsMap.set(R, I), d.inboundAudioRtp.set(A.id, I), d.consumerStreamMap.get(R).inboundAudioRtpId.push(A.id), this.processInboundConsumerAudioStats(R, fe, I);
2450
2450
  }
@@ -2458,8 +2458,8 @@ class Rm extends wm {
2458
2458
  var R, L, fe, xe, V, I, Ue, Cr, qs, qa, ja, Ga, Wa, Ja, Ka, za, Ya, Qa, Xa, Za, eo, to, so;
2459
2459
  if (A.outboundVideoRtpId.length > 0) {
2460
2460
  const le = [];
2461
- A.outboundVideoRtpId.forEach((Xl) => {
2462
- le.push(d.outboundVideoRtp.get(Xl));
2461
+ A.outboundVideoRtpId.forEach((Zl) => {
2462
+ le.push(d.outboundVideoRtp.get(Zl));
2463
2463
  });
2464
2464
  const se = this.getWorkingSimulcastVideoStats(le);
2465
2465
  se.score = Tm({
@@ -3569,7 +3569,7 @@ function Gv() {
3569
3569
  function xc(s, t) {
3570
3570
  return s === t || s !== s && t !== t;
3571
3571
  }
3572
- function Dl(s, t) {
3572
+ function Ol(s, t) {
3573
3573
  for (var e = s.length; e--; )
3574
3574
  if (xc(s[e][0], t))
3575
3575
  return e;
@@ -3577,21 +3577,21 @@ function Dl(s, t) {
3577
3577
  }
3578
3578
  var Wv = Array.prototype, Jv = Wv.splice;
3579
3579
  function Kv(s) {
3580
- var t = this.__data__, e = Dl(t, s);
3580
+ var t = this.__data__, e = Ol(t, s);
3581
3581
  if (e < 0)
3582
3582
  return !1;
3583
3583
  var r = t.length - 1;
3584
3584
  return e == r ? t.pop() : Jv.call(t, e, 1), --this.size, !0;
3585
3585
  }
3586
3586
  function zv(s) {
3587
- var t = this.__data__, e = Dl(t, s);
3587
+ var t = this.__data__, e = Ol(t, s);
3588
3588
  return e < 0 ? void 0 : t[e][1];
3589
3589
  }
3590
3590
  function Yv(s) {
3591
- return Dl(this.__data__, s) > -1;
3591
+ return Ol(this.__data__, s) > -1;
3592
3592
  }
3593
3593
  function Qv(s, t) {
3594
- var e = this.__data__, r = Dl(e, s);
3594
+ var e = this.__data__, r = Ol(e, s);
3595
3595
  return r < 0 ? (++this.size, e.push([s, t])) : e[r][1] = t, this;
3596
3596
  }
3597
3597
  function yr(s) {
@@ -3644,21 +3644,21 @@ var hT = "[object Null]", pT = "[object Undefined]", dp = Bs ? Bs.toStringTag :
3644
3644
  function dn(s) {
3645
3645
  return s == null ? s === void 0 ? pT : hT : dp && dp in Object(s) ? cT(s) : uT(s);
3646
3646
  }
3647
- function ns(s) {
3647
+ function as(s) {
3648
3648
  var t = typeof s;
3649
3649
  return s != null && (t == "object" || t == "function");
3650
3650
  }
3651
3651
  var gT = "[object AsyncFunction]", mT = "[object Function]", fT = "[object GeneratorFunction]", ST = "[object Proxy]";
3652
3652
  function mh(s) {
3653
- if (!ns(s))
3653
+ if (!as(s))
3654
3654
  return !1;
3655
3655
  var t = dn(s);
3656
3656
  return t == mT || t == fT || t == gT || t == ST;
3657
3657
  }
3658
3658
  var vT = ks["__core-js_shared__"];
3659
- const tu = vT;
3659
+ const su = vT;
3660
3660
  var lp = function() {
3661
- var s = /[^.]+$/.exec(tu && tu.keys && tu.keys.IE_PROTO || "");
3661
+ var s = /[^.]+$/.exec(su && su.keys && su.keys.IE_PROTO || "");
3662
3662
  return s ? "Symbol(src)_1." + s : "";
3663
3663
  }();
3664
3664
  function TT(s) {
@@ -3682,7 +3682,7 @@ var _T = /[\\^$.*+?()[\]{}|]/g, PT = /^\[object .+?Constructor\]$/, CT = Functio
3682
3682
  "^" + RT.call(bT).replace(_T, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
3683
3683
  );
3684
3684
  function IT(s) {
3685
- if (!ns(s) || TT(s))
3685
+ if (!as(s) || TT(s))
3686
3686
  return !1;
3687
3687
  var t = mh(s) ? kT : PT;
3688
3688
  return t.test(ln(s));
@@ -3747,22 +3747,22 @@ function GT(s) {
3747
3747
  var t = typeof s;
3748
3748
  return t == "string" || t == "number" || t == "symbol" || t == "boolean" ? s !== "__proto__" : s === null;
3749
3749
  }
3750
- function Ol(s, t) {
3750
+ function Nl(s, t) {
3751
3751
  var e = s.__data__;
3752
3752
  return GT(t) ? e[typeof t == "string" ? "string" : "hash"] : e.map;
3753
3753
  }
3754
3754
  function WT(s) {
3755
- var t = Ol(this, s).delete(s);
3755
+ var t = Nl(this, s).delete(s);
3756
3756
  return this.size -= t ? 1 : 0, t;
3757
3757
  }
3758
3758
  function JT(s) {
3759
- return Ol(this, s).get(s);
3759
+ return Nl(this, s).get(s);
3760
3760
  }
3761
3761
  function KT(s) {
3762
- return Ol(this, s).has(s);
3762
+ return Nl(this, s).has(s);
3763
3763
  }
3764
3764
  function zT(s, t) {
3765
- var e = Ol(this, s), r = e.size;
3765
+ var e = Nl(this, s), r = e.size;
3766
3766
  return e.set(s, t), this.size += e.size == r ? 0 : 1, this;
3767
3767
  }
3768
3768
  function Er(s) {
@@ -3877,19 +3877,19 @@ function Th(s) {
3877
3877
  return s(t);
3878
3878
  };
3879
3879
  }
3880
- var Om = typeof exports == "object" && exports && !exports.nodeType && exports, yo = Om && typeof module == "object" && module && !module.nodeType && module, Fy = yo && yo.exports === Om, su = Fy && km.process, By = function() {
3880
+ var Om = typeof exports == "object" && exports && !exports.nodeType && exports, yo = Om && typeof module == "object" && module && !module.nodeType && module, Fy = yo && yo.exports === Om, ru = Fy && km.process, By = function() {
3881
3881
  try {
3882
3882
  var s = yo && yo.require && yo.require("util").types;
3883
- return s || su && su.binding && su.binding("util");
3883
+ return s || ru && ru.binding && ru.binding("util");
3884
3884
  } catch (t) {
3885
3885
  }
3886
3886
  }();
3887
3887
  const Na = By;
3888
3888
  var gp = Na && Na.isTypedArray, Hy = gp ? Th(gp) : $y;
3889
- const Nl = Hy;
3889
+ const Vl = Hy;
3890
3890
  var qy = Object.prototype, jy = qy.hasOwnProperty;
3891
3891
  function Nm(s, t) {
3892
- var e = Bt(s), r = !e && Ao(s), i = !e && !r && Oa(s), a = !e && !r && !i && Nl(s), o = e || r || i || a, c = o ? sy(s.length, String) : [], d = c.length;
3892
+ var e = Bt(s), r = !e && Ao(s), i = !e && !r && Oa(s), a = !e && !r && !i && Vl(s), o = e || r || i || a, c = o ? sy(s.length, String) : [], d = c.length;
3893
3893
  for (var l in s)
3894
3894
  (t || jy.call(s, l)) && !(o && // Safari 9 has enumerable `arguments.length` in strict mode.
3895
3895
  (l == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
@@ -3899,7 +3899,7 @@ function Nm(s, t) {
3899
3899
  return c;
3900
3900
  }
3901
3901
  var Gy = Object.prototype;
3902
- function Vl(s) {
3902
+ function Ll(s) {
3903
3903
  var t = s && s.constructor, e = typeof t == "function" && t.prototype || Gy;
3904
3904
  return s === e;
3905
3905
  }
@@ -3912,7 +3912,7 @@ var Wy = Vm(Object.keys, Object);
3912
3912
  const Jy = Wy;
3913
3913
  var Ky = Object.prototype, zy = Ky.hasOwnProperty;
3914
3914
  function Lm(s) {
3915
- if (!Vl(s))
3915
+ if (!Ll(s))
3916
3916
  return Jy(s);
3917
3917
  var t = [];
3918
3918
  for (var e in Object(s))
@@ -3922,11 +3922,11 @@ function Lm(s) {
3922
3922
  function $c(s) {
3923
3923
  return s != null && vh(s.length) && !mh(s);
3924
3924
  }
3925
- function Ll(s) {
3925
+ function xl(s) {
3926
3926
  return $c(s) ? Nm(s) : Lm(s);
3927
3927
  }
3928
3928
  function Yy(s, t) {
3929
- return s && Uc(t, Ll(t), s);
3929
+ return s && Uc(t, xl(t), s);
3930
3930
  }
3931
3931
  function Qy(s) {
3932
3932
  var t = [];
@@ -3937,9 +3937,9 @@ function Qy(s) {
3937
3937
  }
3938
3938
  var Xy = Object.prototype, Zy = Xy.hasOwnProperty;
3939
3939
  function eE(s) {
3940
- if (!ns(s))
3940
+ if (!as(s))
3941
3941
  return Qy(s);
3942
- var t = Vl(s), e = [];
3942
+ var t = Ll(s), e = [];
3943
3943
  for (var r in s)
3944
3944
  r == "constructor" && (t || !Zy.call(s, r)) || e.push(r);
3945
3945
  return e;
@@ -4002,22 +4002,22 @@ function qm(s, t, e) {
4002
4002
  var r = t(s);
4003
4003
  return Bt(s) ? r : Bm(r, e(s));
4004
4004
  }
4005
- function fu(s) {
4006
- return qm(s, Ll, yh);
4005
+ function Su(s) {
4006
+ return qm(s, xl, yh);
4007
4007
  }
4008
4008
  function hE(s) {
4009
4009
  return qm(s, Fc, Hm);
4010
4010
  }
4011
4011
  var pE = un(ks, "DataView");
4012
- const Su = pE;
4012
+ const vu = pE;
4013
4013
  var gE = un(ks, "Promise");
4014
- const vu = gE;
4014
+ const Tu = gE;
4015
4015
  var mE = un(ks, "Set");
4016
4016
  const In = mE;
4017
4017
  var fE = un(ks, "WeakMap");
4018
- const Tu = fE;
4019
- var Tp = "[object Map]", SE = "[object Object]", yp = "[object Promise]", Ep = "[object Set]", _p = "[object WeakMap]", Pp = "[object DataView]", vE = ln(Su), TE = ln(ko), yE = ln(vu), EE = ln(In), _E = ln(Tu), ni = dn;
4020
- (Su && ni(new Su(new ArrayBuffer(1))) != Pp || ko && ni(new ko()) != Tp || vu && ni(vu.resolve()) != yp || In && ni(new In()) != Ep || Tu && ni(new Tu()) != _p) && (ni = function(s) {
4018
+ const yu = fE;
4019
+ var Tp = "[object Map]", SE = "[object Object]", yp = "[object Promise]", Ep = "[object Set]", _p = "[object WeakMap]", Pp = "[object DataView]", vE = ln(vu), TE = ln(ko), yE = ln(Tu), EE = ln(In), _E = ln(yu), ni = dn;
4020
+ (vu && ni(new vu(new ArrayBuffer(1))) != Pp || ko && ni(new ko()) != Tp || Tu && ni(Tu.resolve()) != yp || In && ni(new In()) != Ep || yu && ni(new yu()) != _p) && (ni = function(s) {
4021
4021
  var t = dn(s), e = t == SE ? s.constructor : void 0, r = e ? ln(e) : "";
4022
4022
  if (r)
4023
4023
  switch (r) {
@@ -4101,7 +4101,7 @@ var Rp = Object.create, QE = function() {
4101
4101
  function s() {
4102
4102
  }
4103
4103
  return function(t) {
4104
- if (!ns(t))
4104
+ if (!as(t))
4105
4105
  return {};
4106
4106
  if (Rp)
4107
4107
  return Rp(t);
@@ -4112,7 +4112,7 @@ var Rp = Object.create, QE = function() {
4112
4112
  }();
4113
4113
  const XE = QE;
4114
4114
  function Gm(s) {
4115
- return typeof s.constructor == "function" && !Vl(s) ? XE(Eh(s)) : {};
4115
+ return typeof s.constructor == "function" && !Ll(s) ? XE(Eh(s)) : {};
4116
4116
  }
4117
4117
  var ZE = "[object Map]";
4118
4118
  function e_(s) {
@@ -4133,7 +4133,7 @@ function od(s, t, e, r, i, a) {
4133
4133
  var o, c = t & o_, d = t & c_, l = t & d_;
4134
4134
  if (e && (o = i ? e(s, r, i, a) : e(s)), o !== void 0)
4135
4135
  return o;
4136
- if (!ns(s))
4136
+ if (!as(s))
4137
4137
  return s;
4138
4138
  var p = Bt(s);
4139
4139
  if (p) {
@@ -4161,7 +4161,7 @@ function od(s, t, e, r, i, a) {
4161
4161
  }) : s_(s) && s.forEach(function(C, w) {
4162
4162
  o.set(w, od(C, t, e, w, s, a));
4163
4163
  });
4164
- var _ = l ? d ? hE : fu : d ? Fc : Ll, P = p ? void 0 : _(s);
4164
+ var _ = l ? d ? hE : Su : d ? Fc : xl, P = p ? void 0 : _(s);
4165
4165
  return XT(P || s, function(C, w) {
4166
4166
  P && (w = C, C = s[w]), Am(o, w, od(C, t, e, w, s, a));
4167
4167
  }), o;
@@ -4171,7 +4171,7 @@ function Ph(s) {
4171
4171
  return od(s, O_ | N_);
4172
4172
  }
4173
4173
  var V_ = "[object Symbol]";
4174
- function xl(s) {
4174
+ function Ul(s) {
4175
4175
  return typeof s == "symbol" || Hs(s) && dn(s) == V_;
4176
4176
  }
4177
4177
  var L_ = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, x_ = /^\w*$/;
@@ -4179,7 +4179,7 @@ function Ch(s, t) {
4179
4179
  if (Bt(s))
4180
4180
  return !1;
4181
4181
  var e = typeof s;
4182
- return e == "number" || e == "symbol" || e == "boolean" || s == null || xl(s) ? !0 : x_.test(s) || !L_.test(s) || t != null && s in Object(t);
4182
+ return e == "number" || e == "symbol" || e == "boolean" || s == null || Ul(s) ? !0 : x_.test(s) || !L_.test(s) || t != null && s in Object(t);
4183
4183
  }
4184
4184
  var U_ = "Expected a function";
4185
4185
  function wh(s, t) {
@@ -4220,7 +4220,7 @@ function zm(s) {
4220
4220
  return s;
4221
4221
  if (Bt(s))
4222
4222
  return G_(s, zm) + "";
4223
- if (xl(s))
4223
+ if (Ul(s))
4224
4224
  return Ap ? Ap.call(s) : "";
4225
4225
  var t = s + "";
4226
4226
  return t == "0" && 1 / s == -W_ ? "-0" : t;
@@ -4232,8 +4232,8 @@ function Ym(s, t) {
4232
4232
  return Bt(s) ? s : Ch(s, t) ? [s] : j_(J_(s));
4233
4233
  }
4234
4234
  var K_ = 1 / 0;
4235
- function Ul(s) {
4236
- if (typeof s == "string" || xl(s))
4235
+ function $l(s) {
4236
+ if (typeof s == "string" || Ul(s))
4237
4237
  return s;
4238
4238
  var t = s + "";
4239
4239
  return t == "0" && 1 / s == -K_ ? "-0" : t;
@@ -4241,7 +4241,7 @@ function Ul(s) {
4241
4241
  function Qm(s, t) {
4242
4242
  t = Ym(t, s);
4243
4243
  for (var e = 0, r = t.length; s != null && e < r; )
4244
- s = s[Ul(t[e++])];
4244
+ s = s[$l(t[e++])];
4245
4245
  return e && e == r ? s : void 0;
4246
4246
  }
4247
4247
  function z_(s, t, e) {
@@ -4251,7 +4251,7 @@ function z_(s, t, e) {
4251
4251
  function Y_(s, t, e) {
4252
4252
  t = Ym(t, s);
4253
4253
  for (var r = -1, i = t.length, a = !1; ++r < i; ) {
4254
- var o = Ul(t[r]);
4254
+ var o = $l(t[r]);
4255
4255
  if (!(a = s != null && e(s, o)))
4256
4256
  break;
4257
4257
  s = s[o];
@@ -4968,7 +4968,7 @@ const zh = class extends lt.EventEmitter {
4968
4968
  f(this, Js, /* @__PURE__ */ new Map()), f(this, Ks, /* @__PURE__ */ new Map()), super.removeAllListeners();
4969
4969
  }
4970
4970
  };
4971
- let yu = zh;
4971
+ let Eu = zh;
4972
4972
  Js = new WeakMap(), Ks = new WeakMap();
4973
4973
  var fP = /\s/;
4974
4974
  function SP(s) {
@@ -4984,11 +4984,11 @@ var Dp = 0 / 0, yP = /^[-+]0x[0-9a-f]+$/i, EP = /^0b[01]+$/i, _P = /^0o[0-7]+$/i
4984
4984
  function Op(s) {
4985
4985
  if (typeof s == "number")
4986
4986
  return s;
4987
- if (xl(s))
4987
+ if (Ul(s))
4988
4988
  return Dp;
4989
- if (ns(s)) {
4989
+ if (as(s)) {
4990
4990
  var t = typeof s.valueOf == "function" ? s.valueOf() : s;
4991
- s = ns(t) ? t + "" : t;
4991
+ s = as(t) ? t + "" : t;
4992
4992
  }
4993
4993
  if (typeof s != "string")
4994
4994
  return s === 0 ? s : +s;
@@ -5080,7 +5080,7 @@ function BP(s, t) {
5080
5080
  return NP(FP(s, t, bh), s + "");
5081
5081
  }
5082
5082
  function HP(s, t, e) {
5083
- if (!ns(e))
5083
+ if (!as(e))
5084
5084
  return !1;
5085
5085
  var r = typeof t;
5086
5086
  return (r == "number" ? $c(e) && Sh(t, e.length) : r == "string" && t in e) ? xc(e[t], s) : !1;
@@ -5174,7 +5174,7 @@ function kh(s) {
5174
5174
  e[++t] = r;
5175
5175
  }), e;
5176
5176
  }
5177
- var rC = 1, iC = 2, nC = "[object Boolean]", aC = "[object Date]", oC = "[object Error]", cC = "[object Map]", dC = "[object Number]", lC = "[object RegExp]", uC = "[object Set]", hC = "[object String]", pC = "[object Symbol]", gC = "[object ArrayBuffer]", mC = "[object DataView]", Vp = Bs ? Bs.prototype : void 0, ru = Vp ? Vp.valueOf : void 0;
5177
+ var rC = 1, iC = 2, nC = "[object Boolean]", aC = "[object Date]", oC = "[object Error]", cC = "[object Map]", dC = "[object Number]", lC = "[object RegExp]", uC = "[object Set]", hC = "[object String]", pC = "[object Symbol]", gC = "[object ArrayBuffer]", mC = "[object DataView]", Vp = Bs ? Bs.prototype : void 0, iu = Vp ? Vp.valueOf : void 0;
5178
5178
  function fC(s, t, e, r, i, a, o) {
5179
5179
  switch (e) {
5180
5180
  case mC:
@@ -5205,14 +5205,14 @@ function fC(s, t, e, r, i, a, o) {
5205
5205
  var p = of(c(s), c(t), r, i, a, o);
5206
5206
  return o.delete(s), p;
5207
5207
  case pC:
5208
- if (ru)
5209
- return ru.call(s) == ru.call(t);
5208
+ if (iu)
5209
+ return iu.call(s) == iu.call(t);
5210
5210
  }
5211
5211
  return !1;
5212
5212
  }
5213
5213
  var SC = 1, vC = Object.prototype, TC = vC.hasOwnProperty;
5214
5214
  function yC(s, t, e, r, i, a) {
5215
- var o = e & SC, c = fu(s), d = c.length, l = fu(t), p = l.length;
5215
+ var o = e & SC, c = Su(s), d = c.length, l = Su(t), p = l.length;
5216
5216
  if (d != p && !o)
5217
5217
  return !1;
5218
5218
  for (var g = d; g--; ) {
@@ -5253,7 +5253,7 @@ function PC(s, t, e, r, i, a) {
5253
5253
  o = !0, p = !1;
5254
5254
  }
5255
5255
  if (S && !p)
5256
- return a || (a = new bs()), o || Nl(s) ? of(s, t, e, r, i, a) : fC(s, t, d, e, r, i, a);
5256
+ return a || (a = new bs()), o || Vl(s) ? of(s, t, e, r, i, a) : fC(s, t, d, e, r, i, a);
5257
5257
  if (!(e & EC)) {
5258
5258
  var v = p && Up.call(s, "__wrapped__"), _ = g && Up.call(t, "__wrapped__");
5259
5259
  if (v || _) {
@@ -5263,8 +5263,8 @@ function PC(s, t, e, r, i, a) {
5263
5263
  }
5264
5264
  return S ? (a || (a = new bs()), yC(s, t, e, r, i, a)) : !1;
5265
5265
  }
5266
- function $l(s, t, e, r, i) {
5267
- return s === t ? !0 : s == null || t == null || !Hs(s) && !Hs(t) ? s !== s && t !== t : PC(s, t, e, r, $l, i);
5266
+ function Fl(s, t, e, r, i) {
5267
+ return s === t ? !0 : s == null || t == null || !Hs(s) && !Hs(t) ? s !== s && t !== t : PC(s, t, e, r, Fl, i);
5268
5268
  }
5269
5269
  var CC = 1, wC = 2;
5270
5270
  function RC(s, t, e, r) {
@@ -5286,17 +5286,17 @@ function RC(s, t, e, r) {
5286
5286
  var g = new bs();
5287
5287
  if (r)
5288
5288
  var S = r(l, p, d, s, t, g);
5289
- if (!(S === void 0 ? $l(p, l, CC | wC, r, g) : S))
5289
+ if (!(S === void 0 ? Fl(p, l, CC | wC, r, g) : S))
5290
5290
  return !1;
5291
5291
  }
5292
5292
  }
5293
5293
  return !0;
5294
5294
  }
5295
5295
  function cf(s) {
5296
- return s === s && !ns(s);
5296
+ return s === s && !as(s);
5297
5297
  }
5298
5298
  function bC(s) {
5299
- for (var t = Ll(s), e = t.length; e--; ) {
5299
+ for (var t = xl(s), e = t.length; e--; ) {
5300
5300
  var r = t[e], i = s[r];
5301
5301
  t[e] = [r, i, cf(i)];
5302
5302
  }
@@ -5321,9 +5321,9 @@ function AC(s, t) {
5321
5321
  }
5322
5322
  var MC = 1, DC = 2;
5323
5323
  function OC(s, t) {
5324
- return Ch(s) && cf(t) ? df(Ul(s), t) : function(e) {
5324
+ return Ch(s) && cf(t) ? df($l(s), t) : function(e) {
5325
5325
  var r = z_(e, s);
5326
- return r === void 0 && r === t ? AC(e, s) : $l(t, r, MC | DC);
5326
+ return r === void 0 && r === t ? AC(e, s) : Fl(t, r, MC | DC);
5327
5327
  };
5328
5328
  }
5329
5329
  function NC(s) {
@@ -5337,7 +5337,7 @@ function VC(s) {
5337
5337
  };
5338
5338
  }
5339
5339
  function LC(s) {
5340
- return Ch(s) ? NC(Ul(s)) : VC(s);
5340
+ return Ch(s) ? NC($l(s)) : VC(s);
5341
5341
  }
5342
5342
  function xC(s) {
5343
5343
  return typeof s == "function" ? s : s == null ? bh : typeof s == "object" ? Bt(s) ? OC(s[0], s[1]) : kC(s) : LC(s);
@@ -5357,13 +5357,13 @@ const FC = $C;
5357
5357
  var BC = function() {
5358
5358
  return ks.Date.now();
5359
5359
  };
5360
- const iu = BC;
5360
+ const nu = BC;
5361
5361
  var HC = "Expected a function", qC = Math.max, jC = Math.min;
5362
5362
  function Ih(s, t, e) {
5363
5363
  var r, i, a, o, c, d, l = 0, p = !1, g = !1, S = !0;
5364
5364
  if (typeof s != "function")
5365
5365
  throw new TypeError(HC);
5366
- t = Op(t) || 0, ns(e) && (p = !!e.leading, g = "maxWait" in e, a = g ? qC(Op(e.maxWait) || 0, t) : a, S = "trailing" in e ? !!e.trailing : S);
5366
+ t = Op(t) || 0, as(e) && (p = !!e.leading, g = "maxWait" in e, a = g ? qC(Op(e.maxWait) || 0, t) : a, S = "trailing" in e ? !!e.trailing : S);
5367
5367
  function v(G) {
5368
5368
  var re = r, tt = i;
5369
5369
  return r = i = void 0, l = G, o = s.apply(tt, re), o;
@@ -5372,15 +5372,15 @@ function Ih(s, t, e) {
5372
5372
  return l = G, c = setTimeout(w, t), p ? v(G) : o;
5373
5373
  }
5374
5374
  function P(G) {
5375
- var re = G - d, tt = G - l, cs = t - re;
5376
- return g ? jC(cs, a - tt) : cs;
5375
+ var re = G - d, tt = G - l, ds = t - re;
5376
+ return g ? jC(ds, a - tt) : ds;
5377
5377
  }
5378
5378
  function C(G) {
5379
5379
  var re = G - d, tt = G - l;
5380
5380
  return d === void 0 || re >= t || re < 0 || g && tt >= a;
5381
5381
  }
5382
5382
  function w() {
5383
- var G = iu();
5383
+ var G = nu();
5384
5384
  if (C(G))
5385
5385
  return $(G);
5386
5386
  c = setTimeout(w, P(G));
@@ -5392,10 +5392,10 @@ function Ih(s, t, e) {
5392
5392
  c !== void 0 && clearTimeout(c), l = 0, r = d = i = c = void 0;
5393
5393
  }
5394
5394
  function N() {
5395
- return c === void 0 ? o : $(iu());
5395
+ return c === void 0 ? o : $(nu());
5396
5396
  }
5397
5397
  function B() {
5398
- var G = iu(), re = C(G);
5398
+ var G = nu(), re = C(G);
5399
5399
  if (r = arguments, i = this, d = G, re) {
5400
5400
  if (c === void 0)
5401
5401
  return _(d);
@@ -5406,13 +5406,13 @@ function Ih(s, t, e) {
5406
5406
  }
5407
5407
  return B.cancel = F, B.flush = N, B;
5408
5408
  }
5409
- function Eu(s, t, e) {
5409
+ function _u(s, t, e) {
5410
5410
  (e !== void 0 && !xc(s[t], e) || e === void 0 && !(t in s)) && fh(s, t, e);
5411
5411
  }
5412
5412
  function GC(s) {
5413
5413
  return Hs(s) && $c(s);
5414
5414
  }
5415
- function _u(s, t) {
5415
+ function Pu(s, t) {
5416
5416
  if (!(t === "constructor" && typeof s[t] == "function") && t != "__proto__")
5417
5417
  return s[t];
5418
5418
  }
@@ -5420,25 +5420,25 @@ function WC(s) {
5420
5420
  return Uc(s, Fc(s));
5421
5421
  }
5422
5422
  function JC(s, t, e, r, i, a, o) {
5423
- var c = _u(s, e), d = _u(t, e), l = o.get(d);
5423
+ var c = Pu(s, e), d = Pu(t, e), l = o.get(d);
5424
5424
  if (l) {
5425
- Eu(s, e, l);
5425
+ _u(s, e, l);
5426
5426
  return;
5427
5427
  }
5428
5428
  var p = a ? a(c, d, e + "", s, t, o) : void 0, g = p === void 0;
5429
5429
  if (g) {
5430
- var S = Bt(d), v = !S && Oa(d), _ = !S && !v && Nl(d);
5431
- p = d, S || v || _ ? Bt(c) ? p = c : GC(c) ? p = $m(c) : v ? (g = !1, p = Um(d, !0)) : _ ? (g = !1, p = jm(d, !0)) : p = [] : zP(d) || Ao(d) ? (p = c, Ao(c) ? p = WC(c) : (!ns(c) || mh(c)) && (p = Gm(d))) : g = !1;
5430
+ var S = Bt(d), v = !S && Oa(d), _ = !S && !v && Vl(d);
5431
+ p = d, S || v || _ ? Bt(c) ? p = c : GC(c) ? p = $m(c) : v ? (g = !1, p = Um(d, !0)) : _ ? (g = !1, p = jm(d, !0)) : p = [] : zP(d) || Ao(d) ? (p = c, Ao(c) ? p = WC(c) : (!as(c) || mh(c)) && (p = Gm(d))) : g = !1;
5432
5432
  }
5433
- g && (o.set(d, p), i(p, d, r, a, o), o.delete(d)), Eu(s, e, p);
5433
+ g && (o.set(d, p), i(p, d, r, a, o), o.delete(d)), _u(s, e, p);
5434
5434
  }
5435
5435
  function lf(s, t, e, r, i) {
5436
5436
  s !== t && FC(t, function(a, o) {
5437
- if (i || (i = new bs()), ns(a))
5437
+ if (i || (i = new bs()), as(a))
5438
5438
  JC(s, t, o, e, lf, r, i);
5439
5439
  else {
5440
- var c = r ? r(_u(s, o), a, o + "", s, t, i) : void 0;
5441
- c === void 0 && (c = a), Eu(s, o, c);
5440
+ var c = r ? r(Pu(s, o), a, o + "", s, t, i) : void 0;
5441
+ c === void 0 && (c = a), _u(s, o, c);
5442
5442
  }
5443
5443
  }, Fc);
5444
5444
  }
@@ -5452,12 +5452,12 @@ var zC = "[object Map]", YC = "[object Set]", QC = Object.prototype, XC = QC.has
5452
5452
  function ZC(s) {
5453
5453
  if (s == null)
5454
5454
  return !0;
5455
- if ($c(s) && (Bt(s) || typeof s == "string" || typeof s.splice == "function" || Oa(s) || Nl(s) || Ao(s)))
5455
+ if ($c(s) && (Bt(s) || typeof s == "string" || typeof s.splice == "function" || Oa(s) || Vl(s) || Ao(s)))
5456
5456
  return !s.length;
5457
5457
  var t = Va(s);
5458
5458
  if (t == zC || t == YC)
5459
5459
  return !s.size;
5460
- if (Vl(s))
5460
+ if (Ll(s))
5461
5461
  return !Lm(s).length;
5462
5462
  for (var e in s)
5463
5463
  if (XC.call(s, e))
@@ -5465,7 +5465,7 @@ function ZC(s) {
5465
5465
  return !0;
5466
5466
  }
5467
5467
  function ew(s, t) {
5468
- return $l(s, t);
5468
+ return Fl(s, t);
5469
5469
  }
5470
5470
  var tw = qP(function(s, t, e) {
5471
5471
  lf(s, t, e);
@@ -5506,7 +5506,7 @@ function aw(s) {
5506
5506
  function ow(s, t) {
5507
5507
  return s && s.length ? uf(s, xC(t)) : [];
5508
5508
  }
5509
- var Pu = /* @__PURE__ */ ((s) => (s.PARTICIPANT = "PARTICIPANT", s.PEER = "PEER", s.CLIENT = "CLIENT", s))(Pu || {});
5509
+ var Cu = /* @__PURE__ */ ((s) => (s.PARTICIPANT = "PARTICIPANT", s.PEER = "PEER", s.CLIENT = "CLIENT", s))(Cu || {});
5510
5510
  const ee = {
5511
5511
  PROPAGATE_KICK_ALL: "propagate_kick_across_rooms",
5512
5512
  REFRESH_ID_ON_DISCONNECTION: "refresh_id_on_disconnection",
@@ -5894,7 +5894,7 @@ class fw {
5894
5894
  if (this.contexts.has(t))
5895
5895
  return this.contexts.get(t);
5896
5896
  const r = new E(), i = new rf();
5897
- this.contexts.set(t, mw(e)), this.contexts.get(t).setValue("peerSessionStore", new yu(i));
5897
+ this.contexts.set(t, mw(e)), this.contexts.get(t).setValue("peerSessionStore", new Eu(i));
5898
5898
  const a = new bm();
5899
5899
  return a.setMaxListeners(50), this.contexts.get(t).setValue("logger", i), this.contexts.get(t).setValue("telemetry", r), this.contexts.get(t).setValue("callstats", a), this.contexts.get(t).setValue("flagsmith", iP()), this.mostRecentPeerId = t, this.contexts.get(t);
5900
5900
  }
@@ -6294,7 +6294,7 @@ const Bp = 1080, Hp = 1920, _w = (s, t, e, r, i, a) => {
6294
6294
  let g = d * p, S = l * p, v, _, P, C, w = 1;
6295
6295
  return g < e && (w = e / g), Math.abs(w - 1) < 1e-14 && S < r && (w = r / S), g *= w, S *= w, P = d / (g / e), C = l / (S / r), v = (d - P) * o, _ = (l - C) * c, v < 0 && (v = 0), _ < 0 && (_ = 0), P > d && (P = d), C > l && (C = l), [v, _, P, C, s, t, e, r];
6296
6296
  };
6297
- var Kt, mi, st, zt, be, hs, zs, gt, De, On, Nn, Ys, Vn;
6297
+ var Kt, mi, st, zt, be, ps, zs, gt, De, On, Nn, Ys, Vn;
6298
6298
  const Qh = class extends qt {
6299
6299
  constructor(e, r, i, a) {
6300
6300
  const o = e.getValue("logger");
@@ -6307,7 +6307,7 @@ const Qh = class extends qt {
6307
6307
  height: Bp,
6308
6308
  width: Hp
6309
6309
  });
6310
- m(this, hs, {
6310
+ m(this, ps, {
6311
6311
  brand: "#2160FD",
6312
6312
  background: "#141414",
6313
6313
  text: "#000000",
@@ -6355,7 +6355,7 @@ const Qh = class extends qt {
6355
6355
  h(this, "disable", (e = !1) => {
6356
6356
  f(this, Ys, "idle"), this.cleanupEventListeners(), cancelAnimationFrame(n(this, zs)), e !== !0 && document.body.removeChild(n(this, st)), f(this, zs, void 0), document.pictureInPictureElement && document.exitPictureInPicture();
6357
6357
  });
6358
- f(this, mi, e), f(this, Ys, "idle"), f(this, De, r), f(this, hs, {
6358
+ f(this, mi, e), f(this, Ys, "idle"), f(this, De, r), f(this, ps, {
6359
6359
  brand: r.config.designTokens.colors.brand[500],
6360
6360
  background: r.config.designTokens.colors.background[1e3],
6361
6361
  text: r.config.designTokens.colors.text,
@@ -6441,7 +6441,7 @@ const Qh = class extends qt {
6441
6441
  if (n(this, Kt) === void 0)
6442
6442
  return;
6443
6443
  const o = n(this, Kt).getContext("2d"), c = n(this, Kt).width, d = 0, l = 0, p = r - d * 2, g = i - d * 2, S = Math.floor(c / p), v = Math.floor(e / S), P = e % S * (p + d) + d, C = v * (g + d) + d, { displayText: w, image: $ } = a != null ? a : {};
6444
- o.fillStyle = w || $ ? n(this, hs).videoBackground : n(this, hs).background, o.strokeStyle = n(this, hs).brand, o.beginPath(), o.moveTo(P + l, C), o.arcTo(P + p, C, P + p, C + l, l), o.arcTo(
6444
+ o.fillStyle = w || $ ? n(this, ps).videoBackground : n(this, ps).background, o.strokeStyle = n(this, ps).brand, o.beginPath(), o.moveTo(P + l, C), o.arcTo(P + p, C, P + p, C + l, l), o.arcTo(
6445
6445
  P + p,
6446
6446
  C + g,
6447
6447
  P + p - l,
@@ -6449,26 +6449,26 @@ const Qh = class extends qt {
6449
6449
  l
6450
6450
  ), o.arcTo(P, C + g, P, C + g - l, l), o.arcTo(P, C, P + l, C, l), o.closePath(), o.fill(), o.stroke();
6451
6451
  const F = p / 6, N = p / 2 + P, B = g / 2 + C;
6452
- o.save(), (w || $) && (o.beginPath(), o.arc(N, B, F, 0, Math.PI * 2), o.fillStyle = n(this, hs).brand, o.fill(), $ ? (o.clip(), o.drawImage(
6452
+ o.save(), (w || $) && (o.beginPath(), o.arc(N, B, F, 0, Math.PI * 2), o.fillStyle = n(this, ps).brand, o.fill(), $ ? (o.clip(), o.drawImage(
6453
6453
  $,
6454
6454
  N - F,
6455
6455
  B - F,
6456
6456
  F * 2,
6457
6457
  F * 2
6458
- ), o.restore()) : w && (o.fillStyle = n(this, hs).textOnBrand, o.font = `${F / 2}px sans-serif`, o.textAlign = "center", o.textBaseline = "middle", o.fillText(w, N, B)), this.drawIcons(a, P, C, Math.max(p, g)));
6458
+ ), o.restore()) : w && (o.fillStyle = n(this, ps).textOnBrand, o.font = `${F / 2}px sans-serif`, o.textAlign = "center", o.textBaseline = "middle", o.fillText(w, N, B)), this.drawIcons(a, P, C, Math.max(p, g)));
6459
6459
  }
6460
6460
  drawIcons(e, r, i, a) {
6461
6461
  const o = Math.min(Math.max(a * 0.15, 100), 200), c = o * 0.2, d = o * 0.2;
6462
6462
  let l = r + c;
6463
6463
  const p = i + c, g = (S) => {
6464
6464
  const v = n(this, Kt).getContext("2d");
6465
- v.save(), v.fillStyle = n(this, hs).background, v.beginPath(), v.moveTo(l + d, p), v.arcTo(l + o, p, l + o, p + d, d), v.arcTo(
6465
+ v.save(), v.fillStyle = n(this, ps).background, v.beginPath(), v.moveTo(l + d, p), v.arcTo(l + o, p, l + o, p + d, d), v.arcTo(
6466
6466
  l + o,
6467
6467
  p + o,
6468
6468
  l + o - d,
6469
6469
  p + o,
6470
6470
  d
6471
- ), v.arcTo(l, p + o, l, p + o - d, d), v.arcTo(l, p, l + d, p, d), v.closePath(), v.fill(), typeof S == "string" ? (v.font = `${o / 1.5}px sans-serif`, v.fillStyle = n(this, hs).text, v.textAlign = "center", v.textBaseline = "top", v.fillText(S, o / 2 + l, p + c)) : v.drawImage(
6471
+ ), v.arcTo(l, p + o, l, p + o - d, d), v.arcTo(l, p, l + d, p, d), v.closePath(), v.fill(), typeof S == "string" ? (v.font = `${o / 1.5}px sans-serif`, v.fillStyle = n(this, ps).text, v.textAlign = "center", v.textBaseline = "top", v.fillText(S, o / 2 + l, p + c)) : v.drawImage(
6472
6472
  S,
6473
6473
  l + c,
6474
6474
  p + c,
@@ -6664,8 +6664,8 @@ const Qh = class extends qt {
6664
6664
  });
6665
6665
  }
6666
6666
  };
6667
- let Cu = Qh;
6668
- Kt = new WeakMap(), mi = new WeakMap(), st = new WeakMap(), zt = new WeakMap(), be = new WeakMap(), hs = new WeakMap(), zs = new WeakMap(), gt = new WeakMap(), De = new WeakMap(), On = new WeakMap(), Nn = new WeakMap(), Ys = new WeakMap(), Vn = new WeakMap();
6667
+ let wu = Qh;
6668
+ Kt = new WeakMap(), mi = new WeakMap(), st = new WeakMap(), zt = new WeakMap(), be = new WeakMap(), ps = new WeakMap(), zs = new WeakMap(), gt = new WeakMap(), De = new WeakMap(), On = new WeakMap(), Nn = new WeakMap(), Ys = new WeakMap(), Vn = new WeakMap();
6669
6669
  var vr;
6670
6670
  (function(s) {
6671
6671
  s[s.PUBLISHER = 0] = "PUBLISHER", s[s.SUBSCRIBER = 1] = "SUBSCRIBER";
@@ -7892,7 +7892,7 @@ class HR extends T {
7892
7892
  ]);
7893
7893
  }
7894
7894
  }
7895
- const wu = new HR();
7895
+ const Ru = new HR();
7896
7896
  class qR extends T {
7897
7897
  constructor() {
7898
7898
  super("media.edge.SelectedPeersDiffEntry", [
@@ -7933,7 +7933,7 @@ class JR extends T {
7933
7933
  super("media.edge.PeerJoinCompleteResponse", [
7934
7934
  { no: 1, name: "room_state", kind: "message", T: () => xR },
7935
7935
  { no: 2, name: "participants", kind: "message", repeat: 1, T: () => yf },
7936
- { no: 3, name: "selected_peers", kind: "message", T: () => wu },
7936
+ { no: 3, name: "selected_peers", kind: "message", T: () => Ru },
7937
7937
  {
7938
7938
  no: 4,
7939
7939
  name: "max_preferred_streams",
@@ -7944,7 +7944,7 @@ class JR extends T {
7944
7944
  ]);
7945
7945
  }
7946
7946
  }
7947
- const Ru = new JR();
7947
+ const bu = new JR();
7948
7948
  class KR extends T {
7949
7949
  constructor() {
7950
7950
  super("media.edge.PeerLeaveResponse", [
@@ -8285,7 +8285,7 @@ class Ib extends T {
8285
8285
  ]);
8286
8286
  }
8287
8287
  }
8288
- const bu = new Ib();
8288
+ const ku = new Ib();
8289
8289
  class Ab extends T {
8290
8290
  constructor() {
8291
8291
  super("media.edge.GlobalPeerPinningBroadcastResponse", [
@@ -8418,7 +8418,7 @@ class xb extends T {
8418
8418
  ]);
8419
8419
  }
8420
8420
  }
8421
- const nu = new xb();
8421
+ const au = new xb();
8422
8422
  class Ub extends T {
8423
8423
  constructor() {
8424
8424
  super("socket.api.BaseSocketHubMessage", [
@@ -8514,14 +8514,14 @@ var pr;
8514
8514
  (function(s) {
8515
8515
  s[s.UNSPECIFIED = 0] = "UNSPECIFIED", s[s.ON_STAGE = 1] = "ON_STAGE", s[s.APPROVED_STAGE = 2] = "APPROVED_STAGE", s[s.REQUESTED_STAGE = 3] = "REQUESTED_STAGE", s[s.OFF_STAGE = 4] = "OFF_STAGE";
8516
8516
  })(pr || (pr = {}));
8517
- var ku;
8517
+ var Iu;
8518
8518
  (function(s) {
8519
8519
  s[s.NONE = 0] = "NONE", s[s.RECORDER = 1] = "RECORDER", s[s.LIVESTREAMER = 2] = "LIVESTREAMER";
8520
- })(ku || (ku = {}));
8521
- var Iu;
8520
+ })(Iu || (Iu = {}));
8521
+ var Au;
8522
8522
  (function(s) {
8523
8523
  s[s.PEERS = 0] = "PEERS", s[s.ROOMS = 1] = "ROOMS";
8524
- })(Iu || (Iu = {}));
8524
+ })(Au || (Au = {}));
8525
8525
  var Rd;
8526
8526
  (function(s) {
8527
8527
  s[s.HIVE = 0] = "HIVE", s[s.CHAT = 1] = "CHAT", s[s.PING = 2] = "PING";
@@ -8614,11 +8614,11 @@ class qb extends T {
8614
8614
  ]);
8615
8615
  }
8616
8616
  }
8617
- const Fl = new qb();
8617
+ const Bl = new qb();
8618
8618
  class jb extends T {
8619
8619
  constructor() {
8620
8620
  super("socket.room.PeerInfoResponse", [
8621
- { no: 1, name: "peer", kind: "message", T: () => Fl }
8621
+ { no: 1, name: "peer", kind: "message", T: () => Bl }
8622
8622
  ]);
8623
8623
  }
8624
8624
  }
@@ -8676,11 +8676,11 @@ const Jb = new Wb();
8676
8676
  class Kb extends T {
8677
8677
  constructor() {
8678
8678
  super("socket.room.RoomPeersInfoResponse", [
8679
- { no: 1, name: "peers", kind: "message", repeat: 1, T: () => Fl }
8679
+ { no: 1, name: "peers", kind: "message", repeat: 1, T: () => Bl }
8680
8680
  ]);
8681
8681
  }
8682
8682
  }
8683
- const au = new Kb();
8683
+ const ou = new Kb();
8684
8684
  class zb extends T {
8685
8685
  constructor() {
8686
8686
  super("socket.room.RoomPeerCountResponse", [
@@ -8803,7 +8803,7 @@ new tk();
8803
8803
  class sk extends T {
8804
8804
  constructor() {
8805
8805
  super("socket.room.JoinRoomRequest", [
8806
- { no: 1, name: "peer", kind: "message", T: () => Fl },
8806
+ { no: 1, name: "peer", kind: "message", T: () => Bl },
8807
8807
  {
8808
8808
  no: 3,
8809
8809
  name: "room_uuid",
@@ -8852,7 +8852,7 @@ const rk = new sk();
8852
8852
  class ik extends T {
8853
8853
  constructor() {
8854
8854
  super("socket.room.LeaveRoomRequest", [
8855
- { no: 1, name: "peer", kind: "message", T: () => Fl },
8855
+ { no: 1, name: "peer", kind: "message", T: () => Bl },
8856
8856
  {
8857
8857
  no: 2,
8858
8858
  name: "timestamp",
@@ -9327,7 +9327,7 @@ class Gk extends T {
9327
9327
  T: 9
9328
9328
  /*ScalarType.STRING*/
9329
9329
  },
9330
- { no: 5, name: "broadcast_type", kind: "enum", opt: !0, T: () => ["socket.room.BroadcastType", Iu, "BROADCAST_TYPE_"] }
9330
+ { no: 5, name: "broadcast_type", kind: "enum", opt: !0, T: () => ["socket.room.BroadcastType", Au, "BROADCAST_TYPE_"] }
9331
9331
  ]);
9332
9332
  }
9333
9333
  }
@@ -9453,10 +9453,10 @@ class Zk extends T {
9453
9453
  }
9454
9454
  }
9455
9455
  const sg = new Zk();
9456
- var Au;
9456
+ var Mu;
9457
9457
  (function(s) {
9458
9458
  s[s.NONE = 0] = "NONE", s[s.SKIP = 1] = "SKIP", s[s.ON_PRIVILEGED_USER_ENTRY = 2] = "ON_PRIVILEGED_USER_ENTRY", s[s.SKIP_ON_ACCEPT = 3] = "SKIP_ON_ACCEPT";
9459
- })(Au || (Au = {}));
9459
+ })(Mu || (Mu = {}));
9460
9460
  var Qr;
9461
9461
  (function(s) {
9462
9462
  s[s.NONE = 0] = "NONE", s[s.ALLOWED = 1] = "ALLOWED", s[s.NOT_ALLOWED = 2] = "NOT_ALLOWED", s[s.CAN_REQUEST = 3] = "CAN_REQUEST";
@@ -9633,13 +9633,13 @@ class hI extends T {
9633
9633
  ]);
9634
9634
  }
9635
9635
  }
9636
- const ou = new hI();
9636
+ const cu = new hI();
9637
9637
  class pI extends T {
9638
9638
  constructor() {
9639
9639
  super("socket.preset.MediaPermissionUpdate", [
9640
- { no: 1, name: "video", kind: "message", T: () => ou },
9641
- { no: 2, name: "audio", kind: "message", T: () => ou },
9642
- { no: 3, name: "screenshare", kind: "message", T: () => ou }
9640
+ { no: 1, name: "video", kind: "message", T: () => cu },
9641
+ { no: 2, name: "audio", kind: "message", T: () => cu },
9642
+ { no: 3, name: "screenshare", kind: "message", T: () => cu }
9643
9643
  ]);
9644
9644
  }
9645
9645
  }
@@ -9746,7 +9746,7 @@ class mI extends T {
9746
9746
  T: 8
9747
9747
  /*ScalarType.BOOL*/
9748
9748
  },
9749
- { no: 16, name: "waiting_room_type", kind: "enum", opt: !0, T: () => ["socket.preset.WaitingRoomType", Au, "WAITING_ROOM_TYPE_"] },
9749
+ { no: 16, name: "waiting_room_type", kind: "enum", opt: !0, T: () => ["socket.preset.WaitingRoomType", Mu, "WAITING_ROOM_TYPE_"] },
9750
9750
  {
9751
9751
  no: 17,
9752
9752
  name: "is_recorder",
@@ -9755,7 +9755,7 @@ class mI extends T {
9755
9755
  T: 8
9756
9756
  /*ScalarType.BOOL*/
9757
9757
  },
9758
- { no: 18, name: "recorder_type", kind: "enum", opt: !0, T: () => ["socket.room.RecorderType", ku, "RECORDER_TYPE_"] },
9758
+ { no: 18, name: "recorder_type", kind: "enum", opt: !0, T: () => ["socket.room.RecorderType", Iu, "RECORDER_TYPE_"] },
9759
9759
  {
9760
9760
  no: 19,
9761
9761
  name: "hidden_participant",
@@ -10105,7 +10105,7 @@ class UI extends T {
10105
10105
  ]);
10106
10106
  }
10107
10107
  }
10108
- const cu = new UI();
10108
+ const du = new UI();
10109
10109
  class $I extends T {
10110
10110
  constructor() {
10111
10111
  super("socket.chat.SendChatMessageToPeersRequest", [
@@ -10142,7 +10142,7 @@ class BI extends T {
10142
10142
  ]);
10143
10143
  }
10144
10144
  }
10145
- const du = new BI();
10145
+ const lu = new BI();
10146
10146
  class HI extends T {
10147
10147
  constructor() {
10148
10148
  super("socket.chat.SendChatMessageToChannelRequest", [
@@ -10968,11 +10968,11 @@ class WA extends T {
10968
10968
  ]);
10969
10969
  }
10970
10970
  }
10971
- const Mu = new WA();
10971
+ const Du = new WA();
10972
10972
  class JA extends T {
10973
10973
  constructor() {
10974
10974
  super("socket.plugin.EnablePluginsResponse", [
10975
- { no: 1, name: "plugins", kind: "message", repeat: 1, T: () => Mu }
10975
+ { no: 1, name: "plugins", kind: "message", repeat: 1, T: () => Du }
10976
10976
  ]);
10977
10977
  }
10978
10978
  }
@@ -11204,7 +11204,7 @@ class iM extends T {
11204
11204
  ]);
11205
11205
  }
11206
11206
  }
11207
- const lu = new iM();
11207
+ const uu = new iM();
11208
11208
  class nM extends T {
11209
11209
  constructor() {
11210
11210
  super("socket.livestreaming.GrantStageAccessRequest", [
@@ -11434,7 +11434,7 @@ class TM extends T {
11434
11434
  ]);
11435
11435
  }
11436
11436
  }
11437
- const uu = new TM();
11437
+ const hu = new TM();
11438
11438
  class yM extends T {
11439
11439
  constructor() {
11440
11440
  super("socket.polls.GetPollsResponse", [
@@ -11629,11 +11629,11 @@ class CM extends T {
11629
11629
  ]);
11630
11630
  }
11631
11631
  }
11632
- const Du = new CM();
11632
+ const Ou = new CM();
11633
11633
  class wM extends T {
11634
11634
  constructor() {
11635
11635
  super("common.BulkedHubMessage", [
11636
- { no: 1, name: "messages", kind: "message", repeat: 1, T: () => Du }
11636
+ { no: 1, name: "messages", kind: "message", repeat: 1, T: () => Ou }
11637
11637
  ]);
11638
11638
  }
11639
11639
  }
@@ -11641,8 +11641,8 @@ new wM();
11641
11641
  class RM extends T {
11642
11642
  constructor() {
11643
11643
  super("common.CFWorkersResponse", [
11644
- { no: 1, name: "responses", kind: "message", repeat: 1, T: () => Du },
11645
- { no: 2, name: "broadcast_responses", kind: "message", repeat: 1, T: () => Du }
11644
+ { no: 1, name: "responses", kind: "message", repeat: 1, T: () => Ou },
11645
+ { no: 2, name: "broadcast_responses", kind: "message", repeat: 1, T: () => Ou }
11646
11646
  ]);
11647
11647
  }
11648
11648
  }
@@ -11804,7 +11804,7 @@ var $M = Object.defineProperty, FM = Object.getOwnPropertyDescriptor, Oh = (s, t
11804
11804
  (o = s[a]) && (i = (r ? o(t, e, i) : o(i)) || i);
11805
11805
  return r && i && $M(t, e, i), i;
11806
11806
  }, Mr, Ln, Ig;
11807
- const Ou = (Ig = class {
11807
+ const Nu = (Ig = class {
11808
11808
  constructor(s, t) {
11809
11809
  m(this, Mr, void 0);
11810
11810
  m(this, Ln, void 0);
@@ -11840,7 +11840,7 @@ const Ou = (Ig = class {
11840
11840
  ), c = js.fromBinary(
11841
11841
  o.payload
11842
11842
  ).chatChannels;
11843
- return Ou.formatChannel(c[0]);
11843
+ return Nu.formatChannel(c[0]);
11844
11844
  });
11845
11845
  }
11846
11846
  updateChannel(s, t) {
@@ -11857,7 +11857,7 @@ const Ou = (Ig = class {
11857
11857
  ), r = js.fromBinary(
11858
11858
  e.payload
11859
11859
  ).chatChannels;
11860
- return Ou.formatChannel(r[0]);
11860
+ return Nu.formatChannel(r[0]);
11861
11861
  });
11862
11862
  }
11863
11863
  static formatChannel(s) {
@@ -11922,7 +11922,7 @@ const Ou = (Ig = class {
11922
11922
  });
11923
11923
  }
11924
11924
  }, Mr = new WeakMap(), Ln = new WeakMap(), Ig);
11925
- let on = Ou;
11925
+ let on = Nu;
11926
11926
  Oh([
11927
11927
  E.trace("ChatChannelHandler.createChannel")
11928
11928
  ], on.prototype, "createChannel", 1);
@@ -11937,7 +11937,7 @@ var BM = Object.defineProperty, HM = Object.getOwnPropertyDescriptor, As = (s, t
11937
11937
  (o = s[a]) && (i = (r ? o(t, e, i) : o(i)) || i);
11938
11938
  return r && i && BM(t, e, i), i;
11939
11939
  }, Et = /* @__PURE__ */ ((s) => (s[s.TEXT = 0] = "TEXT", s[s.IMAGE = 1] = "IMAGE", s[s.FILE = 2] = "FILE", s[s.CUSTOM = 3] = "CUSTOM", s))(Et || {}), rt, xn;
11940
- class as {
11940
+ class os {
11941
11941
  constructor(t, e) {
11942
11942
  m(this, rt, void 0);
11943
11943
  m(this, xn, void 0);
@@ -12113,17 +12113,17 @@ class as {
12113
12113
  let r, i;
12114
12114
  switch (t) {
12115
12115
  case Re.sendMessageToRoom: {
12116
- r = cu.fromBinary.bind(
12117
- cu
12118
- ), i = cu.create();
12119
- break;
12120
- }
12121
- case Re.sendMessageToPeers: {
12122
12116
  r = du.fromBinary.bind(
12123
12117
  du
12124
12118
  ), i = du.create();
12125
12119
  break;
12126
12120
  }
12121
+ case Re.sendMessageToPeers: {
12122
+ r = lu.fromBinary.bind(
12123
+ lu
12124
+ ), i = lu.create();
12125
+ break;
12126
+ }
12127
12127
  case Re.editMessage: {
12128
12128
  r = ed.fromBinary.bind(
12129
12129
  ed
@@ -12163,37 +12163,37 @@ class as {
12163
12163
  rt = new WeakMap(), xn = new WeakMap();
12164
12164
  As([
12165
12165
  E.trace("SocketService.getChatMessages")
12166
- ], as.prototype, "getChatMessages", 1);
12166
+ ], os.prototype, "getChatMessages", 1);
12167
12167
  As([
12168
12168
  E.trace("SocketService.getChatMessagesPaginated")
12169
- ], as.prototype, "getChatMessagesPaginated", 1);
12169
+ ], os.prototype, "getChatMessagesPaginated", 1);
12170
12170
  As([
12171
12171
  E.trace("SocketService.sendMessageToRoom")
12172
- ], as.prototype, "sendMessageToRoom", 1);
12172
+ ], os.prototype, "sendMessageToRoom", 1);
12173
12173
  As([
12174
12174
  E.trace("SocketService.sendMessageToPeers")
12175
- ], as.prototype, "sendMessageToPeers", 1);
12175
+ ], os.prototype, "sendMessageToPeers", 1);
12176
12176
  As([
12177
12177
  E.trace("SocketService.sendMessageToChannel")
12178
- ], as.prototype, "sendMessageToChannel", 1);
12178
+ ], os.prototype, "sendMessageToChannel", 1);
12179
12179
  As([
12180
12180
  E.trace("SocketService.sendMessage")
12181
- ], as.prototype, "sendMessage", 1);
12181
+ ], os.prototype, "sendMessage", 1);
12182
12182
  As([
12183
12183
  E.trace("SocketService.editMessage")
12184
- ], as.prototype, "editMessage", 1);
12184
+ ], os.prototype, "editMessage", 1);
12185
12185
  As([
12186
12186
  E.trace("SocketService.deleteMessage")
12187
- ], as.prototype, "deleteMessage", 1);
12187
+ ], os.prototype, "deleteMessage", 1);
12188
12188
  As([
12189
12189
  E.trace("SocketService.searchMessages")
12190
- ], as.prototype, "searchMessages", 1);
12190
+ ], os.prototype, "searchMessages", 1);
12191
12191
  As([
12192
12192
  E.trace("SocketService.getAllChannels")
12193
- ], as.prototype, "getAllChannels", 1);
12193
+ ], os.prototype, "getAllChannels", 1);
12194
12194
  As([
12195
12195
  E.trace("SocketService.markLastReadMessage")
12196
- ], as.prototype, "markLastReadMessage", 1);
12196
+ ], os.prototype, "markLastReadMessage", 1);
12197
12197
  function qM(s) {
12198
12198
  return s.replace(
12199
12199
  /([-_]\w)/g,
@@ -12425,7 +12425,7 @@ class KM {
12425
12425
  this.organizationId = t;
12426
12426
  }
12427
12427
  }
12428
- var zM = Object.defineProperty, YM = Object.getOwnPropertyDescriptor, os = (s, t, e, r) => {
12428
+ var zM = Object.defineProperty, YM = Object.getOwnPropertyDescriptor, cs = (s, t, e, r) => {
12429
12429
  for (var i = r > 1 ? void 0 : r ? YM(t, e) : t, a = s.length - 1, o; a >= 0; a--)
12430
12430
  (o = s[a]) && (i = (r ? o(t, e, i) : o(i)) || i);
12431
12431
  return r && i && zM(t, e, i), i;
@@ -12666,48 +12666,48 @@ class jt extends KM {
12666
12666
  });
12667
12667
  }
12668
12668
  }
12669
- os([
12669
+ cs([
12670
12670
  E.trace("APIClient.getIPDetails")
12671
12671
  ], jt.prototype, "getIPDetails", 1);
12672
- os([
12672
+ cs([
12673
12673
  E.trace("APIClient.getICEServers")
12674
12674
  ], jt.prototype, "getICEServers", 1);
12675
- os([
12675
+ cs([
12676
12676
  E.trace("APIClient.getPlugins")
12677
12677
  ], jt.prototype, "getPlugins", 1);
12678
- os([
12678
+ cs([
12679
12679
  E.trace("APIClient.startLivestreaming")
12680
12680
  ], jt.prototype, "startLivestreaming", 1);
12681
- os([
12681
+ cs([
12682
12682
  E.trace("APIClient.stopLivestreaming")
12683
12683
  ], jt.prototype, "stopLivestreaming", 1);
12684
- os([
12684
+ cs([
12685
12685
  E.trace("APIClient.getActiveLivestream")
12686
12686
  ], jt.prototype, "getActiveLivestream", 1);
12687
- os([
12687
+ cs([
12688
12688
  E.trace("APIClient.getUserDetails")
12689
12689
  ], jt.prototype, "getUserDetails", 1);
12690
- os([
12690
+ cs([
12691
12691
  E.trace("APIClient.startRecording")
12692
12692
  ], jt.prototype, "startRecording", 1);
12693
- os([
12693
+ cs([
12694
12694
  E.trace("APIClient.stopRecording")
12695
12695
  ], jt.prototype, "updateRecording", 1);
12696
- os([
12696
+ cs([
12697
12697
  E.trace("APIClient.getActiveRecording")
12698
12698
  ], jt.prototype, "getActiveRecording", 1);
12699
- os([
12699
+ cs([
12700
12700
  E.trace("APIClient.getActiveTranscript")
12701
12701
  ], jt.prototype, "getActiveTranscript", 1);
12702
- os([
12702
+ cs([
12703
12703
  E.trace("APIClient.getRoomNodeData")
12704
12704
  ], jt.prototype, "getRoomNodeData", 1);
12705
- let Nu;
12705
+ let Vu;
12706
12706
  function QM(s, t) {
12707
- return Nu = new jt(s, t), Nu;
12707
+ return Vu = new jt(s, t), Vu;
12708
12708
  }
12709
12709
  function dt() {
12710
- return Nu;
12710
+ return Vu;
12711
12711
  }
12712
12712
  function XM(s, t) {
12713
12713
  return `<blockquote>${t.replace(/<blockquote>[.\s\S]*<\/blockquote>\n\n/m, "")}</blockquote>
@@ -12736,13 +12736,13 @@ var ZM = Object.defineProperty, e0 = Object.getOwnPropertyDescriptor, ht = (s, t
12736
12736
  return r && i && ZM(t, e, i), i;
12737
12737
  };
12738
12738
  const t0 = ["text", "image", "file", "custom", "poll"], ud = { maxInvocations: 180, period: 60 };
12739
- var Z, fi, $e, Si, vi, Ld, Mf, No, Vu, Ag;
12739
+ var Z, fi, $e, Si, vi, xd, Mf, No, Lu, Ag;
12740
12740
  let ze = (Ag = class extends qt {
12741
12741
  constructor(t, e, r, i, a) {
12742
12742
  const o = t.getValue("logger");
12743
12743
  super(o);
12744
12744
  // eslint-disable-next-line class-methods-use-this
12745
- m(this, Ld);
12745
+ m(this, xd);
12746
12746
  /**
12747
12747
  * Returns true if the local participant has joined the meeting.
12748
12748
  */
@@ -13125,7 +13125,7 @@ let ze = (Ag = class extends qt {
13125
13125
  */
13126
13126
  pin(t) {
13127
13127
  return u(this, null, function* () {
13128
- if (!n(this, No, Vu))
13128
+ if (!n(this, No, Lu))
13129
13129
  throw new b("Can`t pin message without joining room", "0505");
13130
13130
  if (!n(this, Z).permissions.pinParticipant)
13131
13131
  throw new b("You do not have permission to pin messages.", "0501");
@@ -13143,7 +13143,7 @@ let ze = (Ag = class extends qt {
13143
13143
  */
13144
13144
  unpin(t) {
13145
13145
  return u(this, null, function* () {
13146
- if (!n(this, No, Vu))
13146
+ if (!n(this, No, Lu))
13147
13147
  throw new b("Can`t unpin message without joining room", "0505");
13148
13148
  if (!n(this, Z).permissions.pinParticipant)
13149
13149
  throw new b("You do not have permission to unpin messages.", "0501");
@@ -13245,10 +13245,10 @@ let ze = (Ag = class extends qt {
13245
13245
  get pinned() {
13246
13246
  return this.messages.filter((t) => t.pinned);
13247
13247
  }
13248
- }, Z = new WeakMap(), fi = new WeakMap(), $e = new WeakMap(), Si = new WeakMap(), vi = new WeakMap(), Ld = new WeakSet(), Mf = function() {
13248
+ }, Z = new WeakMap(), fi = new WeakMap(), $e = new WeakMap(), Si = new WeakMap(), vi = new WeakMap(), xd = new WeakSet(), Mf = function() {
13249
13249
  return n(this, vi).getValue("connectionHandler");
13250
- }, No = new WeakSet(), Vu = function() {
13251
- return n(this, Ld, Mf).socketJoined === !0;
13250
+ }, No = new WeakSet(), Lu = function() {
13251
+ return n(this, xd, Mf).socketJoined === !0;
13252
13252
  }, Ag);
13253
13253
  ht([
13254
13254
  E.trace("Chat.sendTextMessage"),
@@ -13537,17 +13537,17 @@ var n0 = Object.defineProperty, a0 = Object.getOwnPropertyDescriptor, o0 = (s, t
13537
13537
  for (var i = r > 1 ? void 0 : r ? a0(t, e) : t, a = s.length - 1, o; a >= 0; a--)
13538
13538
  (o = s[a]) && (i = (r ? o(t, e, i) : o(i)) || i);
13539
13539
  return r && i && n0(t, e, i), i;
13540
- }, xd, Df, Ud, Of, Un, $n, Vo, Dg;
13541
- let Lu = (Dg = class extends qt {
13540
+ }, Ud, Df, $d, Of, Un, $n, Vo, Dg;
13541
+ let xu = (Dg = class extends qt {
13542
13542
  constructor(t, e, r) {
13543
13543
  const i = t.getValue("logger");
13544
13544
  super(i);
13545
13545
  // eslint-disable-next-line class-methods-use-this
13546
- m(this, xd);
13546
+ m(this, Ud);
13547
13547
  /**
13548
13548
  * Returns true if the local participant has joined the meeting.
13549
13549
  */
13550
- m(this, Ud);
13550
+ m(this, $d);
13551
13551
  /**
13552
13552
  * An array of poll items.
13553
13553
  */
@@ -13566,7 +13566,7 @@ let Lu = (Dg = class extends qt {
13566
13566
  */
13567
13567
  create(t, e, r = !1, i = !1) {
13568
13568
  return u(this, null, function* () {
13569
- if (!n(this, Ud, Of))
13569
+ if (!n(this, $d, Of))
13570
13570
  throw new b("Can't create polls without joining room", "0705");
13571
13571
  if (!n(this, Un).permissions.polls.canCreate) {
13572
13572
  this.logger.error("Polls::create::permission_denied");
@@ -13609,15 +13609,15 @@ let Lu = (Dg = class extends qt {
13609
13609
  yield n(this, $n).votePoll(t, e);
13610
13610
  });
13611
13611
  }
13612
- }, xd = new WeakSet(), Df = function() {
13612
+ }, Ud = new WeakSet(), Df = function() {
13613
13613
  return n(this, Vo).getValue("connectionHandler");
13614
- }, Ud = new WeakSet(), Of = function() {
13614
+ }, $d = new WeakSet(), Of = function() {
13615
13615
  var t;
13616
- return ((t = n(this, xd, Df)) == null ? void 0 : t.socketJoined) === !0;
13616
+ return ((t = n(this, Ud, Df)) == null ? void 0 : t.socketJoined) === !0;
13617
13617
  }, Un = new WeakMap(), $n = new WeakMap(), Vo = new WeakMap(), Dg);
13618
- Lu = o0([
13618
+ xu = o0([
13619
13619
  ut("0700")
13620
- ], Lu);
13620
+ ], xu);
13621
13621
  var c0 = Object.defineProperty, d0 = Object.getOwnPropertyDescriptor, l0 = (s, t, e, r) => {
13622
13622
  for (var i = r > 1 ? void 0 : r ? d0(t, e) : t, a = s.length - 1, o; a >= 0; a--)
13623
13623
  (o = s[a]) && (i = (r ? o(t, e, i) : o(i)) || i);
@@ -13629,7 +13629,7 @@ const vn = (Og = class {
13629
13629
  m(this, Or, void 0);
13630
13630
  m(this, Fn, void 0);
13631
13631
  m(this, Ti, void 0);
13632
- this.polls = new Lu(s, t, e), f(this, Fn, t), f(this, Or, s), f(this, Ti, e), this.setupEvents();
13632
+ this.polls = new xu(s, t, e), f(this, Fn, t), f(this, Or, s), f(this, Ti, e), this.setupEvents();
13633
13633
  }
13634
13634
  /**
13635
13635
  * @access private
@@ -13736,8 +13736,8 @@ var u0 = Object.defineProperty, h0 = Object.getOwnPropertyDescriptor, p0 = (s, t
13736
13736
  for (var i = r > 1 ? void 0 : r ? h0(t, e) : t, a = s.length - 1, o; a >= 0; a--)
13737
13737
  (o = s[a]) && (i = (r ? o(t, e, i) : o(i)) || i);
13738
13738
  return r && i && u0(t, e, i), i;
13739
- }, Vf = /* @__PURE__ */ ((s) => (s[s.User = 0] = "User", s[s.Meeting = 1] = "Meeting", s))(Vf || {}), Bn, Lo, Uu, yi, xo, Ng;
13740
- let xu = (Ng = class extends qt {
13739
+ }, Vf = /* @__PURE__ */ ((s) => (s[s.User = 0] = "User", s[s.Meeting = 1] = "Meeting", s))(Vf || {}), Bn, Lo, $u, yi, xo, Ng;
13740
+ let Uu = (Ng = class extends qt {
13741
13741
  constructor(t, e, r, i, a) {
13742
13742
  const o = t.getValue("logger");
13743
13743
  super(o);
@@ -13773,10 +13773,10 @@ let xu = (Ng = class extends qt {
13773
13773
  f(this, Bn, t), f(this, yi, e), this.viewType = r, f(this, xo, i), this.meetingTitle = a, this.broadcastTabChanges = e.permissions.canSpotlight;
13774
13774
  }
13775
13775
  get socketState() {
13776
- return n(this, Lo, Uu).socketState;
13776
+ return n(this, Lo, $u).socketState;
13777
13777
  }
13778
13778
  get mediaState() {
13779
- return n(this, Lo, Uu).mediaState;
13779
+ return n(this, Lo, $u).mediaState;
13780
13780
  }
13781
13781
  /**
13782
13782
  * The room name of the meeting.
@@ -13814,12 +13814,12 @@ let xu = (Ng = class extends qt {
13814
13814
  currentTab: this.selfActiveTab
13815
13815
  });
13816
13816
  }
13817
- }, Bn = new WeakMap(), Lo = new WeakSet(), Uu = function() {
13817
+ }, Bn = new WeakMap(), Lo = new WeakSet(), $u = function() {
13818
13818
  return n(this, Bn).getValue("connectionHandler");
13819
13819
  }, yi = new WeakMap(), xo = new WeakMap(), Ng);
13820
- xu = p0([
13820
+ Uu = p0([
13821
13821
  ut("0800")
13822
- ], xu);
13822
+ ], Uu);
13823
13823
  function g0(s) {
13824
13824
  let t = "", e = [""];
13825
13825
  const r = [e];
@@ -13933,7 +13933,7 @@ const xf = (Lg = class {
13933
13933
  m(this, Hn, void 0);
13934
13934
  h(this, "aiSocketHandler");
13935
13935
  m(this, Lt, void 0);
13936
- f(this, Lt, s), this.meta = new xu(
13936
+ f(this, Lt, s), this.meta = new Uu(
13937
13937
  s,
13938
13938
  t,
13939
13939
  t.config.viewType,
@@ -14154,7 +14154,7 @@ var y0 = Object.defineProperty, E0 = Object.getOwnPropertyDescriptor, pn = (s, t
14154
14154
  for (var i = r > 1 ? void 0 : r ? E0(t, e) : t, a = s.length - 1, o; a >= 0; a--)
14155
14155
  (o = s[a]) && (i = (r ? o(t, e, i) : o(i)) || i);
14156
14156
  return r && i && y0(t, e, i), i;
14157
- }, Yt, $d, ie, $o, Ds, We, Fo, $u, qn, hd;
14157
+ }, Yt, Fd, ie, $o, Ds, We, Fo, Fu, qn, hd;
14158
14158
  class si extends qt {
14159
14159
  constructor(e, r, i, a, o) {
14160
14160
  const c = e.getValue("logger");
@@ -14163,12 +14163,12 @@ class si extends qt {
14163
14163
  m(this, Fo);
14164
14164
  m(this, qn);
14165
14165
  m(this, Yt, void 0);
14166
- m(this, $d, void 0);
14166
+ m(this, Fd, void 0);
14167
14167
  m(this, ie, void 0);
14168
14168
  m(this, $o, void 0);
14169
14169
  m(this, Ds, void 0);
14170
14170
  m(this, We, void 0);
14171
- f(this, We, e), f(this, Yt, a), f(this, $d, o), f(this, ie, r), f(this, $o, i), f(this, Ds, []), this.setupEvents();
14171
+ f(this, We, e), f(this, Yt, a), f(this, Fd, o), f(this, ie, r), f(this, $o, i), f(this, Ds, []), this.setupEvents();
14172
14172
  }
14173
14173
  /**
14174
14174
  * @access private
@@ -14293,7 +14293,7 @@ class si extends qt {
14293
14293
  yield n(this, We).getValue("selfController").joinRoom();
14294
14294
  return;
14295
14295
  }
14296
- n(this, We).notify("stageStatus"), n(this, ie).audioEnabled && n(this, Fo, $u).shareMic(n(this, ie).audioTrack), n(this, ie).videoEnabled && n(this, Fo, $u).shareWebcam(n(this, ie).videoTrack);
14296
+ n(this, We).notify("stageStatus"), n(this, ie).audioEnabled && n(this, Fo, Fu).shareMic(n(this, ie).audioTrack), n(this, ie).videoEnabled && n(this, Fo, Fu).shareWebcam(n(this, ie).videoTrack);
14297
14297
  });
14298
14298
  }
14299
14299
  leave() {
@@ -14331,7 +14331,7 @@ class si extends qt {
14331
14331
  });
14332
14332
  }
14333
14333
  }
14334
- Yt = new WeakMap(), $d = new WeakMap(), ie = new WeakMap(), $o = new WeakMap(), Ds = new WeakMap(), We = new WeakMap(), Fo = new WeakSet(), $u = function() {
14334
+ Yt = new WeakMap(), Fd = new WeakMap(), ie = new WeakMap(), $o = new WeakMap(), Ds = new WeakMap(), We = new WeakMap(), Fo = new WeakSet(), Fu = function() {
14335
14335
  return n(this, We).getValue("roomNodeClient");
14336
14336
  }, qn = new WeakSet(), hd = function(e) {
14337
14337
  return u(this, null, function* () {
@@ -14387,12 +14387,12 @@ var P0 = Object.defineProperty, C0 = Object.getOwnPropertyDescriptor, w0 = (s, t
14387
14387
  for (var i = r > 1 ? void 0 : r ? C0(t, e) : t, a = s.length - 1, o; a >= 0; a--)
14388
14388
  (o = s[a]) && (i = (r ? o(t, e, i) : o(i)) || i);
14389
14389
  return r && i && P0(t, e, i), i;
14390
- }, Vr, ps, Lr, Bo, mt;
14390
+ }, Vr, gs, Lr, Bo, mt;
14391
14391
  class $f {
14392
14392
  constructor(t, e, r, i, a) {
14393
14393
  h(this, "stage");
14394
14394
  m(this, Vr, void 0);
14395
- m(this, ps, void 0);
14395
+ m(this, gs, void 0);
14396
14396
  m(this, Lr, void 0);
14397
14397
  m(this, Bo, 0);
14398
14398
  m(this, mt, void 0);
@@ -14402,7 +14402,7 @@ class $f {
14402
14402
  a,
14403
14403
  e,
14404
14404
  r
14405
- ), f(this, Lr, e), f(this, Vr, i), f(this, ps, a), this.setupEvents();
14405
+ ), f(this, Lr, e), f(this, Vr, i), f(this, gs, a), this.setupEvents();
14406
14406
  }
14407
14407
  /**
14408
14408
  * @access private
@@ -14439,7 +14439,7 @@ class $f {
14439
14439
  );
14440
14440
  }
14441
14441
  getCurrentStageRequests() {
14442
- return n(this, ps).joined.toArray().filter(
14442
+ return n(this, gs).joined.toArray().filter(
14443
14443
  (e) => e.stageStatus === "REQUESTED_TO_JOIN_STAGE"
14444
14444
  ).map((e) => ({
14445
14445
  displayName: e.name,
@@ -14480,14 +14480,14 @@ class $f {
14480
14480
  */
14481
14481
  peerStageStatusHandler(t) {
14482
14482
  return u(this, null, function* () {
14483
- const e = n(this, ps).joined.get(t.peerId), r = n(this, ps).viewMode === "ACTIVE_GRID";
14483
+ const e = n(this, gs).joined.get(t.peerId), r = n(this, gs).viewMode === "ACTIVE_GRID";
14484
14484
  if (!e) {
14485
14485
  this.logger.warn("err::peerStageStatusUpdate: participant not found");
14486
14486
  return;
14487
14487
  }
14488
14488
  switch (t.stageType) {
14489
14489
  case 1:
14490
- e.setStageStatus("ON_STAGE"), r && n(this, mt).getValue("peerSessionStore").emit(k.UPDATE_ACTIVE, { viewMode: n(this, ps).viewMode, page: n(this, ps).currentPage });
14490
+ e.setStageStatus("ON_STAGE"), r && n(this, mt).getValue("peerSessionStore").emit(k.UPDATE_ACTIVE, { viewMode: n(this, gs).viewMode, page: n(this, gs).currentPage });
14491
14491
  break;
14492
14492
  case 2:
14493
14493
  e.setStageStatus("ACCEPTED_TO_JOIN_STAGE");
@@ -14498,7 +14498,7 @@ class $f {
14498
14498
  case 0:
14499
14499
  case 4:
14500
14500
  default:
14501
- e.setStageStatus("OFF_STAGE"), r && n(this, mt).getValue("peerSessionStore").emit(k.UPDATE_ACTIVE, { viewMode: n(this, ps).viewMode, page: n(this, ps).currentPage });
14501
+ e.setStageStatus("OFF_STAGE"), r && n(this, mt).getValue("peerSessionStore").emit(k.UPDATE_ACTIVE, { viewMode: n(this, gs).viewMode, page: n(this, gs).currentPage });
14502
14502
  break;
14503
14503
  }
14504
14504
  n(this, mt).getValue("peerSessionStore").emit(k.UPDATE_PEER_STAGE_STATUS, {
@@ -14508,11 +14508,11 @@ class $f {
14508
14508
  });
14509
14509
  }
14510
14510
  }
14511
- Vr = new WeakMap(), ps = new WeakMap(), Lr = new WeakMap(), Bo = new WeakMap(), mt = new WeakMap();
14511
+ Vr = new WeakMap(), gs = new WeakMap(), Lr = new WeakMap(), Bo = new WeakMap(), mt = new WeakMap();
14512
14512
  w0([
14513
14513
  E.trace("Stage.setupEvents")
14514
14514
  ], $f.prototype, "setupEvents", 1);
14515
- var R0 = Object.defineProperty, b0 = Object.getOwnPropertyDescriptor, Bl = (s, t, e, r) => {
14515
+ var R0 = Object.defineProperty, b0 = Object.getOwnPropertyDescriptor, Hl = (s, t, e, r) => {
14516
14516
  for (var i = r > 1 ? void 0 : r ? b0(t, e) : t, a = s.length - 1, o; a >= 0; a--)
14517
14517
  (o = s[a]) && (i = (r ? o(t, e, i) : o(i)) || i);
14518
14518
  return r && i && R0(t, e, i), i;
@@ -14904,16 +14904,16 @@ let xa = (xg = class extends Ua {
14904
14904
  });
14905
14905
  }
14906
14906
  }, it = new WeakMap(), xt = new WeakMap(), jn = new WeakMap(), Gn = new WeakMap(), Qs = new WeakMap(), Wn = new WeakMap(), xr = new WeakMap(), Jn = new WeakMap(), xg);
14907
- Bl([
14907
+ Hl([
14908
14908
  Mt({ maxInvocations: 5, period: 1 })
14909
14909
  ], xa.prototype, "sendData", 1);
14910
- Bl([
14910
+ Hl([
14911
14911
  E.trace("Plugin.activatePlugin")
14912
14912
  ], xa.prototype, "activate", 1);
14913
- Bl([
14913
+ Hl([
14914
14914
  E.trace("Plugin.deactivatePlugin")
14915
14915
  ], xa.prototype, "deactivate", 1);
14916
- xa = Bl([
14916
+ xa = Hl([
14917
14917
  ut("0600")
14918
14918
  ], xa);
14919
14919
  var Oe, Ei;
@@ -15022,7 +15022,7 @@ var k0 = Object.defineProperty, I0 = Object.getOwnPropertyDescriptor, A0 = (s, t
15022
15022
  (o = s[a]) && (i = (r ? o(t, e, i) : o(i)) || i);
15023
15023
  return r && i && k0(t, e, i), i;
15024
15024
  };
15025
- let Fu = class {
15025
+ let Bu = class {
15026
15026
  constructor(s) {
15027
15027
  /**
15028
15028
  * All plugins accessible by the current user.
@@ -15035,39 +15035,39 @@ let Fu = class {
15035
15035
  this.all = new pg(s), this.active = new pg(s);
15036
15036
  }
15037
15037
  };
15038
- Fu = A0([
15038
+ Bu = A0([
15039
15039
  ut("0600")
15040
- ], Fu);
15041
- var M0 = Object.defineProperty, D0 = Object.getOwnPropertyDescriptor, Hl = (s, t, e, r) => {
15040
+ ], Bu);
15041
+ var M0 = Object.defineProperty, D0 = Object.getOwnPropertyDescriptor, ql = (s, t, e, r) => {
15042
15042
  for (var i = r > 1 ? void 0 : r ? D0(t, e) : t, a = s.length - 1, o; a >= 0; a--)
15043
15043
  (o = s[a]) && (i = (r ? o(t, e, i) : o(i)) || i);
15044
15044
  return r && i && M0(t, e, i), i;
15045
- }, Qt, Kn, gs, Ug;
15045
+ }, Qt, Kn, ms, Ug;
15046
15046
  const Bf = (Ug = class {
15047
15047
  constructor(s, t, e, r) {
15048
15048
  h(this, "plugins");
15049
15049
  m(this, Qt, void 0);
15050
15050
  m(this, Kn, void 0);
15051
- m(this, gs, void 0);
15052
- f(this, Qt, t), f(this, Kn, e), f(this, gs, s), this.plugins = r, this.setupEvents();
15051
+ m(this, ms, void 0);
15052
+ f(this, Qt, t), f(this, Kn, e), f(this, ms, s), this.plugins = r, this.setupEvents();
15053
15053
  }
15054
15054
  /**
15055
15055
  * @access private
15056
15056
  * Not for external use
15057
15057
  */
15058
15058
  get telemetry() {
15059
- return n(this, gs).getValue("telemetry");
15059
+ return n(this, ms).getValue("telemetry");
15060
15060
  }
15061
15061
  /**
15062
15062
  * @access private
15063
15063
  * Not for external use
15064
15064
  */
15065
15065
  get logger() {
15066
- return n(this, gs).getValue("logger");
15066
+ return n(this, ms).getValue("logger");
15067
15067
  }
15068
15068
  static init(s, t, e, r, i, a, o, c) {
15069
15069
  return u(this, null, function* () {
15070
- const d = s.getValue("logger"), l = new Fu(d);
15070
+ const d = s.getValue("logger"), l = new Bu(d);
15071
15071
  return t.forEach((p) => {
15072
15072
  const g = new xa(
15073
15073
  s,
@@ -15137,7 +15137,7 @@ const Bf = (Ug = class {
15137
15137
  }
15138
15138
  this.plugins.active.delete(t);
15139
15139
  }
15140
- ), n(this, gs).getValue("peerSessionStore").onAsync(k.SOCKET_SERVICE_ROOM_JOINED, () => u(this, null, function* () {
15140
+ ), n(this, ms).getValue("peerSessionStore").onAsync(k.SOCKET_SERVICE_ROOM_JOINED, () => u(this, null, function* () {
15141
15141
  yield this.getRoomPlugins(), this.logger.debug("[SOCKET_SERVICE_ROOM_JOINED] resolved request to fetch plugins.");
15142
15142
  })), n(this, Qt).on(
15143
15143
  J.addPlugin,
@@ -15240,29 +15240,29 @@ const Bf = (Ug = class {
15240
15240
  );
15241
15241
  this.broadcastIframeEvent(Ie.chatMessage, { message: t });
15242
15242
  }
15243
- ), n(this, gs).getValue("peerSessionStore").on(k.PEER_JOINED_INTERNAL, (s) => {
15243
+ ), n(this, ms).getValue("peerSessionStore").on(k.PEER_JOINED_INTERNAL, (s) => {
15244
15244
  const t = bd(s);
15245
15245
  this.broadcastIframeEvent(Ie.peerJoined, t);
15246
- }), n(this, gs).getValue("peerSessionStore").on(k.PEER_CLOSED, (s) => {
15246
+ }), n(this, ms).getValue("peerSessionStore").on(k.PEER_CLOSED, (s) => {
15247
15247
  this.broadcastIframeEvent(Ie.peerLeft, s);
15248
- }), n(this, gs).getValue("peerSessionStore").on(k.UPDATE_PEER_STAGE_STATUS, (s) => {
15248
+ }), n(this, ms).getValue("peerSessionStore").on(k.UPDATE_PEER_STAGE_STATUS, (s) => {
15249
15249
  this.broadcastIframeEvent(Ie.peerStageStatusUpdate, s);
15250
- }), n(this, gs).subscribe("stageStatus", (s) => {
15250
+ }), n(this, ms).subscribe("stageStatus", (s) => {
15251
15251
  this.broadcastIframeEvent(Ie.stageStatusUpdate, s);
15252
15252
  });
15253
15253
  }
15254
- }, Qt = new WeakMap(), Kn = new WeakMap(), gs = new WeakMap(), Ug);
15254
+ }, Qt = new WeakMap(), Kn = new WeakMap(), ms = new WeakMap(), Ug);
15255
15255
  let Hc = Bf;
15256
- Hl([
15256
+ ql([
15257
15257
  E.trace("PluginController.getRoomPlugins")
15258
15258
  ], Hc.prototype, "getRoomPlugins", 1);
15259
- Hl([
15259
+ ql([
15260
15260
  E.trace("PluginController.enableForSelf")
15261
15261
  ], Hc.prototype, "enablePlugin", 1);
15262
- Hl([
15262
+ ql([
15263
15263
  E.trace("PluginController.disableForSelf")
15264
15264
  ], Hc.prototype, "disablePlugin", 1);
15265
- Hl([
15265
+ ql([
15266
15266
  E.trace("PluginController.setupEvents")
15267
15267
  ], Hc.prototype, "setupEvents", 1);
15268
15268
  var Ho;
@@ -15589,7 +15589,7 @@ var F0 = Object.defineProperty, B0 = Object.getOwnPropertyDescriptor, Gt = (s, t
15589
15589
  return r && i && F0(t, e, i), i;
15590
15590
  }, He, ve, pe, Xs, Xt, qo, ke;
15591
15591
  class Dt extends Ua {
15592
- constructor(e, r, i = Bu, a = !0) {
15592
+ constructor(e, r, i = kd, a = !0) {
15593
15593
  const o = e.getValue("logger");
15594
15594
  super(o);
15595
15595
  m(this, He, void 0);
@@ -15894,17 +15894,20 @@ class Dt extends Ua {
15894
15894
  }
15895
15895
  onDeviceChange(e, r) {
15896
15896
  return u(this, null, function* () {
15897
- var i, a;
15898
- this.emit("DEVICE_LIST_UPDATED", e), !(r || !n(this, qo)) && ((i = e == null ? void 0 : e.added) == null || i.forEach((o) => u(this, null, function* () {
15899
- var c;
15900
- o && !Bu(o) && (o.kind === "audioinput" && ((c = this.audioTrack) == null ? void 0 : c.enabled) === !0 ? yield this.setAudioDevice(o) : o.kind === "audiooutput" && (yield this.setSpeakerDevice(o)));
15901
- })), (a = e == null ? void 0 : e.removed) == null || a.forEach((o) => u(this, null, function* () {
15902
- var c;
15903
- if (o.kind === "audiooutput" && ((c = this.getCurrentDevices().speaker) == null ? void 0 : c.deviceId) === o.deviceId) {
15904
- const d = (yield this.getSpeakerDevices()).find((l) => l.deviceId !== o.deviceId);
15905
- d && (yield this.setSpeakerDevice(d));
15897
+ var a, o;
15898
+ if (this.emit("DEVICE_LIST_UPDATED", e), r || !n(this, qo))
15899
+ return;
15900
+ let i = !1;
15901
+ (a = e == null ? void 0 : e.added) == null || a.reverse().forEach((c) => u(this, null, function* () {
15902
+ var d;
15903
+ c && !kd(c) && (c.kind === "audioinput" && ((d = this.audioTrack) == null ? void 0 : d.enabled) === !0 ? yield this.setAudioDevice(c) : c.kind === "audiooutput" && (i = !0, yield this.setSpeakerDevice(c)));
15904
+ })), i || (o = e == null ? void 0 : e.removed) == null || o.forEach((c) => u(this, null, function* () {
15905
+ var d;
15906
+ if (c.kind === "audiooutput" && ((d = this.getCurrentDevices().speaker) == null ? void 0 : d.deviceId) === c.deviceId) {
15907
+ const l = yield this.getSpeakerDevices();
15908
+ (l == null ? void 0 : l.length) > 0 && (yield this.setSpeakerDevice(l[0]));
15906
15909
  }
15907
- })));
15910
+ }));
15908
15911
  });
15909
15912
  }
15910
15913
  /**
@@ -16043,7 +16046,7 @@ const H0 = [
16043
16046
  "morphvoxx"
16044
16047
  // MorphVOXX virtual audio device
16045
16048
  ];
16046
- function Bu(s) {
16049
+ function kd(s) {
16047
16050
  var e, r;
16048
16051
  const t = (e = s.label) == null ? void 0 : e.toLowerCase();
16049
16052
  return ((r = ye._bowser) == null ? void 0 : r.getOSName()) === "macOS" && t.includes("iphone") ? !0 : H0.some(
@@ -16294,7 +16297,7 @@ class z0 {
16294
16297
  echoCancellation: (p = r == null ? void 0 : r.echoCancellation) != null ? p : !0,
16295
16298
  noiseSuppression: (g = r == null ? void 0 : r.noiseSupression) != null ? g : !0,
16296
16299
  channelCount: i
16297
- }, t && t !== "default" && (e.audio.deviceId = { exact: t }), e);
16300
+ }, t && (e.audio.deviceId = { exact: t }), e);
16298
16301
  });
16299
16302
  h(this, "getVideoConstraints", (t) => {
16300
16303
  var a, o, c, d;
@@ -16318,7 +16321,7 @@ class z0 {
16318
16321
  }
16319
16322
  }
16320
16323
  wi = new WeakMap(), Os = new WeakMap();
16321
- class hu extends Error {
16324
+ class pu extends Error {
16322
16325
  constructor(e, r, i) {
16323
16326
  super(r);
16324
16327
  h(this, "constraints");
@@ -16362,14 +16365,10 @@ var Q0 = Object.defineProperty, X0 = Object.getOwnPropertyDescriptor, Ms = (s, t
16362
16365
  let Ht = (Fg = class extends Y0 {
16363
16366
  constructor(t, e) {
16364
16367
  super();
16365
- /**
16366
- * Only used for recognising device change
16367
- */
16368
- h(this, "availableDevices");
16369
16368
  m(this, Xn, void 0);
16370
16369
  m(this, Zt, void 0);
16371
16370
  m(this, Ne, void 0);
16372
- f(this, Ne, t), f(this, Zt, new z0(t, e)), f(this, Xn, new AbortController()), this.availableDevices = [], this.getAvailableDevices();
16371
+ f(this, Ne, t), f(this, Zt, new z0(t, e)), f(this, Xn, new AbortController());
16373
16372
  }
16374
16373
  /**
16375
16374
  * @access private
@@ -16438,119 +16437,124 @@ let Ht = (Fg = class extends Y0 {
16438
16437
  }
16439
16438
  getAudioTrack(t, e) {
16440
16439
  return u(this, null, function* () {
16440
+ var o, c;
16441
16441
  let r = yield this.getAudioInputDevices();
16442
16442
  if (r.length === 0)
16443
16443
  throw this.permissions.audio = "NO_DEVICES_AVAILABLE", n(this, Ne).getValue("peerSessionStore").emit(k.MEDIA_PERMISSION_UPDATE, {
16444
16444
  message: this.permissions.audio,
16445
16445
  kind: "audio"
16446
16446
  }), new b("No audio devices available", "1606");
16447
- const i = (a) => u(this, null, function* () {
16448
- let o;
16447
+ let i;
16448
+ e ? i = e : (o = r[0]) != null && o.deviceId && (i = (c = r[0]) == null ? void 0 : c.deviceId);
16449
+ const a = (d) => u(this, null, function* () {
16450
+ let l;
16449
16451
  try {
16450
- r = r.filter((d) => d.deviceId !== a), o = n(this, Zt).getAudioConstraints(a), this.logger.info("getUserMediaWithoutTimeout::requesting_user_media", {
16451
- constraints: JSON.stringify(o)
16452
+ r = r.filter((g) => g.deviceId !== d), l = n(this, Zt).getAudioConstraints(d), this.logger.info("getUserMediaWithoutTimeout::requesting_user_media", {
16453
+ constraints: JSON.stringify(l)
16452
16454
  });
16453
- const [c] = (yield navigator.mediaDevices.getUserMedia(o)).getAudioTracks();
16455
+ const [p] = (yield navigator.mediaDevices.getUserMedia(l)).getAudioTracks();
16454
16456
  return this.logger.info("getUserMediaWithoutTimeout::received_user_media", {
16455
- constraints: JSON.stringify(o)
16456
- }), c;
16457
- } catch (c) {
16458
- const d = sd(
16457
+ constraints: JSON.stringify(l)
16458
+ }), p;
16459
+ } catch (p) {
16460
+ const g = sd(
16459
16461
  "audio",
16460
- c.name,
16461
- c.message
16462
- ), l = new hu(c.name, c.message, o);
16463
- if (d === "COULD_NOT_START") {
16464
- const p = r.shift();
16465
- if (!p)
16466
- throw l;
16462
+ p.name,
16463
+ p.message
16464
+ ), S = new pu(p.name, p.message, l);
16465
+ if (g === "COULD_NOT_START") {
16466
+ const v = r.shift();
16467
+ if (!v)
16468
+ throw S;
16467
16469
  this.logger.info("getAudioTrack::gum_failed", {
16468
- constraints: JSON.stringify(o),
16469
- error: c
16470
+ constraints: JSON.stringify(l),
16471
+ error: p
16470
16472
  });
16471
- const g = n(this, Zt).getAudioConstraints(
16472
- p.deviceId
16473
+ const _ = n(this, Zt).getAudioConstraints(
16474
+ v.deviceId
16473
16475
  );
16474
16476
  return this.logger.info("getAudioTrack::retrying_gum_for_next_device", {
16475
- constraints: JSON.stringify(g)
16476
- }), i(p.deviceId);
16477
+ constraints: JSON.stringify(_)
16478
+ }), a(v.deviceId);
16477
16479
  }
16478
- throw l;
16480
+ throw S;
16479
16481
  }
16480
16482
  });
16481
16483
  try {
16482
- const a = yield i(e);
16483
- return a.enabled = !t, this.permissions.audio !== "ACCEPTED" && (this.permissions.audio = "ACCEPTED", n(this, Ne).getValue("peerSessionStore").emit(k.MEDIA_PERMISSION_UPDATE, {
16484
+ const d = yield a(i);
16485
+ return d.enabled = !t, this.permissions.audio !== "ACCEPTED" && (this.permissions.audio = "ACCEPTED", n(this, Ne).getValue("peerSessionStore").emit(k.MEDIA_PERMISSION_UPDATE, {
16484
16486
  message: this.permissions.audio,
16485
16487
  kind: "audio"
16486
- })), a;
16487
- } catch (a) {
16488
- throw a.constraints && this.handlePermissionErrors("audio", a), new b(a.message, "1601");
16488
+ })), d;
16489
+ } catch (d) {
16490
+ throw d.constraints && this.handlePermissionErrors("audio", d), new b(d.message, "1601");
16489
16491
  }
16490
16492
  });
16491
16493
  }
16492
16494
  getVideoTrack(t) {
16493
16495
  return u(this, null, function* () {
16494
- var c;
16495
- const e = n(this, Ne).getValue("flagsmith").hasFeature(ee.OBS_QUALITY), r = (c = yield this.getCurrentDeviceLabel(t)) == null ? void 0 : c.includes("OBS Virtual"), i = e && r, a = yield this.getVideoInputDevices();
16496
+ var d, l, p;
16497
+ const e = n(this, Ne).getValue("flagsmith").hasFeature(ee.OBS_QUALITY), r = (d = yield this.getCurrentDeviceLabel(t)) == null ? void 0 : d.includes("OBS Virtual"), i = e && r, a = yield this.getVideoInputDevices();
16496
16498
  if (a.length === 0)
16497
16499
  throw this.permissions.video = "NO_DEVICES_AVAILABLE", n(this, Ne).getValue("peerSessionStore").emit(k.MEDIA_PERMISSION_UPDATE, {
16498
16500
  message: this.permissions.video,
16499
16501
  kind: "video"
16500
16502
  }), new b("No video devices available", "1607");
16501
- const o = (d) => u(this, null, function* () {
16503
+ let o;
16504
+ t ? o = t : (l = a[0]) != null && l.deviceId && (o = (p = a[0]) == null ? void 0 : p.deviceId);
16505
+ const c = (g) => u(this, null, function* () {
16502
16506
  try {
16503
- let l = d;
16504
- const { video: p } = l;
16505
- i && typeof p != "boolean" && (l = {
16506
- video: { deviceId: p.deviceId }
16507
+ let S = g;
16508
+ const { video: v } = S;
16509
+ i && typeof v != "boolean" && (S = {
16510
+ video: { deviceId: v.deviceId }
16507
16511
  }), this.logger.info("getUserMediaWithoutTimeout::requesting_user_media", {
16508
- constraints: JSON.stringify(l)
16512
+ constraints: JSON.stringify(S)
16509
16513
  });
16510
- const [g] = (yield navigator.mediaDevices.getUserMedia(l)).getVideoTracks();
16511
- if (i && typeof p != "boolean" && typeof p.width == "object") {
16512
- const { width: S, height: v } = g.getSettings(), { ideal: _ } = p.width;
16513
- g.applyConstraints({
16514
- width: { ideal: _ },
16515
- height: { ideal: Math.floor(v * _ / S) },
16516
- frameRate: p.frameRate
16514
+ const [_] = (yield navigator.mediaDevices.getUserMedia(S)).getVideoTracks();
16515
+ if (i && typeof v != "boolean" && typeof v.width == "object") {
16516
+ const { width: P, height: C } = _.getSettings(), { ideal: w } = v.width;
16517
+ _.applyConstraints({
16518
+ width: { ideal: w },
16519
+ height: { ideal: Math.floor(C * w / P) },
16520
+ frameRate: v.frameRate
16517
16521
  });
16518
16522
  }
16519
16523
  return this.logger.info("getUserMediaWithoutTimeout::received_user_media", {
16520
- constraints: JSON.stringify(l)
16521
- }), g;
16522
- } catch (l) {
16523
- const p = sd(
16524
+ constraints: JSON.stringify(S)
16525
+ }), _;
16526
+ } catch (S) {
16527
+ const v = sd(
16524
16528
  "video",
16525
- l.name,
16526
- l.message
16527
- ), g = new hu(l.name, l.message, d);
16528
- if (p === "COULD_NOT_START") {
16529
- const S = a.shift();
16530
- if (!S)
16531
- throw g;
16529
+ S.name,
16530
+ S.message
16531
+ ), _ = new pu(S.name, S.message, g);
16532
+ if (v === "COULD_NOT_START") {
16533
+ const P = a.shift();
16534
+ if (!P)
16535
+ throw _;
16532
16536
  this.logger.info("getVideoTrack::gum_failed", {
16533
- constraints: JSON.stringify(d),
16534
- error: l
16537
+ constraints: JSON.stringify(g),
16538
+ error: S
16535
16539
  });
16536
- const v = n(this, Zt).getVideoConstraints(
16537
- S.deviceId
16540
+ const C = n(this, Zt).getVideoConstraints(
16541
+ P.deviceId
16538
16542
  );
16539
16543
  return this.logger.info("getVideoTrack::retrying_gum_for_next_device", {
16540
- constraints: JSON.stringify(v)
16541
- }), o({ video: v.video });
16544
+ constraints: JSON.stringify(C)
16545
+ }), c({ video: C.video });
16542
16546
  }
16543
- throw g;
16547
+ throw _;
16544
16548
  }
16545
16549
  });
16546
16550
  try {
16547
- const d = n(this, Zt).getVideoConstraints(t), l = yield o(d);
16551
+ const g = n(this, Zt).getVideoConstraints(o), S = yield c(g);
16548
16552
  return this.permissions.video !== "ACCEPTED" && (this.permissions.video = "ACCEPTED", n(this, Ne).getValue("peerSessionStore").emit(k.MEDIA_PERMISSION_UPDATE, {
16549
16553
  message: this.permissions.video,
16550
16554
  kind: "video"
16551
- })), l;
16552
- } catch (d) {
16553
- throw d.constraints && this.handlePermissionErrors("video", d), new b(d.message, "1602");
16555
+ })), S;
16556
+ } catch (g) {
16557
+ throw g.constraints && this.handlePermissionErrors("video", g), new b(g.message, "1602");
16554
16558
  }
16555
16559
  });
16556
16560
  }
@@ -16572,7 +16576,7 @@ let Ht = (Fg = class extends Y0 {
16572
16576
  "video",
16573
16577
  r.name,
16574
16578
  r.message
16575
- ), a = new hu(r.name, r.message, e), o = { video: !0 };
16579
+ ), a = new pu(r.name, r.message, e), o = { video: !0 };
16576
16580
  if (ew(e, o) || !n(this, Ne).getValue("flagsmith").hasFeature(ee.SCREEENSHARE_CONSTRAINTS_RETRY))
16577
16581
  throw a;
16578
16582
  if (i === "COULD_NOT_START")
@@ -16600,11 +16604,24 @@ let Ht = (Fg = class extends Y0 {
16600
16604
  return e == null ? void 0 : e.label;
16601
16605
  });
16602
16606
  }
16607
+ // eslint-disable-next-line class-methods-use-this
16608
+ enumerateDevicesWithExternalFirst() {
16609
+ return u(this, null, function* () {
16610
+ const t = yield navigator.mediaDevices.enumerateDevices(), e = (r) => {
16611
+ var a;
16612
+ const i = ((a = r.label) == null ? void 0 : a.toLowerCase()) || "";
16613
+ return kd(r) ? 4 : r.deviceId === "default" || i.includes("default") ? 1 : (i.includes("airpods") || i.includes("bluetooth") || i.includes("wireless") || i.includes("headphones") || i.includes("headset") || i.includes("earbuds") || i.includes("usb") || i.includes("external")) && !i.includes("default") ? 0 : i.includes("built-in") || i.includes("internal") ? 2 : 3;
16614
+ };
16615
+ return t.sort((r, i) => {
16616
+ const a = e(r), o = e(i);
16617
+ return a !== o ? a - o : 0;
16618
+ });
16619
+ });
16620
+ }
16603
16621
  getAvailableDevices() {
16604
16622
  return u(this, null, function* () {
16605
16623
  try {
16606
- const t = yield navigator.mediaDevices.enumerateDevices();
16607
- return this.availableDevices = t, t;
16624
+ return yield this.enumerateDevicesWithExternalFirst();
16608
16625
  } catch (t) {
16609
16626
  throw this.logger.error("enumerate_devices_failed", {
16610
16627
  error: t
@@ -16615,7 +16632,7 @@ let Ht = (Fg = class extends Y0 {
16615
16632
  getAvailableDevicesByKind(t) {
16616
16633
  return u(this, null, function* () {
16617
16634
  try {
16618
- return (yield navigator.mediaDevices.enumerateDevices()).filter(
16635
+ return (yield this.enumerateDevicesWithExternalFirst()).filter(
16619
16636
  ({ kind: e }) => t === e
16620
16637
  );
16621
16638
  } catch (e) {
@@ -16628,7 +16645,7 @@ let Ht = (Fg = class extends Y0 {
16628
16645
  getDevice(t) {
16629
16646
  return u(this, null, function* () {
16630
16647
  try {
16631
- return (yield navigator.mediaDevices.enumerateDevices()).filter((r) => r.deviceId === t)[0];
16648
+ return (yield this.enumerateDevicesWithExternalFirst()).filter((r) => r.deviceId === t)[0];
16632
16649
  } catch (e) {
16633
16650
  throw this.logger.error("enumerate_devices_failed", {
16634
16651
  error: e
@@ -16638,33 +16655,43 @@ let Ht = (Fg = class extends Y0 {
16638
16655
  }
16639
16656
  onDeviceChange(t) {
16640
16657
  return u(this, null, function* () {
16641
- ye.supportsDeviceChangeEvent() && navigator.mediaDevices.addEventListener(
16642
- "devicechange",
16643
- (e) => u(this, null, function* () {
16644
- var l, p;
16645
- const r = (g) => `${g.kind}-${g.deviceId}-${g.groupId}`, i = this.availableDevices, a = new Set(
16646
- i.map((g) => r(g))
16647
- ), o = yield this.getAvailableDevices(), c = new Set(
16648
- o.map((g) => r(g))
16649
- ), d = {
16650
- added: o.filter(
16651
- (g) => !a.has(r(g))
16652
- ),
16653
- removed: i.filter(
16654
- (g) => !c.has(r(g))
16655
- ),
16656
- devices: o
16657
- };
16658
- if ((l = d.added) != null && l.length || (p = d.removed) != null && p.length) {
16659
- this.logger.info("repopulated_full_device_list", {
16660
- devices: JSON.stringify(o)
16661
- });
16662
- const g = [...d.added, ...d.removed];
16663
- g.some((S) => S.kind === "audioinput") && n(this, Ne).getValue("callstats").devices("AUDIO", o == null ? void 0 : o.filter((S) => S.kind === "audioinput")), g.some((S) => S.kind === "videoinput") && n(this, Ne).getValue("callstats").devices("VIDEO", o == null ? void 0 : o.filter((S) => S.kind === "videoinput")), g.some((S) => S.kind === "audiooutput") && n(this, Ne).getValue("callstats").devices("SPEAKER", o == null ? void 0 : o.filter((S) => S.kind === "audiooutput")), t(e, d, !1);
16664
- }
16665
- }),
16666
- { signal: n(this, Xn).signal }
16667
- );
16658
+ if (ye.supportsDeviceChangeEvent()) {
16659
+ let e = [];
16660
+ try {
16661
+ e = (yield this.getAvailableDevices()) || [];
16662
+ } catch (r) {
16663
+ this.logger.error("onDeviceChange::enumerate_devices_failed", {
16664
+ error: r
16665
+ });
16666
+ }
16667
+ navigator.mediaDevices.addEventListener(
16668
+ "devicechange",
16669
+ (r) => u(this, null, function* () {
16670
+ var l, p;
16671
+ const i = (g) => `${g.kind}-${g.label}-${g.deviceId}-${g.groupId}`, a = new Set(
16672
+ e.map((g) => i(g))
16673
+ ), o = yield this.getAvailableDevices(), c = new Set(
16674
+ o.map((g) => i(g))
16675
+ ), d = {
16676
+ added: o.filter(
16677
+ (g) => !a.has(i(g))
16678
+ ),
16679
+ removed: e.filter(
16680
+ (g) => !c.has(i(g))
16681
+ ),
16682
+ devices: o
16683
+ };
16684
+ if (e = o, (l = d.added) != null && l.length || (p = d.removed) != null && p.length) {
16685
+ this.logger.info("repopulated_full_device_list", {
16686
+ devices: JSON.stringify(o)
16687
+ });
16688
+ const g = [...d.added, ...d.removed];
16689
+ g.some((S) => S.kind === "audioinput") && n(this, Ne).getValue("callstats").devices("AUDIO", o == null ? void 0 : o.filter((S) => S.kind === "audioinput")), g.some((S) => S.kind === "videoinput") && n(this, Ne).getValue("callstats").devices("VIDEO", o == null ? void 0 : o.filter((S) => S.kind === "videoinput")), g.some((S) => S.kind === "audiooutput") && n(this, Ne).getValue("callstats").devices("SPEAKER", o == null ? void 0 : o.filter((S) => S.kind === "audiooutput")), t(r, d, !1);
16690
+ }
16691
+ }),
16692
+ { signal: n(this, Xn).signal }
16693
+ );
16694
+ }
16668
16695
  });
16669
16696
  }
16670
16697
  }, Xn = new WeakMap(), Zt = new WeakMap(), Ne = new WeakMap(), Fg);
@@ -16814,7 +16841,7 @@ var nD = Object.defineProperty, aD = Object.getOwnPropertyDescriptor, jf = (s, t
16814
16841
  (o = s[a]) && (i = (r ? o(t, e, i) : o(i)) || i);
16815
16842
  return r && i && nD(t, e, i), i;
16816
16843
  };
16817
- let kd = class extends Ua {
16844
+ let Id = class extends Ua {
16818
16845
  /**
16819
16846
  * Allows creation of an instance of BaseMediaHandler with a track.
16820
16847
  * We initialize it with a track when we want to enable streams on init.
@@ -17031,18 +17058,18 @@ let kd = class extends Ua {
17031
17058
  };
17032
17059
  jf([
17033
17060
  E.trace("BaseMediaHandler.unmuteTrack")
17034
- ], kd.prototype, "unmuteTrack", 1);
17035
- kd = jf([
17061
+ ], Id.prototype, "unmuteTrack", 1);
17062
+ Id = jf([
17036
17063
  ut("1600")
17037
- ], kd);
17038
- const Gf = kd;
17064
+ ], Id);
17065
+ const Gf = Id;
17039
17066
  var oD = Object.defineProperty, cD = Object.getOwnPropertyDescriptor, Uh = (s, t, e, r) => {
17040
17067
  for (var i = r > 1 ? void 0 : r ? cD(t, e) : t, a = s.length - 1, o; a >= 0; a--)
17041
17068
  (o = s[a]) && (i = (r ? o(t, e, i) : o(i)) || i);
17042
17069
  return r && i && oD(t, e, i), i;
17043
17070
  };
17044
- const pu = "[Realtimekit]nonSilentDeviceLabels";
17045
- class ql extends Gf {
17071
+ const gu = "[Realtimekit]nonSilentDeviceLabels";
17072
+ class jl extends Gf {
17046
17073
  onSetDevice(t) {
17047
17074
  return u(this, null, function* () {
17048
17075
  if (!t)
@@ -17131,7 +17158,7 @@ class ql extends Gf {
17131
17158
  a[0].deviceId
17132
17159
  ));
17133
17160
  const o = JSON.parse(
17134
- Eo.getItem(pu, this.logger)
17161
+ Eo.getItem(gu, this.logger)
17135
17162
  );
17136
17163
  if (o != null && o.devices.some(
17137
17164
  (l) => l.label === r.label
@@ -17141,7 +17168,7 @@ class ql extends Gf {
17141
17168
  const l = (d = o == null ? void 0 : o.devices.concat({
17142
17169
  label: r.label
17143
17170
  })) != null ? d : [{ label: r.label }];
17144
- return Eo.setItem(pu, JSON.stringify({
17171
+ return Eo.setItem(gu, JSON.stringify({
17145
17172
  devices: l
17146
17173
  }), this.logger), r;
17147
17174
  }
@@ -17156,7 +17183,7 @@ class ql extends Gf {
17156
17183
  const g = (p = o == null ? void 0 : o.devices.concat({
17157
17184
  label: r.label
17158
17185
  })) != null ? p : [{ label: r.label }];
17159
- return Eo.setItem(pu, JSON.stringify({
17186
+ return Eo.setItem(gu, JSON.stringify({
17160
17187
  devices: g
17161
17188
  }), this.logger), this.logger.info("AudioMediaHandler.conditionallyChangeTrack.SuccesfullyChangedTrack"), !0;
17162
17189
  }
@@ -17167,14 +17194,14 @@ class ql extends Gf {
17167
17194
  }
17168
17195
  Uh([
17169
17196
  E.trace("AudioMediaHandler.setTransformedTrack")
17170
- ], ql.prototype, "setTransformedTrack", 1);
17197
+ ], jl.prototype, "setTransformedTrack", 1);
17171
17198
  Uh([
17172
17199
  E.trace("AudioMediaHandler.onTrackEnded")
17173
- ], ql.prototype, "onTrackEnded", 1);
17200
+ ], jl.prototype, "onTrackEnded", 1);
17174
17201
  Uh([
17175
17202
  E.trace("AudioMediaHandler.conditionallyChangeTrack")
17176
- ], ql.prototype, "conditionallyChangeTrack", 1);
17177
- const dD = ql;
17203
+ ], jl.prototype, "conditionallyChangeTrack", 1);
17204
+ const dD = jl;
17178
17205
  var Zn;
17179
17206
  class lD {
17180
17207
  constructor(t) {
@@ -17190,7 +17217,7 @@ class lD {
17190
17217
  let e = t;
17191
17218
  if (t || ([e] = (yield n(this, Zn).getAvailableDevicesByKind(
17192
17219
  "audiooutput"
17193
- )).filter((c) => !Bu(c))), !e)
17220
+ )).filter((c) => !kd(c))), !e)
17194
17221
  throw new b("No speaker found", "1608");
17195
17222
  if (((i = this.currentDevice) == null ? void 0 : i.deviceId) === e.deviceId)
17196
17223
  return;
@@ -17279,7 +17306,7 @@ class hD extends Ua {
17279
17306
  }
17280
17307
  Go = new WeakMap();
17281
17308
  const pD = hD;
17282
- var gD = Object.defineProperty, mD = Object.getOwnPropertyDescriptor, jl = (s, t, e, r) => {
17309
+ var gD = Object.defineProperty, mD = Object.getOwnPropertyDescriptor, Gl = (s, t, e, r) => {
17283
17310
  for (var i = r > 1 ? void 0 : r ? mD(t, e) : t, a = s.length - 1, o; a >= 0; a--)
17284
17311
  (o = s[a]) && (i = (r ? o(t, e, i) : o(i)) || i);
17285
17312
  return r && i && gD(t, e, i), i;
@@ -17412,16 +17439,16 @@ class jc extends Gf {
17412
17439
  }
17413
17440
  }
17414
17441
  ea = new WeakMap(), Wo = new WeakMap();
17415
- jl([
17442
+ Gl([
17416
17443
  E.trace("VideoMediaHandler.setTransformedTrack")
17417
17444
  ], jc.prototype, "setTransformedTrack", 1);
17418
- jl([
17445
+ Gl([
17419
17446
  E.trace("VideoMediaHandler.setVideoMiddlewareGlobalConfig")
17420
17447
  ], jc.prototype, "setVideoMiddlewareGlobalConfig", 1);
17421
- jl([
17448
+ Gl([
17422
17449
  E.trace("VideoMediaHandler.onTrackEnded")
17423
17450
  ], jc.prototype, "onTrackEnded", 1);
17424
- jl([
17451
+ Gl([
17425
17452
  E.trace("VideoMediaHandler.conditionallyChangeTrack")
17426
17453
  ], jc.prototype, "conditionallyChangeTrack", 1);
17427
17454
  const fD = jc, Sg = Rs(
@@ -17774,10 +17801,10 @@ var _D = Object.defineProperty, PD = Object.getOwnPropertyDescriptor, Gc = (s, t
17774
17801
  for (var i = r > 1 ? void 0 : r ? PD(t, e) : t, a = s.length - 1, o; a >= 0; a--)
17775
17802
  (o = s[a]) && (i = (r ? o(t, e, i) : o(i)) || i);
17776
17803
  return r && i && _D(t, e, i), i;
17777
- }, nt, Ur, $r, Fd, Kf;
17804
+ }, nt, Ur, $r, Bd, Kf;
17778
17805
  class Ba {
17779
17806
  constructor({ name: t, socketHandler: e, meetingId: r }) {
17780
- m(this, Fd);
17807
+ m(this, Bd);
17781
17808
  h(this, "name", "");
17782
17809
  m(this, nt, {});
17783
17810
  m(this, Ur, "");
@@ -17820,7 +17847,7 @@ class Ba {
17820
17847
  }
17821
17848
  update(t, e, r = !0) {
17822
17849
  return u(this, null, function* () {
17823
- x(this, Fd, Kf).call(this, t, e, r);
17850
+ x(this, Bd, Kf).call(this, t, e, r);
17824
17851
  });
17825
17852
  }
17826
17853
  // eslint-disable-next-line consistent-return
@@ -17907,7 +17934,7 @@ class Ba {
17907
17934
  f(this, nt, t);
17908
17935
  }
17909
17936
  }
17910
- nt = new WeakMap(), Ur = new WeakMap(), $r = new WeakMap(), Fd = new WeakSet(), Kf = function(t, e, r = !0) {
17937
+ nt = new WeakMap(), Ur = new WeakMap(), $r = new WeakMap(), Bd = new WeakSet(), Kf = function(t, e, r = !0) {
17911
17938
  let i;
17912
17939
  const a = n(this, nt)[t], o = Object.prototype.toString.call(e), c = Object.prototype.toString.call(a);
17913
17940
  if (o !== c) {
@@ -17948,17 +17975,17 @@ Gc([
17948
17975
  Gc([
17949
17976
  Mt(Fa, "bulkRateLimitConfig")
17950
17977
  ], Ba.prototype, "bulkDelete", 1);
17951
- var bi, ki, zo, qu, Yo, Fr, Bd, zf;
17978
+ var bi, ki, zo, qu, Yo, Fr, Hd, zf;
17952
17979
  class CD {
17953
17980
  constructor(t, e) {
17954
17981
  m(this, zo);
17955
- m(this, Bd);
17982
+ m(this, Hd);
17956
17983
  h(this, "stores", /* @__PURE__ */ new Map());
17957
17984
  m(this, bi, void 0);
17958
17985
  m(this, ki, "");
17959
17986
  m(this, Yo, void 0);
17960
17987
  m(this, Fr, /* @__PURE__ */ new Map());
17961
- f(this, bi, e), f(this, ki, t.getValue("meetingId")), f(this, Yo, t), x(this, Bd, zf).call(this);
17988
+ f(this, bi, e), f(this, ki, t.getValue("meetingId")), f(this, Yo, t), x(this, Hd, zf).call(this);
17962
17989
  }
17963
17990
  create(t) {
17964
17991
  const e = new Ba(
@@ -17972,7 +17999,7 @@ class CD {
17972
17999
  }
17973
18000
  bi = new WeakMap(), ki = new WeakMap(), zo = new WeakSet(), qu = function() {
17974
18001
  return n(this, Yo).getValue("peerId");
17975
- }, Yo = new WeakMap(), Fr = new WeakMap(), Bd = new WeakSet(), zf = function() {
18002
+ }, Yo = new WeakMap(), Fr = new WeakMap(), Hd = new WeakSet(), zf = function() {
17976
18003
  [
17977
18004
  J.storeInsertKeys,
17978
18005
  J.storeGetKeys,
@@ -18047,7 +18074,7 @@ var wD = Object.defineProperty, RD = Object.getOwnPropertyDescriptor, Ha = (s, t
18047
18074
  return r && i && wD(t, e, i), i;
18048
18075
  };
18049
18076
  const bD = 0.8, kD = 1.2;
18050
- var na, aa, Ut, Ii, uo, Br, Tn, Ai, ho, Hd, Yf, er, Qo, Hr, Mi, po, tr, qd, Xo, ju, jd, Qf, Gd, Xf, Bg;
18077
+ var na, aa, Ut, Ii, uo, Br, Tn, Ai, ho, qd, Yf, er, Qo, Hr, Mi, po, tr, jd, Xo, ju, Gd, Qf, Wd, Xf, Bg;
18051
18078
  let Tr = (Bg = class extends qt {
18052
18079
  constructor(t, e, r, i) {
18053
18080
  const a = t.getValue("logger");
@@ -18062,11 +18089,11 @@ let Tr = (Bg = class extends qt {
18062
18089
  /**
18063
18090
  * Returns true if the local participant has joined the meeting.
18064
18091
  */
18065
- m(this, Hd);
18092
+ m(this, qd);
18066
18093
  m(this, Mi);
18067
18094
  m(this, Xo);
18068
- m(this, jd);
18069
18095
  m(this, Gd);
18096
+ m(this, Wd);
18070
18097
  /**
18071
18098
  * The peer ID of the participant.
18072
18099
  * The participants are indexed by this ID in the participant map.
@@ -18152,7 +18179,7 @@ let Tr = (Bg = class extends qt {
18152
18179
  * default = 1
18153
18180
  */
18154
18181
  m(this, tr, 1);
18155
- m(this, qd, Ih((t) => {
18182
+ m(this, jd, Ih((t) => {
18156
18183
  if (!this.videoTrack)
18157
18184
  return;
18158
18185
  const { clientWidth: e, clientHeight: r } = t, { width: i, height: a } = this.videoTrack.getSettings();
@@ -18228,7 +18255,7 @@ let Tr = (Bg = class extends qt {
18228
18255
  });
18229
18256
  }
18230
18257
  setupEvents() {
18231
- this.on("videoUpdate", x(this, Xo, ju)), n(this, Br, Tn) && (this.on("audioUpdate", x(this, jd, Qf)), this.on("screenShareUpdate", x(this, Gd, Xf)));
18258
+ this.on("videoUpdate", x(this, Xo, ju)), n(this, Br, Tn) && (this.on("audioUpdate", x(this, Gd, Qf)), this.on("screenShareUpdate", x(this, Wd, Xf)));
18232
18259
  }
18233
18260
  /**
18234
18261
  * Returns `participant.id` if user has permission
@@ -18291,7 +18318,7 @@ let Tr = (Bg = class extends qt {
18291
18318
  const t = this.id;
18292
18319
  if (this.logger.info("Participant::kick", {
18293
18320
  participant: { id: t }
18294
- }), !n(this, Hd, Yf))
18321
+ }), !n(this, qd, Yf))
18295
18322
  throw new b("Can`t kick participant without joining room", "1205");
18296
18323
  if (n(this, er).permissions.kickParticipant) {
18297
18324
  yield n(this, Ut).getValue("peerSessionStore").emitAsync(k.KICK_PEER, {
@@ -18346,7 +18373,7 @@ let Tr = (Bg = class extends qt {
18346
18373
  if (!t)
18347
18374
  return;
18348
18375
  let e;
18349
- (i = (r = n(this, Hr).get(t)) == null ? void 0 : r.observer) == null || i.disconnect(), "ResizeObserver" in window && (e = new ResizeObserver(() => n(this, qd).call(this, t)), e.observe(t)), n(this, Hr).set(t, { observer: e }), this.updateVideo(t), (o = n(this, Mi, po)) == null || o.addSource(
18376
+ (i = (r = n(this, Hr).get(t)) == null ? void 0 : r.observer) == null || i.disconnect(), "ResizeObserver" in window && (e = new ResizeObserver(() => n(this, jd).call(this, t)), e.observe(t)), n(this, Hr).set(t, { observer: e }), this.updateVideo(t), (o = n(this, Mi, po)) == null || o.addSource(
18350
18377
  this.id,
18351
18378
  t,
18352
18379
  this.videoEnabled,
@@ -18387,16 +18414,16 @@ let Tr = (Bg = class extends qt {
18387
18414
  return n(this, Ut).getValue("audioPlayback");
18388
18415
  }, Ai = new WeakSet(), ho = function() {
18389
18416
  return n(this, Ut).getValue("connectionHandler").mediaJoined;
18390
- }, Hd = new WeakSet(), Yf = function() {
18417
+ }, qd = new WeakSet(), Yf = function() {
18391
18418
  return n(this, Ut).getValue("connectionHandler").socketJoined;
18392
18419
  }, er = new WeakMap(), Qo = new WeakMap(), Hr = new WeakMap(), Mi = new WeakSet(), po = function() {
18393
18420
  return n(this, Ut).getValue("pip");
18394
- }, tr = new WeakMap(), qd = new WeakMap(), Xo = new WeakSet(), ju = function() {
18421
+ }, tr = new WeakMap(), jd = new WeakMap(), Xo = new WeakSet(), ju = function() {
18395
18422
  Array.from(n(this, Hr).keys()).forEach(this.updateVideo);
18396
- }, jd = new WeakSet(), Qf = function() {
18423
+ }, Gd = new WeakSet(), Qf = function() {
18397
18424
  var t, e;
18398
18425
  this.audioEnabled && this.audioTrack ? (t = n(this, Br, Tn)) == null || t.addParticipantTrack(this.id, this.audioTrack) : (e = n(this, Br, Tn)) == null || e.removeParticipantTrack(this.id);
18399
- }, Gd = new WeakSet(), Xf = function() {
18426
+ }, Wd = new WeakSet(), Xf = function() {
18400
18427
  var t, e;
18401
18428
  this.screenShareEnabled && this.screenShareTracks.audio ? (t = n(this, Br, Tn)) == null || t.addParticipantTrack(`screenshare-${this.id}`, this.screenShareTracks.audio) : (e = n(this, Br, Tn)) == null || e.removeParticipantTrack(`screenshare-${this.id}`);
18402
18429
  }, Bg);
@@ -19015,7 +19042,7 @@ var VD = Object.defineProperty, LD = Object.getOwnPropertyDescriptor, gn = (s, t
19015
19042
  for (var i = r > 1 ? void 0 : r ? LD(t, e) : t, a = s.length - 1, o; a >= 0; a--)
19016
19043
  (o = s[a]) && (i = (r ? o(t, e, i) : o(i)) || i);
19017
19044
  return r && i && VD(t, e, i), i;
19018
- }, es, ms, ca, qg;
19045
+ }, es, fs, ca, qg;
19019
19046
  const eS = (qg = class {
19020
19047
  constructor(s, t, e) {
19021
19048
  h(this, "participants");
@@ -19028,7 +19055,7 @@ const eS = (qg = class {
19028
19055
  h(this, "context");
19029
19056
  h(this, "videoPeerConsumerMap", /* @__PURE__ */ new Map());
19030
19057
  m(this, es, { mode: "ACTIVE_GRID", page: 0 });
19031
- m(this, ms, !1);
19058
+ m(this, fs, !1);
19032
19059
  m(this, ca, !1);
19033
19060
  h(this, "updateConsumerSpatialLayers", Ih(() => {
19034
19061
  const s = {}, t = new Map(this.maxSpatialLayerUpdates);
@@ -19043,7 +19070,7 @@ const eS = (qg = class {
19043
19070
  });
19044
19071
  }, 2e3));
19045
19072
  h(this, "updateConsumers", (s, t) => u(this, null, function* () {
19046
- this.logger.info(`updateConsumers: Starting consumer updates - AddProducers: ${s.length}, RemoveProducers: ${t.length}, ConsumersSyncing: ${n(this, ms)}`);
19073
+ this.logger.info(`updateConsumers: Starting consumer updates - AddProducers: ${s.length}, RemoveProducers: ${t.length}, ConsumersSyncing: ${n(this, fs)}`);
19047
19074
  try {
19048
19075
  s.length !== 0 && (this.logger.info(`updateConsumers: Creating consumers for ${s.length} producers: [${s.map((e) => e.producerId).join(", ")}]`), yield this.roomNodeClient.createConsumers(s), this.logger.info("updateConsumers: Successfully created consumers."));
19049
19076
  } catch (e) {
@@ -19166,7 +19193,7 @@ const eS = (qg = class {
19166
19193
  appData: { screenShare: t == null ? void 0 : t.screenShare }
19167
19194
  }
19168
19195
  }
19169
- ), (t == null ? void 0 : t.kind) === "audio" && this.participants.audioSubscribed.get(s) || (t == null ? void 0 : t.kind) === "video" && this.participants.videoSubscribed.get(s) || t != null && t.screenShare ? (this.logger.info(`NEW_PRODUCER: scheduling syncConsumer (AUTO mode) - Producer: ${t.producerId}, Peer: ${s}, Kind: ${t.kind}, ScreenShare: ${t.screenShare}, ConsumersSyncing: ${n(this, ms)}, VideoSub: ${t.kind === "video" ? this.participants.videoSubscribed.has(s) : "N/A"}, AudioSub: ${t.kind === "audio" ? this.participants.audioSubscribed.has(s) : "N/A"}`), this.scheduleSyncConsumers({
19196
+ ), (t == null ? void 0 : t.kind) === "audio" && this.participants.audioSubscribed.get(s) || (t == null ? void 0 : t.kind) === "video" && this.participants.videoSubscribed.get(s) || t != null && t.screenShare ? (this.logger.info(`NEW_PRODUCER: scheduling syncConsumer (AUTO mode) - Producer: ${t.producerId}, Peer: ${s}, Kind: ${t.kind}, ScreenShare: ${t.screenShare}, ConsumersSyncing: ${n(this, fs)}, VideoSub: ${t.kind === "video" ? this.participants.videoSubscribed.has(s) : "N/A"}, AudioSub: ${t.kind === "audio" ? this.participants.audioSubscribed.has(s) : "N/A"}`), this.scheduleSyncConsumers({
19170
19197
  source: "NEW_PRODUCER_AUTO"
19171
19198
  })) : this.logger.info(
19172
19199
  "ParticipantController::NEW_PRODUCER::not_consuming_producer_auto",
@@ -19227,7 +19254,7 @@ const eS = (qg = class {
19227
19254
  const e = t;
19228
19255
  this.onParticipantPinned(e);
19229
19256
  const r = this.participants.joined.get(e);
19230
- r && (this.logger.info(`globalPeerPinBroadcast: Scheduling audio/video consumer sync for pinned participant ${e} - ProducerCount: ${r.producers.length}, ConsumersSyncing: ${n(this, ms)}, ProducerIds: [${r.producers.map((i) => i.producerId).join(", ")}]`), this.scheduleSyncConsumers({
19257
+ r && (this.logger.info(`globalPeerPinBroadcast: Scheduling audio/video consumer sync for pinned participant ${e} - ProducerCount: ${r.producers.length}, ConsumersSyncing: ${n(this, fs)}, ProducerIds: [${r.producers.map((i) => i.producerId).join(", ")}]`), this.scheduleSyncConsumers({
19231
19258
  source: "GLOBAL_PEER_PIN"
19232
19259
  }));
19233
19260
  }
@@ -19355,8 +19382,8 @@ const eS = (qg = class {
19355
19382
  source: s
19356
19383
  }) {
19357
19384
  var r, i, a;
19358
- const e = ((r = n(this, es)) == null ? void 0 : r.mode) === "PAGINATED" && !n(this, ms) ? 200 : 0;
19359
- this.logger.info(`scheduleSyncConsumers():: Source: ${s}, ViewMode: ${(i = n(this, es)) == null ? void 0 : i.mode}, ConsumersSyncing: ${n(this, ms)}, Delay: ${e}, Page: ${(a = n(this, es)) == null ? void 0 : a.page}`), setTimeout(() => this.syncConsumers(), e);
19385
+ const e = ((r = n(this, es)) == null ? void 0 : r.mode) === "PAGINATED" && !n(this, fs) ? 200 : 0;
19386
+ this.logger.info(`scheduleSyncConsumers():: Source: ${s}, ViewMode: ${(i = n(this, es)) == null ? void 0 : i.mode}, ConsumersSyncing: ${n(this, fs)}, Delay: ${e}, Page: ${(a = n(this, es)) == null ? void 0 : a.page}`), setTimeout(() => this.syncConsumers(), e);
19360
19387
  });
19361
19388
  }
19362
19389
  /**
@@ -19386,11 +19413,11 @@ const eS = (qg = class {
19386
19413
  this.logger.info("syncConsumers: Connection not ready, exiting.");
19387
19414
  return;
19388
19415
  }
19389
- if (n(this, ms)) {
19416
+ if (n(this, fs)) {
19390
19417
  f(this, ca, !0), this.logger.info("syncConsumers: Sync in progress, marking resyncRequired=true and exiting.");
19391
19418
  return;
19392
19419
  }
19393
- this.logger.info("syncConsumers: Starting sync operation."), f(this, ms, !0), f(this, ca, !1);
19420
+ this.logger.info("syncConsumers: Starting sync operation."), f(this, fs, !0), f(this, ca, !1);
19394
19421
  let s = [];
19395
19422
  this.participants.videoSubscribed.forEach((g) => {
19396
19423
  var _, P;
@@ -19436,7 +19463,7 @@ const eS = (qg = class {
19436
19463
  } catch (g) {
19437
19464
  this.logger.error("syncConsumers: updateConsumers failed with error.", { error: g });
19438
19465
  } finally {
19439
- this.logger.info("syncConsumers: Setting consumersSyncing=false and completing sync."), f(this, ms, !1);
19466
+ this.logger.info("syncConsumers: Setting consumersSyncing=false and completing sync."), f(this, fs, !1);
19440
19467
  }
19441
19468
  n(this, ca) && (this.logger.info("syncConsumers: Resync required, calling syncConsumers again."), this.syncConsumers());
19442
19469
  });
@@ -20011,7 +20038,7 @@ const eS = (qg = class {
20011
20038
  // priority
20012
20039
  })), t && this.context.getValue("peerSessionStore").emit(k.UPDATE_ACTIVE, { viewMode: this.participants.viewMode, page: this.participants.currentPage });
20013
20040
  }
20014
- }, es = new WeakMap(), ms = new WeakMap(), ca = new WeakMap(), qg);
20041
+ }, es = new WeakMap(), fs = new WeakMap(), ca = new WeakMap(), qg);
20015
20042
  let Pr = eS;
20016
20043
  gn([
20017
20044
  E.trace("ParticipantController.setupEvents")
@@ -20037,7 +20064,7 @@ gn([
20037
20064
  const ue = Rs(
20038
20065
  Rh().permissions
20039
20066
  );
20040
- var q, da, la, Wd, ft, Nt;
20067
+ var q, da, la, Jd, ft, Nt;
20041
20068
  const wn = class extends qt {
20042
20069
  constructor(e, r, i, a = !1) {
20043
20070
  const o = e.getValue("logger");
@@ -20046,7 +20073,7 @@ const wn = class extends qt {
20046
20073
  m(this, q, void 0);
20047
20074
  m(this, da, void 0);
20048
20075
  m(this, la, void 0);
20049
- m(this, Wd, (e) => {
20076
+ m(this, Jd, (e) => {
20050
20077
  var p, g, S;
20051
20078
  const l = e, {
20052
20079
  chat: r,
@@ -20095,7 +20122,7 @@ const wn = class extends qt {
20095
20122
  f(this, la, e), f(this, da, i), f(this, q, r), a && this.setupEvents();
20096
20123
  }
20097
20124
  setupEvents() {
20098
- n(this, la).getValue("peerSessionStore").on(k.UPDATE_PERMISSIONS, n(this, Wd));
20125
+ n(this, la).getValue("peerSessionStore").on(k.UPDATE_PERMISSIONS, n(this, Jd));
20099
20126
  }
20100
20127
  /** @deprecated. Use init() */
20101
20128
  static fromResponse(e, r, i) {
@@ -20441,15 +20468,15 @@ const wn = class extends qt {
20441
20468
  }
20442
20469
  };
20443
20470
  let Wu = wn;
20444
- q = new WeakMap(), da = new WeakMap(), la = new WeakMap(), Wd = new WeakMap(), ft = new WeakSet(), Nt = function() {
20471
+ q = new WeakMap(), da = new WeakMap(), la = new WeakMap(), Jd = new WeakMap(), ft = new WeakSet(), Nt = function() {
20445
20472
  return n(this, la).getValue("stageStatus");
20446
20473
  };
20447
- var fs;
20474
+ var ts;
20448
20475
  class tS extends qt {
20449
20476
  constructor() {
20450
20477
  super(...arguments);
20451
20478
  h(this, "localMediaHandler");
20452
- m(this, fs, void 0);
20479
+ m(this, ts, void 0);
20453
20480
  }
20454
20481
  updatePermission() {
20455
20482
  return u(this, null, function* () {
@@ -20457,7 +20484,7 @@ class tS extends qt {
20457
20484
  const e = (p, g) => {
20458
20485
  this.mediaPermissions[p] = g;
20459
20486
  const S = { message: this.mediaPermissions[p], kind: p };
20460
- g === "DENIED" ? n(this, fs).getValue("peerSessionStore").emit(k.MEDIA_PERMISSION_ERROR, S) : n(this, fs).getValue("peerSessionStore").emit(k.MEDIA_PERMISSION_UPDATE, S);
20487
+ g === "DENIED" ? n(this, ts).getValue("peerSessionStore").emit(k.MEDIA_PERMISSION_ERROR, S) : n(this, ts).getValue("peerSessionStore").emit(k.MEDIA_PERMISSION_UPDATE, S);
20461
20488
  };
20462
20489
  if (ye.getName() === "firefox")
20463
20490
  return;
@@ -20489,15 +20516,15 @@ class tS extends qt {
20489
20516
  var a, o, c, d;
20490
20517
  switch (r) {
20491
20518
  case "audio": {
20492
- (a = n(this, fs)) == null || a.getValue("callstats").mediaPermission("AUDIO", e), (o = n(this, fs)) == null || o.getValue("callstats").mediaPermission("SPEAKER", e);
20519
+ (a = n(this, ts)) == null || a.getValue("callstats").mediaPermission("AUDIO", e), (o = n(this, ts)) == null || o.getValue("callstats").mediaPermission("SPEAKER", e);
20493
20520
  break;
20494
20521
  }
20495
20522
  case "video": {
20496
- (c = n(this, fs)) == null || c.getValue("callstats").mediaPermission("VIDEO", e);
20523
+ (c = n(this, ts)) == null || c.getValue("callstats").mediaPermission("VIDEO", e);
20497
20524
  break;
20498
20525
  }
20499
20526
  case "screenshare": {
20500
- (d = n(this, fs)) == null || d.getValue("callstats").mediaPermission("SCREENSHARE", e);
20527
+ (d = n(this, ts)) == null || d.getValue("callstats").mediaPermission("SCREENSHARE", e);
20501
20528
  break;
20502
20529
  }
20503
20530
  }
@@ -20505,12 +20532,12 @@ class tS extends qt {
20505
20532
  }
20506
20533
  get peerId() {
20507
20534
  var e;
20508
- return (e = n(this, fs)) == null ? void 0 : e.getValue("peerId");
20535
+ return (e = n(this, ts)) == null ? void 0 : e.getValue("peerId");
20509
20536
  }
20510
20537
  init() {
20511
20538
  return u(this, arguments, function* (e = {}, r = !1, i = null) {
20512
20539
  var a, o, c, d, l, p, g;
20513
- if (ye.init(), !this.localMediaHandler)
20540
+ if (ye.init(), i && f(this, ts, i), !this.localMediaHandler)
20514
20541
  try {
20515
20542
  let S = !0;
20516
20543
  if ((a = i == null ? void 0 : i.getValue("defaults")) != null && a.mediaHandler)
@@ -20576,7 +20603,7 @@ class tS extends qt {
20576
20603
  });
20577
20604
  }
20578
20605
  set context(e) {
20579
- f(this, fs, e), this.localMediaHandler.context = e;
20606
+ f(this, ts, e), this.localMediaHandler.context = e;
20580
20607
  }
20581
20608
  /**
20582
20609
  * Returns the `audioTrack`.
@@ -20834,7 +20861,7 @@ class tS extends qt {
20834
20861
  });
20835
20862
  }
20836
20863
  }
20837
- fs = new WeakMap();
20864
+ ts = new WeakMap();
20838
20865
  var xD = Object.defineProperty, UD = Object.getOwnPropertyDescriptor, Pt = (s, t, e, r) => {
20839
20866
  for (var i = r > 1 ? void 0 : r ? UD(t, e) : t, a = s.length - 1, o; a >= 0; a--)
20840
20867
  (o = s[a]) && (i = (r ? o(t, e, i) : o(i)) || i);
@@ -21763,7 +21790,7 @@ class qD {
21763
21790
  this.events.selfJoinComplete,
21764
21791
  nR.toBinary(t)
21765
21792
  )).payload;
21766
- return Ru.fromBinary(e);
21793
+ return bu.fromBinary(e);
21767
21794
  });
21768
21795
  }
21769
21796
  audioActivity(t) {
@@ -21774,7 +21801,7 @@ class qD {
21774
21801
  }
21775
21802
  Je = new WeakMap();
21776
21803
  var An = /* @__PURE__ */ ((s) => (s.NEW = "new", s.CONNECTING = "connecting", s.RECONNECTING = "reconnecting", s.DISCONNECTED = "disconnected", s.CONNECTED = "connected", s.FAILED = "failed", s.CLOSED = "closed", s))(An || {}), sc;
21777
- class Gl extends lt.EventEmitter {
21804
+ class Wl extends lt.EventEmitter {
21778
21805
  constructor(e) {
21779
21806
  super();
21780
21807
  m(this, sc, void 0);
@@ -21821,7 +21848,7 @@ class Gl extends lt.EventEmitter {
21821
21848
  }
21822
21849
  }
21823
21850
  sc = new WeakMap();
21824
- class Hh extends Gl {
21851
+ class Hh extends Wl {
21825
21852
  constructor() {
21826
21853
  super(...arguments);
21827
21854
  /** Local stream for sending general media tracks. */
@@ -22166,7 +22193,7 @@ class qh extends Hh {
22166
22193
  });
22167
22194
  }
22168
22195
  }
22169
- class Id extends Hh {
22196
+ class Ad extends Hh {
22170
22197
  // eslint-disable-next-line no-useless-constructor
22171
22198
  constructor(e, r) {
22172
22199
  super(e);
@@ -22177,7 +22204,7 @@ class Id extends Hh {
22177
22204
  * Creates a factory function.
22178
22205
  */
22179
22206
  static createFactory(e, r) {
22180
- return () => new Id(
22207
+ return () => new Ad(
22181
22208
  e,
22182
22209
  r
22183
22210
  );
@@ -22207,8 +22234,8 @@ class Id extends Hh {
22207
22234
  }
22208
22235
  const l = (S, v) => {
22209
22236
  var N;
22210
- const _ = us.parse(S), P = _.media[_.media.length - 1], C = P.rtp.filter((B) => v.some((G) => G.name === B.codec)), w = P.fmtp.filter((B) => C.some((G) => G.payload === B.payload)), $ = (N = P.rtcpFb) == null ? void 0 : N.filter((B) => C.some((G) => G.payload === B.payload)), F = C.map((B) => B.payload);
22211
- return _.media[_.media.length - 1].rtp = C, _.media[_.media.length - 1].fmtp = w, _.media[_.media.length - 1].rtcpFb = $, _.media[_.media.length - 1].payloads = F.join(" "), us.write(_);
22237
+ const _ = hs.parse(S), P = _.media[_.media.length - 1], C = P.rtp.filter((B) => v.some((G) => G.name === B.codec)), w = P.fmtp.filter((B) => C.some((G) => G.payload === B.payload)), $ = (N = P.rtcpFb) == null ? void 0 : N.filter((B) => C.some((G) => G.payload === B.payload)), F = C.map((B) => B.payload);
22238
+ return _.media[_.media.length - 1].rtp = C, _.media[_.media.length - 1].fmtp = w, _.media[_.media.length - 1].rtcpFb = $, _.media[_.media.length - 1].payloads = F.join(" "), hs.write(_);
22212
22239
  }, p = yield this.pc.createOffer();
22213
22240
  if (p.sdp = l(p.sdp, i), this.logger.debug(`send() | calling pc.setLocalDescription() [offer:${JSON.stringify(p)}]`), yield this.pc.setLocalDescription(p), e === "audio" || e.kind === "audio") {
22214
22241
  const { enableDtx: S, enableStereo: v } = this, _ = this.enableHighBitrate ? v ? 128e3 : 64e3 : v ? 64e3 : 32e3;
@@ -22332,15 +22359,15 @@ class jh extends Hh {
22332
22359
  function jD(s, t) {
22333
22360
  return typeof s == "undefined" ? t : typeof window != "undefined" && Object.getOwnPropertyDescriptor(window, "structuredClone") ? structuredClone(s) : JSON.parse(JSON.stringify(s));
22334
22361
  }
22335
- var rc, Ni, Vs, Jd, Ls, br, ic, zu, Kd, rS, zd, iS;
22336
- class GD extends Gl {
22362
+ var rc, Ni, Vs, Kd, Ls, br, ic, zu, zd, rS, Yd, iS;
22363
+ class GD extends Wl {
22337
22364
  constructor(e, r) {
22338
22365
  var i;
22339
22366
  super(e);
22340
22367
  m(this, Ls);
22341
22368
  m(this, ic);
22342
- m(this, Kd);
22343
22369
  m(this, zd);
22370
+ m(this, Yd);
22344
22371
  /**
22345
22372
  * Associated transciever RTCRtpSender object
22346
22373
  */
@@ -22384,8 +22411,8 @@ class GD extends Gl {
22384
22411
  m(this, rc, void 0);
22385
22412
  m(this, Ni, void 0);
22386
22413
  m(this, Vs, void 0);
22387
- m(this, Jd, void 0);
22388
- this.id = r.id, this.localId = r.localId, f(this, rc, r.handler), this.appData = r.appData, this.peerId = r.producingPeerId, this.producingTransportId = r.producingTransportId, f(this, Vs, !1), this.producerId = r.producerId, this.track = r.track, f(this, Ni, (i = r.paused) != null ? i : !1), this.mimeType = r.mimeType, this.transceiver = r.transceiver, this.rtpReceiver = r.rtpReceiver, x(this, Kd, rS).call(this), f(this, Jd, e);
22414
+ m(this, Kd, void 0);
22415
+ this.id = r.id, this.localId = r.localId, f(this, rc, r.handler), this.appData = r.appData, this.peerId = r.producingPeerId, this.producingTransportId = r.producingTransportId, f(this, Vs, !1), this.producerId = r.producerId, this.track = r.track, f(this, Ni, (i = r.paused) != null ? i : !1), this.mimeType = r.mimeType, this.transceiver = r.transceiver, this.rtpReceiver = r.rtpReceiver, x(this, zd, rS).call(this), f(this, Kd, e);
22389
22416
  }
22390
22417
  /**
22391
22418
  * Indicates whether this consumer is closed
@@ -22409,7 +22436,7 @@ class GD extends Gl {
22409
22436
  * Closes the Consumer.
22410
22437
  */
22411
22438
  close(e, r) {
22412
- n(this, Vs) || (this.logger.debug(`Consumer::close() ${e ? `with reason ${e}` : ""}`, n(this, Ls, br)), f(this, Vs, !0), r && (x(this, zd, iS).call(this), this.transceiver.stop()), this.safeEmit("close", e));
22439
+ n(this, Vs) || (this.logger.debug(`Consumer::close() ${e ? `with reason ${e}` : ""}`, n(this, Ls, br)), f(this, Vs, !0), r && (x(this, Yd, iS).call(this), this.transceiver.stop()), this.safeEmit("close", e));
22413
22440
  }
22414
22441
  /**
22415
22442
  * Get associated RTCRtpReceiver stats.
@@ -22442,7 +22469,7 @@ class GD extends Gl {
22442
22469
  f(this, Ni, !1), this.track.enabled = !0, this.safeEmit("resume");
22443
22470
  }
22444
22471
  }
22445
- rc = new WeakMap(), Ni = new WeakMap(), Vs = new WeakMap(), Jd = new WeakMap(), Ls = new WeakSet(), br = function() {
22472
+ rc = new WeakMap(), Ni = new WeakMap(), Vs = new WeakMap(), Kd = new WeakMap(), Ls = new WeakSet(), br = function() {
22446
22473
  return {
22447
22474
  consumer: {
22448
22475
  id: this.id,
@@ -22453,9 +22480,9 @@ rc = new WeakMap(), Ni = new WeakMap(), Vs = new WeakMap(), Jd = new WeakMap(),
22453
22480
  };
22454
22481
  }, ic = new WeakSet(), zu = function() {
22455
22482
  this.logger.debug('Consumer::track "ended" event', n(this, Ls, br)), this.safeEmit("trackended");
22456
- }, Kd = new WeakSet(), rS = function() {
22483
+ }, zd = new WeakSet(), rS = function() {
22457
22484
  this.track.addEventListener("ended", x(this, ic, zu).bind(this));
22458
- }, zd = new WeakSet(), iS = function() {
22485
+ }, Yd = new WeakSet(), iS = function() {
22459
22486
  try {
22460
22487
  this.track.removeEventListener("ended", x(this, ic, zu)), this.track.stop();
22461
22488
  } catch (e) {
@@ -22464,8 +22491,8 @@ rc = new WeakMap(), Ni = new WeakMap(), Vs = new WeakMap(), Jd = new WeakMap(),
22464
22491
  }));
22465
22492
  }
22466
22493
  };
22467
- var Ss, fa, Sa, Vi, ts, Xe, jr, va, Yd, $t, ls;
22468
- class WD extends Gl {
22494
+ var Ss, fa, Sa, Vi, ss, Xe, jr, va, Qd, $t, us;
22495
+ class WD extends Wl {
22469
22496
  /**
22470
22497
  * @emits transportclose
22471
22498
  * @emits trackended
@@ -22514,18 +22541,18 @@ class WD extends Gl {
22514
22541
  * Specify if we should replace the RTCRtpSender.track with null when paused.
22515
22542
  */
22516
22543
  m(this, Vi, void 0);
22517
- m(this, ts, !1);
22544
+ m(this, ss, !1);
22518
22545
  m(this, Xe, void 0);
22519
22546
  m(this, jr, void 0);
22520
22547
  m(this, va, void 0);
22521
- m(this, Yd, void 0);
22522
- this.id = r.id, this.localId = r.localId, f(this, Xe, r.track), this.kind = (i = r.track) == null ? void 0 : i.kind, f(this, jr, r.disableTrackOnPause ? !((a = r.track) != null && a.enabled) : !1), f(this, va, void 0), f(this, fa, r.stopTracks), f(this, Sa, r.disableTrackOnPause), f(this, Vi, r.zeroRtpOnPause), this.appData = r.appData || {}, this._onTrackEnded = this._onTrackEnded.bind(this), f(this, Ss, r.handler), this.rtpSender = r.rtpSender, this._handleTrack(), f(this, Yd, e);
22548
+ m(this, Qd, void 0);
22549
+ this.id = r.id, this.localId = r.localId, f(this, Xe, r.track), this.kind = (i = r.track) == null ? void 0 : i.kind, f(this, jr, r.disableTrackOnPause ? !((a = r.track) != null && a.enabled) : !1), f(this, va, void 0), f(this, fa, r.stopTracks), f(this, Sa, r.disableTrackOnPause), f(this, Vi, r.zeroRtpOnPause), this.appData = r.appData || {}, this._onTrackEnded = this._onTrackEnded.bind(this), f(this, Ss, r.handler), this.rtpSender = r.rtpSender, this._handleTrack(), f(this, Qd, e);
22523
22550
  }
22524
22551
  /**
22525
22552
  * Whether the Producer is closed.
22526
22553
  */
22527
22554
  get closed() {
22528
- return n(this, ts);
22555
+ return n(this, ss);
22529
22556
  }
22530
22557
  /**
22531
22558
  * The associated track.
@@ -22552,9 +22579,9 @@ class WD extends Gl {
22552
22579
  */
22553
22580
  close(e) {
22554
22581
  return u(this, null, function* () {
22555
- if (n(this, ts))
22582
+ if (n(this, ss))
22556
22583
  return;
22557
- if (this.logger.debug(`Producer::close() ${e ? `with reason ${e}` : ""}`, n(this, $t, ls)), f(this, ts, !0), this._destroyTrack(), e === Ad) {
22584
+ if (this.logger.debug(`Producer::close() ${e ? `with reason ${e}` : ""}`, n(this, $t, us)), f(this, ss, !0), this._destroyTrack(), e === Md) {
22558
22585
  this.safeEmit("close", { reason: e });
22559
22586
  return;
22560
22587
  }
@@ -22567,7 +22594,7 @@ class WD extends Gl {
22567
22594
  */
22568
22595
  getStats() {
22569
22596
  return u(this, null, function* () {
22570
- if (n(this, ts))
22597
+ if (n(this, ss))
22571
22598
  throw new It("closed");
22572
22599
  return n(this, Ss).getSenderStats(this.localId);
22573
22600
  });
@@ -22576,14 +22603,14 @@ class WD extends Gl {
22576
22603
  * Pauses sending media.
22577
22604
  */
22578
22605
  pause() {
22579
- this.logger.debug("Producer::pause()", n(this, $t, ls)), n(this, ts) && this.logger.error("Producer::pause() | Producer closed", n(this, $t, ls)), f(this, jr, !0), n(this, Xe) && n(this, Sa) && (n(this, Xe).enabled = !1), n(this, Vi) && n(this, Ss).replaceTrack(this.localId, null), this.emit("pause");
22606
+ this.logger.debug("Producer::pause()", n(this, $t, us)), n(this, ss) && this.logger.error("Producer::pause() | Producer closed", n(this, $t, us)), f(this, jr, !0), n(this, Xe) && n(this, Sa) && (n(this, Xe).enabled = !1), n(this, Vi) && n(this, Ss).replaceTrack(this.localId, null), this.emit("pause");
22580
22607
  }
22581
22608
  /**
22582
22609
  * Resumes sending media.
22583
22610
  */
22584
22611
  resume() {
22585
- if (this.logger.debug("Producer::resume()", n(this, $t, ls)), n(this, ts)) {
22586
- this.logger.error("Producer::resume() | Producer closed", n(this, $t, ls));
22612
+ if (this.logger.debug("Producer::resume()", n(this, $t, us)), n(this, ss)) {
22613
+ this.logger.error("Producer::resume() | Producer closed", n(this, $t, us));
22587
22614
  return;
22588
22615
  }
22589
22616
  f(this, jr, !1), n(this, Xe) && n(this, Sa) && (n(this, Xe).enabled = !0), n(this, Vi) && n(this, Ss).replaceTrack(this.localId, n(this, Xe)), this.emit("resume");
@@ -22595,12 +22622,12 @@ class WD extends Gl {
22595
22622
  return u(this, arguments, function* ({
22596
22623
  track: e
22597
22624
  }) {
22598
- if (this.logger.debug(`Producer::replaceTrack() trackId: ${e == null ? void 0 : e.id}`, n(this, $t, ls)), n(this, ts)) {
22625
+ if (this.logger.debug(`Producer::replaceTrack() trackId: ${e == null ? void 0 : e.id}`, n(this, $t, us)), n(this, ss)) {
22599
22626
  if (e && n(this, fa))
22600
22627
  try {
22601
22628
  e.stop();
22602
22629
  } catch (i) {
22603
- this.logger.error("Producer::replaceTrack", H(D({}, n(this, $t, ls)), {
22630
+ this.logger.error("Producer::replaceTrack", H(D({}, n(this, $t, us)), {
22604
22631
  error: i
22605
22632
  }));
22606
22633
  }
@@ -22608,7 +22635,7 @@ class WD extends Gl {
22608
22635
  } else if (e && e.readyState === "ended")
22609
22636
  throw new It("track ended");
22610
22637
  if (e === n(this, Xe)) {
22611
- this.logger.debug(`replaceTrack() | same track, ignored trackId: ${e.id}`, n(this, $t, ls));
22638
+ this.logger.debug(`replaceTrack() | same track, ignored trackId: ${e.id}`, n(this, $t, us));
22612
22639
  return;
22613
22640
  }
22614
22641
  (!n(this, Vi) || !n(this, jr)) && (yield n(this, Ss).replaceTrack(this.localId, e)), this._destroyTrack(), f(this, Xe, e), this._handleTrack();
@@ -22619,7 +22646,7 @@ class WD extends Gl {
22619
22646
  */
22620
22647
  setMaxSpatialLayer(e) {
22621
22648
  return u(this, null, function* () {
22622
- if (n(this, ts))
22649
+ if (n(this, ss))
22623
22650
  throw new It("closed");
22624
22651
  if (this.kind !== "video")
22625
22652
  throw new Do("not a video Producer");
@@ -22633,7 +22660,7 @@ class WD extends Gl {
22633
22660
  */
22634
22661
  setRtpEncodingParameters(e) {
22635
22662
  return u(this, null, function* () {
22636
- if (n(this, ts))
22663
+ if (n(this, ss))
22637
22664
  throw new It("closed");
22638
22665
  if (typeof e != "object")
22639
22666
  throw new TypeError("invalid params");
@@ -22641,7 +22668,7 @@ class WD extends Gl {
22641
22668
  });
22642
22669
  }
22643
22670
  _onTrackEnded() {
22644
- this.logger.debug(`Producer::track "ended" event trackId: ${this.track.id}`, n(this, $t, ls)), this.safeEmit("trackended", this.track.id);
22671
+ this.logger.debug(`Producer::track "ended" event trackId: ${this.track.id}`, n(this, $t, us)), this.safeEmit("trackended", this.track.id);
22645
22672
  }
22646
22673
  _handleTrack() {
22647
22674
  n(this, Xe) && n(this, Xe).addEventListener("ended", this._onTrackEnded);
@@ -22652,13 +22679,13 @@ class WD extends Gl {
22652
22679
  try {
22653
22680
  n(this, Xe).removeEventListener("ended", this._onTrackEnded), n(this, fa) && n(this, Xe).stop();
22654
22681
  } catch (r) {
22655
- this.logger.error(`Producer::_destroyTrack trackId: ${(e = this.track) == null ? void 0 : e.id}`, H(D({}, n(this, $t, ls)), {
22682
+ this.logger.error(`Producer::_destroyTrack trackId: ${(e = this.track) == null ? void 0 : e.id}`, H(D({}, n(this, $t, us)), {
22656
22683
  error: r
22657
22684
  }));
22658
22685
  }
22659
22686
  }
22660
22687
  }
22661
- Ss = new WeakMap(), fa = new WeakMap(), Sa = new WeakMap(), Vi = new WeakMap(), ts = new WeakMap(), Xe = new WeakMap(), jr = new WeakMap(), va = new WeakMap(), Yd = new WeakMap(), $t = new WeakSet(), ls = function() {
22688
+ Ss = new WeakMap(), fa = new WeakMap(), Sa = new WeakMap(), Vi = new WeakMap(), ss = new WeakMap(), Xe = new WeakMap(), jr = new WeakMap(), va = new WeakMap(), Qd = new WeakMap(), $t = new WeakSet(), us = function() {
22662
22689
  return {
22663
22690
  producer: {
22664
22691
  id: this.id,
@@ -22670,7 +22697,7 @@ Ss = new WeakMap(), fa = new WeakMap(), Sa = new WeakMap(), Vi = new WeakMap(),
22670
22697
  function nS(s) {
22671
22698
  return typeof s == "object" && !Array.isArray(s) && s !== null;
22672
22699
  }
22673
- function gu(s) {
22700
+ function mu(s) {
22674
22701
  return Math.random().toString(36).substring(2, 2 + s);
22675
22702
  }
22676
22703
  const id = 1;
@@ -22685,7 +22712,7 @@ function KD(s) {
22685
22712
  var t, e;
22686
22713
  return JD(s) && (e = (t = s.payload._bolt) == null ? void 0 : t.id) != null ? e : "";
22687
22714
  }
22688
- var Gr, Qd, Li;
22715
+ var Gr, Xd, Li;
22689
22716
  const Rn = class extends lt.EventEmitter {
22690
22717
  constructor(e, r, i, a) {
22691
22718
  super();
@@ -22693,7 +22720,7 @@ const Rn = class extends lt.EventEmitter {
22693
22720
  h(this, "queue");
22694
22721
  h(this, "serverProtocolVersion");
22695
22722
  m(this, Gr, /* @__PURE__ */ new Map());
22696
- m(this, Qd, void 0);
22723
+ m(this, Xd, void 0);
22697
22724
  m(this, Li, void 0);
22698
22725
  h(this, "respond", (e, r, i = !1) => {
22699
22726
  let a;
@@ -22767,13 +22794,13 @@ const Rn = class extends lt.EventEmitter {
22767
22794
  });
22768
22795
  h(this, "processBoltHandshake", (e) => {
22769
22796
  var r, i;
22770
- return e.type === "_bolt" || e.type === "handshake" ? (this.respond((i = (r = e.payload._bolt) == null ? void 0 : r.id) != null ? i : gu(8), { type: "_bolt", payload: { message: "pong" } }), !0) : !1;
22797
+ return e.type === "_bolt" || e.type === "handshake" ? (this.respond((i = (r = e.payload._bolt) == null ? void 0 : r.id) != null ? i : mu(8), { type: "_bolt", payload: { message: "pong" } }), !0) : !1;
22771
22798
  });
22772
- this.label = i, this.transportId = a, f(this, Qd, e), f(this, Li, e.getValue("logger")), this.channel = r, this.queue = /* @__PURE__ */ new Map();
22799
+ this.label = i, this.transportId = a, f(this, Xd, e), f(this, Li, e.getValue("logger")), this.channel = r, this.queue = /* @__PURE__ */ new Map();
22773
22800
  }
22774
22801
  };
22775
22802
  let ci = Rn;
22776
- Gr = new WeakMap(), Qd = new WeakMap(), Li = new WeakMap(), h(ci, "createRequest", (e) => {
22803
+ Gr = new WeakMap(), Xd = new WeakMap(), Li = new WeakMap(), h(ci, "createRequest", (e) => {
22777
22804
  var r;
22778
22805
  if ((r = e.payload) != null && r._bolt)
22779
22806
  throw new Error("rpc fields are internal values");
@@ -22781,7 +22808,7 @@ Gr = new WeakMap(), Qd = new WeakMap(), Li = new WeakMap(), h(ci, "createRequest
22781
22808
  type: e.type,
22782
22809
  payload: H(D({}, e.payload), {
22783
22810
  _bolt: {
22784
- id: gu(8),
22811
+ id: mu(8),
22785
22812
  type: "REQUEST",
22786
22813
  version: id
22787
22814
  }
@@ -22809,7 +22836,7 @@ Gr = new WeakMap(), Qd = new WeakMap(), Li = new WeakMap(), h(ci, "createRequest
22809
22836
  type: e.type,
22810
22837
  payload: H(D({}, e.payload), {
22811
22838
  bolt: {
22812
- id: gu(8),
22839
+ id: mu(8),
22813
22840
  type: "NOTIFY",
22814
22841
  version: id
22815
22842
  }
@@ -22826,9 +22853,9 @@ Gr = new WeakMap(), Qd = new WeakMap(), Li = new WeakMap(), h(ci, "createRequest
22826
22853
  }
22827
22854
  }
22828
22855
  }));
22829
- const Ad = "transport closed";
22856
+ const Md = "transport closed";
22830
22857
  var xi;
22831
- const bn = class extends Gl {
22858
+ const bn = class extends Wl {
22832
22859
  constructor(e, {
22833
22860
  id: r,
22834
22861
  direction: i,
@@ -22961,11 +22988,11 @@ const bn = class extends Gl {
22961
22988
  close() {
22962
22989
  this.closed || (this.logger.debug("Transport close called"), this.connectionState = "closed", this.awaitQueue.stop(), this.awaitQueue = void 0, this.connected = !1, this.handler.close(), Array.from(this.producers.values()).forEach(
22963
22990
  (e) => {
22964
- e.close(Ad).catch(() => {
22991
+ e.close(Md).catch(() => {
22965
22992
  });
22966
22993
  }
22967
22994
  ), this.producers.clear(), Array.from(this.consumers.values()).forEach((e) => {
22968
- e.close(Ad);
22995
+ e.close(Md);
22969
22996
  }), this.consumers.clear(), this.consumerTrackEvents.clear(), this.emit("close"));
22970
22997
  }
22971
22998
  /**
@@ -23123,7 +23150,7 @@ const bn = class extends Gl {
23123
23150
  });
23124
23151
  }
23125
23152
  static parseCodecAndFmtpMappings(e, r) {
23126
- const i = us.parse(e.sdp), a = {};
23153
+ const i = hs.parse(e.sdp), a = {};
23127
23154
  return i.media.forEach((o) => {
23128
23155
  r.includes(o.mid.toString()) && (a[o.mid.toString()] = {
23129
23156
  rtp: o.rtp,
@@ -23134,7 +23161,7 @@ const bn = class extends Gl {
23134
23161
  }), a;
23135
23162
  }
23136
23163
  static setCodecAndFmtpMappings(e, r, i) {
23137
- const a = us.parse(e.sdp);
23164
+ const a = hs.parse(e.sdp);
23138
23165
  return a.media = a.media.map((c) => {
23139
23166
  if (r.includes(c.mid.toString())) {
23140
23167
  const d = D({}, c);
@@ -23142,22 +23169,22 @@ const bn = class extends Gl {
23142
23169
  }
23143
23170
  return c;
23144
23171
  }), H(D({}, e), {
23145
- sdp: us.write(a)
23172
+ sdp: hs.write(a)
23146
23173
  });
23147
23174
  }
23148
23175
  static parseHeaderExtensionMappings(e) {
23149
- const r = us.parse(e.sdp), i = {};
23176
+ const r = hs.parse(e.sdp), i = {};
23150
23177
  return r.media.forEach((a) => {
23151
23178
  i[a.mid] = a.ext;
23152
23179
  }), i;
23153
23180
  }
23154
23181
  static setHeaderExtensionMappings(e, r) {
23155
- const i = us.parse(e.sdp);
23182
+ const i = hs.parse(e.sdp);
23156
23183
  return i.media = i.media.map((o) => {
23157
23184
  const c = D({}, o);
23158
23185
  return c.ext = r[o.mid], c;
23159
23186
  }), H(D({}, e), {
23160
- sdp: us.write(i)
23187
+ sdp: hs.write(i)
23161
23188
  });
23162
23189
  }
23163
23190
  closeConsumers(e, r) {
@@ -23192,7 +23219,7 @@ const bn = class extends Gl {
23192
23219
  this.logger.info("Received offer from SFU", { sdp: e.sdp }), yield this.setRemoteDescription(e);
23193
23220
  const r = yield this.handler.pc.createAnswer();
23194
23221
  this.logger.info("Created answer corresponding to received offer", { sdp: r.sdp });
23195
- const i = us.parse(r.sdp);
23222
+ const i = hs.parse(r.sdp);
23196
23223
  return i.media = i.media.map((a) => {
23197
23224
  if (a.type === "audio") {
23198
23225
  const o = D({}, a), c = o.fmtp.find(
@@ -23206,7 +23233,7 @@ const bn = class extends Gl {
23206
23233
  }), o;
23207
23234
  }
23208
23235
  return a;
23209
- }), r.sdp = us.write(i), this.logger.info("Setting munged SDP", { sdp: r.sdp }), yield this.setLocalDescription(r), this.logger.info("Successfully set local description", { sdp: r.sdp }), r;
23236
+ }), r.sdp = hs.write(i), this.logger.info("Setting munged SDP", { sdp: r.sdp }), yield this.setLocalDescription(r), this.logger.info("Successfully set local description", { sdp: r.sdp }), r;
23210
23237
  } catch (r) {
23211
23238
  throw this.logger.error("Set remote offer failed", { error: r }), r;
23212
23239
  }
@@ -23391,13 +23418,13 @@ class YD {
23391
23418
  this.handlerFactory = jh.createFactory(n(this, rr));
23392
23419
  break;
23393
23420
  case "Firefox60":
23394
- this.handlerFactory = Id.createFactory(
23421
+ this.handlerFactory = Ad.createFactory(
23395
23422
  n(this, rr),
23396
23423
  { supportsSendEncodings: !1 }
23397
23424
  );
23398
23425
  break;
23399
23426
  case "Firefox110":
23400
- this.handlerFactory = Id.createFactory(
23427
+ this.handlerFactory = Ad.createFactory(
23401
23428
  n(this, rr),
23402
23429
  { supportsSendEncodings: !0 }
23403
23430
  );
@@ -23424,19 +23451,19 @@ class YD {
23424
23451
  }
23425
23452
  rr = new WeakMap(), Ui = new WeakMap();
23426
23453
  const QD = 2e3;
23427
- var Ta, at, ot, nc, ac, $i, ya, oc, Ea, Fi, xs, _a, fd, cc, Qu, Xd, aS, dc, Xu, Zd, oS, el, cS, tl, dS, sl, lS, rl, uS, lc, Zu, uc, eh;
23454
+ var Ta, at, ot, nc, ac, $i, ya, oc, Ea, Fi, xs, _a, fd, cc, Qu, Zd, aS, dc, Xu, el, oS, tl, cS, sl, dS, rl, lS, il, uS, lc, Zu, uc, eh;
23428
23455
  class XD extends lt.EventEmitter {
23429
23456
  constructor(e, r) {
23430
23457
  super();
23431
23458
  m(this, _a);
23432
23459
  m(this, cc);
23433
- m(this, Xd);
23434
- m(this, dc);
23435
23460
  m(this, Zd);
23461
+ m(this, dc);
23436
23462
  m(this, el);
23437
23463
  m(this, tl);
23438
23464
  m(this, sl);
23439
23465
  m(this, rl);
23466
+ m(this, il);
23440
23467
  m(this, lc);
23441
23468
  m(this, uc);
23442
23469
  h(this, "context");
@@ -23499,7 +23526,7 @@ class XD extends lt.EventEmitter {
23499
23526
  }
23500
23527
  setupTransports(e) {
23501
23528
  return u(this, null, function* () {
23502
- yield x(this, Xd, aS).call(this, e);
23529
+ yield x(this, Zd, aS).call(this, e);
23503
23530
  let r, i;
23504
23531
  e.send && (r = x(this, dc, Xu).call(this, n(this, at)).then((a) => {
23505
23532
  try {
@@ -23543,7 +23570,7 @@ Ta = new WeakMap(), at = new WeakMap(), ot = new WeakMap(), nc = new WeakMap(),
23543
23570
  send: void 0,
23544
23571
  recv: void 0
23545
23572
  });
23546
- }, Xd = new WeakSet(), aS = function(e) {
23573
+ }, Zd = new WeakSet(), aS = function(e) {
23547
23574
  return u(this, null, function* () {
23548
23575
  var o, c, d, l, p, g, S, v;
23549
23576
  (La(this.context, "forceRelay") || this.context.getValue("flagsmith").hasFeature(ee.FORCE_RELAY)) && f(this, xs, "relay"), this.logger.info(`ICE Transport Policy set to ${n(this, xs)}`);
@@ -23552,7 +23579,7 @@ Ta = new WeakMap(), at = new WeakMap(), ot = new WeakMap(), nc = new WeakMap(),
23552
23579
  const _ = this.context.getValue("flagsmith").hasFeature(
23553
23580
  ee.DISABLE_OPUS_DTX_CF
23554
23581
  );
23555
- x(this, el, cS).call(this, {
23582
+ x(this, tl, cS).call(this, {
23556
23583
  iceServers: a,
23557
23584
  additionalSettings: {
23558
23585
  encodedInsertableStreams: (o = this.context.getValue("modules").e2ee) == null ? void 0 : o.enabled
@@ -23565,7 +23592,7 @@ Ta = new WeakMap(), at = new WeakMap(), ot = new WeakMap(), nc = new WeakMap(),
23565
23592
  iceTransportPolicy: n(this, xs)
23566
23593
  });
23567
23594
  }
23568
- e.recv && x(this, tl, dS).call(this, {
23595
+ e.recv && x(this, sl, dS).call(this, {
23569
23596
  iceServers: a,
23570
23597
  additionalSettings: {
23571
23598
  encodedInsertableStreams: (v = this.context.getValue("modules").e2ee) == null ? void 0 : v.enabled
@@ -23576,7 +23603,7 @@ Ta = new WeakMap(), at = new WeakMap(), ot = new WeakMap(), nc = new WeakMap(),
23576
23603
  }, dc = new WeakSet(), Xu = function(e) {
23577
23604
  return u(this, null, function* () {
23578
23605
  const { id: r, serverId: i, direction: a } = e;
23579
- x(this, sl, lS).call(this, e);
23606
+ x(this, rl, lS).call(this, e);
23580
23607
  try {
23581
23608
  return yield sS((c, d) => u(this, null, function* () {
23582
23609
  c > 0 && this.logger.debug(`Retrying transport connect, count: ${c}`, {
@@ -23585,7 +23612,7 @@ Ta = new WeakMap(), at = new WeakMap(), ot = new WeakMap(), nc = new WeakMap(),
23585
23612
  try {
23586
23613
  if (e.closed)
23587
23614
  throw new pi("Cannot reconnect closed transport");
23588
- yield x(this, Zd, oS).call(this, e);
23615
+ yield x(this, el, oS).call(this, e);
23589
23616
  } catch (l) {
23590
23617
  if (l instanceof pi) {
23591
23618
  d(l);
@@ -23608,7 +23635,7 @@ Ta = new WeakMap(), at = new WeakMap(), ot = new WeakMap(), nc = new WeakMap(),
23608
23635
  ), e.close(), e.removeAllListeners(), o;
23609
23636
  }
23610
23637
  });
23611
- }, Zd = new WeakSet(), oS = function(e) {
23638
+ }, el = new WeakSet(), oS = function(e) {
23612
23639
  return u(this, null, function* () {
23613
23640
  const { id: r, direction: i } = e;
23614
23641
  if (this.logger.info(`Connecting ${i} transport`, {
@@ -23619,7 +23646,7 @@ Ta = new WeakMap(), at = new WeakMap(), ot = new WeakMap(), nc = new WeakMap(),
23619
23646
  throw new pi("Transport is closed");
23620
23647
  try {
23621
23648
  yield e.connect(
23622
- (a) => x(this, rl, uS).call(this, i, a)
23649
+ (a) => x(this, il, uS).call(this, i, a)
23623
23650
  ), this.logger.info(`Connected ${i} transport`, {
23624
23651
  transport: { id: r, serverId: e.serverId, type: i }
23625
23652
  });
@@ -23627,7 +23654,7 @@ Ta = new WeakMap(), at = new WeakMap(), ot = new WeakMap(), nc = new WeakMap(),
23627
23654
  throw n(this, Ea).transportFailureCount[i] += 1, a.message === "ice connection failed" ? new pi(a.message) : a;
23628
23655
  }
23629
23656
  });
23630
- }, el = new WeakSet(), cS = function(e) {
23657
+ }, tl = new WeakSet(), cS = function(e) {
23631
23658
  var r, i;
23632
23659
  if (n(this, at) && n(this, at).connected) {
23633
23660
  this.logger.info("Transport send is already connected", {
@@ -23642,7 +23669,7 @@ Ta = new WeakMap(), at = new WeakMap(), ot = new WeakMap(), nc = new WeakMap(),
23642
23669
  f(this, at, n(this, Ta).createTransport(H(D({}, e), {
23643
23670
  direction: "send"
23644
23671
  }))), this.context.getValue("callstats").configureSendTransport(n(this, at));
23645
- }, tl = new WeakSet(), dS = function(e) {
23672
+ }, sl = new WeakSet(), dS = function(e) {
23646
23673
  var r, i;
23647
23674
  if (n(this, ot) && n(this, ot).connected) {
23648
23675
  this.logger.info("Transport recv is already connected", {
@@ -23657,7 +23684,7 @@ Ta = new WeakMap(), at = new WeakMap(), ot = new WeakMap(), nc = new WeakMap(),
23657
23684
  f(this, ot, n(this, Ta).createTransport(H(D({}, e), {
23658
23685
  direction: "recv"
23659
23686
  }))), this.context.getValue("callstats").configureRecvTransport(n(this, ot));
23660
- }, sl = new WeakSet(), lS = function(e) {
23687
+ }, rl = new WeakSet(), lS = function(e) {
23661
23688
  const { direction: r, id: i } = e;
23662
23689
  e.on("connectionstatechange", (a) => u(this, null, function* () {
23663
23690
  x(this, uc, eh).call(this, { state: a, direction: r }), this.logger.info(
@@ -23726,7 +23753,7 @@ Ta = new WeakMap(), at = new WeakMap(), ot = new WeakMap(), nc = new WeakMap(),
23726
23753
  })), e.on("dc_error", () => {
23727
23754
  e.direction === "recv" && (this.logger.warn("Events datachannel did not open in 5s", { country: E.location.country }), this.handleErrors("reconnectRecvTransport"));
23728
23755
  });
23729
- }, rl = new WeakSet(), uS = function(e, r) {
23756
+ }, il = new WeakSet(), uS = function(e, r) {
23730
23757
  return u(this, null, function* () {
23731
23758
  const i = e === "recv";
23732
23759
  try {
@@ -23779,13 +23806,13 @@ Ta = new WeakMap(), at = new WeakMap(), ot = new WeakMap(), nc = new WeakMap(),
23779
23806
  }, n(this, _a, fd).mediaState[i])
23780
23807
  );
23781
23808
  };
23782
- var hc, ss;
23809
+ var hc, rs;
23783
23810
  class ZD {
23784
23811
  constructor(t, e, r, i, a) {
23785
23812
  /* eslint-disable-next-line no-useless-constructor */
23786
23813
  m(this, hc, void 0);
23787
- m(this, ss, void 0);
23788
- this.events = e, this.recvTransport = r, this.socket = i, this.socketHandler = a, f(this, hc, t), f(this, ss, t.getValue("logger"));
23814
+ m(this, rs, void 0);
23815
+ this.events = e, this.recvTransport = r, this.socket = i, this.socketHandler = a, f(this, hc, t), f(this, rs, t.getValue("logger"));
23789
23816
  }
23790
23817
  create(t) {
23791
23818
  return u(this, null, function* () {
@@ -23817,7 +23844,7 @@ class ZD {
23817
23844
  if (!p)
23818
23845
  return;
23819
23846
  if (l.errorCode) {
23820
- n(this, ss).warn(`Consumer request failed for producer ${d}`, {
23847
+ n(this, rs).warn(`Consumer request failed for producer ${d}`, {
23821
23848
  error: { message: l.errorCode }
23822
23849
  }), c.push(H(D({}, p), { errorCode: l.errorCode }));
23823
23850
  return;
@@ -23845,7 +23872,7 @@ class ZD {
23845
23872
  negotiate(t) {
23846
23873
  return u(this, null, function* () {
23847
23874
  try {
23848
- n(this, ss).info("Negotiating socket consumer", { transport: this.recvTransport }), n(this, ss).debug(`setting remote offer: ${JSON.stringify(t)} on recvTransport`, {
23875
+ n(this, rs).info("Negotiating socket consumer", { transport: this.recvTransport }), n(this, rs).debug(`setting remote offer: ${JSON.stringify(t)} on recvTransport`, {
23849
23876
  transport: this.recvTransport
23850
23877
  });
23851
23878
  const e = yield this.recvTransport.setRemoteOffer(t), r = {
@@ -23856,14 +23883,14 @@ class ZD {
23856
23883
  target: vr.SUBSCRIBER
23857
23884
  }
23858
23885
  };
23859
- return n(this, ss).debug(`sending renegotiate request: ${JSON.stringify(r)} on recvTransport`, {
23886
+ return n(this, rs).debug(`sending renegotiate request: ${JSON.stringify(r)} on recvTransport`, {
23860
23887
  transport: this.recvTransport
23861
23888
  }), yield this.socket.sendMessagePromise(
23862
23889
  this.events.renegotiateSessionDescription,
23863
23890
  Lw.toBinary(r)
23864
- ), n(this, ss).info("Renegotiation done", { transport: this.recvTransport }), e;
23891
+ ), n(this, rs).info("Renegotiation done", { transport: this.recvTransport }), e;
23865
23892
  } catch (e) {
23866
- n(this, ss).error("Failed to renegotiate", { error: e });
23893
+ n(this, rs).error("Failed to renegotiate", { error: e });
23867
23894
  return;
23868
23895
  }
23869
23896
  });
@@ -23874,7 +23901,7 @@ class ZD {
23874
23901
  return {};
23875
23902
  const e = (r, i) => u(this, null, function* () {
23876
23903
  const a = r.map((l) => l.localId);
23877
- n(this, ss).info(`Closing consumers: ${JSON.stringify(a)}`);
23904
+ n(this, rs).info(`Closing consumers: ${JSON.stringify(a)}`);
23878
23905
  const o = {
23879
23906
  description: {
23880
23907
  sdp: i.sdp,
@@ -23909,18 +23936,18 @@ class ZD {
23909
23936
  ridNotAvailable: "asciibetical"
23910
23937
  }
23911
23938
  });
23912
- }), yield this.socketHandler.updateConsumersSimulcastConfig(r), n(this, ss).info(`Consumers switched layers to ${e}`, { consumerIds: i == null ? void 0 : i.map(({ id: a }) => a) });
23939
+ }), yield this.socketHandler.updateConsumersSimulcastConfig(r), n(this, rs).info(`Consumers switched layers to ${e}`, { consumerIds: i == null ? void 0 : i.map(({ id: a }) => a) });
23913
23940
  });
23914
23941
  }
23915
23942
  }
23916
- hc = new WeakMap(), ss = new WeakMap();
23943
+ hc = new WeakMap(), rs = new WeakMap();
23917
23944
  class Gh {
23918
23945
  /* eslint-disable-next-line no-useless-constructor, no-empty-function */
23919
23946
  constructor(t) {
23920
23947
  this.socketHandler = t;
23921
23948
  }
23922
23949
  static getMSIDFromSDP(t, e) {
23923
- return us.parse(t).media.filter(
23950
+ return hs.parse(t).media.filter(
23924
23951
  (a) => e === "video" ? a.type === "video" : a.type === "audio"
23925
23952
  ).at(-1).msid;
23926
23953
  }
@@ -23952,21 +23979,21 @@ class Gh {
23952
23979
  });
23953
23980
  }
23954
23981
  }
23955
- var Bi, Wr, Pa, pc, Us, il, ir, Ca, gc, th, nl, hS, al, pS, ol, gS, cl, mS;
23982
+ var Bi, Wr, Pa, pc, Us, nl, ir, Ca, gc, th, al, hS, ol, pS, cl, gS, dl, mS;
23956
23983
  class eO extends XD {
23957
23984
  constructor(e, r) {
23958
23985
  super(e, r);
23959
23986
  m(this, gc);
23960
- m(this, nl);
23961
23987
  m(this, al);
23962
23988
  m(this, ol);
23963
23989
  m(this, cl);
23990
+ m(this, dl);
23964
23991
  m(this, Bi, void 0);
23965
23992
  m(this, Wr, void 0);
23966
23993
  m(this, Pa, void 0);
23967
23994
  m(this, pc, void 0);
23968
23995
  m(this, Us, void 0);
23969
- m(this, il, {
23996
+ m(this, nl, {
23970
23997
  producerCreationFailureCount: 0,
23971
23998
  consumerCreationFailureCount: 0,
23972
23999
  producerNotReadyFailureCount: 0
@@ -24015,11 +24042,11 @@ class eO extends XD {
24015
24042
  try {
24016
24043
  const a = yield this.sendTransport.produce(
24017
24044
  e,
24018
- x(this, nl, hS).bind(this)
24045
+ x(this, al, hS).bind(this)
24019
24046
  );
24020
- return (i = e.appData) != null && i.e2ee && this.context.getValue("peerSessionStore").emit(k.E2EE_ACTIVE_PRODUCER, a), x(this, al, pS).call(this, a, r), a;
24047
+ return (i = e.appData) != null && i.e2ee && this.context.getValue("peerSessionStore").emit(k.E2EE_ACTIVE_PRODUCER, a), x(this, ol, pS).call(this, a, r), a;
24021
24048
  } catch (a) {
24022
- throw this.logger.error("Failed to create producer", { error: a }), n(this, il).producerCreationFailureCount += 1, a;
24049
+ throw this.logger.error("Failed to create producer", { error: a }), n(this, nl).producerCreationFailureCount += 1, a;
24023
24050
  }
24024
24051
  });
24025
24052
  }
@@ -24073,7 +24100,7 @@ class eO extends XD {
24073
24100
  });
24074
24101
  }
24075
24102
  }
24076
- Bi = new WeakMap(), Wr = new WeakMap(), Pa = new WeakMap(), pc = new WeakMap(), Us = new WeakMap(), il = new WeakMap(), ir = new WeakMap(), Ca = new WeakMap(), gc = new WeakSet(), th = function() {
24103
+ Bi = new WeakMap(), Wr = new WeakMap(), Pa = new WeakMap(), pc = new WeakMap(), Us = new WeakMap(), nl = new WeakMap(), ir = new WeakMap(), Ca = new WeakMap(), gc = new WeakSet(), th = function() {
24077
24104
  return u(this, null, function* () {
24078
24105
  if (!this.recvTransport || this.recvTransport.closed)
24079
24106
  throw new Error("Recv transport is closed");
@@ -24084,10 +24111,10 @@ Bi = new WeakMap(), Wr = new WeakMap(), Pa = new WeakMap(), pc = new WeakMap(),
24084
24111
  return;
24085
24112
  const { consumers: o, failedProducers: c } = yield this.recvTransport.consume(
24086
24113
  a,
24087
- x(this, ol, gS).bind(this),
24114
+ x(this, cl, gS).bind(this),
24088
24115
  n(this, Us).negotiate.bind(n(this, Us))
24089
24116
  );
24090
- if (o.forEach(x(this, cl, mS).bind(this)), c != null && c.length) {
24117
+ if (o.forEach(x(this, dl, mS).bind(this)), c != null && c.length) {
24091
24118
  this.logger.error("Failed to create consumers for producers", { producers: c });
24092
24119
  const d = c.filter(({ errorCode: l, producerId: p }) => l === "not_found_track_error" ? (this.logger.error(`Track not found for producer: ${p}. This will not be retried.`), !1) : l === "backend_error" ? (this.logger.error("Unrecoverable error: backend error"), !1) : !0);
24093
24120
  f(this, ir, n(this, ir).concat(d)), f(this, Ca, setTimeout(
@@ -24112,15 +24139,15 @@ Bi = new WeakMap(), Wr = new WeakMap(), Pa = new WeakMap(), pc = new WeakMap(),
24112
24139
  }
24113
24140
  }
24114
24141
  });
24115
- }, nl = new WeakSet(), hS = function(e) {
24142
+ }, al = new WeakSet(), hS = function(e) {
24116
24143
  return n(this, pc).create(e);
24117
- }, al = new WeakSet(), pS = function(e, r) {
24144
+ }, ol = new WeakSet(), pS = function(e, r) {
24118
24145
  e.on("close", (i, a) => u(this, null, function* () {
24119
24146
  const { offer: o, reason: c } = i;
24120
24147
  if (this.logger.info("producer::closing", {
24121
24148
  debuggingHint: c,
24122
24149
  producer: H(D({}, e), { status: "closing" })
24123
- }), c !== Ad) {
24150
+ }), c !== Md) {
24124
24151
  const d = {
24125
24152
  producerId: e.id,
24126
24153
  description: {
@@ -24143,7 +24170,7 @@ Bi = new WeakMap(), Wr = new WeakMap(), Pa = new WeakMap(), pc = new WeakMap(),
24143
24170
  })), e.on("trackended", () => {
24144
24171
  this.logger.info("producer::trackended", { producer: H(D({}, e), { status: "UNKNOWN" }) });
24145
24172
  }), n(this, Bi).set(e.id, e);
24146
- }, ol = new WeakSet(), gS = function(e) {
24173
+ }, cl = new WeakSet(), gS = function(e) {
24147
24174
  return u(this, null, function* () {
24148
24175
  try {
24149
24176
  return yield this.recvTransport.canConsume(), yield n(this, Us).create(e);
@@ -24151,7 +24178,7 @@ Bi = new WeakMap(), Wr = new WeakMap(), Pa = new WeakMap(), pc = new WeakMap(),
24151
24178
  throw this.logger.error("Error in consume request", { error: r }), r;
24152
24179
  }
24153
24180
  });
24154
- }, cl = new WeakSet(), mS = function(e) {
24181
+ }, dl = new WeakSet(), mS = function(e) {
24155
24182
  e.on("close", (r) => u(this, null, function* () {
24156
24183
  this.logger.debug("consumer closed", {
24157
24184
  consumer: {
@@ -24167,8 +24194,8 @@ Bi = new WeakMap(), Wr = new WeakMap(), Pa = new WeakMap(), pc = new WeakMap(),
24167
24194
  peerId: e.peerId
24168
24195
  });
24169
24196
  };
24170
- var mc, fc, Sc, wa, Ra, ba, vc, Tc, ka, Rt, vs, Ts, Hi, qi, nr, yc, dl, fS, ll, SS, ul, vS, hl, TS;
24171
- const pl = class {
24197
+ var mc, fc, Sc, wa, Ra, ba, vc, Tc, ka, Rt, vs, Ts, Hi, qi, nr, yc, ll, fS, ul, SS, hl, vS, pl, TS;
24198
+ const gl = class {
24172
24199
  constructor({
24173
24200
  initialEnergyThreshold: t = 0.015,
24174
24201
  zeroCrossingThreshold: e = 20,
@@ -24184,11 +24211,11 @@ const pl = class {
24184
24211
  /**
24185
24212
  * Update the energy threshold based on current noise conditions
24186
24213
  */
24187
- m(this, dl);
24214
+ m(this, ll);
24188
24215
  /**
24189
24216
  * Update the background noise estimate
24190
24217
  */
24191
- m(this, ll);
24218
+ m(this, ul);
24192
24219
  // Core VAD parameters
24193
24220
  m(this, mc, void 0);
24194
24221
  m(this, fc, void 0);
@@ -24221,8 +24248,8 @@ const pl = class {
24221
24248
  */
24222
24249
  processAudioChunk(t) {
24223
24250
  var o, c;
24224
- const e = x(o = pl, ul, vS).call(o, t), r = x(c = pl, hl, TS).call(c, t);
24225
- return x(this, dl, fS).call(this, e), e / n(this, vs) > n(this, ka) && e > n(this, Rt) && r > n(this, mc) ? (f(this, Hi, n(this, Hi) + 1), f(this, qi, n(this, Sc)), n(this, Hi) >= n(this, fc) && f(this, Ts, !0)) : (f(this, Hi, 0), n(this, qi) > 0 ? f(this, qi, n(this, qi) - 1) : n(this, Ts) && f(this, Ts, !1), n(this, Ts) || x(this, ll, SS).call(this, e)), { energy: e, isVoice: n(this, Ts) };
24251
+ const e = x(o = gl, hl, vS).call(o, t), r = x(c = gl, pl, TS).call(c, t);
24252
+ return x(this, ll, fS).call(this, e), e / n(this, vs) > n(this, ka) && e > n(this, Rt) && r > n(this, mc) ? (f(this, Hi, n(this, Hi) + 1), f(this, qi, n(this, Sc)), n(this, Hi) >= n(this, fc) && f(this, Ts, !0)) : (f(this, Hi, 0), n(this, qi) > 0 ? f(this, qi, n(this, qi) - 1) : n(this, Ts) && f(this, Ts, !1), n(this, Ts) || x(this, ul, SS).call(this, e)), { energy: e, isVoice: n(this, Ts) };
24226
24253
  }
24227
24254
  /**
24228
24255
  * Reset the detector state
@@ -24241,29 +24268,29 @@ const pl = class {
24241
24268
  };
24242
24269
  }
24243
24270
  };
24244
- let mo = pl;
24245
- mc = new WeakMap(), fc = new WeakMap(), Sc = new WeakMap(), wa = new WeakMap(), Ra = new WeakMap(), ba = new WeakMap(), vc = new WeakMap(), Tc = new WeakMap(), ka = new WeakMap(), Rt = new WeakMap(), vs = new WeakMap(), Ts = new WeakMap(), Hi = new WeakMap(), qi = new WeakMap(), nr = new WeakMap(), yc = new WeakMap(), dl = new WeakSet(), fS = function(t) {
24271
+ let mo = gl;
24272
+ mc = new WeakMap(), fc = new WeakMap(), Sc = new WeakMap(), wa = new WeakMap(), Ra = new WeakMap(), ba = new WeakMap(), vc = new WeakMap(), Tc = new WeakMap(), ka = new WeakMap(), Rt = new WeakMap(), vs = new WeakMap(), Ts = new WeakMap(), Hi = new WeakMap(), qi = new WeakMap(), nr = new WeakMap(), yc = new WeakMap(), ll = new WeakSet(), fS = function(t) {
24246
24273
  n(this, Ts) ? f(this, Rt, n(this, ba) * n(this, Rt) + (1 - n(this, ba)) * t) : f(this, Rt, n(this, Ra) * n(this, Rt) + (1 - n(this, Ra)) * n(this, vs)), f(this, Rt, Math.max(
24247
24274
  n(this, vc),
24248
24275
  Math.min(n(this, Tc), n(this, Rt))
24249
24276
  ));
24250
- }, ll = new WeakSet(), SS = function(t) {
24277
+ }, ul = new WeakSet(), SS = function(t) {
24251
24278
  if (t < n(this, Rt) * 1.2)
24252
24279
  if (n(this, nr).push(t), n(this, nr).length > n(this, yc) && n(this, nr).shift(), n(this, nr).length >= 10) {
24253
24280
  const e = [...n(this, nr)].sort((i, a) => i - a), r = Math.floor(e.length / 2);
24254
24281
  f(this, vs, e[r]);
24255
24282
  } else
24256
24283
  f(this, vs, 0.95 * n(this, vs) + 0.05 * t);
24257
- }, ul = new WeakSet(), vS = function(t) {
24284
+ }, hl = new WeakSet(), vS = function(t) {
24258
24285
  return Math.sqrt(
24259
24286
  t.map((e) => e * e).reduce((e, r) => e + r) / t.length
24260
24287
  );
24261
- }, hl = new WeakSet(), TS = function(t) {
24288
+ }, pl = new WeakSet(), TS = function(t) {
24262
24289
  let e = 0;
24263
24290
  for (let r = 1; r < t.length; r += 1)
24264
24291
  (t[r] >= 0 && t[r - 1] < 0 || t[r] < 0 && t[r - 1] >= 0) && (e += 1);
24265
24292
  return e;
24266
- }, m(mo, ul), m(mo, hl);
24293
+ }, m(mo, hl), m(mo, pl);
24267
24294
  var Ec;
24268
24295
  class yg {
24269
24296
  constructor(t) {
@@ -24341,11 +24368,11 @@ class tO {
24341
24368
  }
24342
24369
  }
24343
24370
  const sO = 60, rO = 400;
24344
- var ar, or, ys, Pc, ji, Ia, cr, Jr, Aa, dr, lr, $s, gl, yS, Cc, sh, ml, ES, fl, _S;
24371
+ var ar, or, ys, Pc, ji, Ia, cr, Jr, Aa, dr, lr, $s, ml, yS, Cc, sh, fl, ES, Sl, _S;
24345
24372
  const Ro = class {
24346
24373
  constructor(t, e) {
24347
- m(this, gl);
24348
24374
  m(this, ml);
24375
+ m(this, fl);
24349
24376
  m(this, ar, void 0);
24350
24377
  m(this, or, void 0);
24351
24378
  m(this, ys, void 0);
@@ -24380,11 +24407,11 @@ const Ro = class {
24380
24407
  var i;
24381
24408
  if (!n(this, Pc) || !n(this, ys))
24382
24409
  return;
24383
- const { energy: t } = x(this, gl, yS).call(this), e = x(i = Ro, Cc, sh).call(i, t);
24410
+ const { energy: t } = x(this, ml, yS).call(this), e = x(i = Ro, Cc, sh).call(i, t);
24384
24411
  let r = 0.9;
24385
24412
  n(this, Aa) !== e && n(this, Aa) ? r = 0.9 : e ? r = 0.3 : r = 0.5, f(this, ji, (n(this, ji) || 0) * (1 - r) + t * r);
24386
24413
  }), sO)), n(this, or) && n(this, $s).clearInterval(n(this, or)), f(this, or, n(this, $s).setInterval(
24387
- x(this, ml, ES).bind(this),
24414
+ x(this, fl, ES).bind(this),
24388
24415
  rO
24389
24416
  ));
24390
24417
  }
@@ -24397,9 +24424,9 @@ const Ro = class {
24397
24424
  }
24398
24425
  };
24399
24426
  let fo = Ro;
24400
- ar = new WeakMap(), or = new WeakMap(), ys = new WeakMap(), Pc = new WeakMap(), ji = new WeakMap(), Ia = new WeakMap(), cr = new WeakMap(), Jr = new WeakMap(), Aa = new WeakMap(), dr = new WeakMap(), lr = new WeakMap(), $s = new WeakMap(), gl = new WeakSet(), yS = function() {
24427
+ ar = new WeakMap(), or = new WeakMap(), ys = new WeakMap(), Pc = new WeakMap(), ji = new WeakMap(), Ia = new WeakMap(), cr = new WeakMap(), Jr = new WeakMap(), Aa = new WeakMap(), dr = new WeakMap(), lr = new WeakMap(), $s = new WeakMap(), ml = new WeakSet(), yS = function() {
24401
24428
  var o;
24402
- const { samples: t } = n(this, lr), { energy: e, isVoice: r } = n(this, Ia).processAudioChunk(t), i = x(o = Ro, fl, _S).call(o, e);
24429
+ const { samples: t } = n(this, lr), { energy: e, isVoice: r } = n(this, Ia).processAudioChunk(t), i = x(o = Ro, Sl, _S).call(o, e);
24403
24430
  return n(this, dr).getValue("flagsmith").hasFeature(ee.ENABLE_AUDIO_ACTIVITY_DEBUG_LOGS) && this.logger.debug(
24404
24431
  `AudioActivityReporter: producer: ${n(this, ys)}, energy: ${n(this, ji)},
24405
24432
  slogScale: ${i}, isVoice: ${r}, minEnergy: ${n(this, cr)},
@@ -24407,7 +24434,7 @@ ar = new WeakMap(), or = new WeakMap(), ys = new WeakMap(), Pc = new WeakMap(),
24407
24434
  ), i === -1 / 0 || e < 1e-6 ? { energy: 0, isVoice: !1 } : ((!n(this, cr) || i < n(this, cr)) && f(this, cr, i), (!n(this, Jr) || i > n(this, Jr)) && f(this, Jr, i), { energy: (i - n(this, cr)) / (n(this, Jr) - n(this, cr)) * 10 || 0, isVoice: r });
24408
24435
  }, Cc = new WeakSet(), sh = function(t) {
24409
24436
  return t < 5;
24410
- }, ml = new WeakSet(), ES = function(t = n(this, ji)) {
24437
+ }, fl = new WeakSet(), ES = function(t = n(this, ji)) {
24411
24438
  var r;
24412
24439
  if (!n(this, ys) || !t) {
24413
24440
  n(this, dr).getValue("flagsmith").hasFeature(ee.ENABLE_AUDIO_ACTIVITY_DEBUG_LOGS) && this.logger.debug(`AudioActivityReporter: No producerId or energy to report: ${n(this, ys)}`);
@@ -24419,10 +24446,10 @@ ar = new WeakMap(), or = new WeakMap(), ys = new WeakMap(), Pc = new WeakMap(),
24419
24446
  silent: x(r = Ro, Cc, sh).call(r, t)
24420
24447
  };
24421
24448
  f(this, Aa, e.silent), this.reportRequest(e);
24422
- }, fl = new WeakSet(), _S = function(t) {
24449
+ }, Sl = new WeakSet(), _S = function(t) {
24423
24450
  const e = Math.log10(t);
24424
24451
  return Math.round(e);
24425
- }, m(fo, Cc), m(fo, fl);
24452
+ }, m(fo, Cc), m(fo, Sl);
24426
24453
  const iO = (s = !1) => {
24427
24454
  if ("MediaStreamTrackGenerator" in window && "AudioData" in window)
24428
24455
  try {
@@ -24484,33 +24511,33 @@ var aO = Object.defineProperty, oO = Object.getOwnPropertyDescriptor, de = (s, t
24484
24511
  return r && i && aO(t, e, i), i;
24485
24512
  };
24486
24513
  const Ot = ["video/VP9", "video/VP8"];
24487
- var wc, Rc, ct, W, Ma, vt, Gi, Wi, Ji, bc, rs, ur, kc, Ki, zi, Tt, bt, Kr, yn, Sl, CS, vl, wS, Tl, RS, Ic, rh, yl, mu, bS, El, kS, _l, IS, Pl, AS, Ze, pt, Yi, So, Cl, MS, wl, DS, Rl, OS;
24488
- const PS = (mu = class {
24514
+ var wc, Rc, ct, W, Ma, vt, Gi, Wi, Ji, bc, is, ur, kc, Ki, zi, Tt, bt, Kr, yn, vl, CS, Tl, wS, yl, RS, Ic, rh, El, fu, bS, _l, kS, Pl, IS, Cl, AS, Ze, pt, Yi, So, wl, MS, Rl, DS, bl, OS;
24515
+ const PS = (fu = class {
24489
24516
  constructor(s, t) {
24490
24517
  m(this, Kr);
24491
24518
  /**
24492
24519
  * Wait for the transports to be established and notify join room completion
24493
24520
  */
24494
- m(this, Sl);
24495
24521
  m(this, vl);
24522
+ m(this, Tl);
24496
24523
  /**
24497
24524
  * Reports room joined analytics to call stats
24498
24525
  * @param roomUuid - The UUID of the room
24499
24526
  */
24500
- m(this, Tl);
24527
+ m(this, yl);
24501
24528
  /**
24502
24529
  * Initializes the connection to the SFU by establishing
24503
24530
  * a socket connection and setting up transports.
24504
24531
  */
24505
24532
  m(this, Ic);
24506
- m(this, El);
24507
24533
  m(this, _l);
24508
24534
  m(this, Pl);
24535
+ m(this, Cl);
24509
24536
  m(this, Ze);
24510
24537
  m(this, Yi);
24511
- m(this, Cl);
24512
24538
  m(this, wl);
24513
24539
  m(this, Rl);
24540
+ m(this, bl);
24514
24541
  h(this, "context");
24515
24542
  h(this, "authToken");
24516
24543
  h(this, "e2ee");
@@ -24524,7 +24551,7 @@ const PS = (mu = class {
24524
24551
  m(this, Wi, void 0);
24525
24552
  m(this, Ji, void 0);
24526
24553
  m(this, bc, void 0);
24527
- m(this, rs, null);
24554
+ m(this, is, null);
24528
24555
  m(this, ur, void 0);
24529
24556
  m(this, kc, void 0);
24530
24557
  // NOTE(roerohan): If a peer ID is present in a set corresponding
@@ -24588,14 +24615,14 @@ const PS = (mu = class {
24588
24615
  n(this, Kr, yn).mediaJoined = s;
24589
24616
  }
24590
24617
  reset() {
24591
- n(this, W).closeAllProducers(), n(this, W).closeAllConsumers(), n(this, Tt).clear(), n(this, ur).clear(), f(this, rs, null), n(this, Ji).stop(), n(this, W).stopAllTransports(), n(this, W).reset(), f(this, Ji, new Ku());
24618
+ n(this, W).closeAllProducers(), n(this, W).closeAllConsumers(), n(this, Tt).clear(), n(this, ur).clear(), f(this, is, null), n(this, Ji).stop(), n(this, W).stopAllTransports(), n(this, W).reset(), f(this, Ji, new Ku());
24592
24619
  }
24593
24620
  joinRoom(a, o) {
24594
24621
  return u(this, arguments, function* (s, t, e = !1, r = !1, i = {}) {
24595
24622
  n(this, Kr, yn).mediaJoinAttempted = !0, f(this, Gi, !0), e && this.reset();
24596
24623
  try {
24597
24624
  return yield n(this, Ji).push(
24598
- () => x(this, Sl, CS).call(this, s, t, r, i),
24625
+ () => x(this, vl, CS).call(this, s, t, r, i),
24599
24626
  "joinRoom"
24600
24627
  );
24601
24628
  } catch (c) {
@@ -24610,13 +24637,13 @@ const PS = (mu = class {
24610
24637
  */
24611
24638
  initializeConnection(i, a) {
24612
24639
  return u(this, arguments, function* (s, t, e = !1, r = {}) {
24613
- return n(this, rs) ? n(this, rs) : (f(this, rs, (() => u(this, null, function* () {
24640
+ return n(this, is) ? n(this, is) : (f(this, is, (() => u(this, null, function* () {
24614
24641
  try {
24615
24642
  yield x(this, Ic, rh).call(this, s, t, e, r);
24616
24643
  } catch (o) {
24617
- throw f(this, rs, null), o;
24644
+ throw f(this, is, null), o;
24618
24645
  }
24619
- }))()), n(this, rs));
24646
+ }))()), n(this, is));
24620
24647
  });
24621
24648
  }
24622
24649
  getConsumers() {
@@ -24681,7 +24708,7 @@ const PS = (mu = class {
24681
24708
  }
24682
24709
  return this._shareWebcam(s, t);
24683
24710
  }
24684
- const i = [t].concat(Ot.filter((v) => v !== t)), a = x(this, Rl, OS).call(this, s, i), o = La(this.context, "disableSimulcast"), c = (S = (g = this.context) == null ? void 0 : g.getValue("overrides")) == null ? void 0 : S.simulcastConfig;
24711
+ const i = [t].concat(Ot.filter((v) => v !== t)), a = x(this, bl, OS).call(this, s, i), o = La(this.context, "disableSimulcast"), c = (S = (g = this.context) == null ? void 0 : g.getValue("overrides")) == null ? void 0 : S.simulcastConfig;
24685
24712
  !(o || c && c.disable) && this.context.getValue("flagsmith").hasFeature(ee.ENABLE_CF_SIMULCAST) ? (this.logger.info("Simulcast enabled for SFU: CF"), a.encodings = W0(this.context, s)) : this.logger.info("Simulcast disabled for webcam producer, SFU: CF"), this.context.getValue("flagsmith").hasFeature(ee.TRACK_HINT) && (a.track.contentHint = this.context.getValue("flagsmith").getValue(
24686
24713
  ee.TRACK_HINT
24687
24714
  ));
@@ -24780,7 +24807,7 @@ const PS = (mu = class {
24780
24807
  yield this.shareMic(s);
24781
24808
  return;
24782
24809
  }
24783
- const e = x(this, wl, DS).call(this, s), r = () => {
24810
+ const e = x(this, Rl, DS).call(this, s), r = () => {
24784
24811
  n(this, Tt).delete(he.MIC);
24785
24812
  }, i = n(this, W).createProducer(
24786
24813
  e,
@@ -24884,7 +24911,7 @@ const PS = (mu = class {
24884
24911
  disableWebcam(s) {
24885
24912
  return u(this, null, function* () {
24886
24913
  const t = s === "video/VP9" ? he.WEBCAM : he.WEBCAM_BACKUP, e = yield x(this, Ze, pt).call(this, t);
24887
- x(this, Cl, MS).call(this, t), e && (yield n(this, W).closeProducer(e));
24914
+ x(this, wl, MS).call(this, t), e && (yield n(this, W).closeProducer(e));
24888
24915
  });
24889
24916
  }
24890
24917
  disableMic() {
@@ -25077,7 +25104,7 @@ const PS = (mu = class {
25077
25104
  ), n(this, ct).on(n(this, vt).peerLeaveBroadcast, ({ payload: s }) => {
25078
25105
  if (this.mediaJoined)
25079
25106
  try {
25080
- const { participantId: t } = bu.fromBinary(s);
25107
+ const { participantId: t } = ku.fromBinary(s);
25081
25108
  if (t === this.peerId)
25082
25109
  return;
25083
25110
  this.logger.info(`peer left broadcast:${t}`), n(this, ur).delete(t), n(this, W).consumers.forEach(
@@ -25190,20 +25217,20 @@ const PS = (mu = class {
25190
25217
  t.delete(s), !(t.size !== 0 || e === Ot[0]) && this.disableWebcam(e);
25191
25218
  }));
25192
25219
  }
25193
- }, wc = new WeakMap(), Rc = new WeakMap(), ct = new WeakMap(), W = new WeakMap(), Ma = new WeakMap(), vt = new WeakMap(), Gi = new WeakMap(), Wi = new WeakMap(), Ji = new WeakMap(), bc = new WeakMap(), rs = new WeakMap(), ur = new WeakMap(), kc = new WeakMap(), Ki = new WeakMap(), zi = new WeakMap(), Tt = new WeakMap(), bt = new WeakMap(), Kr = new WeakSet(), yn = function() {
25220
+ }, wc = new WeakMap(), Rc = new WeakMap(), ct = new WeakMap(), W = new WeakMap(), Ma = new WeakMap(), vt = new WeakMap(), Gi = new WeakMap(), Wi = new WeakMap(), Ji = new WeakMap(), bc = new WeakMap(), is = new WeakMap(), ur = new WeakMap(), kc = new WeakMap(), Ki = new WeakMap(), zi = new WeakMap(), Tt = new WeakMap(), bt = new WeakMap(), Kr = new WeakSet(), yn = function() {
25194
25221
  return this.context.getValue("connectionHandler");
25195
- }, Sl = new WeakSet(), CS = function(s, t, e, r) {
25222
+ }, vl = new WeakSet(), CS = function(s, t, e, r) {
25196
25223
  return u(this, null, function* () {
25197
25224
  f(this, Rc, s);
25198
25225
  try {
25199
- return n(this, rs) ? yield n(this, rs) : yield x(this, Ic, rh).call(this, s, t, e, r), x(this, Tl, RS).call(this, t), { roomJoined: yield x(this, vl, wS).call(this) };
25226
+ return n(this, is) ? yield n(this, is) : yield x(this, Ic, rh).call(this, s, t, e, r), x(this, yl, RS).call(this, t), { roomJoined: yield x(this, Tl, wS).call(this) };
25200
25227
  } catch (i) {
25201
25228
  return this.logger.error("Failed to complete room join", { error: i }), { roomJoined: !1 };
25202
25229
  } finally {
25203
- f(this, rs, null);
25230
+ f(this, is, null);
25204
25231
  }
25205
25232
  });
25206
- }, vl = new WeakSet(), wS = function() {
25233
+ }, Tl = new WeakSet(), wS = function() {
25207
25234
  return u(this, null, function* () {
25208
25235
  try {
25209
25236
  this.mediaJoined = !0;
@@ -25213,7 +25240,7 @@ const PS = (mu = class {
25213
25240
  return this.logger.error("Error completing room join", { error: s }), this.mediaJoined = !1, !1;
25214
25241
  }
25215
25242
  });
25216
- }, Tl = new WeakSet(), RS = function(s) {
25243
+ }, yl = new WeakSet(), RS = function(s) {
25217
25244
  navigator.product !== "ReactNative" && setTimeout(() => {
25218
25245
  try {
25219
25246
  const e = {
@@ -25240,24 +25267,24 @@ const PS = (mu = class {
25240
25267
  return u(this, null, function* () {
25241
25268
  var i, a;
25242
25269
  try {
25243
- (a = n(this, kc)) != null || f(this, kc, x(i = PS, yl, bS).call(i));
25244
- const o = x(this, El, kS).call(this);
25245
- yield x(this, _l, IS).call(this, s, t, e, o), yield n(this, W).setupTransports({ send: !0, recv: !0 }), yield x(this, Pl, AS).call(this, r);
25270
+ (a = n(this, kc)) != null || f(this, kc, x(i = PS, El, bS).call(i));
25271
+ const o = x(this, _l, kS).call(this);
25272
+ yield x(this, Pl, IS).call(this, s, t, e, o), yield n(this, W).setupTransports({ send: !0, recv: !0 }), yield x(this, Cl, AS).call(this, r);
25246
25273
  } catch (o) {
25247
25274
  throw this.logger.error("Failed to initialize connection", { error: o }), o;
25248
25275
  }
25249
25276
  });
25250
- }, yl = new WeakSet(), bS = function() {
25277
+ }, El = new WeakSet(), bS = function() {
25251
25278
  const { ipInfo: s } = dt();
25252
25279
  if (!(s != null && s.loc))
25253
25280
  return;
25254
25281
  const [t, e] = s.loc.split(",").map(parseFloat);
25255
25282
  return { latitude: t, longitude: e };
25256
- }, El = new WeakSet(), kS = function() {
25283
+ }, _l = new WeakSet(), kS = function() {
25257
25284
  var e;
25258
25285
  const s = (e = this.context.getValue("flagsmith").getValue(ee.FORCE_VIDEO_CODEC)) == null ? void 0 : e.toString(), t = HD(s);
25259
25286
  return f(this, Ma, t), t;
25260
- }, _l = new WeakSet(), IS = function(s, t, e, r) {
25287
+ }, Pl = new WeakSet(), IS = function(s, t, e, r) {
25261
25288
  return u(this, null, function* () {
25262
25289
  yield sS(
25263
25290
  (i, a) => u(this, null, function* () {
@@ -25287,7 +25314,7 @@ const PS = (mu = class {
25287
25314
  }
25288
25315
  );
25289
25316
  });
25290
- }, Pl = new WeakSet(), AS = function(s) {
25317
+ }, Cl = new WeakSet(), AS = function(s) {
25291
25318
  return u(this, null, function* () {
25292
25319
  if (!(!this.context.getValue("flagsmith").hasFeature(
25293
25320
  ee.PRECREATE_PRODUCERS
@@ -25307,9 +25334,9 @@ const PS = (mu = class {
25307
25334
  return n(this, Tt).get(s);
25308
25335
  }, Yi = new WeakSet(), So = function(s, t) {
25309
25336
  return n(this, Tt).set(s, t);
25310
- }, Cl = new WeakSet(), MS = function(s) {
25337
+ }, wl = new WeakSet(), MS = function(s) {
25311
25338
  return n(this, Tt).delete(s);
25312
- }, wl = new WeakSet(), DS = function(s) {
25339
+ }, Rl = new WeakSet(), DS = function(s) {
25313
25340
  return {
25314
25341
  track: s,
25315
25342
  encodings: [
@@ -25328,7 +25355,7 @@ const PS = (mu = class {
25328
25355
  stopTracks: !1,
25329
25356
  zeroRtpOnPause: !1
25330
25357
  };
25331
- }, Rl = new WeakSet(), OS = function(s, t) {
25358
+ }, bl = new WeakSet(), OS = function(s, t) {
25332
25359
  return {
25333
25360
  track: s,
25334
25361
  codecOptions: t ? t.map((e) => ({
@@ -25340,7 +25367,7 @@ const PS = (mu = class {
25340
25367
  },
25341
25368
  stopTracks: !1
25342
25369
  };
25343
- }, m(mu, yl), mu);
25370
+ }, m(fu, El), fu);
25344
25371
  let ae = PS;
25345
25372
  de([
25346
25373
  E.trace("MediaNodeClient.reset", { country: E.location.country })
@@ -25797,9 +25824,9 @@ class uO {
25797
25824
  let r, i;
25798
25825
  switch (t) {
25799
25826
  case U.transcript: {
25800
- r = nu.fromBinary.bind(
25801
- nu
25802
- ), i = nu.create();
25827
+ r = au.fromBinary.bind(
25828
+ au
25829
+ ), i = au.create();
25803
25830
  break;
25804
25831
  }
25805
25832
  default: {
@@ -25826,7 +25853,7 @@ var hO = Object.defineProperty, pO = Object.getOwnPropertyDescriptor, Wh = (s, t
25826
25853
  (o = s[a]) && (i = (r ? o(t, e, i) : o(i)) || i);
25827
25854
  return r && i && hO(t, e, i), i;
25828
25855
  }, hr, Da;
25829
- class Wl {
25856
+ class Jl {
25830
25857
  constructor(t, e) {
25831
25858
  m(this, hr, void 0);
25832
25859
  m(this, Da, void 0);
@@ -25877,7 +25904,7 @@ class Wl {
25877
25904
  case Ws.updatePoll:
25878
25905
  case Ws.createPoll:
25879
25906
  case Ws.votePoll: {
25880
- r = uu.fromBinary.bind(uu), i = uu.create();
25907
+ r = hu.fromBinary.bind(hu), i = hu.create();
25881
25908
  break;
25882
25909
  }
25883
25910
  }
@@ -25900,13 +25927,13 @@ class Wl {
25900
25927
  hr = new WeakMap(), Da = new WeakMap();
25901
25928
  Wh([
25902
25929
  E.trace("PollSocketHandler.getPolls")
25903
- ], Wl.prototype, "getPolls", 1);
25930
+ ], Jl.prototype, "getPolls", 1);
25904
25931
  Wh([
25905
25932
  E.trace("PollSocketHandler.createPoll")
25906
- ], Wl.prototype, "createPoll", 1);
25933
+ ], Jl.prototype, "createPoll", 1);
25907
25934
  Wh([
25908
25935
  E.trace("PollSocketHandler.votePoll")
25909
- ], Wl.prototype, "votePoll", 1);
25936
+ ], Jl.prototype, "votePoll", 1);
25910
25937
  var gO = Object.defineProperty, mO = Object.getOwnPropertyDescriptor, fO = (s, t, e, r) => {
25911
25938
  for (var i = r > 1 ? void 0 : r ? mO(t, e) : t, a = s.length - 1, o; a >= 0; a--)
25912
25939
  (o = s[a]) && (i = (r ? o(t, e, i) : o(i)) || i);
@@ -26005,7 +26032,7 @@ class xS {
26005
26032
  U.getRoomPeersInfo,
26006
26033
  Jb.toBinary(a)
26007
26034
  );
26008
- i = au.fromBinary(o.payload);
26035
+ i = ou.fromBinary(o.payload);
26009
26036
  } catch (a) {
26010
26037
  this.logger.error("getRoomPeers::binary_decode_error", { error: a });
26011
26038
  }
@@ -26019,7 +26046,7 @@ class xS {
26019
26046
  const e = yield this.socket.sendMessagePromise(
26020
26047
  U.getRoomPeersInfo
26021
26048
  );
26022
- t = au.fromBinary(e.payload);
26049
+ t = ou.fromBinary(e.payload);
26023
26050
  } catch (e) {
26024
26051
  this.logger.error("getRoomJoinedPeers::binary_decode_error", { error: e });
26025
26052
  }
@@ -26037,7 +26064,7 @@ class xS {
26037
26064
  const e = yield this.socket.sendMessagePromise(
26038
26065
  U.getRoomPeersInfo
26039
26066
  );
26040
- t = au.fromBinary(e.payload);
26067
+ t = ou.fromBinary(e.payload);
26041
26068
  } catch (e) {
26042
26069
  this.logger.error("getRoomJoinedPeers::binary_decode_error", { error: e });
26043
26070
  }
@@ -26255,7 +26282,7 @@ class xS {
26255
26282
  }
26256
26283
  case Cs.selfJoinComplete:
26257
26284
  case Ar.selfJoinComplete: {
26258
- r = Ru.fromBinary.bind(Ru);
26285
+ r = bu.fromBinary.bind(bu);
26259
26286
  break;
26260
26287
  }
26261
26288
  case Cs.globalPeerPinBroadcast:
@@ -26265,7 +26292,7 @@ class xS {
26265
26292
  }
26266
26293
  case Cs.selectedPeer:
26267
26294
  case Ar.selectedPeer: {
26268
- r = wu.fromBinary.bind(wu);
26295
+ r = Ru.fromBinary.bind(Ru);
26269
26296
  break;
26270
26297
  }
26271
26298
  case Cs.selectedPeerDiff:
@@ -26275,7 +26302,7 @@ class xS {
26275
26302
  }
26276
26303
  case Cs.leaveRoom:
26277
26304
  case Ar.leaveRoom: {
26278
- r = bu.fromBinary.bind(bu);
26305
+ r = ku.fromBinary.bind(ku);
26279
26306
  break;
26280
26307
  }
26281
26308
  }
@@ -26325,7 +26352,7 @@ class SO {
26325
26352
  const { payload: t } = yield n(this, kt).sendMessagePromise(
26326
26353
  U.getStageRequests
26327
26354
  );
26328
- return t ? lu.fromBinary(t) : { stageRequests: [] };
26355
+ return t ? uu.fromBinary(t) : { stageRequests: [] };
26329
26356
  });
26330
26357
  }
26331
26358
  requestAccess() {
@@ -26401,8 +26428,8 @@ class SO {
26401
26428
  case U.getStageRequests:
26402
26429
  case U.requestStageAccess:
26403
26430
  case U.cancelStageRequest: {
26404
- r = lu.fromBinary.bind(
26405
- lu
26431
+ r = uu.fromBinary.bind(
26432
+ uu
26406
26433
  );
26407
26434
  break;
26408
26435
  }
@@ -26594,7 +26621,7 @@ class vO {
26594
26621
  case J.addPlugin:
26595
26622
  case J.enablePluginForPeers:
26596
26623
  case J.enablePluginForRoom: {
26597
- r = Mu.fromBinary.bind(Mu);
26624
+ r = Du.fromBinary.bind(Du);
26598
26625
  break;
26599
26626
  }
26600
26627
  case J.removePlugin:
@@ -26632,12 +26659,12 @@ var TO = Object.defineProperty, yO = (s, t, e) => t in s ? TO(s, t, { enumerable
26632
26659
  if (t.has(s))
26633
26660
  throw TypeError("Cannot add the same private member more than once");
26634
26661
  t instanceof WeakSet ? t.add(s) : t.set(s, e);
26635
- }, ne = (s, t, e, r) => (Jh(s, t, "write to private field"), r ? r.call(s, e) : t.set(s, e), e), Pe = (s, t, e) => (Jh(s, t, "access private method"), e), Md = {}, _O = {
26662
+ }, ne = (s, t, e, r) => (Jh(s, t, "write to private field"), r ? r.call(s, e) : t.set(s, e), e), Pe = (s, t, e) => (Jh(s, t, "access private method"), e), Dd = {}, _O = {
26636
26663
  get exports() {
26637
- return Md;
26664
+ return Dd;
26638
26665
  },
26639
26666
  set exports(s) {
26640
- Md = s;
26667
+ Dd = s;
26641
26668
  }
26642
26669
  }, Mn = typeof Reflect == "object" ? Reflect : null, _g = Mn && typeof Mn.apply == "function" ? Mn.apply : function(s, t, e) {
26643
26670
  return Function.prototype.apply.call(s, t, e);
@@ -26657,13 +26684,13 @@ function ce() {
26657
26684
  ce.init.call(this);
26658
26685
  }
26659
26686
  _O.exports = ce;
26660
- Md.once = bO;
26687
+ Dd.once = bO;
26661
26688
  ce.EventEmitter = ce;
26662
26689
  ce.prototype._events = void 0;
26663
26690
  ce.prototype._eventsCount = 0;
26664
26691
  ce.prototype._maxListeners = void 0;
26665
26692
  var Pg = 10;
26666
- function Jl(s) {
26693
+ function Kl(s) {
26667
26694
  if (typeof s != "function")
26668
26695
  throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof s);
26669
26696
  }
@@ -26719,7 +26746,7 @@ ce.prototype.emit = function(s) {
26719
26746
  };
26720
26747
  function FS(s, t, e, r) {
26721
26748
  var i, a, o;
26722
- if (Jl(e), a = s._events, a === void 0 ? (a = s._events = /* @__PURE__ */ Object.create(null), s._eventsCount = 0) : (a.newListener !== void 0 && (s.emit(
26749
+ if (Kl(e), a = s._events, a === void 0 ? (a = s._events = /* @__PURE__ */ Object.create(null), s._eventsCount = 0) : (a.newListener !== void 0 && (s.emit(
26723
26750
  "newListener",
26724
26751
  t,
26725
26752
  e.listener ? e.listener : e
@@ -26748,14 +26775,14 @@ function BS(s, t, e) {
26748
26775
  return i.listener = e, r.wrapFn = i, i;
26749
26776
  }
26750
26777
  ce.prototype.once = function(s, t) {
26751
- return Jl(t), this.on(s, BS(this, s, t)), this;
26778
+ return Kl(t), this.on(s, BS(this, s, t)), this;
26752
26779
  };
26753
26780
  ce.prototype.prependOnceListener = function(s, t) {
26754
- return Jl(t), this.prependListener(s, BS(this, s, t)), this;
26781
+ return Kl(t), this.prependListener(s, BS(this, s, t)), this;
26755
26782
  };
26756
26783
  ce.prototype.removeListener = function(s, t) {
26757
26784
  var e, r, i, a, o;
26758
- if (Jl(t), r = this._events, r === void 0)
26785
+ if (Kl(t), r = this._events, r === void 0)
26759
26786
  return this;
26760
26787
  if (e = r[s], e === void 0)
26761
26788
  return this;
@@ -26965,13 +26992,13 @@ class DO {
26965
26992
  di = /* @__PURE__ */ new WeakMap(), li = /* @__PURE__ */ new WeakMap();
26966
26993
  var JS = /* @__PURE__ */ ((s) => (s[s.CONNECTING = 0] = "CONNECTING", s[s.OPEN = 1] = "OPEN", s[s.CLOSING = 2] = "CLOSING", s[s.CLOSED = 3] = "CLOSED", s))(JS || {});
26967
26994
  const OO = "2", NO = "3";
26968
- var Ae, En, _e, Le, Ir, Ke, gr, Xr, Ps, _n, Gs, ih, KS, vo, vd, nh, zS, ah, wg, Dd, oh, ch, YS, _o, Td, Po, Od, Nd, dh, Dn, Co, wo, Vd;
26995
+ var Ae, En, _e, Le, Ir, Ke, gr, Xr, Ps, _n, Gs, ih, KS, vo, vd, nh, zS, ah, wg, Od, oh, ch, YS, _o, Td, Po, Nd, Vd, dh, Dn, Co, wo, Ld;
26969
26996
  class VO {
26970
26997
  constructor(t, e) {
26971
26998
  var S, v, _, P, C, w, $, F, N, B;
26972
- Se(this, ih), Se(this, vo), Se(this, nh), Se(this, ah), Se(this, Dd), Se(this, ch), Se(this, _o), Se(this, Po), Se(this, Nd), Se(this, Dn), Se(this, wo), Se(this, Ae, void 0), Se(this, En, void 0), Se(this, _e, void 0), Se(this, Le, void 0), Se(this, Ir, void 0), Se(this, Ke, void 0), Se(this, gr, void 0), Se(this, Xr, void 0), Se(this, Ps, void 0), Se(this, _n, void 0), Se(this, Gs, void 0);
26999
+ Se(this, ih), Se(this, vo), Se(this, nh), Se(this, ah), Se(this, Od), Se(this, ch), Se(this, _o), Se(this, Po), Se(this, Vd), Se(this, Dn), Se(this, wo), Se(this, Ae, void 0), Se(this, En, void 0), Se(this, _e, void 0), Se(this, Le, void 0), Se(this, Ir, void 0), Se(this, Ke, void 0), Se(this, gr, void 0), Se(this, Xr, void 0), Se(this, Ps, void 0), Se(this, _n, void 0), Se(this, Gs, void 0);
26973
27000
  var r, i, a, o, c, d, l, p, g;
26974
- ne(this, En, t), ne(this, Ir, []), ne(this, Ke, new Md()), ne(this, gr, !0), ne(this, Ps, !1), ne(this, _e, e != null ? e : {}), (S = (r = M(this, _e)).autoReconnect) != null || (r.autoReconnect = !0), (v = (i = M(this, _e)).retryConnectionInterval) != null || (i.retryConnectionInterval = 1e3), (_ = (a = M(this, _e)).pingTimeout) != null || (a.pingTimeout = 3e4), (P = (o = M(this, _e)).connectionTimeout) != null || (o.connectionTimeout = 5e3), (C = (c = M(this, _e)).debug) != null || (c.debug = !0), (w = (d = M(this, _e)).maxReconnectionAttempts) != null || (d.maxReconnectionAttempts = 10), ($ = (l = M(this, _e)).disconnectOnPingTimeout) != null || (l.disconnectOnPingTimeout = !0), (F = (p = M(this, _e)).queueOnDisconnect) != null || (p.queueOnDisconnect = !1), (N = (g = M(this, _e)).flushOnReconnect) != null || (g.flushOnReconnect = !1), ne(this, Xr, {
27001
+ ne(this, En, t), ne(this, Ir, []), ne(this, Ke, new Dd()), ne(this, gr, !0), ne(this, Ps, !1), ne(this, _e, e != null ? e : {}), (S = (r = M(this, _e)).autoReconnect) != null || (r.autoReconnect = !0), (v = (i = M(this, _e)).retryConnectionInterval) != null || (i.retryConnectionInterval = 1e3), (_ = (a = M(this, _e)).pingTimeout) != null || (a.pingTimeout = 3e4), (P = (o = M(this, _e)).connectionTimeout) != null || (o.connectionTimeout = 5e3), (C = (c = M(this, _e)).debug) != null || (c.debug = !0), (w = (d = M(this, _e)).maxReconnectionAttempts) != null || (d.maxReconnectionAttempts = 10), ($ = (l = M(this, _e)).disconnectOnPingTimeout) != null || (l.disconnectOnPingTimeout = !0), (F = (p = M(this, _e)).queueOnDisconnect) != null || (p.queueOnDisconnect = !1), (N = (g = M(this, _e)).flushOnReconnect) != null || (g.flushOnReconnect = !1), ne(this, Xr, {
26975
27002
  code: void 0,
26976
27003
  reason: void 0
26977
27004
  }), ne(this, Le, (B = M(this, _e).logger) != null ? B : new DO(M(this, _e).debug ? "debug" : "info")), ne(this, Gs, new MO());
@@ -27032,17 +27059,17 @@ class VO {
27032
27059
  }
27033
27060
  if (M(this, gr) !== !1)
27034
27061
  return new Promise((e, r) => {
27035
- Pe(this, Dn, Co).call(this), Pe(this, wo, Vd).call(this);
27062
+ Pe(this, Dn, Co).call(this), Pe(this, wo, Ld).call(this);
27036
27063
  try {
27037
27064
  ne(this, Ae, new WebSocket(Pe(this, ih, KS).call(this, M(this, En)))), M(this, Ae).binaryType = "arraybuffer", M(this, Le).debug("Connecting");
27038
27065
  const i = setTimeout(() => {
27039
- M(this, Le).debug("Connection timeout. Closing socket"), ne(this, gr, !0), Pe(this, wo, Vd).call(this), M(this, Ae).close(3001, "Connection Timeout"), M(this, _e).autoReconnect && !M(this, Ps) && (M(this, Ke).emit(
27066
+ M(this, Le).debug("Connection timeout. Closing socket"), ne(this, gr, !0), Pe(this, wo, Ld).call(this), M(this, Ae).close(3001, "Connection Timeout"), M(this, _e).autoReconnect && !M(this, Ps) && (M(this, Ke).emit(
27040
27067
  "reconnecting"
27041
27068
  /* reconnecting */
27042
27069
  ), Pe(this, _o, Td).call(this)), r(new Error("Connection timed out!"));
27043
27070
  }, M(this, _e).connectionTimeout);
27044
27071
  M(this, Ae).onopen = () => {
27045
- M(this, Le).debug(`Ready State: ${JS[M(this, Ae).readyState]}`), i && clearTimeout(i), Pe(this, Nd, dh).call(this), ne(this, Xr, {
27072
+ M(this, Le).debug(`Ready State: ${JS[M(this, Ae).readyState]}`), i && clearTimeout(i), Pe(this, Vd, dh).call(this), ne(this, Xr, {
27046
27073
  code: void 0,
27047
27074
  reason: void 0
27048
27075
  }), M(this, Ke).emit(
@@ -27053,7 +27080,7 @@ class VO {
27053
27080
  try {
27054
27081
  i && clearTimeout(i);
27055
27082
  const { code: o, reason: c } = a;
27056
- r(c), M(this, Le).debug("Socket closed. Close event:", { event: a }), M(this, Le).debug(`Connection closed code: ${o}`), M(this, Le).debug(`Connection closed reason: ${c}`), M(this, Ps) || Pe(this, Dd, oh).call(this, o, c);
27083
+ r(c), M(this, Le).debug("Socket closed. Close event:", { event: a }), M(this, Le).debug(`Connection closed code: ${o}`), M(this, Le).debug(`Connection closed reason: ${c}`), M(this, Ps) || Pe(this, Od, oh).call(this, o, c);
27057
27084
  } catch (o) {
27058
27085
  Pe(this, vo, vd).call(this, o);
27059
27086
  }
@@ -27075,7 +27102,7 @@ class VO {
27075
27102
  if (M(this, _e).queueOnDisconnect && (!M(this, Ae) || M(this, Ae).readyState !== 1))
27076
27103
  return M(this, Le).debug("Queuing message since socket is not connected!", a), M(this, Ir).push(a), !1;
27077
27104
  const o = WS.encode(a);
27078
- return Pe(this, Po, Od).call(this, o);
27105
+ return Pe(this, Po, Nd).call(this, o);
27079
27106
  }
27080
27107
  /**
27081
27108
  * Alias for `send`.
@@ -27087,7 +27114,7 @@ class VO {
27087
27114
  * Send a raw message to the socket server.
27088
27115
  */
27089
27116
  sendRaw(t) {
27090
- return Pe(this, Po, Od).call(this, t);
27117
+ return Pe(this, Po, Nd).call(this, t);
27091
27118
  }
27092
27119
  /**
27093
27120
  * Alias to `on`.
@@ -27158,15 +27185,15 @@ Ae = /* @__PURE__ */ new WeakMap(), En = /* @__PURE__ */ new WeakMap(), _e = /*
27158
27185
  }, vo = /* @__PURE__ */ new WeakSet(), vd = function(s, t) {
27159
27186
  M(this, Le).error("Error:", { error: s }), M(this, Ke).emit("errored", { error: s }), t == null || t(s);
27160
27187
  }, nh = /* @__PURE__ */ new WeakSet(), zS = function(s) {
27161
- if (Pe(this, Nd, dh).call(this), s.data === OO) {
27162
- M(this, Le).debug("Received ping from server"), Pe(this, Po, Od).call(this, NO);
27188
+ if (Pe(this, Vd, dh).call(this), s.data === OO) {
27189
+ M(this, Le).debug("Received ping from server"), Pe(this, Po, Nd).call(this, NO);
27163
27190
  return;
27164
27191
  }
27165
27192
  const t = WS.decode(s.data), { id: e, payload: r } = t;
27166
27193
  M(this, Le).debug("Received message", { event: t.event, messageID: e }), M(this, Ke).emit(t.event.toString(), { id: e, payload: r });
27167
27194
  }, ah = /* @__PURE__ */ new WeakSet(), wg = function() {
27168
27195
  return M(this, Ae).readyState === 1;
27169
- }, Dd = /* @__PURE__ */ new WeakSet(), oh = function(s, t) {
27196
+ }, Od = /* @__PURE__ */ new WeakSet(), oh = function(s, t) {
27170
27197
  ne(this, Xr, { reason: t, code: s }), M(this, Ke).emit("disconnected", { code: s, reason: t });
27171
27198
  }, ch = /* @__PURE__ */ new WeakSet(), YS = function() {
27172
27199
  const { reason: s, code: t } = M(this, Xr);
@@ -27187,7 +27214,7 @@ Ae = /* @__PURE__ */ new WeakMap(), En = /* @__PURE__ */ new WeakMap(), _e = /*
27187
27214
  ), ne(this, Ps, !1);
27188
27215
  return;
27189
27216
  }
27190
- ne(this, Ps, !0), Pe(this, wo, Vd).call(this), Pe(this, Dn, Co).call(this);
27217
+ ne(this, Ps, !0), Pe(this, wo, Ld).call(this), Pe(this, Dn, Co).call(this);
27191
27218
  try {
27192
27219
  if (yield M(this, Gs).wait(), M(this, gr) === !1)
27193
27220
  return;
@@ -27204,31 +27231,31 @@ Ae = /* @__PURE__ */ new WeakMap(), En = /* @__PURE__ */ new WeakMap(), _e = /*
27204
27231
  M(this, Le).debug("Failed to reconnect."), M(this, Ke).emit("reconnectFailure", { attempt: M(this, Gs).getAttempts() }), Pe(this, _o, Td).call(this, !1);
27205
27232
  }
27206
27233
  });
27207
- }, Po = /* @__PURE__ */ new WeakSet(), Od = function(s) {
27234
+ }, Po = /* @__PURE__ */ new WeakSet(), Nd = function(s) {
27208
27235
  try {
27209
27236
  return M(this, Ae).send(s), !0;
27210
27237
  } catch (t) {
27211
27238
  return M(this, Le).error(t.message), !1;
27212
27239
  }
27213
- }, Nd = /* @__PURE__ */ new WeakSet(), dh = function() {
27240
+ }, Vd = /* @__PURE__ */ new WeakSet(), dh = function() {
27214
27241
  this.config.disconnectOnPingTimeout && (M(this, Le).debug("Resetting ping timeout"), Pe(this, Dn, Co).call(this), ne(this, _n, setTimeout(() => {
27215
27242
  var s;
27216
27243
  M(this, Le).debug("Disconnecting the socket due to ping timeout"), ne(this, gr, !0);
27217
27244
  const t = 3002, e = "Ping timeout";
27218
- (s = M(this, Ae)) == null || s.close(t, e), Pe(this, Dd, oh).call(this, t, e);
27245
+ (s = M(this, Ae)) == null || s.close(t, e), Pe(this, Od, oh).call(this, t, e);
27219
27246
  }, M(this, _e).pingTimeout)));
27220
27247
  }, Dn = /* @__PURE__ */ new WeakSet(), Co = function() {
27221
27248
  M(this, _n) && (clearTimeout(M(this, _n)), ne(this, _n, void 0));
27222
- }, wo = /* @__PURE__ */ new WeakSet(), Vd = function() {
27249
+ }, wo = /* @__PURE__ */ new WeakSet(), Ld = function() {
27223
27250
  M(this, Ae) && (M(this, Ae).onopen = void 0, M(this, Ae).onerror = void 0, M(this, Ae).onmessage = void 0, M(this, Ae).onclose = void 0);
27224
27251
  };
27225
- var LO = Object.defineProperty, xO = Object.getOwnPropertyDescriptor, Kl = (s, t, e, r) => {
27252
+ var LO = Object.defineProperty, xO = Object.getOwnPropertyDescriptor, zl = (s, t, e, r) => {
27226
27253
  for (var i = r > 1 ? void 0 : r ? xO(t, e) : t, a = s.length - 1, o; a >= 0; a--)
27227
27254
  (o = s[a]) && (i = (r ? o(t, e, i) : o(i)) || i);
27228
27255
  return r && i && LO(t, e, i), i;
27229
27256
  };
27230
27257
  const Rg = 65535, UO = 3e3;
27231
- var zr, Ce, we, Me, is, et, Nc, lh, Vc, uh, Wg;
27258
+ var zr, Ce, we, Me, ns, et, Nc, lh, Vc, uh, Wg;
27232
27259
  const QS = (Wg = class {
27233
27260
  constructor(s, {
27234
27261
  peerId: t,
@@ -27244,12 +27271,12 @@ const QS = (Wg = class {
27244
27271
  h(this, "roomName");
27245
27272
  h(this, "authToken");
27246
27273
  h(this, "capabilities");
27247
- m(this, is, void 0);
27274
+ m(this, ns, void 0);
27248
27275
  m(this, et, void 0);
27249
27276
  var a;
27250
27277
  if (!t || !e || !r)
27251
27278
  throw new b("peerId, meetingId, or authToken can not be empty", "0404");
27252
- f(this, is, void 0), f(this, et, s), this.capabilities = i, this.roomName = e, this.authToken = r, f(this, zr, x(this, Nc, lh).call(this, t)), f(this, Ce, new VO(n(this, zr), {
27279
+ f(this, ns, void 0), f(this, et, s), this.capabilities = i, this.roomName = e, this.authToken = r, f(this, zr, x(this, Nc, lh).call(this, t)), f(this, Ce, new VO(n(this, zr), {
27253
27280
  autoReconnect: !0,
27254
27281
  disconnectOnPingTimeout: (a = i.includes("PING")) != null ? a : !1,
27255
27282
  queueOnDisconnect: !0,
@@ -27405,7 +27432,7 @@ const QS = (Wg = class {
27405
27432
  }
27406
27433
  handleSocketConnectionEvents() {
27407
27434
  this.onStateEvent("connected", () => u(this, null, function* () {
27408
- this.logger.info("SocketService::Connected to socket-edge"), n(this, is) && (clearTimeout(n(this, is)), f(this, is, void 0)), n(this, we, Me).updateSocketConnectionState("connected");
27435
+ this.logger.info("SocketService::Connected to socket-edge"), n(this, ns) && (clearTimeout(n(this, ns)), f(this, ns, void 0)), n(this, we, Me).updateSocketConnectionState("connected");
27409
27436
  })), this.onStateEvent("disconnected", ({ code: s, reason: t }) => {
27410
27437
  var i;
27411
27438
  this.logger.info("SocketService::Disconnected from socket-edge", { error: { code: s, reason: t }, country: E.location.country });
@@ -27415,11 +27442,11 @@ const QS = (Wg = class {
27415
27442
  {
27416
27443
  joinAttempted: n(this, we, Me).joinAttempted
27417
27444
  }
27418
- ) : f(this, is, setTimeout(() => {
27445
+ ) : f(this, ns, setTimeout(() => {
27419
27446
  n(this, et).getValue("peerSessionStore").emit(
27420
27447
  k.SOCKET_SERVICE_DISCONNECTED,
27421
27448
  { joinAttempted: n(this, we, Me).joinAttempted }
27422
- ), f(this, is, void 0);
27449
+ ), f(this, ns, void 0);
27423
27450
  }, UO)), n(this, we, Me).updateSocketConnectionState("disconnected");
27424
27451
  }), this.onStateEvent("reconnecting", () => u(this, null, function* () {
27425
27452
  this.logger.info("SocketService::Reconnecting to socket-edge", { country: E.location.country }), n(this, we, Me).updateSocketConnectionState("reconnecting");
@@ -27436,7 +27463,7 @@ const QS = (Wg = class {
27436
27463
  }
27437
27464
  }), n(this, we, Me).updateSocketConnectionState("reconnectFailure", s);
27438
27465
  }), this.onStateEvent("reconnected", () => u(this, null, function* () {
27439
- this.logger.info("SocketService::Reconnected to socket-edge", { connectionState: { joinAttempted: n(this, we, Me).mediaJoinAttempted } }), n(this, is) && (clearTimeout(n(this, is)), f(this, is, void 0)), n(this, et).getValue("peerSessionStore").emit(k.SOCKET_SERVICE_RECONNECTED, {
27466
+ this.logger.info("SocketService::Reconnected to socket-edge", { connectionState: { joinAttempted: n(this, we, Me).mediaJoinAttempted } }), n(this, ns) && (clearTimeout(n(this, ns)), f(this, ns, void 0)), n(this, et).getValue("peerSessionStore").emit(k.SOCKET_SERVICE_RECONNECTED, {
27440
27467
  wasJoinAttempted: n(this, we, Me).mediaJoinAttempted
27441
27468
  }), n(this, we, Me).updateSocketConnectionState("reconnected");
27442
27469
  })), this.onStateEvent("failed", () => u(this, null, function* () {
@@ -27445,7 +27472,7 @@ const QS = (Wg = class {
27445
27472
  }
27446
27473
  }, zr = new WeakMap(), Ce = new WeakMap(), we = new WeakSet(), Me = function() {
27447
27474
  return n(this, et).getValue("connectionHandler");
27448
- }, is = new WeakMap(), et = new WeakMap(), Nc = new WeakSet(), lh = function(s) {
27475
+ }, ns = new WeakMap(), et = new WeakMap(), Nc = new WeakSet(), lh = function(s) {
27449
27476
  let t = QS.getSocketEdgeDomain(n(this, et).getValue("baseURI"));
27450
27477
  typeof La(n(this, et), "socket_server_base") == "string" && (t = La(n(this, et), "socket_server_base"));
27451
27478
  const e = `wss://${t}`, r = new URL(`${e}/ws`), i = this.peerId, a = H(D({
@@ -27467,16 +27494,16 @@ const QS = (Wg = class {
27467
27494
  return `${this.peerId}-${(Math.random() + 1).toString(36).substring(7)}`;
27468
27495
  }, Wg);
27469
27496
  let Wc = QS;
27470
- Kl([
27497
+ zl([
27471
27498
  E.trace("SocketService.connect")
27472
27499
  ], Wc.prototype, "connect", 1);
27473
- Kl([
27500
+ zl([
27474
27501
  E.trace("SocketService.disconnect")
27475
27502
  ], Wc.prototype, "disconnect", 1);
27476
- Kl([
27503
+ zl([
27477
27504
  E.trace("SocketService.sendMessagePromise")
27478
27505
  ], Wc.prototype, "sendMessagePromise", 1);
27479
- Kl([
27506
+ zl([
27480
27507
  E.trace("SocketService.sendMessagePromiseWithTimeout")
27481
27508
  ], Wc.prototype, "sendMessagePromiseWithTimeout", 1);
27482
27509
  class $O {
@@ -27867,17 +27894,17 @@ const ZS = (Jg = class {
27867
27894
  });
27868
27895
  }
27869
27896
  }, ge = new WeakMap(), Jg);
27870
- let zl = ZS;
27897
+ let Yl = ZS;
27871
27898
  Kh([
27872
27899
  E.trace("ConnectedMeetingsController.getConnectedMeetings")
27873
- ], zl.prototype, "getConnectedMeetings", 1);
27900
+ ], Yl.prototype, "getConnectedMeetings", 1);
27874
27901
  Kh([
27875
27902
  E.trace("ConnectedMeetingsController.setupEvents")
27876
- ], zl.prototype, "setupEvents", 1);
27903
+ ], Yl.prototype, "setupEvents", 1);
27877
27904
  Kh([
27878
27905
  E.trace("ConnectedMeetingsController.switchMeeting")
27879
- ], zl.prototype, "switchMeeting", 1);
27880
- var GO = Object.defineProperty, WO = Object.getOwnPropertyDescriptor, Yl = (s, t, e, r) => {
27906
+ ], Yl.prototype, "switchMeeting", 1);
27907
+ var GO = Object.defineProperty, WO = Object.getOwnPropertyDescriptor, Ql = (s, t, e, r) => {
27881
27908
  for (var i = r > 1 ? void 0 : r ? WO(t, e) : t, a = s.length - 1, o; a >= 0; a--)
27882
27909
  (o = s[a]) && (i = (r ? o(t, e, i) : o(i)) || i);
27883
27910
  return r && i && GO(t, e, i), i;
@@ -27993,7 +28020,7 @@ const Pn = class {
27993
28020
  organizationId: a,
27994
28021
  logger: o
27995
28022
  } = s.getAllValues(), c = Tw(i), d = H(D({
27996
- entity: Pu.PEER,
28023
+ entity: Cu.PEER,
27997
28024
  clientId: a,
27998
28025
  isAnonUser: !a,
27999
28026
  sdkVersion: s.getValue("sdkVersion"),
@@ -28006,7 +28033,7 @@ const Pn = class {
28006
28033
  try {
28007
28034
  const p = (l = r == null ? void 0 : r.whitelabelled_flags_endpoint) == null || l ? sn({ servicePrefix: "flags", baseURI: e }) : "edge.api.flagsmith.com";
28008
28035
  yield s.getValue("flagsmith").identify(
28009
- `${Pu.PEER}_${t}`,
28036
+ `${Cu.PEER}_${t}`,
28010
28037
  JSON.parse(JSON.stringify(d)),
28011
28038
  !1,
28012
28039
  // force evaluate
@@ -28041,9 +28068,9 @@ const Pn = class {
28041
28068
  s
28042
28069
  );
28043
28070
  t.setValue("connectedMeetingsSocketHandler", re);
28044
- const tt = new Wl(t, s), cs = new as(t, s), ii = new SO(s), ds = new xS(t, s), A = new vO(t, s), y = new lO(s), R = new on(t, s), L = yield ri.init(
28071
+ const tt = new Jl(t, s), ds = new os(t, s), ii = new SO(s), ls = new xS(t, s), A = new vO(t, s), y = new lO(s), R = new on(t, s), L = yield ri.init(
28045
28072
  t,
28046
- ds,
28073
+ ls,
28047
28074
  d,
28048
28075
  o,
28049
28076
  a
@@ -28052,17 +28079,17 @@ const Pn = class {
28052
28079
  const fe = yield Uf.init(
28053
28080
  t,
28054
28081
  L.self,
28055
- ds,
28082
+ ls,
28056
28083
  G,
28057
28084
  i
28058
28085
  );
28059
28086
  if (c.participant && (N = new Pr(
28060
28087
  t,
28061
28088
  L.self,
28062
- ds
28089
+ ls
28063
28090
  )), (Cr = c.e2ee) != null && Cr.enabled && c.e2ee.manager.init(p, t.getValue("peerSessionStore")), c.chat && (_ = yield ws.init(
28064
28091
  t,
28065
- cs,
28092
+ ds,
28066
28093
  R,
28067
28094
  L.self,
28068
28095
  N.participants
@@ -28078,11 +28105,11 @@ const Pn = class {
28078
28105
  )), c.recording && ($ = new Hf(
28079
28106
  t,
28080
28107
  L.self,
28081
- ds
28108
+ ls
28082
28109
  )), c.stage && (P = new $f(
28083
28110
  t,
28084
28111
  ii,
28085
- ds,
28112
+ ls,
28086
28113
  L.self,
28087
28114
  N.participants
28088
28115
  )), c.plugin) {
@@ -28096,17 +28123,17 @@ const Pn = class {
28096
28123
  t,
28097
28124
  qs,
28098
28125
  A,
28099
- cs,
28126
+ ds,
28100
28127
  _ == null ? void 0 : _.chat,
28101
28128
  L.self,
28102
28129
  N.participants,
28103
28130
  i
28104
28131
  );
28105
28132
  }
28106
- if (c.connectedMeetings && (B = yield zl.init(
28133
+ if (c.connectedMeetings && (B = yield Yl.init(
28107
28134
  t
28108
28135
  )), c.pip) {
28109
- const qs = yield Cu._init(t, L.self);
28136
+ const qs = yield wu._init(t, L.self);
28110
28137
  t.setValue("pip", qs);
28111
28138
  }
28112
28139
  }
@@ -28155,16 +28182,16 @@ const Pn = class {
28155
28182
  }
28156
28183
  };
28157
28184
  let Jc = Pn;
28158
- Yl([
28185
+ Ql([
28159
28186
  E.trace("Controller.init")
28160
28187
  ], Jc, "init", 1);
28161
- Yl([
28188
+ Ql([
28162
28189
  E.trace("setupFlagsmith")
28163
28190
  ], Jc, "setupFlagsmith", 1);
28164
- Yl([
28191
+ Ql([
28165
28192
  E.trace("Controller.createRoomNodeClient")
28166
28193
  ], Jc, "createRoomNodeClient", 1);
28167
- Yl([
28194
+ Ql([
28168
28195
  E.trace("Controller.createSocketService")
28169
28196
  ], Jc, "createSocketService", 1);
28170
28197
  class JO {
@@ -28222,10 +28249,10 @@ function KO(s, t) {
28222
28249
  throw new b("Invalid auth token", "0004");
28223
28250
  }
28224
28251
  }
28225
- var Yr, Xi, Zi, Lc, bl, ev;
28252
+ var Yr, Xi, Zi, Lc, kl, ev;
28226
28253
  class zO {
28227
28254
  constructor() {
28228
- m(this, bl);
28255
+ m(this, kl);
28229
28256
  m(this, Yr, new Audio());
28230
28257
  m(this, Xi, new MediaStream());
28231
28258
  m(this, Zi, /* @__PURE__ */ new Map());
@@ -28249,7 +28276,7 @@ class zO {
28249
28276
  play() {
28250
28277
  return u(this, null, function* () {
28251
28278
  return n(this, Yr).srcObject = n(this, Xi), n(this, Yr).play().catch((t) => {
28252
- x(this, bl, ev).call(this, t);
28279
+ x(this, kl, ev).call(this, t);
28253
28280
  });
28254
28281
  });
28255
28282
  }
@@ -28257,7 +28284,7 @@ class zO {
28257
28284
  f(this, Lc, t);
28258
28285
  }
28259
28286
  }
28260
- Yr = new WeakMap(), Xi = new WeakMap(), Zi = new WeakMap(), Lc = new WeakMap(), bl = new WeakSet(), ev = function(t) {
28287
+ Yr = new WeakMap(), Xi = new WeakMap(), Zi = new WeakMap(), Lc = new WeakMap(), kl = new WeakSet(), ev = function(t) {
28261
28288
  var e;
28262
28289
  (e = n(this, Lc)) == null || e.call(this, t);
28263
28290
  };
@@ -28278,7 +28305,7 @@ class YO extends zO {
28278
28305
  }
28279
28306
  }
28280
28307
  en = new WeakMap();
28281
- var QO = Object.defineProperty, XO = Object.getOwnPropertyDescriptor, Ql = (s, t, e, r) => {
28308
+ var QO = Object.defineProperty, XO = Object.getOwnPropertyDescriptor, Xl = (s, t, e, r) => {
28282
28309
  for (var i = r > 1 ? void 0 : r ? XO(t, e) : t, a = s.length - 1, o; a >= 0; a--)
28283
28310
  (o = s[a]) && (i = (r ? o(t, e, i) : o(i)) || i);
28284
28311
  return r && i && QO(t, e, i), i;
@@ -28335,7 +28362,7 @@ let ti = (Kg = class {
28335
28362
  video: !0
28336
28363
  };
28337
28364
  return a.setValue("options", e), a.setValue("peerId", t), a.setValue("modules", o), a.setValue("sdkName", "web-core"), a.setValue("meetingId", r), a.setValue("apiBase", i.apiBase), a.setValue("baseURI", i.baseURI), a.setValue("userId", i.participantId), a.setValue("organizationId", i.orgId), a.setValue("authToken", e.authToken), a.setValue("overrides", (d = e.overrides) != null ? d : {}), a.setValue("env", lw({ baseURI: i.baseURI })), a.setValue("defaults", c), a.setValue("onError", e.onError || (() => {
28338
- })), a.setValue("cachedUserDetails", Rs(e.cachedUserDetails)), a.setValue("sdkVersion", "1.2.1-staging.3"), (l = e.modules) != null && l.experimentalAudioPlayback && a.setValue("audioPlayback", new YO()), a;
28365
+ })), a.setValue("cachedUserDetails", Rs(e.cachedUserDetails)), a.setValue("sdkVersion", "1.2.1-staging.4"), (l = e.modules) != null && l.experimentalAudioPlayback && a.setValue("audioPlayback", new YO()), a;
28339
28366
  }
28340
28367
  join() {
28341
28368
  return u(this, null, function* () {
@@ -28462,7 +28489,7 @@ let ti = (Kg = class {
28462
28489
  });
28463
28490
  }
28464
28491
  }, Ge = new WeakMap(), tn = new WeakMap(), Kg);
28465
- Ql([
28492
+ Xl([
28466
28493
  ut("0002"),
28467
28494
  _r.executeWithLock({
28468
28495
  methodName: "meeting.join",
@@ -28470,10 +28497,10 @@ Ql([
28470
28497
  timeout: 3e3
28471
28498
  })
28472
28499
  ], ti.prototype, "join", 1);
28473
- Ql([
28500
+ Xl([
28474
28501
  ut("0003")
28475
28502
  ], ti.prototype, "leave", 1);
28476
- Ql([
28503
+ Xl([
28477
28504
  ut("0001"),
28478
28505
  _r.executeWithLock({
28479
28506
  methodName: "Client.init",
@@ -28481,7 +28508,7 @@ Ql([
28481
28508
  timeout: 3e3
28482
28509
  })
28483
28510
  ], ti, "init", 1);
28484
- ti = Ql([
28511
+ ti = Xl([
28485
28512
  ut("0000")
28486
28513
  ], ti);
28487
28514
  const ZO = ti;