@cloudflare/realtimekit-react 1.1.4-staging.2 → 1.1.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
@@ -5177,7 +5177,7 @@ var rp;
5177
5177
  (function(s) {
5178
5178
  s[s.INIT = 0] = "INIT", s[s.ACCEPTED = 1] = "ACCEPTED", s[s.DENIED = 2] = "DENIED", s[s.SYS_DENIED = 3] = "SYS_DENIED", s[s.FAILED = 4] = "FAILED", s[s.NOTFOUND = 5] = "NOTFOUND", s[s.NOT_APPLICABLE = 6] = "NOT_APPLICABLE";
5179
5179
  })(rp || (rp = {}));
5180
- function Xr(s) {
5180
+ function Zr(s) {
5181
5181
  return s ? s.split(".").slice(0, 2).concat(["0", "0"]).join(".") : "";
5182
5182
  }
5183
5183
  function Rd({ packetsLost: s, packetsSent: t }) {
@@ -5560,7 +5560,7 @@ class Mv {
5560
5560
  try {
5561
5561
  const d = `https://${e.location}`, p = yield (yield fetch(d)).json();
5562
5562
  if (((n = p.loc) == null ? void 0 : n.length) > 5)
5563
- return this.ipInformation = p, (o = this.ipInformation) != null && o.ip && (this.ipInformation.ip = Xr(this.ipInformation.ip)), p;
5563
+ return this.ipInformation = p, (o = this.ipInformation) != null && o.ip && (this.ipInformation.ip = Zr(this.ipInformation.ip)), p;
5564
5564
  throw Error("Insufficient data");
5565
5565
  } catch (d) {
5566
5566
  r.error("callstats::ipDetails:: failed to fetch ip using location service", { error: d });
@@ -5569,7 +5569,7 @@ class Mv {
5569
5569
  const d = yield fetch(`https://${e.locationLegacy}/?token=3c493932b0624c&peerId=${t}`, {
5570
5570
  method: "POST"
5571
5571
  });
5572
- this.ipInformation = yield d.json(), (c = this.ipInformation) != null && c.ip && (this.ipInformation.ip = Xr(this.ipInformation.ip));
5572
+ this.ipInformation = yield d.json(), (c = this.ipInformation) != null && c.ip && (this.ipInformation.ip = Zr(this.ipInformation.ip));
5573
5573
  } catch (d) {
5574
5574
  r.error("callstats::ipDetails:: failed to fetch ip using legacy location service", { error: d });
5575
5575
  }
@@ -5765,7 +5765,7 @@ class ym extends ut {
5765
5765
  }) || e[e.length - 1];
5766
5766
  }
5767
5767
  parseRTCReport(e, r = [], i = false, n = void 0, o = void 0) {
5768
- var P, k, A, N, H, $, F, K, re, Je, Is, vr, ni;
5768
+ var P, k, A, N, H, $, F, K, re, Je, Is, yr, ni;
5769
5769
  const c = e, d = new vm(), u = r.length ? new Set(r) : void 0, p = [], f = [], S = [], E = /* @__PURE__ */ new Map(), _ = /* @__PURE__ */ new Map();
5770
5770
  for (const I of c.values()) {
5771
5771
  if (u) {
@@ -6030,7 +6030,7 @@ class ym extends ut {
6030
6030
  score: +(w.score * 10).toFixed(),
6031
6031
  packetsLostPercentage: wd({
6032
6032
  packetsLost: (w.packetsLost || 0) - (((Is = this.audioConsumerToStatsMap.get(C)) == null ? void 0 : Is.packetsLost) || 0),
6033
- packetsReceived: (w.packetsReceived || 0) - (((vr = this.audioConsumerToStatsMap.get(C)) == null ? void 0 : vr.packetsReceived) || 0)
6033
+ packetsReceived: (w.packetsReceived || 0) - (((yr = this.audioConsumerToStatsMap.get(C)) == null ? void 0 : yr.packetsReceived) || 0)
6034
6034
  }),
6035
6035
  jitter: w.jitter || 0,
6036
6036
  isScreenShare: this.screenShareConsumers.has(C),
@@ -6044,7 +6044,7 @@ class ym extends ut {
6044
6044
  }
6045
6045
  }
6046
6046
  if (d.producerStreamMap.forEach((I, y) => {
6047
- var C, U, ie, Me, L, w, $e, yr, Tr, $s, Zn, eo, to, so, ro, io, ao, no, oo, co, lo, uo, ho;
6047
+ var C, U, ie, Me, L, w, $e, Tr, Er, $s, Zn, eo, to, so, ro, io, ao, no, oo, co, lo, uo, ho;
6048
6048
  if (I.outboundVideoRtpId.length > 0) {
6049
6049
  const ue = [];
6050
6050
  I.outboundVideoRtpId.forEach((tu) => {
@@ -6067,8 +6067,8 @@ class ym extends ut {
6067
6067
  jitter: (($e = se.remoteData) == null ? void 0 : $e.jitter) || 0,
6068
6068
  isScreenShare: this.screenShareProducers.has(y),
6069
6069
  packetsLostPercentage: Rd({
6070
- packetsSent: (se.packetsSent || 0) - (((yr = this.videoProducerToStatsMap.get(y)) == null ? void 0 : yr.packetsSent) || 0),
6071
- packetsLost: (((Tr = se.remoteData) == null ? void 0 : Tr.packetsLost) || 0) - (((Zn = ($s = this.videoProducerToStatsMap.get(y)) == null ? void 0 : $s.remoteData) == null ? void 0 : Zn.packetsLost) || 0)
6070
+ packetsSent: (se.packetsSent || 0) - (((Tr = this.videoProducerToStatsMap.get(y)) == null ? void 0 : Tr.packetsSent) || 0),
6071
+ packetsLost: (((Er = se.remoteData) == null ? void 0 : Er.packetsLost) || 0) - (((Zn = ($s = this.videoProducerToStatsMap.get(y)) == null ? void 0 : $s.remoteData) == null ? void 0 : Zn.packetsLost) || 0)
6072
6072
  }),
6073
6073
  bitrate: ((se.bytesSent || 0) - (((eo = this.videoProducerToStatsMap.get(y)) == null ? void 0 : eo.bytesSent) || 0)) * 8 / 7,
6074
6074
  cpuLimitations: se.qualityLimitationReason === "cpu",
@@ -6093,7 +6093,7 @@ class ym extends ut {
6093
6093
  }
6094
6094
  }), S.forEach((I) => {
6095
6095
  const y = p.find((U) => U.id === I.localCandidateId ? (I.localCandidateId = U.id, U) : null), C = f.find((U) => U.id === I.remoteCandidateId ? (I.remoteCandidateId = U.id, U) : null);
6096
- y && (I.localCandidateType = y.type, I.localCandidateAddress = Xr(y.address), I.localCandidatePort = y.port, I.localCandidateProtocol = y.protocol, I.localCandidateUrl = y.url, I.localCandidateNetworkType = y.networkType, I.localCandidateRelatedAddress = Xr(y.relatedAddress), I.localCandidateRelatedPort = y.relatedPort), C && (I.remoteCandidateType = C.type, I.remoteCandidateAddress = Xr(C.address), I.remoteCandidatePort = C.port, I.remoteCandidateProtocol = C.protocol, I.remoteCandidateUrl = C.url);
6096
+ y && (I.localCandidateType = y.type, I.localCandidateAddress = Zr(y.address), I.localCandidatePort = y.port, I.localCandidateProtocol = y.protocol, I.localCandidateUrl = y.url, I.localCandidateNetworkType = y.networkType, I.localCandidateRelatedAddress = Zr(y.relatedAddress), I.localCandidateRelatedPort = y.relatedPort), C && (I.remoteCandidateType = C.type, I.remoteCandidateAddress = Zr(C.address), I.remoteCandidatePort = C.port, I.remoteCandidateProtocol = C.protocol, I.remoteCandidateUrl = C.url);
6097
6097
  }), d.candidatePair && (d.transport ? (d.transport.totalRoundTripTime = d.candidatePair.totalRoundTripTime, d.transport.availableOutgoingBitrate = d.candidatePair.availableOutgoingBitrate, d.transport.availableIncomingBitrate = d.candidatePair.availableIncomingBitrate, d.transport.roundTripTime = d.candidatePair.currentRoundTripTime) : d.transport = {
6098
6098
  bytesReceived: d.candidatePair.bytesReceived,
6099
6099
  bytesSent: d.candidatePair.bytesSent,
@@ -6398,7 +6398,7 @@ class Tm extends ym {
6398
6398
  };
6399
6399
  }
6400
6400
  parseRTCReport(e, r = [], i = false, n = void 0, o = void 0) {
6401
- var P, k, A, N, H, $, F, K, re, Je, Is, vr, ni;
6401
+ var P, k, A, N, H, $, F, K, re, Je, Is, yr, ni;
6402
6402
  const c = e, d = new vm(), u = r.length ? new Set(r) : void 0, p = [], f = [], S = [], E = /* @__PURE__ */ new Map(), _ = /* @__PURE__ */ new Map();
6403
6403
  for (const I of c.values()) {
6404
6404
  if (u) {
@@ -6663,7 +6663,7 @@ class Tm extends ym {
6663
6663
  score: +(w.score * 10).toFixed(),
6664
6664
  packetsLostPercentage: wd({
6665
6665
  packetsLost: (w.packetsLost || 0) - (((Is = this.audioConsumerToStatsMap.get(C)) == null ? void 0 : Is.packetsLost) || 0),
6666
- packetsReceived: (w.packetsReceived || 0) - (((vr = this.audioConsumerToStatsMap.get(C)) == null ? void 0 : vr.packetsReceived) || 0)
6666
+ packetsReceived: (w.packetsReceived || 0) - (((yr = this.audioConsumerToStatsMap.get(C)) == null ? void 0 : yr.packetsReceived) || 0)
6667
6667
  }),
6668
6668
  jitter: w.jitter || 0,
6669
6669
  isScreenShare: this.screenShareConsumers.has(C),
@@ -6677,7 +6677,7 @@ class Tm extends ym {
6677
6677
  }
6678
6678
  }
6679
6679
  if (d.producerStreamMap.forEach((I, y) => {
6680
- var C, U, ie, Me, L, w, $e, yr, Tr, $s, Zn, eo, to, so, ro, io, ao, no, oo, co, lo, uo, ho;
6680
+ var C, U, ie, Me, L, w, $e, Tr, Er, $s, Zn, eo, to, so, ro, io, ao, no, oo, co, lo, uo, ho;
6681
6681
  if (I.outboundVideoRtpId.length > 0) {
6682
6682
  const ue = [];
6683
6683
  I.outboundVideoRtpId.forEach((tu) => {
@@ -6700,8 +6700,8 @@ class Tm extends ym {
6700
6700
  jitter: (($e = se.remoteData) == null ? void 0 : $e.jitter) || 0,
6701
6701
  isScreenShare: this.screenShareProducers.has(y),
6702
6702
  packetsLostPercentage: Rd({
6703
- packetsSent: (se.packetsSent || 0) - (((yr = this.videoProducerToStatsMap.get(y)) == null ? void 0 : yr.packetsSent) || 0),
6704
- packetsLost: (((Tr = se.remoteData) == null ? void 0 : Tr.packetsLost) || 0) - (((Zn = ($s = this.videoProducerToStatsMap.get(y)) == null ? void 0 : $s.remoteData) == null ? void 0 : Zn.packetsLost) || 0)
6703
+ packetsSent: (se.packetsSent || 0) - (((Tr = this.videoProducerToStatsMap.get(y)) == null ? void 0 : Tr.packetsSent) || 0),
6704
+ packetsLost: (((Er = se.remoteData) == null ? void 0 : Er.packetsLost) || 0) - (((Zn = ($s = this.videoProducerToStatsMap.get(y)) == null ? void 0 : $s.remoteData) == null ? void 0 : Zn.packetsLost) || 0)
6705
6705
  }),
6706
6706
  bitrate: ((se.bytesSent || 0) - (((eo = this.videoProducerToStatsMap.get(y)) == null ? void 0 : eo.bytesSent) || 0)) * 8 / 7,
6707
6707
  cpuLimitations: se.qualityLimitationReason === "cpu",
@@ -6726,7 +6726,7 @@ class Tm extends ym {
6726
6726
  }
6727
6727
  }), S.forEach((I) => {
6728
6728
  const y = p.find((U) => U.id === I.localCandidateId ? (I.localCandidateId = U.id, U) : null), C = f.find((U) => U.id === I.remoteCandidateId ? (I.remoteCandidateId = U.id, U) : null);
6729
- y && (I.localCandidateType = y.type, I.localCandidateAddress = Xr(y.address), I.localCandidatePort = y.port, I.localCandidateProtocol = y.protocol, I.localCandidateUrl = y.url, I.localCandidateNetworkType = y.networkType, I.localCandidateRelatedAddress = Xr(y.relatedAddress), I.localCandidateRelatedPort = y.relatedPort), C && (I.remoteCandidateType = C.type, I.remoteCandidateAddress = Xr(C.address), I.remoteCandidatePort = C.port, I.remoteCandidateProtocol = C.protocol, I.remoteCandidateUrl = C.url);
6729
+ y && (I.localCandidateType = y.type, I.localCandidateAddress = Zr(y.address), I.localCandidatePort = y.port, I.localCandidateProtocol = y.protocol, I.localCandidateUrl = y.url, I.localCandidateNetworkType = y.networkType, I.localCandidateRelatedAddress = Zr(y.relatedAddress), I.localCandidateRelatedPort = y.relatedPort), C && (I.remoteCandidateType = C.type, I.remoteCandidateAddress = Zr(C.address), I.remoteCandidatePort = C.port, I.remoteCandidateProtocol = C.protocol, I.remoteCandidateUrl = C.url);
6730
6730
  }), d.candidatePair && (d.transport ? (d.transport.bytesReceived = d.candidatePair.bytesReceived, d.transport.bytesSent = d.candidatePair.bytesSent, d.transport.totalRoundTripTime = d.candidatePair.totalRoundTripTime, d.transport.availableOutgoingBitrate = d.candidatePair.availableOutgoingBitrate, d.transport.availableIncomingBitrate = d.candidatePair.availableIncomingBitrate, d.transport.roundTripTime = d.candidatePair.currentRoundTripTime) : d.transport = {
6731
6731
  bytesReceived: d.candidatePair.bytesReceived,
6732
6732
  bytesSent: d.candidatePair.bytesSent,
@@ -7842,8 +7842,8 @@ const _m = Kv;
7842
7842
  var zv = typeof self == "object" && self && self.Object === Object && self, Yv = _m || zv || Function("return this")();
7843
7843
  const Rs = Yv;
7844
7844
  var Qv = Rs.Symbol;
7845
- const ei = Qv;
7846
- var Pm = Object.prototype, Xv = Pm.hasOwnProperty, Zv = Pm.toString, mo = ei ? ei.toStringTag : void 0;
7845
+ const ti = Qv;
7846
+ var Pm = Object.prototype, Xv = Pm.hasOwnProperty, Zv = Pm.toString, mo = ti ? ti.toStringTag : void 0;
7847
7847
  function ey(s) {
7848
7848
  var t = Xv.call(s, mo), e = s[mo];
7849
7849
  try {
@@ -7858,7 +7858,7 @@ var ty = Object.prototype, sy = ty.toString;
7858
7858
  function ry(s) {
7859
7859
  return sy.call(s);
7860
7860
  }
7861
- var iy = "[object Null]", ay = "[object Undefined]", op = ei ? ei.toStringTag : void 0;
7861
+ var iy = "[object Null]", ay = "[object Undefined]", op = ti ? ti.toStringTag : void 0;
7862
7862
  function fa(s) {
7863
7863
  return s == null ? s === void 0 ? ay : iy : op && op in Object(s) ? ey(s) : ry(s);
7864
7864
  }
@@ -8069,7 +8069,7 @@ var Rm = Object.prototype, Yy = Rm.hasOwnProperty, Qy = Rm.propertyIsEnumerable,
8069
8069
  };
8070
8070
  const Id = Xy;
8071
8071
  var Zy = Array.isArray;
8072
- const ti = Zy;
8072
+ const si = Zy;
8073
8073
  function eT() {
8074
8074
  return false;
8075
8075
  }
@@ -8107,7 +8107,7 @@ var hp = jn && jn.isTypedArray, NT = hp ? Th(hp) : MT;
8107
8107
  const Hl = NT;
8108
8108
  var LT = Object.prototype, VT = LT.hasOwnProperty;
8109
8109
  function Am(s, t) {
8110
- var e = ti(s), r = !e && Id(s), i = !e && !r && qn(s), n = !e && !r && !i && Hl(s), o = e || r || i || n, c = o ? Ky(s.length, String) : [], d = c.length;
8110
+ var e = si(s), r = !e && Id(s), i = !e && !r && qn(s), n = !e && !r && !i && Hl(s), o = e || r || i || n, c = o ? Ky(s.length, String) : [], d = c.length;
8111
8111
  for (var u in s)
8112
8112
  (t || VT.call(s, u)) && !(o && (u == "length" || i && (u == "offset" || u == "parent") || n && (u == "buffer" || u == "byteLength" || u == "byteOffset") || bm(u, d))) && c.push(u);
8113
8113
  return c;
@@ -8214,7 +8214,7 @@ function rE(s, t) {
8214
8214
  }
8215
8215
  function $m(s, t, e) {
8216
8216
  var r = t(s);
8217
- return ti(s) ? r : xm(r, e(s));
8217
+ return si(s) ? r : xm(r, e(s));
8218
8218
  }
8219
8219
  function yu(s) {
8220
8220
  return $m(s, Eh, _h);
@@ -8269,7 +8269,7 @@ function EE(s) {
8269
8269
  var t = new s.constructor(s.source, TE.exec(s));
8270
8270
  return t.lastIndex = s.lastIndex, t;
8271
8271
  }
8272
- var _p = ei ? ei.prototype : void 0, Pp = _p ? _p.valueOf : void 0;
8272
+ var _p = ti ? ti.prototype : void 0, Pp = _p ? _p.valueOf : void 0;
8273
8273
  function _E(s) {
8274
8274
  return Pp ? Object(Pp.call(s)) : {};
8275
8275
  }
@@ -8349,7 +8349,7 @@ function ld(s, t, e, r, i, n) {
8349
8349
  return o;
8350
8350
  if (!Cs(s))
8351
8351
  return s;
8352
- var p = ti(s);
8352
+ var p = si(s);
8353
8353
  if (p) {
8354
8354
  if (o = SE(s), !c)
8355
8355
  return Lm(s, o);
@@ -9260,7 +9260,7 @@ function AP(s) {
9260
9260
  e[++t] = r;
9261
9261
  }), e;
9262
9262
  }
9263
- var MP = 1, DP = 2, OP = "[object Boolean]", NP = "[object Date]", LP = "[object Error]", VP = "[object Map]", xP = "[object Number]", UP = "[object RegExp]", $P = "[object Set]", FP = "[object String]", HP = "[object Symbol]", BP = "[object ArrayBuffer]", qP = "[object DataView]", Mp = ei ? ei.prototype : void 0, nu = Mp ? Mp.valueOf : void 0;
9263
+ var MP = 1, DP = 2, OP = "[object Boolean]", NP = "[object Date]", LP = "[object Error]", VP = "[object Map]", xP = "[object Number]", UP = "[object RegExp]", $P = "[object Set]", FP = "[object String]", HP = "[object Symbol]", BP = "[object ArrayBuffer]", qP = "[object DataView]", Mp = ti ? ti.prototype : void 0, nu = Mp ? Mp.valueOf : void 0;
9264
9264
  function jP(s, t, e, r, i, n, o) {
9265
9265
  switch (e) {
9266
9266
  case qP:
@@ -9330,7 +9330,7 @@ function KP(s, t, e, r, i, n) {
9330
9330
  }
9331
9331
  var zP = 1, Dp = "[object Arguments]", Op = "[object Array]", Zc = "[object Object]", YP = Object.prototype, Np = YP.hasOwnProperty;
9332
9332
  function QP(s, t, e, r, i, n) {
9333
- var o = ti(s), c = ti(t), d = o ? Op : Gn(s), u = c ? Op : Gn(t);
9333
+ var o = si(s), c = si(t), d = o ? Op : Gn(s), u = c ? Op : Gn(t);
9334
9334
  d = d == Dp ? Zc : d, u = u == Dp ? Zc : u;
9335
9335
  var p = d == Zc, f = u == Zc, S = d == u;
9336
9336
  if (S && qn(s)) {
@@ -9437,8 +9437,8 @@ function oC(s, t, e, r, i, n, o) {
9437
9437
  }
9438
9438
  var p = n ? n(c, d, e + "", s, t, o) : void 0, f = p === void 0;
9439
9439
  if (f) {
9440
- var S = ti(d), E = !S && qn(d), _ = !S && !E && Hl(d);
9441
- p = d, S || E || _ ? ti(c) ? p = c : aC(c) ? p = Lm(c) : E ? (f = false, p = Nm(d, true)) : _ ? (f = false, p = Fm(d, true)) : p = [] : EP(d) || Id(d) ? (p = c, Id(c) ? p = nC(c) : (!Cs(c) || vh(c)) && (p = Hm(d))) : f = false;
9440
+ var S = si(d), E = !S && qn(d), _ = !S && !E && Hl(d);
9441
+ p = d, S || E || _ ? si(c) ? p = c : aC(c) ? p = Lm(c) : E ? (f = false, p = Nm(d, true)) : _ ? (f = false, p = Fm(d, true)) : p = [] : EP(d) || Id(d) ? (p = c, Id(c) ? p = nC(c) : (!Cs(c) || vh(c)) && (p = Hm(d))) : f = false;
9442
9442
  }
9443
9443
  f && (o.set(d, p), i(p, d, r, n, o), o.delete(d)), Ru(s, e, p);
9444
9444
  }
@@ -9456,7 +9456,7 @@ var cC = "[object Map]", dC = "[object Set]", lC = Object.prototype, uC = lC.has
9456
9456
  function hC(s) {
9457
9457
  if (s == null)
9458
9458
  return true;
9459
- if (qc(s) && (ti(s) || typeof s == "string" || typeof s.splice == "function" || qn(s) || Hl(s) || Id(s)))
9459
+ if (qc(s) && (si(s) || typeof s == "string" || typeof s.splice == "function" || qn(s) || Hl(s) || Id(s)))
9460
9460
  return !s.length;
9461
9461
  var t = Gn(s);
9462
9462
  if (t == cC || t == dC)
@@ -9474,7 +9474,7 @@ function pC(s, t) {
9474
9474
  var gC = mP(function(s, t, e) {
9475
9475
  tf(s, t, e);
9476
9476
  });
9477
- const _r = gC;
9477
+ const Pr = gC;
9478
9478
  var bu = /* @__PURE__ */ ((s) => (s.PARTICIPANT = "PARTICIPANT", s.PEER = "PEER", s.CLIENT = "CLIENT", s))(bu || {});
9479
9479
  const Z = {
9480
9480
  PROPAGATE_KICK_ALL: "propagate_kick_across_rooms",
@@ -10239,14 +10239,14 @@ const xp = 1080, Up = 1920, IC = (s, t, e, r, i, n) => {
10239
10239
  let f = d * p, S = u * p, E, _, P, k, A = 1;
10240
10240
  return f < e && (A = e / f), Math.abs(A - 1) < 1e-14 && S < r && (A = r / S), f *= A, S *= A, P = d / (f / e), k = u / (S / r), E = (d - P) * o, _ = (u - k) * c, E < 0 && (E = 0), _ < 0 && (_ = 0), P > d && (P = d), k > u && (k = u), [E, _, P, k, s, t, e, r];
10241
10241
  };
10242
- var Kt, Si, st, zt, be, ds, Ws, mt, Oe, Fa, Ha, Js, Ba;
10242
+ var Kt, Si, rt, zt, be, ds, Ws, mt, Oe, Fa, Ha, Js, Ba;
10243
10243
  const zh = class extends qt {
10244
10244
  constructor(e, r, i, n) {
10245
10245
  const o = e.getValue("logger");
10246
10246
  super(o);
10247
10247
  g(this, Kt, void 0);
10248
10248
  g(this, Si, void 0);
10249
- g(this, st, void 0);
10249
+ g(this, rt, void 0);
10250
10250
  g(this, zt, void 0);
10251
10251
  g(this, be, {
10252
10252
  height: xp,
@@ -10295,7 +10295,7 @@ const zh = class extends qt {
10295
10295
  a(this, mt) !== void 0 && this.paintCanvas(), a(this, Ws) !== void 0 && m(this, Ws, requestAnimationFrame(() => this.animate()));
10296
10296
  });
10297
10297
  h(this, "disable", (e2 = false) => {
10298
- m(this, Js, "idle"), this.cleanupEventListeners(), cancelAnimationFrame(a(this, Ws)), e2 !== true && document.body.removeChild(a(this, st)), m(this, Ws, void 0), document.pictureInPictureElement && document.exitPictureInPicture();
10298
+ m(this, Js, "idle"), this.cleanupEventListeners(), cancelAnimationFrame(a(this, Ws)), e2 !== true && document.body.removeChild(a(this, rt)), m(this, Ws, void 0), document.pictureInPictureElement && document.exitPictureInPicture();
10299
10299
  });
10300
10300
  m(this, Si, e), m(this, Js, "idle"), m(this, Oe, r), m(this, ds, {
10301
10301
  brand: r.config.designTokens.colors.brand[500],
@@ -10348,7 +10348,7 @@ const zh = class extends qt {
10348
10348
  });
10349
10349
  }
10350
10350
  createVideoContainer() {
10351
- m(this, st, document.createElement("div")), a(this, st).style.width = "0.1px", a(this, st).style.height = "0.1px", a(this, st).style.overflow = "hidden", a(this, st).style.position = "absolute", a(this, st).style.bottom = "0", a(this, st).style.right = "0", a(this, st).style.opacity = "0", a(this, st).appendChild(a(this, zt));
10351
+ m(this, rt, document.createElement("div")), a(this, rt).style.width = "0.1px", a(this, rt).style.height = "0.1px", a(this, rt).style.overflow = "hidden", a(this, rt).style.position = "absolute", a(this, rt).style.bottom = "0", a(this, rt).style.right = "0", a(this, rt).style.opacity = "0", a(this, rt).appendChild(a(this, zt));
10352
10352
  }
10353
10353
  setupEventListeners() {
10354
10354
  a(this, Si).subscribe("stageStatus", this.handlePipMediaControls), a(this, Oe).addListener("videoUpdate", this.onSelfVideoUpdateListener), a(this, Oe).addListener("audioUpdate", this.onSelfAudioUpdateListener), a(this, Oe).addListener("roomLeft", () => this.disable());
@@ -10481,9 +10481,9 @@ const zh = class extends qt {
10481
10481
  return document.pictureInPictureElement !== null;
10482
10482
  }
10483
10483
  cleanup() {
10484
- if (m(this, Ba, false), this.isSupported() && document.exitPictureInPicture !== void 0 && document.pictureInPictureElement !== null && document.exitPictureInPicture(), a(this, st))
10484
+ if (m(this, Ba, false), this.isSupported() && document.exitPictureInPicture !== void 0 && document.pictureInPictureElement !== null && document.exitPictureInPicture(), a(this, rt))
10485
10485
  try {
10486
- document.body.removeChild(a(this, st));
10486
+ document.body.removeChild(a(this, rt));
10487
10487
  } catch (e) {
10488
10488
  }
10489
10489
  this.removeAllSources(), m(this, Kt, void 0), m(this, zt, void 0), m(this, Ws, void 0);
@@ -10572,7 +10572,7 @@ const zh = class extends qt {
10572
10572
  m(this, mt, {});
10573
10573
  }
10574
10574
  enable() {
10575
- m(this, Js, "activating"), this.setupEventListeners(), this.updateMediaSession("CAMERA", a(this, Oe).videoEnabled), this.updateMediaSession("MIC", a(this, Oe).audioEnabled), document.body.appendChild(a(this, st)), m(this, Ws, requestAnimationFrame(() => this.animate())), a(this, zt).onloadedmetadata = () => {
10575
+ m(this, Js, "activating"), this.setupEventListeners(), this.updateMediaSession("CAMERA", a(this, Oe).videoEnabled), this.updateMediaSession("MIC", a(this, Oe).audioEnabled), document.body.appendChild(a(this, rt)), m(this, Ws, requestAnimationFrame(() => this.animate())), a(this, zt).onloadedmetadata = () => {
10576
10576
  a(this, zt).requestPictureInPicture().then(() => {
10577
10577
  m(this, Js, "active");
10578
10578
  });
@@ -10582,7 +10582,7 @@ const zh = class extends qt {
10582
10582
  }
10583
10583
  };
10584
10584
  let ku = zh;
10585
- Kt = /* @__PURE__ */ new WeakMap(), Si = /* @__PURE__ */ new WeakMap(), st = /* @__PURE__ */ new WeakMap(), zt = /* @__PURE__ */ new WeakMap(), be = /* @__PURE__ */ new WeakMap(), ds = /* @__PURE__ */ new WeakMap(), Ws = /* @__PURE__ */ new WeakMap(), mt = /* @__PURE__ */ new WeakMap(), Oe = /* @__PURE__ */ new WeakMap(), Fa = /* @__PURE__ */ new WeakMap(), Ha = /* @__PURE__ */ new WeakMap(), Js = /* @__PURE__ */ new WeakMap(), Ba = /* @__PURE__ */ new WeakMap();
10585
+ Kt = /* @__PURE__ */ new WeakMap(), Si = /* @__PURE__ */ new WeakMap(), rt = /* @__PURE__ */ new WeakMap(), zt = /* @__PURE__ */ new WeakMap(), be = /* @__PURE__ */ new WeakMap(), ds = /* @__PURE__ */ new WeakMap(), Ws = /* @__PURE__ */ new WeakMap(), mt = /* @__PURE__ */ new WeakMap(), Oe = /* @__PURE__ */ new WeakMap(), Fa = /* @__PURE__ */ new WeakMap(), Ha = /* @__PURE__ */ new WeakMap(), Js = /* @__PURE__ */ new WeakMap(), Ba = /* @__PURE__ */ new WeakMap();
10586
10586
  var gr;
10587
10587
  (function(s) {
10588
10588
  s[s.PUBLISHER = 0] = "PUBLISHER", s[s.SUBSCRIBER = 1] = "SUBSCRIBER";
@@ -13135,10 +13135,10 @@ var Nu;
13135
13135
  (function(s) {
13136
13136
  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";
13137
13137
  })(Nu || (Nu = {}));
13138
- var Yr;
13138
+ var Qr;
13139
13139
  (function(s) {
13140
13140
  s[s.NONE = 0] = "NONE", s[s.ALLOWED = 1] = "ALLOWED", s[s.NOT_ALLOWED = 2] = "NOT_ALLOWED", s[s.CAN_REQUEST = 3] = "CAN_REQUEST";
13141
- })(Yr || (Yr = {}));
13141
+ })(Qr || (Qr = {}));
13142
13142
  class ok extends MessageType {
13143
13143
  constructor() {
13144
13144
  super("socket.preset.PollsPermissionUpdate", [
@@ -13291,8 +13291,8 @@ const vk = new Sk();
13291
13291
  class yk extends MessageType {
13292
13292
  constructor() {
13293
13293
  super("socket.preset.StreamPermission", [
13294
- { no: 1, name: "can_produce", kind: "enum", opt: true, T: () => ["socket.preset.StreamPermissionType", Yr, "STREAM_PERMISSION_TYPE_"] },
13295
- { no: 2, name: "can_consume", kind: "enum", opt: true, T: () => ["socket.preset.StreamPermissionType", Yr, "STREAM_PERMISSION_TYPE_"] }
13294
+ { no: 1, name: "can_produce", kind: "enum", opt: true, T: () => ["socket.preset.StreamPermissionType", Qr, "STREAM_PERMISSION_TYPE_"] },
13295
+ { no: 2, name: "can_consume", kind: "enum", opt: true, T: () => ["socket.preset.StreamPermissionType", Qr, "STREAM_PERMISSION_TYPE_"] }
13296
13296
  ]);
13297
13297
  }
13298
13298
  }
@@ -15247,12 +15247,12 @@ var WA = Object.defineProperty, JA = Object.getOwnPropertyDescriptor, Mh = (s, t
15247
15247
  for (var i = r > 1 ? void 0 : r ? JA(t, e) : t, n = s.length - 1, o; n >= 0; n--)
15248
15248
  (o = s[n]) && (i = (r ? o(t, e, i) : o(i)) || i);
15249
15249
  return r && i && WA(t, e, i), i;
15250
- }, wr, qa, Pg;
15250
+ }, br, qa, Pg;
15251
15251
  const xu = (Pg = class {
15252
15252
  constructor(s, t) {
15253
- g(this, wr, void 0);
15253
+ g(this, br, void 0);
15254
15254
  g(this, qa, void 0);
15255
- m(this, wr, t), m(this, qa, s);
15255
+ m(this, br, t), m(this, qa, s);
15256
15256
  }
15257
15257
  get telemetry() {
15258
15258
  return a(this, qa).getValue("telemetry");
@@ -15270,7 +15270,7 @@ const xu = (Pg = class {
15270
15270
  isDirectMessage: i
15271
15271
  };
15272
15272
  i && (n.visibility = "private");
15273
- const o = yield a(this, wr).sendMessagePromise(
15273
+ const o = yield a(this, br).sendMessagePromise(
15274
15274
  pi.createChatChannel,
15275
15275
  gI.toBinary(n)
15276
15276
  ), c = Fs.fromBinary(
@@ -15281,7 +15281,7 @@ const xu = (Pg = class {
15281
15281
  }
15282
15282
  updateChannel(s, t) {
15283
15283
  return l(this, null, function* () {
15284
- const e = yield a(this, wr).sendMessagePromise(
15284
+ const e = yield a(this, br).sendMessagePromise(
15285
15285
  pi.updateChatChannel,
15286
15286
  fI.toBinary({
15287
15287
  chatChannelId: s,
@@ -15310,7 +15310,7 @@ const xu = (Pg = class {
15310
15310
  getChannelMembers(s) {
15311
15311
  return l(this, null, function* () {
15312
15312
  try {
15313
- const t = yield a(this, wr).sendMessagePromise(
15313
+ const t = yield a(this, br).sendMessagePromise(
15314
15314
  pi.getChannelMembers,
15315
15315
  yI.toBinary({ chatChannelId: s })
15316
15316
  );
@@ -15345,7 +15345,7 @@ const xu = (Pg = class {
15345
15345
  );
15346
15346
  return;
15347
15347
  }
15348
- a(this, wr).on(s, ({ payload: i }) => {
15348
+ a(this, br).on(s, ({ payload: i }) => {
15349
15349
  let n = r;
15350
15350
  try {
15351
15351
  n = e(i);
@@ -15357,7 +15357,7 @@ const xu = (Pg = class {
15357
15357
  return t(n);
15358
15358
  });
15359
15359
  }
15360
- }, wr = /* @__PURE__ */ new WeakMap(), qa = /* @__PURE__ */ new WeakMap(), Pg);
15360
+ }, br = /* @__PURE__ */ new WeakMap(), qa = /* @__PURE__ */ new WeakMap(), Pg);
15361
15361
  let ga = xu;
15362
15362
  Mh([
15363
15363
  T.trace("ChatChannelHandler.createChannel")
@@ -15372,12 +15372,12 @@ var KA = Object.defineProperty, zA = Object.getOwnPropertyDescriptor, bs = (s, t
15372
15372
  for (var i = r > 1 ? void 0 : r ? zA(t, e) : t, n = s.length - 1, o; n >= 0; n--)
15373
15373
  (o = s[n]) && (i = (r ? o(t, e, i) : o(i)) || i);
15374
15374
  return r && i && KA(t, e, i), i;
15375
- }, _t = /* @__PURE__ */ ((s) => (s[s.TEXT = 0] = "TEXT", s[s.IMAGE = 1] = "IMAGE", s[s.FILE = 2] = "FILE", s[s.CUSTOM = 3] = "CUSTOM", s))(_t || {}), rt, ja;
15375
+ }, _t = /* @__PURE__ */ ((s) => (s[s.TEXT = 0] = "TEXT", s[s.IMAGE = 1] = "IMAGE", s[s.FILE = 2] = "FILE", s[s.CUSTOM = 3] = "CUSTOM", s))(_t || {}), it, ja;
15376
15376
  class as {
15377
15377
  constructor(t, e) {
15378
- g(this, rt, void 0);
15378
+ g(this, it, void 0);
15379
15379
  g(this, ja, void 0);
15380
- m(this, rt, e), m(this, ja, t);
15380
+ m(this, it, e), m(this, ja, t);
15381
15381
  }
15382
15382
  get telemetry() {
15383
15383
  return a(this, ja).getValue("telemetry");
@@ -15386,7 +15386,7 @@ class as {
15386
15386
  return a(this, ja).getValue("logger");
15387
15387
  }
15388
15388
  getChatMessages() {
15389
- return a(this, rt).sendMessagePromise(we.getMessages);
15389
+ return a(this, it).sendMessagePromise(we.getMessages);
15390
15390
  }
15391
15391
  getChatMessagesPaginated(t, e, r, i = 0, n = "") {
15392
15392
  return l(this, null, function* () {
@@ -15396,7 +15396,7 @@ class as {
15396
15396
  from: i,
15397
15397
  reversed: r,
15398
15398
  channelId: n
15399
- }, c = yield a(this, rt).sendMessagePromise(
15399
+ }, c = yield a(this, it).sendMessagePromise(
15400
15400
  we.getPaginatedMessages,
15401
15401
  $k.toBinary(o)
15402
15402
  );
@@ -15413,7 +15413,7 @@ class as {
15413
15413
  payloadType: e,
15414
15414
  payload: t
15415
15415
  };
15416
- a(this, rt).sendMessage(
15416
+ a(this, it).sendMessage(
15417
15417
  we.sendMessageToRoom,
15418
15418
  jk.toBinary(r)
15419
15419
  );
@@ -15424,7 +15424,7 @@ class as {
15424
15424
  peerIds: r,
15425
15425
  payload: t
15426
15426
  };
15427
- a(this, rt).sendMessage(
15427
+ a(this, it).sendMessage(
15428
15428
  we.sendMessageToPeers,
15429
15429
  Jk.toBinary(i)
15430
15430
  );
@@ -15435,7 +15435,7 @@ class as {
15435
15435
  channelId: r,
15436
15436
  payload: t
15437
15437
  };
15438
- a(this, rt).sendMessage(
15438
+ a(this, it).sendMessage(
15439
15439
  we.sendMessageToChannel,
15440
15440
  Yk.toBinary(i)
15441
15441
  );
@@ -15455,7 +15455,7 @@ class as {
15455
15455
  payload: e
15456
15456
  };
15457
15457
  i && (o.channelId = i), n !== void 0 && (o.pinned = n);
15458
- const c = yield a(this, rt).sendMessagePromise(
15458
+ const c = yield a(this, it).sendMessagePromise(
15459
15459
  we.editMessage,
15460
15460
  Zk.toBinary(o)
15461
15461
  );
@@ -15468,7 +15468,7 @@ class as {
15468
15468
  chatId: t
15469
15469
  };
15470
15470
  e && (r.channelId = e);
15471
- const i = yield a(this, rt).sendMessagePromise(
15471
+ const i = yield a(this, it).sendMessagePromise(
15472
15472
  we.deleteMessage,
15473
15473
  aI.toBinary(r)
15474
15474
  ), n = ad.fromBinary(i.payload);
@@ -15489,7 +15489,7 @@ class as {
15489
15489
  };
15490
15490
  e.channelId && (r.channelId = e.channelId);
15491
15491
  try {
15492
- const c = yield a(this, rt).sendMessagePromise(
15492
+ const c = yield a(this, it).sendMessagePromise(
15493
15493
  we.searchChannelMessages,
15494
15494
  cI.toBinary(r)
15495
15495
  );
@@ -15502,7 +15502,7 @@ class as {
15502
15502
  getAllChannels() {
15503
15503
  return l(this, null, function* () {
15504
15504
  try {
15505
- const t = yield a(this, rt).sendMessagePromise(
15505
+ const t = yield a(this, it).sendMessagePromise(
15506
15506
  we.getAllChatChannels
15507
15507
  );
15508
15508
  return Fs.fromBinary(t.payload).chatChannels.map(ga.formatChannel);
@@ -15513,7 +15513,7 @@ class as {
15513
15513
  }
15514
15514
  markLastReadMessage(t, e) {
15515
15515
  return l(this, null, function* () {
15516
- const r = yield a(this, rt).sendMessagePromise(
15516
+ const r = yield a(this, it).sendMessagePromise(
15517
15517
  we.markChannelIndexAsRead,
15518
15518
  lI.toBinary({
15519
15519
  channelId: t,
@@ -15530,7 +15530,7 @@ class as {
15530
15530
  chatId: t.id,
15531
15531
  pinned: e,
15532
15532
  channelId: t.channelId
15533
- }, i = yield a(this, rt).sendMessagePromise(
15533
+ }, i = yield a(this, it).sendMessagePromise(
15534
15534
  we.pinMessage,
15535
15535
  tI.toBinary(r)
15536
15536
  );
@@ -15575,7 +15575,7 @@ class as {
15575
15575
  this.logger.warn(`ChatSocketHandler::Event ${t} is not recognized`);
15576
15576
  return;
15577
15577
  }
15578
- a(this, rt).on(t, ({ payload: n }) => {
15578
+ a(this, it).on(t, ({ payload: n }) => {
15579
15579
  let o = i;
15580
15580
  try {
15581
15581
  o = r(n);
@@ -15588,7 +15588,7 @@ class as {
15588
15588
  });
15589
15589
  }
15590
15590
  }
15591
- rt = /* @__PURE__ */ new WeakMap(), ja = /* @__PURE__ */ new WeakMap();
15591
+ it = /* @__PURE__ */ new WeakMap(), ja = /* @__PURE__ */ new WeakMap();
15592
15592
  bs([
15593
15593
  T.trace("SocketService.getChatMessages")
15594
15594
  ], as.prototype, "getChatMessages", 1);
@@ -16166,7 +16166,7 @@ var nM = Object.defineProperty, oM = Object.getOwnPropertyDescriptor, pt = (s, t
16166
16166
  };
16167
16167
  const cM = ["text", "image", "file", "custom", "poll"], gd = { maxInvocations: 180, period: 60 };
16168
16168
  var ee, vi, Fe, yi, Ti, Bd, _f, Ho, $u, Cg;
16169
- let Ye = (Cg = class extends qt {
16169
+ let Qe = (Cg = class extends qt {
16170
16170
  constructor(t, e, r, i, n) {
16171
16171
  const o = t.getValue("logger");
16172
16172
  super(o);
@@ -16641,68 +16641,68 @@ let Ye = (Cg = class extends qt {
16641
16641
  pt([
16642
16642
  T.trace("DyteChat.sendTextMessage"),
16643
16643
  Dt(gd)
16644
- ], Ye.prototype, "sendTextMessage", 1);
16644
+ ], Qe.prototype, "sendTextMessage", 1);
16645
16645
  pt([
16646
16646
  T.trace("DyteChat.sendImageMessage"),
16647
16647
  Dt({ maxInvocations: 20, period: 60 })
16648
- ], Ye.prototype, "sendImageMessage", 1);
16648
+ ], Qe.prototype, "sendImageMessage", 1);
16649
16649
  pt([
16650
16650
  T.trace("DyteChat.sendFileMessage"),
16651
16651
  Dt({ maxInvocations: 20, period: 60 })
16652
- ], Ye.prototype, "sendFileMessage", 1);
16652
+ ], Qe.prototype, "sendFileMessage", 1);
16653
16653
  pt([
16654
16654
  T.trace("DyteChat.sendMessage"),
16655
16655
  Dt({ maxInvocations: 180, period: 60 })
16656
- ], Ye.prototype, "sendMessage", 1);
16656
+ ], Qe.prototype, "sendMessage", 1);
16657
16657
  pt([
16658
16658
  T.trace("DyteChat.editTextMessage")
16659
- ], Ye.prototype, "editTextMessage", 1);
16659
+ ], Qe.prototype, "editTextMessage", 1);
16660
16660
  pt([
16661
16661
  T.trace("DyteChat.editImageMessage")
16662
- ], Ye.prototype, "editImageMessage", 1);
16662
+ ], Qe.prototype, "editImageMessage", 1);
16663
16663
  pt([
16664
16664
  T.trace("DyteChat.editFileMessage")
16665
- ], Ye.prototype, "editFileMessage", 1);
16665
+ ], Qe.prototype, "editFileMessage", 1);
16666
16666
  pt([
16667
16667
  T.trace("DyteChat.editMessage")
16668
- ], Ye.prototype, "editMessage", 1);
16668
+ ], Qe.prototype, "editMessage", 1);
16669
16669
  pt([
16670
16670
  T.trace("DyteChat.deleteMessage")
16671
- ], Ye.prototype, "deleteMessage", 1);
16671
+ ], Qe.prototype, "deleteMessage", 1);
16672
16672
  pt([
16673
16673
  T.trace("DyteChat.createChannel")
16674
- ], Ye.prototype, "createChannel", 1);
16674
+ ], Qe.prototype, "createChannel", 1);
16675
16675
  pt([
16676
16676
  T.trace("DyteChat.updateChannel")
16677
- ], Ye.prototype, "updateChannel", 1);
16677
+ ], Qe.prototype, "updateChannel", 1);
16678
16678
  pt([
16679
16679
  T.trace("DyteChat.sendMessageToChannel")
16680
- ], Ye.prototype, "sendMessageToChannel", 1);
16680
+ ], Qe.prototype, "sendMessageToChannel", 1);
16681
16681
  pt([
16682
16682
  T.trace("DyteChat.getChannelMembers")
16683
- ], Ye.prototype, "getChannelMembers", 1);
16683
+ ], Qe.prototype, "getChannelMembers", 1);
16684
16684
  pt([
16685
16685
  T.trace("DyteChat.searchMessages")
16686
- ], Ye.prototype, "searchMessages", 1);
16686
+ ], Qe.prototype, "searchMessages", 1);
16687
16687
  pt([
16688
16688
  T.trace("DyteChat.markLastReadMessage")
16689
- ], Ye.prototype, "markLastReadMessage", 1);
16690
- Ye = pt([
16689
+ ], Qe.prototype, "markLastReadMessage", 1);
16690
+ Qe = pt([
16691
16691
  ht("0500")
16692
- ], Ye);
16692
+ ], Qe);
16693
16693
  var dM = Object.defineProperty, lM = Object.getOwnPropertyDescriptor, uM = (s, t, e, r) => {
16694
16694
  for (var i = r > 1 ? void 0 : r ? lM(t, e) : t, n = s.length - 1, o; n >= 0; n--)
16695
16695
  (o = s[n]) && (i = (r ? o(t, e, i) : o(i)) || i);
16696
16696
  return r && i && dM(t, e, i), i;
16697
- }, br, Rg;
16697
+ }, kr, Rg;
16698
16698
  const ci = (Rg = class {
16699
16699
  constructor(s, t, e, r, i) {
16700
16700
  h(this, "chat");
16701
16701
  h(this, "chatSocketHandler");
16702
16702
  h(this, "chatChannelSocketHandler");
16703
16703
  h(this, "self");
16704
- g(this, br, void 0);
16705
- m(this, br, s), this.chatSocketHandler = t, this.chatChannelSocketHandler = e, this.chat = new Ye(
16704
+ g(this, kr, void 0);
16705
+ m(this, kr, s), this.chatSocketHandler = t, this.chatChannelSocketHandler = e, this.chat = new Qe(
16706
16706
  s,
16707
16707
  t,
16708
16708
  e,
@@ -16711,10 +16711,10 @@ const ci = (Rg = class {
16711
16711
  ), this.self = r, this.setupEvents();
16712
16712
  }
16713
16713
  get telemetry() {
16714
- return a(this, br).getValue("telemetry");
16714
+ return a(this, kr).getValue("telemetry");
16715
16715
  }
16716
16716
  get logger() {
16717
- return a(this, br).getValue("logger");
16717
+ return a(this, kr).getValue("logger");
16718
16718
  }
16719
16719
  static init(s, t, e, r, i) {
16720
16720
  return l(this, null, function* () {
@@ -16785,7 +16785,7 @@ const ci = (Rg = class {
16785
16785
  }
16786
16786
  getChatMessages() {
16787
16787
  return l(this, null, function* () {
16788
- if (this.self.config.viewType === "LIVESTREAM" || this.self.config.viewType === "CHAT" || a(this, br).getValue("flagsmith").hasFeature(Z.FEAT_PAGINATED_CHAT))
16788
+ if (this.self.config.viewType === "LIVESTREAM" || this.self.config.viewType === "CHAT" || a(this, kr).getValue("flagsmith").hasFeature(Z.FEAT_PAGINATED_CHAT))
16789
16789
  return;
16790
16790
  const s = yield this.chatSocketHandler.getChatMessages();
16791
16791
  if (!(s != null && s.payload))
@@ -16799,7 +16799,7 @@ const ci = (Rg = class {
16799
16799
  });
16800
16800
  }
16801
16801
  setupEvents() {
16802
- a(this, br).getValue("peerSessionStore").on(
16802
+ a(this, kr).getValue("peerSessionStore").on(
16803
16803
  b.SOCKET_SERVICE_ROOM_JOINED,
16804
16804
  () => l(this, null, function* () {
16805
16805
  this.getChatMessages();
@@ -16903,7 +16903,7 @@ const ci = (Rg = class {
16903
16903
  }
16904
16904
  );
16905
16905
  }
16906
- }, br = /* @__PURE__ */ new WeakMap(), Rg);
16906
+ }, kr = /* @__PURE__ */ new WeakMap(), Rg);
16907
16907
  let _s = ci;
16908
16908
  uM([
16909
16909
  T.trace("ChatController.setupEvents")
@@ -16978,20 +16978,20 @@ var mM = Object.defineProperty, fM = Object.getOwnPropertyDescriptor, SM = (s, t
16978
16978
  for (var i = r > 1 ? void 0 : r ? fM(t, e) : t, n = s.length - 1, o; n >= 0; n--)
16979
16979
  (o = s[n]) && (i = (r ? o(t, e, i) : o(i)) || i);
16980
16980
  return r && i && mM(t, e, i), i;
16981
- }, kr, Ja, Ei, bg;
16981
+ }, Ir, Ja, Ei, bg;
16982
16982
  const wa = (bg = class {
16983
16983
  constructor(s, t, e) {
16984
16984
  h(this, "polls");
16985
- g(this, kr, void 0);
16985
+ g(this, Ir, void 0);
16986
16986
  g(this, Ja, void 0);
16987
16987
  g(this, Ei, void 0);
16988
- this.polls = new Fu(s, t, e), m(this, Ja, t), m(this, kr, s), m(this, Ei, e), this.setupEvents();
16988
+ this.polls = new Fu(s, t, e), m(this, Ja, t), m(this, Ir, s), m(this, Ei, e), this.setupEvents();
16989
16989
  }
16990
16990
  get telemetry() {
16991
- return a(this, kr).getValue("telemetry");
16991
+ return a(this, Ir).getValue("telemetry");
16992
16992
  }
16993
16993
  get logger() {
16994
- return a(this, kr).getValue("logger");
16994
+ return a(this, Ir).getValue("logger");
16995
16995
  }
16996
16996
  static init(s, t, e) {
16997
16997
  return l(this, null, function* () {
@@ -17013,13 +17013,13 @@ const wa = (bg = class {
17013
17013
  r.poll && this.updatePoll(wa.formatSocketServicePoll(r.poll));
17014
17014
  }
17015
17015
  }, t = () => {
17016
- a(this, kr).getValue("peerSessionStore").on(b.SOCKET_SERVICE_ROOM_JOINED, () => {
17016
+ a(this, Ir).getValue("peerSessionStore").on(b.SOCKET_SERVICE_ROOM_JOINED, () => {
17017
17017
  this.getPolls();
17018
17018
  }), Object.keys(s).map(Number).forEach((r) => {
17019
17019
  a(this, Ei).on(r, s[r]);
17020
17020
  });
17021
17021
  }, e = () => {
17022
- a(this, kr).getValue("peerSessionStore").on(b.SOCKET_SERVICE_ROOM_JOINED, () => {
17022
+ a(this, Ir).getValue("peerSessionStore").on(b.SOCKET_SERVICE_ROOM_JOINED, () => {
17023
17023
  this.getPolls();
17024
17024
  }), Object.keys(s).map(Number).forEach((r) => {
17025
17025
  a(this, Ei).removeListeners(r);
@@ -17075,7 +17075,7 @@ const wa = (bg = class {
17075
17075
  voted: s.votes
17076
17076
  };
17077
17077
  }
17078
- }, kr = /* @__PURE__ */ new WeakMap(), Ja = /* @__PURE__ */ new WeakMap(), Ei = /* @__PURE__ */ new WeakMap(), bg);
17078
+ }, Ir = /* @__PURE__ */ new WeakMap(), Ja = /* @__PURE__ */ new WeakMap(), Ei = /* @__PURE__ */ new WeakMap(), bg);
17079
17079
  let Rf = wa;
17080
17080
  SM([
17081
17081
  T.trace("PollController.setupEvents")
@@ -17152,7 +17152,7 @@ var _M = Object.defineProperty, PM = Object.getOwnPropertyDescriptor, bf = (s, t
17152
17152
  (o = s[n]) && (i = (r ? o(t, e, i) : o(i)) || i);
17153
17153
  return r && i && _M(t, e, i), i;
17154
17154
  }, Go, Ig;
17155
- let Zr = (Ig = class extends qt {
17155
+ let ei = (Ig = class extends qt {
17156
17156
  constructor(t) {
17157
17157
  const e = t.getValue("logger");
17158
17158
  super(e);
@@ -17165,7 +17165,7 @@ let Zr = (Ig = class extends qt {
17165
17165
  }
17166
17166
  static init(t, e) {
17167
17167
  return l(this, null, function* () {
17168
- const r = new Zr(t), i = t.getValue("logger");
17168
+ const r = new ei(t), i = t.getValue("logger");
17169
17169
  try {
17170
17170
  e && r.getActiveTranscript();
17171
17171
  } catch (n) {
@@ -17198,13 +17198,13 @@ let Zr = (Ig = class extends qt {
17198
17198
  }
17199
17199
  static parseTranscripts(t) {
17200
17200
  return t ? t.split(`
17201
- `).map((e) => Zr.parseTranscript(e, false)).filter(Boolean) : [];
17201
+ `).map((e) => ei.parseTranscript(e, false)).filter(Boolean) : [];
17202
17202
  }
17203
17203
  getActiveTranscript() {
17204
17204
  return l(this, null, function* () {
17205
17205
  try {
17206
17206
  const t = lt(), { transcript: e } = yield t.getActiveTranscript();
17207
- this.transcripts = Zr.parseTranscripts(e);
17207
+ this.transcripts = ei.parseTranscripts(e);
17208
17208
  } catch (t) {
17209
17209
  }
17210
17210
  });
@@ -17224,20 +17224,20 @@ let Zr = (Ig = class extends qt {
17224
17224
  }, Go = /* @__PURE__ */ new WeakMap(), Ig);
17225
17225
  bf([
17226
17226
  T.trace("DyteAi.getActiveTranscript")
17227
- ], Zr.prototype, "getActiveTranscript", 1);
17228
- Zr = bf([
17227
+ ], ei.prototype, "getActiveTranscript", 1);
17228
+ ei = bf([
17229
17229
  ht("0000")
17230
- ], Zr);
17230
+ ], ei);
17231
17231
  var CM = Object.defineProperty, RM = Object.getOwnPropertyDescriptor, wM = (s, t, e, r) => {
17232
17232
  for (var i = r > 1 ? void 0 : r ? RM(t, e) : t, n = s.length - 1, o; n >= 0; n--)
17233
17233
  (o = s[n]) && (i = (r ? o(t, e, i) : o(i)) || i);
17234
17234
  return r && i && CM(t, e, i), i;
17235
- }, Ir, za, xt, Ag;
17235
+ }, Ar, za, xt, Ag;
17236
17236
  const kf = (Ag = class {
17237
17237
  constructor(s, t, e, r, i, n) {
17238
17238
  h(this, "meta");
17239
17239
  h(this, "ai");
17240
- g(this, Ir, void 0);
17240
+ g(this, Ar, void 0);
17241
17241
  g(this, za, void 0);
17242
17242
  h(this, "aiSocketHandler");
17243
17243
  g(this, xt, void 0);
@@ -17247,7 +17247,7 @@ const kf = (Ag = class {
17247
17247
  t.config.viewType,
17248
17248
  e,
17249
17249
  n
17250
- ), this.ai = r, m(this, Ir, t), m(this, za, e), this.aiSocketHandler = i, t.config.viewType !== Mt.Chat && this.setupEvents();
17250
+ ), this.ai = r, m(this, Ar, t), m(this, za, e), this.aiSocketHandler = i, t.config.viewType !== Mt.Chat && this.setupEvents();
17251
17251
  }
17252
17252
  get telemetry() {
17253
17253
  return a(this, xt).getValue("telemetry");
@@ -17257,7 +17257,7 @@ const kf = (Ag = class {
17257
17257
  }
17258
17258
  static init(s, t, e, r, i) {
17259
17259
  return l(this, null, function* () {
17260
- const n = yield Zr.init(s, t.permissions.transcriptionEnabled);
17260
+ const n = yield ei.init(s, t.permissions.transcriptionEnabled);
17261
17261
  return new kf(
17262
17262
  s,
17263
17263
  t,
@@ -17302,14 +17302,14 @@ const kf = (Ag = class {
17302
17302
  ({ score: s }) => {
17303
17303
  s < 5 && this.meta.emit("poorConnection", { score: s });
17304
17304
  }
17305
- ), a(this, Ir).permissions.canSpotlight && (this.logger.info("DyteMetaController::Asserting Spotlight"), this.meta.selfActiveTab && a(this, za).broadcastMessage("spotlight", {
17306
- userId: a(this, Ir).userId,
17305
+ ), a(this, Ar).permissions.canSpotlight && (this.logger.info("DyteMetaController::Asserting Spotlight"), this.meta.selfActiveTab && a(this, za).broadcastMessage("spotlight", {
17306
+ userId: a(this, Ar).userId,
17307
17307
  currentTab: this.meta.selfActiveTab
17308
17308
  })), a(this, xt).getValue("peerSessionStore").on(
17309
17309
  b.PEER_JOINED_INTERNAL,
17310
17310
  (s) => l(this, null, function* () {
17311
- a(this, Ir).permissions.canSpotlight && this.meta.selfActiveTab && a(this, za).broadcastToPeers("spotlight", [s.id], {
17312
- userId: a(this, Ir).userId,
17311
+ a(this, Ar).permissions.canSpotlight && this.meta.selfActiveTab && a(this, za).broadcastToPeers("spotlight", [s.id], {
17312
+ userId: a(this, Ar).userId,
17313
17313
  currentTab: this.meta.selfActiveTab
17314
17314
  });
17315
17315
  })
@@ -17371,7 +17371,7 @@ const kf = (Ag = class {
17371
17371
  } = s;
17372
17372
  let i;
17373
17373
  try {
17374
- i = Zr.parseTranscript(e, r);
17374
+ i = ei.parseTranscript(e, r);
17375
17375
  } catch (d) {
17376
17376
  this.logger.error(`Failed to parse transcript: ${e}`, d);
17377
17377
  }
@@ -17384,17 +17384,56 @@ const kf = (Ag = class {
17384
17384
  this.logger.debug(`${t} Received transcript for peer ${n} - ${o}: ${c}`);
17385
17385
  });
17386
17386
  }
17387
- }, Ir = /* @__PURE__ */ new WeakMap(), za = /* @__PURE__ */ new WeakMap(), xt = /* @__PURE__ */ new WeakMap(), Ag);
17387
+ }, Ar = /* @__PURE__ */ new WeakMap(), za = /* @__PURE__ */ new WeakMap(), xt = /* @__PURE__ */ new WeakMap(), Ag);
17388
17388
  let If = kf;
17389
17389
  wM([
17390
17390
  T.trace("MetaController.setupEvents")
17391
17391
  ], If.prototype, "setupEvents", 1);
17392
+ const vo = {}, Sr = {
17393
+ executeWithLock({
17394
+ methodName: s,
17395
+ lockName: t,
17396
+ timeout: e
17397
+ }) {
17398
+ return (r, i, n) => {
17399
+ const o = n.value;
17400
+ return n.value = function(...d) {
17401
+ var _, P;
17402
+ const u = (P = (this == null ? void 0 : this.peerId) || ((_ = d[0]) == null ? void 0 : _.authToken)) != null ? P : "", p = `${t}-${u}`, f = this == null ? void 0 : this.logger;
17403
+ if (vo[p]) {
17404
+ const k = new Error(
17405
+ `Unsupported concurrent calls on Dyte method: ${s}.`
17406
+ );
17407
+ throw k.name = "UnsupportedConcurrentMethodExecution", f == null || f.error("DyteLocker::UnsupportedConcurrentMethodExecution", {
17408
+ error: {
17409
+ stack: k.stack
17410
+ },
17411
+ dyteLocker: {
17412
+ methodName: s,
17413
+ lockName: p
17414
+ }
17415
+ }), k;
17416
+ }
17417
+ vo[p] = true;
17418
+ const S = setTimeout(
17419
+ () => delete vo[p],
17420
+ e
17421
+ ), E = o.apply(this, d);
17422
+ return Promise.resolve(E).then(() => {
17423
+ delete vo[p], clearTimeout(S);
17424
+ }).catch(() => {
17425
+ delete vo[p], clearTimeout(S);
17426
+ }), E;
17427
+ }, n;
17428
+ };
17429
+ }
17430
+ };
17392
17431
  var bM = Object.defineProperty, kM = Object.getOwnPropertyDescriptor, Ea = (s, t, e, r) => {
17393
17432
  for (var i = r > 1 ? void 0 : r ? kM(t, e) : t, n = s.length - 1, o; n >= 0; n--)
17394
17433
  (o = s[n]) && (i = (r ? o(t, e, i) : o(i)) || i);
17395
17434
  return r && i && bM(t, e, i), i;
17396
- }, Yt, Gd, ae, Wo, As, it, Jo, qu, Ya, md;
17397
- class ri extends qt {
17435
+ }, Yt, Gd, ae, Wo, As, Ke, Jo, qu, Ya, md;
17436
+ class ii extends qt {
17398
17437
  constructor(e, r, i, n, o) {
17399
17438
  const c = e.getValue("logger");
17400
17439
  super(c);
@@ -17405,14 +17444,14 @@ class ri extends qt {
17405
17444
  g(this, ae, void 0);
17406
17445
  g(this, Wo, void 0);
17407
17446
  g(this, As, void 0);
17408
- g(this, it, void 0);
17409
- m(this, it, e), m(this, Yt, n), m(this, Gd, o), m(this, ae, r), m(this, Wo, i), m(this, As, []), this.setupEvents();
17447
+ g(this, Ke, void 0);
17448
+ m(this, Ke, e), m(this, Yt, n), m(this, Gd, o), m(this, ae, r), m(this, Wo, i), m(this, As, []), this.setupEvents();
17410
17449
  }
17411
17450
  get telemetry() {
17412
- return a(this, it).getValue("telemetry");
17451
+ return a(this, Ke).getValue("telemetry");
17413
17452
  }
17414
17453
  get status() {
17415
- return a(this, it).getValue("stageStatus");
17454
+ return a(this, Ke).getValue("stageStatus");
17416
17455
  }
17417
17456
  setupEvents() {
17418
17457
  const e = {
@@ -17425,14 +17464,14 @@ class ri extends qt {
17425
17464
  })
17426
17465
  }, r = () => {
17427
17466
  Object.entries(e).forEach(([n, o]) => {
17428
- a(this, it).getValue("peerSessionStore").onAsync(
17467
+ a(this, Ke).getValue("peerSessionStore").onAsync(
17429
17468
  n,
17430
17469
  o
17431
17470
  );
17432
17471
  });
17433
17472
  }, i = () => {
17434
17473
  Object.entries(e).forEach(([n, o]) => {
17435
- a(this, it).getValue("peerSessionStore").removeListener(
17474
+ a(this, Ke).getValue("peerSessionStore").removeListener(
17436
17475
  n,
17437
17476
  o
17438
17477
  );
@@ -17503,18 +17542,21 @@ class ri extends qt {
17503
17542
  throw this.logger.error("DyteStage::deny_access::permission_denied"), new R("You do not have permission to perform this action", "2001");
17504
17543
  return a(this, Yt).denyAccess(e);
17505
17544
  }
17545
+ get peerId() {
17546
+ return a(this, Ke).getValue("peerId");
17547
+ }
17506
17548
  join() {
17507
17549
  return l(this, null, function* () {
17508
- const e = a(this, it).getValue("viewType");
17550
+ const e = a(this, Ke).getValue("viewType");
17509
17551
  if (this.status === "ON_STAGE")
17510
17552
  throw new R("You are already on stage.", "2006");
17511
17553
  if (this.status !== "ACCEPTED_TO_JOIN_STAGE" || a(this, ae).permissions.stageAccess === j.NotAllowed)
17512
17554
  throw new R(`Unable to join stage you are currently ${this.status}`, "2006");
17513
- if (yield a(this, Yt).joinStage(), e === Mt.Livestream) {
17514
- yield a(this, it).getValue("selfController").joinRoom();
17555
+ if (a(this, Ke).setValue("stageStatus", "ON_STAGE", false), yield a(this, Yt).joinStage(), e === Mt.Livestream) {
17556
+ yield a(this, Ke).getValue("selfController").joinRoom();
17515
17557
  return;
17516
17558
  }
17517
- a(this, it).setValue("stageStatus", "ON_STAGE"), a(this, ae).audioEnabled && a(this, Jo, qu).shareMic(a(this, ae).audioTrack), a(this, ae).videoEnabled && a(this, Jo, qu).shareWebcam(a(this, ae).videoTrack);
17559
+ a(this, Ke).notify("stageStatus"), a(this, ae).audioEnabled && a(this, Jo, qu).shareMic(a(this, ae).audioTrack), a(this, ae).videoEnabled && a(this, Jo, qu).shareWebcam(a(this, ae).videoTrack);
17518
17560
  });
17519
17561
  }
17520
17562
  leave() {
@@ -17523,13 +17565,13 @@ class ri extends qt {
17523
17565
  throw this.logger.error("DyteStage::stage_disabled"), new R("Stage is disabled", "2003");
17524
17566
  if (!(this.status === "ON_STAGE" || this.status === "ACCEPTED_TO_JOIN_STAGE"))
17525
17567
  throw new R(`Unable to leave stage you are currently ${this.status}`, "2006");
17526
- a(this, ae).setIsPinned(false), a(this, it).setValue("stageStatus", "OFF_STAGE", false), yield a(this, Yt).leaveStage(a(this, ae).userId);
17568
+ a(this, ae).setIsPinned(false), a(this, Ke).setValue("stageStatus", "OFF_STAGE", false), yield a(this, Yt).leaveStage(a(this, ae).userId);
17527
17569
  try {
17528
- yield a(this, it).getValue("peerSessionStore").emitAsync(b.LEAVE_MEDIA_ROOM, "stageLeft");
17570
+ yield a(this, Ke).getValue("peerSessionStore").emitAsync(b.LEAVE_MEDIA_ROOM, "stageLeft");
17529
17571
  } catch (e) {
17530
17572
  this.logger.error("DyteStage::leave::emitAsync::failed", { error: e });
17531
17573
  }
17532
- a(this, it).notify("stageStatus");
17574
+ a(this, Ke).notify("stageStatus");
17533
17575
  });
17534
17576
  }
17535
17577
  kick(e) {
@@ -17547,34 +17589,39 @@ class ri extends qt {
17547
17589
  });
17548
17590
  }
17549
17591
  }
17550
- Yt = /* @__PURE__ */ new WeakMap(), Gd = /* @__PURE__ */ new WeakMap(), ae = /* @__PURE__ */ new WeakMap(), Wo = /* @__PURE__ */ new WeakMap(), As = /* @__PURE__ */ new WeakMap(), it = /* @__PURE__ */ new WeakMap(), Jo = /* @__PURE__ */ new WeakSet(), qu = function() {
17551
- return a(this, it).getValue("roomNodeClient");
17592
+ Yt = /* @__PURE__ */ new WeakMap(), Gd = /* @__PURE__ */ new WeakMap(), ae = /* @__PURE__ */ new WeakMap(), Wo = /* @__PURE__ */ new WeakMap(), As = /* @__PURE__ */ new WeakMap(), Ke = /* @__PURE__ */ new WeakMap(), Jo = /* @__PURE__ */ new WeakSet(), qu = function() {
17593
+ return a(this, Ke).getValue("roomNodeClient");
17552
17594
  }, Ya = /* @__PURE__ */ new WeakSet(), md = function(e) {
17553
17595
  return l(this, null, function* () {
17554
- this.status !== e && a(this, it).setValue("stageStatus", e);
17596
+ this.status !== e && a(this, Ke).setValue("stageStatus", e);
17555
17597
  });
17556
17598
  };
17557
17599
  Ea([
17558
17600
  T.trace("DyteStage.getStageRequests")
17559
- ], ri.prototype, "getAccessRequests", 1);
17601
+ ], ii.prototype, "getAccessRequests", 1);
17560
17602
  Ea([
17561
17603
  T.trace("DyteStage.requestAccess")
17562
- ], ri.prototype, "requestAccess", 1);
17604
+ ], ii.prototype, "requestAccess", 1);
17563
17605
  Ea([
17564
17606
  T.trace("DyteStage.cancelRequestAccess")
17565
- ], ri.prototype, "cancelRequestAccess", 1);
17607
+ ], ii.prototype, "cancelRequestAccess", 1);
17566
17608
  Ea([
17567
17609
  T.trace("DyteStage.grantAccess")
17568
- ], ri.prototype, "grantAccess", 1);
17610
+ ], ii.prototype, "grantAccess", 1);
17569
17611
  Ea([
17570
17612
  T.trace("DyteStage.denyAccess")
17571
- ], ri.prototype, "denyAccess", 1);
17613
+ ], ii.prototype, "denyAccess", 1);
17572
17614
  Ea([
17615
+ Sr.executeWithLock({
17616
+ methodName: "joinStage",
17617
+ lockName: "DyteStage.join",
17618
+ timeout: 5e3
17619
+ }),
17573
17620
  T.trace("DyteStage.joinStage")
17574
- ], ri.prototype, "join", 1);
17621
+ ], ii.prototype, "join", 1);
17575
17622
  Ea([
17576
17623
  T.trace("DyteStage.leaveStage")
17577
- ], ri.prototype, "leave", 1);
17624
+ ], ii.prototype, "leave", 1);
17578
17625
  function IM(s) {
17579
17626
  return !(s.viewType === "LIVESTREAM" || s.viewType === "CHAT");
17580
17627
  }
@@ -17598,22 +17645,22 @@ var AM = Object.defineProperty, MM = Object.getOwnPropertyDescriptor, DM = (s, t
17598
17645
  for (var i = r > 1 ? void 0 : r ? MM(t, e) : t, n = s.length - 1, o; n >= 0; n--)
17599
17646
  (o = s[n]) && (i = (r ? o(t, e, i) : o(i)) || i);
17600
17647
  return r && i && AM(t, e, i), i;
17601
- }, Ar, Pi, Mr, Ko, ft;
17648
+ }, Mr, Pi, Dr, Ko, ft;
17602
17649
  class Af {
17603
17650
  constructor(t, e, r, i, n) {
17604
17651
  h(this, "stage");
17605
- g(this, Ar, void 0);
17606
- g(this, Pi, void 0);
17607
17652
  g(this, Mr, void 0);
17653
+ g(this, Pi, void 0);
17654
+ g(this, Dr, void 0);
17608
17655
  g(this, Ko, 0);
17609
17656
  g(this, ft, void 0);
17610
- m(this, ft, t), this.stage = new ri(
17657
+ m(this, ft, t), this.stage = new ii(
17611
17658
  t,
17612
17659
  i,
17613
17660
  n,
17614
17661
  e,
17615
17662
  r
17616
- ), m(this, Mr, e), m(this, Ar, i), m(this, Pi, n), this.setupEvents();
17663
+ ), m(this, Dr, e), m(this, Mr, i), m(this, Pi, n), this.setupEvents();
17617
17664
  }
17618
17665
  get telemetry() {
17619
17666
  return a(this, ft).getValue("telemetry");
@@ -17624,17 +17671,17 @@ class Af {
17624
17671
  setupEvents() {
17625
17672
  a(this, ft).subscribe("stageStatus", (t) => {
17626
17673
  this.stage.emit("stageStatusUpdate", t);
17627
- }), a(this, Mr).on(x.grantStageAccess, () => {
17628
- a(this, Ar).permissions.stageAccess !== j.Allowed && (this.stage.emit("stageRequestApproved"), this.setStageStatus("ACCEPTED_TO_JOIN_STAGE"));
17629
- }), a(this, Mr).on(x.peerStageStatusUpdate, (t) => {
17630
- t !== void 0 && (t.peerId === a(this, Ar).id ? this.selfStageStatusHandler(t) : this.peerStageStatusHandler(t));
17631
- }), a(this, Mr).on(x.denyStageAccess, () => {
17632
- a(this, Ar).permissions.stageAccess !== j.Allowed && (this.stage.emit("stageRequestRejected"), this.setStageStatus("OFF_STAGE"));
17633
- }), a(this, Mr).on(
17674
+ }), a(this, Dr).on(x.grantStageAccess, () => {
17675
+ a(this, Mr).permissions.stageAccess !== j.Allowed && (this.stage.emit("stageRequestApproved"), this.setStageStatus("ACCEPTED_TO_JOIN_STAGE"));
17676
+ }), a(this, Dr).on(x.peerStageStatusUpdate, (t) => {
17677
+ t !== void 0 && (t.peerId === a(this, Mr).id ? this.selfStageStatusHandler(t) : this.peerStageStatusHandler(t));
17678
+ }), a(this, Dr).on(x.denyStageAccess, () => {
17679
+ a(this, Mr).permissions.stageAccess !== j.Allowed && (this.stage.emit("stageRequestRejected"), this.setStageStatus("OFF_STAGE"));
17680
+ }), a(this, Dr).on(
17634
17681
  x.getStageRequests,
17635
17682
  (t) => l(this, null, function* () {
17636
17683
  var r;
17637
- if (a(this, Ar).permissions.stageAccess !== j.Allowed)
17684
+ if (a(this, Mr).permissions.stageAccess !== j.Allowed)
17638
17685
  return;
17639
17686
  const e = (r = t == null ? void 0 : t.stageRequests) != null ? r : [];
17640
17687
  yield a(this, ft).getValue("peerSessionStore").emitAsync(b.GET_STAGE_REQUESTS, e), a(this, Ko) < e.length && e.length > 0 && this.stage.emit("newStageRequest", { count: e.length }), m(this, Ko, e.length), this.stage.emit("stageAccessRequestUpdate", e);
@@ -17703,7 +17750,7 @@ class Af {
17703
17750
  });
17704
17751
  }
17705
17752
  }
17706
- Ar = /* @__PURE__ */ new WeakMap(), Pi = /* @__PURE__ */ new WeakMap(), Mr = /* @__PURE__ */ new WeakMap(), Ko = /* @__PURE__ */ new WeakMap(), ft = /* @__PURE__ */ new WeakMap();
17753
+ Mr = /* @__PURE__ */ new WeakMap(), Pi = /* @__PURE__ */ new WeakMap(), Dr = /* @__PURE__ */ new WeakMap(), Ko = /* @__PURE__ */ new WeakMap(), ft = /* @__PURE__ */ new WeakMap();
17707
17754
  DM([
17708
17755
  T.trace("DyteStage.setupEvents")
17709
17756
  ], Af.prototype, "setupEvents", 1);
@@ -17726,7 +17773,7 @@ const Ie = {
17726
17773
  stageStatusUpdate: 25,
17727
17774
  peerStageStatusUpdate: 26
17728
17775
  };
17729
- var at, Ut, Qa, Xa, Ks, Za, Dr, en, Mg;
17776
+ var at, Ut, Qa, Xa, Ks, Za, Or, en, Mg;
17730
17777
  let Jn = (Mg = class extends Kn {
17731
17778
  constructor(t, {
17732
17779
  baseURL: e,
@@ -17768,12 +17815,12 @@ let Jn = (Mg = class extends Kn {
17768
17815
  h(this, "active");
17769
17816
  h(this, "iframes");
17770
17817
  h(this, "enabledBy");
17771
- g(this, Dr, void 0);
17818
+ g(this, Or, void 0);
17772
17819
  g(this, en, void 0);
17773
- m(this, Dr, t), this.baseURL = e, this.createdAt = new Date(r), this.description = i, this.id = n, this.name = o, m(this, Ut, k), this.organizationId = c, this.picture = d, this.private = u, this.published = p, this.staggered = f, this.tags = S, this.type = E, this.updatedAt = new Date(_), this.active = false, this.iframes = /* @__PURE__ */ new Map(), m(this, at, P), m(this, Qa, A), m(this, Xa, N), this.enabledBy = "", m(this, en, H);
17820
+ m(this, Or, t), this.baseURL = e, this.createdAt = new Date(r), this.description = i, this.id = n, this.name = o, m(this, Ut, k), this.organizationId = c, this.picture = d, this.private = u, this.published = p, this.staggered = f, this.tags = S, this.type = E, this.updatedAt = new Date(_), this.active = false, this.iframes = /* @__PURE__ */ new Map(), m(this, at, P), m(this, Qa, A), m(this, Xa, N), this.enabledBy = "", m(this, en, H);
17774
17821
  }
17775
17822
  get telemetry() {
17776
- return a(this, Dr).getValue("telemetry");
17823
+ return a(this, Or).getValue("telemetry");
17777
17824
  }
17778
17825
  sendIframeEvent(t) {
17779
17826
  this.iframes.size && this.iframes.forEach((e) => {
@@ -17933,7 +17980,7 @@ let Jn = (Mg = class extends Kn {
17933
17980
  case Ie.getRoomName: {
17934
17981
  this.sendIframeEvent({
17935
17982
  type: Ie.getRoomName,
17936
- payload: { roomName: a(this, Dr).getValue("meetingId") },
17983
+ payload: { roomName: a(this, Or).getValue("meetingId") },
17937
17984
  uuid: e.uuid
17938
17985
  });
17939
17986
  break;
@@ -17977,9 +18024,9 @@ let Jn = (Mg = class extends Kn {
17977
18024
  const r = t, i = new URL(this.baseURL), n = {
17978
18025
  auth: a(this, Za),
17979
18026
  parent: navigator.isReactNative ? this.baseURL : window.location.origin,
17980
- backend: a(this, Dr).getValue("apiBase"),
18027
+ backend: a(this, Or).getValue("apiBase"),
17981
18028
  pluginId: this.id,
17982
- roomName: (o = a(this, Dr).getValue("meetingId")) != null ? o : "",
18029
+ roomName: (o = a(this, Or).getValue("meetingId")) != null ? o : "",
17983
18030
  displayTitle: a(this, en)
17984
18031
  };
17985
18032
  if (Object.keys(n).forEach((c) => {
@@ -18062,7 +18109,7 @@ let Jn = (Mg = class extends Kn {
18062
18109
  }), m(this, Ks, void 0)));
18063
18110
  });
18064
18111
  }
18065
- }, at = /* @__PURE__ */ new WeakMap(), Ut = /* @__PURE__ */ new WeakMap(), Qa = /* @__PURE__ */ new WeakMap(), Xa = /* @__PURE__ */ new WeakMap(), Ks = /* @__PURE__ */ new WeakMap(), Za = /* @__PURE__ */ new WeakMap(), Dr = /* @__PURE__ */ new WeakMap(), en = /* @__PURE__ */ new WeakMap(), Mg);
18112
+ }, at = /* @__PURE__ */ new WeakMap(), Ut = /* @__PURE__ */ new WeakMap(), Qa = /* @__PURE__ */ new WeakMap(), Xa = /* @__PURE__ */ new WeakMap(), Ks = /* @__PURE__ */ new WeakMap(), Za = /* @__PURE__ */ new WeakMap(), Or = /* @__PURE__ */ new WeakMap(), en = /* @__PURE__ */ new WeakMap(), Mg);
18066
18113
  jl([
18067
18114
  Dt({ maxInvocations: 5, period: 1 })
18068
18115
  ], Jn.prototype, "sendData", 1);
@@ -20733,14 +20780,14 @@ var I0 = Object.defineProperty, A0 = Object.getOwnPropertyDescriptor, zc = (s, t
20733
20780
  for (var i = r > 1 ? void 0 : r ? A0(t, e) : t, n = s.length - 1, o; n >= 0; n--)
20734
20781
  (o = s[n]) && (i = (r ? o(t, e, i) : o(i)) || i);
20735
20782
  return r && i && I0(t, e, i), i;
20736
- }, nt, Or, Nr, Wd, $f;
20783
+ }, nt, Nr, Lr, Wd, $f;
20737
20784
  class Qn {
20738
20785
  constructor({ name: t, socketHandler: e, meetingId: r }) {
20739
20786
  g(this, Wd);
20740
20787
  h(this, "name", "");
20741
20788
  g(this, nt, {});
20742
- g(this, Or, "");
20743
- g(this, Nr, void 0);
20789
+ g(this, Nr, "");
20790
+ g(this, Lr, void 0);
20744
20791
  h(this, "rateLimitConfig", {
20745
20792
  maxInvocations: 5,
20746
20793
  period: 1
@@ -20750,7 +20797,7 @@ class Qn {
20750
20797
  period: 1
20751
20798
  });
20752
20799
  h(this, "listeners", {});
20753
- this.name = t, m(this, Nr, e), m(this, Or, r);
20800
+ this.name = t, m(this, Lr, e), m(this, Nr, r);
20754
20801
  }
20755
20802
  set(t, e, r = true, i = false) {
20756
20803
  return l(this, null, function* () {
@@ -20762,13 +20809,13 @@ class Qn {
20762
20809
  });
20763
20810
  }
20764
20811
  remoteSet(t, e) {
20765
- a(this, Nr).storeInsertKeys(a(this, Or), this.name, [{ key: t, payload: e }]);
20812
+ a(this, Lr).storeInsertKeys(a(this, Nr), this.name, [{ key: t, payload: e }]);
20766
20813
  }
20767
20814
  bulkSet(t) {
20768
20815
  return l(this, null, function* () {
20769
20816
  t.forEach(({ key: e, payload: r }) => {
20770
20817
  a(this, nt)[e] = r;
20771
- }), a(this, Nr).storeInsertKeys(a(this, Or), this.name, t);
20818
+ }), a(this, Lr).storeInsertKeys(a(this, Nr), this.name, t);
20772
20819
  });
20773
20820
  }
20774
20821
  update(t, e, r = true) {
@@ -20779,8 +20826,8 @@ class Qn {
20779
20826
  delete(t, e = true, r = false) {
20780
20827
  return l(this, null, function* () {
20781
20828
  if (a(this, nt)[t] && delete a(this, nt)[t], e)
20782
- return a(this, Nr).storeDeleteKeys(
20783
- a(this, Or),
20829
+ return a(this, Lr).storeDeleteKeys(
20830
+ a(this, Nr),
20784
20831
  this.name,
20785
20832
  [{ key: t }]
20786
20833
  );
@@ -20791,8 +20838,8 @@ class Qn {
20791
20838
  return l(this, null, function* () {
20792
20839
  return t.forEach(({ key: e }) => {
20793
20840
  a(this, nt)[e] && delete a(this, nt)[e];
20794
- }), a(this, Nr).storeDeleteKeys(
20795
- a(this, Or),
20841
+ }), a(this, Lr).storeDeleteKeys(
20842
+ a(this, Nr),
20796
20843
  this.name,
20797
20844
  t
20798
20845
  );
@@ -20836,7 +20883,7 @@ class Qn {
20836
20883
  m(this, nt, t);
20837
20884
  }
20838
20885
  }
20839
- nt = /* @__PURE__ */ new WeakMap(), Or = /* @__PURE__ */ new WeakMap(), Nr = /* @__PURE__ */ new WeakMap(), Wd = /* @__PURE__ */ new WeakSet(), $f = function(t, e, r = true) {
20886
+ nt = /* @__PURE__ */ new WeakMap(), Nr = /* @__PURE__ */ new WeakMap(), Lr = /* @__PURE__ */ new WeakMap(), Wd = /* @__PURE__ */ new WeakSet(), $f = function(t, e, r = true) {
20840
20887
  let i;
20841
20888
  const n = a(this, nt)[t], o = Object.prototype.toString.call(e), c = Object.prototype.toString.call(n);
20842
20889
  if (o !== c) {
@@ -20877,7 +20924,7 @@ zc([
20877
20924
  zc([
20878
20925
  Dt(Yn, "bulkRateLimitConfig")
20879
20926
  ], Qn.prototype, "bulkDelete", 1);
20880
- var Ai, Mi, sc, Ju, rc, Lr, Jd, Ff;
20927
+ var Ai, Mi, sc, Ju, rc, Vr, Jd, Ff;
20881
20928
  class M0 {
20882
20929
  constructor(t, e) {
20883
20930
  g(this, sc);
@@ -20886,7 +20933,7 @@ class M0 {
20886
20933
  g(this, Ai, void 0);
20887
20934
  g(this, Mi, "");
20888
20935
  g(this, rc, void 0);
20889
- g(this, Lr, /* @__PURE__ */ new Map());
20936
+ g(this, Vr, /* @__PURE__ */ new Map());
20890
20937
  m(this, Ai, e), m(this, Mi, t.getValue("meetingId")), m(this, rc, t), V(this, Jd, Ff).call(this);
20891
20938
  }
20892
20939
  create(t) {
@@ -20895,13 +20942,13 @@ class M0 {
20895
20942
  );
20896
20943
  return a(this, Ai).storeGetKeys(a(this, Mi), t, []), new Promise((i, n) => {
20897
20944
  const o = setTimeout(() => n(Error("Failed")), 3e3);
20898
- a(this, Lr).set(t, { rejectTimeout: o, resolve: i, store: e });
20945
+ a(this, Vr).set(t, { rejectTimeout: o, resolve: i, store: e });
20899
20946
  });
20900
20947
  }
20901
20948
  }
20902
20949
  Ai = /* @__PURE__ */ new WeakMap(), Mi = /* @__PURE__ */ new WeakMap(), sc = /* @__PURE__ */ new WeakSet(), Ju = function() {
20903
20950
  return a(this, rc).getValue("peerId");
20904
- }, rc = /* @__PURE__ */ new WeakMap(), Lr = /* @__PURE__ */ new WeakMap(), Jd = /* @__PURE__ */ new WeakSet(), Ff = function() {
20951
+ }, rc = /* @__PURE__ */ new WeakMap(), Vr = /* @__PURE__ */ new WeakMap(), Jd = /* @__PURE__ */ new WeakSet(), Ff = function() {
20905
20952
  [
20906
20953
  W.storeInsertKeys,
20907
20954
  W.storeGetKeys,
@@ -20925,13 +20972,13 @@ Ai = /* @__PURE__ */ new WeakMap(), Mi = /* @__PURE__ */ new WeakMap(), sc = /*
20925
20972
  };
20926
20973
  });
20927
20974
  if (t === W.storeGetKeys) {
20928
- const c = a(this, Lr).get(e.storeName), d = this.stores.get(e.storeName) || (c == null ? void 0 : c.store);
20929
- a(this, Lr).get(e.storeName) && (this.stores.set(e.storeName, c.store), c.resolve(d), clearTimeout(c.rejectTimeout), a(this, Lr).delete(e.storeName)), r.forEach((u) => {
20975
+ const c = a(this, Vr).get(e.storeName), d = this.stores.get(e.storeName) || (c == null ? void 0 : c.store);
20976
+ a(this, Vr).get(e.storeName) && (this.stores.set(e.storeName, c.store), c.resolve(d), clearTimeout(c.rejectTimeout), a(this, Vr).delete(e.storeName)), r.forEach((u) => {
20930
20977
  d.set(u.key, u.payload, false, false);
20931
20978
  });
20932
20979
  return;
20933
20980
  }
20934
- const i = this.stores.get(e.storeName) || ((o = a(this, Lr).get(e.storeName)) == null ? void 0 : o.store);
20981
+ const i = this.stores.get(e.storeName) || ((o = a(this, Vr).get(e.storeName)) == null ? void 0 : o.store);
20935
20982
  i !== void 0 && (t === W.storeInsertKeys && r.forEach(({ key: c, peerId: d, payload: u }) => {
20936
20983
  d !== a(this, sc, Ju) && i.set(c, u, false, true);
20937
20984
  }), t === W.storeDeleteKeys && r.forEach(({ key: c, peerId: d }) => {
@@ -20976,13 +21023,13 @@ var D0 = Object.defineProperty, O0 = Object.getOwnPropertyDescriptor, Xn = (s, t
20976
21023
  return r && i && D0(t, e, i), i;
20977
21024
  };
20978
21025
  const N0 = 0.8, L0 = 1.2;
20979
- var pn, gn, $t, Di, yo, Vr, ba, Oi, To, Kd, Hf, Qs, ic, xr, Ni, Eo, Xs, zd, ac, Ku, Yd, Bf, Qd, qf, Lg;
21026
+ var pn, gn, $t, Di, yo, xr, ba, Oi, To, Kd, Hf, Qs, ic, Ur, Ni, Eo, Xs, zd, ac, Ku, Yd, Bf, Qd, qf, Lg;
20980
21027
  let mr = (Lg = class extends qt {
20981
21028
  constructor(t, e, r, i) {
20982
21029
  const n = t.getValue("logger");
20983
21030
  super(n);
20984
21031
  g(this, Di);
20985
- g(this, Vr);
21032
+ g(this, xr);
20986
21033
  g(this, Oi);
20987
21034
  g(this, Kd);
20988
21035
  g(this, Ni);
@@ -21012,7 +21059,7 @@ let mr = (Lg = class extends qt {
21012
21059
  g(this, $t, void 0);
21013
21060
  g(this, Qs, void 0);
21014
21061
  g(this, ic, void 0);
21015
- g(this, xr, /* @__PURE__ */ new Map());
21062
+ g(this, Ur, /* @__PURE__ */ new Map());
21016
21063
  g(this, Xs, 1);
21017
21064
  g(this, zd, bh((t2) => {
21018
21065
  if (!this.videoTrack)
@@ -21081,7 +21128,7 @@ let mr = (Lg = class extends qt {
21081
21128
  });
21082
21129
  }
21083
21130
  setupEvents() {
21084
- this.on("videoUpdate", V(this, ac, Ku)), a(this, Vr, ba) && (this.on("audioUpdate", V(this, Yd, Bf)), this.on("screenShareUpdate", V(this, Qd, qf)));
21131
+ this.on("videoUpdate", V(this, ac, Ku)), a(this, xr, ba) && (this.on("audioUpdate", V(this, Yd, Bf)), this.on("screenShareUpdate", V(this, Qd, qf)));
21085
21132
  }
21086
21133
  pin() {
21087
21134
  return l(this, null, function* () {
@@ -21184,7 +21231,7 @@ let mr = (Lg = class extends qt {
21184
21231
  if (!t)
21185
21232
  return;
21186
21233
  let e;
21187
- (i = (r = a(this, xr).get(t)) == null ? void 0 : r.observer) == null || i.disconnect(), "ResizeObserver" in window && (e = new ResizeObserver(() => a(this, zd).call(this, t)), e.observe(t)), a(this, xr).set(t, { observer: e }), this.updateVideo(t), (o = a(this, Ni, Eo)) == null || o.addSource(
21234
+ (i = (r = a(this, Ur).get(t)) == null ? void 0 : r.observer) == null || i.disconnect(), "ResizeObserver" in window && (e = new ResizeObserver(() => a(this, zd).call(this, t)), e.observe(t)), a(this, Ur).set(t, { observer: e }), this.updateVideo(t), (o = a(this, Ni, Eo)) == null || o.addSource(
21188
21235
  this.id,
21189
21236
  t,
21190
21237
  this.videoEnabled,
@@ -21200,7 +21247,7 @@ let mr = (Lg = class extends qt {
21200
21247
  (e = a(this, Ni, Eo)) == null || e.removeSource(this.id);
21201
21248
  return;
21202
21249
  }
21203
- t.srcObject = void 0, (i = (r = a(this, xr).get(t)) == null ? void 0 : r.observer) == null || i.disconnect(), a(this, xr).delete(t), (n = a(this, Ni, Eo)) == null || n.removeSource(this.id);
21250
+ t.srcObject = void 0, (i = (r = a(this, Ur).get(t)) == null ? void 0 : r.observer) == null || i.disconnect(), a(this, Ur).delete(t), (n = a(this, Ni, Eo)) == null || n.removeSource(this.id);
21204
21251
  }
21205
21252
  updateVideo(t) {
21206
21253
  var e;
@@ -21218,22 +21265,22 @@ let mr = (Lg = class extends qt {
21218
21265
  }
21219
21266
  }, pn = /* @__PURE__ */ new WeakMap(), gn = /* @__PURE__ */ new WeakMap(), $t = /* @__PURE__ */ new WeakMap(), Di = /* @__PURE__ */ new WeakSet(), yo = function() {
21220
21267
  return a(this, $t).getValue("roomNodeClient");
21221
- }, Vr = /* @__PURE__ */ new WeakSet(), ba = function() {
21268
+ }, xr = /* @__PURE__ */ new WeakSet(), ba = function() {
21222
21269
  return a(this, $t).getValue("audioPlayback");
21223
21270
  }, Oi = /* @__PURE__ */ new WeakSet(), To = function() {
21224
21271
  return a(this, $t).getValue("connectionHandler").mediaJoined;
21225
21272
  }, Kd = /* @__PURE__ */ new WeakSet(), Hf = function() {
21226
21273
  return a(this, $t).getValue("connectionHandler").socketJoined;
21227
- }, Qs = /* @__PURE__ */ new WeakMap(), ic = /* @__PURE__ */ new WeakMap(), xr = /* @__PURE__ */ new WeakMap(), Ni = /* @__PURE__ */ new WeakSet(), Eo = function() {
21274
+ }, Qs = /* @__PURE__ */ new WeakMap(), ic = /* @__PURE__ */ new WeakMap(), Ur = /* @__PURE__ */ new WeakMap(), Ni = /* @__PURE__ */ new WeakSet(), Eo = function() {
21228
21275
  return a(this, $t).getValue("pip");
21229
21276
  }, Xs = /* @__PURE__ */ new WeakMap(), zd = /* @__PURE__ */ new WeakMap(), ac = /* @__PURE__ */ new WeakSet(), Ku = function() {
21230
- Array.from(a(this, xr).keys()).forEach(this.updateVideo);
21277
+ Array.from(a(this, Ur).keys()).forEach(this.updateVideo);
21231
21278
  }, Yd = /* @__PURE__ */ new WeakSet(), Bf = function() {
21232
21279
  var t, e;
21233
- this.audioEnabled && this.audioTrack ? (t = a(this, Vr, ba)) == null || t.addParticipantTrack(this.id, this.audioTrack) : (e = a(this, Vr, ba)) == null || e.removeParticipantTrack(this.id);
21280
+ this.audioEnabled && this.audioTrack ? (t = a(this, xr, ba)) == null || t.addParticipantTrack(this.id, this.audioTrack) : (e = a(this, xr, ba)) == null || e.removeParticipantTrack(this.id);
21234
21281
  }, Qd = /* @__PURE__ */ new WeakSet(), qf = function() {
21235
21282
  var t, e;
21236
- this.screenShareEnabled && this.screenShareTracks.audio ? (t = a(this, Vr, ba)) == null || t.addParticipantTrack(`screenshare-${this.id}`, this.screenShareTracks.audio) : (e = a(this, Vr, ba)) == null || e.removeParticipantTrack(`screenshare-${this.id}`);
21283
+ this.screenShareEnabled && this.screenShareTracks.audio ? (t = a(this, xr, ba)) == null || t.addParticipantTrack(`screenshare-${this.id}`, this.screenShareTracks.audio) : (e = a(this, xr, ba)) == null || e.removeParticipantTrack(`screenshare-${this.id}`);
21237
21284
  }, Lg);
21238
21285
  Xn([
21239
21286
  T.trace("DyteParticipant.disableAudio")
@@ -21276,27 +21323,27 @@ class mi extends Mf {
21276
21323
  return super.delete(t, e, r);
21277
21324
  }
21278
21325
  }
21279
- var Ur;
21326
+ var $r;
21280
21327
  class V0 extends Kn {
21281
21328
  constructor(e) {
21282
21329
  super(e);
21283
- g(this, Ur, void 0);
21284
- m(this, Ur, /* @__PURE__ */ new Map());
21330
+ g(this, $r, void 0);
21331
+ m(this, $r, /* @__PURE__ */ new Map());
21285
21332
  }
21286
21333
  __set(e, r) {
21287
- return a(this, Ur).set(e, r);
21334
+ return a(this, $r).set(e, r);
21288
21335
  }
21289
21336
  __clear() {
21290
- return a(this, Ur).clear();
21337
+ return a(this, $r).clear();
21291
21338
  }
21292
21339
  get(e) {
21293
- return a(this, Ur).get(e);
21340
+ return a(this, $r).get(e);
21294
21341
  }
21295
21342
  toArray() {
21296
- return Array.from(a(this, Ur).values());
21343
+ return Array.from(a(this, $r).values());
21297
21344
  }
21298
21345
  }
21299
- Ur = /* @__PURE__ */ new WeakMap();
21346
+ $r = /* @__PURE__ */ new WeakMap();
21300
21347
  class x0 {
21301
21348
  constructor() {
21302
21349
  h(this, "_orderedArray");
@@ -21731,7 +21778,7 @@ let Pt = (Vg = class extends qt {
21731
21778
  }
21732
21779
  getAllJoinedPeers(t, e, r) {
21733
21780
  return l(this, null, function* () {
21734
- return (yield a(this, wt).getRoomPeers(t, e, r)).peers.map(Sr.formatSocketServiceMessage);
21781
+ return (yield a(this, wt).getRoomPeers(t, e, r)).peers.map(vr.formatSocketServiceMessage);
21735
21782
  });
21736
21783
  }
21737
21784
  updatePermissions(t, e) {
@@ -22688,28 +22735,28 @@ const vd = (xg = class {
22688
22735
  })), t && this.updateSubscriptions(this.participants.viewMode);
22689
22736
  }
22690
22737
  }, Zs = /* @__PURE__ */ new WeakMap(), Ui = /* @__PURE__ */ new WeakMap(), $i = /* @__PURE__ */ new WeakMap(), Fi = /* @__PURE__ */ new WeakMap(), fn = /* @__PURE__ */ new WeakMap(), xg);
22691
- let Sr = vd;
22738
+ let vr = vd;
22692
22739
  _a([
22693
22740
  T.trace("ParticipantController.setupEvents")
22694
- ], Sr.prototype, "setupEvents", 1);
22741
+ ], vr.prototype, "setupEvents", 1);
22695
22742
  _a([
22696
22743
  T.trace("ParticipantController.setupEvents")
22697
- ], Sr.prototype, "setupEventsGlobal", 1);
22744
+ ], vr.prototype, "setupEventsGlobal", 1);
22698
22745
  _a([
22699
22746
  T.trace("ParticipantController.processMedia")
22700
- ], Sr.prototype, "processMedia", 1);
22747
+ ], vr.prototype, "processMedia", 1);
22701
22748
  _a([
22702
22749
  T.trace("ParticipantController.processConsumerClosed")
22703
- ], Sr.prototype, "processConsumerClosed", 1);
22750
+ ], vr.prototype, "processConsumerClosed", 1);
22704
22751
  _a([
22705
22752
  T.trace("ParticipantController.processConsumerResumed")
22706
- ], Sr.prototype, "processConsumerResumed", 1);
22753
+ ], vr.prototype, "processConsumerResumed", 1);
22707
22754
  _a([
22708
22755
  T.trace("ParticipantController.processConsumerPaused")
22709
- ], Sr.prototype, "processConsumerPaused", 1);
22756
+ ], vr.prototype, "processConsumerPaused", 1);
22710
22757
  _a([
22711
22758
  T.trace("ParticipantController.processNewConsumer")
22712
- ], Sr.prototype, "processNewConsumer", 1);
22759
+ ], vr.prototype, "processNewConsumer", 1);
22713
22760
  const he = Ps(
22714
22761
  wh().permissions
22715
22762
  );
@@ -22737,16 +22784,16 @@ const Oa = class extends qt {
22737
22784
  "polls",
22738
22785
  "media"
22739
22786
  ]);
22740
- if (r2 && (r2.private && _r(a(this, q).chat.private, r2.private), r2.public && _r(a(this, q).chat.public, r2.public), this.emit("chatUpdate")), i2 && _r(a(this, q).connectedMeetings, i2), c) {
22787
+ if (r2 && (r2.private && Pr(a(this, q).chat.private, r2.private), r2.public && Pr(a(this, q).chat.public, r2.public), this.emit("chatUpdate")), i2 && Pr(a(this, q).connectedMeetings, i2), c) {
22741
22788
  const E = (P) => {
22742
22789
  switch (P) {
22743
- case Yr.NONE:
22790
+ case Qr.NONE:
22744
22791
  return j.Allowed;
22745
- case Yr.ALLOWED:
22792
+ case Qr.ALLOWED:
22746
22793
  return j.Allowed;
22747
- case Yr.NOT_ALLOWED:
22794
+ case Qr.NOT_ALLOWED:
22748
22795
  return j.NotAllowed;
22749
- case Yr.CAN_REQUEST:
22796
+ case Qr.CAN_REQUEST:
22750
22797
  return j.CanRequest;
22751
22798
  default:
22752
22799
  return;
@@ -22762,9 +22809,9 @@ const Oa = class extends qt {
22762
22809
  canProduce: E(c.video.canProduce)
22763
22810
  }), (S = c.screenshare) != null && S.canProduce && (_.screenshare = {
22764
22811
  canProduce: E(c.screenshare.canProduce)
22765
- }), _r(a(this, q).media, _);
22812
+ }), Pr(a(this, q).media, _);
22766
22813
  }
22767
- n2 && (_r(a(this, q).plugins, n2), this.emit("pluginsUpdate")), o2 && (_r(a(this, q).polls, o2), this.emit("pollsUpdate")), Object.keys(d).length !== 0 && _r(a(this, q), d), this.emit("permissionsUpdate", e2);
22814
+ n2 && (Pr(a(this, q).plugins, n2), this.emit("pluginsUpdate")), o2 && (Pr(a(this, q).polls, o2), this.emit("pollsUpdate")), Object.keys(d).length !== 0 && Pr(a(this, q), d), this.emit("permissionsUpdate", e2);
22768
22815
  });
22769
22816
  if (!r)
22770
22817
  throw this.logger.error("DytePermissionsPreset::load_preset_permissions_failed"), new R("Could not load preset permissions.", "0904");
@@ -23260,51 +23307,12 @@ class Gf extends qt {
23260
23307
  }
23261
23308
  }
23262
23309
  us = /* @__PURE__ */ new WeakMap();
23263
- const vo = {}, ii = {
23264
- executeWithLock({
23265
- methodName: s,
23266
- lockName: t,
23267
- timeout: e
23268
- }) {
23269
- return (r, i, n) => {
23270
- const o = n.value;
23271
- return n.value = function(...d) {
23272
- var _, P;
23273
- const u = (P = (this == null ? void 0 : this.peerId) || ((_ = d[0]) == null ? void 0 : _.authToken)) != null ? P : "", p = `${t}-${u}`, f = this == null ? void 0 : this.logger;
23274
- if (vo[p]) {
23275
- const k = new Error(
23276
- `Unsupported concurrent calls on Dyte method: ${s}.`
23277
- );
23278
- throw k.name = "UnsupportedConcurrentMethodExecution", f == null || f.error("DyteLocker::UnsupportedConcurrentMethodExecution", {
23279
- error: {
23280
- stack: k.stack
23281
- },
23282
- dyteLocker: {
23283
- methodName: s,
23284
- lockName: p
23285
- }
23286
- }), k;
23287
- }
23288
- vo[p] = true;
23289
- const S = setTimeout(
23290
- () => delete vo[p],
23291
- e
23292
- ), E = o.apply(this, d);
23293
- return Promise.resolve(E).then(() => {
23294
- delete vo[p], clearTimeout(S);
23295
- }).catch(() => {
23296
- delete vo[p], clearTimeout(S);
23297
- }), E;
23298
- }, n;
23299
- };
23300
- }
23301
- };
23302
23310
  var j0 = Object.defineProperty, G0 = Object.getOwnPropertyDescriptor, Ct = (s, t, e, r) => {
23303
23311
  for (var i = r > 1 ? void 0 : r ? G0(t, e) : t, n = s.length - 1, o; n >= 0; n--)
23304
23312
  (o = s[n]) && (i = (r ? o(t, e, i) : o(i)) || i);
23305
23313
  return r && i && j0(t, e, i), i;
23306
- }, vn, vt, yn, He, er, di, je, Xe, Tn, yd, xe, Be, En, _n, nc, Yu, Ug;
23307
- let Qe = (Ug = class extends Gf {
23314
+ }, vn, vt, yn, He, er, di, je, Ze, Tn, yd, xe, Be, En, _n, nc, Yu, Ug;
23315
+ let Xe = (Ug = class extends Gf {
23308
23316
  constructor(t, e, r, i, n) {
23309
23317
  var c;
23310
23318
  const o = t.getValue("logger");
@@ -23351,11 +23359,11 @@ let Qe = (Ug = class extends Gf {
23351
23359
  var S, E, _, P, k, A;
23352
23360
  let c = (E = (S = t.getValue("defaults")) == null ? void 0 : S.audio) != null ? E : true, d = (P = (_ = t.getValue("defaults")) == null ? void 0 : _.video) != null ? P : true;
23353
23361
  r.canProduceAudio !== "ALLOWED" && (c = false), r.canProduceVideo !== "ALLOWED" && (d = false);
23354
- const u = new Qe(t, e, r, i, n);
23362
+ const u = new Xe(t, e, r, i, n);
23355
23363
  if (i.viewType === Mt.Chat)
23356
23364
  return u;
23357
23365
  const p = t0(i.mediaConstraints);
23358
- _r(p, (k = t.getValue("defaults")) == null ? void 0 : k.mediaConfiguration);
23366
+ Pr(p, (k = t.getValue("defaults")) == null ? void 0 : k.mediaConfiguration);
23359
23367
  const f = (A = t.getValue("defaults")) == null ? void 0 : A.mediaHandler;
23360
23368
  return f && (f.context = t), yield u.init({
23361
23369
  audio: c,
@@ -23375,7 +23383,7 @@ let Qe = (Ug = class extends Gf {
23375
23383
  }), this.localMediaHandler.on("AUDIO_TRACK_CHANGE", () => l(this, null, function* () {
23376
23384
  if (this.logger.info("DyteSelf::setupEvents::AUDIO_TRACK_CHANGE", D({}, gi(this))), a(this, xe, Be) && this.audioEnabled)
23377
23385
  try {
23378
- yield a(this, je, Xe).shareMic(this.audioTrack);
23386
+ yield a(this, je, Ze).shareMic(this.audioTrack);
23379
23387
  } catch (e) {
23380
23388
  this.logger.error("DyteSelf::setupEvents::Error while sharing mic", {
23381
23389
  error: e
@@ -23390,8 +23398,8 @@ let Qe = (Ug = class extends Gf {
23390
23398
  this.logger.info("DyteSelf::VIDEO_TRACK_CHANGE::Forcing_disable_video"), this.disableVideo();
23391
23399
  else if (this.videoEnabled && a(this, xe, Be))
23392
23400
  try {
23393
- const e = yield a(this, je, Xe).shareWebcam(this.videoTrack);
23394
- e && e.id !== this.videoTrack.id && a(this, He).getValue("flagsmith").hasFeature(Z.EXP_RESHARE) && (yield a(this, je, Xe).shareWebcam(this.videoTrack));
23401
+ const e = yield a(this, je, Ze).shareWebcam(this.videoTrack);
23402
+ e && e.id !== this.videoTrack.id && a(this, He).getValue("flagsmith").hasFeature(Z.EXP_RESHARE) && (yield a(this, je, Ze).shareWebcam(this.videoTrack));
23395
23403
  } catch (e) {
23396
23404
  this.logger.error("DyteSelf::setupEvents::failed shareWebcam", {
23397
23405
  error: e
@@ -23420,7 +23428,7 @@ let Qe = (Ug = class extends Gf {
23420
23428
  }
23421
23429
  if (this.screenShareEnabled)
23422
23430
  try {
23423
- yield a(this, je, Xe).shareScreen(this.screenShareTracks);
23431
+ yield a(this, je, Ze).shareScreen(this.screenShareTracks);
23424
23432
  } catch (e) {
23425
23433
  this.logger.error(
23426
23434
  "DyteSelf::setupEvents::Error while sharing screen",
@@ -23442,7 +23450,7 @@ let Qe = (Ug = class extends Gf {
23442
23450
  this.disableAudio();
23443
23451
  }), this.localMediaHandler.on("FORCE_MUTE_VIDEO", () => l(this, null, function* () {
23444
23452
  var e;
23445
- a(this, xe, Be) && (yield a(this, je, Xe).pauseWebcam()), this.emit("videoUpdate", {
23453
+ a(this, xe, Be) && (yield a(this, je, Ze).pauseWebcam()), this.emit("videoUpdate", {
23446
23454
  videoEnabled: this.videoEnabled,
23447
23455
  videoTrack: this.videoTrack
23448
23456
  }), (e = a(this, He)) == null || e.getValue("callstats").videoOff();
@@ -23488,7 +23496,7 @@ let Qe = (Ug = class extends Gf {
23488
23496
  if ((e = a(this, He)) == null || e.getValue("callstats").audioOn(), yield this.localMediaHandler.enableAudio(t), a(this, xe, Be) && this.stageStatus === "ON_STAGE") {
23489
23497
  if (this.audioTrack)
23490
23498
  try {
23491
- yield a(this, je, Xe).shareMic(this.audioTrack);
23499
+ yield a(this, je, Ze).shareMic(this.audioTrack);
23492
23500
  } catch (r) {
23493
23501
  this.logger.error("DyteSelf::enableAudio::Error while sharing mic", {
23494
23502
  error: r
@@ -23496,7 +23504,7 @@ let Qe = (Ug = class extends Gf {
23496
23504
  }
23497
23505
  if (!this.audioEnabled)
23498
23506
  return;
23499
- a(this, je, Xe).unmuteSelf();
23507
+ a(this, je, Ze).unmuteSelf();
23500
23508
  }
23501
23509
  this.emit("audioUpdate", {
23502
23510
  audioEnabled: this.audioEnabled,
@@ -23511,7 +23519,7 @@ let Qe = (Ug = class extends Gf {
23511
23519
  if (a(this, vt).canProduceVideo !== j.NotAllowed && !(a(this, vt).canProduceVideo === j.CanRequest && (this.stageStatus === "OFF_STAGE" || this.stageStatus === "REQUESTED_TO_JOIN_STAGE")) && !this.videoEnabled) {
23512
23520
  if ((e = a(this, He)) == null || e.getValue("callstats").videoOn(), yield this.localMediaHandler.enableVideo(t), a(this, xe, Be) && this.stageStatus === "ON_STAGE")
23513
23521
  try {
23514
- yield a(this, je, Xe).shareWebcam(this.videoTrack);
23522
+ yield a(this, je, Ze).shareWebcam(this.videoTrack);
23515
23523
  } catch (r) {
23516
23524
  this.logger.error("DyteSelf::enableVideo::Error while sharing video", {
23517
23525
  error: r
@@ -23537,7 +23545,7 @@ let Qe = (Ug = class extends Gf {
23537
23545
  throw new R("Can`t enable screenshare without joining room", "1105");
23538
23546
  if (a(this, vt).canProduceScreenshare !== j.NotAllowed && !(a(this, vt).canProduceScreenshare === j.CanRequest && (this.stageStatus === "OFF_STAGE" || this.stageStatus === "REQUESTED_TO_JOIN_STAGE")) && !this.screenShareEnabled && (yield this.localMediaHandler.enableScreenShare(), this.screenShareTracks.audio || this.screenShareTracks.video)) {
23539
23547
  try {
23540
- yield a(this, je, Xe).shareScreen(this.screenShareTracks);
23548
+ yield a(this, je, Ze).shareScreen(this.screenShareTracks);
23541
23549
  } catch (t) {
23542
23550
  this.logger.error(
23543
23551
  "DyteSelf::enableScreenShare::Error while sharing screen",
@@ -23563,7 +23571,7 @@ let Qe = (Ug = class extends Gf {
23563
23571
  disableAudio() {
23564
23572
  return l(this, null, function* () {
23565
23573
  var t;
23566
- this.audioEnabled && (this.localMediaHandler.disableAudio(), a(this, xe, Be) && a(this, je, Xe).muteSelf(), this.emit("audioUpdate", {
23574
+ this.audioEnabled && (this.localMediaHandler.disableAudio(), a(this, xe, Be) && a(this, je, Ze).muteSelf(), this.emit("audioUpdate", {
23567
23575
  audioEnabled: this.audioEnabled,
23568
23576
  audioTrack: this.audioTrack
23569
23577
  }), (t = a(this, He)) == null || t.getValue("callstats").audioOff());
@@ -23572,7 +23580,7 @@ let Qe = (Ug = class extends Gf {
23572
23580
  disableVideo() {
23573
23581
  return l(this, null, function* () {
23574
23582
  var t;
23575
- this.videoEnabled && (yield this.localMediaHandler.disableVideo(), a(this, xe, Be) && (yield a(this, je, Xe).pauseWebcam()), this.emit("videoUpdate", {
23583
+ this.videoEnabled && (yield this.localMediaHandler.disableVideo(), a(this, xe, Be) && (yield a(this, je, Ze).pauseWebcam()), this.emit("videoUpdate", {
23576
23584
  videoEnabled: this.videoEnabled,
23577
23585
  videoTrack: this.videoTrack
23578
23586
  }), (t = a(this, He)) == null || t.getValue("callstats").videoOff());
@@ -23580,7 +23588,7 @@ let Qe = (Ug = class extends Gf {
23580
23588
  }
23581
23589
  disableScreenShare() {
23582
23590
  return l(this, null, function* () {
23583
- this.screenShareEnabled && (yield this.localMediaHandler.disableScreenShare(), a(this, xe, Be) && (yield a(this, je, Xe).disableScreenShare()), this.emit("screenShareUpdate", {
23591
+ this.screenShareEnabled && (yield this.localMediaHandler.disableScreenShare(), a(this, xe, Be) && (yield a(this, je, Ze).disableScreenShare()), this.emit("screenShareUpdate", {
23584
23592
  screenShareEnabled: this.screenShareEnabled,
23585
23593
  screenShareTracks: this.screenShareTracks
23586
23594
  }));
@@ -23602,14 +23610,14 @@ let Qe = (Ug = class extends Gf {
23602
23610
  return l(this, null, function* () {
23603
23611
  if (!a(this, xe, Be))
23604
23612
  throw new R("Can`t pin participants without joining room", "1105");
23605
- return this.show(), a(this, je, Xe).pinPeer(this.id);
23613
+ return this.show(), a(this, je, Ze).pinPeer(this.id);
23606
23614
  });
23607
23615
  }
23608
23616
  unpin() {
23609
23617
  return l(this, null, function* () {
23610
23618
  if (!a(this, xe, Be))
23611
23619
  throw new R("Can`t unpin participants without joining room", "1105");
23612
- return a(this, je, Xe).pinPeer(null);
23620
+ return a(this, je, Ze).pinPeer(null);
23613
23621
  });
23614
23622
  }
23615
23623
  hide() {
@@ -23637,7 +23645,7 @@ let Qe = (Ug = class extends Gf {
23637
23645
  try {
23638
23646
  yield this.localMediaHandler.setAudioDevice(t);
23639
23647
  } catch (o) {
23640
- a(this, xe, Be) && (yield a(this, je, Xe).muteSelf()), this.emit("audioUpdate", {
23648
+ a(this, xe, Be) && (yield a(this, je, Ze).muteSelf()), this.emit("audioUpdate", {
23641
23649
  audioEnabled: this.audioEnabled,
23642
23650
  audioTrack: this.audioTrack
23643
23651
  });
@@ -23650,7 +23658,7 @@ let Qe = (Ug = class extends Gf {
23650
23658
  try {
23651
23659
  yield this.localMediaHandler.setVideoDevice(t);
23652
23660
  } catch (o) {
23653
- a(this, xe, Be) && (yield a(this, je, Xe).pauseWebcam()), this.emit("videoUpdate", {
23661
+ a(this, xe, Be) && (yield a(this, je, Ze).pauseWebcam()), this.emit("videoUpdate", {
23654
23662
  videoEnabled: this.videoEnabled,
23655
23663
  videoTrack: this.videoTrack
23656
23664
  });
@@ -23702,7 +23710,7 @@ let Qe = (Ug = class extends Gf {
23702
23710
  }
23703
23711
  }, vn = /* @__PURE__ */ new WeakMap(), vt = /* @__PURE__ */ new WeakMap(), yn = /* @__PURE__ */ new WeakMap(), He = /* @__PURE__ */ new WeakMap(), er = /* @__PURE__ */ new WeakSet(), di = function() {
23704
23712
  return a(this, He).getValue("pip");
23705
- }, je = /* @__PURE__ */ new WeakSet(), Xe = function() {
23713
+ }, je = /* @__PURE__ */ new WeakSet(), Ze = function() {
23706
23714
  return a(this, He).getValue("roomNodeClient");
23707
23715
  }, Tn = /* @__PURE__ */ new WeakSet(), yd = function() {
23708
23716
  return a(this, He).getValue("audioPlayback");
@@ -23714,79 +23722,79 @@ let Qe = (Ug = class extends Gf {
23714
23722
  }, Ug);
23715
23723
  Ct([
23716
23724
  T.trace("DyteSelf.cleanupEvents")
23717
- ], Qe.prototype, "cleanupEvents", 1);
23725
+ ], Xe.prototype, "cleanupEvents", 1);
23718
23726
  Ct([
23719
23727
  T.trace("DyteSelf.setupEvents")
23720
- ], Qe.prototype, "setupEvents", 1);
23728
+ ], Xe.prototype, "setupEvents", 1);
23721
23729
  Ct([
23722
23730
  T.trace("DyteSelf.setupTracks")
23723
- ], Qe.prototype, "setupTracks", 1);
23731
+ ], Xe.prototype, "setupTracks", 1);
23724
23732
  Ct([
23725
23733
  T.trace("DyteSelf.destructMediaHandler")
23726
- ], Qe.prototype, "destructMediaHandler", 1);
23734
+ ], Xe.prototype, "destructMediaHandler", 1);
23727
23735
  Ct([
23728
23736
  T.trace("DyteSelf.removeDocumentEventListeners")
23729
- ], Qe.prototype, "removeDocumentEventListeners", 1);
23737
+ ], Xe.prototype, "removeDocumentEventListeners", 1);
23730
23738
  Ct([
23731
- ii.executeWithLock({
23739
+ Sr.executeWithLock({
23732
23740
  methodName: "meeting.self.enableAudio",
23733
23741
  lockName: "DyteSelf.toggleAudio",
23734
23742
  timeout: 3e3
23735
23743
  }),
23736
23744
  T.trace("DyteSelf.enableAudio")
23737
- ], Qe.prototype, "enableAudio", 1);
23745
+ ], Xe.prototype, "enableAudio", 1);
23738
23746
  Ct([
23739
- ii.executeWithLock({
23747
+ Sr.executeWithLock({
23740
23748
  methodName: "meeting.self.enableVideo",
23741
23749
  lockName: "DyteSelf.toggleVideo",
23742
23750
  timeout: 3e3
23743
23751
  }),
23744
23752
  T.trace("DyteSelf.enableVideo")
23745
- ], Qe.prototype, "enableVideo", 1);
23753
+ ], Xe.prototype, "enableVideo", 1);
23746
23754
  Ct([
23747
23755
  T.trace("DyteSelf.updateVideoConstraints")
23748
- ], Qe.prototype, "updateVideoConstraints", 1);
23756
+ ], Xe.prototype, "updateVideoConstraints", 1);
23749
23757
  Ct([
23750
23758
  T.trace("DyteSelf.enableScreenShare"),
23751
- ii.executeWithLock({
23759
+ Sr.executeWithLock({
23752
23760
  methodName: "meeting.self.enableScreenShare",
23753
23761
  lockName: "DyteSelf.toggleScreenShare",
23754
23762
  timeout: 3e3
23755
23763
  })
23756
- ], Qe.prototype, "enableScreenShare", 1);
23764
+ ], Xe.prototype, "enableScreenShare", 1);
23757
23765
  Ct([
23758
23766
  T.trace("DyteSelf.updateScreenshareConstraints")
23759
- ], Qe.prototype, "updateScreenshareConstraints", 1);
23767
+ ], Xe.prototype, "updateScreenshareConstraints", 1);
23760
23768
  Ct([
23761
- ii.executeWithLock({
23769
+ Sr.executeWithLock({
23762
23770
  methodName: "meeting.self.disableAudio",
23763
23771
  lockName: "DyteSelf.toggleAudio",
23764
23772
  timeout: 3e3
23765
23773
  }),
23766
23774
  T.trace("DyteSelf.disableAudio")
23767
- ], Qe.prototype, "disableAudio", 1);
23775
+ ], Xe.prototype, "disableAudio", 1);
23768
23776
  Ct([
23769
- ii.executeWithLock({
23777
+ Sr.executeWithLock({
23770
23778
  methodName: "meeting.self.disableVideo",
23771
23779
  lockName: "DyteSelf.toggleVideo",
23772
23780
  timeout: 3e3
23773
23781
  }),
23774
23782
  T.trace("DyteSelf.disableVideo")
23775
- ], Qe.prototype, "disableVideo", 1);
23783
+ ], Xe.prototype, "disableVideo", 1);
23776
23784
  Ct([
23777
- ii.executeWithLock({
23785
+ Sr.executeWithLock({
23778
23786
  methodName: "meeting.self.disableScreenShare",
23779
23787
  lockName: "DyteSelf.toggleScreenShare",
23780
23788
  timeout: 3e3
23781
23789
  }),
23782
23790
  T.trace("DyteSelf.disableScreenShare")
23783
- ], Qe.prototype, "disableScreenShare", 1);
23791
+ ], Xe.prototype, "disableScreenShare", 1);
23784
23792
  Ct([
23785
23793
  T.trace("DyteSelf.setDevice")
23786
- ], Qe.prototype, "setDevice", 1);
23787
- Qe = Ct([
23794
+ ], Xe.prototype, "setDevice", 1);
23795
+ Xe = Ct([
23788
23796
  ht("1100")
23789
- ], Qe);
23797
+ ], Xe);
23790
23798
  class Uh extends Error {
23791
23799
  constructor(t) {
23792
23800
  super(t != null ? t : "AwaitQueue stopped"), this.name = "AwaitQueueStoppedError", typeof Error.captureStackTrace == "function" && Error.captureStackTrace(this, Uh);
@@ -23980,13 +23988,13 @@ function z0(s) {
23980
23988
  receiver: n
23981
23989
  };
23982
23990
  }
23983
- var Ke;
23991
+ var ze;
23984
23992
  class Y0 {
23985
23993
  constructor(t, e) {
23986
- g(this, Ke, void 0);
23994
+ g(this, ze, void 0);
23987
23995
  h(this, "events");
23988
23996
  h(this, "sfuType");
23989
- m(this, Ke, t), this.sfuType = e, this.events = e === Pe.CF ? Es : is;
23997
+ m(this, ze, t), this.sfuType = e, this.events = e === Pe.CF ? Es : is;
23990
23998
  }
23991
23999
  joinRoom(t, e, r, i = false, n = null) {
23992
24000
  return l(this, null, function* () {
@@ -23996,7 +24004,7 @@ class Y0 {
23996
24004
  prejoined: i,
23997
24005
  capabilities: r
23998
24006
  };
23999
- return n && (o.location = n), (yield a(this, Ke).sendMessagePromiseWithTimeout({
24007
+ return n && (o.location = n), (yield a(this, ze).sendMessagePromiseWithTimeout({
24000
24008
  event: this.events.joinRoom,
24001
24009
  protobuf: lR.toBinary(o),
24002
24010
  timeout: 5e3
@@ -24005,7 +24013,7 @@ class Y0 {
24005
24013
  }
24006
24014
  connectTransport(t) {
24007
24015
  return l(this, null, function* () {
24008
- const e = (yield a(this, Ke).sendMessagePromise(
24016
+ const e = (yield a(this, ze).sendMessagePromise(
24009
24017
  this.events.createWebRTCTransport,
24010
24018
  UC.toBinary(t)
24011
24019
  )).payload, { transportId: r, description: i, producerIds: n } = nf.fromBinary(e), o = {
@@ -24022,7 +24030,7 @@ class Y0 {
24022
24030
  produce(t) {
24023
24031
  return l(this, null, function* () {
24024
24032
  var n, o;
24025
- const e = (yield a(this, Ke).sendMessagePromise(
24033
+ const e = (yield a(this, ze).sendMessagePromise(
24026
24034
  this.events.produce,
24027
24035
  RR.toBinary(t)
24028
24036
  )).payload, r = ow.fromBinary(e);
@@ -24039,7 +24047,7 @@ class Y0 {
24039
24047
  return l(this, null, function* () {
24040
24048
  if (this.sfuType === Pe.HIVE)
24041
24049
  throw new Error("Hive does not support socket consumer operations");
24042
- const e = (yield a(this, Ke).sendMessagePromise(
24050
+ const e = (yield a(this, ze).sendMessagePromise(
24043
24051
  this.events.consume,
24044
24052
  yR.toBinary(t)
24045
24053
  )).payload, {
@@ -24051,7 +24059,7 @@ class Y0 {
24051
24059
  }
24052
24060
  closeProducer(t) {
24053
24061
  return l(this, null, function* () {
24054
- const e = (yield a(this, Ke).sendMessagePromise(
24062
+ const e = (yield a(this, ze).sendMessagePromise(
24055
24063
  this.events.closeProducer,
24056
24064
  DR.toBinary(t)
24057
24065
  )).payload, { description: r } = gw.fromBinary(e);
@@ -24062,7 +24070,7 @@ class Y0 {
24062
24070
  return l(this, null, function* () {
24063
24071
  if (this.sfuType === Pe.HIVE)
24064
24072
  throw new Error("Hive does not support socket consumer operations");
24065
- return (yield a(this, Ke).sendMessagePromise(
24073
+ return (yield a(this, ze).sendMessagePromise(
24066
24074
  this.events.closeConsumer,
24067
24075
  NR.toBinary(t)
24068
24076
  )).payload;
@@ -24072,7 +24080,7 @@ class Y0 {
24072
24080
  return l(this, null, function* () {
24073
24081
  if (this.sfuType === Pe.HIVE)
24074
24082
  throw new Error("Method not implemented");
24075
- return (yield a(this, Ke).sendMessagePromise(
24083
+ return (yield a(this, ze).sendMessagePromise(
24076
24084
  this.events.updateConsumersSimulcastConfig,
24077
24085
  PR.toBinary(t)
24078
24086
  )).payload;
@@ -24085,7 +24093,7 @@ class Y0 {
24085
24093
  screeShare: false,
24086
24094
  video: e === "video",
24087
24095
  participantId: t
24088
- }, i = (yield a(this, Ke).sendMessagePromise(
24096
+ }, i = (yield a(this, ze).sendMessagePromise(
24089
24097
  this.events.hostControlPeer,
24090
24098
  FR.toBinary(r)
24091
24099
  )).payload;
@@ -24101,7 +24109,7 @@ class Y0 {
24101
24109
  audio: t === "audio",
24102
24110
  screenShare: false,
24103
24111
  video: t === "video"
24104
- }, r = (yield a(this, Ke).sendMessagePromise(
24112
+ }, r = (yield a(this, ze).sendMessagePromise(
24105
24113
  this.events.hostControlAllPeers,
24106
24114
  BR.toBinary(e)
24107
24115
  )).payload;
@@ -24116,7 +24124,7 @@ class Y0 {
24116
24124
  const t = {
24117
24125
  propagateKickAcrossRooms: false
24118
24126
  };
24119
- a(this, Ke).sendMessagePromise(
24127
+ a(this, ze).sendMessagePromise(
24120
24128
  x.kickAll,
24121
24129
  lf.toBinary(t)
24122
24130
  );
@@ -24124,7 +24132,7 @@ class Y0 {
24124
24132
  }
24125
24133
  kickPeer(t) {
24126
24134
  return l(this, null, function* () {
24127
- a(this, Ke).sendMessagePromise(
24135
+ a(this, ze).sendMessagePromise(
24128
24136
  x.kick,
24129
24137
  mf.toBinary(t)
24130
24138
  );
@@ -24132,7 +24140,7 @@ class Y0 {
24132
24140
  }
24133
24141
  changeDisplayName(t) {
24134
24142
  return l(this, null, function* () {
24135
- const e = (yield a(this, Ke).sendMessagePromise(
24143
+ const e = (yield a(this, ze).sendMessagePromise(
24136
24144
  this.events.changeDisplayName,
24137
24145
  UR.toBinary(t)
24138
24146
  )).payload;
@@ -24144,7 +24152,7 @@ class Y0 {
24144
24152
  }
24145
24153
  notifySelfJoinComplete() {
24146
24154
  return l(this, null, function* () {
24147
- const t = {}, e = (yield a(this, Ke).sendMessagePromise(
24155
+ const t = {}, e = (yield a(this, ze).sendMessagePromise(
24148
24156
  this.events.selfJoinComplete,
24149
24157
  hR.toBinary(t)
24150
24158
  )).payload;
@@ -24153,11 +24161,11 @@ class Y0 {
24153
24161
  }
24154
24162
  audioActivity(t) {
24155
24163
  return l(this, null, function* () {
24156
- a(this, Ke).sendMessage(this.events.audioActivity, FC.toBinary(t));
24164
+ a(this, ze).sendMessage(this.events.audioActivity, FC.toBinary(t));
24157
24165
  });
24158
24166
  }
24159
24167
  }
24160
- Ke = /* @__PURE__ */ new WeakMap();
24168
+ ze = /* @__PURE__ */ new WeakMap();
24161
24169
  var cc;
24162
24170
  class Kl extends ut.EventEmitter {
24163
24171
  constructor(e) {
@@ -24698,7 +24706,7 @@ class Bh extends Fh {
24698
24706
  function Q0(s, t) {
24699
24707
  return typeof s == "undefined" ? t : typeof window != "undefined" && Object.getOwnPropertyDescriptor(window, "structuredClone") ? structuredClone(s) : JSON.parse(JSON.stringify(s));
24700
24708
  }
24701
- var dc, Bi, Os, Zd, Ns, Pr, lc, Xu, el, Jf, tl, Kf;
24709
+ var dc, Bi, Os, Zd, Ns, Cr, lc, Xu, el, Jf, tl, Kf;
24702
24710
  class X0 extends Kl {
24703
24711
  constructor(e, r) {
24704
24712
  var i;
@@ -24733,7 +24741,7 @@ class X0 extends Kl {
24733
24741
  return a(this, Bi);
24734
24742
  }
24735
24743
  close(e, r) {
24736
- a(this, Os) || (this.logger.debug(`Consumer::close() ${e ? `with reason ${e}` : ""}`, a(this, Ns, Pr)), m(this, Os, true), r && (V(this, tl, Kf).call(this), this.transceiver.stop()), this.safeEmit("close", e));
24744
+ a(this, Os) || (this.logger.debug(`Consumer::close() ${e ? `with reason ${e}` : ""}`, a(this, Ns, Cr)), m(this, Os, true), r && (V(this, tl, Kf).call(this), this.transceiver.stop()), this.safeEmit("close", e));
24737
24745
  }
24738
24746
  getStats() {
24739
24747
  return l(this, null, function* () {
@@ -24743,21 +24751,21 @@ class X0 extends Kl {
24743
24751
  });
24744
24752
  }
24745
24753
  pause() {
24746
- if (this.logger.debug("consumer::pause()", a(this, Ns, Pr)), a(this, Os)) {
24747
- this.logger.error("consumer::pause() | Consumer closed", a(this, Ns, Pr));
24754
+ if (this.logger.debug("consumer::pause()", a(this, Ns, Cr)), a(this, Os)) {
24755
+ this.logger.error("consumer::pause() | Consumer closed", a(this, Ns, Cr));
24748
24756
  return;
24749
24757
  }
24750
24758
  m(this, Bi, true), this.track.enabled = false, this.safeEmit("pause");
24751
24759
  }
24752
24760
  resume() {
24753
- if (this.logger.debug("consumer::resume()", a(this, Ns, Pr)), a(this, Os)) {
24754
- this.logger.error("Consumer::resume() | Consumer closed", a(this, Ns, Pr));
24761
+ if (this.logger.debug("consumer::resume()", a(this, Ns, Cr)), a(this, Os)) {
24762
+ this.logger.error("Consumer::resume() | Consumer closed", a(this, Ns, Cr));
24755
24763
  return;
24756
24764
  }
24757
24765
  m(this, Bi, false), this.track.enabled = true, this.safeEmit("resume");
24758
24766
  }
24759
24767
  }
24760
- dc = /* @__PURE__ */ new WeakMap(), Bi = /* @__PURE__ */ new WeakMap(), Os = /* @__PURE__ */ new WeakMap(), Zd = /* @__PURE__ */ new WeakMap(), Ns = /* @__PURE__ */ new WeakSet(), Pr = function() {
24768
+ dc = /* @__PURE__ */ new WeakMap(), Bi = /* @__PURE__ */ new WeakMap(), Os = /* @__PURE__ */ new WeakMap(), Zd = /* @__PURE__ */ new WeakMap(), Ns = /* @__PURE__ */ new WeakSet(), Cr = function() {
24761
24769
  return {
24762
24770
  consumer: {
24763
24771
  id: this.id,
@@ -24767,19 +24775,19 @@ dc = /* @__PURE__ */ new WeakMap(), Bi = /* @__PURE__ */ new WeakMap(), Os = /*
24767
24775
  }
24768
24776
  };
24769
24777
  }, lc = /* @__PURE__ */ new WeakSet(), Xu = function() {
24770
- this.logger.debug('Consumer::track "ended" event', a(this, Ns, Pr)), this.safeEmit("trackended");
24778
+ this.logger.debug('Consumer::track "ended" event', a(this, Ns, Cr)), this.safeEmit("trackended");
24771
24779
  }, el = /* @__PURE__ */ new WeakSet(), Jf = function() {
24772
24780
  this.track.addEventListener("ended", V(this, lc, Xu).bind(this));
24773
24781
  }, tl = /* @__PURE__ */ new WeakSet(), Kf = function() {
24774
24782
  try {
24775
24783
  this.track.removeEventListener("ended", V(this, lc, Xu)), this.track.stop();
24776
24784
  } catch (e) {
24777
- this.logger.error("Consumer::destroyTrack()", B(D({}, a(this, Ns, Pr)), {
24785
+ this.logger.error("Consumer::destroyTrack()", B(D({}, a(this, Ns, Cr)), {
24778
24786
  error: e
24779
24787
  }));
24780
24788
  }
24781
24789
  };
24782
- var hs, Pn, Cn, qi, es, Ze, $r, Rn, sl, Ft, os;
24790
+ var hs, Pn, Cn, qi, es, et, Fr, Rn, sl, Ft, os;
24783
24791
  class Z0 extends Kl {
24784
24792
  constructor(e, r) {
24785
24793
  var i, n;
@@ -24795,20 +24803,20 @@ class Z0 extends Kl {
24795
24803
  g(this, Cn, void 0);
24796
24804
  g(this, qi, void 0);
24797
24805
  g(this, es, false);
24798
- g(this, Ze, void 0);
24799
- g(this, $r, void 0);
24806
+ g(this, et, void 0);
24807
+ g(this, Fr, void 0);
24800
24808
  g(this, Rn, void 0);
24801
24809
  g(this, sl, void 0);
24802
- this.id = r.id, this.localId = r.localId, m(this, Ze, r.track), this.kind = (i = r.track) == null ? void 0 : i.kind, m(this, $r, r.disableTrackOnPause ? !((n = r.track) != null && n.enabled) : false), m(this, Rn, void 0), m(this, Pn, r.stopTracks), m(this, Cn, r.disableTrackOnPause), m(this, qi, r.zeroRtpOnPause), this.appData = r.appData || {}, this._onTrackEnded = this._onTrackEnded.bind(this), m(this, hs, r.handler), this.rtpSender = r.rtpSender, this._handleTrack(), m(this, sl, e);
24810
+ this.id = r.id, this.localId = r.localId, m(this, et, r.track), this.kind = (i = r.track) == null ? void 0 : i.kind, m(this, Fr, r.disableTrackOnPause ? !((n = r.track) != null && n.enabled) : false), m(this, Rn, void 0), m(this, Pn, r.stopTracks), m(this, Cn, r.disableTrackOnPause), m(this, qi, r.zeroRtpOnPause), this.appData = r.appData || {}, this._onTrackEnded = this._onTrackEnded.bind(this), m(this, hs, r.handler), this.rtpSender = r.rtpSender, this._handleTrack(), m(this, sl, e);
24803
24811
  }
24804
24812
  get closed() {
24805
24813
  return a(this, es);
24806
24814
  }
24807
24815
  get track() {
24808
- return a(this, Ze);
24816
+ return a(this, et);
24809
24817
  }
24810
24818
  get paused() {
24811
- return a(this, $r);
24819
+ return a(this, Fr);
24812
24820
  }
24813
24821
  get maxSpatialLayer() {
24814
24822
  return a(this, Rn);
@@ -24833,14 +24841,14 @@ class Z0 extends Kl {
24833
24841
  });
24834
24842
  }
24835
24843
  pause() {
24836
- this.logger.debug("Producer::pause()", a(this, Ft, os)), a(this, es) && this.logger.error("Producer::pause() | Producer closed", a(this, Ft, os)), m(this, $r, true), a(this, Ze) && a(this, Cn) && (a(this, Ze).enabled = false), a(this, qi) && a(this, hs).replaceTrack(this.localId, null), this.emit("pause");
24844
+ this.logger.debug("Producer::pause()", a(this, Ft, os)), a(this, es) && this.logger.error("Producer::pause() | Producer closed", a(this, Ft, os)), m(this, Fr, true), a(this, et) && a(this, Cn) && (a(this, et).enabled = false), a(this, qi) && a(this, hs).replaceTrack(this.localId, null), this.emit("pause");
24837
24845
  }
24838
24846
  resume() {
24839
24847
  if (this.logger.debug("Producer::resume()", a(this, Ft, os)), a(this, es)) {
24840
24848
  this.logger.error("Producer::resume() | Producer closed", a(this, Ft, os));
24841
24849
  return;
24842
24850
  }
24843
- m(this, $r, false), a(this, Ze) && a(this, Cn) && (a(this, Ze).enabled = true), a(this, qi) && a(this, hs).replaceTrack(this.localId, a(this, Ze)), this.emit("resume");
24851
+ m(this, Fr, false), a(this, et) && a(this, Cn) && (a(this, et).enabled = true), a(this, qi) && a(this, hs).replaceTrack(this.localId, a(this, et)), this.emit("resume");
24844
24852
  }
24845
24853
  replaceTrack(r) {
24846
24854
  return l(this, arguments, function* ({
@@ -24858,11 +24866,11 @@ class Z0 extends Kl {
24858
24866
  throw new At("closed");
24859
24867
  } else if (e && e.readyState === "ended")
24860
24868
  throw new At("track ended");
24861
- if (e === a(this, Ze)) {
24869
+ if (e === a(this, et)) {
24862
24870
  this.logger.debug(`replaceTrack() | same track, ignored trackId: ${e.id}`, a(this, Ft, os));
24863
24871
  return;
24864
24872
  }
24865
- (!a(this, qi) || !a(this, $r)) && (yield a(this, hs).replaceTrack(this.localId, e)), this._destroyTrack(), m(this, Ze, e), this._handleTrack();
24873
+ (!a(this, qi) || !a(this, Fr)) && (yield a(this, hs).replaceTrack(this.localId, e)), this._destroyTrack(), m(this, et, e), this._handleTrack();
24866
24874
  });
24867
24875
  }
24868
24876
  setMaxSpatialLayer(e) {
@@ -24889,13 +24897,13 @@ class Z0 extends Kl {
24889
24897
  this.logger.debug(`Producer::track "ended" event trackId: ${this.track.id}`, a(this, Ft, os)), this.safeEmit("trackended", this.track.id);
24890
24898
  }
24891
24899
  _handleTrack() {
24892
- a(this, Ze) && a(this, Ze).addEventListener("ended", this._onTrackEnded);
24900
+ a(this, et) && a(this, et).addEventListener("ended", this._onTrackEnded);
24893
24901
  }
24894
24902
  _destroyTrack() {
24895
24903
  var e;
24896
- if (a(this, Ze))
24904
+ if (a(this, et))
24897
24905
  try {
24898
- a(this, Ze).removeEventListener("ended", this._onTrackEnded), a(this, Pn) && a(this, Ze).stop();
24906
+ a(this, et).removeEventListener("ended", this._onTrackEnded), a(this, Pn) && a(this, et).stop();
24899
24907
  } catch (r) {
24900
24908
  this.logger.error(`Producer::_destroyTrack trackId: ${(e = this.track) == null ? void 0 : e.id}`, B(D({}, a(this, Ft, os)), {
24901
24909
  error: r
@@ -24903,7 +24911,7 @@ class Z0 extends Kl {
24903
24911
  }
24904
24912
  }
24905
24913
  }
24906
- hs = /* @__PURE__ */ new WeakMap(), Pn = /* @__PURE__ */ new WeakMap(), Cn = /* @__PURE__ */ new WeakMap(), qi = /* @__PURE__ */ new WeakMap(), es = /* @__PURE__ */ new WeakMap(), Ze = /* @__PURE__ */ new WeakMap(), $r = /* @__PURE__ */ new WeakMap(), Rn = /* @__PURE__ */ new WeakMap(), sl = /* @__PURE__ */ new WeakMap(), Ft = /* @__PURE__ */ new WeakSet(), os = function() {
24914
+ hs = /* @__PURE__ */ new WeakMap(), Pn = /* @__PURE__ */ new WeakMap(), Cn = /* @__PURE__ */ new WeakMap(), qi = /* @__PURE__ */ new WeakMap(), es = /* @__PURE__ */ new WeakMap(), et = /* @__PURE__ */ new WeakMap(), Fr = /* @__PURE__ */ new WeakMap(), Rn = /* @__PURE__ */ new WeakMap(), sl = /* @__PURE__ */ new WeakMap(), Ft = /* @__PURE__ */ new WeakSet(), os = function() {
24907
24915
  return {
24908
24916
  producer: {
24909
24917
  id: this.id,
@@ -24930,14 +24938,14 @@ function Yf(s) {
24930
24938
  var t, e;
24931
24939
  return eD(s) && (e = (t = s.payload._bolt) == null ? void 0 : t.id) != null ? e : "";
24932
24940
  }
24933
- var Fr, rl, ji;
24941
+ var Hr, rl, ji;
24934
24942
  const Na = class extends ut.EventEmitter {
24935
24943
  constructor(e, r, i, n) {
24936
24944
  super();
24937
24945
  h(this, "channel");
24938
24946
  h(this, "queue");
24939
24947
  h(this, "serverProtocolVersion");
24940
- g(this, Fr, /* @__PURE__ */ new Map());
24948
+ g(this, Hr, /* @__PURE__ */ new Map());
24941
24949
  g(this, rl, void 0);
24942
24950
  g(this, ji, void 0);
24943
24951
  h(this, "respond", (e2, r2, i2 = false) => {
@@ -24990,11 +24998,11 @@ const Na = class extends ut.EventEmitter {
24990
24998
  });
24991
24999
  h(this, "processMessage", (e2) => {
24992
25000
  var i2;
24993
- a(this, Fr).has(e2.id) || a(this, Fr).set(e2.id, []);
24994
- const r2 = a(this, Fr).get(e2.id);
25001
+ a(this, Hr).has(e2.id) || a(this, Hr).set(e2.id, []);
25002
+ const r2 = a(this, Hr).get(e2.id);
24995
25003
  if (r2[e2.chunkIndex] = e2, (r2 == null ? void 0 : r2.length) === e2.count && !r2.some((n2) => n2 === void 0)) {
24996
- const n2 = a(this, Fr).get(e2.id), o = n2 == null ? void 0 : n2.reduce((d, u) => d + u.chunk, "");
24997
- a(this, Fr).delete(e2.id);
25004
+ const n2 = a(this, Hr).get(e2.id), o = n2 == null ? void 0 : n2.reduce((d, u) => d + u.chunk, "");
25005
+ a(this, Hr).delete(e2.id);
24998
25006
  const c = JSON.parse(o);
24999
25007
  if (!c.payload || !zf(c.payload))
25000
25008
  throw new Error("corrupted incoming message over dc", {
@@ -25018,7 +25026,7 @@ const Na = class extends ut.EventEmitter {
25018
25026
  }
25019
25027
  };
25020
25028
  let li = Na;
25021
- Fr = /* @__PURE__ */ new WeakMap(), rl = /* @__PURE__ */ new WeakMap(), ji = /* @__PURE__ */ new WeakMap(), h(li, "createRequest", (e) => {
25029
+ Hr = /* @__PURE__ */ new WeakMap(), rl = /* @__PURE__ */ new WeakMap(), ji = /* @__PURE__ */ new WeakMap(), h(li, "createRequest", (e) => {
25022
25030
  var r;
25023
25031
  if ((r = e.payload) != null && r._bolt)
25024
25032
  throw new Error("rpc fields are internal values");
@@ -25912,13 +25920,13 @@ wn = /* @__PURE__ */ new WeakMap(), ot = /* @__PURE__ */ new WeakMap(), ct = /*
25912
25920
  break;
25913
25921
  case "disconnected":
25914
25922
  a(this, zi)[r] = setTimeout(() => l(this, null, function* () {
25915
- yield V(this, fc, sh).call(this, e.direction);
25923
+ this.logger.warn(`${r} transport is in disconnected state, reconnecting transport`, { transport: { id: i, serverId: e.serverId, type: r } }), yield V(this, fc, sh).call(this, e.direction);
25916
25924
  }), rD);
25917
25925
  break;
25918
25926
  case "failed":
25919
25927
  if (e.closed)
25920
25928
  return;
25921
- o(), yield V(this, fc, sh).call(this, e.direction);
25929
+ o(), this.logger.warn(`${r} transport is in failed state, reconnecting transport`, { transport: { id: i, serverId: e.serverId, type: r } }), yield V(this, fc, sh).call(this, e.direction);
25922
25930
  break;
25923
25931
  }
25924
25932
  })), e.on("icecandidate", (n) => l(this, null, function* () {
@@ -26302,7 +26310,7 @@ class qh {
26302
26310
  });
26303
26311
  }
26304
26312
  }
26305
- var Yi, Hr, Dn, Tc, ps, ul, sr, On, Ec, ih, hl, iS, pl, aS, gl, nS, ml, oS;
26313
+ var Yi, Br, Dn, Tc, ps, ul, sr, On, Ec, ih, hl, iS, pl, aS, gl, nS, ml, oS;
26306
26314
  class oD extends iD {
26307
26315
  constructor(e, r, i) {
26308
26316
  super(e, r, i);
@@ -26312,7 +26320,7 @@ class oD extends iD {
26312
26320
  g(this, gl);
26313
26321
  g(this, ml);
26314
26322
  g(this, Yi, void 0);
26315
- g(this, Hr, void 0);
26323
+ g(this, Br, void 0);
26316
26324
  g(this, Dn, void 0);
26317
26325
  g(this, Tc, void 0);
26318
26326
  g(this, ps, void 0);
@@ -26350,7 +26358,7 @@ class oD extends iD {
26350
26358
  return a(this, Yi);
26351
26359
  }
26352
26360
  get consumers() {
26353
- return a(this, Hr);
26361
+ return a(this, Br);
26354
26362
  }
26355
26363
  get producerIdToConsumerIdMap() {
26356
26364
  return a(this, Dn);
@@ -26359,7 +26367,7 @@ class oD extends iD {
26359
26367
  return this.context.getValue("logger");
26360
26368
  }
26361
26369
  reset() {
26362
- m(this, Yi, /* @__PURE__ */ new Map()), m(this, Hr, /* @__PURE__ */ new Map()), m(this, Dn, /* @__PURE__ */ new Map());
26370
+ m(this, Yi, /* @__PURE__ */ new Map()), m(this, Br, /* @__PURE__ */ new Map()), m(this, Dn, /* @__PURE__ */ new Map());
26363
26371
  }
26364
26372
  createProducer(e, r) {
26365
26373
  return l(this, null, function* () {
@@ -26419,7 +26427,7 @@ class oD extends iD {
26419
26427
  });
26420
26428
  }
26421
26429
  closeAllConsumers() {
26422
- return this.closeConsumers(Array.from(a(this, Hr).keys()));
26430
+ return this.closeConsumers(Array.from(a(this, Br).keys()));
26423
26431
  }
26424
26432
  switchConsumersToLayer(e, r) {
26425
26433
  return l(this, null, function* () {
@@ -26427,7 +26435,7 @@ class oD extends iD {
26427
26435
  });
26428
26436
  }
26429
26437
  }
26430
- Yi = /* @__PURE__ */ new WeakMap(), Hr = /* @__PURE__ */ new WeakMap(), Dn = /* @__PURE__ */ new WeakMap(), Tc = /* @__PURE__ */ new WeakMap(), ps = /* @__PURE__ */ new WeakMap(), ul = /* @__PURE__ */ new WeakMap(), sr = /* @__PURE__ */ new WeakMap(), On = /* @__PURE__ */ new WeakMap(), Ec = /* @__PURE__ */ new WeakSet(), ih = function() {
26438
+ Yi = /* @__PURE__ */ new WeakMap(), Br = /* @__PURE__ */ new WeakMap(), Dn = /* @__PURE__ */ new WeakMap(), Tc = /* @__PURE__ */ new WeakMap(), ps = /* @__PURE__ */ new WeakMap(), ul = /* @__PURE__ */ new WeakMap(), sr = /* @__PURE__ */ new WeakMap(), On = /* @__PURE__ */ new WeakMap(), Ec = /* @__PURE__ */ new WeakSet(), ih = function() {
26431
26439
  return l(this, null, function* () {
26432
26440
  if (!this.recvTransport || this.recvTransport.closed)
26433
26441
  throw new Error("Recv transport is closed");
@@ -26514,8 +26522,8 @@ Yi = /* @__PURE__ */ new WeakMap(), Hr = /* @__PURE__ */ new WeakMap(), Dn = /*
26514
26522
  kind: e.kind,
26515
26523
  appData: e.appData
26516
26524
  }
26517
- }), a(this, Hr).delete(e.id), this.context.getValue("peerSessionStore").emit(b.CONSUMER_CLOSED, { id: e.id });
26518
- })), a(this, Hr).set(e.id, e), this.producerIdToConsumerIdMap.set(e.producerId, e.id), this.context.getValue("peerSessionStore").emit(b.NEW_CONSUMER, {
26525
+ }), a(this, Br).delete(e.id), this.context.getValue("peerSessionStore").emit(b.CONSUMER_CLOSED, { id: e.id });
26526
+ })), a(this, Br).set(e.id, e), this.producerIdToConsumerIdMap.set(e.producerId, e.id), this.context.getValue("peerSessionStore").emit(b.NEW_CONSUMER, {
26519
26527
  id: e.id,
26520
26528
  appData: e.appData,
26521
26529
  peerId: e.peerId
@@ -26598,7 +26606,7 @@ _c = /* @__PURE__ */ new WeakMap(), Pc = /* @__PURE__ */ new WeakMap(), Cc = /*
26598
26606
  return e;
26599
26607
  }, g(Co, vl), g(Co, yl);
26600
26608
  const cD = 60, dD = 400;
26601
- var ir, ar, fs, Br, qr, Un, Zi, $n, nr, jr, Fn, ea, El, hS, kc, ah, _l, pS, Pl, gS;
26609
+ var ir, ar, fs, qr, jr, Un, Zi, $n, nr, Gr, Fn, ea, El, hS, kc, ah, _l, pS, Pl, gS;
26602
26610
  const Lo = class {
26603
26611
  constructor(t, e) {
26604
26612
  g(this, El);
@@ -26606,16 +26614,16 @@ const Lo = class {
26606
26614
  g(this, ir, void 0);
26607
26615
  g(this, ar, void 0);
26608
26616
  g(this, fs, void 0);
26609
- g(this, Br, void 0);
26610
26617
  g(this, qr, void 0);
26618
+ g(this, jr, void 0);
26611
26619
  g(this, Un, void 0);
26612
26620
  g(this, Zi, void 0);
26613
26621
  g(this, $n, void 0);
26614
26622
  g(this, nr, void 0);
26615
- g(this, jr, void 0);
26623
+ g(this, Gr, void 0);
26616
26624
  g(this, Fn, void 0);
26617
26625
  g(this, ea, void 0);
26618
- this.reportRequest = e, m(this, Br, new AudioContext()), m(this, qr, a(this, Br).createAnalyser()), a(this, qr).fftSize = 2048, m(this, $n, new Co()), m(this, ea, t);
26626
+ this.reportRequest = e, m(this, qr, new AudioContext()), m(this, jr, a(this, qr).createAnalyser()), a(this, jr).fftSize = 2048, m(this, $n, new Co()), m(this, ea, t);
26619
26627
  }
26620
26628
  get logger() {
26621
26629
  return a(this, ea).getValue("logger");
@@ -26626,7 +26634,7 @@ const Lo = class {
26626
26634
  set audioTrack(t) {
26627
26635
  m(this, Un, t);
26628
26636
  const e = new MediaStream();
26629
- e.addTrack(a(this, Un)), a(this, Br).createMediaStreamSource(e).connect(a(this, qr));
26637
+ e.addTrack(a(this, Un)), a(this, qr).createMediaStreamSource(e).connect(a(this, jr));
26630
26638
  }
26631
26639
  start() {
26632
26640
  this.logger.debug(`AudioActivityReporter: Starting audio activity reporter: ${a(this, fs)}`), a(this, ir) && clearInterval$1(a(this, ir)), m(this, ir, setInterval$1(() => l(this, null, function* () {
@@ -26650,21 +26658,21 @@ const Lo = class {
26650
26658
  }
26651
26659
  };
26652
26660
  let Ro = Lo;
26653
- ir = /* @__PURE__ */ new WeakMap(), ar = /* @__PURE__ */ new WeakMap(), fs = /* @__PURE__ */ new WeakMap(), Br = /* @__PURE__ */ new WeakMap(), qr = /* @__PURE__ */ new WeakMap(), Un = /* @__PURE__ */ new WeakMap(), Zi = /* @__PURE__ */ new WeakMap(), $n = /* @__PURE__ */ new WeakMap(), nr = /* @__PURE__ */ new WeakMap(), jr = /* @__PURE__ */ new WeakMap(), Fn = /* @__PURE__ */ new WeakMap(), ea = /* @__PURE__ */ new WeakMap(), El = /* @__PURE__ */ new WeakSet(), hS = function() {
26661
+ ir = /* @__PURE__ */ new WeakMap(), ar = /* @__PURE__ */ new WeakMap(), fs = /* @__PURE__ */ new WeakMap(), qr = /* @__PURE__ */ new WeakMap(), jr = /* @__PURE__ */ new WeakMap(), Un = /* @__PURE__ */ new WeakMap(), Zi = /* @__PURE__ */ new WeakMap(), $n = /* @__PURE__ */ new WeakMap(), nr = /* @__PURE__ */ new WeakMap(), Gr = /* @__PURE__ */ new WeakMap(), Fn = /* @__PURE__ */ new WeakMap(), ea = /* @__PURE__ */ new WeakMap(), El = /* @__PURE__ */ new WeakSet(), hS = function() {
26654
26662
  var o;
26655
- a(this, Br).state === "suspended" && a(this, Br).resume().then(() => {
26663
+ a(this, qr).state === "suspended" && a(this, qr).resume().then(() => {
26656
26664
  this.logger.debug("AudioActivityReporter: AudioContext forced resumed");
26657
26665
  }).catch((c) => {
26658
26666
  this.logger.error("AudioActivityReporter: Error resuming AudioContext", c);
26659
26667
  });
26660
- const t = new Float32Array(a(this, qr).frequencyBinCount);
26661
- a(this, qr).getFloatTimeDomainData(t);
26668
+ const t = new Float32Array(a(this, jr).frequencyBinCount);
26669
+ a(this, jr).getFloatTimeDomainData(t);
26662
26670
  const { energy: e, isVoice: r } = a(this, $n).processAudioChunk(t), i = V(o = Lo, Pl, gS).call(o, e);
26663
26671
  return a(this, ea).getValue("flagsmith").hasFeature(Z.ENABLE_AUDIO_ACTIVITY_DEBUG_LOGS) && this.logger.debug(
26664
26672
  `AudioActivityReporter: producer: ${a(this, fs)}, energy: ${a(this, Zi)},
26665
26673
  slogScale: ${i}, isVoice: ${r}, minEnergy: ${a(this, nr)},
26666
- maxEnergy: ${a(this, jr)}`
26667
- ), i === -1 / 0 || e < 1e-6 ? { energy: 0, isVoice: false } : ((!a(this, nr) || i < a(this, nr)) && m(this, nr, i), (!a(this, jr) || i > a(this, jr)) && m(this, jr, i), { energy: (i - a(this, nr)) / (a(this, jr) - a(this, nr)) * 10 || 0, isVoice: r });
26674
+ maxEnergy: ${a(this, Gr)}`
26675
+ ), i === -1 / 0 || e < 1e-6 ? { energy: 0, isVoice: false } : ((!a(this, nr) || i < a(this, nr)) && m(this, nr, i), (!a(this, Gr) || i > a(this, Gr)) && m(this, Gr, i), { energy: (i - a(this, nr)) / (a(this, Gr) - a(this, nr)) * 10 || 0, isVoice: r });
26668
26676
  }, kc = /* @__PURE__ */ new WeakSet(), ah = function(t) {
26669
26677
  return t < 5;
26670
26678
  }, _l = /* @__PURE__ */ new WeakSet(), pS = function(t = a(this, Zi)) {
@@ -26744,10 +26752,10 @@ var hD = Object.defineProperty, pD = Object.getOwnPropertyDescriptor, le = (s, t
26744
26752
  return r && i && hD(t, e, i), i;
26745
26753
  };
26746
26754
  const Nt = ["video/VP9", "video/VP8"];
26747
- var Ic, Ac, dt, G, Hn, Ss, yt, ta, sa, ra, Mc, ss, or, Dc, ia, aa, Tt, kt, Gr, ka, Cl, fS, Rl, SS, wl, vS, Oc, nh, bl, vu, yS, kl, TS, Il, ES, Al, _S, et, gt, na, wo, Ml, PS, Dl, CS, Ol, RS;
26755
+ var Ic, Ac, dt, G, Hn, Ss, yt, ta, sa, ra, Mc, ss, or, Dc, ia, aa, Tt, kt, Wr, ka, Cl, fS, Rl, SS, wl, vS, Oc, nh, bl, vu, yS, kl, TS, Il, ES, Al, _S, tt, gt, na, wo, Ml, PS, Dl, CS, Ol, RS;
26748
26756
  const mS = (vu = class {
26749
26757
  constructor(s, t, e) {
26750
- g(this, Gr);
26758
+ g(this, Wr);
26751
26759
  g(this, Cl);
26752
26760
  g(this, Rl);
26753
26761
  g(this, wl);
@@ -26755,7 +26763,7 @@ const mS = (vu = class {
26755
26763
  g(this, kl);
26756
26764
  g(this, Il);
26757
26765
  g(this, Al);
26758
- g(this, et);
26766
+ g(this, tt);
26759
26767
  g(this, na);
26760
26768
  g(this, Ml);
26761
26769
  g(this, Dl);
@@ -26797,7 +26805,7 @@ const mS = (vu = class {
26797
26805
  a(this, G).socketHandler.audioActivity.bind(a(this, G).socketHandler)
26798
26806
  )), this.e2ee = (n = (i = s.getValue("modules").e2ee) == null ? void 0 : i.enabled) != null ? n : false, this.handleSocketEvents(), this.handleCallstatsEvents(), m(this, Mc, bh(
26799
26807
  () => l(this, null, function* () {
26800
- if (!a(this, Gr, ka).mediaJoinAttempted)
26808
+ if (!a(this, Wr, ka).mediaJoinAttempted)
26801
26809
  return;
26802
26810
  const { roomJoined: o } = yield this.joinRoom(
26803
26811
  a(this, Ac),
@@ -26821,17 +26829,17 @@ const mS = (vu = class {
26821
26829
  return this.context.getValue("logger");
26822
26830
  }
26823
26831
  get mediaJoined() {
26824
- return a(this, Gr, ka).mediaJoined;
26832
+ return a(this, Wr, ka).mediaJoined;
26825
26833
  }
26826
26834
  set mediaJoined(s) {
26827
- a(this, Gr, ka).mediaJoined = s;
26835
+ a(this, Wr, ka).mediaJoined = s;
26828
26836
  }
26829
26837
  reset() {
26830
26838
  a(this, G).closeAllProducers(), a(this, G).closeAllConsumers(), a(this, Tt).clear(), a(this, or).clear(), m(this, ss, null), a(this, ra).stop(), a(this, G).stopAllTransports(), a(this, G).reset(), m(this, ra, new Qu());
26831
26839
  }
26832
26840
  joinRoom(n, o) {
26833
26841
  return l(this, arguments, function* (s, t, e = false, r = false, i = {}) {
26834
- a(this, Gr, ka).mediaJoinAttempted = true, m(this, ta, true), e && this.reset();
26842
+ a(this, Wr, ka).mediaJoinAttempted = true, m(this, ta, true), e && this.reset();
26835
26843
  try {
26836
26844
  return yield a(this, ra).push(
26837
26845
  () => V(this, Cl, fS).call(this, s, t, r, i),
@@ -26859,7 +26867,7 @@ const mS = (vu = class {
26859
26867
  leaveRoom() {
26860
26868
  return l(this, null, function* () {
26861
26869
  var t;
26862
- a(this, G).stopAllTransports(), m(this, sa, false), a(this, Gr, ka).mediaJoinAttempted = false;
26870
+ a(this, G).stopAllTransports(), m(this, sa, false), a(this, Wr, ka).mediaJoinAttempted = false;
26863
26871
  const s = {
26864
26872
  closeRoom: false
26865
26873
  };
@@ -26904,7 +26912,7 @@ const mS = (vu = class {
26904
26912
  }
26905
26913
  _shareWebcam(s, t) {
26906
26914
  return l(this, null, function* () {
26907
- const e = t === "video/VP9" ? pe.WEBCAM : pe.WEBCAM_BACKUP, r = V(this, et, gt).call(this, e);
26915
+ const e = t === "video/VP9" ? pe.WEBCAM : pe.WEBCAM_BACKUP, r = V(this, tt, gt).call(this, e);
26908
26916
  if (r) {
26909
26917
  const p = yield r;
26910
26918
  if (a(this, G).producers.has(p)) {
@@ -26997,7 +27005,7 @@ const mS = (vu = class {
26997
27005
  try {
26998
27006
  if (s === void 0)
26999
27007
  throw new At("track undefined");
27000
- const t = V(this, et, gt).call(this, pe.MIC);
27008
+ const t = V(this, tt, gt).call(this, pe.MIC);
27001
27009
  if (t) {
27002
27010
  const n = yield t;
27003
27011
  if (a(this, G).producers.has(n)) {
@@ -27028,7 +27036,7 @@ const mS = (vu = class {
27028
27036
  pauseMic() {
27029
27037
  return l(this, null, function* () {
27030
27038
  var r;
27031
- const s = yield V(this, et, gt).call(this, pe.MIC), t = a(this, G).producers.get(s);
27039
+ const s = yield V(this, tt, gt).call(this, pe.MIC), t = a(this, G).producers.get(s);
27032
27040
  if (!t) {
27033
27041
  this.logger.error("pauseMic::could_not_find_mic_producer");
27034
27042
  return;
@@ -27050,7 +27058,7 @@ const mS = (vu = class {
27050
27058
  }
27051
27059
  pauseWebcam() {
27052
27060
  return l(this, null, function* () {
27053
- const s = yield V(this, et, gt).call(this, pe.WEBCAM), t = yield V(this, et, gt).call(this, pe.WEBCAM_BACKUP), e = a(this, G).producers.get(s), r = a(this, G).producers.get(t);
27061
+ const s = yield V(this, tt, gt).call(this, pe.WEBCAM), t = yield V(this, tt, gt).call(this, pe.WEBCAM_BACKUP), e = a(this, G).producers.get(s), r = a(this, G).producers.get(t);
27054
27062
  if (!e && !r) {
27055
27063
  this.logger.error("pauseWebcam::could_not_find_webcam_producer");
27056
27064
  return;
@@ -27070,7 +27078,7 @@ const mS = (vu = class {
27070
27078
  }
27071
27079
  resumeMic() {
27072
27080
  return l(this, null, function* () {
27073
- const s = yield V(this, et, gt).call(this, pe.MIC), t = a(this, G).producers.get(s);
27081
+ const s = yield V(this, tt, gt).call(this, pe.MIC), t = a(this, G).producers.get(s);
27074
27082
  if (!t) {
27075
27083
  this.logger.error("resumeMic::could_not_find_mic_producer");
27076
27084
  return;
@@ -27092,7 +27100,7 @@ const mS = (vu = class {
27092
27100
  }
27093
27101
  resumeWebcam() {
27094
27102
  return l(this, arguments, function* (s = pe.WEBCAM) {
27095
- const t = yield V(this, et, gt).call(this, s), e = a(this, G).producers.get(t);
27103
+ const t = yield V(this, tt, gt).call(this, s), e = a(this, G).producers.get(t);
27096
27104
  if (!e) {
27097
27105
  this.logger.error("resumeWebcam::could_not_find_webcam_producer");
27098
27106
  return;
@@ -27114,21 +27122,21 @@ const mS = (vu = class {
27114
27122
  }
27115
27123
  disableWebcam(s) {
27116
27124
  return l(this, null, function* () {
27117
- const t = s === "video/VP9" ? pe.WEBCAM : pe.WEBCAM_BACKUP, e = yield V(this, et, gt).call(this, t);
27125
+ const t = s === "video/VP9" ? pe.WEBCAM : pe.WEBCAM_BACKUP, e = yield V(this, tt, gt).call(this, t);
27118
27126
  V(this, Ml, PS).call(this, t), e && (yield a(this, G).closeProducer(e));
27119
27127
  });
27120
27128
  }
27121
27129
  disableMic() {
27122
27130
  return l(this, null, function* () {
27123
27131
  var t;
27124
- const s = yield V(this, et, gt).call(this, pe.MIC);
27132
+ const s = yield V(this, tt, gt).call(this, pe.MIC);
27125
27133
  s && (yield a(this, G).closeProducer(s)), (t = a(this, kt)) == null || t.stop(), a(this, Tt).delete(pe.MIC);
27126
27134
  });
27127
27135
  }
27128
27136
  disableScreenShare() {
27129
27137
  return l(this, null, function* () {
27130
27138
  this.logger.info("screen_sharing_stopped"), this.context.getValue("callstats").screenShareStop();
27131
- const s = yield V(this, et, gt).call(this, pe.SCREENSHARE_VIDEO), t = yield V(this, et, gt).call(this, pe.SCREENSHARE_AUDIO);
27139
+ const s = yield V(this, tt, gt).call(this, pe.SCREENSHARE_VIDEO), t = yield V(this, tt, gt).call(this, pe.SCREENSHARE_AUDIO);
27132
27140
  s && (yield a(this, G).closeProducer(s)), t && (yield a(this, G).closeProducer(t)), a(this, or).clear(), a(this, Tt).delete(pe.SCREENSHARE_VIDEO), a(this, Tt).delete(pe.SCREENSHARE_AUDIO);
27133
27141
  });
27134
27142
  }
@@ -27144,11 +27152,11 @@ const mS = (vu = class {
27144
27152
  resetVideoProducers(s, t) {
27145
27153
  return l(this, null, function* () {
27146
27154
  if (s) {
27147
- const e = yield V(this, et, gt).call(this, pe.WEBCAM), r = yield V(this, et, gt).call(this, pe.WEBCAM_BACKUP);
27155
+ const e = yield V(this, tt, gt).call(this, pe.WEBCAM), r = yield V(this, tt, gt).call(this, pe.WEBCAM_BACKUP);
27148
27156
  yield a(this, G).closeProducer(e, { stopTrack: false }), yield a(this, G).closeProducer(r, { stopTrack: false }), this.shareWebcam(s);
27149
27157
  }
27150
27158
  if (t) {
27151
- const e = yield V(this, et, gt).call(this, pe.SCREENSHARE_VIDEO);
27159
+ const e = yield V(this, tt, gt).call(this, pe.SCREENSHARE_VIDEO);
27152
27160
  yield a(this, G).closeProducer(
27153
27161
  e,
27154
27162
  { stopTrack: false }
@@ -27409,7 +27417,7 @@ const mS = (vu = class {
27409
27417
  t.delete(s), !(t.size !== 0 || e === Nt[0]) && this.disableWebcam(e);
27410
27418
  }));
27411
27419
  }
27412
- }, Ic = /* @__PURE__ */ new WeakMap(), Ac = /* @__PURE__ */ new WeakMap(), dt = /* @__PURE__ */ new WeakMap(), G = /* @__PURE__ */ new WeakMap(), Hn = /* @__PURE__ */ new WeakMap(), Ss = /* @__PURE__ */ new WeakMap(), yt = /* @__PURE__ */ new WeakMap(), ta = /* @__PURE__ */ new WeakMap(), sa = /* @__PURE__ */ new WeakMap(), ra = /* @__PURE__ */ new WeakMap(), Mc = /* @__PURE__ */ new WeakMap(), ss = /* @__PURE__ */ new WeakMap(), or = /* @__PURE__ */ new WeakMap(), Dc = /* @__PURE__ */ new WeakMap(), ia = /* @__PURE__ */ new WeakMap(), aa = /* @__PURE__ */ new WeakMap(), Tt = /* @__PURE__ */ new WeakMap(), kt = /* @__PURE__ */ new WeakMap(), Gr = /* @__PURE__ */ new WeakSet(), ka = function() {
27420
+ }, Ic = /* @__PURE__ */ new WeakMap(), Ac = /* @__PURE__ */ new WeakMap(), dt = /* @__PURE__ */ new WeakMap(), G = /* @__PURE__ */ new WeakMap(), Hn = /* @__PURE__ */ new WeakMap(), Ss = /* @__PURE__ */ new WeakMap(), yt = /* @__PURE__ */ new WeakMap(), ta = /* @__PURE__ */ new WeakMap(), sa = /* @__PURE__ */ new WeakMap(), ra = /* @__PURE__ */ new WeakMap(), Mc = /* @__PURE__ */ new WeakMap(), ss = /* @__PURE__ */ new WeakMap(), or = /* @__PURE__ */ new WeakMap(), Dc = /* @__PURE__ */ new WeakMap(), ia = /* @__PURE__ */ new WeakMap(), aa = /* @__PURE__ */ new WeakMap(), Tt = /* @__PURE__ */ new WeakMap(), kt = /* @__PURE__ */ new WeakMap(), Wr = /* @__PURE__ */ new WeakSet(), ka = function() {
27413
27421
  return this.context.getValue("connectionHandler");
27414
27422
  }, Cl = /* @__PURE__ */ new WeakSet(), fS = function(s, t, e, r) {
27415
27423
  return l(this, null, function* () {
@@ -27522,7 +27530,7 @@ const mS = (vu = class {
27522
27530
  this.logger.warn("Failed to precreate producers", { error: e });
27523
27531
  }
27524
27532
  });
27525
- }, et = /* @__PURE__ */ new WeakSet(), gt = function(s) {
27533
+ }, tt = /* @__PURE__ */ new WeakSet(), gt = function(s) {
27526
27534
  return a(this, Tt).get(s);
27527
27535
  }, na = /* @__PURE__ */ new WeakSet(), wo = function(s, t) {
27528
27536
  return a(this, Tt).set(s, t);
@@ -27668,18 +27676,18 @@ var gD = Object.defineProperty, mD = Object.getOwnPropertyDescriptor, Pa = (s, t
27668
27676
  for (var i = r > 1 ? void 0 : r ? mD(t, e) : t, n = s.length - 1, o; n >= 0; n--)
27669
27677
  (o = s[n]) && (i = (r ? o(t, e, i) : o(i)) || i);
27670
27678
  return r && i && gD(t, e, i), i;
27671
- }, Wr, vs, te, Et, Vt, $g;
27679
+ }, Jr, vs, te, Et, Vt, $g;
27672
27680
  const kS = ($g = class {
27673
27681
  constructor(s, t, e, r) {
27674
27682
  g(this, Et);
27675
27683
  h(this, "self");
27676
27684
  h(this, "authToken");
27677
- g(this, Wr, void 0);
27685
+ g(this, Jr, void 0);
27678
27686
  h(this, "viewType");
27679
27687
  g(this, vs, void 0);
27680
27688
  g(this, te, void 0);
27681
27689
  const { socket: i } = e, n = s.getValue("authToken");
27682
- this.self = t, m(this, te, s), this.viewType = r, this.authToken = n, m(this, Wr, i), m(this, vs, e), t.config.viewType !== Mt.Chat && this.setupEvents();
27690
+ this.self = t, m(this, te, s), this.viewType = r, this.authToken = n, m(this, Jr, i), m(this, vs, e), t.config.viewType !== Mt.Chat && this.setupEvents();
27683
27691
  }
27684
27692
  get peerId() {
27685
27693
  return a(this, te).getValue("peerId");
@@ -27695,7 +27703,7 @@ const kS = ($g = class {
27695
27703
  }
27696
27704
  static init(s, t, e, r, i) {
27697
27705
  return l(this, null, function* () {
27698
- const n = lt(), o = s.getValue("peerId"), c = !!s.getValue("cachedUserDetails"), d = yield Qe.__init__(
27706
+ const n = lt(), o = s.getValue("peerId"), c = !!s.getValue("cachedUserDetails"), d = yield Xe.__init__(
27699
27707
  s,
27700
27708
  e,
27701
27709
  r,
@@ -27812,7 +27820,7 @@ const kS = ($g = class {
27812
27820
  if (this.self.roomState === "disconnected")
27813
27821
  return;
27814
27822
  let { peerId: t } = this;
27815
- s && a(this, te).getValue("flagsmith").hasFeature(Z.REFRESH_ID_ON_DISCONNECTION) && (t = v4()), a(this, Wr).updateURL(t), a(this, te).getValue("telemetry").resetPeerId(t), lt().setHeader("dyte-tracing-id", t), ur.remapContext(t, a(this, te)), this.self.roomState = "disconnected", this.self.emit("roomLeft", { state: "disconnected" });
27823
+ s && a(this, te).getValue("flagsmith").hasFeature(Z.REFRESH_ID_ON_DISCONNECTION) && (t = v4()), a(this, Jr).updateURL(t), a(this, te).getValue("telemetry").resetPeerId(t), lt().setHeader("dyte-tracing-id", t), ur.remapContext(t, a(this, te)), this.self.roomState = "disconnected", this.self.emit("roomLeft", { state: "disconnected" });
27816
27824
  }), a(this, te).getValue("peerSessionStore").on(b.SOCKET_SERVICE_FAILED, () => {
27817
27825
  this.self.roomState = "failed", this.self.emit("roomLeft", { state: "failed" });
27818
27826
  }), a(this, vs).on(x.waitingRoomRequestAccepted, () => {
@@ -27880,7 +27888,7 @@ const kS = ($g = class {
27880
27888
  var t, e;
27881
27889
  if (s === "rejected") {
27882
27890
  try {
27883
- (t = a(this, Wr)) == null || t.disconnect();
27891
+ (t = a(this, Jr)) == null || t.disconnect();
27884
27892
  } catch (r) {
27885
27893
  this.logger.error("SelfController::leaveRoom::socketDisconnect");
27886
27894
  }
@@ -27889,7 +27897,7 @@ const kS = ($g = class {
27889
27897
  }
27890
27898
  this.self.setIsPinned(false), a(this, te).setValue("stageStatus", "OFF_STAGE", false), yield this.leaveMediaRoom(s), a(this, te).notify("stageStatus");
27891
27899
  try {
27892
- (e = a(this, Wr)) == null || e.disconnect();
27900
+ (e = a(this, Jr)) == null || e.disconnect();
27893
27901
  } catch (r) {
27894
27902
  this.logger.error("SelfController::leaveRoom::socketDisconnect");
27895
27903
  }
@@ -27913,7 +27921,7 @@ const kS = ($g = class {
27913
27921
  return;
27914
27922
  }
27915
27923
  wS(a(this, te), o, {
27916
- socket: a(this, Wr),
27924
+ socket: a(this, Jr),
27917
27925
  peerId: t
27918
27926
  });
27919
27927
  }
@@ -27947,7 +27955,7 @@ const kS = ($g = class {
27947
27955
  yield this.self.disableAudio(), yield this.self.disableVideo(), yield this.self.disableScreenShare(), this.self.cleanUpTracks(), this.self.destructMediaHandler(), navigator.isReactNative || this.self.removeDocumentEventListeners();
27948
27956
  });
27949
27957
  }
27950
- }, Wr = /* @__PURE__ */ new WeakMap(), vs = /* @__PURE__ */ new WeakMap(), te = /* @__PURE__ */ new WeakMap(), Et = /* @__PURE__ */ new WeakSet(), Vt = function() {
27958
+ }, Jr = /* @__PURE__ */ new WeakMap(), vs = /* @__PURE__ */ new WeakMap(), te = /* @__PURE__ */ new WeakMap(), Et = /* @__PURE__ */ new WeakSet(), Vt = function() {
27951
27959
  return a(this, te).getValue("roomNodeClient");
27952
27960
  }, $g);
27953
27961
  let ai = kS;
@@ -29079,33 +29087,33 @@ class US {
29079
29087
  function VD(s, t) {
29080
29088
  return Math.floor(Math.random() * (t - s + 1) + s);
29081
29089
  }
29082
- var Cr;
29090
+ var Rr;
29083
29091
  class xD {
29084
29092
  constructor(t = {}) {
29085
- bD(this, "opts"), Se(this, Cr, void 0), this.opts = {
29093
+ bD(this, "opts"), Se(this, Rr, void 0), this.opts = {
29086
29094
  initialTimeout: t.initialTimeout || 1e3,
29087
29095
  maxTimeout: t.maxTimeout || 1e4,
29088
29096
  factor: t.factor || 2
29089
- }, ne(this, Cr, 0);
29097
+ }, ne(this, Rr, 0);
29090
29098
  }
29091
29099
  wait() {
29092
29100
  return l(this, null, function* () {
29093
- ne(this, Cr, M(this, Cr) + 1);
29094
- const t = VD(0, Math.min(this.opts.maxTimeout, this.opts.initialTimeout * Xh(2, M(this, Cr))));
29101
+ ne(this, Rr, M(this, Rr) + 1);
29102
+ const t = VD(0, Math.min(this.opts.maxTimeout, this.opts.initialTimeout * Xh(2, M(this, Rr))));
29095
29103
  yield new Promise((e) => {
29096
29104
  setTimeout(e, t);
29097
29105
  });
29098
29106
  });
29099
29107
  }
29100
29108
  getAttempts() {
29101
- return M(this, Cr);
29109
+ return M(this, Rr);
29102
29110
  }
29103
29111
  reset() {
29104
- ne(this, Cr, 0);
29112
+ ne(this, Rr, 0);
29105
29113
  }
29106
29114
  }
29107
- Cr = /* @__PURE__ */ new WeakMap();
29108
- const Er = {
29115
+ Rr = /* @__PURE__ */ new WeakMap();
29116
+ const _r = {
29109
29117
  debug: 0,
29110
29118
  info: 1,
29111
29119
  warn: 2,
@@ -29117,28 +29125,28 @@ class UD {
29117
29125
  Se(this, ui, void 0), Se(this, hi, void 0), ne(this, ui, console), ne(this, hi, t);
29118
29126
  }
29119
29127
  debug(...t) {
29120
- Er[M(this, hi)] > Er.debug || M(this, ui).debug("[Sockrates]:", ...t);
29128
+ _r[M(this, hi)] > _r.debug || M(this, ui).debug("[Sockrates]:", ...t);
29121
29129
  }
29122
29130
  info(...t) {
29123
- Er[M(this, hi)] > Er.info || M(this, ui).info("[Sockrates]:", ...t);
29131
+ _r[M(this, hi)] > _r.info || M(this, ui).info("[Sockrates]:", ...t);
29124
29132
  }
29125
29133
  warn(...t) {
29126
- Er[M(this, hi)] > Er.warn || M(this, ui).warn("[Sockrates]:", ...t);
29134
+ _r[M(this, hi)] > _r.warn || M(this, ui).warn("[Sockrates]:", ...t);
29127
29135
  }
29128
29136
  error(...t) {
29129
- Er[M(this, hi)] > Er.error || M(this, ui).error("[Sockrates]:", ...t);
29137
+ _r[M(this, hi)] > _r.error || M(this, ui).error("[Sockrates]:", ...t);
29130
29138
  }
29131
29139
  }
29132
29140
  ui = /* @__PURE__ */ new WeakMap(), hi = /* @__PURE__ */ new WeakMap();
29133
29141
  var $S = /* @__PURE__ */ ((s) => (s[s.CONNECTING = 0] = "CONNECTING", s[s.OPEN = 1] = "OPEN", s[s.CLOSING = 2] = "CLOSING", s[s.CLOSED = 3] = "CLOSED", s))($S || {});
29134
29142
  const $D = "2", FD = "3";
29135
- var Ae, Ia, Ee, Ue, Rr, ze, lr, Qr, Ts, Aa, Hs, oh, FS, bo, _d, ch, HS, dh, yg, Ud, lh, uh, BS, Mo, Pd, Do, $d, Fd, hh, $a, Oo, No, Hd;
29143
+ var Ae, Ia, Ee, Ue, wr, Ye, lr, Xr, Ts, Aa, Hs, oh, FS, bo, _d, ch, HS, dh, yg, Ud, lh, uh, BS, Mo, Pd, Do, $d, Fd, hh, $a, Oo, No, Hd;
29136
29144
  class HD {
29137
29145
  constructor(t, e) {
29138
29146
  var F;
29139
- Se(this, oh), Se(this, bo), Se(this, ch), Se(this, dh), Se(this, Ud), Se(this, uh), Se(this, Mo), Se(this, Do), Se(this, Fd), Se(this, $a), Se(this, No), Se(this, Ae, void 0), Se(this, Ia, void 0), Se(this, Ee, void 0), Se(this, Ue, void 0), Se(this, Rr, void 0), Se(this, ze, void 0), Se(this, lr, void 0), Se(this, Qr, void 0), Se(this, Ts, void 0), Se(this, Aa, void 0), Se(this, Hs, void 0);
29147
+ Se(this, oh), Se(this, bo), Se(this, ch), Se(this, dh), Se(this, Ud), Se(this, uh), Se(this, Mo), Se(this, Do), Se(this, Fd), Se(this, $a), Se(this, No), Se(this, Ae, void 0), Se(this, Ia, void 0), Se(this, Ee, void 0), Se(this, Ue, void 0), Se(this, wr, void 0), Se(this, Ye, void 0), Se(this, lr, void 0), Se(this, Xr, void 0), Se(this, Ts, void 0), Se(this, Aa, void 0), Se(this, Hs, void 0);
29140
29148
  var r, i, n, o, c, d, u, p, f;
29141
- ne(this, Ia, t), ne(this, Rr, []), ne(this, ze, new xd()), ne(this, lr, true), ne(this, Ts, false), ne(this, Ee, e != null ? e : {}), (r = M(this, Ee)).autoReconnect != null || (r.autoReconnect = true), (i = M(this, Ee)).retryConnectionInterval != null || (i.retryConnectionInterval = 1e3), (n = M(this, Ee)).pingTimeout != null || (n.pingTimeout = 3e4), (o = M(this, Ee)).connectionTimeout != null || (o.connectionTimeout = 5e3), (c = M(this, Ee)).debug != null || (c.debug = true), (d = M(this, Ee)).maxReconnectionAttempts != null || (d.maxReconnectionAttempts = 10), (u = M(this, Ee)).disconnectOnPingTimeout != null || (u.disconnectOnPingTimeout = true), (p = M(this, Ee)).queueOnDisconnect != null || (p.queueOnDisconnect = false), (f = M(this, Ee)).flushOnReconnect != null || (f.flushOnReconnect = false), ne(this, Qr, {
29149
+ ne(this, Ia, t), ne(this, wr, []), ne(this, Ye, new xd()), ne(this, lr, true), ne(this, Ts, false), ne(this, Ee, e != null ? e : {}), (r = M(this, Ee)).autoReconnect != null || (r.autoReconnect = true), (i = M(this, Ee)).retryConnectionInterval != null || (i.retryConnectionInterval = 1e3), (n = M(this, Ee)).pingTimeout != null || (n.pingTimeout = 3e4), (o = M(this, Ee)).connectionTimeout != null || (o.connectionTimeout = 5e3), (c = M(this, Ee)).debug != null || (c.debug = true), (d = M(this, Ee)).maxReconnectionAttempts != null || (d.maxReconnectionAttempts = 10), (u = M(this, Ee)).disconnectOnPingTimeout != null || (u.disconnectOnPingTimeout = true), (p = M(this, Ee)).queueOnDisconnect != null || (p.queueOnDisconnect = false), (f = M(this, Ee)).flushOnReconnect != null || (f.flushOnReconnect = false), ne(this, Xr, {
29142
29150
  code: void 0,
29143
29151
  reason: void 0
29144
29152
  }), ne(this, Ue, (F = M(this, Ee).logger) != null ? F : new UD(M(this, Ee).debug ? "debug" : "info")), ne(this, Hs, new xD());
@@ -29157,15 +29165,15 @@ class HD {
29157
29165
  return M(this, Ee);
29158
29166
  }
29159
29167
  get sendQueue() {
29160
- return M(this, Rr);
29168
+ return M(this, wr);
29161
29169
  }
29162
29170
  flush() {
29163
29171
  if (!M(this, Ee).queueOnDisconnect)
29164
29172
  return false;
29165
29173
  const t = [];
29166
- return M(this, Rr).forEach((e) => {
29174
+ return M(this, wr).forEach((e) => {
29167
29175
  this.send(e.event, e.id, e.payload, e.metadata) || t.push(e);
29168
- }), ne(this, Rr, t), M(this, Rr);
29176
+ }), ne(this, wr, t), M(this, wr);
29169
29177
  }
29170
29178
  connect(t = false) {
29171
29179
  return l(this, null, function* () {
@@ -29182,15 +29190,15 @@ class HD {
29182
29190
  try {
29183
29191
  ne(this, Ae, new WebSocket(_e(this, oh, FS).call(this, M(this, Ia)))), M(this, Ae).binaryType = "arraybuffer", M(this, Ue).debug("Connecting");
29184
29192
  const i = setTimeout(() => {
29185
- M(this, Ue).debug("Connection timeout. Closing socket"), ne(this, lr, true), _e(this, No, Hd).call(this), M(this, Ae).close(3001, "Connection Timeout"), M(this, Ee).autoReconnect && !M(this, Ts) && (M(this, ze).emit(
29193
+ M(this, Ue).debug("Connection timeout. Closing socket"), ne(this, lr, true), _e(this, No, Hd).call(this), M(this, Ae).close(3001, "Connection Timeout"), M(this, Ee).autoReconnect && !M(this, Ts) && (M(this, Ye).emit(
29186
29194
  "reconnecting"
29187
29195
  ), _e(this, Mo, Pd).call(this)), r(new Error("Connection timed out!"));
29188
29196
  }, M(this, Ee).connectionTimeout);
29189
29197
  M(this, Ae).onopen = () => {
29190
- M(this, Ue).debug(`Ready State: ${$S[M(this, Ae).readyState]}`), i && clearTimeout(i), _e(this, Fd, hh).call(this), ne(this, Qr, {
29198
+ M(this, Ue).debug(`Ready State: ${$S[M(this, Ae).readyState]}`), i && clearTimeout(i), _e(this, Fd, hh).call(this), ne(this, Xr, {
29191
29199
  code: void 0,
29192
29200
  reason: void 0
29193
- }), M(this, ze).emit(
29201
+ }), M(this, Ye).emit(
29194
29202
  "connected"
29195
29203
  ), M(this, Ee).flushOnReconnect && this.flush(), e();
29196
29204
  }, M(this, Ae).onclose = (n) => {
@@ -29213,7 +29221,7 @@ class HD {
29213
29221
  send(t, e, r, i) {
29214
29222
  const n = { event: t, id: e, payload: r, metadata: i };
29215
29223
  if (M(this, Ee).queueOnDisconnect && (!M(this, Ae) || M(this, Ae).readyState !== 1))
29216
- return M(this, Ue).debug("Queuing message since socket is not connected!", n), M(this, Rr).push(n), false;
29224
+ return M(this, Ue).debug("Queuing message since socket is not connected!", n), M(this, wr).push(n), false;
29217
29225
  const o = US.encode(n);
29218
29226
  return _e(this, Do, $d).call(this, o);
29219
29227
  }
@@ -29224,40 +29232,40 @@ class HD {
29224
29232
  return _e(this, Do, $d).call(this, t);
29225
29233
  }
29226
29234
  receive(t, e) {
29227
- return M(this, ze).on(t.toString(), e);
29235
+ return M(this, Ye).on(t.toString(), e);
29228
29236
  }
29229
29237
  on(t, e) {
29230
29238
  if (typeof t == "string" && (t === "connected" || t === "disconnected" || t === "errored" || t === "reconnected" || t === "reconnecting" || t === "reconnectAttempt" || t === "reconnectFailure" || t === "failed")) {
29231
- M(this, ze).on(t, e);
29239
+ M(this, Ye).on(t, e);
29232
29240
  return;
29233
29241
  }
29234
29242
  this.receive(t, e);
29235
29243
  }
29236
29244
  removeAllListeners() {
29237
- M(this, ze).removeAllListeners();
29245
+ M(this, Ye).removeAllListeners();
29238
29246
  }
29239
29247
  removeReceiver(t, e) {
29240
29248
  this.removeListener(t, e);
29241
29249
  }
29242
29250
  removeListener(t, e) {
29243
- M(this, ze).removeListener(t.toString(), e);
29251
+ M(this, Ye).removeListener(t.toString(), e);
29244
29252
  }
29245
29253
  removeReceivers(t) {
29246
29254
  this.removeListeners(t);
29247
29255
  }
29248
29256
  removeListeners(t) {
29249
- M(this, ze).listeners(t.toString()).map(
29257
+ M(this, Ye).listeners(t.toString()).map(
29250
29258
  (e) => this.removeListener(t, e)
29251
29259
  );
29252
29260
  }
29253
29261
  disconnect() {
29254
- ne(this, lr, false), _e(this, $a, Oo).call(this), this.removeAllListeners(), ne(this, Qr, {
29262
+ ne(this, lr, false), _e(this, $a, Oo).call(this), this.removeAllListeners(), ne(this, Xr, {
29255
29263
  code: 1e3,
29256
29264
  reason: "Sockrates disconnect method called"
29257
29265
  }), M(this, Ae).close(1e3, "Sockrates disconnect method called.");
29258
29266
  }
29259
29267
  }
29260
- Ae = /* @__PURE__ */ new WeakMap(), Ia = /* @__PURE__ */ new WeakMap(), Ee = /* @__PURE__ */ new WeakMap(), Ue = /* @__PURE__ */ new WeakMap(), Rr = /* @__PURE__ */ new WeakMap(), ze = /* @__PURE__ */ new WeakMap(), lr = /* @__PURE__ */ new WeakMap(), Qr = /* @__PURE__ */ new WeakMap(), Ts = /* @__PURE__ */ new WeakMap(), Aa = /* @__PURE__ */ new WeakMap(), Hs = /* @__PURE__ */ new WeakMap(), oh = /* @__PURE__ */ new WeakSet(), FS = function(s) {
29268
+ Ae = /* @__PURE__ */ new WeakMap(), Ia = /* @__PURE__ */ new WeakMap(), Ee = /* @__PURE__ */ new WeakMap(), Ue = /* @__PURE__ */ new WeakMap(), wr = /* @__PURE__ */ new WeakMap(), Ye = /* @__PURE__ */ new WeakMap(), lr = /* @__PURE__ */ new WeakMap(), Xr = /* @__PURE__ */ new WeakMap(), Ts = /* @__PURE__ */ new WeakMap(), Aa = /* @__PURE__ */ new WeakMap(), Hs = /* @__PURE__ */ new WeakMap(), oh = /* @__PURE__ */ new WeakSet(), FS = function(s) {
29261
29269
  if (s.startsWith("ws://") || s.startsWith("wss://"))
29262
29270
  return s;
29263
29271
  if (s.startsWith("https://"))
@@ -29266,21 +29274,21 @@ Ae = /* @__PURE__ */ new WeakMap(), Ia = /* @__PURE__ */ new WeakMap(), Ee = /*
29266
29274
  return `ws://${s.substring(7)}`;
29267
29275
  throw new Error("Invalid URL. URL must start with http(s):// or ws(s)://.");
29268
29276
  }, bo = /* @__PURE__ */ new WeakSet(), _d = function(s, t) {
29269
- M(this, Ue).error("Error:", { error: s }), M(this, ze).emit("errored", { error: s }), t == null || t(s);
29277
+ M(this, Ue).error("Error:", { error: s }), M(this, Ye).emit("errored", { error: s }), t == null || t(s);
29270
29278
  }, ch = /* @__PURE__ */ new WeakSet(), HS = function(s) {
29271
29279
  if (_e(this, Fd, hh).call(this), s.data === $D) {
29272
29280
  M(this, Ue).debug("Received ping from server"), _e(this, Do, $d).call(this, FD);
29273
29281
  return;
29274
29282
  }
29275
29283
  const t = US.decode(s.data), { id: e, payload: r } = t;
29276
- M(this, Ue).debug("Received message", { event: t.event, messageID: e }), M(this, ze).emit(t.event.toString(), { id: e, payload: r });
29284
+ M(this, Ue).debug("Received message", { event: t.event, messageID: e }), M(this, Ye).emit(t.event.toString(), { id: e, payload: r });
29277
29285
  }, dh = /* @__PURE__ */ new WeakSet(), yg = function() {
29278
29286
  return M(this, Ae).readyState === 1;
29279
29287
  }, Ud = /* @__PURE__ */ new WeakSet(), lh = function(s, t) {
29280
- ne(this, Qr, { reason: t, code: s }), M(this, ze).emit("disconnected", { code: s, reason: t });
29288
+ ne(this, Xr, { reason: t, code: s }), M(this, Ye).emit("disconnected", { code: s, reason: t });
29281
29289
  }, uh = /* @__PURE__ */ new WeakSet(), BS = function() {
29282
- const { reason: s, code: t } = M(this, Qr);
29283
- t && t !== 1e3 && M(this, lr) && M(this, Ee).autoReconnect && !M(this, Ts) && (M(this, Ue).debug(`Triggering reconnection due to ${s}.`), M(this, ze).emit(
29290
+ const { reason: s, code: t } = M(this, Xr);
29291
+ t && t !== 1e3 && M(this, lr) && M(this, Ee).autoReconnect && !M(this, Ts) && (M(this, Ue).debug(`Triggering reconnection due to ${s}.`), M(this, Ye).emit(
29284
29292
  "reconnecting"
29285
29293
  ), _e(this, Mo, Pd).call(this));
29286
29294
  }, Mo = /* @__PURE__ */ new WeakSet(), Pd = function(s = true) {
@@ -29290,7 +29298,7 @@ Ae = /* @__PURE__ */ new WeakMap(), Ia = /* @__PURE__ */ new WeakMap(), Ee = /*
29290
29298
  return;
29291
29299
  }
29292
29300
  if (M(this, Ts) || M(this, Hs).reset(), M(this, Ee).maxReconnectionAttempts !== null && M(this, Hs).getAttempts() >= M(this, Ee).maxReconnectionAttempts) {
29293
- M(this, ze).emit(
29301
+ M(this, Ye).emit(
29294
29302
  "failed"
29295
29303
  ), ne(this, Ts, false);
29296
29304
  return;
@@ -29299,16 +29307,16 @@ Ae = /* @__PURE__ */ new WeakMap(), Ia = /* @__PURE__ */ new WeakMap(), Ee = /*
29299
29307
  try {
29300
29308
  if (yield M(this, Hs).wait(), M(this, lr) === false)
29301
29309
  return;
29302
- if (M(this, Ue).debug(`Reconnection attempt ${M(this, Hs).getAttempts()}`), M(this, ze).emit("reconnectAttempt", { attempt: M(this, Hs).getAttempts() }), yield this.connect(), !_e(this, dh, yg).call(this))
29310
+ if (M(this, Ue).debug(`Reconnection attempt ${M(this, Hs).getAttempts()}`), M(this, Ye).emit("reconnectAttempt", { attempt: M(this, Hs).getAttempts() }), yield this.connect(), !_e(this, dh, yg).call(this))
29303
29311
  throw Error("Reconnect Failed");
29304
- ne(this, Ts, false), ne(this, Qr, {
29312
+ ne(this, Ts, false), ne(this, Xr, {
29305
29313
  code: void 0,
29306
29314
  reason: void 0
29307
- }), M(this, ze).emit(
29315
+ }), M(this, Ye).emit(
29308
29316
  "reconnected"
29309
29317
  );
29310
29318
  } catch (t) {
29311
- M(this, Ue).debug("Failed to reconnect."), M(this, ze).emit("reconnectFailure", { attempt: M(this, Hs).getAttempts() }), _e(this, Mo, Pd).call(this, false);
29319
+ M(this, Ue).debug("Failed to reconnect."), M(this, Ye).emit("reconnectFailure", { attempt: M(this, Hs).getAttempts() }), _e(this, Mo, Pd).call(this, false);
29312
29320
  }
29313
29321
  });
29314
29322
  }, Do = /* @__PURE__ */ new WeakSet(), $d = function(s) {
@@ -29335,7 +29343,7 @@ var BD = Object.defineProperty, qD = Object.getOwnPropertyDescriptor, Ql = (s, t
29335
29343
  return r && i && BD(t, e, i), i;
29336
29344
  };
29337
29345
  const Tg = 65535, jD = 3e3;
29338
- var Jr, Ce, Re, De, rs, tt, Uc, ph, $c, gh, Fg;
29346
+ var Kr, Ce, Re, De, rs, st, Uc, ph, $c, gh, Fg;
29339
29347
  const qS = (Fg = class {
29340
29348
  constructor(s, {
29341
29349
  peerId: t,
@@ -29346,17 +29354,17 @@ const qS = (Fg = class {
29346
29354
  g(this, Re);
29347
29355
  g(this, Uc);
29348
29356
  g(this, $c);
29349
- g(this, Jr, void 0);
29357
+ g(this, Kr, void 0);
29350
29358
  g(this, Ce, void 0);
29351
29359
  h(this, "roomName");
29352
29360
  h(this, "authToken");
29353
29361
  h(this, "capabilities");
29354
29362
  g(this, rs, void 0);
29355
- g(this, tt, void 0);
29363
+ g(this, st, void 0);
29356
29364
  var n;
29357
29365
  if (!t || !e || !r)
29358
29366
  throw new R("peerId, meetingId, or authToken can not be empty", "0404");
29359
- m(this, rs, void 0), m(this, tt, s), this.capabilities = i, this.roomName = e, this.authToken = r, m(this, Jr, V(this, Uc, ph).call(this, t)), m(this, Ce, new HD(a(this, Jr), {
29367
+ m(this, rs, void 0), m(this, st, s), this.capabilities = i, this.roomName = e, this.authToken = r, m(this, Kr, V(this, Uc, ph).call(this, t)), m(this, Ce, new HD(a(this, Kr), {
29360
29368
  autoReconnect: true,
29361
29369
  disconnectOnPingTimeout: (n = i.includes("PING")) != null ? n : false,
29362
29370
  queueOnDisconnect: true,
@@ -29371,22 +29379,22 @@ const qS = (Fg = class {
29371
29379
  a(this, Re, De).socketJoinAttempted = s;
29372
29380
  }
29373
29381
  get telemetry() {
29374
- return a(this, tt).getValue("telemetry");
29382
+ return a(this, st).getValue("telemetry");
29375
29383
  }
29376
29384
  get logger() {
29377
- return a(this, tt).getValue("logger");
29385
+ return a(this, st).getValue("logger");
29378
29386
  }
29379
29387
  get peerId() {
29380
- return a(this, tt).getValue("peerId");
29388
+ return a(this, st).getValue("peerId");
29381
29389
  }
29382
29390
  updateURL(s) {
29383
- s !== this.peerId && (m(this, Jr, V(this, Uc, ph).call(this, s)), this.logger.debug("SocketService:: Connection URL updated.")), a(this, Ce).updateURL(a(this, Jr));
29391
+ s !== this.peerId && (m(this, Kr, V(this, Uc, ph).call(this, s)), this.logger.debug("SocketService:: Connection URL updated.")), a(this, Ce).updateURL(a(this, Kr));
29384
29392
  }
29385
29393
  static getSocketEdgeDomain(s) {
29386
29394
  return la({ servicePrefix: "socket-edge", baseURI: s });
29387
29395
  }
29388
29396
  get url() {
29389
- return a(this, Jr);
29397
+ return a(this, Kr);
29390
29398
  }
29391
29399
  connect() {
29392
29400
  return l(this, null, function* () {
@@ -29415,7 +29423,7 @@ const qS = (Fg = class {
29415
29423
  }
29416
29424
  sendMessage(s, t, e) {
29417
29425
  const r = {};
29418
- return a(this, tt).getValue("telemetry").injectContext(r), a(this, Ce).send(
29426
+ return a(this, st).getValue("telemetry").injectContext(r), a(this, Ce).send(
29419
29427
  s,
29420
29428
  e != null ? e : V(this, $c, gh).call(this),
29421
29429
  t,
@@ -29451,7 +29459,7 @@ const qS = (Fg = class {
29451
29459
  P
29452
29460
  );
29453
29461
  }, u = r != null ? r : V(this, $c, gh).call(this), p = {};
29454
- a(this, tt).getValue("telemetry").injectContext(p);
29462
+ a(this, st).getValue("telemetry").injectContext(p);
29455
29463
  const S = ({
29456
29464
  id: _,
29457
29465
  payload: P
@@ -29511,13 +29519,13 @@ const qS = (Fg = class {
29511
29519
  var i;
29512
29520
  this.logger.info("SocketService::Disconnected from socket-edge", { error: { code: s, reason: t }, country: T.location.country });
29513
29521
  const { recv: e, send: r } = (i = a(this, Re, De).mediaState) != null ? i : {};
29514
- e != null && e.state && (e == null ? void 0 : e.state) !== xa.CONNECTED || r != null && r.state && (r == null ? void 0 : r.state) !== xa.CONNECTED ? a(this, tt).getValue("peerSessionStore").emit(
29522
+ e != null && e.state && (e == null ? void 0 : e.state) !== xa.CONNECTED || r != null && r.state && (r == null ? void 0 : r.state) !== xa.CONNECTED ? a(this, st).getValue("peerSessionStore").emit(
29515
29523
  b.SOCKET_SERVICE_DISCONNECTED,
29516
29524
  {
29517
29525
  joinAttempted: a(this, Re, De).joinAttempted
29518
29526
  }
29519
29527
  ) : m(this, rs, setTimeout(() => {
29520
- a(this, tt).getValue("peerSessionStore").emit(
29528
+ a(this, st).getValue("peerSessionStore").emit(
29521
29529
  b.SOCKET_SERVICE_DISCONNECTED,
29522
29530
  { joinAttempted: a(this, Re, De).joinAttempted }
29523
29531
  ), m(this, rs, void 0);
@@ -29537,18 +29545,18 @@ const qS = (Fg = class {
29537
29545
  }
29538
29546
  }), a(this, Re, De).updateSocketConnectionState("reconnectFailure", s);
29539
29547
  }), this.onStateEvent("reconnected", () => l(this, null, function* () {
29540
- this.logger.info("SocketService::Reconnected to socket-edge", { connectionState: { joinAttempted: a(this, Re, De).mediaJoinAttempted } }), a(this, rs) && (clearTimeout(a(this, rs)), m(this, rs, void 0)), a(this, tt).getValue("peerSessionStore").emit(b.SOCKET_SERVICE_RECONNECTED, {
29548
+ this.logger.info("SocketService::Reconnected to socket-edge", { connectionState: { joinAttempted: a(this, Re, De).mediaJoinAttempted } }), a(this, rs) && (clearTimeout(a(this, rs)), m(this, rs, void 0)), a(this, st).getValue("peerSessionStore").emit(b.SOCKET_SERVICE_RECONNECTED, {
29541
29549
  wasJoinAttempted: a(this, Re, De).mediaJoinAttempted
29542
29550
  }), a(this, Re, De).updateSocketConnectionState("reconnected");
29543
29551
  })), this.onStateEvent("failed", () => l(this, null, function* () {
29544
- this.logger.info("SocketService::Failed to connect to socket-edge", { country: T.location.country }), a(this, tt).getValue("peerSessionStore").emit(b.SOCKET_SERVICE_FAILED), a(this, Re, De).updateSocketConnectionState("failed");
29552
+ this.logger.info("SocketService::Failed to connect to socket-edge", { country: T.location.country }), a(this, st).getValue("peerSessionStore").emit(b.SOCKET_SERVICE_FAILED), a(this, Re, De).updateSocketConnectionState("failed");
29545
29553
  }));
29546
29554
  }
29547
- }, Jr = /* @__PURE__ */ new WeakMap(), Ce = /* @__PURE__ */ new WeakMap(), Re = /* @__PURE__ */ new WeakSet(), De = function() {
29548
- return a(this, tt).getValue("connectionHandler");
29549
- }, rs = /* @__PURE__ */ new WeakMap(), tt = /* @__PURE__ */ new WeakMap(), Uc = /* @__PURE__ */ new WeakSet(), ph = function(s) {
29550
- let t = qS.getSocketEdgeDomain(a(this, tt).getValue("baseURI"));
29551
- typeof Wn(a(this, tt), "socket_server_base") == "string" && (t = Wn(a(this, tt), "socket_server_base"));
29555
+ }, Kr = /* @__PURE__ */ new WeakMap(), Ce = /* @__PURE__ */ new WeakMap(), Re = /* @__PURE__ */ new WeakSet(), De = function() {
29556
+ return a(this, st).getValue("connectionHandler");
29557
+ }, rs = /* @__PURE__ */ new WeakMap(), st = /* @__PURE__ */ new WeakMap(), Uc = /* @__PURE__ */ new WeakSet(), ph = function(s) {
29558
+ let t = qS.getSocketEdgeDomain(a(this, st).getValue("baseURI"));
29559
+ typeof Wn(a(this, st), "socket_server_base") == "string" && (t = Wn(a(this, st), "socket_server_base"));
29552
29560
  const e = `wss://${t}`, r = new URL(`${e}/ws`), i = this.peerId, n = B(D({
29553
29561
  roomID: this.roomName,
29554
29562
  peerID: s,
@@ -30072,13 +30080,13 @@ const Ma = class {
30072
30080
  }
30073
30081
  static setupControllers(s, t, e, r, i, n, o) {
30074
30082
  return l(this, null, function* () {
30075
- var $e, yr, Tr;
30083
+ var $e, Tr, Er;
30076
30084
  const c = t.getValue("modules"), { participant: d } = e, u = t.getValue("defaults"), p = t.getValue("logger"), { sfu: f } = t.getValue("roomNodeOptions"), { viewType: S, mediaConstraints: { audio: E } } = n;
30077
30085
  t.setValue("viewType", S), t.setValue("defaults", D({
30078
30086
  mediaConfiguration: {
30079
30087
  audio: {
30080
30088
  enableHighBitrate: ($e = E.enableHighBitrate) != null ? $e : false,
30081
- enableStereo: (yr = E.enableStereo) != null ? yr : false
30089
+ enableStereo: (Tr = E.enableStereo) != null ? Tr : false
30082
30090
  }
30083
30091
  }
30084
30092
  }, u)), t.setValue("maxPreferredStreams", Te.isMobile() ? n.maxVideoStreams.mobile : n.maxVideoStreams.desktop);
@@ -30087,7 +30095,7 @@ const Ma = class {
30087
30095
  s
30088
30096
  );
30089
30097
  t.setValue("connectedMeetingsSocketHandler", Je);
30090
- const Is = new zl(t, s), vr = new as(t, s), ni = new PD(s), I = new IS(t, s), y = new CD(t, s), C = new fD(s), U = new ga(t, s), ie = yield ai.init(
30098
+ const Is = new zl(t, s), yr = new as(t, s), ni = new PD(s), I = new IS(t, s), y = new CD(t, s), C = new fD(s), U = new ga(t, s), ie = yield ai.init(
30091
30099
  t,
30092
30100
  I,
30093
30101
  d,
@@ -30102,14 +30110,14 @@ const Ma = class {
30102
30110
  re,
30103
30111
  i
30104
30112
  );
30105
- if (c.participant && (F = new Sr(
30113
+ if (c.participant && (F = new vr(
30106
30114
  t,
30107
30115
  ie.self,
30108
30116
  I,
30109
30117
  f
30110
- )), (Tr = c.e2ee) != null && Tr.enabled && c.e2ee.manager.init(p, t.getValue("peerSessionStore")), c.chat && (P = yield _s.init(
30118
+ )), (Er = c.e2ee) != null && Er.enabled && c.e2ee.manager.init(p, t.getValue("peerSessionStore")), c.chat && (P = yield _s.init(
30111
30119
  t,
30112
- vr,
30120
+ yr,
30113
30121
  U,
30114
30122
  ie.self,
30115
30123
  F.participants
@@ -30143,7 +30151,7 @@ const Ma = class {
30143
30151
  t,
30144
30152
  $s,
30145
30153
  y,
30146
- vr,
30154
+ yr,
30147
30155
  P == null ? void 0 : P.chat,
30148
30156
  ie.self,
30149
30157
  F.participants,
@@ -30270,15 +30278,15 @@ function eO(s, t) {
30270
30278
  throw new R("Invalid auth token", "0004");
30271
30279
  }
30272
30280
  }
30273
- var Kr, oa, ca, Fc, Nl, WS;
30281
+ var zr, oa, ca, Fc, Nl, WS;
30274
30282
  class tO {
30275
30283
  constructor() {
30276
30284
  g(this, Nl);
30277
- g(this, Kr, new Audio());
30285
+ g(this, zr, new Audio());
30278
30286
  g(this, oa, new MediaStream());
30279
30287
  g(this, ca, /* @__PURE__ */ new Map());
30280
30288
  g(this, Fc, void 0);
30281
- a(this, Kr).srcObject = a(this, oa), a(this, Kr).autoplay = true;
30289
+ a(this, zr).srcObject = a(this, oa), a(this, zr).autoplay = true;
30282
30290
  }
30283
30291
  playTracks(t) {
30284
30292
  return l(this, null, function* () {
@@ -30288,7 +30296,7 @@ class tO {
30288
30296
  });
30289
30297
  }
30290
30298
  setSpeakerDevice(t) {
30291
- typeof HTMLAudioElement.prototype.setSinkId == "function" && a(this, Kr).setSinkId(t);
30299
+ typeof HTMLAudioElement.prototype.setSinkId == "function" && a(this, zr).setSinkId(t);
30292
30300
  }
30293
30301
  removeTrack(t) {
30294
30302
  const e = a(this, ca).get(t);
@@ -30296,7 +30304,7 @@ class tO {
30296
30304
  }
30297
30305
  play() {
30298
30306
  return l(this, null, function* () {
30299
- return a(this, Kr).srcObject = a(this, oa), a(this, Kr).play().catch((t) => {
30307
+ return a(this, zr).srcObject = a(this, oa), a(this, zr).play().catch((t) => {
30300
30308
  V(this, Nl, WS).call(this, t);
30301
30309
  });
30302
30310
  });
@@ -30305,7 +30313,7 @@ class tO {
30305
30313
  m(this, Fc, t);
30306
30314
  }
30307
30315
  }
30308
- Kr = /* @__PURE__ */ new WeakMap(), oa = /* @__PURE__ */ new WeakMap(), ca = /* @__PURE__ */ new WeakMap(), Fc = /* @__PURE__ */ new WeakMap(), Nl = /* @__PURE__ */ new WeakSet(), WS = function(t) {
30316
+ zr = /* @__PURE__ */ new WeakMap(), oa = /* @__PURE__ */ new WeakMap(), ca = /* @__PURE__ */ new WeakMap(), Fc = /* @__PURE__ */ new WeakMap(), Nl = /* @__PURE__ */ new WeakSet(), WS = function(t) {
30309
30317
  var e;
30310
30318
  (e = a(this, Fc)) == null || e.call(this, t);
30311
30319
  };
@@ -30329,15 +30337,15 @@ var rO = Object.defineProperty, iO = Object.getOwnPropertyDescriptor, eu = (s, t
30329
30337
  for (var i = r > 1 ? void 0 : r ? iO(t, e) : t, n = s.length - 1, o; n >= 0; n--)
30330
30338
  (o = s[n]) && (i = (r ? o(t, e, i) : o(i)) || i);
30331
30339
  return r && i && rO(t, e, i), i;
30332
- }, We, zr, Bg;
30333
- let si = (Bg = class {
30340
+ }, We, Yr, Bg;
30341
+ let ri = (Bg = class {
30334
30342
  constructor(t, e) {
30335
30343
  g(this, We, void 0);
30336
- g(this, zr, void 0);
30337
- m(this, zr, t), m(this, We, e);
30344
+ g(this, Yr, void 0);
30345
+ m(this, Yr, t), m(this, We, e);
30338
30346
  }
30339
30347
  get peerId() {
30340
- return a(this, zr).getValue("peerId");
30348
+ return a(this, Yr).getValue("peerId");
30341
30349
  }
30342
30350
  static initMedia(t = {}, e = false, r = void 0) {
30343
30351
  var d;
@@ -30354,7 +30362,7 @@ let si = (Bg = class {
30354
30362
  Te.init();
30355
30363
  const { mediaHandler: e } = (E = t.defaults) != null ? E : {}, r = (e == null ? void 0 : e.peerId) || ((P = (_ = t == null ? void 0 : t.cachedUserDetails) == null ? void 0 : _.peerId) != null ? P : v4()), { authToken: i, baseURI: n } = t, k = eO(i, n), { meetingId: o } = k, c = po(k, ["meetingId"]);
30356
30364
  window.__zone_symbol__DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION = true;
30357
- const d = si.setupContext(
30365
+ const d = ri.setupContext(
30358
30366
  r,
30359
30367
  t,
30360
30368
  o,
@@ -30371,7 +30379,7 @@ let si = (Bg = class {
30371
30379
  ${($ = t.authToken) == null ? void 0 : $.slice(-10)}`
30372
30380
  })
30373
30381
  });
30374
- const f = yield Qc.init(d), S = new si(d, f);
30382
+ const f = yield Qc.init(d), S = new ri(d, f);
30375
30383
  return d.setValue("meeting", S), S;
30376
30384
  });
30377
30385
  }
@@ -30382,7 +30390,7 @@ let si = (Bg = class {
30382
30390
  video: true
30383
30391
  };
30384
30392
  return n.setValue("options", e), n.setValue("peerId", t), n.setValue("modules", o), n.setValue("sdkName", "web-core"), n.setValue("meetingId", r), n.setValue("apiBase", i.apiBase), n.setValue("baseURI", i.baseURI), n.setValue("userId", i.participantId), n.setValue("organizationId", i.orgId), n.setValue("authToken", e.authToken), n.setValue("overrides", (d = e.overrides) != null ? d : {}), n.setValue("env", yC({ baseURI: i.baseURI })), n.setValue("defaults", c), n.setValue("onError", e.onError || (() => {
30385
- })), n.setValue("cachedUserDetails", Ps(e.cachedUserDetails)), n.setValue("sdkVersion", "3.1.4-staging.2"), (u = e.modules) != null && u.experimentalAudioPlayback && n.setValue("audioPlayback", new sO()), n;
30393
+ })), n.setValue("cachedUserDetails", Ps(e.cachedUserDetails)), n.setValue("sdkVersion", "3.1.4"), (u = e.modules) != null && u.experimentalAudioPlayback && n.setValue("audioPlayback", new sO()), n;
30386
30394
  }
30387
30395
  join() {
30388
30396
  return l(this, null, function* () {
@@ -30393,7 +30401,7 @@ let si = (Bg = class {
30393
30401
  leave(t) {
30394
30402
  return l(this, null, function* () {
30395
30403
  var r;
30396
- Eg.cleanup(), a(this, zr).getValue("peerSessionStore").reset(), (r = a(this, zr).getValue("roomSocketHandler")) == null || r.cleanup();
30404
+ Eg.cleanup(), a(this, Yr).getValue("peerSessionStore").reset(), (r = a(this, Yr).getValue("roomSocketHandler")) == null || r.cleanup();
30397
30405
  const { selfController: e } = a(this, We);
30398
30406
  return e.leaveRoom(t);
30399
30407
  });
@@ -30446,7 +30454,7 @@ let si = (Bg = class {
30446
30454
  return a(this, We).storesManager;
30447
30455
  }
30448
30456
  get audio() {
30449
- return a(this, zr).getValue("audioPlayback");
30457
+ return a(this, Yr).getValue("audioPlayback");
30450
30458
  }
30451
30459
  get __internals__() {
30452
30460
  var t;
@@ -30462,30 +30470,30 @@ let si = (Bg = class {
30462
30470
  return this.leave(t);
30463
30471
  });
30464
30472
  }
30465
- }, We = /* @__PURE__ */ new WeakMap(), zr = /* @__PURE__ */ new WeakMap(), Bg);
30473
+ }, We = /* @__PURE__ */ new WeakMap(), Yr = /* @__PURE__ */ new WeakMap(), Bg);
30466
30474
  eu([
30467
30475
  ht("0002"),
30468
- ii.executeWithLock({
30476
+ Sr.executeWithLock({
30469
30477
  methodName: "meeting.join",
30470
30478
  lockName: "DyteClient.join",
30471
30479
  timeout: 3e3
30472
30480
  })
30473
- ], si.prototype, "join", 1);
30481
+ ], ri.prototype, "join", 1);
30474
30482
  eu([
30475
30483
  ht("0003")
30476
- ], si.prototype, "leave", 1);
30484
+ ], ri.prototype, "leave", 1);
30477
30485
  eu([
30478
30486
  ht("0001"),
30479
- ii.executeWithLock({
30487
+ Sr.executeWithLock({
30480
30488
  methodName: "DyteClient.init",
30481
30489
  lockName: "DyteClient.init",
30482
30490
  timeout: 3e3
30483
30491
  })
30484
- ], si, "init", 1);
30485
- si = eu([
30492
+ ], ri, "init", 1);
30493
+ ri = eu([
30486
30494
  ht("0000")
30487
- ], si);
30488
- const aO = si;
30495
+ ], ri);
30496
+ const aO = ri;
30489
30497
  class RTKUpdates {
30490
30498
  constructor(meeting) {
30491
30499
  __publicField(this, "meeting");