@cloudflare/realtimekit 2.0.3-staging.2 → 2.0.3-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
@@ -49,7 +49,7 @@ import { v4 as Pa, validate as tm } from "uuid";
49
49
  import sm from "bowser";
50
50
  import { MessageType as T, PbLong as Wa, typeofJsonValue as gv } from "@protobuf-ts/runtime";
51
51
  import * as ao from "worker-timers";
52
- import * as ts from "sdp-transform";
52
+ import * as ss from "sdp-transform";
53
53
  function mv(s) {
54
54
  const { length: t } = this, e = s >= 0 ? s : t + s;
55
55
  return e < 0 || e >= t ? void 0 : this[e];
@@ -3924,7 +3924,7 @@ var TT = /^\s+/;
3924
3924
  function yT(s) {
3925
3925
  return s && s.slice(0, vT(s) + 1).replace(TT, "");
3926
3926
  }
3927
- function Qt(s) {
3927
+ function Xt(s) {
3928
3928
  var t = typeof s;
3929
3929
  return s != null && (t == "object" || t == "function");
3930
3930
  }
@@ -3934,9 +3934,9 @@ function _p(s) {
3934
3934
  return s;
3935
3935
  if (Hl(s))
3936
3936
  return Pp;
3937
- if (Qt(s)) {
3937
+ if (Xt(s)) {
3938
3938
  var t = typeof s.valueOf == "function" ? s.valueOf() : s;
3939
- s = Qt(t) ? t + "" : t;
3939
+ s = Xt(t) ? t + "" : t;
3940
3940
  }
3941
3941
  if (typeof s != "string")
3942
3942
  return s === 0 ? s : +s;
@@ -3949,7 +3949,7 @@ function Rh(s) {
3949
3949
  }
3950
3950
  var wT = "[object AsyncFunction]", RT = "[object Function]", bT = "[object GeneratorFunction]", kT = "[object Proxy]";
3951
3951
  function bh(s) {
3952
- if (!Qt(s))
3952
+ if (!Xt(s))
3953
3953
  return !1;
3954
3954
  var t = rn(s);
3955
3955
  return t == RT || t == bT || t == wT || t == kT;
@@ -3981,7 +3981,7 @@ var OT = /[\\^$.*+?()[\]{}|]/g, NT = /^\[object .+?Constructor\]$/, LT = Functio
3981
3981
  "^" + xT.call(UT).replace(OT, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
3982
3982
  );
3983
3983
  function BT(s) {
3984
- if (!Qt(s) || IT(s))
3984
+ if (!Xt(s) || IT(s))
3985
3985
  return !1;
3986
3986
  var t = bh(s) ? $T : NT;
3987
3987
  return t.test(nn(s));
@@ -3999,7 +3999,7 @@ var wp = Object.create, qT = function() {
3999
3999
  function s() {
4000
4000
  }
4001
4001
  return function(t) {
4002
- if (!Qt(t))
4002
+ if (!Xt(t))
4003
4003
  return {};
4004
4004
  if (wp)
4005
4005
  return wp(t);
@@ -4146,7 +4146,7 @@ function Hc(s) {
4146
4146
  return s != null && Ih(s.length) && !bh(s);
4147
4147
  }
4148
4148
  function fy(s, t, e) {
4149
- if (!Qt(e))
4149
+ if (!Xt(e))
4150
4150
  return !1;
4151
4151
  var r = typeof t;
4152
4152
  return (r == "number" ? Hc(e) && kh(t, e.length) : r == "string" && t in e) ? $c(e[t], s) : !1;
@@ -4246,7 +4246,7 @@ function cE(s) {
4246
4246
  }
4247
4247
  var dE = Object.prototype, lE = dE.hasOwnProperty;
4248
4248
  function uE(s) {
4249
- if (!Qt(s))
4249
+ if (!Xt(s))
4250
4250
  return cE(s);
4251
4251
  var t = Fl(s), e = [];
4252
4252
  for (var r in s)
@@ -4647,7 +4647,7 @@ function co(s, t, e, r, i, a) {
4647
4647
  var o, c = t & h_, d = t & p_, l = t & g_;
4648
4648
  if (e && (o = i ? e(s, r, i, a) : e(s)), o !== void 0)
4649
4649
  return o;
4650
- if (!Qt(s))
4650
+ if (!Xt(s))
4651
4651
  return s;
4652
4652
  var h = Lt(s);
4653
4653
  if (h) {
@@ -4876,7 +4876,7 @@ function vC(s, t, e, r) {
4876
4876
  return !0;
4877
4877
  }
4878
4878
  function lf(s) {
4879
- return s === s && !Qt(s);
4879
+ return s === s && !Xt(s);
4880
4880
  }
4881
4881
  function TC(s) {
4882
4882
  for (var t = jl(s), e = t.length; e--; ) {
@@ -4956,7 +4956,7 @@ function $h(s, t, e) {
4956
4956
  var r, i, a, o, c, d, l = 0, h = !1, g = !1, S = !0;
4957
4957
  if (typeof s != "function")
4958
4958
  throw new TypeError(LC);
4959
- t = _p(t) || 0, Qt(e) && (h = !!e.leading, g = "maxWait" in e, a = g ? VC(_p(e.maxWait) || 0, t) : a, S = "trailing" in e ? !!e.trailing : S);
4959
+ t = _p(t) || 0, Xt(e) && (h = !!e.leading, g = "maxWait" in e, a = g ? VC(_p(e.maxWait) || 0, t) : a, S = "trailing" in e ? !!e.trailing : S);
4960
4960
  function y(F) {
4961
4961
  var X = r, ee = i;
4962
4962
  return r = i = void 0, l = F, o = s.apply(ee, X), o;
@@ -5021,13 +5021,13 @@ function BC(s, t, e, r, i, a, o) {
5021
5021
  var h = a ? a(c, d, e + "", s, t, o) : void 0, g = h === void 0;
5022
5022
  if (g) {
5023
5023
  var S = Lt(d), y = !S && _a(d), E = !S && !y && ql(d);
5024
- h = d, S || y || E ? Lt(c) ? h = c : UC(c) ? h = $m(c) : y ? (g = !1, h = Xm(d, !0)) : E ? (g = !1, h = sf(d, !0)) : h = [] : sP(d) || To(d) ? (h = c, To(c) ? h = $C(c) : (!Qt(c) || bh(c)) && (h = rf(d))) : g = !1;
5024
+ h = d, S || y || E ? Lt(c) ? h = c : UC(c) ? h = $m(c) : y ? (g = !1, h = Xm(d, !0)) : E ? (g = !1, h = sf(d, !0)) : h = [] : sP(d) || To(d) ? (h = c, To(c) ? h = $C(c) : (!Xt(c) || bh(c)) && (h = rf(d))) : g = !1;
5025
5025
  }
5026
5026
  g && (o.set(d, h), i(h, d, r, a, o), o.delete(d)), ku(s, e, h);
5027
5027
  }
5028
5028
  function hf(s, t, e, r, i) {
5029
5029
  s !== t && OC(t, function(a, o) {
5030
- if (i || (i = new ps()), Qt(a))
5030
+ if (i || (i = new ps()), Xt(a))
5031
5031
  BC(s, t, o, e, hf, r, i);
5032
5032
  else {
5033
5033
  var c = r ? r(Au(s, o), a, o + "", s, t, i) : void 0;
@@ -6184,7 +6184,7 @@ const Xp = 1080, Zp = 1920, bw = (s, t, e, r, i, a) => {
6184
6184
  let g = d * h, S = l * h, y, E, k, R, A = 1;
6185
6185
  return g < e && (A = e / g), Math.abs(A - 1) < 1e-14 && S < r && (A = r / S), g *= A, S *= A, k = d / (g / e), R = l / (S / r), y = (d - k) * o, E = (l - R) * c, y < 0 && (y = 0), E < 0 && (E = 0), k > d && (k = d), R > l && (R = l), [y, E, k, R, s, t, e, r];
6186
6186
  };
6187
- var Ft, hi, et, qt, we, ss, Us, nt, Ie, wn, Rn, $s, bn;
6187
+ var Ft, hi, et, qt, we, rs, Us, nt, Ie, wn, Rn, $s, bn;
6188
6188
  const cp = class extends xt {
6189
6189
  constructor(e, r, i, a) {
6190
6190
  const o = e.getValue("logger");
@@ -6197,7 +6197,7 @@ const cp = class extends xt {
6197
6197
  height: Xp,
6198
6198
  width: Zp
6199
6199
  });
6200
- m(this, ss, {
6200
+ m(this, rs, {
6201
6201
  brand: "#2160FD",
6202
6202
  background: "#141414",
6203
6203
  text: "#000000",
@@ -6253,7 +6253,7 @@ const cp = class extends xt {
6253
6253
  p(this, "disable", (e = !1) => {
6254
6254
  f(this, $s, "idle"), this.cleanupEventListeners(), cancelAnimationFrame(n(this, Us)), e !== !0 && document.body.removeChild(n(this, et)), f(this, Us, void 0), document.pictureInPictureElement && document.exitPictureInPicture();
6255
6255
  });
6256
- f(this, hi, e), f(this, $s, "idle"), f(this, Ie, r), f(this, ss, {
6256
+ f(this, hi, e), f(this, $s, "idle"), f(this, Ie, r), f(this, rs, {
6257
6257
  brand: r.config.designTokens.colors.brand[500],
6258
6258
  background: r.config.designTokens.colors.background[1e3],
6259
6259
  text: r.config.designTokens.colors.text,
@@ -6353,7 +6353,7 @@ const cp = class extends xt {
6353
6353
  if (n(this, Ft) === void 0)
6354
6354
  return;
6355
6355
  const o = n(this, Ft).getContext("2d"), c = n(this, Ft).width, d = 0, l = 0, h = r - d * 2, g = i - d * 2, S = Math.floor(c / h), y = Math.floor(e / S), k = e % S * (h + d) + d, R = y * (g + d) + d, { displayText: A, image: x } = a != null ? a : {};
6356
- o.fillStyle = A || x ? n(this, ss).videoBackground : n(this, ss).background, o.strokeStyle = n(this, ss).brand, o.beginPath(), o.moveTo(k + l, R), o.arcTo(k + h, R, k + h, R + l, l), o.arcTo(
6356
+ o.fillStyle = A || x ? n(this, rs).videoBackground : n(this, rs).background, o.strokeStyle = n(this, rs).brand, o.beginPath(), o.moveTo(k + l, R), o.arcTo(k + h, R, k + h, R + l, l), o.arcTo(
6357
6357
  k + h,
6358
6358
  R + g,
6359
6359
  k + h - l,
@@ -6361,13 +6361,13 @@ const cp = class extends xt {
6361
6361
  l
6362
6362
  ), o.arcTo(k, R + g, k, R + g - l, l), o.arcTo(k, R, k + l, R, l), o.closePath(), o.fill(), o.stroke();
6363
6363
  const D = h / 6, U = h / 2 + k, $ = g / 2 + R;
6364
- o.save(), (A || x) && (o.beginPath(), o.arc(U, $, D, 0, Math.PI * 2), o.fillStyle = n(this, ss).brand, o.fill(), x ? (o.clip(), o.drawImage(
6364
+ o.save(), (A || x) && (o.beginPath(), o.arc(U, $, D, 0, Math.PI * 2), o.fillStyle = n(this, rs).brand, o.fill(), x ? (o.clip(), o.drawImage(
6365
6365
  x,
6366
6366
  U - D,
6367
6367
  $ - D,
6368
6368
  D * 2,
6369
6369
  D * 2
6370
- ), o.restore()) : A && (o.fillStyle = n(this, ss).textOnBrand, o.font = `${D / 2}px sans-serif`, o.textAlign = "center", o.textBaseline = "middle", o.fillText(A, U, $)), this.drawIcons(a, k, R, Math.max(h, g)));
6370
+ ), o.restore()) : A && (o.fillStyle = n(this, rs).textOnBrand, o.font = `${D / 2}px sans-serif`, o.textAlign = "center", o.textBaseline = "middle", o.fillText(A, U, $)), this.drawIcons(a, k, R, Math.max(h, g)));
6371
6371
  }
6372
6372
  /** @access private */
6373
6373
  drawIcons(e, r, i, a) {
@@ -6375,13 +6375,13 @@ const cp = class extends xt {
6375
6375
  let l = r + c;
6376
6376
  const h = i + c, g = (S) => {
6377
6377
  const y = n(this, Ft).getContext("2d");
6378
- y.save(), y.fillStyle = n(this, ss).background, y.beginPath(), y.moveTo(l + d, h), y.arcTo(l + o, h, l + o, h + d, d), y.arcTo(
6378
+ y.save(), y.fillStyle = n(this, rs).background, y.beginPath(), y.moveTo(l + d, h), y.arcTo(l + o, h, l + o, h + d, d), y.arcTo(
6379
6379
  l + o,
6380
6380
  h + o,
6381
6381
  l + o - d,
6382
6382
  h + o,
6383
6383
  d
6384
- ), y.arcTo(l, h + o, l, h + o - d, d), y.arcTo(l, h, l + d, h, d), y.closePath(), y.fill(), typeof S == "string" ? (y.font = `${o / 1.5}px sans-serif`, y.fillStyle = n(this, ss).text, y.textAlign = "center", y.textBaseline = "top", y.fillText(S, o / 2 + l, h + c)) : y.drawImage(
6384
+ ), y.arcTo(l, h + o, l, h + o - d, d), y.arcTo(l, h, l + d, h, d), y.closePath(), y.fill(), typeof S == "string" ? (y.font = `${o / 1.5}px sans-serif`, y.fillStyle = n(this, rs).text, y.textAlign = "center", y.textBaseline = "top", y.fillText(S, o / 2 + l, h + c)) : y.drawImage(
6385
6385
  S,
6386
6386
  l + c,
6387
6387
  h + c,
@@ -6595,7 +6595,7 @@ const cp = class extends xt {
6595
6595
  }
6596
6596
  };
6597
6597
  let Mu = cp;
6598
- Ft = new WeakMap(), hi = new WeakMap(), et = new WeakMap(), qt = new WeakMap(), we = new WeakMap(), ss = new WeakMap(), Us = new WeakMap(), nt = new WeakMap(), Ie = new WeakMap(), wn = new WeakMap(), Rn = new WeakMap(), $s = new WeakMap(), bn = new WeakMap();
6598
+ Ft = new WeakMap(), hi = new WeakMap(), et = new WeakMap(), qt = new WeakMap(), we = new WeakMap(), rs = new WeakMap(), Us = new WeakMap(), nt = new WeakMap(), Ie = new WeakMap(), wn = new WeakMap(), Rn = new WeakMap(), $s = new WeakMap(), bn = new WeakMap();
6599
6599
  var cr;
6600
6600
  (function(s) {
6601
6601
  s[s.PUBLISHER = 0] = "PUBLISHER", s[s.SUBSCRIBER = 1] = "SUBSCRIBER";
@@ -11746,7 +11746,7 @@ var A0 = Object.defineProperty, I0 = Object.getOwnPropertyDescriptor, si = (s, t
11746
11746
  for (var i = r > 1 ? void 0 : r ? I0(t, e) : t, a = s.length - 1, o; a >= 0; a--)
11747
11747
  (o = s[a]) && (i = (r ? o(t, e, i) : o(i)) || i);
11748
11748
  return r && i && A0(t, e, i), i;
11749
- }, Yt = /* @__PURE__ */ ((s) => (s[s.TEXT = 0] = "TEXT", s[s.IMAGE = 1] = "IMAGE", s[s.FILE = 2] = "FILE", s[s.CUSTOM = 3] = "CUSTOM", s))(Yt || {}), Rt, kn;
11749
+ }, Qt = /* @__PURE__ */ ((s) => (s[s.TEXT = 0] = "TEXT", s[s.IMAGE = 1] = "IMAGE", s[s.FILE = 2] = "FILE", s[s.CUSTOM = 3] = "CUSTOM", s))(Qt || {}), Rt, kn;
11750
11750
  class hr {
11751
11751
  constructor(t, e) {
11752
11752
  m(this, Rt, void 0);
@@ -12411,7 +12411,7 @@ var B0 = Object.defineProperty, H0 = Object.getOwnPropertyDescriptor, Ms = (s, t
12411
12411
  };
12412
12412
  const F0 = ["text", "image", "file", "custom", "poll"], ld = { maxInvocations: 180, period: 60 };
12413
12413
  var se, pi, ze, An, xd, Vf, ko, Bu, xg;
12414
- let Xt = (xg = class extends xt {
12414
+ let Zt = (xg = class extends xt {
12415
12415
  constructor(t, e, r, i) {
12416
12416
  const a = t.getValue("logger");
12417
12417
  super(a);
@@ -12498,7 +12498,7 @@ let Xt = (xg = class extends xt {
12498
12498
  let r = [];
12499
12499
  e && e.length > 0 && (e.push(n(this, se).id), r = n(this, pi).joined.toArray().filter((h) => e.includes(h.id)).map((h) => h.userId), r.push(n(this, se).userId)), n(this, ze).sendMessage(
12500
12500
  t,
12501
- Yt.TEXT,
12501
+ Qt.TEXT,
12502
12502
  e
12503
12503
  );
12504
12504
  });
@@ -12534,7 +12534,7 @@ let Xt = (xg = class extends xt {
12534
12534
  let y = [];
12535
12535
  e && e.length > 0 && (e.push(n(this, se).id), y = n(this, pi).joined.toArray().filter((E) => e.includes(E.id)).map((E) => E.userId), y.push(n(this, se).userId)), n(this, ze).sendMessage(
12536
12536
  g,
12537
- Yt.IMAGE,
12537
+ Qt.IMAGE,
12538
12538
  e
12539
12539
  );
12540
12540
  } catch (h) {
@@ -12575,7 +12575,7 @@ let Xt = (xg = class extends xt {
12575
12575
  });
12576
12576
  n(this, ze).sendMessage(
12577
12577
  y,
12578
- Yt.FILE,
12578
+ Qt.FILE,
12579
12579
  e
12580
12580
  );
12581
12581
  } catch (l) {
@@ -12643,7 +12643,7 @@ let Xt = (xg = class extends xt {
12643
12643
  });
12644
12644
  n(this, ze).sendMessage(
12645
12645
  JSON.stringify(i),
12646
- Yt.CUSTOM,
12646
+ Qt.CUSTOM,
12647
12647
  e
12648
12648
  );
12649
12649
  });
@@ -12677,7 +12677,7 @@ let Xt = (xg = class extends xt {
12677
12677
  n(this, ze).editMessage(
12678
12678
  t,
12679
12679
  e,
12680
- Yt.TEXT
12680
+ Qt.TEXT
12681
12681
  );
12682
12682
  });
12683
12683
  }
@@ -12703,7 +12703,7 @@ let Xt = (xg = class extends xt {
12703
12703
  yield d.uploadFile(e, h), n(this, ze).editMessage(
12704
12704
  t,
12705
12705
  l,
12706
- Yt.IMAGE
12706
+ Qt.IMAGE
12707
12707
  );
12708
12708
  } catch (d) {
12709
12709
  throw new w("Error editing image message.", "0500", this.logger);
@@ -12730,7 +12730,7 @@ let Xt = (xg = class extends xt {
12730
12730
  name: e.name,
12731
12731
  size: "size" in e ? e.size : 0
12732
12732
  }),
12733
- Yt.FILE
12733
+ Qt.FILE
12734
12734
  );
12735
12735
  } catch (c) {
12736
12736
  throw new w("Error editing file message.", "0500", this.logger);
@@ -12860,37 +12860,37 @@ let Xt = (xg = class extends xt {
12860
12860
  Ms([
12861
12861
  P.trace("Chat.sendTextMessage"),
12862
12862
  Ut(ld)
12863
- ], Xt.prototype, "sendTextMessage", 1);
12863
+ ], Zt.prototype, "sendTextMessage", 1);
12864
12864
  Ms([
12865
12865
  P.trace("Chat.sendImageMessage"),
12866
12866
  Ut({ maxInvocations: 20, period: 60 })
12867
- ], Xt.prototype, "sendImageMessage", 1);
12867
+ ], Zt.prototype, "sendImageMessage", 1);
12868
12868
  Ms([
12869
12869
  P.trace("Chat.sendFileMessage"),
12870
12870
  Ut({ maxInvocations: 20, period: 60 })
12871
- ], Xt.prototype, "sendFileMessage", 1);
12871
+ ], Zt.prototype, "sendFileMessage", 1);
12872
12872
  Ms([
12873
12873
  P.trace("Chat.sendMessage"),
12874
12874
  Ut({ maxInvocations: 180, period: 60 })
12875
- ], Xt.prototype, "sendMessage", 1);
12875
+ ], Zt.prototype, "sendMessage", 1);
12876
12876
  Ms([
12877
12877
  P.trace("Chat.editTextMessage")
12878
- ], Xt.prototype, "editTextMessage", 1);
12878
+ ], Zt.prototype, "editTextMessage", 1);
12879
12879
  Ms([
12880
12880
  P.trace("Chat.editImageMessage")
12881
- ], Xt.prototype, "editImageMessage", 1);
12881
+ ], Zt.prototype, "editImageMessage", 1);
12882
12882
  Ms([
12883
12883
  P.trace("Chat.editFileMessage")
12884
- ], Xt.prototype, "editFileMessage", 1);
12884
+ ], Zt.prototype, "editFileMessage", 1);
12885
12885
  Ms([
12886
12886
  P.trace("Chat.editMessage")
12887
- ], Xt.prototype, "editMessage", 1);
12887
+ ], Zt.prototype, "editMessage", 1);
12888
12888
  Ms([
12889
12889
  P.trace("Chat.deleteMessage")
12890
- ], Xt.prototype, "deleteMessage", 1);
12891
- Xt = Ms([
12890
+ ], Zt.prototype, "deleteMessage", 1);
12891
+ Zt = Ms([
12892
12892
  rt("0500")
12893
- ], Xt);
12893
+ ], Zt);
12894
12894
  var q0 = Object.defineProperty, j0 = Object.getOwnPropertyDescriptor, G0 = (s, t, e, r) => {
12895
12895
  for (var i = r > 1 ? void 0 : r ? j0(t, e) : t, a = s.length - 1, o; a >= 0; a--)
12896
12896
  (o = s[a]) && (i = (r ? o(t, e, i) : o(i)) || i);
@@ -12902,7 +12902,7 @@ const vr = (Ug = class {
12902
12902
  p(this, "chatSocketHandler");
12903
12903
  p(this, "self");
12904
12904
  m(this, gi, void 0);
12905
- f(this, gi, s), this.chatSocketHandler = t, this.chat = new Xt(
12905
+ f(this, gi, s), this.chatSocketHandler = t, this.chat = new Zt(
12906
12906
  s,
12907
12907
  t,
12908
12908
  e,
@@ -12965,20 +12965,20 @@ const vr = (Ug = class {
12965
12965
  pinned: s.pinned
12966
12966
  };
12967
12967
  switch (e.type) {
12968
- case Yt.TEXT: {
12968
+ case Qt.TEXT: {
12969
12969
  e.message = s.payload;
12970
12970
  break;
12971
12971
  }
12972
- case Yt.IMAGE: {
12972
+ case Qt.IMAGE: {
12973
12973
  e.link = s.payload;
12974
12974
  break;
12975
12975
  }
12976
- case Yt.FILE: {
12976
+ case Qt.FILE: {
12977
12977
  const { link: r, name: i, size: a } = JSON.parse(s.payload);
12978
12978
  e.link = r, e.name = i, e.size = a;
12979
12979
  break;
12980
12980
  }
12981
- case Yt.CUSTOM: {
12981
+ case Qt.CUSTOM: {
12982
12982
  const {
12983
12983
  html: r,
12984
12984
  images: i,
@@ -13962,12 +13962,12 @@ var lM = Object.defineProperty, uM = Object.getOwnPropertyDescriptor, hM = (s, t
13962
13962
  for (var i = r > 1 ? void 0 : r ? uM(t, e) : t, a = s.length - 1, o; a >= 0; a--)
13963
13963
  (o = s[a]) && (i = (r ? o(t, e, i) : o(i)) || i);
13964
13964
  return r && i && lM(t, e, i), i;
13965
- }, br, rs, kr, Lo, at;
13965
+ }, br, is, kr, Lo, at;
13966
13966
  class jf {
13967
13967
  constructor(t, e, r, i, a) {
13968
13968
  p(this, "stage");
13969
13969
  m(this, br, void 0);
13970
- m(this, rs, void 0);
13970
+ m(this, is, void 0);
13971
13971
  m(this, kr, void 0);
13972
13972
  m(this, Lo, 0);
13973
13973
  m(this, at, void 0);
@@ -13977,7 +13977,7 @@ class jf {
13977
13977
  a,
13978
13978
  e,
13979
13979
  r
13980
- ), f(this, kr, e), f(this, br, i), f(this, rs, a), this.setupEvents();
13980
+ ), f(this, kr, e), f(this, br, i), f(this, is, a), this.setupEvents();
13981
13981
  }
13982
13982
  /**
13983
13983
  * @access private
@@ -14014,7 +14014,7 @@ class jf {
14014
14014
  );
14015
14015
  }
14016
14016
  getCurrentStageRequests() {
14017
- return n(this, rs).joined.toArray().filter(
14017
+ return n(this, is).joined.toArray().filter(
14018
14018
  (e) => e.stageStatus === "REQUESTED_TO_JOIN_STAGE"
14019
14019
  ).map((e) => ({
14020
14020
  displayName: e.name,
@@ -14055,14 +14055,14 @@ class jf {
14055
14055
  */
14056
14056
  peerStageStatusHandler(t) {
14057
14057
  return u(this, null, function* () {
14058
- const e = n(this, rs).joined.get(t.peerId), r = n(this, rs).viewMode === "ACTIVE_GRID";
14058
+ const e = n(this, is).joined.get(t.peerId), r = n(this, is).viewMode === "ACTIVE_GRID";
14059
14059
  if (!e) {
14060
14060
  this.logger.warn("err::peerStageStatusUpdate: participant not found");
14061
14061
  return;
14062
14062
  }
14063
14063
  switch (t.stageType) {
14064
14064
  case 1:
14065
- e.setStageStatus("ON_STAGE"), r && n(this, at).getValue("peerSessionStore").emit(C.UPDATE_ACTIVE, { viewMode: n(this, rs).viewMode, page: n(this, rs).currentPage });
14065
+ e.setStageStatus("ON_STAGE"), r && n(this, at).getValue("peerSessionStore").emit(C.UPDATE_ACTIVE, { viewMode: n(this, is).viewMode, page: n(this, is).currentPage });
14066
14066
  break;
14067
14067
  case 2:
14068
14068
  e.setStageStatus("ACCEPTED_TO_JOIN_STAGE");
@@ -14073,7 +14073,7 @@ class jf {
14073
14073
  case 0:
14074
14074
  case 4:
14075
14075
  default:
14076
- e.setStageStatus("OFF_STAGE"), r && n(this, at).getValue("peerSessionStore").emit(C.UPDATE_ACTIVE, { viewMode: n(this, rs).viewMode, page: n(this, rs).currentPage });
14076
+ e.setStageStatus("OFF_STAGE"), r && n(this, at).getValue("peerSessionStore").emit(C.UPDATE_ACTIVE, { viewMode: n(this, is).viewMode, page: n(this, is).currentPage });
14077
14077
  break;
14078
14078
  }
14079
14079
  n(this, at).getValue("peerSessionStore").emit(C.UPDATE_PEER_STAGE_STATUS, {
@@ -14083,7 +14083,7 @@ class jf {
14083
14083
  });
14084
14084
  }
14085
14085
  }
14086
- br = new WeakMap(), rs = new WeakMap(), kr = new WeakMap(), Lo = new WeakMap(), at = new WeakMap();
14086
+ br = new WeakMap(), is = new WeakMap(), kr = new WeakMap(), Lo = new WeakMap(), at = new WeakMap();
14087
14087
  hM([
14088
14088
  P.trace("Stage.setupEvents")
14089
14089
  ], jf.prototype, "setupEvents", 1);
@@ -14323,7 +14323,7 @@ var vM = Object.defineProperty, TM = Object.getOwnPropertyDescriptor, yM = (s, t
14323
14323
  for (var i = r > 1 ? void 0 : r ? TM(t, e) : t, a = s.length - 1, o; a >= 0; a--)
14324
14324
  (o = s[a]) && (i = (r ? o(t, e, i) : o(i)) || i);
14325
14325
  return r && i && vM(t, e, i), i;
14326
- }, is, Vn, Ar, yi, Hd, Jf, Uo, Wu, $o, Ju, Bo, Ku, Gg;
14326
+ }, ns, Vn, Ar, yi, Hd, Jf, Uo, Wu, $o, Ju, Bo, Ku, Gg;
14327
14327
  const Wf = (Gg = class {
14328
14328
  constructor(s, t, e, r) {
14329
14329
  m(this, Hd);
@@ -14331,11 +14331,11 @@ const Wf = (Gg = class {
14331
14331
  m(this, $o);
14332
14332
  m(this, Bo);
14333
14333
  p(this, "plugins");
14334
- m(this, is, void 0);
14334
+ m(this, ns, void 0);
14335
14335
  m(this, Vn, void 0);
14336
14336
  m(this, Ar, void 0);
14337
14337
  m(this, yi, null);
14338
- f(this, Ar, s), this.plugins = t, f(this, Vn, e), f(this, is, r), this.setupEvents();
14338
+ f(this, Ar, s), this.plugins = t, f(this, Vn, e), f(this, ns, r), this.setupEvents();
14339
14339
  }
14340
14340
  /**
14341
14341
  * @access private
@@ -14391,19 +14391,19 @@ const Wf = (Gg = class {
14391
14391
  var t, e;
14392
14392
  if (((e = (t = this.plugins.active) == null ? void 0 : t.toArray()) != null ? e : []).forEach((r) => {
14393
14393
  r.deactivateForSelf();
14394
- }), !n(this, is)) {
14394
+ }), !n(this, ns)) {
14395
14395
  this.logger.warn("Active plugins store not available yet on ROOM_JOINED. Sync will be performed when store is created.");
14396
14396
  return;
14397
14397
  }
14398
14398
  yield O(this, $o, Ju).call(this), this.logger.debug("[SOCKET_SERVICE_ROOM_JOINED] resolved request to sync active plugins.");
14399
14399
  }));
14400
14400
  }
14401
- }, is = new WeakMap(), Vn = new WeakMap(), Ar = new WeakMap(), yi = new WeakMap(), Hd = new WeakSet(), Jf = function() {
14401
+ }, ns = new WeakMap(), Vn = new WeakMap(), Ar = new WeakMap(), yi = new WeakMap(), Hd = new WeakSet(), Jf = function() {
14402
14402
  const s = n(this, Ar).getValue("peerSessionStore"), t = (e) => u(this, null, function* () {
14403
- if (e.state === "connected" && !n(this, is))
14403
+ if (e.state === "connected" && !n(this, ns))
14404
14404
  try {
14405
- f(this, is, yield n(this, Vn).create(Iu, !0)), O(this, Uo, Wu).call(this), this.plugins.all.toArray().forEach((r) => {
14406
- r.activePluginsStore = n(this, is);
14405
+ f(this, ns, yield n(this, Vn).create(Iu, !0)), O(this, Uo, Wu).call(this), this.plugins.all.toArray().forEach((r) => {
14406
+ r.activePluginsStore = n(this, ns);
14407
14407
  }), O(this, Bo, Ku).call(this), this.logger.info("Active plugins store created after socket connected"), yield O(this, $o, Ju).call(this);
14408
14408
  } catch (r) {
14409
14409
  this.logger.error("Failed to create active plugins store after socket connected, will retry on next reconnect", { error: r });
@@ -14417,11 +14417,11 @@ const Wf = (Gg = class {
14417
14417
  }, $o = new WeakSet(), Ju = function() {
14418
14418
  return u(this, null, function* () {
14419
14419
  try {
14420
- yield n(this, Vn).refresh(n(this, is).name);
14420
+ yield n(this, Vn).refresh(n(this, ns).name);
14421
14421
  } catch (t) {
14422
14422
  this.logger.error("Failed to refresh active plugins store, syncing from stale data.", { error: t });
14423
14423
  }
14424
- const s = n(this, is).getAll();
14424
+ const s = n(this, ns).getAll();
14425
14425
  Object.entries(s).forEach(([t, e]) => {
14426
14426
  if (!e)
14427
14427
  return;
@@ -14434,7 +14434,7 @@ const Wf = (Gg = class {
14434
14434
  });
14435
14435
  });
14436
14436
  }, Bo = new WeakSet(), Ku = function() {
14437
- n(this, is).subscribe("*", (s) => {
14437
+ n(this, ns).subscribe("*", (s) => {
14438
14438
  Object.entries(s).forEach(([t, e]) => {
14439
14439
  const r = this.plugins.all.get(t);
14440
14440
  if (!r) {
@@ -17246,7 +17246,7 @@ Jc([
17246
17246
  Jc([
17247
17247
  Ut(ba, "bulkRateLimitConfig")
17248
17248
  ], ka.prototype, "bulkDelete", 1);
17249
- var Dr, Or, Ko, Yu, zo, ns, jd, sS;
17249
+ var Dr, Or, Ko, Yu, zo, as, jd, sS;
17250
17250
  class pD {
17251
17251
  constructor(t, e) {
17252
17252
  m(this, Ko);
@@ -17255,7 +17255,7 @@ class pD {
17255
17255
  m(this, Dr, void 0);
17256
17256
  m(this, Or, "");
17257
17257
  m(this, zo, void 0);
17258
- m(this, ns, /* @__PURE__ */ new Map());
17258
+ m(this, as, /* @__PURE__ */ new Map());
17259
17259
  f(this, Dr, e), f(this, Or, t.getValue("meetingId")), f(this, zo, t), O(this, jd, sS).call(this);
17260
17260
  }
17261
17261
  create(t, e = !1) {
@@ -17266,24 +17266,24 @@ class pD {
17266
17266
  );
17267
17267
  return n(this, Dr).storeGetKeys(n(this, Or), t, []), new Promise((a, o) => {
17268
17268
  const c = setTimeout(() => {
17269
- n(this, ns).delete(t), o(Error("Failed"));
17269
+ n(this, as).delete(t), o(Error("Failed"));
17270
17270
  }, 3e3);
17271
- n(this, ns).set(t, { rejectTimeout: c, resolve: a, store: r });
17271
+ n(this, as).set(t, { rejectTimeout: c, resolve: a, store: r });
17272
17272
  });
17273
17273
  }
17274
17274
  refresh(t) {
17275
17275
  const e = this.stores.get(t);
17276
17276
  return e ? (e.clear(), n(this, Dr).storeGetKeys(n(this, Or), t, []), new Promise((i, a) => {
17277
17277
  const o = setTimeout(() => {
17278
- n(this, ns).delete(t), a(Error("Store refresh timed out"));
17278
+ n(this, as).delete(t), a(Error("Store refresh timed out"));
17279
17279
  }, 3e3);
17280
- n(this, ns).set(t, { rejectTimeout: o, resolve: i, store: e });
17280
+ n(this, as).set(t, { rejectTimeout: o, resolve: i, store: e });
17281
17281
  })) : Promise.reject(Error(`Store '${t}' does not exist`));
17282
17282
  }
17283
17283
  }
17284
17284
  Dr = new WeakMap(), Or = new WeakMap(), Ko = new WeakSet(), Yu = function() {
17285
17285
  return n(this, zo).getValue("peerId");
17286
- }, zo = new WeakMap(), ns = new WeakMap(), jd = new WeakSet(), sS = function() {
17286
+ }, zo = new WeakMap(), as = new WeakMap(), jd = new WeakSet(), sS = function() {
17287
17287
  [
17288
17288
  Ns.storeInsertKeys,
17289
17289
  Ns.storeGetKeys,
@@ -17307,15 +17307,15 @@ Dr = new WeakMap(), Or = new WeakMap(), Ko = new WeakSet(), Yu = function() {
17307
17307
  };
17308
17308
  });
17309
17309
  if (t === Ns.storeGetKeys) {
17310
- const c = n(this, ns).get(e.storeName), d = this.stores.get(e.storeName) || (c == null ? void 0 : c.store);
17311
- if (n(this, ns).get(e.storeName) && (this.stores.set(e.storeName, c.store), c.resolve(d), clearTimeout(c.rejectTimeout), n(this, ns).delete(e.storeName)), !d)
17310
+ const c = n(this, as).get(e.storeName), d = this.stores.get(e.storeName) || (c == null ? void 0 : c.store);
17311
+ if (n(this, as).get(e.storeName) && (this.stores.set(e.storeName, c.store), c.resolve(d), clearTimeout(c.rejectTimeout), n(this, as).delete(e.storeName)), !d)
17312
17312
  return;
17313
17313
  r.forEach((l) => {
17314
17314
  d.set(l.key, l.payload, !1, !1);
17315
17315
  });
17316
17316
  return;
17317
17317
  }
17318
- const i = this.stores.get(e.storeName) || ((o = n(this, ns).get(e.storeName)) == null ? void 0 : o.store);
17318
+ const i = this.stores.get(e.storeName) || ((o = n(this, as).get(e.storeName)) == null ? void 0 : o.store);
17319
17319
  i !== void 0 && (t === Ns.storeInsertKeys && r.forEach(({ key: c, peerId: d, payload: l }) => {
17320
17320
  d !== n(this, Ko, Yu) && i.set(c, l, !1, !0);
17321
17321
  }), t === Ns.storeDeleteKeys && r.forEach(({ key: c, peerId: d }) => {
@@ -17898,7 +17898,7 @@ var ED = Object.defineProperty, PD = Object.getOwnPropertyDescriptor, Ds = (s, t
17898
17898
  };
17899
17899
  const _D = ["ACTIVE_GRID", "PAGINATED", "MANUAL"];
17900
17900
  var be, Xo, Xu, Ii, eo, Kn, pd, Mi, ft, zg;
17901
- let Zt = (zg = class extends xt {
17901
+ let es = (zg = class extends xt {
17902
17902
  constructor(t, e, r) {
17903
17903
  const i = t.getValue("logger");
17904
17904
  super(i);
@@ -18309,42 +18309,42 @@ let Zt = (zg = class extends xt {
18309
18309
  }, Mi = new WeakMap(), ft = new WeakMap(), zg);
18310
18310
  Ds([
18311
18311
  P.trace("Participants.setViewMode")
18312
- ], Zt.prototype, "setViewMode", 1);
18312
+ ], es.prototype, "setViewMode", 1);
18313
18313
  Ds([
18314
18314
  P.trace("Participants.setPage")
18315
- ], Zt.prototype, "setPage", 1);
18315
+ ], es.prototype, "setPage", 1);
18316
18316
  Ds([
18317
18317
  P.trace("Participants.disableAllAudio")
18318
- ], Zt.prototype, "disableAllAudio", 1);
18318
+ ], es.prototype, "disableAllAudio", 1);
18319
18319
  Ds([
18320
18320
  P.trace("Participants.disableAllVideo")
18321
- ], Zt.prototype, "disableAllVideo", 1);
18321
+ ], es.prototype, "disableAllVideo", 1);
18322
18322
  Ds([
18323
18323
  P.trace("Participants.kickAll")
18324
- ], Zt.prototype, "kickAll", 1);
18324
+ ], es.prototype, "kickAll", 1);
18325
18325
  Ds([
18326
18326
  P.trace("Participants.broadcastMessage"),
18327
18327
  Ut(ba, "rateLimitConfig")
18328
- ], Zt.prototype, "broadcastMessage", 1);
18328
+ ], es.prototype, "broadcastMessage", 1);
18329
18329
  Ds([
18330
18330
  P.trace("Participants.getAllJoinedPeers"),
18331
18331
  Ut({ maxInvocations: 10, period: 60 })
18332
- ], Zt.prototype, "getAllJoinedPeers", 1);
18332
+ ], es.prototype, "getAllJoinedPeers", 1);
18333
18333
  Ds([
18334
18334
  P.trace("Participant.updatePermissions"),
18335
18335
  Ut({ maxInvocations: 1e3, period: 60 })
18336
- ], Zt.prototype, "updatePermissions", 1);
18336
+ ], es.prototype, "updatePermissions", 1);
18337
18337
  Ds([
18338
18338
  P.trace("Participants.getParticipantsInMeetingPreJoin")
18339
- ], Zt.prototype, "getParticipantsInMeetingPreJoin", 1);
18340
- Zt = Ds([
18339
+ ], es.prototype, "getParticipantsInMeetingPreJoin", 1);
18340
+ es = Ds([
18341
18341
  rt("1200")
18342
- ], Zt);
18342
+ ], es);
18343
18343
  var CD = Object.defineProperty, wD = Object.getOwnPropertyDescriptor, cn = (s, t, e, r) => {
18344
18344
  for (var i = r > 1 ? void 0 : r ? wD(t, e) : t, a = s.length - 1, o; a >= 0; a--)
18345
18345
  (o = s[a]) && (i = (r ? o(t, e, i) : o(i)) || i);
18346
18346
  return r && i && CD(t, e, i), i;
18347
- }, Jt, as, xr, Yg;
18347
+ }, Jt, os, xr, Yg;
18348
18348
  const oS = (Yg = class {
18349
18349
  constructor(s, t, e) {
18350
18350
  p(this, "participants");
@@ -18357,7 +18357,7 @@ const oS = (Yg = class {
18357
18357
  p(this, "context");
18358
18358
  p(this, "videoPeerConsumerMap", /* @__PURE__ */ new Map());
18359
18359
  m(this, Jt, { mode: "ACTIVE_GRID", page: 0 });
18360
- m(this, as, !1);
18360
+ m(this, os, !1);
18361
18361
  m(this, xr, !1);
18362
18362
  p(this, "updateConsumerSpatialLayers", $h(() => {
18363
18363
  const s = {}, t = new Map(this.maxSpatialLayerUpdates);
@@ -18372,7 +18372,7 @@ const oS = (Yg = class {
18372
18372
  });
18373
18373
  }, 2e3));
18374
18374
  p(this, "updateConsumers", (r, i, ...a) => u(this, [r, i, ...a], function* (s, t, e = []) {
18375
- this.logger.info(`updateConsumers: Starting consumer updates - AddProducers: ${s.length}, RemoveProducers: ${t.length}, RemoveStaleConsumers: ${e.length}, ConsumersSyncing: ${n(this, as)}`);
18375
+ this.logger.info(`updateConsumers: Starting consumer updates - AddProducers: ${s.length}, RemoveProducers: ${t.length}, RemoveStaleConsumers: ${e.length}, ConsumersSyncing: ${n(this, os)}`);
18376
18376
  try {
18377
18377
  s.length !== 0 && (this.logger.info(`updateConsumers: Creating consumers for ${s.length} producers: [${s.map((o) => o.producerId).join(", ")}]`), yield this.roomNodeClient.createConsumers(s), this.logger.info("updateConsumers: Successfully created consumers."));
18378
18378
  } catch (o) {
@@ -18390,7 +18390,7 @@ const oS = (Yg = class {
18390
18390
  }
18391
18391
  this.logger.info("updateConsumers: Completed consumer updates.");
18392
18392
  }));
18393
- this.context = s, this.roomSocketHandler = e, this.participants = new Zt(s, t, this.roomSocketHandler), this.self = t, this.consumerPeerMap = /* @__PURE__ */ new Map(), this.events = hs, t.config.viewType !== "CHAT" && this.setupEventsGlobal(), this.setupEvents();
18393
+ this.context = s, this.roomSocketHandler = e, this.participants = new es(s, t, this.roomSocketHandler), this.self = t, this.consumerPeerMap = /* @__PURE__ */ new Map(), this.events = hs, t.config.viewType !== "CHAT" && this.setupEventsGlobal(), this.setupEvents();
18394
18394
  }
18395
18395
  get roomNodeClient() {
18396
18396
  return this.context.getValue("roomNodeClient");
@@ -18490,7 +18490,7 @@ const oS = (Yg = class {
18490
18490
  appData: { screenShare: t == null ? void 0 : t.screenShare }
18491
18491
  }
18492
18492
  }
18493
- ), (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, as)}, VideoSub: ${t.kind === "video" ? this.participants.videoSubscribed.has(s) : "N/A"}, AudioSub: ${t.kind === "audio" ? this.participants.audioSubscribed.has(s) : "N/A"}`), this.scheduleSyncConsumers({
18493
+ ), (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, os)}, VideoSub: ${t.kind === "video" ? this.participants.videoSubscribed.has(s) : "N/A"}, AudioSub: ${t.kind === "audio" ? this.participants.audioSubscribed.has(s) : "N/A"}`), this.scheduleSyncConsumers({
18494
18494
  source: "NEW_PRODUCER_AUTO"
18495
18495
  })) : this.logger.info(
18496
18496
  "ParticipantController::NEW_PRODUCER::not_consuming_producer_auto",
@@ -18551,7 +18551,7 @@ const oS = (Yg = class {
18551
18551
  const e = t;
18552
18552
  this.onParticipantPinned(e);
18553
18553
  const r = this.participants.joined.get(e);
18554
- r && (this.logger.info(`globalPeerPinBroadcast: Scheduling audio/video consumer sync for pinned participant ${e} - ProducerCount: ${r.producers.length}, ConsumersSyncing: ${n(this, as)}, ProducerIds: [${r.producers.map((i) => i.producerId).join(", ")}]`), this.scheduleSyncConsumers({
18554
+ r && (this.logger.info(`globalPeerPinBroadcast: Scheduling audio/video consumer sync for pinned participant ${e} - ProducerCount: ${r.producers.length}, ConsumersSyncing: ${n(this, os)}, ProducerIds: [${r.producers.map((i) => i.producerId).join(", ")}]`), this.scheduleSyncConsumers({
18555
18555
  source: "GLOBAL_PEER_PIN"
18556
18556
  }));
18557
18557
  }
@@ -18679,8 +18679,8 @@ const oS = (Yg = class {
18679
18679
  source: s
18680
18680
  }) {
18681
18681
  var r, i, a;
18682
- const e = ((r = n(this, Jt)) == null ? void 0 : r.mode) === "PAGINATED" && !n(this, as) ? 200 : 0;
18683
- this.logger.info(`scheduleSyncConsumers():: Source: ${s}, ViewMode: ${(i = n(this, Jt)) == null ? void 0 : i.mode}, ConsumersSyncing: ${n(this, as)}, Delay: ${e}, Page: ${(a = n(this, Jt)) == null ? void 0 : a.page}`), setTimeout(() => this.syncConsumers(), e);
18682
+ const e = ((r = n(this, Jt)) == null ? void 0 : r.mode) === "PAGINATED" && !n(this, os) ? 200 : 0;
18683
+ this.logger.info(`scheduleSyncConsumers():: Source: ${s}, ViewMode: ${(i = n(this, Jt)) == null ? void 0 : i.mode}, ConsumersSyncing: ${n(this, os)}, Delay: ${e}, Page: ${(a = n(this, Jt)) == null ? void 0 : a.page}`), setTimeout(() => this.syncConsumers(), e);
18684
18684
  });
18685
18685
  }
18686
18686
  /**
@@ -18715,11 +18715,11 @@ const oS = (Yg = class {
18715
18715
  this.logger.info("syncConsumers: Connection not ready, exiting.");
18716
18716
  return;
18717
18717
  }
18718
- if (n(this, as)) {
18718
+ if (n(this, os)) {
18719
18719
  f(this, xr, !0), this.logger.info("syncConsumers: Sync in progress, marking resyncRequired=true and exiting.");
18720
18720
  return;
18721
18721
  }
18722
- this.logger.info("syncConsumers: Starting sync operation."), f(this, as, !0), f(this, xr, !1);
18722
+ this.logger.info("syncConsumers: Starting sync operation."), f(this, os, !0), f(this, xr, !1);
18723
18723
  let t = [];
18724
18724
  this.participants.videoSubscribed.forEach((D) => {
18725
18725
  var F, X;
@@ -18790,7 +18790,7 @@ const oS = (Yg = class {
18790
18790
  } catch (D) {
18791
18791
  this.logger.error("syncConsumers: updateConsumers failed with error.", { error: D });
18792
18792
  } finally {
18793
- this.logger.info("syncConsumers: Setting consumersSyncing=false and completing sync."), f(this, as, !1), (x = s == null ? void 0 : s.socketState) != null && x.state && s.socketState.state !== "connected" && f(this, xr, !0);
18793
+ this.logger.info("syncConsumers: Setting consumersSyncing=false and completing sync."), f(this, os, !1), (x = s == null ? void 0 : s.socketState) != null && x.state && s.socketState.state !== "connected" && f(this, xr, !0);
18794
18794
  }
18795
18795
  n(this, xr) && (this.logger.info("syncConsumers: Resync required, calling syncConsumers again."), this.syncConsumers());
18796
18796
  });
@@ -19361,7 +19361,7 @@ const oS = (Yg = class {
19361
19361
  // priority
19362
19362
  })), t && this.context.getValue("peerSessionStore").emit(C.UPDATE_ACTIVE, { viewMode: this.participants.viewMode, page: this.participants.currentPage });
19363
19363
  }
19364
- }, Jt = new WeakMap(), as = new WeakMap(), xr = new WeakMap(), Yg);
19364
+ }, Jt = new WeakMap(), os = new WeakMap(), xr = new WeakMap(), Yg);
19365
19365
  let mr = oS;
19366
19366
  cn([
19367
19367
  P.trace("ParticipantController.setupEvents")
@@ -21426,8 +21426,8 @@ class Dd extends ep {
21426
21426
  }
21427
21427
  const l = (S, y) => {
21428
21428
  var U;
21429
- const E = ts.parse(S), k = E.media[E.media.length - 1], R = k.rtp.filter(($) => y.some((F) => F.name === $.codec)), A = k.fmtp.filter(($) => R.some((F) => F.payload === $.payload)), x = (U = k.rtcpFb) == null ? void 0 : U.filter(($) => R.some((F) => F.payload === $.payload)), D = R.map(($) => $.payload);
21430
- return E.media[E.media.length - 1].rtp = R, E.media[E.media.length - 1].fmtp = A, E.media[E.media.length - 1].rtcpFb = x, E.media[E.media.length - 1].payloads = D.join(" "), ts.write(E);
21429
+ const E = ss.parse(S), k = E.media[E.media.length - 1], R = k.rtp.filter(($) => y.some((F) => F.name === $.codec)), A = k.fmtp.filter(($) => R.some((F) => F.payload === $.payload)), x = (U = k.rtcpFb) == null ? void 0 : U.filter(($) => R.some((F) => F.payload === $.payload)), D = R.map(($) => $.payload);
21430
+ return E.media[E.media.length - 1].rtp = R, E.media[E.media.length - 1].fmtp = A, E.media[E.media.length - 1].rtcpFb = x, E.media[E.media.length - 1].payloads = D.join(" "), ss.write(E);
21431
21431
  }, h = yield this.pc.createOffer();
21432
21432
  if (h.sdp = l(h.sdp, i), this.logger.debug(`[SDP] send() | calling pc.setLocalDescription() [offer:${JSON.stringify(h)}]`), yield this.pc.setLocalDescription(h), e === "audio" || e.kind === "audio") {
21433
21433
  const { enableDtx: S, enableStereo: y } = this, E = this.enableHighBitrate ? y ? 128e3 : 64e3 : y ? 64e3 : 32e3;
@@ -21659,7 +21659,7 @@ sc = new WeakMap(), Di = new WeakMap(), Ts = new WeakMap(), Qd = new WeakMap(),
21659
21659
  }));
21660
21660
  }
21661
21661
  };
21662
- var os, sa, ra, Oi, Kt, Qe, Ur, ia, el, It, es;
21662
+ var cs, sa, ra, Oi, Kt, Qe, Ur, ia, el, It, ts;
21663
21663
  class ND extends Xl {
21664
21664
  /**
21665
21665
  * @emits transportclose
@@ -21684,7 +21684,7 @@ class ND extends Xl {
21684
21684
  /**
21685
21685
  * Associated RTCRtpSender.
21686
21686
  */
21687
- m(this, os, void 0);
21687
+ m(this, cs, void 0);
21688
21688
  /**
21689
21689
  * Kind of media on to this producer
21690
21690
  */
@@ -21714,7 +21714,7 @@ class ND extends Xl {
21714
21714
  m(this, Ur, void 0);
21715
21715
  m(this, ia, void 0);
21716
21716
  m(this, el, void 0);
21717
- this.id = r.id, this.localId = r.localId, f(this, Qe, r.track), this.kind = (i = r.track) == null ? void 0 : i.kind, f(this, Ur, r.disableTrackOnPause ? !((a = r.track) != null && a.enabled) : !1), f(this, ia, void 0), f(this, sa, r.stopTracks), f(this, ra, r.disableTrackOnPause), f(this, Oi, r.zeroRtpOnPause), this.appData = r.appData || {}, this._onTrackEnded = this._onTrackEnded.bind(this), f(this, os, r.handler), this.rtpSender = r.rtpSender, this._handleTrack(), f(this, el, e);
21717
+ this.id = r.id, this.localId = r.localId, f(this, Qe, r.track), this.kind = (i = r.track) == null ? void 0 : i.kind, f(this, Ur, r.disableTrackOnPause ? !((a = r.track) != null && a.enabled) : !1), f(this, ia, void 0), f(this, sa, r.stopTracks), f(this, ra, r.disableTrackOnPause), f(this, Oi, r.zeroRtpOnPause), this.appData = r.appData || {}, this._onTrackEnded = this._onTrackEnded.bind(this), f(this, cs, r.handler), this.rtpSender = r.rtpSender, this._handleTrack(), f(this, el, e);
21718
21718
  }
21719
21719
  /**
21720
21720
  * Whether the Producer is closed.
@@ -21749,11 +21749,11 @@ class ND extends Xl {
21749
21749
  return u(this, null, function* () {
21750
21750
  if (n(this, Kt))
21751
21751
  return;
21752
- if (this.logger.debug(`Producer::close() ${e ? `with reason ${e}` : ""}`, n(this, It, es)), f(this, Kt, !0), this._destroyTrack(), e === Ro) {
21752
+ if (this.logger.debug(`Producer::close() ${e ? `with reason ${e}` : ""}`, n(this, It, ts)), f(this, Kt, !0), this._destroyTrack(), e === Ro) {
21753
21753
  this.safeEmit("close", { reason: e });
21754
21754
  return;
21755
21755
  }
21756
- const { offerSdp: r, callback: i } = yield n(this, os).stopSending(this.localId), { answer: a } = yield this.safeEmitAsPromise("close", { offer: r, reason: e });
21756
+ const { offerSdp: r, callback: i } = yield n(this, cs).stopSending(this.localId), { answer: a } = yield this.safeEmitAsPromise("close", { offer: r, reason: e });
21757
21757
  i(a);
21758
21758
  });
21759
21759
  }
@@ -21764,24 +21764,24 @@ class ND extends Xl {
21764
21764
  return u(this, null, function* () {
21765
21765
  if (n(this, Kt))
21766
21766
  throw new Et("closed");
21767
- return n(this, os).getSenderStats(this.localId);
21767
+ return n(this, cs).getSenderStats(this.localId);
21768
21768
  });
21769
21769
  }
21770
21770
  /**
21771
21771
  * Pauses sending media.
21772
21772
  */
21773
21773
  pause() {
21774
- this.logger.debug("Producer::pause()", n(this, It, es)), n(this, Kt) && this.logger.error("Producer::pause() | Producer closed", n(this, It, es)), f(this, Ur, !0), n(this, Qe) && n(this, ra) && (n(this, Qe).enabled = !1), n(this, Oi) && n(this, os).replaceTrack(this.localId, null), this.emit("pause");
21774
+ this.logger.debug("Producer::pause()", n(this, It, ts)), n(this, Kt) && this.logger.error("Producer::pause() | Producer closed", n(this, It, ts)), f(this, Ur, !0), n(this, Qe) && n(this, ra) && (n(this, Qe).enabled = !1), n(this, Oi) && n(this, cs).replaceTrack(this.localId, null), this.emit("pause");
21775
21775
  }
21776
21776
  /**
21777
21777
  * Resumes sending media.
21778
21778
  */
21779
21779
  resume() {
21780
- if (this.logger.debug("Producer::resume()", n(this, It, es)), n(this, Kt)) {
21781
- this.logger.error("Producer::resume() | Producer closed", n(this, It, es));
21780
+ if (this.logger.debug("Producer::resume()", n(this, It, ts)), n(this, Kt)) {
21781
+ this.logger.error("Producer::resume() | Producer closed", n(this, It, ts));
21782
21782
  return;
21783
21783
  }
21784
- f(this, Ur, !1), n(this, Qe) && n(this, ra) && (n(this, Qe).enabled = !0), n(this, Oi) && n(this, os).replaceTrack(this.localId, n(this, Qe)), this.emit("resume");
21784
+ f(this, Ur, !1), n(this, Qe) && n(this, ra) && (n(this, Qe).enabled = !0), n(this, Oi) && n(this, cs).replaceTrack(this.localId, n(this, Qe)), this.emit("resume");
21785
21785
  }
21786
21786
  /**
21787
21787
  * Replaces the current track with a new one or null.
@@ -21790,12 +21790,12 @@ class ND extends Xl {
21790
21790
  return u(this, arguments, function* ({
21791
21791
  track: e
21792
21792
  }) {
21793
- if (this.logger.debug(`Producer::replaceTrack() trackId: ${e == null ? void 0 : e.id}`, n(this, It, es)), n(this, Kt)) {
21793
+ if (this.logger.debug(`Producer::replaceTrack() trackId: ${e == null ? void 0 : e.id}`, n(this, It, ts)), n(this, Kt)) {
21794
21794
  if (e && n(this, sa))
21795
21795
  try {
21796
21796
  e.stop();
21797
21797
  } catch (i) {
21798
- this.logger.error("Producer::replaceTrack", z(L({}, n(this, It, es)), {
21798
+ this.logger.error("Producer::replaceTrack", z(L({}, n(this, It, ts)), {
21799
21799
  error: i
21800
21800
  }));
21801
21801
  }
@@ -21803,10 +21803,10 @@ class ND extends Xl {
21803
21803
  } else if (e && e.readyState === "ended")
21804
21804
  throw new Et("track ended");
21805
21805
  if (e === n(this, Qe)) {
21806
- this.logger.debug(`replaceTrack() | same track, ignored trackId: ${e.id}`, n(this, It, es));
21806
+ this.logger.debug(`replaceTrack() | same track, ignored trackId: ${e.id}`, n(this, It, ts));
21807
21807
  return;
21808
21808
  }
21809
- (!n(this, Oi) || !n(this, Ur)) && (yield n(this, os).replaceTrack(this.localId, e)), this._destroyTrack(), f(this, Qe, e), this._handleTrack();
21809
+ (!n(this, Oi) || !n(this, Ur)) && (yield n(this, cs).replaceTrack(this.localId, e)), this._destroyTrack(), f(this, Qe, e), this._handleTrack();
21810
21810
  });
21811
21811
  }
21812
21812
  /**
@@ -21820,7 +21820,7 @@ class ND extends Xl {
21820
21820
  throw new wo("not a video Producer");
21821
21821
  if (typeof e != "number")
21822
21822
  throw new TypeError("invalid spatialLayer");
21823
- yield n(this, os).setMaxSpatialLayer(this.localId, e), f(this, ia, e);
21823
+ yield n(this, cs).setMaxSpatialLayer(this.localId, e), f(this, ia, e);
21824
21824
  });
21825
21825
  }
21826
21826
  /**
@@ -21832,11 +21832,11 @@ class ND extends Xl {
21832
21832
  throw new Et("closed");
21833
21833
  if (typeof e != "object")
21834
21834
  throw new TypeError("invalid params");
21835
- yield n(this, os).setRtpEncodingParameters(this.localId, e);
21835
+ yield n(this, cs).setRtpEncodingParameters(this.localId, e);
21836
21836
  });
21837
21837
  }
21838
21838
  _onTrackEnded() {
21839
- this.logger.debug(`Producer::track "ended" event trackId: ${this.track.id}`, n(this, It, es)), this.safeEmit("trackended", this.track.id);
21839
+ this.logger.debug(`Producer::track "ended" event trackId: ${this.track.id}`, n(this, It, ts)), this.safeEmit("trackended", this.track.id);
21840
21840
  }
21841
21841
  _handleTrack() {
21842
21842
  n(this, Qe) && n(this, Qe).addEventListener("ended", this._onTrackEnded);
@@ -21847,13 +21847,13 @@ class ND extends Xl {
21847
21847
  try {
21848
21848
  n(this, Qe).removeEventListener("ended", this._onTrackEnded), n(this, sa) && n(this, Qe).stop();
21849
21849
  } catch (r) {
21850
- this.logger.error(`Producer::_destroyTrack trackId: ${(e = this.track) == null ? void 0 : e.id}`, z(L({}, n(this, It, es)), {
21850
+ this.logger.error(`Producer::_destroyTrack trackId: ${(e = this.track) == null ? void 0 : e.id}`, z(L({}, n(this, It, ts)), {
21851
21851
  error: r
21852
21852
  }));
21853
21853
  }
21854
21854
  }
21855
21855
  }
21856
- os = new WeakMap(), sa = new WeakMap(), ra = new WeakMap(), Oi = new WeakMap(), Kt = new WeakMap(), Qe = new WeakMap(), Ur = new WeakMap(), ia = new WeakMap(), el = new WeakMap(), It = new WeakSet(), es = function() {
21856
+ cs = new WeakMap(), sa = new WeakMap(), ra = new WeakMap(), Oi = new WeakMap(), Kt = new WeakMap(), Qe = new WeakMap(), Ur = new WeakMap(), ia = new WeakMap(), el = new WeakMap(), It = new WeakSet(), ts = function() {
21857
21857
  return {
21858
21858
  producer: {
21859
21859
  id: this.id,
@@ -22114,7 +22114,7 @@ const Tn = class extends Xl {
22114
22114
  });
22115
22115
  }
22116
22116
  static parseCodecAndFmtpMappings(e, r) {
22117
- const i = ts.parse(e.sdp), a = {};
22117
+ const i = ss.parse(e.sdp), a = {};
22118
22118
  return i.media.forEach((o) => {
22119
22119
  r.includes(o.mid.toString()) && (a[o.mid.toString()] = {
22120
22120
  rtp: o.rtp,
@@ -22125,7 +22125,7 @@ const Tn = class extends Xl {
22125
22125
  }), a;
22126
22126
  }
22127
22127
  static setCodecAndFmtpMappings(e, r, i) {
22128
- const a = ts.parse(e.sdp);
22128
+ const a = ss.parse(e.sdp);
22129
22129
  return a.media = a.media.map((c) => {
22130
22130
  if (r.includes(c.mid.toString())) {
22131
22131
  const d = L({}, c);
@@ -22133,22 +22133,22 @@ const Tn = class extends Xl {
22133
22133
  }
22134
22134
  return c;
22135
22135
  }), z(L({}, e), {
22136
- sdp: ts.write(a)
22136
+ sdp: ss.write(a)
22137
22137
  });
22138
22138
  }
22139
22139
  static parseHeaderExtensionMappings(e) {
22140
- const r = ts.parse(e.sdp), i = {};
22140
+ const r = ss.parse(e.sdp), i = {};
22141
22141
  return r.media.forEach((a) => {
22142
22142
  i[a.mid] = a.ext;
22143
22143
  }), i;
22144
22144
  }
22145
22145
  static setHeaderExtensionMappings(e, r) {
22146
- const i = ts.parse(e.sdp);
22146
+ const i = ss.parse(e.sdp);
22147
22147
  return i.media = i.media.map((o) => {
22148
22148
  const c = L({}, o);
22149
22149
  return c.ext = r[o.mid], c;
22150
22150
  }), z(L({}, e), {
22151
- sdp: ts.write(i)
22151
+ sdp: ss.write(i)
22152
22152
  });
22153
22153
  }
22154
22154
  closeConsumers(e, r) {
@@ -22183,7 +22183,7 @@ const Tn = class extends Xl {
22183
22183
  this.logger.info("[SDP] Received offer from SFU", { sdp: e.sdp }), yield this.setRemoteDescription(e);
22184
22184
  const r = yield this.handler.pc.createAnswer();
22185
22185
  this.logger.info("[SDP] Created answer corresponding to received offer", { sdp: r.sdp });
22186
- const i = ts.parse(r.sdp);
22186
+ const i = ss.parse(r.sdp);
22187
22187
  return i.media = i.media.map((a) => {
22188
22188
  if (a.type === "audio") {
22189
22189
  const o = L({}, a), c = o.fmtp.find(
@@ -22197,7 +22197,7 @@ const Tn = class extends Xl {
22197
22197
  }), o;
22198
22198
  }
22199
22199
  return a;
22200
- }), r.sdp = ts.write(i), this.logger.info("[SDP] Setting munged SDP", { sdp: r.sdp }), yield this.setLocalDescription(r), this.logger.info("[SDP] Successfully set local description", { sdp: r.sdp }), r;
22200
+ }), r.sdp = ss.write(i), this.logger.info("[SDP] Setting munged SDP", { sdp: r.sdp }), yield this.setLocalDescription(r), this.logger.info("[SDP] Successfully set local description", { sdp: r.sdp }), r;
22201
22201
  } catch (r) {
22202
22202
  throw this.logger.error("Set remote offer failed", { error: r }), r;
22203
22203
  }
@@ -22867,7 +22867,7 @@ class rp {
22867
22867
  this.socketHandler = t;
22868
22868
  }
22869
22869
  static getMSIDFromSDP(t, e) {
22870
- return ts.parse(t).media.filter(
22870
+ return ss.parse(t).media.filter(
22871
22871
  (a) => e === "video" ? a.type === "video" : a.type === "audio"
22872
22872
  ).at(-1).msid;
22873
22873
  }
@@ -23155,7 +23155,7 @@ Br = new WeakMap(), Hr = new WeakMap(), la = new WeakMap(), lc = new WeakMap(),
23155
23155
  peerId: e.peerId
23156
23156
  });
23157
23157
  };
23158
- var hc, pc, gc, ha, pa, ga, mc, fc, ma, St, cs, ds, xi, Ui, Ks, Sc, pl, PS, gl, _S, ml, CS, fl, wS;
23158
+ var hc, pc, gc, ha, pa, ga, mc, fc, ma, St, ds, ls, xi, Ui, Ks, Sc, pl, PS, gl, _S, ml, CS, fl, wS;
23159
23159
  const Sl = class {
23160
23160
  constructor({
23161
23161
  initialEnergyThreshold: t = 0.015,
@@ -23191,16 +23191,16 @@ const Sl = class {
23191
23191
  m(this, ma, void 0);
23192
23192
  // State variables
23193
23193
  m(this, St, void 0);
23194
- m(this, cs, void 0);
23195
- m(this, ds, !1);
23194
+ m(this, ds, void 0);
23195
+ m(this, ls, !1);
23196
23196
  m(this, xi, 0);
23197
23197
  m(this, Ui, 0);
23198
23198
  m(this, Ks, []);
23199
23199
  m(this, Sc, void 0);
23200
- f(this, ha, t), f(this, St, t), f(this, hc, e), f(this, pc, r), f(this, gc, i), f(this, pa, a), f(this, ga, o), f(this, mc, c), f(this, fc, d), f(this, ma, l), f(this, Sc, h), f(this, cs, t / 2);
23200
+ f(this, ha, t), f(this, St, t), f(this, hc, e), f(this, pc, r), f(this, gc, i), f(this, pa, a), f(this, ga, o), f(this, mc, c), f(this, fc, d), f(this, ma, l), f(this, Sc, h), f(this, ds, t / 2);
23201
23201
  }
23202
23202
  get voiceDetected() {
23203
- return n(this, ds);
23203
+ return n(this, ls);
23204
23204
  }
23205
23205
  /**
23206
23206
  * Process an audio chunk and determine if it contains voice activity
@@ -23210,13 +23210,13 @@ const Sl = class {
23210
23210
  processAudioChunk(t) {
23211
23211
  var o, c;
23212
23212
  const e = O(o = Sl, ml, CS).call(o, t), r = O(c = Sl, fl, wS).call(c, t);
23213
- return O(this, pl, PS).call(this, e), e / n(this, cs) > n(this, ma) && e > n(this, St) && r > n(this, hc) ? (f(this, xi, n(this, xi) + 1), f(this, Ui, n(this, gc)), n(this, xi) >= n(this, pc) && f(this, ds, !0)) : (f(this, xi, 0), n(this, Ui) > 0 ? f(this, Ui, n(this, Ui) - 1) : n(this, ds) && f(this, ds, !1), n(this, ds) || O(this, gl, _S).call(this, e)), { energy: e, isVoice: n(this, ds) };
23213
+ return O(this, pl, PS).call(this, e), e / n(this, ds) > n(this, ma) && e > n(this, St) && r > n(this, hc) ? (f(this, xi, n(this, xi) + 1), f(this, Ui, n(this, gc)), n(this, xi) >= n(this, pc) && f(this, ls, !0)) : (f(this, xi, 0), n(this, Ui) > 0 ? f(this, Ui, n(this, Ui) - 1) : n(this, ls) && f(this, ls, !1), n(this, ls) || O(this, gl, _S).call(this, e)), { energy: e, isVoice: n(this, ls) };
23214
23214
  }
23215
23215
  /**
23216
23216
  * Reset the detector state
23217
23217
  */
23218
23218
  reset() {
23219
- f(this, ds, !1), f(this, xi, 0), f(this, Ui, 0), f(this, St, n(this, ha)), f(this, cs, n(this, ha) / 2), f(this, Ks, []);
23219
+ f(this, ls, !1), f(this, xi, 0), f(this, Ui, 0), f(this, St, n(this, ha)), f(this, ds, n(this, ha) / 2), f(this, Ks, []);
23220
23220
  }
23221
23221
  /**
23222
23222
  * Get current adaptive threshold values for debugging/visualization
@@ -23224,14 +23224,14 @@ const Sl = class {
23224
23224
  getThresholdInfo() {
23225
23225
  return {
23226
23226
  currentEnergyThreshold: n(this, St),
23227
- backgroundNoiseEnergy: n(this, cs),
23227
+ backgroundNoiseEnergy: n(this, ds),
23228
23228
  energyRatioThreshold: n(this, ma)
23229
23229
  };
23230
23230
  }
23231
23231
  };
23232
23232
  let to = Sl;
23233
- hc = new WeakMap(), pc = new WeakMap(), gc = new WeakMap(), ha = new WeakMap(), pa = new WeakMap(), ga = new WeakMap(), mc = new WeakMap(), fc = new WeakMap(), ma = new WeakMap(), St = new WeakMap(), cs = new WeakMap(), ds = new WeakMap(), xi = new WeakMap(), Ui = new WeakMap(), Ks = new WeakMap(), Sc = new WeakMap(), pl = new WeakSet(), PS = function(t) {
23234
- n(this, ds) ? f(this, St, n(this, ga) * n(this, St) + (1 - n(this, ga)) * t) : f(this, St, n(this, pa) * n(this, St) + (1 - n(this, pa)) * n(this, cs)), f(this, St, Math.max(
23233
+ hc = new WeakMap(), pc = new WeakMap(), gc = new WeakMap(), ha = new WeakMap(), pa = new WeakMap(), ga = new WeakMap(), mc = new WeakMap(), fc = new WeakMap(), ma = new WeakMap(), St = new WeakMap(), ds = new WeakMap(), ls = new WeakMap(), xi = new WeakMap(), Ui = new WeakMap(), Ks = new WeakMap(), Sc = new WeakMap(), pl = new WeakSet(), PS = function(t) {
23234
+ n(this, ls) ? f(this, St, n(this, ga) * n(this, St) + (1 - n(this, ga)) * t) : f(this, St, n(this, pa) * n(this, St) + (1 - n(this, pa)) * n(this, ds)), f(this, St, Math.max(
23235
23235
  n(this, mc),
23236
23236
  Math.min(n(this, fc), n(this, St))
23237
23237
  ));
@@ -23239,9 +23239,9 @@ hc = new WeakMap(), pc = new WeakMap(), gc = new WeakMap(), ha = new WeakMap(),
23239
23239
  if (t < n(this, St) * 1.2)
23240
23240
  if (n(this, Ks).push(t), n(this, Ks).length > n(this, Sc) && n(this, Ks).shift(), n(this, Ks).length >= 10) {
23241
23241
  const e = [...n(this, Ks)].sort((i, a) => i - a), r = Math.floor(e.length / 2);
23242
- f(this, cs, e[r]);
23242
+ f(this, ds, e[r]);
23243
23243
  } else
23244
- f(this, cs, 0.95 * n(this, cs) + 0.05 * t);
23244
+ f(this, ds, 0.95 * n(this, ds) + 0.05 * t);
23245
23245
  }, ml = new WeakSet(), CS = function(t) {
23246
23246
  return Math.sqrt(
23247
23247
  t.map((e) => e * e).reduce((e, r) => e + r) / t.length
@@ -24301,7 +24301,7 @@ var JD = Object.defineProperty, KD = Object.getOwnPropertyDescriptor, dn = (s, t
24301
24301
  for (var i = r > 1 ? void 0 : r ? KD(t, e) : t, a = s.length - 1, o; a >= 0; a--)
24302
24302
  (o = s[a]) && (i = (r ? o(t, e, i) : o(i)) || i);
24303
24303
  return r && i && JD(t, e, i), i;
24304
- }, Rc, ls, te, Tt, Bt, Xg;
24304
+ }, Rc, Yt, te, Tt, Bt, Xg;
24305
24305
  const $S = (Xg = class {
24306
24306
  /**
24307
24307
  * Use await SelfController.init(roomNodeClient) instead
@@ -24313,10 +24313,10 @@ const $S = (Xg = class {
24313
24313
  p(this, "authToken");
24314
24314
  m(this, Rc, void 0);
24315
24315
  p(this, "viewType");
24316
- m(this, ls, void 0);
24316
+ m(this, Yt, void 0);
24317
24317
  m(this, te, void 0);
24318
24318
  const { socket: i } = e, a = s.getValue("authToken");
24319
- this.self = t, f(this, te, s), this.viewType = r, this.authToken = a, f(this, Rc, i), f(this, ls, e), this.setupEvents();
24319
+ this.self = t, f(this, te, s), this.viewType = r, this.authToken = a, f(this, Rc, i), f(this, Yt, e), this.setupEvents();
24320
24320
  }
24321
24321
  get peerId() {
24322
24322
  return n(this, te).getValue("peerId");
@@ -24477,17 +24477,17 @@ const $S = (Xg = class {
24477
24477
  this.self.roomState !== "disconnected" && (this.self.roomState = "disconnected", this.self.emit("roomLeft", { state: "disconnected" }));
24478
24478
  }), n(this, te).getValue("peerSessionStore").on(C.SOCKET_SERVICE_FAILED, () => {
24479
24479
  this.logger.error("Socket reconnection failed after exhausting all attempts. SDK re-initialization is required."), this.self.roomState = "failed", this.self.emit("roomLeft", { state: "failed" });
24480
- }), n(this, ls).on(B.waitingRoomRequestAccepted, () => {
24480
+ }), n(this, Yt).on(B.waitingRoomRequestAccepted, () => {
24481
24481
  this.waitlistAcceptHandler();
24482
- }), n(this, ls).on(dd.updateUserPreset, (s) => {
24482
+ }), n(this, Yt).on(dd.updateUserPreset, (s) => {
24483
24483
  s.updatePeersPresets.forEach((t) => {
24484
24484
  t.userIds === this.self.userId && n(this, te).getValue("peerSessionStore").emit(C.UPDATE_PERMISSIONS, t.patch);
24485
24485
  });
24486
- }), n(this, ls).on(B.waitingRoomRequestDenied, () => {
24486
+ }), n(this, Yt).on(B.waitingRoomRequestDenied, () => {
24487
24487
  this.waitlistRejectedHandler();
24488
- }), n(this, ls).on(B.kick, () => {
24488
+ }), n(this, Yt).on(B.kick, () => {
24489
24489
  this.kickHandler({ kickType: "kick" });
24490
- }), n(this, ls).on(B.kickAll, () => {
24490
+ }), n(this, Yt).on(B.kickAll, () => {
24491
24491
  this.kickHandler({ kickType: "kickAll" });
24492
24492
  }), n(this, te).getValue("peerSessionStore").onAsync(C.JOIN_MEDIA_ROOM, this.joinMediaRoom.bind(this)), n(this, te).getValue("peerSessionStore").on(
24493
24493
  C.PRODUCER_SCORE_UPDATE,
@@ -24523,10 +24523,10 @@ const $S = (Xg = class {
24523
24523
  return u(this, null, function* () {
24524
24524
  try {
24525
24525
  this.logger.info("Joining socket room.");
24526
- const { peer: t } = yield n(this, ls).joinRoom(
24526
+ const { peer: t } = yield n(this, Yt).joinRoom(
24527
24527
  this.self
24528
24528
  );
24529
- this.logger.info("Joined socket room."), n(this, ls).socket.flush();
24529
+ this.logger.info("Joined socket room."), n(this, Yt).socket.flush();
24530
24530
  const e = Gh(t.stageType);
24531
24531
  if (n(this, te).setValue("stageStatus", e, !1), t.waitlisted) {
24532
24532
  this.logger.info("Peer was waitlisted. Skipped joining media room."), this.waitlistedHandler();
@@ -24547,12 +24547,18 @@ const $S = (Xg = class {
24547
24547
  }
24548
24548
  leaveRoom(s = "left") {
24549
24549
  return u(this, null, function* () {
24550
- var t;
24550
+ var e;
24551
24551
  if (this.logger.info(`Leaving room with state: ${s}`), s === "rejected") {
24552
24552
  this.self.roomState = s, this.self.emit("roomLeft", { state: s });
24553
24553
  return;
24554
24554
  }
24555
- this.self.setIsPinned(!1), n(this, te).setValue("stageStatus", "OFF_STAGE", !1), yield this.leaveMediaRoom(s), n(this, te).setValue("roomNodeClient", void 0), n(this, te).notify("stageStatus"), (t = n(this, te).getValue("roomSocketHandler")) == null || t.cleanup(), this.self.roomState = s, this.self.emit("roomLeft", { state: s }), this.logger.info(`roomLeft event emitted with state: ${s}`);
24555
+ if (this.self.setIsPinned(!1), n(this, te).setValue("stageStatus", "OFF_STAGE", !1), yield this.leaveMediaRoom(s), n(this, te).setValue("roomNodeClient", void 0), n(this, te).notify("stageStatus"), n(this, te).getValue("connectionHandler").socketJoined)
24556
+ try {
24557
+ n(this, Yt).leaveRoom();
24558
+ } catch (r) {
24559
+ this.logger.error("SelfController.leaveRoom: socket leave failed", { error: r });
24560
+ }
24561
+ (e = n(this, te).getValue("roomSocketHandler")) == null || e.cleanup(), this.self.roomState = s, this.self.emit("roomLeft", { state: s }), this.logger.info(`roomLeft event emitted with state: ${s}`);
24556
24562
  });
24557
24563
  }
24558
24564
  joinMediaRoom(s = !1) {
@@ -24604,7 +24610,7 @@ const $S = (Xg = class {
24604
24610
  yield this.self.disableAudio(), yield this.self.disableVideo(), yield this.self.disableScreenShare(), this.self.cleanUpTracks(), this.self.destructMediaHandler(), navigator.isReactNative || this.self.removeDocumentEventListeners();
24605
24611
  });
24606
24612
  }
24607
- }, Rc = new WeakMap(), ls = new WeakMap(), te = new WeakMap(), Tt = new WeakSet(), Bt = function() {
24613
+ }, Rc = new WeakMap(), Yt = new WeakMap(), te = new WeakMap(), Tt = new WeakSet(), Bt = function() {
24608
24614
  return n(this, te).getValue("roomNodeClient");
24609
24615
  }, Xg);
24610
24616
  let ii = $S;
@@ -24995,12 +25001,10 @@ class BS {
24995
25001
  });
24996
25002
  }
24997
25003
  leaveRoom() {
24998
- return u(this, null, function* () {
24999
- this.socket.joinAttempted = !1, this.socket.sendMessagePromise(
25000
- B.leaveRoom,
25001
- lk.toBinary({})
25002
- );
25003
- });
25004
+ return this.socket.joinAttempted = !1, this.socket.sendMessage(
25005
+ B.leaveRoom,
25006
+ lk.toBinary({})
25007
+ );
25004
25008
  }
25005
25009
  kick(t) {
25006
25010
  return u(this, null, function* () {
@@ -26224,7 +26228,8 @@ const tv = (_u = class {
26224
26228
  capabilities: this.capabilities.map((a) => kd[a]).join(" "),
26225
26229
  joinWithDetails: !0,
26226
26230
  useCfWorker: !0,
26227
- useStartSession: !0
26231
+ useStartSession: !0,
26232
+ newReconnectionFlow: !0
26228
26233
  });
26229
26234
  return Object.entries(i).forEach(([a, o]) => {
26230
26235
  r.searchParams.append(a, o.toString());
@@ -27223,7 +27228,7 @@ let ei = (em = class {
27223
27228
  video: !0
27224
27229
  };
27225
27230
  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", rw({ baseURI: i.baseURI })), a.setValue("defaults", c), a.setValue("onError", e.onError || (() => {
27226
- })), a.setValue("cachedUserDetails", bs(e.cachedUserDetails)), a.setValue("sdkVersion", "2.0.3-staging.2"), (l = e.modules) != null && l.experimentalAudioPlayback && a.setValue("audioPlayback", new UO()), a;
27231
+ })), a.setValue("cachedUserDetails", bs(e.cachedUserDetails)), a.setValue("sdkVersion", "2.0.3-staging.4"), (l = e.modules) != null && l.experimentalAudioPlayback && a.setValue("audioPlayback", new UO()), a;
27227
27232
  }
27228
27233
  join() {
27229
27234
  return u(this, null, function* () {