@vkontakte/calls-sdk 2.8.11-dev.55f30024.0 → 2.8.11-dev.611d028c.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.55f30024.0
3
- * Fri, 10 Jul 2026 12:37:54 GMT
2
+ * @vkontakte/calls-sdk v2.8.11-dev.611d028c.0
3
+ * Fri, 10 Jul 2026 13:11:01 GMT
4
4
  * https://calls-sdk.cdn-vk.ru/doc/latest/index.html
5
5
  */
6
6
 
@@ -112,31 +112,31 @@ var g = class {
112
112
  }
113
113
  }, y = /* @__PURE__ */ function(e) {
114
114
  return e.RECOVER = "recover", e.ACCEPT_CALL = "accept-call", e.ADD_PARTICIPANT = "add-participant", e.REMOVE_PARTICIPANT = "remove-participant", e.HANGUP = "hangup", e.TRANSMIT_DATA = "transmit-data", e.ACCEPT_PRODUCER = "accept-producer", e.ALLOCATE_CONSUMER = "allocate-consumer", e.CHANGE_MEDIA_SETTINGS = "change-media-settings", e.CHANGE_PARTICIPANT_STATE = "change-participant-state", e.CHANGE_STREAM_PRIORITIES = "change-streams-priorities", e.UPDATE_DISPLAY_LAYOUT = "update-display-layout", e.REPORT_PERF_STAT = "report-perf-stat", e.REPORT_SHARING_STAT = "report-sharing-stat", e.REPORT_NETWORK_STAT = "report-network-stat", e.RECORD_START = "record-start", e.RECORD_STOP = "record-stop", e.RECORD_PUBLISH = "record-publish", e.RECORD_SET_CONF = "record-set-conf", e.RECORD_GET_STATUS = "record-get-status", e.SWITCH_MICRO = "switch-micro", e.SWITCH_TOPOLOGY = "switch-topology", e.REQUEST_REALLOC = "request-realloc", e.CHAT_MESSAGE = "chat-message", e.CHAT_HISTORY = "chat-history", e.CUSTOM_DATA = "custom-data", e.GRANT_ROLES = "grant-roles", e.MUTE_PARTICIPANT = "mute-participant", e.ENABLE_FEATURE_FOR_ROLES = "enable-feature-for-roles", e.PIN_PARTICIPANT = "pin-participant", e.UPDATE_MEDIA_MODIFIERS = "update-media-modifiers", e.CHANGE_OPTIONS = "change-options", e.GET_WAITING_HALL = "get-waiting-hall", e.GET_PARTICIPANT_LIST_CHUNK = "get-participant-list-chunk", e.GET_PARTICIPANTS = "get-participants", e.PROMOTE_PARTICIPANT = "promote-participant", e.REQUEST_TEST_MODE = "request-test-mode", e.ADD_MOVIE = "add-movie", e.UPDATE_MOVIE = "update-movie", e.REMOVE_MOVIE = "remove-movie", e.START_URL_SHARING = "start-url-sharing", e.STOP_URL_SHARING = "stop-url-sharing", e.GET_ROOMS = "get-rooms", e.UPDATE_ROOMS = "update-rooms", e.ACTIVATE_ROOMS = "activate-rooms", e.REMOVE_ROOMS = "remove-rooms", e.SWITCH_ROOM = "switch-room", e.FEEDBACK = "feedback", e.ASR_START = "asr-start", e.ASR_STOP = "asr-stop", e.REQUEST_ASR = "request-asr", e.REQUEST_PROMOTION = "request-promotion", e.ACCEPT_PROMOTION = "accept-promotion", e.GET_HAND_QUEUE = "get-hand-queue", e.ENABLE_VIDEO_SUSPEND = "enable-video-suspend", e.ENABLE_VIDEO_SUSPEND_SUGGEST = "enable-video-suspend-suggest", e.HOLD = "hold", e.PUT_HANDS_DOWN = "put-hands-down", e.CHANGE_SIMULCAST = "change-simulcast", e;
115
- }(y || {}), ne = 25 * 1024 * 1024, re = 10, ie = "_okcls_logs_session_", ae = 3e4, oe = "ok-calls-sdk-debug-logs", se = 1, b = "sessions", x = "chunks", ce = 120 * 1e3, le = new Set(["WARN", "ERROR"]);
116
- function ue() {
115
+ }(y || {}), ne = 25 * 1024 * 1024, re = 10, ie = "_okcls_logs_session_", ae = 3e4, oe = "ok-calls-sdk-debug-logs", se = 1, b = "sessions", ce = "chunks", le = 120 * 1e3, ue = new Set(["WARN", "ERROR"]);
116
+ function de() {
117
117
  return `${Date.now()}_${Math.random().toString(36).slice(2)}`;
118
118
  }
119
- function de() {
120
- let e = ue();
121
- return fe(e), e;
119
+ function fe() {
120
+ let e = de();
121
+ return pe(e), e;
122
122
  }
123
- function fe(e) {
123
+ function pe(e) {
124
124
  Ue.has(e) || Ue.set(e, []), We.has(e) || We.set(e, 0), Ge.has(e) || Ge.set(e, null);
125
125
  }
126
- function pe(e) {
126
+ function me(e) {
127
127
  return Ge.get(e) ?? null;
128
128
  }
129
- function me(e) {
129
+ function he(e) {
130
130
  let t = We.get(e) ?? 0;
131
131
  return We.set(e, t + 1), t;
132
132
  }
133
- function he(e, t) {
133
+ function ge(e, t) {
134
134
  return `${e}:${String(t).padStart(12, "0")}`;
135
135
  }
136
- function ge(e) {
136
+ function _e(e) {
137
137
  return new Blob([e]).size;
138
138
  }
139
- function _e() {
139
+ function ve() {
140
140
  try {
141
141
  let e = window.localStorage;
142
142
  for (let t of Object.keys(e)) t.indexOf(ie) === 0 && e.removeItem(t);
@@ -144,7 +144,7 @@ function _e() {
144
144
  console.error("Storage is blocked", e);
145
145
  }
146
146
  }
147
- var S = new class {
147
+ var x = new class {
148
148
  constructor() {
149
149
  h(this, "_db", null), h(this, "_dbPromise", null), h(this, "_supported", this.isSupported());
150
150
  }
@@ -197,7 +197,7 @@ var S = new class {
197
197
  async getChunksBySession(e) {
198
198
  let t = await this.open();
199
199
  if (!t) return [];
200
- let n = t.transaction(x, "readonly"), r = await this.requestToPromise(n.objectStore(x).index("sessionId").getAll(e));
200
+ let n = t.transaction(ce, "readonly"), r = await this.requestToPromise(n.objectStore(ce).index("sessionId").getAll(e));
201
201
  return await this.txDone(n), r.sort((e, t) => e.sequence - t.sequence);
202
202
  }
203
203
  async putSession(e) {
@@ -209,8 +209,8 @@ var S = new class {
209
209
  async putSessionAndChunk(e, t) {
210
210
  let n = await this.open();
211
211
  if (!n) return !1;
212
- let r = n.transaction([b, x], "readwrite");
213
- return r.objectStore(b).put(e), r.objectStore(x).put(t), await this.txDone(r), !0;
212
+ let r = n.transaction([b, ce], "readwrite");
213
+ return r.objectStore(b).put(e), r.objectStore(ce).put(t), await this.txDone(r), !0;
214
214
  }
215
215
  async updateSessionConversationId(e, t) {
216
216
  let [n] = await this.getSessionBySessionId(e);
@@ -223,14 +223,14 @@ var S = new class {
223
223
  async deleteSession(e) {
224
224
  let t = await this.open();
225
225
  if (!t) return 0;
226
- let n = await this.getChunksBySession(e), r = t.transaction([b, x], "readwrite"), i = r.objectStore(x), a = 0;
226
+ let n = await this.getChunksBySession(e), r = t.transaction([b, ce], "readwrite"), i = r.objectStore(ce), a = 0;
227
227
  for (let e of n) a += e.bytes, i.delete(e.id);
228
228
  return r.objectStore(b).delete(e), await this.txDone(r), a;
229
229
  }
230
230
  async deleteChunks(e) {
231
231
  let t = await this.open();
232
232
  if (!t || !e.length) return;
233
- let n = t.transaction(x, "readwrite"), r = n.objectStore(x);
233
+ let n = t.transaction(ce, "readwrite"), r = n.objectStore(ce);
234
234
  for (let t of e) r.delete(t.id);
235
235
  await this.txDone(n);
236
236
  }
@@ -264,7 +264,7 @@ var S = new class {
264
264
  let t = e.createObjectStore(b, { keyPath: "sessionId" });
265
265
  t.createIndex("conversationId", "conversationId", { unique: !1 }), t.createIndex("updatedAt", "updatedAt", { unique: !1 });
266
266
  }
267
- e.objectStoreNames.contains(x) || e.createObjectStore(x, { keyPath: "id" }).createIndex("sessionId", "sessionId", { unique: !1 });
267
+ e.objectStoreNames.contains(ce) || e.createObjectStore(ce, { keyPath: "id" }).createIndex("sessionId", "sessionId", { unique: !1 });
268
268
  }
269
269
  isSupported() {
270
270
  return typeof window < "u" && !!window.indexedDB;
@@ -335,15 +335,15 @@ var S = new class {
335
335
  return i;
336
336
  }
337
337
  }();
338
- async function ve(e) {
339
- return e.sessionId ? S.getSessionBySessionId(e.sessionId) : e.conversationId ? S.getSessionsByConversationId(e.conversationId) : [];
338
+ async function ye(e) {
339
+ return e.sessionId ? x.getSessionBySessionId(e.sessionId) : e.conversationId ? x.getSessionsByConversationId(e.conversationId) : [];
340
340
  }
341
- async function ye(e, t, n, r) {
341
+ async function be(e, t, n, r) {
342
342
  if (!r.length) return;
343
- let i = pe(e) || t, a = r, o = JSON.stringify(a), s = ge(o);
344
- for (; s > ne && a.length > 1;) a = a.slice(Math.floor(a.length / 2)), o = JSON.stringify(a), s = ge(o);
343
+ let i = me(e) || t, a = r, o = JSON.stringify(a), s = _e(o);
344
+ for (; s > ne && a.length > 1;) a = a.slice(Math.floor(a.length / 2)), o = JSON.stringify(a), s = _e(o);
345
345
  if (s > ne) return;
346
- let c = a[0].t, l = a[a.length - 1].t, [u] = await S.getSessionBySessionId(e), d = u || {
346
+ let c = a[0].t, l = a[a.length - 1].t, [u] = await x.getSessionBySessionId(e), d = u || {
347
347
  sessionId: e,
348
348
  conversationId: i,
349
349
  startTime: c,
@@ -360,7 +360,7 @@ async function ye(e, t, n, r) {
360
360
  bytes: d.bytes + s,
361
361
  entriesCount: d.entriesCount + a.length
362
362
  }, p = {
363
- id: he(e, n),
363
+ id: ge(e, n),
364
364
  sessionId: e,
365
365
  sequence: n,
366
366
  startTime: c,
@@ -368,9 +368,9 @@ async function ye(e, t, n, r) {
368
368
  bytes: s,
369
369
  items: a
370
370
  };
371
- await S.putSessionAndChunk(f, p) && await S.enforceRetentionPolicy();
371
+ await x.putSessionAndChunk(f, p) && await x.enforceRetentionPolicy();
372
372
  }
373
- function be(e) {
373
+ function xe(e) {
374
374
  let t = /* @__PURE__ */ new WeakSet();
375
375
  try {
376
376
  return JSON.parse(JSON.stringify(e, (e, n) => {
@@ -385,23 +385,23 @@ function be(e) {
385
385
  return e.map((e) => String(e));
386
386
  }
387
387
  }
388
- function xe(e) {
388
+ function Se(e) {
389
389
  let t = Ue.get(e);
390
390
  if (!t?.length) return Je;
391
- let n = t.splice(0), r = pe(e), i = me(e);
392
- return Je = Je.then(() => ye(e, r, i, n)).catch((e) => {
391
+ let n = t.splice(0), r = me(e), i = he(e);
392
+ return Je = Je.then(() => be(e, r, i, n)).catch((e) => {
393
393
  console.warn("Failed to write debug log to storage", e);
394
394
  }), Je;
395
395
  }
396
- function Se(e) {
397
- if (e) return xe(e);
398
- for (let e of Ue.keys()) xe(e);
396
+ function S(e) {
397
+ if (e) return Se(e);
398
+ for (let e of Ue.keys()) Se(e);
399
399
  return Je;
400
400
  }
401
401
  async function Ce(e) {
402
402
  let t = [];
403
403
  for (let n of e.sort((e, t) => e.startTime - t.startTime)) {
404
- let e = await S.getChunksBySession(n.sessionId);
404
+ let e = await x.getChunksBySession(n.sessionId);
405
405
  for (let n of e) t.push(...n.items);
406
406
  }
407
407
  return t;
@@ -413,10 +413,10 @@ async function we(e) {
413
413
  return [...await Te(r, i, new Set(e.map((e) => e.sessionId))), ...n].sort(Ee);
414
414
  }
415
415
  async function Te(e, t, n) {
416
- let r = (await S.getAllSessions()).filter((r) => !n.has(r.sessionId) && r.conversationId === null && r.endTime >= e - ce && r.startTime <= t), i = [];
416
+ let r = (await x.getAllSessions()).filter((r) => !n.has(r.sessionId) && r.conversationId === null && r.endTime >= e - le && r.startTime <= t), i = [];
417
417
  for (let n of r) {
418
- let r = await S.getChunksBySession(n.sessionId);
419
- for (let n of r) n.endTime < e - ce || n.startTime > t || i.push(...n.items.filter((n) => n.t >= e - ce && n.t <= e ? !0 : n.t >= e && n.t <= t && le.has(n.l)));
418
+ let r = await x.getChunksBySession(n.sessionId);
419
+ for (let n of r) n.endTime < e - le || n.startTime > t || i.push(...n.items.filter((n) => n.t >= e - le && n.t <= e ? !0 : n.t >= e && n.t <= t && ue.has(n.l)));
420
420
  }
421
421
  return i;
422
422
  }
@@ -428,40 +428,40 @@ function De(e, t) {
428
428
  n.href = i, n.download = t, n.click(), URL.revokeObjectURL(i);
429
429
  }
430
430
  function Oe() {
431
- Se();
431
+ S();
432
432
  }
433
433
  function ke() {
434
- document.visibilityState === "hidden" && Se();
434
+ document.visibilityState === "hidden" && S();
435
435
  }
436
436
  function Ae(e, t, n = Ke) {
437
- He || je(), fe(n);
437
+ He || je(), pe(n);
438
438
  let r = /* @__PURE__ */ new Date(), i = {
439
439
  t: r.getTime(),
440
440
  l: e,
441
- d: be(t),
441
+ d: xe(t),
442
442
  h: r.toLocaleString("ru-RU", {
443
443
  dateStyle: "short",
444
444
  timeStyle: "long"
445
445
  })
446
446
  };
447
447
  return Ue.get(n)?.push(i), qe || (qe = window.setTimeout(() => {
448
- qe = null, Se();
448
+ qe = null, S();
449
449
  }, ae)), i;
450
450
  }
451
451
  function je() {
452
- He || (He = !0, _e(), S.open(), window.addEventListener("pagehide", Oe), document.addEventListener("visibilitychange", ke));
452
+ He || (He = !0, ve(), x.open(), window.addEventListener("pagehide", Oe), document.addEventListener("visibilitychange", ke));
453
453
  }
454
454
  function Me() {
455
- return He || je(), Se(), de();
455
+ return He || je(), S(), fe();
456
456
  }
457
457
  function Ne(e, t = Ke) {
458
- t && (fe(t), Ge.set(t, e), e && S.updateSessionConversationId(t, e));
458
+ t && (pe(t), Ge.set(t, e), e && x.updateSessionConversationId(t, e));
459
459
  }
460
460
  async function Pe() {
461
- return await Se(), (await S.getAllSessions()).sort((e, t) => t.updatedAt - e.updatedAt);
461
+ return await S(), (await x.getAllSessions()).sort((e, t) => t.updatedAt - e.updatedAt);
462
462
  }
463
463
  async function Fe(e) {
464
- return await Se(), we(await ve(e));
464
+ return await S(), we(await ye(e));
465
465
  }
466
466
  async function Ie(e) {
467
467
  return JSON.stringify(await Fe(e));
@@ -471,15 +471,15 @@ async function Le(e) {
471
471
  return De(t, n), n;
472
472
  }
473
473
  async function Re(e) {
474
- await Se();
475
- let t = e ? await ve(e) : await S.getAllSessions();
476
- for (let e of t) await S.deleteSession(e.sessionId);
474
+ await S();
475
+ let t = e ? await ye(e) : await x.getAllSessions();
476
+ for (let e of t) await x.deleteSession(e.sessionId);
477
477
  }
478
478
  async function ze() {
479
- await Se();
480
- let e = await S.getStorageSummary(), t = await S.estimateStorage();
479
+ await S();
480
+ let e = await x.getStorageSummary(), t = await x.estimateStorage();
481
481
  return {
482
- supported: S.supported,
482
+ supported: x.supported,
483
483
  callsCount: e.callsCount,
484
484
  sessionsCount: e.sessions.length,
485
485
  usedBytes: e.usedBytes,
@@ -490,15 +490,15 @@ async function ze() {
490
490
  };
491
491
  }
492
492
  async function Be() {
493
- await Se();
494
- let e = await Ce(await S.getAllSessions());
493
+ await S();
494
+ let e = await Ce(await x.getAllSessions());
495
495
  return JSON.stringify(e.sort(Ee));
496
496
  }
497
497
  async function Ve() {
498
498
  let e = await Be(), t = `logs_${Date.now()}.json`;
499
499
  return De(e, t), t;
500
500
  }
501
- var He = !1, Ue = /* @__PURE__ */ new Map(), We = /* @__PURE__ */ new Map(), Ge = /* @__PURE__ */ new Map(), Ke = de(), qe = null, Je = Promise.resolve();
501
+ var He = !1, Ue = /* @__PURE__ */ new Map(), We = /* @__PURE__ */ new Map(), Ge = /* @__PURE__ */ new Map(), Ke = fe(), qe = null, Je = Promise.resolve();
502
502
  window.__VKCallsSDKLogs__ = (e = !1) => (He || je(), e ? Be() : Ve());
503
503
  //#endregion
504
504
  //#region src/static/AuthData.ts
@@ -1076,7 +1076,7 @@ var D;
1076
1076
  }
1077
1077
  e.getBlackMediaTrack = ie;
1078
1078
  function ae() {
1079
- if (me() === "Edge" && Number(he()) < 70) return !1;
1079
+ if (he() === "Edge" && Number(ge()) < 70) return !1;
1080
1080
  try {
1081
1081
  let e = window;
1082
1082
  return "mediaDevices" in e.navigator && "getUserMedia" in e.navigator.mediaDevices && e.RTCPeerConnection && e.RTCIceCandidate && e.RTCSessionDescription && e.HTMLCanvasElement && e.HTMLCanvasElement.prototype.captureStream && e.RTCRtpSender && e.RTCRtpSender.prototype.replaceTrack && e.RTCRtpSender.prototype.getParameters && "sendBeacon" in navigator && !0 || !1;
@@ -1098,7 +1098,7 @@ var D;
1098
1098
  return D.browserName() === "Yandex" && D.os() === "Windows" || N.simulcast;
1099
1099
  }
1100
1100
  e.isBrokenVP9Encoder = b;
1101
- function x() {
1101
+ function ce() {
1102
1102
  let e = D.browserName() === "Safari" && Number(D.browserVersion()) === 17 && [
1103
1103
  4,
1104
1104
  5,
@@ -1106,20 +1106,20 @@ var D;
1106
1106
  ].includes(Number(D.browserSubVersion())), t = D.os() === "Windows" && D.osVersion() === 10;
1107
1107
  return e || t;
1108
1108
  }
1109
- e.isBrokenVP9Decoder = x;
1110
- function ce() {
1109
+ e.isBrokenVP9Decoder = ce;
1110
+ function le() {
1111
1111
  return D.browserName() === "Firefox" && Number(D.browserVersion()) < 60;
1112
1112
  }
1113
- e.isOldDataChannelDescription = ce;
1114
- function le() {
1113
+ e.isOldDataChannelDescription = le;
1114
+ function ue() {
1115
1115
  return !(D.baseChromeVersion() && D.isMobile());
1116
1116
  }
1117
- e.canPreferH264 = le;
1118
- function ue() {
1117
+ e.canPreferH264 = ue;
1118
+ function de() {
1119
1119
  return !(D.browserName() === "Firefox" || D.browserName() === "Safari");
1120
1120
  }
1121
- e.isSimulcastSupportedByBrowser = ue;
1122
- function de() {
1121
+ e.isSimulcastSupportedByBrowser = de;
1122
+ function fe() {
1123
1123
  return Ct || (Ct = (() => {
1124
1124
  let e = {
1125
1125
  Windows: /Win/,
@@ -1141,53 +1141,53 @@ var D;
1141
1141
  return "Unknown";
1142
1142
  })()), Ct;
1143
1143
  }
1144
- e.os = de;
1145
- function fe() {
1144
+ e.os = fe;
1145
+ function pe() {
1146
1146
  return wt;
1147
1147
  }
1148
- e.osVersion = fe;
1149
- function pe() {
1148
+ e.osVersion = pe;
1149
+ function me() {
1150
1150
  return St === null && (St = /Mobile|mini|Fennec|Android|iP(ad|od|hone)/.test(Dt)), St;
1151
1151
  }
1152
- e.isMobile = pe;
1153
- function me() {
1152
+ e.isMobile = me;
1153
+ function he() {
1154
1154
  return Ut()[0];
1155
1155
  }
1156
- e.browserName = me;
1157
- function he() {
1156
+ e.browserName = he;
1157
+ function ge() {
1158
1158
  return Ut()[1];
1159
1159
  }
1160
- e.browserVersion = he;
1161
- function ge() {
1160
+ e.browserVersion = ge;
1161
+ function _e() {
1162
1162
  return Ut()[3];
1163
1163
  }
1164
- e.baseChromeVersion = ge;
1165
- function _e() {
1164
+ e.baseChromeVersion = _e;
1165
+ function ve() {
1166
1166
  return Et || (Et = new (window.AudioContext || window.webkitAudioContext)()), Et.resume().catch(() => {
1167
1167
  z.warn("Failed to resume AudioContext");
1168
1168
  }), Et;
1169
1169
  }
1170
- e.getAudioContext = _e;
1171
- function S() {
1170
+ e.getAudioContext = ve;
1171
+ function x() {
1172
1172
  return Ut()[4];
1173
1173
  }
1174
- e.browserSubVersion = S;
1175
- function ve() {
1174
+ e.browserSubVersion = x;
1175
+ function ye() {
1176
1176
  return D.baseChromeVersion() >= 105 && !D.isMobile();
1177
1177
  }
1178
- e.isAudioShareSupported = ve;
1179
- function ye(e, t) {
1178
+ e.isAudioShareSupported = ye;
1179
+ function be(e, t) {
1180
1180
  At[e] || (At[e] = []), At[e].push(t);
1181
1181
  }
1182
- e.addEventListener = ye;
1183
- function be(e, t) {
1182
+ e.addEventListener = be;
1183
+ function xe(e, t) {
1184
1184
  if (At[e]) if (!t) delete At[e];
1185
1185
  else {
1186
1186
  let n = At[e].indexOf(t);
1187
1187
  n > -1 && At[e].splice(n, 1);
1188
1188
  }
1189
1189
  }
1190
- e.removeEventListener = be;
1190
+ e.removeEventListener = xe;
1191
1191
  })(D || (D = {}));
1192
1192
  var O = D;
1193
1193
  //#endregion
@@ -1842,15 +1842,15 @@ var sn = 533, cn = "a=fmtp:", ln = "sps-pps-idr-in-keyframe=1", un;
1842
1842
  };
1843
1843
  }
1844
1844
  e.decomposeParticipantId = b;
1845
- function x() {
1845
+ function ce() {
1846
1846
  let e = window.crypto?.randomUUID?.();
1847
1847
  if (e) return e;
1848
1848
  let t = "0123456789abcdefghijklmnopqrstuvwxyz".split(""), n = Array(36), r = 0, i, a;
1849
1849
  for (a = 0; a < 36; a++) a === 8 || a === 13 || a === 18 || a === 23 ? n[a] = "-" : a === 14 ? n[a] = "4" : (r <= 2 && (r = 33554432 + Math.random() * 16777216 | 0), i = r & 15, r >>= 4, n[a] = t[a === 19 ? i & 3 | 8 : i]);
1850
1850
  return n.join("");
1851
1851
  }
1852
- e.uuid = x;
1853
- function ce(e, t) {
1852
+ e.uuid = ce;
1853
+ function le(e, t) {
1854
1854
  let n;
1855
1855
  function r(...r) {
1856
1856
  let i = this;
@@ -1860,8 +1860,8 @@ var sn = 533, cn = "a=fmtp:", ln = "sps-pps-idr-in-keyframe=1", un;
1860
1860
  }
1861
1861
  return r;
1862
1862
  }
1863
- e.debounce = ce;
1864
- function le(e) {
1863
+ e.debounce = le;
1864
+ function ue(e) {
1865
1865
  if (!window.BigInt) return null;
1866
1866
  let t = "", n = e.split("\n");
1867
1867
  for (let e of n) if (e.startsWith("a=fingerprint")) {
@@ -1879,8 +1879,8 @@ var sn = 533, cn = "a=fmtp:", ln = "sps-pps-idr-in-keyframe=1", un;
1879
1879
  }
1880
1880
  return BigInt.asIntN(64, i);
1881
1881
  }
1882
- e.sdpFingerprint = le;
1883
- async function ue(e, { signal: t } = {}) {
1882
+ e.sdpFingerprint = ue;
1883
+ async function de(e, { signal: t } = {}) {
1884
1884
  return new Promise((n, r) => {
1885
1885
  if (t?.aborted) return r(t.reason);
1886
1886
  let i = setTimeout(() => {
@@ -1891,13 +1891,13 @@ var sn = 533, cn = "a=fmtp:", ln = "sps-pps-idr-in-keyframe=1", un;
1891
1891
  t?.addEventListener("abort", a, { once: !0 });
1892
1892
  });
1893
1893
  }
1894
- e.delay = ue;
1895
- function de(e, t, n, r = z) {
1894
+ e.delay = de;
1895
+ function fe(e, t, n, r = z) {
1896
1896
  let i = [];
1897
- return e.getSenders().forEach((e) => fe(t, e, e.track, n, i, r)), i;
1897
+ return e.getSenders().forEach((e) => pe(t, e, e.track, n, i, r)), i;
1898
1898
  }
1899
- e.applySettings = de;
1900
- function fe(e, t, n, r, i, a = z) {
1899
+ e.applySettings = fe;
1900
+ function pe(e, t, n, r, i, a = z) {
1901
1901
  if (!RTCRtpSender.prototype.getParameters || !RTCRtpSender.prototype.setParameters || !e || !n || n.kind !== A.video) return;
1902
1902
  let o = n.getSettings();
1903
1903
  if (!o) return;
@@ -1936,21 +1936,21 @@ var sn = 533, cn = "a=fmtp:", ln = "sps-pps-idr-in-keyframe=1", un;
1936
1936
  a.log(`applyVideoTrackSettings: actual encodings= ${JSON.stringify(e.encodings)}`);
1937
1937
  }
1938
1938
  }
1939
- e.applyVideoTrackSettings = fe;
1940
- function pe(e, t) {
1939
+ e.applyVideoTrackSettings = pe;
1940
+ function me(e, t) {
1941
1941
  Array.isArray(t) || (t = [t]);
1942
1942
  for (let n of t) if (e.includes(n)) return !0;
1943
1943
  return !1;
1944
1944
  }
1945
- e.includesOneOf = pe;
1946
- function me(e) {
1945
+ e.includesOneOf = me;
1946
+ function he(e) {
1947
1947
  return Object.entries(e.participantState?.state || {}).reduce((t, [n, r]) => (e.participantState && (t[n] = {
1948
1948
  ts: e.participantState.stateUpdateTs[n],
1949
1949
  state: r
1950
1950
  }), t), {});
1951
1951
  }
1952
- e.mapParticipantState = me;
1953
- function he(e) {
1952
+ e.mapParticipantState = he;
1953
+ function ge(e) {
1954
1954
  let t = e.map((e) => ({
1955
1955
  uid: e.externalId,
1956
1956
  mediaSettings: e.mediaSettings,
@@ -1964,37 +1964,37 @@ var sn = 533, cn = "a=fmtp:", ln = "sps-pps-idr-in-keyframe=1", un;
1964
1964
  }));
1965
1965
  return N.filterObservers ? t.filter((e) => !e.uid.observer) : t;
1966
1966
  }
1967
- e.mapSharedParticipants = he;
1968
- function ge(e, t) {
1967
+ e.mapSharedParticipants = ge;
1968
+ function _e(e, t) {
1969
1969
  let n = Object.keys(e), r = Object.keys(t);
1970
1970
  if (n.length !== r.length) return !1;
1971
1971
  for (let i of n) if (!Object.hasOwn(r, i) || e[i].state !== t[i].state || e[i].ts !== t[i].ts) return !1;
1972
1972
  return !0;
1973
1973
  }
1974
- e.isEqualParticipantState = ge;
1975
- function _e(e, t, n = !1) {
1974
+ e.isEqualParticipantState = _e;
1975
+ function ve(e, t, n = !1) {
1976
1976
  let r = Object.keys(e), i = Object.keys(t);
1977
1977
  if (r.length !== i.length) return !1;
1978
1978
  for (let i of r) {
1979
1979
  if (!Object.hasOwn(t, i)) return !1;
1980
1980
  let r = e[i], a = t[i];
1981
- if (n && Se(r) && Se(a)) return _e(r, a, n);
1981
+ if (n && S(r) && S(a)) return ve(r, a, n);
1982
1982
  if (r !== a) return !1;
1983
1983
  }
1984
1984
  return !0;
1985
1985
  }
1986
- e.isObjectsEquals = _e;
1987
- function S(e, t) {
1986
+ e.isObjectsEquals = ve;
1987
+ function x(e, t) {
1988
1988
  if (e.length !== t.length) return !1;
1989
1989
  for (let n of e) if (t.indexOf(n) < 0) return !1;
1990
1990
  return !0;
1991
1991
  }
1992
- e.isArraysEquals = S;
1993
- function ve(e) {
1992
+ e.isArraysEquals = x;
1993
+ function ye(e) {
1994
1994
  return !Object.keys(e).length;
1995
1995
  }
1996
- e.isEmptyObject = ve;
1997
- function ye(e, t) {
1996
+ e.isEmptyObject = ye;
1997
+ function be(e, t) {
1998
1998
  if (!e && !t) return 0;
1999
1999
  if (!e || !t) return e ? -1 : 1;
2000
2000
  return r(t.rank, e.rank) || r(e.ts, t.ts) || n(e, t);
@@ -2009,17 +2009,17 @@ var sn = 533, cn = "a=fmtp:", ln = "sps-pps-idr-in-keyframe=1", un;
2009
2009
  return e < t ? -1 : e === t ? 0 : 1;
2010
2010
  }
2011
2011
  }
2012
- e.participantMarkerCompare = ye;
2013
- function be(e, t) {
2012
+ e.participantMarkerCompare = be;
2013
+ function xe(e, t) {
2014
2014
  return an(Object.entries(e).filter(([, e]) => Array.isArray(t) ? !t.includes(e) : e !== t));
2015
2015
  }
2016
- e.objectFilterOutValues = be;
2017
- function xe(e, t, n) {
2016
+ e.objectFilterOutValues = xe;
2017
+ function Se(e, t, n) {
2018
2018
  let r = n;
2019
2019
  for (let n in e) Object.hasOwn(e, n) && (r = t(r, e[n], n));
2020
2020
  return r;
2021
2021
  }
2022
- e.objectReduce = xe, e.setImmediate = (() => {
2022
+ e.objectReduce = Se, e.setImmediate = (() => {
2023
2023
  let e = 1, t = {}, n = null;
2024
2024
  return typeof MessageChannel < "u" && (n = new MessageChannel(), n.port1.onmessage = (e) => {
2025
2025
  let n = e.data;
@@ -2035,10 +2035,10 @@ var sn = 533, cn = "a=fmtp:", ln = "sps-pps-idr-in-keyframe=1", un;
2035
2035
  return () => clearTimeout(i);
2036
2036
  };
2037
2037
  })();
2038
- function Se(e) {
2038
+ function S(e) {
2039
2039
  return typeof e == "object" && !!e && !Array.isArray(e);
2040
2040
  }
2041
- e.isObject = Se;
2041
+ e.isObject = S;
2042
2042
  function Ce(e, n, r, i) {
2043
2043
  function a(e, t) {
2044
2044
  let n = 0, r = e.length, i = !1;
@@ -2171,7 +2171,7 @@ var hn = mn.getInstance(), N = class e {
2171
2171
  return 1.1;
2172
2172
  }
2173
2173
  static get sdkVersion() {
2174
- return "2.8.11-dev.55f30024.0";
2174
+ return "2.8.11-dev.611d028c.0";
2175
2175
  }
2176
2176
  static get debug() {
2177
2177
  return e._params.debug;
@@ -2824,75 +2824,75 @@ var _n;
2824
2824
  F("onRemoteParticipantsState", e, t);
2825
2825
  }
2826
2826
  e.onRemoteParticipantsState = b;
2827
- function x(e, t, n = null) {
2827
+ function ce(e, t, n = null) {
2828
2828
  z.debug("Remote status:", t, e), I("onRemoteStatus", e, t, n);
2829
2829
  }
2830
- e.onRemoteStatus = x;
2831
- function ce() {
2830
+ e.onRemoteStatus = ce;
2831
+ function le() {
2832
2832
  F("onPermissionsRequested");
2833
2833
  }
2834
- e.onPermissionsRequested = ce;
2835
- function le(e, t) {
2834
+ e.onPermissionsRequested = le;
2835
+ function ue(e, t) {
2836
2836
  F("onPermissionsError", e, t);
2837
2837
  }
2838
- e.onPermissionsError = le;
2839
- function ue(e, t) {
2838
+ e.onPermissionsError = ue;
2839
+ function de(e, t) {
2840
2840
  I("onRemoteRemoved", e, t);
2841
2841
  }
2842
- e.onRemoteRemoved = ue;
2843
- function de(e, t, n) {
2842
+ e.onRemoteRemoved = de;
2843
+ function fe(e, t, n) {
2844
2844
  F("onCallState", e, t, L(n));
2845
2845
  }
2846
- e.onCallState = de;
2847
- function fe(e, t) {
2846
+ e.onCallState = fe;
2847
+ function pe(e, t) {
2848
2848
  F("onDeviceSwitched", e, t);
2849
2849
  }
2850
- e.onDeviceSwitched = fe;
2851
- function pe(e, t, n, r = !1, i = !1, a = null, o = null, s, c, l = null) {
2850
+ e.onDeviceSwitched = pe;
2851
+ function me(e, t, n, r = !1, i = !1, a = null, o = null, s, c, l = null) {
2852
2852
  let u = c ? gn(c) : void 0;
2853
2853
  F("onMuteStates", L(e), gn(t), gn(n), r, i, a, o, s, u, l);
2854
2854
  }
2855
- e.onMuteStates = pe;
2856
- function me(e, t, n = !1) {
2855
+ e.onMuteStates = me;
2856
+ function he(e, t, n = !1) {
2857
2857
  I("onRolesChanged", e, gn(t), n);
2858
2858
  }
2859
- e.onRolesChanged = me;
2860
- function he(e, t = !1) {
2859
+ e.onRolesChanged = he;
2860
+ function ge(e, t = !1) {
2861
2861
  F("onLocalRolesChanged", gn(e), t);
2862
2862
  }
2863
- e.onLocalRolesChanged = he;
2864
- function ge(e, t, n, r) {
2863
+ e.onLocalRolesChanged = ge;
2864
+ function _e(e, t, n, r) {
2865
2865
  I("onPinnedParticipant", e, t, n, r);
2866
2866
  }
2867
- e.onPinnedParticipant = ge;
2868
- function _e(e, t) {
2867
+ e.onPinnedParticipant = _e;
2868
+ function ve(e, t) {
2869
2869
  F("onLocalPin", e, t);
2870
2870
  }
2871
- e.onLocalPin = _e;
2872
- function S(e) {
2871
+ e.onLocalPin = ve;
2872
+ function x(e) {
2873
2873
  F("onOptionsChanged", gn(e));
2874
2874
  }
2875
- e.onOptionsChanged = S;
2876
- function ve() {
2875
+ e.onOptionsChanged = x;
2876
+ function ye() {
2877
2877
  F("onCallAccepted");
2878
2878
  }
2879
- e.onCallAccepted = ve;
2880
- function ye(e, t) {
2879
+ e.onCallAccepted = ye;
2880
+ function be(e, t) {
2881
2881
  I("onAcceptedCall", e, t);
2882
2882
  }
2883
- e.onAcceptedCall = ye;
2884
- function be() {
2883
+ e.onAcceptedCall = be;
2884
+ function xe() {
2885
2885
  F("onRateNeeded");
2886
2886
  }
2887
- e.onRateNeeded = be;
2888
- function xe(e) {
2887
+ e.onRateNeeded = xe;
2888
+ function Se(e) {
2889
2889
  I("onSpeakerChanged", e);
2890
2890
  }
2891
- e.onSpeakerChanged = xe;
2892
- function Se(e) {
2891
+ e.onSpeakerChanged = Se;
2892
+ function S(e) {
2893
2893
  F("onVolumesDetected", gn(e));
2894
2894
  }
2895
- e.onVolumesDetected = Se;
2895
+ e.onVolumesDetected = S;
2896
2896
  function Ce(e, t) {
2897
2897
  F("onLocalVolume", e, t);
2898
2898
  }
@@ -3609,36 +3609,67 @@ var U = {
3609
3609
  clearMark: sr,
3610
3610
  measureMark: cr,
3611
3611
  getMarkNameScreenshareFirstFrame: lr
3612
- }, W = /* @__PURE__ */ function(e) {
3613
- return e.IDLE = "IDLE", e.OPENED = "OPENED", e.CONNECTING = "CONNECTING", e.RECONNECTING = "RECONNECTING", e.CONNECTED = "CONNECTED", e.CLOSED = "CLOSED", e.FAILED = "FAILED", e;
3614
- }(W || {}), G = /* @__PURE__ */ function(e) {
3612
+ }, dr = /* @__PURE__ */ function(e) {
3613
+ return e.START = "start", e.ACCEPT = "accept", e.JOIN = "join", e.RETRY = "retry", e;
3614
+ }(dr || {}), W = /* @__PURE__ */ function(e) {
3615
3615
  return e.NOTIFICATION = "NOTIFICATION", e.FAILED = "FAILED", e.RECONNECT = "RECONNECT", e;
3616
- }(G || {}), K = /* @__PURE__ */ function(e) {
3616
+ }(W || {}), G = /* @__PURE__ */ function(e) {
3617
3617
  return e.TRANSMITTED_DATA = "transmitted-data", e.ACCEPTED_CALL = "accepted-call", e.HUNGUP = "hungup", e.PARTICIPANT_ADDED = "participant-added", e.PARTICIPANT_JOINED = "participant-joined", e.CLOSED_CONVERSATION = "closed-conversation", e.MEDIA_SETTINGS_CHANGED = "media-settings-changed", e.PARTICIPANT_STATE_CHANGED = "participant-state-changed", e.PARTICIPANTS_STATE_CHANGED = "participants-state-changed", e.RATE_CALL_DATA = "rate-call-data", e.FEATURE_SET_CHANGED = "feature-set-changed", e.TOPOLOGY_CHANGED = "topology-changed", e.PRODUCER_UPDATED = "producer-updated", e.CONSUMER_ANSWERED = "consumer-answered", e.MULTIPARTY_CHAT_CREATED = "multiparty-chat-created", e.FORCE_MEDIA_SETTINGS_CHANGE = "force-media-settings-change", e.SETTINGS_UPDATE = "settings-update", e.VIDEO_QUALITY_UPDATE = "video-quality-update", e.REGISTERED_PEER = "registered-peer", e.SWITCH_MICRO = "switch-micro", e.RECORD_STARTED = "record-started", e.RECORD_STOPPED = "record-stopped", e.REALLOC_CON = "realloc-con", e.AUDIO_ACTIVITY = "audio-activity", e.SPEAKER_CHANGED = "speaker-changed", e.STALLED_ACTIVITY = "stalled-activity", e.CHAT_MESSAGE = "chat-message", e.CUSTOM_DATA = "custom-data", e.ROLES_CHANGED = "roles-changed", e.MUTE_PARTICIPANT = "mute-participant", e.PIN_PARTICIPANT = "pin-participant", e.OPTIONS_CHANGED = "options-changed", e.NETWORK_STATUS = "network-status", e.PARTICIPANT_SOURCES_UPDATE = "participant-sources-update", e.PROMOTE_PARTICIPANT = "promote-participant", e.CHAT_ROOM_UPDATED = "chat-room-updated", e.PROMOTION_APPROVED = "promotion-approved", e.JOIN_LINK_CHANGED = "join-link-changed", e.FEEDBACK = "feedback", e.MOVIE_UPDATE_NOTIFICATION = "movie-update-notification", e.MOVIE_SHARE_STARTED = "movie-share-started", e.MOVIE_SHARE_STOPPED = "movie-share-stopped", e.URL_SHARING_INFO_UPDATED = "url-sharing-info-updated", e.ROOM_UPDATED = "room-updated", e.ROOMS_UPDATED = "rooms-updated", e.ROOM_PARTICIPANTS_UPDATED = "room-participants-updated", e.FEATURES_PER_ROLE_CHANGED = "features-per-role-changed", e.PARTICIPANT_ANIMOJI_CHANGED = "participant-animoji-changed", e.ASR_STARTED = "asr-started", e.ASR_STOPPED = "asr-stopped", e.DECORATIVE_PARTICIPANT_ID_CHANGED = "decorative-participant-id-changed", e.VIDEO_SUSPEND_SUGGEST = "video-suspend-suggest", e;
3618
+ }(G || {}), fr = /* @__PURE__ */ function(e) {
3619
+ return e.WEBSOCKET = "ws", e.WEBTRANSPORT = "wt", e;
3620
+ }({}), pr = /* @__PURE__ */ function(e) {
3621
+ return e.CONNECTED = "connected", e.RECONNECTED = "reconnected", e.FAILED_PINGS = "failed_pings", e.FAILED_EXCEPTIONS = "failed_exception", e.TIMEOUT = "timeout", e.RESTART = "restart", e;
3622
+ }({}), mr = {
3623
+ connected: {
3624
+ wt: V.WEBTRANSPORT_CONNECTED,
3625
+ ws: V.WEBSOCKET_CONNECTED
3626
+ },
3627
+ reconnected: {
3628
+ wt: V.WEBTRANSPORT_RECONNECTED,
3629
+ ws: V.WEBSOCKET_RECONNECTED
3630
+ },
3631
+ failed_pings: {
3632
+ wt: V.WEBTRANSPORT_FAILED_PINGS,
3633
+ ws: V.WEBSOCKET_FAILED_PINGS
3634
+ },
3635
+ failed_exception: {
3636
+ wt: V.WEBTRANSPORT_FAILED_EXCEPTION,
3637
+ ws: V.WEBSOCKET_FAILED_EXCEPTION
3638
+ },
3639
+ timeout: {
3640
+ wt: V.WEBTRANSPORT_TIMEOUT,
3641
+ ws: V.WEBSOCKET_TIMEOUT
3642
+ },
3643
+ restart: {
3644
+ wt: V.WEBTRANSPORT_RESTART,
3645
+ ws: V.WEBSOCKET_RESTART
3646
+ }
3647
+ }, K = /* @__PURE__ */ function(e) {
3648
+ return e.IDLE = "IDLE", e.OPENED = "OPENED", e.CONNECTING = "CONNECTING", e.RECONNECTING = "RECONNECTING", e.CONNECTED = "CONNECTED", e.CLOSED = "CLOSED", e.FAILED = "FAILED", e;
3618
3649
  }(K || {}), q = /* @__PURE__ */ function(e) {
3619
3650
  return e.DIRECT = "DIRECT", e.SERVER = "SERVER", e;
3620
- }(q || {}), dr = /* @__PURE__ */ function(e) {
3651
+ }(q || {}), hr = /* @__PURE__ */ function(e) {
3621
3652
  return e.producerNotification = "producerNotification", e.producerCommand = "producerCommand", e.consumerScreenShare = "consumerScreenShare", e.producerScreenShare = "producerScreenShare", e.asr = "asr", e.animoji = "animoji", e;
3622
- }(dr || {}), { isObject: fr, isObjectsEquals: pr } = M;
3623
- function mr(e, t) {
3624
- return e === null || t === null ? e === null && t === null : e.maxDimension !== t.maxDimension || e.maxBitrateK !== t.maxBitrateK || e.maxFramerate !== t.maxFramerate || e.degradationPreference !== t.degradationPreference || e.scalabilityMode !== t.scalabilityMode || fr(e.bitrates) && fr(t.bitrates) && !pr(e.bitrates, t.bitrates, !0) ? !1 : e.bitrates === t.bitrates;
3653
+ }(hr || {}), { isObject: gr, isObjectsEquals: _r } = M;
3654
+ function vr(e, t) {
3655
+ return e === null || t === null ? e === null && t === null : e.maxDimension !== t.maxDimension || e.maxBitrateK !== t.maxBitrateK || e.maxFramerate !== t.maxFramerate || e.degradationPreference !== t.degradationPreference || e.scalabilityMode !== t.scalabilityMode || gr(e.bitrates) && gr(t.bitrates) && !_r(e.bitrates, t.bitrates, !0) ? !1 : e.bitrates === t.bitrates;
3625
3656
  }
3626
- var hr = /* @__PURE__ */ function(e) {
3657
+ var yr = /* @__PURE__ */ function(e) {
3627
3658
  return e.L1T1 = "L1T1", e.L1T2 = "L1T2", e.L1T3 = "L1T3", e;
3628
3659
  }({});
3629
3660
  //#endregion
3630
3661
  //#region src/types/ServerSettings.ts
3631
- function gr(e, t) {
3632
- return !(!mr(e.camera, t.camera) || !mr(e.screenSharing, t.screenSharing) || !mr(e.fastScreenSharing, t.fastScreenSharing));
3662
+ function br(e, t) {
3663
+ return !(!vr(e.camera, t.camera) || !vr(e.screenSharing, t.screenSharing) || !vr(e.fastScreenSharing, t.fastScreenSharing));
3633
3664
  }
3634
- function _r(e, t) {
3665
+ function xr(e, t) {
3635
3666
  return {
3636
3667
  camera: Object.assign({}, e.camera, t.camera),
3637
3668
  screenSharing: Object.assign({}, e.screenSharing, t.screenSharing),
3638
3669
  fastScreenSharing: Object.assign({}, e.fastScreenSharing, t.fastScreenSharing)
3639
3670
  };
3640
3671
  }
3641
- function vr() {
3672
+ function Sr() {
3642
3673
  return {
3643
3674
  camera: null,
3644
3675
  screenSharing: null,
@@ -3647,14 +3678,14 @@ function vr() {
3647
3678
  }
3648
3679
  //#endregion
3649
3680
  //#region src/classes/transport/BaseTransport.ts
3650
- var yr = class extends g {
3681
+ var Cr = class extends g {
3651
3682
  constructor(e, t) {
3652
- super(), h(this, "_signaling", void 0), h(this, "_mediaSource", void 0), h(this, "_state", W.IDLE), h(this, "_pc", null), this._signaling = e, this._mediaSource = t;
3683
+ super(), h(this, "_signaling", void 0), h(this, "_mediaSource", void 0), h(this, "_state", K.IDLE), h(this, "_pc", null), this._signaling = e, this._mediaSource = t;
3653
3684
  }
3654
3685
  getState() {
3655
- return this._state || W.IDLE;
3686
+ return this._state || K.IDLE;
3656
3687
  }
3657
- }, br = class {
3688
+ }, wr = class {
3658
3689
  constructor(e, t = null) {
3659
3690
  h(this, "weightUp", void 0), h(this, "weightDown", void 0), h(this, "value", NaN), this.weightUp = e, this.weightDown = t ?? e;
3660
3691
  }
@@ -3672,7 +3703,7 @@ var yr = class extends g {
3672
3703
  getValue() {
3673
3704
  return this.value;
3674
3705
  }
3675
- }, xr = .25, Sr = .35, Cr = 85, wr = .1, Tr = 1.5, Er = .1, Dr = 1, Or = .6, kr = .3, Ar = class extends g {
3706
+ }, Tr = .25, Er = .35, Dr = 85, Or = .1, kr = 1.5, Ar = .1, jr = 1, Mr = .6, Nr = .3, Pr = class extends g {
3676
3707
  constructor(e, t = z) {
3677
3708
  super(), h(this, "_signaling", void 0), h(this, "_localNetworkStat", void 0), h(this, "_remoteNetworkStat", void 0), h(this, "_lastNetworkStat", void 0), h(this, "_networkLimits", {
3678
3709
  badNet: {
@@ -3684,8 +3715,8 @@ var yr = class extends g {
3684
3715
  rtt: 600
3685
3716
  }
3686
3717
  }), h(this, "_lastStatSentTimestamp", 0), h(this, "_currentState", "good"), h(this, "_debug", void 0), this._debug = t, this._signaling = e, this._localNetworkStat = {
3687
- rtt: new br(xr, xr),
3688
- loss: new br(Sr, Sr),
3718
+ rtt: new wr(Tr, Tr),
3719
+ loss: new wr(Er, Er),
3689
3720
  bitrate: 0
3690
3721
  }, this._remoteNetworkStat = {
3691
3722
  rtt: 0,
@@ -3700,20 +3731,20 @@ var yr = class extends g {
3700
3731
  _calcRttRating(e) {
3701
3732
  let t = typeof e == "number" ? e : e.getValue(), n = 1;
3702
3733
  if (isNaN(t)) return n;
3703
- let r = Math.round((t - this._networkLimits.goodNet.rtt) / Cr);
3704
- for (let e = 0; e < r; e++) n *= 1 - wr;
3734
+ let r = Math.round((t - this._networkLimits.goodNet.rtt) / Dr);
3735
+ for (let e = 0; e < r; e++) n *= 1 - Or;
3705
3736
  return n;
3706
3737
  }
3707
3738
  _calcLossRating(e) {
3708
3739
  let t = typeof e == "number" ? e : e.getValue(), n = 1;
3709
3740
  if (isNaN(t)) return n;
3710
- let r = Math.round((t - this._networkLimits.goodNet.loss) / Tr);
3711
- for (let e = 0; e < r; e++) n *= 1 - Er;
3741
+ let r = Math.round((t - this._networkLimits.goodNet.loss) / kr);
3742
+ for (let e = 0; e < r; e++) n *= 1 - Ar;
3712
3743
  return n;
3713
3744
  }
3714
3745
  _calcBitrateRating(e, t) {
3715
3746
  if (!e || !t) return 1;
3716
- let n = 1 - (1 - Math.min(e, t) / Math.max(e, t)) * Dr;
3747
+ let n = 1 - (1 - Math.min(e, t) / Math.max(e, t)) * jr;
3717
3748
  return Math.min(n, 1);
3718
3749
  }
3719
3750
  _calcUDPRating({ rtt: e, loss: t }) {
@@ -3723,7 +3754,7 @@ var yr = class extends g {
3723
3754
  return n ? this._calcBitrateRating(e.bitrate, t.bitrate) : this._calcUDPRating(e) * this._calcUDPRating(t);
3724
3755
  }
3725
3756
  _getNetworkState(e) {
3726
- return isNaN(e) || e >= Or ? "good" : e >= kr ? "medium" : "bad";
3757
+ return isNaN(e) || e >= Mr ? "good" : e >= Nr ? "medium" : "bad";
3727
3758
  }
3728
3759
  updateSettings(e) {
3729
3760
  Object.assign(this._networkLimits.badNet, e?.badNet || {}), Object.assign(this._networkLimits.goodNet, e?.goodNet || {});
@@ -3747,7 +3778,7 @@ var yr = class extends g {
3747
3778
  let { rtt: t, loss: n, bitrate: r } = e || {};
3748
3779
  this._remoteNetworkStat.rtt = t || 0, this._remoteNetworkStat.loss = n || 0, this._remoteNetworkStat.bitrate = r || 0;
3749
3780
  }
3750
- }, jr = 30 * 1e3, Mr = class e extends yr {
3781
+ }, Fr = 30 * 1e3, Ir = class e extends Cr {
3751
3782
  constructor(e, t, n, r, i, a = z, o = null, s = null, c = null) {
3752
3783
  super(n, r), h(this, "_participantId", void 0), h(this, "_isMaster", void 0), h(this, "_remoteSDP", {}), h(this, "_remoteCandidates", {}), h(this, "_lastRemoteSDP", null), h(this, "_animojiDataChannel", null), h(this, "_animojiReceiver", null), h(this, "_animojiSender", null), h(this, "_remoteAnimojiVersion", 1), h(this, "_isOpen", !1), h(this, "_remotePeerId", null), h(this, "_statInterval", null), h(this, "_settingsInterval", null), h(this, "_failedOnCreate", null), h(this, "_remoteStream", null), h(this, "_iceRestartTimeout", null), h(this, "_reconnectionTimeout", null), h(this, "_reconnectionPrevented", !1), h(this, "_lastStat", void 0), h(this, "_fingerprint", null), h(this, "_neverConnected", !0), h(this, "_serverSettings", void 0), h(this, "_prevConsumerSettings", {}), h(this, "_networkLimitsForVideo", {
3753
3784
  bad: {
@@ -3762,7 +3793,7 @@ var yr = class extends g {
3762
3793
  worst: 320,
3763
3794
  bad: 640,
3764
3795
  good: 1280
3765
- }), h(this, "_lastVideoMaxDimension", this._videoMaxDimensionsForNet.good), h(this, "_lastBadConnection", 0), h(this, "_perfStatReporter", void 0), h(this, "_directStatReporter", void 0), h(this, "_debug", void 0), h(this, "_logger", void 0), h(this, "_statAggregator", void 0), h(this, "_codecStatsAggregator", void 0), this._participantId = e, this._isMaster = t, this._serverSettings = i, this._debug = a, this._logger = o, this._statAggregator = s, this._codecStatsAggregator = c, this._perfStatReporter = new $i(this, n, this._statAggregator, !0, this._debug), this._directStatReporter = new Ar(n, this._debug), this.subscribe(this._signaling, G.NOTIFICATION, this._onSignalingNotification.bind(this)), this.subscribe(this._mediaSource, qt.TRACK_REPLACED, this._onReplacedTrack.bind(this)), this.subscribe(this._mediaSource, qt.SOURCE_CHANGED, this._applySettings.bind(this)), this.subscribe(this._directStatReporter, J.NETWORK_STATUS, this._onNetworkStatus.bind(this));
3796
+ }), h(this, "_lastVideoMaxDimension", this._videoMaxDimensionsForNet.good), h(this, "_lastBadConnection", 0), h(this, "_perfStatReporter", void 0), h(this, "_directStatReporter", void 0), h(this, "_debug", void 0), h(this, "_logger", void 0), h(this, "_statAggregator", void 0), h(this, "_codecStatsAggregator", void 0), this._participantId = e, this._isMaster = t, this._serverSettings = i, this._debug = a, this._logger = o, this._statAggregator = s, this._codecStatsAggregator = c, this._perfStatReporter = new ra(this, n, this._statAggregator, !0, this._debug), this._directStatReporter = new Pr(n, this._debug), this.subscribe(this._signaling, W.NOTIFICATION, this._onSignalingNotification.bind(this)), this.subscribe(this._mediaSource, qt.TRACK_REPLACED, this._onReplacedTrack.bind(this)), this.subscribe(this._mediaSource, qt.SOURCE_CHANGED, this._applySettings.bind(this)), this.subscribe(this._directStatReporter, J.NETWORK_STATUS, this._onNetworkStatus.bind(this));
3766
3797
  try {
3767
3798
  this._pc = new RTCPeerConnection({
3768
3799
  iceServers: N.iceServers,
@@ -3772,7 +3803,7 @@ var yr = class extends g {
3772
3803
  this._debug.error("Failed to create RTCPeerConnection:", e), this.close(e);
3773
3804
  return;
3774
3805
  }
3775
- if (this._pc.onicecandidate = this._handleIceCandidate.bind(this), this._pc.ontrack = this._onAddTrack.bind(this), this._pc.oniceconnectionstatechange = this._onIceConnectionStateChange.bind(this), this._pc.onconnectionstatechange = this._onConnectionStateChange.bind(this), this._pc.onsignalingstatechange = this._onSignalingStateChange.bind(this), this._prevConsumerSettings = {}, N.vmoji && this._createDataChannel(this._pc, dr.animoji, (e) => {
3806
+ if (this._pc.onicecandidate = this._handleIceCandidate.bind(this), this._pc.ontrack = this._onAddTrack.bind(this), this._pc.oniceconnectionstatechange = this._onIceConnectionStateChange.bind(this), this._pc.onconnectionstatechange = this._onConnectionStateChange.bind(this), this._pc.onsignalingstatechange = this._onSignalingStateChange.bind(this), this._prevConsumerSettings = {}, N.vmoji && this._createDataChannel(this._pc, hr.animoji, (e) => {
3776
3807
  this._animojiDataChannel = e, this._animojiDataChannel.binaryType = "arraybuffer", this._animojiReceiver?.setDataChannel(this._animojiDataChannel), this._animojiSender?.setDataChannel(this._animojiDataChannel);
3777
3808
  }), this._isMaster) {
3778
3809
  try {
@@ -3782,7 +3813,7 @@ var yr = class extends g {
3782
3813
  return;
3783
3814
  }
3784
3815
  this._createOffer(!1).catch((e) => {
3785
- this._state === W.IDLE ? this._failedOnCreate = e : this.close(e);
3816
+ this._state === K.IDLE ? this._failedOnCreate = e : this.close(e);
3786
3817
  });
3787
3818
  }
3788
3819
  this._startSettingsInterval();
@@ -3795,9 +3826,9 @@ var yr = class extends g {
3795
3826
  }
3796
3827
  _isDeadConnection() {
3797
3828
  return [
3798
- W.IDLE,
3799
- W.CLOSED,
3800
- W.FAILED
3829
+ K.IDLE,
3830
+ K.CLOSED,
3831
+ K.FAILED
3801
3832
  ].includes(this.getState());
3802
3833
  }
3803
3834
  async open(e = null) {
@@ -3815,7 +3846,7 @@ var yr = class extends g {
3815
3846
  this._logger?.log(E.ERROR, "addTrack-direct"), this._debug.error("DirectTransport: Unable to add media source tracks", e, { participantId: this._participantId }), this.close(e);
3816
3847
  return;
3817
3848
  }
3818
- this._setState(W.OPENED);
3849
+ this._setState(K.OPENED);
3819
3850
  let t = e;
3820
3851
  if (!e) {
3821
3852
  let e = Object.keys(this._remoteSDP);
@@ -3830,7 +3861,7 @@ var yr = class extends g {
3830
3861
  this._remoteSDP = {}, this._remoteCandidates = {};
3831
3862
  }
3832
3863
  updateSettings(e) {
3833
- gr(e, this._serverSettings) || (this._serverSettings = e, this._applySettings());
3864
+ br(e, this._serverSettings) || (this._serverSettings = e, this._applySettings());
3834
3865
  }
3835
3866
  preventRestart() {
3836
3867
  this._reconnectionPrevented = !0;
@@ -3847,20 +3878,20 @@ var yr = class extends g {
3847
3878
  close(e) {
3848
3879
  this._isOpen && (this._isOpen = !1, this._stopReconnection(), this._remoteStream && (this._remoteStream.getTracks().forEach((e) => {
3849
3880
  e.stop(), this._triggerEvent(J.REMOTE_TRACK_REMOVED, this._remoteStream, e);
3850
- }), this._remoteStream = null), this._stopStatInterval(), this._stopSettingsInterval(), this._pc && (this._animojiDataChannel && (this._animojiDataChannel.onopen = null, this._animojiDataChannel.onmessage = null, this._animojiDataChannel.onerror = null, this._animojiDataChannel.close()), this._pc.onicecandidate = null, this._pc.ontrack = null, this._pc.oniceconnectionstatechange = null, this._pc.onconnectionstatechange = null, this._pc.onsignalingstatechange = null, this._pc.close(), this._pc = null), this._onNetworkStatus(1), this.unsubscribe(), e ? (this._debug.error("DirectTransport: Closed", e, { participantId: this._participantId }), this._setState(W.FAILED)) : (this._debug.debug("DirectTransport: Closed", { participantId: this._participantId }), this._setState(W.CLOSED)), this._triggerEvent(J.PEER_CONNECTION_CLOSED));
3881
+ }), this._remoteStream = null), this._stopStatInterval(), this._stopSettingsInterval(), this._pc && (this._animojiDataChannel && (this._animojiDataChannel.onopen = null, this._animojiDataChannel.onmessage = null, this._animojiDataChannel.onerror = null, this._animojiDataChannel.close()), this._pc.onicecandidate = null, this._pc.ontrack = null, this._pc.oniceconnectionstatechange = null, this._pc.onconnectionstatechange = null, this._pc.onsignalingstatechange = null, this._pc.close(), this._pc = null), this._onNetworkStatus(1), this.unsubscribe(), e ? (this._debug.error("DirectTransport: Closed", e, { participantId: this._participantId }), this._setState(K.FAILED)) : (this._debug.debug("DirectTransport: Closed", { participantId: this._participantId }), this._setState(K.CLOSED)), this._triggerEvent(J.PEER_CONNECTION_CLOSED));
3851
3882
  }
3852
3883
  _setState(e) {
3853
3884
  this._state !== e && (this._debug.debug(`DirectTransport: State changed to ${e}`, { participantId: this._participantId }), this._state = e, this._triggerEvent(J.STATE_CHANGED, e));
3854
3885
  }
3855
3886
  _onSignalingNotification(e) {
3856
3887
  switch (e.notification) {
3857
- case K.TRANSMITTED_DATA:
3888
+ case G.TRANSMITTED_DATA:
3858
3889
  this._handleTransmittedData(e);
3859
3890
  break;
3860
- case K.SETTINGS_UPDATE:
3891
+ case G.SETTINGS_UPDATE:
3861
3892
  this._directStatReporter.updateSettings(e.settings);
3862
3893
  break;
3863
- case K.CUSTOM_DATA:
3894
+ case G.CUSTOM_DATA:
3864
3895
  Object.hasOwn(e.data, "sdk") && this._directStatReporter.reportRemote(e.data?.sdk);
3865
3896
  break;
3866
3897
  }
@@ -3951,7 +3982,7 @@ var yr = class extends g {
3951
3982
  switch (this._debug.debug(`DirectTransport: Ice Connection state changed to ${this._pc?.iceConnectionState}`, { participantId: this._participantId }), this._pc?.iceConnectionState) {
3952
3983
  case "checking":
3953
3984
  let e = this.getState();
3954
- e === W.IDLE || e === W.OPENED ? this._setState(W.CONNECTING) : this._setState(W.RECONNECTING);
3985
+ e === K.IDLE || e === K.OPENED ? this._setState(K.CONNECTING) : this._setState(K.RECONNECTING);
3955
3986
  break;
3956
3987
  case "connected":
3957
3988
  case "completed":
@@ -3960,7 +3991,7 @@ var yr = class extends g {
3960
3991
  }
3961
3992
  }
3962
3993
  _markConnected() {
3963
- this._neverConnected = !1, this._setState(W.CONNECTED), this._stopReconnection(), this._pc && M.getPeerConnectionHostInfo(this._pc).then((e) => {
3994
+ this._neverConnected = !1, this._setState(K.CONNECTED), this._stopReconnection(), this._pc && M.getPeerConnectionHostInfo(this._pc).then((e) => {
3964
3995
  e?.local && (this._logger?.log(E.ICE_CONNECTION_TYPE, e.local.type), this._debug.debug("Selected ICE candidates", e));
3965
3996
  }), this._startStatInterval();
3966
3997
  }
@@ -3971,7 +4002,7 @@ var yr = class extends g {
3971
4002
  break;
3972
4003
  case "failed":
3973
4004
  case "disconnected":
3974
- this._reconnectionPrevented ? this.close(/* @__PURE__ */ Error(`Ice connection ${this._pc.connectionState}`)) : (this._setState(W.RECONNECTING), this._startReconnection());
4005
+ this._reconnectionPrevented ? this.close(/* @__PURE__ */ Error(`Ice connection ${this._pc.connectionState}`)) : (this._setState(K.RECONNECTING), this._startReconnection());
3975
4006
  break;
3976
4007
  case "closed":
3977
4008
  this.close(/* @__PURE__ */ Error("Ice connection closed"));
@@ -4111,8 +4142,8 @@ var yr = class extends g {
4111
4142
  }
4112
4143
  async _checkPPTNetwork(e) {
4113
4144
  if (!N.switchVideoAtBadNetwork || !e.inbound.transport.averageNetStat) return;
4114
- let { averageNetStat: t } = e.inbound.transport, n = t.currentRoundTripTime <= this._networkLimitsForVideo.good.rtt && t.lostPercent <= this._networkLimitsForVideo.good.loss, r = t.currentRoundTripTime >= this._networkLimitsForVideo.bad.rtt || t.lostPercent >= this._networkLimitsForVideo.bad.loss, i = t.currentRoundTripTime < this._networkLimitsForVideo.bad.rtt, a = this._videoMaxDimensionsForNet.good, o = hr.L1T1;
4115
- if (r ? (this._lastBadConnection = Date.now(), i ? (a = this._videoMaxDimensionsForNet.bad, o = hr.L1T2) : (a = this._videoMaxDimensionsForNet.worst, o = hr.L1T3)) : n && (a = this._videoMaxDimensionsForNet.good, o = hr.L1T1), !(a < this._lastVideoMaxDimension || Date.now() - this._lastBadConnection > jr) || this._lastVideoMaxDimension === a) return;
4145
+ let { averageNetStat: t } = e.inbound.transport, n = t.currentRoundTripTime <= this._networkLimitsForVideo.good.rtt && t.lostPercent <= this._networkLimitsForVideo.good.loss, r = t.currentRoundTripTime >= this._networkLimitsForVideo.bad.rtt || t.lostPercent >= this._networkLimitsForVideo.bad.loss, i = t.currentRoundTripTime < this._networkLimitsForVideo.bad.rtt, a = this._videoMaxDimensionsForNet.good, o = yr.L1T1;
4146
+ if (r ? (this._lastBadConnection = Date.now(), i ? (a = this._videoMaxDimensionsForNet.bad, o = yr.L1T2) : (a = this._videoMaxDimensionsForNet.worst, o = yr.L1T3)) : n && (a = this._videoMaxDimensionsForNet.good, o = yr.L1T1), !(a < this._lastVideoMaxDimension || Date.now() - this._lastBadConnection > Fr) || this._lastVideoMaxDimension === a) return;
4116
4147
  let s = this._serverSettings.camera;
4117
4148
  if (!s || !await this._isSVCSupported(e, o)) return;
4118
4149
  this._debug.debug("Switch outbound video frame size and scalabilityMode", {
@@ -4177,9 +4208,9 @@ var yr = class extends g {
4177
4208
  }, n(r)) : this._debug.error(`[${t}] data channel open failed, state [${e}]`);
4178
4209
  };
4179
4210
  }
4180
- }, Nr = /* @__PURE__ */ function(e) {
4211
+ }, Lr = /* @__PURE__ */ function(e) {
4181
4212
  return e.AUDIO_MIX = "audio-mix", e.PARTICIPANT_AGNOSTIC_TRACK_PREFIX = "pat", e.TRANSPARENT_AUDIO_TRACK_PREFIX = "ta", e;
4182
- }({}), Pr = 16, Fr = class e {
4213
+ }({}), Rr = 16, zr = class e {
4183
4214
  constructor(e, t, n, r = z) {
4184
4215
  h(this, "_datachannel", void 0), h(this, "_participantIdRegistry", void 0), h(this, "_asrCallback", void 0), h(this, "_textDecoder", void 0), h(this, "_debug", void 0), this._debug = r, this._debug.debug("AsrReceiver started"), this._datachannel = e, this._participantIdRegistry = t, this._asrCallback = n, this._textDecoder = new TextDecoder(), this._datachannel.onmessage = (e) => this._onDataChannelMessage(e.data);
4185
4216
  }
@@ -4193,7 +4224,7 @@ var yr = class extends g {
4193
4224
  ssrc: a,
4194
4225
  timestamp: o,
4195
4226
  duration: s,
4196
- data: e.slice(Pr)
4227
+ data: e.slice(Rr)
4197
4228
  };
4198
4229
  }
4199
4230
  _onDataChannelMessage(t) {
@@ -4213,7 +4244,7 @@ var yr = class extends g {
4213
4244
  destroy() {
4214
4245
  this._datachannel.onmessage = null;
4215
4246
  }
4216
- }, Ir, Lr = class {
4247
+ }, Br, Vr = class {
4217
4248
  constructor() {
4218
4249
  h(this, "_value", 1);
4219
4250
  }
@@ -4224,10 +4255,10 @@ var yr = class extends g {
4224
4255
  this._value = e;
4225
4256
  }
4226
4257
  };
4227
- Ir = Lr, h(Lr, "_instance", null), h(Lr, "getInstance", () => (Ir._instance || (Ir._instance = new Ir()), Ir._instance));
4258
+ Br = Vr, h(Vr, "_instance", null), h(Vr, "getInstance", () => (Br._instance || (Br._instance = new Br()), Br._instance));
4228
4259
  //#endregion
4229
4260
  //#region src/classes/ParticipantIdRegistry.ts
4230
- var Rr = class {
4261
+ var Hr = class {
4231
4262
  constructor(e = z) {
4232
4263
  h(this, "streamDescriptionByCompactId", /* @__PURE__ */ new Map()), h(this, "compactIdByStreamDescription", /* @__PURE__ */ new Map()), h(this, "_debug", void 0), this._debug = e;
4233
4264
  }
@@ -4255,25 +4286,25 @@ var Rr = class {
4255
4286
  }
4256
4287
  return n === 2 ? {
4257
4288
  type: "notification",
4258
- notification: K.AUDIO_ACTIVITY,
4289
+ notification: G.AUDIO_ACTIVITY,
4259
4290
  activeParticipants: i
4260
4291
  } : {
4261
4292
  type: "notification",
4262
- notification: K.STALLED_ACTIVITY,
4293
+ notification: G.STALLED_ACTIVITY,
4263
4294
  stalledParticipants: i
4264
4295
  };
4265
4296
  case 3:
4266
4297
  let a = s(r);
4267
4298
  return {
4268
4299
  type: "notification",
4269
- notification: K.SPEAKER_CHANGED,
4300
+ notification: G.SPEAKER_CHANGED,
4270
4301
  speaker: this.getStreamDescription(a)?.participantId
4271
4302
  };
4272
4303
  case 5:
4273
4304
  let o = s(r);
4274
4305
  return {
4275
4306
  type: "notification",
4276
- notification: K.VIDEO_QUALITY_UPDATE,
4307
+ notification: G.VIDEO_QUALITY_UPDATE,
4277
4308
  quality: {
4278
4309
  maxBitrate: o[0],
4279
4310
  maxDimension: o[1]
@@ -4288,7 +4319,7 @@ var Rr = class {
4288
4319
  }
4289
4320
  return {
4290
4321
  type: "notification",
4291
- notification: K.NETWORK_STATUS,
4322
+ notification: G.NETWORK_STATUS,
4292
4323
  statuses: l
4293
4324
  };
4294
4325
  case 7: return this._createParticipantSourcesUpdateNotification(r);
@@ -4307,7 +4338,7 @@ var Rr = class {
4307
4338
  });
4308
4339
  return {
4309
4340
  type: "notification",
4310
- notification: K.MOVIE_UPDATE_NOTIFICATION,
4341
+ notification: G.MOVIE_UPDATE_NOTIFICATION,
4311
4342
  data: e
4312
4343
  };
4313
4344
  }
@@ -4315,7 +4346,7 @@ var Rr = class {
4315
4346
  let u = s(r);
4316
4347
  return {
4317
4348
  type: "notification",
4318
- notification: K.VIDEO_SUSPEND_SUGGEST,
4349
+ notification: G.VIDEO_SUSPEND_SUGGEST,
4319
4350
  bandwidth: u
4320
4351
  };
4321
4352
  default: return this._debug.debug("unsupported message type: " + n), null;
@@ -4343,7 +4374,7 @@ var Rr = class {
4343
4374
  this._debug.error("unexpected null sequenceNumber", e, r);
4344
4375
  continue;
4345
4376
  }
4346
- let l = Nr.PARTICIPANT_AGNOSTIC_TRACK_PREFIX + "-" + e, u = i ? i >>> 0 : null;
4377
+ let l = Lr.PARTICIPANT_AGNOSTIC_TRACK_PREFIX + "-" + e, u = i ? i >>> 0 : null;
4347
4378
  n.push({
4348
4379
  participantStreamDescription: c,
4349
4380
  streamId: l,
@@ -4355,13 +4386,13 @@ var Rr = class {
4355
4386
  }
4356
4387
  return {
4357
4388
  type: "notification",
4358
- notification: K.PARTICIPANT_SOURCES_UPDATE,
4389
+ notification: G.PARTICIPANT_SOURCES_UPDATE,
4359
4390
  participantUpdateInfos: n
4360
4391
  };
4361
4392
  }
4362
- }, zr = /* @__PURE__ */ function(e) {
4393
+ }, Ur = /* @__PURE__ */ function(e) {
4363
4394
  return e.INIT = "init", e.READY = "ready", e.FRAME = "frame", e.SET_BITRATE = "set_bitrate", e.ERROR = "error", e.DEBUG = "debug", e.LOG_ERROR = "log_error", e;
4364
- }({}), Br = class {
4395
+ }({}), Wr = class {
4365
4396
  constructor(e = z, t = null) {
4366
4397
  h(this, "_worker", null), h(this, "_debug", void 0), h(this, "_logger", void 0), this._debug = e, this._logger = t;
4367
4398
  }
@@ -4377,7 +4408,7 @@ var Rr = class {
4377
4408
  return;
4378
4409
  }
4379
4410
  t({
4380
- type: zr.FRAME,
4411
+ type: Ur.FRAME,
4381
4412
  error: e
4382
4413
  });
4383
4414
  };
@@ -4387,23 +4418,23 @@ var Rr = class {
4387
4418
  e.preventDefault?.(), m(this._formatWorkerMessageError(e));
4388
4419
  }, f.onmessage = (e) => {
4389
4420
  switch (e.data.type) {
4390
- case zr.READY:
4421
+ case Ur.READY:
4391
4422
  s = !0, c || (c = !0, a());
4392
4423
  break;
4393
- case zr.ERROR:
4424
+ case Ur.ERROR:
4394
4425
  s ? m(e.data.error) : p(e.data.error);
4395
4426
  break;
4396
- case zr.FRAME:
4427
+ case Ur.FRAME:
4397
4428
  t(e.data);
4398
4429
  break;
4399
- case zr.DEBUG:
4430
+ case Ur.DEBUG:
4400
4431
  this._debug.debug(e.data.message);
4401
4432
  break;
4402
- case zr.LOG_ERROR:
4433
+ case Ur.LOG_ERROR:
4403
4434
  this._logger?.log(E.ERROR, e.data.message);
4404
4435
  break;
4405
4436
  }
4406
- }, this._sendToWorker(zr.INIT, r, i);
4437
+ }, this._sendToWorker(Ur.INIT, r, i);
4407
4438
  });
4408
4439
  }
4409
4440
  _removeWorker() {
@@ -4426,7 +4457,7 @@ var Rr = class {
4426
4457
  static isBrowserSupported() {
4427
4458
  throw Error("Not implemented");
4428
4459
  }
4429
- }, Vr = class extends Br {
4460
+ }, Gr = class extends Wr {
4430
4461
  constructor(e = z, t = null) {
4431
4462
  super(e, t);
4432
4463
  }
@@ -4436,7 +4467,7 @@ var Rr = class {
4436
4467
  }, [c, c.getUrl]);
4437
4468
  }
4438
4469
  decodeFrame(e, t, n, r) {
4439
- this._sendToWorker(zr.FRAME, {
4470
+ this._sendToWorker(Ur.FRAME, {
4440
4471
  timestamp: e,
4441
4472
  data: t.buffer,
4442
4473
  isVP9: n,
@@ -4450,7 +4481,7 @@ var Rr = class {
4450
4481
  static isBrowserSupported() {
4451
4482
  return "WebAssembly" in window && "Worker" in window;
4452
4483
  }
4453
- }, Hr = class extends Br {
4484
+ }, Kr = class extends Wr {
4454
4485
  constructor(e = z, t = null) {
4455
4486
  super(e, t);
4456
4487
  }
@@ -4460,7 +4491,7 @@ var Rr = class {
4460
4491
  }, [O.baseChromeVersion() >= 92 || O.browserName() === "Safari"]);
4461
4492
  }
4462
4493
  decodeFrame(e, t, n, r = !1) {
4463
- this._sendToWorker(zr.FRAME, {
4494
+ this._sendToWorker(Ur.FRAME, {
4464
4495
  timestamp: e,
4465
4496
  data: t.buffer,
4466
4497
  isVP9: n,
@@ -4473,7 +4504,7 @@ var Rr = class {
4473
4504
  static isBrowserSupported() {
4474
4505
  return "VideoDecoder" in window && "Worker" in window && "VideoFrame" in window && !O.isBrokenVP9Decoder() && O.browserName() !== "Firefox";
4475
4506
  }
4476
- }, Ur = class {
4507
+ }, qr = class {
4477
4508
  constructor(e = null, t = 0) {
4478
4509
  h(this, "_counter", 0), h(this, "_interval", 0), h(this, "_lastCalculationTime", Date.now()), h(this, "_onCalculated", null), this._onCalculated = e, t && (this._interval = window.setInterval(() => this.calculate(), t));
4479
4510
  }
@@ -4487,7 +4518,7 @@ var Rr = class {
4487
4518
  destroy() {
4488
4519
  window.clearInterval(this._interval), this._interval = 0;
4489
4520
  }
4490
- }, Wr = class {
4521
+ }, Jr = class {
4491
4522
  constructor(e, t) {
4492
4523
  h(this, "_participantId", void 0), h(this, "_statAggregator", void 0), h(this, "_firstFrameReceived", !1), this._participantId = e, this._statAggregator = t;
4493
4524
  }
@@ -4502,14 +4533,14 @@ var Rr = class {
4502
4533
  height: t
4503
4534
  });
4504
4535
  }
4505
- }, Gr = 65536, Kr = "MARK_SCREENSHARE_FREEZE_DURATION", qr = class e {
4536
+ }, Yr = 65536, Xr = "MARK_SCREENSHARE_FREEZE_DURATION", Zr = class e {
4506
4537
  constructor(e, t, n, r, i, a = z) {
4507
- h(this, "_participantId", void 0), h(this, "_onStream", void 0), h(this, "_onStat", void 0), h(this, "_onKeyFrameRequested", void 0), h(this, "_statScreenShareFirstFrame", void 0), h(this, "_debug", void 0), h(this, "_chunks", []), this._participantId = e, this._onStream = t, this._onStat = n, this._onKeyFrameRequested = i, this._statScreenShareFirstFrame = new Wr(e, r), this._debug = a;
4538
+ h(this, "_participantId", void 0), h(this, "_onStream", void 0), h(this, "_onStat", void 0), h(this, "_onKeyFrameRequested", void 0), h(this, "_statScreenShareFirstFrame", void 0), h(this, "_debug", void 0), h(this, "_chunks", []), this._participantId = e, this._onStream = t, this._onStat = n, this._onKeyFrameRequested = i, this._statScreenShareFirstFrame = new Jr(e, r), this._debug = a;
4508
4539
  }
4509
4540
  appendChunk(t) {
4510
4541
  let n = this._chunks.length;
4511
4542
  if (t.start) this._measureFreezeDuration(!1), this._measureFreezeDuration(!0), n && (this._debug.warn("[FrameBuilder] Cleanup buffer", Array.prototype.slice.call(this._chunks)), this._chunks = []);
4512
- else if (!n || (this._chunks[n - 1].sequence + 1) % Gr !== t.sequence) {
4543
+ else if (!n || (this._chunks[n - 1].sequence + 1) % Yr !== t.sequence) {
4513
4544
  this._debug.warn("[FrameBuilder] Got incorrect chunk");
4514
4545
  return;
4515
4546
  }
@@ -4526,7 +4557,7 @@ var Rr = class {
4526
4557
  }
4527
4558
  }
4528
4559
  destroy() {
4529
- U.clearMark(Kr), U.clearMark(U.getMarkNameScreenshareFirstFrame(this._participantId)), this._chunks = [];
4560
+ U.clearMark(Xr), U.clearMark(U.getMarkNameScreenshareFirstFrame(this._participantId)), this._chunks = [];
4530
4561
  }
4531
4562
  _processFrameData() {
4532
4563
  let e = this._chunks;
@@ -4549,13 +4580,13 @@ var Rr = class {
4549
4580
  }
4550
4581
  _measureFreezeDuration(e) {
4551
4582
  if (e) {
4552
- U.setMark(Kr);
4583
+ U.setMark(Xr);
4553
4584
  return;
4554
4585
  }
4555
- let t = U.measureMark(Kr);
4586
+ let t = U.measureMark(Xr);
4556
4587
  t !== null && t > 1e3 && this._onStat({ freeze_duration: t });
4557
4588
  }
4558
- }, Jr = class {
4589
+ }, Qr = class {
4559
4590
  constructor(e) {
4560
4591
  h(this, "_onStream", void 0), this._onStream = e;
4561
4592
  }
@@ -4568,7 +4599,7 @@ var Rr = class {
4568
4599
  static isBrowserSupported() {
4569
4600
  throw Error("Method `isBrowserSupported` is not implemented");
4570
4601
  }
4571
- }, Yr = class extends Jr {
4602
+ }, $r = class extends Qr {
4572
4603
  constructor(e, t = z) {
4573
4604
  super(e), h(this, "_useImageBitmap", void 0), h(this, "_canvas", null), h(this, "_canvasContext", null), h(this, "_stream", null), h(this, "_track", null), h(this, "_debug", void 0), this._debug = t, this._debug.debug("CanvasRenderer started"), this._useImageBitmap = "ImageBitmap" in window;
4574
4605
  }
@@ -4628,7 +4659,7 @@ var Rr = class {
4628
4659
  static isBrowserSupported() {
4629
4660
  return ("CanvasCaptureMediaStream" in window || "CanvasCaptureMediaStreamTrack" in window) && !(O.browserName() === "Safari" && Number(O.browserVersion()) === 15) && !(O.browserName() === "Firefox" && Number(O.browserVersion()) < 60);
4630
4661
  }
4631
- }, Xr = class extends Jr {
4662
+ }, ei = class extends Qr {
4632
4663
  constructor(e, t = z) {
4633
4664
  super(e), h(this, "_generator", void 0), h(this, "_writer", void 0), h(this, "_stream", void 0), h(this, "_debug", void 0), this._debug = t, this._debug.debug("TrackGeneratorRenderer started"), this._generator = new MediaStreamTrackGenerator({ kind: A.video }), this._writer = this._generator.writable.getWriter(), this._stream = new MediaStream([this._generator]), this._onStream(this._stream);
4634
4665
  }
@@ -4639,9 +4670,9 @@ var Rr = class {
4639
4670
  this._writer.releaseLock(), this._generator.writable.close().then(() => this._generator.stop()), this._debug.debug("TrackGeneratorRenderer destroyed");
4640
4671
  }
4641
4672
  static isBrowserSupported() {
4642
- return "VideoFrame" in window && "MediaStreamTrackGenerator" in window && Hr.isBrowserSupported();
4673
+ return "VideoFrame" in window && "MediaStreamTrackGenerator" in window && Kr.isBrowserSupported();
4643
4674
  }
4644
- }, Zr = class extends qr {
4675
+ }, ti = class extends Zr {
4645
4676
  constructor(e, t, n, r, i, a = z, o = null) {
4646
4677
  super(e, t, n, r, i, a), h(this, "_renderer", void 0), h(this, "_decoder", void 0), h(this, "_decoderReady", !1), h(this, "_decoderBusy", !1), h(this, "_decoderQueue", []), h(this, "_fpsMeter", void 0), h(this, "_logger", void 0), this._logger = o, this._debug.debug(`StreamBuilder started for participant [${e}]`), this._initFpsMeter(), this._initRenderer(), this._initDecoder();
4647
4678
  }
@@ -4649,20 +4680,20 @@ var Rr = class {
4649
4680
  e.keyframe && (this._decoderQueue = []), this._decoderQueue.push(e), this._decodeQueue();
4650
4681
  }
4651
4682
  _initFpsMeter() {
4652
- this._fpsMeter = new Ur((e) => this._debug.log(`[StreamBuilder][${this._participantId}] fps: ${e}`), 2e4);
4683
+ this._fpsMeter = new qr((e) => this._debug.log(`[StreamBuilder][${this._participantId}] fps: ${e}`), 2e4);
4653
4684
  }
4654
4685
  _initRenderer(e = !1) {
4655
- e || !Xr.isBrowserSupported() ? this._renderer = new Yr(this._onStream, this._debug) : this._renderer = new Xr(this._onStream, this._debug);
4686
+ e || !ei.isBrowserSupported() ? this._renderer = new $r(this._onStream, this._debug) : this._renderer = new ei(this._onStream, this._debug);
4656
4687
  }
4657
4688
  _initDecoder(e = !1) {
4658
- e || !Hr.isBrowserSupported() ? this._decoder = new Vr(this._debug, this._logger) : this._decoder = new Hr(this._debug, this._logger), this._decoder.init(async (e) => {
4689
+ e || !Kr.isBrowserSupported() ? this._decoder = new Gr(this._debug, this._logger) : this._decoder = new Kr(this._debug, this._logger), this._decoder.init(async (e) => {
4659
4690
  this._decoderBusy = !1, "VideoFrame" in window && e instanceof VideoFrame ? await this._renderer.drawFrame(e) : await this._renderer.drawImage(e), this._fpsMeter.increment(), this._decodeQueue();
4660
4691
  }, (e) => {
4661
- this._decoderBusy = !1, this._decodeQueue(), this._decoder instanceof Hr && typeof e == "string" && e.includes("EncodingError") && this._switchToLibVPXDecoder();
4692
+ this._decoderBusy = !1, this._decodeQueue(), this._decoder instanceof Kr && typeof e == "string" && e.includes("EncodingError") && this._switchToLibVPXDecoder();
4662
4693
  }, this._onKeyFrameRequested).then(() => {
4663
4694
  this._decoderReady = !0, this._decodeQueue();
4664
4695
  }).catch((e) => {
4665
- this._debug.warn("StreamBuilder decoder init failed", e), this._decoder instanceof Hr && this._switchToLibVPXDecoder();
4696
+ this._debug.warn("StreamBuilder decoder init failed", e), this._decoder instanceof Kr && this._switchToLibVPXDecoder();
4666
4697
  });
4667
4698
  }
4668
4699
  _switchToLibVPXDecoder() {
@@ -4677,20 +4708,20 @@ var Rr = class {
4677
4708
  super.destroy(), this._fpsMeter.destroy(), this._decoder.destroy(), this._renderer.destroy(), this._debug.debug(`StreamBuilder destroyed for participant ${this._participantId}`);
4678
4709
  }
4679
4710
  static isBrowserSupported() {
4680
- return Yr.isBrowserSupported() || Xr.isBrowserSupported();
4711
+ return $r.isBrowserSupported() || ei.isBrowserSupported();
4681
4712
  }
4682
- }, Qr = 1, $r = 1, ei = 2, ti = 0, ni = 1, ri = 2, ii = 4, ai = 8;
4683
- function oi(e, t, n, r, i, a, o) {
4713
+ }, ni = 1, ri = 1, ii = 2, ai = 0, oi = 1, si = 2, ci = 4, li = 8;
4714
+ function ui(e, t, n, r, i, a, o) {
4684
4715
  let s = 0;
4685
- t && (s |= ni), n && (s |= ri), r && (s |= ii), o || (s |= ai);
4716
+ t && (s |= oi), n && (s |= si), r && (s |= ci), o || (s |= li);
4686
4717
  let c = /* @__PURE__ */ new ArrayBuffer(11), l = new DataView(c);
4687
- if (l.setUint8(0, Qr), l.setUint16(1, i), l.setUint32(3, e), l.setUint8(7, +!!a), l.setUint16(8, ti), l.setUint8(10, s), !o) return c;
4718
+ if (l.setUint8(0, ni), l.setUint16(1, i), l.setUint32(3, e), l.setUint8(7, +!!a), l.setUint16(8, ai), l.setUint8(10, s), !o) return c;
4688
4719
  let u = new Uint8Array(c.byteLength + o.byteLength);
4689
4720
  return u.set(new Uint8Array(c), 0), u.set(new Uint8Array(o), c.byteLength), u.buffer;
4690
4721
  }
4691
- function si(e) {
4692
- let t = new DataView(e), n = t.getUint8(0), r = t.getUint16(1), i = t.getUint32(3), a = t.getUint8(7) === 1, o = t.getUint16(8), s = t.getUint8(10), c = !!(s & ni), l = !!(s & ri), u = !!(s & ii), d = !!(s & ai);
4693
- if (n !== Qr) throw Error(`Unexpected protocol version. Got ${n}, expected ${Qr}`);
4722
+ function di(e) {
4723
+ let t = new DataView(e), n = t.getUint8(0), r = t.getUint16(1), i = t.getUint32(3), a = t.getUint8(7) === 1, o = t.getUint16(8), s = t.getUint8(10), c = !!(s & oi), l = !!(s & si), u = !!(s & ci), d = !!(s & li);
4724
+ if (n !== ni) throw Error(`Unexpected protocol version. Got ${n}, expected ${ni}`);
4694
4725
  return {
4695
4726
  timestamp: i,
4696
4727
  start: c,
@@ -4703,26 +4734,26 @@ function si(e) {
4703
4734
  data: e.slice(11)
4704
4735
  };
4705
4736
  }
4706
- function ci(e) {
4737
+ function fi(e) {
4707
4738
  if (!e || !e.byteLength || e.byteLength !== 4) return !1;
4708
4739
  let t = new DataView(e);
4709
- return !(t.getUint8(0) !== Qr || t.getUint8(1) !== $r || t.getUint16(2) !== ti);
4740
+ return !(t.getUint8(0) !== ni || t.getUint8(1) !== ri || t.getUint16(2) !== ai);
4710
4741
  }
4711
- function li(e) {
4742
+ function pi(e) {
4712
4743
  if (!e || !e.byteLength || e.byteLength !== 10) return null;
4713
4744
  let t = new DataView(e);
4714
- return t.getUint8(0) !== Qr || t.getUint8(1) !== ei || t.getUint16(2) !== ti ? null : {
4745
+ return t.getUint8(0) !== ni || t.getUint8(1) !== ii || t.getUint16(2) !== ai ? null : {
4715
4746
  seq: t.getUint16(4),
4716
4747
  ts2: t.getUint32(6)
4717
4748
  };
4718
4749
  }
4719
- function ui(e) {
4750
+ function mi(e) {
4720
4751
  let t = /* @__PURE__ */ new ArrayBuffer(4), n = new DataView(t);
4721
- return n.setUint8(0, Qr), n.setUint8(1, $r), n.setUint16(2, e), t;
4752
+ return n.setUint8(0, ni), n.setUint8(1, ri), n.setUint16(2, e), t;
4722
4753
  }
4723
4754
  //#endregion
4724
4755
  //#region src/classes/screenshare/WebmBuilder.ts
4725
- var di = 2 ** 15 - 1, fi = 1, pi = 5, mi = 5, hi = class e {
4756
+ var hi = 2 ** 15 - 1, gi = 1, _i = 5, vi = 5, yi = class e {
4726
4757
  constructor(e, t = z) {
4727
4758
  h(this, "_mediaSource", void 0), h(this, "_codec", void 0), h(this, "_sourceBuffer", null), h(this, "_queue", []), h(this, "_clearBufferTill", 0), h(this, "_debug", void 0), this._mediaSource = new MediaSource(), this._codec = e, this._debug = t;
4728
4759
  let n = () => {
@@ -4765,8 +4796,8 @@ var di = 2 ** 15 - 1, fi = 1, pi = 5, mi = 5, hi = class e {
4765
4796
  this._mediaSource?.readyState === "open" && this._sourceBuffer?.abort();
4766
4797
  let e = this._sourceBuffer?.buffered, t = e?.length;
4767
4798
  if (!t) return;
4768
- let n = e.start(0), r = Math.max(0, e.end(t - 1) - pi);
4769
- r - n > mi && (this._clearBufferTill = r);
4799
+ let n = e.start(0), r = Math.max(0, e.end(t - 1) - _i);
4800
+ r - n > vi && (this._clearBufferTill = r);
4770
4801
  }
4771
4802
  destroy() {
4772
4803
  this._queue = [], this._mediaSource.readyState === "open" && (this._sourceBuffer?.abort(), this._mediaSource.endOfStream()), this._sourceBuffer = null, this._clearBufferTill = 0;
@@ -4780,7 +4811,7 @@ var di = 2 ** 15 - 1, fi = 1, pi = 5, mi = 5, hi = class e {
4780
4811
  get buffered() {
4781
4812
  return this._sourceBuffer?.buffered;
4782
4813
  }
4783
- }, gi = class e extends qr {
4814
+ }, bi = class e extends Zr {
4784
4815
  constructor(e, t, n, r, i = z) {
4785
4816
  super(e, t, n, r, void 0, i), h(this, "_mediaBuffer", null), h(this, "_video", null), h(this, "_stream", null), h(this, "_earliestTimestamp", 0), h(this, "_clusterStartTime", 0), h(this, "_lastFrameTimestamp", 0), this._debug.debug(`[WebmBuilder] started for participant [${e}]`);
4786
4817
  }
@@ -4804,8 +4835,8 @@ var di = 2 ** 15 - 1, fi = 1, pi = 5, mi = 5, hi = class e {
4804
4835
  u.element(u.ID.MuxingApp, u.string("vk-webm-builder")),
4805
4836
  u.element(u.ID.WritingApp, u.string("vk-webm-builder"))
4806
4837
  ]), i = [u.element(u.ID.PixelWidth, u.number(e)), u.element(u.ID.PixelHeight, u.number(t))], a = u.element(u.ID.Tracks, u.element(u.ID.TrackEntry, [
4807
- u.element(u.ID.TrackNumber, u.number(fi)),
4808
- u.element(u.ID.TrackUID, u.number(fi)),
4838
+ u.element(u.ID.TrackNumber, u.number(gi)),
4839
+ u.element(u.ID.TrackUID, u.number(gi)),
4809
4840
  u.element(u.ID.TrackType, u.number(1)),
4810
4841
  u.element(u.ID.FlagLacing, u.number(0)),
4811
4842
  u.element(u.ID.DefaultDuration, u.number(1e9)),
@@ -4818,7 +4849,7 @@ var di = 2 ** 15 - 1, fi = 1, pi = 5, mi = 5, hi = class e {
4818
4849
  return u.unknownSizeElement(u.ID.Cluster, [u.element(u.ID.Timecode, u.number(Math.round(e)))]);
4819
4850
  }
4820
4851
  _createVideo(e) {
4821
- this._mediaBuffer = new hi(e, this._debug), this._video = document.createElement("video"), this._video.autoplay = !0, this._video.controls = !1, this._video.muted = !0, this._video.style.pointerEvents = "none", this._video.style.visibility = "hidden", this._video.style.position = "absolute", this._video.style.width = "160px", this._video.style.height = "90px", this._video.style.bottom = "0", this._video.style.right = "0", this._video.style.zIndex = "5000", this._video.src = URL.createObjectURL(this._mediaBuffer.mediaSource), document.body.appendChild(this._video);
4852
+ this._mediaBuffer = new yi(e, this._debug), this._video = document.createElement("video"), this._video.autoplay = !0, this._video.controls = !1, this._video.muted = !0, this._video.style.pointerEvents = "none", this._video.style.visibility = "hidden", this._video.style.position = "absolute", this._video.style.width = "160px", this._video.style.height = "90px", this._video.style.bottom = "0", this._video.style.right = "0", this._video.style.zIndex = "5000", this._video.src = URL.createObjectURL(this._mediaBuffer.mediaSource), document.body.appendChild(this._video);
4822
4853
  let t = () => {
4823
4854
  if (this._video?.src) {
4824
4855
  this._debug.warn(`[WebmBuilder] Video paused for participant [${this._participantId}], try to play again`);
@@ -4845,13 +4876,13 @@ var di = 2 ** 15 - 1, fi = 1, pi = 5, mi = 5, hi = class e {
4845
4876
  this._mediaBuffer?.append(a);
4846
4877
  }
4847
4878
  let i = Math.round(r - this._clusterStartTime);
4848
- if (i > di && (this._clusterStartTime = r, i = 0), i === 0) {
4879
+ if (i > hi && (this._clusterStartTime = r, i = 0), i === 0) {
4849
4880
  this._debug.debug(`[WebmBuilder] Cluster header for participant [${this._participantId}]`);
4850
4881
  let t = e._genClusterHeader(this._clusterStartTime);
4851
4882
  this._mediaBuffer?.append(t);
4852
4883
  }
4853
4884
  let a = u.element(u.ID.SimpleBlock, [
4854
- u.vintEncodedNumber(fi),
4885
+ u.vintEncodedNumber(gi),
4855
4886
  u.bytes(e._intToU16BE(i)),
4856
4887
  u.number(!!t.keyframe << 7),
4857
4888
  u.bytes(t.frameData)
@@ -4864,12 +4895,12 @@ var di = 2 ** 15 - 1, fi = 1, pi = 5, mi = 5, hi = class e {
4864
4895
  static isBrowserSupported() {
4865
4896
  return "captureStream" in window.HTMLVideoElement?.prototype && window.MediaSource?.isTypeSupported("video/webm; codecs=\"vp8\"") && window.MediaSource?.isTypeSupported("video/webm; codecs=\"vp9\"");
4866
4897
  }
4867
- }, _i = class {
4898
+ }, xi = class {
4868
4899
  constructor(e, t, n, r, i, a = null, o = z, s = null) {
4869
4900
  h(this, "_datachannel", void 0), h(this, "_participantIdRegistry", null), h(this, "_streamBuilders", {}), h(this, "_onStream", () => {}), h(this, "_onEos", () => {}), h(this, "_onStat", void 0), h(this, "_debug", void 0), h(this, "_logger", void 0), h(this, "_statAggregator", void 0), this._debug = o, this._logger = s, this._statAggregator = a, this._debug.debug("ScreenCaptureReceiver started"), this._datachannel = e, this._participantIdRegistry = t, this._onStream = n, this._onEos = r, this._onStat = i, this._datachannel.onmessage = (e) => this._onDataChannelMessage(e.data);
4870
4901
  }
4871
4902
  _onDataChannelMessage(e) {
4872
- let t = si(e), n = this._participantIdRegistry?.getStreamDescription(t.ssrc)?.participantId;
4903
+ let t = di(e), n = this._participantIdRegistry?.getStreamDescription(t.ssrc)?.participantId;
4873
4904
  if (!n) {
4874
4905
  this._debug.warn(`Participant id for ssrc ${t.ssrc} not found in registry`);
4875
4906
  return;
@@ -4881,7 +4912,7 @@ var di = 2 ** 15 - 1, fi = 1, pi = 5, mi = 5, hi = class e {
4881
4912
  let r = this._streamBuilders[n];
4882
4913
  if (!r) {
4883
4914
  let e = (e) => this._onStream(n, e);
4884
- r = N.screenShareWebmBuilder && gi.isBrowserSupported() ? new gi(n, e, this._onStat, this._statAggregator, this._debug) : new Zr(n, e, this._onStat, this._statAggregator, () => {
4915
+ r = N.screenShareWebmBuilder && bi.isBrowserSupported() ? new bi(n, e, this._onStat, this._statAggregator, this._debug) : new ti(n, e, this._onStat, this._statAggregator, () => {
4885
4916
  this._requestKeyFrame(t.ssrc);
4886
4917
  }, this._debug, this._logger), this._streamBuilders[n] = r;
4887
4918
  }
@@ -4889,7 +4920,7 @@ var di = 2 ** 15 - 1, fi = 1, pi = 5, mi = 5, hi = class e {
4889
4920
  }
4890
4921
  _requestKeyFrame(e) {
4891
4922
  if (!(!this._datachannel || this._datachannel.readyState !== "open")) try {
4892
- let t = ui(e);
4923
+ let t = mi(e);
4893
4924
  this._datachannel.send(t), this._debug.debug(`ScreenCaptureReceiver request for keyframe for ssrc ${e}`);
4894
4925
  } catch (e) {
4895
4926
  this._debug.warn("Failed to send keyframe request", e);
@@ -4902,7 +4933,7 @@ var di = 2 ** 15 - 1, fi = 1, pi = 5, mi = 5, hi = class e {
4902
4933
  destroy() {
4903
4934
  this._datachannel.onbufferedamountlow = null, this._datachannel.onmessage = null, this._onStream = () => {}, Object.values(this._streamBuilders).forEach((e) => e.destroy()), this._streamBuilders = {}, this._participantIdRegistry = null, this._debug.debug("ScreenCaptureReceiver destroyed");
4904
4935
  }
4905
- }, vi = class {
4936
+ }, Si = class {
4906
4937
  constructor(e, t, n) {
4907
4938
  h(this, "_prev", void 0), h(this, "_next", void 0), h(this, "_data", void 0), this._next = n, n && (n.prev = this), this._prev = t, t && (t.next = this), this._data = e;
4908
4939
  }
@@ -4921,7 +4952,7 @@ var di = 2 ** 15 - 1, fi = 1, pi = 5, mi = 5, hi = class e {
4921
4952
  get data() {
4922
4953
  return this._data;
4923
4954
  }
4924
- }, yi = class {
4955
+ }, Ci = class {
4925
4956
  constructor() {
4926
4957
  h(this, "_head", null), h(this, "_tail", null), h(this, "_length", 0);
4927
4958
  }
@@ -4929,7 +4960,7 @@ var di = 2 ** 15 - 1, fi = 1, pi = 5, mi = 5, hi = class e {
4929
4960
  return this._length;
4930
4961
  }
4931
4962
  push(...e) {
4932
- for (let t of e) this._tail = new vi(t, this._tail, null), this._head || (this._head = this._tail), this._length++;
4963
+ for (let t of e) this._tail = new Si(t, this._tail, null), this._head || (this._head = this._tail), this._length++;
4933
4964
  }
4934
4965
  merge(e) {
4935
4966
  this._tail && (this._tail.next = e._head), this._head || (this._head = e._head), this._tail = e._tail, this._length += e._length, e.clear();
@@ -4959,7 +4990,7 @@ var di = 2 ** 15 - 1, fi = 1, pi = 5, mi = 5, hi = class e {
4959
4990
  for (; t !== null;) e.push(t.data), t = t.next;
4960
4991
  return e.length ? JSON.stringify(e, (e, t) => t instanceof Error ? String(t) : t) : "";
4961
4992
  }
4962
- }, bi = 1e3, xi = class extends Br {
4993
+ }, wi = 1e3, Ti = class extends Wr {
4963
4994
  constructor(e, t, n, r, i = z, a = null) {
4964
4995
  super(i, a), h(this, "_sourceTrack", void 0), h(this, "_onFrame", void 0), h(this, "_useCongestionControl", void 0), h(this, "_maxBitrate", void 0), h(this, "_useImageCapture", void 0), h(this, "_video", null), h(this, "_imageCapture", null), h(this, "_canvas", null), h(this, "_canvasCtx", null), h(this, "_frameReadTimeout", 0), h(this, "_lastFrame", null), this._sourceTrack = e, this._onFrame = t, this._useCongestionControl = n, this._maxBitrate = r, this._useImageCapture = "ImageCapture" in window && ImageCapture.prototype.grabFrame !== void 0 && "ImageBitmap" in window, (e.readyState !== "live" || !e.enabled || e.muted) && (this._useImageCapture = !1);
4965
4996
  }
@@ -5028,7 +5059,7 @@ var di = 2 ** 15 - 1, fi = 1, pi = 5, mi = 5, hi = class e {
5028
5059
  }
5029
5060
  _encode(e, t) {
5030
5061
  let n = e.data.buffer;
5031
- this._sendToWorker(zr.FRAME, {
5062
+ this._sendToWorker(Ur.FRAME, {
5032
5063
  width: e.width,
5033
5064
  height: e.height,
5034
5065
  imageData: n,
@@ -5045,7 +5076,7 @@ var di = 2 ** 15 - 1, fi = 1, pi = 5, mi = 5, hi = class e {
5045
5076
  let t = this._drawFrameData(this._lastFrame);
5046
5077
  this._encode(t, e);
5047
5078
  } else this._onFrame(null);
5048
- }, bi), this._getFrameBitmap().then((t) => {
5079
+ }, wi), this._getFrameBitmap().then((t) => {
5049
5080
  window.clearTimeout(this._frameReadTimeout), this._lastFrame?.close(), this._lastFrame = t;
5050
5081
  let n = this._drawFrameData(t);
5051
5082
  this._encode(n, e);
@@ -5055,7 +5086,7 @@ var di = 2 ** 15 - 1, fi = 1, pi = 5, mi = 5, hi = class e {
5055
5086
  this._useImageCapture ? this._requestFrameBitmap(e) : this._requestFrameVideo(e);
5056
5087
  }
5057
5088
  setBitrate(e, t, n) {
5058
- this._sendToWorker(zr.SET_BITRATE, {
5089
+ this._sendToWorker(Ur.SET_BITRATE, {
5059
5090
  bitrate: e,
5060
5091
  useCbr: t
5061
5092
  });
@@ -5066,7 +5097,7 @@ var di = 2 ** 15 - 1, fi = 1, pi = 5, mi = 5, hi = class e {
5066
5097
  destroy() {
5067
5098
  this._removeWorker(), this._removeStream(), this._removeDom(), this._debug.debug("LibVPxEncoder destroyed");
5068
5099
  }
5069
- }, Si = class extends Br {
5100
+ }, Ei = class extends Wr {
5070
5101
  constructor(e, t, n, r, i, a, o = z, s = null) {
5071
5102
  super(o, s), h(this, "_sourceTrack", void 0), h(this, "_trackProcessor", void 0), h(this, "_onFrame", void 0), h(this, "_useCongestionControl", void 0), h(this, "_maxBitrate", void 0), h(this, "_useCbr", void 0), h(this, "_frameRate", void 0), this._sourceTrack = e, this._onFrame = t, this._useCongestionControl = n, this._maxBitrate = r, this._useCbr = i, this._frameRate = a, this._trackProcessor = new MediaStreamTrackProcessor({ track: e });
5072
5103
  }
@@ -5094,10 +5125,10 @@ var di = 2 ** 15 - 1, fi = 1, pi = 5, mi = 5, hi = class e {
5094
5125
  }, [n]);
5095
5126
  }
5096
5127
  requestFrame(e = !1) {
5097
- this._sendToWorker(zr.FRAME, { keyFrame: e });
5128
+ this._sendToWorker(Ur.FRAME, { keyFrame: e });
5098
5129
  }
5099
5130
  setBitrate(e, t, n) {
5100
- this._sendToWorker(zr.SET_BITRATE, {
5131
+ this._sendToWorker(Ur.SET_BITRATE, {
5101
5132
  bitrate: e,
5102
5133
  useCbr: t,
5103
5134
  fps: n
@@ -5112,11 +5143,11 @@ var di = 2 ** 15 - 1, fi = 1, pi = 5, mi = 5, hi = class e {
5112
5143
  static isBrowserSupported() {
5113
5144
  return "VideoEncoder" in window && "Worker" in window && "EncodedVideoChunk" in window && "MediaStreamTrackProcessor" in window;
5114
5145
  }
5115
- }, Ci = 2100, wi = 600, Ti = 1.2, Ei = .8, Di = 2e3, Oi = 8e3, ki = 8e3, Ai = 16e3, ji = 4, Mi = 2e3, Ni = /* @__PURE__ */ function(e) {
5146
+ }, Di = 2100, Oi = 600, ki = 1.2, Ai = .8, ji = 2e3, Mi = 8e3, Ni = 8e3, Pi = 16e3, Fi = 4, Ii = 2e3, Li = /* @__PURE__ */ function(e) {
5116
5147
  return e[e.NONE = 0] = "NONE", e[e.UP = 1] = "UP", e[e.DOWN = 2] = "DOWN", e;
5117
- }(Ni || {}), Pi = class {
5148
+ }(Li || {}), Ri = class {
5118
5149
  constructor(e, t, n, r, i, a, o, s = z) {
5119
- h(this, "_onCongestion", void 0), h(this, "_ccEnabled", void 0), h(this, "_fastSharing", void 0), h(this, "_trendDelayThreshold", void 0), h(this, "_highDelayThreshold", void 0), h(this, "_targetFps", void 0), h(this, "_minBitrate", void 0), h(this, "_maxBitrate", void 0), h(this, "_targetBitrate", void 0), h(this, "_lastDown", void 0), h(this, "_lastUp", void 0), h(this, "_lastProbing", void 0), h(this, "_lastCheckDelay", void 0), h(this, "_upPenalty", 0), h(this, "_probing", void 0), h(this, "_delayAvgShort", -1), h(this, "_delayAvgLong", -1), h(this, "_minDelay", Number.MAX_VALUE), h(this, "_maxDelay", 0), h(this, "_largeDelayDuration", 0), h(this, "_lastFpsCalcMs", void 0), h(this, "_frames", 0), h(this, "_fps", 0), h(this, "_debug", void 0), this._onCongestion = e, this._ccEnabled = r, this._debug = s, this._minBitrate = t, this._maxBitrate = n, this._fastSharing = i, this._targetFps = o, a > 0 ? this._highDelayThreshold = a : this._highDelayThreshold = Ci, i && (this._highDelayThreshold = wi), this._trendDelayThreshold = Math.round(this._highDelayThreshold / 3), this._targetBitrate = this._maxBitrate, this._probing = !1;
5150
+ h(this, "_onCongestion", void 0), h(this, "_ccEnabled", void 0), h(this, "_fastSharing", void 0), h(this, "_trendDelayThreshold", void 0), h(this, "_highDelayThreshold", void 0), h(this, "_targetFps", void 0), h(this, "_minBitrate", void 0), h(this, "_maxBitrate", void 0), h(this, "_targetBitrate", void 0), h(this, "_lastDown", void 0), h(this, "_lastUp", void 0), h(this, "_lastProbing", void 0), h(this, "_lastCheckDelay", void 0), h(this, "_upPenalty", 0), h(this, "_probing", void 0), h(this, "_delayAvgShort", -1), h(this, "_delayAvgLong", -1), h(this, "_minDelay", Number.MAX_VALUE), h(this, "_maxDelay", 0), h(this, "_largeDelayDuration", 0), h(this, "_lastFpsCalcMs", void 0), h(this, "_frames", 0), h(this, "_fps", 0), h(this, "_debug", void 0), this._onCongestion = e, this._ccEnabled = r, this._debug = s, this._minBitrate = t, this._maxBitrate = n, this._fastSharing = i, this._targetFps = o, a > 0 ? this._highDelayThreshold = a : this._highDelayThreshold = Di, i && (this._highDelayThreshold = Oi), this._trendDelayThreshold = Math.round(this._highDelayThreshold / 3), this._targetBitrate = this._maxBitrate, this._probing = !1;
5120
5151
  let c = Date.now();
5121
5152
  this._lastDown = 0, this._lastUp = c, this._lastProbing = c, this._lastCheckDelay = 0, this._lastFpsCalcMs = 0;
5122
5153
  }
@@ -5126,27 +5157,27 @@ var di = 2 ** 15 - 1, fi = 1, pi = 5, mi = 5, hi = class e {
5126
5157
  let i = 0, a = this._delayAvgShort - this._delayAvgLong, o = Math.round(Math.abs(a) * 100 / this._delayAvgLong), s = a > 40 && o > 30 && this._delayAvgShort > this._trendDelayThreshold, c = this._delayAvgShort > this._highDelayThreshold;
5127
5158
  s || c ? i = 2 : Math.abs(a) < 40 && o < 10 && !c && (i = 1);
5128
5159
  let l = Math.round(this._targetBitrate / 1e3), u = n;
5129
- e % 20 == 0 && this._debug.debug(`#${e}: cc: delay=${t} short=${this._delayAvgShort} long=${this._delayAvgLong} delta=${a} percent=${o} -> ${Ni[i]} tr=${l} br=${n}`);
5160
+ e % 20 == 0 && this._debug.debug(`#${e}: cc: delay=${t} short=${this._delayAvgShort} long=${this._delayAvgLong} delta=${a} percent=${o} -> ${Li[i]} tr=${l} br=${n}`);
5130
5161
  let d = r - this._lastDown;
5131
- if (i === 2 && d > Di) {
5132
- this._probing && (this._upPenalty = Math.min(++this._upPenalty, ji), this._probing = !1);
5133
- let n = Ei * u * 1e3;
5134
- if (n >= this._targetBitrate && (n = this._targetBitrate * Ei), n = Math.max(n, this._minBitrate), n < this._targetBitrate) {
5135
- let r = Math.round(n / 1e3), s = Math.round(this._upPenalty * ki / 1e3);
5136
- this._debug.log(`#${e}: cc: delay=${t} short=${this._delayAvgShort} long=${this._delayAvgLong} delta=${a} percent=${o} -> ${Ni[i]}`), this._debug.log(`#${e}: cc: DOWN delay=${t} bitrate=${u} target=${l} -> newBitrate=${r} penalty=${s}s`), this._setBitrate(n, !0), this._targetBitrate = n;
5162
+ if (i === 2 && d > ji) {
5163
+ this._probing && (this._upPenalty = Math.min(++this._upPenalty, Fi), this._probing = !1);
5164
+ let n = Ai * u * 1e3;
5165
+ if (n >= this._targetBitrate && (n = this._targetBitrate * Ai), n = Math.max(n, this._minBitrate), n < this._targetBitrate) {
5166
+ let r = Math.round(n / 1e3), s = Math.round(this._upPenalty * Ni / 1e3);
5167
+ this._debug.log(`#${e}: cc: delay=${t} short=${this._delayAvgShort} long=${this._delayAvgLong} delta=${a} percent=${o} -> ${Li[i]}`), this._debug.log(`#${e}: cc: DOWN delay=${t} bitrate=${u} target=${l} -> newBitrate=${r} penalty=${s}s`), this._setBitrate(n, !0), this._targetBitrate = n;
5137
5168
  }
5138
5169
  this._lastDown = r;
5139
5170
  }
5140
- let f = r - this._lastUp, p = Oi + this._upPenalty * ki;
5171
+ let f = r - this._lastUp, p = Mi + this._upPenalty * Ni;
5141
5172
  if (i === 1 && f > p && d > p) {
5142
- let n = Math.min(this._targetBitrate * Ti, this._maxBitrate);
5173
+ let n = Math.min(this._targetBitrate * ki, this._maxBitrate);
5143
5174
  if (n > this._targetBitrate) {
5144
- let s = Math.round(n / 1e3), c = Math.round(this._targetBitrate / 1e3), l = Math.round(this._upPenalty * ki / 1e3);
5145
- this._debug.log(`#${e}: cc: delay=${t} short=${this._delayAvgShort} long=${this._delayAvgLong} delta=${a} percent=${o} -> ${Ni[i]}`), this._debug.log(`#${e}: cc: UP bitrate=${u} target=${c} -> newBitrate=${s} penalty=${l}s`), this._setBitrate(n, !1), this._targetBitrate = n, this._probing = !0, this._lastProbing = r, this._lastUp = r;
5175
+ let s = Math.round(n / 1e3), c = Math.round(this._targetBitrate / 1e3), l = Math.round(this._upPenalty * Ni / 1e3);
5176
+ this._debug.log(`#${e}: cc: delay=${t} short=${this._delayAvgShort} long=${this._delayAvgLong} delta=${a} percent=${o} -> ${Li[i]}`), this._debug.log(`#${e}: cc: UP bitrate=${u} target=${c} -> newBitrate=${s} penalty=${l}s`), this._setBitrate(n, !1), this._targetBitrate = n, this._probing = !0, this._lastProbing = r, this._lastUp = r;
5146
5177
  }
5147
5178
  }
5148
5179
  let m = r - this._lastProbing;
5149
- this._probing && m > Ai && (this._probing = !1);
5180
+ this._probing && m > Pi && (this._probing = !1);
5150
5181
  let ee = r - this._lastDown;
5151
5182
  this._upPenalty > 0 && ee > 3 * p && (this._debug.log(`#${e}: cc: UP reset penalty: oldPenalty=${this._upPenalty}`), this._upPenalty = 0);
5152
5183
  }
@@ -5157,7 +5188,7 @@ var di = 2 ** 15 - 1, fi = 1, pi = 5, mi = 5, hi = class e {
5157
5188
  }
5158
5189
  _calcDelay(e, t) {
5159
5190
  if (!(e <= 0)) {
5160
- if (this._delayAvgShort === -1 && (this._delayAvgShort = e, this._delayAvgLong = e), this._delayAvgShort = Math.round((this._delayAvgShort * 3 + e) / 4), this._delayAvgLong = Math.round((this._delayAvgLong * 23 + e) / 24), e > 0 && e < this._minDelay ? this._minDelay = e : e > this._maxDelay && (this._maxDelay = e), this._lastCheckDelay === 0 && (this._lastCheckDelay = t), e > Mi) {
5191
+ if (this._delayAvgShort === -1 && (this._delayAvgShort = e, this._delayAvgLong = e), this._delayAvgShort = Math.round((this._delayAvgShort * 3 + e) / 4), this._delayAvgLong = Math.round((this._delayAvgLong * 23 + e) / 24), e > 0 && e < this._minDelay ? this._minDelay = e : e > this._maxDelay && (this._maxDelay = e), this._lastCheckDelay === 0 && (this._lastCheckDelay = t), e > Ii) {
5161
5192
  let e = t - this._lastCheckDelay;
5162
5193
  this._largeDelayDuration += e;
5163
5194
  }
@@ -5186,7 +5217,7 @@ var di = 2 ** 15 - 1, fi = 1, pi = 5, mi = 5, hi = class e {
5186
5217
  this._fps === 0 ? this._fps = Math.round(r) : this._fps = Math.round((this._fps * 3 + r) / 4), this._frames = 0, this._fps !== n && this._debug.log(`cc: fps=${this._fps}`);
5187
5218
  }
5188
5219
  }
5189
- }, Fi = class {
5220
+ }, zi = class {
5190
5221
  constructor(e) {
5191
5222
  h(this, "_maxSize", void 0), h(this, "_size", 0), h(this, "_buffer", void 0), h(this, "_head", 0), h(this, "_tail", 0), this._maxSize = e, this._buffer = Array(e);
5192
5223
  }
@@ -5260,11 +5291,11 @@ var di = 2 ** 15 - 1, fi = 1, pi = 5, mi = 5, hi = class e {
5260
5291
  clear() {
5261
5292
  this._buffer.fill(void 0), this._size = 0, this._head = 0, this._tail = 0;
5262
5293
  }
5263
- }, Ii = 65536, Li = 50, Ri = 400, zi = 1e6, Bi = 3e5, Vi = 3e4, Hi = 2e3, Ui = 5, Wi = 0, Gi = class {
5294
+ }, Bi = 65536, Vi = 50, Hi = 400, Ui = 1e6, Wi = 3e5, Gi = 3e4, Ki = 2e3, qi = 5, Ji = 0, Yi = class {
5264
5295
  constructor(e, t, n, r, i = z, a = null) {
5265
- h(this, "_encoder", void 0), h(this, "_datachannel", void 0), h(this, "_signaling", void 0), h(this, "_fastSharing", void 0), h(this, "_destroyed", !1), h(this, "_needKeyframe", !0), h(this, "DATA_SIZE", void 0), h(this, "_congestionControl", void 0), h(this, "_frameNum", 0), h(this, "_width", void 0), h(this, "_height", void 0), h(this, "_feedback", new Fi(1024)), h(this, "_lastSentFrameSeq", 0), h(this, "_lastDeliveredFrameSeq", 0), h(this, "_lastFrameDelay", 0), h(this, "_lastFramerateReduced", Date.now()), h(this, "_lastSharingStat", Date.now()), h(this, "_congestionControlEnabled", void 0), h(this, "_queue", new yi()), h(this, "_fpsMeter", void 0), h(this, "_maxFrameDelay", void 0), h(this, "_debug", void 0), h(this, "_logger", void 0), this._debug = i, this._logger = a, this._debug.debug("ScreenCaptureSender started"), this.DATA_SIZE = N.consumerScreenDataChannelPacketSize - 11, this._datachannel = t, this._signaling = n, this._fastSharing = r, this._congestionControlEnabled = N.screenShareCongestionControl || this._fastSharing, this._width = e.getSettings().width, this._height = e.getSettings().height, this._maxFrameDelay = this._fastSharing ? N.screenShareCongestionControlThreshold : N.screenShareCongestionControlThreshold * 2;
5296
+ h(this, "_encoder", void 0), h(this, "_datachannel", void 0), h(this, "_signaling", void 0), h(this, "_fastSharing", void 0), h(this, "_destroyed", !1), h(this, "_needKeyframe", !0), h(this, "DATA_SIZE", void 0), h(this, "_congestionControl", void 0), h(this, "_frameNum", 0), h(this, "_width", void 0), h(this, "_height", void 0), h(this, "_feedback", new zi(1024)), h(this, "_lastSentFrameSeq", 0), h(this, "_lastDeliveredFrameSeq", 0), h(this, "_lastFrameDelay", 0), h(this, "_lastFramerateReduced", Date.now()), h(this, "_lastSharingStat", Date.now()), h(this, "_congestionControlEnabled", void 0), h(this, "_queue", new Ci()), h(this, "_fpsMeter", void 0), h(this, "_maxFrameDelay", void 0), h(this, "_debug", void 0), h(this, "_logger", void 0), this._debug = i, this._logger = a, this._debug.debug("ScreenCaptureSender started"), this.DATA_SIZE = N.consumerScreenDataChannelPacketSize - 11, this._datachannel = t, this._signaling = n, this._fastSharing = r, this._congestionControlEnabled = N.screenShareCongestionControl || this._fastSharing, this._width = e.getSettings().width, this._height = e.getSettings().height, this._maxFrameDelay = this._fastSharing ? N.screenShareCongestionControlThreshold : N.screenShareCongestionControlThreshold * 2;
5266
5297
  let o = N.getScreenFrameRate(this._fastSharing), { minBitrate: s, maxBitrate: c } = this._calcMinMaxBitrate(this._width, this._height), l = this._onCongestionCallback.bind(this);
5267
- this._debug.log(`ScreenCaptureSender: CongestionControl: enabled=${this._congestionControlEnabled} minBitrate=${Math.round(s / 1e3)}k maxBitrate=${Math.round(c / 1e3)}k delayThreshold=${N.screenShareCongestionControlThreshold}`), this._congestionControl = new Pi(l, s, c, this._congestionControlEnabled, this._fastSharing, N.screenShareCongestionControlThreshold, o, this._debug);
5298
+ this._debug.log(`ScreenCaptureSender: CongestionControl: enabled=${this._congestionControlEnabled} minBitrate=${Math.round(s / 1e3)}k maxBitrate=${Math.round(c / 1e3)}k delayThreshold=${N.screenShareCongestionControlThreshold}`), this._congestionControl = new Ri(l, s, c, this._congestionControlEnabled, this._fastSharing, N.screenShareCongestionControlThreshold, o, this._debug);
5268
5299
  let u = (e, t) => {
5269
5300
  if (this._destroyed) return;
5270
5301
  if (!e) {
@@ -5275,23 +5306,23 @@ var di = 2 ** 15 - 1, fi = 1, pi = 5, mi = 5, hi = class e {
5275
5306
  let n = this._sliceFrame(e);
5276
5307
  this._queue.merge(n), this._handleQueue(), this._sendSharingStat();
5277
5308
  };
5278
- if (Si.isBrowserSupported()) {
5309
+ if (Ei.isBrowserSupported()) {
5279
5310
  let t = this._fastSharing;
5280
- this._encoder = new Si(e, u, this._congestionControlEnabled, c, t, o, this._debug, this._logger);
5281
- } else this._encoder = new xi(e, u, this._congestionControlEnabled, c, this._debug, this._logger);
5311
+ this._encoder = new Ei(e, u, this._congestionControlEnabled, c, t, o, this._debug, this._logger);
5312
+ } else this._encoder = new Ti(e, u, this._congestionControlEnabled, c, this._debug, this._logger);
5282
5313
  this._datachannel.onmessage = (e) => {
5283
- ci(e.data) && (this._debug.debug(`[${this._datachannel.label}] Requested keyframe`), this._needKeyframe = !0);
5284
- let t = li(e.data);
5314
+ fi(e.data) && (this._debug.debug(`[${this._datachannel.label}] Requested keyframe`), this._needKeyframe = !0);
5315
+ let t = pi(e.data);
5285
5316
  t !== null && this._checkCcFeedback(t);
5286
- }, this._encoder.init().then(() => this._handleQueue()).catch((e) => this._debug.warn("ScreenCaptureSender init failed", e)), this._fpsMeter = new Ur((e) => this._debug.log(`[ScreenCaptureSender] fps: ${e}`), 5e3);
5317
+ }, this._encoder.init().then(() => this._handleQueue()).catch((e) => this._debug.warn("ScreenCaptureSender init failed", e)), this._fpsMeter = new qr((e) => this._debug.log(`[ScreenCaptureSender] fps: ${e}`), 5e3);
5287
5318
  }
5288
5319
  _handleQueue() {
5289
5320
  if (this._destroyed) return;
5290
5321
  let e = this._queue.shift();
5291
5322
  if (!e) {
5292
- if ((this._lastSentFrameSeq - this._lastDeliveredFrameSeq + Ii) % Ii > Ui && this._lastFrameDelay > this._maxFrameDelay) {
5323
+ if ((this._lastSentFrameSeq - this._lastDeliveredFrameSeq + Bi) % Bi > qi && this._lastFrameDelay > this._maxFrameDelay) {
5293
5324
  let e = Date.now();
5294
- e - this._lastFramerateReduced > Hi && (this._lastFramerateReduced = e, this._debug.debug(`[ScreenCaptureSender] reduce framerate: delay=${this._lastFrameDelay} maxDelay=${this._maxFrameDelay}`));
5325
+ e - this._lastFramerateReduced > Ki && (this._lastFramerateReduced = e, this._debug.debug(`[ScreenCaptureSender] reduce framerate: delay=${this._lastFrameDelay} maxDelay=${this._maxFrameDelay}`));
5295
5326
  } else this._requestFrame();
5296
5327
  return;
5297
5328
  }
@@ -5317,7 +5348,7 @@ var di = 2 ** 15 - 1, fi = 1, pi = 5, mi = 5, hi = class e {
5317
5348
  this._destroyed || (this._encoder.requestFrame(this._needKeyframe), this._needKeyframe = !1);
5318
5349
  }
5319
5350
  _sliceFrame(e) {
5320
- let t = e.type === "key", n = e.data.byteLength, r = new yi();
5351
+ let t = e.type === "key", n = e.data.byteLength, r = new Ci();
5321
5352
  for (let i = 0; i < n; i += this.DATA_SIZE) {
5322
5353
  let a = e.data.slice(i, i + this.DATA_SIZE), o = i === 0, s = n <= i + a.byteLength, c = this._wrapHeader(e.timestamp, o, s, t, a);
5323
5354
  r.push({
@@ -5333,11 +5364,11 @@ var di = 2 ** 15 - 1, fi = 1, pi = 5, mi = 5, hi = class e {
5333
5364
  return r;
5334
5365
  }
5335
5366
  _wrapHeader(e, t, n, r, i) {
5336
- let a = oi(e, t, n, r, Wi, this._encoder.isVP9(), i), o = {
5337
- sequence: Wi,
5367
+ let a = ui(e, t, n, r, Ji, this._encoder.isVP9(), i), o = {
5368
+ sequence: Ji,
5338
5369
  data: a
5339
5370
  };
5340
- return Wi = (Wi + 1) % Ii, o;
5371
+ return Ji = (Ji + 1) % Bi, o;
5341
5372
  }
5342
5373
  _stopPacket() {
5343
5374
  return this._wrapHeader(Date.now(), !1, !1, !1, null).data;
@@ -5354,7 +5385,7 @@ var di = 2 ** 15 - 1, fi = 1, pi = 5, mi = 5, hi = class e {
5354
5385
  this._queue.clear(), this._fpsMeter.destroy(), this._datachannel.onmessage = null, this._feedback.clear(), this._datachannel.readyState === "open" && this._datachannel.send(this._stopPacket()), this._destroyed = !0, this._encoder.destroy(), this._debug.debug("ScreenCaptureSender destroyed");
5355
5386
  }
5356
5387
  static isBrowserSupported() {
5357
- return Si.isBrowserSupported() || xi.isBrowserSupported();
5388
+ return Ei.isBrowserSupported() || Ti.isBrowserSupported();
5358
5389
  }
5359
5390
  _onCongestionCallback(e, t, n) {
5360
5391
  this._encoder.setBitrate(e, t, n);
@@ -5367,8 +5398,8 @@ var di = 2 ** 15 - 1, fi = 1, pi = 5, mi = 5, hi = class e {
5367
5398
  (e === void 0 || e < 640) && (e = 640), (t === void 0 || t < 360) && (t = 360);
5368
5399
  let n = e * t / 256;
5369
5400
  return {
5370
- minBitrate: Math.max(Bi, Math.min(zi, Math.round(n * Li))),
5371
- maxBitrate: Math.round(n * Ri)
5401
+ minBitrate: Math.max(Wi, Math.min(Ui, Math.round(n * Vi))),
5402
+ maxBitrate: Math.round(n * Hi)
5372
5403
  };
5373
5404
  }
5374
5405
  _checkCcFeedback(e) {
@@ -5382,19 +5413,19 @@ var di = 2 ** 15 - 1, fi = 1, pi = 5, mi = 5, hi = class e {
5382
5413
  }
5383
5414
  _sendSharingStat() {
5384
5415
  let e = Date.now();
5385
- if (e - this._lastSharingStat > Vi) {
5416
+ if (e - this._lastSharingStat > Gi) {
5386
5417
  let t = this._congestionControl.getStat();
5387
5418
  t !== null && (this._debug.debug(`cc: send stats: ${JSON.stringify(t)}`), this._signaling.reportSharingStat(t)), this._lastSharingStat = e;
5388
5419
  }
5389
5420
  }
5390
- }, Ki = 90, qi = 4294967295, Ji = class e extends yr {
5421
+ }, Xi = 90, Zi = 4294967295, Qi = class e extends Cr {
5391
5422
  constructor(e, t, n, r = z, i = null, a = null, o = null) {
5392
- super(e, t), h(this, "_producerNotification", null), h(this, "_producerCommand", null), h(this, "_producerScreen", null), h(this, "_consumerScreen", null), h(this, "_asr", null), h(this, "_animojiDataChannel", null), h(this, "_animojiReceiver", null), h(this, "_animojiSender", null), h(this, "_isOpen", !1), h(this, "_observer", !1), h(this, "_reconnectionPrevented", !1), h(this, "_statInterval", null), h(this, "_settingsInterval", null), h(this, "_monitorRtpShareInterval", null), h(this, "_statBytes", {}), h(this, "_ssrcMap", {}), h(this, "_ssrcMapUpdated", !1), h(this, "_perfStatReporter", void 0), h(this, "_producerOfferIsProcessing", !1), h(this, "_producerNextOffer", null), h(this, "_producerNextSessionId", null), h(this, "_lastStat", null), h(this, "_serverSettings", void 0), h(this, "_prevConsumerSettings", {}), h(this, "_prevConsumerFastSharingSettings", {}), h(this, "_asrTrack", null), h(this, "_captureSender", null), h(this, "_captureReceiver", null), h(this, "_participantIdRegistry", null), h(this, "_disabledSenders", /* @__PURE__ */ new Set()), h(this, "_rtpReceiversByStreamId", {}), h(this, "_producerSessionId", ""), h(this, "_newAudioShareTrack", null), h(this, "_simulcastInfo", null), h(this, "_debug", void 0), h(this, "_logger", void 0), h(this, "_statAggregator", void 0), h(this, "_codecStatsAggregator", void 0), this._debug = r, this._logger = i, this._statAggregator = a, this._codecStatsAggregator = o, this.subscribe(this._signaling, G.NOTIFICATION, this._onSignalingNotification.bind(this)), this.subscribe(this._mediaSource, qt.TRACK_REPLACED, this._onReplacedTrack.bind(this)), this.subscribe(this._mediaSource, qt.SOURCE_CHANGED, this._onSourcesChanged.bind(this)), this.subscribe(this._mediaSource, qt.SCREEN_STATUS, this._onScreenSharingStatus.bind(this)), this._createPerfStatsReporter(), this._serverSettings = n, this._debug.debug("ServerTransport: Created");
5423
+ super(e, t), h(this, "_producerNotification", null), h(this, "_producerCommand", null), h(this, "_producerScreen", null), h(this, "_consumerScreen", null), h(this, "_asr", null), h(this, "_animojiDataChannel", null), h(this, "_animojiReceiver", null), h(this, "_animojiSender", null), h(this, "_isOpen", !1), h(this, "_observer", !1), h(this, "_reconnectionPrevented", !1), h(this, "_statInterval", null), h(this, "_settingsInterval", null), h(this, "_monitorRtpShareInterval", null), h(this, "_statBytes", {}), h(this, "_ssrcMap", {}), h(this, "_ssrcMapUpdated", !1), h(this, "_perfStatReporter", void 0), h(this, "_producerOfferIsProcessing", !1), h(this, "_producerNextOffer", null), h(this, "_producerNextSessionId", null), h(this, "_lastStat", null), h(this, "_serverSettings", void 0), h(this, "_prevConsumerSettings", {}), h(this, "_prevConsumerFastSharingSettings", {}), h(this, "_asrTrack", null), h(this, "_captureSender", null), h(this, "_captureReceiver", null), h(this, "_participantIdRegistry", null), h(this, "_disabledSenders", /* @__PURE__ */ new Set()), h(this, "_rtpReceiversByStreamId", {}), h(this, "_producerSessionId", ""), h(this, "_newAudioShareTrack", null), h(this, "_simulcastInfo", null), h(this, "_debug", void 0), h(this, "_logger", void 0), h(this, "_statAggregator", void 0), h(this, "_codecStatsAggregator", void 0), this._debug = r, this._logger = i, this._statAggregator = a, this._codecStatsAggregator = o, this.subscribe(this._signaling, W.NOTIFICATION, this._onSignalingNotification.bind(this)), this.subscribe(this._mediaSource, qt.TRACK_REPLACED, this._onReplacedTrack.bind(this)), this.subscribe(this._mediaSource, qt.SOURCE_CHANGED, this._onSourcesChanged.bind(this)), this.subscribe(this._mediaSource, qt.SCREEN_STATUS, this._onScreenSharingStatus.bind(this)), this._createPerfStatsReporter(), this._serverSettings = n, this._debug.debug("ServerTransport: Created");
5393
5424
  }
5394
5425
  updateStatisticsInterval() {
5395
5426
  this._stopStatInterval();
5396
5427
  let e = this.getState();
5397
- e !== W.IDLE && e !== W.CLOSED && e !== W.FAILED && this._startStatInterval();
5428
+ e !== K.IDLE && e !== K.CLOSED && e !== K.FAILED && this._startStatInterval();
5398
5429
  }
5399
5430
  open(e = !1) {
5400
5431
  if (this._isOpen) {
@@ -5404,7 +5435,7 @@ var di = 2 ** 15 - 1, fi = 1, pi = 5, mi = 5, hi = class e {
5404
5435
  this._isOpen = !0, this._observer = e, this._openConnection();
5405
5436
  }
5406
5437
  close(e) {
5407
- this._isOpen && (this._isOpen = !1, this._closeConnection(), this.unsubscribe(), e ? (this._debug.error("ServerTransport: Closed", e), this._setState(W.FAILED)) : (this._debug.debug("ServerTransport: Closed"), this._setState(W.CLOSED)));
5438
+ this._isOpen && (this._isOpen = !1, this._closeConnection(), this.unsubscribe(), e ? (this._debug.error("ServerTransport: Closed", e), this._setState(K.FAILED)) : (this._debug.debug("ServerTransport: Closed"), this._setState(K.CLOSED)));
5408
5439
  }
5409
5440
  removeParticipant(e) {
5410
5441
  this._captureReceiver?.close(e);
@@ -5416,7 +5447,7 @@ var di = 2 ** 15 - 1, fi = 1, pi = 5, mi = 5, hi = class e {
5416
5447
  this._reconnectionPrevented = !1;
5417
5448
  }
5418
5449
  updateSettings(e) {
5419
- gr(e, this._serverSettings) || (this._serverSettings = e, this._applyConsumerSettings());
5450
+ br(e, this._serverSettings) || (this._serverSettings = e, this._applyConsumerSettings());
5420
5451
  }
5421
5452
  setAnimojiTransport(e, t) {
5422
5453
  if (N.vmoji && (this._animojiReceiver = e, this._animojiSender = t, this._participantIdRegistry && e.setParticipantIdRegistry(this._participantIdRegistry), this._animojiDataChannel)) {
@@ -5428,7 +5459,7 @@ var di = 2 ** 15 - 1, fi = 1, pi = 5, mi = 5, hi = class e {
5428
5459
  N.simulcast && await this._changeSimulcastInfo(!0, !1);
5429
5460
  }
5430
5461
  _createPerfStatsReporter() {
5431
- this._perfStatReporter?.destroy(), this._perfStatReporter = new $i(this, this._signaling, this._statAggregator, !1, this._debug);
5462
+ this._perfStatReporter?.destroy(), this._perfStatReporter = new ra(this, this._signaling, this._statAggregator, !1, this._debug);
5432
5463
  }
5433
5464
  _closeConnection() {
5434
5465
  this._stopStatInterval(), this._stopSettingsInterval(), this._stopMonitorRtpShareInterval(), this._removeAsrTrack(), this._removeCaptureSender(), this._removeCaptureReceiver(), this._simulcastInfo = null, this._pc && (this._rtpReceiversByStreamId = {}, this._disabledSenders.forEach((e) => e.track?.stop()), this._disabledSenders.clear(), this._pc.ontrack = null, this._pc.onconnectionstatechange = null, this._pc.onsignalingstatechange = null, this._participantIdRegistry = null, e._closeDataChannel(this._producerNotification), e._closeDataChannel(this._producerCommand), e._closeDataChannel(this._producerScreen), e._closeDataChannel(this._consumerScreen), e._closeDataChannel(this._asr), e._closeDataChannel(this._animojiDataChannel), this._pc.close(), this._pc = null, this._producerOfferIsProcessing = !1, this._producerNextOffer = null), this._triggerEvent(J.PEER_CONNECTION_CLOSED);
@@ -5457,17 +5488,17 @@ var di = 2 ** 15 - 1, fi = 1, pi = 5, mi = 5, hi = class e {
5457
5488
  }
5458
5489
  this._pc.ontrack = this._onAddTrack.bind(this, this._pc), this._pc.onconnectionstatechange = M.debounce((e) => {
5459
5490
  this._pc && this._onConnectionStateChange(this._pc, e);
5460
- }, 500), this._pc.onsignalingstatechange = this._onSignalingStateChange.bind(this, this._pc), this._participantIdRegistry = new Rr(this._debug), this._signaling.setParticipantIdRegistry(this._participantIdRegistry), this._createDataChannel(this._pc, dr.producerNotification, (e) => {
5491
+ }, 500), this._pc.onsignalingstatechange = this._onSignalingStateChange.bind(this, this._pc), this._participantIdRegistry = new Hr(this._debug), this._signaling.setParticipantIdRegistry(this._participantIdRegistry), this._createDataChannel(this._pc, hr.producerNotification, (e) => {
5461
5492
  this._producerNotification = e, this._producerNotification.binaryType = "arraybuffer", this._signaling.setProducerNotificationDataChannel(e);
5462
- }), this._signaling.useCommandDataChannel(!0), this._createDataChannel(this._pc, dr.producerCommand, (e) => {
5493
+ }), this._signaling.useCommandDataChannel(!0), this._createDataChannel(this._pc, hr.producerCommand, (e) => {
5463
5494
  this._producerCommand = e, this._signaling.setProducerCommandDataChannel(e);
5464
- }), this._createDataChannel(this._pc, dr.producerScreenShare, (e) => {
5495
+ }), this._createDataChannel(this._pc, hr.producerScreenShare, (e) => {
5465
5496
  this._producerScreen = e, this._producerScreen.binaryType = "arraybuffer", this._createCaptureReceiver();
5466
- }), N.asrDataChannel && this._createDataChannel(this._pc, dr.asr, (e) => {
5467
- this._asr = e, this._asr.binaryType = "arraybuffer", this._removeAsrTrack(), this._asrTrack = new Fr(e, this._participantIdRegistry, (e) => {
5497
+ }), N.asrDataChannel && this._createDataChannel(this._pc, hr.asr, (e) => {
5498
+ this._asr = e, this._asr.binaryType = "arraybuffer", this._removeAsrTrack(), this._asrTrack = new zr(e, this._participantIdRegistry, (e) => {
5468
5499
  this._onAsrTranscription(e);
5469
5500
  }, this._debug);
5470
- }), N.vmoji && this._createDataChannel(this._pc, dr.animoji, (e) => {
5501
+ }), N.vmoji && this._createDataChannel(this._pc, hr.animoji, (e) => {
5471
5502
  this._animojiDataChannel = e, this._animojiDataChannel.binaryType = "arraybuffer", this._animojiReceiver?.setDataChannel(e), this._animojiReceiver?.setParticipantIdRegistry(this._participantIdRegistry), this._animojiSender?.setDataChannel(e), this._animojiSender?.setProtocolVersion(N.vmojiOptions.protocolVersion || 1);
5472
5503
  }), this._newAudioShareTrack = this._mediaSource.getAudioShareTrack();
5473
5504
  try {
@@ -5476,17 +5507,17 @@ var di = 2 ** 15 - 1, fi = 1, pi = 5, mi = 5, hi = class e {
5476
5507
  this._debug.error("ServerTransport: Unable to add media source tracks", e), this._logger?.log(E.ERROR, "addTrack-single"), this.close(e);
5477
5508
  return;
5478
5509
  }
5479
- this._createDataChannel(this._pc, dr.consumerScreenShare, (e) => {
5510
+ this._createDataChannel(this._pc, hr.consumerScreenShare, (e) => {
5480
5511
  this._consumerScreen = e, this._consumerScreen.binaryType = "arraybuffer";
5481
5512
  let t = this._mediaSource.getScreenTrack();
5482
5513
  t && (!N.consumerFastScreenShare || !this._mediaSource.getMediaSettings().isFastScreenSharingEnabled) && this._createCaptureSender(t);
5483
- }), e || this._allocateConsumer(), this._setState(W.OPENED), this._startStatInterval(), this._startSettingsInterval(), this._startMonitorRtpShareInterval();
5514
+ }), e || this._allocateConsumer(), this._setState(K.OPENED), this._startStatInterval(), this._startSettingsInterval(), this._startMonitorRtpShareInterval();
5484
5515
  }
5485
5516
  _removeAsrTrack() {
5486
5517
  this._asrTrack?.destroy(), this._asrTrack = null;
5487
5518
  }
5488
5519
  _reconnect() {
5489
- this.getState() !== W.OPENED && (this._setState(W.RECONNECTING), this._closeConnection(), this._openConnection(!0));
5520
+ this.getState() !== K.OPENED && (this._setState(K.RECONNECTING), this._closeConnection(), this._openConnection(!0));
5490
5521
  }
5491
5522
  _signalActiveParticipants(e) {
5492
5523
  this._triggerEvent(J.SIGNALLED_ACTIVE_PARTICIPANTS, e);
@@ -5502,19 +5533,19 @@ var di = 2 ** 15 - 1, fi = 1, pi = 5, mi = 5, hi = class e {
5502
5533
  }
5503
5534
  _updateSSRCMap(e) {
5504
5535
  e && e.sdp.split("\n").forEach((e) => {
5505
- let t = `a=ssrc:([0-9]+) label:(audio|video)-((?:[ug]?[\\d]+)|(?:mix)|(?:${Nr.PARTICIPANT_AGNOSTIC_TRACK_PREFIX}-[0-9]+)|(?:${Nr.TRANSPARENT_AUDIO_TRACK_PREFIX}-[0-9]+))`, n = new RegExp(t).exec(e);
5536
+ let t = `a=ssrc:([0-9]+) label:(audio|video)-((?:[ug]?[\\d]+)|(?:mix)|(?:${Lr.PARTICIPANT_AGNOSTIC_TRACK_PREFIX}-[0-9]+)|(?:${Lr.TRANSPARENT_AUDIO_TRACK_PREFIX}-[0-9]+))`, n = new RegExp(t).exec(e);
5506
5537
  n && (this._ssrcMap[n[1]] = n[3], this._ssrcMapUpdated = !0);
5507
5538
  });
5508
5539
  }
5509
5540
  _createCaptureSender(e) {
5510
5541
  let t = this._mediaSource.getMediaSettings();
5511
- !e || !this._consumerScreen || !t.isScreenSharingEnabled || (this._captureSender && this._removeCaptureSender(), this._captureSender = new Gi(e, this._consumerScreen, this._signaling, t.isFastScreenSharingEnabled, this._debug, this._logger));
5542
+ !e || !this._consumerScreen || !t.isScreenSharingEnabled || (this._captureSender && this._removeCaptureSender(), this._captureSender = new Yi(e, this._consumerScreen, this._signaling, t.isFastScreenSharingEnabled, this._debug, this._logger));
5512
5543
  }
5513
5544
  _removeCaptureSender() {
5514
5545
  this._captureSender?.destroy(), this._captureSender = null;
5515
5546
  }
5516
5547
  _createCaptureReceiver() {
5517
- this._producerScreen && (this._captureReceiver && this._removeCaptureReceiver(), this._captureReceiver = new _i(this._producerScreen, this._participantIdRegistry, (e, t) => {
5548
+ this._producerScreen && (this._captureReceiver && this._removeCaptureReceiver(), this._captureReceiver = new xi(this._producerScreen, this._participantIdRegistry, (e, t) => {
5518
5549
  this._triggerEvent(J.REMOTE_STREAM_SECOND, e, t);
5519
5550
  }, (e) => {
5520
5551
  this._triggerEvent(J.REMOTE_STREAM_SECOND, e, null);
@@ -5624,7 +5655,7 @@ var di = 2 ** 15 - 1, fi = 1, pi = 5, mi = 5, hi = class e {
5624
5655
  _detectStaleTracks(e) {
5625
5656
  let t = e.rtps.find((e) => e.type === "inbound-rtp" && e.kind === "audio" && this._ssrcMap[e.ssrc] === "mix");
5626
5657
  if (!t) return;
5627
- let n = Nr.AUDIO_MIX, r = this._statBytes[n], i = !1;
5658
+ let n = Lr.AUDIO_MIX, r = this._statBytes[n], i = !1;
5628
5659
  if (r) {
5629
5660
  let e = t.bytesReceived - r.bytesReceived;
5630
5661
  e >= 0 && e <= 5 && (i = !0), r.stalled !== i && this._triggerEvent(J.AUDIO_MIX_STALL, i);
@@ -5637,7 +5668,7 @@ var di = 2 ** 15 - 1, fi = 1, pi = 5, mi = 5, hi = class e {
5637
5668
  _allocateConsumer() {
5638
5669
  if (!this._signaling.ready) return;
5639
5670
  let e = {
5640
- estimatedPerformanceIndex: $i.getEstimatedPerformanceIndex(),
5671
+ estimatedPerformanceIndex: ra.getEstimatedPerformanceIndex(),
5641
5672
  audioMix: !0,
5642
5673
  consumerUpdate: !0,
5643
5674
  producerNotificationDataChannelVersion: 8,
@@ -5778,22 +5809,22 @@ var di = 2 ** 15 - 1, fi = 1, pi = 5, mi = 5, hi = class e {
5778
5809
  }
5779
5810
  async _onSignalingNotification(e) {
5780
5811
  if (this._isOpen) switch (e.notification) {
5781
- case K.PRODUCER_UPDATED:
5812
+ case G.PRODUCER_UPDATED:
5782
5813
  await this._onProducerUpdated(e);
5783
5814
  break;
5784
- case K.REALLOC_CON:
5815
+ case G.REALLOC_CON:
5785
5816
  this._reconnect();
5786
5817
  break;
5787
- case K.AUDIO_ACTIVITY:
5818
+ case G.AUDIO_ACTIVITY:
5788
5819
  this._signalActiveParticipants(e.activeParticipants);
5789
5820
  break;
5790
- case K.SPEAKER_CHANGED:
5821
+ case G.SPEAKER_CHANGED:
5791
5822
  this._signalSpeakerChanged(e.speaker);
5792
5823
  break;
5793
- case K.STALLED_ACTIVITY:
5824
+ case G.STALLED_ACTIVITY:
5794
5825
  this._signalStalledParticipants(e.stalledParticipants);
5795
5826
  break;
5796
- case K.NETWORK_STATUS:
5827
+ case G.NETWORK_STATUS:
5797
5828
  this._signalNetworkStatus(e.statuses);
5798
5829
  break;
5799
5830
  }
@@ -5821,13 +5852,13 @@ var di = 2 ** 15 - 1, fi = 1, pi = 5, mi = 5, hi = class e {
5821
5852
  break;
5822
5853
  case "connecting":
5823
5854
  let t = this.getState();
5824
- t === W.IDLE || t === W.OPENED ? this._setState(W.CONNECTING) : e.iceConnectionState === "checking" && this._setState(W.RECONNECTING);
5855
+ t === K.IDLE || t === K.OPENED ? this._setState(K.CONNECTING) : e.iceConnectionState === "checking" && this._setState(K.RECONNECTING);
5825
5856
  break;
5826
5857
  case "disconnected":
5827
- this._reconnectionPrevented ? this.close(/* @__PURE__ */ Error("Ice connection disconnected")) : this._setState(W.RECONNECTING);
5858
+ this._reconnectionPrevented ? this.close(/* @__PURE__ */ Error("Ice connection disconnected")) : this._setState(K.RECONNECTING);
5828
5859
  break;
5829
5860
  case "connected":
5830
- this._setState(W.CONNECTED), M.getPeerConnectionHostInfo(e).then((e) => {
5861
+ this._setState(K.CONNECTED), M.getPeerConnectionHostInfo(e).then((e) => {
5831
5862
  e?.local && (this._logger?.log(E.ICE_CONNECTION_TYPE, e.local.type), this._debug.debug("Selected ICE candidates", e));
5832
5863
  });
5833
5864
  break;
@@ -5863,7 +5894,7 @@ var di = 2 ** 15 - 1, fi = 1, pi = 5, mi = 5, hi = class e {
5863
5894
  if (!r || !r.length) return this._debug.log(`Cannot get stream waiting time, ${e} receiver has no synchronization sources`), 0;
5864
5895
  let i = r[0].rtpTimestamp;
5865
5896
  if (!Number.isInteger(i)) return this._logger?.log(E.PAT_WAITING_TIME_ERROR, "timestampNotInteger"), this._debug.error(`Cannot get stream waiting time, ${e} receiver's RTP timestamp is not an integer: ${i}`), 0;
5866
- let a = t - i & qi, o = Math.ceil(a / Ki);
5897
+ let a = t - i & Zi, o = Math.ceil(a / Xi);
5867
5898
  return Math.min(100, Math.max(0, o));
5868
5899
  }
5869
5900
  async _changeSimulcastInfo(e, t) {
@@ -5892,7 +5923,7 @@ var di = 2 ** 15 - 1, fi = 1, pi = 5, mi = 5, hi = class e {
5892
5923
  }
5893
5924
  }
5894
5925
  async _monitorRtpShare() {
5895
- let e = Lr.getInstance().value;
5926
+ let e = Vr.getInstance().value;
5896
5927
  if (!this._mediaSource.getMediaSettings().isFastScreenSharingEnabled || !N.consumerFastScreenShare || e < .6) return;
5897
5928
  let t = this._pc?.getSenders().find((e) => e.track?.kind === A.video && e.track?.contentHint === "motion");
5898
5929
  t && (await t.getStats()).forEach((e) => {
@@ -5923,9 +5954,9 @@ var di = 2 ** 15 - 1, fi = 1, pi = 5, mi = 5, hi = class e {
5923
5954
  }
5924
5955
  }, J = /* @__PURE__ */ function(e) {
5925
5956
  return e.REMOTE_TRACK_ADDED = "REMOTE_TRACK_ADDED", e.REMOTE_TRACK_REMOVED = "REMOTE_TRACK_REMOVED", e.REMOTE_STREAM_SECOND = "REMOTE_STREAM_SECOND", e.AUDIO_MIX_STALL = "AUDIO_MIX_STALL", e.REMOTE_DATA_STATS = "REMOTE_DATA_STATS", e.STATE_CHANGED = "STATE_CHANGED", e.LOCAL_STATE_CHANGED = "LOCAL_STATE_CHANGED", e.SIGNALLED_ACTIVE_PARTICIPANTS = "SIGNALLED_ACTIVE_PARTICIPANTS", e.SIGNALLED_SPEAKER_CHANGED = "SIGNALLED_SPEAKER_CHANGED", e.SIGNALLED_STALLED_PARTICIPANTS = "SIGNALLED_STALLED_PARTICIPANTS", e.TOPOLOGY_CHANGED = "TOPOLOGY_CHANGED", e.NETWORK_STATUS = "NETWORK_STATUS", e.PEER_CONNECTION_CLOSED = "PEER_CONNECTION_CLOSED", e.ASR_TRANSCRIPTION = "ASR_TRANSCRIPTION", e.ANIMOJI_STREAM = "ANIMOJI_STREAM", e.ANIMOJI_ERROR = "ANIMOJI_ERROR", e.SCREEN_SHARING_STAT = "SCREEN_SHARING_STAT", e;
5926
- }({}), Yi = class extends g {
5957
+ }({}), $i = class extends g {
5927
5958
  constructor(e, t, n, r, i = z, a = null, o = null, s = null) {
5928
- super(), h(this, "_signaling", void 0), h(this, "_mediaSource", void 0), h(this, "_topology", void 0), h(this, "_allocated", []), h(this, "_opened", []), h(this, "_directTransport", null), h(this, "_serverTransport", null), h(this, "_serverSettings", void 0), h(this, "_dtListeners", []), h(this, "_stListeners", []), h(this, "_states", {}), h(this, "_localState", W.IDLE), h(this, "_animojiReceiver", null), h(this, "_animojiSender", null), h(this, "_debug", void 0), h(this, "_logger", void 0), h(this, "_statAggregator", void 0), h(this, "_codecStatsAggregator", void 0), this._signaling = t, this._mediaSource = n, this._topology = e, this._serverSettings = r, this._debug = i, this._logger = a, this._statAggregator = o, this._codecStatsAggregator = s, this.subscribe(this._signaling, G.NOTIFICATION, this._onSignalingNotification.bind(this)), this.subscribe(this._mediaSource, qt.ANIMOJI_STATUS, this._onAnimojiStatus.bind(this)), this.subscribe(this._mediaSource, qt.SOURCE_CHANGED, this._onSourceChanged.bind(this)), this._createAnimojiTransport(), e === q.SERVER && (this._serverTransport = this._createServerTransport());
5959
+ super(), h(this, "_signaling", void 0), h(this, "_mediaSource", void 0), h(this, "_topology", void 0), h(this, "_allocated", []), h(this, "_opened", []), h(this, "_directTransport", null), h(this, "_serverTransport", null), h(this, "_serverSettings", void 0), h(this, "_dtListeners", []), h(this, "_stListeners", []), h(this, "_states", {}), h(this, "_localState", K.IDLE), h(this, "_animojiReceiver", null), h(this, "_animojiSender", null), h(this, "_debug", void 0), h(this, "_logger", void 0), h(this, "_statAggregator", void 0), h(this, "_codecStatsAggregator", void 0), this._signaling = t, this._mediaSource = n, this._topology = e, this._serverSettings = r, this._debug = i, this._logger = a, this._statAggregator = o, this._codecStatsAggregator = s, this.subscribe(this._signaling, W.NOTIFICATION, this._onSignalingNotification.bind(this)), this.subscribe(this._mediaSource, qt.ANIMOJI_STATUS, this._onAnimojiStatus.bind(this)), this.subscribe(this._mediaSource, qt.SOURCE_CHANGED, this._onSourceChanged.bind(this)), this._createAnimojiTransport(), e === q.SERVER && (this._serverTransport = this._createServerTransport());
5929
5960
  }
5930
5961
  updateSettings(e) {
5931
5962
  this._debug.log("Update transport settings", e), this._serverSettings = e, this._directTransport && this._directTransport.updateSettings(e), this._serverTransport && this._serverTransport.updateSettings(e);
@@ -5958,7 +5989,7 @@ var di = 2 ** 15 - 1, fi = 1, pi = 5, mi = 5, hi = class e {
5958
5989
  }
5959
5990
  close(e) {
5960
5991
  let t = this._allocated.indexOf(e), n = this._opened.indexOf(e);
5961
- t < 0 && this._debug.warn(`The participant [${e}] transport has already deallocated`), this._topology === q.DIRECT && this._directTransport && n >= 0 && this._releaseDirectTransport(), this._topology === q.SERVER && (this._serverTransport?.removeParticipant(e), this._setStates([e], W.CLOSED)), n >= 0 && this._opened.splice(n, 1), t >= 0 && this._allocated.splice(t, 1), delete this._states[e];
5992
+ t < 0 && this._debug.warn(`The participant [${e}] transport has already deallocated`), this._topology === q.DIRECT && this._directTransport && n >= 0 && this._releaseDirectTransport(), this._topology === q.SERVER && (this._serverTransport?.removeParticipant(e), this._setStates([e], K.CLOSED)), n >= 0 && this._opened.splice(n, 1), t >= 0 && this._allocated.splice(t, 1), delete this._states[e];
5962
5993
  }
5963
5994
  destroy() {
5964
5995
  this.unsubscribe();
@@ -6001,7 +6032,7 @@ var di = 2 ** 15 - 1, fi = 1, pi = 5, mi = 5, hi = class e {
6001
6032
  this._localState !== e && (this._localState = e, this._triggerEvent("LOCAL_STATE_CHANGED", e));
6002
6033
  }
6003
6034
  _onSignalingNotification(e) {
6004
- if (e.notification === K.TOPOLOGY_CHANGED) return this._onTopologyChanged(e);
6035
+ if (e.notification === G.TOPOLOGY_CHANGED) return this._onTopologyChanged(e);
6005
6036
  }
6006
6037
  _onTopologyChanged(e) {
6007
6038
  if (e.topology !== this._topology) {
@@ -6024,11 +6055,11 @@ var di = 2 ** 15 - 1, fi = 1, pi = 5, mi = 5, hi = class e {
6024
6055
  }
6025
6056
  }
6026
6057
  _createDirectTransport(e, t = !1) {
6027
- let n = new Mr(e, t, this._signaling, this._mediaSource, this._serverSettings, this._debug, this._logger, this._statAggregator, this._codecStatsAggregator);
6058
+ let n = new Ir(e, t, this._signaling, this._mediaSource, this._serverSettings, this._debug, this._logger, this._statAggregator, this._codecStatsAggregator);
6028
6059
  return this._dtListeners.length > 0 && this._debug.warn(`The list of direct listeners for the participant [${e}] is not empty`), this._dtListeners = [], this._dtListeners.push(n.addEventListener("REMOTE_TRACK_ADDED", this._onRemoteTrackAdded.bind(this, e)), n.addEventListener("REMOTE_TRACK_REMOVED", this._onRemoteTrackRemoved.bind(this, e)), n.addEventListener("REMOTE_DATA_STATS", this._onRemoteDataStats.bind(this)), n.addEventListener("STATE_CHANGED", this._onDirectTransportChanged.bind(this)), n.addEventListener("NETWORK_STATUS", this._onTransportNetworkStatus.bind(this)), n.addEventListener("PEER_CONNECTION_CLOSED", this._onPeerConnectionClosed.bind(this, q.DIRECT))), this._animojiReceiver && this._animojiSender && n.setAnimojiTransport(this._animojiReceiver, this._animojiSender), n;
6029
6060
  }
6030
6061
  _createServerTransport() {
6031
- let e = new Ji(this._signaling, this._mediaSource, this._serverSettings, this._debug, this._logger, this._statAggregator, this._codecStatsAggregator);
6062
+ let e = new Qi(this._signaling, this._mediaSource, this._serverSettings, this._debug, this._logger, this._statAggregator, this._codecStatsAggregator);
6032
6063
  return this._stListeners.length > 0 && this._debug.warn("The list of server transport listeners is not empty"), this._stListeners = [], this._stListeners.push(e.addEventListener("REMOTE_TRACK_ADDED", this._onRemoteTrackAdded.bind(this)), e.addEventListener("REMOTE_TRACK_REMOVED", this._onRemoteTrackRemoved.bind(this)), e.addEventListener("AUDIO_MIX_STALL", this._onServerAudioMixStall.bind(this)), e.addEventListener("REMOTE_DATA_STATS", this._onRemoteDataStats.bind(this)), e.addEventListener("STATE_CHANGED", this._onServerTransportChanged.bind(this)), e.addEventListener("SIGNALLED_ACTIVE_PARTICIPANTS", this._onTransportActiveParticipants.bind(this)), e.addEventListener("SIGNALLED_SPEAKER_CHANGED", this._onTransportSpeakerChanged.bind(this)), e.addEventListener("SIGNALLED_STALLED_PARTICIPANTS", this._onTransportStalledParticipants.bind(this)), e.addEventListener("NETWORK_STATUS", this._onTransportNetworkStatus.bind(this)), e.addEventListener("REMOTE_STREAM_SECOND", this._onRemoteStreamSecond.bind(this)), e.addEventListener("PEER_CONNECTION_CLOSED", this._onPeerConnectionClosed.bind(this, q.SERVER)), e.addEventListener("ASR_TRANSCRIPTION", this._onAsrTranscription.bind(this))), this._animojiReceiver && this._animojiSender && e.setAnimojiTransport(this._animojiReceiver, this._animojiSender), e;
6033
6064
  }
6034
6065
  _releaseDirectTransport() {
@@ -6043,7 +6074,7 @@ var di = 2 ** 15 - 1, fi = 1, pi = 5, mi = 5, hi = class e {
6043
6074
  }
6044
6075
  _onDirectTransportChanged(e) {
6045
6076
  let t = this._directTransport?.participantId;
6046
- if (e === W.CONNECTED && this._topology === q.DIRECT && this._releaseServerTransport(), (e === W.CLOSED || e === W.FAILED) && (this._releaseDirectTransport(), this._topology === q.DIRECT)) {
6077
+ if (e === K.CONNECTED && this._topology === q.DIRECT && this._releaseServerTransport(), (e === K.CLOSED || e === K.FAILED) && (this._releaseDirectTransport(), this._topology === q.DIRECT)) {
6047
6078
  let e = this._opened.indexOf(t);
6048
6079
  e >= 0 && this._opened.splice(e, 1);
6049
6080
  let n = this._allocated.indexOf(t);
@@ -6053,7 +6084,7 @@ var di = 2 ** 15 - 1, fi = 1, pi = 5, mi = 5, hi = class e {
6053
6084
  }
6054
6085
  _onServerTransportChanged(e) {
6055
6086
  let t = this._opened.slice();
6056
- e === W.CONNECTED && this._topology === q.SERVER && this._releaseDirectTransport(), (e === W.CLOSED || e === W.FAILED) && (this._releaseServerTransport(), this._topology === q.SERVER && (this._allocated = [], this._opened = [])), this._topology === q.SERVER && (this._setStates(t, e), this._setLocalState(e));
6087
+ e === K.CONNECTED && this._topology === q.SERVER && this._releaseDirectTransport(), (e === K.CLOSED || e === K.FAILED) && (this._releaseServerTransport(), this._topology === q.SERVER && (this._allocated = [], this._opened = [])), this._topology === q.SERVER && (this._setStates(t, e), this._setLocalState(e));
6057
6088
  }
6058
6089
  _onTransportActiveParticipants(e) {
6059
6090
  this._topology === q.SERVER && this._triggerEvent("SIGNALLED_ACTIVE_PARTICIPANTS", e);
@@ -6115,12 +6146,12 @@ var di = 2 ** 15 - 1, fi = 1, pi = 5, mi = 5, hi = class e {
6115
6146
  getStreamWaitingTimeMs(e, t) {
6116
6147
  return this._topology === q.SERVER ? this._serverTransport ? this._serverTransport.getStreamWaitingTimeMs(e, t) : (this._logger?.log(E.PAT_WAITING_TIME_ERROR, "noTransport"), this._debug.error("Cannot get stream waiting time, server transport is not initialized"), 0) : (this._logger?.log(E.PAT_WAITING_TIME_ERROR, "wrongTopology"), this._debug.error(`Cannot get stream waiting time, incorrect topology: ${this._topology}`), 0);
6117
6148
  }
6118
- }, Xi = "videochat-epi", Zi = 5e3, Qi = 500, $i = class extends g {
6149
+ }, ea = "videochat-epi", ta = 5e3, na = 500, ra = class extends g {
6119
6150
  constructor(e, t, n = null, r = !1, i = z) {
6120
6151
  super(), h(this, "_previousPerfStatReportTimestamp", 0), h(this, "_previousNetworkStatReportTimestamp", Date.now()), h(this, "_previousCallStatReportTimestamp", Date.now()), h(this, "_previousCallStatReport", null), h(this, "_screenShareStats", []), h(this, "_signaling", void 0), h(this, "_directTopology", void 0), h(this, "_debug", void 0), h(this, "_statAggregator", void 0), h(this, "_handleScreenSharingStat", (e) => {
6121
6152
  this._screenShareStats.push(e);
6122
6153
  }), h(this, "_handleTransportStateChanged", (e) => {
6123
- (this._directTopology && e === W.CONNECTED || !this._directTopology && e === W.OPENED) && (this._previousNetworkStatReportTimestamp = Date.now(), this._previousCallStatReportTimestamp = Date.now());
6154
+ (this._directTopology && e === K.CONNECTED || !this._directTopology && e === K.OPENED) && (this._previousNetworkStatReportTimestamp = Date.now(), this._previousCallStatReportTimestamp = Date.now());
6124
6155
  }), this._signaling = t, this._directTopology = r, this._debug = i, this._statAggregator = n, this.subscribe(e, J.REMOTE_DATA_STATS, this._handleStats.bind(this)), this.subscribe(e, J.SCREEN_SHARING_STAT, this._handleScreenSharingStat.bind(this)), this.subscribe(e, J.STATE_CHANGED, this._handleTransportStateChanged.bind(this));
6125
6156
  }
6126
6157
  destroy() {
@@ -6128,7 +6159,7 @@ var di = 2 ** 15 - 1, fi = 1, pi = 5, mi = 5, hi = class e {
6128
6159
  }
6129
6160
  static getEstimatedPerformanceIndex() {
6130
6161
  try {
6131
- let e = parseInt(localStorage.getItem(Xi) || "", 10);
6162
+ let e = parseInt(localStorage.getItem(ea) || "", 10);
6132
6163
  return isNaN(e) ? 0 : e;
6133
6164
  } catch {
6134
6165
  return 0;
@@ -6137,9 +6168,9 @@ var di = 2 ** 15 - 1, fi = 1, pi = 5, mi = 5, hi = class e {
6137
6168
  async _handleStats(e) {
6138
6169
  if (!e.inbound || !e.inbound.rtps) return;
6139
6170
  let t = Date.now();
6140
- !this._directTopology && N.perfStatReportEnabled && this._previousPerfStatReportTimestamp + Zi <= t && (await this.reportPerfStats(e), this._previousPerfStatReportTimestamp = t);
6171
+ !this._directTopology && N.perfStatReportEnabled && this._previousPerfStatReportTimestamp + ta <= t && (await this.reportPerfStats(e), this._previousPerfStatReportTimestamp = t);
6141
6172
  let n = e.outbound.transport.local?.protocol === "tcp";
6142
- !this._directTopology && n && this._previousNetworkStatReportTimestamp + Qi <= t && (await this.reportNetworkStats(e), this._previousNetworkStatReportTimestamp = t), N.callStatReportEnabled && this._previousCallStatReportTimestamp + N.statisticsInterval <= t && (this._reportCallStats(e), this._previousCallStatReportTimestamp = t);
6173
+ !this._directTopology && n && this._previousNetworkStatReportTimestamp + na <= t && (await this.reportNetworkStats(e), this._previousNetworkStatReportTimestamp = t), N.callStatReportEnabled && this._previousCallStatReportTimestamp + N.statisticsInterval <= t && (this._reportCallStats(e), this._previousCallStatReportTimestamp = t);
6143
6174
  }
6144
6175
  async reportPerfStats(e) {
6145
6176
  let t = e.inbound.rtps.reduce((e, t) => (t.kind === "video" && (e.framesDecoded += t.framesDecoded || 0, e.framesReceived += t.framesReceived || 0), e), {
@@ -6148,7 +6179,7 @@ var di = 2 ** 15 - 1, fi = 1, pi = 5, mi = 5, hi = class e {
6148
6179
  });
6149
6180
  if (t.framesDecoded) try {
6150
6181
  let e = await this._signaling.reportPerfStat(t);
6151
- localStorage.setItem(Xi, e.estimatedPerformanceIndex);
6182
+ localStorage.setItem(ea, e.estimatedPerformanceIndex);
6152
6183
  } catch {}
6153
6184
  }
6154
6185
  async reportNetworkStats(e) {
@@ -6192,11 +6223,11 @@ var di = 2 ** 15 - 1, fi = 1, pi = 5, mi = 5, hi = class e {
6192
6223
  rtt: Math.round(e.inbound.transport.currentRoundTripTime * 1e3),
6193
6224
  ss_freeze_count: 0,
6194
6225
  ss_total_freezes_duration: 0,
6195
- local_address: ta(e.inbound.transport.local),
6226
+ local_address: aa(e.inbound.transport.local),
6196
6227
  local_connection_type: e.inbound.transport.local?.type,
6197
6228
  network_type: e.inbound.transport.local?.networkType,
6198
6229
  transport: e.inbound.transport.local?.protocol,
6199
- remote_address: ta(e.inbound.transport.remote),
6230
+ remote_address: aa(e.inbound.transport.remote),
6200
6231
  remote_connection_type: e.inbound.transport.remote?.type
6201
6232
  };
6202
6233
  this._previousCallStatReport || (this._previousCallStatReport = Object.assign({}, t));
@@ -6217,35 +6248,35 @@ var di = 2 ** 15 - 1, fi = 1, pi = 5, mi = 5, hi = class e {
6217
6248
  frames_dropped: Math.max(0, t.frames_dropped - this._previousCallStatReport.frames_dropped),
6218
6249
  rtt: Math.max(0, t.rtt)
6219
6250
  };
6220
- if (N.simulcast && (i.is_simulcast = !0), navigator.hardwareConcurrency && (i.cpu_hardware_concurrency = navigator.hardwareConcurrency), n && !na(t.jitter_video) && (i.jitter_video = Math.round(t.jitter_video)), r && !na(t.jitter_audio) && (i.jitter_audio = Math.round(t.jitter_audio)), n && !na(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 && !na(t.total_audio_samples_received)) {
6251
+ if (N.simulcast && (i.is_simulcast = !0), navigator.hardwareConcurrency && (i.cpu_hardware_concurrency = navigator.hardwareConcurrency), n && !oa(t.jitter_video) && (i.jitter_video = Math.round(t.jitter_video)), r && !oa(t.jitter_audio) && (i.jitter_audio = Math.round(t.jitter_audio)), n && !oa(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 && !oa(t.total_audio_samples_received)) {
6221
6252
  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);
6222
- i.inserted_audio_samples_for_deceleration = ra(n / e * 1e3), i.removed_audio_samples_for_acceleration = ra(r / e * 1e3), i.concealed_audio_samples = ra(a / e * 1e3), i.concealed_silent_audio_samples = ra(o / e * 1e3), i.concealment_audio_avg_size = ra(a / s), i.total_audio_energy = t.total_audio_energy;
6253
+ i.inserted_audio_samples_for_deceleration = sa(n / e * 1e3), i.removed_audio_samples_for_acceleration = sa(r / e * 1e3), i.concealed_audio_samples = sa(a / e * 1e3), i.concealed_silent_audio_samples = sa(o / e * 1e3), i.concealment_audio_avg_size = sa(a / s), i.total_audio_energy = t.total_audio_energy;
6223
6254
  }
6224
- ea(t, "local_address", "local_connection_type", "network_type", "transport") && (i.local_address = t.local_address, i.local_connection_type = t.local_connection_type, i.network_type = t.network_type, i.transport = t.transport), ea(t, "remote_address", "remote_connection_type") && (i.remote_address = t.remote_address, i.remote_connection_type = t.remote_connection_type);
6255
+ ia(t, "local_address", "local_connection_type", "network_type", "transport") && (i.local_address = t.local_address, i.local_connection_type = t.local_connection_type, i.network_type = t.network_type, i.transport = t.transport), ia(t, "remote_address", "remote_connection_type") && (i.remote_address = t.remote_address, i.remote_connection_type = t.remote_connection_type);
6225
6256
  let a = Math.max(0, t.packets_sent_video - this._previousCallStatReport.packets_sent_video), o = Math.max(0, t.packets_sent_audio - this._previousCallStatReport.packets_sent_audio);
6226
- a > 0 && (i.video_loss = ra(Math.max(0, t.packets_lost_video - this._previousCallStatReport.packets_lost_video) / a * 100)), o > 0 && (i.audio_loss = ra(Math.max(0, t.packets_lost_audio - this._previousCallStatReport.packets_lost_audio) / o * 100)), this._statAggregator?.logCallStat(i), N.enableLogPerfStatReport && this._debug.log("Sent call stats", i), this._previousCallStatReport = t;
6257
+ a > 0 && (i.video_loss = sa(Math.max(0, t.packets_lost_video - this._previousCallStatReport.packets_lost_video) / a * 100)), o > 0 && (i.audio_loss = sa(Math.max(0, t.packets_lost_audio - this._previousCallStatReport.packets_lost_audio) / o * 100)), this._statAggregator?.logCallStat(i), N.enableLogPerfStatReport && this._debug.log("Sent call stats", i), this._previousCallStatReport = t;
6227
6258
  }
6228
6259
  };
6229
- function ea(e, ...t) {
6260
+ function ia(e, ...t) {
6230
6261
  for (let n of t) if (!Object.hasOwn(e, n) || e[n] === void 0) return !1;
6231
6262
  return !0;
6232
6263
  }
6233
- function ta(e, t = !1) {
6264
+ function aa(e, t = !1) {
6234
6265
  if (e?.address) return e.address + (t ? `:${e.port}` : "");
6235
6266
  }
6236
- function na(e) {
6267
+ function oa(e) {
6237
6268
  return e === void 0;
6238
6269
  }
6239
- function ra(e) {
6270
+ function sa(e) {
6240
6271
  return Number.isNaN(e) ? 0 : e;
6241
6272
  }
6242
6273
  //#endregion
6243
6274
  //#region src/static/Capabilities.ts
6244
- var ia;
6275
+ var ca;
6245
6276
  (function(e) {
6246
6277
  function t() {
6247
6278
  return {
6248
- estimatedPerformanceIndex: $i.getEstimatedPerformanceIndex(),
6279
+ estimatedPerformanceIndex: ra.getEstimatedPerformanceIndex(),
6249
6280
  audioMix: !0,
6250
6281
  consumerUpdate: !0,
6251
6282
  producerNotificationDataChannelVersion: 8,
@@ -6270,39 +6301,8 @@ var ia;
6270
6301
  };
6271
6302
  }
6272
6303
  e.get = t;
6273
- })(ia || (ia = {}));
6274
- var aa = ia, oa = /* @__PURE__ */ function(e) {
6275
- return e.START = "start", e.ACCEPT = "accept", e.JOIN = "join", e.RETRY = "retry", e;
6276
- }(oa || {}), sa = /* @__PURE__ */ function(e) {
6277
- return e.WEBSOCKET = "ws", e.WEBTRANSPORT = "wt", e;
6278
- }({}), ca = /* @__PURE__ */ function(e) {
6279
- return e.CONNECTED = "connected", e.RECONNECTED = "reconnected", e.FAILED_PINGS = "failed_pings", e.FAILED_EXCEPTIONS = "failed_exception", e.TIMEOUT = "timeout", e.RESTART = "restart", e;
6280
- }({}), la = {
6281
- connected: {
6282
- wt: V.WEBTRANSPORT_CONNECTED,
6283
- ws: V.WEBSOCKET_CONNECTED
6284
- },
6285
- reconnected: {
6286
- wt: V.WEBTRANSPORT_RECONNECTED,
6287
- ws: V.WEBSOCKET_RECONNECTED
6288
- },
6289
- failed_pings: {
6290
- wt: V.WEBTRANSPORT_FAILED_PINGS,
6291
- ws: V.WEBSOCKET_FAILED_PINGS
6292
- },
6293
- failed_exception: {
6294
- wt: V.WEBTRANSPORT_FAILED_EXCEPTION,
6295
- ws: V.WEBSOCKET_FAILED_EXCEPTION
6296
- },
6297
- timeout: {
6298
- wt: V.WEBTRANSPORT_TIMEOUT,
6299
- ws: V.WEBSOCKET_TIMEOUT
6300
- },
6301
- restart: {
6302
- wt: V.WEBTRANSPORT_RESTART,
6303
- ws: V.WEBSOCKET_RESTART
6304
- }
6305
- }, ua = {
6304
+ })(ca || (ca = {}));
6305
+ var la = ca, ua = {
6306
6306
  producerScreenTrack: () => !0,
6307
6307
  videoTracksCount: () => N.videoTracksCount > 0,
6308
6308
  waitingHall: () => !0,
@@ -6554,7 +6554,7 @@ var aa = ia, oa = /* @__PURE__ */ function(e) {
6554
6554
  return e.EMPTY_ENDPOINT = "EMPTY_ENDPOINT", e.NETWORK_ERROR = "NETWORK_ERROR", e.ABORTED = "ABORTED", e;
6555
6555
  }({}), Sa = class {
6556
6556
  constructor(e) {
6557
- h(this, "handlers", void 0), h(this, "socket", null), h(this, "endpoint", ""), h(this, "wtEndpoint", null), h(this, "peerId", null), h(this, "lastStamp", 0), h(this, "connectionType", void 0), h(this, "reconnectCount", 0), h(this, "reconnectTimer", 0), h(this, "doctorTimer", 0), h(this, "forceWebSocket", !1), h(this, "abortSignal", void 0), h(this, "manualClose", !1), h(this, "currentType", sa.WEBSOCKET), this.handlers = e;
6557
+ h(this, "handlers", void 0), h(this, "socket", null), h(this, "endpoint", ""), h(this, "wtEndpoint", null), h(this, "peerId", null), h(this, "lastStamp", 0), h(this, "connectionType", void 0), h(this, "reconnectCount", 0), h(this, "reconnectTimer", 0), h(this, "doctorTimer", 0), h(this, "forceWebSocket", !1), h(this, "abortSignal", void 0), h(this, "manualClose", !1), h(this, "currentType", fr.WEBSOCKET), this.handlers = e;
6558
6558
  }
6559
6559
  get readyState() {
6560
6560
  return this.socket?.readyState ?? null;
@@ -6581,7 +6581,7 @@ var aa = ia, oa = /* @__PURE__ */ function(e) {
6581
6581
  this.reconnectCount = 0;
6582
6582
  }
6583
6583
  connect(e) {
6584
- this.socket && this.socket.readyState < WebSocket.CLOSING || (e !== oa.RETRY && (this.forceWebSocket = !1, this.reconnectCount = 0), this.manualClose = !1, this.connectionType = e, this._connect());
6584
+ this.socket && this.socket.readyState < WebSocket.CLOSING || (e !== dr.RETRY && (this.forceWebSocket = !1, this.reconnectCount = 0), this.manualClose = !1, this.connectionType = e, this._connect());
6585
6585
  }
6586
6586
  close(e) {
6587
6587
  this.manualClose = !0, this._disconnect(e), window.clearTimeout(this.reconnectTimer), this.reconnectTimer = 0, this.lastStamp = 0;
@@ -6602,7 +6602,7 @@ var aa = ia, oa = /* @__PURE__ */ function(e) {
6602
6602
  return;
6603
6603
  }
6604
6604
  let e = this._buildUrl(this.wtEndpoint, !0);
6605
- this.currentType = sa.WEBTRANSPORT, this.socket = new ba(e, { congestionControl: "low-latency" }), this._setSocketHandlers();
6605
+ this.currentType = fr.WEBTRANSPORT, this.socket = new ba(e, { congestionControl: "low-latency" }), this._setSocketHandlers();
6606
6606
  }
6607
6607
  _connectWebSocket() {
6608
6608
  if (!this.endpoint) {
@@ -6614,14 +6614,14 @@ var aa = ia, oa = /* @__PURE__ */ function(e) {
6614
6614
  return;
6615
6615
  }
6616
6616
  let e = this._buildUrl(this.endpoint, !1);
6617
- this.currentType = sa.WEBSOCKET, this.socket = new WebSocket(e), this._setSocketHandlers();
6617
+ this.currentType = fr.WEBSOCKET, this.socket = new WebSocket(e), this._setSocketHandlers();
6618
6618
  }
6619
6619
  _setSocketHandlers() {
6620
6620
  this.socket && (this.socket.onopen = this._onOpen.bind(this), this.socket.onmessage = this._onMessage.bind(this), this.socket.onerror = this._onError.bind(this), this.socket.onclose = this._onClose.bind(this), this._startDoctor());
6621
6621
  }
6622
6622
  _buildUrl(e, t) {
6623
6623
  let n = new URL(e), r = n.searchParams;
6624
- return r.set("platform", N.platform), r.set("appVersion", String(N.appVersion)), r.set("version", String(N.protocolVersion)), r.set("device", N.device), r.set("capabilities", da.getFlags()), r.set("clientType", N.clientType), this.connectionType && r.set("tgt", this.connectionType), this.connectionType === oa.RETRY && this.lastStamp && r.set("recoverTs", String(this.lastStamp)), N.useParticipantListChunk && (r.set("partIdx", String(N.participantListChunkInitIndex)), N.participantListChunkInitCount !== null && r.set("partCount", String(N.participantListChunkInitCount))), t && (r.set("compression", "deflate-raw"), r.set("ua", navigator.userAgent)), this.peerId !== null && r.set("peerId", String(this.peerId)), n.toString();
6624
+ return r.set("platform", N.platform), r.set("appVersion", String(N.appVersion)), r.set("version", String(N.protocolVersion)), r.set("device", N.device), r.set("capabilities", da.getFlags()), r.set("clientType", N.clientType), this.connectionType && r.set("tgt", this.connectionType), this.connectionType === dr.RETRY && this.lastStamp && r.set("recoverTs", String(this.lastStamp)), N.useParticipantListChunk && (r.set("partIdx", String(N.participantListChunkInitIndex)), N.participantListChunkInitCount !== null && r.set("partCount", String(N.participantListChunkInitCount))), t && (r.set("compression", "deflate-raw"), r.set("ua", navigator.userAgent)), this.peerId !== null && r.set("peerId", String(this.peerId)), n.toString();
6625
6625
  }
6626
6626
  _canUseWebTransport() {
6627
6627
  return !this.forceWebSocket && ba.isBrowserSupported() && this.wtEndpoint !== null && N.webtransport;
@@ -6662,7 +6662,7 @@ var aa = ia, oa = /* @__PURE__ */ function(e) {
6662
6662
  count: this.reconnectCount,
6663
6663
  delay: e
6664
6664
  }), this.reconnectTimer = window.setTimeout(() => {
6665
- this.connectionType = oa.RETRY, this._connect();
6665
+ this.connectionType = dr.RETRY, this._connect();
6666
6666
  }, e);
6667
6667
  }
6668
6668
  _getReconnectDelay() {
@@ -6786,7 +6786,7 @@ var aa = ia, oa = /* @__PURE__ */ function(e) {
6786
6786
  return t && (n.participantId = t), this._sendRaw(y.CHANGE_PARTICIPANT_STATE, n);
6787
6787
  }
6788
6788
  async hold(e) {
6789
- let t = aa.get();
6789
+ let t = la.get();
6790
6790
  return this._send(y.HOLD, {
6791
6791
  hold: e,
6792
6792
  capabilities: e ? void 0 : t
@@ -7046,11 +7046,11 @@ var aa = ia, oa = /* @__PURE__ */ function(e) {
7046
7046
  return this.producerCommandDataChannelEnabled ? e === y.UPDATE_DISPLAY_LAYOUT || e === y.REPORT_PERF_STAT || e === y.REPORT_SHARING_STAT || e === y.REQUEST_ASR || e === y.ENABLE_VIDEO_SUSPEND || e === y.ENABLE_VIDEO_SUSPEND_SUGGEST || e === y.REPORT_NETWORK_STAT || e === y.CHANGE_SIMULCAST : !1;
7047
7047
  }
7048
7048
  _onOpen() {
7049
- this._debug.debug("[signaling] socket opened"), this._logger?.log(E.SOCKET_ACTION, "opened"), this._waitConnectionMessage(), this._logTransportStat(this.connectionType === oa.RETRY ? ca.RECONNECTED : ca.CONNECTED);
7049
+ this._debug.debug("[signaling] socket opened"), this._logger?.log(E.SOCKET_ACTION, "opened"), this._waitConnectionMessage(), this._logTransportStat(this.connectionType === dr.RETRY ? pr.RECONNECTED : pr.CONNECTED);
7050
7050
  }
7051
7051
  _onMessage(e) {
7052
7052
  if (e.data === "ping") {
7053
- this._statPings?.mark(this._getSocketType()), this._markTransportStat(ca.FAILED_PINGS), R.onSignalingMessage(e.data), this.transport.readyState === WebSocket.OPEN && this.transport.send("pong");
7053
+ this._statPings?.mark(this._getSocketType()), this._markTransportStat(pr.FAILED_PINGS), R.onSignalingMessage(e.data), this.transport.readyState === WebSocket.OPEN && this.transport.send("pong");
7054
7054
  return;
7055
7055
  }
7056
7056
  try {
@@ -7063,13 +7063,13 @@ var aa = ia, oa = /* @__PURE__ */ function(e) {
7063
7063
  _handleMessage(e) {
7064
7064
  switch (e.type) {
7065
7065
  case "notification":
7066
- e.notification === "connection" ? (this._debug.debug("[signaling] signaling connected", e), this.connected = !0, this.transport.resetReconnectCount(), this.transport.setEndpoint(e.endpoint), e.peerId && this.peerId !== e.peerId.id && (this.peerId = e.peerId.id, this.transport.setPeerId(e.peerId.id)), this._stopWaitConnectionMessage(), this.conversationResolve ? this.conversationResolve(e) : (this._logTransportStat(ca.RESTART), this._triggerEvent(G.RECONNECT, e), e.conversation.topology && this._triggerEvent(G.NOTIFICATION, {
7066
+ e.notification === "connection" ? (this._debug.debug("[signaling] signaling connected", e), this.connected = !0, this.transport.resetReconnectCount(), this.transport.setEndpoint(e.endpoint), e.peerId && this.peerId !== e.peerId.id && (this.peerId = e.peerId.id, this.transport.setPeerId(e.peerId.id)), this._stopWaitConnectionMessage(), this.conversationResolve ? this.conversationResolve(e) : (this._logTransportStat(pr.RESTART), this._triggerEvent(W.RECONNECT, e), e.conversation.topology && this._triggerEvent(W.NOTIFICATION, {
7067
7067
  type: "notification",
7068
- notification: K.TOPOLOGY_CHANGED,
7068
+ notification: G.TOPOLOGY_CHANGED,
7069
7069
  topology: e.conversation.topology
7070
7070
  })), this.lastStamp && this._handleCachedMessages(), e.recoverMessages?.forEach((e) => {
7071
- e.notification === K.ACCEPTED_CALL && e.peerId.id === this.peerId && e.peerId.type === "WEB_TRANSPORT" || this._handleMessage(e);
7072
- }), this._handleCommandsQueue(this.websocketCommandsQueue)) : !this.connected || !this.listenersReady ? this.incomingCache.push(e) : this._triggerEvent(G.NOTIFICATION, e);
7071
+ e.notification === G.ACCEPTED_CALL && e.peerId.id === this.peerId && e.peerId.type === "WEB_TRANSPORT" || this._handleMessage(e);
7072
+ }), this._handleCommandsQueue(this.websocketCommandsQueue)) : !this.connected || !this.listenersReady ? this.incomingCache.push(e) : this._triggerEvent(W.NOTIFICATION, e);
7073
7073
  break;
7074
7074
  case "response":
7075
7075
  this._handleCommandResponse(!0, e);
@@ -7090,8 +7090,8 @@ var aa = ia, oa = /* @__PURE__ */ function(e) {
7090
7090
  message: `Conversation ended: ${e.error}`,
7091
7091
  remote: !0
7092
7092
  });
7093
- this.conversationReject ? this.conversationReject(n) : this._triggerEvent(G.NOTIFICATION, {
7094
- notification: K.CLOSED_CONVERSATION,
7093
+ this.conversationReject ? this.conversationReject(n) : this._triggerEvent(W.NOTIFICATION, {
7094
+ notification: G.CLOSED_CONVERSATION,
7095
7095
  reason: _.SERVICE_UNAVAILABLE
7096
7096
  });
7097
7097
  break;
@@ -7099,8 +7099,8 @@ var aa = ia, oa = /* @__PURE__ */ function(e) {
7099
7099
  this.conversationReject ? this.conversationReject(new v(e.reason || w.SIGNALING_FAILED, {
7100
7100
  message: `Conversation ended: ${e.error}`,
7101
7101
  remote: !0
7102
- })) : this._triggerEvent(G.NOTIFICATION, {
7103
- notification: K.CLOSED_CONVERSATION,
7102
+ })) : this._triggerEvent(W.NOTIFICATION, {
7103
+ notification: G.CLOSED_CONVERSATION,
7104
7104
  reason: e.reason
7105
7105
  });
7106
7106
  break;
@@ -7129,10 +7129,10 @@ var aa = ia, oa = /* @__PURE__ */ function(e) {
7129
7129
  }
7130
7130
  }
7131
7131
  _throwError(e) {
7132
- this._triggerEvent(G.FAILED, e);
7132
+ this._triggerEvent(W.FAILED, e);
7133
7133
  }
7134
7134
  _onError(e) {
7135
- this._logger?.log(E.SOCKET_ACTION, "error"), this._debug.error("[signaling] signaling error", e), this._logTransportStat(ca.FAILED_EXCEPTIONS, { string_value: this._serializeErrorEvent(e) });
7135
+ this._logger?.log(E.SOCKET_ACTION, "error"), this._debug.error("[signaling] signaling error", e), this._logTransportStat(pr.FAILED_EXCEPTIONS, { string_value: this._serializeErrorEvent(e) });
7136
7136
  }
7137
7137
  _serializeErrorEvent(e) {
7138
7138
  let t = e, n = t.error instanceof Error ? t.error : null;
@@ -7254,20 +7254,20 @@ var aa = ia, oa = /* @__PURE__ */ function(e) {
7254
7254
  }
7255
7255
  }
7256
7256
  _onTransportReconnectScheduled(e) {
7257
- this.connectionType = oa.RETRY, this._debug.log(`[signaling] reconnect websocket after ${e.delay}ms (${e.count})`), this._logger?.log(E.SOCKET_ACTION, "reconnect");
7257
+ this.connectionType = dr.RETRY, this._debug.log(`[signaling] reconnect websocket after ${e.delay}ms (${e.count})`), this._logger?.log(E.SOCKET_ACTION, "reconnect");
7258
7258
  }
7259
7259
  _onTransportConnectionDead() {
7260
- this._debug.warn("[signaling] socket is dead, trying to reconnect"), this._logTransportStat(ca.FAILED_PINGS);
7260
+ this._debug.warn("[signaling] socket is dead, trying to reconnect"), this._logTransportStat(pr.FAILED_PINGS);
7261
7261
  }
7262
7262
  _getSocketType() {
7263
7263
  return this.transport.type;
7264
7264
  }
7265
7265
  _markTransportStat(e) {
7266
- let t = this._getSocketType(), n = la[e][t];
7266
+ let t = this._getSocketType(), n = mr[e][t];
7267
7267
  U.setMark(n);
7268
7268
  }
7269
7269
  _logTransportStat(e, t) {
7270
- let n = this._getSocketType(), r = la[e][n];
7270
+ let n = this._getSocketType(), r = mr[e][n];
7271
7271
  this._statAggregator?.logEventualStat({
7272
7272
  name: r,
7273
7273
  ...t
@@ -7339,9 +7339,10 @@ var za = /* @__PURE__ */ function(e) {
7339
7339
  };
7340
7340
  }
7341
7341
  e.fromId = n;
7342
- function r(e, t = !0) {
7343
- let n = t ? e.decorativeExternalUserId : e.externalId, r = e.deviceIdx ?? 0;
7344
- if (n) return i(n, r);
7342
+ function r(e, t = !0, n = !1) {
7343
+ let r = t ? e.decorativeExternalUserId : e.externalId, a = e.deviceIdx ?? 0;
7344
+ if (r) return i(r, a);
7345
+ if (n && t && e.externalId) return i(e.externalId, a);
7345
7346
  }
7346
7347
  e.fromSignalingParticipant = r;
7347
7348
  function i(e, t = 0) {
@@ -7850,14 +7851,14 @@ var eo = 90, to = 3, no = class extends g {
7850
7851
  }
7851
7852
  _getAudioTrackLevelByParticipantId(e) {
7852
7853
  if (this._isTransparentAudioMode()) return this._getTransparentAudioLevelByParticipantId(e);
7853
- let t = this._detectors.get(Nr.AUDIO_MIX);
7854
+ let t = this._detectors.get(Lr.AUDIO_MIX);
7854
7855
  return t ? t.getLevel() : null;
7855
7856
  }
7856
7857
  _getTransparentAudioLevelByParticipantId(e) {
7857
7858
  if (!this._activeParticipants?.includes(e)) return null;
7858
7859
  let t = null;
7859
7860
  return this._detectors.forEach((e, n) => {
7860
- if (!n.startsWith(`${Nr.TRANSPARENT_AUDIO_TRACK_PREFIX}-`)) return;
7861
+ if (!n.startsWith(`${Lr.TRANSPARENT_AUDIO_TRACK_PREFIX}-`)) return;
7861
7862
  let r = e.getLevel();
7862
7863
  (!t || r.real > t.real) && (t = r);
7863
7864
  }), t;
@@ -7913,7 +7914,7 @@ var eo = 90, to = 3, no = class extends g {
7913
7914
  t.isAudioEnabled || (this._volumes[e] = 1), t.isAudioEnabled && (this._volumes[e] = 0);
7914
7915
  }
7915
7916
  _onTransportStateChanged(e, t) {
7916
- t === W.OPENED && (this._connectionTimeout || (this._connectionTimeout = window.setTimeout(this._onConnectionTimeout.bind(this), N.specListenerParams.connectionTimeout)), this._volumeTimeout || (this._volumeTimeout = window.setTimeout(this._onVolumeTimeout.bind(this), N.specListenerParams.volumeTimeout))), t === W.FAILED && this._connectionTimeout && (this._debug.warn("Transport failed, send callSpecError"), this._logger?.log(E.CALL_SPEC_ERROR, `${this._transport.getTopology()}_CONNECTION_TIMEOUT`));
7917
+ t === K.OPENED && (this._connectionTimeout || (this._connectionTimeout = window.setTimeout(this._onConnectionTimeout.bind(this), N.specListenerParams.connectionTimeout)), this._volumeTimeout || (this._volumeTimeout = window.setTimeout(this._onVolumeTimeout.bind(this), N.specListenerParams.volumeTimeout))), t === K.FAILED && this._connectionTimeout && (this._debug.warn("Transport failed, send callSpecError"), this._logger?.log(E.CALL_SPEC_ERROR, `${this._transport.getTopology()}_CONNECTION_TIMEOUT`));
7917
7918
  }
7918
7919
  _onVolumesDetected(e) {
7919
7920
  Object.keys(e).forEach((t) => {
@@ -7921,7 +7922,7 @@ var eo = 90, to = 3, no = class extends g {
7921
7922
  });
7922
7923
  }
7923
7924
  _onConnectionTimeout() {
7924
- Object.values(this._transport.getStates()).filter((e) => e !== W.CONNECTED).length > 0 && (this._debug.warn("There is not connected transport, send callSpecError"), this._logger?.log(E.CALL_SPEC_ERROR, `${this._transport.getTopology()}_CONNECTION_TIMEOUT`)), this._connectionTimeout = 0;
7925
+ Object.values(this._transport.getStates()).filter((e) => e !== K.CONNECTED).length > 0 && (this._debug.warn("There is not connected transport, send callSpecError"), this._logger?.log(E.CALL_SPEC_ERROR, `${this._transport.getTopology()}_CONNECTION_TIMEOUT`)), this._connectionTimeout = 0;
7925
7926
  }
7926
7927
  _onVolumeTimeout() {
7927
7928
  let e = [];
@@ -8185,7 +8186,7 @@ var eo = 90, to = 3, no = class extends g {
8185
8186
  this.lastSeen[e] = t;
8186
8187
  }
8187
8188
  logMetrics(e) {
8188
- [sa.WEBSOCKET, sa.WEBTRANSPORT].forEach((t) => {
8189
+ [fr.WEBSOCKET, fr.WEBTRANSPORT].forEach((t) => {
8189
8190
  if (!this.trackerByTransport[t].hasData) return;
8190
8191
  let n = this.trackerByTransport[t].snapshot();
8191
8192
  this._logger.logClientStats({
@@ -8309,7 +8310,7 @@ var eo = 90, to = 3, no = class extends g {
8309
8310
  }
8310
8311
  }, wo = 1e3, To = 1e4, Eo = 15, Q = class e extends g {
8311
8312
  constructor(e, t) {
8312
- 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, "_debug", z.createSessionLogger()), 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", vr()), h(this, "_serverTimeOffset", 0), h(this, "_onUnload", void 0), h(this, "_audioOutput", void 0), h(this, "_stats", 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", M.debounce(async (e) => {
8313
+ 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, "_debug", z.createSessionLogger()), 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", Sr()), h(this, "_serverTimeOffset", 0), h(this, "_onUnload", void 0), h(this, "_audioOutput", void 0), h(this, "_stats", 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", M.debounce(async (e) => {
8313
8314
  if (this._signaling.ready) try {
8314
8315
  await this._signaling.changeMediaSettings(e);
8315
8316
  } catch (e) {
@@ -8720,7 +8721,7 @@ var eo = 90, to = 3, no = class extends g {
8720
8721
  }
8721
8722
  } else ee = await this._api.startConversation(p, t, n, m, a, o, s, { onlyAdminCanShareMovie: c }, l), this._debug.debug("Api.startConversation", ee);
8722
8723
  this._setConversationParams(ee);
8723
- let h = await this._connectSignaling(oa.START, ee);
8724
+ let h = await this._connectSignaling(dr.START, ee);
8724
8725
  return await this._setConversation(ee, h, r), this._logCallStartEvent(u, Y.OUTGOING), h;
8725
8726
  }
8726
8727
  async _joinConversation(t, n) {
@@ -8771,7 +8772,7 @@ var eo = 90, to = 3, no = class extends g {
8771
8772
  else if (o) d = await this._api.joinConversationByLink(o, u, s, c), f = "joinConversationByLink";
8772
8773
  else throw new v(_.UNKNOWN_ERROR);
8773
8774
  this._debug.debug("Api.joinConversation", d), Za(d, f), this._setConversationParams(d);
8774
- let p = await this._connectSignaling(oa.JOIN, d);
8775
+ let p = await this._connectSignaling(dr.JOIN, d);
8775
8776
  return await this._setConversation(d, p, Y.JOINING), this._logCallStartEvent(n, Y.JOINING), p;
8776
8777
  }
8777
8778
  async _prepareConversation(t, n = j.USER, r, i, a) {
@@ -8829,7 +8830,7 @@ var eo = 90, to = 3, no = class extends g {
8829
8830
  conversationParams: e
8830
8831
  }), u.wt_endpoint = l);
8831
8832
  }
8832
- let d = await this._connectSignaling(oa.ACCEPT, u);
8833
+ let d = await this._connectSignaling(dr.ACCEPT, u);
8833
8834
  return e._current && (e._current._participantState === X.ACCEPTED || e._current._participantState === X.CALLED) ? (this._debug.log("Push rejected (busy)"), this._stats.logger.log(E.PUSH, "busy"), this._signaling.ready && this._signaling.hangup(_.BUSY), Promise.reject(new v(_.BUSY))) : (e._current && (e._current.destroy(), e._current = null), await this._setConversation(u, d, Y.INCOMING, n), d);
8834
8835
  }
8835
8836
  async _createParticipant(e, t) {
@@ -8862,9 +8863,8 @@ var eo = 90, to = 3, no = class extends g {
8862
8863
  throw this._close(new v(_.NETWORK_ERROR), e), e;
8863
8864
  }
8864
8865
  }
8865
- async _setConversation(e, t, n, r = j.USER) {
8866
- let { participants: i } = t.conversation;
8867
- t.conversationParams?.serverTime && (this._serverTimeOffset = t.conversationParams.serverTime - Date.now()), i.forEach((e) => {
8866
+ _cacheParticipantExternalIds(e) {
8867
+ e.forEach((e) => {
8868
8868
  let t = M.composeId(e), n = Z.fromSignalingParticipant(e, !1);
8869
8869
  if (n) {
8870
8870
  this._api.cacheExternalId(t, n);
@@ -8872,6 +8872,10 @@ var eo = 90, to = 3, no = class extends g {
8872
8872
  r && i && (this._api.cacheExternalId(r, i), this._api.mapDecorativeId(e.decorativeUserId, e.id));
8873
8873
  }
8874
8874
  });
8875
+ }
8876
+ async _setConversation(e, t, n, r = j.USER) {
8877
+ let { participants: i } = t.conversation;
8878
+ t.conversationParams?.serverTime && (this._serverTimeOffset = t.conversationParams.serverTime - Date.now()), this._cacheParticipantExternalIds(i);
8875
8879
  let a = this._api.getUserId(), o = this._extractLocalParticipantFromConnection(t), s = e.device_idx || 0;
8876
8880
  if (!a) {
8877
8881
  if (!o) throw new v(_.UNKNOWN_ERROR);
@@ -8914,14 +8918,14 @@ var eo = 90, to = 3, no = class extends g {
8914
8918
  }
8915
8919
  _updateConversation(e) {
8916
8920
  if (!this._conversation) throw new v(_.UNKNOWN_ERROR);
8917
- this._conversation.acceptTime = e.conversation.acceptTime, this._conversation.features = e.conversation.features || [], this._conversation.featuresPerRole = e.conversation.featuresPerRole, this._conversation.participantsLimit = e.conversation.participantsLimit || 30, this._conversation.topology = e.conversation.topology || q.DIRECT, this._conversation.concurrent = e.isConcurrent || !1, this._conversation.chatId = e.conversation.multichatId, this._conversation.mediaModifiers = e.mediaModifiers, this._conversation.waitingHall = !1, this._conversation.waitForAdmin = !1, this._conversation.restricted = !1;
8921
+ this._conversation.acceptTime = e.conversation.acceptTime, this._conversation.features = e.conversation.features || [], this._conversation.featuresPerRole = e.conversation.featuresPerRole, this._conversation.participantsLimit = e.conversation.participantsLimit || 30, this._conversation.topology = e.conversation.topology || q.DIRECT, this._conversation.concurrent = e.isConcurrent || !1, this._conversation.chatId = e.conversation.multichatId, this._conversation.mediaModifiers = e.mediaModifiers, this._conversation.waitingHall = !1, this._conversation.waitForAdmin = !1, this._conversation.restricted = !1, this._cacheParticipantExternalIds(e.conversation.participants ?? []);
8918
8922
  }
8919
8923
  _createMediaSource() {
8920
8924
  let e = new Yt(this._debug, this._stats.logger);
8921
8925
  return this.subscribe(e, qt.SOURCE_CHANGED, this._onLocalMediaStreamChanged.bind(this)), this.subscribe(e, qt.SCREEN_STATUS, this._onScreenSharingStatus.bind(this)), this._audioFix = new Ya(e, this._debug, this._stats.logger), e;
8922
8926
  }
8923
8927
  async _connectSignaling(e, t) {
8924
- this._signaling.setEndpoint(t.endpoint), this._signaling.setWebTransportEndpoint(t.wt_endpoint ? t.wt_endpoint : null), this.subscribe(this._signaling, G.NOTIFICATION, (e) => this._signalingActor.add(e)), this.subscribe(this._signaling, G.FAILED, this._onSignalingFailed.bind(this)), this.subscribe(this._signaling, G.RECONNECT, this._onSignalingReconnect.bind(this));
8928
+ this._signaling.setEndpoint(t.endpoint), this._signaling.setWebTransportEndpoint(t.wt_endpoint ? t.wt_endpoint : null), this.subscribe(this._signaling, W.NOTIFICATION, (e) => this._signalingActor.add(e)), this.subscribe(this._signaling, W.FAILED, this._onSignalingFailed.bind(this)), this.subscribe(this._signaling, W.RECONNECT, this._onSignalingReconnect.bind(this));
8925
8929
  let n = await this._signaling.connect(e, t);
8926
8930
  return this._stats.statAggregator.logEventualStat({ name: V.SIGNALING_CONNECTED }), n;
8927
8931
  }
@@ -8974,7 +8978,7 @@ var eo = 90, to = 3, no = class extends g {
8974
8978
  let i = M.composeDecorativeId(n);
8975
8979
  this._registerParticipant({
8976
8980
  id: e,
8977
- externalId: Z.fromSignalingParticipant(n),
8981
+ externalId: Z.fromSignalingParticipant(n, !0, !0),
8978
8982
  mediaSettings: k(n.mediaSettings),
8979
8983
  participantState: M.mapParticipantState(n),
8980
8984
  state: n.state,
@@ -9006,7 +9010,7 @@ var eo = 90, to = 3, no = class extends g {
9006
9010
  }
9007
9011
  _getStatusByTransportState(e) {
9008
9012
  let t = null;
9009
- return e === W.CONNECTED ? t = P.CONNECTED : e === W.CONNECTING || e === W.OPENED ? t = P.CONNECTING : e === W.RECONNECTING && (t = P.RECONNECT), t;
9013
+ return e === K.CONNECTED ? t = P.CONNECTED : e === K.CONNECTING || e === K.OPENED ? t = P.CONNECTING : e === K.RECONNECTING && (t = P.RECONNECT), t;
9010
9014
  }
9011
9015
  _registerParticipantInCache(e) {
9012
9016
  return this._participants[e.id] = e, e;
@@ -9027,6 +9031,9 @@ var eo = 90, to = 3, no = class extends g {
9027
9031
  return this._api.cacheExternalId(e, t), t;
9028
9032
  }
9029
9033
  }
9034
+ _getExternalIdsByOkIdsFromCache(e) {
9035
+ return e.map((e) => this._api.getCachedExternalIdByOkId(e) ?? Z.fromId(String(e)));
9036
+ }
9030
9037
  async _registerParticipantAndSetMarkersIfChunkEnabled(e, t) {
9031
9038
  if (N.useParticipantListChunk) {
9032
9039
  let n = this._registerParticipantInCache(await this._getExistedParticipantByIdOrCreate(e));
@@ -9075,7 +9082,7 @@ var eo = 90, to = 3, no = class extends g {
9075
9082
  }
9076
9083
  async _allocateTransport() {
9077
9084
  if (!this._conversation || !this._mediaSource) return;
9078
- this._transport = new Yi(this._conversation.topology, this._signaling, this._mediaSource, this._serverSettings, this._debug, this._stats.logger, this._stats.statAggregator, this._stats.codecStatsAggregator), this._debugInfo = new no(this._debug), this.subscribe(this._transport, J.STATE_CHANGED, this._onTransportStateChanged.bind(this)), this.subscribe(this._transport, J.LOCAL_STATE_CHANGED, this._onTransportLocalStateChanged.bind(this)), this.subscribe(this._transport, J.REMOTE_TRACK_ADDED, this._onRemoteTrackAdded.bind(this)), this.subscribe(this._transport, J.REMOTE_TRACK_REMOVED, this._onRemoteTrackRemoved.bind(this)), this.subscribe(this._transport, J.AUDIO_MIX_STALL, this._onAudioMixStall.bind(this)), this.subscribe(this._transport, J.REMOTE_DATA_STATS, this._onRemoteDataStats.bind(this)), this.subscribe(this._transport, J.SIGNALLED_STALLED_PARTICIPANTS, this._onRemoteSignalledStall.bind(this)), this.subscribe(this._transport, J.TOPOLOGY_CHANGED, this._onTopologyChanged.bind(this)), this.subscribe(this._transport, J.NETWORK_STATUS, this._onNetworkStatus.bind(this)), this.subscribe(this._transport, J.REMOTE_STREAM_SECOND, this._onRemoteStreamSecond.bind(this)), this.subscribe(this._transport, J.PEER_CONNECTION_CLOSED, this._onPeerConnectionClosed.bind(this)), this.subscribe(this._transport, J.ASR_TRANSCRIPTION, this._onAsrTranscription.bind(this)), this.subscribe(this._transport, J.ANIMOJI_STREAM, this._onAnimojiStream.bind(this)), this.subscribe(this._transport, J.ANIMOJI_ERROR, this._onAnimojiError.bind(this));
9085
+ this._transport = new $i(this._conversation.topology, this._signaling, this._mediaSource, this._serverSettings, this._debug, this._stats.logger, this._stats.statAggregator, this._stats.codecStatsAggregator), this._debugInfo = new no(this._debug), this.subscribe(this._transport, J.STATE_CHANGED, this._onTransportStateChanged.bind(this)), this.subscribe(this._transport, J.LOCAL_STATE_CHANGED, this._onTransportLocalStateChanged.bind(this)), this.subscribe(this._transport, J.REMOTE_TRACK_ADDED, this._onRemoteTrackAdded.bind(this)), this.subscribe(this._transport, J.REMOTE_TRACK_REMOVED, this._onRemoteTrackRemoved.bind(this)), this.subscribe(this._transport, J.AUDIO_MIX_STALL, this._onAudioMixStall.bind(this)), this.subscribe(this._transport, J.REMOTE_DATA_STATS, this._onRemoteDataStats.bind(this)), this.subscribe(this._transport, J.SIGNALLED_STALLED_PARTICIPANTS, this._onRemoteSignalledStall.bind(this)), this.subscribe(this._transport, J.TOPOLOGY_CHANGED, this._onTopologyChanged.bind(this)), this.subscribe(this._transport, J.NETWORK_STATUS, this._onNetworkStatus.bind(this)), this.subscribe(this._transport, J.REMOTE_STREAM_SECOND, this._onRemoteStreamSecond.bind(this)), this.subscribe(this._transport, J.PEER_CONNECTION_CLOSED, this._onPeerConnectionClosed.bind(this)), this.subscribe(this._transport, J.ASR_TRANSCRIPTION, this._onAsrTranscription.bind(this)), this.subscribe(this._transport, J.ANIMOJI_STREAM, this._onAnimojiStream.bind(this)), this.subscribe(this._transport, J.ANIMOJI_ERROR, this._onAnimojiError.bind(this));
9079
9086
  let e = this._conversation.direction === Y.OUTGOING && !this._conversation.concurrent, t = await this._getParticipants();
9080
9087
  for (let n of Object.values(t)) (n.state === X.ACCEPTED || n.state === X.CALLED) && this._transport.allocate(n.id, e);
9081
9088
  }
@@ -9145,7 +9152,7 @@ var eo = 90, to = 3, no = class extends g {
9145
9152
  let n = M.composeDecorativeId(t);
9146
9153
  this._registerParticipant({
9147
9154
  id: e,
9148
- externalId: Z.fromSignalingParticipant(t),
9155
+ externalId: Z.fromSignalingParticipant(t, !0, !0),
9149
9156
  mediaSettings: k(t.mediaSettings),
9150
9157
  state: t.state,
9151
9158
  roles: t.roles || [],
@@ -9403,11 +9410,8 @@ var eo = 90, to = 3, no = class extends g {
9403
9410
  R.onChatRoomUpdated(e, t, l, [], []);
9404
9411
  return;
9405
9412
  }
9406
- if (c.length) {
9407
- let e = await this._api.getExternalIdsByOkIds(c);
9408
- l.push(...e);
9409
- }
9410
- let u = await this._api.getExternalIdsByOkIds(o), d = await this._api.getExternalIdsByOkIds(s);
9413
+ c.length && l.push(...this._getExternalIdsByOkIdsFromCache(c));
9414
+ let u = this._getExternalIdsByOkIdsFromCache(o), d = this._getExternalIdsByOkIdsFromCache(s);
9411
9415
  R.onChatRoomUpdated(e, t, l, u, d);
9412
9416
  }
9413
9417
  async _onSharedMovieUpdate(e) {
@@ -9651,7 +9655,7 @@ var eo = 90, to = 3, no = class extends g {
9651
9655
  let t = Z.fromSignaling(e.externalId);
9652
9656
  n.push(e.id.addedTs), r.push(t), this._api.cacheExternalId(e.id.id, t);
9653
9657
  } else i.push(M.decomposeId(e.id.id).id);
9654
- }), i.length && !r.length && (r = await this._api.getExternalIdsByOkIds(i), n = r.map((e) => {
9658
+ }), i.length && !r.length && (r = this._getExternalIdsByOkIdsFromCache(i), n = r.map((e) => {
9655
9659
  let n = this._api.getCachedOkIdByExternalId(e);
9656
9660
  return (n ? t.get(n) : void 0) || Date.now();
9657
9661
  }));
@@ -9822,7 +9826,7 @@ var eo = 90, to = 3, no = class extends g {
9822
9826
  let t = M.composeId(e);
9823
9827
  return this._createParticipant({
9824
9828
  id: t,
9825
- externalId: Z.fromSignalingParticipant(e),
9829
+ externalId: Z.fromSignalingParticipant(e, !0, !0),
9826
9830
  mediaSettings: k(e.mediaSettings),
9827
9831
  participantState: M.mapParticipantState(e),
9828
9832
  state: e.state,
@@ -9920,49 +9924,49 @@ var eo = 90, to = 3, no = class extends g {
9920
9924
  }
9921
9925
  _onSignalingNotification(e) {
9922
9926
  switch (e.notification) {
9923
- case K.ACCEPTED_CALL: return this._onAcceptedCall(e);
9924
- case K.HUNGUP: return this._onHungup(e);
9925
- case K.PARTICIPANT_ADDED: return this._onAddedParticipant(e);
9926
- case K.PARTICIPANT_JOINED: return this._onJoinedParticipant(e);
9927
- case K.CLOSED_CONVERSATION: return this._onClosedConversation(e);
9928
- case K.MEDIA_SETTINGS_CHANGED: return this._onMediaSettingsChanged(e);
9929
- case K.PARTICIPANT_STATE_CHANGED: return this._onParticipantStateChanged(e);
9930
- case K.PARTICIPANTS_STATE_CHANGED: return this._onParticipantsStateChanged(e);
9931
- case K.RATE_CALL_DATA: return this._onNeedRate();
9932
- case K.FEATURE_SET_CHANGED: return this._onFeatureSetChanged(e);
9933
- case K.MULTIPARTY_CHAT_CREATED: return this._onMultipartyChatCreated(e);
9934
- case K.FORCE_MEDIA_SETTINGS_CHANGE: return this._onForceMediaSettingsChange(e);
9935
- case K.SETTINGS_UPDATE: return this._onSettingsUpdate(e);
9936
- case K.VIDEO_QUALITY_UPDATE: return this._onVideoQualityUpdate(e);
9937
- case K.REGISTERED_PEER: return this._onPeerRegistered(e);
9938
- case K.SWITCH_MICRO: return this._onMicSwitched(e);
9939
- case K.CHAT_MESSAGE: return this._onChatMessage(e);
9940
- case K.CUSTOM_DATA: return this._onCustomData(e);
9941
- case K.RECORD_STARTED: return this._onRecordInfo(e.recordInfo, e.roomId);
9942
- case K.RECORD_STOPPED: return this._onStopRecordInfo(e, e.roomId);
9943
- case K.ROLES_CHANGED: return this._onRolesChanged(e.participantId, e.roles || []);
9944
- case K.MUTE_PARTICIPANT: return this._onMuteParticipant(e);
9945
- case K.PIN_PARTICIPANT: return this._onPinParticipant(e.participantId, e.unpin, e.markers, e.roomId);
9946
- case K.OPTIONS_CHANGED: return this._onOptionsChanged(e.options || []);
9947
- case K.PARTICIPANT_SOURCES_UPDATE: return this._onParticipantSourcesUpdate(e);
9948
- case K.PROMOTE_PARTICIPANT: return this._onParticipantPromoted(e);
9949
- case K.CHAT_ROOM_UPDATED: return this._onChatRoomUpdated(e.eventType, e.totalCount, e.firstParticipants, e.addedParticipantIds, e.removedParticipantIds);
9950
- case K.JOIN_LINK_CHANGED: return this._onJoinLinkChanged(e);
9951
- case K.FEEDBACK: return this._onFeedback(e);
9952
- case K.MOVIE_UPDATE_NOTIFICATION: return this._onSharedMovieUpdate(e);
9953
- case K.MOVIE_SHARE_STARTED: return this._onSharedMovieInfoStarted(e);
9954
- case K.MOVIE_SHARE_STOPPED: return this._onSharedMovieInfoStopped(e);
9955
- case K.URL_SHARING_INFO_UPDATED: return this._onUrlSharingInfoUpdated(e);
9956
- case K.ROOMS_UPDATED: return this._onRoomsUpdated(e);
9957
- case K.ROOM_UPDATED: return this._onRoomUpdated(e);
9958
- case K.ROOM_PARTICIPANTS_UPDATED: return this._onRoomParticipantsUpdated(e);
9959
- case K.FEATURES_PER_ROLE_CHANGED: return this._onFeaturesPerRoleChanged(e);
9960
- case K.PARTICIPANT_ANIMOJI_CHANGED: return this._onParticipantAnimojiChanged(e);
9961
- case K.ASR_STARTED: return this._onAsrStart(e);
9962
- case K.ASR_STOPPED: return this._onAsrStop(e);
9963
- case K.PROMOTION_APPROVED: return this._onPromotionApproved(e);
9964
- case K.DECORATIVE_PARTICIPANT_ID_CHANGED: return this._onDecorativeParticipantIdChanged(e);
9965
- case K.VIDEO_SUSPEND_SUGGEST: return this._onVideoSuspendSuggest(e);
9927
+ case G.ACCEPTED_CALL: return this._onAcceptedCall(e);
9928
+ case G.HUNGUP: return this._onHungup(e);
9929
+ case G.PARTICIPANT_ADDED: return this._onAddedParticipant(e);
9930
+ case G.PARTICIPANT_JOINED: return this._onJoinedParticipant(e);
9931
+ case G.CLOSED_CONVERSATION: return this._onClosedConversation(e);
9932
+ case G.MEDIA_SETTINGS_CHANGED: return this._onMediaSettingsChanged(e);
9933
+ case G.PARTICIPANT_STATE_CHANGED: return this._onParticipantStateChanged(e);
9934
+ case G.PARTICIPANTS_STATE_CHANGED: return this._onParticipantsStateChanged(e);
9935
+ case G.RATE_CALL_DATA: return this._onNeedRate();
9936
+ case G.FEATURE_SET_CHANGED: return this._onFeatureSetChanged(e);
9937
+ case G.MULTIPARTY_CHAT_CREATED: return this._onMultipartyChatCreated(e);
9938
+ case G.FORCE_MEDIA_SETTINGS_CHANGE: return this._onForceMediaSettingsChange(e);
9939
+ case G.SETTINGS_UPDATE: return this._onSettingsUpdate(e);
9940
+ case G.VIDEO_QUALITY_UPDATE: return this._onVideoQualityUpdate(e);
9941
+ case G.REGISTERED_PEER: return this._onPeerRegistered(e);
9942
+ case G.SWITCH_MICRO: return this._onMicSwitched(e);
9943
+ case G.CHAT_MESSAGE: return this._onChatMessage(e);
9944
+ case G.CUSTOM_DATA: return this._onCustomData(e);
9945
+ case G.RECORD_STARTED: return this._onRecordInfo(e.recordInfo, e.roomId);
9946
+ case G.RECORD_STOPPED: return this._onStopRecordInfo(e, e.roomId);
9947
+ case G.ROLES_CHANGED: return this._onRolesChanged(e.participantId, e.roles || []);
9948
+ case G.MUTE_PARTICIPANT: return this._onMuteParticipant(e);
9949
+ case G.PIN_PARTICIPANT: return this._onPinParticipant(e.participantId, e.unpin, e.markers, e.roomId);
9950
+ case G.OPTIONS_CHANGED: return this._onOptionsChanged(e.options || []);
9951
+ case G.PARTICIPANT_SOURCES_UPDATE: return this._onParticipantSourcesUpdate(e);
9952
+ case G.PROMOTE_PARTICIPANT: return this._onParticipantPromoted(e);
9953
+ case G.CHAT_ROOM_UPDATED: return this._onChatRoomUpdated(e.eventType, e.totalCount, e.firstParticipants, e.addedParticipantIds, e.removedParticipantIds);
9954
+ case G.JOIN_LINK_CHANGED: return this._onJoinLinkChanged(e);
9955
+ case G.FEEDBACK: return this._onFeedback(e);
9956
+ case G.MOVIE_UPDATE_NOTIFICATION: return this._onSharedMovieUpdate(e);
9957
+ case G.MOVIE_SHARE_STARTED: return this._onSharedMovieInfoStarted(e);
9958
+ case G.MOVIE_SHARE_STOPPED: return this._onSharedMovieInfoStopped(e);
9959
+ case G.URL_SHARING_INFO_UPDATED: return this._onUrlSharingInfoUpdated(e);
9960
+ case G.ROOMS_UPDATED: return this._onRoomsUpdated(e);
9961
+ case G.ROOM_UPDATED: return this._onRoomUpdated(e);
9962
+ case G.ROOM_PARTICIPANTS_UPDATED: return this._onRoomParticipantsUpdated(e);
9963
+ case G.FEATURES_PER_ROLE_CHANGED: return this._onFeaturesPerRoleChanged(e);
9964
+ case G.PARTICIPANT_ANIMOJI_CHANGED: return this._onParticipantAnimojiChanged(e);
9965
+ case G.ASR_STARTED: return this._onAsrStart(e);
9966
+ case G.ASR_STOPPED: return this._onAsrStop(e);
9967
+ case G.PROMOTION_APPROVED: return this._onPromotionApproved(e);
9968
+ case G.DECORATIVE_PARTICIPANT_ID_CHANGED: return this._onDecorativeParticipantIdChanged(e);
9969
+ case G.VIDEO_SUSPEND_SUGGEST: return this._onVideoSuspendSuggest(e);
9966
9970
  }
9967
9971
  }
9968
9972
  async _onPromotionApproved(e) {
@@ -10067,7 +10071,7 @@ var eo = 90, to = 3, no = class extends g {
10067
10071
  let { participant: r } = e, i = r.decorativeUserId;
10068
10072
  this._registerParticipant({
10069
10073
  id: t,
10070
- externalId: Z.fromSignalingParticipant(r),
10074
+ externalId: Z.fromSignalingParticipant(r, !0, !0),
10071
10075
  mediaSettings: k(r.mediaSettings),
10072
10076
  state: r.state,
10073
10077
  participantState: M.mapParticipantState(r),
@@ -10090,7 +10094,7 @@ var eo = 90, to = 3, no = class extends g {
10090
10094
  let { participant: r } = e, i = r.decorativeUserId;
10091
10095
  this._registerParticipant({
10092
10096
  id: t,
10093
- externalId: Z.fromSignalingParticipant(r),
10097
+ externalId: Z.fromSignalingParticipant(r, !0, !0),
10094
10098
  mediaSettings: k(r.mediaSettings),
10095
10099
  state: r.state,
10096
10100
  participantState: M.mapParticipantState(r),
@@ -10159,7 +10163,7 @@ var eo = 90, to = 3, no = class extends g {
10159
10163
  screenSharing: e.screenSharing,
10160
10164
  fastScreenSharing: e.fastScreenSharing
10161
10165
  };
10162
- this._serverSettings = _r(this._serverSettings, t), this._transport && this._transport.updateSettings(this._serverSettings);
10166
+ this._serverSettings = xr(this._serverSettings, t), this._transport && this._transport.updateSettings(this._serverSettings);
10163
10167
  }
10164
10168
  _onVideoQualityUpdate(e) {
10165
10169
  this._debug.debug("Got video quality update notification", e);
@@ -10175,7 +10179,7 @@ var eo = 90, to = 3, no = class extends g {
10175
10179
  camera: Object.assign({}, this._serverSettings.camera, t),
10176
10180
  screenSharing: null,
10177
10181
  fastScreenSharing: null
10178
- }, this._serverSettings = _r(this._serverSettings, n), this._transport && this._transport.updateSettings(this._serverSettings);
10182
+ }, this._serverSettings = xr(this._serverSettings, n), this._transport && this._transport.updateSettings(this._serverSettings);
10179
10183
  }
10180
10184
  async _onPeerRegistered(e) {
10181
10185
  let t = M.composeMessageId(e), n = await this._getParticipant(t);
@@ -10393,7 +10397,7 @@ var eo = 90, to = 3, no = class extends g {
10393
10397
  if (this._isMe(r) || r === "") e = this._conversation.networkRating;
10394
10398
  else if (n[r]) e = n[r].networkRating;
10395
10399
  else continue;
10396
- if (e !== i) if (this._isMe(r) || r === "") this._conversation.networkRating = i, Lr.getInstance().value = i, R.onLocalNetworkStatusChanged(i);
10400
+ if (e !== i) if (this._isMe(r) || r === "") this._conversation.networkRating = i, Vr.getInstance().value = i, R.onLocalNetworkStatusChanged(i);
10397
10401
  else {
10398
10402
  let e = n[r];
10399
10403
  e.networkRating = i, t.push({
@@ -10467,23 +10471,23 @@ var eo = 90, to = 3, no = class extends g {
10467
10471
  let r = await this._getParticipants(), i = [], a = e.reduce((e, n) => {
10468
10472
  if (n in r) {
10469
10473
  let a = r[n];
10470
- e.push(a), t === W.CONNECTED && (a.remoteStream || (a.mediaSettings && this._changeRemoteMediaSettings(n, a.mediaSettings), this._changeRemoteParticipantState(n, a.participantState)), i.push(...Object.values(a.lastRequestedLayouts)));
10474
+ e.push(a), t === K.CONNECTED && (a.remoteStream || (a.mediaSettings && this._changeRemoteMediaSettings(n, a.mediaSettings), this._changeRemoteParticipantState(n, a.participantState)), i.push(...Object.values(a.lastRequestedLayouts)));
10471
10475
  } else this._warnParticipantNotInConversation(n);
10472
10476
  return e;
10473
10477
  }, []);
10474
10478
  a.length && (this._updateDisplayLayoutFromCache(i), this._setParticipantsStatus(a, n));
10475
10479
  }
10476
10480
  async _onTransportLocalStateChanged(e) {
10477
- if (this._debug.debug(`Local transport state has changed: ${e}`), e === W.CONNECTED && (O.releaseFirefoxMicrophonePermissionWarmup(), R.onLocalStatus(P.CONNECTED), this._transport?.getTopology() === q.SERVER)) {
10481
+ if (this._debug.debug(`Local transport state has changed: ${e}`), e === K.CONNECTED && (O.releaseFirefoxMicrophonePermissionWarmup(), R.onLocalStatus(P.CONNECTED), this._transport?.getTopology() === q.SERVER)) {
10478
10482
  let e = Object.values(this._myLastRequestedLayouts);
10479
10483
  await this.updateDisplayLayout(e), this._displayLayoutRequester.resend();
10480
10484
  }
10481
- e === W.CONNECTING && R.onLocalStatus(P.CONNECTING), e === W.RECONNECTING && R.onLocalStatus(P.RECONNECT), e === W.FAILED && this._transport && this._transport.allocated().length === 0 && (this._signaling.ready && await this._signaling.hangup(_.FAILED), this._close(new v(_.FAILED), "Transport failed"));
10485
+ e === K.CONNECTING && R.onLocalStatus(P.CONNECTING), e === K.RECONNECTING && R.onLocalStatus(P.RECONNECT), e === K.FAILED && this._transport && this._transport.allocated().length === 0 && (this._signaling.ready && await this._signaling.hangup(_.FAILED), this._close(new v(_.FAILED), "Transport failed"));
10482
10486
  }
10483
10487
  async _onRemoteTrackAdded(e, t, n) {
10484
- if (e.endsWith(Nr.AUDIO_MIX)) this._debug.debug("Remote audio mix track added"), this._audioOutput.add(e, n), R.onRemoteMixedAudioStream(t);
10485
- else if (e.startsWith(Nr.TRANSPARENT_AUDIO_TRACK_PREFIX)) this._debug.debug(`Remote transparent audio track added: ${e}`), this._audioOutput.add(e, n);
10486
- else if (e.startsWith(Nr.PARTICIPANT_AGNOSTIC_TRACK_PREFIX)) this._debug.debug(`Participant-agnostic track added: ${e}`), this._streamByStreamId.set(e, t);
10488
+ if (e.endsWith(Lr.AUDIO_MIX)) this._debug.debug("Remote audio mix track added"), this._audioOutput.add(e, n), R.onRemoteMixedAudioStream(t);
10489
+ else if (e.startsWith(Lr.TRANSPARENT_AUDIO_TRACK_PREFIX)) this._debug.debug(`Remote transparent audio track added: ${e}`), this._audioOutput.add(e, n);
10490
+ else if (e.startsWith(Lr.PARTICIPANT_AGNOSTIC_TRACK_PREFIX)) this._debug.debug(`Participant-agnostic track added: ${e}`), this._streamByStreamId.set(e, t);
10487
10491
  else {
10488
10492
  this._debug.debug(`Remote track added on the participant [${e}]`, { kind: n.kind });
10489
10493
  let r = await this._getParticipant(e);
@@ -10510,7 +10514,7 @@ var eo = 90, to = 3, no = class extends g {
10510
10514
  }
10511
10515
  }
10512
10516
  async _removeAudioTrack(e, t, n) {
10513
- if (e !== Nr.AUDIO_MIX) {
10517
+ if (e !== Lr.AUDIO_MIX) {
10514
10518
  let n = await this._getParticipant(e);
10515
10519
  if (!n || n.remoteStream && n.remoteStream !== t) return;
10516
10520
  }
@@ -10607,7 +10611,7 @@ var eo = 90, to = 3, no = class extends g {
10607
10611
  };
10608
10612
  }
10609
10613
  async _onRoomParticipantsUpdated(e) {
10610
- let t = this._transport?.getState(), n = e.roomId ?? null, r = e.addedParticipantIds?.map((e) => M.decomposeId(e).id) || [], i = await this._api.getExternalIdsByOkIds(r), a = e.addedParticipants;
10614
+ let t = this._transport?.getState(), n = e.roomId ?? null, r = e.addedParticipantIds?.map((e) => M.decomposeId(e).id) || [], i = this._getExternalIdsByOkIdsFromCache(r), a = e.addedParticipants;
10611
10615
  if (i.length && a?.length !== i.length && !this._isCalledState()) {
10612
10616
  let e = this._convertExternalIdsToServerExternalIds(i);
10613
10617
  a = (await this._signaling.getParticipants(e)).participants;
@@ -10616,7 +10620,7 @@ var eo = 90, to = 3, no = class extends g {
10616
10620
  let r = M.composeId(e);
10617
10621
  return this._createParticipant({
10618
10622
  id: r,
10619
- externalId: Z.fromSignalingParticipant(e),
10623
+ externalId: Z.fromSignalingParticipant(e, !0, !0),
10620
10624
  mediaSettings: k(e.mediaSettings),
10621
10625
  participantState: M.mapParticipantState(e),
10622
10626
  state: e.state,
@@ -10630,7 +10634,7 @@ var eo = 90, to = 3, no = class extends g {
10630
10634
  }, e.decorativeUserId);
10631
10635
  }) || []), s = !1;
10632
10636
  for (let e of o) e.id === this._conversation?.compositeUserId && (s = !0), this._registerParticipantInCache(e);
10633
- this._transport?.getState() === W.IDLE && !this._isCalledState() && this._openTransport(o, !0);
10637
+ this._transport?.getState() === K.IDLE && !this._isCalledState() && this._openTransport(o, !0);
10634
10638
  let c = [], l = [];
10635
10639
  if (e?.removedParticipantMarkers) {
10636
10640
  for (let t of e.removedParticipantMarkers) if (t.GRID?.id) {
@@ -10735,7 +10739,7 @@ var eo = 90, to = 3, no = class extends g {
10735
10739
  this._conversation?.muteStates.set(t, e);
10736
10740
  }
10737
10741
  _forceOpenTransportForAloneInCall() {
10738
- this._transport?.getTopology() === q.SERVER && this._transport?.getState() === W.IDLE && !this._isCalledState() && this._transport.open(this._transport.allocated(), null, !!this._conversation?.observer, !0);
10742
+ this._transport?.getTopology() === q.SERVER && this._transport?.getState() === K.IDLE && !this._isCalledState() && this._transport.open(this._transport.allocated(), null, !!this._conversation?.observer, !0);
10739
10743
  }
10740
10744
  _registerParticipant(e, t) {
10741
10745
  let n = this._createParticipant(e, t);
@@ -10867,6 +10871,9 @@ var zo = class {
10867
10871
  getCachedRawOkIdByExternalId(e) {
10868
10872
  return null;
10869
10873
  }
10874
+ getCachedExternalIdByOkId(e) {
10875
+ return null;
10876
+ }
10870
10877
  cacheExternalId(e, t) {}
10871
10878
  mapDecorativeId(e, t) {}
10872
10879
  unmapDecorativeId(e) {}
@@ -10995,7 +11002,7 @@ var zo = class {
10995
11002
  }
10996
11003
  async userId(e) {
10997
11004
  let t = M.extractOkId(e);
10998
- return C.isEmpty() ? Z.fromId(String(t)) : (this._idCache.hasByOkId(t) || await this._getExternalIdsByOkIds([t]), this._idCache.getExternalId(t) || Z.fromId(String(t)));
11005
+ return C.isEmpty() ? Z.fromId(String(t)) : this._idCache.getExternalId(t) || Z.fromId(String(t));
10999
11006
  }
11000
11007
  async authorize() {
11001
11008
  if (this._ensureUuid(), !N.apiKey) throw new v(w.API, { message: "Required argument apiAppKey not passed" });
@@ -11164,22 +11171,15 @@ var zo = class {
11164
11171
  };
11165
11172
  return n?.length && (i.observedIds = n.join(",")), N.anonymToken && (i.anonymToken = N.anonymToken), r && (i.payload = r), this._call("vchat.joinConversationByLink", i);
11166
11173
  }
11167
- async getExternalIdsByOkIds(e) {
11168
- let t = [], n = [];
11169
- for (let r of e) {
11170
- let e = this._idCache.getExternalId(r);
11171
- e ? t.push(e) : n.push(r);
11172
- }
11173
- if (!n.length) return t;
11174
- let r = await this._getExternalIdsByOkIds(n);
11175
- return Array.from(r.values());
11176
- }
11177
11174
  getCachedOkIdByExternalId(e) {
11178
11175
  return this._idCache.getParticipantIdByExternalId(e);
11179
11176
  }
11180
11177
  getCachedRawOkIdByExternalId(e) {
11181
11178
  return this._idCache.getOkId(e);
11182
11179
  }
11180
+ getCachedExternalIdByOkId(e) {
11181
+ return this._idCache.getExternalId(e);
11182
+ }
11183
11183
  cacheExternalId(e, t) {
11184
11184
  this._idCache.cache(e, t);
11185
11185
  }
@@ -11218,29 +11218,6 @@ var zo = class {
11218
11218
  cleanup() {
11219
11219
  this._idCache.clear();
11220
11220
  }
11221
- async _getExternalIdsByOkIds(e) {
11222
- let t = /* @__PURE__ */ new Map();
11223
- e = e.map((e) => this.getDecorativeIdByInitialId(e) ?? e);
11224
- try {
11225
- let n = await this._call("vchat.getExternalIdsByOkIds", { uids: e.join(",") }), r = (e, n) => {
11226
- for (let [r, i] of Object.entries(e)) {
11227
- let e = Number(r), a = Z.fromId(i, n);
11228
- t.set(e, a), this.cacheExternalId(e, a);
11229
- }
11230
- };
11231
- n.external_ids && r(n.external_ids, za.USER), n.anonym_ids && r(n.anonym_ids, za.ANONYM);
11232
- for (let n of e) {
11233
- let e = Number(n);
11234
- if (!t.has(e)) {
11235
- let n = Z.fromId(String(e));
11236
- t.set(e, n), this.cacheExternalId(e, n);
11237
- }
11238
- }
11239
- return t;
11240
- } catch {
11241
- return t;
11242
- }
11243
- }
11244
11221
  async getServerTime() {
11245
11222
  return (await this._call("system.getInfo")).serverTime;
11246
11223
  }
@@ -11859,4 +11836,4 @@ function Hc() {
11859
11836
  }
11860
11837
  typeof window < "u" && (window.__CALLS_SDK = hn);
11861
11838
  //#endregion
11862
- export { Wo as Api, Xo as ApiExternal, Yo as ArrayDequeue, C as AuthData, f as BaseLogger, Y as CallDirection, Da as CallType, Oa as ChatRoomEventType, ka as ConversationFeature, Aa as ConversationOption, vn as DebugMessageType, za as ExternalIdType, jt as FacingMode, w as FatalError, v as HangupReason, _ as HangupType, T as MediaOption, A as MediaTrackKind, B as MediaType, Na as MuteState, X as ParticipantState, Jo as ParticipantStateDataValue, P as ParticipantStatus, qo as RecordRole, Pa as RoomsEventType, Ea as Signaling, y as SignalingCommandType, oa as SignalingConnectionType, K as SignalingNotification, q as TransportTopology, La as UserRole, j as UserType, ao as VolumeDetector, us as acceptCall, Dc as acceptPromotion, lc as activateRooms, ac as addMovie, gs as addParticipant, _s as addParticipantInternal, ls as authorize, Qo as browser, os as callInternal, as as callTo, xs as captureScreen, Ss as captureVmoji, yc as changeAudioEffect, Hs as changeConversationOptions, bs as changeDevice, Os as changeParticipantState, Ds as changePriorities, vc as changeVideoEffect, Gs as chatHistory, Us as chatMessage, Ws as chatMessageInternal, Xs as createJoinLink, Ks as customData, qs as customDataInternal, pc as debug, hc as debugLogs, mc as debugMessage, ds as declineCall, Nc as enableFeatureForRoles, Bs as enableVideoSuspend, Vs as enableVideoSuspendSuggest, Ac as feedback, ec as forceRelayPolicy, Qs as getAnonymTokenByLink, wc as getAudienceModeHands, Oc as getParticipantListChunk, kc as getParticipants, ic as getStreamInfo, Vc as getSyncedTime, Cc as getWaitingHall, Ns as grantRoles, Ps as grantRolesInternal, hs as hangup, ks as hold, is as init, fs as joinCall, ms as joinCallByLink, ps as joinCallInternal, Mc as logClientEvent, Fs as muteParticipant, Is as muteParticipantInternal, Ls as pinParticipant, Rs as pinParticipantInternal, ss as processPush, cs as processPushInternal, Tc as promoteParticipant, rc as publishStream, As as putHandsDown, Fc as removeHistoryRecords, Zs as removeJoinLink, sc as removeMovie, vs as removeParticipant, ys as removeParticipantInternal, dc as removeRooms, Rc as requestAsr, Ms as requestDisplayLayout, Ec as requestPromotion, ns as setAudioEffects, bc as setAudioStream, Es as setLocalResolution, es as setLogger, zs as setMediaModifiers, fc as setStatisticsInterval, ts as setVideoEffects, Cs as setVideoStream, rs as setVmoji, Sc as setVmojiFill, xc as setVmojiSvg, $s as setVolume, Ic as startAsr, Ys as startAudienceConversation, Js as startConversation, tc as startStream, zc as startUrlSharing, Lc as stopAsr, nc as stopStream, Bc as stopUrlSharing, uc as switchRoom, Ts as toggleLocalAudio, ws as toggleLocalVideo, js as updateDisplayLayout, oc as updateMovie, cc as updateRooms, _c as uploadDebugLogs, jc as userFeedbackStats, $o as utils, Hc as version };
11839
+ export { Wo as Api, Xo as ApiExternal, Yo as ArrayDequeue, C as AuthData, f as BaseLogger, Y as CallDirection, Da as CallType, Oa as ChatRoomEventType, ka as ConversationFeature, Aa as ConversationOption, vn as DebugMessageType, za as ExternalIdType, jt as FacingMode, w as FatalError, v as HangupReason, _ as HangupType, T as MediaOption, A as MediaTrackKind, B as MediaType, Na as MuteState, X as ParticipantState, Jo as ParticipantStateDataValue, P as ParticipantStatus, qo as RecordRole, Pa as RoomsEventType, Ea as Signaling, y as SignalingCommandType, dr as SignalingConnectionType, G as SignalingNotification, q as TransportTopology, La as UserRole, j as UserType, ao as VolumeDetector, us as acceptCall, Dc as acceptPromotion, lc as activateRooms, ac as addMovie, gs as addParticipant, _s as addParticipantInternal, ls as authorize, Qo as browser, os as callInternal, as as callTo, xs as captureScreen, Ss as captureVmoji, yc as changeAudioEffect, Hs as changeConversationOptions, bs as changeDevice, Os as changeParticipantState, Ds as changePriorities, vc as changeVideoEffect, Gs as chatHistory, Us as chatMessage, Ws as chatMessageInternal, Xs as createJoinLink, Ks as customData, qs as customDataInternal, pc as debug, hc as debugLogs, mc as debugMessage, ds as declineCall, Nc as enableFeatureForRoles, Bs as enableVideoSuspend, Vs as enableVideoSuspendSuggest, Ac as feedback, ec as forceRelayPolicy, Qs as getAnonymTokenByLink, wc as getAudienceModeHands, Oc as getParticipantListChunk, kc as getParticipants, ic as getStreamInfo, Vc as getSyncedTime, Cc as getWaitingHall, Ns as grantRoles, Ps as grantRolesInternal, hs as hangup, ks as hold, is as init, fs as joinCall, ms as joinCallByLink, ps as joinCallInternal, Mc as logClientEvent, Fs as muteParticipant, Is as muteParticipantInternal, Ls as pinParticipant, Rs as pinParticipantInternal, ss as processPush, cs as processPushInternal, Tc as promoteParticipant, rc as publishStream, As as putHandsDown, Fc as removeHistoryRecords, Zs as removeJoinLink, sc as removeMovie, vs as removeParticipant, ys as removeParticipantInternal, dc as removeRooms, Rc as requestAsr, Ms as requestDisplayLayout, Ec as requestPromotion, ns as setAudioEffects, bc as setAudioStream, Es as setLocalResolution, es as setLogger, zs as setMediaModifiers, fc as setStatisticsInterval, ts as setVideoEffects, Cs as setVideoStream, rs as setVmoji, Sc as setVmojiFill, xc as setVmojiSvg, $s as setVolume, Ic as startAsr, Ys as startAudienceConversation, Js as startConversation, tc as startStream, zc as startUrlSharing, Lc as stopAsr, nc as stopStream, Bc as stopUrlSharing, uc as switchRoom, Ts as toggleLocalAudio, ws as toggleLocalVideo, js as updateDisplayLayout, oc as updateMovie, cc as updateRooms, _c as uploadDebugLogs, jc as userFeedbackStats, $o as utils, Hc as version };