@cloudflare/realtimekit 1.1.3-staging.1 → 1.1.3-staging.3

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
@@ -4509,20 +4509,20 @@ var a = (s, t, e) => (ru(s, t, "read from private field"), e ? e.call(s) : t.get
4509
4509
  }, m = (s, t, e, r) => (ru(s, t, "write to private field"), r ? r.call(s, e) : t.set(s, e), e);
4510
4510
  var V = (s, t, e) => (ru(s, t, "access private method"), e), Zh = (s, t, e) => QS(YS(s), e, t);
4511
4511
  var l = (s, t, e) => new Promise((r, i) => {
4512
- var n = (c) => {
4512
+ var n = (d) => {
4513
4513
  try {
4514
- d(e.next(c));
4514
+ c(e.next(d));
4515
4515
  } catch (u) {
4516
4516
  i(u);
4517
4517
  }
4518
- }, o = (c) => {
4518
+ }, o = (d) => {
4519
4519
  try {
4520
- d(e.throw(c));
4520
+ c(e.throw(d));
4521
4521
  } catch (u) {
4522
4522
  i(u);
4523
4523
  }
4524
- }, d = (c) => c.done ? r(c.value) : Promise.resolve(c.value).then(n, o);
4525
- d((e = e.apply(s, t)).next());
4524
+ }, c = (d) => d.done ? r(d.value) : Promise.resolve(d.value).then(n, o);
4525
+ c((e = e.apply(s, t)).next());
4526
4526
  });
4527
4527
  function ZS(s) {
4528
4528
  const { length: t } = this, e = s >= 0 ? s : t + s;
@@ -4547,7 +4547,7 @@ const tv = (s) => {
4547
4547
  }), window.addEventListener(
4548
4548
  "unhandledrejection",
4549
4549
  (t) => {
4550
- var e, r, i, n, o, d, c, u;
4550
+ var e, r, i, n, o, c, d, u;
4551
4551
  s.error(
4552
4552
  "window::unhandledrejection",
4553
4553
  {
@@ -4555,8 +4555,8 @@ const tv = (s) => {
4555
4555
  networkCall: {
4556
4556
  url: (r = (e = t == null ? void 0 : t.reason) == null ? void 0 : e.config) == null ? void 0 : r.url,
4557
4557
  baseURL: (n = (i = t == null ? void 0 : t.reason) == null ? void 0 : i.config) == null ? void 0 : n.baseURL,
4558
- method: (d = (o = t == null ? void 0 : t.reason) == null ? void 0 : o.config) == null ? void 0 : d.method,
4559
- status: (c = t == null ? void 0 : t.reason) == null ? void 0 : c.status,
4558
+ method: (c = (o = t == null ? void 0 : t.reason) == null ? void 0 : o.config) == null ? void 0 : c.method,
4559
+ status: (d = t == null ? void 0 : t.reason) == null ? void 0 : d.status,
4560
4560
  statusText: (u = t == null ? void 0 : t.reason) == null ? void 0 : u.statusText
4561
4561
  }
4562
4562
  },
@@ -4883,16 +4883,16 @@ ce.prototype.emit = function(t) {
4883
4883
  var o;
4884
4884
  if (e.length > 0 && (o = e[0]), o instanceof Error)
4885
4885
  throw o;
4886
- var d = new Error("Unhandled error." + (o ? " (" + o.message + ")" : ""));
4887
- throw d.context = o, d;
4886
+ var c = new Error("Unhandled error." + (o ? " (" + o.message + ")" : ""));
4887
+ throw c.context = o, c;
4888
4888
  }
4889
- var c = n[t];
4890
- if (c === void 0)
4889
+ var d = n[t];
4890
+ if (d === void 0)
4891
4891
  return false;
4892
- if (typeof c == "function")
4893
- ep(c, this, e);
4892
+ if (typeof d == "function")
4893
+ ep(d, this, e);
4894
4894
  else
4895
- for (var u = c.length, p = im(c, u), r = 0; r < u; ++r)
4895
+ for (var u = d.length, p = im(d, u), r = 0; r < u; ++r)
4896
4896
  ep(p[r], this, e);
4897
4897
  return true;
4898
4898
  };
@@ -4906,8 +4906,8 @@ function em(s, t, e, r) {
4906
4906
  o = n[t] = e, ++s._eventsCount;
4907
4907
  else if (typeof o == "function" ? o = n[t] = r ? [e, o] : [o, e] : r ? o.unshift(e) : o.push(e), i = Zg(s), i > 0 && o.length > i && !o.warned) {
4908
4908
  o.warned = true;
4909
- var d = new Error("Possible EventEmitter memory leak detected. " + o.length + " " + String(t) + " listeners added. Use emitter.setMaxListeners() to increase limit");
4910
- d.name = "MaxListenersExceededWarning", d.emitter = s, d.type = t, d.count = o.length, lv(d);
4909
+ var c = new Error("Possible EventEmitter memory leak detected. " + o.length + " " + String(t) + " listeners added. Use emitter.setMaxListeners() to increase limit");
4910
+ c.name = "MaxListenersExceededWarning", c.emitter = s, c.type = t, c.count = o.length, lv(c);
4911
4911
  }
4912
4912
  return s;
4913
4913
  }
@@ -4933,7 +4933,7 @@ ce.prototype.prependOnceListener = function(t, e) {
4933
4933
  return Ll(e), this.prependListener(t, tm(this, t, e)), this;
4934
4934
  };
4935
4935
  ce.prototype.removeListener = function(t, e) {
4936
- var r, i, n, o, d;
4936
+ var r, i, n, o, c;
4937
4937
  if (Ll(e), i = this._events, i === void 0)
4938
4938
  return this;
4939
4939
  if (r = i[t], r === void 0)
@@ -4943,12 +4943,12 @@ ce.prototype.removeListener = function(t, e) {
4943
4943
  else if (typeof r != "function") {
4944
4944
  for (n = -1, o = r.length - 1; o >= 0; o--)
4945
4945
  if (r[o] === e || r[o].listener === e) {
4946
- d = r[o].listener, n = o;
4946
+ c = r[o].listener, n = o;
4947
4947
  break;
4948
4948
  }
4949
4949
  if (n < 0)
4950
4950
  return this;
4951
- n === 0 ? r.shift() : hv(r, n), r.length === 1 && (i[t] = r[0]), i.removeListener !== void 0 && this.emit("removeListener", t, d || e);
4951
+ n === 0 ? r.shift() : hv(r, n), r.length === 1 && (i[t] = r[0]), i.removeListener !== void 0 && this.emit("removeListener", t, c || e);
4952
4952
  }
4953
4953
  return this;
4954
4954
  };
@@ -5219,7 +5219,7 @@ function Ev({ framesEncoded: s }) {
5219
5219
  return s === 0;
5220
5220
  }
5221
5221
  function pm({ frameWidth: s, framesPerSecond: t, packetsLost: e, packetsSent: r, jitter: i, isScreenShare: n, framesEncoded: o }) {
5222
- const d = hr({
5222
+ const c = hr({
5223
5223
  stat: um({
5224
5224
  packetsLost: e,
5225
5225
  packetsSent: r
@@ -5228,7 +5228,7 @@ function pm({ frameWidth: s, framesPerSecond: t, packetsLost: e, packetsSent: r,
5228
5228
  rangeMin: 0,
5229
5229
  rangeMax: Vl,
5230
5230
  rangeRankingDirection: "UP"
5231
- }), c = hr({
5231
+ }), d = hr({
5232
5232
  stat: i,
5233
5233
  weight: 1,
5234
5234
  rangeMin: xl,
@@ -5248,8 +5248,8 @@ function pm({ frameWidth: s, framesPerSecond: t, packetsLost: e, packetsSent: r,
5248
5248
  isLowQualityVideo: u,
5249
5249
  isVideoLagging: p,
5250
5250
  isVideoStuck: f,
5251
- jitterQuality: c,
5252
- packetsLostQuality: d
5251
+ jitterQuality: d,
5252
+ packetsLostQuality: c
5253
5253
  });
5254
5254
  }
5255
5255
  function gm({ packetsLost: s, packetsReceived: t }) {
@@ -5262,7 +5262,7 @@ function mm({ concealmentEvents: s, packetsLost: t, packetsReceived: e, jitter:
5262
5262
  rangeMin: 0,
5263
5263
  rangeMax: 3,
5264
5264
  rangeRankingDirection: "UP"
5265
- }), o = 0.5, d = hr({
5265
+ }), o = 0.5, c = hr({
5266
5266
  stat: gm({
5267
5267
  packetsLost: t,
5268
5268
  packetsReceived: e
@@ -5278,7 +5278,7 @@ function mm({ concealmentEvents: s, packetsLost: t, packetsReceived: e, jitter:
5278
5278
  rangeMax: Ul,
5279
5279
  rangeRankingDirection: "UP"
5280
5280
  });
5281
- return n + d + u;
5281
+ return n + c + u;
5282
5282
  }
5283
5283
  function _v({ framesDecoded: s }) {
5284
5284
  return s === 0;
@@ -5290,7 +5290,7 @@ function Cv({ frameWidth: s, isScreenShare: t }) {
5290
5290
  return s < (t ? om : nm);
5291
5291
  }
5292
5292
  function fm({ frameWidth: s, framesPerSecond: t, packetsLost: e, packetsReceived: r, jitter: i, isScreenShare: n, framesDecoded: o }) {
5293
- const d = hr({
5293
+ const c = hr({
5294
5294
  stat: gm({
5295
5295
  packetsLost: e,
5296
5296
  packetsReceived: r
@@ -5299,7 +5299,7 @@ function fm({ frameWidth: s, framesPerSecond: t, packetsLost: e, packetsReceived
5299
5299
  rangeMin: 0,
5300
5300
  rangeMax: Vl,
5301
5301
  rangeRankingDirection: "UP"
5302
- }), c = hr({
5302
+ }), d = hr({
5303
5303
  stat: i,
5304
5304
  weight: 1,
5305
5305
  rangeMin: xl,
@@ -5319,8 +5319,8 @@ function fm({ frameWidth: s, framesPerSecond: t, packetsLost: e, packetsReceived
5319
5319
  isLowQualityVideo: u,
5320
5320
  isVideoLagging: p,
5321
5321
  isVideoStuck: f,
5322
- jitterQuality: c,
5323
- packetsLostQuality: d
5322
+ jitterQuality: d,
5323
+ packetsLostQuality: c
5324
5324
  });
5325
5325
  }
5326
5326
  class pr {
@@ -5548,23 +5548,23 @@ class Mv {
5548
5548
  }
5549
5549
  getIPDetails(i) {
5550
5550
  return l(this, arguments, function* ({ peerId: t, apiHostnames: e, logger: r }) {
5551
- var n, o, d;
5551
+ var n, o, c;
5552
5552
  if (!this.ipInformation) {
5553
5553
  try {
5554
- const c = `https://${e.location}`, p = yield (yield fetch(c)).json();
5554
+ const d = `https://${e.location}`, p = yield (yield fetch(d)).json();
5555
5555
  if (((n = p.loc) == null ? void 0 : n.length) > 5)
5556
5556
  return this.ipInformation = p, (o = this.ipInformation) != null && o.ip && (this.ipInformation.ip = Xr(this.ipInformation.ip)), p;
5557
5557
  throw Error("Insufficient data");
5558
- } catch (c) {
5559
- r.error("callstats::ipDetails:: failed to fetch ip using location service", { error: c });
5558
+ } catch (d) {
5559
+ r.error("callstats::ipDetails:: failed to fetch ip using location service", { error: d });
5560
5560
  }
5561
5561
  try {
5562
- const c = yield fetch(`https://${e.locationLegacy}/?token=3c493932b0624c&peerId=${t}`, {
5562
+ const d = yield fetch(`https://${e.locationLegacy}/?token=3c493932b0624c&peerId=${t}`, {
5563
5563
  method: "POST"
5564
5564
  });
5565
- this.ipInformation = yield c.json(), (d = this.ipInformation) != null && d.ip && (this.ipInformation.ip = Xr(this.ipInformation.ip));
5566
- } catch (c) {
5567
- r.error("callstats::ipDetails:: failed to fetch ip using legacy location service", { error: c });
5565
+ this.ipInformation = yield d.json(), (c = this.ipInformation) != null && c.ip && (this.ipInformation.ip = Xr(this.ipInformation.ip));
5566
+ } catch (d) {
5567
+ r.error("callstats::ipDetails:: failed to fetch ip using legacy location service", { error: d });
5568
5568
  }
5569
5569
  }
5570
5570
  return this.ipInformation;
@@ -5655,13 +5655,13 @@ class ym extends ut {
5655
5655
  this.pausedProducerMap.delete(e);
5656
5656
  }
5657
5657
  processInboundConsumerVideoStats(e, r, i) {
5658
- var o, d;
5659
- const n = ((d = (o = this == null ? void 0 : this.callStatsInstance) == null ? void 0 : o.consumerSharedMediaStatesMap) == null ? void 0 : d.get(e)) || {};
5658
+ var o, c;
5659
+ const n = ((c = (o = this == null ? void 0 : this.callStatsInstance) == null ? void 0 : o.consumerSharedMediaStatesMap) == null ? void 0 : c.get(e)) || {};
5660
5660
  r.totalVideoPacketsReceived === i.packetsReceived ? (this.consumerIdsWithFreezedVideo.add(e), this.callStatsInstance && n.video && (this.callStatsInstance.logger.debug("callstats::measurements::consumerVideoFreezed", { consumerId: e }), this.callStatsInstance.eventHandler.emit("consumer_video_status", "pause", e))) : (r.totalVideoPacketsReceived = i.packetsReceived, this.consumerIdsWithFreezedVideo.has(e) && (this.consumerIdsWithFreezedVideo.delete(e), this.callStatsInstance && n.video && (this.callStatsInstance.logger.debug("callstats::measurements::consumerVideoDefreezed", { consumerId: e }), this.callStatsInstance.eventHandler.emit("consumer_video_status", "resume", e))));
5661
5661
  }
5662
5662
  processInboundConsumerAudioStats(e, r, i) {
5663
- var o, d;
5664
- const n = ((d = (o = this == null ? void 0 : this.callStatsInstance) == null ? void 0 : o.consumerSharedMediaStatesMap) == null ? void 0 : d.get(e)) || {};
5663
+ var o, c;
5664
+ const n = ((c = (o = this == null ? void 0 : this.callStatsInstance) == null ? void 0 : o.consumerSharedMediaStatesMap) == null ? void 0 : c.get(e)) || {};
5665
5665
  r.totalAudioPacketsReceived === i.packetsReceived ? (this.consumerIdsWithFreezedAudio.add(e), this.callStatsInstance && n.audio && (this.callStatsInstance.logger.debug("callStats::measurements::consumerAudioFreezed", { consumerId: e }), this.callStatsInstance.eventHandler.emit("consumer_audio_status", "pause", e))) : (r.totalAudioPacketsReceived = i.packetsReceived, this.consumerIdsWithFreezedAudio.has(e) && (this.consumerIdsWithFreezedAudio.delete(e), this.callStatsInstance && n.audio && (this.callStatsInstance.logger.debug("callStats::measurements::consumerAudioDefreezed", { consumerId: e }), this.callStatsInstance.eventHandler.emit("consumer_audio_status", "resume", e))));
5666
5666
  }
5667
5667
  processOutboundProducerVideoStats(e, r, i) {
@@ -5676,12 +5676,12 @@ class ym extends ut {
5676
5676
  }
5677
5677
  processProducingTransportStats(e, r, i) {
5678
5678
  var p;
5679
- const n = ((p = this == null ? void 0 : this.callStatsInstance) == null ? void 0 : p.currentUserMediaStates) || {}, { audio: o, video: d, screen: c } = n, u = o || d || c;
5679
+ const n = ((p = this == null ? void 0 : this.callStatsInstance) == null ? void 0 : p.currentUserMediaStates) || {}, { audio: o, video: c, screen: d } = n, u = o || c || d;
5680
5680
  r.totalPacketsSent === i.packetsSent ? (this.freezedProducingTransportIds.add(e), this.callStatsInstance && u && (this.callStatsInstance.logger.debug("callStats::measurements::producingTransportFreezed", { transportId: e }), this.callStatsInstance.eventHandler.emit("producing_transport_status", "pause", e))) : (r.totalPacketsSent = i.packetsSent, this.freezedProducingTransportIds.has(e) && (this.freezedProducingTransportIds.delete(e), this.callStatsInstance && u && (this.callStatsInstance.logger.debug("callStats::measurements::producingTransportDefreezed", { transportId: e }), this.callStatsInstance.eventHandler.emit("producing_transport_status", "resume", e))));
5681
5681
  }
5682
5682
  processConsumingTransportStats(e, r, i) {
5683
- var d, c;
5684
- const o = !!Array.from(((c = (d = this == null ? void 0 : this.callStatsInstance) == null ? void 0 : d.consumerSharedMediaStatesMap) == null ? void 0 : c.values()) || []).reduce((u, p) => u || p.audio || p.video || p.screen, false);
5683
+ var c, d;
5684
+ const o = !!Array.from(((d = (c = this == null ? void 0 : this.callStatsInstance) == null ? void 0 : c.consumerSharedMediaStatesMap) == null ? void 0 : d.values()) || []).reduce((u, p) => u || p.audio || p.video || p.screen, false);
5685
5685
  r.totalPacketsReceived === i.packetsSent ? (this.freezedConsumingTransportIds.add(e), this.callStatsInstance && o && (this.callStatsInstance.logger.debug("callStats::measurements::consumingTransportFreezed", { transportId: e }), this.callStatsInstance.eventHandler.emit("consuming_transport_status", "pause", e))) : (r.totalPacketsReceived = i.packetsSent, this.freezedConsumingTransportIds.has(e) && (this.freezedConsumingTransportIds.delete(e), this.callStatsInstance && o && (this.callStatsInstance.logger.debug("callStats::measurements::consumingTransportDefreezed", { transportId: e }), this.callStatsInstance.eventHandler.emit("consuming_transport_status", "resume", e))));
5686
5686
  }
5687
5687
  registerConsumer(e) {
@@ -5753,14 +5753,14 @@ class ym extends ut {
5753
5753
  }
5754
5754
  getWorkingSimulcastVideoStats(e) {
5755
5755
  return e.find((i) => {
5756
- const n = i.framesEncoded > 0, o = i.packetsSent > 0, d = i.frameWidth && i.frameHeight;
5757
- return n && o && !!d;
5756
+ const n = i.framesEncoded > 0, o = i.packetsSent > 0, c = i.frameWidth && i.frameHeight;
5757
+ return n && o && !!c;
5758
5758
  }) || e[e.length - 1];
5759
5759
  }
5760
5760
  parseRTCReport(e, r = [], i = false, n = void 0, o = void 0) {
5761
5761
  var P, k, A, N, H, $, F, K, re, Je, Is, vr, ni;
5762
- const d = e, c = new vm(), u = r.length ? new Set(r) : void 0, p = [], f = [], S = [], E = /* @__PURE__ */ new Map(), _ = /* @__PURE__ */ new Map();
5763
- for (const I of d.values()) {
5762
+ const c = e, d = new vm(), u = r.length ? new Set(r) : void 0, p = [], f = [], S = [], E = /* @__PURE__ */ new Map(), _ = /* @__PURE__ */ new Map();
5763
+ for (const I of c.values()) {
5764
5764
  if (u) {
5765
5765
  if (u.size === 0)
5766
5766
  break;
@@ -5796,7 +5796,7 @@ class ym extends ut {
5796
5796
  packetsReceived: U.packetsReceived,
5797
5797
  packetsDiscardedOnSend: U.packetsDiscardedOnSend
5798
5798
  };
5799
- S.push(ie), (I.nominated === true || I.selected === true) && (c.candidatePair = ie);
5799
+ S.push(ie), (I.nominated === true || I.selected === true) && (d.candidatePair = ie);
5800
5800
  break;
5801
5801
  }
5802
5802
  case "transport": {
@@ -5815,7 +5815,7 @@ class ym extends ut {
5815
5815
  dtlsState: y.dtlsState,
5816
5816
  iceRole: y.iceRole
5817
5817
  };
5818
- if (c.transport = C, o) {
5818
+ if (d.transport = C, o) {
5819
5819
  if (o.producing) {
5820
5820
  const U = this.overallProducingTransportsStatsMap[o.id];
5821
5821
  this.processProducingTransportStats(o.id, U, C);
@@ -5836,7 +5836,7 @@ class ym extends ut {
5836
5836
  totalRoundTripTime: y.totalRoundTripTime,
5837
5837
  packetsLost: y.packetsLost
5838
5838
  };
5839
- c.remoteInboundRtp.set(y.localId, C);
5839
+ d.remoteInboundRtp.set(y.localId, C);
5840
5840
  break;
5841
5841
  }
5842
5842
  case "outbound-rtp": {
@@ -5855,13 +5855,13 @@ class ym extends ut {
5855
5855
  const ie = this.overallProducersStatsMap[C];
5856
5856
  if (["video", "audio"].includes(y.mediaType) || ["video", "audio"].includes(y.kind)) {
5857
5857
  if (!this.outboundProducerMap.has(I.id)) {
5858
- c.staleProducerStreamMap = true;
5858
+ d.staleProducerStreamMap = true;
5859
5859
  break;
5860
5860
  }
5861
5861
  const Me = this.callStatsInstance.producers.get(C);
5862
5862
  if (((P = Me == null ? void 0 : Me.track) == null ? void 0 : P.readyState) === "ended")
5863
5863
  break;
5864
- c.producerStreamMap.has(C) || c.producerStreamMap.set(C, {
5864
+ d.producerStreamMap.has(C) || d.producerStreamMap.set(C, {
5865
5865
  outboundVideoRtpId: [],
5866
5866
  outboundAudioRtpId: []
5867
5867
  });
@@ -5900,13 +5900,13 @@ class ym extends ut {
5900
5900
  scalabilityMode: w.scalabilityMode,
5901
5901
  powerEfficientEncoder: w.powerEfficientEncoder
5902
5902
  }, L);
5903
- c.outboundVideoRtp.set(I.id, $e), c.producerStreamMap.get(C).outboundVideoRtpId.push(I.id), this.processOutboundProducerVideoStats(C, ie, $e);
5903
+ d.outboundVideoRtp.set(I.id, $e), d.producerStreamMap.get(C).outboundVideoRtpId.push(I.id), this.processOutboundProducerVideoStats(C, ie, $e);
5904
5904
  } else if (y.mediaType === "audio" || y.kind === "audio") {
5905
5905
  const w = y, $e = D({
5906
5906
  retransmittedBytesSent: w.retransmittedBytesSent,
5907
5907
  retransmittedPacketsSent: w.retransmittedPacketsSent
5908
5908
  }, L);
5909
- c.outboundAudioRtp.set(I.id, $e), c.producerStreamMap.get(C).outboundAudioRtpId.push(I.id), this.processOutboundProducerAudioStats(C, ie, $e);
5909
+ d.outboundAudioRtp.set(I.id, $e), d.producerStreamMap.get(C).outboundAudioRtpId.push(I.id), this.processOutboundProducerAudioStats(C, ie, $e);
5910
5910
  }
5911
5911
  } else
5912
5912
  this.callStatsInstance.logger.error(`Callstats: Unknown Outbound-rtp. mediatype: ${y.mediaType} kind: ${y.kind}`);
@@ -5930,10 +5930,10 @@ class ym extends ut {
5930
5930
  const ie = this.overallConsumersStatsMap[C];
5931
5931
  if (["video", "audio"].includes(y.mediaType) || ["video", "audio"].includes(y.kind)) {
5932
5932
  if (!this.inboundConsumerMap.has(I.id)) {
5933
- c.staleConsumerStreamMap = true;
5933
+ d.staleConsumerStreamMap = true;
5934
5934
  break;
5935
5935
  }
5936
- c.consumerStreamMap.has(C) || c.consumerStreamMap.set(C, {
5936
+ d.consumerStreamMap.has(C) || d.consumerStreamMap.set(C, {
5937
5937
  inboundVideoRtpId: [],
5938
5938
  inboundAudioRtpId: []
5939
5939
  });
@@ -5998,7 +5998,7 @@ class ym extends ut {
5998
5998
  jitter: w.jitter || 0,
5999
5999
  isScreenShare: this.screenShareConsumers.has(C),
6000
6000
  bitrate: ((w.bytesReceived || 0) - (((F = this.videoConsumerToStatsMap.get(C)) == null ? void 0 : F.bytesReceived) || 0)) * 8 / 7
6001
- }), this.videoConsumerToStatsMap.set(C, w), c.inboundVideoRtp.set(I.id, w), c.consumerStreamMap.get(C).inboundVideoRtpId.push(I.id), this.processInboundConsumerVideoStats(C, ie, w);
6001
+ }), this.videoConsumerToStatsMap.set(C, w), d.inboundVideoRtp.set(I.id, w), d.consumerStreamMap.get(C).inboundVideoRtpId.push(I.id), this.processInboundConsumerVideoStats(C, ie, w);
6002
6002
  } else if (y.mediaType === "audio" || y.kind === "audio") {
6003
6003
  const L = y, w = D({
6004
6004
  audioLevel: L.audioLevel,
@@ -6028,7 +6028,7 @@ class ym extends ut {
6028
6028
  jitter: w.jitter || 0,
6029
6029
  isScreenShare: this.screenShareConsumers.has(C),
6030
6030
  bitrate: ((w.bytesReceived || 0) - (((ni = this.audioConsumerToStatsMap.get(C)) == null ? void 0 : ni.bytesReceived) || 0)) * 8 / 7
6031
- }), this.audioConsumerToStatsMap.set(C, w), c.inboundAudioRtp.set(I.id, w), c.consumerStreamMap.get(C).inboundAudioRtpId.push(I.id), this.processInboundConsumerAudioStats(C, ie, w);
6031
+ }), this.audioConsumerToStatsMap.set(C, w), d.inboundAudioRtp.set(I.id, w), d.consumerStreamMap.get(C).inboundAudioRtpId.push(I.id), this.processInboundConsumerAudioStats(C, ie, w);
6032
6032
  }
6033
6033
  } else
6034
6034
  this.callStatsInstance.logger.error(`Callstats: Unknown Inbound-rtp. mediatype: ${y.mediaType} kind: ${y.kind}`);
@@ -6036,12 +6036,12 @@ class ym extends ut {
6036
6036
  }
6037
6037
  }
6038
6038
  }
6039
- if (c.producerStreamMap.forEach((I, y) => {
6039
+ if (d.producerStreamMap.forEach((I, y) => {
6040
6040
  var C, U, ie, Me, L, w, $e, yr, Tr, $s, eo, to, so, ro, io, ao, no, oo, co, lo, uo, ho, po;
6041
6041
  if (I.outboundVideoRtpId.length > 0) {
6042
6042
  const ue = [];
6043
6043
  I.outboundVideoRtpId.forEach((tu) => {
6044
- ue.push(c.outboundVideoRtp.get(tu));
6044
+ ue.push(d.outboundVideoRtp.get(tu));
6045
6045
  });
6046
6046
  const se = this.getWorkingSimulcastVideoStats(ue);
6047
6047
  se.score = pm({
@@ -6068,7 +6068,7 @@ class ym extends ut {
6068
6068
  bandwidthLimitations: se.qualityLimitationReason === "bandwidth"
6069
6069
  }), this.videoProducerToStatsMap.set(y, se);
6070
6070
  } else if (I.outboundAudioRtpId.length > 0) {
6071
- const ue = c.outboundAudioRtp.get(I.outboundAudioRtpId[0]);
6071
+ const ue = d.outboundAudioRtp.get(I.outboundAudioRtpId[0]);
6072
6072
  ue.score = hm({
6073
6073
  packetsSent: (ue.packetsSent || 0) - (((so = this.audioProducerToStatsMap.get(y)) == null ? void 0 : so.packetsSent) || 0),
6074
6074
  packetsLost: (((ro = ue.remoteData) == null ? void 0 : ro.packetsLost) || 0) - (((ao = (io = this.audioProducerToStatsMap.get(y)) == null ? void 0 : io.remoteData) == null ? void 0 : ao.packetsLost) || 0),
@@ -6087,18 +6087,18 @@ class ym extends ut {
6087
6087
  }), S.forEach((I) => {
6088
6088
  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);
6089
6089
  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);
6090
- }), c.candidatePair && (c.transport ? (c.transport.totalRoundTripTime = c.candidatePair.totalRoundTripTime, c.transport.availableOutgoingBitrate = c.candidatePair.availableOutgoingBitrate, c.transport.availableIncomingBitrate = c.candidatePair.availableIncomingBitrate, c.transport.roundTripTime = c.candidatePair.currentRoundTripTime) : c.transport = {
6091
- bytesReceived: c.candidatePair.bytesReceived,
6092
- bytesSent: c.candidatePair.bytesSent,
6093
- totalRoundTripTime: c.candidatePair.totalRoundTripTime,
6094
- availableOutgoingBitrate: c.candidatePair.availableOutgoingBitrate,
6095
- availableIncomingBitrate: c.candidatePair.availableIncomingBitrate,
6096
- roundTripTime: c.candidatePair.currentRoundTripTime
6097
- }), c.transport && (c.transport.candidatePairs = S), c.transport && !c.transport.roundTripTime) {
6090
+ }), 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 = {
6091
+ bytesReceived: d.candidatePair.bytesReceived,
6092
+ bytesSent: d.candidatePair.bytesSent,
6093
+ totalRoundTripTime: d.candidatePair.totalRoundTripTime,
6094
+ availableOutgoingBitrate: d.candidatePair.availableOutgoingBitrate,
6095
+ availableIncomingBitrate: d.candidatePair.availableIncomingBitrate,
6096
+ roundTripTime: d.candidatePair.currentRoundTripTime
6097
+ }), d.transport && (d.transport.candidatePairs = S), d.transport && !d.transport.roundTripTime) {
6098
6098
  let I = 0, y = 0;
6099
- c.remoteInboundRtp.forEach((C, U) => {
6099
+ d.remoteInboundRtp.forEach((C, U) => {
6100
6100
  C.roundTripTime && C.roundTripTime > I && (I = C.roundTripTime, y = C.totalRoundTripTime);
6101
- }), c.transport.roundTripTime = I, c.transport.totalRoundTripTime = y;
6101
+ }), d.transport.roundTripTime = I, d.transport.totalRoundTripTime = y;
6102
6102
  }
6103
6103
  if (_.size > 0)
6104
6104
  try {
@@ -6110,7 +6110,7 @@ class ym extends ut {
6110
6110
  this.observer.emit("producer_score", E);
6111
6111
  } catch (I) {
6112
6112
  }
6113
- return c;
6113
+ return d;
6114
6114
  }
6115
6115
  getProducersReport(e) {
6116
6116
  return l(this, null, function* () {
@@ -6131,15 +6131,15 @@ class ym extends ut {
6131
6131
  }
6132
6132
  getProcessedStats(e, r, i) {
6133
6133
  return l(this, null, function* () {
6134
- const n = yield this.getTransportReport(e), o = { producing: i, consuming: r, id: e.id }, d = n, c = this.parseRTCReport(d, ["transport", "candidate-pair", "inbound-rtp", "outbound-rtp", "remote-inbound-rtp", "local-candidate", "remote-candidate"], false, void 0, o);
6135
- if (!c)
6134
+ const n = yield this.getTransportReport(e), o = { producing: i, consuming: r, id: e.id }, c = n, d = this.parseRTCReport(c, ["transport", "candidate-pair", "inbound-rtp", "outbound-rtp", "remote-inbound-rtp", "local-candidate", "remote-candidate"], false, void 0, o);
6135
+ if (!d)
6136
6136
  return;
6137
6137
  const u = {
6138
- stats: c.transport,
6138
+ stats: d.transport,
6139
6139
  transportId: e.id,
6140
6140
  consuming: r,
6141
6141
  producing: i
6142
- }, p = c.staleProducerStreamMap ? void 0 : this.getProducerStatsFromReport(c), f = c.staleConsumerStreamMap ? void 0 : this.getConsumerStatsFromReport(c);
6142
+ }, p = d.staleProducerStreamMap ? void 0 : this.getProducerStatsFromReport(d), f = d.staleConsumerStreamMap ? void 0 : this.getConsumerStatsFromReport(d);
6143
6143
  return {
6144
6144
  transportReport: u,
6145
6145
  producerReport: p,
@@ -6151,12 +6151,12 @@ class ym extends ut {
6151
6151
  const r = [];
6152
6152
  try {
6153
6153
  e.producerStreamMap.forEach((i, n) => {
6154
- var o, d;
6154
+ var o, c;
6155
6155
  r.push({
6156
6156
  producerId: n,
6157
- videoStats: i.outboundVideoRtpId.map((c) => e.outboundVideoRtp.get(c)),
6158
- audioStats: i.outboundAudioRtpId.map((c) => e.outboundAudioRtp.get(c)),
6159
- appData: ((d = (o = this.callStatsInstance.producers) == null ? void 0 : o.get(n)) == null ? void 0 : d.appData) || null
6157
+ videoStats: i.outboundVideoRtpId.map((d) => e.outboundVideoRtp.get(d)),
6158
+ audioStats: i.outboundAudioRtpId.map((d) => e.outboundAudioRtp.get(d)),
6159
+ appData: ((c = (o = this.callStatsInstance.producers) == null ? void 0 : o.get(n)) == null ? void 0 : c.appData) || null
6160
6160
  });
6161
6161
  });
6162
6162
  } catch (i) {
@@ -6170,12 +6170,12 @@ class ym extends ut {
6170
6170
  const r = [];
6171
6171
  try {
6172
6172
  e.consumerStreamMap.forEach((i, n) => {
6173
- const { peerId: o, producerId: d, appData: c } = this.consumerPeerIdMap.get(n);
6173
+ const { peerId: o, producerId: c, appData: d } = this.consumerPeerIdMap.get(n);
6174
6174
  r.push({
6175
6175
  consumerId: n,
6176
6176
  peerId: o,
6177
- producerId: d,
6178
- appData: c,
6177
+ producerId: c,
6178
+ appData: d,
6179
6179
  videoStats: i.inboundVideoRtpId.map((u) => e.inboundVideoRtp.get(u)),
6180
6180
  audioStats: i.inboundAudioRtpId.map((u) => e.inboundAudioRtp.get(u))
6181
6181
  });
@@ -6230,10 +6230,10 @@ class ym extends ut {
6230
6230
  } catch (S) {
6231
6231
  f(S);
6232
6232
  }
6233
- }), [d, c, u] = yield Promise.all([i, n, o]);
6233
+ }), [c, d, u] = yield Promise.all([i, n, o]);
6234
6234
  return {
6235
- host: d == null ? void 0 : d.connectivity,
6236
- relay: c == null ? void 0 : c.connectivity,
6235
+ host: c == null ? void 0 : c.connectivity,
6236
+ relay: d == null ? void 0 : d.connectivity,
6237
6237
  reflexive: u == null ? void 0 : u.connectivity
6238
6238
  };
6239
6239
  } catch (r) {
@@ -6250,12 +6250,12 @@ class ym extends ut {
6250
6250
  try {
6251
6251
  const i = yield new Promise((n, o) => {
6252
6252
  try {
6253
- const d = {
6253
+ const c = {
6254
6254
  iceServers: e || ip
6255
- }, c = new bv(d);
6256
- c.addListener("done", n), c.addListener("failed", o), c.start(1e4);
6257
- } catch (d) {
6258
- o(d);
6255
+ }, d = new bv(c);
6256
+ d.addListener("done", n), d.addListener("failed", o), d.start(1e4);
6257
+ } catch (c) {
6258
+ o(c);
6259
6259
  }
6260
6260
  });
6261
6261
  return {
@@ -6302,12 +6302,12 @@ class ym extends ut {
6302
6302
  }
6303
6303
  getNetworkInfo(e, r = false) {
6304
6304
  return l(this, null, function* () {
6305
- var d, c;
6305
+ var c, d;
6306
6306
  if (r) {
6307
6307
  const u = yield this.getIPDetails();
6308
6308
  return {
6309
6309
  ipDetails: u,
6310
- effectiveNetworkType: (d = navigator.connection) == null ? void 0 : d.effectiveType,
6310
+ effectiveNetworkType: (c = navigator.connection) == null ? void 0 : c.effectiveType,
6311
6311
  location: u != null && u.loc ? ap(u == null ? void 0 : u.loc) : void 0
6312
6312
  };
6313
6313
  }
@@ -6318,7 +6318,7 @@ class ym extends ut {
6318
6318
  ]);
6319
6319
  return {
6320
6320
  ipDetails: o,
6321
- effectiveNetworkType: (c = navigator.connection) == null ? void 0 : c.effectiveType,
6321
+ effectiveNetworkType: (d = navigator.connection) == null ? void 0 : d.effectiveType,
6322
6322
  location: o != null && o.loc ? ap(o == null ? void 0 : o.loc) : void 0,
6323
6323
  turnConnectivity: i ? i.host || i.relay || i.reflexive : false,
6324
6324
  connectivity: i,
@@ -6355,15 +6355,15 @@ class Tm extends ym {
6355
6355
  }
6356
6356
  generateConsumerStreamMap(e, r = false) {
6357
6357
  return l(this, null, function* () {
6358
- const i = yield e.getStats(), n = this.parseRTCReport(i, ["inbound-rtp"], false, e.id), o = [...n.consumerStreamMap.values()][0], d = r ? this.getConsumerStatsFromParsedConsumerStats(n, o, e.id) : void 0;
6359
- for (const c of i.values())
6360
- switch (c.type) {
6358
+ const i = yield e.getStats(), n = this.parseRTCReport(i, ["inbound-rtp"], false, e.id), o = [...n.consumerStreamMap.values()][0], c = r ? this.getConsumerStatsFromParsedConsumerStats(n, o, e.id) : void 0;
6359
+ for (const d of i.values())
6360
+ switch (d.type) {
6361
6361
  case "inbound-rtp": {
6362
- this.inboundConsumerMap.set(c.id, e.id);
6362
+ this.inboundConsumerMap.set(d.id, e.id);
6363
6363
  break;
6364
6364
  }
6365
6365
  }
6366
- return d;
6366
+ return c;
6367
6367
  });
6368
6368
  }
6369
6369
  deregisterProducer(e) {
@@ -6392,8 +6392,8 @@ class Tm extends ym {
6392
6392
  }
6393
6393
  parseRTCReport(e, r = [], i = false, n = void 0, o = void 0) {
6394
6394
  var P, k, A, N, H, $, F, K, re, Je, Is, vr, ni;
6395
- const d = e, c = new vm(), u = r.length ? new Set(r) : void 0, p = [], f = [], S = [], E = /* @__PURE__ */ new Map(), _ = /* @__PURE__ */ new Map();
6396
- for (const I of d.values()) {
6395
+ const c = e, d = new vm(), u = r.length ? new Set(r) : void 0, p = [], f = [], S = [], E = /* @__PURE__ */ new Map(), _ = /* @__PURE__ */ new Map();
6396
+ for (const I of c.values()) {
6397
6397
  if (u) {
6398
6398
  if (u.size === 0)
6399
6399
  break;
@@ -6429,7 +6429,7 @@ class Tm extends ym {
6429
6429
  packetsReceived: U.packetsReceived,
6430
6430
  packetsDiscardedOnSend: U.packetsDiscardedOnSend
6431
6431
  };
6432
- S.push(ie), (I.nominated === true || I.selected === true) && (c.candidatePair = ie);
6432
+ S.push(ie), (I.nominated === true || I.selected === true) && (d.candidatePair = ie);
6433
6433
  break;
6434
6434
  }
6435
6435
  case "transport": {
@@ -6448,7 +6448,7 @@ class Tm extends ym {
6448
6448
  dtlsState: y.dtlsState,
6449
6449
  iceRole: y.iceRole
6450
6450
  };
6451
- if (c.transport = C, o) {
6451
+ if (d.transport = C, o) {
6452
6452
  if (o.producing) {
6453
6453
  const U = this.overallProducingTransportsStatsMap[o.id];
6454
6454
  this.processProducingTransportStats(o.id, U, C);
@@ -6469,7 +6469,7 @@ class Tm extends ym {
6469
6469
  totalRoundTripTime: y.totalRoundTripTime,
6470
6470
  packetsLost: y.packetsLost
6471
6471
  };
6472
- c.remoteInboundRtp.set(y.localId, C);
6472
+ d.remoteInboundRtp.set(y.localId, C);
6473
6473
  break;
6474
6474
  }
6475
6475
  case "outbound-rtp": {
@@ -6488,13 +6488,13 @@ class Tm extends ym {
6488
6488
  const ie = this.overallProducersStatsMap[C];
6489
6489
  if (["video", "audio"].includes(y.mediaType) || ["video", "audio"].includes(y.kind)) {
6490
6490
  if (!this.outboundProducerMap.has(I.id)) {
6491
- c.staleProducerStreamMap = true;
6491
+ d.staleProducerStreamMap = true;
6492
6492
  break;
6493
6493
  }
6494
6494
  const Me = this.callStatsInstance.producers.get(C);
6495
6495
  if (((P = Me == null ? void 0 : Me.track) == null ? void 0 : P.readyState) === "ended")
6496
6496
  break;
6497
- c.producerStreamMap.has(C) || c.producerStreamMap.set(C, {
6497
+ d.producerStreamMap.has(C) || d.producerStreamMap.set(C, {
6498
6498
  outboundVideoRtpId: [],
6499
6499
  outboundAudioRtpId: []
6500
6500
  });
@@ -6533,13 +6533,13 @@ class Tm extends ym {
6533
6533
  scalabilityMode: w.scalabilityMode,
6534
6534
  powerEfficientEncoder: w.powerEfficientEncoder
6535
6535
  }, L);
6536
- c.outboundVideoRtp.set(I.id, $e), c.producerStreamMap.get(C).outboundVideoRtpId.push(I.id), this.processOutboundProducerVideoStats(C, ie, $e);
6536
+ d.outboundVideoRtp.set(I.id, $e), d.producerStreamMap.get(C).outboundVideoRtpId.push(I.id), this.processOutboundProducerVideoStats(C, ie, $e);
6537
6537
  } else if (y.mediaType === "audio" || y.kind === "audio") {
6538
6538
  const w = y, $e = D({
6539
6539
  retransmittedBytesSent: w.retransmittedBytesSent,
6540
6540
  retransmittedPacketsSent: w.retransmittedPacketsSent
6541
6541
  }, L);
6542
- c.outboundAudioRtp.set(I.id, $e), c.producerStreamMap.get(C).outboundAudioRtpId.push(I.id), this.processOutboundProducerAudioStats(C, ie, $e);
6542
+ d.outboundAudioRtp.set(I.id, $e), d.producerStreamMap.get(C).outboundAudioRtpId.push(I.id), this.processOutboundProducerAudioStats(C, ie, $e);
6543
6543
  }
6544
6544
  } else
6545
6545
  this.callStatsInstance.logger.error(`Callstats: Unknown Outbound-rtp. mediatype: ${y.mediaType} kind: ${y.kind}`);
@@ -6563,10 +6563,10 @@ class Tm extends ym {
6563
6563
  const ie = this.overallConsumersStatsMap[C];
6564
6564
  if (["video", "audio"].includes(y.mediaType) || ["video", "audio"].includes(y.kind)) {
6565
6565
  if (!this.inboundConsumerMap.has(I.id)) {
6566
- c.staleConsumerStreamMap = true;
6566
+ d.staleConsumerStreamMap = true;
6567
6567
  break;
6568
6568
  }
6569
- c.consumerStreamMap.has(C) || c.consumerStreamMap.set(C, {
6569
+ d.consumerStreamMap.has(C) || d.consumerStreamMap.set(C, {
6570
6570
  inboundVideoRtpId: [],
6571
6571
  inboundAudioRtpId: []
6572
6572
  });
@@ -6631,7 +6631,7 @@ class Tm extends ym {
6631
6631
  jitter: w.jitter || 0,
6632
6632
  isScreenShare: this.screenShareConsumers.has(C),
6633
6633
  bitrate: ((w.bytesReceived || 0) - (((F = this.videoConsumerToStatsMap.get(C)) == null ? void 0 : F.bytesReceived) || 0)) * 8 / 7
6634
- }), this.videoConsumerToStatsMap.set(C, w), c.inboundVideoRtp.set(I.id, w), c.consumerStreamMap.get(C).inboundVideoRtpId.push(I.id), this.processInboundConsumerVideoStats(C, ie, w);
6634
+ }), this.videoConsumerToStatsMap.set(C, w), d.inboundVideoRtp.set(I.id, w), d.consumerStreamMap.get(C).inboundVideoRtpId.push(I.id), this.processInboundConsumerVideoStats(C, ie, w);
6635
6635
  } else if (y.mediaType === "audio" || y.kind === "audio") {
6636
6636
  const L = y, w = D({
6637
6637
  audioLevel: L.audioLevel,
@@ -6661,7 +6661,7 @@ class Tm extends ym {
6661
6661
  jitter: w.jitter || 0,
6662
6662
  isScreenShare: this.screenShareConsumers.has(C),
6663
6663
  bitrate: ((w.bytesReceived || 0) - (((ni = this.audioConsumerToStatsMap.get(C)) == null ? void 0 : ni.bytesReceived) || 0)) * 8 / 7
6664
- }), this.audioConsumerToStatsMap.set(C, w), c.inboundAudioRtp.set(I.id, w), c.consumerStreamMap.get(C).inboundAudioRtpId.push(I.id), this.processInboundConsumerAudioStats(C, ie, w);
6664
+ }), this.audioConsumerToStatsMap.set(C, w), d.inboundAudioRtp.set(I.id, w), d.consumerStreamMap.get(C).inboundAudioRtpId.push(I.id), this.processInboundConsumerAudioStats(C, ie, w);
6665
6665
  }
6666
6666
  } else
6667
6667
  this.callStatsInstance.logger.error(`Callstats: Unknown Inbound-rtp. mediatype: ${y.mediaType} kind: ${y.kind}`);
@@ -6669,12 +6669,12 @@ class Tm extends ym {
6669
6669
  }
6670
6670
  }
6671
6671
  }
6672
- if (c.producerStreamMap.forEach((I, y) => {
6672
+ if (d.producerStreamMap.forEach((I, y) => {
6673
6673
  var C, U, ie, Me, L, w, $e, yr, Tr, $s, eo, to, so, ro, io, ao, no, oo, co, lo, uo, ho, po;
6674
6674
  if (I.outboundVideoRtpId.length > 0) {
6675
6675
  const ue = [];
6676
6676
  I.outboundVideoRtpId.forEach((tu) => {
6677
- ue.push(c.outboundVideoRtp.get(tu));
6677
+ ue.push(d.outboundVideoRtp.get(tu));
6678
6678
  });
6679
6679
  const se = this.getWorkingSimulcastVideoStats(ue);
6680
6680
  se.score = pm({
@@ -6701,7 +6701,7 @@ class Tm extends ym {
6701
6701
  bandwidthLimitations: se.qualityLimitationReason === "bandwidth"
6702
6702
  }), this.videoProducerToStatsMap.set(y, se);
6703
6703
  } else if (I.outboundAudioRtpId.length > 0) {
6704
- const ue = c.outboundAudioRtp.get(I.outboundAudioRtpId[0]);
6704
+ const ue = d.outboundAudioRtp.get(I.outboundAudioRtpId[0]);
6705
6705
  ue.score = hm({
6706
6706
  packetsSent: (ue.packetsSent || 0) - (((so = this.audioProducerToStatsMap.get(y)) == null ? void 0 : so.packetsSent) || 0),
6707
6707
  packetsLost: (((ro = ue.remoteData) == null ? void 0 : ro.packetsLost) || 0) - (((ao = (io = this.audioProducerToStatsMap.get(y)) == null ? void 0 : io.remoteData) == null ? void 0 : ao.packetsLost) || 0),
@@ -6720,18 +6720,18 @@ class Tm extends ym {
6720
6720
  }), S.forEach((I) => {
6721
6721
  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);
6722
6722
  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);
6723
- }), c.candidatePair && (c.transport ? (c.transport.bytesReceived = c.candidatePair.bytesReceived, c.transport.bytesSent = c.candidatePair.bytesSent, c.transport.totalRoundTripTime = c.candidatePair.totalRoundTripTime, c.transport.availableOutgoingBitrate = c.candidatePair.availableOutgoingBitrate, c.transport.availableIncomingBitrate = c.candidatePair.availableIncomingBitrate, c.transport.roundTripTime = c.candidatePair.currentRoundTripTime) : c.transport = {
6724
- bytesReceived: c.candidatePair.bytesReceived,
6725
- bytesSent: c.candidatePair.bytesSent,
6726
- totalRoundTripTime: c.candidatePair.totalRoundTripTime,
6727
- availableOutgoingBitrate: c.candidatePair.availableOutgoingBitrate,
6728
- availableIncomingBitrate: c.candidatePair.availableIncomingBitrate,
6729
- roundTripTime: c.candidatePair.currentRoundTripTime
6730
- }), c.transport && (c.transport.candidatePairs = S), c.transport && !c.transport.roundTripTime) {
6723
+ }), 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 = {
6724
+ bytesReceived: d.candidatePair.bytesReceived,
6725
+ bytesSent: d.candidatePair.bytesSent,
6726
+ totalRoundTripTime: d.candidatePair.totalRoundTripTime,
6727
+ availableOutgoingBitrate: d.candidatePair.availableOutgoingBitrate,
6728
+ availableIncomingBitrate: d.candidatePair.availableIncomingBitrate,
6729
+ roundTripTime: d.candidatePair.currentRoundTripTime
6730
+ }), d.transport && (d.transport.candidatePairs = S), d.transport && !d.transport.roundTripTime) {
6731
6731
  let I = 0, y = 0;
6732
- c.remoteInboundRtp.forEach((C, U) => {
6732
+ d.remoteInboundRtp.forEach((C, U) => {
6733
6733
  C.roundTripTime && C.roundTripTime > I && (I = C.roundTripTime, y = C.totalRoundTripTime);
6734
- }), c.transport.roundTripTime = I, c.transport.totalRoundTripTime = y;
6734
+ }), d.transport.roundTripTime = I, d.transport.totalRoundTripTime = y;
6735
6735
  }
6736
6736
  if (_.size > 0)
6737
6737
  try {
@@ -6743,19 +6743,19 @@ class Tm extends ym {
6743
6743
  this.observer.emit("producer_score", E);
6744
6744
  } catch (I) {
6745
6745
  }
6746
- return c;
6746
+ return d;
6747
6747
  }
6748
6748
  getProducerStatsFromReport(e) {
6749
6749
  const r = [];
6750
6750
  try {
6751
6751
  e.producerStreamMap.forEach((i, n) => {
6752
- const o = this.producerMap.get(n), d = o.track.getSettings(), c = i.outboundVideoRtpId.map((p) => {
6752
+ const o = this.producerMap.get(n), c = o.track.getSettings(), d = i.outboundVideoRtpId.map((p) => {
6753
6753
  const f = e.outboundVideoRtp.get(p);
6754
- return f.frameHeight || (f.frameHeight = d.height, f.frameWidth = d.width, f.framesPerSecond = d.frameRate), f;
6754
+ return f.frameHeight || (f.frameHeight = c.height, f.frameWidth = c.width, f.framesPerSecond = c.frameRate), f;
6755
6755
  }), u = {
6756
6756
  producerId: n,
6757
6757
  appData: o.appData,
6758
- videoStats: c,
6758
+ videoStats: d,
6759
6759
  audioStats: i.outboundAudioRtpId.map((p) => e.outboundAudioRtp.get(p))
6760
6760
  };
6761
6761
  r.push(u);
@@ -6768,15 +6768,15 @@ class Tm extends ym {
6768
6768
  getConsumerStatsFromParsedConsumerStats(e, r, i) {
6769
6769
  let n;
6770
6770
  try {
6771
- const { peerId: o, producerId: d, appData: c } = this.consumerPeerIdMap.get(i), u = r == null ? void 0 : r.inboundVideoRtpId.map((p) => {
6771
+ const { peerId: o, producerId: c, appData: d } = this.consumerPeerIdMap.get(i), u = r == null ? void 0 : r.inboundVideoRtpId.map((p) => {
6772
6772
  const S = this.consumerMap.get(i).track.getSettings(), E = e.inboundVideoRtp.get(p);
6773
6773
  return E.frameHeight || (E.frameHeight = S.height, E.frameWidth = S.width, E.framesPerSecond = S.frameRate), E;
6774
6774
  });
6775
6775
  n = {
6776
6776
  consumerId: i,
6777
6777
  peerId: o,
6778
- producerId: d,
6779
- appData: c,
6778
+ producerId: c,
6779
+ appData: d,
6780
6780
  videoStats: u,
6781
6781
  audioStats: r == null ? void 0 : r.inboundAudioRtpId.map((p) => e.inboundAudioRtp.get(p))
6782
6782
  };
@@ -6823,12 +6823,12 @@ const X = (s, t) => (e, r, i) => {
6823
6823
  const n = i.value;
6824
6824
  return i.value = function(...o) {
6825
6825
  try {
6826
- const d = n.apply(this, o);
6827
- return d && d instanceof Promise ? d.catch((c) => {
6828
- kd(this, s, t, c);
6829
- }) : d;
6830
- } catch (d) {
6831
- kd(this, s, t, d);
6826
+ const c = n.apply(this, o);
6827
+ return c && c instanceof Promise ? c.catch((d) => {
6828
+ kd(this, s, t, d);
6829
+ }) : c;
6830
+ } catch (c) {
6831
+ kd(this, s, t, c);
6832
6832
  }
6833
6833
  return null;
6834
6834
  }, i;
@@ -6845,13 +6845,13 @@ var Y = globalThis && globalThis.__decorate || function(s, t, e, r) {
6845
6845
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
6846
6846
  n = Reflect.decorate(s, t, e, r);
6847
6847
  else
6848
- for (var d = s.length - 1; d >= 0; d--)
6849
- (o = s[d]) && (n = (i < 3 ? o(n) : i > 3 ? o(t, e, n) : o(t, e)) || n);
6848
+ for (var c = s.length - 1; c >= 0; c--)
6849
+ (o = s[c]) && (n = (i < 3 ? o(n) : i > 3 ? o(t, e, n) : o(t, e)) || n);
6850
6850
  return i > 3 && n && Object.defineProperty(t, e, n), n;
6851
6851
  };
6852
6852
  const Q = console;
6853
6853
  let J = class extends ut {
6854
- constructor(e = "https://api.testingv3.dyte.in", r = "Blink", i = Io.PROD, n, o, d, c) {
6854
+ constructor(e = "https://api.testingv3.dyte.in", r = "Blink", i = Io.PROD, n, o, c, d) {
6855
6855
  super();
6856
6856
  h(this, "observer");
6857
6857
  h(this, "eventHandler");
@@ -6869,7 +6869,7 @@ let J = class extends ut {
6869
6869
  h(this, "peerId");
6870
6870
  h(this, "consumerSharedMediaStatesMap", /* @__PURE__ */ new Map());
6871
6871
  h(this, "currentUserMediaStates", {});
6872
- switch (this.env = i, this.apiHostnames = c, this.logger = o, this.peerId = d, this.eventHandler = new vv({ logger: o, peerId: d, apiHostnames: c }), this.logger.debug("callStats::engineName: ", { engineName: r }), r) {
6872
+ switch (this.env = i, this.apiHostnames = d, this.logger = o, this.peerId = c, this.eventHandler = new vv({ logger: o, peerId: c, apiHostnames: d }), this.logger.debug("callStats::engineName: ", { engineName: r }), r) {
6873
6873
  case "Blink":
6874
6874
  this.measurements = new Dv();
6875
6875
  break;
@@ -7071,13 +7071,13 @@ let J = class extends ut {
7071
7071
  event: O.NET_QUALITY_TEST_BEGIN,
7072
7072
  timestamp: r
7073
7073
  }), new Promise((n, o) => l(this, null, function* () {
7074
- const d = [];
7074
+ const c = [];
7075
7075
  try {
7076
- for (const c of e)
7076
+ for (const d of e)
7077
7077
  try {
7078
- if (c.iceServers && c.iceServers.length > 0) {
7079
- const u = yield this.measurements.getNetworkQuality(c.iceServers);
7080
- d.push(B(D({}, c), {
7078
+ if (d.iceServers && d.iceServers.length > 0) {
7079
+ const u = yield this.measurements.getNetworkQuality(d.iceServers);
7080
+ c.push(B(D({}, d), {
7081
7081
  networkResults: u
7082
7082
  }));
7083
7083
  }
@@ -7085,10 +7085,10 @@ let J = class extends ut {
7085
7085
  console.warn("Error handling ", u);
7086
7086
  }
7087
7087
  n({
7088
- regionData: d
7088
+ regionData: c
7089
7089
  });
7090
- } catch (c) {
7091
- console.warn("Error in callstats, ", c), o(c);
7090
+ } catch (d) {
7091
+ console.warn("Error in callstats, ", d), o(d);
7092
7092
  }
7093
7093
  })).then((n) => {
7094
7094
  this.eventHandler.callEvent({
@@ -7144,13 +7144,13 @@ let J = class extends ut {
7144
7144
  let i, n;
7145
7145
  if (this.producingTransport && (i = yield this.measurements.getProcessedStats(this.producingTransport, false, true), !i || !(i != null && i.producerReport))) {
7146
7146
  this.logger.debug("callStats::sendPingStatsEvent::staleProducingTransport", { disclaimer: "Stale producer? Regenerating Stream Maps!" });
7147
- const d = yield this.measurements.getProducersReport([...this.producers.values()]);
7148
- i && d ? i.producerReport = d : (i = yield this.measurements.getProcessedStats(this.producingTransport, false, true), (!i || !(i != null && i.producerReport)) && this.logger.debug("callStats::sendPingStatsEvent::noProducingTransportReport", { disclaimer: "Stream maps invalid despite regenerating!" }));
7147
+ const c = yield this.measurements.getProducersReport([...this.producers.values()]);
7148
+ i && c ? i.producerReport = c : (i = yield this.measurements.getProcessedStats(this.producingTransport, false, true), (!i || !(i != null && i.producerReport)) && this.logger.debug("callStats::sendPingStatsEvent::noProducingTransportReport", { disclaimer: "Stream maps invalid despite regenerating!" }));
7149
7149
  }
7150
7150
  if (this.consumingTransport && (n = yield this.measurements.getProcessedStats(this.consumingTransport, true, false), !n || !n.consumerReport)) {
7151
7151
  this.logger.debug("callStats::sendPingStatsEvent::staleConsumingTransport", { disclaimer: "Stale consumer? Regenerating Stream Maps!" });
7152
- const d = yield this.measurements.getConsumersReport([...this.consumers.values()]);
7153
- n && d ? n.consumerReport = d : (n = yield this.measurements.getProcessedStats(this.consumingTransport, true, false), (!n || !n.consumerReport) && this.logger.debug("callStats::sendPingStatsEvent::noConsumingTransportReport", { disclaimer: "Stream maps invalid despite regenerating!" }));
7152
+ const c = yield this.measurements.getConsumersReport([...this.consumers.values()]);
7153
+ n && c ? n.consumerReport = c : (n = yield this.measurements.getProcessedStats(this.consumingTransport, true, false), (!n || !n.consumerReport) && this.logger.debug("callStats::sendPingStatsEvent::noConsumingTransportReport", { disclaimer: "Stream maps invalid despite regenerating!" }));
7154
7154
  }
7155
7155
  const o = {
7156
7156
  producingTransportStats: i ? i == null ? void 0 : i.transportReport : void 0,
@@ -7451,10 +7451,10 @@ class Em extends ut {
7451
7451
  h(this, "logger");
7452
7452
  }
7453
7453
  initialize(f) {
7454
- return l(this, arguments, function* ({ peerId: e, engineName: r, env: i = Io.PROD, iceServers: n, apiBase: o = "https://api.cluster.dyte.in", flags: d, logger: c = console, apiHostnames: u, skipConnectivityChecks: p = false }) {
7454
+ return l(this, arguments, function* ({ peerId: e, engineName: r, env: i = Io.PROD, iceServers: n, apiBase: o = "https://api.cluster.dyte.in", flags: c, logger: d = console, apiHostnames: u, skipConnectivityChecks: p = false }) {
7455
7455
  var S, E, _;
7456
7456
  try {
7457
- this.peerId = e, this.logger = c, this.ipInformation = yield Sh.getIPDetails({ peerId: e, apiHostnames: u, logger: c }), this.backend = new Lv(o, r, i, d, c, e, u), this.iceServers = n, (S = this.backend) == null || S.registerIceServers(this.iceServers), this.initialized = true, (_ = (E = this.backend) == null ? void 0 : E.eventHandler) == null || _.emit("initialized", this.ipInformation), this.emit("initialized", this.ipInformation), this.startPreCallTest(p);
7457
+ this.peerId = e, this.logger = d, this.ipInformation = yield Sh.getIPDetails({ peerId: e, apiHostnames: u, logger: d }), this.backend = new Lv(o, r, i, c, d, e, u), this.iceServers = n, (S = this.backend) == null || S.registerIceServers(this.iceServers), this.initialized = true, (_ = (E = this.backend) == null ? void 0 : E.eventHandler) == null || _.emit("initialized", this.ipInformation), this.emit("initialized", this.ipInformation), this.startPreCallTest(p);
7458
7458
  } catch (P) {
7459
7459
  this.logger.error("callStats::CallStatsIntegration: ", { error: P }), this.stallCallStats();
7460
7460
  }
@@ -7712,7 +7712,7 @@ class Em extends ut {
7712
7712
  ivsPlayerEvent(e, r) {
7713
7713
  const i = new Date();
7714
7714
  this.onSafeInitialization(() => {
7715
- var n, o, d, c, u, p, f, S, E, _, P;
7715
+ var n, o, c, d, u, p, f, S, E, _, P;
7716
7716
  switch (e) {
7717
7717
  case "PlayerRebuffering":
7718
7718
  (n = this.backend) == null || n.sendIVSPlayerRebufferEvent(i);
@@ -7721,10 +7721,10 @@ class Em extends ut {
7721
7721
  (o = this.backend) == null || o.sendIVSPlayerAudioBlockEvent(i);
7722
7722
  break;
7723
7723
  case "PlayerPlaybackBlocked":
7724
- (d = this.backend) == null || d.sendIVSPlayerPlaybackBlockedEvent(i);
7724
+ (c = this.backend) == null || c.sendIVSPlayerPlaybackBlockedEvent(i);
7725
7725
  break;
7726
7726
  case "PlayerNetworkUnavailable":
7727
- (c = this.backend) == null || c.sendIVSPlayerNetworkUnavailableEvent(i);
7727
+ (d = this.backend) == null || d.sendIVSPlayerNetworkUnavailableEvent(i);
7728
7728
  break;
7729
7729
  case "PlayerInitialized":
7730
7730
  (u = this.backend) == null || u.sendIVSPlayerInitializedEvent(i);
@@ -8038,8 +8038,8 @@ function qc(s, t, e, r) {
8038
8038
  var i = !e;
8039
8039
  e || (e = {});
8040
8040
  for (var n = -1, o = t.length; ++n < o; ) {
8041
- var d = t[n], c = r ? r(e[d], s[d], d, e, s) : void 0;
8042
- c === void 0 && (c = s[d]), i ? yh(e, d, c) : Cm(e, d, c);
8041
+ var c = t[n], d = r ? r(e[c], s[c], c, e, s) : void 0;
8042
+ d === void 0 && (d = s[c]), i ? yh(e, c, d) : Cm(e, c, d);
8043
8043
  }
8044
8044
  return e;
8045
8045
  }
@@ -8100,10 +8100,10 @@ var hp = Gn && Gn.isTypedArray, NT = hp ? Th(hp) : MT;
8100
8100
  const Hl = NT;
8101
8101
  var LT = Object.prototype, VT = LT.hasOwnProperty;
8102
8102
  function Am(s, t) {
8103
- var e = ti(s), r = !e && Ad(s), i = !e && !r && jn(s), n = !e && !r && !i && Hl(s), o = e || r || i || n, d = o ? Ky(s.length, String) : [], c = d.length;
8103
+ var e = ti(s), r = !e && Ad(s), i = !e && !r && jn(s), n = !e && !r && !i && Hl(s), o = e || r || i || n, c = o ? Ky(s.length, String) : [], d = c.length;
8104
8104
  for (var u in s)
8105
- (t || VT.call(s, u)) && !(o && (u == "length" || i && (u == "offset" || u == "parent") || n && (u == "buffer" || u == "byteLength" || u == "byteOffset") || bm(u, c))) && d.push(u);
8106
- return d;
8105
+ (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);
8106
+ return c;
8107
8107
  }
8108
8108
  var xT = Object.prototype;
8109
8109
  function Bl(s) {
@@ -8337,26 +8337,26 @@ var ZE = 1, e_ = 2, t_ = 4, Bm = "[object Arguments]", s_ = "[object Array]", r_
8337
8337
  fe[Bm] = fe[s_] = fe[g_] = fe[m_] = fe[r_] = fe[i_] = fe[f_] = fe[S_] = fe[v_] = fe[y_] = fe[T_] = fe[o_] = fe[c_] = fe[jm] = fe[d_] = fe[l_] = fe[u_] = fe[h_] = fe[E_] = fe[__] = fe[P_] = fe[C_] = true;
8338
8338
  fe[a_] = fe[qm] = fe[p_] = false;
8339
8339
  function ud(s, t, e, r, i, n) {
8340
- var o, d = t & ZE, c = t & e_, u = t & t_;
8340
+ var o, c = t & ZE, d = t & e_, u = t & t_;
8341
8341
  if (e && (o = i ? e(s, r, i, n) : e(s)), o !== void 0)
8342
8342
  return o;
8343
8343
  if (!Cs(s))
8344
8344
  return s;
8345
8345
  var p = ti(s);
8346
8346
  if (p) {
8347
- if (o = SE(s), !d)
8347
+ if (o = SE(s), !c)
8348
8348
  return Lm(s, o);
8349
8349
  } else {
8350
8350
  var f = Wn(s), S = f == qm || f == n_;
8351
8351
  if (jn(s))
8352
- return Nm(s, d);
8352
+ return Nm(s, c);
8353
8353
  if (f == jm || f == Bm || S && !i) {
8354
- if (o = c || S ? {} : Hm(s), !d)
8355
- return c ? rE(s, JT(o, s)) : ZT(s, BT(o, s));
8354
+ if (o = d || S ? {} : Hm(s), !c)
8355
+ return d ? rE(s, JT(o, s)) : ZT(s, BT(o, s));
8356
8356
  } else {
8357
8357
  if (!fe[f])
8358
8358
  return i ? s : {};
8359
- o = BE(s, f, d);
8359
+ o = BE(s, f, c);
8360
8360
  }
8361
8361
  }
8362
8362
  n || (n = new xs());
@@ -8368,7 +8368,7 @@ function ud(s, t, e, r, i, n) {
8368
8368
  }) : KE(s) && s.forEach(function(k, A) {
8369
8369
  o.set(A, ud(k, t, e, A, s, n));
8370
8370
  });
8371
- var _ = u ? c ? iE : yu : c ? Gc : Eh, P = p ? void 0 : _(s);
8371
+ var _ = u ? d ? iE : yu : d ? Gc : Eh, P = p ? void 0 : _(s);
8372
8372
  return jy(P || s, function(k, A) {
8373
8373
  P && (A = k, k = s[A]), Cm(o, A, ud(k, t, e, A, s, n));
8374
8374
  }), o;
@@ -8521,7 +8521,7 @@ var Wm = class {
8521
8521
  h(this, "environmentKey", null);
8522
8522
  this.environmentKey = s;
8523
8523
  }
8524
- identifyAndFetchFlagsWithRetry(d) {
8524
+ identifyAndFetchFlagsWithRetry(c) {
8525
8525
  return l(this, arguments, function* ({
8526
8526
  primaryEndpoint: s,
8527
8527
  secondaryEndpoint: t,
@@ -8531,7 +8531,7 @@ var Wm = class {
8531
8531
  traitsObj: n,
8532
8532
  logger: o
8533
8533
  }) {
8534
- const c = JSON.parse(JSON.stringify(n)), u = Object.entries(c).map((f) => ({
8534
+ const d = JSON.parse(JSON.stringify(n)), u = Object.entries(d).map((f) => ({
8535
8535
  trait_key: f[0],
8536
8536
  trait_value: f[1]
8537
8537
  })), p = [s, t, t];
@@ -8596,38 +8596,38 @@ var $_ = (s, t, e) => {
8596
8596
  if (t == 0)
8597
8597
  r = i = n = e;
8598
8598
  else {
8599
- const o = (u, p, f) => (f < 0 && (f += 1), f > 1 && (f -= 1), f < 0.16666666666666666 ? u + (p - u) * 6 * f : f < 0.5 ? p : f < 0.6666666666666666 ? u + (p - u) * (0.6666666666666666 - f) * 6 : u), d = e < 0.5 ? e * (1 + t) : e + t - e * t, c = 2 * e - d;
8600
- r = o(c, d, s + 1 / 3), i = o(c, d, s), n = o(c, d, s - 1 / 3);
8599
+ const o = (u, p, f) => (f < 0 && (f += 1), f > 1 && (f -= 1), f < 0.16666666666666666 ? u + (p - u) * 6 * f : f < 0.5 ? p : f < 0.6666666666666666 ? u + (p - u) * (0.6666666666666666 - f) * 6 : u), c = e < 0.5 ? e * (1 + t) : e + t - e * t, d = 2 * e - c;
8600
+ r = o(d, c, s + 1 / 3), i = o(d, c, s), n = o(d, c, s - 1 / 3);
8601
8601
  }
8602
8602
  return [Math.round(r * 255), Math.round(i * 255), Math.round(n * 255)];
8603
8603
  }, F_ = (s, t, e) => {
8604
8604
  s /= 255, t /= 255, e /= 255;
8605
8605
  const r = Math.max(s, t, e), i = Math.min(s, t, e);
8606
8606
  let n, o;
8607
- const d = (r + i) / 2;
8607
+ const c = (r + i) / 2;
8608
8608
  if (r == i)
8609
8609
  n = o = 0;
8610
8610
  else {
8611
- const c = r - i;
8612
- switch (o = d > 0.5 ? c / (2 - r - i) : c / (r + i), r) {
8611
+ const d = r - i;
8612
+ switch (o = c > 0.5 ? d / (2 - r - i) : d / (r + i), r) {
8613
8613
  case s:
8614
- n = (t - e) / c + (t < e ? 6 : 0);
8614
+ n = (t - e) / d + (t < e ? 6 : 0);
8615
8615
  break;
8616
8616
  case t:
8617
- n = (e - s) / c + 2;
8617
+ n = (e - s) / d + 2;
8618
8618
  break;
8619
8619
  case e:
8620
- n = (s - t) / c + 4;
8620
+ n = (s - t) / d + 4;
8621
8621
  break;
8622
8622
  }
8623
8623
  n /= 6;
8624
8624
  }
8625
- return [n, o, d];
8625
+ return [n, o, c];
8626
8626
  }, H_ = (s, t, e) => {
8627
8627
  const r = (i) => i.toString(16).padStart(2, "0");
8628
8628
  return `#${r(s)}${r(t)}${r(e)}`;
8629
8629
  }, Km = (s, t = Jm, e = 0.4) => {
8630
- const r = [], [i, n, o] = U_(s), [d, c, u] = F_(i, n, o), p = Math.round(u * 100);
8630
+ const r = [], [i, n, o] = U_(s), [c, d, u] = F_(i, n, o), p = Math.round(u * 100);
8631
8631
  p > 70 ? e = 0.8 : p > 60 ? e = 0.9 : p < 10 ? e = 0.075 : p < 42 && (e = 0.3);
8632
8632
  const f = t.findIndex((k) => k === 0);
8633
8633
  if (f === -1)
@@ -8636,7 +8636,7 @@ var $_ = (s, t, e) => {
8636
8636
  for (const k of t) {
8637
8637
  let A;
8638
8638
  k < 0 ? A = p + k * P * e : k > 0 ? A = p + k * _ * e : A = p;
8639
- const [N, H, $] = $_(d, c, A / 100);
8639
+ const [N, H, $] = $_(c, d, A / 100);
8640
8640
  r.push(H_(N, H, $));
8641
8641
  }
8642
8642
  return r;
@@ -9056,14 +9056,14 @@ const Jh = class extends ut.EventEmitter {
9056
9056
  }
9057
9057
  onAsync(e, r) {
9058
9058
  const i = a(this, js), n = (...o) => l(this, null, function* () {
9059
- var c;
9059
+ var d;
9060
9060
  try {
9061
9061
  yield r(...o);
9062
9062
  } catch (u) {
9063
9063
  this.logger.error("[onAsync]", { error: u });
9064
9064
  }
9065
- const d = (c = i.get(e)) == null ? void 0 : c.shift();
9066
- d == null || d();
9065
+ const c = (d = i.get(e)) == null ? void 0 : d.shift();
9066
+ c == null || c();
9067
9067
  });
9068
9068
  return a(this, Gs).get(e) || a(this, Gs).set(e, []), a(this, Gs).get(e).push(n), super.on(e, n);
9069
9069
  }
@@ -9150,9 +9150,9 @@ function hP(s, t, e) {
9150
9150
  for (var r = arguments, i = -1, n = Ap(r.length - t, 0), o = Array(n); ++i < n; )
9151
9151
  o[i] = r[t + i];
9152
9152
  i = -1;
9153
- for (var d = Array(t + 1); ++i < t; )
9154
- d[i] = r[i];
9155
- return d[t] = e(o), sP(s, this, d);
9153
+ for (var c = Array(t + 1); ++i < t; )
9154
+ c[i] = r[i];
9155
+ return c[t] = e(o), sP(s, this, c);
9156
9156
  };
9157
9157
  }
9158
9158
  function pP(s, t) {
@@ -9168,8 +9168,8 @@ function mP(s) {
9168
9168
  return pP(function(t, e) {
9169
9169
  var r = -1, i = e.length, n = i > 1 ? e[i - 1] : void 0, o = i > 2 ? e[2] : void 0;
9170
9170
  for (n = s.length > 3 && typeof n == "function" ? (i--, n) : void 0, o && gP(e[0], e[1], o) && (n = i < 3 ? void 0 : n, i = 1), t = Object(t); ++r < i; ) {
9171
- var d = e[r];
9172
- d && s(t, d, r, n);
9171
+ var c = e[r];
9172
+ c && s(t, c, r, n);
9173
9173
  }
9174
9174
  return t;
9175
9175
  });
@@ -9209,14 +9209,14 @@ function wP(s, t) {
9209
9209
  }
9210
9210
  var bP = 1, kP = 2;
9211
9211
  function Zm(s, t, e, r, i, n) {
9212
- var o = e & bP, d = s.length, c = t.length;
9213
- if (d != c && !(o && c > d))
9212
+ var o = e & bP, c = s.length, d = t.length;
9213
+ if (c != d && !(o && d > c))
9214
9214
  return false;
9215
9215
  var u = n.get(s), p = n.get(t);
9216
9216
  if (u && p)
9217
9217
  return u == t && p == s;
9218
9218
  var f = -1, S = true, E = e & kP ? new Dd() : void 0;
9219
- for (n.set(s, t), n.set(t, s); ++f < d; ) {
9219
+ for (n.set(s, t), n.set(t, s); ++f < c; ) {
9220
9220
  var _ = s[f], P = t[f];
9221
9221
  if (r)
9222
9222
  var k = o ? r(P, _, f, t, s, n) : r(_, P, f, s, t, n);
@@ -9272,16 +9272,16 @@ function jP(s, t, e, r, i, n, o) {
9272
9272
  case FP:
9273
9273
  return s == t + "";
9274
9274
  case VP:
9275
- var d = IP;
9275
+ var c = IP;
9276
9276
  case $P:
9277
- var c = r & MP;
9278
- if (d || (d = AP), s.size != t.size && !c)
9277
+ var d = r & MP;
9278
+ if (c || (c = AP), s.size != t.size && !d)
9279
9279
  return false;
9280
9280
  var u = o.get(s);
9281
9281
  if (u)
9282
9282
  return u == t;
9283
9283
  r |= DP, o.set(s, t);
9284
- var p = Zm(d(s), d(t), r, i, n, o);
9284
+ var p = Zm(c(s), c(t), r, i, n, o);
9285
9285
  return o.delete(s), p;
9286
9286
  case HP:
9287
9287
  if (nu)
@@ -9291,11 +9291,11 @@ function jP(s, t, e, r, i, n, o) {
9291
9291
  }
9292
9292
  var GP = 1, WP = Object.prototype, JP = WP.hasOwnProperty;
9293
9293
  function KP(s, t, e, r, i, n) {
9294
- var o = e & GP, d = yu(s), c = d.length, u = yu(t), p = u.length;
9295
- if (c != p && !o)
9294
+ var o = e & GP, c = yu(s), d = c.length, u = yu(t), p = u.length;
9295
+ if (d != p && !o)
9296
9296
  return false;
9297
- for (var f = c; f--; ) {
9298
- var S = d[f];
9297
+ for (var f = d; f--; ) {
9298
+ var S = c[f];
9299
9299
  if (!(o ? S in t : JP.call(t, S)))
9300
9300
  return false;
9301
9301
  }
@@ -9304,8 +9304,8 @@ function KP(s, t, e, r, i, n) {
9304
9304
  return E == t && _ == s;
9305
9305
  var P = true;
9306
9306
  n.set(s, t), n.set(t, s);
9307
- for (var k = o; ++f < c; ) {
9308
- S = d[f];
9307
+ for (var k = o; ++f < d; ) {
9308
+ S = c[f];
9309
9309
  var A = s[S], N = t[S];
9310
9310
  if (r)
9311
9311
  var H = o ? r(N, A, S, t, s, n) : r(A, N, S, s, t, n);
@@ -9323,16 +9323,16 @@ function KP(s, t, e, r, i, n) {
9323
9323
  }
9324
9324
  var zP = 1, Dp = "[object Arguments]", Op = "[object Array]", ed = "[object Object]", YP = Object.prototype, Np = YP.hasOwnProperty;
9325
9325
  function QP(s, t, e, r, i, n) {
9326
- var o = ti(s), d = ti(t), c = o ? Op : Wn(s), u = d ? Op : Wn(t);
9327
- c = c == Dp ? ed : c, u = u == Dp ? ed : u;
9328
- var p = c == ed, f = u == ed, S = c == u;
9326
+ var o = ti(s), c = ti(t), d = o ? Op : Wn(s), u = c ? Op : Wn(t);
9327
+ d = d == Dp ? ed : d, u = u == Dp ? ed : u;
9328
+ var p = d == ed, f = u == ed, S = d == u;
9329
9329
  if (S && jn(s)) {
9330
9330
  if (!jn(t))
9331
9331
  return false;
9332
9332
  o = true, p = false;
9333
9333
  }
9334
9334
  if (S && !p)
9335
- return n || (n = new xs()), o || Hl(s) ? Zm(s, t, e, r, i, n) : jP(s, t, c, e, r, i, n);
9335
+ return n || (n = new xs()), o || Hl(s) ? Zm(s, t, e, r, i, n) : jP(s, t, d, e, r, i, n);
9336
9336
  if (!(e & zP)) {
9337
9337
  var E = p && Np.call(s, "__wrapped__"), _ = f && Np.call(t, "__wrapped__");
9338
9338
  if (E || _) {
@@ -9347,9 +9347,9 @@ function ef(s, t, e, r, i) {
9347
9347
  }
9348
9348
  function XP(s) {
9349
9349
  return function(t, e, r) {
9350
- for (var i = -1, n = Object(t), o = r(t), d = o.length; d--; ) {
9351
- var c = o[s ? d : ++i];
9352
- if (e(n[c], c, n) === false)
9350
+ for (var i = -1, n = Object(t), o = r(t), c = o.length; c--; ) {
9351
+ var d = o[s ? c : ++i];
9352
+ if (e(n[d], d, n) === false)
9353
9353
  break;
9354
9354
  }
9355
9355
  return t;
@@ -9363,7 +9363,7 @@ var tC = function() {
9363
9363
  const ou = tC;
9364
9364
  var sC = "Expected a function", rC = Math.max, iC = Math.min;
9365
9365
  function bh(s, t, e) {
9366
- var r, i, n, o, d, c, u = 0, p = false, f = false, S = true;
9366
+ var r, i, n, o, c, d, u = 0, p = false, f = false, S = true;
9367
9367
  if (typeof s != "function")
9368
9368
  throw new TypeError(sC);
9369
9369
  t = Ip(t) || 0, Cs(e) && (p = !!e.leading, f = "maxWait" in e, n = f ? rC(Ip(e.maxWait) || 0, t) : n, S = "trailing" in e ? !!e.trailing : S);
@@ -9372,40 +9372,40 @@ function bh(s, t, e) {
9372
9372
  return r = i = void 0, u = K, o = s.apply(Je, re), o;
9373
9373
  }
9374
9374
  function _(K) {
9375
- return u = K, d = setTimeout(A, t), p ? E(K) : o;
9375
+ return u = K, c = setTimeout(A, t), p ? E(K) : o;
9376
9376
  }
9377
9377
  function P(K) {
9378
- var re = K - c, Je = K - u, Is = t - re;
9378
+ var re = K - d, Je = K - u, Is = t - re;
9379
9379
  return f ? iC(Is, n - Je) : Is;
9380
9380
  }
9381
9381
  function k(K) {
9382
- var re = K - c, Je = K - u;
9383
- return c === void 0 || re >= t || re < 0 || f && Je >= n;
9382
+ var re = K - d, Je = K - u;
9383
+ return d === void 0 || re >= t || re < 0 || f && Je >= n;
9384
9384
  }
9385
9385
  function A() {
9386
9386
  var K = ou();
9387
9387
  if (k(K))
9388
9388
  return N(K);
9389
- d = setTimeout(A, P(K));
9389
+ c = setTimeout(A, P(K));
9390
9390
  }
9391
9391
  function N(K) {
9392
- return d = void 0, S && r ? E(K) : (r = i = void 0, o);
9392
+ return c = void 0, S && r ? E(K) : (r = i = void 0, o);
9393
9393
  }
9394
9394
  function H() {
9395
- d !== void 0 && clearTimeout(d), u = 0, r = c = i = d = void 0;
9395
+ c !== void 0 && clearTimeout(c), u = 0, r = d = i = c = void 0;
9396
9396
  }
9397
9397
  function $() {
9398
- return d === void 0 ? o : N(ou());
9398
+ return c === void 0 ? o : N(ou());
9399
9399
  }
9400
9400
  function F() {
9401
9401
  var K = ou(), re = k(K);
9402
- if (r = arguments, i = this, c = K, re) {
9403
- if (d === void 0)
9404
- return _(c);
9402
+ if (r = arguments, i = this, d = K, re) {
9403
+ if (c === void 0)
9404
+ return _(d);
9405
9405
  if (f)
9406
- return clearTimeout(d), d = setTimeout(A, t), E(c);
9406
+ return clearTimeout(c), c = setTimeout(A, t), E(d);
9407
9407
  }
9408
- return d === void 0 && (d = setTimeout(A, t)), o;
9408
+ return c === void 0 && (c = setTimeout(A, t)), o;
9409
9409
  }
9410
9410
  return F.cancel = H, F.flush = $, F;
9411
9411
  }
@@ -9423,25 +9423,25 @@ function nC(s) {
9423
9423
  return qc(s, Gc(s));
9424
9424
  }
9425
9425
  function oC(s, t, e, r, i, n, o) {
9426
- var d = wu(s, e), c = wu(t, e), u = o.get(c);
9426
+ var c = wu(s, e), d = wu(t, e), u = o.get(d);
9427
9427
  if (u) {
9428
9428
  Ru(s, e, u);
9429
9429
  return;
9430
9430
  }
9431
- var p = n ? n(d, c, e + "", s, t, o) : void 0, f = p === void 0;
9431
+ var p = n ? n(c, d, e + "", s, t, o) : void 0, f = p === void 0;
9432
9432
  if (f) {
9433
- var S = ti(c), E = !S && jn(c), _ = !S && !E && Hl(c);
9434
- p = c, S || E || _ ? ti(d) ? p = d : aC(d) ? p = Lm(d) : E ? (f = false, p = Nm(c, true)) : _ ? (f = false, p = Fm(c, true)) : p = [] : EP(c) || Ad(c) ? (p = d, Ad(d) ? p = nC(d) : (!Cs(d) || vh(d)) && (p = Hm(c))) : f = false;
9433
+ var S = ti(d), E = !S && jn(d), _ = !S && !E && Hl(d);
9434
+ 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) || Ad(d) ? (p = c, Ad(c) ? p = nC(c) : (!Cs(c) || vh(c)) && (p = Hm(d))) : f = false;
9435
9435
  }
9436
- f && (o.set(c, p), i(p, c, r, n, o), o.delete(c)), Ru(s, e, p);
9436
+ f && (o.set(d, p), i(p, d, r, n, o), o.delete(d)), Ru(s, e, p);
9437
9437
  }
9438
9438
  function tf(s, t, e, r, i) {
9439
9439
  s !== t && eC(t, function(n, o) {
9440
9440
  if (i || (i = new xs()), Cs(n))
9441
9441
  oC(s, t, o, e, tf, r, i);
9442
9442
  else {
9443
- var d = r ? r(wu(s, o), n, o + "", s, t, i) : void 0;
9444
- d === void 0 && (d = n), Ru(s, o, d);
9443
+ var c = r ? r(wu(s, o), n, o + "", s, t, i) : void 0;
9444
+ c === void 0 && (c = n), Ru(s, o, c);
9445
9445
  }
9446
9446
  }, Gc);
9447
9447
  }
@@ -9573,11 +9573,11 @@ function sf(s, t, e = {}) {
9573
9573
  function Lp(s, t, e = {}, r = "") {
9574
9574
  const i = {};
9575
9575
  try {
9576
- const n = JSON.stringify(e), o = JSON.parse(n), d = sf(
9576
+ const n = JSON.stringify(e), o = JSON.parse(n), c = sf(
9577
9577
  o,
9578
9578
  r
9579
- ), c = JSON.stringify(d);
9580
- return JSON.parse(c);
9579
+ ), d = JSON.stringify(c);
9580
+ return JSON.parse(d);
9581
9581
  } catch (n) {
9582
9582
  const o = hd(n);
9583
9583
  i[`${r}.error.message`] = o.message || "", i[`${r}.error.stack`] = o.stack || "", i[`${r}.error.reason`] = o.reason || "", i[`${r}.error.source`] = "safelyFlattenObjForOpenTelemetry";
@@ -9711,13 +9711,13 @@ const TC = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d=
9711
9711
  static trace(t, e = void 0) {
9712
9712
  return (r, i, n) => {
9713
9713
  const o = n.value;
9714
- return n.value = function(...c) {
9714
+ return n.value = function(...d) {
9715
9715
  var S;
9716
9716
  const u = this == null ? void 0 : this.telemetry;
9717
9717
  if (!u || !u.initialized || navigator.isReactNative || !u.tracingEnabled || (S = ur.getContext(u.meetingMetadata.peerId)) != null && S.getValue("flagsmith").hasFeature(Z.SKIP_OTEL_TRACES))
9718
- return o.apply(this, c);
9718
+ return o.apply(this, d);
9719
9719
  u.addLogInCurrentSpan("info", t, e);
9720
- const p = performance.now(), f = o.apply(this, c);
9720
+ const p = performance.now(), f = o.apply(this, d);
9721
9721
  return Promise.resolve(f).then(() => {
9722
9722
  const E = performance.now();
9723
9723
  E - p > 10 && u.addLogInCurrentSpan("info", `${t}_timing`, {
@@ -9748,25 +9748,25 @@ const TC = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d=
9748
9748
  r
9749
9749
  )), !!fC(n, t))
9750
9750
  try {
9751
- const d = Lp(
9751
+ const c = Lp(
9752
9752
  n,
9753
9753
  e,
9754
9754
  r,
9755
9755
  "metadata"
9756
- ), c = new Date(), u = B(D({
9756
+ ), d = new Date(), u = B(D({
9757
9757
  message: e,
9758
9758
  level: t
9759
- }, d), {
9760
- loggedAt: c.toISOString(),
9761
- loggedAtTzOffset: c.getTimezoneOffset()
9759
+ }, c), {
9760
+ loggedAt: d.toISOString(),
9761
+ loggedAtTzOffset: d.getTimezoneOffset()
9762
9762
  });
9763
9763
  i ? this.sendOtelLogsToNewRelic([u]) : this.logsCache.push(u);
9764
- } catch (d) {
9764
+ } catch (c) {
9765
9765
  this.addLogInCurrentSpan(
9766
9766
  "error",
9767
9767
  "opentelemetry::addLogInCurrentSpan_failed",
9768
9768
  {
9769
- error: hd(d)
9769
+ error: hd(c)
9770
9770
  }
9771
9771
  );
9772
9772
  }
@@ -9986,11 +9986,11 @@ ${this.message}`;
9986
9986
  r && r.endsWith("00") && i && (o = true), o && i.error("DyteError", {
9987
9987
  error: { message: this.message, name: this.name, code: r }
9988
9988
  });
9989
- const d = ur.getContext(ur.getMostRecentPeerId());
9990
- if (d) {
9991
- const c = d.getValue("onError");
9989
+ const c = ur.getContext(ur.getMostRecentPeerId());
9990
+ if (c) {
9991
+ const d = c.getValue("onError");
9992
9992
  try {
9993
- c(this);
9993
+ d(this);
9994
9994
  } catch (u) {
9995
9995
  }
9996
9996
  }
@@ -10022,8 +10022,8 @@ function Vp(s, t, e) {
10022
10022
  }), n && (s.set = function(o) {
10023
10023
  try {
10024
10024
  return n.apply(this, [o]);
10025
- } catch (d) {
10026
- sd(this, t, e, d);
10025
+ } catch (c) {
10026
+ sd(this, t, e, c);
10027
10027
  }
10028
10028
  }), s;
10029
10029
  }
@@ -10227,10 +10227,10 @@ function kC(s, t = 2) {
10227
10227
  return s.replace(/[^\u00BF-\u1FFF\u2C00-\uD7FF\w\s]/g, "").trim().split(/\s+/).slice(0, t).map((i) => i.charAt(0)).join("").toUpperCase();
10228
10228
  }
10229
10229
  const xp = 1080, Up = 1920, IC = (s, t, e, r, i, n) => {
10230
- let o = 0.5, d = 0.5;
10231
- const c = i, u = n, p = Math.min(e / c, r / u);
10232
- let f = c * p, S = u * p, E, _, P, k, A = 1;
10233
- return f < e && (A = e / f), Math.abs(A - 1) < 1e-14 && S < r && (A = r / S), f *= A, S *= A, P = c / (f / e), k = u / (S / r), E = (c - P) * o, _ = (u - k) * d, E < 0 && (E = 0), _ < 0 && (_ = 0), P > c && (P = c), k > u && (k = u), [E, _, P, k, s, t, e, r];
10230
+ let o = 0.5, c = 0.5;
10231
+ const d = i, u = n, p = Math.min(e / d, r / u);
10232
+ let f = d * p, S = u * p, E, _, P, k, A = 1;
10233
+ 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];
10234
10234
  };
10235
10235
  var Kt, Si, st, zt, be, ds, Ws, mt, Oe, Fa, Ha, Js, Ba;
10236
10236
  const zh = class extends qt {
@@ -10375,7 +10375,7 @@ const zh = class extends qt {
10375
10375
  drawEmptyTile(e, r, i, n) {
10376
10376
  if (a(this, Kt) === void 0)
10377
10377
  return;
10378
- const o = a(this, Kt).getContext("2d"), d = a(this, Kt).width, c = 0, u = 0, p = r - c * 2, f = i - c * 2, S = Math.floor(d / p), E = Math.floor(e / S), P = e % S * (p + c) + c, k = E * (f + c) + c, { displayText: A, image: N } = n != null ? n : {};
10378
+ const o = a(this, Kt).getContext("2d"), c = a(this, Kt).width, d = 0, u = 0, p = r - d * 2, f = i - d * 2, S = Math.floor(c / p), E = Math.floor(e / S), P = e % S * (p + d) + d, k = E * (f + d) + d, { displayText: A, image: N } = n != null ? n : {};
10379
10379
  o.fillStyle = A || N ? a(this, ds).videoBackground : a(this, ds).background, o.strokeStyle = a(this, ds).brand, o.beginPath(), o.moveTo(P + u, k), o.arcTo(P + p, k, P + p, k + u, u), o.arcTo(
10380
10380
  P + p,
10381
10381
  k + f,
@@ -10393,23 +10393,23 @@ const zh = class extends qt {
10393
10393
  ), o.restore()) : A && (o.fillStyle = a(this, ds).textOnBrand, o.font = `${H / 2}px sans-serif`, o.textAlign = "center", o.textBaseline = "middle", o.fillText(A, $, F)), this.drawIcons(n, P, k, Math.max(p, f)));
10394
10394
  }
10395
10395
  drawIcons(e, r, i, n) {
10396
- const o = Math.min(Math.max(n * 0.15, 100), 200), d = o * 0.2, c = o * 0.2;
10397
- let u = r + d;
10398
- const p = i + d, f = (S) => {
10396
+ const o = Math.min(Math.max(n * 0.15, 100), 200), c = o * 0.2, d = o * 0.2;
10397
+ let u = r + c;
10398
+ const p = i + c, f = (S) => {
10399
10399
  const E = a(this, Kt).getContext("2d");
10400
- E.save(), E.fillStyle = a(this, ds).background, E.beginPath(), E.moveTo(u + c, p), E.arcTo(u + o, p, u + o, p + c, c), E.arcTo(
10400
+ E.save(), E.fillStyle = a(this, ds).background, E.beginPath(), E.moveTo(u + d, p), E.arcTo(u + o, p, u + o, p + d, d), E.arcTo(
10401
10401
  u + o,
10402
10402
  p + o,
10403
- u + o - c,
10403
+ u + o - d,
10404
10404
  p + o,
10405
- c
10406
- ), E.arcTo(u, p + o, u, p + o - c, c), E.arcTo(u, p, u + c, p, c), E.closePath(), E.fill(), typeof S == "string" ? (E.font = `${o / 1.5}px sans-serif`, E.fillStyle = a(this, ds).text, E.textAlign = "center", E.textBaseline = "top", E.fillText(S, o / 2 + u, p + d)) : E.drawImage(
10405
+ d
10406
+ ), E.arcTo(u, p + o, u, p + o - d, d), E.arcTo(u, p, u + d, p, d), E.closePath(), E.fill(), typeof S == "string" ? (E.font = `${o / 1.5}px sans-serif`, E.fillStyle = a(this, ds).text, E.textAlign = "center", E.textBaseline = "top", E.fillText(S, o / 2 + u, p + c)) : E.drawImage(
10407
10407
  S,
10408
- u + d,
10409
- p + d,
10410
- o - d * 2,
10411
- o - d * 2
10412
- ), u += o + d, E.restore();
10408
+ u + c,
10409
+ p + c,
10410
+ o - c * 2,
10411
+ o - c * 2
10412
+ ), u += o + c, E.restore();
10413
10413
  };
10414
10414
  e.pinned && f(a(this, Fa)), e.handRaised && f(a(this, Ha));
10415
10415
  }
@@ -10418,25 +10418,25 @@ const zh = class extends qt {
10418
10418
  if (a(this, Kt) === void 0)
10419
10419
  return;
10420
10420
  const n = a(this, Kt).getContext("2d"), o = this.getSources();
10421
- let d = 0, c = 0;
10422
- for (; d < a(this, be).height - 5; ) {
10421
+ let c = 0, d = 0;
10422
+ for (; c < a(this, be).height - 5; ) {
10423
10423
  let f = 0;
10424
- for (; f < a(this, be).width - 5 && c < i; ) {
10425
- if ((u = o[c]) != null && u.enabled) {
10426
- const S = o[c].element, [E, _, P, k, A, N, H, $] = IC(
10424
+ for (; f < a(this, be).width - 5 && d < i; ) {
10425
+ if ((u = o[d]) != null && u.enabled) {
10426
+ const S = o[d].element, [E, _, P, k, A, N, H, $] = IC(
10427
10427
  f,
10428
- d,
10428
+ c,
10429
10429
  e,
10430
10430
  r,
10431
10431
  S.videoWidth,
10432
10432
  S.videoHeight
10433
10433
  );
10434
- ((p = S == null ? void 0 : S.classList) == null ? void 0 : p.contains("mirror")) ? (n.save(), n.scale(-1, 1), n.drawImage(S, E, _, P, k, -1 * A, N, -1 * H, $), n.restore()) : n.drawImage(S, E, _, P, k, A, N, H, $), this.drawIcons(o[c], A, N, Math.max(H, $));
10434
+ ((p = S == null ? void 0 : S.classList) == null ? void 0 : p.contains("mirror")) ? (n.save(), n.scale(-1, 1), n.drawImage(S, E, _, P, k, -1 * A, N, -1 * H, $), n.restore()) : n.drawImage(S, E, _, P, k, A, N, H, $), this.drawIcons(o[d], A, N, Math.max(H, $));
10435
10435
  } else
10436
- this.drawEmptyTile(c, e, r, o[c]);
10437
- c += 1, f += e;
10436
+ this.drawEmptyTile(d, e, r, o[d]);
10437
+ d += 1, f += e;
10438
10438
  }
10439
- d += r;
10439
+ c += r;
10440
10440
  }
10441
10441
  }
10442
10442
  calcGridElemSize(e) {
@@ -10527,11 +10527,11 @@ const zh = class extends qt {
10527
10527
  }
10528
10528
  });
10529
10529
  }
10530
- addSource(e, r, i, n = false, o = void 0, d = void 0, c = false) {
10530
+ addSource(e, r, i, n = false, o = void 0, c = void 0, d = false) {
10531
10531
  this.logger.debug("DytePIP::AddSource", {
10532
10532
  pip: {
10533
10533
  id: e,
10534
- handRaised: c
10534
+ handRaised: d
10535
10535
  }
10536
10536
  }), a(this, mt)[e] = {
10537
10537
  id: e,
@@ -10539,9 +10539,9 @@ const zh = class extends qt {
10539
10539
  enabled: i,
10540
10540
  pinned: n,
10541
10541
  displayText: o ? kC(o) : void 0,
10542
- imageUrl: d,
10543
- handRaised: c
10544
- }, d && this.generateAvatar(e, d);
10542
+ imageUrl: c,
10543
+ handRaised: d
10544
+ }, c && this.generateAvatar(e, c);
10545
10545
  }
10546
10546
  updateSource(e, r) {
10547
10547
  this.logger.info("DytePIP::UpdateSource", {
@@ -15266,10 +15266,10 @@ const xu = (Pg = class {
15266
15266
  const o = yield a(this, wr).sendMessagePromise(
15267
15267
  pi.createChatChannel,
15268
15268
  gI.toBinary(n)
15269
- ), d = Fs.fromBinary(
15269
+ ), c = Fs.fromBinary(
15270
15270
  o.payload
15271
15271
  ).chatChannels;
15272
- return xu.formatChannel(d[0]);
15272
+ return xu.formatChannel(c[0]);
15273
15273
  });
15274
15274
  }
15275
15275
  updateChannel(s, t) {
@@ -15389,12 +15389,12 @@ class as {
15389
15389
  from: i,
15390
15390
  reversed: r,
15391
15391
  channelId: n
15392
- }, d = yield a(this, rt).sendMessagePromise(
15392
+ }, c = yield a(this, rt).sendMessagePromise(
15393
15393
  we.getPaginatedMessages,
15394
15394
  $k.toBinary(o)
15395
15395
  );
15396
- return d.payload ? Hk.fromBinary(
15397
- d.payload
15396
+ return c.payload ? Hk.fromBinary(
15397
+ c.payload
15398
15398
  ) : {
15399
15399
  messages: [],
15400
15400
  next: false
@@ -15448,11 +15448,11 @@ class as {
15448
15448
  payload: e
15449
15449
  };
15450
15450
  i && (o.channelId = i), n !== void 0 && (o.pinned = n);
15451
- const d = yield a(this, rt).sendMessagePromise(
15451
+ const c = yield a(this, rt).sendMessagePromise(
15452
15452
  we.editMessage,
15453
15453
  Zk.toBinary(o)
15454
15454
  );
15455
- return ad.fromBinary(d.payload).message;
15455
+ return ad.fromBinary(c.payload).message;
15456
15456
  });
15457
15457
  }
15458
15458
  deleteMessage(t, e) {
@@ -15482,12 +15482,12 @@ class as {
15482
15482
  };
15483
15483
  e.channelId && (r.channelId = e.channelId);
15484
15484
  try {
15485
- const d = yield a(this, rt).sendMessagePromise(
15485
+ const c = yield a(this, rt).sendMessagePromise(
15486
15486
  we.searchChannelMessages,
15487
15487
  cI.toBinary(r)
15488
15488
  );
15489
- return Sf.fromBinary(d.payload).messages;
15490
- } catch (d) {
15489
+ return Sf.fromBinary(c.payload).messages;
15490
+ } catch (c) {
15491
15491
  return [];
15492
15492
  }
15493
15493
  });
@@ -15572,9 +15572,9 @@ class as {
15572
15572
  let o = i;
15573
15573
  try {
15574
15574
  o = r(n);
15575
- } catch (d) {
15575
+ } catch (c) {
15576
15576
  this.logger.error("chatSocketHandler::on::binary_decode_error", {
15577
- error: d
15577
+ error: c
15578
15578
  });
15579
15579
  }
15580
15580
  return e(o);
@@ -15679,8 +15679,8 @@ class cg {
15679
15679
  const { baseURL: r } = this.defaults, i = t.startsWith("http") ? t : `${r}${t.startsWith("/") ? t : `/${t}`}`;
15680
15680
  if (e) {
15681
15681
  const n = new URLSearchParams();
15682
- return Object.entries(e).forEach(([o, d]) => {
15683
- n.append(o, d);
15682
+ return Object.entries(e).forEach(([o, c]) => {
15683
+ n.append(o, c);
15684
15684
  }), `${i}${i.includes("?") ? "&" : "?"}${n.toString()}`;
15685
15685
  }
15686
15686
  return i;
@@ -15690,15 +15690,15 @@ class cg {
15690
15690
  var f;
15691
15691
  const e = ((f = t.method) == null ? void 0 : f.toUpperCase()) || "GET", r = this.buildURL(t.url || "", t.params), i = D(D({}, this.defaults.headers.common), t.headers);
15692
15692
  e !== "GET" && e !== "HEAD" && t.data && !i["Content-Type"] && (i["Content-Type"] = "application/json");
15693
- const o = i["Content-Type"] === "application/json" ? JSON.stringify(t.data) : t.data, d = {
15693
+ const o = i["Content-Type"] === "application/json" ? JSON.stringify(t.data) : t.data, c = {
15694
15694
  method: e,
15695
15695
  headers: i,
15696
15696
  body: e !== "GET" && e !== "HEAD" && t.data ? o : void 0
15697
- }, c = t.timeout || this.defaults.timeout, u = t.retry !== void 0 ? t.retry : this.defaults.retry, p = t.retryDelay || this.defaults.retryDelay;
15697
+ }, d = t.timeout || this.defaults.timeout, u = t.retry !== void 0 ? t.retry : this.defaults.retry, p = t.retryDelay || this.defaults.retryDelay;
15698
15698
  try {
15699
- const S = new AbortController(), E = setTimeout(() => S.abort(), c);
15700
- d.signal = S.signal;
15701
- const _ = yield fetch(r, d);
15699
+ const S = new AbortController(), E = setTimeout(() => S.abort(), d);
15700
+ c.signal = S.signal;
15701
+ const _ = yield fetch(r, c);
15702
15702
  clearTimeout(E);
15703
15703
  let P = null;
15704
15704
  const k = _.headers.get("content-type");
@@ -15774,10 +15774,10 @@ class tM {
15774
15774
  retry: i = XA,
15775
15775
  retryDelay: n = ZA,
15776
15776
  baseURL: o = "https://api.dyte.io",
15777
- authToken: d,
15778
- cachedUserDetails: c
15777
+ authToken: c,
15778
+ cachedUserDetails: d
15779
15779
  } = e || {};
15780
- this.iceServers = c == null ? void 0 : c.iceServers, this.pluginInformation = c == null ? void 0 : c.pluginInformation, this.userDetails = c == null ? void 0 : c.userDetails, this.roomDetails = c == null ? void 0 : c.roomDetails, this.requests = new cg({
15780
+ this.iceServers = d == null ? void 0 : d.iceServers, this.pluginInformation = d == null ? void 0 : d.pluginInformation, this.userDetails = d == null ? void 0 : d.userDetails, this.roomDetails = d == null ? void 0 : d.roomDetails, this.requests = new cg({
15781
15781
  baseURL: o,
15782
15782
  timeout: r,
15783
15783
  retry: i,
@@ -15789,7 +15789,7 @@ class tM {
15789
15789
  retry: i,
15790
15790
  retryDelay: n,
15791
15791
  responseType: "json"
15792
- }), this.setAuthToken(d, { bearer: true });
15792
+ }), this.setAuthToken(c, { bearer: true });
15793
15793
  const u = this.requests.request.bind(this.requests);
15794
15794
  this.requests.request = (p) => l(this, null, function* () {
15795
15795
  var S, E, _, P, k;
@@ -15889,14 +15889,14 @@ class jt extends tM {
15889
15889
  }
15890
15890
  getPlugins() {
15891
15891
  return l(this, null, function* () {
15892
- var n, o, d, c, u, p, f;
15892
+ var n, o, c, d, u, p, f;
15893
15893
  if (this.pluginInformation)
15894
15894
  return this.pluginInformation;
15895
15895
  const { plugins: e } = (yield this.requests.get("/v2/plugins/user")).data.data, r = ((o = (n = this.context.getValue("flagsmith").getValue(Z.V1_PLUGINS)) == null ? void 0 : n.toString()) == null ? void 0 : o.split(",")) || [], i = e.reduce(
15896
15896
  (S, E) => (S[r.includes(E.id) ? "v1" : "v2"].push(B(D({}, E), { name: E.name.replace("v2", "") })), S),
15897
15897
  { v1: [], v2: [] }
15898
15898
  );
15899
- return (u = (c = (d = this.context.getValue("modules")) == null ? void 0 : d.devTools) == null ? void 0 : c.plugins) != null && u.length && ((f = (p = this.context.getValue("modules")) == null ? void 0 : p.devTools) == null || f.plugins.forEach((S) => {
15899
+ return (u = (d = (c = this.context.getValue("modules")) == null ? void 0 : c.devTools) == null ? void 0 : d.plugins) != null && u.length && ((f = (p = this.context.getValue("modules")) == null ? void 0 : p.devTools) == null || f.plugins.forEach((S) => {
15900
15900
  var _, P, k;
15901
15901
  const E = B(D({}, So), {
15902
15902
  tags: [...So.tags],
@@ -15941,10 +15941,10 @@ class jt extends tM {
15941
15941
  expiry: typeof i == "number" ? i : void 0
15942
15942
  };
15943
15943
  this.context.getValue("flagsmith").hasFeature(Z.FEAT_CHAT_SDK) && (n.viewType = r);
15944
- const { getLocation: o, putLocation: d } = (yield this.requests.post("/v1/meetings/genPreSignedUploadUrl", n)).data.data;
15944
+ const { getLocation: o, putLocation: c } = (yield this.requests.post("/v1/meetings/genPreSignedUploadUrl", n)).data.data;
15945
15945
  return {
15946
15946
  getLocation: o,
15947
- putLocation: d
15947
+ putLocation: c
15948
15948
  };
15949
15949
  });
15950
15950
  }
@@ -16143,12 +16143,12 @@ const Qn = {
16143
16143
  function Dt(s, t) {
16144
16144
  return function(e, r, i) {
16145
16145
  const n = i.value;
16146
- let o = 0, d = Date.now();
16147
- return i.value = function(...c) {
16146
+ let o = 0, c = Date.now();
16147
+ return i.value = function(...d) {
16148
16148
  const u = Date.now(), p = t ? this[t] : s;
16149
- if (u - d > p.period * 1e3 && (d = u, o = 0), o >= p.maxInvocations)
16149
+ if (u - c > p.period * 1e3 && (c = u, o = 0), o >= p.maxInvocations)
16150
16150
  throw new R(`Method rate limit ${p.maxInvocations} invocations/${p.period}sec exceeded`, "0013");
16151
- return o += 1, n.apply(this, c);
16151
+ return o += 1, n.apply(this, d);
16152
16152
  }, i;
16153
16153
  };
16154
16154
  }
@@ -16181,12 +16181,12 @@ let Ye = (Cg = class extends qt {
16181
16181
  setMaxTextLimit(t) {
16182
16182
  this.maxTextLimit = t;
16183
16183
  }
16184
- sendMessageInternal(n, o, d) {
16184
+ sendMessageInternal(n, o, c) {
16185
16185
  return l(this, arguments, function* (t, e, r, i = {}) {
16186
16186
  switch (t.type) {
16187
16187
  case "text": {
16188
- const c = i.replyTo && i.replyTo.type === "text" ? aM(t.message, i.replyTo.message) : t.message;
16189
- yield this.sendTextMessageInternal(c, e, r);
16188
+ const d = i.replyTo && i.replyTo.type === "text" ? aM(t.message, i.replyTo.message) : t.message;
16189
+ yield this.sendTextMessageInternal(d, e, r);
16190
16190
  break;
16191
16191
  }
16192
16192
  case "image":
@@ -16205,13 +16205,13 @@ let Ye = (Cg = class extends qt {
16205
16205
  }
16206
16206
  sendTextMessageInternal(t, e, r) {
16207
16207
  return l(this, null, function* () {
16208
- var n, o, d, c, u, p;
16208
+ var n, o, c, d, u, p;
16209
16209
  if (t.length > this.maxTextLimit)
16210
16210
  throw new R("Max character limit breached", "0503");
16211
16211
  if (e && e.length > 0) {
16212
16212
  if (!((n = a(this, ee).permissions) != null && n.chatPrivate.canSend) || !((o = a(this, ee).permissions) != null && o.chatPrivate.text))
16213
16213
  throw this.logger.error("sendTextMessage::private_chat_permission_denied"), new R("Could not send message to private chat.", "0501");
16214
- } else if (!((c = (d = a(this, ee).permissions) == null ? void 0 : d.chatPublic) != null && c.canSend) || !((p = (u = a(this, ee).permissions) == null ? void 0 : u.chatPublic) != null && p.text))
16214
+ } else if (!((d = (c = a(this, ee).permissions) == null ? void 0 : c.chatPublic) != null && d.canSend) || !((p = (u = a(this, ee).permissions) == null ? void 0 : u.chatPublic) != null && p.text))
16215
16215
  throw this.logger.error("sendTextMessage::public_chat_permission_denied"), new R("Could not send message to public chat.", "0501");
16216
16216
  if (!t)
16217
16217
  throw this.logger.error("sendTextMessage::message_can_not_be_empty"), new R("Message can not be empty.", "0502");
@@ -16229,13 +16229,13 @@ let Ye = (Cg = class extends qt {
16229
16229
  }
16230
16230
  sendImageMessageInternal(t, e, r) {
16231
16231
  return l(this, null, function* () {
16232
- var n, o, d, c, u, p;
16232
+ var n, o, c, d, u, p;
16233
16233
  if (e && e.length > 0) {
16234
16234
  if (!((n = a(this, ee).permissions) != null && n.chatPrivate.canSend) || !((o = a(this, ee).permissions) != null && o.chatPrivate.files)) {
16235
16235
  this.logger.error("sendImageMessage::private_chat_permission_denied");
16236
16236
  return;
16237
16237
  }
16238
- } else if (!((c = (d = a(this, ee).permissions) == null ? void 0 : d.chatPublic) != null && c.canSend) || !((p = (u = a(this, ee).permissions) == null ? void 0 : u.chatPublic) != null && p.files)) {
16238
+ } else if (!((d = (c = a(this, ee).permissions) == null ? void 0 : c.chatPublic) != null && d.canSend) || !((p = (u = a(this, ee).permissions) == null ? void 0 : u.chatPublic) != null && p.files)) {
16239
16239
  this.logger.error("sendImageMessage::permission_denied");
16240
16240
  return;
16241
16241
  }
@@ -16273,13 +16273,13 @@ let Ye = (Cg = class extends qt {
16273
16273
  }
16274
16274
  sendFileMessageInternal(t, e, r) {
16275
16275
  return l(this, null, function* () {
16276
- var i, n, o, d, c, u;
16276
+ var i, n, o, c, d, u;
16277
16277
  if (e && e.length > 0) {
16278
16278
  if (!((i = a(this, ee).permissions) != null && i.chatPrivate.canSend) || !((n = a(this, ee).permissions) != null && n.chatPrivate.files)) {
16279
16279
  this.logger.error("sendFileMessage::private_chat_permission_denied");
16280
16280
  return;
16281
16281
  }
16282
- } else if (!((d = (o = a(this, ee).permissions) == null ? void 0 : o.chatPublic) != null && d.canSend) || !((u = (c = a(this, ee).permissions) == null ? void 0 : c.chatPublic) != null && u.files)) {
16282
+ } else if (!((c = (o = a(this, ee).permissions) == null ? void 0 : o.chatPublic) != null && c.canSend) || !((u = (d = a(this, ee).permissions) == null ? void 0 : d.chatPublic) != null && u.files)) {
16283
16283
  this.logger.error("sendFileMessage::permission_denied");
16284
16284
  return;
16285
16285
  }
@@ -16334,13 +16334,13 @@ let Ye = (Cg = class extends qt {
16334
16334
  }
16335
16335
  sendCustomMessage(t, e) {
16336
16336
  return l(this, null, function* () {
16337
- var n, o, d, c, u, p, f, S, E, _, P, k, A, N, H;
16337
+ var n, o, c, d, u, p, f, S, E, _, P, k, A, N, H;
16338
16338
  if (e && e.length > 0) {
16339
- if (!((n = a(this, ee).permissions) != null && n.chatPrivate.canSend) || !((o = a(this, ee).permissions) != null && o.chatPrivate.files) || !((d = a(this, ee).permissions) != null && d.chatPrivate.text)) {
16339
+ if (!((n = a(this, ee).permissions) != null && n.chatPrivate.canSend) || !((o = a(this, ee).permissions) != null && o.chatPrivate.files) || !((c = a(this, ee).permissions) != null && c.chatPrivate.text)) {
16340
16340
  this.logger.error("sendCustomMessage::private_chat_permission_denied");
16341
16341
  return;
16342
16342
  }
16343
- } else if (!((u = (c = a(this, ee).permissions) == null ? void 0 : c.chatPublic) != null && u.canSend) || !((f = (p = a(this, ee).permissions) == null ? void 0 : p.chatPublic) != null && f.files) || !((E = (S = a(this, ee).permissions) == null ? void 0 : S.chatPublic) != null && E.text)) {
16343
+ } else if (!((u = (d = a(this, ee).permissions) == null ? void 0 : d.chatPublic) != null && u.canSend) || !((f = (p = a(this, ee).permissions) == null ? void 0 : p.chatPublic) != null && f.files) || !((E = (S = a(this, ee).permissions) == null ? void 0 : S.chatPublic) != null && E.text)) {
16344
16344
  this.logger.error("sendCustomMessage::permission_denied");
16345
16345
  return;
16346
16346
  }
@@ -16396,10 +16396,10 @@ let Ye = (Cg = class extends qt {
16396
16396
  }
16397
16397
  editTextMessage(t, e, r) {
16398
16398
  return l(this, null, function* () {
16399
- var i, n, o, d, c, u;
16399
+ var i, n, o, c, d, u;
16400
16400
  if (((n = (i = a(this, ee).permissions) == null ? void 0 : i.chatMessage) == null ? void 0 : n.canEdit) === "NONE")
16401
16401
  throw new R("Not permitted to edit messages", "0501");
16402
- if (!((d = (o = a(this, ee).permissions) == null ? void 0 : o.chatPublic) != null && d.canSend) || !((u = (c = a(this, ee).permissions) == null ? void 0 : c.chatPublic) != null && u.text)) {
16402
+ if (!((c = (o = a(this, ee).permissions) == null ? void 0 : o.chatPublic) != null && c.canSend) || !((u = (d = a(this, ee).permissions) == null ? void 0 : d.chatPublic) != null && u.text)) {
16403
16403
  this.logger.error("editTextMessage::permission_denied");
16404
16404
  return;
16405
16405
  }
@@ -16417,8 +16417,8 @@ let Ye = (Cg = class extends qt {
16417
16417
  }
16418
16418
  editImageMessage(t, e, r) {
16419
16419
  return l(this, null, function* () {
16420
- var n, o, d, c;
16421
- if (!((o = (n = a(this, ee).permissions) == null ? void 0 : n.chatPublic) != null && o.canSend) || !((c = (d = a(this, ee).permissions) == null ? void 0 : d.chatPublic) != null && c.files)) {
16420
+ var n, o, c, d;
16421
+ if (!((o = (n = a(this, ee).permissions) == null ? void 0 : n.chatPublic) != null && o.canSend) || !((d = (c = a(this, ee).permissions) == null ? void 0 : c.chatPublic) != null && d.files)) {
16422
16422
  this.logger.error("editImageMessage::permission_denied");
16423
16423
  return;
16424
16424
  }
@@ -16447,8 +16447,8 @@ let Ye = (Cg = class extends qt {
16447
16447
  }
16448
16448
  editFileMessage(t, e, r) {
16449
16449
  return l(this, null, function* () {
16450
- var i, n, o, d;
16451
- if (!((n = (i = a(this, ee).permissions) == null ? void 0 : i.chatPublic) != null && n.canSend) || !((d = (o = a(this, ee).permissions) == null ? void 0 : o.chatPublic) != null && d.files)) {
16450
+ var i, n, o, c;
16451
+ if (!((n = (i = a(this, ee).permissions) == null ? void 0 : i.chatPublic) != null && n.canSend) || !((c = (o = a(this, ee).permissions) == null ? void 0 : o.chatPublic) != null && c.files)) {
16452
16452
  this.logger.error("sendFileMessage::permission_denied");
16453
16453
  return;
16454
16454
  }
@@ -16457,11 +16457,11 @@ let Ye = (Cg = class extends qt {
16457
16457
  return;
16458
16458
  }
16459
16459
  try {
16460
- const c = lt(), { getLocation: u, putLocation: p } = yield c.getPresignedUrls(
16460
+ const d = lt(), { getLocation: u, putLocation: p } = yield d.getPresignedUrls(
16461
16461
  e.name,
16462
16462
  a(this, ee).config.viewType
16463
16463
  );
16464
- yield c.uploadFile(e, p), a(this, Fe).editMessage(
16464
+ yield d.uploadFile(e, p), a(this, Fe).editMessage(
16465
16465
  t,
16466
16466
  JSON.stringify({
16467
16467
  link: u,
@@ -16471,7 +16471,7 @@ let Ye = (Cg = class extends qt {
16471
16471
  _t.FILE,
16472
16472
  r
16473
16473
  );
16474
- } catch (c) {
16474
+ } catch (d) {
16475
16475
  throw new R("Error editing file message.", "0500", this.logger);
16476
16476
  }
16477
16477
  });
@@ -16547,7 +16547,7 @@ let Ye = (Cg = class extends qt {
16547
16547
  const o = yield a(this, Fe).getChatMessagesPaginated(t, e, r, i, n);
16548
16548
  return {
16549
16549
  messages: o.messages.map(
16550
- (d) => _s.formatSocketServiceMessage(d)
16550
+ (c) => _s.formatSocketServiceMessage(c)
16551
16551
  ),
16552
16552
  next: o.next
16553
16553
  };
@@ -16567,10 +16567,10 @@ let Ye = (Cg = class extends qt {
16567
16567
  }
16568
16568
  if (!t || t.trim().length === 0)
16569
16569
  throw new R("channel name cannot be empty.", "0510");
16570
- const d = [.../* @__PURE__ */ new Set([...e, a(this, ee).userId])];
16570
+ const c = [.../* @__PURE__ */ new Set([...e, a(this, ee).userId])];
16571
16571
  return yield a(this, yi).createChannel(
16572
16572
  t.trim(),
16573
- d,
16573
+ c,
16574
16574
  r.displayPictureUrl,
16575
16575
  r.visibility,
16576
16576
  r.isDirectMessage
@@ -16578,7 +16578,7 @@ let Ye = (Cg = class extends qt {
16578
16578
  });
16579
16579
  }
16580
16580
  updateChannel(t, e) {
16581
- var o, d, c, u, p;
16581
+ var o, c, d, u, p;
16582
16582
  const r = this.channels.find((f) => f.id === t), i = (o = a(this, ee).permissions) == null ? void 0 : o.chatChannel;
16583
16583
  if (i) {
16584
16584
  if (i.canUpdate === "NONE")
@@ -16589,8 +16589,8 @@ let Ye = (Cg = class extends qt {
16589
16589
  throw new R("Not permitted to update private channels", "0501");
16590
16590
  }
16591
16591
  const n = {
16592
- memberIds: (d = e.memberIds) != null ? d : r.memberIds,
16593
- displayName: (c = e.displayName) != null ? c : r.displayName,
16592
+ memberIds: (c = e.memberIds) != null ? c : r.memberIds,
16593
+ displayName: (d = e.displayName) != null ? d : r.displayName,
16594
16594
  displayPictureUrl: (u = e.displayPictureUrl) != null ? u : r.displayPictureUrl,
16595
16595
  visibility: (p = e.visibility) != null ? p : r.visibility
16596
16596
  };
@@ -16768,9 +16768,9 @@ const ci = (Rg = class {
16768
16768
  images: i,
16769
16769
  message: n,
16770
16770
  videos: o,
16771
- files: d
16771
+ files: c
16772
16772
  } = JSON.parse(s.payload);
16773
- e.message = n, e.html = r, e.images = i, e.videos = o, e.files = d;
16773
+ e.message = n, e.html = r, e.images = i, e.videos = o, e.files = c;
16774
16774
  break;
16775
16775
  }
16776
16776
  }
@@ -17134,10 +17134,10 @@ Hu = TM([
17134
17134
  function EM(s) {
17135
17135
  let t = "", e = [""];
17136
17136
  const r = [e];
17137
- let i = 0, n = 0, o = true, d;
17138
- for (d of s)
17139
- d === '"' ? (o && d === t && (e[i] += d), o = !o) : d === "," && o ? d = e[++i] = "" : d === `
17140
- ` && o ? (t === "\r" && (e[i] = e[i].slice(0, -1)), e = r[++n] = [d = ""], i = 0) : e[i] += d, t = d;
17137
+ let i = 0, n = 0, o = true, c;
17138
+ for (c of s)
17139
+ c === '"' ? (o && c === t && (e[i] += c), o = !o) : c === "," && o ? c = e[++i] = "" : c === `
17140
+ ` && o ? (t === "\r" && (e[i] = e[i].slice(0, -1)), e = r[++n] = [c = ""], i = 0) : e[i] += c, t = c;
17141
17141
  return r;
17142
17142
  }
17143
17143
  var _M = Object.defineProperty, PM = Object.getOwnPropertyDescriptor, bf = (s, t, e, r) => {
@@ -17175,16 +17175,16 @@ let Zr = (Ig = class extends qt {
17175
17175
  i,
17176
17176
  n,
17177
17177
  o,
17178
- d,
17179
- c
17178
+ c,
17179
+ d
17180
17180
  ]] = EM(t);
17181
17181
  return {
17182
17182
  id: v4(),
17183
- name: d,
17183
+ name: c,
17184
17184
  peerId: i,
17185
17185
  userId: n,
17186
17186
  customParticipantId: o,
17187
- transcript: c,
17187
+ transcript: d,
17188
17188
  isPartialTranscript: e,
17189
17189
  date: new Date(parseInt(r, 10) * 1e3)
17190
17190
  };
@@ -17365,16 +17365,16 @@ const kf = (Ag = class {
17365
17365
  let i;
17366
17366
  try {
17367
17367
  i = Zr.parseTranscript(e, r);
17368
- } catch (c) {
17369
- this.logger.error(`Failed to parse transcript: ${e}`, c);
17368
+ } catch (d) {
17369
+ this.logger.error(`Failed to parse transcript: ${e}`, d);
17370
17370
  }
17371
17371
  if (!i) {
17372
17372
  this.logger.warn("Received empty transcript data");
17373
17373
  return;
17374
17374
  }
17375
17375
  this.ai.onTranscript(i), this.meta.emit("transcript", i);
17376
- const { peerId: n, name: o, transcript: d } = i;
17377
- this.logger.debug(`${t} Received transcript for peer ${n} - ${o}: ${d}`);
17376
+ const { peerId: n, name: o, transcript: c } = i;
17377
+ this.logger.debug(`${t} Received transcript for peer ${n} - ${o}: ${c}`);
17378
17378
  });
17379
17379
  }
17380
17380
  }, Ir = /* @__PURE__ */ new WeakMap(), za = /* @__PURE__ */ new WeakMap(), xt = /* @__PURE__ */ new WeakMap(), Ag);
@@ -17389,8 +17389,8 @@ var bM = Object.defineProperty, kM = Object.getOwnPropertyDescriptor, Ea = (s, t
17389
17389
  }, Yt, Ya, ae, Jo, As, it, Ko, qu, Qa, fd;
17390
17390
  class ri extends qt {
17391
17391
  constructor(e, r, i, n, o) {
17392
- const d = e.getValue("logger");
17393
- super(d);
17392
+ const c = e.getValue("logger");
17393
+ super(c);
17394
17394
  g(this, Ko);
17395
17395
  g(this, Qa);
17396
17396
  g(this, Yt, void 0);
@@ -17413,8 +17413,8 @@ class ri extends qt {
17413
17413
  m(this, As, n);
17414
17414
  }),
17415
17415
  [b.UPDATE_STAGE_REQUESTS]: (o) => l(this, [o], function* ({ add: n }) {
17416
- const d = a(this, As).length, { stageRequests: c } = this.getAccessRequests();
17417
- (n || c.length > d) && this.emit("newStageRequest", { count: c.length }), this.emit("stageAccessRequestUpdate", c);
17416
+ const c = a(this, As).length, { stageRequests: d } = this.getAccessRequests();
17417
+ (n || d.length > c) && this.emit("newStageRequest", { count: d.length }), this.emit("stageAccessRequestUpdate", d);
17418
17418
  })
17419
17419
  }, r = () => {
17420
17420
  Object.entries(e).forEach(([n, o]) => {
@@ -17722,8 +17722,8 @@ let Kn = (Mg = class extends zn {
17722
17722
  description: i,
17723
17723
  id: n,
17724
17724
  name: o,
17725
- organizationId: d,
17726
- picture: c,
17725
+ organizationId: c,
17726
+ picture: d,
17727
17727
  private: u,
17728
17728
  published: p,
17729
17729
  staggered: f,
@@ -17758,7 +17758,7 @@ let Kn = (Mg = class extends zn {
17758
17758
  h(this, "enabledBy");
17759
17759
  g(this, Dr, void 0);
17760
17760
  g(this, tn, void 0);
17761
- 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 = d, this.picture = c, 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, Xa, A), m(this, Za, N), this.enabledBy = "", m(this, tn, H);
17761
+ 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, Xa, A), m(this, Za, N), this.enabledBy = "", m(this, tn, H);
17762
17762
  }
17763
17763
  get telemetry() {
17764
17764
  return a(this, Dr).getValue("telemetry");
@@ -17850,8 +17850,8 @@ let Kn = (Mg = class extends zn {
17850
17850
  }
17851
17851
  case Ie.chatMessage: {
17852
17852
  const {
17853
- messagePayload: d,
17854
- peerIds: c
17853
+ messagePayload: c,
17854
+ peerIds: d
17855
17855
  } = r;
17856
17856
  if (!a(this, Za)) {
17857
17857
  this.sendIframeEvent({
@@ -17862,7 +17862,7 @@ let Kn = (Mg = class extends zn {
17862
17862
  return;
17863
17863
  }
17864
17864
  try {
17865
- yield a(this, Za).sendMessage(d, c), this.sendIframeEvent({
17865
+ yield a(this, Za).sendMessage(c, d), this.sendIframeEvent({
17866
17866
  type: Ie.chatMessage,
17867
17867
  uuid: e.uuid,
17868
17868
  payload: { success: true }
@@ -17879,25 +17879,25 @@ let Kn = (Mg = class extends zn {
17879
17879
  break;
17880
17880
  }
17881
17881
  case Ie.getPeer: {
17882
- let d;
17883
- const { peerId: c } = r, u = B(D({}, a(this, Ut)), {
17882
+ let c;
17883
+ const { peerId: d } = r, u = B(D({}, a(this, Ut)), {
17884
17884
  id: a(this, Ut).id,
17885
17885
  isRecorder: (o = a(this, Ut).permissions) == null ? void 0 : o.isRecorder,
17886
17886
  isHidden: a(this, Ut).permissions.hiddenParticipant,
17887
17887
  stageStatus: a(this, Ut).stageStatus
17888
17888
  });
17889
- c ? (d = a(this, Xa).joined.get(r.peerId), a(this, Ut).id === c && (d = u)) : d = u, this.sendIframeEvent({
17889
+ d ? (c = a(this, Xa).joined.get(r.peerId), a(this, Ut).id === d && (c = u)) : c = u, this.sendIframeEvent({
17890
17890
  type: Ie.getPeer,
17891
- payload: { peer: d && Nd(d) },
17891
+ payload: { peer: c && Nd(c) },
17892
17892
  uuid: e.uuid
17893
17893
  });
17894
17894
  break;
17895
17895
  }
17896
17896
  case Ie.getPeers: {
17897
- const d = a(this, Xa).joined.toArray().map((c) => Nd(c));
17897
+ const c = a(this, Xa).joined.toArray().map((d) => Nd(d));
17898
17898
  this.sendIframeEvent({
17899
17899
  type: Ie.getPeers,
17900
- payload: { peers: d },
17900
+ payload: { peers: c },
17901
17901
  uuid: e.uuid
17902
17902
  });
17903
17903
  break;
@@ -17970,17 +17970,17 @@ let Kn = (Mg = class extends zn {
17970
17970
  roomName: (o = a(this, Dr).getValue("meetingId")) != null ? o : "",
17971
17971
  displayTitle: a(this, tn)
17972
17972
  };
17973
- if (Object.keys(n).forEach((d) => {
17974
- i.searchParams.set(d, n[d]);
17973
+ if (Object.keys(n).forEach((c) => {
17974
+ i.searchParams.set(c, n[c]);
17975
17975
  }), r.src = i.href, r.allow = "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture", r.title = e, navigator.isReactNative)
17976
- r.props.onMessage = (d) => {
17977
- this.handleIframeMessage(JSON.parse(d.nativeEvent.data));
17976
+ r.props.onMessage = (c) => {
17977
+ this.handleIframeMessage(JSON.parse(c.nativeEvent.data));
17978
17978
  }, this.iframes.set(e, { iframe: r });
17979
17979
  else {
17980
- const d = (c) => l(this, null, function* () {
17981
- c.source === t.contentWindow && (yield this.handleIframeMessage(c.data));
17980
+ const c = (d) => l(this, null, function* () {
17981
+ d.source === t.contentWindow && (yield this.handleIframeMessage(d.data));
17982
17982
  });
17983
- window.addEventListener("message", d), this.iframes.set(e, { iframe: r, listener: d });
17983
+ window.addEventListener("message", c), this.iframes.set(e, { iframe: r, listener: c });
17984
17984
  }
17985
17985
  }
17986
17986
  setActive(t) {
@@ -18125,8 +18125,8 @@ class Mf extends Map {
18125
18125
  return this.set(e.id, e, r);
18126
18126
  }
18127
18127
  set(e, r, i = true) {
18128
- const n = super.set(e, r), o = (d, ...c) => {
18129
- this.emit(d, r, ...c);
18128
+ const n = super.set(e, r), o = (c, ...d) => {
18129
+ this.emit(c, r, ...d);
18130
18130
  };
18131
18131
  return a(this, Ci).set(e, o), r.on("*", o), i && a(this, Ne).emit(this.onAddEvent, r), n;
18132
18132
  }
@@ -18198,9 +18198,9 @@ const Df = (Dg = class {
18198
18198
  get logger() {
18199
18199
  return a(this, ls).getValue("logger");
18200
18200
  }
18201
- static init(s, t, e, r, i, n, o, d) {
18201
+ static init(s, t, e, r, i, n, o, c) {
18202
18202
  return l(this, null, function* () {
18203
- const c = s.getValue("logger"), u = new ju(c);
18203
+ const d = s.getValue("logger"), u = new ju(d);
18204
18204
  return t.forEach((p) => {
18205
18205
  const f = new Kn(
18206
18206
  s,
@@ -18209,7 +18209,7 @@ const Df = (Dg = class {
18209
18209
  n,
18210
18210
  o,
18211
18211
  i,
18212
- d
18212
+ c
18213
18213
  );
18214
18214
  u.all.add(f);
18215
18215
  }), new Df(
@@ -18566,9 +18566,9 @@ let ma = (Og = class extends qt {
18566
18566
  t === "stop" && (n.state = "STOPPING", this.emit("recordingUpdate", "STOPPING"));
18567
18567
  try {
18568
18568
  yield lt().updateRecording(n.id, t);
18569
- } catch (d) {
18569
+ } catch (c) {
18570
18570
  throw this.logger.error("DyteRecording::stop::recording_failed_to_stop", {
18571
- error: d
18571
+ error: c
18572
18572
  }), n.state !== o && (n.state = o, this.emit("recordingUpdate", o)), new R("Error while stopping recording", "1000", this.logger);
18573
18573
  }
18574
18574
  }));
@@ -18768,21 +18768,21 @@ class Ot extends zn {
18768
18768
  audio: e,
18769
18769
  video: r
18770
18770
  }) {
18771
- var d;
18771
+ var c;
18772
18772
  e ? a(this, ke).getValue("callstats").audioOn() : a(this, ke).getValue("callstats").audioOff(), r ? a(this, ke).getValue("callstats").videoOn() : a(this, ke).getValue("callstats").videoOff();
18773
18773
  let n, o;
18774
18774
  if (e && r)
18775
18775
  try {
18776
- const c = yield a(this, qe).getAudioAndVideoTrack(
18776
+ const d = yield a(this, qe).getAudioAndVideoTrack(
18777
18777
  a(this, ve).userSelectedDevice,
18778
18778
  a(this, ge).userSelectedDevice
18779
18779
  );
18780
- n = c.audioTrack, o = c.videoTrack;
18781
- } catch (c) {
18780
+ n = d.audioTrack, o = d.videoTrack;
18781
+ } catch (d) {
18782
18782
  this.logger.error(
18783
18783
  "LocalMediaHandler::init::Failed to get audio video tracks",
18784
18784
  {
18785
- error: c
18785
+ error: d
18786
18786
  }
18787
18787
  );
18788
18788
  }
@@ -18792,9 +18792,9 @@ class Ot extends zn {
18792
18792
  false,
18793
18793
  a(this, ve).userSelectedDevice
18794
18794
  );
18795
- } catch (c) {
18795
+ } catch (d) {
18796
18796
  this.logger.error("LocalMediaHandler::init::Failed to get audio track", {
18797
- error: c
18797
+ error: d
18798
18798
  });
18799
18799
  }
18800
18800
  if (!o && r)
@@ -18802,25 +18802,25 @@ class Ot extends zn {
18802
18802
  o = yield a(this, qe).getVideoTrack(
18803
18803
  a(this, ge).userSelectedDevice
18804
18804
  );
18805
- } catch (c) {
18805
+ } catch (d) {
18806
18806
  this.logger.error("LocalMediaHandler::init::Failed to get video track", {
18807
- error: c
18807
+ error: d
18808
18808
  });
18809
18809
  }
18810
18810
  e && !n && a(this, ke).getValue("callstats").audioOff(), r && !o && a(this, ke).getValue("callstats").videoOff(), yield a(this, ve).setMediaTrack(n), yield a(this, ge).setMediaTrack(o);
18811
18811
  try {
18812
18812
  this.setupSpeaker();
18813
- } catch (c) {
18813
+ } catch (d) {
18814
18814
  }
18815
18815
  if (o) {
18816
- const c = yield this.getDeviceById(o.getSettings().deviceId);
18817
- a(this, ke).getValue("callstats").selectedDevice("VIDEO", c);
18816
+ const d = yield this.getDeviceById(o.getSettings().deviceId);
18817
+ a(this, ke).getValue("callstats").selectedDevice("VIDEO", d);
18818
18818
  }
18819
18819
  if (n) {
18820
- const c = yield this.getDeviceById(n.getSettings().deviceId);
18821
- a(this, ke).getValue("callstats").selectedDevice("AUDIO", c);
18820
+ const d = yield this.getDeviceById(n.getSettings().deviceId);
18821
+ a(this, ke).getValue("callstats").selectedDevice("AUDIO", d);
18822
18822
  }
18823
- (d = a(this, zs).currentDevice) != null && d.deviceId && a(this, ke).getValue("callstats").selectedDevice("SPEAKER", a(this, zs).currentDevice), a(this, qe).onDeviceChange((c, u, p) => {
18823
+ (c = a(this, zs).currentDevice) != null && c.deviceId && a(this, ke).getValue("callstats").selectedDevice("SPEAKER", a(this, zs).currentDevice), a(this, qe).onDeviceChange((d, u, p) => {
18824
18824
  this.onDeviceChange(u, p);
18825
18825
  });
18826
18826
  });
@@ -18994,13 +18994,13 @@ class Ot extends zn {
18994
18994
  return l(this, null, function* () {
18995
18995
  var i, n;
18996
18996
  this.emit("DEVICE_LIST_UPDATED", e), !(r || !a(this, Qo)) && ((i = e == null ? void 0 : e.added) == null || i.forEach((o) => l(this, null, function* () {
18997
- var d;
18998
- o && !Gu(o) && (o.kind === "audioinput" && ((d = this.audioTrack) == null ? void 0 : d.enabled) === true ? yield this.setAudioDevice(o) : o.kind === "audiooutput" && (yield this.setSpeakerDevice(o)));
18997
+ var c;
18998
+ o && !Gu(o) && (o.kind === "audioinput" && ((c = this.audioTrack) == null ? void 0 : c.enabled) === true ? yield this.setAudioDevice(o) : o.kind === "audiooutput" && (yield this.setSpeakerDevice(o)));
18999
18999
  })), (n = e == null ? void 0 : e.removed) == null || n.forEach((o) => l(this, null, function* () {
19000
- var d;
19001
- if (o.kind === "audiooutput" && ((d = this.getCurrentDevices().speaker) == null ? void 0 : d.deviceId) === o.deviceId) {
19002
- const c = (yield this.getSpeakerDevices()).find((u) => u.deviceId !== o.deviceId);
19003
- c && (yield this.setSpeakerDevice(c));
19000
+ var c;
19001
+ if (o.kind === "audiooutput" && ((c = this.getCurrentDevices().speaker) == null ? void 0 : c.deviceId) === o.deviceId) {
19002
+ const d = (yield this.getSpeakerDevices()).find((u) => u.deviceId !== o.deviceId);
19003
+ d && (yield this.setSpeakerDevice(d));
19004
19004
  }
19005
19005
  })));
19006
19006
  });
@@ -19124,21 +19124,21 @@ function YM(s, t, e) {
19124
19124
  if (!(t != null && t.length))
19125
19125
  return e;
19126
19126
  const r = s.getValue("logger"), i = new AudioContext(), n = yield Promise.all(
19127
- t == null ? void 0 : t.map((c) => c(i))
19127
+ t == null ? void 0 : t.map((d) => d(i))
19128
19128
  ), o = i.createMediaStreamSource(
19129
19129
  new MediaStream([e])
19130
- ), d = i.createMediaStreamDestination();
19130
+ ), c = i.createMediaStreamDestination();
19131
19131
  try {
19132
- let c = o;
19132
+ let d = o;
19133
19133
  for (let u = 0; u < n.length; u += 1)
19134
- c.connect(n[u]), c = n[u];
19135
- c.connect(d);
19136
- } catch (c) {
19134
+ d.connect(n[u]), d = n[u];
19135
+ d.connect(c);
19136
+ } catch (d) {
19137
19137
  return r.error("getTransformedAudioTrack::middleware_execution_failed", {
19138
- error: c
19138
+ error: d
19139
19139
  }), e;
19140
19140
  }
19141
- return d.stream.getAudioTracks()[0];
19141
+ return c.stream.getAudioTracks()[0];
19142
19142
  });
19143
19143
  }
19144
19144
  var bi, Xo;
@@ -19175,21 +19175,21 @@ class QM {
19175
19175
  value: e.getSettings()
19176
19176
  }), E;
19177
19177
  }
19178
- const o = document.createElement("video"), d = new MediaStream();
19179
- d.addTrack(e);
19180
- const c = i.getContext("2d");
19181
- o.srcObject = d, o.autoplay = true, this.terminateMiddlewareWebWorker();
19178
+ const o = document.createElement("video"), c = new MediaStream();
19179
+ c.addTrack(e);
19180
+ const d = i.getContext("2d");
19181
+ o.srcObject = c, o.autoplay = true, this.terminateMiddlewareWebWorker();
19182
19182
  const u = () => l(this, null, function* () {
19183
19183
  if (e.enabled === false || e.readyState === "ended") {
19184
19184
  this.terminateMiddlewareWebWorker(), o.remove(), i.remove();
19185
19185
  return;
19186
19186
  }
19187
19187
  try {
19188
- c.drawImage(o, 0, 0);
19188
+ d.drawImage(o, 0, 0);
19189
19189
  for (let S = 0; S < n.length; S += 1)
19190
19190
  typeof n[S] == "function" && (yield n[S](
19191
19191
  i,
19192
- c
19192
+ d
19193
19193
  ));
19194
19194
  } catch (S) {
19195
19195
  this.logger.error(
@@ -19283,16 +19283,16 @@ const lg = {
19283
19283
  }
19284
19284
  ]]
19285
19285
  ], ZM = (s, t) => {
19286
- var d;
19287
- const e = "getSettings" in t && t.getSettings().width || "getConstraints" in t && t.getConstraints().width || "originalSettings" in t && ((d = t.originalSettings) == null ? void 0 : d.width);
19286
+ var c;
19287
+ const e = "getSettings" in t && t.getSettings().width || "getConstraints" in t && t.getConstraints().width || "originalSettings" in t && ((c = t.originalSettings) == null ? void 0 : c.width);
19288
19288
  let r = XM;
19289
19289
  s.getValue("flagsmith").hasFeature(Z.OVERRIDE_HIVE_SIMULCAST_DYNAMIC) && (r = JSON.parse(s.getValue("flagsmith").getValue(
19290
19290
  Z.OVERRIDE_HIVE_SIMULCAST_DYNAMIC
19291
19291
  )));
19292
- const i = r.map(([c]) => c).sort((c, u) => c - u);
19292
+ const i = r.map(([d]) => d).sort((d, u) => d - u);
19293
19293
  let n = Number.MAX_VALUE, o = 0;
19294
- return i.forEach((c, u) => {
19295
- Math.abs(c - e) < n && (n = Math.abs(c - e), o = u);
19294
+ return i.forEach((d, u) => {
19295
+ Math.abs(d - e) < n && (n = Math.abs(d - e), o = u);
19296
19296
  }), r[o][1];
19297
19297
  };
19298
19298
  var pe = /* @__PURE__ */ ((s) => (s.WEBCAM = "webcam", s.WEBCAM_BACKUP = "webcam_backup", s.MIC = "mic", s.SCREENSHARE_VIDEO = "screenshare_video", s.SCREENSHARE_AUDIO = "screenshare_audio", s))(pe || {});
@@ -19316,12 +19316,12 @@ class s0 {
19316
19316
  var u, p, f, S, E, _, P, k, A, N, H;
19317
19317
  const t2 = (u = a(this, ki)) == null ? void 0 : u.screenshare, e2 = (f = (p = t2 == null ? void 0 : t2.width) == null ? void 0 : p.max) != null ? f : 1920, r = (E = (S = t2 == null ? void 0 : t2.height) == null ? void 0 : S.max) != null ? E : 1080, i = (P = (_ = t2 == null ? void 0 : t2.frameRate) == null ? void 0 : _.max) != null ? P : 5;
19318
19318
  let n = (A = (k = t2 == null ? void 0 : t2.frameRate) == null ? void 0 : k.ideal) != null ? A : 5;
19319
- const o = t2 == null ? void 0 : t2.displaySurface, d = t2 == null ? void 0 : t2.selfBrowserSurface;
19319
+ const o = t2 == null ? void 0 : t2.displaySurface, c = t2 == null ? void 0 : t2.selfBrowserSurface;
19320
19320
  a(this, Ms).getValue("flagsmith").getValue(Z.VAL_MIN_FRAMERATE) && (n = parseInt(
19321
19321
  (N = a(this, Ms).getValue("flagsmith").getValue(Z.VAL_MIN_FRAMERATE)) == null ? void 0 : N.toString(),
19322
19322
  10
19323
19323
  ));
19324
- let c = {
19324
+ let d = {
19325
19325
  width: { max: e2 },
19326
19326
  height: { max: r },
19327
19327
  frameRate: {
@@ -19333,21 +19333,21 @@ class s0 {
19333
19333
  const $ = (H = a(this, Ms).getValue("flagsmith").getValue(
19334
19334
  Z.SCREENSHARE_CONSTRAINTS
19335
19335
  )) == null ? void 0 : H.toString();
19336
- c = JSON.parse($);
19336
+ d = JSON.parse($);
19337
19337
  }
19338
- return o !== void 0 && ["monitor", "browser", "window"].includes(o) && (c = B(D({}, c), { displaySurface: o })), d !== void 0 && (c = B(D({}, c), { selfBrowserSurface: d })), {
19338
+ return o !== void 0 && ["monitor", "browser", "window"].includes(o) && (d = B(D({}, d), { displaySurface: o })), c !== void 0 && (d = B(D({}, d), { selfBrowserSurface: c })), {
19339
19339
  audio: true,
19340
- video: c
19340
+ video: d
19341
19341
  };
19342
19342
  });
19343
19343
  h(this, "getAudioConstraints", (t2) => {
19344
- var n, o, d, c, u, p, f, S;
19344
+ var n, o, c, d, u, p, f, S;
19345
19345
  const e2 = {}, r = (n = a(this, ki)) == null ? void 0 : n.audio, i = r != null && r.enableStereo ? 2 : 1;
19346
19346
  return Te.isFirefox() || Te.isWebKitBased() ? (e2.audio = {
19347
19347
  deviceId: t2,
19348
19348
  autoGainControl: (o = r == null ? void 0 : r.autoGainControl) != null ? o : true,
19349
- echoCancellation: (d = r == null ? void 0 : r.echoCancellation) != null ? d : true,
19350
- noiseSuppression: (c = r == null ? void 0 : r.noiseSupression) != null ? c : true,
19349
+ echoCancellation: (c = r == null ? void 0 : r.echoCancellation) != null ? c : true,
19350
+ noiseSuppression: (d = r == null ? void 0 : r.noiseSupression) != null ? d : true,
19351
19351
  channelCount: i
19352
19352
  }, e2) : (e2.audio = {}, e2.audio.optional = [
19353
19353
  t2 ? { sourceId: t2 } : { sourceId: "default" },
@@ -19360,15 +19360,15 @@ class s0 {
19360
19360
  ], e2);
19361
19361
  });
19362
19362
  h(this, "getVideoConstraints", (t2) => {
19363
- var n, o, d, c;
19363
+ var n, o, c, d;
19364
19364
  const e2 = {}, r = (n = a(this, ki)) == null ? void 0 : n.video;
19365
19365
  let i = lg.vga;
19366
19366
  if (typeof r == "string" ? i = lg[r] : r !== void 0 && (i.height.ideal = r.height.ideal, i.width.ideal = r.width.ideal), i.frameRate = {
19367
- ideal: (d = (o = i.frameRate) == null ? void 0 : o.ideal) != null ? d : 24
19367
+ ideal: (c = (o = i.frameRate) == null ? void 0 : o.ideal) != null ? c : 24
19368
19368
  }, Te.isChromiumBased() && (i.frameRate.max = 30), a(this, Ms).getValue("flagsmith").hasFeature(Z.VIDEO_CONSTRAINTS)) {
19369
- const u = (c = a(this, Ms).getValue("flagsmith").getValue(
19369
+ const u = (d = a(this, Ms).getValue("flagsmith").getValue(
19370
19370
  Z.VIDEO_CONSTRAINTS
19371
- )) == null ? void 0 : c.toString();
19371
+ )) == null ? void 0 : d.toString();
19372
19372
  i = JSON.parse(u);
19373
19373
  }
19374
19374
  return e2.video = i, typeof e2.video == "boolean" || (t2 ? e2.video.deviceId = { exact: t2 } : e2.video.facingMode = "user"), e2;
@@ -19498,26 +19498,26 @@ let Bt = (Ng = class extends r0 {
19498
19498
  const i = (n) => l(this, null, function* () {
19499
19499
  let o;
19500
19500
  try {
19501
- r = r.filter((c) => c.deviceId !== n), o = a(this, Zt).getAudioConstraints(n), this.logger.info("getUserMediaWithoutTimeout::requesting_user_media", {
19501
+ r = r.filter((d) => d.deviceId !== n), o = a(this, Zt).getAudioConstraints(n), this.logger.info("getUserMediaWithoutTimeout::requesting_user_media", {
19502
19502
  constraints: JSON.stringify(o)
19503
19503
  });
19504
- const [d] = (yield navigator.mediaDevices.getUserMedia(o)).getAudioTracks();
19504
+ const [c] = (yield navigator.mediaDevices.getUserMedia(o)).getAudioTracks();
19505
19505
  return this.logger.info("getUserMediaWithoutTimeout::received_user_media", {
19506
19506
  constraints: JSON.stringify(o)
19507
- }), d;
19508
- } catch (d) {
19509
- const c = od(
19507
+ }), c;
19508
+ } catch (c) {
19509
+ const d = od(
19510
19510
  "audio",
19511
- d.name,
19512
- d.message
19513
- ), u = new mu(d.name, d.message, o);
19514
- if (c === "COULD_NOT_START") {
19511
+ c.name,
19512
+ c.message
19513
+ ), u = new mu(c.name, c.message, o);
19514
+ if (d === "COULD_NOT_START") {
19515
19515
  const p = r.shift();
19516
19516
  if (!p)
19517
19517
  throw u;
19518
19518
  this.logger.info("getAudioTrack::gum_failed", {
19519
19519
  constraints: JSON.stringify(o),
19520
- error: d
19520
+ error: c
19521
19521
  });
19522
19522
  const f = a(this, Zt).getAudioConstraints(
19523
19523
  p.deviceId
@@ -19542,16 +19542,16 @@ let Bt = (Ng = class extends r0 {
19542
19542
  }
19543
19543
  getVideoTrack(t) {
19544
19544
  return l(this, null, function* () {
19545
- var d;
19546
- const e = a(this, Le).getValue("flagsmith").hasFeature(Z.OBS_QUALITY), r = (d = yield this.getCurrentDeviceLabel(t)) == null ? void 0 : d.includes("OBS Virtual"), i = e && r, n = yield this.getVideoInputDevices();
19545
+ var c;
19546
+ const e = a(this, Le).getValue("flagsmith").hasFeature(Z.OBS_QUALITY), r = (c = yield this.getCurrentDeviceLabel(t)) == null ? void 0 : c.includes("OBS Virtual"), i = e && r, n = yield this.getVideoInputDevices();
19547
19547
  if (n.length === 0)
19548
19548
  throw this.permissions.video = "NO_DEVICES_AVAILABLE", a(this, Le).getValue("peerSessionStore").emit(b.MEDIA_PERMISSION_UPDATE, {
19549
19549
  message: this.permissions.video,
19550
19550
  kind: "video"
19551
19551
  }), new R("No video devices available", "1607");
19552
- const o = (c) => l(this, null, function* () {
19552
+ const o = (d) => l(this, null, function* () {
19553
19553
  try {
19554
- let u = c;
19554
+ let u = d;
19555
19555
  const { video: p } = u;
19556
19556
  i && typeof p != "boolean" && (u = {
19557
19557
  video: { deviceId: p.deviceId }
@@ -19575,13 +19575,13 @@ let Bt = (Ng = class extends r0 {
19575
19575
  "video",
19576
19576
  u.name,
19577
19577
  u.message
19578
- ), f = new mu(u.name, u.message, c);
19578
+ ), f = new mu(u.name, u.message, d);
19579
19579
  if (p === "COULD_NOT_START") {
19580
19580
  const S = n.shift();
19581
19581
  if (!S)
19582
19582
  throw f;
19583
19583
  this.logger.info("getVideoTrack::gum_failed", {
19584
- constraints: JSON.stringify(c),
19584
+ constraints: JSON.stringify(d),
19585
19585
  error: u
19586
19586
  });
19587
19587
  const E = a(this, Zt).getVideoConstraints(
@@ -19595,13 +19595,13 @@ let Bt = (Ng = class extends r0 {
19595
19595
  }
19596
19596
  });
19597
19597
  try {
19598
- const c = a(this, Zt).getVideoConstraints(t), u = yield o(c);
19598
+ const d = a(this, Zt).getVideoConstraints(t), u = yield o(d);
19599
19599
  return this.permissions.video !== "ACCEPTED" && (this.permissions.video = "ACCEPTED", a(this, Le).getValue("peerSessionStore").emit(b.MEDIA_PERMISSION_UPDATE, {
19600
19600
  message: this.permissions.video,
19601
19601
  kind: "video"
19602
19602
  })), u;
19603
- } catch (c) {
19604
- throw c.constraints && this.handlePermissionErrors("video", c), new R(c.message, "1602");
19603
+ } catch (d) {
19604
+ throw d.constraints && this.handlePermissionErrors("video", d), new R(d.message, "1602");
19605
19605
  }
19606
19606
  });
19607
19607
  }
@@ -19695,23 +19695,23 @@ let Bt = (Ng = class extends r0 {
19695
19695
  var u, p;
19696
19696
  const r = (f) => `${f.kind}-${f.deviceId}-${f.groupId}`, i = this.availableDevices, n = new Set(
19697
19697
  i.map((f) => r(f))
19698
- ), o = yield this.getAvailableDevices(), d = new Set(
19698
+ ), o = yield this.getAvailableDevices(), c = new Set(
19699
19699
  o.map((f) => r(f))
19700
- ), c = {
19700
+ ), d = {
19701
19701
  added: o.filter(
19702
19702
  (f) => !n.has(r(f))
19703
19703
  ),
19704
19704
  removed: i.filter(
19705
- (f) => !d.has(r(f))
19705
+ (f) => !c.has(r(f))
19706
19706
  ),
19707
19707
  devices: o
19708
19708
  };
19709
- if ((u = c.added) != null && u.length || (p = c.removed) != null && p.length) {
19709
+ if ((u = d.added) != null && u.length || (p = d.removed) != null && p.length) {
19710
19710
  this.logger.info("repopulated_full_device_list", {
19711
19711
  devices: JSON.stringify(o)
19712
19712
  });
19713
- const f = [...c.added, ...c.removed];
19714
- f.some((S) => S.kind === "audioinput") && a(this, Le).getValue("callstats").devices("AUDIO", o == null ? void 0 : o.filter((S) => S.kind === "audioinput")), f.some((S) => S.kind === "videoinput") && a(this, Le).getValue("callstats").devices("VIDEO", o == null ? void 0 : o.filter((S) => S.kind === "videoinput")), f.some((S) => S.kind === "audiooutput") && a(this, Le).getValue("callstats").devices("SPEAKER", o == null ? void 0 : o.filter((S) => S.kind === "audiooutput")), t(e, c, false);
19713
+ const f = [...d.added, ...d.removed];
19714
+ f.some((S) => S.kind === "audioinput") && a(this, Le).getValue("callstats").devices("AUDIO", o == null ? void 0 : o.filter((S) => S.kind === "audioinput")), f.some((S) => S.kind === "videoinput") && a(this, Le).getValue("callstats").devices("VIDEO", o == null ? void 0 : o.filter((S) => S.kind === "videoinput")), f.some((S) => S.kind === "audiooutput") && a(this, Le).getValue("callstats").devices("SPEAKER", o == null ? void 0 : o.filter((S) => S.kind === "audiooutput")), t(e, d, false);
19715
19715
  }
19716
19716
  }),
19717
19717
  { signal: a(this, on).signal }
@@ -19780,14 +19780,14 @@ const Nf = Bt, Mo = {
19780
19780
  const r = typeof e == "number" ? e : 250, i = s.createMediaStreamSource(t), n = s.createAnalyser();
19781
19781
  n.fftSize = 2048, i.connect(n);
19782
19782
  const o = new Uint8Array(n.fftSize);
19783
- let d = false;
19783
+ let c = false;
19784
19784
  setTimeout(() => {
19785
- d = true;
19785
+ c = true;
19786
19786
  }, r);
19787
- function c() {
19788
- return d ? Promise.resolve(true) : (n.getByteTimeDomainData(o), o.some((u) => u !== 128 && u !== 0) ? Promise.resolve(false) : n0().then(c));
19787
+ function d() {
19788
+ return c ? Promise.resolve(true) : (n.getByteTimeDomainData(o), o.some((u) => u !== 128 && u !== 0) ? Promise.resolve(false) : n0().then(d));
19789
19789
  }
19790
- return c().then(
19790
+ return d().then(
19791
19791
  (u) => (i.disconnect(), u),
19792
19792
  (u) => {
19793
19793
  throw i.disconnect(), u;
@@ -19902,23 +19902,23 @@ let Ld = class extends zn {
19902
19902
  get mediaTrack() {
19903
19903
  return this._mediaTrack;
19904
19904
  }
19905
- setMediaTrack(t) {
19905
+ setMediaTrack(t, e = false) {
19906
19906
  return l(this, null, function* () {
19907
- const e = (r) => {
19907
+ const r = (i) => {
19908
19908
  this.logger.error(`${this.constructorName}.setMediaTrack.error`, {
19909
- error: r
19909
+ error: i
19910
19910
  });
19911
19911
  };
19912
19912
  try {
19913
19913
  this.disableTrack();
19914
- } catch (r) {
19915
- e(r);
19914
+ } catch (i) {
19915
+ r(i);
19916
19916
  }
19917
- this._mediaTrack = yield this.conditionallyChangeTrack(t), yield this.setTransformedTrack();
19917
+ this._mediaTrack = yield this.conditionallyChangeTrack(t, e), yield this.setTransformedTrack();
19918
19918
  try {
19919
19919
  this.addMediaTrackListeners(), yield this.setCurrentDevice();
19920
- } catch (r) {
19921
- e(r);
19920
+ } catch (i) {
19921
+ r(i);
19922
19922
  }
19923
19923
  });
19924
19924
  }
@@ -20088,7 +20088,7 @@ class Wl extends Vf {
20088
20088
  return;
20089
20089
  }
20090
20090
  if (e) {
20091
- this.isCustomTrack = true, yield this.setMediaTrack(e);
20091
+ this.isCustomTrack = true, yield this.setMediaTrack(e, true);
20092
20092
  return;
20093
20093
  }
20094
20094
  this.isCustomTrack = false;
@@ -20129,52 +20129,52 @@ class Wl extends Vf {
20129
20129
  onTrackMuted() {
20130
20130
  this.logger.info("AudioMediaHandler.TrackMuted"), this.emit("trackMuted");
20131
20131
  }
20132
- conditionallyChangeTrack(t) {
20132
+ conditionallyChangeTrack(t, e = false) {
20133
20133
  return l(this, null, function* () {
20134
20134
  var d;
20135
- if (!t || this.userSelectedDevice)
20135
+ if (!t || this.userSelectedDevice || e)
20136
20136
  return t;
20137
- let e = t;
20138
- const r = yield this.mediaInterface.getAudioInputDevices(), i = this.isNonPreferredDevice ? r.filter((c) => c && !this.isNonPreferredDevice(c)) : r;
20139
- if (!(i != null && i.length))
20140
- return e;
20141
- i.find(
20142
- (c) => c.deviceId === t.getSettings().deviceId
20143
- ) || (e.stop(), this.logger.info("localmediahandler::setupstreams::found_audio_non_preferred"), e = yield this.mediaInterface.getAudioTrack(
20137
+ let r = t;
20138
+ const i = yield this.mediaInterface.getAudioInputDevices(), n = this.isNonPreferredDevice ? i.filter((u) => u && !this.isNonPreferredDevice(u)) : i;
20139
+ if (!(n != null && n.length))
20140
+ return r;
20141
+ n.find(
20142
+ (u) => u.deviceId === t.getSettings().deviceId
20143
+ ) || (r.stop(), this.logger.info("localmediahandler::setupstreams::found_audio_non_preferred"), r = yield this.mediaInterface.getAudioTrack(
20144
20144
  false,
20145
- i[0].deviceId
20145
+ n[0].deviceId
20146
20146
  ));
20147
- const n = JSON.parse(
20147
+ const o = JSON.parse(
20148
20148
  Mo.getItem(fu, this.logger)
20149
20149
  );
20150
- if (n != null && n.devices.some(
20151
- (c) => c.label === e.label
20150
+ if (o != null && o.devices.some(
20151
+ (u) => u.label === r.label
20152
20152
  ))
20153
- return e;
20154
- if (!(yield hg(this.logger, e))) {
20155
- const c = (d = n == null ? void 0 : n.devices.concat({
20156
- label: e.label
20157
- })) != null ? d : [{ label: e.label }];
20153
+ return r;
20154
+ if (!(yield hg(this.logger, r))) {
20155
+ const u = (d = o == null ? void 0 : o.devices.concat({
20156
+ label: r.label
20157
+ })) != null ? d : [{ label: r.label }];
20158
20158
  return Mo.setItem(fu, JSON.stringify({
20159
- devices: c
20160
- }), this.logger), e;
20159
+ devices: u
20160
+ }), this.logger), r;
20161
20161
  }
20162
20162
  this.logger.info("AudioMediaHandler.conditionallyChangeTrack.DetectedSilentTrack");
20163
- const o = e.getSettings().deviceId;
20164
- return i.filter((c) => c.deviceId !== o).some((c) => l(this, null, function* () {
20165
- if (e = yield this.mediaInterface.getAudioTrack(
20163
+ const c = r.getSettings().deviceId;
20164
+ return n.filter((u) => u.deviceId !== c).some((u) => l(this, null, function* () {
20165
+ if (r = yield this.mediaInterface.getAudioTrack(
20166
20166
  false,
20167
- c.deviceId
20168
- ), !(yield hg(this.logger, e))) {
20169
- const u = n.devices.concat({
20170
- label: e.label
20167
+ u.deviceId
20168
+ ), !(yield hg(this.logger, r))) {
20169
+ const p = o.devices.concat({
20170
+ label: r.label
20171
20171
  });
20172
20172
  return Mo.setItem(fu, JSON.stringify({
20173
- devices: u
20173
+ devices: p
20174
20174
  }), this.logger), this.logger.info("AudioMediaHandler.conditionallyChangeTrack.SuccesfullyChangedTrack"), true;
20175
20175
  }
20176
20176
  return this.logger.info("AudioMediaHandler.conditionallyChangeTrack.AnotherSilentTrackFound"), false;
20177
- })), e;
20177
+ })), r;
20178
20178
  });
20179
20179
  }
20180
20180
  }
@@ -20203,7 +20203,7 @@ class S0 {
20203
20203
  let e = t;
20204
20204
  if (t || ([e] = (yield a(this, cn).getAvailableDevicesByKind(
20205
20205
  "audiooutput"
20206
- )).filter((d) => !Gu(d))), !e)
20206
+ )).filter((c) => !Gu(c))), !e)
20207
20207
  throw new R("No speaker found", "1608");
20208
20208
  if (((i = this.currentDevice) == null ? void 0 : i.deviceId) === e.deviceId)
20209
20209
  return;
@@ -20213,7 +20213,7 @@ class S0 {
20213
20213
  if (typeof o.sinkId != "undefined" && this.currentDevice.deviceId && o.sinkId !== this.currentDevice.deviceId)
20214
20214
  try {
20215
20215
  yield o.setSinkId(this.currentDevice.deviceId);
20216
- } catch (d) {
20216
+ } catch (c) {
20217
20217
  }
20218
20218
  }));
20219
20219
  });
@@ -20344,7 +20344,7 @@ class zc extends Vf {
20344
20344
  return;
20345
20345
  }
20346
20346
  if (r) {
20347
- this.isCustomTrack = true, yield this.setMediaTrack(r);
20347
+ this.isCustomTrack = true, yield this.setMediaTrack(r, true);
20348
20348
  return;
20349
20349
  }
20350
20350
  this.isCustomTrack = false;
@@ -20408,19 +20408,19 @@ class zc extends Vf {
20408
20408
  onTrackMuted() {
20409
20409
  this.logger.info("VideoMediaHandler.TrackMuted"), this.emit("trackMuted");
20410
20410
  }
20411
- conditionallyChangeTrack(e) {
20411
+ conditionallyChangeTrack(e, r = false) {
20412
20412
  return l(this, null, function* () {
20413
- if (!e || this.userSelectedDevice)
20413
+ if (!e || this.userSelectedDevice || r)
20414
20414
  return e;
20415
- let r = e;
20416
- const i = yield this.mediaInterface.getVideoInputDevices(), n = this.isNonPreferredDevice ? i.filter((o) => !this.isNonPreferredDevice(
20417
- o
20418
- )) : i;
20419
- return !(n != null && n.length) || window.FAST_DYTE || n.find(
20420
- (o) => o.deviceId === e.getSettings().deviceId
20421
- ) || (r.stop(), this.logger.info("localmediahandler::setupstreams::found_video_non_preferred"), r = yield this.mediaInterface.getVideoTrack(
20422
- n[0].deviceId
20423
- )), r;
20415
+ let i = e;
20416
+ const n = yield this.mediaInterface.getVideoInputDevices(), o = this.isNonPreferredDevice ? n.filter((c) => !this.isNonPreferredDevice(
20417
+ c
20418
+ )) : n;
20419
+ return !(o != null && o.length) || window.FAST_DYTE || o.find(
20420
+ (c) => c.deviceId === e.getSettings().deviceId
20421
+ ) || (i.stop(), this.logger.info("localmediahandler::setupstreams::found_video_non_preferred"), i = yield this.mediaInterface.getVideoTrack(
20422
+ o[0].deviceId
20423
+ )), i;
20424
20424
  });
20425
20425
  }
20426
20426
  }
@@ -20526,11 +20526,11 @@ const Da = class {
20526
20526
  return a(this, Ii).configDiff;
20527
20527
  }
20528
20528
  get mediaConstraints() {
20529
- var t, e, r, i, n, o, d, c, u, p, f, S, E, _, P, k, A, N, H, $, F, K, re, Je;
20529
+ var t, e, r, i, n, o, c, d, u, p, f, S, E, _, P, k, A, N, H, $, F, K, re, Je;
20530
20530
  return {
20531
20531
  audio: {
20532
20532
  enableStereo: (i = (r = (e = (t = a(this, Rt)) == null ? void 0 : t.media) == null ? void 0 : e.audio) == null ? void 0 : r.enableStereo) != null ? i : Ca.audio.enableStereo,
20533
- enableHighBitrate: (c = (d = (o = (n = a(this, Rt)) == null ? void 0 : n.media) == null ? void 0 : o.audio) == null ? void 0 : d.enableHighBitrate) != null ? c : Ca.audio.enableHighBitrate
20533
+ enableHighBitrate: (d = (c = (o = (n = a(this, Rt)) == null ? void 0 : n.media) == null ? void 0 : o.audio) == null ? void 0 : c.enableHighBitrate) != null ? d : Ca.audio.enableHighBitrate
20534
20534
  },
20535
20535
  video: {
20536
20536
  quality: (S = (f = (p = (u = a(this, Rt)) == null ? void 0 : u.media) == null ? void 0 : p.video) == null ? void 0 : f.quality) != null ? S : Ca.video.quality,
@@ -20819,12 +20819,12 @@ class Xn {
20819
20819
  }
20820
20820
  nt = /* @__PURE__ */ new WeakMap(), Or = /* @__PURE__ */ new WeakMap(), Nr = /* @__PURE__ */ new WeakMap(), Wd = /* @__PURE__ */ new WeakSet(), $f = function(t, e, r = true) {
20821
20821
  let i;
20822
- const n = a(this, nt)[t], o = Object.prototype.toString.call(e), d = Object.prototype.toString.call(n);
20823
- if (o !== d) {
20822
+ const n = a(this, nt)[t], o = Object.prototype.toString.call(e), c = Object.prototype.toString.call(n);
20823
+ if (o !== c) {
20824
20824
  this.set(t, e);
20825
20825
  return;
20826
20826
  }
20827
- switch (d) {
20827
+ switch (c) {
20828
20828
  case "[object Array]":
20829
20829
  i = [...n, ...e];
20830
20830
  break;
@@ -20894,36 +20894,36 @@ Ai = /* @__PURE__ */ new WeakMap(), Mi = /* @__PURE__ */ new WeakMap(), rc = /*
20894
20894
  var n, o;
20895
20895
  if (e.pluginId !== a(this, Mi))
20896
20896
  return;
20897
- const r = (n = e.storeItems) == null ? void 0 : n.map((d) => {
20898
- var c;
20897
+ const r = (n = e.storeItems) == null ? void 0 : n.map((c) => {
20898
+ var d;
20899
20899
  return {
20900
- timestamp: d.timestamp,
20901
- peerId: d.peerId,
20900
+ timestamp: c.timestamp,
20901
+ peerId: c.peerId,
20902
20902
  payload: JSON.parse(
20903
- (c = d.payload) != null && c.length ? new TextDecoder().decode(d.payload) : "{}"
20903
+ (d = c.payload) != null && d.length ? new TextDecoder().decode(c.payload) : "{}"
20904
20904
  ),
20905
- key: d.storeKey
20905
+ key: c.storeKey
20906
20906
  };
20907
20907
  });
20908
20908
  if (t === W.storeGetKeys) {
20909
- const d = a(this, Lr).get(e.storeName), c = this.stores.get(e.storeName) || (d == null ? void 0 : d.store);
20910
- a(this, Lr).get(e.storeName) && (this.stores.set(e.storeName, d.store), d.resolve(c), clearTimeout(d.rejectTimeout), a(this, Lr).delete(e.storeName)), r.forEach((u) => {
20911
- c.set(u.key, u.payload, false, false);
20909
+ const c = a(this, Lr).get(e.storeName), d = this.stores.get(e.storeName) || (c == null ? void 0 : c.store);
20910
+ 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) => {
20911
+ d.set(u.key, u.payload, false, false);
20912
20912
  });
20913
20913
  return;
20914
20914
  }
20915
20915
  const i = this.stores.get(e.storeName) || ((o = a(this, Lr).get(e.storeName)) == null ? void 0 : o.store);
20916
- i !== void 0 && (t === W.storeInsertKeys && r.forEach(({ key: d, peerId: c, payload: u }) => {
20917
- c !== a(this, rc, Ju) && i.set(d, u, false, true);
20918
- }), t === W.storeDeleteKeys && r.forEach(({ key: d, peerId: c }) => {
20919
- c !== a(this, rc, Ju) && i.delete(d, false, true);
20916
+ i !== void 0 && (t === W.storeInsertKeys && r.forEach(({ key: c, peerId: d, payload: u }) => {
20917
+ d !== a(this, rc, Ju) && i.set(c, u, false, true);
20918
+ }), t === W.storeDeleteKeys && r.forEach(({ key: c, peerId: d }) => {
20919
+ d !== a(this, rc, Ju) && i.delete(c, false, true);
20920
20920
  }));
20921
20921
  })
20922
20922
  );
20923
20923
  });
20924
20924
  };
20925
20925
  function gi(s) {
20926
- var t, e, r, i, n, o, d, c, u, p, f, S, E;
20926
+ var t, e, r, i, n, o, c, d, u, p, f, S, E;
20927
20927
  return s ? {
20928
20928
  media: {
20929
20929
  audio: {
@@ -20940,8 +20940,8 @@ function gi(s) {
20940
20940
  enabled: s.screenShareEnabled,
20941
20941
  permission: "mediaPermissions" in s ? (n = s.mediaPermissions) == null ? void 0 : n.screenshare : null,
20942
20942
  audio: {
20943
- enabled: (d = (o = s.screenShareTracks) == null ? void 0 : o.audio) == null ? void 0 : d.enabled,
20944
- trackId: (u = (c = s.screenShareTracks) == null ? void 0 : c.audio) == null ? void 0 : u.id
20943
+ enabled: (c = (o = s.screenShareTracks) == null ? void 0 : o.audio) == null ? void 0 : c.enabled,
20944
+ trackId: (u = (d = s.screenShareTracks) == null ? void 0 : d.audio) == null ? void 0 : u.id
20945
20945
  },
20946
20946
  video: {
20947
20947
  enabled: (f = (p = s.screenShareTracks) == null ? void 0 : p.video) == null ? void 0 : f.enabled,
@@ -21001,11 +21001,11 @@ let mr = (Lg = class extends qt {
21001
21001
  const { clientWidth: e2, clientHeight: r2 } = t2, { width: i2, height: n2 } = this.videoTrack.getSettings();
21002
21002
  if (!i2 || !n2)
21003
21003
  return;
21004
- const o2 = n2 / r2, d2 = i2 / e2, c2 = Math.max(o2, d2);
21005
- c2 > L0 && a(this, Xs) === 1 ? (m(this, Xs, 0), a(this, $t).getValue("peerSessionStore").emit(b.MAX_SPATIAL_LAYER_CHANGE, {
21004
+ const o2 = n2 / r2, c2 = i2 / e2, d2 = Math.max(o2, c2);
21005
+ d2 > L0 && a(this, Xs) === 1 ? (m(this, Xs, 0), a(this, $t).getValue("peerSessionStore").emit(b.MAX_SPATIAL_LAYER_CHANGE, {
21006
21006
  peerId: this.id,
21007
21007
  maxSpatialLayer: a(this, Xs)
21008
- })) : c2 < N0 && a(this, Xs) === 0 && (m(this, Xs, 1), a(this, $t).getValue("peerSessionStore").emit(b.MAX_SPATIAL_LAYER_CHANGE, {
21008
+ })) : d2 < N0 && a(this, Xs) === 0 && (m(this, Xs, 1), a(this, $t).getValue("peerSessionStore").emit(b.MAX_SPATIAL_LAYER_CHANGE, {
21009
21009
  peerId: this.id,
21010
21010
  maxSpatialLayer: a(this, Xs)
21011
21011
  }));
@@ -21013,8 +21013,8 @@ let mr = (Lg = class extends qt {
21013
21013
  m(this, $t, t);
21014
21014
  const {
21015
21015
  id: o,
21016
- userId: d,
21017
- displayName: c,
21016
+ userId: c,
21017
+ displayName: d,
21018
21018
  device: u,
21019
21019
  picture: p,
21020
21020
  isHost: f,
@@ -21029,7 +21029,7 @@ let mr = (Lg = class extends qt {
21029
21029
  producers: $,
21030
21030
  metadata: F
21031
21031
  } = e;
21032
- this.id = o, this.userId = d, this.name = c, this.device = u, this.picture = p, this.isHost = f, this.flags = S, this.manualProducerConfig = SC, m(this, mn, _ != null ? _ : "ON_STAGE"), this.customParticipantId = P != null ? P : E, this.audioEnabled = !k, this.audioTrack = A, this.videoEnabled = N, this.videoTrack = H, this.screenShareTracks = {
21032
+ this.id = o, this.userId = c, this.name = d, this.device = u, this.picture = p, this.isHost = f, this.flags = S, this.manualProducerConfig = SC, m(this, mn, _ != null ? _ : "ON_STAGE"), this.customParticipantId = P != null ? P : E, this.audioEnabled = !k, this.audioTrack = A, this.videoEnabled = N, this.videoTrack = H, this.screenShareTracks = {
21033
21033
  audio: void 0,
21034
21034
  video: void 0
21035
21035
  }, this.producers = $ != null ? $ : [], this.presetName = F == null ? void 0 : F.preset_name, m(this, gn, false), m(this, Qs, r), m(this, ac, i), this.setupEvents(), this.updateVideo = this.updateVideo.bind(this), V(this, nc, Ku).call(this);
@@ -21515,33 +21515,33 @@ let Pt = (Vg = class extends qt {
21515
21515
  o.manualProducerConfig = B(D({}, o.manualProducerConfig), {
21516
21516
  audio: true
21517
21517
  }), this.videoSubscribed.add(o);
21518
- const d = o.producers.find((c) => c.kind === "audio" && !c.screenShare);
21519
- d && i.push(d);
21518
+ const c = o.producers.find((d) => d.kind === "audio" && !d.screenShare);
21519
+ c && i.push(c);
21520
21520
  }
21521
21521
  if (e.includes("video")) {
21522
21522
  o.manualProducerConfig = B(D({}, o.manualProducerConfig), {
21523
21523
  video: true
21524
21524
  }), this.audioSubscribed.add(o);
21525
- const d = o.producers.find((c) => c.kind === "video" && !c.screenShare);
21526
- d && i.push(d);
21525
+ const c = o.producers.find((d) => d.kind === "video" && !d.screenShare);
21526
+ c && i.push(c);
21527
21527
  }
21528
21528
  if (e.includes("screenshareAudio")) {
21529
21529
  o.manualProducerConfig = B(D({}, o.manualProducerConfig), {
21530
21530
  screenshareAudio: true
21531
21531
  });
21532
- const d = o.producers.find(
21533
- (c) => c.kind === "audio" && c.screenShare
21532
+ const c = o.producers.find(
21533
+ (d) => d.kind === "audio" && d.screenShare
21534
21534
  );
21535
- i.push(d);
21535
+ i.push(c);
21536
21536
  }
21537
21537
  if (e.includes("screenshareVideo")) {
21538
21538
  o.manualProducerConfig = B(D({}, o.manualProducerConfig), {
21539
21539
  screenshareVideo: true
21540
21540
  });
21541
- const d = o.producers.find(
21542
- (c) => c.kind === "video" && c.screenShare
21541
+ const c = o.producers.find(
21542
+ (d) => d.kind === "video" && d.screenShare
21543
21543
  );
21544
- i.push(d);
21544
+ i.push(c);
21545
21545
  }
21546
21546
  }
21547
21547
  }), yield a(this, Li, Po).createConsumers(i);
@@ -21559,33 +21559,33 @@ let Pt = (Vg = class extends qt {
21559
21559
  o.manualProducerConfig = B(D({}, o.manualProducerConfig), {
21560
21560
  audio: false
21561
21561
  });
21562
- const d = o.producers.find((c) => c.kind === "audio" && !c.screenShare);
21563
- d && i.push(d);
21562
+ const c = o.producers.find((d) => d.kind === "audio" && !d.screenShare);
21563
+ c && i.push(c);
21564
21564
  }
21565
21565
  if (e.includes("video")) {
21566
21566
  o.manualProducerConfig = B(D({}, o.manualProducerConfig), {
21567
21567
  video: false
21568
21568
  });
21569
- const d = o.producers.find((c) => c.kind === "video" && !c.screenShare);
21570
- d && i.push(d);
21569
+ const c = o.producers.find((d) => d.kind === "video" && !d.screenShare);
21570
+ c && i.push(c);
21571
21571
  }
21572
21572
  if (e.includes("screenshareAudio")) {
21573
21573
  o.manualProducerConfig = B(D({}, o.manualProducerConfig), {
21574
21574
  screenshareAudio: false
21575
21575
  });
21576
- const d = o.producers.find(
21577
- (c) => c.kind === "audio" && c.screenShare
21576
+ const c = o.producers.find(
21577
+ (d) => d.kind === "audio" && d.screenShare
21578
21578
  );
21579
- i.push(d);
21579
+ i.push(c);
21580
21580
  }
21581
21581
  if (e.includes("screenshareVideo")) {
21582
21582
  o.manualProducerConfig = B(D({}, o.manualProducerConfig), {
21583
21583
  screenshareVideo: false
21584
21584
  });
21585
- const d = o.producers.find(
21586
- (c) => c.kind === "video" && c.screenShare
21585
+ const c = o.producers.find(
21586
+ (d) => d.kind === "video" && d.screenShare
21587
21587
  );
21588
- i.push(d);
21588
+ i.push(c);
21589
21589
  }
21590
21590
  }
21591
21591
  }), yield a(this, Li, Po).closeConsumers(i);
@@ -21601,10 +21601,10 @@ let Pt = (Vg = class extends qt {
21601
21601
  }
21602
21602
  });
21603
21603
  const { compulsoryPeers: t } = this.selectedPeers, e = t.filter(
21604
- (d) => this.joined.has(d)
21604
+ (c) => this.joined.has(c)
21605
21605
  ), r = Array.from(this.pinned.keys()).filter(
21606
- (d) => !e.includes(d)
21607
- ), i = Array.from(this.joined.toArray().filter((d) => d.stageStatus === "ON_STAGE").map((d) => d.id)), n = Math.max(
21606
+ (c) => !e.includes(c)
21607
+ ), i = Array.from(this.joined.toArray().filter((c) => c.stageStatus === "ON_STAGE").map((c) => c.id)), n = Math.max(
21608
21608
  (this.currentPage - 1) * (this.maxActiveParticipantsCount - e.length - r.length)
21609
21609
  ), o = this.currentPage * (this.maxActiveParticipantsCount - e.length - r.length);
21610
21610
  return e.concat(r, i.slice(n, o));
@@ -21889,10 +21889,10 @@ const yd = (xg = class {
21889
21889
  } : void 0;
21890
21890
  this.logger.info("events.selfJoinComplete", n);
21891
21891
  }
21892
- s.forEach(({ peerId: n, producerStates: o, capabilities: d }) => this.onMediaJoined(
21892
+ s.forEach(({ peerId: n, producerStates: o, capabilities: c }) => this.onMediaJoined(
21893
21893
  n,
21894
21894
  o,
21895
- d
21895
+ c
21896
21896
  ));
21897
21897
  const { audioPeers: r, compulsoryPeers: i } = t != null ? t : {};
21898
21898
  e.pinnedPeerIds.length !== 0 && this.onParticipantPinned(e.pinnedPeerIds[0]), this.computeActivateParticipants(r != null ? r : [], i), this.context.getValue("peerSessionStore").emit(b.UPDATE_ACTIVE, { createAllConsumers: true });
@@ -22062,10 +22062,10 @@ const yd = (xg = class {
22062
22062
  }
22063
22063
  selectPagePeers(s) {
22064
22064
  const { compulsoryPeers: t } = this.selectedPeers, e = t.filter(
22065
- (c) => this.participants.joined.has(c)
22065
+ (d) => this.participants.joined.has(d)
22066
22066
  ), r = Array.from(this.participants.pinned.keys()).filter(
22067
- (c) => !e.includes(c)
22068
- ), i = Array.from(this.participants.joined.toArray().filter((c) => c.stageStatus === "ON_STAGE").map((c) => c.id)), n = Math.max(
22067
+ (d) => !e.includes(d)
22068
+ ), i = Array.from(this.participants.joined.toArray().filter((d) => d.stageStatus === "ON_STAGE").map((d) => d.id)), n = Math.max(
22069
22069
  (s - 1) * (this.maxPreferredStreams - e.length - r.length)
22070
22070
  ), o = s * (this.maxPreferredStreams - e.length - r.length);
22071
22071
  return e.concat(r, i.slice(n, o));
@@ -22073,17 +22073,17 @@ const yd = (xg = class {
22073
22073
  selectActivePeers(s) {
22074
22074
  const t = /* @__PURE__ */ new Map(), e = Array.from(
22075
22075
  this.participants.joined.toArray().filter((p) => p.stageStatus === "ON_STAGE").map((p) => (t.set(p.id, true), p.id))
22076
- ), r = this.selectedPeers.peers, i = this.participants.pinned.toArray().reduce((p, f) => (f.stageStatus !== "ON_STAGE" ? this.participants.pinned.delete(f.id) : p.push(f.id), p), []), n = this.self.stageStatus === "ON_STAGE" ? 1 : 0, o = s - n, d = new Set(
22076
+ ), r = this.selectedPeers.peers, i = this.participants.pinned.toArray().reduce((p, f) => (f.stageStatus !== "ON_STAGE" ? this.participants.pinned.delete(f.id) : p.push(f.id), p), []), n = this.self.stageStatus === "ON_STAGE" ? 1 : 0, o = s - n, c = new Set(
22077
22077
  r.concat(i).filter((p) => p !== this.self.id && t.has(p))
22078
22078
  );
22079
- let c = Array.from(d);
22080
- const u = o - d.size;
22079
+ let d = Array.from(c);
22080
+ const u = o - c.size;
22081
22081
  if (u >= 0) {
22082
- const p = e.filter((f) => !d.has(f) && f !== this.self.id).slice(0, u);
22083
- c = Array.from(d).concat(p);
22082
+ const p = e.filter((f) => !c.has(f) && f !== this.self.id).slice(0, u);
22083
+ d = Array.from(c).concat(p);
22084
22084
  } else
22085
- c = c.slice(0, o);
22086
- return c;
22085
+ d = d.slice(0, o);
22086
+ return d;
22087
22087
  }
22088
22088
  updateSubscriptions(s, t) {
22089
22089
  const { page: e, createAllConsumers: r } = t != null ? t : {};
@@ -22093,20 +22093,20 @@ const yd = (xg = class {
22093
22093
  case "PAGINATED": {
22094
22094
  if (!n)
22095
22095
  return;
22096
- const o = this.selectPagePeers(n), d = this.selectActivePeers(
22096
+ const o = this.selectPagePeers(n), c = this.selectActivePeers(
22097
22097
  this.participants.maxActiveParticipantsCount + 4
22098
22098
  );
22099
- this.updateParticipantsMap(this.participants.videoSubscribed, o), this.updateParticipantsMap(this.participants.audioSubscribed, d), this.logger.debug(
22099
+ this.updateParticipantsMap(this.participants.videoSubscribed, o), this.updateParticipantsMap(this.participants.audioSubscribed, c), this.logger.debug(
22100
22100
  "ParticipantController::updateActive::updating_current_page_peers",
22101
22101
  { peerIds: o }
22102
22102
  );
22103
22103
  break;
22104
22104
  }
22105
22105
  case "ACTIVE_GRID": {
22106
- const o = this.selectActivePeers(this.participants.maxActiveParticipantsCount), d = this.selectActivePeers(
22106
+ const o = this.selectActivePeers(this.participants.maxActiveParticipantsCount), c = this.selectActivePeers(
22107
22107
  this.participants.maxActiveParticipantsCount + 4
22108
22108
  );
22109
- this.updateParticipantsMapMinReplacement(this.participants.videoSubscribed, o), this.updateParticipantsMap(this.participants.audioSubscribed, d);
22109
+ this.updateParticipantsMapMinReplacement(this.participants.videoSubscribed, o), this.updateParticipantsMap(this.participants.audioSubscribed, c);
22110
22110
  break;
22111
22111
  }
22112
22112
  default:
@@ -22116,8 +22116,8 @@ const yd = (xg = class {
22116
22116
  }
22117
22117
  syncConsumers() {
22118
22118
  return l(this, null, function* () {
22119
- var o, d, c;
22120
- if (((c = (d = (o = this.context.getValue("connectionHandler")) == null ? void 0 : o.mediaState) == null ? void 0 : d.recv) == null ? void 0 : c.state) !== "connected")
22119
+ var o, c, d;
22120
+ if (((d = (c = (o = this.context.getValue("connectionHandler")) == null ? void 0 : o.mediaState) == null ? void 0 : c.recv) == null ? void 0 : d.state) !== "connected")
22121
22121
  return;
22122
22122
  if (a(this, Fi)) {
22123
22123
  m(this, Sn, true);
@@ -22209,8 +22209,8 @@ const yd = (xg = class {
22209
22209
  }
22210
22210
  updateParticipantsMapMinReplacement(s, t) {
22211
22211
  const e = Array.from(s.keys()), r = new Map(s), i = new Set(t), n = [];
22212
- e.forEach((o, d) => {
22213
- (!i.has(o) || !this.participants.joined.get(o)) && n.push(d);
22212
+ e.forEach((o, c) => {
22213
+ (!i.has(o) || !this.participants.joined.get(o)) && n.push(c);
22214
22214
  }), t.forEach((o) => {
22215
22215
  if (s.get(o))
22216
22216
  return;
@@ -22218,8 +22218,8 @@ const yd = (xg = class {
22218
22218
  e.push(o);
22219
22219
  return;
22220
22220
  }
22221
- const d = n.shift();
22222
- e[d] = o;
22221
+ const c = n.shift();
22222
+ e[c] = o;
22223
22223
  }), n.forEach((o) => {
22224
22224
  e.splice(o, 1);
22225
22225
  }), Array.from(s.keys()).forEach((o) => {
@@ -22344,8 +22344,8 @@ const yd = (xg = class {
22344
22344
  peerId: r,
22345
22345
  scoreStats: i
22346
22346
  }) => {
22347
- var d;
22348
- const n = t === "video" && ((d = e == null ? void 0 : e.screenShare) != null ? d : false), o = this.participants.joined.get(r);
22347
+ var c;
22348
+ const n = t === "video" && ((c = e == null ? void 0 : e.screenShare) != null ? c : false), o = this.participants.joined.get(r);
22349
22349
  o && (o.emit("mediaScoreUpdate", {
22350
22350
  kind: t,
22351
22351
  isScreenshare: n,
@@ -22420,8 +22420,8 @@ const yd = (xg = class {
22420
22420
  appData: i,
22421
22421
  track: n,
22422
22422
  producerId: o,
22423
- rtpReceiver: d,
22424
- paused: c
22423
+ rtpReceiver: c,
22424
+ paused: d
22425
22425
  } = (p = t.get(s)) != null ? p : {};
22426
22426
  if (!e)
22427
22427
  return this.logger.warn("processMedia::Peer ID is undefined", {
@@ -22433,7 +22433,7 @@ const yd = (xg = class {
22433
22433
  supportsRemoteControl: !!(i != null && i.supportsRemoteControl),
22434
22434
  screenShare: !!(i != null && i.screenShare)
22435
22435
  },
22436
- remotelyPaused: c,
22436
+ remotelyPaused: d,
22437
22437
  producerId: o
22438
22438
  }
22439
22439
  }), {};
@@ -22444,23 +22444,23 @@ const yd = (xg = class {
22444
22444
  peerId: e,
22445
22445
  kind: r,
22446
22446
  appData: u,
22447
- remotelyPaused: c,
22447
+ remotelyPaused: d,
22448
22448
  producerId: o
22449
22449
  }
22450
22450
  }), this.consumerPeerMap.set(s, {
22451
22451
  type: r,
22452
22452
  peerId: e,
22453
22453
  appData: u,
22454
- remotelyPaused: c,
22454
+ remotelyPaused: d,
22455
22455
  producerId: o
22456
22456
  }), {
22457
22457
  peerId: e,
22458
22458
  kind: r,
22459
22459
  appData: u,
22460
- remotelyPaused: c,
22460
+ remotelyPaused: d,
22461
22461
  track: n,
22462
22462
  producerId: o,
22463
- rtpReceiver: d
22463
+ rtpReceiver: c
22464
22464
  };
22465
22465
  }
22466
22466
  processConsumerClosed(s) {
@@ -22482,16 +22482,16 @@ const yd = (xg = class {
22482
22482
  }
22483
22483
  }), this.consumerPeerMap.delete(s), e === "video" && r.screenShare !== true && this.videoPeerConsumerMap.delete(t), !o)
22484
22484
  return;
22485
- const d = [];
22486
- r && r.screenShare ? (o.setScreenShareEnabled(false), this.context.getValue("callstats").consumerSharedMediaState(s, { screen: false }), o.screenShareTracks.video && d.push(o.screenShareTracks.video.id), o.screenShareTracks.audio && d.push(o.screenShareTracks.audio.id), o.screenShareTracks = {
22485
+ const c = [];
22486
+ r && r.screenShare ? (o.setScreenShareEnabled(false), this.context.getValue("callstats").consumerSharedMediaState(s, { screen: false }), o.screenShareTracks.video && c.push(o.screenShareTracks.video.id), o.screenShareTracks.audio && c.push(o.screenShareTracks.audio.id), o.screenShareTracks = {
22487
22487
  audio: void 0,
22488
22488
  video: void 0
22489
- }) : e === "audio" ? (o.setAudioEnabled(false), o.audioTrack && d.push(o.audioTrack.id), this.context.getValue("callstats").consumerSharedMediaState(s, { audio: false }), o.audioTrack = void 0) : e === "video" && (o.setVideoEnabled(false), this.updatePipSource(o.id, false), o.videoTrack && d.push(o.videoTrack.id), this.context.getValue("callstats").consumerSharedMediaState(s, { video: false }), o.videoTrack = void 0), r.e2ee && d.forEach((c) => {
22489
+ }) : e === "audio" ? (o.setAudioEnabled(false), o.audioTrack && c.push(o.audioTrack.id), this.context.getValue("callstats").consumerSharedMediaState(s, { audio: false }), o.audioTrack = void 0) : e === "video" && (o.setVideoEnabled(false), this.updatePipSource(o.id, false), o.videoTrack && c.push(o.videoTrack.id), this.context.getValue("callstats").consumerSharedMediaState(s, { video: false }), o.videoTrack = void 0), r.e2ee && c.forEach((d) => {
22490
22490
  this.context.getValue("peerSessionStore").emit(
22491
22491
  b.E2EE_INACTIVE_CONSUMER,
22492
22492
  {
22493
22493
  peerId: t,
22494
- trackId: c
22494
+ trackId: d
22495
22495
  }
22496
22496
  );
22497
22497
  });
@@ -22505,7 +22505,7 @@ const yd = (xg = class {
22505
22505
  track: i,
22506
22506
  remotelyPaused: n,
22507
22507
  producerId: o,
22508
- rtpReceiver: d
22508
+ rtpReceiver: c
22509
22509
  } = this.processMedia(s);
22510
22510
  if (!t)
22511
22511
  return;
@@ -22519,14 +22519,14 @@ const yd = (xg = class {
22519
22519
  producerId: o
22520
22520
  }
22521
22521
  });
22522
- const c = this.participants.joined.get(t);
22523
- if (c) {
22524
- if (r.e2ee && this.context.getValue("peerSessionStore").emit(b.E2EE_ACTIVE_CONSUMER, { peerId: t, rtpReceiver: d, track: i }), r.screenShare) {
22525
- e === "video" ? c.screenShareTracks.video = i : e === "audio" && (c.screenShareTracks.audio = i), c.setScreenShareEnabled(true), (u = this.context) == null || u.getValue("callstats").consumerSharedMediaState(s, { screen: true });
22522
+ const d = this.participants.joined.get(t);
22523
+ if (d) {
22524
+ if (r.e2ee && this.context.getValue("peerSessionStore").emit(b.E2EE_ACTIVE_CONSUMER, { peerId: t, rtpReceiver: c, track: i }), r.screenShare) {
22525
+ e === "video" ? d.screenShareTracks.video = i : e === "audio" && (d.screenShareTracks.audio = i), d.setScreenShareEnabled(true), (u = this.context) == null || u.getValue("callstats").consumerSharedMediaState(s, { screen: true });
22526
22526
  return;
22527
22527
  }
22528
- e === "video" ? (c.videoTrack = i, c.setVideoEnabled(true), this.updatePipSource(c.id, true), this.context.getValue("callstats").consumerSharedMediaState(s, { video: true })) : e === "audio" && (c.audioTrack = i, c.setAudioEnabled(c.audioEnabled), this.context.getValue("callstats").consumerSharedMediaState(s, {
22529
- audio: c.audioEnabled
22528
+ e === "video" ? (d.videoTrack = i, d.setVideoEnabled(true), this.updatePipSource(d.id, true), this.context.getValue("callstats").consumerSharedMediaState(s, { video: true })) : e === "audio" && (d.audioTrack = i, d.setAudioEnabled(d.audioEnabled), this.context.getValue("callstats").consumerSharedMediaState(s, {
22529
+ audio: d.audioEnabled
22530
22530
  }));
22531
22531
  }
22532
22532
  }
@@ -22554,9 +22554,9 @@ const yd = (xg = class {
22554
22554
  producerId: o
22555
22555
  }
22556
22556
  });
22557
- const d = this.participants.joined.get(t);
22558
- d && (r && i.e2ee && this.context.getValue("peerSessionStore").emit(b.E2EE_INACTIVE_CONSUMER, { peerId: t, trackId: r.id }), e === "video" ? (d.videoTrack = r, d.setVideoEnabled(false), this.updatePipSource(d.id, false), this.context.getValue("callstats").consumerSharedMediaState(s, { video: false })) : e === "audio" && (d.audioTrack = r, d.setAudioEnabled(d.audioEnabled), this.context.getValue("callstats").consumerSharedMediaState(s, {
22559
- audio: d.audioEnabled
22557
+ const c = this.participants.joined.get(t);
22558
+ c && (r && i.e2ee && this.context.getValue("peerSessionStore").emit(b.E2EE_INACTIVE_CONSUMER, { peerId: t, trackId: r.id }), e === "video" ? (c.videoTrack = r, c.setVideoEnabled(false), this.updatePipSource(c.id, false), this.context.getValue("callstats").consumerSharedMediaState(s, { video: false })) : e === "audio" && (c.audioTrack = r, c.setAudioEnabled(c.audioEnabled), this.context.getValue("callstats").consumerSharedMediaState(s, {
22559
+ audio: c.audioEnabled
22560
22560
  })));
22561
22561
  }
22562
22562
  processNewConsumer(s) {
@@ -22567,7 +22567,7 @@ const yd = (xg = class {
22567
22567
  track: i,
22568
22568
  appData: n,
22569
22569
  producerId: o,
22570
- rtpReceiver: d
22570
+ rtpReceiver: c
22571
22571
  } = this.processMedia(s);
22572
22572
  if (!t)
22573
22573
  return;
@@ -22581,10 +22581,10 @@ const yd = (xg = class {
22581
22581
  producerId: o
22582
22582
  }
22583
22583
  });
22584
- const c = this.participants.joined.get(t);
22585
- if (c) {
22584
+ const d = this.participants.joined.get(t);
22585
+ if (d) {
22586
22586
  if (n.screenShare) {
22587
- e === "video" ? c.screenShareTracks.video = i : e === "audio" && (c.screenShareTracks.audio = i), (!r || this.self.permissions.isRecorder || this.context.getValue("flagsmith").hasFeature(Z.SCREEENSHARE_ERR_HACK)) && c.setScreenShareEnabled(true), n.supportsRemoteControl && (c.supportsRemoteControl = true), this.participants.broadcastMessage("screenshareConsumerCreated", {
22587
+ e === "video" ? d.screenShareTracks.video = i : e === "audio" && (d.screenShareTracks.audio = i), (!r || this.self.permissions.isRecorder || this.context.getValue("flagsmith").hasFeature(Z.SCREEENSHARE_ERR_HACK)) && d.setScreenShareEnabled(true), n.supportsRemoteControl && (d.supportsRemoteControl = true), this.participants.broadcastMessage("screenshareConsumerCreated", {
22588
22588
  producerId: o,
22589
22589
  peerId: t,
22590
22590
  screenShare: true,
@@ -22602,15 +22602,15 @@ const yd = (xg = class {
22602
22602
  });
22603
22603
  return;
22604
22604
  }
22605
- e === "video" ? (c.videoTrack = i, r || (c.setVideoEnabled(true), this.updatePipSource(c.id, true)), this.context.getValue("callstats").consumerSharedMediaState(s, {
22605
+ e === "video" ? (d.videoTrack = i, r || (d.setVideoEnabled(true), this.updatePipSource(d.id, true)), this.context.getValue("callstats").consumerSharedMediaState(s, {
22606
22606
  video: !r
22607
- })) : e === "audio" && (c.audioTrack = i, r || c.setAudioEnabled(true), this.context.getValue("callstats").consumerSharedMediaState(s, {
22607
+ })) : e === "audio" && (d.audioTrack = i, r || d.setAudioEnabled(true), this.context.getValue("callstats").consumerSharedMediaState(s, {
22608
22608
  audio: !r
22609
- })), !r && n.e2ee && this.context.getValue("peerSessionStore").emit(b.E2EE_ACTIVE_CONSUMER, { peerId: t, rtpReceiver: d, track: i });
22609
+ })), !r && n.e2ee && this.context.getValue("peerSessionStore").emit(b.E2EE_ACTIVE_CONSUMER, { peerId: t, rtpReceiver: c, track: i });
22610
22610
  }
22611
22611
  }
22612
22612
  static formatSocketServiceMessage(s) {
22613
- var e, r, i, n, o, d;
22613
+ var e, r, i, n, o, c;
22614
22614
  if (!s)
22615
22615
  return;
22616
22616
  const t = Dh(s.stageType);
@@ -22632,12 +22632,12 @@ const yd = (xg = class {
22632
22632
  flags: {
22633
22633
  hiddenParticipant: (i = s.flags) == null ? void 0 : i.hiddenParticipant,
22634
22634
  hidden_participant: (n = s.flags) == null ? void 0 : n.hiddenParticipant,
22635
- recorder: ((o = s.flags) == null ? void 0 : o.recorderType) !== void 0 && ((d = s.flags) == null ? void 0 : d.recorderType) !== "NONE"
22635
+ recorder: ((o = s.flags) == null ? void 0 : o.recorderType) !== void 0 && ((c = s.flags) == null ? void 0 : c.recorderType) !== "NONE"
22636
22636
  }
22637
22637
  };
22638
22638
  }
22639
22639
  mapPeerIdsToProducers(s, t) {
22640
- const e = (i, n) => i.filter(({ kind: o, screenShare: d }) => n.includes(o) || d && n.includes("screenshare"));
22640
+ const e = (i, n) => i.filter(({ kind: o, screenShare: c }) => n.includes(o) || c && n.includes("screenshare"));
22641
22641
  return s.flatMap((i) => {
22642
22642
  const n = this.participants.joined.get(i);
22643
22643
  if (n)
@@ -22710,15 +22710,15 @@ const Oa = class extends qt {
22710
22710
  connectedMeetings: i2,
22711
22711
  plugins: n2,
22712
22712
  polls: o2,
22713
- media: d
22714
- } = u, c = go(u, [
22713
+ media: c
22714
+ } = u, d = go(u, [
22715
22715
  "chat",
22716
22716
  "connectedMeetings",
22717
22717
  "plugins",
22718
22718
  "polls",
22719
22719
  "media"
22720
22720
  ]);
22721
- 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), d) {
22721
+ 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) {
22722
22722
  const E = (P) => {
22723
22723
  switch (P) {
22724
22724
  case Yr.NONE:
@@ -22737,15 +22737,15 @@ const Oa = class extends qt {
22737
22737
  video: void 0,
22738
22738
  screenshare: void 0
22739
22739
  };
22740
- (p = d.audio) != null && p.canProduce && (_.audio = {
22741
- canProduce: E(d.audio.canProduce)
22742
- }), (f = d.video) != null && f.canProduce && (_.video = {
22743
- canProduce: E(d.video.canProduce)
22744
- }), (S = d.screenshare) != null && S.canProduce && (_.screenshare = {
22745
- canProduce: E(d.screenshare.canProduce)
22740
+ (p = c.audio) != null && p.canProduce && (_.audio = {
22741
+ canProduce: E(c.audio.canProduce)
22742
+ }), (f = c.video) != null && f.canProduce && (_.video = {
22743
+ canProduce: E(c.video.canProduce)
22744
+ }), (S = c.screenshare) != null && S.canProduce && (_.screenshare = {
22745
+ canProduce: E(c.screenshare.canProduce)
22746
22746
  }), _r(a(this, q).media, _);
22747
22747
  }
22748
- n2 && (_r(a(this, q).plugins, n2), this.emit("pluginsUpdate")), o2 && (_r(a(this, q).polls, o2), this.emit("pollsUpdate")), Object.keys(c).length !== 0 && _r(a(this, q), c), this.emit("permissionsUpdate", e2);
22748
+ 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);
22749
22749
  });
22750
22750
  if (!r)
22751
22751
  throw this.logger.error("DytePermissionsPreset::load_preset_permissions_failed"), new R("Could not load preset permissions.", "0904");
@@ -22947,7 +22947,7 @@ class Gf extends qt {
22947
22947
  }
22948
22948
  updatePermission() {
22949
22949
  return l(this, null, function* () {
22950
- var c, u;
22950
+ var d, u;
22951
22951
  const e = (p, f) => {
22952
22952
  this.mediaPermissions[p] = f;
22953
22953
  const S = { message: this.mediaPermissions[p], kind: p };
@@ -22955,9 +22955,9 @@ class Gf extends qt {
22955
22955
  };
22956
22956
  if (Te.getName() === "firefox")
22957
22957
  return;
22958
- const r = "microphone", i = "camera", n = yield (c = navigator == null ? void 0 : navigator.permissions) == null ? void 0 : c.query({ name: r }), o = yield (u = navigator == null ? void 0 : navigator.permissions) == null ? void 0 : u.query({
22958
+ const r = "microphone", i = "camera", n = yield (d = navigator == null ? void 0 : navigator.permissions) == null ? void 0 : d.query({ name: r }), o = yield (u = navigator == null ? void 0 : navigator.permissions) == null ? void 0 : u.query({
22959
22959
  name: i
22960
- }), d = (p, f) => {
22960
+ }), c = (p, f) => {
22961
22961
  switch (f) {
22962
22962
  case "granted":
22963
22963
  e(p, "ACCEPTED");
@@ -22971,7 +22971,7 @@ class Gf extends qt {
22971
22971
  }
22972
22972
  this.localMediaHandler.repopulateAvailableDevices();
22973
22973
  };
22974
- n && (n.onchange = () => d("audio", n.state)), o && (o.onchange = () => d("video", o.state));
22974
+ n && (n.onchange = () => c("audio", n.state)), o && (o.onchange = () => c("video", o.state));
22975
22975
  });
22976
22976
  }
22977
22977
  populateMediaPermissionsInCallstats(i) {
@@ -22979,18 +22979,18 @@ class Gf extends qt {
22979
22979
  message: e,
22980
22980
  kind: r
22981
22981
  }) {
22982
- var n, o, d, c;
22982
+ var n, o, c, d;
22983
22983
  switch (r) {
22984
22984
  case "audio": {
22985
22985
  (n = a(this, us)) == null || n.getValue("callstats").mediaPermission("AUDIO", e), (o = a(this, us)) == null || o.getValue("callstats").mediaPermission("SPEAKER", e);
22986
22986
  break;
22987
22987
  }
22988
22988
  case "video": {
22989
- (d = a(this, us)) == null || d.getValue("callstats").mediaPermission("VIDEO", e);
22989
+ (c = a(this, us)) == null || c.getValue("callstats").mediaPermission("VIDEO", e);
22990
22990
  break;
22991
22991
  }
22992
22992
  case "screenshare": {
22993
- (c = a(this, us)) == null || c.getValue("callstats").mediaPermission("SCREENSHARE", e);
22993
+ (d = a(this, us)) == null || d.getValue("callstats").mediaPermission("SCREENSHARE", e);
22994
22994
  break;
22995
22995
  }
22996
22996
  }
@@ -23002,7 +23002,7 @@ class Gf extends qt {
23002
23002
  }
23003
23003
  init() {
23004
23004
  return l(this, arguments, function* (e = {}, r = false, i = null) {
23005
- var n, o, d, c, u, p, f;
23005
+ var n, o, c, d, u, p, f;
23006
23006
  if (Te.init(), !this.localMediaHandler)
23007
23007
  try {
23008
23008
  let S = true;
@@ -23016,7 +23016,7 @@ class Gf extends qt {
23016
23016
  i,
23017
23017
  e.constraints,
23018
23018
  (o = i == null ? void 0 : i.getValue("defaults")) == null ? void 0 : o.isNonPreferredDevice,
23019
- (d = i == null ? void 0 : i.getValue("defaults")) == null ? void 0 : d.autoSwitchAudioDevice
23019
+ (c = i == null ? void 0 : i.getValue("defaults")) == null ? void 0 : c.autoSwitchAudioDevice
23020
23020
  );
23021
23021
  if (i == null || i.getValue("peerSessionStore").on(
23022
23022
  b.MEDIA_PERMISSION_UPDATE,
@@ -23054,7 +23054,7 @@ class Gf extends qt {
23054
23054
  }), this.emit("mediaPermissionError", E), this.emit("mediaPermissionUpdate", { message: P, kind: _ });
23055
23055
  })
23056
23056
  ), S) {
23057
- this.logger.info(`Setting up DyteSelfMedia streams using media handler. audio:${(c = e == null ? void 0 : e.audio) != null ? c : true} video:${(u = e == null ? void 0 : e.video) != null ? u : true}`);
23057
+ this.logger.info(`Setting up DyteSelfMedia streams using media handler. audio:${(d = e == null ? void 0 : e.audio) != null ? d : true} video:${(u = e == null ? void 0 : e.video) != null ? u : true}`);
23058
23058
  const E = this.localMediaHandler.setupStreams({
23059
23059
  video: (p = e == null ? void 0 : e.video) != null ? p : true,
23060
23060
  audio: (f = e == null ? void 0 : e.audio) != null ? f : true
@@ -23249,9 +23249,9 @@ const yo = {}, ii = {
23249
23249
  }) {
23250
23250
  return (r, i, n) => {
23251
23251
  const o = n.value;
23252
- return n.value = function(...c) {
23252
+ return n.value = function(...d) {
23253
23253
  var _, P;
23254
- const u = (P = (this == null ? void 0 : this.peerId) || ((_ = c[0]) == null ? void 0 : _.authToken)) != null ? P : "", p = `${t}-${u}`, f = this == null ? void 0 : this.logger;
23254
+ 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;
23255
23255
  if (yo[p]) {
23256
23256
  const k = new Error(
23257
23257
  `Unsupported concurrent calls on Dyte method: ${s}.`
@@ -23270,7 +23270,7 @@ const yo = {}, ii = {
23270
23270
  const S = setTimeout(
23271
23271
  () => delete yo[p],
23272
23272
  e
23273
- ), E = o.apply(this, c);
23273
+ ), E = o.apply(this, d);
23274
23274
  return Promise.resolve(E).then(() => {
23275
23275
  delete yo[p], clearTimeout(S);
23276
23276
  }).catch(() => {
@@ -23287,7 +23287,7 @@ var j0 = Object.defineProperty, G0 = Object.getOwnPropertyDescriptor, Ct = (s, t
23287
23287
  }, yn, vt, Tn, He, er, di, je, Xe, En, Td, xe, Be, _n, Pn, oc, Yu, Ug;
23288
23288
  let Qe = (Ug = class extends Gf {
23289
23289
  constructor(t, e, r, i, n) {
23290
- var d;
23290
+ var c;
23291
23291
  const o = t.getValue("logger");
23292
23292
  super(o);
23293
23293
  g(this, er);
@@ -23313,7 +23313,7 @@ let Qe = (Ug = class extends Gf {
23313
23313
  h(this, "roomState", "init");
23314
23314
  g(this, _n, /* @__PURE__ */ new Set());
23315
23315
  g(this, Pn, /* @__PURE__ */ new Set());
23316
- m(this, He, t), this.userId = e.id, this.name = e.name, this.picture = e.picture, this.customParticipantId = (d = e.customParticipantId) != null ? d : e.clientSpecificId, this.waitlistStatus = "none", m(this, vt, r), m(this, yn, i), this.hidden = false, m(this, Tn, false), this.organizationId = e.organizationId, this.supportsRemoteControl = Te.isElectron(), this.device = Te.getDeviceInfo(), this.presetName = n, i.viewType !== Mt.Chat && this.updatePermission(), this.updateVideo = this.updateVideo.bind(this), V(this, oc, Yu).call(this);
23316
+ m(this, He, t), this.userId = e.id, this.name = e.name, this.picture = e.picture, this.customParticipantId = (c = e.customParticipantId) != null ? c : e.clientSpecificId, this.waitlistStatus = "none", m(this, vt, r), m(this, yn, i), this.hidden = false, m(this, Tn, false), this.organizationId = e.organizationId, this.supportsRemoteControl = Te.isElectron(), this.device = Te.getDeviceInfo(), this.presetName = n, i.viewType !== Mt.Chat && this.updatePermission(), this.updateVideo = this.updateVideo.bind(this), V(this, oc, Yu).call(this);
23317
23317
  }
23318
23318
  get telemetry() {
23319
23319
  return a(this, He).getValue("telemetry");
@@ -23330,8 +23330,8 @@ let Qe = (Ug = class extends Gf {
23330
23330
  static __init__(t, e, r, i, n, o = false) {
23331
23331
  return l(this, null, function* () {
23332
23332
  var S, E, _, P, k, A;
23333
- let d = (E = (S = t.getValue("defaults")) == null ? void 0 : S.audio) != null ? E : true, c = (P = (_ = t.getValue("defaults")) == null ? void 0 : _.video) != null ? P : true;
23334
- r.canProduceAudio !== "ALLOWED" && (d = false), r.canProduceVideo !== "ALLOWED" && (c = false);
23333
+ 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;
23334
+ r.canProduceAudio !== "ALLOWED" && (c = false), r.canProduceVideo !== "ALLOWED" && (d = false);
23335
23335
  const u = new Qe(t, e, r, i, n);
23336
23336
  if (i.viewType === Mt.Chat)
23337
23337
  return u;
@@ -23339,8 +23339,8 @@ let Qe = (Ug = class extends Gf {
23339
23339
  _r(p, (k = t.getValue("defaults")) == null ? void 0 : k.mediaConfiguration);
23340
23340
  const f = (A = t.getValue("defaults")) == null ? void 0 : A.mediaHandler;
23341
23341
  return f && (f.context = t), yield u.init({
23342
- audio: d,
23343
- video: c,
23342
+ audio: c,
23343
+ video: d,
23344
23344
  constraints: p
23345
23345
  }, o, t), u.setupEvents(), u;
23346
23346
  });
@@ -23675,8 +23675,8 @@ let Qe = (Ug = class extends Gf {
23675
23675
  const o = (r = t.srcObject) == null ? void 0 : r.getTracks()[0];
23676
23676
  if ((o == null ? void 0 : o.id) === this.videoTrack.id)
23677
23677
  return;
23678
- const d = new MediaStream();
23679
- d.addTrack(this.videoTrack), t.srcObject = d, e || (i = a(this, er, di)) == null || i.enableSource(this.id);
23678
+ const c = new MediaStream();
23679
+ c.addTrack(this.videoTrack), t.srcObject = c, e || (i = a(this, er, di)) == null || i.enableSource(this.id);
23680
23680
  } else
23681
23681
  t.srcObject = void 0, e || (n = a(this, er, di)) == null || n.disableSource(this.id);
23682
23682
  t.style.display = this.videoEnabled ? "block" : "none";
@@ -23809,17 +23809,17 @@ class Qu {
23809
23809
  enqueuedAt: Date.now(),
23810
23810
  executedAt: void 0,
23811
23811
  completed: false,
23812
- resolve: (d) => {
23812
+ resolve: (c) => {
23813
23813
  if (o.completed)
23814
23814
  return;
23815
- o.completed = true, this.pendingTasks.delete(o.id), i(d);
23816
- const [c] = this.pendingTasks.values();
23817
- c && !c.executedAt && this.execute(c);
23815
+ o.completed = true, this.pendingTasks.delete(o.id), i(c);
23816
+ const [d] = this.pendingTasks.values();
23817
+ d && !d.executedAt && this.execute(d);
23818
23818
  },
23819
- reject: (d) => {
23820
- if (!o.completed && (o.completed = true, this.pendingTasks.delete(o.id), n(d), !this.stopping)) {
23821
- const [c] = this.pendingTasks.values();
23822
- c && !c.executedAt && this.execute(c);
23819
+ reject: (c) => {
23820
+ if (!o.completed && (o.completed = true, this.pendingTasks.delete(o.id), n(c), !this.stopping)) {
23821
+ const [d] = this.pendingTasks.values();
23822
+ d && !d.executedAt && this.execute(d);
23823
23823
  }
23824
23824
  }
23825
23825
  };
@@ -23905,25 +23905,25 @@ function Wf(s, t) {
23905
23905
  maxRetryCount: 3,
23906
23906
  delayTime: 10
23907
23907
  }, t);
23908
- let d = 0, c, u = false;
23908
+ let c = 0, d, u = false;
23909
23909
  const p = (f) => {
23910
23910
  u = true, r(f);
23911
23911
  };
23912
- for (; d < n; ) {
23912
+ for (; c < n; ) {
23913
23913
  try {
23914
- const f = yield s(d, p);
23914
+ const f = yield s(c, p);
23915
23915
  return e(f);
23916
23916
  } catch (f) {
23917
- if (c = f, u)
23917
+ if (d = f, u)
23918
23918
  break;
23919
- if (d < n)
23920
- i === "linear" ? yield gg(o * (d + 1)) : i === "exponential" && (yield gg(o * (d + Math.max(0, d - 1))));
23919
+ if (c < n)
23920
+ i === "linear" ? yield gg(o * (c + 1)) : i === "exponential" && (yield gg(o * (c + Math.max(0, c - 1))));
23921
23921
  else
23922
23922
  break;
23923
23923
  }
23924
- d += 1;
23924
+ c += 1;
23925
23925
  }
23926
- return r(c);
23926
+ return r(d);
23927
23927
  }));
23928
23928
  });
23929
23929
  }
@@ -23948,7 +23948,7 @@ function cd(s) {
23948
23948
  }
23949
23949
  function z0(s) {
23950
23950
  const t = RTCRtpReceiver.getCapabilities("audio"), e = RTCRtpReceiver.getCapabilities("video"), r = RTCRtpSender.getCapabilities("audio"), i = RTCRtpSender.getCapabilities("video");
23951
- s && (e.codecs = e.codecs.filter(({ mimeType: c }) => s === c), i.codecs = i.codecs.filter(({ mimeType: c }) => s === c));
23951
+ s && (e.codecs = e.codecs.filter(({ mimeType: d }) => s === d), i.codecs = i.codecs.filter(({ mimeType: d }) => s === d));
23952
23952
  const n = {
23953
23953
  audio: cd(t),
23954
23954
  video: cd(e)
@@ -24174,13 +24174,13 @@ class Kl extends ut.EventEmitter {
24174
24174
  setTimeout(o, r, "event request timeout");
24175
24175
  try {
24176
24176
  this.emit(e.toString(), ...i, n, o);
24177
- } catch (d) {
24177
+ } catch (c) {
24178
24178
  this.logger.error(
24179
24179
  `EnhancedEventEmitter:: safeEmitAsPromise() | event listener for event ${e.toString()} threw an error [event:%s]:%o`,
24180
24180
  {
24181
- error: d
24181
+ error: c
24182
24182
  }
24183
- ), o(d);
24183
+ ), o(c);
24184
24184
  }
24185
24185
  });
24186
24186
  });
@@ -24232,7 +24232,7 @@ class Fh extends Kl {
24232
24232
  iceTransportPolicy: i,
24233
24233
  additionalSettings: n,
24234
24234
  proprietaryConstraints: o,
24235
- onTrackHandler: d
24235
+ onTrackHandler: c
24236
24236
  }) {
24237
24237
  this.logger.debug("HandlerInterface::init()"), this._direction = e, this.pc = new RTCPeerConnection(
24238
24238
  D({
@@ -24242,8 +24242,8 @@ class Fh extends Kl {
24242
24242
  rtcpMuxPolicy: "require"
24243
24243
  }, n),
24244
24244
  o
24245
- ), d && this.pc.addEventListener("track", (c) => {
24246
- d(c);
24245
+ ), c && this.pc.addEventListener("track", (d) => {
24246
+ c(d);
24247
24247
  }), this._addEventListeners();
24248
24248
  }
24249
24249
  connect() {
@@ -24318,8 +24318,8 @@ class Fh extends Kl {
24318
24318
  throw new Error("associated RTCRtpTransceiver not found");
24319
24319
  const n = i.sender.getParameters();
24320
24320
  n.encodings.forEach(
24321
- (o, d) => {
24322
- d <= r ? o.active = true : o.active = false;
24321
+ (o, c) => {
24322
+ c <= r ? o.active = true : o.active = false;
24323
24323
  }
24324
24324
  ), yield i.sender.setParameters(n);
24325
24325
  });
@@ -24332,8 +24332,8 @@ class Fh extends Kl {
24332
24332
  throw new Error("associated RTCRtpTransceiver not found");
24333
24333
  const n = i.sender.getParameters();
24334
24334
  n.encodings.forEach(
24335
- (o, d) => {
24336
- n.encodings[d] = D(D({}, o), r);
24335
+ (o, c) => {
24336
+ n.encodings[c] = D(D({}, o), r);
24337
24337
  }
24338
24338
  ), yield i.sender.setParameters(n);
24339
24339
  });
@@ -24451,8 +24451,8 @@ class Hh extends Fh {
24451
24451
  sdpSemantics: "unified-plan"
24452
24452
  }, i),
24453
24453
  n
24454
- ), o && this.pc.addEventListener("track", (d) => {
24455
- o(d);
24454
+ ), o && this.pc.addEventListener("track", (c) => {
24455
+ o(c);
24456
24456
  }), this._addEventListeners();
24457
24457
  }
24458
24458
  send(n) {
@@ -24488,22 +24488,22 @@ class Hh extends Fh {
24488
24488
  p.push(S);
24489
24489
  }), this.logger.info(`selected codecs: ${JSON.stringify(p)}`), o.setCodecPreferences(p);
24490
24490
  }
24491
- const d = yield this.pc.createOffer();
24492
- if (yield this.pc.setLocalDescription(d), r && r.findIndex(({ name: u }) => u === "opus") >= 0) {
24491
+ const c = yield this.pc.createOffer();
24492
+ if (yield this.pc.setLocalDescription(c), r && r.findIndex(({ name: u }) => u === "opus") >= 0) {
24493
24493
  const { enableDtx: u, enableStereo: p } = this, f = this.enableHighBitrate ? p ? 128e3 : 64e3 : p ? 64e3 : 32e3;
24494
- d.sdp = d.sdp.replace(
24494
+ c.sdp = c.sdp.replace(
24495
24495
  "minptime=10;useinbandfec=1",
24496
24496
  `minptime=10;useinbandfec=1;${u ? "usedtx=1;" : ""}${p ? "stereo=1;sprop-stereo=1;" : ""}maxaveragebitrate=${f}`
24497
- ), d.sdp += `a=rtcp-fb:111 nack\r
24497
+ ), c.sdp += `a=rtcp-fb:111 nack\r
24498
24498
  `;
24499
24499
  }
24500
24500
  this.midTransceiverMap.set(o.mid, o);
24501
- const c = (u) => l(this, null, function* () {
24501
+ const d = (u) => l(this, null, function* () {
24502
24502
  return this.logger.debug(`send() | calling pc.setRemoteDescription() [answer:${JSON.stringify(u)}]`), yield this.pc.setRemoteDescription(u), o.mid;
24503
24503
  });
24504
- return this.logger.debug(`send() | calling pc.setLocalDescription() [offer: ${JSON.stringify(d, void 0, 2)}]`), {
24505
- offerSdp: d,
24506
- callback: c,
24504
+ return this.logger.debug(`send() | calling pc.setLocalDescription() [offer: ${JSON.stringify(c, void 0, 2)}]`), {
24505
+ offerSdp: c,
24506
+ callback: d,
24507
24507
  sender: o.sender,
24508
24508
  mid: o.mid
24509
24509
  };
@@ -24545,16 +24545,16 @@ class Vd extends Fh {
24545
24545
  screenShare: n
24546
24546
  }) {
24547
24547
  this._assertSendDirection();
24548
- const d = this.supportsSendEncodings && r !== void 0 ? { sendEncodings: r } : {}, c = this.pc.addTransceiver(e, D({
24548
+ const c = this.supportsSendEncodings && r !== void 0 ? { sendEncodings: r } : {}, d = this.pc.addTransceiver(e, D({
24549
24549
  direction: "sendonly",
24550
24550
  streams: [
24551
24551
  n ? this._sendScreenShareStream : this._sendWebStream
24552
24552
  ]
24553
- }, d));
24553
+ }, c));
24554
24554
  if (!this.supportsSendEncodings && r) {
24555
24555
  r.reverse();
24556
- const S = c.sender.getParameters();
24557
- S.encodings = r, yield c.sender.setParameters(S);
24556
+ const S = d.sender.getParameters();
24557
+ S.encodings = r, yield d.sender.setParameters(S);
24558
24558
  }
24559
24559
  const u = (S, E) => {
24560
24560
  var $;
@@ -24568,13 +24568,13 @@ class Vd extends Fh {
24568
24568
  `minptime=10;useinbandfec=1;${S ? "usedtx=1;" : ""}${E ? "stereo=1;sprop-stereo=1;" : ""}maxaveragebitrate=${_}`
24569
24569
  );
24570
24570
  }
24571
- return this.midTransceiverMap.set(c.mid, c), {
24571
+ return this.midTransceiverMap.set(d.mid, d), {
24572
24572
  offerSdp: p,
24573
24573
  callback: (S) => l(this, null, function* () {
24574
- return this.logger.debug(`send() | calling pc.setRemoteDescription() [answer:${JSON.stringify(S)}]`), yield this.pc.setRemoteDescription(S), c.mid;
24574
+ return this.logger.debug(`send() | calling pc.setRemoteDescription() [answer:${JSON.stringify(S)}]`), yield this.pc.setRemoteDescription(S), d.mid;
24575
24575
  }),
24576
- sender: c.sender,
24577
- mid: c.mid
24576
+ sender: d.sender,
24577
+ mid: d.mid
24578
24578
  };
24579
24579
  });
24580
24580
  }
@@ -24586,8 +24586,8 @@ class Vd extends Fh {
24586
24586
  throw new Error("associated RTCRtpTransceiver not found");
24587
24587
  const n = i.sender.getParameters(), o = n.encodings.length - 1 - r;
24588
24588
  n.encodings.forEach(
24589
- (d, c) => {
24590
- c >= o ? d.active = true : d.active = false;
24589
+ (c, d) => {
24590
+ d >= o ? c.active = true : c.active = false;
24591
24591
  }
24592
24592
  ), yield i.sender.setParameters(n);
24593
24593
  });
@@ -24627,12 +24627,12 @@ class Bh extends Fh {
24627
24627
  i ? this._sendScreenShareStream : this._sendWebStream
24628
24628
  ],
24629
24629
  sendEncodings: e
24630
- }), d = RTCRtpSender.getCapabilities(typeof t == "string" ? t : t.kind);
24631
- this.logger.info(`Safari12::senders available params: ${JSON.stringify(d)}`);
24632
- const c = [];
24630
+ }), c = RTCRtpSender.getCapabilities(typeof t == "string" ? t : t.kind);
24631
+ this.logger.info(`Safari12::senders available params: ${JSON.stringify(c)}`);
24632
+ const d = [];
24633
24633
  r && r.length > 0 && r.forEach((f) => {
24634
24634
  var E;
24635
- const S = d.codecs.find(
24635
+ const S = c.codecs.find(
24636
24636
  (_) => _.mimeType.includes(f.name)
24637
24637
  );
24638
24638
  if (f.parameters) {
@@ -24642,8 +24642,8 @@ class Bh extends Fh {
24642
24642
  const P = [...new Set(_).values()];
24643
24643
  S.sdpFmtpLine = P.join(";");
24644
24644
  }
24645
- c.push(S);
24646
- }), this.logger.info(`Safari12::selected codecs: ${JSON.stringify(c)}`), o.setCodecPreferences(c);
24645
+ d.push(S);
24646
+ }), this.logger.info(`Safari12::selected codecs: ${JSON.stringify(d)}`), o.setCodecPreferences(d);
24647
24647
  const u = yield this.pc.createOffer();
24648
24648
  if (yield this.pc.setLocalDescription(u), t === "audio" || t.kind === "audio") {
24649
24649
  const { enableStereo: f, enableDtx: S } = this, E = this.enableHighBitrate ? f ? 128e3 : 64e3 : f ? 64e3 : 32e3;
@@ -24931,35 +24931,35 @@ const Na = class extends ut.EventEmitter {
24931
24931
  });
24932
24932
  h(this, "request", (e2) => l(this, null, function* () {
24933
24933
  const r2 = Na.createRequest(e2), i2 = new Promise((n2, o) => {
24934
- const { id: c } = r2.payload._bolt, u = {
24935
- id: c,
24934
+ const { id: d } = r2.payload._bolt, u = {
24935
+ id: d,
24936
24936
  method: r2.type,
24937
24937
  resolve: (p) => {
24938
- this.queue.delete(c) && (clearTimeout(u.timer), n2(p));
24938
+ this.queue.delete(d) && (clearTimeout(u.timer), n2(p));
24939
24939
  },
24940
24940
  timer: setTimeout(() => {
24941
- this.queue.delete(c) && o(new Error(`request timeout for message id: ${c}`));
24941
+ this.queue.delete(d) && o(new Error(`request timeout for message id: ${d}`));
24942
24942
  }, 2e4),
24943
24943
  cancel: (p) => {
24944
- this.queue.delete(c) && (clearTimeout(u.timer), o(p));
24944
+ this.queue.delete(d) && (clearTimeout(u.timer), o(p));
24945
24945
  }
24946
24946
  };
24947
- this.queue.set(c, u);
24947
+ this.queue.set(d, u);
24948
24948
  });
24949
24949
  return this.channel.send(JSON.stringify(r2)), i2;
24950
24950
  }));
24951
24951
  h(this, "send", (e2) => {
24952
24952
  const r2 = JSON.stringify(e2), i2 = 16384;
24953
24953
  if (r2.length > i2) {
24954
- const n2 = i2 - 200, o = Math.ceil(r2.length / n2), d = [];
24954
+ const n2 = i2 - 200, o = Math.ceil(r2.length / n2), c = [];
24955
24955
  for (let u = 0; u < o; u += 1) {
24956
24956
  const p = u * n2, f = (u + 1) * n2;
24957
- d.push(r2.slice(p, f));
24957
+ c.push(r2.slice(p, f));
24958
24958
  }
24959
- const c = v4();
24959
+ const d = v4();
24960
24960
  for (let u = 0; u < o; u += 1) {
24961
- const p = d[u], S = JSON.stringify({
24962
- id: c,
24961
+ const p = c[u], S = JSON.stringify({
24962
+ id: d,
24963
24963
  count: o,
24964
24964
  chunkIndex: u,
24965
24965
  chunk: p
@@ -24974,17 +24974,17 @@ const Na = class extends ut.EventEmitter {
24974
24974
  a(this, Fr).has(e2.id) || a(this, Fr).set(e2.id, []);
24975
24975
  const r2 = a(this, Fr).get(e2.id);
24976
24976
  if (r2[e2.chunkIndex] = e2, (r2 == null ? void 0 : r2.length) === e2.count && !r2.some((n2) => n2 === void 0)) {
24977
- const n2 = a(this, Fr).get(e2.id), o = n2 == null ? void 0 : n2.reduce((c, u) => c + u.chunk, "");
24977
+ const n2 = a(this, Fr).get(e2.id), o = n2 == null ? void 0 : n2.reduce((d, u) => d + u.chunk, "");
24978
24978
  a(this, Fr).delete(e2.id);
24979
- const d = JSON.parse(o);
24980
- if (!d.payload || !zf(d.payload))
24979
+ const c = JSON.parse(o);
24980
+ if (!c.payload || !zf(c.payload))
24981
24981
  throw new Error("corrupted incoming message over dc", {
24982
- cause: { code: "CORRUPT_DC_MESSAGE", values: d }
24982
+ cause: { code: "CORRUPT_DC_MESSAGE", values: c }
24983
24983
  });
24984
- if (this.processBoltHandshake(d))
24984
+ if (this.processBoltHandshake(c))
24985
24985
  return;
24986
- if (this.serverProtocolVersion = (i2 = d.payload._bolt) == null ? void 0 : i2.version, !this.processResponseMsg(d))
24987
- return d;
24986
+ if (this.serverProtocolVersion = (i2 = c.payload._bolt) == null ? void 0 : i2.version, !this.processResponseMsg(c))
24987
+ return c;
24988
24988
  }
24989
24989
  });
24990
24990
  h(this, "processResponseMsg", (e2) => {
@@ -25059,8 +25059,8 @@ const La = class extends Kl {
25059
25059
  id: i,
25060
25060
  direction: n,
25061
25061
  handlerFactory: o,
25062
- iceServers: d,
25063
- iceTransportPolicy: c,
25062
+ iceServers: c,
25063
+ iceTransportPolicy: d,
25064
25064
  proprietaryConstraints: u,
25065
25065
  additionalSettings: p,
25066
25066
  appData: f,
@@ -25096,8 +25096,8 @@ const La = class extends Kl {
25096
25096
  delete _.iceServers, delete _.iceTransportPolicy, delete _.bundlePolicy, delete _.rtcpMuxPolicy, delete _.sdpSemantics, this.producers = /* @__PURE__ */ new Map(), this.consumers = /* @__PURE__ */ new Map(), this.datachannels = /* @__PURE__ */ new Map(), this.consumerTrackEvents = /* @__PURE__ */ new Map(), this.unknownTracksMap = /* @__PURE__ */ new Map(), this.awaitQueue = new Qu(E, true), this.handler = o(), this.handler.enableHighBitrate = (P = S == null ? void 0 : S.enableHighBitrate) != null ? P : false, this.handler.enableStereo = (k = S == null ? void 0 : S.enableStereo) != null ? k : false, this.handler.enableDtx = (A = S == null ? void 0 : S.enableDtx) != null ? A : true, this.handler.sfu = a(this, Gi), this.handler.init({
25097
25097
  onTrackHandler: this._ontrack.bind(this),
25098
25098
  direction: n,
25099
- iceServers: d,
25100
- iceTransportPolicy: c,
25099
+ iceServers: c,
25100
+ iceTransportPolicy: d,
25101
25101
  additionalSettings: p,
25102
25102
  proprietaryConstraints: u
25103
25103
  }), this.appData = f || {}, this.transportConnectionPromise = new Promise((N) => {
@@ -25239,8 +25239,8 @@ const La = class extends Kl {
25239
25239
  const {
25240
25240
  track: n,
25241
25241
  encodings: o,
25242
- codecOptions: d,
25243
- stopTracks: c = true,
25242
+ codecOptions: c,
25243
+ stopTracks: d = true,
25244
25244
  disableTrackOnPause: u = true,
25245
25245
  zeroRtpOnPause: p = false,
25246
25246
  appData: f = {}
@@ -25255,7 +25255,7 @@ const La = class extends Kl {
25255
25255
  } = yield this.handler.send({
25256
25256
  track: n,
25257
25257
  encodings: o,
25258
- codecOptions: d,
25258
+ codecOptions: c,
25259
25259
  screenShare: f == null ? void 0 : f.screenShare
25260
25260
  }), { answer: H, producerId: $ } = yield r(
25261
25261
  {
@@ -25263,7 +25263,7 @@ const La = class extends Kl {
25263
25263
  kind: n.kind,
25264
25264
  paused: u ? !n.enabled || Object.hasOwn(n, "fakeTracks") : false,
25265
25265
  appData: B(D({}, f || {}), { mid: N }),
25266
- codecOptions: d,
25266
+ codecOptions: c,
25267
25267
  producingTransportId: this.serverId
25268
25268
  }
25269
25269
  ), F = yield k(H);
@@ -25273,7 +25273,7 @@ const La = class extends Kl {
25273
25273
  id: S,
25274
25274
  localId: E,
25275
25275
  track: n,
25276
- stopTracks: c,
25276
+ stopTracks: d,
25277
25277
  disableTrackOnPause: u,
25278
25278
  zeroRtpOnPause: p,
25279
25279
  appData: f,
@@ -25311,14 +25311,14 @@ const La = class extends Kl {
25311
25311
  return this.awaitQueue.push(() => l(this, null, function* () {
25312
25312
  const n = {}, {
25313
25313
  consumerStates: o,
25314
- sessionDescription: d,
25315
- failedProducers: c
25314
+ sessionDescription: c,
25315
+ failedProducers: d
25316
25316
  } = yield r(e);
25317
25317
  o.forEach((p, f) => {
25318
25318
  n[f] = this.createConsumerObjectAndWaitForTrack(B(D({}, p), {
25319
25319
  producerId: f
25320
25320
  }));
25321
- }), d && (this.logger.info("Session description found, sending negotiation request"), yield i(d));
25321
+ }), c && (this.logger.info("Session description found, sending negotiation request"), yield i(c));
25322
25322
  const u = [];
25323
25323
  return yield Promise.all(Object.entries(n).map(
25324
25324
  ([p, f]) => f.then((S) => u.push(S)).catch(() => {
@@ -25327,7 +25327,7 @@ const La = class extends Kl {
25327
25327
  transport: { serverId: this.serverId }
25328
25328
  });
25329
25329
  })
25330
- )), { consumers: u, failedProducers: c };
25330
+ )), { consumers: u, failedProducers: d };
25331
25331
  }), "Transport.consume", { producersLength: e.length });
25332
25332
  });
25333
25333
  }
@@ -25344,12 +25344,12 @@ const La = class extends Kl {
25344
25344
  }
25345
25345
  static setCodecAndFmtpMappings(e, r, i) {
25346
25346
  const n = parse(e.sdp);
25347
- return n.media = n.media.map((d) => {
25348
- if (r.includes(d.mid.toString())) {
25349
- const c = D({}, d);
25350
- return c.rtp = i[d.mid.toString()].rtp, c.fmtp = i[d.mid.toString()].fmtp, c.payloads = i[d.mid.toString()].payloads, c.rtcpFb = i[d.mid.toString()].rtcpFb, c;
25347
+ return n.media = n.media.map((c) => {
25348
+ if (r.includes(c.mid.toString())) {
25349
+ const d = D({}, c);
25350
+ return d.rtp = i[c.mid.toString()].rtp, d.fmtp = i[c.mid.toString()].fmtp, d.payloads = i[c.mid.toString()].payloads, d.rtcpFb = i[c.mid.toString()].rtcpFb, d;
25351
25351
  }
25352
- return d;
25352
+ return c;
25353
25353
  }), B(D({}, e), {
25354
25354
  sdp: write(n)
25355
25355
  });
@@ -25363,8 +25363,8 @@ const La = class extends Kl {
25363
25363
  static setHeaderExtensionMappings(e, r) {
25364
25364
  const i = parse(e.sdp);
25365
25365
  return i.media = i.media.map((o) => {
25366
- const d = D({}, o);
25367
- return d.ext = r[o.mid], d;
25366
+ const c = D({}, o);
25367
+ return c.ext = r[o.mid], c;
25368
25368
  }), B(D({}, e), {
25369
25369
  sdp: write(i)
25370
25370
  });
@@ -25379,17 +25379,17 @@ const La = class extends Kl {
25379
25379
  this.handler.pc.remoteDescription
25380
25380
  );
25381
25381
  this.logger.info("Stopping transceivers", { consumerIds: e.map(({ id: u }) => u) }), e.forEach((u) => u.close(void 0, true));
25382
- let d = yield this.handler.pc.createOffer();
25383
- this.logger.info("Created offer for closing consumers", { sdp: d.sdp }), d = La.setCodecAndFmtpMappings(
25384
- d,
25382
+ let c = yield this.handler.pc.createOffer();
25383
+ this.logger.info("Created offer for closing consumers", { sdp: c.sdp }), c = La.setCodecAndFmtpMappings(
25384
+ c,
25385
25385
  i,
25386
25386
  n
25387
- ), d = La.setHeaderExtensionMappings(
25388
- d,
25387
+ ), c = La.setHeaderExtensionMappings(
25388
+ c,
25389
25389
  o
25390
- ), this.logger.info("Updated codec and fmtp mappings in close consumer offer", { sdp: d.sdp }), yield this.setLocalDescription(d), this.logger.info("Successfully set local description in close consumers");
25391
- const c = yield r(e, d);
25392
- this.logger.info("Received answer in close consumers", { sdp: c.sdp }), yield this.setRemoteDescription(c), this.logger.info("Remote description was set successfully in close consumers", { sdp: c.sdp });
25390
+ ), this.logger.info("Updated codec and fmtp mappings in close consumer offer", { sdp: c.sdp }), yield this.setLocalDescription(c), this.logger.info("Successfully set local description in close consumers");
25391
+ const d = yield r(e, c);
25392
+ this.logger.info("Received answer in close consumers", { sdp: d.sdp }), yield this.setRemoteDescription(d), this.logger.info("Remote description was set successfully in close consumers", { sdp: d.sdp });
25393
25393
  } catch (i) {
25394
25394
  this.logger.error("Failed to close consumers", { error: i });
25395
25395
  }
@@ -25404,10 +25404,10 @@ const La = class extends Kl {
25404
25404
  const i = parse(r.sdp);
25405
25405
  return i.media = i.media.map((n) => {
25406
25406
  if (n.type === "audio") {
25407
- const o = D({}, n), d = o.fmtp.find(
25407
+ const o = D({}, n), c = o.fmtp.find(
25408
25408
  (u) => u.payload === 111
25409
25409
  );
25410
- return d && (d.config += ";stereo=1;sprop-stereo=1"), o.rtcpFb || (o.rtcpFb = []), o.rtcpFb.some(
25410
+ return c && (c.config += ";stereo=1;sprop-stereo=1"), o.rtcpFb || (o.rtcpFb = []), o.rtcpFb.some(
25411
25411
  (u) => u.type === "nack"
25412
25412
  ) || o.rtcpFb.push({
25413
25413
  payload: parseInt(o.payloads, 10),
@@ -25428,8 +25428,8 @@ const La = class extends Kl {
25428
25428
  a(this, Gi) === Pe.HIVE ? o = `${n[0].id}:${r.kind}` : o = `${i.mid}:${r.kind}`, r.addEventListener("ended", () => {
25429
25429
  this.logger.info(`rtc consumer track ended [trackId: ${r.id}]`), this.unknownTracksMap.delete(o);
25430
25430
  });
25431
- const d = this.consumerTrackEvents.get(o);
25432
- d ? (d(r, i), this.consumerTrackEvents.delete(o)) : (this.logger.warn(`track event handler not found ${o}`), this.unknownTracksMap.set(o, e));
25431
+ const c = this.consumerTrackEvents.get(o);
25432
+ c ? (c(r, i), this.consumerTrackEvents.delete(o)) : (this.logger.warn(`track event handler not found ${o}`), this.unknownTracksMap.set(o, e));
25433
25433
  }
25434
25434
  sendErrorOverDC(e, r, i) {
25435
25435
  const n = this.getDatachannel(e);
@@ -25454,13 +25454,13 @@ const La = class extends Kl {
25454
25454
  producerId: i,
25455
25455
  producingPeerId: n,
25456
25456
  producingTransportId: o,
25457
- streamId: d,
25458
- paused: c,
25457
+ streamId: c,
25458
+ paused: d,
25459
25459
  screenShare: u,
25460
25460
  appData: p,
25461
25461
  kind: f,
25462
25462
  mimeType: S
25463
- } = e, E = `${d}:${f}`, _ = B(D({}, e), {
25463
+ } = e, E = `${c}:${f}`, _ = B(D({}, e), {
25464
25464
  name: "consumer creation task error",
25465
25465
  message: "consumer creation failed"
25466
25466
  });
@@ -25479,7 +25479,7 @@ const La = class extends Kl {
25479
25479
  localId: F.mid,
25480
25480
  transceiver: F,
25481
25481
  track: K,
25482
- paused: c,
25482
+ paused: d,
25483
25483
  producerId: i,
25484
25484
  producingPeerId: n,
25485
25485
  producingTransportId: o,
@@ -25729,12 +25729,12 @@ class iD extends ut.EventEmitter {
25729
25729
  stopTransports(e) {
25730
25730
  var r, i;
25731
25731
  if (e.send && this.sendTransport !== void 0) {
25732
- const { id: n, serverId: o, direction: d } = a(this, ot);
25733
- this.logger.info("Closing send transport", { transport: { id: n, serverId: o, type: d } }), a(this, ot).close(), a(this, ot).removeAllListeners(), m(this, ot, void 0);
25732
+ const { id: n, serverId: o, direction: c } = a(this, ot);
25733
+ this.logger.info("Closing send transport", { transport: { id: n, serverId: o, type: c } }), a(this, ot).close(), a(this, ot).removeAllListeners(), m(this, ot, void 0);
25734
25734
  }
25735
25735
  if (e.recv && this.recvTransport !== void 0) {
25736
- const { id: n, serverId: o, direction: d } = a(this, ct);
25737
- this.logger.info("Closing recv transport", { transport: { id: n, serverId: o, type: d } }), (r = a(this, ct)) == null || r.close(), (i = a(this, ct)) == null || i.removeAllListeners(), m(this, ct, void 0);
25736
+ const { id: n, serverId: o, direction: c } = a(this, ct);
25737
+ this.logger.info("Closing recv transport", { transport: { id: n, serverId: o, type: c } }), (r = a(this, ct)) == null || r.close(), (i = a(this, ct)) == null || i.removeAllListeners(), m(this, ct, void 0);
25738
25738
  }
25739
25739
  V(this, mc, eh).call(this);
25740
25740
  }
@@ -25754,7 +25754,7 @@ bn = /* @__PURE__ */ new WeakMap(), ot = /* @__PURE__ */ new WeakMap(), ct = /*
25754
25754
  });
25755
25755
  }, il = /* @__PURE__ */ new WeakSet(), Qf = function(e) {
25756
25756
  return l(this, null, function* () {
25757
- var o, d, c, u, p, f, S, E;
25757
+ var o, c, d, u, p, f, S, E;
25758
25758
  (Jn(this.context, "forceRelay") || this.context.getValue("flagsmith").hasFeature(Z.FORCE_RELAY)) && m(this, Ls, "relay"), this.logger.info(`ICE Transport Policy set to ${a(this, Ls)}`);
25759
25759
  const n = yield lt().getICEServers().catch((_) => (this.logger.warn(`failed to get iceservers from server: ${_.message}`), []));
25760
25760
  if (e.send) {
@@ -25767,7 +25767,7 @@ bn = /* @__PURE__ */ new WeakMap(), ot = /* @__PURE__ */ new WeakMap(), ct = /*
25767
25767
  encodedInsertableStreams: (o = this.context.getValue("modules").e2ee) == null ? void 0 : o.enabled
25768
25768
  },
25769
25769
  config: {
25770
- enableHighBitrate: (u = (c = (d = this.context.getValue("defaults").mediaConfiguration) == null ? void 0 : d.audio) == null ? void 0 : c.enableHighBitrate) != null ? u : false,
25770
+ enableHighBitrate: (u = (d = (c = this.context.getValue("defaults").mediaConfiguration) == null ? void 0 : c.audio) == null ? void 0 : d.enableHighBitrate) != null ? u : false,
25771
25771
  enableStereo: (S = (f = (p = this.context.getValue("defaults").mediaConfiguration) == null ? void 0 : p.audio) == null ? void 0 : f.enableStereo) != null ? S : false,
25772
25772
  enableDtx: a(this, Mn) === Pe.HIVE ? true : !!_
25773
25773
  },
@@ -25790,8 +25790,8 @@ bn = /* @__PURE__ */ new WeakMap(), ot = /* @__PURE__ */ new WeakMap(), ct = /*
25790
25790
  const o = this.context.getValue("flagsmith").hasFeature(
25791
25791
  Z.ENABLE_HIVE_INFINITE_RETRIES
25792
25792
  ) ? 1 / 0 : 3;
25793
- return yield Wf((d, c) => l(this, null, function* () {
25794
- d > 0 && this.logger.debug(`Retrying transport connect, count: ${d}`, {
25793
+ return yield Wf((c, d) => l(this, null, function* () {
25794
+ c > 0 && this.logger.debug(`Retrying transport connect, count: ${c}`, {
25795
25795
  transport: { id: r, serverId: i, type: n }
25796
25796
  });
25797
25797
  try {
@@ -25800,7 +25800,7 @@ bn = /* @__PURE__ */ new WeakMap(), ot = /* @__PURE__ */ new WeakMap(), ct = /*
25800
25800
  yield V(this, al, Xf).call(this, e);
25801
25801
  } catch (u) {
25802
25802
  if (u instanceof fi) {
25803
- c(u);
25803
+ d(u);
25804
25804
  return;
25805
25805
  }
25806
25806
  throw this.logger.error("Failed to connect transport, retrying", { transport: e, error: u }), u;
@@ -25884,8 +25884,8 @@ bn = /* @__PURE__ */ new WeakMap(), ot = /* @__PURE__ */ new WeakMap(), ct = /*
25884
25884
  }
25885
25885
  );
25886
25886
  const o = () => {
25887
- const d = a(this, zi)[r];
25888
- d !== void 0 && (clearTimeout(d), a(this, zi)[r] = void 0);
25887
+ const c = a(this, zi)[r];
25888
+ c !== void 0 && (clearTimeout(c), a(this, zi)[r] = void 0);
25889
25889
  };
25890
25890
  switch (n) {
25891
25891
  case "connected":
@@ -25905,7 +25905,7 @@ bn = /* @__PURE__ */ new WeakMap(), ot = /* @__PURE__ */ new WeakMap(), ct = /*
25905
25905
  })), e.on("icecandidate", (n) => l(this, null, function* () {
25906
25906
  this.logger.debug("Sending iceCandidate:", { iceCandidate: n });
25907
25907
  })), e.on("datachannel:events", (n, o) => l(this, null, function* () {
25908
- var d, c;
25908
+ var c, d;
25909
25909
  this.logger.debug("Got data channel message on event:", {
25910
25910
  rtcChannel: { label: n, message: o }
25911
25911
  });
@@ -25922,7 +25922,7 @@ bn = /* @__PURE__ */ new WeakMap(), ot = /* @__PURE__ */ new WeakMap(), ct = /*
25922
25922
  break;
25923
25923
  }
25924
25924
  case "hub-disconnect": {
25925
- this.logger.debug(`media hub disconnected, full_reconnect: ${(d = o.payload) == null ? void 0 : d.full_reconnect}`), ((c = o.payload) == null ? void 0 : c.full_reconnect) === true && this.handleErrors("rejoin");
25925
+ this.logger.debug(`media hub disconnected, full_reconnect: ${(c = o.payload) == null ? void 0 : c.full_reconnect}`), ((d = o.payload) == null ? void 0 : d.full_reconnect) === true && this.handleErrors("rejoin");
25926
25926
  break;
25927
25927
  }
25928
25928
  case "error":
@@ -25942,7 +25942,7 @@ bn = /* @__PURE__ */ new WeakMap(), ot = /* @__PURE__ */ new WeakMap(), ct = /*
25942
25942
  return l(this, null, function* () {
25943
25943
  const i = e === "recv";
25944
25944
  try {
25945
- const { sdp: n, type: o } = r, d = {
25945
+ const { sdp: n, type: o } = r, c = {
25946
25946
  consuming: i,
25947
25947
  description: {
25948
25948
  sdp: n,
@@ -25951,7 +25951,7 @@ bn = /* @__PURE__ */ new WeakMap(), ot = /* @__PURE__ */ new WeakMap(), ct = /*
25951
25951
  },
25952
25952
  producers: []
25953
25953
  };
25954
- return a(this, kn).connectTransport(d);
25954
+ return a(this, kn).connectTransport(c);
25955
25955
  } catch (n) {
25956
25956
  throw this.logger.error(
25957
25957
  `Error in ${e} transport connection:`,
@@ -26009,29 +26009,29 @@ class aD {
26009
26009
  type: "create_consumer",
26010
26010
  payload: {
26011
26011
  producers: t.map(({
26012
- producerId: d,
26013
- producingTransportId: c,
26012
+ producerId: c,
26013
+ producingTransportId: d,
26014
26014
  kind: u,
26015
26015
  mimeType: p
26016
26016
  }) => ({
26017
- producerId: d,
26018
- producingTransportId: c,
26017
+ producerId: c,
26018
+ producingTransportId: d,
26019
26019
  preferredCodec: D(D({}, u === "video" && p ? { video: p } : {}), u === "audio" && p ? { audio: p } : {})
26020
26020
  }))
26021
26021
  }
26022
26022
  }, i = yield this.recvTransport.sendDataChannelMessage("events", r), n = /* @__PURE__ */ new Map();
26023
- t.forEach((d) => n.set(d.producerId, d));
26023
+ t.forEach((c) => n.set(c.producerId, c));
26024
26024
  const o = /* @__PURE__ */ new Map();
26025
- return Object.entries(i).forEach(([d, c]) => {
26026
- const u = n.get(c.producerId);
26027
- u && o.set(c.producerId, {
26028
- consumerId: d,
26025
+ return Object.entries(i).forEach(([c, d]) => {
26026
+ const u = n.get(d.producerId);
26027
+ u && o.set(d.producerId, {
26028
+ consumerId: c,
26029
26029
  producingTransportId: u.producingTransportId,
26030
26030
  producingPeerId: u.producingPeerId,
26031
26031
  kind: u.kind,
26032
26032
  paused: u.pause,
26033
- streamId: c.streamId,
26034
- trackId: c.trackId,
26033
+ streamId: d.streamId,
26034
+ trackId: d.trackId,
26035
26035
  screenShare: u.screenShare,
26036
26036
  mimeType: u.mimeType,
26037
26037
  appData: {}
@@ -26079,7 +26079,7 @@ class aD {
26079
26079
  this.logger.warn("events datachannel not found");
26080
26080
  return;
26081
26081
  }
26082
- const i = (o = t == null ? void 0 : t.map(({ id: d }) => d)) != null ? o : [], n = {
26082
+ const i = (o = t == null ? void 0 : t.map(({ id: c }) => c)) != null ? o : [], n = {
26083
26083
  type: "switch_consumer_layer",
26084
26084
  payload: {
26085
26085
  consumerIds: i,
@@ -26124,8 +26124,8 @@ class nD {
26124
26124
  if (!t || t && t.length === 0)
26125
26125
  throw new Error("List of producers is required");
26126
26126
  const e = /* @__PURE__ */ new Map(), r = [];
26127
- t.forEach((c) => {
26128
- const { producingPeerId: u, producerId: p, producingTransportId: f } = c, S = a(this, Tc).getValue("flagsmith").hasFeature(Z.ENABLE_CF_SIMULCAST) ? {
26127
+ t.forEach((d) => {
26128
+ const { producingPeerId: u, producerId: p, producingTransportId: f } = d, S = a(this, Tc).getValue("flagsmith").hasFeature(Z.ENABLE_CF_SIMULCAST) ? {
26129
26129
  simulcast: {
26130
26130
  preferredRid: "h",
26131
26131
  priorityOrdering: "asciibetical",
@@ -26142,16 +26142,16 @@ class nD {
26142
26142
  requests: r,
26143
26143
  consumingTransportId: this.recvTransport.serverId
26144
26144
  }), n = /* @__PURE__ */ new Map();
26145
- t.forEach((c) => n.set(c.producerId, c));
26146
- const o = /* @__PURE__ */ new Map(), d = [];
26147
- return Object.entries(i.consumerStateMap).forEach(([c, u]) => {
26148
- const p = n.get(c);
26145
+ t.forEach((d) => n.set(d.producerId, d));
26146
+ const o = /* @__PURE__ */ new Map(), c = [];
26147
+ return Object.entries(i.consumerStateMap).forEach(([d, u]) => {
26148
+ const p = n.get(d);
26149
26149
  if (!p)
26150
26150
  return;
26151
26151
  if (u.errorCode) {
26152
- a(this, ts).warn(`Consumer request failed for producer ${c}`, {
26152
+ a(this, ts).warn(`Consumer request failed for producer ${d}`, {
26153
26153
  error: { message: u.errorCode }
26154
- }), d.push(B(D({}, p), { errorCode: u.errorCode }));
26154
+ }), c.push(B(D({}, p), { errorCode: u.errorCode }));
26155
26155
  return;
26156
26156
  }
26157
26157
  let f = {};
@@ -26159,7 +26159,7 @@ class nD {
26159
26159
  f = JSON.parse(u.producerState.appData);
26160
26160
  } catch (S) {
26161
26161
  }
26162
- o.set(c, {
26162
+ o.set(d, {
26163
26163
  consumerId: u.consumerId,
26164
26164
  producingTransportId: p.producingTransportId,
26165
26165
  producingPeerId: p.producingPeerId,
@@ -26171,7 +26171,7 @@ class nD {
26171
26171
  mimeType: p.mimeType,
26172
26172
  appData: f
26173
26173
  });
26174
- }), { consumerStates: o, sessionDescription: i.sessionDescription, failedProducers: d };
26174
+ }), { consumerStates: o, sessionDescription: i.sessionDescription, failedProducers: c };
26175
26175
  });
26176
26176
  }
26177
26177
  negotiate(t) {
@@ -26215,10 +26215,10 @@ class nD {
26215
26215
  },
26216
26216
  consumerIds: n,
26217
26217
  consumingTransportId: this.recvTransport.serverId
26218
- }, d = yield this.socketHandler.closeConsumer(o), c = fw.fromBinary(d).description;
26218
+ }, c = yield this.socketHandler.closeConsumer(o), d = fw.fromBinary(c).description;
26219
26219
  return {
26220
- sdp: c.sdp,
26221
- type: c.type
26220
+ sdp: d.sdp,
26221
+ type: d.type
26222
26222
  };
26223
26223
  });
26224
26224
  return yield this.recvTransport.awaitQueue.push(() => this.recvTransport.closeConsumers(t, e), "ConsumerStrategy.close", { consumersLength: t.length }), {};
@@ -26255,7 +26255,7 @@ class qh {
26255
26255
  (n) => e === "video" ? n.type === "video" : n.type === "audio"
26256
26256
  ).at(-1).msid;
26257
26257
  }
26258
- create(d) {
26258
+ create(c) {
26259
26259
  return l(this, arguments, function* ({
26260
26260
  offer: t,
26261
26261
  kind: e,
@@ -26265,7 +26265,7 @@ class qh {
26265
26265
  producingTransportId: o
26266
26266
  }) {
26267
26267
  var S, E;
26268
- const c = qh.getMSIDFromSDP(t.sdp, e), u = {
26268
+ const d = qh.getMSIDFromSDP(t.sdp, e), u = {
26269
26269
  description: {
26270
26270
  sdp: t.sdp,
26271
26271
  type: t.type,
@@ -26273,7 +26273,7 @@ class qh {
26273
26273
  },
26274
26274
  paused: r,
26275
26275
  kind: e,
26276
- msid: c,
26276
+ msid: d,
26277
26277
  appData: JSON.stringify(i),
26278
26278
  screenShare: (S = i.screenShare) != null ? S : false,
26279
26279
  mimeType: `${e}/${(E = n[0]) == null ? void 0 : E.name}`,
@@ -26414,18 +26414,18 @@ Yi = /* @__PURE__ */ new WeakMap(), Hr = /* @__PURE__ */ new WeakMap(), On = /*
26414
26414
  throw new Error("Recv transport is closed");
26415
26415
  const e = 500, r = a(this, sr).splice(0, a(this, sr).length);
26416
26416
  try {
26417
- const i = new Set(Array.from(this.consumers.values()).map(({ producerId: c }) => c)), n = r.filter(({ producerId: c }) => !this.producers.get(c) && !i.has(c));
26417
+ const i = new Set(Array.from(this.consumers.values()).map(({ producerId: d }) => d)), n = r.filter(({ producerId: d }) => !this.producers.get(d) && !i.has(d));
26418
26418
  if (n.length === 0)
26419
26419
  return;
26420
- const { consumers: o, failedProducers: d } = yield this.recvTransport.consume(
26420
+ const { consumers: o, failedProducers: c } = yield this.recvTransport.consume(
26421
26421
  n,
26422
26422
  V(this, gl, nS).bind(this),
26423
26423
  a(this, ps).negotiate.bind(a(this, ps))
26424
26424
  );
26425
- if (o.forEach(V(this, ml, oS).bind(this)), d != null && d.length) {
26426
- this.logger.error("Failed to create consumers for producers", { producers: d });
26427
- const c = d.filter(({ errorCode: u, producerId: p }) => u === "not_found_track_error" ? (this.logger.error(`Track not found for producer: ${p}. This will not be retried.`), false) : u === "backend_error" ? (this.logger.error("Unrecoverable error: backend error"), false) : true);
26428
- m(this, sr, a(this, sr).concat(c)), m(this, Nn, setTimeout(
26425
+ if (o.forEach(V(this, ml, oS).bind(this)), c != null && c.length) {
26426
+ this.logger.error("Failed to create consumers for producers", { producers: c });
26427
+ const d = c.filter(({ errorCode: u, producerId: p }) => u === "not_found_track_error" ? (this.logger.error(`Track not found for producer: ${p}. This will not be retried.`), false) : u === "backend_error" ? (this.logger.error("Unrecoverable error: backend error"), false) : true);
26428
+ m(this, sr, a(this, sr).concat(d)), m(this, Nn, setTimeout(
26429
26429
  V(this, _c, ih).bind(this),
26430
26430
  e
26431
26431
  ));
@@ -26451,12 +26451,12 @@ Yi = /* @__PURE__ */ new WeakMap(), Hr = /* @__PURE__ */ new WeakMap(), On = /*
26451
26451
  return a(this, Ec).create(e);
26452
26452
  }, pl = /* @__PURE__ */ new WeakSet(), aS = function(e, r) {
26453
26453
  e.on("close", (i, n) => l(this, null, function* () {
26454
- const { offer: o, reason: d } = i;
26454
+ const { offer: o, reason: c } = i;
26455
26455
  if (this.logger.info("producer::closing", {
26456
- debuggingHint: d,
26456
+ debuggingHint: c,
26457
26457
  producer: B(D({}, e), { status: "closing" })
26458
- }), d !== xd) {
26459
- const c = {
26458
+ }), c !== xd) {
26459
+ const d = {
26460
26460
  producerId: e.id,
26461
26461
  description: {
26462
26462
  sdp: o.sdp,
@@ -26465,7 +26465,7 @@ Yi = /* @__PURE__ */ new WeakMap(), Hr = /* @__PURE__ */ new WeakMap(), On = /*
26465
26465
  }
26466
26466
  };
26467
26467
  try {
26468
- const u = yield this.socketHandler.closeProducer(c), p = {
26468
+ const u = yield this.socketHandler.closeProducer(d), p = {
26469
26469
  sdp: u == null ? void 0 : u.sdp,
26470
26470
  type: u == null ? void 0 : u.type
26471
26471
  };
@@ -26511,8 +26511,8 @@ const Tl = class {
26511
26511
  hangoverFrames: i = 5,
26512
26512
  noiseAdaptationRate: n = 0.95,
26513
26513
  voiceAdaptationRate: o = 0.99,
26514
- minEnergyThreshold: d = 5e-3,
26515
- maxEnergyThreshold: c = 0.2,
26514
+ minEnergyThreshold: c = 5e-3,
26515
+ maxEnergyThreshold: d = 0.2,
26516
26516
  energyRatioThreshold: u = 1.5,
26517
26517
  noiseHistorySize: p = 50
26518
26518
  } = {}) {
@@ -26534,14 +26534,14 @@ const Tl = class {
26534
26534
  g(this, Xi, 0);
26535
26535
  g(this, rr, []);
26536
26536
  g(this, kc, void 0);
26537
- m(this, Ln, t), m(this, bt, t), m(this, Pc, e), m(this, Cc, r), m(this, Rc, i), m(this, Vn, n), m(this, xn, o), m(this, wc, d), m(this, bc, c), m(this, Un, u), m(this, kc, p), m(this, gs, t / 2);
26537
+ m(this, Ln, t), m(this, bt, t), m(this, Pc, e), m(this, Cc, r), m(this, Rc, i), m(this, Vn, n), m(this, xn, o), m(this, wc, c), m(this, bc, d), m(this, Un, u), m(this, kc, p), m(this, gs, t / 2);
26538
26538
  }
26539
26539
  get voiceDetected() {
26540
26540
  return a(this, ms);
26541
26541
  }
26542
26542
  processAudioChunk(t) {
26543
- var o, d;
26544
- const e = V(o = Tl, vl, lS).call(o, t), r = V(d = Tl, yl, uS).call(d, t);
26543
+ var o, c;
26544
+ const e = V(o = Tl, vl, lS).call(o, t), r = V(c = Tl, yl, uS).call(c, t);
26545
26545
  return V(this, fl, cS).call(this, e), e / a(this, gs) > a(this, Un) && e > a(this, bt) && r > a(this, Pc) ? (m(this, Qi, a(this, Qi) + 1), m(this, Xi, a(this, Rc)), a(this, Qi) >= a(this, Cc) && m(this, ms, true)) : (m(this, Qi, 0), a(this, Xi) > 0 ? m(this, Xi, a(this, Xi) - 1) : a(this, ms) && m(this, ms, false), a(this, ms) || V(this, Sl, dS).call(this, e)), { energy: e, isVoice: a(this, ms) };
26546
26546
  }
26547
26547
  reset() {
@@ -26635,8 +26635,8 @@ ir = /* @__PURE__ */ new WeakMap(), ar = /* @__PURE__ */ new WeakMap(), fs = /*
26635
26635
  var o;
26636
26636
  a(this, Br).state === "suspended" && a(this, Br).resume().then(() => {
26637
26637
  this.logger.debug("AudioActivityReporter: AudioContext forced resumed");
26638
- }).catch((d) => {
26639
- this.logger.error("AudioActivityReporter: Error resuming AudioContext", d);
26638
+ }).catch((c) => {
26639
+ this.logger.error("AudioActivityReporter: Error resuming AudioContext", c);
26640
26640
  });
26641
26641
  const t = new Float32Array(a(this, qr).frequencyBinCount);
26642
26642
  a(this, qr).getFloatTimeDomainData(t);
@@ -26668,7 +26668,7 @@ const lD = (s = false) => {
26668
26668
  if ("MediaStreamTrackGenerator" in window && "AudioData" in window)
26669
26669
  try {
26670
26670
  const e = new window.MediaStreamTrackGenerator({ kind: "audio" }), r = e.writable.getWriter(), i = 48e3, n = 128, o = 1;
26671
- let d = 0, c = null;
26671
+ let c = 0, d = null;
26672
26672
  const u = () => l(void 0, null, function* () {
26673
26673
  try {
26674
26674
  const S = new Float32Array(n * o), E = new window.AudioData({
@@ -26676,18 +26676,18 @@ const lD = (s = false) => {
26676
26676
  sampleRate: i,
26677
26677
  numberOfFrames: n,
26678
26678
  numberOfChannels: o,
26679
- timestamp: d,
26679
+ timestamp: c,
26680
26680
  data: S
26681
26681
  });
26682
- d += n / i * 1e6, yield r.ready, yield r.write(E);
26682
+ c += n / i * 1e6, yield r.ready, yield r.write(E);
26683
26683
  } catch (S) {
26684
- c && clearInterval(c), r.releaseLock(), e.writable.abort();
26684
+ d && clearInterval(d), r.releaseLock(), e.writable.abort();
26685
26685
  }
26686
26686
  });
26687
- c = window.setInterval(u, 100);
26687
+ d = window.setInterval(u, 100);
26688
26688
  const f = new MediaStream([e]).getAudioTracks()[0];
26689
26689
  return f.addEventListener("ended", () => {
26690
- c && clearInterval(c), r.releaseLock(), e.writable.abort();
26690
+ d && clearInterval(d), r.releaseLock(), e.writable.abort();
26691
26691
  }), Object.assign(f, { fakeTracks: "fakeTracks:fakeAudioTrack" }), f.enabled = s, f;
26692
26692
  } catch (e) {
26693
26693
  }
@@ -26818,8 +26818,8 @@ const mS = (vu = class {
26818
26818
  () => V(this, Cl, fS).call(this, s, t, r, i),
26819
26819
  "joinRoom"
26820
26820
  );
26821
- } catch (d) {
26822
- return this.logger.error("Error in room joining process", { error: d }), this.context.getValue("peerSessionStore").emit(b.ROOM_NODE_FAILED), { roomJoined: false };
26821
+ } catch (c) {
26822
+ return this.logger.error("Error in room joining process", { error: c }), this.context.getValue("peerSessionStore").emit(b.ROOM_NODE_FAILED), { roomJoined: false };
26823
26823
  }
26824
26824
  });
26825
26825
  }
@@ -26896,15 +26896,15 @@ const mS = (vu = class {
26896
26896
  }
26897
26897
  return this._shareWebcam(s, t);
26898
26898
  }
26899
- const i = [t].concat(Nt.filter((p) => p !== t)), n = V(this, Ol, RS).call(this, s, i), o = Jn(this.context, "disableSimulcast"), d = a(this, Ss) === Pe.CF ? Z.ENABLE_CF_SIMULCAST : Z.ENABLE_HIVE_SIMULCAST;
26900
- !o && this.context.getValue("flagsmith").hasFeature(d) ? (this.logger.info(`Simulcast enabled for SFU: ${a(this, Ss)}`), n.encodings = ZM(this.context, s)) : this.logger.info(`Simulcast disabled for webcam producer, SFU: ${a(this, Ss)}`), this.context.getValue("flagsmith").hasFeature(Z.TRACK_HINT) && (n.track.contentHint = this.context.getValue("flagsmith").getValue(
26899
+ const i = [t].concat(Nt.filter((p) => p !== t)), n = V(this, Ol, RS).call(this, s, i), o = Jn(this.context, "disableSimulcast"), c = a(this, Ss) === Pe.CF ? Z.ENABLE_CF_SIMULCAST : Z.ENABLE_HIVE_SIMULCAST;
26900
+ !o && this.context.getValue("flagsmith").hasFeature(c) ? (this.logger.info(`Simulcast enabled for SFU: ${a(this, Ss)}`), n.encodings = ZM(this.context, s)) : this.logger.info(`Simulcast disabled for webcam producer, SFU: ${a(this, Ss)}`), this.context.getValue("flagsmith").hasFeature(Z.TRACK_HINT) && (n.track.contentHint = this.context.getValue("flagsmith").getValue(
26901
26901
  Z.TRACK_HINT
26902
26902
  ));
26903
- const c = () => {
26903
+ const d = () => {
26904
26904
  this.logger.info("Disabling video due to the producer closure"), a(this, Tt).delete(e);
26905
26905
  }, u = a(this, G).createProducer(
26906
26906
  n,
26907
- c
26907
+ d
26908
26908
  );
26909
26909
  return V(this, na, bo).call(this, e, u.then((p) => p.id)), u.then((p) => p.track);
26910
26910
  });
@@ -26920,7 +26920,7 @@ const mS = (vu = class {
26920
26920
  const e = Nt.filter((i) => {
26921
26921
  var n, o;
26922
26922
  return ((o = (n = a(this, Bn).sender) == null ? void 0 : n.video) == null ? void 0 : o.codecs.findIndex(
26923
- (d) => d.mimeType === i
26923
+ (c) => c.mimeType === i
26924
26924
  )) >= 0 && a(this, aa).get(i).size > 0;
26925
26925
  });
26926
26926
  return e.length === 0 && e.push(Nt[0]), yield Promise.all(e.map((i) => (this.logger.debug(`Calling _shareWebcam with video codec: ${i}`), this._shareWebcam(s, i)))), s;
@@ -26950,10 +26950,10 @@ const mS = (vu = class {
26950
26950
  r,
26951
26951
  i
26952
26952
  );
26953
- V(this, na, bo).call(this, pe.SCREENSHARE_VIDEO, n.then((d) => d.id));
26953
+ V(this, na, bo).call(this, pe.SCREENSHARE_VIDEO, n.then((c) => c.id));
26954
26954
  let o;
26955
26955
  if (e) {
26956
- const d = {
26956
+ const c = {
26957
26957
  track: e,
26958
26958
  codecOptions: [{ name: "opus" }],
26959
26959
  appData: {
@@ -26963,11 +26963,11 @@ const mS = (vu = class {
26963
26963
  },
26964
26964
  stopTracks: false,
26965
26965
  zeroRtpOnPause: a(this, Ss) !== Pe.CF
26966
- }, c = () => {
26966
+ }, d = () => {
26967
26967
  };
26968
26968
  o = a(this, G).createProducer(
26969
- d,
26970
- c
26969
+ c,
26970
+ d
26971
26971
  ), V(this, na, bo).call(this, pe.SCREENSHARE_AUDIO, o.then((u) => u.id));
26972
26972
  }
26973
26973
  yield Promise.all([n, o || Promise.resolve()]), this.context.getValue("callstats").screenShareStart();
@@ -27265,13 +27265,13 @@ const mS = (vu = class {
27265
27265
  kind: o
27266
27266
  }), Array.from(
27267
27267
  this.getConsumers().values()
27268
- ).filter((c) => c.producerId === n).forEach((c) => {
27269
- c.paused !== i && (this.logger.debug(
27270
- `consumer state mismatched for ${c.id}. updating consumer pause state ${c.paused} to ${i}`
27271
- ), i ? (c.pause(), this.context.getValue("peerSessionStore").emit(b.CONSUMER_PAUSED, {
27272
- id: c.id
27273
- })) : (c.resume(), this.context.getValue("peerSessionStore").emit(b.CONSUMER_RESUMED, {
27274
- id: c.id
27268
+ ).filter((d) => d.producerId === n).forEach((d) => {
27269
+ d.paused !== i && (this.logger.debug(
27270
+ `consumer state mismatched for ${d.id}. updating consumer pause state ${d.paused} to ${i}`
27271
+ ), i ? (d.pause(), this.context.getValue("peerSessionStore").emit(b.CONSUMER_PAUSED, {
27272
+ id: d.id
27273
+ })) : (d.resume(), this.context.getValue("peerSessionStore").emit(b.CONSUMER_RESUMED, {
27274
+ id: d.id
27275
27275
  })));
27276
27276
  });
27277
27277
  } catch (t) {
@@ -27367,20 +27367,20 @@ const mS = (vu = class {
27367
27367
  handlePeerCapabilities(s, t) {
27368
27368
  var e, r, i, n;
27369
27369
  for (let o = 0; o <= Nt.length; o += 1) {
27370
- const d = Nt[o];
27370
+ const c = Nt[o];
27371
27371
  if (((r = (e = t == null ? void 0 : t.receiver) == null ? void 0 : e.video) == null ? void 0 : r.codecs.findIndex(
27372
- (c) => c.mimeType === d
27372
+ (d) => d.mimeType === c
27373
27373
  )) >= 0 || o === Nt.length - 1) {
27374
- a(this, aa).get(d).add(s);
27374
+ a(this, aa).get(c).add(s);
27375
27375
  break;
27376
27376
  }
27377
27377
  }
27378
27378
  for (let o = 0; o <= Nt.length; o += 1) {
27379
- const d = Nt[o];
27379
+ const c = Nt[o];
27380
27380
  if (((n = (i = t == null ? void 0 : t.sender) == null ? void 0 : i.video) == null ? void 0 : n.codecs.findIndex(
27381
- (c) => c.mimeType === d
27381
+ (d) => d.mimeType === c
27382
27382
  )) >= 0 || o === Nt.length - 1) {
27383
- a(this, ia).get(d).add(s);
27383
+ a(this, ia).get(c).add(s);
27384
27384
  break;
27385
27385
  }
27386
27386
  }
@@ -27676,20 +27676,20 @@ const kS = ($g = class {
27676
27676
  }
27677
27677
  static init(s, t, e, r, i) {
27678
27678
  return l(this, null, function* () {
27679
- const n = lt(), o = s.getValue("peerId"), d = !!s.getValue("cachedUserDetails"), c = yield Qe.__init__(
27679
+ const n = lt(), o = s.getValue("peerId"), c = !!s.getValue("cachedUserDetails"), d = yield Qe.__init__(
27680
27680
  s,
27681
27681
  e,
27682
27682
  r,
27683
27683
  i,
27684
27684
  i.name,
27685
- d
27685
+ c
27686
27686
  );
27687
- s.setValue("self", c);
27687
+ s.setValue("self", d);
27688
27688
  const u = s.getValue("logger");
27689
27689
  if (navigator.product !== "ReactNative") {
27690
27690
  const p = !s.getValue("flagsmith").hasFeature(Z.PRECALL_BANDWIDTH_TEST);
27691
27691
  setTimeout(() => l(this, null, function* () {
27692
- const f = yield c.getAllDevices();
27692
+ const f = yield d.getAllDevices();
27693
27693
  u.info("populated_full_device_list", {
27694
27694
  devices: JSON.stringify(f)
27695
27695
  }), s.getValue("callstats").devices("AUDIO", f == null ? void 0 : f.filter((S) => S.kind === "audioinput")), s.getValue("callstats").devices("VIDEO", f == null ? void 0 : f.filter((S) => S.kind === "videoinput")), s.getValue("callstats").devices("SPEAKER", f == null ? void 0 : f.filter((S) => S.kind === "audiooutput")), u.info("Callstats:: initializing");
@@ -27711,12 +27711,12 @@ const kS = ($g = class {
27711
27711
  }), 0);
27712
27712
  } else
27713
27713
  u.info("Callstats:: Skipped initialization due to navigator product being ReactNative.");
27714
- return new kS(s, c, t, i.viewType);
27714
+ return new kS(s, d, t, i.viewType);
27715
27715
  });
27716
27716
  }
27717
27717
  shareMediaTracks() {
27718
27718
  return l(this, null, function* () {
27719
- var d;
27719
+ var c;
27720
27720
  const {
27721
27721
  audioTrack: s,
27722
27722
  videoTrack: t,
@@ -27729,23 +27729,23 @@ const kS = ($g = class {
27729
27729
  if (e.canProduceAudio === j.Allowed && r)
27730
27730
  try {
27731
27731
  yield a(this, Et, Vt).shareMic(s), this.self.audioEnabled || a(this, Et, Vt).pauseMic();
27732
- } catch (c) {
27732
+ } catch (d) {
27733
27733
  this.self.disableAudio();
27734
27734
  }
27735
27735
  if (e.canProduceVideo === j.Allowed && i)
27736
27736
  try {
27737
- const c = yield a(this, Et, Vt).shareWebcam(t);
27738
- c && c.id !== t.id && a(this, te).getValue("flagsmith").hasFeature(Z.EXP_RESHARE) && (yield a(this, Et, Vt).shareWebcam(c)), this.self.videoEnabled || a(this, Et, Vt).pauseWebcam();
27739
- } catch (c) {
27737
+ const d = yield a(this, Et, Vt).shareWebcam(t);
27738
+ d && d.id !== t.id && a(this, te).getValue("flagsmith").hasFeature(Z.EXP_RESHARE) && (yield a(this, Et, Vt).shareWebcam(d)), this.self.videoEnabled || a(this, Et, Vt).pauseWebcam();
27739
+ } catch (d) {
27740
27740
  this.self.disableVideo();
27741
27741
  }
27742
27742
  if (e.canProduceScreenshare === j.Allowed && n)
27743
27743
  try {
27744
- yield (d = a(this, Et, Vt)) == null ? void 0 : d.shareScreen({
27744
+ yield (c = a(this, Et, Vt)) == null ? void 0 : c.shareScreen({
27745
27745
  video: o.video,
27746
27746
  audio: o.audio
27747
27747
  });
27748
- } catch (c) {
27748
+ } catch (d) {
27749
27749
  this.self.disableScreenShare();
27750
27750
  }
27751
27751
  });
@@ -27879,7 +27879,7 @@ const kS = ($g = class {
27879
27879
  }
27880
27880
  joinMediaRoom(s = false) {
27881
27881
  return l(this, null, function* () {
27882
- var d, c;
27882
+ var c, d;
27883
27883
  const {
27884
27884
  peerId: t,
27885
27885
  viewType: e,
@@ -27898,7 +27898,7 @@ const kS = ($g = class {
27898
27898
  peerId: t
27899
27899
  });
27900
27900
  }
27901
- const { canProduceAudio: u, canProduceVideo: p, canProduceScreenshare: f } = this.self.permissions, { roomJoined: S } = (c = yield (d = a(this, Et, Vt)) == null ? void 0 : d.joinRoom(
27901
+ const { canProduceAudio: u, canProduceVideo: p, canProduceScreenshare: f } = this.self.permissions, { roomJoined: S } = (d = yield (c = a(this, Et, Vt)) == null ? void 0 : c.joinRoom(
27902
27902
  this.self.name,
27903
27903
  r,
27904
27904
  s,
@@ -27908,7 +27908,7 @@ const kS = ($g = class {
27908
27908
  canProduceVideo: p,
27909
27909
  canProduceScreenshare: f
27910
27910
  }
27911
- )) != null ? c : {};
27911
+ )) != null ? d : {};
27912
27912
  if (!S)
27913
27913
  return;
27914
27914
  i === "ON_STAGE" && (yield this.shareMediaTracks()), this.self.roomState = "joined", this.self.emit("roomJoined", { reconnected: s });
@@ -27996,9 +27996,9 @@ class SD {
27996
27996
  let o = i;
27997
27997
  try {
27998
27998
  o = r(n);
27999
- } catch (d) {
27999
+ } catch (c) {
28000
28000
  this.logger.error("chatSocketHandler::on::binary_decode_error", {
28001
- error: d
28001
+ error: c
28002
28002
  });
28003
28003
  }
28004
28004
  return e(o);
@@ -28062,9 +28062,9 @@ class zl {
28062
28062
  let o = i;
28063
28063
  try {
28064
28064
  o = r(n);
28065
- } catch (d) {
28065
+ } catch (c) {
28066
28066
  this.logger.error("pollSocketHandler::on::binary_decode_error", {
28067
- error: d
28067
+ error: c
28068
28068
  });
28069
28069
  }
28070
28070
  return e(o);
@@ -28133,8 +28133,8 @@ class IS {
28133
28133
  try {
28134
28134
  const { peer: n } = Ra.fromBinary((yield r).payload);
28135
28135
  a(this, Ht).getValue("connectionHandler").socketJoined = true, a(this, Ht).getValue("peerSessionStore").emit(b.SOCKET_SERVICE_ROOM_JOINED, { peer: n });
28136
- const o = this.getRoomState(), d = this.getRoomPeersNonPaginated(), [{ room: c }, { peers: u }] = yield Promise.all([o, d]);
28137
- return a(this, Ht).getValue("peerSessionStore").emit(b.ROOM_STATE, c), a(this, Ht).getValue("peerSessionStore").emit(b.SOCKET_PEERS, u), { peer: n };
28136
+ const o = this.getRoomState(), c = this.getRoomPeersNonPaginated(), [{ room: d }, { peers: u }] = yield Promise.all([o, c]);
28137
+ return a(this, Ht).getValue("peerSessionStore").emit(b.ROOM_STATE, d), a(this, Ht).getValue("peerSessionStore").emit(b.SOCKET_PEERS, u), { peer: n };
28138
28138
  } catch (n) {
28139
28139
  throw this.logger.error("RoomSocketHandler.joinRoom.failed", {
28140
28140
  error: n
@@ -28446,9 +28446,9 @@ class IS {
28446
28446
  return e(void 0);
28447
28447
  try {
28448
28448
  o = r(n);
28449
- } catch (d) {
28449
+ } catch (c) {
28450
28450
  this.logger.error("roomSocketHandler::on::binary_decode_error", {
28451
- error: d
28451
+ error: c
28452
28452
  });
28453
28453
  }
28454
28454
  return e(o);
@@ -28857,13 +28857,13 @@ de.prototype.emit = function(s) {
28857
28857
  var o = new Error("Unhandled error." + (n ? " (" + n.message + ")" : ""));
28858
28858
  throw o.context = n, o;
28859
28859
  }
28860
- var d = i[s];
28861
- if (d === void 0)
28860
+ var c = i[s];
28861
+ if (c === void 0)
28862
28862
  return false;
28863
- if (typeof d == "function")
28864
- fg(d, this, t);
28863
+ if (typeof c == "function")
28864
+ fg(c, this, t);
28865
28865
  else
28866
- for (var c = d.length, u = VS(d, c), e = 0; e < c; ++e)
28866
+ for (var d = c.length, u = VS(c, d), e = 0; e < d; ++e)
28867
28867
  fg(u[e], this, t);
28868
28868
  return true;
28869
28869
  };
@@ -28877,8 +28877,8 @@ function DS(s, t, e, r) {
28877
28877
  o = n[t] = e, ++s._eventsCount;
28878
28878
  else if (typeof o == "function" ? o = n[t] = r ? [e, o] : [o, e] : r ? o.unshift(e) : o.push(e), i = MS(s), i > 0 && o.length > i && !o.warned) {
28879
28879
  o.warned = true;
28880
- var d = new Error("Possible EventEmitter memory leak detected. " + o.length + " " + String(t) + " listeners added. Use emitter.setMaxListeners() to increase limit");
28881
- d.name = "MaxListenersExceededWarning", d.emitter = s, d.type = t, d.count = o.length, ID(d);
28880
+ var c = new Error("Possible EventEmitter memory leak detected. " + o.length + " " + String(t) + " listeners added. Use emitter.setMaxListeners() to increase limit");
28881
+ c.name = "MaxListenersExceededWarning", c.emitter = s, c.type = t, c.count = o.length, ID(c);
28882
28882
  }
28883
28883
  return s;
28884
28884
  }
@@ -29116,8 +29116,8 @@ class HD {
29116
29116
  constructor(t, e) {
29117
29117
  var F;
29118
29118
  Se(this, oh), Se(this, ko), Se(this, ch), Se(this, dh), Se(this, $d), Se(this, uh), Se(this, Do), Se(this, Oo), Se(this, Hd), Se(this, $a), Se(this, Lo), 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);
29119
- var r, i, n, o, d, c, u, p, f;
29120
- ne(this, Ia, t), ne(this, Rr, []), ne(this, ze, new Ud()), 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), (d = M(this, Ee)).debug != null || (d.debug = true), (c = M(this, Ee)).maxReconnectionAttempts != null || (c.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, {
29119
+ var r, i, n, o, c, d, u, p, f;
29120
+ ne(this, Ia, t), ne(this, Rr, []), ne(this, ze, new Ud()), 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, {
29121
29121
  code: void 0,
29122
29122
  reason: void 0
29123
29123
  }), ne(this, Ue, (F = M(this, Ee).logger) != null ? F : new UD(M(this, Ee).debug ? "debug" : "info")), ne(this, Hs, new xD());
@@ -29175,8 +29175,8 @@ class HD {
29175
29175
  }, M(this, Ae).onclose = (n) => {
29176
29176
  try {
29177
29177
  i && clearTimeout(i);
29178
- const { code: o, reason: d } = n;
29179
- r(d), M(this, Ue).debug("Socket closed. Close event:", { event: n }), M(this, Ue).debug(`Connection closed code: ${o}`), M(this, Ue).debug(`Connection closed reason: ${d}`), M(this, Ts) || _e(this, $d, lh).call(this, o, d);
29178
+ const { code: o, reason: c } = n;
29179
+ r(c), M(this, Ue).debug("Socket closed. Close event:", { event: n }), M(this, Ue).debug(`Connection closed code: ${o}`), M(this, Ue).debug(`Connection closed reason: ${c}`), M(this, Ts) || _e(this, $d, lh).call(this, o, c);
29180
29180
  } catch (o) {
29181
29181
  _e(this, ko, Pd).call(this, o);
29182
29182
  }
@@ -29420,8 +29420,8 @@ const qS = (Fg = class {
29420
29420
  }) {
29421
29421
  const n = i != null ? i : s;
29422
29422
  return new Promise(
29423
- (o, d) => {
29424
- const c = (_, P) => {
29423
+ (o, c) => {
29424
+ const d = (_, P) => {
29425
29425
  a(this, Ce).removeListener(n, _), a(this, Ce).removeListener(Tg, P), a(this, Ce).removeListener(
29426
29426
  is.errorResponse,
29427
29427
  P
@@ -29449,16 +29449,16 @@ const qS = (Fg = class {
29449
29449
  k = new Error("failed to parse error message", { cause: N });
29450
29450
  }
29451
29451
  }
29452
- d(k), c(E, S);
29452
+ c(k), d(E, S);
29453
29453
  }
29454
29454
  }, E = ({
29455
29455
  id: _,
29456
29456
  payload: P
29457
29457
  }) => {
29458
- u === _ && (o({ id: _, payload: P }), c(E, S));
29458
+ u === _ && (o({ id: _, payload: P }), d(E, S));
29459
29459
  };
29460
29460
  a(this, Ce).on(n, E), a(this, Ce).on(Tg, S), a(this, Ce).on(is.errorResponse, S), a(this, Ce).on(Es.errorResponse, S), setTimeout(() => {
29461
- c(E, S), d(new Error(`request timeout for callback eventId:${s}`));
29461
+ d(E, S), c(new Error(`request timeout for callback eventId:${s}`));
29462
29462
  }, t), a(this, Ce).send(
29463
29463
  s,
29464
29464
  u,
@@ -29540,8 +29540,8 @@ const qS = (Fg = class {
29540
29540
  useCfWorker: true,
29541
29541
  useStartSession: true
29542
29542
  });
29543
- return Object.entries(n).forEach(([o, d]) => {
29544
- r.searchParams.append(o, d.toString());
29543
+ return Object.entries(n).forEach(([o, c]) => {
29544
+ r.searchParams.append(o, c.toString());
29545
29545
  }), r.href;
29546
29546
  }, Fc = /* @__PURE__ */ new WeakSet(), gh = function() {
29547
29547
  return `${this.peerId}-${(Math.random() + 1).toString(36).substring(7)}`;
@@ -29567,11 +29567,11 @@ class GD {
29567
29567
  handleConnectedRoomsDumpRaw({ payload: t }) {
29568
29568
  var n;
29569
29569
  const e = Tb.fromBinary(t), r = e.meetings.map((o) => {
29570
- var d;
29570
+ var c;
29571
29571
  return {
29572
29572
  id: o.id,
29573
29573
  title: o.title,
29574
- participants: (d = o.participants) != null ? d : []
29574
+ participants: (c = o.participants) != null ? c : []
29575
29575
  };
29576
29576
  });
29577
29577
  return {
@@ -29755,19 +29755,19 @@ class jS extends qt {
29755
29755
  (o) => !i.includes(o.id)
29756
29756
  )), this.meetings = this.meetings.map((o) => {
29757
29757
  if (r === o.id) {
29758
- const d = o.participants.concat(
29759
- i.map((c) => n.get(c))
29758
+ const c = o.participants.concat(
29759
+ i.map((d) => n.get(d))
29760
29760
  );
29761
29761
  return B(D({}, o), {
29762
- participants: d
29762
+ participants: c
29763
29763
  });
29764
29764
  }
29765
29765
  if (e === o.id) {
29766
- const d = o.participants.filter(
29767
- (c) => !i.includes(c.id)
29766
+ const c = o.participants.filter(
29767
+ (d) => !i.includes(d.id)
29768
29768
  );
29769
29769
  return B(D({}, o), {
29770
- participants: d
29770
+ participants: c
29771
29771
  });
29772
29772
  }
29773
29773
  return o;
@@ -29834,7 +29834,7 @@ const GS = (Hg = class {
29834
29834
  authToken: s,
29835
29835
  meetingId: t
29836
29836
  }) {
29837
- var n, o, d, c;
29837
+ var n, o, c, d;
29838
29838
  if (!this.connectedMeetings.supportsConnectedMeetings)
29839
29839
  throw new Error(`You are not allowed to perform this action.
29840
29840
  Please connect with Dyte team to move you to V2 APIs & to enable connected meetings.`);
@@ -29856,14 +29856,14 @@ const GS = (Hg = class {
29856
29856
  }),
29857
29857
  authToken: s
29858
29858
  }));
29859
- this.logger.info(`ConnectedMeetingsController::switchMeeting:: initialized new meeting. Meeting Id: ${(d = i == null ? void 0 : i.meta) == null ? void 0 : d.meetingId}`);
29859
+ this.logger.info(`ConnectedMeetingsController::switchMeeting:: initialized new meeting. Meeting Id: ${(c = i == null ? void 0 : i.meta) == null ? void 0 : c.meetingId}`);
29860
29860
  try {
29861
29861
  const { hidden: u } = a(this, me).getValue("self");
29862
29862
  i.self.setName(a(this, me).getValue("self").name), yield i.join(), u && i.self.hide();
29863
29863
  } catch (u) {
29864
29864
  this.logger.error("ConnectedMeetingsController.joinRoom", { error: u });
29865
29865
  }
29866
- return this.logger.info(`ConnectedMeetingsController::switchMeeting:: asking ui-kit to show in-meeting ui of newly joined meeting id: ${(c = i == null ? void 0 : i.meta) == null ? void 0 : c.meetingId}`), this.connectedMeetings.emit("meetingChanged", i), i;
29866
+ return this.logger.info(`ConnectedMeetingsController::switchMeeting:: asking ui-kit to show in-meeting ui of newly joined meeting id: ${(d = i == null ? void 0 : i.meta) == null ? void 0 : d.meetingId}`), this.connectedMeetings.emit("meetingChanged", i), i;
29867
29867
  });
29868
29868
  }
29869
29869
  handleConnectedRoomsDump(s) {
@@ -29946,11 +29946,11 @@ const Ma = class {
29946
29946
  meetingId: i,
29947
29947
  organizationId: n,
29948
29948
  cachedUserDetails: o,
29949
- logger: d
29949
+ logger: c
29950
29950
  } = s.getAllValues();
29951
29951
  if (bS(s), Te.isSupported() === false)
29952
- throw new R("Browser not supported", "0010", d, true);
29953
- const c = iM(
29952
+ throw new R("Browser not supported", "0010", c, true);
29953
+ const d = iM(
29954
29954
  s,
29955
29955
  {
29956
29956
  authToken: r,
@@ -29958,28 +29958,28 @@ const Ma = class {
29958
29958
  cachedUserDetails: o
29959
29959
  }
29960
29960
  );
29961
- c.setRoomName(i), c.setRoomUUID(i), c.setOrganizationId(n), c.setHeader("dyte-tracing-id", t), s.setValue("apiClient", c);
29961
+ d.setRoomName(i), d.setRoomUUID(i), d.setOrganizationId(n), d.setHeader("dyte-tracing-id", t), s.setValue("apiClient", d);
29962
29962
  const u = new FM(s);
29963
29963
  s.setValue("connectionHandler", u);
29964
- const p = Ma.createSocketService(s), f = p.connect(), S = c.getUserDetails(), E = c.getPlugins();
29964
+ const p = Ma.createSocketService(s), f = p.connect(), S = d.getUserDetails(), E = d.getPlugins();
29965
29965
  let _ = Pe.HIVE, P, k = "";
29966
29966
  try {
29967
29967
  yield Ma.setupFlagsmith(s);
29968
29968
  } catch (re) {
29969
- d.error("Failed to setup flagsmith", { error: re });
29969
+ c.error("Failed to setup flagsmith", { error: re });
29970
29970
  }
29971
29971
  try {
29972
29972
  yield f;
29973
29973
  } catch (re) {
29974
- d.error(
29974
+ c.error(
29975
29975
  "[Controller]: Failed to connect to socket server:",
29976
29976
  { error: re }
29977
29977
  );
29978
29978
  }
29979
29979
  try {
29980
- ({ sfu: _, meetingTitle: k } = yield c.getRoomNodeData()), P = yield S, d.info(`SFU ${_} is being used.`), s.setValue("presetName", P.preset.name), s.setValue("roomNodeOptions", { sfu: _ });
29980
+ ({ sfu: _, meetingTitle: k } = yield d.getRoomNodeData()), P = yield S, c.info(`SFU ${_} is being used.`), s.setValue("presetName", P.preset.name), s.setValue("roomNodeOptions", { sfu: _ });
29981
29981
  } catch (re) {
29982
- d.error("Failed to get room metadata", { error: re });
29982
+ c.error("Failed to get room metadata", { error: re });
29983
29983
  }
29984
29984
  const A = Wu.init(P.preset, !s.getValue("modules").theme), N = zu.init(
29985
29985
  s,
@@ -30000,11 +30000,11 @@ const Ma = class {
30000
30000
  false,
30001
30001
  N
30002
30002
  )) == null || F.catch((Je) => {
30003
- d.error(
30003
+ c.error(
30004
30004
  "[Controller]: Failed to queue partial media room promise:",
30005
30005
  { error: Je }
30006
30006
  );
30007
- })), T.location.country = (K = c.ipInfo) == null ? void 0 : K.country;
30007
+ })), T.location.country = (K = d.ipInfo) == null ? void 0 : K.country;
30008
30008
  const { controllers: $ } = yield H;
30009
30009
  return bC(), new Ma(e, $, s);
30010
30010
  });
@@ -30019,13 +30019,13 @@ const Ma = class {
30019
30019
  meetingId: i,
30020
30020
  organizationId: n,
30021
30021
  logger: o
30022
- } = s.getAllValues(), d = wC(i), c = B(D({
30022
+ } = s.getAllValues(), c = wC(i), d = B(D({
30023
30023
  entity: bu.PEER,
30024
30024
  clientId: n,
30025
30025
  isAnonUser: !n,
30026
30026
  sdkVersion: s.getValue("sdkVersion"),
30027
30027
  presetName: s.getValue("presetName"),
30028
- meetingHash: d,
30028
+ meetingHash: c,
30029
30029
  roomName: i
30030
30030
  }, Te.getDeviceInfo()), {
30031
30031
  isReactNative: navigator.isReactNative
@@ -30034,7 +30034,7 @@ const Ma = class {
30034
30034
  const p = (u = r == null ? void 0 : r.whitelabelled_flags_endpoint) == null || u ? la({ servicePrefix: "flags", baseURI: e }) : "edge.api.flagsmith.com";
30035
30035
  yield s.getValue("flagsmith").identify(
30036
30036
  `${bu.PEER}_${t}`,
30037
- JSON.parse(JSON.stringify(c)),
30037
+ JSON.parse(JSON.stringify(d)),
30038
30038
  false,
30039
30039
  5e3,
30040
30040
  p,
@@ -30052,7 +30052,7 @@ const Ma = class {
30052
30052
  static setupControllers(s, t, e, r, i, n, o) {
30053
30053
  return l(this, null, function* () {
30054
30054
  var $e, yr, Tr;
30055
- const d = t.getValue("modules"), { participant: c } = e, u = t.getValue("defaults"), p = t.getValue("logger"), { sfu: f } = t.getValue("roomNodeOptions"), { viewType: S, mediaConstraints: { audio: E } } = n;
30055
+ 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;
30056
30056
  t.setValue("viewType", S), t.setValue("defaults", D({
30057
30057
  mediaConfiguration: {
30058
30058
  audio: {
@@ -30069,7 +30069,7 @@ const Ma = class {
30069
30069
  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(
30070
30070
  t,
30071
30071
  I,
30072
- c,
30072
+ d,
30073
30073
  o,
30074
30074
  n
30075
30075
  ), Me = yield If.init(
@@ -30079,37 +30079,37 @@ const Ma = class {
30079
30079
  re,
30080
30080
  i
30081
30081
  );
30082
- if (d.participant && (F = new Sr(
30082
+ if (c.participant && (F = new Sr(
30083
30083
  t,
30084
30084
  ie.self,
30085
30085
  I,
30086
30086
  f
30087
- )), (Tr = d.e2ee) != null && Tr.enabled && d.e2ee.manager.init(p, t.getValue("peerSessionStore")), d.chat && (P = yield _s.init(
30087
+ )), (Tr = c.e2ee) != null && Tr.enabled && c.e2ee.manager.init(p, t.getValue("peerSessionStore")), c.chat && (P = yield _s.init(
30088
30088
  t,
30089
30089
  vr,
30090
30090
  U,
30091
30091
  ie.self,
30092
30092
  F.participants
30093
- )), d.internals && (N = yield Nh.init(t)), d.livestream && n.viewType === Mt.Livestream && t.getValue("flagsmith").hasFeature(Z.LIVESTREAM) && ($ = new Uf(
30093
+ )), c.internals && (N = yield Nh.init(t)), c.livestream && n.viewType === Mt.Livestream && t.getValue("flagsmith").hasFeature(Z.LIVESTREAM) && ($ = new Uf(
30094
30094
  t,
30095
30095
  ie.self,
30096
30096
  C
30097
30097
  )), n.viewType !== Mt.Chat) {
30098
- if (d.poll && (_ = yield Rf.init(
30098
+ if (c.poll && (_ = yield Rf.init(
30099
30099
  t,
30100
30100
  ie.self,
30101
30101
  Is
30102
- )), d.recording && (H = new Of(
30102
+ )), c.recording && (H = new Of(
30103
30103
  t,
30104
30104
  ie.self,
30105
30105
  I
30106
- )), d.stage && (k = new Af(
30106
+ )), c.stage && (k = new Af(
30107
30107
  t,
30108
30108
  ni,
30109
30109
  I,
30110
30110
  ie.self,
30111
30111
  F.participants
30112
- )), d.plugin) {
30112
+ )), c.plugin) {
30113
30113
  if (!F)
30114
30114
  throw new R(
30115
30115
  "The plugin module cannot be initialized without the `participant` module",
@@ -30127,9 +30127,9 @@ const Ma = class {
30127
30127
  i
30128
30128
  );
30129
30129
  }
30130
- if (d.connectedMeetings && (K = yield Xl.init(
30130
+ if (c.connectedMeetings && (K = yield Xl.init(
30131
30131
  t
30132
- )), d.pip) {
30132
+ )), c.pip) {
30133
30133
  const $s = yield ku._init(t, ie.self);
30134
30134
  t.setValue("pip", $s);
30135
30135
  }
@@ -30317,49 +30317,49 @@ let si = (Bg = class {
30317
30317
  return a(this, zr).getValue("peerId");
30318
30318
  }
30319
30319
  static initMedia(t = {}, e = false, r = void 0) {
30320
- var c;
30321
- const i = (c = r == null ? void 0 : r.peerId) != null ? c : v4(), n = ur.createContext(i, {
30320
+ var d;
30321
+ const i = (d = r == null ? void 0 : r.peerId) != null ? d : v4(), n = ur.createContext(i, {
30322
30322
  peerId: i
30323
30323
  }), o = n.getValue("logger");
30324
30324
  o.init(n);
30325
- const d = new Gf(o);
30326
- return d.init(t, e, n), n.setValue("defaults", { mediaHandler: d }), d;
30325
+ const c = new Gf(o);
30326
+ return c.init(t, e, n), n.setValue("defaults", { mediaHandler: c }), c;
30327
30327
  }
30328
30328
  static init(t) {
30329
30329
  return l(this, null, function* () {
30330
30330
  var E, _, P, A, N, H, $;
30331
30331
  Te.init();
30332
- 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, d = go(k, ["meetingId"]);
30332
+ 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 = go(k, ["meetingId"]);
30333
30333
  window.__zone_symbol__DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION = true;
30334
- const c = si.setupContext(
30334
+ const d = si.setupContext(
30335
30335
  r,
30336
30336
  t,
30337
30337
  o,
30338
- d
30339
- ), u = c.getValue("telemetry"), p = c.getValue("logger");
30340
- tv(p), Eg.init(p), u.init(c, {
30338
+ c
30339
+ ), u = d.getValue("telemetry"), p = d.getValue("logger");
30340
+ tv(p), Eg.init(p), u.init(d, {
30341
30341
  roomName: o,
30342
- userId: d.participantId,
30343
- organizationId: d.orgId,
30342
+ userId: c.participantId,
30343
+ organizationId: c.orgId,
30344
30344
  peerId: r
30345
- }, (N = (A = t.modules) == null ? void 0 : A.tracing) != null ? N : true), p.init(c), p.info("DyteClient::init::options", {
30345
+ }, (N = (A = t.modules) == null ? void 0 : A.tracing) != null ? N : true), p.init(d), p.info("DyteClient::init::options", {
30346
30346
  dyteClientInitOptions: B(D({}, t), {
30347
30347
  authToken: `${(H = t.authToken) == null ? void 0 : H.slice(0, 10)}...
30348
30348
  ${($ = t.authToken) == null ? void 0 : $.slice(-10)}`
30349
30349
  })
30350
30350
  });
30351
- const f = yield Xc.init(c), S = new si(c, f);
30352
- return c.setValue("meeting", S), S;
30351
+ const f = yield Xc.init(d), S = new si(d, f);
30352
+ return d.setValue("meeting", S), S;
30353
30353
  });
30354
30354
  }
30355
30355
  static setupContext(t, e, r, i) {
30356
- var c, u;
30357
- const n = ur.createContext(t, e), o = D(D({}, vC), e == null ? void 0 : e.modules), d = e.defaults || {
30356
+ var d, u;
30357
+ const n = ur.createContext(t, e), o = D(D({}, vC), e == null ? void 0 : e.modules), c = e.defaults || {
30358
30358
  audio: true,
30359
30359
  video: true
30360
30360
  };
30361
- 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", (c = e.overrides) != null ? c : {}), n.setValue("env", yC({ baseURI: i.baseURI })), n.setValue("defaults", d), n.setValue("onError", e.onError || (() => {
30362
- })), n.setValue("cachedUserDetails", Ps(e.cachedUserDetails)), n.setValue("sdkVersion", "3.1.3-staging.1"), (u = e.modules) != null && u.experimentalAudioPlayback && n.setValue("audioPlayback", new sO()), n;
30361
+ 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 || (() => {
30362
+ })), n.setValue("cachedUserDetails", Ps(e.cachedUserDetails)), n.setValue("sdkVersion", "3.1.3-staging.3"), (u = e.modules) != null && u.experimentalAudioPlayback && n.setValue("audioPlayback", new sO()), n;
30363
30363
  }
30364
30364
  join() {
30365
30365
  return l(this, null, function* () {