@vkontakte/calls-sdk 2.8.11-dev.50a3a6bf.0 → 2.8.11-dev.54118420.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.50a3a6bf.0
3
- * Fri, 03 Jul 2026 12:07:55 GMT
2
+ * @vkontakte/calls-sdk v2.8.11-dev.54118420.0
3
+ * Mon, 13 Jul 2026 09:32:12 GMT
4
4
  * https://calls-sdk.cdn-vk.ru/doc/latest/index.html
5
5
  */
6
6
 
@@ -55,31 +55,31 @@ function h(e, t, n) {
55
55
  }
56
56
  //#endregion
57
57
  //#region src/utils/DebugStorage.ts
58
- var te = 25 * 1024 * 1024, ne = 10, re = "_okcls_logs_session_", ie = 3e4, ae = "ok-calls-sdk-debug-logs", oe = 1, g = "sessions", _ = "chunks", se = 120 * 1e3, ce = new Set(["WARN", "ERROR"]);
59
- function le() {
60
- return `${Date.now()}_${Math.random().toString(36).slice(2)}`;
61
- }
58
+ var te = 25 * 1024 * 1024, ne = 10, re = "_okcls_logs_session_", ie = 3e4, ae = "ok-calls-sdk-debug-logs", oe = 1, g = "sessions", se = "chunks", ce = 120 * 1e3, le = new Set(["WARN", "ERROR"]);
62
59
  function ue() {
63
- let e = le();
64
- return de(e), e;
60
+ return `${Date.now()}_${Math.random().toString(36).slice(2)}`;
65
61
  }
66
- function de(e) {
67
- He.has(e) || He.set(e, []), Ue.has(e) || Ue.set(e, 0), We.has(e) || We.set(e, null);
62
+ function de() {
63
+ let e = ue();
64
+ return fe(e), e;
68
65
  }
69
66
  function fe(e) {
70
- return We.get(e) ?? null;
67
+ Ue.has(e) || Ue.set(e, []), We.has(e) || We.set(e, 0), Ge.has(e) || Ge.set(e, null);
71
68
  }
72
69
  function pe(e) {
73
- let t = Ue.get(e) ?? 0;
74
- return Ue.set(e, t + 1), t;
70
+ return Ge.get(e) ?? null;
75
71
  }
76
- function me(e, t) {
72
+ function me(e) {
73
+ let t = We.get(e) ?? 0;
74
+ return We.set(e, t + 1), t;
75
+ }
76
+ function he(e, t) {
77
77
  return `${e}:${String(t).padStart(12, "0")}`;
78
78
  }
79
- function he(e) {
79
+ function ge(e) {
80
80
  return new Blob([e]).size;
81
81
  }
82
- function ge() {
82
+ function _e() {
83
83
  try {
84
84
  let e = window.localStorage;
85
85
  for (let t of Object.keys(e)) t.indexOf(re) === 0 && e.removeItem(t);
@@ -87,7 +87,7 @@ function ge() {
87
87
  console.error("Storage is blocked", e);
88
88
  }
89
89
  }
90
- var v = new class {
90
+ var _ = new class {
91
91
  constructor() {
92
92
  h(this, "_db", null), h(this, "_dbPromise", null), h(this, "_supported", this.isSupported());
93
93
  }
@@ -140,7 +140,7 @@ var v = new class {
140
140
  async getChunksBySession(e) {
141
141
  let t = await this.open();
142
142
  if (!t) return [];
143
- let n = t.transaction(_, "readonly"), r = await this.requestToPromise(n.objectStore(_).index("sessionId").getAll(e));
143
+ let n = t.transaction(se, "readonly"), r = await this.requestToPromise(n.objectStore(se).index("sessionId").getAll(e));
144
144
  return await this.txDone(n), r.sort((e, t) => e.sequence - t.sequence);
145
145
  }
146
146
  async putSession(e) {
@@ -152,8 +152,8 @@ var v = new class {
152
152
  async putSessionAndChunk(e, t) {
153
153
  let n = await this.open();
154
154
  if (!n) return !1;
155
- let r = n.transaction([g, _], "readwrite");
156
- return r.objectStore(g).put(e), r.objectStore(_).put(t), await this.txDone(r), !0;
155
+ let r = n.transaction([g, se], "readwrite");
156
+ return r.objectStore(g).put(e), r.objectStore(se).put(t), await this.txDone(r), !0;
157
157
  }
158
158
  async updateSessionConversationId(e, t) {
159
159
  let [n] = await this.getSessionBySessionId(e);
@@ -166,14 +166,14 @@ var v = new class {
166
166
  async deleteSession(e) {
167
167
  let t = await this.open();
168
168
  if (!t) return 0;
169
- let n = await this.getChunksBySession(e), r = t.transaction([g, _], "readwrite"), i = r.objectStore(_), a = 0;
169
+ let n = await this.getChunksBySession(e), r = t.transaction([g, se], "readwrite"), i = r.objectStore(se), a = 0;
170
170
  for (let e of n) a += e.bytes, i.delete(e.id);
171
171
  return r.objectStore(g).delete(e), await this.txDone(r), a;
172
172
  }
173
173
  async deleteChunks(e) {
174
174
  let t = await this.open();
175
175
  if (!t || !e.length) return;
176
- let n = t.transaction(_, "readwrite"), r = n.objectStore(_);
176
+ let n = t.transaction(se, "readwrite"), r = n.objectStore(se);
177
177
  for (let t of e) r.delete(t.id);
178
178
  await this.txDone(n);
179
179
  }
@@ -207,7 +207,7 @@ var v = new class {
207
207
  let t = e.createObjectStore(g, { keyPath: "sessionId" });
208
208
  t.createIndex("conversationId", "conversationId", { unique: !1 }), t.createIndex("updatedAt", "updatedAt", { unique: !1 });
209
209
  }
210
- e.objectStoreNames.contains(_) || e.createObjectStore(_, { keyPath: "id" }).createIndex("sessionId", "sessionId", { unique: !1 });
210
+ e.objectStoreNames.contains(se) || e.createObjectStore(se, { keyPath: "id" }).createIndex("sessionId", "sessionId", { unique: !1 });
211
211
  }
212
212
  isSupported() {
213
213
  return typeof window < "u" && !!window.indexedDB;
@@ -278,15 +278,15 @@ var v = new class {
278
278
  return i;
279
279
  }
280
280
  }();
281
- async function _e(e) {
282
- return e.sessionId ? v.getSessionBySessionId(e.sessionId) : e.conversationId ? v.getSessionsByConversationId(e.conversationId) : [];
281
+ async function ve(e) {
282
+ return e.sessionId ? _.getSessionBySessionId(e.sessionId) : e.conversationId ? _.getSessionsByConversationId(e.conversationId) : [];
283
283
  }
284
- async function ve(e, t, n, r) {
284
+ async function ye(e, t, n, r) {
285
285
  if (!r.length) return;
286
- let i = fe(e) || t, a = r, o = JSON.stringify(a), s = he(o);
287
- for (; s > te && a.length > 1;) a = a.slice(Math.floor(a.length / 2)), o = JSON.stringify(a), s = he(o);
286
+ let i = pe(e) || t, a = r, o = JSON.stringify(a), s = ge(o);
287
+ for (; s > te && a.length > 1;) a = a.slice(Math.floor(a.length / 2)), o = JSON.stringify(a), s = ge(o);
288
288
  if (s > te) return;
289
- let c = a[0].t, l = a[a.length - 1].t, [u] = await v.getSessionBySessionId(e), d = u || {
289
+ let c = a[0].t, l = a[a.length - 1].t, [u] = await _.getSessionBySessionId(e), d = u || {
290
290
  sessionId: e,
291
291
  conversationId: i,
292
292
  startTime: c,
@@ -303,7 +303,7 @@ async function ve(e, t, n, r) {
303
303
  bytes: d.bytes + s,
304
304
  entriesCount: d.entriesCount + a.length
305
305
  }, p = {
306
- id: me(e, n),
306
+ id: he(e, n),
307
307
  sessionId: e,
308
308
  sequence: n,
309
309
  startTime: c,
@@ -311,9 +311,9 @@ async function ve(e, t, n, r) {
311
311
  bytes: s,
312
312
  items: a
313
313
  };
314
- await v.putSessionAndChunk(f, p) && await v.enforceRetentionPolicy();
314
+ await _.putSessionAndChunk(f, p) && await _.enforceRetentionPolicy();
315
315
  }
316
- function ye(e) {
316
+ function be(e) {
317
317
  let t = /* @__PURE__ */ new WeakSet();
318
318
  try {
319
319
  return JSON.parse(JSON.stringify(e, (e, n) => {
@@ -328,101 +328,101 @@ function ye(e) {
328
328
  return e.map((e) => String(e));
329
329
  }
330
330
  }
331
- function be(e) {
332
- let t = He.get(e);
333
- if (!t?.length) return qe;
334
- let n = t.splice(0), r = fe(e), i = pe(e);
335
- return qe = qe.then(() => ve(e, r, i, n)).catch((e) => {
331
+ function xe(e) {
332
+ let t = Ue.get(e);
333
+ if (!t?.length) return Je;
334
+ let n = t.splice(0), r = pe(e), i = me(e);
335
+ return Je = Je.then(() => ye(e, r, i, n)).catch((e) => {
336
336
  console.warn("Failed to write debug log to storage", e);
337
- }), qe;
337
+ }), Je;
338
338
  }
339
- function xe(e) {
340
- if (e) return be(e);
341
- for (let e of He.keys()) be(e);
342
- return qe;
339
+ function Se(e) {
340
+ if (e) return xe(e);
341
+ for (let e of Ue.keys()) xe(e);
342
+ return Je;
343
343
  }
344
- async function Se(e) {
344
+ async function Ce(e) {
345
345
  let t = [];
346
346
  for (let n of e.sort((e, t) => e.startTime - t.startTime)) {
347
- let e = await v.getChunksBySession(n.sessionId);
347
+ let e = await _.getChunksBySession(n.sessionId);
348
348
  for (let n of e) t.push(...n.items);
349
349
  }
350
350
  return t;
351
351
  }
352
- async function Ce(e) {
353
- let t = await Se(e);
352
+ async function we(e) {
353
+ let t = await Ce(e);
354
354
  if (!t.length) return t;
355
- let n = t.sort(Te), r = n[0].t, i = n[n.length - 1].t;
356
- return [...await we(r, i, new Set(e.map((e) => e.sessionId))), ...n].sort(Te);
355
+ let n = t.sort(Ee), r = n[0].t, i = n[n.length - 1].t;
356
+ return [...await Te(r, i, new Set(e.map((e) => e.sessionId))), ...n].sort(Ee);
357
357
  }
358
- async function we(e, t, n) {
359
- let r = (await v.getAllSessions()).filter((r) => !n.has(r.sessionId) && r.conversationId === null && r.endTime >= e - se && r.startTime <= t), i = [];
358
+ async function Te(e, t, n) {
359
+ let r = (await _.getAllSessions()).filter((r) => !n.has(r.sessionId) && r.conversationId === null && r.endTime >= e - ce && r.startTime <= t), i = [];
360
360
  for (let n of r) {
361
- let r = await v.getChunksBySession(n.sessionId);
362
- for (let n of r) n.endTime < e - se || n.startTime > t || i.push(...n.items.filter((n) => n.t >= e - se && n.t <= e ? !0 : n.t >= e && n.t <= t && ce.has(n.l)));
361
+ let r = await _.getChunksBySession(n.sessionId);
362
+ 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)));
363
363
  }
364
364
  return i;
365
365
  }
366
- function Te(e, t) {
366
+ function Ee(e, t) {
367
367
  return e.t - t.t;
368
368
  }
369
- function Ee(e, t) {
369
+ function De(e, t) {
370
370
  let n = document.createElement("a"), r = new Blob([e], { type: "text/json" }), i = URL.createObjectURL(r);
371
371
  n.href = i, n.download = t, n.click(), URL.revokeObjectURL(i);
372
372
  }
373
- function De() {
374
- xe();
375
- }
376
373
  function Oe() {
377
- document.visibilityState === "hidden" && xe();
374
+ Se();
375
+ }
376
+ function ke() {
377
+ document.visibilityState === "hidden" && Se();
378
378
  }
379
- function ke(e, t, n = Ge) {
380
- Ve || Ae(), de(n);
379
+ function Ae(e, t, n = Ke) {
380
+ He || je(), fe(n);
381
381
  let r = /* @__PURE__ */ new Date(), i = {
382
382
  t: r.getTime(),
383
383
  l: e,
384
- d: ye(t),
384
+ d: be(t),
385
385
  h: r.toLocaleString("ru-RU", {
386
386
  dateStyle: "short",
387
387
  timeStyle: "long"
388
388
  })
389
389
  };
390
- return He.get(n)?.push(i), Ke || (Ke = window.setTimeout(() => {
391
- Ke = null, xe();
390
+ return Ue.get(n)?.push(i), qe || (qe = window.setTimeout(() => {
391
+ qe = null, Se();
392
392
  }, ie)), i;
393
393
  }
394
- function Ae() {
395
- Ve || (Ve = !0, ge(), v.open(), window.addEventListener("pagehide", De), document.addEventListener("visibilitychange", Oe));
396
- }
397
394
  function je() {
398
- return Ve || Ae(), xe(), ue();
395
+ He || (He = !0, _e(), _.open(), window.addEventListener("pagehide", Oe), document.addEventListener("visibilitychange", ke));
399
396
  }
400
- function Me(e, t = Ge) {
401
- t && (de(t), We.set(t, e), e && v.updateSessionConversationId(t, e));
397
+ function Me() {
398
+ return He || je(), Se(), de();
402
399
  }
403
- async function Ne() {
404
- return await xe(), (await v.getAllSessions()).sort((e, t) => t.updatedAt - e.updatedAt);
400
+ function Ne(e, t = Ke) {
401
+ t && (fe(t), Ge.set(t, e), e && _.updateSessionConversationId(t, e));
405
402
  }
406
- async function Pe(e) {
407
- return await xe(), Ce(await _e(e));
403
+ async function Pe() {
404
+ return await Se(), (await _.getAllSessions()).sort((e, t) => t.updatedAt - e.updatedAt);
408
405
  }
409
406
  async function Fe(e) {
410
- return JSON.stringify(await Pe(e));
407
+ return await Se(), we(await ve(e));
411
408
  }
412
409
  async function Ie(e) {
413
- let t = await Fe(e), n = `logs_${e.sessionId || e.conversationId}_${Date.now()}.json`;
414
- return Ee(t, n), n;
410
+ return JSON.stringify(await Fe(e));
415
411
  }
416
412
  async function Le(e) {
417
- await xe();
418
- let t = e ? await _e(e) : await v.getAllSessions();
419
- for (let e of t) await v.deleteSession(e.sessionId);
413
+ let t = await Ie(e), n = `logs_${e.sessionId || e.conversationId}_${Date.now()}.json`;
414
+ return De(t, n), n;
415
+ }
416
+ async function Re(e) {
417
+ await Se();
418
+ let t = e ? await ve(e) : await _.getAllSessions();
419
+ for (let e of t) await _.deleteSession(e.sessionId);
420
420
  }
421
- async function Re() {
422
- await xe();
423
- let e = await v.getStorageSummary(), t = await v.estimateStorage();
421
+ async function ze() {
422
+ await Se();
423
+ let e = await _.getStorageSummary(), t = await _.estimateStorage();
424
424
  return {
425
- supported: v.supported,
425
+ supported: _.supported,
426
426
  callsCount: e.callsCount,
427
427
  sessionsCount: e.sessions.length,
428
428
  usedBytes: e.usedBytes,
@@ -432,20 +432,20 @@ async function Re() {
432
432
  usageBytes: t?.usage
433
433
  };
434
434
  }
435
- async function ze() {
436
- await xe();
437
- let e = await Se(await v.getAllSessions());
438
- return JSON.stringify(e.sort(Te));
439
- }
440
435
  async function Be() {
441
- let e = await ze(), t = `logs_${Date.now()}.json`;
442
- return Ee(e, t), t;
436
+ await Se();
437
+ let e = await Ce(await _.getAllSessions());
438
+ return JSON.stringify(e.sort(Ee));
443
439
  }
444
- var Ve = !1, He = /* @__PURE__ */ new Map(), Ue = /* @__PURE__ */ new Map(), We = /* @__PURE__ */ new Map(), Ge = ue(), Ke = null, qe = Promise.resolve();
445
- window.__VKCallsSDKLogs__ = (e = !1) => (Ve || Ae(), e ? ze() : Be());
440
+ async function Ve() {
441
+ let e = await Be(), t = `logs_${Date.now()}.json`;
442
+ return De(e, t), t;
443
+ }
444
+ var He = !1, Ue = /* @__PURE__ */ new Map(), We = /* @__PURE__ */ new Map(), Ge = /* @__PURE__ */ new Map(), Ke = de(), qe = null, Je = Promise.resolve();
445
+ window.__VKCallsSDKLogs__ = (e = !1) => (He || je(), e ? Be() : Ve());
446
446
  //#endregion
447
447
  //#region src/static/AuthData.ts
448
- var y = class e {
448
+ var v = class e {
449
449
  static get sessionKey() {
450
450
  return e._sessionKey;
451
451
  }
@@ -468,10 +468,10 @@ var y = class e {
468
468
  return !e._sessionKey;
469
469
  }
470
470
  };
471
- h(y, "_sessionKey", void 0), h(y, "_sessionSecretKey", void 0), h(y, "_accessToken", void 0);
471
+ h(v, "_sessionKey", void 0), h(v, "_sessionSecretKey", void 0), h(v, "_accessToken", void 0);
472
472
  //#endregion
473
473
  //#region src/classes/EventEmitter.ts
474
- var b = class {
474
+ var y = class {
475
475
  constructor() {
476
476
  h(this, "_handlers", {}), h(this, "_listeners", []);
477
477
  }
@@ -497,14 +497,14 @@ var b = class {
497
497
  e.dispose();
498
498
  });
499
499
  }
500
- }, x = /* @__PURE__ */ function(e) {
500
+ }, b = /* @__PURE__ */ function(e) {
501
501
  return e.MIC_CAMERA_PERMISSION = "mic_camera", e.CAMERA_PERMISSION = "camera", e.MIC_PERMISSION = "mic", e.CAMERA_ACCESS = "cameralock", e.MIC_ACCESS = "miclock", e.MIC_NOT_FOUND = "nomic", e.SCREEN_PERMISSION = "screenpermission", e.SCREEN_ACCESS = "screenlock", e.CONNECTION = "connection", e.NETWORK = "network", e.UNKNOWN = "unknown", e.UNSUPPORTED = "unsupported", e.SIGNALING_FAILED = "signalingfailed", e.API = "api", e.AUTH = "auth", e.OVERCONSTRAINED = "overconstrained", e;
502
- }(x || {}), S = /* @__PURE__ */ function(e) {
502
+ }(b || {}), x = /* @__PURE__ */ function(e) {
503
503
  return e.AUDIO = "AUDIO", e.VIDEO = "VIDEO", e.SCREEN_SHARING = "SCREEN_SHARING", e.MOVIE_SHARING = "MOVIE_SHARING", e.AUDIO_SHARING = "AUDIO_SHARING", e.ANIMOJI = "ANIMOJI", e;
504
- }(S || {}), C = /* @__PURE__ */ function(e) {
504
+ }(x || {}), S = /* @__PURE__ */ function(e) {
505
505
  return e.ACCEPT_CONCURRENT = "callAcceptConcurrent", e.ACCEPT_INCOMING = "callAcceptIncoming", e.ACCEPTED_OUTGOING = "callAcceptedOutgoing", e.ADD_PARTICIPANT = "callAddParticipant", e.CALL_SPEC_ERROR = "callSpecError", e.DECLINE_INCOMING = "callDeclineIncoming", e.DEVICE_CHANGED = "callDeviceChanged", e.DEVICES = "callDevices", e.ERROR = "callError", e.HANGUP = "callHangup", e.ICE_CONNECTION_STATE = "callIceConnectionState", e.ICE_CONNECTION_TYPE = "callIceConnectionType", e.ICE_RESTART = "callIceRestart", e.JOIN_CONVERSATION = "callJoinConversation", e.MEDIA_STATUS = "callMediaStatus", e.OUTGOING_CALL = "callStart", e.OUTGOING_MULTIPARTY_CALL = "callStartMultiparty", e.PAT_ALLOCATED = "patAllocate", e.PAT_DEALLOCATED = "patDeallocate", e.PAT_ERROR = "patError", e.PAT_OUTDATED_RESPONSE = "patOutdatedResponse", e.PAT_WAITING_TIME_ERROR = "patWaitingTimeError", e.POOR_CONNECTION = "callPoorConnection", e.PUSH = "callPush", e.RECONNECT = "callReconnect", e.RELAY_POLICY = "callForceRelay", e.REMOVE_PARTICIPANT = "callRemoveParticipant", e.SOCKET_ACTION = "callSocketAction", e.TOPOLOGY_CHANGE_REQUESTED = "callTopologyChangeRequested", e;
506
- }(C || {}), Je = (e) => e.stop(), Ye = (e) => e.getTracks().forEach(Je), Xe = (e) => e.getVideoTracks().forEach(Je);
507
- async function Ze(e, t) {
506
+ }(S || {}), Ye = (e) => e.stop(), Xe = (e) => e.getTracks().forEach(Ye), Ze = (e) => e.getVideoTracks().forEach(Ye);
507
+ async function Qe(e, t) {
508
508
  try {
509
509
  let n = typeof t.width == "number" ? t.width : void 0, r = typeof t.height == "number" ? t.height : void 0;
510
510
  await e.applyConstraints({
@@ -524,7 +524,7 @@ async function Ze(e, t) {
524
524
  }
525
525
  //#endregion
526
526
  //#region src/utils/NavigatorPermissions.ts
527
- var Qe = class {
527
+ var $e = class {
528
528
  constructor() {
529
529
  h(this, "_cameraPermissionStatus", void 0), h(this, "_microphonePermissionStatus", void 0), h(this, "_listener", void 0);
530
530
  }
@@ -565,7 +565,7 @@ var Qe = class {
565
565
  }
566
566
  return t;
567
567
  }
568
- }, $e = "_okcls_", et = (() => {
568
+ }, et = "_okcls_", tt = (() => {
569
569
  try {
570
570
  let e = Date.now().toString(), t = window.localStorage, n = !1;
571
571
  return t.setItem(e, e), n = t.getItem(e) === e, t.removeItem(e), n ? t : null;
@@ -573,8 +573,8 @@ var Qe = class {
573
573
  return null;
574
574
  }
575
575
  })();
576
- function tt(e) {
577
- let t = et ? et.getItem($e + e) : null;
576
+ function nt(e) {
577
+ let t = tt ? tt.getItem(et + e) : null;
578
578
  if (t === null) return null;
579
579
  try {
580
580
  return JSON.parse(t);
@@ -582,30 +582,30 @@ function tt(e) {
582
582
  return null;
583
583
  }
584
584
  }
585
- function nt(e, t) {
585
+ function rt(e, t) {
586
586
  try {
587
- et && et.setItem($e + e, JSON.stringify(t));
587
+ tt && tt.setItem(et + e, JSON.stringify(t));
588
588
  } catch {}
589
589
  }
590
- function rt(e) {
591
- et && et.removeItem($e + e);
590
+ function it(e) {
591
+ tt && tt.removeItem(et + e);
592
592
  }
593
- var it;
593
+ var at;
594
594
  (function(e) {
595
595
  function t(e) {
596
- return tt(e) || null;
596
+ return nt(e) || null;
597
597
  }
598
598
  e.get = t;
599
599
  function n(e, t) {
600
- nt(e, t);
600
+ rt(e, t);
601
601
  }
602
602
  e.set = n;
603
603
  function r(e) {
604
- rt(e);
604
+ it(e);
605
605
  }
606
606
  e.remove = r;
607
- })(it || (it = {}));
608
- var at = it, ot = null, st = null, ct = null, lt = [], ut = [], dt = [], ft = null, pt = null, mt = null, ht = !1, gt = !1, _t, vt, yt, bt = null, xt = null, St = "", Ct = null, wt = [], Tt = null, Et = navigator.appVersion, Dt = navigator.appName, Ot = navigator.userAgent, kt = {}, At = /* @__PURE__ */ function(e) {
607
+ })(at || (at = {}));
608
+ var ot = at, st = null, ct = null, lt = null, ut = [], dt = [], ft = [], pt = null, mt = null, ht = null, gt = !1, _t = !1, vt, yt, bt, xt = null, St = null, Ct = "", wt = null, Tt = [], Et = null, Dt = navigator.appVersion, Ot = navigator.appName, C = navigator.userAgent, kt = {}, At = /* @__PURE__ */ function(e) {
609
609
  return e.USER = "user", e.ENVIRONMENT = "environment", e;
610
610
  }({});
611
611
  (function(e) {
@@ -625,8 +625,8 @@ var jt = class {
625
625
  autoGainControl: !0
626
626
  };
627
627
  let t = w.getMicrophones(), n, r;
628
- if (pt && (r = pt.groupId, n = pt.deviceId), typeof e == "string") r = t.find((t) => t.deviceId === e)?.groupId, n = e;
629
- else if (!pt && w.os() === "MacOS" && t.find((e) => e.label.includes("iPhone"))) {
628
+ if (mt && (r = mt.groupId, n = mt.deviceId), typeof e == "string") r = t.find((t) => t.deviceId === e)?.groupId, n = e;
629
+ else if (!mt && w.os() === "MacOS" && t.find((e) => e.label.includes("iPhone"))) {
630
630
  let e = t.find((e) => !e.label.includes("Virtual") && !e.label.includes("iPhone"));
631
631
  e && (r = e.groupId, n = e.deviceId);
632
632
  }
@@ -649,8 +649,8 @@ var jt = class {
649
649
  frameRate: { ideal: i }
650
650
  };
651
651
  let e = w.getCameras(), a, s;
652
- if (ft && (s = ft.groupId, a = ft.deviceId), typeof t == "string") s = e.find((e) => e.deviceId === t)?.groupId, a = t;
653
- else if (!ft && w.os() === "MacOS" && e.find((e) => e.label.includes("iPhone"))) {
652
+ if (pt && (s = pt.groupId, a = pt.deviceId), typeof t == "string") s = e.find((e) => e.deviceId === t)?.groupId, a = t;
653
+ else if (!pt && w.os() === "MacOS" && e.find((e) => e.label.includes("iPhone"))) {
654
654
  let t = e.find((e) => !e.label.includes("Virtual") && !e.label.includes("iPhone"));
655
655
  t && (s = t.groupId, a = t.deviceId);
656
656
  }
@@ -701,7 +701,7 @@ var jt = class {
701
701
  h(this, "_lockId", Math.round(Math.random() * 99998) + 1);
702
702
  }
703
703
  busy(t = null) {
704
- if (e._lockId) throw t?.log(C.ERROR, "change_device"), R.warn("Device change failed: MediaSource is busy"), Error("MediaSource is busy");
704
+ if (e._lockId) throw t?.log(S.ERROR, "change_device"), R.warn("Device change failed: MediaSource is busy"), Error("MediaSource is busy");
705
705
  e._lockId = this._lockId;
706
706
  }
707
707
  free() {
@@ -710,7 +710,7 @@ var jt = class {
710
710
  };
711
711
  h(Nt, "_lockId", 0);
712
712
  async function Pt() {
713
- gt = !1, ht = !1, ot = null;
713
+ _t = !1, gt = !1, st = null;
714
714
  let e = {
715
715
  camera: w.getSavedCamera(),
716
716
  microphone: w.getSavedMicrophone(),
@@ -722,18 +722,18 @@ function Ft(e, ...t) {
722
722
  if (kt[e]) for (let n of kt[e]) n(...t);
723
723
  }
724
724
  async function It() {
725
- return ot || (!navigator.mediaDevices || !navigator.mediaDevices.enumerateDevices ? [] : (!st && navigator.mediaDevices.addEventListener && (st = j.debounce(Pt, M.enumerateDevicesDelay), navigator.mediaDevices.addEventListener("devicechange", st)), !ct && Qe.isSupported() && (ct = new Qe(), await ct.init((e, t) => {
725
+ return st || (!navigator.mediaDevices || !navigator.mediaDevices.enumerateDevices ? [] : (!ct && navigator.mediaDevices.addEventListener && (ct = j.debounce(Pt, M.enumerateDevicesDelay), navigator.mediaDevices.addEventListener("devicechange", ct)), !lt && $e.isSupported() && (lt = new $e(), await lt.init((e, t) => {
726
726
  switch (t) {
727
727
  case "denied":
728
728
  case "prompt":
729
- st?.();
729
+ ct?.();
730
730
  break;
731
731
  }
732
- })), ot = navigator.mediaDevices.enumerateDevices().then((e) => {
733
- lt = e.filter((e) => e.kind === "videoinput" ? (e.label && (ht = !0), !0) : !1), ut = e.filter((e) => e.kind === "audioinput" ? (e.label ? gt = !0 : w.isMobile() && w.browserName() === "Firefox" && (gt = ht), !0) : !1), dt = e.filter((e) => e.kind === "audiooutput");
734
- let t = ft?.deviceId ?? at.get("videoinput"), n = pt?.deviceId ?? at.get("audioinput"), r = mt?.deviceId ?? at.get("audiooutput");
735
- return ft = lt.find((e) => e.deviceId === t) || null, pt = ut.find((e) => e.deviceId === n) || null, mt = dt.find((e) => e.deviceId === r) || dt[0] || null, ot = Promise.resolve(e), e;
736
- }).catch(() => (ot = null, []))));
732
+ })), st = navigator.mediaDevices.enumerateDevices().then((e) => {
733
+ ut = e.filter((e) => e.kind === "videoinput" ? (e.label && (gt = !0), !0) : !1), dt = e.filter((e) => e.kind === "audioinput" ? (e.label ? _t = !0 : w.isMobile() && w.browserName() === "Firefox" && (_t = gt), !0) : !1), ft = e.filter((e) => e.kind === "audiooutput");
734
+ let t = pt?.deviceId ?? ot.get("videoinput"), n = mt?.deviceId ?? ot.get("audioinput"), r = ht?.deviceId ?? ot.get("audiooutput");
735
+ return pt = ut.find((e) => e.deviceId === t) || null, mt = dt.find((e) => e.deviceId === n) || null, ht = ft.find((e) => e.deviceId === r) || ft[0] || null, st = Promise.resolve(e), e;
736
+ }).catch(() => (st = null, []))));
737
737
  }
738
738
  async function Lt() {
739
739
  if ("userAgentData" in navigator) try {
@@ -743,19 +743,19 @@ async function Lt() {
743
743
  return;
744
744
  }
745
745
  let t = parseInt(e.split(".")[0]);
746
- Ct = isNaN(t) ? null : t;
746
+ wt = isNaN(t) ? null : t;
747
747
  } catch (e) {
748
748
  R.warn("Failed to get OS version", e);
749
749
  }
750
750
  }
751
751
  function Rt(e) {
752
- if (ft && pt) return;
752
+ if (pt && mt) return;
753
753
  let t = (e, t) => {
754
754
  let n = t.getSettings()?.deviceId;
755
755
  return e.find((e) => e.deviceId === n || e.label === t.label) || null;
756
756
  };
757
757
  e?.getTracks().forEach((e) => {
758
- !pt && e.kind === k.audio ? pt = t(w.getMicrophones(), e) : !ft && e.kind === k.video && (ft = t(w.getCameras(), e));
758
+ !mt && e.kind === k.audio ? mt = t(w.getMicrophones(), e) : !pt && e.kind === k.video && (pt = t(w.getCameras(), e));
759
759
  });
760
760
  }
761
761
  async function zt(e, t, n = R, r = null) {
@@ -775,31 +775,31 @@ async function zt(e, t, n = R, r = null) {
775
775
  case "SecurityError":
776
776
  case "DOMException":
777
777
  case "NotFoundError":
778
- t = e.isVideoRequested() ? x.CAMERA_PERMISSION : x.MIC_PERMISSION;
778
+ t = e.isVideoRequested() ? b.CAMERA_PERMISSION : b.MIC_PERMISSION;
779
779
  break;
780
780
  case "OverconstrainedError":
781
- t = x.OVERCONSTRAINED;
781
+ t = b.OVERCONSTRAINED;
782
782
  break;
783
783
  case "TypeError":
784
- t = x.UNKNOWN;
784
+ t = b.UNKNOWN;
785
785
  break;
786
786
  case "AbortError":
787
787
  case "NotReadableError":
788
- t = e.isVideoRequested() ? x.CAMERA_ACCESS : x.MIC_ACCESS;
788
+ t = e.isVideoRequested() ? b.CAMERA_ACCESS : b.MIC_ACCESS;
789
789
  break;
790
790
  case "Error": if (i.message === "MediaSource is busy") {
791
- t = e.isVideoRequested() ? x.CAMERA_ACCESS : x.MIC_ACCESS;
791
+ t = e.isVideoRequested() ? b.CAMERA_ACCESS : b.MIC_ACCESS;
792
792
  break;
793
793
  }
794
794
  }
795
795
  if (e.canSimplify()) return zt(e.simplify(), t, n, r);
796
- let o = t || x.UNKNOWN;
796
+ let o = t || b.UNKNOWN;
797
797
  throw L.onPermissionsError(o, i), o;
798
798
  }
799
799
  }
800
800
  async function Bt(e = R) {
801
- if (!(bt || w.browserName() !== "Firefox" || !navigator.mediaDevices?.getUserMedia)) try {
802
- w.hasMicrophonePermission() || L.onPermissionsRequested(), bt = await navigator.mediaDevices.getUserMedia({
801
+ if (!(xt || w.browserName() !== "Firefox" || !navigator.mediaDevices?.getUserMedia)) try {
802
+ w.hasMicrophonePermission() || L.onPermissionsRequested(), xt = await navigator.mediaDevices.getUserMedia({
803
803
  audio: !0,
804
804
  video: !1
805
805
  });
@@ -826,17 +826,17 @@ async function Vt(e, t = R, n = null) {
826
826
  switch (e.name) {
827
827
  case "PermissionDeniedError":
828
828
  case "NotAllowedError":
829
- case "SecurityError": throw x.SCREEN_PERMISSION;
830
- default: throw x.SCREEN_ACCESS;
829
+ case "SecurityError": throw b.SCREEN_PERMISSION;
830
+ default: throw b.SCREEN_ACCESS;
831
831
  }
832
832
  } finally {
833
833
  r.free();
834
834
  }
835
835
  }
836
836
  function Ht() {
837
- return wt.length || (wt = (() => {
838
- let e, t = !1, n = 0, r = "0", i = Ot.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];
839
- if (/trident/i.test(i[1])) return e = /\brv[ :]+(\d+)/g.exec(Ot), [
837
+ return Tt.length || (Tt = (() => {
838
+ let e, t = !1, n = 0, r = "0", i = C.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];
839
+ if (/trident/i.test(i[1])) return e = /\brv[ :]+(\d+)/g.exec(C), [
840
840
  "IE",
841
841
  e && e[1] || "Unknown",
842
842
  t,
@@ -844,35 +844,35 @@ function Ht() {
844
844
  r
845
845
  ];
846
846
  if (i[1] === "Safari") {
847
- if (e = Ot.match(/\bEdge\/(\d+)/), e) return [
847
+ if (e = C.match(/\bEdge\/(\d+)/), e) return [
848
848
  "Edge",
849
849
  e[1] || "Unknown",
850
850
  t,
851
851
  n,
852
852
  r
853
853
  ];
854
- if (e = Ot.match(/\bCriOS\/(\d+)/), e) return [
854
+ if (e = C.match(/\bCriOS\/(\d+)/), e) return [
855
855
  "Chrome",
856
856
  e[1],
857
857
  !0,
858
858
  Number(e[1]),
859
859
  r
860
860
  ];
861
- if (e = Ot.match(/\bFxiOS\/(\d+)/), e) return [
861
+ if (e = C.match(/\bFxiOS\/(\d+)/), e) return [
862
862
  "Firefox",
863
863
  e[1],
864
864
  !1,
865
865
  n,
866
866
  r
867
867
  ];
868
- if (e = Ot.match(/\bYaBrowser\/(\d+)/), e) return [
868
+ if (e = C.match(/\bYaBrowser\/(\d+)/), e) return [
869
869
  "Yandex",
870
870
  e[1],
871
871
  !1,
872
872
  n,
873
873
  r
874
874
  ];
875
- if (e = Ot.match(/\bOPT\/(\d+)/), e) return [
875
+ if (e = C.match(/\bOPT\/(\d+)/), e) return [
876
876
  "Opera",
877
877
  e[1],
878
878
  !1,
@@ -881,28 +881,28 @@ function Ht() {
881
881
  ];
882
882
  }
883
883
  if (i[1] === "Chrome") {
884
- if (t = !0, n = Number(i[2]), e = Ot.match(/\bOPR\/(\d+)/), e) return [
884
+ if (t = !0, n = Number(i[2]), e = C.match(/\bOPR\/(\d+)/), e) return [
885
885
  "Opera",
886
886
  e[1] || "Unknown",
887
887
  t,
888
888
  n,
889
889
  r
890
890
  ];
891
- if (e = Ot.match(/\bYaBrowser\/(\d+)/), e) return [
891
+ if (e = C.match(/\bYaBrowser\/(\d+)/), e) return [
892
892
  "Yandex",
893
893
  e[1] || "Unknown",
894
894
  t,
895
895
  n,
896
896
  r
897
897
  ];
898
- if (e = Ot.match(/\bSferum\/((\d+)(?:\.\d+)*)/), e) return [
898
+ if (e = C.match(/\bSferum\/((\d+)(?:\.\d+)*)/), e) return [
899
899
  "Sferum",
900
900
  e[1] || "Unknown",
901
901
  t,
902
902
  n,
903
903
  r
904
904
  ];
905
- if (e = Ot.match(/\bEdge?\/(\d+)/), e) return [
905
+ if (e = C.match(/\bEdge?\/(\d+)/), e) return [
906
906
  "Edge",
907
907
  e[1] || "Unknown",
908
908
  t,
@@ -917,14 +917,14 @@ function Ht() {
917
917
  r
918
918
  ];
919
919
  }
920
- return e = Ot.match(/version\/(\d+)(?:(?:\.)(\d+))?/i), e && e[2] !== void 0 && (r = e[2]), [
921
- i[2] ? i[1] : Dt,
922
- e && e[1] || i[2] || Et,
920
+ return e = C.match(/version\/(\d+)(?:(?:\.)(\d+))?/i), e && e[2] !== void 0 && (r = e[2]), [
921
+ i[2] ? i[1] : Ot,
922
+ e && e[1] || i[2] || Dt,
923
923
  t,
924
924
  n,
925
925
  r
926
926
  ];
927
- })()), wt;
927
+ })()), Tt;
928
928
  }
929
929
  var w;
930
930
  (function(e) {
@@ -933,35 +933,35 @@ var w;
933
933
  }
934
934
  e.init = t;
935
935
  function n() {
936
- return lt;
936
+ return ut;
937
937
  }
938
938
  e.getCameras = n;
939
939
  function r() {
940
- return ut;
940
+ return dt;
941
941
  }
942
942
  e.getMicrophones = r;
943
943
  function i() {
944
- return dt;
944
+ return ft;
945
945
  }
946
946
  e.getOutput = i;
947
947
  function a() {
948
- return lt.length > 0;
948
+ return ut.length > 0;
949
949
  }
950
950
  e.hasCamera = a;
951
951
  function o() {
952
- return ut.length > 0;
952
+ return dt.length > 0;
953
953
  }
954
954
  e.hasMicrophone = o;
955
955
  function s() {
956
- return ft;
956
+ return pt;
957
957
  }
958
958
  e.getSavedCamera = s;
959
959
  function c() {
960
- return pt;
960
+ return mt;
961
961
  }
962
962
  e.getSavedMicrophone = c;
963
963
  function l() {
964
- return mt;
964
+ return ht;
965
965
  }
966
966
  e.getSavedOutput = l;
967
967
  function u() {
@@ -969,15 +969,15 @@ var w;
969
969
  }
970
970
  e.getVideoFacingMode = u;
971
971
  function d() {
972
- return ht;
972
+ return gt;
973
973
  }
974
974
  e.hasCameraPermission = d;
975
975
  function f() {
976
- return gt;
976
+ return _t;
977
977
  }
978
978
  e.hasMicrophonePermission = f;
979
979
  function p() {
980
- return ct?.getPermissionState("microphone") ?? null;
980
+ return lt?.getPermissionState("microphone") ?? null;
981
981
  }
982
982
  e.getMicrophonePermissionState = p;
983
983
  function m(e = !1) {
@@ -985,7 +985,7 @@ var w;
985
985
  }
986
986
  e.hasPermissions = m;
987
987
  function ee() {
988
- bt && (Ye(bt), bt = null);
988
+ xt && (Xe(xt), xt = null);
989
989
  }
990
990
  e.releaseFirefoxMicrophonePermissionWarmup = ee;
991
991
  async function h(e = !1, t = !0, n = !0, r = R, i = null) {
@@ -1020,32 +1020,32 @@ var w;
1020
1020
  async function ae(e, t) {
1021
1021
  let [n] = e.getVideoTracks();
1022
1022
  if (!n) throw Error("Video track not found in stream");
1023
- return Ze(n, t);
1023
+ return Qe(n, t);
1024
1024
  }
1025
1025
  e.setResolution = ae;
1026
1026
  async function oe(e, t) {
1027
1027
  let n = (await It()).find((n) => n.kind === e && n.deviceId === t);
1028
- return n ? (e === "videoinput" ? ft = n : e === "audioinput" ? pt = n : e === "audiooutput" && (mt = n), at.set(e, t), n) : null;
1028
+ return n ? (e === "videoinput" ? pt = n : e === "audioinput" ? mt = n : e === "audiooutput" && (ht = n), ot.set(e, t), n) : null;
1029
1029
  }
1030
1030
  e._saveDeviceId = oe;
1031
1031
  function g() {
1032
- if (!yt || yt.readyState === "ended") {
1032
+ if (!bt || bt.readyState === "ended") {
1033
1033
  let e = w.getAudioContext(), t = e.createMediaStreamDestination(), n = e.createGain();
1034
1034
  n.gain.value = 1e-5, n.connect(t), n.connect(e.destination);
1035
1035
  let r = e.createOscillator();
1036
- r.type = "sine", r.frequency.value = 0, r.connect(n), r.start(), yt = t.stream.getAudioTracks()[0];
1036
+ r.type = "sine", r.frequency.value = 0, r.connect(n), r.start(), bt = t.stream.getAudioTracks()[0];
1037
1037
  }
1038
- return Object.assign(yt.clone(), { enabled: !1 });
1038
+ return Object.assign(bt.clone(), { enabled: !1 });
1039
1039
  }
1040
1040
  e.getSilentMediaTrack = g;
1041
- function _(e = M.videoMinWidth, t = M.videoMinHeight) {
1042
- vt || (vt = document.createElement("canvas")), vt.width = e, vt.height = t;
1043
- let n = vt.getContext("2d");
1044
- return n.rect(0, 0, e, t), n.fillStyle = "black", n.fill(), (!_t || _t.readyState === "ended") && (_t = vt.captureStream(M.videoFrameRate).getVideoTracks()[0]), Object.assign(_t.clone(), { enabled: !1 });
1045
- }
1046
- e.getBlackMediaTrack = _;
1047
- function se() {
1048
- if (_e() === "Edge" && Number(ve()) < 70) return !1;
1041
+ function se(e = M.videoMinWidth, t = M.videoMinHeight) {
1042
+ yt || (yt = document.createElement("canvas")), yt.width = e, yt.height = t;
1043
+ let n = yt.getContext("2d");
1044
+ return n.rect(0, 0, e, t), n.fillStyle = "black", n.fill(), (!vt || vt.readyState === "ended") && (vt = yt.captureStream(M.videoFrameRate).getVideoTracks()[0]), Object.assign(vt.clone(), { enabled: !1 });
1045
+ }
1046
+ e.getBlackMediaTrack = se;
1047
+ function ce() {
1048
+ if (ve() === "Edge" && Number(ye()) < 70) return !1;
1049
1049
  try {
1050
1050
  let e = window;
1051
1051
  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;
@@ -1053,21 +1053,21 @@ var w;
1053
1053
  return !1;
1054
1054
  }
1055
1055
  }
1056
- e.isBrowserSupported = se;
1057
- function ce() {
1056
+ e.isBrowserSupported = ce;
1057
+ function le() {
1058
1058
  return !!navigator.mediaDevices.getDisplayMedia;
1059
1059
  }
1060
- e.isScreenCapturingSupported = ce;
1061
- function le() {
1060
+ e.isScreenCapturingSupported = le;
1061
+ function ue() {
1062
1062
  let e = w.browserName() === "Safari" && w.browserVersion() === "15" && w.browserSubVersion() === "1", t = w.browserName() === "Opera", n = w.browserName() === "Yandex";
1063
1063
  return e || t || n;
1064
1064
  }
1065
- e.isBrokenH264Decoder = le;
1066
- function ue() {
1065
+ e.isBrokenH264Decoder = ue;
1066
+ function de() {
1067
1067
  return w.browserName() === "Yandex" && w.os() === "Windows" || M.simulcast;
1068
1068
  }
1069
- e.isBrokenVP9Encoder = ue;
1070
- function de() {
1069
+ e.isBrokenVP9Encoder = de;
1070
+ function fe() {
1071
1071
  let e = w.browserName() === "Safari" && Number(w.browserVersion()) === 17 && [
1072
1072
  4,
1073
1073
  5,
@@ -1075,21 +1075,21 @@ var w;
1075
1075
  ].includes(Number(w.browserSubVersion())), t = w.os() === "Windows" && w.osVersion() === 10;
1076
1076
  return e || t;
1077
1077
  }
1078
- e.isBrokenVP9Decoder = de;
1079
- function fe() {
1078
+ e.isBrokenVP9Decoder = fe;
1079
+ function pe() {
1080
1080
  return w.browserName() === "Firefox" && Number(w.browserVersion()) < 60;
1081
1081
  }
1082
- e.isOldDataChannelDescription = fe;
1083
- function pe() {
1082
+ e.isOldDataChannelDescription = pe;
1083
+ function me() {
1084
1084
  return !(w.baseChromeVersion() && w.isMobile());
1085
1085
  }
1086
- e.canPreferH264 = pe;
1087
- function me() {
1086
+ e.canPreferH264 = me;
1087
+ function he() {
1088
1088
  return !(w.browserName() === "Firefox" || w.browserName() === "Safari");
1089
1089
  }
1090
- e.isSimulcastSupportedByBrowser = me;
1091
- function he() {
1092
- return St || (St = (() => {
1090
+ e.isSimulcastSupportedByBrowser = he;
1091
+ function ge() {
1092
+ return Ct || (Ct = (() => {
1093
1093
  let e = {
1094
1094
  Windows: /Win/,
1095
1095
  Android: /Android/,
@@ -1106,57 +1106,57 @@ var w;
1106
1106
  OS2: /OS\/2/,
1107
1107
  Bot: /(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask Jeeves\/Teoma|ia_archiver)/
1108
1108
  };
1109
- for (let t in e) if (Object.hasOwn(e, t) && e[t].test(Ot)) return t;
1109
+ for (let t in e) if (Object.hasOwn(e, t) && e[t].test(C)) return t;
1110
1110
  return "Unknown";
1111
- })()), St;
1111
+ })()), Ct;
1112
1112
  }
1113
- e.os = he;
1114
- function ge() {
1115
- return Ct;
1113
+ e.os = ge;
1114
+ function _e() {
1115
+ return wt;
1116
1116
  }
1117
- e.osVersion = ge;
1118
- function v() {
1119
- return xt === null && (xt = /Mobile|mini|Fennec|Android|iP(ad|od|hone)/.test(Et)), xt;
1117
+ e.osVersion = _e;
1118
+ function _() {
1119
+ return St === null && (St = /Mobile|mini|Fennec|Android|iP(ad|od|hone)/.test(Dt)), St;
1120
1120
  }
1121
- e.isMobile = v;
1122
- function _e() {
1121
+ e.isMobile = _;
1122
+ function ve() {
1123
1123
  return Ht()[0];
1124
1124
  }
1125
- e.browserName = _e;
1126
- function ve() {
1125
+ e.browserName = ve;
1126
+ function ye() {
1127
1127
  return Ht()[1];
1128
1128
  }
1129
- e.browserVersion = ve;
1130
- function ye() {
1129
+ e.browserVersion = ye;
1130
+ function be() {
1131
1131
  return Ht()[3];
1132
1132
  }
1133
- e.baseChromeVersion = ye;
1134
- function be() {
1135
- return Tt || (Tt = new (window.AudioContext || window.webkitAudioContext)()), Tt.resume().catch(() => {
1133
+ e.baseChromeVersion = be;
1134
+ function xe() {
1135
+ return Et || (Et = new (window.AudioContext || window.webkitAudioContext)()), Et.resume().catch(() => {
1136
1136
  R.warn("Failed to resume AudioContext");
1137
- }), Tt;
1137
+ }), Et;
1138
1138
  }
1139
- e.getAudioContext = be;
1140
- function xe() {
1139
+ e.getAudioContext = xe;
1140
+ function Se() {
1141
1141
  return Ht()[4];
1142
1142
  }
1143
- e.browserSubVersion = xe;
1144
- function Se() {
1143
+ e.browserSubVersion = Se;
1144
+ function Ce() {
1145
1145
  return w.baseChromeVersion() >= 105 && !w.isMobile();
1146
1146
  }
1147
- e.isAudioShareSupported = Se;
1148
- function Ce(e, t) {
1147
+ e.isAudioShareSupported = Ce;
1148
+ function we(e, t) {
1149
1149
  kt[e] || (kt[e] = []), kt[e].push(t);
1150
1150
  }
1151
- e.addEventListener = Ce;
1152
- function we(e, t) {
1151
+ e.addEventListener = we;
1152
+ function Te(e, t) {
1153
1153
  if (kt[e]) if (!t) delete kt[e];
1154
1154
  else {
1155
1155
  let n = kt[e].indexOf(t);
1156
1156
  n > -1 && kt[e].splice(n, 1);
1157
1157
  }
1158
1158
  }
1159
- e.removeEventListener = we;
1159
+ e.removeEventListener = Te;
1160
1160
  })(w || (w = {}));
1161
1161
  var T = w;
1162
1162
  //#endregion
@@ -1186,7 +1186,7 @@ var D = /* @__PURE__ */ function(e) {
1186
1186
  }
1187
1187
  }, Wt = /* @__PURE__ */ function(e) {
1188
1188
  return e.FpsLimit = "fps-limit", e;
1189
- }({}), Gt = class extends b {
1189
+ }({}), Gt = class extends y {
1190
1190
  constructor(e = R) {
1191
1191
  super(), h(this, "FPS_LIMITS", [
1192
1192
  13,
@@ -1232,7 +1232,7 @@ var D = /* @__PURE__ */ function(e) {
1232
1232
  return e.audio = "audio", e.video = "video", e.screen = "screen", e.audioshare = "audioshare", e;
1233
1233
  }({}), qt = /* @__PURE__ */ function(e) {
1234
1234
  return e[e.CAMERA = 1] = "CAMERA", e[e.SCREEN = 2] = "SCREEN", e;
1235
- }({}), Jt = class extends b {
1235
+ }({}), Jt = class extends y {
1236
1236
  constructor(e = R, t = null) {
1237
1237
  super(), h(this, "_stream", null), h(this, "_screenTrack", null), h(this, "_audioShareTrack", null), h(this, "_screenShareTrack", null), h(this, "_sendVideoTrack", null), h(this, "_cameraVideoTrack", null), h(this, "_micAudioTrack", null), h(this, "_audioEffectsTrack", null), h(this, "_mediaSettings", E()), h(this, "_lastMediaSettings", null), h(this, "_videoStatusOnScreenCapturingEnabled", !1), h(this, "_effect", null), h(this, "_audioEffectParams", null), h(this, "_onDeviceChange", void 0), h(this, "_animojiEnabled", !1), h(this, "_videoEffectsFpsLimiter", void 0), h(this, "_debug", void 0), h(this, "_logger", void 0), h(this, "videoTrackMuteHandler", () => {
1238
1238
  this._mediaSettings.isVideoEnabled && this.toggleVideo(!0);
@@ -1244,10 +1244,10 @@ var D = /* @__PURE__ */ function(e) {
1244
1244
  set cameraVideoTrack(e) {
1245
1245
  this._cameraVideoTrack && this._cameraVideoTrack.removeEventListener("mute", this.videoTrackMuteHandler), this._cameraVideoTrack = e, this._cameraVideoTrack && this._cameraVideoTrack.addEventListener("mute", this.videoTrackMuteHandler), M.consumerFastScreenShare && (this._screenShareTrack = this.getBlackScreenShareTrack());
1246
1246
  }
1247
- async request(e = [S.AUDIO], t = !0) {
1247
+ async request(e = [x.AUDIO], t = !0) {
1248
1248
  if (this._stream) return;
1249
- let n = e.includes(S.VIDEO), r = e.includes(S.AUDIO), i = e.includes(S.ANIMOJI);
1250
- if (!T.isBrowserSupported()) throw new O(x.UNSUPPORTED);
1249
+ let n = e.includes(x.VIDEO), r = e.includes(x.AUDIO), i = e.includes(x.ANIMOJI);
1250
+ if (!T.isBrowserSupported()) throw new O(b.UNSUPPORTED);
1251
1251
  try {
1252
1252
  this._stream = await T.getUserMedia(n, r, t, this._debug, this._logger), this.cameraVideoTrack?.stop(), this.cameraVideoTrack = this._stream.getVideoTracks()[0], this._micAudioTrack?.stop(), this._micAudioTrack = this._stream.getAudioTracks()[0], this._audioEffectsTrack?.stop(), this._mediaSettings.isVideoEnabled = n && this._stream.getVideoTracks().filter((e) => e.enabled).length > 0 || !1, this._mediaSettings.isAudioEnabled = r && this._stream.getAudioTracks().filter((e) => e.enabled).length > 0 || !1, this._mediaSettings.isAnimojiEnabled = i && !this._mediaSettings.isVideoEnabled || !1, this._animojiEnabled = i, this._triggerEvent("SOURCE_READY");
1253
1253
  } catch (e) {
@@ -1288,11 +1288,11 @@ var D = /* @__PURE__ */ function(e) {
1288
1288
  case "audioinput":
1289
1289
  if (this._mediaSettings.isAudioEnabled) return this._changeAudioInput();
1290
1290
  break;
1291
- default: return Promise.reject(x.UNKNOWN);
1291
+ default: return Promise.reject(b.UNKNOWN);
1292
1292
  }
1293
1293
  }
1294
1294
  stopVideoTrack() {
1295
- this._mediaSettings.isVideoEnabled && (this._stopEffect(), this._stream && Xe(this._stream), this.cameraVideoTrack?.stop());
1295
+ this._mediaSettings.isVideoEnabled && (this._stopEffect(), this._stream && Ze(this._stream), this.cameraVideoTrack?.stop());
1296
1296
  }
1297
1297
  async setVideoStream(e, t) {
1298
1298
  return t ? this._changeScreen(!1, !1, e) : this._changeVideoInput(e);
@@ -1312,13 +1312,13 @@ var D = /* @__PURE__ */ function(e) {
1312
1312
  async _changeVideoInput(e) {
1313
1313
  try {
1314
1314
  let t = e ? "stream" : "video", n = e || await T._getUserVideo(!!this._effect, this._frameRate, this._debug, this._logger);
1315
- if (this.cameraVideoTrack?.stop(), this.cameraVideoTrack = n.getVideoTracks()[0], !this._stream) Ye(n);
1315
+ if (this.cameraVideoTrack?.stop(), this.cameraVideoTrack = n.getVideoTracks()[0], !this._stream) Xe(n);
1316
1316
  else {
1317
1317
  let e = await this._setEffect(this._effect, this.cameraVideoTrack);
1318
- this._logger?.log(C.DEVICE_CHANGED, t), this._debug.log("Video stream changed"), await this._replaceLocalTrack(e), this._mediaSettings.isVideoEnabled = !0, this._triggerEvent("SOURCE_CHANGED", { kind: "video" });
1318
+ this._logger?.log(S.DEVICE_CHANGED, t), this._debug.log("Video stream changed"), await this._replaceLocalTrack(e), this._mediaSettings.isVideoEnabled = !0, this._triggerEvent("SOURCE_CHANGED", { kind: "video" });
1319
1319
  }
1320
1320
  } catch (e) {
1321
- throw this._logger?.log(C.ERROR, "change_video"), this._debug.warn("Camera change failed", e), e;
1321
+ throw this._logger?.log(S.ERROR, "change_video"), this._debug.warn("Camera change failed", e), e;
1322
1322
  }
1323
1323
  }
1324
1324
  async setAudioStream(e) {
@@ -1327,30 +1327,30 @@ var D = /* @__PURE__ */ function(e) {
1327
1327
  async _changeAudioInput(e = null) {
1328
1328
  try {
1329
1329
  let t = e || await T.getUserAudio(void 0, this._debug, this._logger);
1330
- if (this._micAudioTrack?.stop(), this._micAudioTrack = t.getAudioTracks()[0], !this._stream) Ye(t);
1330
+ if (this._micAudioTrack?.stop(), this._micAudioTrack = t.getAudioTracks()[0], !this._stream) Xe(t);
1331
1331
  else {
1332
1332
  let e = await this._applyAudioEffect();
1333
- this._logger?.log(C.DEVICE_CHANGED, "audio"), this._debug.log("Audio stream changed", e), await this._replaceLocalTrack(e), this._mediaSettings.isAudioEnabled = !0, this._triggerEvent("SOURCE_CHANGED", { kind: "audio" });
1333
+ this._logger?.log(S.DEVICE_CHANGED, "audio"), this._debug.log("Audio stream changed", e), await this._replaceLocalTrack(e), this._mediaSettings.isAudioEnabled = !0, this._triggerEvent("SOURCE_CHANGED", { kind: "audio" });
1334
1334
  }
1335
1335
  } catch (e) {
1336
- throw this._logger?.log(C.ERROR, "change_audio"), this._debug.error("Microphone change failed", e), e;
1336
+ throw this._logger?.log(S.ERROR, "change_audio"), this._debug.error("Microphone change failed", e), e;
1337
1337
  }
1338
1338
  }
1339
1339
  async _changeScreen(e, t, n) {
1340
1340
  try {
1341
- if (n = n || await T.getScreenMedia(e, t, this._debug, this._logger), !this._stream) Ye(n);
1341
+ if (n = n || await T.getScreenMedia(e, t, this._debug, this._logger), !this._stream) Xe(n);
1342
1342
  else {
1343
1343
  let r = n.getVideoTracks()[0];
1344
1344
  if (r.addEventListener("ended", () => {
1345
1345
  this._mediaSettings.isScreenSharingEnabled && this.disableScreenCapturing();
1346
- }, !1), this._logger?.log(C.DEVICE_CHANGED, "screen"), this._debug.log("Screen capturing started"), this._screenTrack = r, this._mediaSettings.isScreenSharingEnabled = !0, this._mediaSettings.isFastScreenSharingEnabled = e, M.consumerFastScreenShare && this._mediaSettings.isFastScreenSharingEnabled && (r.contentHint = "motion", this._screenShareTrack = r), n.getAudioTracks().length > 0) {
1346
+ }, !1), this._logger?.log(S.DEVICE_CHANGED, "screen"), this._debug.log("Screen capturing started"), this._screenTrack = r, this._mediaSettings.isScreenSharingEnabled = !0, this._mediaSettings.isFastScreenSharingEnabled = e, M.consumerFastScreenShare && this._mediaSettings.isFastScreenSharingEnabled && (r.contentHint = "motion", this._screenShareTrack = r), n.getAudioTracks().length > 0) {
1347
1347
  let e = n.getAudioTracks()[0];
1348
1348
  e.contentHint = "music", this._audioShareTrack = e, await this._replaceLocalTrack(e), this._mediaSettings.isAudioSharingEnabled = !0;
1349
1349
  }
1350
1350
  t && !this._mediaSettings.isAudioSharingEnabled && this._debug.debug("Audio share requested but not captured"), this._triggerEvent("SCREEN_STATUS", { track: r }), this._triggerEvent("SOURCE_CHANGED", { kind: "screen" });
1351
1351
  }
1352
1352
  } catch (e) {
1353
- throw this._logger?.log(C.ERROR, "screen"), this._debug.warn("Screen capturing failed", e), e;
1353
+ throw this._logger?.log(S.ERROR, "screen"), this._debug.warn("Screen capturing failed", e), e;
1354
1354
  }
1355
1355
  }
1356
1356
  async _disableScreenCapture() {
@@ -1398,7 +1398,7 @@ var D = /* @__PURE__ */ function(e) {
1398
1398
  }
1399
1399
  }
1400
1400
  destroy() {
1401
- this._destroyDeviceChangeListener(), T.releaseFirefoxMicrophonePermissionWarmup(), M.videoEffects && (this._effect = null, M.videoEffects.destroy()), M.audioEffects && M.audioEffects.destroy(), this._stream && (Ye(this._stream), this._stream = null), this.cameraVideoTrack?.stop(), this._micAudioTrack?.stop(), this._audioEffectsTrack?.stop(), this._disableScreenCapture(), T.getAudioContext()?.suspend().catch((e) => this._debug.error(e)), this._videoEffectsFpsLimiter?.destroy();
1401
+ this._destroyDeviceChangeListener(), T.releaseFirefoxMicrophonePermissionWarmup(), M.videoEffects && (this._effect = null, M.videoEffects.destroy()), M.audioEffects && M.audioEffects.destroy(), this._stream && (Xe(this._stream), this._stream = null), this.cameraVideoTrack?.stop(), this._micAudioTrack?.stop(), this._audioEffectsTrack?.stop(), this._disableScreenCapture(), T.getAudioContext()?.suspend().catch((e) => this._debug.error(e)), this._videoEffectsFpsLimiter?.destroy();
1402
1402
  }
1403
1403
  async stopLocalMedia() {
1404
1404
  this._mediaSettings.isScreenSharingEnabled && await this.disableScreenCapturing(), this._stream && (this._lastMediaSettings = { ...this._mediaSettings }, this._stream.getAudioTracks().length > 0 && await this.toggleAudio(!1), this._stream.getVideoTracks().length > 0 && await this.toggleVideo(!1), this.cameraVideoTrack = null, this._micAudioTrack = null);
@@ -1406,7 +1406,7 @@ var D = /* @__PURE__ */ function(e) {
1406
1406
  async resumeLocalMedia(e) {
1407
1407
  if (!this._lastMediaSettings) return;
1408
1408
  let t = [];
1409
- if ((e ? e.isAudioEnabled : this._lastMediaSettings.isAudioEnabled) && (t.push(S.AUDIO), await this.toggleAudio(!0)), await this.request(t), this._lastMediaSettings = null, this._stream) for (let e of this._stream.getTracks()) this._triggerEvent("TRACK_REPLACED", e);
1409
+ if ((e ? e.isAudioEnabled : this._lastMediaSettings.isAudioEnabled) && (t.push(x.AUDIO), await this.toggleAudio(!0)), await this.request(t), this._lastMediaSettings = null, this._stream) for (let e of this._stream.getTracks()) this._triggerEvent("TRACK_REPLACED", e);
1410
1410
  }
1411
1411
  async toggleScreenCapturing(e) {
1412
1412
  if (e.captureScreen) {
@@ -1474,7 +1474,7 @@ var D = /* @__PURE__ */ function(e) {
1474
1474
  }
1475
1475
  async videoEffect(e) {
1476
1476
  if (!M.videoEffects) throw Error("Video Effects library is not set");
1477
- if (this._logger?.log(C.DEVICE_CHANGED, `effect_${e?.effect || "none"}`), !this._mediaSettings.isVideoEnabled) {
1477
+ if (this._logger?.log(S.DEVICE_CHANGED, `effect_${e?.effect || "none"}`), !this._mediaSettings.isVideoEnabled) {
1478
1478
  this._effect = e;
1479
1479
  return;
1480
1480
  }
@@ -1523,7 +1523,7 @@ var D = /* @__PURE__ */ function(e) {
1523
1523
  return this._effect ? Math.min(e, M.videoFrameRate) : void 0;
1524
1524
  }
1525
1525
  async _applyVideoConstraints(e, t) {
1526
- await Ze(e, {
1526
+ await Qe(e, {
1527
1527
  width: this._effect ? M.videoEffectMaxWidth : M.videoMaxWidth,
1528
1528
  height: this._effect ? M.videoEffectMaxHeight : M.videoMaxHeight,
1529
1529
  ...this._frameRate && { frameRate: { ideal: this._frameRate } },
@@ -1799,19 +1799,19 @@ var on = 533, sn = "a=fmtp:", cn = "sps-pps-idr-in-keyframe=1", ln;
1799
1799
  return ae(e.id, e.idType || A.USER, e.deviceIdx);
1800
1800
  }
1801
1801
  e.composeId = g;
1802
- function _(e) {
1803
- if (e.decorativeUserId) return ae(e.decorativeUserId, e.idType || A.USER, e.deviceIdx);
1804
- }
1805
- e.composeDecorativeId = _;
1806
1802
  function se(e) {
1807
- return e.participant ? g(e.participant) : ae(e.participantId, e.participantType || A.USER, e.deviceIdx);
1803
+ if (e.decorativeUserId) return ae(e.decorativeUserId, e.idType || A.USER, e.deviceIdx);
1808
1804
  }
1809
- e.composeMessageId = se;
1805
+ e.composeDecorativeId = se;
1810
1806
  function ce(e) {
1811
- return typeof e == "string" ? le(ue(e).compositeUserId).id : e;
1807
+ return e.participant ? g(e.participant) : ae(e.participantId, e.participantType || A.USER, e.deviceIdx);
1812
1808
  }
1813
- e.extractOkId = ce;
1809
+ e.composeMessageId = ce;
1814
1810
  function le(e) {
1811
+ return typeof e == "string" ? ue(de(e).compositeUserId).id : e;
1812
+ }
1813
+ e.extractOkId = le;
1814
+ function ue(e) {
1815
1815
  let t = String(e), n = t.match(re);
1816
1816
  return n ? {
1817
1817
  id: Number(n[2]),
@@ -1821,24 +1821,24 @@ var on = 533, sn = "a=fmtp:", cn = "sps-pps-idr-in-keyframe=1", ln;
1821
1821
  type: A.USER
1822
1822
  });
1823
1823
  }
1824
- e.decomposeId = le;
1825
- function ue(e) {
1824
+ e.decomposeId = ue;
1825
+ function de(e) {
1826
1826
  let t = e.split(":d");
1827
1827
  return {
1828
1828
  compositeUserId: t[0],
1829
1829
  deviceIdx: t.length > 1 ? parseInt(t[1], 10) : 0
1830
1830
  };
1831
1831
  }
1832
- e.decomposeParticipantId = ue;
1833
- function de() {
1832
+ e.decomposeParticipantId = de;
1833
+ function fe() {
1834
1834
  let e = window.crypto?.randomUUID?.();
1835
1835
  if (e) return e;
1836
1836
  let t = "0123456789abcdefghijklmnopqrstuvwxyz".split(""), n = Array(36), r = 0, i, a;
1837
1837
  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]);
1838
1838
  return n.join("");
1839
1839
  }
1840
- e.uuid = de;
1841
- function fe(e, t) {
1840
+ e.uuid = fe;
1841
+ function pe(e, t) {
1842
1842
  let n;
1843
1843
  function r(...r) {
1844
1844
  let i = this;
@@ -1848,8 +1848,8 @@ var on = 533, sn = "a=fmtp:", cn = "sps-pps-idr-in-keyframe=1", ln;
1848
1848
  }
1849
1849
  return r;
1850
1850
  }
1851
- e.debounce = fe;
1852
- function pe(e) {
1851
+ e.debounce = pe;
1852
+ function me(e) {
1853
1853
  if (!window.BigInt) return null;
1854
1854
  let t = "", n = e.split("\n");
1855
1855
  for (let e of n) if (e.startsWith("a=fingerprint")) {
@@ -1867,8 +1867,8 @@ var on = 533, sn = "a=fmtp:", cn = "sps-pps-idr-in-keyframe=1", ln;
1867
1867
  }
1868
1868
  return BigInt.asIntN(64, i);
1869
1869
  }
1870
- e.sdpFingerprint = pe;
1871
- async function me(e, { signal: t } = {}) {
1870
+ e.sdpFingerprint = me;
1871
+ async function he(e, { signal: t } = {}) {
1872
1872
  return new Promise((n, r) => {
1873
1873
  if (t?.aborted) return r(t.reason);
1874
1874
  let i = setTimeout(() => {
@@ -1879,13 +1879,13 @@ var on = 533, sn = "a=fmtp:", cn = "sps-pps-idr-in-keyframe=1", ln;
1879
1879
  t?.addEventListener("abort", a, { once: !0 });
1880
1880
  });
1881
1881
  }
1882
- e.delay = me;
1883
- function he(e, t, n, r = R) {
1882
+ e.delay = he;
1883
+ function ge(e, t, n, r = R) {
1884
1884
  let i = [];
1885
- return e.getSenders().forEach((e) => ge(t, e, e.track, n, i, r)), i;
1885
+ return e.getSenders().forEach((e) => _e(t, e, e.track, n, i, r)), i;
1886
1886
  }
1887
- e.applySettings = he;
1888
- function ge(e, t, n, r, i, a = R) {
1887
+ e.applySettings = ge;
1888
+ function _e(e, t, n, r, i, a = R) {
1889
1889
  if (!RTCRtpSender.prototype.getParameters || !RTCRtpSender.prototype.setParameters || !e || !n || n.kind !== k.video) return;
1890
1890
  let o = n.getSettings();
1891
1891
  if (!o) return;
@@ -1924,21 +1924,21 @@ var on = 533, sn = "a=fmtp:", cn = "sps-pps-idr-in-keyframe=1", ln;
1924
1924
  a.log(`applyVideoTrackSettings: actual encodings= ${JSON.stringify(e.encodings)}`);
1925
1925
  }
1926
1926
  }
1927
- e.applyVideoTrackSettings = ge;
1928
- function v(e, t) {
1927
+ e.applyVideoTrackSettings = _e;
1928
+ function _(e, t) {
1929
1929
  Array.isArray(t) || (t = [t]);
1930
1930
  for (let n of t) if (e.includes(n)) return !0;
1931
1931
  return !1;
1932
1932
  }
1933
- e.includesOneOf = v;
1934
- function _e(e) {
1933
+ e.includesOneOf = _;
1934
+ function ve(e) {
1935
1935
  return Object.entries(e.participantState?.state || {}).reduce((t, [n, r]) => (e.participantState && (t[n] = {
1936
1936
  ts: e.participantState.stateUpdateTs[n],
1937
1937
  state: r
1938
1938
  }), t), {});
1939
1939
  }
1940
- e.mapParticipantState = _e;
1941
- function ve(e) {
1940
+ e.mapParticipantState = ve;
1941
+ function ye(e) {
1942
1942
  let t = e.map((e) => ({
1943
1943
  uid: e.externalId,
1944
1944
  mediaSettings: e.mediaSettings,
@@ -1952,37 +1952,37 @@ var on = 533, sn = "a=fmtp:", cn = "sps-pps-idr-in-keyframe=1", ln;
1952
1952
  }));
1953
1953
  return M.filterObservers ? t.filter((e) => !e.uid.observer) : t;
1954
1954
  }
1955
- e.mapSharedParticipants = ve;
1956
- function ye(e, t) {
1955
+ e.mapSharedParticipants = ye;
1956
+ function be(e, t) {
1957
1957
  let n = Object.keys(e), r = Object.keys(t);
1958
1958
  if (n.length !== r.length) return !1;
1959
1959
  for (let i of n) if (!Object.hasOwn(r, i) || e[i].state !== t[i].state || e[i].ts !== t[i].ts) return !1;
1960
1960
  return !0;
1961
1961
  }
1962
- e.isEqualParticipantState = ye;
1963
- function be(e, t, n = !1) {
1962
+ e.isEqualParticipantState = be;
1963
+ function xe(e, t, n = !1) {
1964
1964
  let r = Object.keys(e), i = Object.keys(t);
1965
1965
  if (r.length !== i.length) return !1;
1966
1966
  for (let i of r) {
1967
1967
  if (!Object.hasOwn(t, i)) return !1;
1968
1968
  let r = e[i], a = t[i];
1969
- if (n && Ee(r) && Ee(a)) return be(r, a, n);
1969
+ if (n && De(r) && De(a)) return xe(r, a, n);
1970
1970
  if (r !== a) return !1;
1971
1971
  }
1972
1972
  return !0;
1973
1973
  }
1974
- e.isObjectsEquals = be;
1975
- function xe(e, t) {
1974
+ e.isObjectsEquals = xe;
1975
+ function Se(e, t) {
1976
1976
  if (e.length !== t.length) return !1;
1977
1977
  for (let n of e) if (t.indexOf(n) < 0) return !1;
1978
1978
  return !0;
1979
1979
  }
1980
- e.isArraysEquals = xe;
1981
- function Se(e) {
1980
+ e.isArraysEquals = Se;
1981
+ function Ce(e) {
1982
1982
  return !Object.keys(e).length;
1983
1983
  }
1984
- e.isEmptyObject = Se;
1985
- function Ce(e, t) {
1984
+ e.isEmptyObject = Ce;
1985
+ function we(e, t) {
1986
1986
  if (!e && !t) return 0;
1987
1987
  if (!e || !t) return e ? -1 : 1;
1988
1988
  return r(t.rank, e.rank) || r(e.ts, t.ts) || n(e, t);
@@ -1990,24 +1990,24 @@ var on = 533, sn = "a=fmtp:", cn = "sps-pps-idr-in-keyframe=1", ln;
1990
1990
  let n = {
1991
1991
  [A.USER]: 0,
1992
1992
  [A.GROUP]: 1
1993
- }, { compositeUserId: i, deviceIdx: a } = ue(e.id), { compositeUserId: o, deviceIdx: s } = ue(t.id), { id: c, type: l } = le(i), { id: u, type: d } = le(o);
1993
+ }, { compositeUserId: i, deviceIdx: a } = de(e.id), { compositeUserId: o, deviceIdx: s } = de(t.id), { id: c, type: l } = ue(i), { id: u, type: d } = ue(o);
1994
1994
  return r(n[l], n[d]) || r(c, u) || r(a, s);
1995
1995
  }
1996
1996
  function r(e, t) {
1997
1997
  return e < t ? -1 : e === t ? 0 : 1;
1998
1998
  }
1999
1999
  }
2000
- e.participantMarkerCompare = Ce;
2001
- function we(e, t) {
2000
+ e.participantMarkerCompare = we;
2001
+ function Te(e, t) {
2002
2002
  return rn(Object.entries(e).filter(([, e]) => Array.isArray(t) ? !t.includes(e) : e !== t));
2003
2003
  }
2004
- e.objectFilterOutValues = we;
2005
- function Te(e, t, n) {
2004
+ e.objectFilterOutValues = Te;
2005
+ function Ee(e, t, n) {
2006
2006
  let r = n;
2007
2007
  for (let n in e) Object.hasOwn(e, n) && (r = t(r, e[n], n));
2008
2008
  return r;
2009
2009
  }
2010
- e.objectReduce = Te, e.setImmediate = (() => {
2010
+ e.objectReduce = Ee, e.setImmediate = (() => {
2011
2011
  let e = 1, t = {}, n = null;
2012
2012
  return typeof MessageChannel < "u" && (n = new MessageChannel(), n.port1.onmessage = (e) => {
2013
2013
  let n = e.data;
@@ -2023,11 +2023,11 @@ var on = 533, sn = "a=fmtp:", cn = "sps-pps-idr-in-keyframe=1", ln;
2023
2023
  return () => clearTimeout(i);
2024
2024
  };
2025
2025
  })();
2026
- function Ee(e) {
2026
+ function De(e) {
2027
2027
  return typeof e == "object" && !!e && !Array.isArray(e);
2028
2028
  }
2029
- e.isObject = Ee;
2030
- function De(e, n, r, i) {
2029
+ e.isObject = De;
2030
+ function Oe(e, n, r, i) {
2031
2031
  function a(e, t) {
2032
2032
  let n = 0, r = e.length, i = !1;
2033
2033
  for (let a = 0; a < e.length; a++) if (!i && e[a].startsWith("m=video") && (n = a), e[a].startsWith("a=mid:" + t) && (i = !0), i && e[a].startsWith("m=")) {
@@ -2053,7 +2053,7 @@ var on = 533, sn = "a=fmtp:", cn = "sps-pps-idr-in-keyframe=1", ln;
2053
2053
  }
2054
2054
  return e;
2055
2055
  }
2056
- e.patchSimulcastAnswerSdp = De;
2056
+ e.patchSimulcastAnswerSdp = Oe;
2057
2057
  })(ln || (ln = {}));
2058
2058
  var j = ln, un = "__CALLS_SDK_DEVTOOLS_", dn = class {
2059
2059
  set(e, t) {
@@ -2142,7 +2142,7 @@ var j = ln, un = "__CALLS_SDK_DEVTOOLS_", dn = class {
2142
2142
  h(pn, "instance", null);
2143
2143
  var mn = pn.getInstance(), M = class e {
2144
2144
  static set(t) {
2145
- Object.hasOwn(t, "voiceParams") && (Object.assign(e._params.voiceParams, t.voiceParams), delete t.voiceParams), Object.hasOwn(t, "specListenerParams") && (Object.assign(e._params.specListenerParams, t.specListenerParams), delete t.specListenerParams), Object.hasOwn(t, "apiAuth") && (y.accessToken = t.apiAuth.accessToken, y.sessionKey = t.apiAuth.sessionKey, y.sessionSecretKey = t.apiAuth.sessionSecretKey);
2145
+ Object.hasOwn(t, "voiceParams") && (Object.assign(e._params.voiceParams, t.voiceParams), delete t.voiceParams), Object.hasOwn(t, "specListenerParams") && (Object.assign(e._params.specListenerParams, t.specListenerParams), delete t.specListenerParams), Object.hasOwn(t, "apiAuth") && (v.accessToken = t.apiAuth.accessToken, v.sessionKey = t.apiAuth.sessionKey, v.sessionSecretKey = t.apiAuth.sessionSecretKey);
2146
2146
  let n = mn.params.applyOverrides(t);
2147
2147
  Object.assign(e._params, j.objectFilterOutValues(n, void 0));
2148
2148
  }
@@ -2159,7 +2159,7 @@ var mn = pn.getInstance(), M = class e {
2159
2159
  return 1.1;
2160
2160
  }
2161
2161
  static get sdkVersion() {
2162
- return "2.8.11-dev.50a3a6bf.0";
2162
+ return "2.8.11-dev.54118420.0";
2163
2163
  }
2164
2164
  static get debug() {
2165
2165
  return e._params.debug;
@@ -2217,7 +2217,7 @@ var mn = pn.getInstance(), M = class e {
2217
2217
  case "CALLSTEST": return "https://calls-test.okcdn.ru/api";
2218
2218
  case "CALLS_BETA": return "https://api-beta.calls-test.oneme.ru/api";
2219
2219
  case "CALLS_BENDER": return "https://api-bender.calls-test.oneme.ru/api";
2220
- case "CALLS_MAMES": return "https://api-mames.calls-test.oneme.ru/api";
2220
+ case "CALLS_MAMES": return "https://calls-mames.okcdn.ru/api";
2221
2221
  case "CALLS_MARS": return "https://api-mars.calls-test.oneme.ru/api";
2222
2222
  default: return e._params.apiEnv;
2223
2223
  }
@@ -2796,251 +2796,251 @@ var gn;
2796
2796
  F("onRemoteSharedUrl", e, t, n, r);
2797
2797
  }
2798
2798
  e.onRemoteSharedUrl = g;
2799
- function _(e, t, n) {
2799
+ function se(e, t, n) {
2800
2800
  F("onParticipantAdded", e, t, n);
2801
2801
  }
2802
- e.onParticipantAdded = _;
2803
- function se(e, t, n) {
2802
+ e.onParticipantAdded = se;
2803
+ function ce(e, t, n) {
2804
2804
  F("onParticipantJoined", e, t, n);
2805
2805
  }
2806
- e.onParticipantJoined = se;
2807
- function ce(e, t = !1, n) {
2806
+ e.onParticipantJoined = ce;
2807
+ function le(e, t = !1, n) {
2808
2808
  P("onLocalParticipantState", I(e), t, n);
2809
2809
  }
2810
- e.onLocalParticipantState = ce;
2811
- function le(e, t, n, r) {
2810
+ e.onLocalParticipantState = le;
2811
+ function ue(e, t, n, r) {
2812
2812
  F("onRemoteParticipantState", e, I(t), n, r);
2813
2813
  }
2814
- e.onRemoteParticipantState = le;
2815
- function ue(e, t, n) {
2814
+ e.onRemoteParticipantState = ue;
2815
+ function de(e, t, n) {
2816
2816
  P("onRemoteParticipantsState", e, t, n);
2817
2817
  }
2818
- e.onRemoteParticipantsState = ue;
2819
- function de(e, t, n = null, r) {
2818
+ e.onRemoteParticipantsState = de;
2819
+ function fe(e, t, n = null, r) {
2820
2820
  R.debug("Remote status:", t, e), F("onRemoteStatus", e, t, n, r);
2821
2821
  }
2822
- e.onRemoteStatus = de;
2823
- function fe() {
2822
+ e.onRemoteStatus = fe;
2823
+ function pe() {
2824
2824
  P("onPermissionsRequested");
2825
2825
  }
2826
- e.onPermissionsRequested = fe;
2827
- function pe(e, t) {
2826
+ e.onPermissionsRequested = pe;
2827
+ function me(e, t) {
2828
2828
  P("onPermissionsError", e, t);
2829
2829
  }
2830
- e.onPermissionsError = pe;
2831
- function me(e, t, n) {
2830
+ e.onPermissionsError = me;
2831
+ function he(e, t, n) {
2832
2832
  F("onRemoteRemoved", e, t, n);
2833
2833
  }
2834
- e.onRemoteRemoved = me;
2835
- function he(e, t, n, r) {
2834
+ e.onRemoteRemoved = he;
2835
+ function ge(e, t, n, r) {
2836
2836
  P("onCallState", e, t, I(n), r);
2837
2837
  }
2838
- e.onCallState = he;
2839
- function ge(e, t, n) {
2838
+ e.onCallState = ge;
2839
+ function _e(e, t, n) {
2840
2840
  P("onDeviceSwitched", e, t, n);
2841
2841
  }
2842
- e.onDeviceSwitched = ge;
2843
- function v(e, t, n, r = !1, i = !1, a = null, o = null, s, c, l = null, u) {
2842
+ e.onDeviceSwitched = _e;
2843
+ function _(e, t, n, r = !1, i = !1, a = null, o = null, s, c, l = null, u) {
2844
2844
  let d = c ? hn(c) : void 0;
2845
2845
  P("onMuteStates", I(e), hn(t), hn(n), r, i, a, o, s, d, l, u);
2846
2846
  }
2847
- e.onMuteStates = v;
2848
- function _e(e, t, n = !1, r) {
2847
+ e.onMuteStates = _;
2848
+ function ve(e, t, n = !1, r) {
2849
2849
  F("onRolesChanged", e, hn(t), n, r);
2850
2850
  }
2851
- e.onRolesChanged = _e;
2852
- function ve(e, t = !1, n) {
2851
+ e.onRolesChanged = ve;
2852
+ function ye(e, t = !1, n) {
2853
2853
  P("onLocalRolesChanged", hn(e), t, n);
2854
2854
  }
2855
- e.onLocalRolesChanged = ve;
2856
- function ye(e, t, n, r, i) {
2855
+ e.onLocalRolesChanged = ye;
2856
+ function be(e, t, n, r, i) {
2857
2857
  F("onPinnedParticipant", e, t, n, r, i);
2858
2858
  }
2859
- e.onPinnedParticipant = ye;
2860
- function be(e, t, n) {
2859
+ e.onPinnedParticipant = be;
2860
+ function xe(e, t, n) {
2861
2861
  P("onLocalPin", e, t, n);
2862
2862
  }
2863
- e.onLocalPin = be;
2864
- function xe(e, t) {
2863
+ e.onLocalPin = xe;
2864
+ function Se(e, t) {
2865
2865
  P("onOptionsChanged", hn(e), t);
2866
2866
  }
2867
- e.onOptionsChanged = xe;
2868
- function Se(e) {
2867
+ e.onOptionsChanged = Se;
2868
+ function Ce(e) {
2869
2869
  P("onCallAccepted", e);
2870
2870
  }
2871
- e.onCallAccepted = Se;
2872
- function Ce(e) {
2871
+ e.onCallAccepted = Ce;
2872
+ function we(e) {
2873
2873
  P("onCallActive", e);
2874
2874
  }
2875
- e.onCallActive = Ce;
2876
- function we(e, t, n) {
2875
+ e.onCallActive = we;
2876
+ function Te(e, t, n) {
2877
2877
  F("onAcceptedCall", e, t, n);
2878
2878
  }
2879
- e.onAcceptedCall = we;
2880
- function Te(e) {
2879
+ e.onAcceptedCall = Te;
2880
+ function Ee(e) {
2881
2881
  P("onRateNeeded", e);
2882
2882
  }
2883
- e.onRateNeeded = Te;
2884
- function Ee(e, t) {
2883
+ e.onRateNeeded = Ee;
2884
+ function De(e, t) {
2885
2885
  F("onSpeakerChanged", e, t);
2886
2886
  }
2887
- e.onSpeakerChanged = Ee;
2888
- function De(e, t) {
2887
+ e.onSpeakerChanged = De;
2888
+ function Oe(e, t) {
2889
2889
  P("onVolumesDetected", hn(e), t);
2890
2890
  }
2891
- e.onVolumesDetected = De;
2892
- function Oe(e, t) {
2891
+ e.onVolumesDetected = Oe;
2892
+ function ke(e, t) {
2893
2893
  P("onLocalVolume", e, t);
2894
2894
  }
2895
- e.onLocalVolume = Oe;
2896
- function ke(e, t, n) {
2895
+ e.onLocalVolume = ke;
2896
+ function Ae(e, t, n) {
2897
2897
  P("onJoinStatus", e, t, n);
2898
2898
  }
2899
- e.onJoinStatus = ke;
2900
- function Ae(e, t) {
2899
+ e.onJoinStatus = Ae;
2900
+ function je(e, t) {
2901
2901
  P("onHangup", e, t);
2902
2902
  }
2903
- e.onHangup = Ae;
2904
- function je(e) {
2903
+ e.onHangup = je;
2904
+ function Me(e) {
2905
2905
  P("onMultipartyChatCreated", I(e));
2906
2906
  }
2907
- e.onMultipartyChatCreated = je;
2908
- function Me() {
2907
+ e.onMultipartyChatCreated = Me;
2908
+ function Ne() {
2909
2909
  P("onDeviceChange");
2910
2910
  }
2911
- e.onDeviceChange = Me;
2912
- function Ne(e) {
2911
+ e.onDeviceChange = Ne;
2912
+ function Pe(e) {
2913
2913
  P("onFingerprintChange", e);
2914
2914
  }
2915
- e.onFingerprintChange = Ne;
2916
- function Pe() {
2915
+ e.onFingerprintChange = Pe;
2916
+ function Fe() {
2917
2917
  P("onTokenExpired");
2918
2918
  }
2919
- e.onTokenExpired = Pe;
2920
- function Fe(e, t, n = !1, r) {
2919
+ e.onTokenExpired = Fe;
2920
+ function Ie(e, t, n = !1, r) {
2921
2921
  P("onChatMessage", e, t, n, r);
2922
2922
  }
2923
- e.onChatMessage = Fe;
2924
- function Ie(e, t, n = !1, r) {
2923
+ e.onChatMessage = Ie;
2924
+ function Le(e, t, n = !1, r) {
2925
2925
  P("onCustomData", e, t, n, r);
2926
2926
  }
2927
- e.onCustomData = Ie;
2928
- function Le(e, t, n, r, i, a, o = null, s) {
2927
+ e.onCustomData = Le;
2928
+ function Re(e, t, n, r, i, a, o = null, s) {
2929
2929
  P("onRecordStarted", e, t, n, r, i, a, o, s);
2930
2930
  }
2931
- e.onRecordStarted = Le;
2932
- function Re(e = null, t, n) {
2931
+ e.onRecordStarted = Re;
2932
+ function ze(e = null, t, n) {
2933
2933
  P("onRecordStopped", e, t, n);
2934
2934
  }
2935
- e.onRecordStopped = Re;
2936
- function ze(e, t) {
2935
+ e.onRecordStopped = ze;
2936
+ function Be(e, t) {
2937
2937
  P("onLocalNetworkStatusChanged", e, t);
2938
2938
  }
2939
- e.onLocalNetworkStatusChanged = ze;
2940
- function Be(e, t) {
2939
+ e.onLocalNetworkStatusChanged = Be;
2940
+ function Ve(e, t) {
2941
2941
  P("onNetworkStatusChanged", e, t);
2942
2942
  }
2943
- e.onNetworkStatusChanged = Be;
2944
- function Ve(e, ...t) {
2943
+ e.onNetworkStatusChanged = Ve;
2944
+ function He(e, ...t) {
2945
2945
  P("onDebugMessage", e, ...t);
2946
2946
  }
2947
- e.onDebugMessage = Ve;
2948
- function He(e, t, ...n) {
2947
+ e.onDebugMessage = He;
2948
+ function Ue(e, t, ...n) {
2949
2949
  P("onDebugMessageWithContext", e, t, ...n);
2950
2950
  }
2951
- e.onDebugMessageWithContext = He;
2952
- function Ue(e, t) {
2951
+ e.onDebugMessageWithContext = Ue;
2952
+ function We(e, t) {
2953
2953
  P("onStatistics", Object.assign({}, e, { memory: t }));
2954
2954
  }
2955
- e.onStatistics = Ue;
2956
- function We() {
2955
+ e.onStatistics = We;
2956
+ function Ge() {
2957
2957
  P("onAutoplayError");
2958
2958
  }
2959
- e.onAutoplayError = We;
2960
- function Ge(e, t, n, r, i, a) {
2959
+ e.onAutoplayError = Ge;
2960
+ function Ke(e, t, n, r, i, a) {
2961
2961
  P("onChatRoomUpdated", e, t, n, r, i, a);
2962
2962
  }
2963
- e.onChatRoomUpdated = Ge;
2964
- function Ke(e, t) {
2963
+ e.onChatRoomUpdated = Ke;
2964
+ function qe(e, t) {
2965
2965
  P("onPromoted", e, t);
2966
2966
  }
2967
- e.onPromoted = Ke;
2968
- function qe(e, t) {
2967
+ e.onPromoted = qe;
2968
+ function Je(e, t) {
2969
2969
  P("onRemoteMixedAudioStream", e, t);
2970
2970
  }
2971
- e.onRemoteMixedAudioStream = qe;
2972
- function y(e, t) {
2971
+ e.onRemoteMixedAudioStream = Je;
2972
+ function v(e, t) {
2973
2973
  P("onJoinLinkChanged", e, t);
2974
2974
  }
2975
- e.onJoinLinkChanged = y;
2976
- function b(e, t) {
2975
+ e.onJoinLinkChanged = v;
2976
+ function y(e, t) {
2977
2977
  P("onRoomsUpdated", e, t);
2978
2978
  }
2979
- e.onRoomsUpdated = b;
2980
- function x(e, t, n, r, i) {
2979
+ e.onRoomsUpdated = y;
2980
+ function b(e, t, n, r, i) {
2981
2981
  P("onRoomUpdated", e, t, n, r, i);
2982
2982
  }
2983
- e.onRoomUpdated = x;
2984
- function S(e, t) {
2983
+ e.onRoomUpdated = b;
2984
+ function x(e, t) {
2985
2985
  P("onRoomParticipantsUpdated", e, t);
2986
2986
  }
2987
- e.onRoomParticipantsUpdated = S;
2988
- function C(e, t) {
2987
+ e.onRoomParticipantsUpdated = x;
2988
+ function S(e, t) {
2989
2989
  P("onRoomSwitched", e, t);
2990
2990
  }
2991
- e.onRoomSwitched = C;
2992
- function Je(e, t) {
2991
+ e.onRoomSwitched = S;
2992
+ function Ye(e, t) {
2993
2993
  P("onRoomStart", e, t);
2994
2994
  }
2995
- e.onRoomStart = Je;
2996
- function Ye(e, t = null, n) {
2995
+ e.onRoomStart = Ye;
2996
+ function Xe(e, t = null, n) {
2997
2997
  P("onFeedback", e, t, n);
2998
2998
  }
2999
- e.onFeedback = Ye;
3000
- function Xe(e, t) {
2999
+ e.onFeedback = Xe;
3000
+ function Ze(e, t) {
3001
3001
  P("onFeaturesPerRoleChanged", e, t);
3002
3002
  }
3003
- e.onFeaturesPerRoleChanged = Xe;
3004
- function Ze(e, t) {
3003
+ e.onFeaturesPerRoleChanged = Ze;
3004
+ function Qe(e, t) {
3005
3005
  P("onParticipantVmojiUpdate", e, t);
3006
3006
  }
3007
- e.onParticipantVmojiUpdate = Ze;
3008
- function Qe(e, t, n) {
3007
+ e.onParticipantVmojiUpdate = Qe;
3008
+ function $e(e, t, n) {
3009
3009
  P("onAsrSet", e, t, n);
3010
3010
  }
3011
- e.onAsrSet = Qe;
3012
- function $e(e, t, n, r) {
3011
+ e.onAsrSet = $e;
3012
+ function et(e, t, n, r) {
3013
3013
  P("onAsrStarted", e, t, n, r);
3014
3014
  }
3015
- e.onAsrStarted = $e;
3016
- function et(e, t) {
3015
+ e.onAsrStarted = et;
3016
+ function tt(e, t) {
3017
3017
  P("onAsrStopped", e, t);
3018
3018
  }
3019
- e.onAsrStopped = et;
3020
- function tt(e, t, n, r, i) {
3019
+ e.onAsrStopped = tt;
3020
+ function nt(e, t, n, r, i) {
3021
3021
  P("onAsrTranscription", e, t, n, r, i);
3022
3022
  }
3023
- e.onAsrTranscription = tt;
3024
- function nt(e, t, n) {
3023
+ e.onAsrTranscription = nt;
3024
+ function rt(e, t, n) {
3025
3025
  P("onParticipantIdChanged", e, t, n);
3026
3026
  }
3027
- e.onParticipantIdChanged = nt;
3028
- function rt(e, t) {
3027
+ e.onParticipantIdChanged = rt;
3028
+ function it(e, t) {
3029
3029
  P("onVideoSuspendSuggest", e, t);
3030
3030
  }
3031
- e.onVideoSuspendSuggest = rt;
3032
- function it(e) {
3031
+ e.onVideoSuspendSuggest = it;
3032
+ function at(e) {
3033
3033
  P("onSignalingMessage", typeof e == "string" ? e : I(e));
3034
3034
  }
3035
- e.onSignalingMessage = it;
3036
- function at(e, t) {
3035
+ e.onSignalingMessage = at;
3036
+ function ot(e, t) {
3037
3037
  P("onPromotionApproved", e, t);
3038
3038
  }
3039
- e.onPromotionApproved = at;
3040
- function ot(e) {
3039
+ e.onPromotionApproved = ot;
3040
+ function st(e) {
3041
3041
  P("onPeerRegistered", e);
3042
3042
  }
3043
- e.onPeerRegistered = ot;
3043
+ e.onPeerRegistered = st;
3044
3044
  })(gn || (gn = {}));
3045
3045
  var L = gn, _n = /* @__PURE__ */ function(e) {
3046
3046
  return e.DEBUG = "DEBUG", e.LOG = "LOG", e.WARN = "WARN", e.ERROR = "ERROR", e;
@@ -3062,7 +3062,7 @@ var L = gn, _n = /* @__PURE__ */ function(e) {
3062
3062
  }
3063
3063
  function u(e, t, n) {
3064
3064
  let u = l(n);
3065
- if (M.debugLog && ke(e, t, u.sessionId || void 0), c) switch (e) {
3065
+ if (M.debugLog && Ae(e, t, u.sessionId || void 0), c) switch (e) {
3066
3066
  case "DEBUG":
3067
3067
  i(...t);
3068
3068
  break;
@@ -3099,7 +3099,7 @@ var L = gn, _n = /* @__PURE__ */ function(e) {
3099
3099
  }
3100
3100
  e.enabled = ee;
3101
3101
  function h(e) {
3102
- c = e, M.debugLog && Ae();
3102
+ c = e, M.debugLog && je();
3103
3103
  }
3104
3104
  e.toggle = h;
3105
3105
  function te(e, ...t) {
@@ -3131,7 +3131,7 @@ var L = gn, _n = /* @__PURE__ */ function(e) {
3131
3131
  function re(e = null) {
3132
3132
  let t = null, n = e;
3133
3133
  function r() {
3134
- !M.debugLog || t || (t = je(), n && Me(n, t));
3134
+ !M.debugLog || t || (t = Me(), n && Ne(n, t));
3135
3135
  }
3136
3136
  let i = () => (r(), {
3137
3137
  sessionId: t,
@@ -3145,7 +3145,7 @@ var L = gn, _n = /* @__PURE__ */ function(e) {
3145
3145
  return n;
3146
3146
  },
3147
3147
  setConversationId(e) {
3148
- n = e, t && Me(n, t);
3148
+ n = e, t && Ne(n, t);
3149
3149
  },
3150
3150
  debug: (...e) => u("DEBUG", e, i),
3151
3151
  log: (...e) => u("LOG", e, i),
@@ -3174,9 +3174,8 @@ var R = vn, z = new class {
3174
3174
  getActive() {
3175
3175
  return this._activeId ? this._conversations.get(this._activeId) ?? null : null;
3176
3176
  }
3177
- getFirstHeld() {
3178
- for (let e of this._conversations.values()) if (e.isCallHeld) return e;
3179
- return null;
3177
+ getFirst() {
3178
+ return this._conversations.values().next().value ?? null;
3180
3179
  }
3181
3180
  getActiveId() {
3182
3181
  return this._activeId;
@@ -3237,7 +3236,7 @@ var R = vn, z = new class {
3237
3236
  clear() {
3238
3237
  this._conversations.clear(), this._activeId = null;
3239
3238
  }
3240
- }(), yn = class extends b {
3239
+ }(), yn = class extends y {
3241
3240
  constructor(...e) {
3242
3241
  super(...e), h(this, "_abortSignal", void 0);
3243
3242
  }
@@ -3777,7 +3776,7 @@ function Cr() {
3777
3776
  }
3778
3777
  //#endregion
3779
3778
  //#region src/classes/transport/BaseTransport.ts
3780
- var wr = class extends b {
3779
+ var wr = class extends y {
3781
3780
  constructor(e, t) {
3782
3781
  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;
3783
3782
  }
@@ -3802,7 +3801,7 @@ var wr = class extends b {
3802
3801
  getValue() {
3803
3802
  return this.value;
3804
3803
  }
3805
- }, Er = .25, Dr = .35, Or = 85, kr = .1, Ar = 1.5, jr = .1, Mr = 1, Nr = .6, Pr = .3, Fr = class extends b {
3804
+ }, Er = .25, Dr = .35, Or = 85, kr = .1, Ar = 1.5, jr = .1, Mr = 1, Nr = .6, Pr = .3, Fr = class extends y {
3806
3805
  constructor(e, t = R) {
3807
3806
  super(), h(this, "_signaling", void 0), h(this, "_localNetworkStat", void 0), h(this, "_remoteNetworkStat", void 0), h(this, "_lastNetworkStat", void 0), h(this, "_networkLimits", {
3808
3807
  badNet: {
@@ -3908,7 +3907,7 @@ var wr = class extends b {
3908
3907
  try {
3909
3908
  this._mediaSource.addTrackToPeerConnection(this._pc, !1, !0), this._applySettings();
3910
3909
  } catch (e) {
3911
- this._logger?.log(C.ERROR, "addTrack-direct"), this._debug.error("Unable to add media source tracks", e, { participantId: this._participantId }), this._failedOnCreate = e;
3910
+ this._logger?.log(S.ERROR, "addTrack-direct"), this._debug.error("Unable to add media source tracks", e, { participantId: this._participantId }), this._failedOnCreate = e;
3912
3911
  return;
3913
3912
  }
3914
3913
  this._createOffer(!1).catch((e) => {
@@ -3942,7 +3941,7 @@ var wr = class extends b {
3942
3941
  if (this._debug.debug("DirectTransport: Open transport", { participantId: this._participantId }), this._isOpen = !0, this._remotePeerId = e, !this._isMaster) try {
3943
3942
  this._mediaSource.addTrackToPeerConnection(this._pc, !1, !0), this._applySettings();
3944
3943
  } catch (e) {
3945
- this._logger?.log(C.ERROR, "addTrack-direct"), this._debug.error("DirectTransport: Unable to add media source tracks", e, { participantId: this._participantId }), this.close(e);
3944
+ this._logger?.log(S.ERROR, "addTrack-direct"), this._debug.error("DirectTransport: Unable to add media source tracks", e, { participantId: this._participantId }), this.close(e);
3946
3945
  return;
3947
3946
  }
3948
3947
  this._setState(K.OPENED);
@@ -4033,7 +4032,7 @@ var wr = class extends b {
4033
4032
  try {
4034
4033
  await this._pc.addIceCandidate(new RTCIceCandidate(t));
4035
4034
  } catch (e) {
4036
- throw this._logger?.log(C.ERROR, "addIceCandidate-direct"), this._debug.error("Unable to add remote ice candidate", e, {
4035
+ throw this._logger?.log(S.ERROR, "addIceCandidate-direct"), this._debug.error("Unable to add remote ice candidate", e, {
4037
4036
  participantId: this._participantId,
4038
4037
  candidate: t
4039
4038
  }), e;
@@ -4064,7 +4063,7 @@ var wr = class extends b {
4064
4063
  try {
4065
4064
  await this._pc.setRemoteDescription(n), await this._setRemoteCandidates(t), this._processAnimojiProtocolVersion(this._remoteAnimojiVersion);
4066
4065
  } catch (e) {
4067
- throw this._logger?.log(C.ERROR, "setRemoteDescription-direct"), this._debug.error("Unable to set remote description", e, {
4066
+ throw this._logger?.log(S.ERROR, "setRemoteDescription-direct"), this._debug.error("Unable to set remote description", e, {
4068
4067
  participantId: this._participantId,
4069
4068
  sdp: n
4070
4069
  }), e;
@@ -4116,11 +4115,11 @@ var wr = class extends b {
4116
4115
  }
4117
4116
  _markConnected() {
4118
4117
  this._neverConnected = !1, this._setState(K.CONNECTED), this._stopReconnection(), this._pc && j.getPeerConnectionHostInfo(this._pc).then((e) => {
4119
- e?.local && (this._logger?.log(C.ICE_CONNECTION_TYPE, e.local.type), this._debug.debug("Selected ICE candidates", e));
4118
+ e?.local && (this._logger?.log(S.ICE_CONNECTION_TYPE, e.local.type), this._debug.debug("Selected ICE candidates", e));
4120
4119
  }), this._startStatInterval();
4121
4120
  }
4122
4121
  _onConnectionStateChange() {
4123
- switch (this._debug.debug(`DirectTransport: Connection state changed to ${this._pc?.connectionState}`, { participantId: this._participantId }), this._logger?.log(C.ICE_CONNECTION_STATE, this._pc?.connectionState), this._pc?.connectionState) {
4122
+ switch (this._debug.debug(`DirectTransport: Connection state changed to ${this._pc?.connectionState}`, { participantId: this._participantId }), this._logger?.log(S.ICE_CONNECTION_STATE, this._pc?.connectionState), this._pc?.connectionState) {
4124
4123
  case "connected":
4125
4124
  this._markConnected();
4126
4125
  break;
@@ -4145,8 +4144,8 @@ var wr = class extends b {
4145
4144
  this._reconnectionTimeout && (clearTimeout(this._reconnectionTimeout), this._reconnectionTimeout = null), this._iceRestartTimeout && (clearTimeout(this._iceRestartTimeout), this._iceRestartTimeout = null);
4146
4145
  }
4147
4146
  _startIceRestart() {
4148
- this._isMaster ? (this._logger?.log(C.ICE_RESTART), this._debug.log("Ice restart", { participantId: this._participantId }), this._createOffer(!0).catch(this.close.bind(this))) : this._debug.debug("Waiting for ice restart...", { participantId: this._participantId }), this._iceRestartTimeout = window.setTimeout(() => {
4149
- this._iceRestartTimeout = null, this._debug.error("Ice restart failed", { participantId: this._participantId }), this._logger?.log(C.ERROR, "iceRestart-direct"), this._requestTopologySwitch();
4147
+ this._isMaster ? (this._logger?.log(S.ICE_RESTART), this._debug.log("Ice restart", { participantId: this._participantId }), this._createOffer(!0).catch(this.close.bind(this))) : this._debug.debug("Waiting for ice restart...", { participantId: this._participantId }), this._iceRestartTimeout = window.setTimeout(() => {
4148
+ this._iceRestartTimeout = null, this._debug.error("Ice restart failed", { participantId: this._participantId }), this._logger?.log(S.ERROR, "iceRestart-direct"), this._requestTopologySwitch();
4150
4149
  }, M.iceRestartWaitTime);
4151
4150
  }
4152
4151
  async _createOffer(t) {
@@ -4166,7 +4165,7 @@ var wr = class extends b {
4166
4165
  offer: r
4167
4166
  }), r = e._patchLocalDescription(r);
4168
4167
  } catch (e) {
4169
- throw this._debug.error("Unable to create offer", e, { participantId: this._participantId }), this._logger?.log(C.ERROR, "createOffer-direct"), e;
4168
+ throw this._debug.error("Unable to create offer", e, { participantId: this._participantId }), this._logger?.log(S.ERROR, "createOffer-direct"), e;
4170
4169
  }
4171
4170
  try {
4172
4171
  return this._debug.debug("Set local description", {
@@ -4174,7 +4173,7 @@ var wr = class extends b {
4174
4173
  offer: r
4175
4174
  }), this._calcFingerprint(r.sdp), await this._pc?.setLocalDescription(r), r;
4176
4175
  } catch (e) {
4177
- throw this._debug.error("Unable to set local description", e, { participantId: this._participantId }), this._logger?.log(C.ERROR, "setLocalDescription-direct"), e;
4176
+ throw this._debug.error("Unable to set local description", e, { participantId: this._participantId }), this._logger?.log(S.ERROR, "setLocalDescription-direct"), e;
4178
4177
  }
4179
4178
  }
4180
4179
  async _createAnswer() {
@@ -4186,7 +4185,7 @@ var wr = class extends b {
4186
4185
  answer: t
4187
4186
  }), t = e._patchLocalDescription(t);
4188
4187
  } catch (e) {
4189
- throw this._debug.error("Unable to create answer", e, { participantId: this._participantId }), this._logger?.log(C.ERROR, "createAnswer-direct"), e;
4188
+ throw this._debug.error("Unable to create answer", e, { participantId: this._participantId }), this._logger?.log(S.ERROR, "createAnswer-direct"), e;
4190
4189
  }
4191
4190
  try {
4192
4191
  return this._debug.debug("Set local description", {
@@ -4194,7 +4193,7 @@ var wr = class extends b {
4194
4193
  answer: t
4195
4194
  }), this._calcFingerprint(t.sdp), await this._pc?.setLocalDescription(t), t;
4196
4195
  } catch (e) {
4197
- throw this._debug.error("Unable to set local description", e, { participantId: this._participantId }), this._logger?.log(C.ERROR, "setLocalDescription-direct"), e;
4196
+ throw this._debug.error("Unable to set local description", e, { participantId: this._participantId }), this._logger?.log(S.ERROR, "setLocalDescription-direct"), e;
4198
4197
  }
4199
4198
  }
4200
4199
  static _patchLocalDescription(e) {
@@ -4207,7 +4206,7 @@ var wr = class extends b {
4207
4206
  _onReplacedTrack(e) {
4208
4207
  this._pc && (this._pc.getSenders().forEach((t) => {
4209
4208
  t.track && t.track.kind === e.kind && t.track.contentHint === e.contentHint && t.replaceTrack(e).catch((e) => {
4210
- this._debug.error("DirectTransport: Unable to replace track", e, { participantId: this._participantId }), this._logger?.log(C.ERROR, "replaceTrack-direct");
4209
+ this._debug.error("DirectTransport: Unable to replace track", e, { participantId: this._participantId }), this._logger?.log(S.ERROR, "replaceTrack-direct");
4211
4210
  });
4212
4211
  }), this._applySettings());
4213
4212
  }
@@ -4522,14 +4521,31 @@ var Ur = class {
4522
4521
  }
4523
4522
  async _createWorker(e, t, n = [], r = {}, i = []) {
4524
4523
  return new Promise((a, o) => {
4525
- let s = n.join(","), c = new Blob([e, `exports.default(${s});`], { type: "application/javascript; charset=utf-8" }), l = window.URL.createObjectURL(c);
4526
- this._worker = new Worker(l), this._worker.onmessage = (e) => {
4524
+ let s = !1, c = !1, l = n.join(","), u = new Blob([e, `exports.default(${l});`], { type: "application/javascript; charset=utf-8" }), d = window.URL.createObjectURL(u), f = new Worker(d);
4525
+ window.URL.revokeObjectURL(d), this._worker = f;
4526
+ let p = (e) => {
4527
+ c || (c = !0, o(e));
4528
+ }, m = (e) => {
4529
+ if (this._debug.warn(e), !s) {
4530
+ p(e);
4531
+ return;
4532
+ }
4533
+ t({
4534
+ type: Wr.FRAME,
4535
+ error: e
4536
+ });
4537
+ };
4538
+ f.onerror = (e) => {
4539
+ e.preventDefault?.(), m(this._formatWorkerError(e));
4540
+ }, f.onmessageerror = (e) => {
4541
+ e.preventDefault?.(), m(this._formatWorkerMessageError(e));
4542
+ }, f.onmessage = (e) => {
4527
4543
  switch (e.data.type) {
4528
4544
  case Wr.READY:
4529
- a();
4545
+ s = !0, c || (c = !0, a());
4530
4546
  break;
4531
4547
  case Wr.ERROR:
4532
- o(e.data.error);
4548
+ s ? m(e.data.error) : p(e.data.error);
4533
4549
  break;
4534
4550
  case Wr.FRAME:
4535
4551
  t(e.data);
@@ -4538,7 +4554,7 @@ var Ur = class {
4538
4554
  this._debug.debug(e.data.message);
4539
4555
  break;
4540
4556
  case Wr.LOG_ERROR:
4541
- this._logger?.log(C.ERROR, e.data.message);
4557
+ this._logger?.log(S.ERROR, e.data.message);
4542
4558
  break;
4543
4559
  }
4544
4560
  }, this._sendToWorker(Wr.INIT, r, i);
@@ -4550,6 +4566,17 @@ var Ur = class {
4550
4566
  _sendToWorker(e, t = {}, n = []) {
4551
4567
  this._worker?.postMessage(Object.assign({ type: e }, t), n);
4552
4568
  }
4569
+ _formatWorkerError(e) {
4570
+ let t = e.message || e.error?.message || "Unknown worker error", n = [[
4571
+ e.filename,
4572
+ e.lineno,
4573
+ e.colno
4574
+ ].filter(Boolean).join(":"), [e.error?.name, e.error?.stack].filter(Boolean).join(": ")].filter(Boolean).join(" ");
4575
+ return `${this.constructor.name} Worker crashed: ${t}${n ? ` (${n})` : ""}`;
4576
+ }
4577
+ _formatWorkerMessageError(e) {
4578
+ return `${this.constructor.name} Worker message error${e.origin ? ` from ${e.origin}` : ""}`;
4579
+ }
4553
4580
  static isBrowserSupported() {
4554
4581
  throw Error("Not implemented");
4555
4582
  }
@@ -4582,7 +4609,7 @@ var Ur = class {
4582
4609
  super(e, t);
4583
4610
  }
4584
4611
  async init(e, t, n) {
4585
- this._debug.debug("WebCodecsDecoder started"), await this._createWorker("var workerExports=(function(){var e=function(e){return e.VP9=`vp09.00.50.08`,e.VP8=`vp8`,e}({}),t=function(e){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}({});return n=>{let r=null,i=`no-preference`,a=!0,o=!1,s=!1,c=null,l=null;function u(){self.postMessage({type:t.READY})}function d(e,n,r,i=!1){c={timestamp:e,data:n,isVP9:r,keyFrame:i};let a=p(r);if(o&&!i){self.postMessage({type:t.FRAME,error:`WebCodecsDecoder waiting for keyframe`}),f();return}else o&&i&&(o=!1,s=!1,self.postMessage({type:t.DEBUG,message:`WebCodecsDecoder got keyframe. Start decoding`}));let l=new EncodedVideoChunk({type:i?`key`:`delta`,timestamp:e,data:n});try{a.decode(l)}catch(e){m(`because failed call decode: ${e.message}`);return}h(i)}self.onmessage=e=>{switch(e.data.type){case t.INIT:u();break;case t.FRAME:d(e.data.timestamp,e.data.data,e.data.isVP9,e.data.keyFrame);break}};function f(){s||(self.postMessage({type:t.FRAME,requestKeyFrame:!0}),s=!0)}function p(e){return a!==e&&(a=e,m(`because codec is changed to ${a?`VP9`:`VP8`}`)),r||(o=!0,self.postMessage({type:t.DEBUG,message:`WebCodecsDecoder codec ${a?`VP9`:`VP8`}`}),r=new VideoDecoder({output:e=>{g();let r=n?[e]:[];self.postMessage({type:t.FRAME,data:e},r),e.close()},error:e=>{g(),m(`because error during decoding: ${e.message}`),i===`prefer-software`?self.postMessage({type:t.FRAME,error:`WebCodecsDecoder failed, reinitialize: `+String(e)}):(i=`prefer-software`,c&&c.keyFrame&&d(c.timestamp,c.data,c.isVP9,c.keyFrame),self.postMessage({type:t.DEBUG,message:`WebCodecsDecoder codec switch to prefer-software because decoding issue: ${e.message}`}))}}),r.configure(_(a,i))),r}function m(e){if(r){try{r&&r.state!==`closed`&&r.close()}catch{}r=null,self.postMessage({type:t.FRAME,error:`WebCodecsDecoder reset ${e}`})}}function h(e=!1){l=setTimeout(()=>{m(`because of decode timeout`)},3e3)}function g(){l&&clearTimeout(l),l=null}function _(t,n){return{codec:t?e.VP9:e.VP8,hardwareAcceleration:n}}}})(),exports={default:workerExports};", (r) => {
4612
+ this._debug.debug("WebCodecsDecoder started"), await this._createWorker("var workerExports=(function(){var e=function(e){return e.VP9=`vp09.00.50.08`,e.VP8=`vp8`,e}({}),t=function(e){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}({});return n=>{let r=null,i=`no-preference`,a=!0,o=!1,s=!1,c=null,l=null;function u(e){return e instanceof Error?[e.name,e.message,e.stack].filter(Boolean).join(`: `):String(e)}function d(e,n){try{self.postMessage({type:t.FRAME,error:`WebCodecsDecoder ${e} failed: ${u(n)}`})}catch{}}function f(){self.postMessage({type:t.READY})}function p(e,n,r,i=!1){try{c={timestamp:e,data:n,isVP9:r,keyFrame:i};let a=h(r);if(o&&!i){self.postMessage({type:t.FRAME,error:`WebCodecsDecoder waiting for keyframe`}),m();return}else o&&i&&(o=!1,s=!1,self.postMessage({type:t.DEBUG,message:`WebCodecsDecoder got keyframe. Start decoding`}));let l=new EncodedVideoChunk({type:i?`key`:`delta`,timestamp:e,data:n});a.decode(l)}catch(e){_(`because failed call decode: ${u(e)}`),d(`decode`,e);return}v(i)}self.onmessage=e=>{try{switch(e.data.type){case t.INIT:f();break;case t.FRAME:p(e.data.timestamp,e.data.data,e.data.isVP9,e.data.keyFrame);break}}catch(e){d(`message`,e)}};function m(){s||(self.postMessage({type:t.FRAME,requestKeyFrame:!0}),s=!0)}function h(e){if(a!==e&&(a=e,_(`because codec is changed to ${a?`VP9`:`VP8`}`)),!r){o=!0,self.postMessage({type:t.DEBUG,message:`WebCodecsDecoder codec ${a?`VP9`:`VP8`}`}),r=new VideoDecoder({output:e=>{y(),g(e)},error:e=>{y(),_(`because error during decoding: ${u(e)}`),i===`prefer-software`?self.postMessage({type:t.FRAME,error:`WebCodecsDecoder failed, reinitialize: `+u(e)}):(i=`prefer-software`,c&&c.keyFrame&&p(c.timestamp,c.data,c.isVP9,c.keyFrame),self.postMessage({type:t.DEBUG,message:`WebCodecsDecoder codec switch to prefer-software because decoding issue: ${u(e)}`}))}});try{r.configure(b(a,i))}catch(e){throw _(`because failed configure: ${u(e)}`),d(`configure`,e),e}}return r}function g(e){try{let r=n?[e]:[];self.postMessage({type:t.FRAME,data:e},r)}catch(n){try{self.postMessage({type:t.FRAME,data:e})}catch(e){d(`postMessage`,e),d(`postMessage transfer`,n)}}finally{try{e.close()}catch{}}}function _(e){if(r){try{r&&r.state!==`closed`&&r.close()}catch{}r=null,self.postMessage({type:t.FRAME,error:`WebCodecsDecoder reset ${e}`})}}function v(e=!1){l=setTimeout(()=>{_(`because of decode timeout`)},3e3)}function y(){l&&clearTimeout(l),l=null}function b(t,n){return{codec:t?e.VP9:e.VP8,hardwareAcceleration:n}}}})(),exports={default:workerExports};", (r) => {
4586
4613
  r.error ? (this._debug.warn("WebCodecsDecoder", r.error), t(r.error)) : r.requestKeyFrame ? (this._debug.debug("WebCodecsDecoder requests key frame"), n()) : (e(r.data), r.data.close());
4587
4614
  }, [T.baseChromeVersion() >= 92 || T.browserName() === "Safari"]);
4588
4615
  }
@@ -4788,6 +4815,8 @@ var Ur = class {
4788
4815
  this._decoderBusy = !1, this._decodeQueue(), this._decoder instanceof qr && typeof e == "string" && e.includes("EncodingError") && this._switchToLibVPXDecoder();
4789
4816
  }, this._onKeyFrameRequested).then(() => {
4790
4817
  this._decoderReady = !0, this._decodeQueue();
4818
+ }).catch((e) => {
4819
+ this._debug.warn("StreamBuilder decoder init failed", e), this._decoder instanceof qr && this._switchToLibVPXDecoder();
4791
4820
  });
4792
4821
  }
4793
4822
  _switchToLibVPXDecoder() {
@@ -5197,7 +5226,7 @@ var gi = 2 ** 15 - 1, _i = 1, vi = 5, yi = 5, bi = class e {
5197
5226
  }
5198
5227
  async init() {
5199
5228
  let e = this._sourceTrack.getSettings().width, t = this._sourceTrack.getSettings().height, n = this._trackProcessor.readable;
5200
- this._debug.debug(`WebCodecsEncoder started ${e}x${t}, codec ${this.isVP9() ? "VP9" : "VP8"}`), await this._createWorker("var workerExports=(function(){var e=function(e){return e.VP9=`vp09.00.50.08`,e.VP8=`vp8`,e}({}),t=function(e){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}({});return()=>{let n,r,i,a,o,s,c=null,l=0,u=!1,d=0,f,p,m=!1,h=!1;function g(e){n=e.readable,r=n.getReader(),i=e.width,a=e.height,o=e.isVP9,s=e.framerate,f=e.useCongestionControl,p=e.maxBitrate,f&&(d=p,m=e.useCbr),y(),self.postMessage({type:t.READY})}function _(e){e&&!h&&(h=!0),self.clearTimeout(l),l=self.setTimeout(()=>{c&&v(c,h)},1e3),!u&&(u=!0,r.read().finally(()=>{u=!1,self.clearTimeout(l)}).then(({done:e,value:t})=>{if(c?.close(),c=null,!(e||!t)){if(!x){r.releaseLock(),n.cancel();return}c=t,v(t,h)}}))}function v(e,t){(e.codedWidth!==i||e.codedHeight!==a)&&(i=e.codedWidth,a=e.codedHeight,y(),h=!0),x.encode(e,{keyFrame:t}),t&&(h=!1)}function y(){let t={framerate:s,codec:o?e.VP9:e.VP8,width:i,height:a,latencyMode:`realtime`,bitrateMode:m?`constant`:`variable`};d>0&&(t.bitrate=d),x.configure(t)}function b(e,t,n){d=e,m=t,s=n,y()}let x=new VideoEncoder({output:e=>{let n;e.data?n=e.data:(n=new ArrayBuffer(e.byteLength),e.copyTo(n)),self.postMessage({type:t.FRAME,frameType:e.type,timestamp:e.timestamp,duration:e.duration,width:i,height:a,data:n},[n])},error:e=>{self.postMessage({type:t.FRAME,error:String(e)})}});self.onmessage=e=>{switch(e.data.type){case t.INIT:g(e.data);break;case t.FRAME:_(e.data.keyFrame);break;case t.SET_BITRATE:b(e.data.bitrate,e.data.useCbr,e.data.fps);break}}}})(),exports={default:workerExports};", (e) => {
5229
+ this._debug.debug(`WebCodecsEncoder started ${e}x${t}, codec ${this.isVP9() ? "VP9" : "VP8"}`), await this._createWorker("var workerExports=(function(){var e=function(e){return e.VP9=`vp09.00.50.08`,e.VP8=`vp8`,e}({}),t=function(e){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}({});return()=>{let n,r,i,a,o,s,c=null,l=0,u=!1,d=0,f,p,m=!1,h=!1,g=null;function _(e){return e instanceof Error?[e.name,e.message,e.stack].filter(Boolean).join(`: `):String(e)}function v(e,n){try{self.postMessage({type:t.FRAME,error:`WebCodecsEncoder ${e} failed: ${_(n)}`})}catch{}}function y(e,n){try{self.postMessage({type:t.ERROR,error:`WebCodecsEncoder ${e} failed: ${_(n)}`})}catch{}}function b(e){try{n=e.readable,r=n.getReader(),i=e.width,a=e.height,o=e.isVP9,s=e.framerate,f=e.useCongestionControl,p=e.maxBitrate,f&&(d=p,m=e.useCbr),T(),C(),self.postMessage({type:t.READY})}catch(e){y(`init`,e)}}function x(e){e&&!h&&(h=!0),self.clearTimeout(l),l=self.setTimeout(()=>{c&&S(c,h)},1e3),!u&&(u=!0,r.read().finally(()=>{u=!1,self.clearTimeout(l)}).then(({done:e,value:t})=>{if(c?.close(),c=null,!(e||!t)){if(!g){r.releaseLock(),n.cancel();return}c=t,S(t,h)}}).catch(e=>{v(`read`,e)}))}function S(e,t){try{if((e.codedWidth!==i||e.codedHeight!==a)&&(i=e.codedWidth,a=e.codedHeight,C(),h=!0),!g)throw Error(`encoder is not initialized`);g.encode(e,{keyFrame:t}),t&&(h=!1)}catch(e){v(`encode`,e)}}function C(){if(!g)throw Error(`encoder is not initialized`);let t={framerate:s,codec:o?e.VP9:e.VP8,width:i,height:a,latencyMode:`realtime`,bitrateMode:m?`constant`:`variable`};d>0&&(t.bitrate=d),g.configure(t)}function w(e,t,n){try{d=e,m=t,s=n,C()}catch(e){v(`setBitrate`,e)}}function T(){g=new VideoEncoder({output:e=>{try{let n;e.data?n=e.data:(n=new ArrayBuffer(e.byteLength),e.copyTo(n)),self.postMessage({type:t.FRAME,frameType:e.type,timestamp:e.timestamp,duration:e.duration,width:i,height:a,data:n},[n])}catch(e){v(`output`,e)}},error:e=>{v(`codec`,e)}})}self.onmessage=e=>{try{switch(e.data.type){case t.INIT:b(e.data);break;case t.FRAME:x(e.data.keyFrame);break;case t.SET_BITRATE:w(e.data.bitrate,e.data.useCbr,e.data.fps);break}}catch(e){v(`message`,e)}}}})(),exports={default:workerExports};", (e) => {
5201
5230
  e.error ? this._onFrame(null, e.error) : this._onFrame({
5202
5231
  type: e.frameType,
5203
5232
  timestamp: e.timestamp,
@@ -5598,7 +5627,7 @@ var gi = 2 ** 15 - 1, _i = 1, vi = 5, yi = 5, bi = class e {
5598
5627
  try {
5599
5628
  this._mediaSource.addTrackToPeerConnection(this._pc, this._observer, !1), this._prevConsumerSettings = {}, this._prevConsumerFastSharingSettings = {}, this._applyConsumerSettings();
5600
5629
  } catch (e) {
5601
- this._debug.error("ServerTransport: Unable to add media source tracks", e), this._logger?.log(C.ERROR, "addTrack-single"), this.close(e);
5630
+ this._debug.error("ServerTransport: Unable to add media source tracks", e), this._logger?.log(S.ERROR, "addTrack-single"), this.close(e);
5602
5631
  return;
5603
5632
  }
5604
5633
  this._createDataChannel(this._pc, gr.consumerScreenShare, (e) => {
@@ -5770,7 +5799,7 @@ var gi = 2 ** 15 - 1, _i = 1, vi = 5, yi = 5, bi = class e {
5770
5799
  try {
5771
5800
  await this._pc.setRemoteDescription(e);
5772
5801
  } catch (e) {
5773
- throw this._debug.error("[single] unable to set remote offer", e), this._logger?.log(C.ERROR, "setRemoteDescription-single"), e;
5802
+ throw this._debug.error("[single] unable to set remote offer", e), this._logger?.log(S.ERROR, "setRemoteDescription-single"), e;
5774
5803
  }
5775
5804
  let r = this._findFirstSimTransceiver();
5776
5805
  if (M.simulcast) if (r) {
@@ -5783,13 +5812,13 @@ var gi = 2 ** 15 - 1, _i = 1, vi = 5, yi = 5, bi = class e {
5783
5812
  if (await this._handleTracks(), this._debug.debug("[single] create local answer"), !this._pc) throw Error("Interrupt allocation");
5784
5813
  i = await this._pc.createAnswer();
5785
5814
  } catch (e) {
5786
- throw this._debug.error("[single] unable to create answer", e), this._logger?.log(C.ERROR, "createAnswer-single"), e;
5815
+ throw this._debug.error("[single] unable to create answer", e), this._logger?.log(S.ERROR, "createAnswer-single"), e;
5787
5816
  }
5788
5817
  try {
5789
5818
  if (!this._pc) throw Error("Interrupt allocation");
5790
5819
  i.sdp = j.patchLocalSDP(i.sdp, !1, T.isBrokenH264Decoder(), !1), this._debug.debug("[single] set local answer", { answer: i }), await this._pc.setLocalDescription(i);
5791
5820
  } catch (e) {
5792
- throw this._debug.error("[single] unable to set local answer", e), this._logger?.log(C.ERROR, "setLocalDescription-single"), e;
5821
+ throw this._debug.error("[single] unable to set local answer", e), this._logger?.log(S.ERROR, "setLocalDescription-single"), e;
5793
5822
  }
5794
5823
  if (n && r) {
5795
5824
  i.sdp = j.patchSimulcastAnswerSdp(i.sdp, r, Yt.WIDTH, Yt.HEIGHT);
@@ -5798,7 +5827,7 @@ var gi = 2 ** 15 - 1, _i = 1, vi = 5, yi = 5, bi = class e {
5798
5827
  try {
5799
5828
  this._debug.debug("[single] transmit local answer", { answer: i }), this._updateSSRCMap(e), await this._signaling.acceptProducer(i, Object.keys(this._ssrcMap), t), this._debug.debug("[single] remote offer has been processed");
5800
5829
  } catch (e) {
5801
- this._debug.warn("[single] unable to send local answer", e), this._logger?.log(C.ERROR, "acceptProducer");
5830
+ this._debug.warn("[single] unable to send local answer", e), this._logger?.log(S.ERROR, "acceptProducer");
5802
5831
  }
5803
5832
  n && await this._changeSimulcastInfo(!0, !0);
5804
5833
  }
@@ -5872,7 +5901,7 @@ var gi = 2 ** 15 - 1, _i = 1, vi = 5, yi = 5, bi = class e {
5872
5901
  try {
5873
5902
  e.direction = "sendonly", await e.sender.replaceTrack(this._newAudioShareTrack), this._newAudioShareTrack = null;
5874
5903
  } catch (e) {
5875
- this._debug.error("ServerTransport: Unable to replace track", e), this._logger?.log(C.ERROR, "replaceTrack-single");
5904
+ this._debug.error("ServerTransport: Unable to replace track", e), this._logger?.log(S.ERROR, "replaceTrack-single");
5876
5905
  }
5877
5906
  }
5878
5907
  async _handleScreenShareTrack() {
@@ -5917,7 +5946,7 @@ var gi = 2 ** 15 - 1, _i = 1, vi = 5, yi = 5, bi = class e {
5917
5946
  this._debug.debug("[single] signaling state changed", { state: e.signalingState }, t);
5918
5947
  }
5919
5948
  _onConnectionStateChange(e, t) {
5920
- switch (this._debug.debug("[single] connection state changed", { state: e.connectionState }, t), this._logger?.log(C.ICE_CONNECTION_STATE, e.connectionState), e.connectionState) {
5949
+ switch (this._debug.debug("[single] connection state changed", { state: e.connectionState }, t), this._logger?.log(S.ICE_CONNECTION_STATE, e.connectionState), e.connectionState) {
5921
5950
  case "failed":
5922
5951
  this._reconnectionPrevented ? this.close(/* @__PURE__ */ Error("Ice connection failed")) : this._reconnect();
5923
5952
  break;
@@ -5930,7 +5959,7 @@ var gi = 2 ** 15 - 1, _i = 1, vi = 5, yi = 5, bi = class e {
5930
5959
  break;
5931
5960
  case "connected":
5932
5961
  this._setState(K.CONNECTED), j.getPeerConnectionHostInfo(e).then((e) => {
5933
- e?.local && (this._logger?.log(C.ICE_CONNECTION_TYPE, e.local.type), this._debug.debug("Selected ICE candidates", e));
5962
+ e?.local && (this._logger?.log(S.ICE_CONNECTION_TYPE, e.local.type), this._debug.debug("Selected ICE candidates", e));
5934
5963
  });
5935
5964
  break;
5936
5965
  }
@@ -5940,7 +5969,7 @@ var gi = 2 ** 15 - 1, _i = 1, vi = 5, yi = 5, bi = class e {
5940
5969
  this._debug.debug(`_onReplacedTrack: newTrack=${e}, sendTrack=${t}`), t && (e = t);
5941
5970
  let n = (e, t) => {
5942
5971
  e.replaceTrack(t).catch((e) => {
5943
- this._debug.error("ServerTransport: Unable to replace track", e), this._logger?.log(C.ERROR, "replaceTrack-single");
5972
+ this._debug.error("ServerTransport: Unable to replace track", e), this._logger?.log(S.ERROR, "replaceTrack-single");
5944
5973
  });
5945
5974
  };
5946
5975
  if (this._debug.log(`_onReplacedTrack: newTrack=${e.getSettings().width}x${e.getSettings().height}`), M.simulcast && e.kind === k.video) {
@@ -5957,14 +5986,14 @@ var gi = 2 ** 15 - 1, _i = 1, vi = 5, yi = 5, bi = class e {
5957
5986
  e === k.screen && M.consumerFastScreenShare && this._mediaSource.mediaSettings.isFastScreenSharingEnabled && await this._replaceScreenShareTrack(), this._applyConsumerSettings();
5958
5987
  }
5959
5988
  getStreamWaitingTimeMs(e, t) {
5960
- if (!this._pc) return this._logger?.log(C.PAT_WAITING_TIME_ERROR, "noConnection"), this._debug.error("Cannot get stream waiting time, peer connection is not initialized"), 0;
5961
- if (!RTCRtpReceiver.prototype.getSynchronizationSources) return this._logger?.log(C.PAT_WAITING_TIME_ERROR, "oldBrowser"), this._debug.error("Cannot get stream waiting time, RTCRtpReceiver.getSynchronizationSources is not supported"), 0;
5989
+ if (!this._pc) return this._logger?.log(S.PAT_WAITING_TIME_ERROR, "noConnection"), this._debug.error("Cannot get stream waiting time, peer connection is not initialized"), 0;
5990
+ if (!RTCRtpReceiver.prototype.getSynchronizationSources) return this._logger?.log(S.PAT_WAITING_TIME_ERROR, "oldBrowser"), this._debug.error("Cannot get stream waiting time, RTCRtpReceiver.getSynchronizationSources is not supported"), 0;
5962
5991
  let n = this._rtpReceiversByStreamId[e];
5963
- if (!n) return this._logger?.log(C.PAT_WAITING_TIME_ERROR, "noReceiver"), this._debug.error(`Cannot get stream waiting time, cannot find RTP receiver by stream ID: ${e}`), 0;
5992
+ if (!n) return this._logger?.log(S.PAT_WAITING_TIME_ERROR, "noReceiver"), this._debug.error(`Cannot get stream waiting time, cannot find RTP receiver by stream ID: ${e}`), 0;
5964
5993
  let r = n.getSynchronizationSources();
5965
5994
  if (!r || !r.length) return this._debug.log(`Cannot get stream waiting time, ${e} receiver has no synchronization sources`), 0;
5966
5995
  let i = r[0].rtpTimestamp;
5967
- if (!Number.isInteger(i)) return this._logger?.log(C.PAT_WAITING_TIME_ERROR, "timestampNotInteger"), this._debug.error(`Cannot get stream waiting time, ${e} receiver's RTP timestamp is not an integer: ${i}`), 0;
5996
+ if (!Number.isInteger(i)) return this._logger?.log(S.PAT_WAITING_TIME_ERROR, "timestampNotInteger"), this._debug.error(`Cannot get stream waiting time, ${e} receiver's RTP timestamp is not an integer: ${i}`), 0;
5968
5997
  let a = t - i & Qi, o = Math.ceil(a / Zi);
5969
5998
  return Math.min(100, Math.max(0, o));
5970
5999
  }
@@ -6025,7 +6054,7 @@ var gi = 2 ** 15 - 1, _i = 1, vi = 5, yi = 5, bi = class e {
6025
6054
  }
6026
6055
  }, J = /* @__PURE__ */ function(e) {
6027
6056
  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;
6028
- }({}), ea = class extends b {
6057
+ }({}), ea = class extends y {
6029
6058
  constructor(e, t, n, r, i = R, a = null, o = null, s = null) {
6030
6059
  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, fr.NOTIFICATION, this._onSignalingNotification.bind(this)), this.subscribe(this._mediaSource, Kt.ANIMOJI_STATUS, this._onAnimojiStatus.bind(this)), this.subscribe(this._mediaSource, Kt.SOURCE_CHANGED, this._onSourceChanged.bind(this)), this._createAnimojiTransport(), e === q.SERVER && (this._serverTransport = this._createServerTransport());
6031
6060
  }
@@ -6116,7 +6145,7 @@ var gi = 2 ** 15 - 1, _i = 1, vi = 5, yi = 5, bi = class e {
6116
6145
  }
6117
6146
  _onTopologyChanged(e) {
6118
6147
  if (e.topology !== this._topology) {
6119
- if (this._debug.log(`Topology changed ${this._topology} -> ${e.topology}`), this._logger?.log(C.TOPOLOGY_CHANGE_REQUESTED, e.topology), this._topology = e.topology, this._topology === q.SERVER && (this._serverTransport ? this._serverTransport.allowRestart() : (this._serverTransport = this._createServerTransport(), this._opened.length > 0 && (this._directTransport?.preventRestart(), this._serverTransport.open()))), this._topology === q.DIRECT) {
6148
+ if (this._debug.log(`Topology changed ${this._topology} -> ${e.topology}`), this._logger?.log(S.TOPOLOGY_CHANGE_REQUESTED, e.topology), this._topology = e.topology, this._topology === q.SERVER && (this._serverTransport ? this._serverTransport.allowRestart() : (this._serverTransport = this._createServerTransport(), this._opened.length > 0 && (this._directTransport?.preventRestart(), this._serverTransport.open()))), this._topology === q.DIRECT) {
6120
6149
  let t = e.offerTo || [], n = e.offerToTypes || [], r = e.offerToDeviceIdxs || [], i = t.length && n.length ? j.composeParticipantId(t[0], n[0], r[0]) : null;
6121
6150
  if (this._serverTransport && this._serverTransport.preventRestart(), !this._allocated || this._allocated.length === 0) {
6122
6151
  this._debug.error("Topology changed to DIRECT, but the list of allocated participants is empty");
@@ -6224,9 +6253,9 @@ var gi = 2 ** 15 - 1, _i = 1, vi = 5, yi = 5, bi = class e {
6224
6253
  this._animojiSender?.destroy(), this._animojiSender = null, this._animojiReceiver?.destroy(), this._animojiReceiver = null;
6225
6254
  }
6226
6255
  getStreamWaitingTimeMs(e, t) {
6227
- return this._topology === q.SERVER ? this._serverTransport ? this._serverTransport.getStreamWaitingTimeMs(e, t) : (this._logger?.log(C.PAT_WAITING_TIME_ERROR, "noTransport"), this._debug.error("Cannot get stream waiting time, server transport is not initialized"), 0) : (this._logger?.log(C.PAT_WAITING_TIME_ERROR, "wrongTopology"), this._debug.error(`Cannot get stream waiting time, incorrect topology: ${this._topology}`), 0);
6256
+ return this._topology === q.SERVER ? this._serverTransport ? this._serverTransport.getStreamWaitingTimeMs(e, t) : (this._logger?.log(S.PAT_WAITING_TIME_ERROR, "noTransport"), this._debug.error("Cannot get stream waiting time, server transport is not initialized"), 0) : (this._logger?.log(S.PAT_WAITING_TIME_ERROR, "wrongTopology"), this._debug.error(`Cannot get stream waiting time, incorrect topology: ${this._topology}`), 0);
6228
6257
  }
6229
- }, ta = "videochat-epi", na = 5e3, ra = 500, ia = class extends b {
6258
+ }, ta = "videochat-epi", na = 5e3, ra = 500, ia = class extends y {
6230
6259
  constructor(e, t, n = null, r = !1, i = R) {
6231
6260
  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) => {
6232
6261
  this._screenShareStats.push(e);
@@ -6820,7 +6849,7 @@ var ua = la, da = {
6820
6849
  async connect(e) {
6821
6850
  return new Promise((t, n) => {
6822
6851
  if (this.transport.readyState !== null && this.transport.readyState < WebSocket.CLOSING) {
6823
- this._logger?.log(C.SOCKET_ACTION, "already_opened"), n(Error("Socket already opened"));
6852
+ this._logger?.log(S.SOCKET_ACTION, "already_opened"), n(Error("Socket already opened"));
6824
6853
  return;
6825
6854
  }
6826
6855
  this.conversationResolve = (e) => {
@@ -7098,10 +7127,10 @@ var ua = la, da = {
7098
7127
  if (this._isDataChannelCommand(e)) this.datachannelCommandsQueue.push(t), this.producerCommandDataChannel?.readyState === wa && this._handleCommandsQueue(this.datachannelCommandsQueue);
7099
7128
  else {
7100
7129
  if (this.transport.readyState === null) {
7101
- this._logger?.log(C.SOCKET_ACTION, "not_opened"), this._debug.warn("[signaling] socket is not opened"), t.reject(/* @__PURE__ */ Error(`Socket not opened [${e}]`), !0);
7130
+ this._logger?.log(S.SOCKET_ACTION, "not_opened"), this._debug.warn("[signaling] socket is not opened"), t.reject(/* @__PURE__ */ Error(`Socket not opened [${e}]`), !0);
7102
7131
  return;
7103
7132
  }
7104
- this.transport.readyState > WebSocket.OPEN && (this._logger?.log(C.SOCKET_ACTION, "invalid_state"), this._debug.warn(`[signaling] socket is not opened, state ${this.transport.readyState}`)), this.websocketCommandsQueue.push(t), this.transport.readyState === WebSocket.OPEN && this._handleCommandsQueue(this.websocketCommandsQueue);
7133
+ this.transport.readyState > WebSocket.OPEN && (this._logger?.log(S.SOCKET_ACTION, "invalid_state"), this._debug.warn(`[signaling] socket is not opened, state ${this.transport.readyState}`)), this.websocketCommandsQueue.push(t), this.transport.readyState === WebSocket.OPEN && this._handleCommandsQueue(this.websocketCommandsQueue);
7105
7134
  }
7106
7135
  };
7107
7136
  return new Promise((a, o) => {
@@ -7126,7 +7155,7 @@ var ua = la, da = {
7126
7155
  return this.producerCommandDataChannelEnabled ? e === B.UPDATE_DISPLAY_LAYOUT || e === B.REPORT_PERF_STAT || e === B.REPORT_SHARING_STAT || e === B.REQUEST_ASR || e === B.ENABLE_VIDEO_SUSPEND || e === B.ENABLE_VIDEO_SUSPEND_SUGGEST || e === B.REPORT_NETWORK_STAT || e === B.CHANGE_SIMULCAST : !1;
7127
7156
  }
7128
7157
  _onOpen() {
7129
- this._debug.debug("[signaling] socket opened"), this._logger?.log(C.SOCKET_ACTION, "opened"), this._waitConnectionMessage(), this._logTransportStat(this.connectionType === dr.RETRY ? mr.RECONNECTED : mr.CONNECTED);
7158
+ this._debug.debug("[signaling] socket opened"), this._logger?.log(S.SOCKET_ACTION, "opened"), this._waitConnectionMessage(), this._logTransportStat(this.connectionType === dr.RETRY ? mr.RECONNECTED : mr.CONNECTED);
7130
7159
  }
7131
7160
  _onMessage(e) {
7132
7161
  if (e.data === "ping") {
@@ -7137,7 +7166,7 @@ var ua = la, da = {
7137
7166
  let t = JSON.parse(e.data);
7138
7167
  L.onSignalingMessage(t), this._handleMessage(t);
7139
7168
  } catch (t) {
7140
- this._logger?.log(C.SOCKET_ACTION, "parse_error"), this._debug.error("[signaling] unable to parse message", t, e.data);
7169
+ this._logger?.log(S.SOCKET_ACTION, "parse_error"), this._debug.error("[signaling] unable to parse message", t, e.data);
7141
7170
  }
7142
7171
  }
7143
7172
  _handleMessage(e) {
@@ -7157,12 +7186,12 @@ var ua = la, da = {
7157
7186
  case "error":
7158
7187
  this._handleErrorMessage(e);
7159
7188
  break;
7160
- default: this._logger?.log(C.SOCKET_ACTION, "unknown_message"), this._debug.warn("[signaling] unhandled message", e);
7189
+ default: this._logger?.log(S.SOCKET_ACTION, "unknown_message"), this._debug.warn("[signaling] unhandled message", e);
7161
7190
  }
7162
7191
  e.stamp && (this.lastStamp = e.stamp, this.transport.setLastStamp(e.stamp));
7163
7192
  }
7164
7193
  _handleErrorMessage(e) {
7165
- this._logger?.log(C.SOCKET_ACTION, `error-${e.error}`);
7194
+ this._logger?.log(S.SOCKET_ACTION, `error-${e.error}`);
7166
7195
  let t = e.error ? Ea.includes(e.error) : !1;
7167
7196
  switch (this._debug.debug(`[signaling] error message [${e.sequence}]`, e), e.sequence && this.responseHandlers[e.sequence] && this._handleCommandResponse(!1, e), e.error) {
7168
7197
  case "service-unavailable":
@@ -7176,7 +7205,7 @@ var ua = la, da = {
7176
7205
  });
7177
7206
  break;
7178
7207
  case "conversation-ended":
7179
- this.conversationReject ? this.conversationReject(new O(e.reason || x.SIGNALING_FAILED, {
7208
+ this.conversationReject ? this.conversationReject(new O(e.reason || b.SIGNALING_FAILED, {
7180
7209
  message: `Conversation ended: ${e.error}`,
7181
7210
  remote: !0
7182
7211
  })) : this._triggerEvent(fr.NOTIFICATION, {
@@ -7195,7 +7224,7 @@ var ua = la, da = {
7195
7224
  break;
7196
7225
  default:
7197
7226
  if (!t) break;
7198
- this.connected ? this._throwError(/* @__PURE__ */ Error(`Signaling error: ${e.error}`)) : e.sequence || (this.conversationReject?.(new O(e.reason || x.SIGNALING_FAILED, {
7227
+ this.connected ? this._throwError(/* @__PURE__ */ Error(`Signaling error: ${e.error}`)) : e.sequence || (this.conversationReject?.(new O(e.reason || b.SIGNALING_FAILED, {
7199
7228
  message: `Unable to connect to the signaling: ${e.error}`,
7200
7229
  remote: !0
7201
7230
  })), this._closeSocket());
@@ -7212,7 +7241,7 @@ var ua = la, da = {
7212
7241
  this._triggerEvent(fr.FAILED, e);
7213
7242
  }
7214
7243
  _onError(e) {
7215
- this._logger?.log(C.SOCKET_ACTION, "error"), this._debug.error("[signaling] signaling error", e), this._logTransportStat(mr.FAILED_EXCEPTIONS, { string_value: this._serializeErrorEvent(e) });
7244
+ this._logger?.log(S.SOCKET_ACTION, "error"), this._debug.error("[signaling] signaling error", e), this._logTransportStat(mr.FAILED_EXCEPTIONS, { string_value: this._serializeErrorEvent(e) });
7216
7245
  }
7217
7246
  _serializeErrorEvent(e) {
7218
7247
  let t = e, n = t.error instanceof Error ? t.error : null;
@@ -7227,7 +7256,7 @@ var ua = la, da = {
7227
7256
  });
7228
7257
  }
7229
7258
  _onClose(e) {
7230
- this._logger?.log(C.SOCKET_ACTION, "closed"), this._debug.debug("[signaling] connection closed", {
7259
+ this._logger?.log(S.SOCKET_ACTION, "closed"), this._debug.debug("[signaling] connection closed", {
7231
7260
  code: e.code,
7232
7261
  reason: e.reason
7233
7262
  }), this.connected = !1;
@@ -7242,7 +7271,7 @@ var ua = la, da = {
7242
7271
  let r = this.responseHandlers[n.sequence];
7243
7272
  window.clearTimeout(r.responseTimer);
7244
7273
  let i = W.measureMark(r.statMarkName);
7245
- i !== null && this._statSignalingCommands?.mark(r.name, i, this._getSocketType()), this._debug.debug(`[signaling] command response [${n.sequence}]`, n), t ? (delete this.responseHandlers[n.sequence], r.resolve(n)) : n.type === "error" ? (delete this.responseHandlers[n.sequence], this._logger?.log(C.SOCKET_ACTION, "response-error"), r.reject(Error(n.error || `Response error [${r.name}]`), !0)) : this.transport.readyState === WebSocket.OPEN ? (delete this.responseHandlers[n.sequence], this._logger?.log(C.SOCKET_ACTION, "response-timeout"), r.reject(Error(n.error || `Response timeout [${r.name}]`))) : r.responseTimer = window.setTimeout(() => this._handleCommandResponse(t, n), e.WAIT_RESPONSE_DELAY);
7274
+ i !== null && this._statSignalingCommands?.mark(r.name, i, this._getSocketType()), this._debug.debug(`[signaling] command response [${n.sequence}]`, n), t ? (delete this.responseHandlers[n.sequence], r.resolve(n)) : n.type === "error" ? (delete this.responseHandlers[n.sequence], this._logger?.log(S.SOCKET_ACTION, "response-error"), r.reject(Error(n.error || `Response error [${r.name}]`), !0)) : this.transport.readyState === WebSocket.OPEN ? (delete this.responseHandlers[n.sequence], this._logger?.log(S.SOCKET_ACTION, "response-timeout"), r.reject(Error(n.error || `Response timeout [${r.name}]`))) : r.responseTimer = window.setTimeout(() => this._handleCommandResponse(t, n), e.WAIT_RESPONSE_DELAY);
7246
7275
  }
7247
7276
  _handleCommandsQueue(e) {
7248
7277
  for (; e.length > 0;) {
@@ -7308,7 +7337,7 @@ var ua = la, da = {
7308
7337
  }
7309
7338
  _waitConnectionMessage() {
7310
7339
  this.connectionMessageWaitTimer = window.setTimeout(() => {
7311
- this.conversationReject && this.conversationReject(new O(x.SIGNALING_FAILED, {
7340
+ this.conversationReject && this.conversationReject(new O(b.SIGNALING_FAILED, {
7312
7341
  message: "Unable to connect to the signaling: connection timeout",
7313
7342
  remote: !0
7314
7343
  }));
@@ -7320,7 +7349,7 @@ var ua = la, da = {
7320
7349
  _onTransportFailed(e) {
7321
7350
  switch (e.failure) {
7322
7351
  case Sa.EMPTY_ENDPOINT:
7323
- this.conversationReject?.(new O(x.SIGNALING_FAILED, {
7352
+ this.conversationReject?.(new O(b.SIGNALING_FAILED, {
7324
7353
  message: e.message,
7325
7354
  remote: e.remote
7326
7355
  }));
@@ -7334,7 +7363,7 @@ var ua = la, da = {
7334
7363
  }
7335
7364
  }
7336
7365
  _onTransportReconnectScheduled(e) {
7337
- this.connectionType = dr.RETRY, this._debug.log(`[signaling] reconnect websocket after ${e.delay}ms (${e.count})`), this._logger?.log(C.SOCKET_ACTION, "reconnect");
7366
+ this.connectionType = dr.RETRY, this._debug.log(`[signaling] reconnect websocket after ${e.delay}ms (${e.count})`), this._logger?.log(S.SOCKET_ACTION, "reconnect");
7338
7367
  }
7339
7368
  _onTransportConnectionDead() {
7340
7369
  this._debug.warn("[signaling] socket is dead, trying to reconnect"), this._logTransportStat(mr.FAILED_PINGS);
@@ -7489,10 +7518,10 @@ function Wa(e) {
7489
7518
  }
7490
7519
  function Ga(e, t) {
7491
7520
  switch (e) {
7492
- case S.AUDIO: return !!t.isAudioEnabled;
7493
- case S.AUDIO_SHARING: return !!t.isAudioSharingEnabled;
7494
- case S.VIDEO: return !!t.isVideoEnabled;
7495
- case S.SCREEN_SHARING: return !!t.isFastScreenSharingEnabled || !!t.isScreenSharingEnabled;
7521
+ case x.AUDIO: return !!t.isAudioEnabled;
7522
+ case x.AUDIO_SHARING: return !!t.isAudioSharingEnabled;
7523
+ case x.VIDEO: return !!t.isVideoEnabled;
7524
+ case x.SCREEN_SHARING: return !!t.isFastScreenSharingEnabled || !!t.isScreenSharingEnabled;
7496
7525
  default: return !1;
7497
7526
  }
7498
7527
  }
@@ -7556,10 +7585,10 @@ var Xa = class {
7556
7585
  _fixAudioDeviceNoPackets(e) {
7557
7586
  if (!(this._fixNoPacketsApplied && this._fixNoPacketsChecked)) {
7558
7587
  if (this._fixNoPacketsApplied && !this._fixNoPacketsChecked) {
7559
- this._fixNoPacketsChecked = !0, this._logger?.log(C.ERROR, `audio_device_recover_${e.bandwidth ? "success" : "fail"}`);
7588
+ this._fixNoPacketsChecked = !0, this._logger?.log(S.ERROR, `audio_device_recover_${e.bandwidth ? "success" : "fail"}`);
7560
7589
  return;
7561
7590
  }
7562
- !this._fixNoPacketsApplied && !e.bandwidth && (this._fixNoPacketsApplied = !0, this._logger?.log(C.ERROR, "audio_device_recover"), this._debug.log("[AudioFix] Trying to fix RV (no packets)"), this._toggleAudioPromise = this._mediaSource.toggleAudio(T.getMicrophonePermissionState() !== "denied"), this._toggleAudioPromise.catch(() => void 0));
7591
+ !this._fixNoPacketsApplied && !e.bandwidth && (this._fixNoPacketsApplied = !0, this._logger?.log(S.ERROR, "audio_device_recover"), this._debug.log("[AudioFix] Trying to fix RV (no packets)"), this._toggleAudioPromise = this._mediaSource.toggleAudio(T.getMicrophonePermissionState() !== "denied"), this._toggleAudioPromise.catch(() => void 0));
7563
7592
  }
7564
7593
  }
7565
7594
  _fixAudioDeviceTooManyPackets(e) {
@@ -7568,7 +7597,7 @@ var Xa = class {
7568
7597
  if (!this._lastPacketsSentTime) e.packetsSent > 0 && (this._lastPacketsSentTime = t, this._lastPacketsSent = e.packetsSent);
7569
7598
  else if (t - this._lastPacketsSentTime > 500) {
7570
7599
  let n = (e.packetsSent - this._lastPacketsSent) * 1e3 / (t - this._lastPacketsSentTime);
7571
- this._lastPacketsSentTime = t, this._lastPacketsSent = e.packetsSent, this._fixTooManyPacketsApplied ? n > 75 ? (this._debug.log("[AudioFix] Failed to fix RV"), this._logger?.log(C.ERROR, "audio_device_recover_rv_fail"), this._fixTooManyPacketsFailed = !0) : t - this._fixTooManyPacketsTime > 6e4 && (this._debug.log("[AudioFix] Fixed RV"), this._logger?.log(C.ERROR, "audio_device_recover_rv_success"), this._fixTooManyPacketsSucceeded = !0) : n > 75 && (this._fixTooManyPacketsApplied = !0, this._logger?.log(C.ERROR, "audio_device_recover"), this._debug.log("[AudioFix] Trying to fix RV (too many packets)"), this._mediaSource.toggleAudio(!0).catch((e) => {
7600
+ this._lastPacketsSentTime = t, this._lastPacketsSent = e.packetsSent, this._fixTooManyPacketsApplied ? n > 75 ? (this._debug.log("[AudioFix] Failed to fix RV"), this._logger?.log(S.ERROR, "audio_device_recover_rv_fail"), this._fixTooManyPacketsFailed = !0) : t - this._fixTooManyPacketsTime > 6e4 && (this._debug.log("[AudioFix] Fixed RV"), this._logger?.log(S.ERROR, "audio_device_recover_rv_success"), this._fixTooManyPacketsSucceeded = !0) : n > 75 && (this._fixTooManyPacketsApplied = !0, this._logger?.log(S.ERROR, "audio_device_recover"), this._debug.log("[AudioFix] Trying to fix RV (too many packets)"), this._mediaSource.toggleAudio(!0).catch((e) => {
7572
7601
  this._debug.warn("[AudioFix] Failed to fix RV (too many packets)", e);
7573
7602
  }), this._fixTooManyPacketsTime = t);
7574
7603
  }
@@ -7628,7 +7657,7 @@ var Xa = class {
7628
7657
  let e = T.getSavedOutput();
7629
7658
  e && await this._audioElement.setSinkId?.(e.deviceId);
7630
7659
  } catch (e) {
7631
- throw this._logger?.log(C.ERROR, "change_output"), this._debug.error("[audio] Output change failed", e), e;
7660
+ throw this._logger?.log(S.ERROR, "change_output"), this._debug.error("[audio] Output change failed", e), e;
7632
7661
  }
7633
7662
  }
7634
7663
  _getTracks() {
@@ -7686,7 +7715,7 @@ function eo(e, t) {
7686
7715
  }
7687
7716
  //#endregion
7688
7717
  //#region src/classes/DebugInfo.ts
7689
- var to = 90, no = 3, ro = class extends b {
7718
+ var to = 90, no = 3, ro = class extends y {
7690
7719
  constructor(e = R) {
7691
7720
  super(), h(this, "_lastMemoryStat", {
7692
7721
  percent: 0,
@@ -7844,7 +7873,7 @@ var to = 90, no = 3, ro = class extends b {
7844
7873
  destroy() {
7845
7874
  this._mediaStreamSource && (this._mediaStreamSource.disconnect(), this._mediaStreamSource = null), this._gainNode && (this._gainNode.disconnect(), this._gainNode = null), this._analyser && (this._analyser.disconnect(), this._analyser = null, this._fftBins = null, this._lastSmoothedLevel = 0), this._stream.removeTrack(this._track);
7846
7875
  }
7847
- }, so = class extends b {
7876
+ }, so = class extends y {
7848
7877
  constructor(e) {
7849
7878
  super(), h(this, "_detector", null), h(this, "_interval", null);
7850
7879
  let t = () => {
@@ -7890,7 +7919,7 @@ var to = 90, no = 3, ro = class extends b {
7890
7919
  }
7891
7920
  }, lo = /* @__PURE__ */ function(e) {
7892
7921
  return e.VOLUMES_DETECTED = "VOLUMES_DETECTED", e;
7893
- }({}), uo = class extends b {
7922
+ }({}), uo = class extends y {
7894
7923
  constructor(e) {
7895
7924
  super(), h(this, "_detectors", /* @__PURE__ */ new Map()), h(this, "_interval", null), h(this, "_activeParticipants", void 0), h(this, "_removedParticipants", void 0), h(this, "_topology", void 0), this._topology = e.getTopology(), this.subscribe(e, J.REMOTE_TRACK_ADDED, this._onRemoteTrackAdded.bind(this)), this.subscribe(e, J.REMOTE_TRACK_REMOVED, this._onRemoteTrackRemoved.bind(this)), this.subscribe(e, J.SIGNALLED_ACTIVE_PARTICIPANTS, this._onSignalledActiveParticipants.bind(this)), this.subscribe(e, J.TOPOLOGY_CHANGED, this._onTopologyChanged.bind(this));
7896
7925
  }
@@ -7958,7 +7987,7 @@ var to = 90, no = 3, ro = class extends b {
7958
7987
  }
7959
7988
  }, fo = /* @__PURE__ */ function(e) {
7960
7989
  return e.SPEAKER_CHANGED = "SPEAKER_CHANGED", e;
7961
- }({}), po = class extends b {
7990
+ }({}), po = class extends y {
7962
7991
  constructor(e, t, n) {
7963
7992
  super(), h(this, "_speakerId", null), h(this, "_serverSideSpeakerDetection", !1), this._serverSideSpeakerDetection = n === q.SERVER, this.subscribe(e, lo.VOLUMES_DETECTED, this._onVolumesDetected.bind(this)), this.subscribe(t, J.SIGNALLED_SPEAKER_CHANGED, this._onServerSpeakerChanged.bind(this)), this.subscribe(t, J.TOPOLOGY_CHANGED, this._onTopologyChanged.bind(this));
7964
7993
  }
@@ -7982,7 +8011,7 @@ var to = 90, no = 3, ro = class extends b {
7982
8011
  _onTopologyChanged(e) {
7983
8012
  this._serverSideSpeakerDetection = e === q.SERVER;
7984
8013
  }
7985
- }, mo = 15e3, ho = 15e3, go = class extends b {
8014
+ }, mo = 15e3, ho = 15e3, go = class extends y {
7986
8015
  constructor(e, t, n, r = R, i = null) {
7987
8016
  super(), h(this, "_transport", void 0), h(this, "_volumes", {}), h(this, "_participants", {}), h(this, "_debug", void 0), h(this, "_logger", void 0), h(this, "_connectionTimeout", 0), h(this, "_connectionTimeoutSuppressed", !1), h(this, "_volumeTimeout", 0), this._transport = e, this._participants = n, this._debug = r, this._logger = i, this.subscribe(e, J.STATE_CHANGED, this._onTransportStateChanged.bind(this)), this.subscribe(t, lo.VOLUMES_DETECTED, this._onVolumesDetected.bind(this));
7988
8017
  }
@@ -8002,7 +8031,7 @@ var to = 90, no = 3, ro = class extends b {
8002
8031
  return this._transport.getTopology() === q.DIRECT ? ho : M.specListenerParams.volumeTimeout;
8003
8032
  }
8004
8033
  _onTransportStateChanged(e, t) {
8005
- t === K.OPENED && (this._connectionTimeout || (this._connectionTimeoutSuppressed = !1, this._connectionTimeout = window.setTimeout(this._onConnectionTimeout.bind(this), this._getConnectionTimeout()))), t === K.CONNECTED && (this._volumeTimeout || (this._volumeTimeout = window.setTimeout(this._onVolumeTimeout.bind(this), this._getVolumeTimeout())), this._volumeTimeout && (window.clearTimeout(this._volumeTimeout), this._volumeTimeout = window.setTimeout(this._onVolumeTimeout.bind(this), this._getVolumeTimeout()))), t === K.FAILED && this._connectionTimeout && (this._debug.warn("Transport failed, send callSpecError"), this._logger?.log(C.CALL_SPEC_ERROR, `${this._transport.getTopology()}_CONNECTION_TIMEOUT`));
8034
+ t === K.OPENED && (this._connectionTimeout || (this._connectionTimeoutSuppressed = !1, this._connectionTimeout = window.setTimeout(this._onConnectionTimeout.bind(this), this._getConnectionTimeout()))), t === K.CONNECTED && (this._volumeTimeout || (this._volumeTimeout = window.setTimeout(this._onVolumeTimeout.bind(this), this._getVolumeTimeout())), this._volumeTimeout && (window.clearTimeout(this._volumeTimeout), this._volumeTimeout = window.setTimeout(this._onVolumeTimeout.bind(this), this._getVolumeTimeout()))), t === K.FAILED && this._connectionTimeout && (this._debug.warn("Transport failed, send callSpecError"), this._logger?.log(S.CALL_SPEC_ERROR, `${this._transport.getTopology()}_CONNECTION_TIMEOUT`));
8006
8035
  }
8007
8036
  _onVolumesDetected(e) {
8008
8037
  Object.keys(e).forEach((t) => {
@@ -8022,14 +8051,14 @@ var to = 90, no = 3, ro = class extends b {
8022
8051
  }
8023
8052
  t = !0;
8024
8053
  }
8025
- }), this._connectionTimeoutSuppressed = e && !t, t && (this._debug.warn("There is not connected transport, send callSpecError"), this._logger?.log(C.CALL_SPEC_ERROR, `${this._transport.getTopology()}_CONNECTION_TIMEOUT`));
8054
+ }), this._connectionTimeoutSuppressed = e && !t, t && (this._debug.warn("There is not connected transport, send callSpecError"), this._logger?.log(S.CALL_SPEC_ERROR, `${this._transport.getTopology()}_CONNECTION_TIMEOUT`));
8026
8055
  }
8027
8056
  _onVolumeTimeout() {
8028
8057
  let e = [];
8029
8058
  Object.keys(this._volumes).forEach((t) => {
8030
- if (this._volumes[t] > 0) return;
8059
+ if (this._volumes[t] > 0 || this._participants[t]?.isOnHold) return;
8031
8060
  let n = "UNKNOWN", r = this._participants[t];
8032
- r && r.platform && (n = r.platform), e.indexOf(n) < 0 && (e.push(n), this._logger?.log(C.CALL_SPEC_ERROR, `${this._transport.getTopology()}_VOLUME_TIMEOUT_${n}`));
8061
+ r && r.platform && (n = r.platform), e.indexOf(n) < 0 && (e.push(n), this._logger?.log(S.CALL_SPEC_ERROR, `${this._transport.getTopology()}_VOLUME_TIMEOUT_${n}`));
8033
8062
  }), e.length && this._debug.warn("There is silent participant, send callSpecError"), this._volumeTimeout = 0;
8034
8063
  }
8035
8064
  }, _o = class extends f {
@@ -8408,7 +8437,7 @@ var to = 90, no = 3, ro = class extends b {
8408
8437
  call_type: this._callType
8409
8438
  }));
8410
8439
  }
8411
- }, Do = 1e3, Oo = 1e4, ko = 15, Q = class e extends b {
8440
+ }, Do = 1e3, Oo = 1e4, ko = 15, Q = class e extends y {
8412
8441
  constructor(e, t) {
8413
8442
  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, "_previousState", null), h(this, "_waitingHallHoldPending", !1), 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", R.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", Cr()), h(this, "_serverTimeOffset", 0), h(this, "_delayedHangup", !1), h(this, "_abortController", null), 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", j.debounce(async (e) => {
8414
8443
  if (this._signaling.ready) try {
@@ -8434,7 +8463,7 @@ var to = 90, no = 3, ro = class extends b {
8434
8463
  }, window.addEventListener("pagehide", this._onUnload), this._statFirstMediaReceived = new Eo(this._stats.statAggregator), this._audioOutput = new Za(this._statFirstMediaReceived, M.transparentAudio, this._debug, this._stats.logger), M.videoTracksCount > 0 && (this._cooldownQueueCleanupTimer = window.setInterval(this._cleanupCooldownQueue.bind(this), Do));
8435
8464
  }
8436
8465
  static current() {
8437
- return z.getActive();
8466
+ return z.getActive() ?? (M.hold ? null : z.getFirst());
8438
8467
  }
8439
8468
  static hangupAfterInit() {
8440
8469
  let e = Ao;
@@ -8470,7 +8499,7 @@ var to = 90, no = 3, ro = class extends b {
8470
8499
  try {
8471
8500
  this._mediaSource = this._createMediaSource(), await this._mediaSource.request(n);
8472
8501
  let d = this._mediaSource.mediaSettings;
8473
- t === Oa.CHAT || e && e.length > 1 ? this._logWithMediaSettings(C.OUTGOING_MULTIPARTY_CALL, d) : this._logWithMediaSettings(C.OUTGOING_CALL, d);
8502
+ t === Oa.CHAT || e && e.length > 1 ? this._logWithMediaSettings(S.OUTGOING_MULTIPARTY_CALL, d) : this._logWithMediaSettings(S.OUTGOING_CALL, d);
8474
8503
  let f = await this._startConversation({
8475
8504
  opponentIds: e,
8476
8505
  opponentType: t,
@@ -8504,7 +8533,7 @@ var to = 90, no = 3, ro = class extends b {
8504
8533
  if (n && M.videoTracksCount > 0) throw this._debug.error("Observer mode: please set videoTracksCount=0"), new O(D.UNSUPPORTED);
8505
8534
  this._mediaSource = this._createMediaSource(), await this._mediaSource.request(e.mediaOptions, !n);
8506
8535
  let r = this._mediaSource.mediaSettings;
8507
- this._logWithMediaSettings(C.JOIN_CONVERSATION, r);
8536
+ this._logWithMediaSettings(S.JOIN_CONVERSATION, r);
8508
8537
  let i = await this._joinConversation(e, t);
8509
8538
  if (!this._conversation) throw new O(D.UNKNOWN_ERROR);
8510
8539
  return this._conversation.observer = n, L.onLocalStream(this._mediaSource.getStream(), r, this.id), this._conversation.waitForAdmin || this._conversation.waitingHall ? (this._debug.log(this._conversation.waitForAdmin ? "Wait for admin" : "In waiting hall"), z.add(this), Ao = null, this._signaling.readyToSend(), L.onLocalStatus(this._conversation.waitForAdmin ? N.WAIT_FOR_ADMIN : N.WAITING_HALL, this.id), this._conversation) : this._onJoinPart2(i);
@@ -8546,8 +8575,8 @@ var to = 90, no = 3, ro = class extends b {
8546
8575
  try {
8547
8576
  let a = Date.now(), o = await this._prepareConversation(e, t, n, r, i);
8548
8577
  if (this._mediaSource = this._createMediaSource(), !this._conversation) throw new O(D.UNKNOWN_ERROR);
8549
- if (!o.conversation.participants.find((e) => e.state === X.CALLED && e.id === this._conversation?.userId)) throw this._debug.log("Push rejected (there is an active call)"), this._stats.logger.log(C.PUSH, "rejected"), new O(D.REJECTED);
8550
- if (await this._processConnection(o), this._extractConnectionUrlSharingInfo(o), await this._allocateTransport(), this._createSpeakerDetector(), await this._createSpecListener(), await this._processPinnedParticipants(o), this._signaling.readyToSend(), this._logCallStartEvent(a, Y.INCOMING), this._stats.logger.log(C.PUSH, "accepted"), z.add(this), Ao = null, this._delayedHangup) throw new O(D.CANCELED);
8578
+ if (!o.conversation.participants.find((e) => e.state === X.CALLED && e.id === this._conversation?.userId)) throw this._debug.log("Push rejected (there is an active call)"), this._stats.logger.log(S.PUSH, "rejected"), new O(D.REJECTED);
8579
+ if (await this._processConnection(o), this._extractConnectionUrlSharingInfo(o), await this._allocateTransport(), this._createSpeakerDetector(), await this._createSpecListener(), await this._processPinnedParticipants(o), this._signaling.readyToSend(), this._logCallStartEvent(a, Y.INCOMING), this._stats.logger.log(S.PUSH, "accepted"), z.add(this), Ao = null, this._delayedHangup) throw new O(D.CANCELED);
8551
8580
  } catch (e) {
8552
8581
  throw Ao = null, this._close(e, "Unable to handle inbound call push"), e;
8553
8582
  }
@@ -8574,7 +8603,7 @@ var to = 90, no = 3, ro = class extends b {
8574
8603
  if (!this._mediaSource || !this._conversation || !this._transport) throw new O(D.UNKNOWN_ERROR);
8575
8604
  this._state = "PROCESSING";
8576
8605
  let e = this._mediaSource.mediaSettings;
8577
- this._logWithMediaSettings(C.ACCEPT_CONCURRENT, e), this._debug.debug("Concurrent call", { conversationId: this._conversation.id });
8606
+ this._logWithMediaSettings(S.ACCEPT_CONCURRENT, e), this._debug.debug("Concurrent call", { conversationId: this._conversation.id });
8578
8607
  try {
8579
8608
  this._statFirstMediaReceived.markAcceptCall(this._transport.getTopology()), await this._signaling.acceptCall(this._mediaSource.mediaSettings), L.onCallAccepted(this.id), this._state = "ACTIVE", this._participantState = X.ACCEPTED, this._changeFeatureSet(), this._openTransport(Object.values(await this._getParticipants()), !0);
8580
8609
  } catch (e) {
@@ -8621,13 +8650,13 @@ var to = 90, no = 3, ro = class extends b {
8621
8650
  });
8622
8651
  }
8623
8652
  async accept(e) {
8624
- if (this._state !== "IDLE") throw this._stats.logger.log(C.ERROR, "acceptIncoming"), this._debug.error("Unable to accept a call - invalid state"), Error("Unable to accept a call - invalid state");
8653
+ if (this._state !== "IDLE") throw this._stats.logger.log(S.ERROR, "acceptIncoming"), this._debug.error("Unable to accept a call - invalid state"), Error("Unable to accept a call - invalid state");
8625
8654
  if (!this._mediaSource || !this._conversation || !this._transport) throw new O(D.UNKNOWN_ERROR);
8626
8655
  this._state = "PROCESSING", this._debug.setConversationId(this._conversation.id), this._debug.debug("Accept incoming call", e);
8627
8656
  try {
8628
8657
  await this._mediaSource.request(e);
8629
8658
  let t = this._mediaSource.mediaSettings;
8630
- this._logWithMediaSettings(C.ACCEPT_INCOMING, t), this._changeMediaSettings(t), this._statFirstMediaReceived.markAcceptCall(this._transport.getTopology()), await this._signaling.acceptCall(t), this._participantState = X.ACCEPTED;
8659
+ this._logWithMediaSettings(S.ACCEPT_INCOMING, t), this._changeMediaSettings(t), this._statFirstMediaReceived.markAcceptCall(this._transport.getTopology()), await this._signaling.acceptCall(t), this._participantState = X.ACCEPTED;
8631
8660
  let n = this._getMuteStatesForCurrentRoom(), r = Object.keys(n);
8632
8661
  r.length && this._onMuteParticipant({
8633
8662
  muteStates: n,
@@ -8653,19 +8682,21 @@ var to = 90, no = 3, ro = class extends b {
8653
8682
  n && (n.movieShareInfos = e.movieShareInfos);
8654
8683
  }), await this._onConversationParticipantListChunk({ participants: e });
8655
8684
  }
8656
- return L.onLocalStatus(N.WAITING, this.id), this._toggleJoinAvailability(), this._changeNeedRate(), this._state = "ACTIVE", this._changeFeatureSet(), this._openTransport(Object.values(await this._getParticipants()), !0), await this._processConversationUrlSharingInfo(), await this._processConnectionAsrInfo(), z.setActive(this.id), this._conversation;
8685
+ return L.onLocalStatus(N.WAITING, this.id), this._toggleJoinAvailability(), this._changeNeedRate(), this._state = "ACTIVE", this._changeFeatureSet(), this._openTransport(Object.values(await this._getParticipants()), !0), await this._processConversationUrlSharingInfo(), await this._processConnectionAsrInfo(), z.setActive(this.id).catch((e) => {
8686
+ this._debug.error(e), this._close(e, "Unable to activated accepted call");
8687
+ }), this._conversation;
8657
8688
  } catch (e) {
8658
8689
  throw this._close(e, "Unable to accept call"), e;
8659
8690
  }
8660
8691
  }
8661
8692
  async decline() {
8662
- if (this._state !== "IDLE") throw this._stats.logger.log(C.ERROR, "declineIncoming"), this._debug.error("Unable to decline a call - invalid state"), Error("Unable to decline a call - invalid state");
8663
- this._state = "PROCESSING", this._debug.debug("Decline incoming call"), this._logWithMediaSettings(C.DECLINE_INCOMING, this.mediaSettings), this._participantState = X.HUNGUP, this._signaling.ready && await this._signaling.hangup(D.REJECTED), this._close(new O(D.REJECTED));
8693
+ if (this._state !== "IDLE") throw this._stats.logger.log(S.ERROR, "declineIncoming"), this._debug.error("Unable to decline a call - invalid state"), Error("Unable to decline a call - invalid state");
8694
+ this._state = "PROCESSING", this._debug.debug("Decline incoming call"), this._logWithMediaSettings(S.DECLINE_INCOMING, this.mediaSettings), this._participantState = X.HUNGUP, this._signaling.ready && await this._signaling.hangup(D.REJECTED), this._close(new O(D.REJECTED));
8664
8695
  }
8665
8696
  async hangup() {
8666
8697
  this._debug.debug("Hangup");
8667
8698
  let e = this._state === "ACTIVE" || this._state === "HELD" ? D.HUNGUP : D.CANCELED;
8668
- this._stats.logger.log(C.HANGUP, e), this._signaling.ready ? (await this._signaling.hangup(e), this._close(new O(e))) : L.onHangup(new O(D.HUNGUP), this._conversation && this._conversation.id), this._conversation?.id && z.has(this._conversation.id) && z.remove(this._conversation.id);
8699
+ this._stats.logger.log(S.HANGUP, e), this._signaling.ready ? (await this._signaling.hangup(e), this._close(new O(e))) : L.onHangup(new O(D.HUNGUP), this._conversation && this._conversation.id), this._conversation?.id && z.has(this._conversation.id) && z.remove(this._conversation.id);
8669
8700
  }
8670
8701
  async addParticipant(e, t) {
8671
8702
  if (!this._signaling.ready) {
@@ -8704,7 +8735,7 @@ var to = 90, no = 3, ro = class extends b {
8704
8735
  r.length ? this._transport.open(r, null, !!this._conversation?.observer) : this._transport.getTopology() === q.SERVER && this._forceOpenTransportForAloneInCall();
8705
8736
  }
8706
8737
  async _close(e, t) {
8707
- t && this._debug.error(t, e), this._debug.debug("Close conversation", e), this._stats.logHangup(e, this._transport?.getTopology()), this._stats.flushCallMetrics(this._transport?.getTopology()), this._signaling.readyToSend(!1), e.error ? this._signaling.ready && this._signaling.hangup(D.FAILED) : this._stats.logger.log(C.ERROR, e.hangup);
8738
+ t && this._debug.error(t, e), this._debug.debug("Close conversation", e), this._stats.logHangup(e, this._transport?.getTopology()), this._stats.flushCallMetrics(this._transport?.getTopology()), this._signaling.readyToSend(!1), e.error ? this._signaling.ready && this._signaling.hangup(D.FAILED) : this._stats.logger.log(S.ERROR, e.hangup);
8708
8739
  let n = this._conversation && this._conversation.id;
8709
8740
  if ([
8710
8741
  D.CANCELED,
@@ -8767,8 +8798,9 @@ var to = 90, no = 3, ro = class extends b {
8767
8798
  }
8768
8799
  M.iceServers = o, M.wssBase = n, M.wssToken = i, r && (M.wtsBase = r), a && (M.clientType = a);
8769
8800
  }
8770
- _addGeoParamsToEndpoint(e, t) {
8771
- return t.isp_as_no && (e += `&ispAsNo=${t.isp_as_no}`), t.isp_as_org && (e += `&ispAsOrg=${t.isp_as_org}`), t.loc_cc && (e += `&locCc=${t.loc_cc}`), t.loc_reg && (e += `&locReg=${t.loc_reg}`), e;
8801
+ _buildSignalingEndpoint({ baseEndpoint: e, userId: t, type: n, deviceIdx: r, conversationId: i, token: a, conversationParams: o }) {
8802
+ let s = new URL(e), c = s.searchParams;
8803
+ return c.set("userId", String(t)), c.set("entityType", n), c.set("deviceIdx", String(r)), c.set("conversationId", i), c.set("token", a), o?.isp_as_no && c.set("ispAsNo", String(o.isp_as_no)), o?.isp_as_org && c.set("ispAsOrg", o.isp_as_org), o?.loc_cc && c.set("locCc", o.loc_cc), o?.loc_reg && c.set("locReg", o.loc_reg), s.toString();
8772
8804
  }
8773
8805
  async _startConversation({ opponentIds: e, opponentType: t, direction: n, mediaOptions: r, payload: i = "", joiningAllowed: a = !1, requireAuthToJoin: o = !1, onlyAdminCanShareMovie: s, externalIds: c, startedTime: l, onFastStart: u, conversationId: d }) {
8774
8806
  let f = d ?? j.uuid();
@@ -8779,7 +8811,7 @@ var to = 90, no = 3, ro = class extends b {
8779
8811
  opponentType: t,
8780
8812
  direction: n
8781
8813
  });
8782
- let p = r.includes(S.VIDEO), m;
8814
+ let p = r.includes(x.VIDEO), m;
8783
8815
  if (u) {
8784
8816
  let e = {
8785
8817
  deviceId: this._api.deviceId(),
@@ -8837,7 +8869,7 @@ var to = 90, no = 3, ro = class extends b {
8837
8869
  joinLink: a,
8838
8870
  observedIds: o
8839
8871
  }), n && z.has(n)) throw new O(D.HAS_ACTIVE_CALL);
8840
- let l = r.includes(S.VIDEO), u, d;
8872
+ let l = r.includes(x.VIDEO), u, d;
8841
8873
  if (c) {
8842
8874
  if (!a) throw new O(D.FAST_JOIN_ERROR, { message: "joinLink is required for fast join" });
8843
8875
  let e = {
@@ -8902,13 +8934,43 @@ var to = 90, no = 3, ro = class extends b {
8902
8934
  };
8903
8935
  if (r) {
8904
8936
  let n = this._decodeExternalConversationParams(r);
8905
- this._setConversationParams(n), s = i ?? `${M.wssBase}?userId=${a}&entityType=${t}&deviceIdx=${o}&conversationId=${e}&token=${M.wssToken}`, l.token = n.token, l.endpoint = s, M.wtsBase && (c = `${M.wtsBase}?userId=${a}&entityType=${t}&deviceIdx=${o}&conversationId=${e}&token=${M.wssToken}`, l.wt_endpoint = c);
8937
+ this._setConversationParams(n), s = i ?? this._buildSignalingEndpoint({
8938
+ baseEndpoint: M.wssBase,
8939
+ userId: a,
8940
+ type: t,
8941
+ deviceIdx: o,
8942
+ conversationId: e,
8943
+ token: M.wssToken
8944
+ }), l.token = n.token, l.endpoint = s, M.wtsBase && (c = this._buildSignalingEndpoint({
8945
+ baseEndpoint: M.wtsBase,
8946
+ userId: a,
8947
+ type: t,
8948
+ deviceIdx: o,
8949
+ conversationId: e,
8950
+ token: M.wssToken
8951
+ }), l.wt_endpoint = c);
8906
8952
  } else {
8907
8953
  let n = await this._getConversationParams(e);
8908
- o = n.device_idx || 0, s = i ?? `${M.wssBase}?userId=${a}&entityType=${t}&deviceIdx=${o}&conversationId=${e}&token=${M.wssToken}`, s = this._addGeoParamsToEndpoint(s, n), l.token = n.token, l.endpoint = s, l.device_idx = o, M.wtsBase && (c = `${M.wtsBase}?userId=${a}&entityType=${t}&deviceIdx=${o}&conversationId=${e}&token=${M.wssToken}`, c = this._addGeoParamsToEndpoint(c, n), l.wt_endpoint = c);
8954
+ o = n.device_idx || 0, s = i ?? this._buildSignalingEndpoint({
8955
+ baseEndpoint: M.wssBase,
8956
+ userId: a,
8957
+ type: t,
8958
+ deviceIdx: o,
8959
+ conversationId: e,
8960
+ token: M.wssToken,
8961
+ conversationParams: n
8962
+ }), l.token = n.token, l.endpoint = s, l.device_idx = o, M.wtsBase && (c = this._buildSignalingEndpoint({
8963
+ baseEndpoint: M.wtsBase,
8964
+ userId: a,
8965
+ type: t,
8966
+ deviceIdx: o,
8967
+ conversationId: e,
8968
+ token: M.wssToken,
8969
+ conversationParams: n
8970
+ }), l.wt_endpoint = c);
8909
8971
  }
8910
8972
  let u = await this._connectSignaling(dr.ACCEPT, l);
8911
- return z.callsLength >= M.maxParallelCalls || !M.hold && z.callsLength > 0 ? (this._debug.log("Push rejected (busy)"), this._stats.logger.log(C.PUSH, "busy"), this._signaling.ready && this._signaling.hangup(D.BUSY), Promise.reject(new O(D.BUSY))) : (await this._setConversation(l, u, Y.INCOMING, t), u);
8973
+ return z.callsLength >= M.maxParallelCalls || !M.hold && z.callsLength > 0 ? (this._debug.log("Push rejected (busy)"), this._stats.logger.log(S.PUSH, "busy"), this._signaling.ready && this._signaling.hangup(D.BUSY), Promise.reject(new O(D.BUSY))) : (await this._setConversation(l, u, Y.INCOMING, t), u);
8912
8974
  }
8913
8975
  async _createParticipant(e, t) {
8914
8976
  let n = Object.assign({
@@ -8988,7 +9050,7 @@ var to = 90, no = 3, ro = class extends b {
8988
9050
  audienceMode: this._isAudienceMode(t),
8989
9051
  restricted: this._isRestricted(t),
8990
9052
  urlSharingInfoByRoom: /* @__PURE__ */ new Map()
8991
- }, this._debug.setConversationId(t.conversation.id || e.id), this._signaling.setConversationId(this._conversation.id), e.p2p_forbidden && (M.forceRelayPolicy = e.p2p_forbidden), this._stats.logger.log(C.RELAY_POLICY, M.forceRelayPolicy ? "1" : "0"), this._changeFeatureSet(), this._changeFeaturesPerRole(), this._logDevices();
9053
+ }, this._debug.setConversationId(t.conversation.id || e.id), this._signaling.setConversationId(this._conversation.id), e.p2p_forbidden && (M.forceRelayPolicy = e.p2p_forbidden), this._stats.logger.log(S.RELAY_POLICY, M.forceRelayPolicy ? "1" : "0"), this._changeFeatureSet(), this._changeFeaturesPerRole(), this._logDevices();
8992
9054
  }
8993
9055
  _updateConversation(e) {
8994
9056
  if (!this._conversation) throw new O(D.UNKNOWN_ERROR);
@@ -9166,7 +9228,7 @@ var to = 90, no = 3, ro = class extends b {
9166
9228
  }
9167
9229
  _logDevices() {
9168
9230
  let e = T.getCameras().length, t = T.getMicrophones().length;
9169
- this._debug.debug("Cameras: " + e + (T.hasCameraPermission() ? "✔" : "✖") + ", Microphones: " + t + (T.hasMicrophonePermission() ? "✔" : "✖")), this._stats.logger.log(C.DEVICES, `${e}_${t}`);
9231
+ this._debug.debug("Cameras: " + e + (T.hasCameraPermission() ? "✔" : "✖") + ", Microphones: " + t + (T.hasMicrophonePermission() ? "✔" : "✖")), this._stats.logger.log(S.DEVICES, `${e}_${t}`);
9170
9232
  }
9171
9233
  _logWithMediaSettings(e, t) {
9172
9234
  this._stats.logger.log(e, [t?.isAudioEnabled && "audio", t?.isVideoEnabled && "video"].filter(Boolean).join("_"));
@@ -9236,7 +9298,7 @@ var to = 90, no = 3, ro = class extends b {
9236
9298
  observedIds: t.observedIds || []
9237
9299
  }, n), r = await this._getParticipant(e);
9238
9300
  }
9239
- this._setParticipantsStatus([r], N.WAITING), n ? (r.state = X.HUNGUP, await this._removeParticipant(r, n)) : this._transport && (r.state = X.CALLED, this._transport.allocate(r.id, !0), this._stats.logger.log(C.ADD_PARTICIPANT), this._invokeRolesChangedCallbackIfNeeded(r));
9301
+ this._setParticipantsStatus([r], N.WAITING), n ? (r.state = X.HUNGUP, await this._removeParticipant(r, n)) : this._transport && (r.state = X.CALLED, this._transport.allocate(r.id, !0), this._stats.logger.log(S.ADD_PARTICIPANT), this._invokeRolesChangedCallbackIfNeeded(r));
9240
9302
  }
9241
9303
  async _onRemoveParticipant(e) {
9242
9304
  this._debug.debug(`Remove participant [${e}]`);
@@ -9250,19 +9312,19 @@ var to = 90, no = 3, ro = class extends b {
9250
9312
  return;
9251
9313
  }
9252
9314
  if (this._transport) for (let e of t) this._transport.close(e.id);
9253
- this._stats.logger.log(C.REMOVE_PARTICIPANT);
9315
+ this._stats.logger.log(S.REMOVE_PARTICIPANT);
9254
9316
  }
9255
9317
  async changeDevice(e) {
9256
- return e === "audiooutput" ? this._audioOutput.changeOutput() : this._mediaSource ? this._mediaSource.changeDevice(e) : Promise.reject(x.UNKNOWN);
9318
+ return e === "audiooutput" ? this._audioOutput.changeOutput() : this._mediaSource ? this._mediaSource.changeDevice(e) : Promise.reject(b.UNKNOWN);
9257
9319
  }
9258
9320
  stopVideoTrack() {
9259
9321
  return this._mediaSource?.stopVideoTrack();
9260
9322
  }
9261
9323
  async toggleScreenCapturing(e) {
9262
- return this._mediaSource ? this._mediaSource.toggleScreenCapturing(e) : Promise.reject(x.UNKNOWN);
9324
+ return this._mediaSource ? this._mediaSource.toggleScreenCapturing(e) : Promise.reject(b.UNKNOWN);
9263
9325
  }
9264
9326
  async disableScreenCapturing() {
9265
- return this._mediaSource ? this._mediaSource.disableScreenCapturing() : Promise.reject(x.UNKNOWN);
9327
+ return this._mediaSource ? this._mediaSource.disableScreenCapturing() : Promise.reject(b.UNKNOWN);
9266
9328
  }
9267
9329
  toggleAnimojiCapturing(e) {
9268
9330
  this._mediaSource && this._mediaSource.toggleAnimojiCapturing(e);
@@ -9294,10 +9356,10 @@ var to = 90, no = 3, ro = class extends b {
9294
9356
  if (this._mediaSource) return this._mediaSource.setAudioStream(e);
9295
9357
  }
9296
9358
  async toggleLocalVideo(e) {
9297
- if (this._mediaSource) return this._stats.logger.log(C.MEDIA_STATUS, e ? "video_1" : "video_0"), this._mediaSource.toggleVideo(e);
9359
+ if (this._mediaSource) return this._stats.logger.log(S.MEDIA_STATUS, e ? "video_1" : "video_0"), this._mediaSource.toggleVideo(e);
9298
9360
  }
9299
9361
  async toggleLocalAudio(e) {
9300
- if (this._mediaSource) return this._stats.logger.log(C.MEDIA_STATUS, e ? "audio_1" : "audio_0"), this._mediaSource.toggleAudio(e);
9362
+ if (this._mediaSource) return this._stats.logger.log(S.MEDIA_STATUS, e ? "audio_1" : "audio_0"), this._mediaSource.toggleAudio(e);
9301
9363
  }
9302
9364
  async changePriorities(e) {
9303
9365
  if (e.length < 2 || !this._signaling.ready) return;
@@ -9447,7 +9509,7 @@ var to = 90, no = 3, ro = class extends b {
9447
9509
  L.onRemoteScreenStream(r.externalId, null, this.id);
9448
9510
  break;
9449
9511
  }
9450
- this._stats.logger.log(C.PAT_DEALLOCATED);
9512
+ this._stats.logger.log(S.PAT_DEALLOCATED);
9451
9513
  } else this._debug.log(`Cannot find participant to stop streaming: ${n.participantId}`);
9452
9514
  }
9453
9515
  this._streamIdByStreamDescription.delete(e);
@@ -9495,7 +9557,7 @@ var to = 90, no = 3, ro = class extends b {
9495
9557
  }
9496
9558
  }
9497
9559
  async _onParticipantPromoted(e) {
9498
- this._conversation && this._conversation.audienceMode ? (this._debug.log("Promoted in audience mode", !e.demote), this._conversation.restricted = e.demote, this._processRecordInfos(e), !e.demote && this._mediaSource && this._changeMediaSettings(this._mediaSource.mediaSettings)) : (this._debug.log("Promoted in waiting hall", !e.demote), e.demote ? (this._debug.log("Kicked from waiting hall"), this._close(new O(D.REMOVED))) : (this._updateConversation(e), this._waitingHallHoldPending ? (await this._signaling.hold(!0), await this._onJoinPart2(e, !1), this._waitingHallHoldPending = !1) : z.getActive() ? (await this._signaling.hold(!0), await this._onJoinPart2(e, !0, !0), this._waitingHallHoldPending = !1) : await this._onJoinPart2(e))), L.onPromoted(e.demote, this.id);
9560
+ this._conversation && this._conversation.audienceMode ? (this._debug.log("Promoted in audience mode", !e.demote), this._conversation.restricted = e.demote, this._processRecordInfos(e), !e.demote && this._mediaSource && this._changeMediaSettings(this._mediaSource.mediaSettings)) : (this._debug.log("Promoted in waiting hall", !e.demote), e.demote ? (this._debug.log("Kicked from waiting hall"), this._close(new O(D.REMOVED))) : (this._updateConversation(e), this._waitingHallHoldPending ? (await this._signaling.hold(!0), await this._onJoinPart2(e, !1), this._waitingHallHoldPending = !1) : z.getActive() && M.hold ? (await this._signaling.hold(!0), await this._onJoinPart2(e, !0, !0), this._waitingHallHoldPending = !1) : await this._onJoinPart2(e))), L.onPromoted(e.demote, this.id);
9499
9561
  }
9500
9562
  async _onChatRoomUpdated(e, t = 0, n = [], r, i) {
9501
9563
  this._debug.log(`Chat room updated: ${e}`);
@@ -9628,7 +9690,7 @@ var to = 90, no = 3, ro = class extends b {
9628
9690
  }
9629
9691
  let a = Tn(t), o = this._sequenceNumberByStreamDescription.get(a);
9630
9692
  if (o && o > e.sequenceNumber) {
9631
- this._debug.warn(`Participant ${r} received outdated PAT response: sequence number ${e.sequenceNumber}; last sent sequence number for given participant is ${o}`), this._stats.logger.log(C.PAT_OUTDATED_RESPONSE);
9693
+ this._debug.warn(`Participant ${r} received outdated PAT response: sequence number ${e.sequenceNumber}; last sent sequence number for given participant is ${o}`), this._stats.logger.log(S.PAT_OUTDATED_RESPONSE);
9632
9694
  return;
9633
9695
  }
9634
9696
  i && e.suspend !== void 0 && n && (this._debug.debug(`participant-sources-update: mediaType=${n}, suspend=${e.suspend}`), L.onRemoteStreamSuspended(i.externalId, n, e.suspend, this.id));
@@ -9637,15 +9699,15 @@ var to = 90, no = 3, ro = class extends b {
9637
9699
  this._streamWaitTimerByStreamDescription.delete(a);
9638
9700
  let t = this._conversation?.externalId, n = this._isMe(r);
9639
9701
  if (!i && !n) {
9640
- this._stats.logger.log(C.PAT_ERROR, "participantMissing"), this._debug.error(`Could not find participant by ID: ${r}`);
9702
+ this._stats.logger.log(S.PAT_ERROR, "participantMissing"), this._debug.error(`Could not find participant by ID: ${r}`);
9641
9703
  return;
9642
9704
  }
9643
9705
  let o = n ? t : i.externalId, c = this._streamByStreamId.get(s);
9644
9706
  if (!c) {
9645
- this._stats.logger.log(C.PAT_ERROR, "streamNotFound"), this._debug.error(`Could not find stream by ID: ${s}`);
9707
+ this._stats.logger.log(S.PAT_ERROR, "streamNotFound"), this._debug.error(`Could not find stream by ID: ${s}`);
9646
9708
  return;
9647
9709
  }
9648
- this._stats.logger.log(C.PAT_ALLOCATED), this._streamIdByStreamDescription.set(a, s);
9710
+ this._stats.logger.log(S.PAT_ALLOCATED), this._streamIdByStreamDescription.set(a, s);
9649
9711
  let l = e.participantStreamDescription?.mediaType;
9650
9712
  if (l === V.STREAM || l === V.MOVIE) {
9651
9713
  if (e.participantStreamDescription?.streamName) {
@@ -10152,7 +10214,7 @@ var to = 90, no = 3, ro = class extends b {
10152
10214
  mediaSettings: E(e.mediaSettings)
10153
10215
  }, i));
10154
10216
  }
10155
- r.state = X.ACCEPTED, r.mediaSettings = E(e.mediaSettings), this._logWithMediaSettings(C.ACCEPTED_OUTGOING, r.mediaSettings), this._conversation && this._conversation.direction === Y.OUTGOING && (this._state === "IDLE" || this._state === "PROCESSING") && (this._state = "ACTIVE", this._changeFeatureSet()), this._state === "ACTIVE" && this._transport && this._transport.open([r.id], n), await this._changeRemoteMediaSettings(t, r.mediaSettings), await this._changeRemoteParticipantState(t);
10217
+ r.state = X.ACCEPTED, r.mediaSettings = E(e.mediaSettings), this._logWithMediaSettings(S.ACCEPTED_OUTGOING, r.mediaSettings), this._conversation && this._conversation.direction === Y.OUTGOING && (this._state === "IDLE" || this._state === "PROCESSING") && (this._state = "ACTIVE", this._changeFeatureSet()), this._state === "ACTIVE" && this._transport && this._transport.open([r.id], n), await this._changeRemoteMediaSettings(t, r.mediaSettings), await this._changeRemoteParticipantState(t);
10156
10218
  let i = Object.keys(r.muteStates);
10157
10219
  i.length && this._onMuteParticipant({
10158
10220
  muteStates: r.muteStates,
@@ -10304,7 +10366,7 @@ var to = 90, no = 3, ro = class extends b {
10304
10366
  n && (n.clientType = e.clientType, n.platform = e.platform), L.onPeerRegistered(this.id);
10305
10367
  }
10306
10368
  async _onMicSwitched(e) {
10307
- L.onDeviceSwitched(S.AUDIO, !e.mute, this.id), await this.toggleLocalAudio(!e.mute);
10369
+ L.onDeviceSwitched(x.AUDIO, !e.mute, this.id), await this.toggleLocalAudio(!e.mute);
10308
10370
  }
10309
10371
  async _onChatMessage(e) {
10310
10372
  let t = j.composeMessageId(e), n = await this._getExternalIdByParticipantId(t);
@@ -10469,17 +10531,17 @@ var to = 90, no = 3, ro = class extends b {
10469
10531
  for (let [e, i] of d) {
10470
10532
  let a = this._isCallAdmin() && n;
10471
10533
  if (!(i !== Pa.MUTE && i !== Pa.MUTE_PERMANENT || a) && (this._isCallAdmin() && i === Pa.MUTE_PERMANENT && !n && (l[e] = Pa.MUTE), !(!t.includes(e) || r))) switch (e) {
10472
- case S.VIDEO:
10473
- u.isVideoEnabled && (L.onDeviceSwitched(S.VIDEO, !1, this.id), await this.toggleLocalVideo(!1));
10534
+ case x.VIDEO:
10535
+ u.isVideoEnabled && (L.onDeviceSwitched(x.VIDEO, !1, this.id), await this.toggleLocalVideo(!1));
10474
10536
  break;
10475
- case S.AUDIO:
10476
- u.isAudioEnabled && (L.onDeviceSwitched(S.AUDIO, !1, this.id), await this.toggleLocalAudio(!1));
10537
+ case x.AUDIO:
10538
+ u.isAudioEnabled && (L.onDeviceSwitched(x.AUDIO, !1, this.id), await this.toggleLocalAudio(!1));
10477
10539
  break;
10478
- case S.SCREEN_SHARING:
10479
- u.isScreenSharingEnabled && (L.onDeviceSwitched(S.SCREEN_SHARING, !1, this.id), await this.disableScreenCapturing());
10540
+ case x.SCREEN_SHARING:
10541
+ u.isScreenSharingEnabled && (L.onDeviceSwitched(x.SCREEN_SHARING, !1, this.id), await this.disableScreenCapturing());
10480
10542
  break;
10481
- case S.AUDIO_SHARING:
10482
- u.isAudioSharingEnabled && (L.onDeviceSwitched(S.AUDIO_SHARING, !1, this.id), await this.toggleScreenCapturing({
10543
+ case x.AUDIO_SHARING:
10544
+ u.isAudioSharingEnabled && (L.onDeviceSwitched(x.AUDIO_SHARING, !1, this.id), await this.toggleScreenCapturing({
10483
10545
  captureScreen: u.isScreenSharingEnabled,
10484
10546
  fastScreenSharing: u.isFastScreenSharingEnabled,
10485
10547
  captureAudio: !1
@@ -10607,7 +10669,7 @@ var to = 90, no = 3, ro = class extends b {
10607
10669
  this._state !== "HELD" && ((e === K.CONNECTING || e === K.RECONNECTING) && await this._areTransportParticipantsOnHold() || (e === K.CONNECTING && L.onLocalStatus(N.CONNECTING, this.id), e === K.RECONNECTING && L.onLocalStatus(N.RECONNECT, this.id), e === K.FAILED && this._transport && this._transport.allocated().length === 0 && (this._signaling.ready && await this._signaling.hangup(D.FAILED), this._close(new O(D.FAILED), "Transport failed"))));
10608
10670
  }
10609
10671
  async _areTransportParticipantsOnHold() {
10610
- if (!this._transport) return !1;
10672
+ if (!M.hold || !this._transport) return !1;
10611
10673
  let e = this._transport.opened().length ? this._transport.opened() : this._transport.allocated();
10612
10674
  if (!e.length) return !1;
10613
10675
  let t = await this._getParticipants();
@@ -10982,7 +11044,7 @@ async function Vo(e, t) {
10982
11044
  }
10983
11045
  }
10984
11046
  function Ho(e, t = {}, n = !1) {
10985
- t.method = e, t.format = "JSON", t.application_key || (t.application_key = M.apiKey), n || (y.sessionKey ? t.session_key = y.sessionKey : y.accessToken && (t.access_token = y.accessToken));
11047
+ t.method = e, t.format = "JSON", t.application_key || (t.application_key = M.apiKey), n || (v.sessionKey ? t.session_key = v.sessionKey : v.accessToken && (t.access_token = v.accessToken));
10986
11048
  for (let [e, n] of Object.entries(t)) typeof n == "object" && (t[e] = JSON.stringify(n));
10987
11049
  let r = "";
10988
11050
  for (let [e, n] of Object.entries(t)) r && (r += "&"), r += `${e}=${encodeURIComponent(n)}`;
@@ -11028,6 +11090,9 @@ var Uo = class {
11028
11090
  return Date.now();
11029
11091
  }
11030
11092
  cleanup() {}
11093
+ async getInbounds() {
11094
+ return [];
11095
+ }
11031
11096
  }, Wo = class {
11032
11097
  constructor() {
11033
11098
  h(this, "_okIdToExternalId", /* @__PURE__ */ new Map()), h(this, "_externalIdToOkId", /* @__PURE__ */ new Map()), h(this, "_decorativeIdToInitialId", /* @__PURE__ */ new Map()), h(this, "_initialIdToDecorativeId", /* @__PURE__ */ new Map());
@@ -11073,7 +11138,7 @@ var Uo = class {
11073
11138
  clear() {
11074
11139
  this._okIdToExternalId.clear(), this._externalIdToOkId.clear(), this._decorativeIdToInitialId.clear(), this._initialIdToDecorativeId.clear();
11075
11140
  }
11076
- }, Go = 700, Ko = 3e3, qo = class extends Uo {
11141
+ }, Go = "anonymLogin:", Ko = 700, qo = 3e3, Jo = class extends Uo {
11077
11142
  constructor(...e) {
11078
11143
  super(...e), h(this, "_userId", null), h(this, "_uuid", void 0), h(this, "_idCache", new Wo());
11079
11144
  }
@@ -11085,7 +11150,7 @@ var Uo = class {
11085
11150
  if (!Object.hasOwn(t, "error_msg")) {
11086
11151
  i++;
11087
11152
  let n = Object.getOwnPropertyNames(t).map((e) => `${e}: ${JSON.stringify(t[e])}`);
11088
- if (R.debug(`${e} network error, attempt ${i}: ${n.join("\n ")}`), this._abortSignal?.aborted && (R.debug(`${e} aborted`), this._abortSignal.throwIfAborted()), i < M.apiMaxAttempt) return await j.delay(Math.min(i * Go, Ko), { signal: this._abortSignal }), r(i);
11153
+ if (R.debug(`${e} network error, attempt ${i}: ${n.join("\n ")}`), this._abortSignal?.aborted && (R.debug(`${e} aborted`), this._abortSignal.throwIfAborted()), i < M.apiMaxAttempt) return await j.delay(Math.min(i * Ko, qo), { signal: this._abortSignal }), r(i);
11089
11154
  }
11090
11155
  throw R.warn(e, "error", t), t;
11091
11156
  }
@@ -11097,18 +11162,18 @@ var Uo = class {
11097
11162
  return await this._callUnsafe(e, t, n);
11098
11163
  } catch (r) {
11099
11164
  R.warn("Api call error", r);
11100
- let i = x.API;
11165
+ let i = b.API;
11101
11166
  switch (r.error_code) {
11102
11167
  case 102:
11103
11168
  case 103:
11104
- case 104: return await this.authorize(), this._callUnsafe(e, t, n);
11169
+ case 104: return this._removeCachedAnonymLogin(), await this.authorize(), this._callUnsafe(e, t, n);
11105
11170
  }
11106
11171
  let a = {
11107
11172
  message: r.error_msg,
11108
11173
  code: r.error_code
11109
11174
  };
11110
11175
  if (r instanceof O) throw r;
11111
- if (r.custom_error && (a.custom_error = r.custom_error), Jo(r)) switch (r.error_code) {
11176
+ if (r.custom_error && (a.custom_error = r.custom_error), Yo(r)) switch (r.error_code) {
11112
11177
  case 1101:
11113
11178
  i = D.SERVICE_DISABLED;
11114
11179
  break;
@@ -11143,25 +11208,54 @@ var Uo = class {
11143
11208
  }
11144
11209
  async userId(e) {
11145
11210
  let t = j.extractOkId(e);
11146
- return y.isEmpty() ? Z.fromId(String(t)) : (this._idCache.hasByOkId(t) || await this._getExternalIdsByOkIds([t]), this._idCache.getExternalId(t) || Z.fromId(String(t)));
11211
+ return v.isEmpty() ? Z.fromId(String(t)) : (this._idCache.hasByOkId(t) || await this._getExternalIdsByOkIds([t]), this._idCache.getExternalId(t) || Z.fromId(String(t)));
11147
11212
  }
11148
11213
  async authorize() {
11149
- if (this._ensureUuid(), !M.apiKey) throw new O(x.API, { message: "Required argument apiAppKey not passed" });
11150
- let e = { session_data: {
11214
+ if (this._ensureUuid(), !M.apiKey) throw new O(b.API, { message: "Required argument apiAppKey not passed" });
11215
+ let e = this._getCachedAnonymLogin();
11216
+ if (e) {
11217
+ this._applyAnonymLogin(e);
11218
+ return;
11219
+ }
11220
+ let t = { session_data: {
11151
11221
  version: 2,
11152
11222
  device_id: this._uuid,
11153
11223
  client_version: M.appVersion,
11154
11224
  client_type: "SDK_JS"
11155
11225
  } };
11156
- return M.authToken && (e.session_data.auth_token = M.authToken, e.session_data.version = 3), this._callUnsafe("auth.anonymLogin", e, !0).then((e) => {
11157
- e.uid && (this._userId = Number(e.uid)), y.sessionKey = e.session_key, y.sessionSecretKey = e.session_secret_key;
11226
+ return M.authToken && (t.session_data.auth_token = M.authToken, t.session_data.version = 3), this._callUnsafe("auth.anonymLogin", t, !0).then((e) => {
11227
+ this._applyAnonymLogin(e), this._setCachedAnonymLogin(e);
11158
11228
  }).catch((e) => {
11159
- throw e.error_code === 401 && L.onTokenExpired(), new O(x.AUTH, {
11229
+ throw e.error_code === 401 && (this._removeCachedAnonymLogin(), L.onTokenExpired()), new O(b.AUTH, {
11160
11230
  message: e.error_msg,
11161
11231
  code: e.error_code
11162
11232
  });
11163
11233
  });
11164
11234
  }
11235
+ _getAnonymLoginCacheKey() {
11236
+ return M.authToken ? `${Go}${M.authToken}` : null;
11237
+ }
11238
+ _getCachedAnonymLogin() {
11239
+ let e = this._getAnonymLoginCacheKey();
11240
+ if (!e) return null;
11241
+ let t = ot.get(e);
11242
+ return Xo(t) ? t : (t && ot.remove(e), null);
11243
+ }
11244
+ _setCachedAnonymLogin(e) {
11245
+ let t = this._getAnonymLoginCacheKey();
11246
+ !t || !Xo(e) || ot.set(t, {
11247
+ session_key: e.session_key,
11248
+ session_secret_key: e.session_secret_key,
11249
+ uid: e.uid
11250
+ });
11251
+ }
11252
+ _removeCachedAnonymLogin() {
11253
+ let e = this._getAnonymLoginCacheKey();
11254
+ e && ot.remove(e);
11255
+ }
11256
+ _applyAnonymLogin(e) {
11257
+ e.uid && (this._userId = Number(e.uid)), v.sessionKey = e.session_key, v.sessionSecretKey = e.session_secret_key;
11258
+ }
11165
11259
  logClientStats(e) {
11166
11260
  let t = {
11167
11261
  app_version: String(M.appVersion),
@@ -11244,8 +11338,8 @@ var Uo = class {
11244
11338
  }
11245
11339
  _ensureUuid() {
11246
11340
  if (!this._uuid) {
11247
- let e = at.get("uuid");
11248
- e || (e = j.uuid(), at.set("uuid", e)), this._uuid = String(e);
11341
+ let e = ot.get("uuid");
11342
+ e || (e = j.uuid(), ot.set("uuid", e)), this._uuid = String(e);
11249
11343
  }
11250
11344
  }
11251
11345
  deviceId() {
@@ -11363,17 +11457,24 @@ var Uo = class {
11363
11457
  async getServerTime() {
11364
11458
  return (await this._call("system.getInfo")).serverTime;
11365
11459
  }
11460
+ async getInbounds() {
11461
+ let e = await this._call("vchat.getInbounds");
11462
+ return Array.isArray(e?.inbounds) ? e.inbounds : [];
11463
+ }
11366
11464
  };
11367
- function Jo(e) {
11465
+ function Yo(e) {
11368
11466
  return typeof e == "object" && !!e && "error_code" in e && "error_msg" in e;
11369
11467
  }
11468
+ function Xo(e) {
11469
+ return typeof e == "object" && !!e && "session_key" in e && "session_secret_key" in e && typeof e.session_key == "string" && e.session_key.length > 0 && typeof e.session_secret_key == "string" && e.session_secret_key.length > 0;
11470
+ }
11370
11471
  //#endregion
11371
11472
  //#region src/enums/RecordRole.ts
11372
- var Yo = /* @__PURE__ */ function(e) {
11473
+ var Zo = /* @__PURE__ */ function(e) {
11373
11474
  return e.KING = "KING", e.PAWN = "PAWN", e;
11374
- }(Yo || {}), Xo = /* @__PURE__ */ function(e) {
11475
+ }(Zo || {}), Qo = /* @__PURE__ */ function(e) {
11375
11476
  return e.OFF = "0", e.ON = "1", e;
11376
- }({}), Zo = class {
11477
+ }({}), $o = class {
11377
11478
  constructor(e) {
11378
11479
  h(this, "_queue", void 0), h(this, "_readCursor", void 0), h(this, "_writeCursor", void 0), h(this, "_moveReadCursor", void 0), h(this, "_left", void 0), this._queue = Array(e).fill(null), this._readCursor = this._writeCursor = this._left = 0, this._moveReadCursor = !1;
11379
11480
  }
@@ -11396,7 +11497,7 @@ var Yo = /* @__PURE__ */ function(e) {
11396
11497
  let e = this._queue[this._readCursor];
11397
11498
  return e && (this._moveReadCursor = !1, this._queue[this._readCursor] = null, this._readCursor = this.nextCursor(this._readCursor), --this._left), e;
11398
11499
  }
11399
- }, Qo = class {
11500
+ }, es = class {
11400
11501
  constructor(e, t, n, r = null) {
11401
11502
  h(this, "_uuid", void 0), h(this, "_apiKey", void 0), h(this, "_callToken", void 0), h(this, "_apiEnv", void 0), h(this, "_baseApiUrl", void 0), h(this, "_sessionKey", void 0), this._uuid = j.uuid(), this._apiKey = t, this._callToken = n, this._apiEnv = e, this._baseApiUrl = r;
11402
11503
  }
@@ -11421,7 +11522,7 @@ var Yo = /* @__PURE__ */ function(e) {
11421
11522
  session_key: this._sessionKey
11422
11523
  }, !0, await Io(this._baseApiUrl, this._apiEnv));
11423
11524
  }
11424
- }, $, $o = null, es = {
11525
+ }, $, ts = null, ns = {
11425
11526
  getCameras: T.getCameras,
11426
11527
  getMicrophones: T.getMicrophones,
11427
11528
  getOutput: T.getOutput,
@@ -11447,33 +11548,33 @@ var Yo = /* @__PURE__ */ function(e) {
11447
11548
  baseChromeVersion: T.baseChromeVersion,
11448
11549
  getAudioContext: T.getAudioContext,
11449
11550
  isAudioShareSupported: T.isAudioShareSupported
11450
- }, ts = { participantMarkerCompare: j.participantMarkerCompare };
11451
- function ns(e) {
11452
- $o = e;
11551
+ }, rs = { participantMarkerCompare: j.participantMarkerCompare };
11552
+ function is(e) {
11553
+ ts = e;
11453
11554
  }
11454
- function rs(e) {
11555
+ function as(e) {
11455
11556
  M.videoEffects = e;
11456
11557
  }
11457
- function is(e) {
11558
+ function os(e) {
11458
11559
  M.audioEffects = e;
11459
11560
  }
11460
- function as(e, t = null, n = {}, r = 1) {
11561
+ function ss(e, t = null, n = {}, r = 1) {
11461
11562
  M.vmoji = e, M.vmojiOptions = {
11462
11563
  protocolVersion: r,
11463
11564
  renderingOptions: n
11464
11565
  }, t && e.setSDK(t);
11465
11566
  }
11466
- async function os(t) {
11467
- if (M.set(t), $ || ($ = new qo()), e.disableLog(!M.debug), R.toggle(M.debug), R.log(`Calls SDK ${M.sdkVersion}`, t), await T.init(), !T.isBrowserSupported()) throw new O(x.UNSUPPORTED);
11567
+ async function cs(t) {
11568
+ if (M.set(t), $ || ($ = new Jo()), e.disableLog(!M.debug), R.toggle(M.debug), R.log(`Calls SDK ${M.sdkVersion}`, t), await T.init(), !T.isBrowserSupported()) throw new O(b.UNSUPPORTED);
11468
11569
  R.log("UserAgent:", navigator.userAgent), R.log("Screen resolution:", `${window.screen.width}x${window.screen.height}`), R.log("Permissions:", `Camera: ${T.hasCameraPermission()}, Mic: ${T.hasMicrophonePermission()}`), R.log("Simulcast:", `${t.simulcast} => ${M.simulcast}`);
11469
11570
  }
11470
- async function ss(e, t = [S.AUDIO], n = "", r = !1, i = !1, a, o, s) {
11571
+ async function ls(e, t = [x.AUDIO], n = "", r = !1, i = !1, a, o, s) {
11471
11572
  let c = [];
11472
- return Array.isArray(e) ? c = e.length ? e : [] : e && (c = [e]), cs([], Oa.USER, t, n, r, i, a, c, o, s);
11573
+ return Array.isArray(e) ? c = e.length ? e : [] : e && (c = [e]), us([], Oa.USER, t, n, r, i, a, c, o, s);
11473
11574
  }
11474
- async function cs(e, t = Oa.USER, n, r = "", i = !1, a = !1, o, s, c, l) {
11575
+ async function us(e, t = Oa.USER, n, r = "", i = !1, a = !1, o, s, c, l) {
11475
11576
  if (!M.hold && z.callsLength > 0) throw R.error("There is already active call"), new O(D.FAILED);
11476
- return new Q($, $o).onStart({
11577
+ return new Q($, ts).onStart({
11477
11578
  opponentIds: e,
11478
11579
  opponentType: t,
11479
11580
  mediaOptions: n,
@@ -11486,37 +11587,40 @@ async function cs(e, t = Oa.USER, n, r = "", i = !1, a = !1, o, s, c, l) {
11486
11587
  conversationId: l
11487
11588
  });
11488
11589
  }
11489
- async function ls(e, t) {
11490
- return us(e, A.USER, void 0, t);
11590
+ async function ds(e, t) {
11591
+ return fs(e, A.USER, void 0, t);
11491
11592
  }
11492
- async function us(e, t = A.USER, n, r, i, a) {
11593
+ async function fs(e, t = A.USER, n, r, i, a) {
11493
11594
  if (e === Q.id()) throw Error("Push has already been processed");
11494
- return a && $.setUserId(a), new Q($, $o).onPush(e, t, n, r, i);
11595
+ return a && $.setUserId(a), new Q($, ts).onPush(e, t, n, r, i);
11495
11596
  }
11496
- async function ds(e, t) {
11597
+ async function ps() {
11598
+ return $.getInbounds();
11599
+ }
11600
+ async function ms(e, t) {
11497
11601
  return e && (M.authToken = e), t !== void 0 && M.apiBaseUrl !== t && (M.apiBaseUrl = t, Po()), $.authorize();
11498
11602
  }
11499
- async function fs(e = [S.AUDIO], t) {
11500
- return Ic(t).accept(e);
11603
+ async function hs(e = [x.AUDIO], t) {
11604
+ return zc(t).accept(e);
11501
11605
  }
11502
- async function ps(e) {
11503
- let t = Fc(e);
11606
+ async function gs(e) {
11607
+ let t = Rc(e);
11504
11608
  if (t) return t.decline();
11505
11609
  }
11506
- async function ms(e, t = [S.AUDIO]) {
11507
- return hs(e, t);
11610
+ async function _s(e, t = [x.AUDIO]) {
11611
+ return vs(e, t);
11508
11612
  }
11509
- async function hs(e, t, n) {
11613
+ async function vs(e, t, n) {
11510
11614
  if (!M.hold && z.callsLength > 0) throw R.error("There is already active call"), new O(D.FAILED);
11511
- return new Q($, $o).onJoin({
11615
+ return new Q($, ts).onJoin({
11512
11616
  conversationId: e,
11513
11617
  mediaOptions: t,
11514
11618
  chatId: n
11515
11619
  });
11516
11620
  }
11517
- async function gs(e, t = [S.AUDIO], n, r, i, a) {
11621
+ async function ys(e, t = [x.AUDIO], n, r, i, a) {
11518
11622
  if (!M.hold && z.callsLength > 0) throw R.error("There is already active call"), new O(D.FAILED);
11519
- return n && (M.anonymToken = n), new Q($, $o).onJoin({
11623
+ return n && (M.anonymToken = n), new Q($, ts).onJoin({
11520
11624
  joinLink: e,
11521
11625
  mediaOptions: t,
11522
11626
  observedIds: r,
@@ -11524,31 +11628,31 @@ async function gs(e, t = [S.AUDIO], n, r, i, a) {
11524
11628
  onFastJoin: a
11525
11629
  });
11526
11630
  }
11527
- async function _s(e) {
11528
- let t = Fc(e);
11631
+ async function bs(e) {
11632
+ let t = Rc(e);
11529
11633
  if (t) return t.hangup();
11530
11634
  Q.hangupAfterInit();
11531
11635
  }
11532
- async function vs(e, t) {
11636
+ async function xs(e, t) {
11533
11637
  let n = Array.isArray(e) ? e : [e], r = Q.current();
11534
11638
  r && await r.addParticipant(n, t);
11535
11639
  }
11536
- async function ys(e, t) {
11640
+ async function Ss(e, t) {
11537
11641
  let n = Q.current();
11538
11642
  if (n) {
11539
11643
  let r = e.map((e) => j.composeUserId(e));
11540
11644
  await n.addParticipantLegacy(r, t);
11541
11645
  }
11542
11646
  }
11543
- async function bs(e, t = !1) {
11647
+ async function Cs(e, t = !1) {
11544
11648
  let n = $.getCachedRawOkIdByExternalId(e);
11545
11649
  if (!n) {
11546
11650
  R.warn("removeParticipant: externalId not found in cache", e);
11547
11651
  return;
11548
11652
  }
11549
- return xs(n, t);
11653
+ return ws(n, t);
11550
11654
  }
11551
- async function xs(e, t = !1) {
11655
+ async function ws(e, t = !1) {
11552
11656
  let n = Q.current();
11553
11657
  if (n) try {
11554
11658
  await n.removeParticipant(j.composeUserId(e), t);
@@ -11556,13 +11660,13 @@ async function xs(e, t = !1) {
11556
11660
  R.warn(`Failed to remove participant ${e}. Perhaps he is no longer on the call. ${t}`);
11557
11661
  }
11558
11662
  }
11559
- async function Ss(e, t) {
11663
+ async function Ts(e, t) {
11560
11664
  let n = Q.current();
11561
11665
  if (e === "videoinput" && At.contains(t)) return M.videoFacingMode = t, n ? (T.isMobile() && n.stopVideoTrack(), n.changeDevice(e)) : void 0;
11562
11666
  if (!await T._saveDeviceId(e, t)) throw Error(`Device not found: ${t}`);
11563
11667
  if (n) return n.changeDevice(e);
11564
11668
  }
11565
- async function Cs(e, t) {
11669
+ async function Es(e, t) {
11566
11670
  let n = typeof e == "object" ? {
11567
11671
  ...e,
11568
11672
  fastScreenSharing: e.captureScreen && e.fastScreenSharing,
@@ -11571,34 +11675,34 @@ async function Cs(e, t) {
11571
11675
  captureScreen: e,
11572
11676
  fastScreenSharing: !1,
11573
11677
  captureAudio: !1
11574
- }, r = Fc(t);
11678
+ }, r = Rc(t);
11575
11679
  return r ? r.toggleScreenCapturing(n) : Promise.reject();
11576
11680
  }
11577
- function ws(e) {
11681
+ function Ds(e) {
11578
11682
  let t = Q.current();
11579
11683
  t && t.toggleAnimojiCapturing(e);
11580
11684
  }
11581
- async function Ts(e, t = !1) {
11685
+ async function Os(e, t = !1) {
11582
11686
  let n = Q.current();
11583
11687
  n && await n.setVideoStream(e, t);
11584
11688
  }
11585
- async function Es(e, t) {
11586
- let n = Fc(t);
11689
+ async function ks(e, t) {
11690
+ let n = Rc(t);
11587
11691
  n && await n.toggleLocalVideo(e);
11588
11692
  }
11589
- async function Ds(e, t) {
11590
- let n = Fc(t);
11693
+ async function As(e, t) {
11694
+ let n = Rc(t);
11591
11695
  n && await n.toggleLocalAudio(e);
11592
11696
  }
11593
- async function Os(e) {
11697
+ async function js(e) {
11594
11698
  let t = Q.current();
11595
11699
  if (t) return t.setLocalResolution(e);
11596
11700
  }
11597
- async function ks(e) {
11701
+ async function Ms(e) {
11598
11702
  let t = Q.current();
11599
11703
  t && await t.changePriorities(e);
11600
11704
  }
11601
- async function As(e, t) {
11705
+ async function Ns(e, t) {
11602
11706
  let n = Q.current();
11603
11707
  if (n) {
11604
11708
  let r;
@@ -11613,33 +11717,33 @@ async function As(e, t) {
11613
11717
  await n.changeParticipantState(e, r);
11614
11718
  }
11615
11719
  }
11616
- async function js() {
11720
+ async function Ps() {
11617
11721
  let e = Q.current();
11618
11722
  e && await e.putHandsDown();
11619
11723
  }
11620
- async function Ms(e) {
11724
+ async function Fs(e) {
11621
11725
  let t = Q.current();
11622
11726
  t && await t.updateDisplayLayout(e);
11623
11727
  }
11624
- async function Ns(e) {
11728
+ async function Is(e) {
11625
11729
  let t = Q.current();
11626
11730
  t && await t.requestDisplayLayout(e);
11627
11731
  }
11628
- async function Ps(e, t, n = !1) {
11732
+ async function Ls(e, t, n = !1) {
11629
11733
  let r = $.getCachedRawOkIdByExternalId(e);
11630
11734
  if (!r) {
11631
11735
  R.warn("grantRoles: externalId not found in cache", e);
11632
11736
  return;
11633
11737
  }
11634
- return Fs(r, Z.getDeviceIdx(e), t, n);
11738
+ return Rs(r, Z.getDeviceIdx(e), t, n);
11635
11739
  }
11636
- async function Fs(e, t, n, r = !1) {
11740
+ async function Rs(e, t, n, r = !1) {
11637
11741
  let i = Q.current();
11638
11742
  i && await i.grantRoles(j.composeParticipantId(e, A.USER, t), n, r);
11639
11743
  }
11640
- async function Is({ externalId: e = null, muteStates: t, requestedMedia: n = [], roomId: r = null }) {
11744
+ async function zs({ externalId: e = null, muteStates: t, requestedMedia: n = [], roomId: r = null }) {
11641
11745
  let i = null;
11642
- return e && (i = $.getCachedRawOkIdByExternalId(e), i || R.warn("muteParticipant: externalId not found in cache", e)), Ls({
11746
+ return e && (i = $.getCachedRawOkIdByExternalId(e), i || R.warn("muteParticipant: externalId not found in cache", e)), Bs({
11643
11747
  uid: i,
11644
11748
  muteStates: t,
11645
11749
  requestedMedia: n,
@@ -11647,75 +11751,75 @@ async function Is({ externalId: e = null, muteStates: t, requestedMedia: n = [],
11647
11751
  roomId: r
11648
11752
  });
11649
11753
  }
11650
- async function Ls({ uid: e = null, muteStates: t, requestedMedia: n = [], deviceIdx: r = 0, roomId: i = null }) {
11754
+ async function Bs({ uid: e = null, muteStates: t, requestedMedia: n = [], deviceIdx: r = 0, roomId: i = null }) {
11651
11755
  let a = Q.current();
11652
11756
  if (a) {
11653
11757
  let o = e ? j.composeParticipantId(e, A.USER, r) : null;
11654
11758
  await a.muteParticipant(o, t, n, i);
11655
11759
  }
11656
11760
  }
11657
- async function Rs(e, t = !1, n = null) {
11761
+ async function Vs(e, t = !1, n = null) {
11658
11762
  let r = $.getCachedRawOkIdByExternalId(e);
11659
11763
  if (!r) {
11660
11764
  R.warn("pinParticipant: externalId not found in cache", e);
11661
11765
  return;
11662
11766
  }
11663
- return zs(r, t, Z.getDeviceIdx(e), n);
11767
+ return Hs(r, t, Z.getDeviceIdx(e), n);
11664
11768
  }
11665
- async function zs(e, t = !1, n = 0, r = null) {
11769
+ async function Hs(e, t = !1, n = 0, r = null) {
11666
11770
  let i = Q.current();
11667
11771
  i && await i.pinParticipant(j.composeParticipantId(e, A.USER, n), t, r);
11668
11772
  }
11669
- async function Bs(e) {
11773
+ async function Us(e) {
11670
11774
  let t = Q.current();
11671
11775
  t && await t.updateMediaModifiers(e);
11672
11776
  }
11673
- async function Vs(e) {
11777
+ async function Ws(e) {
11674
11778
  let t = Q.current();
11675
11779
  t && await t.enableVideoSuspend(e);
11676
11780
  }
11677
- async function Hs(e) {
11781
+ async function Gs(e) {
11678
11782
  let t = Q.current();
11679
11783
  t && await t.enableVideoSuspendSuggest(e);
11680
11784
  }
11681
- async function Us(e) {
11785
+ async function Ks(e) {
11682
11786
  let t = Q.current();
11683
11787
  t && await t.changeOptions(e);
11684
11788
  }
11685
- async function Ws(e, t = null) {
11789
+ async function qs(e, t = null) {
11686
11790
  let n = null;
11687
- return t && (n = $.getCachedRawOkIdByExternalId(t), n || R.warn("chatMessage: externalId not found in cache", t)), Gs(e, n);
11791
+ return t && (n = $.getCachedRawOkIdByExternalId(t), n || R.warn("chatMessage: externalId not found in cache", t)), Js(e, n);
11688
11792
  }
11689
- async function Gs(e, t = null) {
11793
+ async function Js(e, t = null) {
11690
11794
  let n = Q.current();
11691
11795
  if (n) {
11692
11796
  let r = t ? j.composeUserId(t) : null;
11693
11797
  await n.chatMessage(e, r);
11694
11798
  }
11695
11799
  }
11696
- async function Ks(e = 10) {
11800
+ async function Ys(e = 10) {
11697
11801
  let t = Q.current();
11698
11802
  if (t) return t.chatHistory(e);
11699
11803
  }
11700
- async function qs(e, t = null) {
11804
+ async function Xs(e, t = null) {
11701
11805
  let n = null;
11702
- return t && (n = $.getCachedRawOkIdByExternalId(t), n || R.warn("customData: externalId not found in cache", t)), Js(e, n, Z.getDeviceIdx(t));
11806
+ return t && (n = $.getCachedRawOkIdByExternalId(t), n || R.warn("customData: externalId not found in cache", t)), Zs(e, n, Z.getDeviceIdx(t));
11703
11807
  }
11704
- async function Js(e, t = null, n = 0) {
11808
+ async function Zs(e, t = null, n = 0) {
11705
11809
  let r = Q.current();
11706
11810
  if (r) {
11707
11811
  let i = t ? j.composeParticipantId(t, A.USER, n) : null;
11708
11812
  await r.customData(e, i);
11709
11813
  }
11710
11814
  }
11711
- async function Ys(e = "", t = !1, { onlyAdminCanShareMovie: n = !1, waitForAdmin: r = !1, closedConversation: i = !1 } = {}, a) {
11815
+ async function Qs(e = "", t = !1, { onlyAdminCanShareMovie: n = !1, waitForAdmin: r = !1, closedConversation: i = !1 } = {}, a) {
11712
11816
  return (await $.createConversation(a ?? j.uuid(), e, t, {
11713
11817
  onlyAdminCanShareMovie: n,
11714
11818
  waitForAdmin: r,
11715
11819
  closedConversation: i
11716
11820
  })).join_link;
11717
11821
  }
11718
- async function Xs(e = "", t = !1, { onlyAdminCanShareMovie: n = !1, audioOnly: r = !1 } = {}, i) {
11822
+ async function $s(e = "", t = !1, { onlyAdminCanShareMovie: n = !1, audioOnly: r = !1 } = {}, i) {
11719
11823
  let a = i.map((e) => Z.fromId(e));
11720
11824
  return (await $.createConversation(j.uuid(), e, t, {
11721
11825
  onlyAdminCanShareMovie: n,
@@ -11723,53 +11827,53 @@ async function Xs(e = "", t = !1, { onlyAdminCanShareMovie: n = !1, audioOnly: r
11723
11827
  audioOnly: r
11724
11828
  }, a)).join_link;
11725
11829
  }
11726
- async function Zs() {
11830
+ async function ec() {
11727
11831
  let e = Q.current();
11728
11832
  return e ? e.createJoinLink() : Promise.reject();
11729
11833
  }
11730
- async function Qs() {
11834
+ async function tc() {
11731
11835
  let e = Q.current();
11732
11836
  return e ? e.removeJoinLink() : Promise.reject();
11733
11837
  }
11734
- async function $s(e, t) {
11838
+ async function nc(e, t) {
11735
11839
  return $.getAnonymTokenByLink(e, t);
11736
11840
  }
11737
- function ec(e) {
11841
+ function rc(e) {
11738
11842
  let t = Q.current();
11739
11843
  t && t.setVolume(e);
11740
11844
  }
11741
- function tc(e) {
11845
+ function ic(e) {
11742
11846
  M.forceRelayPolicy = e;
11743
11847
  }
11744
- async function nc(e = !1, t = null, n = null, r = "DIRECT_LINK", i = null, a = null) {
11848
+ async function ac(e = !1, t = null, n = null, r = "DIRECT_LINK", i = null, a = null) {
11745
11849
  let o = Q.current();
11746
11850
  return o ? o.startStream(e, t, n, r, i, a) : Promise.reject();
11747
11851
  }
11748
- async function rc(e = null, t) {
11852
+ async function oc(e = null, t) {
11749
11853
  let n = Q.current();
11750
11854
  return n ? n.stopStream(e, t) : Promise.reject();
11751
11855
  }
11752
- async function ic(e = null) {
11856
+ async function sc(e = null) {
11753
11857
  let t = Q.current();
11754
11858
  return t ? t.publishStream(e) : Promise.reject();
11755
11859
  }
11756
- async function ac() {
11860
+ async function cc() {
11757
11861
  let e = Q.current();
11758
11862
  return e ? e.getStreamInfo() : Promise.reject();
11759
11863
  }
11760
- async function oc(e) {
11864
+ async function lc(e) {
11761
11865
  let t = Q.current();
11762
11866
  return t ? t.addMovie(e) : Promise.reject();
11763
11867
  }
11764
- async function sc(e) {
11868
+ async function uc(e) {
11765
11869
  let t = Q.current();
11766
11870
  return t ? t.updateMovie(e) : Promise.reject();
11767
11871
  }
11768
- async function cc(e) {
11872
+ async function dc(e) {
11769
11873
  let t = Q.current();
11770
11874
  return t ? t.removeMovie(e) : Promise.reject();
11771
11875
  }
11772
- async function lc(e, t) {
11876
+ async function fc(e, t) {
11773
11877
  let n = Q.current();
11774
11878
  if (n) {
11775
11879
  let r = [];
@@ -11794,11 +11898,11 @@ async function lc(e, t) {
11794
11898
  }
11795
11899
  return Promise.reject();
11796
11900
  }
11797
- async function uc(e, t) {
11901
+ async function pc(e, t) {
11798
11902
  let n = Q.current();
11799
11903
  return n ? n.activateRooms(e, t) : Promise.reject();
11800
11904
  }
11801
- async function dc(e = null, t = null) {
11905
+ async function mc(e = null, t = null) {
11802
11906
  let n = Q.current();
11803
11907
  if (!n) return Promise.reject();
11804
11908
  let r;
@@ -11813,30 +11917,30 @@ async function dc(e = null, t = null) {
11813
11917
  }
11814
11918
  return n.switchRoom(e, r);
11815
11919
  }
11816
- async function fc(e) {
11920
+ async function hc(e) {
11817
11921
  let t = Q.current();
11818
11922
  return t ? t.removeRooms(e) : Promise.reject();
11819
11923
  }
11820
- function pc(e) {
11924
+ function gc(e) {
11821
11925
  M.statisticsInterval = e;
11822
11926
  let t = Q.current();
11823
11927
  if (t) return t.updateStatisticsInterval();
11824
11928
  }
11825
- function mc(t) {
11929
+ function _c(t) {
11826
11930
  e.disableLog(!t), R.toggle(t);
11827
11931
  }
11828
- function hc(e, ...t) {
11932
+ function vc(e, ...t) {
11829
11933
  M.debugLog && R.send(e, "[external]", ...t);
11830
11934
  }
11831
- var gc = {
11832
- list: Ne,
11833
- get: Pe,
11834
- getJson: Fe,
11835
- download: Ie,
11836
- clear: Le,
11837
- stats: Re
11935
+ var yc = {
11936
+ list: Pe,
11937
+ get: Fe,
11938
+ getJson: Ie,
11939
+ download: Le,
11940
+ clear: Re,
11941
+ stats: ze
11838
11942
  };
11839
- function _c() {
11943
+ function bc() {
11840
11944
  let e = [
11841
11945
  [`Calls SDK ${M.sdkVersion}`, M.toJSON()],
11842
11946
  ["UserAgent:", navigator.userAgent],
@@ -11853,31 +11957,31 @@ function _c() {
11853
11957
  d: e
11854
11958
  }));
11855
11959
  }
11856
- async function vc() {
11960
+ async function xc() {
11857
11961
  let e = Q.id(), t = Q.debugSessionId();
11858
11962
  if (!t || !e) throw R.error("[uploadDebugLogs]", "No conversation id found"), Error("No conversation id found");
11859
- let n = await Pe({ sessionId: t });
11963
+ let n = await Fe({ sessionId: t });
11860
11964
  if (n.length === 0) throw R.error("[uploadDebugLogs]", "No logs found"), Error("No logs found");
11861
11965
  let r = n[0].t, i = n[n.length - 1].t;
11862
11966
  try {
11863
- return $?.uploadDebugLogs(e, r, i, JSON.stringify([..._c(), ...n]));
11967
+ return $?.uploadDebugLogs(e, r, i, JSON.stringify([...bc(), ...n]));
11864
11968
  } catch (e) {
11865
11969
  throw R.error("[uploadDebugLogs]", "Error while uploading logs", e), Error("Error while uploading logs", { cause: e });
11866
11970
  }
11867
11971
  }
11868
- async function yc(e) {
11972
+ async function Sc(e) {
11869
11973
  let t = Q.current();
11870
11974
  if (t) return t.videoEffect(e);
11871
11975
  }
11872
- async function bc(e, t) {
11976
+ async function Cc(e, t) {
11873
11977
  let n = Q.current();
11874
11978
  if (n) return n.audioEffect(e.length > 0 ? e : null, t);
11875
11979
  }
11876
- async function xc(e) {
11980
+ async function wc(e) {
11877
11981
  let t = Q.current();
11878
11982
  t && await t.setAudioStream(e);
11879
11983
  }
11880
- async function Sc(e, t = null, n = null) {
11984
+ async function Tc(e, t = null, n = null) {
11881
11985
  let r = Q.current();
11882
11986
  if (!r) return;
11883
11987
  let i = n ?? t?.id, a = null;
@@ -11888,18 +11992,18 @@ async function Sc(e, t = null, n = null) {
11888
11992
  }
11889
11993
  r.setAnimojiSvg(e, a, i);
11890
11994
  }
11891
- function Cc(e) {
11995
+ function Ec(e) {
11892
11996
  let t = Q.current();
11893
11997
  t && t.setAnimojiFill(e);
11894
11998
  }
11895
- async function wc(e = null, t, n = !1) {
11896
- return Ic().getWaitingHall(e, t, n);
11999
+ async function Dc(e = null, t, n = !1) {
12000
+ return zc().getWaitingHall(e, t, n);
11897
12001
  }
11898
- async function Tc() {
11899
- return Ic().getAudienceModeHands();
12002
+ async function Oc() {
12003
+ return zc().getAudienceModeHands();
11900
12004
  }
11901
- async function Ec(e, t = !1) {
11902
- let n = Ic(), r;
12005
+ async function kc(e, t = !1) {
12006
+ let n = zc(), r;
11903
12007
  if (e) {
11904
12008
  let t = $.getCachedRawOkIdByExternalId(e);
11905
12009
  if (!t) {
@@ -11910,74 +12014,74 @@ async function Ec(e, t = !1) {
11910
12014
  }
11911
12015
  return n.promoteParticipant(r, t);
11912
12016
  }
11913
- async function Dc(e = !1) {
11914
- return Ic().requestPromotion(e);
12017
+ async function Ac(e = !1) {
12018
+ return zc().requestPromotion(e);
11915
12019
  }
11916
- async function Oc(e = !1) {
11917
- return Ic().acceptPromotion(e);
12020
+ async function jc(e = !1) {
12021
+ return zc().acceptPromotion(e);
11918
12022
  }
11919
- async function kc(e) {
11920
- return Ic().getParticipantListChunk(e);
12023
+ async function Mc(e) {
12024
+ return zc().getParticipantListChunk(e);
11921
12025
  }
11922
- async function Ac(e) {
11923
- return Ic().getParticipants(e);
12026
+ async function Nc(e) {
12027
+ return zc().getParticipants(e);
11924
12028
  }
11925
- async function jc(e) {
11926
- return Ic().feedback(e);
12029
+ async function Pc(e) {
12030
+ return zc().feedback(e);
11927
12031
  }
11928
- function Mc(e, t, n) {
11929
- return Ic().userFeedbackStats(e, t, n);
12032
+ function Fc(e, t, n) {
12033
+ return zc().userFeedbackStats(e, t, n);
11930
12034
  }
11931
- function Nc(e, t = {}, n = !1) {
12035
+ function Ic(e, t = {}, n = !1) {
11932
12036
  let r = Q.current();
11933
12037
  r && r.sendClientEvent(e, t, n);
11934
12038
  }
11935
- async function Pc(e, t, n) {
11936
- return Ic(n).enableFeatureForRoles(e, t);
12039
+ async function Lc(e, t, n) {
12040
+ return zc(n).enableFeatureForRoles(e, t);
11937
12041
  }
11938
- function Fc(e) {
11939
- return e ? z.get(e) ?? null : Q.current() ?? z.getFirstHeld();
12042
+ function Rc(e) {
12043
+ return e ? z.get(e) ?? null : Q.current() ?? z.getFirst();
11940
12044
  }
11941
- function Ic(e) {
11942
- let t = Fc(e);
12045
+ function zc(e) {
12046
+ let t = Rc(e);
11943
12047
  if (!t) throw Error("Conversation not found");
11944
12048
  return t;
11945
12049
  }
11946
- async function Lc(e) {
12050
+ async function Bc(e) {
11947
12051
  await $.removeHistoryRecords(e);
11948
12052
  }
11949
- async function Rc(e) {
12053
+ async function Vc(e) {
11950
12054
  let t = Q.current();
11951
12055
  t && await t.startAsr(e);
11952
12056
  }
11953
- async function zc(e) {
12057
+ async function Hc(e) {
11954
12058
  let t = Q.current();
11955
12059
  t && await t.stopAsr(e);
11956
12060
  }
11957
- async function Bc(e) {
12061
+ async function Uc(e) {
11958
12062
  let t = Q.current();
11959
12063
  t && await t.requestAsr(e);
11960
12064
  }
11961
- async function Vc(e) {
12065
+ async function Wc(e) {
11962
12066
  let t = Q.current();
11963
12067
  return t ? t.startUrlSharing(e) : Promise.reject();
11964
12068
  }
11965
- async function Hc() {
12069
+ async function Gc() {
11966
12070
  let e = Q.current();
11967
12071
  return e ? e.stopUrlSharing() : Promise.reject();
11968
12072
  }
11969
- async function Uc(e) {
12073
+ async function Kc(e) {
11970
12074
  await z.switchCall(e);
11971
12075
  }
11972
- function Wc() {
12076
+ function qc() {
11973
12077
  return z.getActiveId();
11974
12078
  }
11975
- function Gc() {
12079
+ function Jc() {
11976
12080
  return Q.getSyncedTime();
11977
12081
  }
11978
- function Kc() {
12082
+ function Yc() {
11979
12083
  return M.sdkVersion;
11980
12084
  }
11981
12085
  typeof window < "u" && (window.__CALLS_SDK = mn);
11982
12086
  //#endregion
11983
- export { qo as Api, Qo as ApiExternal, Zo as ArrayDequeue, y as AuthData, f as BaseLogger, Y as CallDirection, Oa as CallType, ka as ChatRoomEventType, Aa as ConversationFeature, ja as ConversationOption, _n as DebugMessageType, Ba as ExternalIdType, At as FacingMode, x as FatalError, O as HangupReason, D as HangupType, S as MediaOption, k as MediaTrackKind, V as MediaType, Pa as MuteState, X as ParticipantState, Xo as ParticipantStateDataValue, N as ParticipantStatus, Yo as RecordRole, Fa as RoomsEventType, Da as Signaling, B as SignalingCommandType, dr as SignalingConnectionType, G as SignalingNotification, q as TransportTopology, Ra as UserRole, A as UserType, oo as VolumeDetector, fs as acceptCall, Oc as acceptPromotion, uc as activateRooms, oc as addMovie, vs as addParticipant, ys as addParticipantInternal, ds as authorize, es as browser, cs as callInternal, ss as callTo, Cs as captureScreen, ws as captureVmoji, bc as changeAudioEffect, Us as changeConversationOptions, Ss as changeDevice, As as changeParticipantState, ks as changePriorities, yc as changeVideoEffect, Ks as chatHistory, Ws as chatMessage, Gs as chatMessageInternal, Zs as createJoinLink, qs as customData, Js as customDataInternal, mc as debug, gc as debugLogs, hc as debugMessage, ps as declineCall, Pc as enableFeatureForRoles, Vs as enableVideoSuspend, Hs as enableVideoSuspendSuggest, jc as feedback, tc as forceRelayPolicy, Wc as getActiveCallId, $s as getAnonymTokenByLink, Tc as getAudienceModeHands, kc as getParticipantListChunk, Ac as getParticipants, ac as getStreamInfo, Gc as getSyncedTime, wc as getWaitingHall, Ps as grantRoles, Fs as grantRolesInternal, _s as hangup, os as init, ms as joinCall, gs as joinCallByLink, hs as joinCallInternal, Nc as logClientEvent, Is as muteParticipant, Ls as muteParticipantInternal, Rs as pinParticipant, zs as pinParticipantInternal, ls as processPush, us as processPushInternal, Ec as promoteParticipant, ic as publishStream, js as putHandsDown, Lc as removeHistoryRecords, Qs as removeJoinLink, cc as removeMovie, bs as removeParticipant, xs as removeParticipantInternal, fc as removeRooms, Bc as requestAsr, Ns as requestDisplayLayout, Dc as requestPromotion, is as setAudioEffects, xc as setAudioStream, Os as setLocalResolution, ns as setLogger, Bs as setMediaModifiers, pc as setStatisticsInterval, rs as setVideoEffects, Ts as setVideoStream, as as setVmoji, Cc as setVmojiFill, Sc as setVmojiSvg, ec as setVolume, Rc as startAsr, Xs as startAudienceConversation, Ys as startConversation, nc as startStream, Vc as startUrlSharing, zc as stopAsr, rc as stopStream, Hc as stopUrlSharing, Uc as switchCall, dc as switchRoom, Ds as toggleLocalAudio, Es as toggleLocalVideo, Ms as updateDisplayLayout, sc as updateMovie, lc as updateRooms, vc as uploadDebugLogs, Mc as userFeedbackStats, ts as utils, Kc as version };
12087
+ export { Jo as Api, es as ApiExternal, $o as ArrayDequeue, v as AuthData, f as BaseLogger, Y as CallDirection, Oa as CallType, ka as ChatRoomEventType, Aa as ConversationFeature, ja as ConversationOption, _n as DebugMessageType, Ba as ExternalIdType, At as FacingMode, b as FatalError, O as HangupReason, D as HangupType, x as MediaOption, k as MediaTrackKind, V as MediaType, Pa as MuteState, X as ParticipantState, Qo as ParticipantStateDataValue, N as ParticipantStatus, Zo as RecordRole, Fa as RoomsEventType, Da as Signaling, B as SignalingCommandType, dr as SignalingConnectionType, G as SignalingNotification, q as TransportTopology, Ra as UserRole, A as UserType, oo as VolumeDetector, hs as acceptCall, jc as acceptPromotion, pc as activateRooms, lc as addMovie, xs as addParticipant, Ss as addParticipantInternal, ms as authorize, ns as browser, us as callInternal, ls as callTo, Es as captureScreen, Ds as captureVmoji, Cc as changeAudioEffect, Ks as changeConversationOptions, Ts as changeDevice, Ns as changeParticipantState, Ms as changePriorities, Sc as changeVideoEffect, Ys as chatHistory, qs as chatMessage, Js as chatMessageInternal, ec as createJoinLink, Xs as customData, Zs as customDataInternal, _c as debug, yc as debugLogs, vc as debugMessage, gs as declineCall, Lc as enableFeatureForRoles, Ws as enableVideoSuspend, Gs as enableVideoSuspendSuggest, Pc as feedback, ic as forceRelayPolicy, qc as getActiveCallId, nc as getAnonymTokenByLink, Oc as getAudienceModeHands, ps as getInbounds, Mc as getParticipantListChunk, Nc as getParticipants, cc as getStreamInfo, Jc as getSyncedTime, Dc as getWaitingHall, Ls as grantRoles, Rs as grantRolesInternal, bs as hangup, cs as init, _s as joinCall, ys as joinCallByLink, vs as joinCallInternal, Ic as logClientEvent, zs as muteParticipant, Bs as muteParticipantInternal, Vs as pinParticipant, Hs as pinParticipantInternal, ds as processPush, fs as processPushInternal, kc as promoteParticipant, sc as publishStream, Ps as putHandsDown, Bc as removeHistoryRecords, tc as removeJoinLink, dc as removeMovie, Cs as removeParticipant, ws as removeParticipantInternal, hc as removeRooms, Uc as requestAsr, Is as requestDisplayLayout, Ac as requestPromotion, os as setAudioEffects, wc as setAudioStream, js as setLocalResolution, is as setLogger, Us as setMediaModifiers, gc as setStatisticsInterval, as as setVideoEffects, Os as setVideoStream, ss as setVmoji, Ec as setVmojiFill, Tc as setVmojiSvg, rc as setVolume, Vc as startAsr, $s as startAudienceConversation, Qs as startConversation, ac as startStream, Wc as startUrlSharing, Hc as stopAsr, oc as stopStream, Gc as stopUrlSharing, Kc as switchCall, mc as switchRoom, As as toggleLocalAudio, ks as toggleLocalVideo, Fs as updateDisplayLayout, uc as updateMovie, fc as updateRooms, xc as uploadDebugLogs, Fc as userFeedbackStats, rs as utils, Yc as version };