@vkontakte/calls-sdk 2.8.11-dev.3ca8f2a1.0 → 2.8.11-dev.48925708.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/calls-sdk.esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * @vkontakte/calls-sdk v2.8.11-dev.3ca8f2a1.0
3
- * Tue, 26 May 2026 11:12:08 GMT
2
+ * @vkontakte/calls-sdk v2.8.11-dev.48925708.0
3
+ * Thu, 28 May 2026 21:37:33 GMT
4
4
  * https://calls-sdk.cdn-vk.ru/doc/latest/index.html
5
5
  */
6
6
 
@@ -852,7 +852,7 @@ var be = ye.getInstance(), D = class e {
852
852
  return 1.1;
853
853
  }
854
854
  static get sdkVersion() {
855
- return "2.8.11-dev.3ca8f2a1.0";
855
+ return "2.8.11-dev.48925708.0";
856
856
  }
857
857
  static get debug() {
858
858
  return e._params.debug;
@@ -1125,6 +1125,9 @@ var be = ye.getInstance(), D = class e {
1125
1125
  static get videoTracksCount() {
1126
1126
  return Number(e._params.videoTracksCount);
1127
1127
  }
1128
+ static get requestDisplayLayoutThrottleMs() {
1129
+ return Number(e._params.requestDisplayLayoutThrottleMs);
1130
+ }
1128
1131
  static get breakVideoPayloadTypes() {
1129
1132
  return e._params.breakVideoPayloadTypes;
1130
1133
  }
@@ -1207,7 +1210,7 @@ var be = ye.getInstance(), D = class e {
1207
1210
  return e._params.enableVideoEffectsFpsDegradation;
1208
1211
  }
1209
1212
  static get simulcast() {
1210
- return e._params.simulcast;
1213
+ return L.isSimulcastSupportedByBrowser() && e._params.simulcast;
1211
1214
  }
1212
1215
  static get webtransport() {
1213
1216
  return e._params.webtransport;
@@ -1235,6 +1238,7 @@ var be = ye.getInstance(), D = class e {
1235
1238
  screenShareCongestionControl: e._params.screenShareCongestionControl,
1236
1239
  screenShareCongestionControlThreshold: e._params.screenShareCongestionControlThreshold,
1237
1240
  videoTracksCount: e._params.videoTracksCount,
1241
+ requestDisplayLayoutThrottleMs: e._params.requestDisplayLayoutThrottleMs,
1238
1242
  asrDataChannel: e._params.asrDataChannel,
1239
1243
  videoMaxHeight: e._params.videoMaxHeight,
1240
1244
  videoMaxWidth: e._params.videoMaxWidth,
@@ -1328,6 +1332,7 @@ h(D, "_params", {
1328
1332
  preferVP9: !1,
1329
1333
  audioNack: !0,
1330
1334
  videoTracksCount: 30,
1335
+ requestDisplayLayoutThrottleMs: 250,
1331
1336
  movieShare: !1,
1332
1337
  useCallsToContacts: !1,
1333
1338
  useParticipantListChunk: !1,
@@ -3813,7 +3818,7 @@ var er = class extends g {
3813
3818
  frames_dropped: Math.max(0, t.frames_dropped - this._previousCallStatReport.frames_dropped),
3814
3819
  rtt: Math.max(0, t.rtt)
3815
3820
  };
3816
- if (navigator.hardwareConcurrency && (i.cpu_hardware_concurrency = navigator.hardwareConcurrency), n && !sr(t.jitter_video) && (i.jitter_video = Math.round(t.jitter_video)), r && !sr(t.jitter_audio) && (i.jitter_audio = Math.round(t.jitter_audio)), n && !sr(t.interframe_delay_variance) && (i.interframe_delay_variance = t.interframe_delay_variance), t.freeze_count && t.total_freezes_duration && (i.freeze_count = t.freeze_count, i.total_freezes_duration = Math.round(t.total_freezes_duration * 1e3)), t.ss_freeze_count && t.ss_total_freezes_duration && (i.ss_freeze_count = t.ss_freeze_count, i.ss_total_freezes_duration = t.ss_total_freezes_duration), r && !sr(t.total_audio_samples_received)) {
3821
+ if (D.simulcast && (i.is_simulcast = !0), navigator.hardwareConcurrency && (i.cpu_hardware_concurrency = navigator.hardwareConcurrency), n && !sr(t.jitter_video) && (i.jitter_video = Math.round(t.jitter_video)), r && !sr(t.jitter_audio) && (i.jitter_audio = Math.round(t.jitter_audio)), n && !sr(t.interframe_delay_variance) && (i.interframe_delay_variance = t.interframe_delay_variance), t.freeze_count && t.total_freezes_duration && (i.freeze_count = t.freeze_count, i.total_freezes_duration = Math.round(t.total_freezes_duration * 1e3)), t.ss_freeze_count && t.ss_total_freezes_duration && (i.ss_freeze_count = t.ss_freeze_count, i.ss_total_freezes_duration = t.ss_total_freezes_duration), r && !sr(t.total_audio_samples_received)) {
3817
3822
  let e = Math.max(0, t.total_audio_samples_received - this._previousCallStatReport.total_audio_samples_received), n = Math.max(0, t.inserted_audio_samples_for_deceleration - this._previousCallStatReport.inserted_audio_samples_for_deceleration), r = Math.max(0, t.removed_audio_samples_for_acceleration - this._previousCallStatReport.removed_audio_samples_for_acceleration), a = Math.max(0, t.concealed_audio_samples - this._previousCallStatReport.concealed_audio_samples), o = Math.max(0, t.silent_concealed_audio_samples - this._previousCallStatReport.silent_concealed_audio_samples), s = Math.max(0, t.audio_concealment_events - this._previousCallStatReport.audio_concealment_events);
3818
3823
  i.inserted_audio_samples_for_deceleration = cr(n / e * 1e3), i.removed_audio_samples_for_acceleration = cr(r / e * 1e3), i.concealed_audio_samples = cr(a / e * 1e3), i.concealed_silent_audio_samples = cr(o / e * 1e3), i.concealment_audio_avg_size = cr(a / s), i.total_audio_energy = t.total_audio_energy;
3819
3824
  }
@@ -5572,7 +5577,7 @@ var ei = 2 ** 15 - 1, ti = 1, ni = 5, ri = 5, ii = class e {
5572
5577
  }
5573
5578
  }
5574
5579
  async onCameraResolutionChanged() {
5575
- D.simulcast && L.isSimulcastSupportedByBrowser() && await this._changeSimulcastInfo(!0, !1);
5580
+ D.simulcast && await this._changeSimulcastInfo(!0, !1);
5576
5581
  }
5577
5582
  _createPerfStatsReporter() {
5578
5583
  this._perfStatReporter?.destroy(), this._perfStatReporter = new ir(this, this._signaling);
@@ -5802,7 +5807,7 @@ var ei = 2 ** 15 - 1, ti = 1, ni = 5, ri = 5, ii = class e {
5802
5807
  audioShare: D.audioShare,
5803
5808
  fastScreenShare: D.fastScreenShare,
5804
5809
  videoSuspend: D.videoSuspend,
5805
- simulcast: D.simulcast && L.isSimulcastSupportedByBrowser(),
5810
+ simulcast: D.simulcast,
5806
5811
  consumerFastScreenShare: D.consumerFastScreenShare,
5807
5812
  consumerFastScreenShareQualityOnDemand: D.consumerFastScreenShareQualityOnDemand,
5808
5813
  transparentAudio: D.transparentAudio
@@ -5811,41 +5816,41 @@ var ei = 2 ** 15 - 1, ti = 1, ni = 5, ri = 5, ii = class e {
5811
5816
  }
5812
5817
  async _processOffer(e, t) {
5813
5818
  if (!this._pc) throw Error("Interrupt allocation");
5814
- let n = D.simulcast && L.isSimulcastSupportedByBrowser(), r = n;
5819
+ let n = D.simulcast;
5815
5820
  try {
5816
5821
  await this._pc.setRemoteDescription(e);
5817
5822
  } catch (e) {
5818
5823
  throw z.error("[single] unable to set remote offer", e), y.log(C.ERROR, "setRemoteDescription-single"), e;
5819
5824
  }
5820
- let i = this._findFirstSimTransceiver();
5821
- if (n) if (i) {
5822
- z.log(`_processOffer: caps.simulcast=${D.simulcast} mid=${i.mid} dir=${i.direction}`);
5823
- let e = this._mediaSource.getStream(), t = await this._setupSimulcastTransceiver(e, i);
5824
- z.log("_processOffer: simulcastInfo", t), t || (z.log(`_processOffer: simulcast transceiver not found in server offer mid=${i.mid}, disable simulcast`), r = !1);
5825
- } else z.log("_processOffer: simulcast transceiver not found in server offer, disable simulcast"), r = !1;
5826
- let a;
5825
+ let r = this._findFirstSimTransceiver();
5826
+ if (D.simulcast) if (r) {
5827
+ z.log(`_processOffer: caps.simulcast=${D.simulcast} mid=${r.mid} dir=${r.direction}`);
5828
+ let e = this._mediaSource.getStream(), t = await this._setupSimulcastTransceiver(e, r);
5829
+ z.log("_processOffer: simulcastInfo", t), t || (z.log(`_processOffer: simulcast transceiver not found in server offer mid=${r.mid}, disable simulcast`), n = !1);
5830
+ } else z.log("_processOffer: simulcast transceiver not found in server offer, disable simulcast"), n = !1;
5831
+ let i;
5827
5832
  try {
5828
5833
  if (await this._handleTracks(), z.debug("[single] create local answer"), !this._pc) throw Error("Interrupt allocation");
5829
- a = await this._pc.createAnswer();
5834
+ i = await this._pc.createAnswer();
5830
5835
  } catch (e) {
5831
5836
  throw z.error("[single] unable to create answer", e), y.log(C.ERROR, "createAnswer-single"), e;
5832
5837
  }
5833
5838
  try {
5834
5839
  if (!this._pc) throw Error("Interrupt allocation");
5835
- a.sdp = E.patchLocalSDP(a.sdp, !1, L.isBrokenH264Decoder(), !1), z.debug("[single] set local answer", { answer: a }), await this._pc.setLocalDescription(a);
5840
+ i.sdp = E.patchLocalSDP(i.sdp, !1, L.isBrokenH264Decoder(), !1), z.debug("[single] set local answer", { answer: i }), await this._pc.setLocalDescription(i);
5836
5841
  } catch (e) {
5837
5842
  throw z.error("[single] unable to set local answer", e), y.log(C.ERROR, "setLocalDescription-single"), e;
5838
5843
  }
5839
- if (r && i) {
5840
- a.sdp = E.patchSimulcastAnswerSdp(a.sdp, i, ne.WIDTH, ne.HEIGHT);
5844
+ if (n && r) {
5845
+ i.sdp = E.patchSimulcastAnswerSdp(i.sdp, r, ne.WIDTH, ne.HEIGHT);
5841
5846
  for (let e of this._pc.getTransceivers()) e.mid === null && e.stop();
5842
5847
  }
5843
5848
  try {
5844
- z.debug("[single] transmit local answer", { answer: a }), this._updateSSRCMap(e), await this._signaling.acceptProducer(a, Object.keys(this._ssrcMap), t), z.debug("[single] remote offer has been processed");
5849
+ z.debug("[single] transmit local answer", { answer: i }), this._updateSSRCMap(e), await this._signaling.acceptProducer(i, Object.keys(this._ssrcMap), t), z.debug("[single] remote offer has been processed");
5845
5850
  } catch (e) {
5846
5851
  z.warn("[single] unable to send local answer", e), y.log(C.ERROR, "acceptProducer");
5847
5852
  }
5848
- r && await this._changeSimulcastInfo(!0, !0);
5853
+ n && await this._changeSimulcastInfo(!0, !0);
5849
5854
  }
5850
5855
  _findFirstSimTransceiver() {
5851
5856
  if (!this._pc) return null;
@@ -5988,7 +5993,7 @@ var ei = 2 ** 15 - 1, ti = 1, ni = 5, ri = 5, ii = class e {
5988
5993
  z.error("ServerTransport: Unable to replace track", e), y.log(C.ERROR, "replaceTrack-single");
5989
5994
  });
5990
5995
  };
5991
- if (z.log(`_onReplacedTrack: newTrack=${e.getSettings().width}x${e.getSettings().height}`), D.simulcast && L.isSimulcastSupportedByBrowser() && e.kind === k.video) {
5996
+ if (z.log(`_onReplacedTrack: newTrack=${e.getSettings().width}x${e.getSettings().height}`), D.simulcast && e.kind === k.video) {
5992
5997
  let t = this._pc?.getTransceivers().find((t) => t.direction === "sendonly" && t.sender?.track?.kind === k.video && t.sender.track.contentHint === e.contentHint)?.sender;
5993
5998
  t?.track ? (n(t, e), e.getSettings().width && e.getSettings().height && this._changeSimulcastInfo(!1, !1)) : z.warn("_onReplacedTrack: simulcast video transceiver not found");
5994
5999
  } else {
@@ -6015,7 +6020,7 @@ var ei = 2 ** 15 - 1, ti = 1, ni = 5, ri = 5, ii = class e {
6015
6020
  }
6016
6021
  async _changeSimulcastInfo(e, t) {
6017
6022
  let n = this._mediaSource.getMediaSettings().isVideoEnabled, r = this._findFirstSimTransceiver();
6018
- if (!D.simulcast || !L.isSimulcastSupportedByBrowser() || !n || !r || !r.sender) return;
6023
+ if (!D.simulcast || !n || !r || !r.sender) return;
6019
6024
  let i = this._mediaSource.getStream();
6020
6025
  if (!i) return;
6021
6026
  let a = i.getVideoTracks()[0], o = a.getSettings().width, s = a.getSettings().height, c = ce(o, s, this._serverSettings.camera?.bitrates?.generic), l = t || !oe(this._simulcastInfo, c);
@@ -7540,7 +7545,117 @@ var Ta = class {
7540
7545
  let t = Number((100 * e.usedJSHeapSize / e.jsHeapSizeLimit).toFixed(2)), n = Number((e.usedJSHeapSize / 1024 / 1024).toFixed(1));
7541
7546
  t > Da ? z.warn(`High memory usage: ${t}% (${n} MiB)`) : (!this._lastMemoryStat.percent || Math.abs(t - this._lastMemoryStat.percent) >= Oa) && (z.debug(`Memory usage: ${t}% (${n} MiB)`), this._lastMemoryStat.percent = t, this._lastMemoryStat.bytes = e.usedJSHeapSize);
7542
7547
  }
7543
- }, Aa = 44100, ja = class {
7548
+ }, Aa = class {
7549
+ constructor({ api: e, getParticipants: t, isMe: n, updateDisplayLayout: r }) {
7550
+ h(this, "_api", void 0), h(this, "_getParticipants", void 0), h(this, "_isMe", void 0), h(this, "_updateDisplayLayout", void 0), h(this, "_requestedLayouts", {}), h(this, "_uncertainLayouts", {}), h(this, "_pendingRequests", null), h(this, "_pendingPromises", []), h(this, "_lastRequests", null), h(this, "_timer", null), h(this, "_inFlight", !1), h(this, "_lastFlushAt", null), h(this, "_generation", 0), h(this, "_forceNextFlush", !1), this._api = e, this._getParticipants = t, this._isMe = n, this._updateDisplayLayout = r;
7551
+ }
7552
+ request(e) {
7553
+ this._pendingRequests = e.slice(), this._lastRequests = e.slice();
7554
+ let t = new Promise((e, t) => {
7555
+ this._pendingPromises.push({
7556
+ resolve: e,
7557
+ reject: t
7558
+ });
7559
+ });
7560
+ return this._schedule(), t;
7561
+ }
7562
+ resend() {
7563
+ this._lastRequests && (this._pendingRequests = this._lastRequests.slice(), this._forceNextFlush = !0, this._schedule());
7564
+ }
7565
+ cleanupParticipant(e) {
7566
+ for (let t of Object.keys(this._requestedLayouts)) Qt(t).participantId === e && delete this._requestedLayouts[t];
7567
+ for (let t of Object.keys(this._uncertainLayouts)) Qt(t).participantId === e && delete this._uncertainLayouts[t];
7568
+ }
7569
+ clear() {
7570
+ this._generation++, this._timer !== null && (window.clearTimeout(this._timer), this._timer = null), this._pendingPromises.forEach(({ resolve: e }) => e()), this._requestedLayouts = {}, this._uncertainLayouts = {}, this._pendingRequests = null, this._pendingPromises = [], this._lastRequests = null, this._inFlight = !1, this._lastFlushAt = null, this._forceNextFlush = !1;
7571
+ }
7572
+ _schedule() {
7573
+ if (this._inFlight || this._timer !== null) return;
7574
+ let e = this._lastFlushAt === null ? 0 : Math.max(0, D.requestDisplayLayoutThrottleMs - (Date.now() - this._lastFlushAt));
7575
+ this._timer = window.setTimeout(() => {
7576
+ this._timer = null, this._flush();
7577
+ }, e);
7578
+ }
7579
+ async _flush() {
7580
+ if (this._inFlight || !this._pendingRequests) return;
7581
+ this._inFlight = !0;
7582
+ let e = this._generation, t = this._pendingRequests, n = this._pendingPromises;
7583
+ this._pendingRequests = null, this._pendingPromises = [];
7584
+ let r = {};
7585
+ try {
7586
+ r = await this._getRequestLayouts(t);
7587
+ let i = this._forceNextFlush || Object.keys(this._uncertainLayouts).length > 0;
7588
+ this._forceNextFlush = !1;
7589
+ let a = this._getDiff(r, i);
7590
+ a.length && await this._updateDisplayLayout(a), e === this._generation && (this._requestedLayouts = r, this._uncertainLayouts = {}), n.forEach(({ resolve: e }) => e());
7591
+ } catch (t) {
7592
+ e === this._generation ? (this._uncertainLayouts = {
7593
+ ...this._uncertainLayouts,
7594
+ ...r
7595
+ }, n.forEach(({ reject: e }) => e(t))) : n.forEach(({ resolve: e }) => e());
7596
+ } finally {
7597
+ e === this._generation && (this._lastFlushAt = Date.now(), this._inFlight = !1, this._pendingRequests && this._schedule());
7598
+ }
7599
+ }
7600
+ async _getRequestLayouts(e) {
7601
+ let t = {}, n = await this._getParticipants();
7602
+ for (let r of e) {
7603
+ let e = typeof r.uid == "object" ? r.uid : Z.fromId(r.uid), i = this._api.getCachedOkIdByExternalId(e);
7604
+ if (!i) {
7605
+ z.log(`Unknown participant external ID ${typeof r.uid == "object" ? Z.toString(r.uid) : r.uid}`);
7606
+ continue;
7607
+ }
7608
+ if (!n[i] && !this._isMe(i)) continue;
7609
+ let a = Zt({
7610
+ participantId: i,
7611
+ mediaType: r.mediaType,
7612
+ streamName: r.streamName
7613
+ });
7614
+ t[a] = {
7615
+ uid: r.uid,
7616
+ mediaType: r.mediaType,
7617
+ width: r.width,
7618
+ height: r.height,
7619
+ fit: r.cover ? "cv" : "cn",
7620
+ ...r.priority === void 0 ? {} : { priority: r.priority },
7621
+ ...r.streamName === void 0 ? {} : { streamName: r.streamName }
7622
+ };
7623
+ }
7624
+ return t;
7625
+ }
7626
+ _getDiff(e, t = !1) {
7627
+ let n = [];
7628
+ if (t) {
7629
+ let t = {
7630
+ ...this._requestedLayouts,
7631
+ ...this._uncertainLayouts
7632
+ };
7633
+ n.push(...Object.values(e));
7634
+ for (let [r, i] of Object.entries(t)) e[r] || n.push({
7635
+ uid: i.uid,
7636
+ mediaType: i.mediaType,
7637
+ stopStream: !0,
7638
+ ...i.streamName === void 0 ? {} : { streamName: i.streamName }
7639
+ });
7640
+ return n;
7641
+ }
7642
+ for (let [t, r] of Object.entries(e)) {
7643
+ let e = this._requestedLayouts[t];
7644
+ (!e || this._isChanged(e, r)) && n.push(r);
7645
+ }
7646
+ for (let [t, r] of Object.entries(this._requestedLayouts)) e[t] || n.push({
7647
+ uid: r.uid,
7648
+ mediaType: r.mediaType,
7649
+ stopStream: !0,
7650
+ ...r.streamName === void 0 ? {} : { streamName: r.streamName }
7651
+ });
7652
+ return n;
7653
+ }
7654
+ _isChanged(e, t) {
7655
+ let n = e, r = t;
7656
+ return n.width !== r.width || n.height !== r.height || n.fit !== r.fit || n.priority !== r.priority;
7657
+ }
7658
+ }, ja = 44100, Ma = class {
7544
7659
  constructor(e, t) {
7545
7660
  h(this, "_analyser", null), h(this, "_gainNode", null), h(this, "_fftBins", null), h(this, "_mediaStreamSource", null), h(this, "_lastSmoothedLevel", 0), h(this, "_trackId", void 0), h(this, "_track", void 0), h(this, "_stream", void 0), this._trackId = e, this._track = t, this._stream = new MediaStream([t]);
7546
7661
  try {
@@ -7557,7 +7672,7 @@ var Ta = class {
7557
7672
  _getBins() {
7558
7673
  if (!this._fftBins || !this._analyser) return new Uint8Array();
7559
7674
  this._analyser.getByteFrequencyData(this._fftBins);
7560
- let e = Aa / this._fftBins.length, t = Math.ceil(D.voiceParams.minFreq / e), n = Math.floor(D.voiceParams.maxFreq / e);
7675
+ let e = ja / this._fftBins.length, t = Math.ceil(D.voiceParams.minFreq / e), n = Math.floor(D.voiceParams.maxFreq / e);
7561
7676
  return this._fftBins.subarray(t, n);
7562
7677
  }
7563
7678
  getLevel() {
@@ -7570,7 +7685,7 @@ var Ta = class {
7570
7685
  destroy() {
7571
7686
  this._mediaStreamSource && (this._mediaStreamSource.disconnect(), this._mediaStreamSource = null), this._gainNode && (this._gainNode.disconnect(), this._gainNode = null), this._analyser && (this._analyser.disconnect(), this._analyser = null, this._fftBins = null, this._lastSmoothedLevel = 0), this._stream.removeTrack(this._track);
7572
7687
  }
7573
- }, Ma = class extends g {
7688
+ }, Na = class extends g {
7574
7689
  constructor(e) {
7575
7690
  super(), h(this, "_detector", null), h(this, "_interval", null);
7576
7691
  let t = () => {
@@ -7586,7 +7701,7 @@ var Ta = class {
7586
7701
  }), this.subscribe(e, Oe.SOURCE_READY, n), n();
7587
7702
  }
7588
7703
  init(e) {
7589
- this._stopDetector(), this._detector = new ja("local", e.clone());
7704
+ this._stopDetector(), this._detector = new Ma("local", e.clone());
7590
7705
  }
7591
7706
  _stopDetector() {
7592
7707
  this._detector && (this._detector.track.stop(), this._detector.destroy(), this._detector = null);
@@ -7594,7 +7709,7 @@ var Ta = class {
7594
7709
  destroy() {
7595
7710
  this.unsubscribe(), this._interval && (window.clearTimeout(this._interval), this._interval = null), this._stopDetector();
7596
7711
  }
7597
- }, Na = class {
7712
+ }, Pa = class {
7598
7713
  constructor(e) {
7599
7714
  h(this, "processor", void 0), h(this, "queue", []), h(this, "isProcessing", !1), this.processor = e;
7600
7715
  }
@@ -7614,9 +7729,9 @@ var Ta = class {
7614
7729
  this.isProcessing = !1;
7615
7730
  }
7616
7731
  }
7617
- }, Pa = /* @__PURE__ */ function(e) {
7732
+ }, Fa = /* @__PURE__ */ function(e) {
7618
7733
  return e.VOLUMES_DETECTED = "VOLUMES_DETECTED", e;
7619
- }({}), Fa = class extends g {
7734
+ }({}), Ia = class extends g {
7620
7735
  constructor(e) {
7621
7736
  super(), h(this, "_detectors", /* @__PURE__ */ new Map()), h(this, "_interval", null), h(this, "_activeParticipants", void 0), h(this, "_removedParticipants", void 0), h(this, "_topology", void 0), this._topology = e.getTopology(), this.subscribe(e, K.REMOTE_TRACK_ADDED, this._onRemoteTrackAdded.bind(this)), this.subscribe(e, K.REMOTE_TRACK_REMOVED, this._onRemoteTrackRemoved.bind(this)), this.subscribe(e, K.SIGNALLED_ACTIVE_PARTICIPANTS, this._onSignalledActiveParticipants.bind(this)), this.subscribe(e, K.TOPOLOGY_CHANGED, this._onTopologyChanged.bind(this));
7622
7737
  }
@@ -7624,7 +7739,7 @@ var Ta = class {
7624
7739
  this._interval && (window.clearTimeout(this._interval), this._interval = null), this.unsubscribe(), this._destroyDetectors();
7625
7740
  }
7626
7741
  _onRemoteTrackAdded(e, t, n) {
7627
- if (n.kind === k.audio && (this._detectors.get(e)?.destroy(), this._detectors.set(e, new ja(e, n)), !this._interval)) {
7742
+ if (n.kind === k.audio && (this._detectors.get(e)?.destroy(), this._detectors.set(e, new Ma(e, n)), !this._interval)) {
7628
7743
  let e = () => {
7629
7744
  this._collectVolumes(), this._interval = window.setTimeout(e, D.voiceParams.interval);
7630
7745
  };
@@ -7682,11 +7797,11 @@ var Ta = class {
7682
7797
  e.destroy();
7683
7798
  }), this._detectors.clear();
7684
7799
  }
7685
- }, Ia = /* @__PURE__ */ function(e) {
7800
+ }, La = /* @__PURE__ */ function(e) {
7686
7801
  return e.SPEAKER_CHANGED = "SPEAKER_CHANGED", e;
7687
- }({}), La = class extends g {
7802
+ }({}), Ra = class extends g {
7688
7803
  constructor(e, t, n) {
7689
- super(), h(this, "_speakerId", null), h(this, "_serverSideSpeakerDetection", !1), this._serverSideSpeakerDetection = n === J.SERVER, this.subscribe(e, Pa.VOLUMES_DETECTED, this._onVolumesDetected.bind(this)), this.subscribe(t, K.SIGNALLED_SPEAKER_CHANGED, this._onServerSpeakerChanged.bind(this)), this.subscribe(t, K.TOPOLOGY_CHANGED, this._onTopologyChanged.bind(this));
7804
+ super(), h(this, "_speakerId", null), h(this, "_serverSideSpeakerDetection", !1), this._serverSideSpeakerDetection = n === J.SERVER, this.subscribe(e, Fa.VOLUMES_DETECTED, this._onVolumesDetected.bind(this)), this.subscribe(t, K.SIGNALLED_SPEAKER_CHANGED, this._onServerSpeakerChanged.bind(this)), this.subscribe(t, K.TOPOLOGY_CHANGED, this._onTopologyChanged.bind(this));
7690
7805
  }
7691
7806
  destroy() {
7692
7807
  this.unsubscribe();
@@ -7708,9 +7823,9 @@ var Ta = class {
7708
7823
  _onTopologyChanged(e) {
7709
7824
  this._serverSideSpeakerDetection = e === J.SERVER;
7710
7825
  }
7711
- }, Ra = class extends g {
7826
+ }, za = class extends g {
7712
7827
  constructor(e, t, n) {
7713
- super(), h(this, "_transport", void 0), h(this, "_volumes", {}), h(this, "_participants", {}), h(this, "_connectionTimeout", 0), h(this, "_volumeTimeout", 0), this._transport = e, this._participants = n, this.subscribe(e, K.STATE_CHANGED, this._onTransportStateChanged.bind(this)), this.subscribe(t, Pa.VOLUMES_DETECTED, this._onVolumesDetected.bind(this));
7828
+ super(), h(this, "_transport", void 0), h(this, "_volumes", {}), h(this, "_participants", {}), h(this, "_connectionTimeout", 0), h(this, "_volumeTimeout", 0), this._transport = e, this._participants = n, this.subscribe(e, K.STATE_CHANGED, this._onTransportStateChanged.bind(this)), this.subscribe(t, Fa.VOLUMES_DETECTED, this._onVolumesDetected.bind(this));
7714
7829
  }
7715
7830
  destroy() {
7716
7831
  this.unsubscribe(), this._connectionTimeout && window.clearTimeout(this._connectionTimeout), this._volumeTimeout && window.clearTimeout(this._volumeTimeout);
@@ -7737,7 +7852,7 @@ var Ta = class {
7737
7852
  r && r.platform && (n = r.platform), e.indexOf(n) < 0 && (e.push(n), y.log(C.CALL_SPEC_ERROR, `${this._transport.getTopology()}_VOLUME_TIMEOUT_${n}`));
7738
7853
  }), e.length && z.warn("There is silent participant, send callSpecError"), this._volumeTimeout = 0;
7739
7854
  }
7740
- }, za = class e {
7855
+ }, Ba = class e {
7741
7856
  static correctHangupReason(e) {
7742
7857
  switch (e) {
7743
7858
  case _.HUNGUP: return "hangup";
@@ -7774,9 +7889,9 @@ var Ta = class {
7774
7889
  ...r && { string_value: r }
7775
7890
  });
7776
7891
  }
7777
- }, Ba = class {
7892
+ }, Va = class {
7778
7893
  constructor() {
7779
- h(this, "_isCallMarked", !1), h(this, "_isFinished", !1), h(this, "_callType", null), h(this, "_participantJoinedWhileDirect", !1);
7894
+ h(this, "_isCallMarked", !1), h(this, "_isFinished", !1), h(this, "_callType", null);
7780
7895
  }
7781
7896
  markAcceptCall(e) {
7782
7897
  this.mark(e === J.DIRECT ? "direct_incoming" : "server_incoming");
@@ -7785,19 +7900,10 @@ var Ta = class {
7785
7900
  e === J.DIRECT && this.mark("direct_outgoing");
7786
7901
  }
7787
7902
  markParticipantJoined(e) {
7788
- e === J.DIRECT && !this._isFinished && (this._participantJoinedWhileDirect = !0);
7903
+ e === J.DIRECT && this.mark("server_change_topology");
7789
7904
  }
7790
7905
  markOnJoin(e) {
7791
- this.mark(e === J.DIRECT ? "direct_join" : "server_join_server");
7792
- }
7793
- markTopologyChanged(e) {
7794
- if (!(this._isFinished || e !== J.SERVER)) {
7795
- if (this._callType === "direct_outgoing") {
7796
- this._callType = "server_change_topology";
7797
- return;
7798
- }
7799
- this._participantJoinedWhileDirect && this.mark("server_change_topology"), this._callType = "server_change_topology";
7800
- }
7906
+ e === J.SERVER && this.mark("server_join_server");
7801
7907
  }
7802
7908
  mark(e) {
7803
7909
  this._isCallMarked || (this._isCallMarked = !0, this._callType = e, U.setMark(V.FIRST_MEDIA_RECEIVED));
@@ -7808,9 +7914,9 @@ var Ta = class {
7808
7914
  call_type: this._callType
7809
7915
  }));
7810
7916
  }
7811
- }, Va = 1e3, Ha = 1e4, Ua = 15, Q = class e extends g {
7917
+ }, Ha = 1e3, Ua = 1e4, Wa = 15, Q = class e extends g {
7812
7918
  constructor(e, t) {
7813
- super(), h(this, "_api", void 0), h(this, "_signaling", void 0), h(this, "_signalingActor", void 0), h(this, "_mediaSource", null), h(this, "_conversation", null), h(this, "_myLastRequestedLayouts", {}), h(this, "_state", "IDLE"), h(this, "_participantState", X.CALLED), h(this, "_participants", {}), h(this, "_pendingParticipants", /* @__PURE__ */ new Map()), h(this, "_transport", null), h(this, "_debugInfo", null), h(this, "_volumesDetector", null), h(this, "_speakerDetector", null), h(this, "_localVolumeDetector", null), h(this, "_specListener", null), h(this, "_activeSpeakerId", null), h(this, "_lastSignalledActiveSpeakerId", null), h(this, "_isRealTimeAsrRequested", !1), h(this, "_serverSettings", Qn()), h(this, "_onUnload", void 0), h(this, "_audioOutput", void 0), h(this, "_lastStalled", {}), h(this, "_audioMixStalled", !1), h(this, "_audioFix", null), h(this, "_streamByStreamId", /* @__PURE__ */ new Map()), h(this, "_streamIdByStreamDescription", /* @__PURE__ */ new Map()), h(this, "_streamWaitTimerByStreamDescription", /* @__PURE__ */ new Map()), h(this, "_sequenceNumberByStreamDescription", /* @__PURE__ */ new Map()), h(this, "_cooldownTimestampByStreamDescription", /* @__PURE__ */ new Map()), h(this, "_cooldownQueueCleanupTimer", null), h(this, "_statFirstMediaReceived", void 0), h(this, "_changeMediaSettings", E.debounce(async (e) => {
7919
+ super(), h(this, "_api", void 0), h(this, "_signaling", void 0), h(this, "_signalingActor", void 0), h(this, "_displayLayoutRequester", void 0), h(this, "_mediaSource", null), h(this, "_conversation", null), h(this, "_myLastRequestedLayouts", {}), h(this, "_state", "IDLE"), h(this, "_participantState", X.CALLED), h(this, "_participants", {}), h(this, "_pendingParticipants", /* @__PURE__ */ new Map()), h(this, "_transport", null), h(this, "_debugInfo", null), h(this, "_volumesDetector", null), h(this, "_speakerDetector", null), h(this, "_localVolumeDetector", null), h(this, "_specListener", null), h(this, "_activeSpeakerId", null), h(this, "_lastSignalledActiveSpeakerId", null), h(this, "_isRealTimeAsrRequested", !1), h(this, "_serverSettings", Qn()), h(this, "_serverTimeOffset", 0), h(this, "_onUnload", void 0), h(this, "_audioOutput", void 0), h(this, "_lastStalled", {}), h(this, "_audioMixStalled", !1), h(this, "_audioFix", null), h(this, "_streamByStreamId", /* @__PURE__ */ new Map()), h(this, "_streamIdByStreamDescription", /* @__PURE__ */ new Map()), h(this, "_streamWaitTimerByStreamDescription", /* @__PURE__ */ new Map()), h(this, "_sequenceNumberByStreamDescription", /* @__PURE__ */ new Map()), h(this, "_cooldownTimestampByStreamDescription", /* @__PURE__ */ new Map()), h(this, "_cooldownQueueCleanupTimer", null), h(this, "_statFirstMediaReceived", void 0), h(this, "_changeMediaSettings", E.debounce(async (e) => {
7814
7920
  if (this._signaling.ready) try {
7815
7921
  await this._signaling.changeMediaSettings(e);
7816
7922
  } catch (e) {
@@ -7820,12 +7926,17 @@ var Ta = class {
7820
7926
  captureAudio: !1
7821
7927
  });
7822
7928
  }
7823
- }, 100)), y.create(e, t), y.setConversationIdProvider(() => this._conversation?.id || null), Rn.create(), $n.create(() => this._transport?.getTopology()), zi.create(), Bi.create(), this._api = e, this._signaling = new na(), this._signalingActor = new Na(this._onSignalingNotification.bind(this)), this._onUnload = () => {
7929
+ }, 100)), y.create(e, t), y.setConversationIdProvider(() => this._conversation?.id || null), Rn.create(), $n.create(() => this._transport?.getTopology()), zi.create(), Bi.create(), this._api = e, this._signaling = new na(), this._signalingActor = new Pa(this._onSignalingNotification.bind(this)), this._displayLayoutRequester = new Aa({
7930
+ api: this._api,
7931
+ getParticipants: () => this._getParticipants(),
7932
+ isMe: (e) => this._isMe(e),
7933
+ updateDisplayLayout: (e) => this.updateDisplayLayout(e)
7934
+ }), this._onUnload = () => {
7824
7935
  this._conversation && this._api && (this._api.hangupConversation(this._conversation.id, this._state === "IDLE" ? _.CANCELED : _.HUNGUP), D.clientEventsLoggingEnabled && y.logClientEvent({
7825
7936
  event_type: V.CALL_DECLINED_OR_HANGED_LOCALLY,
7826
7937
  reason: "none"
7827
7938
  }, !0)), y.destroy(), Rn.destroy(), $n.destroy(), zi.destroy(), Bi.destroy();
7828
- }, window.addEventListener("pagehide", this._onUnload), this._statFirstMediaReceived = new Ba(), this._audioOutput = new Ea(this._statFirstMediaReceived, D.transparentAudio), D.videoTracksCount > 0 && (this._cooldownQueueCleanupTimer = window.setInterval(this._cleanupCooldownQueue.bind(this), Va));
7939
+ }, window.addEventListener("pagehide", this._onUnload), this._statFirstMediaReceived = new Va(), this._audioOutput = new Ea(this._statFirstMediaReceived, D.transparentAudio), D.videoTracksCount > 0 && (this._cooldownQueueCleanupTimer = window.setInterval(this._cleanupCooldownQueue.bind(this), Ha));
7829
7940
  }
7830
7941
  static current() {
7831
7942
  return e._current;
@@ -7836,6 +7947,9 @@ var Ta = class {
7836
7947
  static id() {
7837
7948
  return e._current?._conversation?.id || null;
7838
7949
  }
7950
+ static getSyncedTime() {
7951
+ return Date.now() + (e._current?._serverTimeOffset ?? 0);
7952
+ }
7839
7953
  async onStart({ opponentIds: t, opponentType: n, mediaOptions: r, payload: i = "", joiningAllowed: a = !1, requireAuthToJoin: o = !1, onlyAdminCanShareMovie: s, externalIds: c, onFastStart: l, conversationId: u }) {
7840
7954
  if (e._activationMutex) throw y.log(C.ERROR, "startCall"), z.warn("Conversation: there is already running activation"), new v(_.FAILED);
7841
7955
  let d = Date.now();
@@ -8083,7 +8197,7 @@ var Ta = class {
8083
8197
  n.length ? this._transport.open(n, null, !!this._conversation?.observer) : this._transport.getTopology() === J.SERVER && this._forceOpenTransportForAloneInCall();
8084
8198
  }
8085
8199
  async _close(t, n) {
8086
- n && z.error(n, t), z.debug("Close conversation", t), za.sendHangupEvent(t, this._transport?.getTopology()), $n.destroy(), zi.logMetrics(this._transport?.getTopology()), zi.destroy(), Bi.logMetrics(this._transport?.getTopology()), Bi.destroy(), this._signaling.readyToSend(!1), t.error ? this._signaling.ready && this._signaling.hangup(_.FAILED) : y.log(C.ERROR, t.hangup), e._activationMutex = !1;
8200
+ n && z.error(n, t), z.debug("Close conversation", t), Ba.sendHangupEvent(t, this._transport?.getTopology()), $n.destroy(), zi.logMetrics(this._transport?.getTopology()), zi.destroy(), Bi.logMetrics(this._transport?.getTopology()), Bi.destroy(), this._signaling.readyToSend(!1), t.error ? this._signaling.ready && this._signaling.hangup(_.FAILED) : y.log(C.ERROR, t.hangup), e._activationMutex = !1;
8087
8201
  let r = this._conversation && this._conversation.id;
8088
8202
  if ([
8089
8203
  _.CANCELED,
@@ -8111,14 +8225,14 @@ var Ta = class {
8111
8225
  this._cleanupSignaling(), this._cleanupMediaSource();
8112
8226
  return;
8113
8227
  }
8114
- this._state = "CLOSE", this._participantState = X.HUNGUP, this._changeFeatureSet(), this._cleanupMediaSource(), await this._cleanupParticipants(), this._cleanupParticipantAgnosticStreams(), this._cleanupTransport(), this._cleanupSpeakerDetector(), this._cleanupSpecListener(), this._cleanupSignaling(), this._api.cleanup(), this._api.setAbortSignal(void 0), this._signaling.setAbortSignal(void 0), y.destroy(), Rn.destroy(), this._conversation = null, this._myLastRequestedLayouts = {}, e._current = null, e._delayedHangup = !1, e._abortController = null, P.onHangup(t || new v(_.UNKNOWN_ERROR), r);
8228
+ this._state = "CLOSE", this._participantState = X.HUNGUP, this._changeFeatureSet(), this._cleanupMediaSource(), await this._cleanupParticipants(), this._cleanupParticipantAgnosticStreams(), this._cleanupTransport(), this._cleanupSpeakerDetector(), this._cleanupSpecListener(), this._cleanupSignaling(), this._api.cleanup(), this._api.setAbortSignal(void 0), this._signaling.setAbortSignal(void 0), y.destroy(), Rn.destroy(), this._conversation = null, this._myLastRequestedLayouts = {}, this._displayLayoutRequester.clear(), e._current = null, e._delayedHangup = !1, e._abortController = null, P.onHangup(t || new v(_.UNKNOWN_ERROR), r);
8115
8229
  }
8116
8230
  async destroy() {
8117
8231
  let t = this._conversation && this._conversation.id;
8118
8232
  if (z.debug("Destroy conversation", { conversationId: t }), this._cooldownQueueCleanupTimer !== null && (window.clearInterval(this._cooldownQueueCleanupTimer), this._cooldownQueueCleanupTimer = null), this._state = "CLOSE", this._participantState = X.HUNGUP, this._cleanupMediaSource(), await this._cleanupParticipants(), this._cleanupParticipantAgnosticStreams(), this._cleanupTransport(), this._cleanupSpeakerDetector(), this._cleanupSpecListener(), this._cleanupSignaling(), this._api.cleanup(), this._api.setAbortSignal(void 0), this._signaling.setAbortSignal(void 0), e._delayedHangup && t) try {
8119
8233
  this._api.hangupConversation(t, _.CANCELED);
8120
8234
  } catch {}
8121
- this._cleanupListeners(), y.destroy(), Rn.destroy(), this._conversation = null, this._myLastRequestedLayouts = {}, e._current = null, e._delayedHangup = !1, e._abortController = null;
8235
+ this._cleanupListeners(), y.destroy(), Rn.destroy(), this._conversation = null, this._myLastRequestedLayouts = {}, this._displayLayoutRequester.clear(), e._current = null, e._delayedHangup = !1, e._abortController = null;
8122
8236
  }
8123
8237
  async _getConversationParams(e) {
8124
8238
  let t = await this._api.getConversationParams(e);
@@ -8318,7 +8432,7 @@ var Ta = class {
8318
8432
  }
8319
8433
  async _setConversation(e, t, n, r = T.USER) {
8320
8434
  let { participants: i } = t.conversation;
8321
- i.forEach((e) => {
8435
+ t.conversationParams?.serverTime && (this._serverTimeOffset = t.conversationParams.serverTime - Date.now()), i.forEach((e) => {
8322
8436
  let t = E.composeId(e), n = Z.fromSignalingParticipant(e, !1);
8323
8437
  if (n) {
8324
8438
  this._api.cacheExternalId(t, n);
@@ -8534,10 +8648,10 @@ var Ta = class {
8534
8648
  for (let n of Object.values(t)) (n.state === X.ACCEPTED || n.state === X.CALLED) && this._transport.allocate(n.id, e);
8535
8649
  }
8536
8650
  _createSpeakerDetector() {
8537
- this._transport && this._conversation && (this._volumesDetector = new Fa(this._transport), this.subscribe(this._volumesDetector, Pa.VOLUMES_DETECTED, this._onVolumesDetected.bind(this)), this._speakerDetector = new La(this._volumesDetector, this._transport, this._conversation.topology), this.subscribe(this._speakerDetector, Ia.SPEAKER_CHANGED, this._onSpeakerChanged.bind(this)), this._localVolumeDetector = new Ma(this._mediaSource));
8651
+ this._transport && this._conversation && (this._volumesDetector = new Ia(this._transport), this.subscribe(this._volumesDetector, Fa.VOLUMES_DETECTED, this._onVolumesDetected.bind(this)), this._speakerDetector = new Ra(this._volumesDetector, this._transport, this._conversation.topology), this.subscribe(this._speakerDetector, La.SPEAKER_CHANGED, this._onSpeakerChanged.bind(this)), this._localVolumeDetector = new Na(this._mediaSource));
8538
8652
  }
8539
8653
  async _createSpecListener() {
8540
- this._transport && this._volumesDetector && (this._specListener = new Ra(this._transport, this._volumesDetector, await this._getParticipants()));
8654
+ this._transport && this._volumesDetector && (this._specListener = new za(this._transport, this._volumesDetector, await this._getParticipants()));
8541
8655
  }
8542
8656
  _logDevices() {
8543
8657
  let e = L.getCameras().length, t = L.getMicrophones().length;
@@ -8551,7 +8665,7 @@ var Ta = class {
8551
8665
  e.id === this._lastSignalledActiveSpeakerId && (this._lastSignalledActiveSpeakerId = null);
8552
8666
  let n = await this._getParticipants();
8553
8667
  if (n[e.id]) {
8554
- t === _.HUNGUP ? this._setParticipantsStatus([e], A.HANGUP) : this._setParticipantsStatus([e], A.ERROR, t), e.mediaSource?.disconnect(), this._conversation && this._conversation.pinnedParticipantIdByRoom.get(null) === e.id && this._conversation.pinnedParticipantIdByRoom.delete(null), this._conversation && this._conversation.roomId && this._conversation.pinnedParticipantIdByRoom.get(this._conversation.roomId) === e.id && this._conversation.pinnedParticipantIdByRoom.delete(this._conversation.roomId);
8668
+ t === _.HUNGUP ? this._setParticipantsStatus([e], A.HANGUP) : this._setParticipantsStatus([e], A.ERROR, t), e.mediaSource?.disconnect(), this._displayLayoutRequester.cleanupParticipant(e.id), this._conversation && this._conversation.pinnedParticipantIdByRoom.get(null) === e.id && this._conversation.pinnedParticipantIdByRoom.delete(null), this._conversation && this._conversation.roomId && this._conversation.pinnedParticipantIdByRoom.get(this._conversation.roomId) === e.id && this._conversation.pinnedParticipantIdByRoom.delete(this._conversation.roomId);
8555
8669
  for (let [t, n] of Object.entries(e.lastRequestedLayouts)) this._streamIdByStreamDescription.delete(t), this._sequenceNumberByStreamDescription.delete(t), this._cooldownTimestampByStreamDescription.delete(t), this._streamWaitTimerByStreamDescription.has(t) && (window.clearTimeout(this._streamWaitTimerByStreamDescription.get(t)), this._streamWaitTimerByStreamDescription.delete(t)), this._sendUpdateDisplayLayout({ [t]: { stopStream: !0 } }, !1);
8556
8670
  this._api.unmapDecorativeId(e.id), delete n[e.id], P.onRemoteRemoved(e.externalId, e.markers);
8557
8671
  }
@@ -8613,7 +8727,7 @@ var Ta = class {
8613
8727
  async _onRemoveParticipant(e) {
8614
8728
  z.debug(`Remove participant [${e}]`);
8615
8729
  let t = [], n = await this._getParticipants();
8616
- for (let r = 0; r <= Ua; r++) {
8730
+ for (let r = 0; r <= Wa; r++) {
8617
8731
  let i = n[E.compose(e, r)];
8618
8732
  i && t.push(i);
8619
8733
  }
@@ -8705,31 +8819,44 @@ var Ta = class {
8705
8819
  async updateDisplayLayout(e) {
8706
8820
  if (e.length < 1 || !this._signaling.ready) return;
8707
8821
  z.log(`Update display layout request [${this._signaling.getNextCommandSequenceNumber()}]`, e);
8708
- let t = {}, n = await this._getParticipants();
8709
- for (let r of e) {
8710
- let e = typeof r.uid == "object" ? r.uid : Z.fromId(r.uid), i = this._api.getCachedOkIdByExternalId(e);
8711
- if (!i) {
8822
+ let t = {}, n = [], r = await this._getParticipants();
8823
+ for (let i of e) {
8824
+ let e = typeof i.uid == "object" ? i.uid : Z.fromId(i.uid), a = this._api.getCachedOkIdByExternalId(e);
8825
+ if (!a) {
8712
8826
  let t = Z.toString(e);
8713
8827
  z.log(`Unknown participant external ID ${t}`);
8714
8828
  continue;
8715
8829
  }
8716
- let a = Zt({
8717
- participantId: i,
8718
- mediaType: r.mediaType,
8719
- streamName: r.streamName
8720
- }), o = n[i];
8721
- o ? o.lastRequestedLayouts[a] = r : this._isMe(i) && (this._myLastRequestedLayouts[a] = r), Kt(r) ? (this._isMe(i) && delete this._myLastRequestedLayouts[a], this._streamIdByStreamDescription.has(a) && !this._cooldownTimestampByStreamDescription.has(a) && this._cooldownTimestampByStreamDescription.set(a, Date.now())) : (this._cooldownTimestampByStreamDescription.delete(a), !this._streamIdByStreamDescription.has(a) && D.videoTracksCount > 0 && this._streamIdByStreamDescription.set(a, null), t[a] = r), r.mediaType === B.SCREEN && !Kt(r) && U.setMark(U.getMarkNameScreenshareFirstFrame(i));
8722
- }
8723
- let r = this._cooldownTimestampByStreamDescription.keys();
8830
+ let o = Zt({
8831
+ participantId: a,
8832
+ mediaType: i.mediaType,
8833
+ streamName: i.streamName
8834
+ }), s = r[a];
8835
+ s ? n.push(() => {
8836
+ s.lastRequestedLayouts[o] = i;
8837
+ }) : this._isMe(a) && n.push(() => {
8838
+ this._myLastRequestedLayouts[o] = i;
8839
+ }), Kt(i) ? (this._isMe(a) && n.push(() => {
8840
+ delete this._myLastRequestedLayouts[o];
8841
+ }), this._streamIdByStreamDescription.has(o) && !this._cooldownTimestampByStreamDescription.has(o) && this._cooldownTimestampByStreamDescription.set(o, Date.now())) : (this._cooldownTimestampByStreamDescription.delete(o), !this._streamIdByStreamDescription.has(o) && D.videoTracksCount > 0 && this._streamIdByStreamDescription.set(o, null), t[o] = i), i.mediaType === B.SCREEN && !Kt(i) && U.setMark(U.getMarkNameScreenshareFirstFrame(a));
8842
+ }
8843
+ let i = this._cooldownTimestampByStreamDescription.keys();
8724
8844
  for (; this._streamIdByStreamDescription.size > D.videoTracksCount;) {
8725
- let e = r.next();
8845
+ let e = i.next();
8726
8846
  if (e.done) {
8727
8847
  z.error("Cannot accommodate all streaming requests: tracks available " + D.videoTracksCount + "; requested streams: " + Array.from(this._streamIdByStreamDescription.keys()));
8728
8848
  break;
8729
8849
  }
8730
8850
  await this._stopStreaming(e.value), t[e.value] = { stopStream: !0 };
8731
8851
  }
8732
- this._transport?.getTopology() === J.SERVER && await this._sendUpdateDisplayLayout(t);
8852
+ if (this._transport?.getTopology() !== J.SERVER) {
8853
+ n.forEach((e) => e());
8854
+ return;
8855
+ }
8856
+ await this._sendUpdateDisplayLayout(t), n.forEach((e) => e());
8857
+ }
8858
+ async requestDisplayLayout(e) {
8859
+ return this._displayLayoutRequester.request(e);
8733
8860
  }
8734
8861
  async feedback(e) {
8735
8862
  return this._signaling.feedback(e);
@@ -8799,7 +8926,7 @@ var Ta = class {
8799
8926
  });
8800
8927
  }
8801
8928
  }
8802
- if (r && r.length && (z.warn("Could not allocate one or more participants", r), t)) throw new Wa("Could not allocate one or more participants", r);
8929
+ if (r && r.length && (z.warn("Could not allocate one or more participants", r), t)) throw new Ga("Could not allocate one or more participants", r);
8803
8930
  }
8804
8931
  async _cleanupCooldownQueue() {
8805
8932
  let e = {}, t = this._cooldownTimestampByStreamDescription.entries();
@@ -8807,7 +8934,7 @@ var Ta = class {
8807
8934
  let n = t.next();
8808
8935
  if (n.done) break;
8809
8936
  let r = n.value;
8810
- if (r[1] + Ha > Date.now()) break;
8937
+ if (r[1] + Ua > Date.now()) break;
8811
8938
  let i = r[0];
8812
8939
  await this._stopStreaming(i), e[i] = { stopStream: !0 };
8813
8940
  } while (!0);
@@ -9425,7 +9552,7 @@ var Ta = class {
9425
9552
  }
9426
9553
  async _onSignalingReconnect(e) {
9427
9554
  if (!this._conversation) return;
9428
- e.conversation.acceptTime && (this._conversation.acceptTime = e.conversation.acceptTime), e.conversation.participantsLimit && (this._conversation.participantsLimit = e.conversation.participantsLimit), e.conversation.features && (this._conversation.features = e.conversation.features, this._conversation.featuresPerRole = e.conversation.featuresPerRole, this._changeFeatureSet(), this._changeFeaturesPerRole()), await this._processPinnedParticipants(e), e.conversation.state;
9555
+ e.conversationParams?.serverTime && (this._serverTimeOffset = e.conversationParams.serverTime - Date.now()), e.conversation.acceptTime && (this._conversation.acceptTime = e.conversation.acceptTime), e.conversation.participantsLimit && (this._conversation.participantsLimit = e.conversation.participantsLimit), e.conversation.features && (this._conversation.features = e.conversation.features, this._conversation.featuresPerRole = e.conversation.featuresPerRole, this._changeFeatureSet(), this._changeFeaturesPerRole()), await this._processPinnedParticipants(e), e.conversation.state;
9429
9556
  let t = null;
9430
9557
  if (e.conversation.participants) {
9431
9558
  let n = Object.keys(await this._getParticipants()), r = [];
@@ -9913,19 +10040,19 @@ var Ta = class {
9913
10040
  z.debug(`Transport state has changed: ${t}`, e);
9914
10041
  let n = this._getStatusByTransportState(t);
9915
10042
  if (!n) return;
9916
- let r = await this._getParticipants(), i = e.reduce((e, n) => {
10043
+ let r = await this._getParticipants(), i = [], a = e.reduce((e, n) => {
9917
10044
  if (n in r) {
9918
- let i = r[n];
9919
- e.push(i), t === q.CONNECTED && (i.remoteStream || (i.mediaSettings && this._changeRemoteMediaSettings(n, i.mediaSettings), this._changeRemoteParticipantState(n, i.participantState)), this._updateDisplayLayoutFromCache(n));
10045
+ let a = r[n];
10046
+ e.push(a), t === q.CONNECTED && (a.remoteStream || (a.mediaSettings && this._changeRemoteMediaSettings(n, a.mediaSettings), this._changeRemoteParticipantState(n, a.participantState)), i.push(...Object.values(a.lastRequestedLayouts)));
9920
10047
  } else this._warnParticipantNotInConversation(n);
9921
10048
  return e;
9922
10049
  }, []);
9923
- i.length && this._setParticipantsStatus(i, n);
10050
+ a.length && (this._updateDisplayLayoutFromCache(i), this._setParticipantsStatus(a, n));
9924
10051
  }
9925
10052
  async _onTransportLocalStateChanged(e) {
9926
10053
  if (z.debug(`Local transport state has changed: ${e}`), e === q.CONNECTED && (L.releaseFirefoxMicrophonePermissionWarmup(), P.onLocalStatus(A.CONNECTED), this._transport?.getTopology() === J.SERVER)) {
9927
10054
  let e = Object.values(this._myLastRequestedLayouts);
9928
- await this.updateDisplayLayout(e);
10055
+ await this.updateDisplayLayout(e), this._displayLayoutRequester.resend();
9929
10056
  }
9930
10057
  e === q.CONNECTING && P.onLocalStatus(A.CONNECTING), e === q.RECONNECTING && P.onLocalStatus(A.RECONNECT), e === q.FAILED && this._transport && this._transport.allocated().length === 0 && (this._signaling.ready && await this._signaling.hangup(_.FAILED), this._close(new v(_.FAILED), "Transport failed"));
9931
10058
  }
@@ -9967,7 +10094,7 @@ var Ta = class {
9967
10094
  }
9968
10095
  _removeVideoTrack(e, t, n) {}
9969
10096
  _onTopologyChanged(e) {
9970
- this._statFirstMediaReceived.markTopologyChanged(e), e === J.DIRECT && (this._onRemoteSignalledStall([]), this._onAudioMixStall(!1)), this._conversation && (this._conversation.topology = e, this._changeFeatureSet(), this._forceOpenTransportForAloneInCall()), this._audioOutput.destroy();
10097
+ e === J.DIRECT && (this._onRemoteSignalledStall([]), this._onAudioMixStall(!1)), this._conversation && (this._conversation.topology = e, this._changeFeatureSet(), this._forceOpenTransportForAloneInCall()), this._audioOutput.destroy();
9971
10098
  }
9972
10099
  _onAudioMixStall(e) {
9973
10100
  this._audioMixStalled !== e && (this._audioMixStalled = e, z.debug("Audio mix stalled:", e), P.onLocalStatus(e ? A.RECONNECT : A.CONNECTED));
@@ -10006,10 +10133,8 @@ var Ta = class {
10006
10133
  }), P.onJoinStatus(t, e));
10007
10134
  }
10008
10135
  async _updateDisplayLayoutFromCache(e) {
10009
- if (this._transport?.getTopology() !== J.SERVER) return;
10010
- let t = await this._getParticipant(e);
10011
- if (t && t.lastRequestedLayouts && Object.keys(t.lastRequestedLayouts).length) try {
10012
- await this.updateDisplayLayout(Object.values(t.lastRequestedLayouts));
10136
+ if (this._transport?.getTopology() === J.SERVER && e.length) try {
10137
+ await this.updateDisplayLayout(e);
10013
10138
  } catch (e) {
10014
10139
  z.warn(`_updateDisplayLayoutFromCache failed: ${e}`);
10015
10140
  }
@@ -10215,19 +10340,19 @@ var Ta = class {
10215
10340
  }
10216
10341
  };
10217
10342
  h(Q, "_current", void 0), h(Q, "_activationMutex", void 0), h(Q, "_delayedHangup", !1), h(Q, "_abortController", null);
10218
- var Wa = class e extends Error {
10343
+ var Ga = class e extends Error {
10219
10344
  constructor(t, n) {
10220
10345
  super(t), h(this, "participantErrors", void 0), Object.setPrototypeOf(this, e.prototype), this.participantErrors = n;
10221
10346
  }
10222
- }, Ga = null, Ka = null;
10223
- function qa() {
10224
- Ga = null, Ka = null;
10347
+ }, Ka = null, qa = null;
10348
+ function Ja() {
10349
+ Ka = null, qa = null;
10225
10350
  }
10226
- function Ja(e) {
10351
+ function Ya(e) {
10227
10352
  return e?.endsWith("/") ? e.slice(0, -1) : e;
10228
10353
  }
10229
- async function Ya(e = null, t) {
10230
- let n = Ja(e ?? D.apiBaseUrl);
10354
+ async function Xa(e = null, t) {
10355
+ let n = Ya(e ?? D.apiBaseUrl);
10231
10356
  if (n) return n;
10232
10357
  if ((t ?? D.apiEnv) !== "AUTO") return D.apiEndpoint(t);
10233
10358
  try {
@@ -10242,20 +10367,20 @@ async function Ya(e = null, t) {
10242
10367
  return z.warn("Failed to resolve API endpoint using DNS, default is used", e), D.apiEndpoint(t);
10243
10368
  }
10244
10369
  }
10245
- async function Xa() {
10246
- return Ga || Ka || (Ka = Ya(), Ga = await Ka, Ka = null, Ga);
10370
+ async function Za() {
10371
+ return Ka || qa || (qa = Xa(), Ka = await qa, qa = null, Ka);
10247
10372
  }
10248
- async function Za(e, t = {}, n = !1) {
10373
+ async function Qa(e, t = {}, n = !1) {
10249
10374
  if (!window.Blob || !window.navigator.sendBeacon) return;
10250
- await Xa();
10251
- let r = to(e, t, n), i = new window.Blob([r], { type: "application/x-www-form-urlencoded" });
10252
- window.navigator.sendBeacon(`${Ga}/fb.do`, i);
10375
+ await Za();
10376
+ let r = no(e, t, n), i = new window.Blob([r], { type: "application/x-www-form-urlencoded" });
10377
+ window.navigator.sendBeacon(`${Ka}/fb.do`, i);
10253
10378
  }
10254
- async function Qa(e, t = {}, n = !1, r) {
10255
- return await Xa(), $a(to(e, t, n), r);
10379
+ async function $a(e, t = {}, n = !1, r) {
10380
+ return await Za(), eo(no(e, t, n), r);
10256
10381
  }
10257
- async function $a(e, t) {
10258
- let n = `${t ?? Ga}/fb.do`, r = new AbortController(), i = setTimeout(() => r.abort(new v(_.NETWORK_ERROR)), D.apiTimeout), a = await fetch(n, {
10382
+ async function eo(e, t) {
10383
+ let n = `${t ?? Ka}/fb.do`, r = new AbortController(), i = setTimeout(() => r.abort(new v(_.NETWORK_ERROR)), D.apiTimeout), a = await fetch(n, {
10259
10384
  method: "POST",
10260
10385
  headers: { "Content-Type": "application/x-www-form-urlencoded" },
10261
10386
  body: e,
@@ -10271,7 +10396,7 @@ async function $a(e, t) {
10271
10396
  if (!a.ok || Object.hasOwn(s, "error_msg")) throw s;
10272
10397
  return s;
10273
10398
  }
10274
- async function eo(e, t) {
10399
+ async function to(e, t) {
10275
10400
  try {
10276
10401
  let n = await fetch(e, {
10277
10402
  method: "POST",
@@ -10284,7 +10409,7 @@ async function eo(e, t) {
10284
10409
  throw z.warn("Failed to send form data", e), e;
10285
10410
  }
10286
10411
  }
10287
- function to(e, t = {}, n = !1) {
10412
+ function no(e, t = {}, n = !1) {
10288
10413
  t.method = e, t.format = "JSON", t.application_key || (t.application_key = D.apiKey), n || (w.sessionKey ? t.session_key = w.sessionKey : w.accessToken && (t.access_token = w.accessToken));
10289
10414
  for (let [e, n] of Object.entries(t)) typeof n == "object" && (t[e] = JSON.stringify(n));
10290
10415
  let r = "";
@@ -10293,7 +10418,7 @@ function to(e, t = {}, n = !1) {
10293
10418
  }
10294
10419
  //#endregion
10295
10420
  //#region src/abstract/BaseApi.ts
10296
- var no = class {
10421
+ var ro = class {
10297
10422
  constructor() {
10298
10423
  h(this, "_abortSignal", void 0);
10299
10424
  }
@@ -10328,19 +10453,19 @@ var no = class {
10328
10453
  return Date.now();
10329
10454
  }
10330
10455
  cleanup() {}
10331
- }, ro = 700, io = 3e3, ao = class extends no {
10456
+ }, io = 700, ao = 3e3, oo = class extends ro {
10332
10457
  constructor(...e) {
10333
10458
  super(...e), h(this, "_userId", null), h(this, "_uuid", void 0), h(this, "_externalUidsCache", /* @__PURE__ */ new Map()), h(this, "_decorativeIdToInitialId", /* @__PURE__ */ new Map()), h(this, "_initialIdToDecorativeId", /* @__PURE__ */ new Map());
10334
10459
  }
10335
10460
  async _callUnsafe(e, t = {}, n = !1) {
10336
10461
  let r = async (i) => {
10337
10462
  try {
10338
- return await Qa(e, t, n);
10463
+ return await $a(e, t, n);
10339
10464
  } catch (t) {
10340
10465
  if (!Object.hasOwn(t, "error_msg")) {
10341
10466
  i++;
10342
10467
  let n = Object.getOwnPropertyNames(t).map((e) => `${e}: ${JSON.stringify(t[e])}`);
10343
- if (z.debug(`${e} network error, attempt ${i}: ${n.join("\n ")}`), this._abortSignal?.aborted && (z.debug(`${e} aborted`), this._abortSignal.throwIfAborted()), i < D.apiMaxAttempt) return await E.delay(Math.min(i * ro, io), { signal: this._abortSignal }), r(i);
10468
+ if (z.debug(`${e} network error, attempt ${i}: ${n.join("\n ")}`), this._abortSignal?.aborted && (z.debug(`${e} aborted`), this._abortSignal.throwIfAborted()), i < D.apiMaxAttempt) return await E.delay(Math.min(i * io, ao), { signal: this._abortSignal }), r(i);
10344
10469
  }
10345
10470
  throw z.warn(e, "error", t), t;
10346
10471
  }
@@ -10363,7 +10488,7 @@ var no = class {
10363
10488
  code: r.error_code
10364
10489
  };
10365
10490
  if (r instanceof v) throw r;
10366
- if (r.custom_error && (a.custom_error = r.custom_error), oo(r)) switch (r.error_code) {
10491
+ if (r.custom_error && (a.custom_error = r.custom_error), so(r)) switch (r.error_code) {
10367
10492
  case 1101:
10368
10493
  i = _.SERVICE_DISABLED;
10369
10494
  break;
@@ -10428,7 +10553,7 @@ var no = class {
10428
10553
  version: 1,
10429
10554
  items: e
10430
10555
  };
10431
- D.clientStatsPlatform && (t.platform = D.clientStatsPlatform), Za("vchat.clientStats", { data: JSON.stringify(t) });
10556
+ D.clientStatsPlatform && (t.platform = D.clientStatsPlatform), Qa("vchat.clientStats", { data: JSON.stringify(t) });
10432
10557
  }
10433
10558
  logClientEvents(e) {
10434
10559
  let t = {
@@ -10438,7 +10563,7 @@ var no = class {
10438
10563
  version: 1,
10439
10564
  items: e
10440
10565
  };
10441
- D.clientStatsPlatform && (t.platform = D.clientStatsPlatform), Za("vchat.clientEvents", { data: JSON.stringify(t) });
10566
+ D.clientStatsPlatform && (t.platform = D.clientStatsPlatform), Qa("vchat.clientEvents", { data: JSON.stringify(t) });
10442
10567
  }
10443
10568
  async uploadDebugLogs(e, t, n, r) {
10444
10569
  let i = {
@@ -10449,7 +10574,7 @@ var no = class {
10449
10574
  }, a = await this._callUnsafe("vchat.getLogUploadUrl", i), o = new FormData(), s = new Blob([r], { type: "application/json" });
10450
10575
  o.append("file", s, "log.json");
10451
10576
  let c = new URL(a.upload_url);
10452
- return c.searchParams.append("size", s.size.toString()), eo(c.toString(), o);
10577
+ return c.searchParams.append("size", s.size.toString()), to(c.toString(), o);
10453
10578
  }
10454
10579
  async joinConversation(e, t = !1, n) {
10455
10580
  let r = {
@@ -10616,7 +10741,7 @@ var no = class {
10616
10741
  conversationId: e,
10617
10742
  reason: t
10618
10743
  };
10619
- D.anonymToken && (n.anonymToken = D.anonymToken), Za("vchat.hangupConversation", n);
10744
+ D.anonymToken && (n.anonymToken = D.anonymToken), Qa("vchat.hangupConversation", n);
10620
10745
  }
10621
10746
  async removeHistoryRecords(e) {
10622
10747
  await this._call("vchat.removeHistoryRecords", { recordIds: e.join(",") });
@@ -10651,16 +10776,16 @@ var no = class {
10651
10776
  return (await this._call("system.getInfo")).serverTime;
10652
10777
  }
10653
10778
  };
10654
- function oo(e) {
10779
+ function so(e) {
10655
10780
  return typeof e == "object" && !!e && "error_code" in e && "error_msg" in e;
10656
10781
  }
10657
10782
  //#endregion
10658
10783
  //#region src/enums/RecordRole.ts
10659
- var so = /* @__PURE__ */ function(e) {
10784
+ var co = /* @__PURE__ */ function(e) {
10660
10785
  return e.KING = "KING", e.PAWN = "PAWN", e;
10661
- }(so || {}), co = /* @__PURE__ */ function(e) {
10786
+ }(co || {}), lo = /* @__PURE__ */ function(e) {
10662
10787
  return e.OFF = "0", e.ON = "1", e;
10663
- }({}), lo = class {
10788
+ }({}), uo = class {
10664
10789
  constructor(e) {
10665
10790
  h(this, "_queue", void 0), h(this, "_readCursor", void 0), h(this, "_writeCursor", void 0), h(this, "_moveReadCursor", void 0), h(this, "_left", void 0), this._queue = Array(e).fill(null), this._readCursor = this._writeCursor = this._left = 0, this._moveReadCursor = !1;
10666
10791
  }
@@ -10683,12 +10808,12 @@ var so = /* @__PURE__ */ function(e) {
10683
10808
  let e = this._queue[this._readCursor];
10684
10809
  return e && (this._moveReadCursor = !1, this._queue[this._readCursor] = null, this._readCursor = this.nextCursor(this._readCursor), --this._left), e;
10685
10810
  }
10686
- }, uo = class {
10811
+ }, fo = class {
10687
10812
  constructor(e, t, n, r = null) {
10688
10813
  h(this, "_uuid", void 0), h(this, "_apiKey", void 0), h(this, "_callToken", void 0), h(this, "_apiEnv", void 0), h(this, "_baseApiUrl", void 0), h(this, "_sessionKey", void 0), this._uuid = E.uuid(), this._apiKey = t, this._callToken = n, this._apiEnv = e, this._baseApiUrl = r;
10689
10814
  }
10690
10815
  async authorize() {
10691
- let e = await Qa("auth.anonymLogin", {
10816
+ let e = await $a("auth.anonymLogin", {
10692
10817
  session_data: {
10693
10818
  device_id: this._uuid,
10694
10819
  client_version: D.appVersion,
@@ -10697,18 +10822,18 @@ var so = /* @__PURE__ */ function(e) {
10697
10822
  version: 3
10698
10823
  },
10699
10824
  application_key: this._apiKey
10700
- }, !0, await Ya(this._baseApiUrl, this._apiEnv));
10825
+ }, !0, await Xa(this._baseApiUrl, this._apiEnv));
10701
10826
  return E.isObject(e) && !("error_msg" in e) ? (this._sessionKey = e.session_key, !0) : !1;
10702
10827
  }
10703
10828
  async hangupConversation(e) {
10704
- await Qa("vchat.hangupConversation", {
10829
+ await $a("vchat.hangupConversation", {
10705
10830
  conversationId: e,
10706
10831
  reason: _.HUNGUP,
10707
10832
  application_key: this._apiKey,
10708
10833
  session_key: this._sessionKey
10709
- }, !0, await Ya(this._baseApiUrl, this._apiEnv));
10834
+ }, !0, await Xa(this._baseApiUrl, this._apiEnv));
10710
10835
  }
10711
- }, $, fo = null, po = {
10836
+ }, $, po = null, mo = {
10712
10837
  getCameras: L.getCameras,
10713
10838
  getMicrophones: L.getMicrophones,
10714
10839
  getOutput: L.getOutput,
@@ -10734,33 +10859,33 @@ var so = /* @__PURE__ */ function(e) {
10734
10859
  baseChromeVersion: L.baseChromeVersion,
10735
10860
  getAudioContext: L.getAudioContext,
10736
10861
  isAudioShareSupported: L.isAudioShareSupported
10737
- }, mo = { participantMarkerCompare: E.participantMarkerCompare };
10738
- function ho(e) {
10739
- fo = e;
10740
- }
10862
+ }, ho = { participantMarkerCompare: E.participantMarkerCompare };
10741
10863
  function go(e) {
10742
- D.videoEffects = e;
10864
+ po = e;
10743
10865
  }
10744
10866
  function _o(e) {
10867
+ D.videoEffects = e;
10868
+ }
10869
+ function vo(e) {
10745
10870
  D.audioEffects = e;
10746
10871
  }
10747
- function vo(e, t = null, n = {}, r = 1) {
10872
+ function yo(e, t = null, n = {}, r = 1) {
10748
10873
  D.vmoji = e, D.vmojiOptions = {
10749
10874
  protocolVersion: r,
10750
10875
  renderingOptions: n
10751
10876
  }, t && e.setSDK(t);
10752
10877
  }
10753
- async function yo(t) {
10754
- if (D.set(t), $ || ($ = new ao()), e.disableLog(!D.debug), z.toggle(D.debug), z.log(`Calls SDK ${D.sdkVersion}`, t), await L.init(), !L.isBrowserSupported()) throw new v(x.UNSUPPORTED);
10878
+ async function bo(t) {
10879
+ if (D.set(t), $ || ($ = new oo()), e.disableLog(!D.debug), z.toggle(D.debug), z.log(`Calls SDK ${D.sdkVersion}`, t), await L.init(), !L.isBrowserSupported()) throw new v(x.UNSUPPORTED);
10755
10880
  z.log("UserAgent:", navigator.userAgent), z.log("Screen resolution:", `${window.screen.width}x${window.screen.height}`), z.log("Permissions:", `Camera: ${L.hasCameraPermission()}, Mic: ${L.hasMicrophonePermission()}`), z.log("Simulcast:", `${t.simulcast} => ${D.simulcast}`);
10756
10881
  }
10757
- async function bo(e, t = [S.AUDIO], n = "", r = !1, i = !1, a, o, s) {
10882
+ async function xo(e, t = [S.AUDIO], n = "", r = !1, i = !1, a, o, s) {
10758
10883
  let c = [];
10759
- return Array.isArray(e) ? c = e.length ? e : [] : e && (c = [e]), xo([], ra.USER, t, n, r, i, a, c, o, s);
10884
+ return Array.isArray(e) ? c = e.length ? e : [] : e && (c = [e]), So([], ra.USER, t, n, r, i, a, c, o, s);
10760
10885
  }
10761
- async function xo(e, t = ra.USER, n, r = "", i = !1, a = !1, o, s, c, l) {
10886
+ async function So(e, t = ra.USER, n, r = "", i = !1, a = !1, o, s, c, l) {
10762
10887
  if (Q.current()) throw z.error("There is already active call"), new v(_.FAILED);
10763
- return new Q($, fo).onStart({
10888
+ return new Q($, po).onStart({
10764
10889
  opponentIds: e,
10765
10890
  opponentType: t,
10766
10891
  mediaOptions: n,
@@ -10773,37 +10898,37 @@ async function xo(e, t = ra.USER, n, r = "", i = !1, a = !1, o, s, c, l) {
10773
10898
  conversationId: l
10774
10899
  });
10775
10900
  }
10776
- async function So(e, t) {
10777
- return Co(e, T.USER, void 0, t);
10901
+ async function Co(e, t) {
10902
+ return wo(e, T.USER, void 0, t);
10778
10903
  }
10779
- async function Co(e, t = T.USER, n, r, i, a) {
10904
+ async function wo(e, t = T.USER, n, r, i, a) {
10780
10905
  if (e === Q.id()) throw Error("Push has already been processed");
10781
- return a && $.setUserId(a), new Q($, fo).onPush(e, t, n, r, i);
10906
+ return a && $.setUserId(a), new Q($, po).onPush(e, t, n, r, i);
10782
10907
  }
10783
- async function wo(e, t) {
10784
- return e && (D.authToken = e), t !== void 0 && D.apiBaseUrl !== t && (D.apiBaseUrl = t, qa()), $.authorize();
10908
+ async function To(e, t) {
10909
+ return e && (D.authToken = e), t !== void 0 && D.apiBaseUrl !== t && (D.apiBaseUrl = t, Ja()), $.authorize();
10785
10910
  }
10786
- async function To(e = [S.AUDIO]) {
10787
- return qs().accept(e);
10911
+ async function Eo(e = [S.AUDIO]) {
10912
+ return Ys().accept(e);
10788
10913
  }
10789
- async function Eo() {
10914
+ async function Do() {
10790
10915
  let e = Q.current();
10791
10916
  if (e) return e.decline();
10792
10917
  }
10793
- async function Do(e, t = [S.AUDIO]) {
10794
- return Oo(e, t);
10918
+ async function Oo(e, t = [S.AUDIO]) {
10919
+ return ko(e, t);
10795
10920
  }
10796
- async function Oo(e, t, n) {
10921
+ async function ko(e, t, n) {
10797
10922
  if (Q.current()) throw z.error("There is already active call"), new v(_.FAILED);
10798
- return new Q($, fo).onJoin({
10923
+ return new Q($, po).onJoin({
10799
10924
  conversationId: e,
10800
10925
  mediaOptions: t,
10801
10926
  chatId: n
10802
10927
  });
10803
10928
  }
10804
- async function ko(e, t = [S.AUDIO], n, r, i, a) {
10929
+ async function Ao(e, t = [S.AUDIO], n, r, i, a) {
10805
10930
  if (Q.current()) throw z.error("There is already active call"), new v(_.FAILED);
10806
- return n && (D.anonymToken = n), new Q($, fo).onJoin({
10931
+ return n && (D.anonymToken = n), new Q($, po).onJoin({
10807
10932
  joinLink: e,
10808
10933
  mediaOptions: t,
10809
10934
  observedIds: r,
@@ -10811,26 +10936,26 @@ async function ko(e, t = [S.AUDIO], n, r, i, a) {
10811
10936
  onFastJoin: a
10812
10937
  });
10813
10938
  }
10814
- async function Ao() {
10939
+ async function jo() {
10815
10940
  let e = Q.current();
10816
10941
  if (e) return e.hangup();
10817
10942
  Q.hangupAfterInit();
10818
10943
  }
10819
- async function jo(e, t) {
10944
+ async function Mo(e, t) {
10820
10945
  let n = Array.isArray(e) ? e : [e], r = Q.current();
10821
10946
  r && await r.addParticipant(n, t);
10822
10947
  }
10823
- async function Mo(e, t) {
10948
+ async function No(e, t) {
10824
10949
  let n = Q.current();
10825
10950
  if (n) {
10826
10951
  let r = e.map((e) => E.composeUserId(e));
10827
10952
  await n.addParticipantLegacy(r, t);
10828
10953
  }
10829
10954
  }
10830
- async function No(e, t = !1) {
10831
- return Po((await $.getOkIdsByExternalIds([e]))[0], t);
10832
- }
10833
10955
  async function Po(e, t = !1) {
10956
+ return Fo((await $.getOkIdsByExternalIds([e]))[0], t);
10957
+ }
10958
+ async function Fo(e, t = !1) {
10834
10959
  let n = Q.current();
10835
10960
  if (n) try {
10836
10961
  await n.removeParticipant(E.composeUserId(e), t);
@@ -10838,13 +10963,13 @@ async function Po(e, t = !1) {
10838
10963
  z.warn(`Failed to remove participant ${e}. Perhaps he is no longer on the call. ${t}`);
10839
10964
  }
10840
10965
  }
10841
- async function Fo(e, t) {
10966
+ async function Io(e, t) {
10842
10967
  let n = Q.current();
10843
10968
  if (e === "videoinput" && ut.contains(t)) return D.videoFacingMode = t, n ? (L.isMobile() && n.stopVideoTrack(), n.changeDevice(e)) : void 0;
10844
10969
  if (!await L._saveDeviceId(e, t)) throw Error(`Device not found: ${t}`);
10845
10970
  if (n) return n.changeDevice(e);
10846
10971
  }
10847
- async function Io(e) {
10972
+ async function Lo(e) {
10848
10973
  let t = typeof e == "object" ? {
10849
10974
  ...e,
10850
10975
  fastScreenSharing: e.captureScreen && e.fastScreenSharing,
@@ -10856,31 +10981,31 @@ async function Io(e) {
10856
10981
  }, n = Q.current();
10857
10982
  return n ? n.toggleScreenCapturing(t) : Promise.reject();
10858
10983
  }
10859
- function Lo(e) {
10984
+ function Ro(e) {
10860
10985
  let t = Q.current();
10861
10986
  t && t.toggleAnimojiCapturing(e);
10862
10987
  }
10863
- async function Ro(e, t = !1) {
10988
+ async function zo(e, t = !1) {
10864
10989
  let n = Q.current();
10865
10990
  n && await n.setVideoStream(e, t);
10866
10991
  }
10867
- async function zo(e) {
10992
+ async function Bo(e) {
10868
10993
  let t = Q.current();
10869
10994
  t && await t.toggleLocalVideo(e);
10870
10995
  }
10871
- async function Bo(e) {
10996
+ async function Vo(e) {
10872
10997
  let t = Q.current();
10873
10998
  t && await t.toggleLocalAudio(e);
10874
10999
  }
10875
- async function Vo(e) {
11000
+ async function Ho(e) {
10876
11001
  let t = Q.current();
10877
11002
  if (t) return t.setLocalResolution(e);
10878
11003
  }
10879
- async function Ho(e) {
11004
+ async function Uo(e) {
10880
11005
  let t = Q.current();
10881
11006
  t && await t.changePriorities(e);
10882
11007
  }
10883
- async function Uo(e, t) {
11008
+ async function Wo(e, t) {
10884
11009
  let n = Q.current();
10885
11010
  if (n) {
10886
11011
  let r;
@@ -10891,28 +11016,32 @@ async function Uo(e, t) {
10891
11016
  await n.changeParticipantState(e, r);
10892
11017
  }
10893
11018
  }
10894
- async function Wo(e) {
11019
+ async function Go(e) {
10895
11020
  let t = Q.current();
10896
11021
  t && await t.hold(e);
10897
11022
  }
10898
- async function Go() {
11023
+ async function Ko() {
10899
11024
  let e = Q.current();
10900
11025
  e && await e.putHandsDown();
10901
11026
  }
10902
- async function Ko(e) {
11027
+ async function qo(e) {
10903
11028
  let t = Q.current();
10904
11029
  t && await t.updateDisplayLayout(e);
10905
11030
  }
10906
- async function qo(e, t, n = !1) {
10907
- return Jo((await $.getOkIdsByExternalIds([e]))[0], Z.getDeviceIdx(e), t, n);
11031
+ async function Jo(e) {
11032
+ let t = Q.current();
11033
+ t && await t.requestDisplayLayout(e);
11034
+ }
11035
+ async function Yo(e, t, n = !1) {
11036
+ return Xo((await $.getOkIdsByExternalIds([e]))[0], Z.getDeviceIdx(e), t, n);
10908
11037
  }
10909
- async function Jo(e, t, n, r = !1) {
11038
+ async function Xo(e, t, n, r = !1) {
10910
11039
  let i = Q.current();
10911
11040
  i && await i.grantRoles(E.composeParticipantId(e, T.USER, t), n, r);
10912
11041
  }
10913
- async function Yo({ externalId: e = null, muteStates: t, requestedMedia: n = [], roomId: r = null }) {
11042
+ async function Zo({ externalId: e = null, muteStates: t, requestedMedia: n = [], roomId: r = null }) {
10914
11043
  let i = null;
10915
- return e && (i = (await $.getOkIdsByExternalIds([e]))[0]), Xo({
11044
+ return e && (i = (await $.getOkIdsByExternalIds([e]))[0]), Qo({
10916
11045
  uid: i,
10917
11046
  muteStates: t,
10918
11047
  requestedMedia: n,
@@ -10920,70 +11049,70 @@ async function Yo({ externalId: e = null, muteStates: t, requestedMedia: n = [],
10920
11049
  roomId: r
10921
11050
  });
10922
11051
  }
10923
- async function Xo({ uid: e = null, muteStates: t, requestedMedia: n = [], deviceIdx: r = 0, roomId: i = null }) {
11052
+ async function Qo({ uid: e = null, muteStates: t, requestedMedia: n = [], deviceIdx: r = 0, roomId: i = null }) {
10924
11053
  let a = Q.current();
10925
11054
  if (a) {
10926
11055
  let o = e ? E.composeParticipantId(e, T.USER, r) : null;
10927
11056
  await a.muteParticipant(o, t, n, i);
10928
11057
  }
10929
11058
  }
10930
- async function Zo(e, t = !1, n = null) {
10931
- return Qo((await $.getOkIdsByExternalIds([e]))[0], t, Z.getDeviceIdx(e), n);
11059
+ async function $o(e, t = !1, n = null) {
11060
+ return es((await $.getOkIdsByExternalIds([e]))[0], t, Z.getDeviceIdx(e), n);
10932
11061
  }
10933
- async function Qo(e, t = !1, n = 0, r = null) {
11062
+ async function es(e, t = !1, n = 0, r = null) {
10934
11063
  let i = Q.current();
10935
11064
  i && await i.pinParticipant(E.composeParticipantId(e, T.USER, n), t, r);
10936
11065
  }
10937
- async function $o(e) {
11066
+ async function ts(e) {
10938
11067
  let t = Q.current();
10939
11068
  t && await t.updateMediaModifiers(e);
10940
11069
  }
10941
- async function es(e) {
11070
+ async function ns(e) {
10942
11071
  let t = Q.current();
10943
11072
  t && await t.enableVideoSuspend(e);
10944
11073
  }
10945
- async function ts(e) {
11074
+ async function rs(e) {
10946
11075
  let t = Q.current();
10947
11076
  t && await t.enableVideoSuspendSuggest(e);
10948
11077
  }
10949
- async function ns(e) {
11078
+ async function is(e) {
10950
11079
  let t = Q.current();
10951
11080
  t && await t.changeOptions(e);
10952
11081
  }
10953
- async function rs(e, t = null) {
11082
+ async function as(e, t = null) {
10954
11083
  let n = null;
10955
- return t && (n = (await $.getOkIdsByExternalIds([t]))[0]), is(e, n);
11084
+ return t && (n = (await $.getOkIdsByExternalIds([t]))[0]), os(e, n);
10956
11085
  }
10957
- async function is(e, t = null) {
11086
+ async function os(e, t = null) {
10958
11087
  let n = Q.current();
10959
11088
  if (n) {
10960
11089
  let r = t ? E.composeUserId(t) : null;
10961
11090
  await n.chatMessage(e, r);
10962
11091
  }
10963
11092
  }
10964
- async function as(e = 10) {
11093
+ async function ss(e = 10) {
10965
11094
  let t = Q.current();
10966
11095
  if (t) return t.chatHistory(e);
10967
11096
  }
10968
- async function os(e, t = null) {
11097
+ async function cs(e, t = null) {
10969
11098
  let n = null;
10970
- return t && (n = (await $.getOkIdsByExternalIds([t]))[0]), ss(e, n, Z.getDeviceIdx(t));
11099
+ return t && (n = (await $.getOkIdsByExternalIds([t]))[0]), ls(e, n, Z.getDeviceIdx(t));
10971
11100
  }
10972
- async function ss(e, t = null, n = 0) {
11101
+ async function ls(e, t = null, n = 0) {
10973
11102
  let r = Q.current();
10974
11103
  if (r) {
10975
11104
  let i = t ? E.composeParticipantId(t, T.USER, n) : null;
10976
11105
  await r.customData(e, i);
10977
11106
  }
10978
11107
  }
10979
- async function cs(e = "", t = !1, { onlyAdminCanShareMovie: n = !1, waitForAdmin: r = !1, closedConversation: i = !1 } = {}, a) {
11108
+ async function us(e = "", t = !1, { onlyAdminCanShareMovie: n = !1, waitForAdmin: r = !1, closedConversation: i = !1 } = {}, a) {
10980
11109
  return (await $.createConversation(a ?? E.uuid(), e, t, {
10981
11110
  onlyAdminCanShareMovie: n,
10982
11111
  waitForAdmin: r,
10983
11112
  closedConversation: i
10984
11113
  })).join_link;
10985
11114
  }
10986
- async function ls(e = "", t = !1, { onlyAdminCanShareMovie: n = !1, audioOnly: r = !1 } = {}, i) {
11115
+ async function ds(e = "", t = !1, { onlyAdminCanShareMovie: n = !1, audioOnly: r = !1 } = {}, i) {
10987
11116
  let a = Z.fromIds(i), o = await $.getOkIdsByExternalIds(a);
10988
11117
  return (await $.createConversation(E.uuid(), e, t, {
10989
11118
  onlyAdminCanShareMovie: n,
@@ -10991,37 +11120,37 @@ async function ls(e = "", t = !1, { onlyAdminCanShareMovie: n = !1, audioOnly: r
10991
11120
  audioOnly: r
10992
11121
  }, o)).join_link;
10993
11122
  }
10994
- async function us() {
11123
+ async function fs() {
10995
11124
  let e = Q.current();
10996
11125
  return e ? e.createJoinLink() : Promise.reject();
10997
11126
  }
10998
- async function ds() {
11127
+ async function ps() {
10999
11128
  let e = Q.current();
11000
11129
  return e ? e.removeJoinLink() : Promise.reject();
11001
11130
  }
11002
- async function fs(e, t) {
11131
+ async function ms(e, t) {
11003
11132
  return $.getAnonymTokenByLink(e, t);
11004
11133
  }
11005
- function ps(e) {
11134
+ function hs(e) {
11006
11135
  let t = Q.current();
11007
11136
  t && t.setVolume(e);
11008
11137
  }
11009
- function ms(e) {
11138
+ function gs(e) {
11010
11139
  D.forceRelayPolicy = e;
11011
11140
  }
11012
- async function hs(e = !1, t = null, n = null, r = "DIRECT_LINK", i = null, a = null) {
11141
+ async function _s(e = !1, t = null, n = null, r = "DIRECT_LINK", i = null, a = null) {
11013
11142
  let o = Q.current();
11014
11143
  return o ? o.startStream(e, t, n, r, i, a) : Promise.reject();
11015
11144
  }
11016
- async function gs(e = null, t) {
11145
+ async function vs(e = null, t) {
11017
11146
  let n = Q.current();
11018
11147
  return n ? n.stopStream(e, t) : Promise.reject();
11019
11148
  }
11020
- async function _s(e = null) {
11149
+ async function ys(e = null) {
11021
11150
  let t = Q.current();
11022
11151
  return t ? t.publishStream(e) : Promise.reject();
11023
11152
  }
11024
- async function vs(e, t, n = !1, r = null) {
11153
+ async function bs(e, t, n = !1, r = null) {
11025
11154
  let i = Q.current();
11026
11155
  if (!i) return Promise.reject();
11027
11156
  let a, o, s = [];
@@ -11031,23 +11160,23 @@ async function vs(e, t, n = !1, r = null) {
11031
11160
  }
11032
11161
  return i.recordSetConf(a, o, n, r);
11033
11162
  }
11034
- async function ys() {
11163
+ async function xs() {
11035
11164
  let e = Q.current();
11036
11165
  return e ? e.getStreamInfo() : Promise.reject();
11037
11166
  }
11038
- async function bs(e) {
11167
+ async function Ss(e) {
11039
11168
  let t = Q.current();
11040
11169
  return t ? t.addMovie(e) : Promise.reject();
11041
11170
  }
11042
- async function xs(e) {
11171
+ async function Cs(e) {
11043
11172
  let t = Q.current();
11044
11173
  return t ? t.updateMovie(e) : Promise.reject();
11045
11174
  }
11046
- async function Ss(e) {
11175
+ async function ws(e) {
11047
11176
  let t = Q.current();
11048
11177
  return t ? t.removeMovie(e) : Promise.reject();
11049
11178
  }
11050
- async function Cs(e, t) {
11179
+ async function Ts(e, t) {
11051
11180
  let n = Q.current();
11052
11181
  if (n) {
11053
11182
  let r = [];
@@ -11066,11 +11195,11 @@ async function Cs(e, t) {
11066
11195
  }
11067
11196
  return Promise.reject();
11068
11197
  }
11069
- async function ws(e, t) {
11198
+ async function Es(e, t) {
11070
11199
  let n = Q.current();
11071
11200
  return n ? n.activateRooms(e, t) : Promise.reject();
11072
11201
  }
11073
- async function Ts(e = null, t = null) {
11202
+ async function Ds(e = null, t = null) {
11074
11203
  let n = Q.current();
11075
11204
  if (!n) return Promise.reject();
11076
11205
  let r;
@@ -11080,22 +11209,22 @@ async function Ts(e = null, t = null) {
11080
11209
  }
11081
11210
  return n.switchRoom(e, r);
11082
11211
  }
11083
- async function Es(e) {
11212
+ async function Os(e) {
11084
11213
  let t = Q.current();
11085
11214
  return t ? t.removeRooms(e) : Promise.reject();
11086
11215
  }
11087
- function Ds(e) {
11216
+ function ks(e) {
11088
11217
  D.statisticsInterval = e;
11089
11218
  let t = Q.current();
11090
11219
  if (t) return t.updateStatisticsInterval();
11091
11220
  }
11092
- function Os(t) {
11221
+ function As(t) {
11093
11222
  e.disableLog(!t), z.toggle(t);
11094
11223
  }
11095
- function ks(e, ...t) {
11224
+ function js(e, ...t) {
11096
11225
  D.debugLog && z.send(e, "[external]", ...t);
11097
11226
  }
11098
- async function As() {
11227
+ async function Ms() {
11099
11228
  let e = Ct.conversationId;
11100
11229
  if (!e) throw z.error("[uploadDebugLogs]", "No conversation id found"), Error("No conversation id found");
11101
11230
  let t = Ct.collectLogs();
@@ -11107,19 +11236,19 @@ async function As() {
11107
11236
  throw z.error("[uploadDebugLogs]", "Error while uploading logs", e), Error("Error while uploading logs", { cause: e });
11108
11237
  }
11109
11238
  }
11110
- async function js(e) {
11239
+ async function Ns(e) {
11111
11240
  let t = Q.current();
11112
11241
  if (t) return t.videoEffect(e);
11113
11242
  }
11114
- async function Ms(e, t) {
11243
+ async function Ps(e, t) {
11115
11244
  let n = Q.current();
11116
11245
  if (n) return n.audioEffect(e.length > 0 ? e : null, t);
11117
11246
  }
11118
- async function Ns(e) {
11247
+ async function Fs(e) {
11119
11248
  let t = Q.current();
11120
11249
  t && await t.setAudioStream(e);
11121
11250
  }
11122
- async function Ps(e, t = null, n = null) {
11251
+ async function Is(e, t = null, n = null) {
11123
11252
  let r = Q.current();
11124
11253
  if (!r) return;
11125
11254
  let i = n ?? t?.id, a = null;
@@ -11130,80 +11259,83 @@ async function Ps(e, t = null, n = null) {
11130
11259
  }
11131
11260
  r.setAnimojiSvg(e, a, i);
11132
11261
  }
11133
- function Fs(e) {
11262
+ function Ls(e) {
11134
11263
  let t = Q.current();
11135
11264
  t && t.setAnimojiFill(e);
11136
11265
  }
11137
- async function Is(e = null, t, n = !1) {
11138
- return qs().getWaitingHall(e, t, n);
11266
+ async function Rs(e = null, t, n = !1) {
11267
+ return Ys().getWaitingHall(e, t, n);
11139
11268
  }
11140
- async function Ls() {
11141
- return qs().getAudienceModeHands();
11269
+ async function zs() {
11270
+ return Ys().getAudienceModeHands();
11142
11271
  }
11143
- async function Rs(e, t = !1) {
11144
- let n = qs(), r;
11272
+ async function Bs(e, t = !1) {
11273
+ let n = Ys(), r;
11145
11274
  if (e) {
11146
11275
  let [t] = await $.getOkIdsByExternalIds([e]);
11147
11276
  r = E.composeUserId(t);
11148
11277
  }
11149
11278
  return n.promoteParticipant(r, t);
11150
11279
  }
11151
- async function zs(e = !1) {
11152
- return qs().requestPromotion(e);
11280
+ async function Vs(e = !1) {
11281
+ return Ys().requestPromotion(e);
11153
11282
  }
11154
- async function Bs(e = !1) {
11155
- return qs().acceptPromotion(e);
11283
+ async function Hs(e = !1) {
11284
+ return Ys().acceptPromotion(e);
11156
11285
  }
11157
- async function Vs(e) {
11158
- return qs().getParticipantListChunk(e);
11286
+ async function Us(e) {
11287
+ return Ys().getParticipantListChunk(e);
11159
11288
  }
11160
- async function Hs(e) {
11161
- return qs().getParticipants(e);
11289
+ async function Ws(e) {
11290
+ return Ys().getParticipants(e);
11162
11291
  }
11163
- async function Us(e) {
11164
- return qs().feedback(e);
11292
+ async function Gs(e) {
11293
+ return Ys().feedback(e);
11165
11294
  }
11166
- function Ws(e, t, n) {
11167
- return qs().userFeedbackStats(e, t, n);
11295
+ function Ks(e, t, n) {
11296
+ return Ys().userFeedbackStats(e, t, n);
11168
11297
  }
11169
- function Gs(e, t = {}, n = !1) {
11298
+ function qs(e, t = {}, n = !1) {
11170
11299
  let r = Q.current();
11171
11300
  r && r.sendClientEvent(e, t, n);
11172
11301
  }
11173
- async function Ks(e, t) {
11174
- return qs().enableFeatureForRoles(e, t);
11302
+ async function Js(e, t) {
11303
+ return Ys().enableFeatureForRoles(e, t);
11175
11304
  }
11176
- function qs() {
11305
+ function Ys() {
11177
11306
  let e = Q.current();
11178
11307
  if (!e) throw Error("Conversation not found");
11179
11308
  return e;
11180
11309
  }
11181
- async function Js(e) {
11310
+ async function Xs(e) {
11182
11311
  await $.removeHistoryRecords(e);
11183
11312
  }
11184
- async function Ys(e) {
11313
+ async function Zs(e) {
11185
11314
  let t = Q.current();
11186
11315
  t && await t.startAsr(e);
11187
11316
  }
11188
- async function Xs(e) {
11317
+ async function Qs(e) {
11189
11318
  let t = Q.current();
11190
11319
  t && await t.stopAsr(e);
11191
11320
  }
11192
- async function Zs(e) {
11321
+ async function $s(e) {
11193
11322
  let t = Q.current();
11194
11323
  t && await t.requestAsr(e);
11195
11324
  }
11196
- async function Qs(e) {
11325
+ async function ec(e) {
11197
11326
  let t = Q.current();
11198
11327
  return t ? t.startUrlSharing(e) : Promise.reject();
11199
11328
  }
11200
- async function $s() {
11329
+ async function tc() {
11201
11330
  let e = Q.current();
11202
11331
  return e ? e.stopUrlSharing() : Promise.reject();
11203
11332
  }
11204
- function ec() {
11333
+ function nc() {
11334
+ return Q.getSyncedTime();
11335
+ }
11336
+ function rc() {
11205
11337
  return D.sdkVersion;
11206
11338
  }
11207
11339
  typeof window < "u" && (window.__CALLS_SDK = be);
11208
11340
  //#endregion
11209
- export { ao as Api, uo as ApiExternal, lo as ArrayDequeue, w as AuthData, f as BaseLogger, Y as CallDirection, ra as CallType, ia as ChatRoomEventType, aa as ConversationFeature, oa as ConversationOption, Wt as DebugMessageType, ha as ExternalIdType, ut as FacingMode, x as FatalError, v as HangupReason, _ as HangupType, S as MediaOption, k as MediaTrackKind, B as MediaType, la as MuteState, X as ParticipantState, co as ParticipantStateDataValue, A as ParticipantStatus, so as RecordRole, ua as RoomsEventType, na as Signaling, b as SignalingCommandType, Vi as SignalingConnectionType, G as SignalingNotification, J as TransportTopology, pa as UserRole, T as UserType, ja as VolumeDetector, To as acceptCall, Bs as acceptPromotion, ws as activateRooms, bs as addMovie, jo as addParticipant, Mo as addParticipantInternal, wo as authorize, po as browser, xo as callInternal, bo as callTo, Io as captureScreen, Lo as captureVmoji, Ms as changeAudioEffect, ns as changeConversationOptions, Fo as changeDevice, Uo as changeParticipantState, Ho as changePriorities, js as changeVideoEffect, as as chatHistory, rs as chatMessage, is as chatMessageInternal, us as createJoinLink, os as customData, ss as customDataInternal, Os as debug, ks as debugMessage, Eo as declineCall, Ks as enableFeatureForRoles, es as enableVideoSuspend, ts as enableVideoSuspendSuggest, Us as feedback, ms as forceRelayPolicy, fs as getAnonymTokenByLink, Ls as getAudienceModeHands, Vs as getParticipantListChunk, Hs as getParticipants, ys as getStreamInfo, Is as getWaitingHall, qo as grantRoles, Jo as grantRolesInternal, Ao as hangup, Wo as hold, yo as init, Do as joinCall, ko as joinCallByLink, Oo as joinCallInternal, Gs as logClientEvent, Yo as muteParticipant, Xo as muteParticipantInternal, Zo as pinParticipant, Qo as pinParticipantInternal, So as processPush, Co as processPushInternal, Rs as promoteParticipant, _s as publishStream, Go as putHandsDown, vs as recordSetConf, Js as removeHistoryRecords, ds as removeJoinLink, Ss as removeMovie, No as removeParticipant, Po as removeParticipantInternal, Es as removeRooms, Zs as requestAsr, zs as requestPromotion, _o as setAudioEffects, Ns as setAudioStream, Vo as setLocalResolution, ho as setLogger, $o as setMediaModifiers, Ds as setStatisticsInterval, go as setVideoEffects, Ro as setVideoStream, vo as setVmoji, Fs as setVmojiFill, Ps as setVmojiSvg, ps as setVolume, Ys as startAsr, ls as startAudienceConversation, cs as startConversation, hs as startStream, Qs as startUrlSharing, Xs as stopAsr, gs as stopStream, $s as stopUrlSharing, Ts as switchRoom, Bo as toggleLocalAudio, zo as toggleLocalVideo, Ko as updateDisplayLayout, xs as updateMovie, Cs as updateRooms, As as uploadDebugLogs, Ws as userFeedbackStats, mo as utils, ec as version };
11341
+ export { oo as Api, fo as ApiExternal, uo as ArrayDequeue, w as AuthData, f as BaseLogger, Y as CallDirection, ra as CallType, ia as ChatRoomEventType, aa as ConversationFeature, oa as ConversationOption, Wt as DebugMessageType, ha as ExternalIdType, ut as FacingMode, x as FatalError, v as HangupReason, _ as HangupType, S as MediaOption, k as MediaTrackKind, B as MediaType, la as MuteState, X as ParticipantState, lo as ParticipantStateDataValue, A as ParticipantStatus, co as RecordRole, ua as RoomsEventType, na as Signaling, b as SignalingCommandType, Vi as SignalingConnectionType, G as SignalingNotification, J as TransportTopology, pa as UserRole, T as UserType, Ma as VolumeDetector, Eo as acceptCall, Hs as acceptPromotion, Es as activateRooms, Ss as addMovie, Mo as addParticipant, No as addParticipantInternal, To as authorize, mo as browser, So as callInternal, xo as callTo, Lo as captureScreen, Ro as captureVmoji, Ps as changeAudioEffect, is as changeConversationOptions, Io as changeDevice, Wo as changeParticipantState, Uo as changePriorities, Ns as changeVideoEffect, ss as chatHistory, as as chatMessage, os as chatMessageInternal, fs as createJoinLink, cs as customData, ls as customDataInternal, As as debug, js as debugMessage, Do as declineCall, Js as enableFeatureForRoles, ns as enableVideoSuspend, rs as enableVideoSuspendSuggest, Gs as feedback, gs as forceRelayPolicy, ms as getAnonymTokenByLink, zs as getAudienceModeHands, Us as getParticipantListChunk, Ws as getParticipants, xs as getStreamInfo, nc as getSyncedTime, Rs as getWaitingHall, Yo as grantRoles, Xo as grantRolesInternal, jo as hangup, Go as hold, bo as init, Oo as joinCall, Ao as joinCallByLink, ko as joinCallInternal, qs as logClientEvent, Zo as muteParticipant, Qo as muteParticipantInternal, $o as pinParticipant, es as pinParticipantInternal, Co as processPush, wo as processPushInternal, Bs as promoteParticipant, ys as publishStream, Ko as putHandsDown, bs as recordSetConf, Xs as removeHistoryRecords, ps as removeJoinLink, ws as removeMovie, Po as removeParticipant, Fo as removeParticipantInternal, Os as removeRooms, $s as requestAsr, Jo as requestDisplayLayout, Vs as requestPromotion, vo as setAudioEffects, Fs as setAudioStream, Ho as setLocalResolution, go as setLogger, ts as setMediaModifiers, ks as setStatisticsInterval, _o as setVideoEffects, zo as setVideoStream, yo as setVmoji, Ls as setVmojiFill, Is as setVmojiSvg, hs as setVolume, Zs as startAsr, ds as startAudienceConversation, us as startConversation, _s as startStream, ec as startUrlSharing, Qs as stopAsr, vs as stopStream, tc as stopUrlSharing, Ds as switchRoom, Vo as toggleLocalAudio, Bo as toggleLocalVideo, qo as updateDisplayLayout, Cs as updateMovie, Ts as updateRooms, Ms as uploadDebugLogs, Ks as userFeedbackStats, ho as utils, rc as version };