@vindral/web-sdk 4.3.0-2-ged356a90 → 4.3.0-4-g99bdcb75

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.
@@ -5947,9 +5947,9 @@ var Zf = /* @__PURE__ */ new WeakMap(), Qf = /* @__PURE__ */ new WeakMap(), $f =
5947
5947
  constructor(e, t, n) {
5948
5948
  S(this, rp), v(this, Zf, void 0), v(this, Qf, void 0), v(this, $f, new ke(100)), v(this, ep, void 0), v(this, tp, 0), v(this, np, O.get().createContext("WebTransportConnection")), x(ep, this, n), x(Zf, this, e), x(Qf, this, t), y(rp, this, ap).call(this).catch((e) => {
5949
5949
  b(np, this).warn("Incoming streams handling ended with error", e), b(Qf, this).markPostHandshake(), b($f, this).close();
5950
- }), b(Zf, this).closed.then(() => {
5950
+ }), b(Zf, this).closed.finally(() => {
5951
5951
  b(Qf, this).markPostHandshake(), b($f, this).close();
5952
- });
5952
+ }).catch(o);
5953
5953
  }
5954
5954
  openSendStream() {
5955
5955
  var e = this;
@@ -5969,7 +5969,7 @@ var Zf = /* @__PURE__ */ new WeakMap(), Qf = /* @__PURE__ */ new WeakMap(), $f =
5969
5969
  closed() {
5970
5970
  var e = this;
5971
5971
  return t(function* () {
5972
- yield b(Zf, e).closed;
5972
+ yield b(Zf, e).closed.catch(o);
5973
5973
  })();
5974
5974
  }
5975
5975
  close() {
@@ -6894,7 +6894,7 @@ var Xm = class n {
6894
6894
  })();
6895
6895
  }
6896
6896
  closed() {
6897
- return b($m, this).closed();
6897
+ return Promise.race([b($m, this).closed(), b(Qm, this).closed()]);
6898
6898
  }
6899
6899
  catalog() {
6900
6900
  return b($m, this).catalog();
@@ -7074,7 +7074,7 @@ function xh(e) {
7074
7074
  }
7075
7075
  var Sh = 1e4, Ch = /* @__PURE__ */ new WeakMap(), wh = /* @__PURE__ */ new WeakSet(), Th = class n {
7076
7076
  constructor(t, n, r) {
7077
- S(this, wh), e(this, "ip", void 0), e(this, "value", void 0), v(this, Ch, void 0), this.ip = r, this.value = new A(n), x(Ch, this, y(wh, this, Eh).call(this, t));
7077
+ S(this, wh), e(this, "ip", void 0), e(this, "value", void 0), v(this, Ch, void 0), this.ip = r, this.value = new A(n), x(Ch, this, y(wh, this, Eh).call(this, t)), this.closed().catch(o);
7078
7078
  }
7079
7079
  closed() {
7080
7080
  return b(Ch, this);
@@ -7188,6 +7188,7 @@ var Ph = class {
7188
7188
  }, Fh = /* @__PURE__ */ new WeakMap(), Ih = /* @__PURE__ */ new WeakMap(), Lh = /* @__PURE__ */ new WeakMap(), Rh = /* @__PURE__ */ new WeakMap(), Z = /* @__PURE__ */ new WeakMap(), zh = /* @__PURE__ */ new WeakMap(), Bh = /* @__PURE__ */ new WeakMap(), Vh = /* @__PURE__ */ new WeakMap(), Hh = /* @__PURE__ */ new WeakMap(), Uh = /* @__PURE__ */ new WeakMap(), Wh = /* @__PURE__ */ new WeakSet(), Gh = class n {
7189
7189
  constructor(t, n, r) {
7190
7190
  S(this, Wh), v(this, Fh, void 0), v(this, Ih, void 0), v(this, Lh, void 0), v(this, Rh, O.get().createContext("Player")), v(this, Z, void 0), v(this, zh, new A(void 0)), v(this, Bh, new A(void 0)), v(this, Vh, new A(void 0)), v(this, Hh, void 0), v(this, Uh, void 0), e(this, "subtitles", new Ph(b(Vh, this), "subtitles")), e(this, "video", new Ph(b(Bh, this), "video")), e(this, "audio", new Ph(b(zh, this), "audio")), x(Fh, this, t), x(Ih, this, uh.start(r)), x(Lh, this, r), x(Z, this, new A(n)), x(Hh, this, new kh(n)), x(Uh, this, Promise.race([
7191
+ y(Wh, this, Yh).call(this),
7191
7192
  r.idleTimeout(),
7192
7193
  y(Wh, this, Jh).call(this),
7193
7194
  b(Hh, this).closed()
@@ -7328,7 +7329,7 @@ function Jh() {
7328
7329
  try {
7329
7330
  for (var l = U(t.catalog()), u; o = !(u = yield l.next()).done; o = !1) {
7330
7331
  let t = u.value;
7331
- yield Promise.all([y(Wh, e, Yh).call(e, t, b(Bh, e)), y(Wh, e, Yh).call(e, t, b(zh, e))]);
7332
+ yield Promise.all([y(Wh, e, Xh).call(e, t, b(Bh, e)), y(Wh, e, Xh).call(e, t, b(zh, e))]);
7332
7333
  }
7333
7334
  } catch (e) {
7334
7335
  s = !0, c = e;
@@ -7351,7 +7352,17 @@ function Jh() {
7351
7352
  }
7352
7353
  })();
7353
7354
  }
7354
- function Yh(e, n) {
7355
+ function Yh() {
7356
+ var e = this;
7357
+ return t(function* () {
7358
+ try {
7359
+ return yield b(Lh, e).closed(), /* @__PURE__ */ Error("Stats closed");
7360
+ } catch (e) {
7361
+ return e;
7362
+ }
7363
+ })();
7364
+ }
7365
+ function Xh(e, n) {
7355
7366
  var r = this;
7356
7367
  return t(function* () {
7357
7368
  let t = n.current();
@@ -7368,74 +7379,74 @@ function Yh(e, n) {
7368
7379
  }
7369
7380
  //#endregion
7370
7381
  //#region ../../libs/web-sdk/src/adapters/MoqConnectionAdapter.ts
7371
- function Xh(e, t, n) {
7382
+ function Zh(e, t, n) {
7372
7383
  let r = new URL("/voq/subscribe", e);
7373
7384
  return r.searchParams.set("sessionId", t.sessionId), r.searchParams.set("clientId", t.clientId), r.searchParams.set("channelId", t.channelId), n && r.searchParams.set("authToken", n), r;
7374
7385
  }
7375
- var Zh = 1e4, Q = /* @__PURE__ */ new WeakMap(), Qh = /* @__PURE__ */ new WeakMap(), $h = /* @__PURE__ */ new WeakMap(), eg = /* @__PURE__ */ new WeakMap(), $ = /* @__PURE__ */ new WeakMap(), tg = /* @__PURE__ */ new WeakMap(), ng = /* @__PURE__ */ new WeakMap(), rg = /* @__PURE__ */ new WeakMap(), ig = /* @__PURE__ */ new WeakMap(), ag = /* @__PURE__ */ new WeakMap(), og = /* @__PURE__ */ new WeakMap(), sg = /* @__PURE__ */ new WeakSet(), cg = /* @__PURE__ */ new WeakMap(), lg = /* @__PURE__ */ new WeakMap(), ug = /* @__PURE__ */ new WeakMap(), dg = class n {
7386
+ var Qh = 1e4, Q = /* @__PURE__ */ new WeakMap(), $h = /* @__PURE__ */ new WeakMap(), eg = /* @__PURE__ */ new WeakMap(), tg = /* @__PURE__ */ new WeakMap(), $ = /* @__PURE__ */ new WeakMap(), ng = /* @__PURE__ */ new WeakMap(), rg = /* @__PURE__ */ new WeakMap(), ig = /* @__PURE__ */ new WeakMap(), ag = /* @__PURE__ */ new WeakMap(), og = /* @__PURE__ */ new WeakMap(), sg = /* @__PURE__ */ new WeakMap(), cg = /* @__PURE__ */ new WeakSet(), lg = /* @__PURE__ */ new WeakMap(), ug = /* @__PURE__ */ new WeakMap(), dg = /* @__PURE__ */ new WeakMap(), fg = class n {
7376
7387
  get estimatedBandwidth() {
7377
- return b(ig, this);
7388
+ return b(ag, this);
7378
7389
  }
7379
7390
  unload() {
7380
- b(Q, this).off("send signal", b(lg, this)), b(Q, this).off("disconnect", this.disconnect), b(Q, this).off("text track", b(cg, this)), this.disconnect();
7391
+ b(Q, this).off("send signal", b(ug, this)), b(Q, this).off("disconnect", this.disconnect), b(Q, this).off("text track", b(lg, this)), this.disconnect();
7381
7392
  }
7382
7393
  suspend() {}
7383
7394
  unsuspend() {}
7384
7395
  getStatistics() {
7385
- let e = b($h, this).transportType() === "webtransport" ? "moq" : "moq_ws";
7396
+ let e = b(eg, this).transportType() === "webtransport" ? "moq" : "moq_ws";
7386
7397
  return {
7387
- edgeUrl: b($h, this).url(),
7398
+ edgeUrl: b(eg, this).url(),
7388
7399
  connectionProtocol: e,
7389
- transportSelectionReason: b(ag, this)
7400
+ transportSelectionReason: b(og, this)
7390
7401
  };
7391
7402
  }
7392
7403
  constructor(t, n, r, i, a, s, c, l) {
7393
- S(this, sg), v(this, Q, void 0), v(this, Qh, void 0), v(this, $h, void 0), v(this, eg, "disconnected"), v(this, $, void 0), v(this, tg, /* @__PURE__ */ new Map()), v(this, ng, void 0), v(this, rg, void 0), v(this, ig, void 0), v(this, ag, void 0), v(this, og, /* @__PURE__ */ new Map()), v(this, cg, (e) => {
7404
+ S(this, cg), v(this, Q, void 0), v(this, $h, void 0), v(this, eg, void 0), v(this, tg, "disconnected"), v(this, $, void 0), v(this, ng, /* @__PURE__ */ new Map()), v(this, rg, void 0), v(this, ig, void 0), v(this, ag, void 0), v(this, og, void 0), v(this, sg, /* @__PURE__ */ new Map()), v(this, lg, (e) => {
7394
7405
  if (!e) {
7395
7406
  b($, this).setSubtitleTrack(void 0).catch(o);
7396
7407
  return;
7397
7408
  }
7398
- let t = b(tg, this).get(yp(b($, this).namespace())), n = t == null ? void 0 : t.getTextTrack(e);
7409
+ let t = b(ng, this).get(yp(b($, this).namespace())), n = t == null ? void 0 : t.getTextTrack(e);
7399
7410
  n && b($, this).setSubtitleTrack(n).catch(o);
7400
- }), v(this, lg, (e) => {
7411
+ }), v(this, ug, (e) => {
7401
7412
  switch (e.type) {
7402
7413
  case "subscribe":
7403
- if (b(ug, this)) {
7404
- b(Qh, this).info("Ignoring - we are already switching");
7414
+ if (b(dg, this)) {
7415
+ b($h, this).info("Ignoring - we are already switching");
7405
7416
  return;
7406
7417
  }
7407
- x(ug, this, !0), y(sg, this, mg).call(this, e.subscription).catch((t) => {
7408
- b(Qh, this).error("error handling subscription", t), b(Q, this).emit("received signal", {
7418
+ x(dg, this, !0), y(cg, this, hg).call(this, e.subscription).catch((t) => {
7419
+ b($h, this).error("error handling subscription", t), b(Q, this).emit("received signal", {
7409
7420
  type: "subscription changed",
7410
7421
  subscription: e.subscription,
7411
7422
  reset: !0
7412
7423
  });
7413
- }).finally(() => x(ug, this, !1));
7424
+ }).finally(() => x(dg, this, !1));
7414
7425
  break;
7415
7426
  case "telemetry":
7416
- me(new URL("/api/telemetry", b($h, this).url().replace("wss://", "https://")), {
7427
+ me(new URL("/api/telemetry", b(eg, this).url().replace("wss://", "https://")), {
7417
7428
  body: e.body,
7418
7429
  headers: { "Content-Type": "text/plain" }
7419
7430
  }).catch(o);
7420
7431
  break;
7421
7432
  case "refresh auth":
7422
- b($h, this).updateAuthToken(e.token);
7433
+ b(eg, this).updateAuthToken(e.token);
7423
7434
  break;
7424
7435
  }
7425
- }), v(this, ug, !1), e(this, "disconnect", (e = "Disconnect Requested") => {
7426
- b(Qh, this).info("Disconnecting", e), b($h, this).close(), b($, this).close().catch(o), x(og, this, /* @__PURE__ */ new Map()), y(sg, this, hg).call(this, "disconnected");
7427
- }), x(Q, this, t), x(Qh, this, n), x($h, this, r), x($, this, i), x(tg, this, a), x(ng, this, s), x(rg, this, c), x(ag, this, l), b(Q, this).on("send signal", b(lg, this)), b(Q, this).on("disconnect", this.disconnect), b(Q, this).on("text track", b(cg, this)), y(sg, this, fg).call(this).catch(o), y(sg, this, gg).call(this).catch(o);
7436
+ }), v(this, dg, !1), e(this, "disconnect", (e = "Disconnect Requested") => {
7437
+ b($h, this).info("Disconnecting", e), b(eg, this).close(), b($, this).close().catch(o), x(sg, this, /* @__PURE__ */ new Map()), y(cg, this, gg).call(this, "disconnected");
7438
+ }), x(Q, this, t), x($h, this, n), x(eg, this, r), x($, this, i), x(ng, this, a), x(rg, this, s), x(ig, this, c), x(og, this, l), b(Q, this).on("send signal", b(ug, this)), b(Q, this).on("disconnect", this.disconnect), b(Q, this).on("text track", b(lg, this)), y(cg, this, pg).call(this).catch(o), y(cg, this, _g).call(this).catch(o);
7428
7439
  }
7429
7440
  static start(e, r, i, a, o) {
7430
7441
  return t(function* () {
7431
7442
  var t, s, c;
7432
- let l = new Map(a.connectInfo.channels.map((e) => [yp(e.catalog.namespace), new Cg(new A(e.catalog))])), u = yield a.onConnectInfo(a.connectInfo), d = a.options.get("authenticationToken"), f, p;
7443
+ let l = new Map(a.connectInfo.channels.map((e) => [yp(e.catalog.namespace), new wg(new A(e.catalog))])), u = yield a.onConnectInfo(a.connectInfo), d = a.options.get("authenticationToken"), f, p;
7433
7444
  switch (typeof a.edgeUrl) {
7434
7445
  case "string":
7435
- f = Xh(a.edgeUrl, u, d);
7446
+ f = Zh(a.edgeUrl, u, d);
7436
7447
  break;
7437
7448
  default:
7438
- f = Xh(a.edgeUrl.moqUrl || a.edgeUrl.moqWsUrl, u, d), p = Xh(a.edgeUrl.moqWsUrl, u, d);
7449
+ f = Zh(a.edgeUrl.moqUrl || a.edgeUrl.moqWsUrl, u, d), p = Zh(a.edgeUrl.moqWsUrl, u, d);
7439
7450
  break;
7440
7451
  }
7441
7452
  let m = (t = a.connectInfo.channels.find((e) => e.channelId === u.channelId)) == null ? void 0 : t.catalog;
@@ -7461,9 +7472,9 @@ var Zh = 1e4, Q = /* @__PURE__ */ new WeakMap(), Qh = /* @__PURE__ */ new WeakMa
7461
7472
  audioTrack: ee == null ? void 0 : ee.track,
7462
7473
  burstMs: u.burstMs || 0
7463
7474
  }),
7464
- hn(Zh, /* @__PURE__ */ Error("Timeout waiting for player to start")),
7475
+ hn(Qh, /* @__PURE__ */ Error("Timeout waiting for player to start")),
7465
7476
  re
7466
- ]), ie = new Cg(g.catalog());
7477
+ ]), ie = new wg(g.catalog());
7467
7478
  l.set(yp(m.namespace), ie), e.emit("received signal", {
7468
7479
  type: "client ip",
7469
7480
  ip: g.connectionInfo().ip
@@ -7473,28 +7484,28 @@ var Zh = 1e4, Q = /* @__PURE__ */ new WeakMap(), Qh = /* @__PURE__ */ new WeakMa
7473
7484
  r.error("Error getting DRM data", e);
7474
7485
  });
7475
7486
  let ae = new n(e, r, te, g, l, i, o, ne);
7476
- return u.textTrack && b(cg, ae).call(ae, u.textTrack), ae;
7487
+ return u.textTrack && b(lg, ae).call(ae, u.textTrack), ae;
7477
7488
  })();
7478
7489
  }
7479
7490
  getState() {
7480
- return b(eg, this);
7491
+ return b(tg, this);
7481
7492
  }
7482
7493
  close() {
7483
- b($h, this).close();
7494
+ b(eg, this).close();
7484
7495
  }
7485
7496
  closed() {
7486
- return Promise.race([b($h, this).closed(), b($, this).closed()]);
7497
+ return Promise.race([b(eg, this).closed(), b($, this).closed()]);
7487
7498
  }
7488
7499
  };
7489
- function fg() {
7500
+ function pg() {
7490
7501
  var e = this;
7491
7502
  return t(function* () {
7492
- b($h, e).transportType() === "websocket" && (yield mn(5e3));
7503
+ b(eg, e).transportType() === "websocket" && (yield mn(5e3));
7493
7504
  var t = !1, n = !1, r;
7494
7505
  try {
7495
7506
  for (var i = U(b($, e).stats()), a; t = !(a = yield i.next()).done; t = !1) {
7496
7507
  let { rtt: t, estimatedBandwidth: n } = a.value;
7497
- x(ig, e, n), b(rg, e).push(t), b(Q, e).emit("rtt", Ot(b(rg, e).items()));
7508
+ x(ag, e, n), b(ig, e).push(t), b(Q, e).emit("rtt", Ot(b(ig, e).items()));
7498
7509
  }
7499
7510
  } catch (e) {
7500
7511
  n = !0, r = e;
@@ -7507,26 +7518,26 @@ function fg() {
7507
7518
  }
7508
7519
  })();
7509
7520
  }
7510
- function pg(e) {
7521
+ function mg(e) {
7511
7522
  var n = this;
7512
7523
  return t(function* () {
7513
7524
  var t;
7514
- let r = yield b(ng, n).connect({ channelId: e });
7525
+ let r = yield b(rg, n).connect({ channelId: e });
7515
7526
  if (!ce(r)) throw Error("no moq connect info found");
7516
7527
  let i = (t = r.channels.find((t) => t.channelId === e)) == null ? void 0 : t.catalog;
7517
7528
  if (!i) throw Error("no catalog found");
7518
7529
  return i;
7519
7530
  })();
7520
7531
  }
7521
- function mg(e) {
7532
+ function hg(e) {
7522
7533
  var n = this;
7523
7534
  return t(function* () {
7524
7535
  var t, r;
7525
- b(Qh, n).info("handle subscription", e);
7526
- let i = b($, n), a = b(tg, n).get(e.channelId);
7527
- if (a || (a = new Cg(new A(yield y(sg, n, pg).call(n, e.channelId))), b(tg, n).set(e.channelId, a)), i.namespace().join("/") !== a.namespace().join("/")) {
7536
+ b($h, n).info("handle subscription", e);
7537
+ let i = b($, n), a = b(ng, n).get(e.channelId);
7538
+ if (a || (a = new wg(new A(yield y(cg, n, mg).call(n, e.channelId))), b(ng, n).set(e.channelId, a)), i.namespace().join("/") !== a.namespace().join("/")) {
7528
7539
  var o;
7529
- b(Qh, n).info("changing channel", e.channelId);
7540
+ b($h, n).info("changing channel", e.channelId);
7530
7541
  let t = a.getVideoTrack(e.video), r = a.getAudioTrack(e.audio);
7531
7542
  yield i.zap({
7532
7543
  namespace: a.namespace(),
@@ -7536,8 +7547,8 @@ function mg(e) {
7536
7547
  }, 500), i.drm().then((e) => {
7537
7548
  e && b(Q, n).emit("received drm data", e.value);
7538
7549
  }).catch((e) => {
7539
- b(Qh, n).error("Error getting DRM data", e);
7540
- }), b(Qh, n).info("switched channel", e.channelId), (o = b(tg, n).get(yp(i.namespace()))) == null || o.updateCatalog(i.catalog()), b(Q, n).emit("received signal", {
7550
+ b($h, n).error("Error getting DRM data", e);
7551
+ }), b($h, n).info("switched channel", e.channelId), (o = b(ng, n).get(yp(i.namespace()))) == null || o.updateCatalog(i.catalog()), b(Q, n).emit("received signal", {
7541
7552
  type: "subscription changed",
7542
7553
  subscription: e
7543
7554
  });
@@ -7550,26 +7561,26 @@ function mg(e) {
7550
7561
  });
7551
7562
  })();
7552
7563
  }
7553
- function hg(e) {
7554
- x(eg, this, e), b(Q, this).emit("connection state", e);
7564
+ function gg(e) {
7565
+ x(tg, this, e), b(Q, this).emit("connection state", e);
7555
7566
  }
7556
- function gg() {
7567
+ function _g() {
7557
7568
  var e = this;
7558
7569
  return t(function* () {
7559
7570
  try {
7560
- y(sg, e, hg).call(e, "connecting"), b(Qh, e).info("Connecting..."), y(sg, e, hg).call(e, "connected"), yield Promise.all([
7561
- y(sg, e, vg).call(e, b($, e).referenceClock(), b($, e).audio),
7562
- y(sg, e, vg).call(e, b($, e).referenceClock(), b($, e).video),
7563
- y(sg, e, _g).call(e, b($, e).subtitles)
7564
- ]), yield b($, e).closed(), b($h, e).close(), b(Qh, e).info("Session closed");
7571
+ y(cg, e, gg).call(e, "connecting"), b($h, e).info("Connecting..."), y(cg, e, gg).call(e, "connected"), yield Promise.all([
7572
+ y(cg, e, yg).call(e, b($, e).referenceClock(), b($, e).audio),
7573
+ y(cg, e, yg).call(e, b($, e).referenceClock(), b($, e).video),
7574
+ y(cg, e, vg).call(e, b($, e).subtitles)
7575
+ ]), yield b($, e).closed(), b(eg, e).close(), b($h, e).info("Session closed");
7565
7576
  } catch (t) {
7566
- b(Qh, e).warn("Session error", t);
7577
+ b($h, e).warn("Session error", t);
7567
7578
  } finally {
7568
- y(sg, e, hg).call(e, "disconnected");
7579
+ y(cg, e, gg).call(e, "disconnected");
7569
7580
  }
7570
7581
  })();
7571
7582
  }
7572
- function _g(e) {
7583
+ function vg(e) {
7573
7584
  var n = this;
7574
7585
  return t(function* () {
7575
7586
  var t = !1, r = !1, i;
@@ -7589,7 +7600,7 @@ function _g(e) {
7589
7600
  }
7590
7601
  })();
7591
7602
  }
7592
- function vg(e, n) {
7603
+ function yg(e, n) {
7593
7604
  var r = this;
7594
7605
  return t(function* () {
7595
7606
  let t = "", i = "", a, o = b($, r).videoTrack() === void 0;
@@ -7614,11 +7625,11 @@ function vg(e, n) {
7614
7625
  drmTransition: a !== void 0 && a !== ne
7615
7626
  };
7616
7627
  t = s, i = c, a = ne;
7617
- let h = p.producerReferenceTime(), ee = b(og, r).get(n.track.namespace) || 0;
7628
+ let h = p.producerReferenceTime(), ee = b(sg, r).get(n.track.namespace) || 0;
7618
7629
  if (h && Date.now() - ee > 1e3) {
7619
- b(og, r).set(n.track.namespace, Date.now());
7630
+ b(sg, r).set(n.track.namespace, Date.now());
7620
7631
  let t = e.wallclock() - h.getTime();
7621
- b(Qh, r).debug("timing-info", {
7632
+ b($h, r).debug("timing-info", {
7622
7633
  mediaType: p.mediaType(),
7623
7634
  referenceClock: e,
7624
7635
  delta: t,
@@ -7642,7 +7653,7 @@ function vg(e, n) {
7642
7653
  codec: l,
7643
7654
  codecString: u,
7644
7655
  switchInfo: m,
7645
- renditionId: yg(n.track.trackObject.name)
7656
+ renditionId: bg(n.track.trackObject.name)
7646
7657
  });
7647
7658
  }
7648
7659
  }
@@ -7668,52 +7679,52 @@ function vg(e, n) {
7668
7679
  }
7669
7680
  })();
7670
7681
  }
7671
- function yg(e) {
7682
+ function bg(e) {
7672
7683
  return e.split("").reduce((e, t) => e = t.charCodeAt(0) + (e << 6) + (e << 16) - e, 0);
7673
7684
  }
7674
- var bg = /* @__PURE__ */ new WeakMap(), xg = /* @__PURE__ */ new WeakMap(), Sg = /* @__PURE__ */ new WeakSet(), Cg = class {
7685
+ var xg = /* @__PURE__ */ new WeakMap(), Sg = /* @__PURE__ */ new WeakMap(), Cg = /* @__PURE__ */ new WeakSet(), wg = class {
7675
7686
  constructor(e) {
7676
- S(this, Sg), v(this, bg, void 0), v(this, xg, void 0), x(bg, this, e), x(xg, this, y(Sg, this, wg).call(this));
7687
+ S(this, Cg), v(this, xg, void 0), v(this, Sg, void 0), x(xg, this, e), x(Sg, this, y(Cg, this, Tg).call(this));
7677
7688
  }
7678
7689
  catalog() {
7679
- return b(bg, this).current();
7690
+ return b(xg, this).current();
7680
7691
  }
7681
7692
  namespace() {
7682
- return b(bg, this).current().namespace;
7693
+ return b(xg, this).current().namespace;
7683
7694
  }
7684
7695
  updateCatalog(e) {
7685
- x(bg, this, e);
7696
+ x(xg, this, e);
7686
7697
  }
7687
7698
  getTextTrack(e) {
7688
- return b(bg, this).current().tracks.find((t) => t.label === e);
7699
+ return b(xg, this).current().tracks.find((t) => t.label === e);
7689
7700
  }
7690
7701
  getAudioTrack(e) {
7691
7702
  if (!e.codec) return;
7692
- let t = b(xg, this).filter((t) => !(!_n(t) || t.bitRate > e.bitRate || e.codec && t.codec !== e.codec || e.language && t.language !== e.language));
7703
+ let t = b(Sg, this).filter((t) => !(!_n(t) || t.bitRate > e.bitRate || e.codec && t.codec !== e.codec || e.language && t.language !== e.language));
7693
7704
  return t[t.length - 1];
7694
7705
  }
7695
7706
  getVideoTrack(e) {
7696
7707
  if (!e.codec) return;
7697
- let t = b(xg, this).filter((t) => !(!gn(t) || t.bitRate > e.bitRate || e.codec && t.codec !== e.codec));
7708
+ let t = b(Sg, this).filter((t) => !(!gn(t) || t.bitRate > e.bitRate || e.codec && t.codec !== e.codec));
7698
7709
  return t[t.length - 1];
7699
7710
  }
7700
7711
  renditions() {
7701
- return b(xg, this);
7712
+ return b(Sg, this);
7702
7713
  }
7703
7714
  };
7704
- function wg() {
7705
- let [e, t] = b(bg, this).value();
7715
+ function Tg() {
7716
+ let [e, t] = b(xg, this).value();
7706
7717
  return ue(e);
7707
7718
  }
7708
7719
  //#endregion
7709
7720
  //#region ../../libs/web-sdk/src/resolveEdgeUrl.ts
7710
- var Tg = (e, t) => {
7721
+ var Eg = (e, t) => {
7711
7722
  var n, r;
7712
7723
  let i = new URL("/subscribe", e);
7713
7724
  return i.searchParams.append("channelId", t.channelId), i.searchParams.append("sessionId", t.sessionId), i.searchParams.append("clientId", t.clientId), (n = t.audio) != null && n.codec && (i.searchParams.append("audio.bitRate", Math.round(t.audio.bitRate).toString()), i.searchParams.append("audio.codec", t.audio.codec), t.audio.language && i.searchParams.append("audio.language", t.audio.language)), (r = t.video) != null && r.codec && (i.searchParams.append("video.width", t.video.width.toString()), i.searchParams.append("video.height", t.video.height.toString()), i.searchParams.append("video.bitRate", Math.round(t.video.bitRate).toString()), i.searchParams.append("video.codec", t.video.codec)), t.expectAdditionalConnection && i.searchParams.append("expectAdditionalConnection", t.expectAdditionalConnection.toString()), t.burstMs && i.searchParams.append("burstMs", t.burstMs.toString()), t.channelGroupId && i.searchParams.append("channelGroupId", t.channelGroupId), t.authToken && (i.searchParams.append("auth.token", t.authToken), i.searchParams.append("auth.type", "jwt")), i.toString();
7714
- }, Eg = /* @__PURE__ */ function(e) {
7725
+ }, Dg = /* @__PURE__ */ function(e) {
7715
7726
  return e[e.AuthenticationFailed = 4e3] = "AuthenticationFailed", e[e.AuthenticationRefreshFailed = 4001] = "AuthenticationRefreshFailed", e[e.AuthenticationExpired = 4002] = "AuthenticationExpired", e[e.ChannelNotFound = 4003] = "ChannelNotFound", e[e.Inactivity = 4010] = "Inactivity", e;
7716
- }({}), Dg = class extends _e {
7727
+ }({}), Og = class extends _e {
7717
7728
  constructor(n, r) {
7718
7729
  var i;
7719
7730
  super(), i = this, e(this, "options", void 0), e(this, "websockets", []), e(this, "logger", void 0), e(this, "reconnectState", { reconnectRetries: 0 }), e(this, "isSuspended", !1), e(this, "_connectionAttemptCount", 0), e(this, "connectStartTime", 0), e(this, "_connectTime", void 0), e(this, "shouldContinueConnecting", !1), e(this, "_isConnectInProgress", !1), e(this, "readyState", () => {
@@ -7755,19 +7766,19 @@ var Tg = (e, t) => {
7755
7766
  code: e.code,
7756
7767
  isSuspended: this.isSuspended
7757
7768
  })), this.close("one websocket was closed"), e.code) {
7758
- case Eg.AuthenticationFailed:
7769
+ case Dg.AuthenticationFailed:
7759
7770
  this.emit("error", ne(se()));
7760
7771
  break;
7761
- case Eg.AuthenticationRefreshFailed:
7772
+ case Dg.AuthenticationRefreshFailed:
7762
7773
  this.emit("error", ne(se()));
7763
7774
  break;
7764
- case Eg.AuthenticationExpired:
7775
+ case Dg.AuthenticationExpired:
7765
7776
  this.emit("error", h(se()));
7766
7777
  break;
7767
- case Eg.ChannelNotFound:
7778
+ case Dg.ChannelNotFound:
7768
7779
  this.emit("error", m("internal", se()));
7769
7780
  break;
7770
- case Eg.Inactivity:
7781
+ case Dg.Inactivity:
7771
7782
  this.emit("error", oe("internal", se()));
7772
7783
  break;
7773
7784
  default:
@@ -7816,10 +7827,10 @@ var Tg = (e, t) => {
7816
7827
  get connectTime() {
7817
7828
  return this._connectTime;
7818
7829
  }
7819
- }, Og, kg = 65536 * 8, Ag = .9, jg = 40, Mg = (e) => {
7820
- let t = e || jg;
7821
- return kg * Ag * 1e3 / t;
7822
- }, Ng = class n {
7830
+ }, kg, Ag = 65536 * 8, jg = .9, Mg = 40, Ng = (e) => {
7831
+ let t = e || Mg;
7832
+ return Ag * jg * 1e3 / t;
7833
+ }, Pg = class n {
7823
7834
  constructor(r, i, a, s) {
7824
7835
  var c = this;
7825
7836
  e(this, "emitter", void 0), e(this, "transport", void 0), e(this, "logger", void 0), e(this, "config", void 0), e(this, "rtts", void 0), e(this, "lastPingSentTime", Date.now()), e(this, "isPingInFlight", !1), e(this, "connectCount", 0), e(this, "missedPings", 0), e(this, "contextSwitchesInProgress", /* @__PURE__ */ new Set()), e(this, "contextSwitchesCompleted", /* @__PURE__ */ new Set()), e(this, "buffer", []), e(this, "disconnected", new w()), e(this, "unload", () => {
@@ -7869,7 +7880,7 @@ var Tg = (e, t) => {
7869
7880
  }), e(this, "resolveEdgeUrl", t(function* () {
7870
7881
  let e = c.config.connectInfo, t = yield c.config.onConnectInfo(e), n = c.config.options.getOverride("separateVideoSocketEnabled", t.channelId), r = c.config.options.get("media") === "audio+video", i = 1;
7871
7882
  r && (i = n === !1 ? 1 : 2);
7872
- let a = Tg(c.config.edgeUrl, {
7883
+ let a = Eg(c.config.edgeUrl, {
7873
7884
  video: t.video,
7874
7885
  audio: t.audio,
7875
7886
  burstMs: t.burstMs,
@@ -7902,7 +7913,7 @@ var Tg = (e, t) => {
7902
7913
  }
7903
7914
  }
7904
7915
  }), e(this, "connectWebSocketTransport", () => {
7905
- let e = new Dg({
7916
+ let e = new Og({
7906
7917
  reconnectDelay: 1e3,
7907
7918
  onMessage: this.onMessage,
7908
7919
  reconnectHandler: this.config.reconnectHandler,
@@ -7943,57 +7954,57 @@ var Tg = (e, t) => {
7943
7954
  return this.disconnected.promise;
7944
7955
  }
7945
7956
  };
7946
- Og = Ng, e(Ng, "PING_INTERVAL", 5e3), e(Ng, "MAX_MISSED_PINGS", 4), e(Ng, "TLS_ROUNDTRIPS", 3), e(Ng, "start", (e, t, n, r) => new Promise((i, a) => {
7947
- let o = new Og(e, t, n, r);
7957
+ kg = Pg, e(Pg, "PING_INTERVAL", 5e3), e(Pg, "MAX_MISSED_PINGS", 4), e(Pg, "TLS_ROUNDTRIPS", 3), e(Pg, "start", (e, t, n, r) => new Promise((i, a) => {
7958
+ let o = new kg(e, t, n, r);
7948
7959
  o.transport.once("error", (e) => a(e)), o.transport.once("open", () => i(o));
7949
7960
  }));
7950
7961
  //#endregion
7951
7962
  //#region ../../libs/web-sdk/src/EdgeSelector.ts
7952
- var Pg = (e) => {
7963
+ var Fg = (e) => {
7953
7964
  var t;
7954
7965
  return typeof e == "string" ? e : `${e.moqWsUrl}|${(t = e.moqUrl) == null ? "" : t}`;
7955
- }, Fg = /* @__PURE__ */ new WeakMap(), Ig = /* @__PURE__ */ new WeakMap(), Lg = /* @__PURE__ */ new WeakMap(), Rg = /* @__PURE__ */ new WeakMap(), zg = class {
7966
+ }, Ig = /* @__PURE__ */ new WeakMap(), Lg = /* @__PURE__ */ new WeakMap(), Rg = /* @__PURE__ */ new WeakMap(), zg = /* @__PURE__ */ new WeakMap(), Bg = class {
7956
7967
  constructor(e) {
7957
- v(this, Fg, void 0), v(this, Ig, []), v(this, Lg, /* @__PURE__ */ new Set()), v(this, Rg, void 0), x(Fg, this, e);
7968
+ v(this, Ig, void 0), v(this, Lg, []), v(this, Rg, /* @__PURE__ */ new Set()), v(this, zg, void 0), x(Ig, this, e);
7958
7969
  }
7959
7970
  select(e) {
7960
- if (b(Fg, this).edgeUrl) return b(Fg, this).edgeUrl;
7971
+ if (b(Ig, this).edgeUrl) return b(Ig, this).edgeUrl;
7961
7972
  if (e.length > 0) {
7962
- x(Ig, this, [...e]);
7963
- let t = new Set(b(Ig, this).map((e) => Pg(e)));
7964
- for (let e of b(Lg, this)) t.has(e) || b(Lg, this).delete(e);
7973
+ x(Lg, this, [...e]);
7974
+ let t = new Set(b(Lg, this).map((e) => Fg(e)));
7975
+ for (let e of b(Rg, this)) t.has(e) || b(Rg, this).delete(e);
7965
7976
  }
7966
- if (b(Ig, this).length === 0) return;
7967
- let t = b(Ig, this).filter((e) => !b(Lg, this).has(Pg(e)));
7968
- t.length === 0 && (b(Lg, this).clear(), t = b(Ig, this));
7977
+ if (b(Lg, this).length === 0) return;
7978
+ let t = b(Lg, this).filter((e) => !b(Rg, this).has(Fg(e)));
7979
+ t.length === 0 && (b(Rg, this).clear(), t = b(Lg, this));
7969
7980
  let n = t[0];
7970
- if (n) return b(Lg, this).add(Pg(n)), x(Rg, this, n), n;
7981
+ if (n) return b(Rg, this).add(Fg(n)), x(zg, this, n), n;
7971
7982
  }
7972
7983
  shiftedEdge() {
7973
- return b(Rg, this);
7984
+ return b(zg, this);
7974
7985
  }
7975
7986
  reset() {
7976
- x(Rg, this, void 0), x(Ig, this, []), b(Lg, this).clear();
7987
+ x(zg, this, void 0), x(Lg, this, []), b(Rg, this).clear();
7977
7988
  }
7978
- }, Bg, Vg = /* @__PURE__ */ new WeakMap(), Hg = /* @__PURE__ */ new WeakMap(), Ug = /* @__PURE__ */ new WeakMap(), Wg = /* @__PURE__ */ new WeakMap(), Gg = /* @__PURE__ */ new WeakMap(), Kg = /* @__PURE__ */ new WeakMap(), qg = /* @__PURE__ */ new WeakMap(), Jg = /* @__PURE__ */ new WeakMap(), Yg = /* @__PURE__ */ new WeakMap(), Xg = /* @__PURE__ */ new WeakMap(), Zg = /* @__PURE__ */ new WeakMap(), Qg = /* @__PURE__ */ new WeakMap(), $g = /* @__PURE__ */ new WeakSet(), e_ = /* @__PURE__ */ new WeakMap(), t_ = /* @__PURE__ */ new WeakMap(), n_ = class n {
7989
+ }, Vg, Hg = /* @__PURE__ */ new WeakMap(), Ug = /* @__PURE__ */ new WeakMap(), Wg = /* @__PURE__ */ new WeakMap(), Gg = /* @__PURE__ */ new WeakMap(), Kg = /* @__PURE__ */ new WeakMap(), qg = /* @__PURE__ */ new WeakMap(), Jg = /* @__PURE__ */ new WeakMap(), Yg = /* @__PURE__ */ new WeakMap(), Xg = /* @__PURE__ */ new WeakMap(), Zg = /* @__PURE__ */ new WeakMap(), Qg = /* @__PURE__ */ new WeakMap(), $g = /* @__PURE__ */ new WeakMap(), e_ = /* @__PURE__ */ new WeakSet(), t_ = /* @__PURE__ */ new WeakMap(), n_ = /* @__PURE__ */ new WeakMap(), r_ = class n {
7979
7990
  constructor(r, i, a) {
7980
7991
  var o = this;
7981
- S(this, $g), e(this, "emitter", void 0), e(this, "logger", void 0), e(this, "config", void 0), e(this, "apiClient", void 0), e(this, "connectionImpl", void 0), v(this, Vg, new _(10)), v(this, Hg, !0), v(this, Ug, void 0), v(this, Wg, 0), v(this, Gg, 0), v(this, Kg, 0), v(this, qg, void 0), v(this, Jg, void 0), v(this, Yg, void 0), v(this, Xg, void 0), e(this, "unload", () => {
7992
+ S(this, e_), e(this, "emitter", void 0), e(this, "logger", void 0), e(this, "config", void 0), e(this, "apiClient", void 0), e(this, "connectionImpl", void 0), v(this, Hg, new _(10)), v(this, Ug, !0), v(this, Wg, void 0), v(this, Gg, 0), v(this, Kg, 0), v(this, qg, 0), v(this, Jg, void 0), v(this, Yg, void 0), v(this, Xg, void 0), v(this, Zg, void 0), e(this, "unload", () => {
7982
7993
  var e;
7983
- this.logger.debug("Unloading module..."), this.disconnect("Unloading"), (e = this.connectionImpl) == null || e.unload(), x(Yg, this, void 0), this.logger.debug("Unloaded module");
7994
+ this.logger.debug("Unloading module..."), this.disconnect("Unloading"), (e = this.connectionImpl) == null || e.unload(), x(Xg, this, void 0), this.logger.debug("Unloaded module");
7984
7995
  }), e(this, "suspend", () => {
7985
7996
  var e;
7986
- x(Hg, this, !1), (e = this.connectionImpl) == null || e.suspend();
7997
+ x(Ug, this, !1), (e = this.connectionImpl) == null || e.suspend();
7987
7998
  }), e(this, "unsuspend", () => {
7988
7999
  var e;
7989
- x(Hg, this, !0), (e = this.connectionImpl) == null || e.unsuspend(), this.connect();
8000
+ x(Ug, this, !0), (e = this.connectionImpl) == null || e.unsuspend(), this.connect();
7990
8001
  }), e(this, "getState", () => this.connectionImpl ? this.connectionImpl.getState() : "disconnected"), e(this, "getStatistics", () => {
7991
- let e = b(Gg, this) > 0 ? b(Kg, this) / b(Gg, this) : 0;
8002
+ let e = b(Kg, this) > 0 ? b(qg, this) / b(Kg, this) : 0;
7992
8003
  return this.connectionImpl ? C(C({}, this.connectionImpl.getStatistics()), {}, {
7993
- rtt: jt(b(Vg, this).items()),
8004
+ rtt: jt(b(Hg, this).items()),
7994
8005
  estimatedBandwidth: this.estimatedBandwidth,
7995
- connectCount: b(Kg, this),
7996
- connectionAttemptCount: b(Gg, this),
8006
+ connectCount: b(qg, this),
8007
+ connectionAttemptCount: b(Kg, this),
7997
8008
  connectionSuccessRatio: e
7998
8009
  }) : {
7999
8010
  rtt: {
@@ -8003,20 +8014,20 @@ var Pg = (e) => {
8003
8014
  last: 0
8004
8015
  },
8005
8016
  estimatedBandwidth: 0,
8006
- connectCount: b(Kg, this),
8007
- connectionAttemptCount: b(Gg, this),
8017
+ connectCount: b(qg, this),
8018
+ connectionAttemptCount: b(Kg, this),
8008
8019
  connectionSuccessRatio: e,
8009
8020
  connectionProtocol: void 0,
8010
8021
  transportSelectionReason: void 0
8011
8022
  };
8012
8023
  }), e(this, "connect", () => {
8013
- x(Hg, this, !0), !b(Ug, this) && x(Ug, this, y($g, this, r_).call(this));
8024
+ x(Ug, this, !0), !b(Wg, this) && x(Wg, this, y(e_, this, i_).call(this));
8014
8025
  }), e(this, "disconnect", (e = "Disconnect Requested") => {
8015
8026
  var t;
8016
- x(Hg, this, !1), b(t_, this).call(this), (t = this.connectionImpl) == null || t.close(e);
8027
+ x(Ug, this, !1), b(n_, this).call(this), (t = this.connectionImpl) == null || t.close(e);
8017
8028
  }), e(this, "reconnect", (e) => {
8018
8029
  this.disconnect(e), this.connect();
8019
- }), v(this, Zg, t(function* () {
8030
+ }), v(this, Qg, t(function* () {
8020
8031
  try {
8021
8032
  return yield o.apiClient.connect(o.config.options.getOptions());
8022
8033
  } catch (e) {
@@ -8027,7 +8038,7 @@ var Pg = (e) => {
8027
8038
  }
8028
8039
  throw o.emitter.emit("error", te(e instanceof Error ? e : void 0)), e;
8029
8040
  }
8030
- })), v(this, Qg, t(function* () {
8041
+ })), v(this, $g, t(function* () {
8031
8042
  let e = Date.now(), t = () => Date.now() - e, r = globalThis.AbortController ? new AbortController() : void 0, i = setTimeout(() => r == null ? void 0 : r.abort(), n.PING_TIMEOUT);
8032
8043
  try {
8033
8044
  return yield fetch(new URL("/api/v4/connect/ping", o.config.options.get("url")).toString(), {
@@ -8039,56 +8050,56 @@ var Pg = (e) => {
8039
8050
  } finally {
8040
8051
  clearTimeout(i);
8041
8052
  }
8042
- })), v(this, e_, () => {
8043
- b(t_, this).call(this), x(Xg, this, setTimeout(() => {
8053
+ })), v(this, t_, () => {
8054
+ b(n_, this).call(this), x(Zg, this, setTimeout(() => {
8044
8055
  var e;
8045
- !b(Yg, this) || ((e = this.connectionImpl) == null ? void 0 : e.getState()) !== "connected" || (this.logger.debug("Connection remained stable for long enough, clearing cached fallback edges"), b(Yg, this).reset(), x(Xg, this, void 0));
8056
+ !b(Xg, this) || ((e = this.connectionImpl) == null ? void 0 : e.getState()) !== "connected" || (this.logger.debug("Connection remained stable for long enough, clearing cached fallback edges"), b(Xg, this).reset(), x(Zg, this, void 0));
8046
8057
  }, n.EDGE_SELECTOR_RESET_TIMEOUT));
8047
- }), v(this, t_, () => {
8048
- b(Xg, this) !== void 0 && (clearTimeout(b(Xg, this)), x(Xg, this, void 0));
8058
+ }), v(this, n_, () => {
8059
+ b(Zg, this) !== void 0 && (clearTimeout(b(Zg, this)), x(Zg, this, void 0));
8049
8060
  }), this.logger = i, this.emitter = r, this.config = a, this.apiClient = new ge({
8050
8061
  publicEndpoint: this.config.options.get("url").toString(),
8051
8062
  tokenFactory: () => this.config.options.get("authenticationToken")
8052
8063
  });
8053
8064
  }
8054
8065
  get rtt() {
8055
- return b(Vg, this).items().length > 0 ? Ot(b(Vg, this).items()) : 0;
8066
+ return b(Hg, this).items().length > 0 ? Ot(b(Hg, this).items()) : 0;
8056
8067
  }
8057
8068
  get estimatedBandwidth() {
8058
- return this.connectionImpl && "estimatedBandwidth" in this.connectionImpl && this.connectionImpl.estimatedBandwidth ? this.connectionImpl.estimatedBandwidth : Mg(this.rtt);
8069
+ return this.connectionImpl && "estimatedBandwidth" in this.connectionImpl && this.connectionImpl.estimatedBandwidth ? this.connectionImpl.estimatedBandwidth : Ng(this.rtt);
8059
8070
  }
8060
8071
  get firstConnectionTime() {
8061
- return b(qg, this);
8072
+ return b(Jg, this);
8062
8073
  }
8063
8074
  get lastConnectionTime() {
8064
- return b(Jg, this);
8075
+ return b(Yg, this);
8065
8076
  }
8066
8077
  };
8067
- Bg = n_;
8068
- function r_() {
8078
+ Vg = r_;
8079
+ function i_() {
8069
8080
  var e = this;
8070
8081
  return t(function* () {
8071
- let t = new zg({ edgeUrl: e.config.options.get("edgeUrl") });
8072
- for (x(Yg, e, t), b(t_, e).call(e), x(Wg, e, 0);;) {
8082
+ let t = new Bg({ edgeUrl: e.config.options.get("edgeUrl") });
8083
+ for (x(Xg, e, t), b(n_, e).call(e), x(Gg, e, 0);;) {
8073
8084
  var n, r, i;
8074
- x(Wg, e, (n = b(Wg, e), n++, n)), x(Gg, e, (r = b(Gg, e), r++, r));
8085
+ x(Gg, e, (n = b(Gg, e), n++, n)), x(Kg, e, (r = b(Kg, e), r++, r));
8075
8086
  let o = !1;
8076
8087
  try {
8077
8088
  var a;
8078
- let [n, r] = yield Promise.all([b(Zg, e).call(e), b(Qg, e).call(e)]);
8079
- if (b(Vg, e).clear(), r !== void 0 && b(Vg, e).push(r / 2), !b(Hg, e)) break;
8089
+ let [n, r] = yield Promise.all([b(Qg, e).call(e), b($g, e).call(e)]);
8090
+ if (b(Hg, e).clear(), r !== void 0 && b(Hg, e).push(r / 2), !b(Ug, e)) break;
8080
8091
  let i = t.select(n.edges);
8081
8092
  if (!i) throw new g("Failed to resolve edge url", {
8082
8093
  isFatal: !0,
8083
8094
  code: "failed_to_resolve_edge_url"
8084
8095
  });
8085
- ce(n) ? e.connectionImpl = yield dg.start(e.emitter, e.logger, e.apiClient, C(C({}, e.config), {}, {
8096
+ ce(n) ? e.connectionImpl = yield fg.start(e.emitter, e.logger, e.apiClient, C(C({}, e.config), {}, {
8086
8097
  connectInfo: n,
8087
8098
  edgeUrl: i
8088
- }), b(Vg, e)) : (de(typeof i == "string", "Edge URL is expected to be a string"), e.connectionImpl = yield Ng.start(e.emitter, e.logger, C(C({}, e.config), {}, {
8099
+ }), b(Hg, e)) : (de(typeof i == "string", "Edge URL is expected to be a string"), e.connectionImpl = yield Pg.start(e.emitter, e.logger, C(C({}, e.config), {}, {
8089
8100
  connectInfo: n,
8090
8101
  edgeUrl: i
8091
- }), b(Vg, e))), b(e_, e).call(e), x(Kg, e, (a = b(Kg, e), a++, a)), x(Wg, e, 0), x(Jg, e, Date.now()), b(qg, e) || x(qg, e, b(Jg, e)), yield e.connectionImpl.closed(), e.logger.info("Connection closed");
8102
+ }), b(Hg, e))), b(t_, e).call(e), x(qg, e, (a = b(qg, e), a++, a)), x(Gg, e, 0), x(Yg, e, Date.now()), b(Jg, e) || x(Jg, e, b(Yg, e)), yield e.connectionImpl.closed(), e.logger.info("Connection closed");
8092
8103
  } catch (n) {
8093
8104
  e.logger.warn("Failed to connect", n);
8094
8105
  let r = t.shiftedEdge();
@@ -8100,31 +8111,31 @@ function r_() {
8100
8111
  isFatal: !1
8101
8112
  }));
8102
8113
  }
8103
- if ((i = e.connectionImpl) == null || i.unload(), e.connectionImpl = void 0, b(t_, e).call(e), o) {
8104
- x(Hg, e, !1);
8114
+ if ((i = e.connectionImpl) == null || i.unload(), e.connectionImpl = void 0, b(n_, e).call(e), o) {
8115
+ x(Ug, e, !1);
8105
8116
  break;
8106
8117
  }
8107
- if (!b(Hg, e)) break;
8108
- if (!(yield e.config.reconnectHandler({ reconnectRetries: b(Wg, e) }))) {
8118
+ if (!b(Ug, e)) break;
8119
+ if (!(yield e.config.reconnectHandler({ reconnectRetries: b(Gg, e) }))) {
8109
8120
  e.emitter.emit("error", s());
8110
8121
  break;
8111
8122
  }
8112
- if (yield mn(1e3), !b(Hg, e)) break;
8123
+ if (yield mn(1e3), !b(Ug, e)) break;
8113
8124
  }
8114
- x(Yg, e, void 0), b(t_, e).call(e), x(Ug, e, void 0);
8125
+ x(Xg, e, void 0), b(n_, e).call(e), x(Wg, e, void 0);
8115
8126
  })();
8116
8127
  }
8117
- e(n_, "PING_TIMEOUT", 1e3), e(n_, "EDGE_SELECTOR_RESET_TIMEOUT", 60 * 1e3), e(n_, "create", (e, t, n) => new Bg(e, t, n));
8128
+ e(r_, "PING_TIMEOUT", 1e3), e(r_, "EDGE_SELECTOR_RESET_TIMEOUT", 60 * 1e3), e(r_, "create", (e, t, n) => new Vg(e, t, n));
8118
8129
  //#endregion
8119
8130
  //#region ../../libs/web-sdk/src/modules/ConstraintCapModule.ts
8120
- var i_, a_ = () => ({
8131
+ var a_, o_ = () => ({
8121
8132
  video: C(C({}, bn()), {}, { bitRate: yn() }),
8122
8133
  audio: { bitRate: yn() }
8123
- }), o_ = () => ({
8134
+ }), s_ = () => ({
8124
8135
  width: window.innerWidth,
8125
8136
  height: window.innerHeight,
8126
8137
  bitRate: yn()
8127
- }), s_ = class t {
8138
+ }), c_ = class t {
8128
8139
  constructor(n, r, i, a) {
8129
8140
  e(this, "emitter", void 0), e(this, "timers", new j()), e(this, "pictureInPictureSource", void 0), e(this, "element", void 0), e(this, "currentCap", void 0), e(this, "userSpecifiedCap", void 0), e(this, "renditionLevelSource", void 0), e(this, "resizeObserver", void 0), e(this, "elementSize", void 0), e(this, "_sizeBasedResolutionCapEnabled", void 0), e(this, "unload", () => {
8130
8141
  var e;
@@ -8146,7 +8157,7 @@ var i_, a_ = () => ({
8146
8157
  this.timers.unload();
8147
8158
  }), e(this, "setUserSpecifiedCap", (e) => {
8148
8159
  var t;
8149
- let n = (t = this.getUserSpecifiedCap()) == null ? a_() : t;
8160
+ let n = (t = this.getUserSpecifiedCap()) == null ? o_() : t;
8150
8161
  this.userSpecifiedCap = C(C({}, n), {}, {
8151
8162
  video: C(C({}, n.video), e.video),
8152
8163
  audio: C(C({}, n.audio), e.audio)
@@ -8170,7 +8181,7 @@ var i_, a_ = () => ({
8170
8181
  });
8171
8182
  }), e(this, "evaluateConstraintCap", () => {
8172
8183
  var e, t, n, r;
8173
- let i = this.sizeBasedResolutionCapEnabled ? C(C({}, a_()), {}, { video: o_() }) : a_();
8184
+ let i = this.sizeBasedResolutionCapEnabled ? C(C({}, o_()), {}, { video: s_() }) : o_();
8174
8185
  if (!this.resizeObserver) {
8175
8186
  let e = this.element.getBoundingClientRect();
8176
8187
  this.elementSize = {
@@ -8207,14 +8218,14 @@ var i_, a_ = () => ({
8207
8218
  this._sizeBasedResolutionCapEnabled = e, this.evaluateConstraintCap();
8208
8219
  }
8209
8220
  };
8210
- i_ = s_, e(s_, "CHECK_SIZE_INTERVAL", 1e3), e(s_, "create", (e, t, n, r) => new i_(e, t, n, r));
8221
+ a_ = c_, e(c_, "CHECK_SIZE_INTERVAL", 1e3), e(c_, "create", (e, t, n, r) => new a_(e, t, n, r));
8211
8222
  //#endregion
8212
8223
  //#region ../../libs/web-sdk/src/modules/DecoderModule.ts
8213
- var c_ = 5, l_ = 100, u_ = 1e3, d_ = class r {
8224
+ var l_ = 5, u_ = 100, d_ = 1e3, f_ = class r {
8214
8225
  constructor(t, n, r, i, a = !1, o = !1, s = !1) {
8215
8226
  e(this, "timers", j.create()), e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "trackContexts", void 0), e(this, "playbackSource", void 0), e(this, "isSuspended", !1), e(this, "_webCodecsInUse", void 0), e(this, "_audioWebCodecsInUse", void 0), e(this, "_offscreenCanvasInUse", void 0), e(this, "currentVideoDecodeRate", 2), e(this, "decodeRateGraceIntervals", 3), e(this, "isAudioEmitRetryScheduled", !1), e(this, "videoKeyframeTimestamps", []), e(this, "load", () => {
8216
- let e = this._audioWebCodecsInUse ? 20 : l_;
8217
- this.timers.setInterval(this.emitDecodedFrames, e), this.timers.setInterval(this.emitDecodeRate, u_), this.emitter.on("init segment", this.onInitSegment), this.emitter.on("coded sample", this.decode);
8227
+ let e = this._audioWebCodecsInUse ? 20 : u_;
8228
+ this.timers.setInterval(this.emitDecodedFrames, e), this.timers.setInterval(this.emitDecodeRate, d_), this.emitter.on("init segment", this.onInitSegment), this.emitter.on("coded sample", this.decode);
8218
8229
  }), e(this, "unload", () => {
8219
8230
  this.trackContexts.forEach(({ decoderContext: e }) => e.unload()), this.timers.unload(), this.isAudioEmitRetryScheduled = !1, this.videoKeyframeTimestamps = [], this.emitter.off("init segment", this.onInitSegment), this.emitter.off("coded sample", this.decode);
8220
8231
  }), e(this, "suspend", () => {
@@ -8271,7 +8282,7 @@ var c_ = 5, l_ = 100, u_ = 1e3, d_ = class r {
8271
8282
  if (this.isSuspended) return;
8272
8283
  t.sampleDuration = e.duration / e.timescale * 1e3;
8273
8284
  let n = e.compositionTimeOffset || 0, { decoderContext: r, buffer: i } = t, a = (e.timestamp + n) / e.timescale * 1e3, o = e.duration / e.timescale * 1e3, s = i[i.length - 1];
8274
- if (!s || a - c_ > s.end ? i.push({
8285
+ if (!s || a - l_ > s.end ? i.push({
8275
8286
  start: a,
8276
8287
  end: a + o
8277
8288
  }) : a + o * 5 < s.end ? (t.buffer = [{
@@ -8391,7 +8402,7 @@ var c_ = 5, l_ = 100, u_ = 1e3, d_ = class r {
8391
8402
  return new r(e, i, t, s, p, m, h);
8392
8403
  })();
8393
8404
  }
8394
- }, f_, p_ = class {
8405
+ }, p_, m_ = class {
8395
8406
  constructor(t) {
8396
8407
  e(this, "emitter", void 0), e(this, "isVisibleCount", 0), e(this, "isHiddenCount", 0), e(this, "isOnlineCount", 0), e(this, "isOfflineCount", 0), e(this, "isActive", document.visibilityState === "visible"), e(this, "unload", () => {
8397
8408
  document.removeEventListener("visibilitychange", this.onVisibilityChanged), window.removeEventListener("pagehide", this.onPageHide), window.removeEventListener("online", this.onOnline), window.removeEventListener("offline", this.onOffline);
@@ -8425,12 +8436,12 @@ var c_ = 5, l_ = 100, u_ = 1e3, d_ = class r {
8425
8436
  return document.visibilityState === "visible";
8426
8437
  }
8427
8438
  };
8428
- f_ = p_, e(p_, "create", (e) => new f_(e));
8439
+ p_ = m_, e(m_, "create", (e) => new p_(e));
8429
8440
  //#endregion
8430
8441
  //#region ../../libs/web-sdk/src/modules/EventModule.ts
8431
- var m_, h_ = (e) => (t, n, r) => t.timestamp <= n || t.timestampAdded <= r - e, g_ = class t {
8442
+ var h_, g_ = (e) => (t, n, r) => t.timestamp <= n || t.timestampAdded <= r - e, __ = class t {
8432
8443
  constructor(n, r, i) {
8433
- e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "waitingEvents", []), e(this, "isTriggered", h_(t.EVENT_TIMEOUT)), e(this, "timeSource", void 0), e(this, "timers", new j()), e(this, "load", () => {
8444
+ e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "waitingEvents", []), e(this, "isTriggered", g_(t.EVENT_TIMEOUT)), e(this, "timeSource", void 0), e(this, "timers", new j()), e(this, "load", () => {
8434
8445
  this.timers.setInterval(this.onBufferedStateChanged, t.EVENT_CHECK_INTERVAL), this.emitter.on("add event", this.addEvent);
8435
8446
  }), e(this, "unload", () => {
8436
8447
  this.timers.unload(), this.emitter.off("add event", this.addEvent);
@@ -8457,10 +8468,10 @@ var m_, h_ = (e) => (t, n, r) => t.timestamp <= n || t.timestampAdded <= r - e,
8457
8468
  }), this.logger = r, this.emitter = n, this.timeSource = i;
8458
8469
  }
8459
8470
  };
8460
- m_ = g_, e(g_, "EVENT_TIMEOUT", 5e3), e(g_, "EVENT_CHECK_INTERVAL", 20), e(g_, "create", (e, t, n) => new m_(e, t, n));
8471
+ h_ = __, e(__, "EVENT_TIMEOUT", 5e3), e(__, "EVENT_CHECK_INTERVAL", 20), e(__, "create", (e, t, n) => new h_(e, t, n));
8461
8472
  //#endregion
8462
8473
  //#region ../../libs/web-sdk/src/modules/IncomingDataModule.ts
8463
- var __, v_ = class t {
8474
+ var v_, y_ = class t {
8464
8475
  constructor(n) {
8465
8476
  e(this, "emitter", void 0), e(this, "timers", j.create()), e(this, "bytesReceived", /* @__PURE__ */ new Map()), e(this, "timeoutInterval", void 0), e(this, "lastBytesUpdated", Date.now()), e(this, "load", () => {
8466
8477
  this.emitter.on("connection state", this.onConnectionState), this.timers.setInterval(() => this.bytesReceived.forEach((e) => e.tick()), 100);
@@ -8495,10 +8506,10 @@ var __, v_ = class t {
8495
8506
  }), this.emitter = n;
8496
8507
  }
8497
8508
  };
8498
- __ = v_, e(v_, "NO_DATA_ERROR_TIMEOUT", 20 * 1e3), e(v_, "NO_DATA_TIMEOUT", 5 * 1e3), e(v_, "UPDATE_RECEIVED_BYTES_INTERVAL", 1e3), e(v_, "create", (e) => new __(e));
8509
+ v_ = y_, e(y_, "NO_DATA_ERROR_TIMEOUT", 20 * 1e3), e(y_, "NO_DATA_TIMEOUT", 5 * 1e3), e(y_, "UPDATE_RECEIVED_BYTES_INTERVAL", 1e3), e(y_, "create", (e) => new v_(e));
8499
8510
  //#endregion
8500
8511
  //#region ../../libs/web-sdk/src/modules/JitterModule.ts
8501
- var y_ = 1e3, b_ = 50, x_ = class t {
8512
+ var b_ = 1e3, x_ = 50, S_ = class t {
8502
8513
  constructor(t) {
8503
8514
  e(this, "logger", void 0), e(this, "trackingState", /* @__PURE__ */ new Map()), e(this, "runningJitter", /* @__PURE__ */ new Map()), e(this, "recentJitterSamples", /* @__PURE__ */ new Map()), e(this, "load", () => {
8504
8515
  this.logger.debug("JitterModule loaded");
@@ -8519,9 +8530,9 @@ var y_ = 1e3, b_ = 50, x_ = class t {
8519
8530
  this.trackingState.set(a, {
8520
8531
  lastArrivalTime: o,
8521
8532
  lastTimestampMs: s,
8522
- jitterSamples: new _(y_),
8523
- interArrivalTimes: new _(y_)
8524
- }), this.runningJitter.set(a, 0), this.recentJitterSamples.set(a, new _(b_));
8533
+ jitterSamples: new _(b_),
8534
+ interArrivalTimes: new _(b_)
8535
+ }), this.runningJitter.set(a, 0), this.recentJitterSamples.set(a, new _(x_));
8525
8536
  return;
8526
8537
  }
8527
8538
  let l = s - c.lastTimestampMs;
@@ -8534,7 +8545,7 @@ var y_ = 1e3, b_ = 50, x_ = class t {
8534
8545
  let f = (i = this.runningJitter.get(a)) == null ? 0 : i, p = f + (d - f) / 16;
8535
8546
  this.runningJitter.set(a, p);
8536
8547
  let m = this.recentJitterSamples.get(a);
8537
- m || (m = new _(b_), this.recentJitterSamples.set(a, m)), m.push(d), c.lastArrivalTime = o, c.lastTimestampMs = s;
8548
+ m || (m = new _(x_), this.recentJitterSamples.set(a, m)), m.push(d), c.lastArrivalTime = o, c.lastTimestampMs = s;
8538
8549
  }
8539
8550
  getJitterForType(e) {
8540
8551
  for (let [i, a] of this.trackingState) if (i.startsWith(e)) {
@@ -8565,10 +8576,10 @@ var y_ = 1e3, b_ = 50, x_ = class t {
8565
8576
  videoJitter: this.getJitterForType("video")
8566
8577
  };
8567
8578
  }
8568
- }, S_ = () => window.AudioContext || window.webkitAudioContext, C_ = class n extends _e {
8579
+ }, C_ = () => window.AudioContext || window.webkitAudioContext, w_ = class n extends _e {
8569
8580
  constructor() {
8570
8581
  var r;
8571
- super(), r = this, e(this, "context", new (S_())()), e(this, "timers", j.create()), e(this, "previousCurrentTime", 0), e(this, "_isStuck", !1), e(this, "mediaStreamDestination", void 0), e(this, "unload", () => (this.timers.unload(), this.context.removeEventListener("statechange", this.onStateChange), this.context.state === "closed" ? Promise.resolve() : this.context.close())), e(this, "createGain", () => this.context.createGain()), e(this, "createBuffer", (e, t, n) => this.context.createBuffer(e, t, n)), e(this, "createBufferSource", () => this.context.createBufferSource()), e(this, "getMediaStreamDestination", () => (this.mediaStreamDestination || (this.mediaStreamDestination = this.context.createMediaStreamDestination()), this.mediaStreamDestination)), e(this, "getDefaultDestination", () => this.context.destination), e(this, "createSplitter", () => this.context.createChannelSplitter(2)), e(this, "resume", t(function* () {
8582
+ super(), r = this, e(this, "context", new (C_())()), e(this, "timers", j.create()), e(this, "previousCurrentTime", 0), e(this, "_isStuck", !1), e(this, "mediaStreamDestination", void 0), e(this, "unload", () => (this.timers.unload(), this.context.removeEventListener("statechange", this.onStateChange), this.context.state === "closed" ? Promise.resolve() : this.context.close())), e(this, "createGain", () => this.context.createGain()), e(this, "createBuffer", (e, t, n) => this.context.createBuffer(e, t, n)), e(this, "createBufferSource", () => this.context.createBufferSource()), e(this, "getMediaStreamDestination", () => (this.mediaStreamDestination || (this.mediaStreamDestination = this.context.createMediaStreamDestination()), this.mediaStreamDestination)), e(this, "getDefaultDestination", () => this.context.destination), e(this, "createSplitter", () => this.context.createChannelSplitter(2)), e(this, "resume", t(function* () {
8572
8583
  try {
8573
8584
  return yield Promise.race([r.context.resume(), hn(1e3, p())]);
8574
8585
  } catch (e) {
@@ -8597,10 +8608,10 @@ var y_ = 1e3, b_ = 50, x_ = class t {
8597
8608
  return this.context.state;
8598
8609
  }
8599
8610
  };
8600
- e(C_, "CHECK_INTERVAL", 1e3);
8611
+ e(w_, "CHECK_INTERVAL", 1e3);
8601
8612
  //#endregion
8602
8613
  //#region ../../libs/web-audio-player/src/AudioPlayer.ts
8603
- var w_, T_ = 150, E_ = 400, D_ = (e) => e === void 0 ? 5 : e <= T_ ? 1 : e <= E_ ? 2 : 5, O_ = class extends _e {
8614
+ var T_, E_ = 150, D_ = 400, O_ = (e) => e === void 0 ? 5 : e <= E_ ? 1 : e <= D_ ? 2 : 5, k_ = class extends _e {
8604
8615
  get isContextRunning() {
8605
8616
  var e;
8606
8617
  return ((e = this.audio) == null ? void 0 : e.state) === "running";
@@ -8641,7 +8652,7 @@ var w_, T_ = 150, E_ = 400, D_ = (e) => e === void 0 ? 5 : e <= T_ ? 1 : e <= E_
8641
8652
  return this._bufferTime;
8642
8653
  }
8643
8654
  set bufferTime(e) {
8644
- this._bufferTime = e, this.audioBufferMultiplier = D_(e);
8655
+ this._bufferTime = e, this.audioBufferMultiplier = O_(e);
8645
8656
  }
8646
8657
  get audioNode() {
8647
8658
  return this.splitter;
@@ -8731,14 +8742,14 @@ var w_, T_ = 150, E_ = 400, D_ = (e) => e === void 0 ? 5 : e <= T_ ? 1 : e <= E_
8731
8742
  }
8732
8743
  })), e(this, "getAudioContext", () => this.audio ? this.audio : this.setupContext()), e(this, "setupContext", () => {
8733
8744
  var e, t, n;
8734
- return (e = this.audio) == null || e.unload(), this.audio = new C_(), this.audio.on("state", (e) => {
8745
+ return (e = this.audio) == null || e.unload(), this.audio = new w_(), this.audio.on("state", (e) => {
8735
8746
  this.logger.info("AudioContext state change", { state: e }), e === "running" && (this._muted = this._userProvidedMuted, this.setGain(this._volume)), !this.ignoreSuspendCalls && this.emit("state change", e);
8736
8747
  }), this.audio.on("stuck", () => {
8737
8748
  this.reInitWhenStuck && (this.logger.info("Re-init audio context"), this.setupContext(), this.resume().catch(o), this.emit("stuck"));
8738
8749
  }), (t = this.gainNode) == null || t.disconnect(), this.gainNode = this.audio.createGain(), this.setGain(this._volume), this.startTime = this.audio.currentTime, (n = this.splitter) == null || n.disconnect(), this.splitter = this.audio.createSplitter(), this.audio;
8739
8750
  }), e(this, "setGain", (e) => {
8740
8751
  this.gainNode && (this.gainNode.gain.value = this._muted ? 0 : e);
8741
- }), this._muted = i, this._userProvidedMuted = i, this.logger = n, this.clockSource = r, this.reInitWhenStuck = a, this._bufferTime = s, this.audioBufferMultiplier = D_(s);
8752
+ }), this._muted = i, this._userProvidedMuted = i, this.logger = n, this.clockSource = r, this.reInitWhenStuck = a, this._bufferTime = s, this.audioBufferMultiplier = O_(s);
8742
8753
  }
8743
8754
  useMediaStreamDestination() {
8744
8755
  var e;
@@ -8751,10 +8762,10 @@ var w_, T_ = 150, E_ = 400, D_ = (e) => e === void 0 ? 5 : e <= T_ ? 1 : e <= E_
8751
8762
  return (e = this.gainNode) == null || e.connect(t), t;
8752
8763
  }
8753
8764
  };
8754
- w_ = O_, e(O_, "create", (e, t, n) => new w_(e, t, n));
8765
+ T_ = k_, e(k_, "create", (e, t, n) => new T_(e, t, n));
8755
8766
  //#endregion
8756
8767
  //#region ../../libs/web-sdk/src/players/VideoPlayer.ts
8757
- var k_, A_ = class {
8768
+ var A_, j_ = class {
8758
8769
  constructor(t, n, r, i, a, o) {
8759
8770
  e(this, "staleFrameThresholdMs", 400), e(this, "pool", void 0), e(this, "logger", void 0), e(this, "videoRenderer", new or()), e(this, "videoFrameCanvas2DRenderer", null), e(this, "renderQueue", []), e(this, "clockSource", void 0), e(this, "isFirstFrame", !0), e(this, "usingWebCodecs", !1), e(this, "onCanvasChangeCallback", void 0), e(this, "onRendererErrorCallback", void 0), e(this, "animationFrameRequest", void 0), e(this, "firstFrameAnimationFrameRequest", void 0), e(this, "pendingFirstFrameSample", void 0), e(this, "renderedFrameCount", 0), e(this, "rendererDroppedFrameCount", 0), e(this, "renderTargetSize", void 0), e(this, "load", () => {
8760
8771
  this.videoRenderer.load(), this.subscribeToContextLost(this.videoRenderer);
@@ -8844,12 +8855,12 @@ var k_, A_ = class {
8844
8855
  }), this.logger = t, this.clockSource = n, this.pool = r, this.renderTargetSize = i || this.videoRenderer.canvas, this.onCanvasChangeCallback = a, this.onRendererErrorCallback = o;
8845
8856
  }
8846
8857
  };
8847
- k_ = A_, e(A_, "create", (e, t, n, r, i, a) => new k_(e, t, n, r, i, a));
8858
+ A_ = j_, e(j_, "create", (e, t, n, r, i, a) => new A_(e, t, n, r, i, a));
8848
8859
  //#endregion
8849
8860
  //#region ../../libs/web-sdk/src/TextTracks.ts
8850
- var j_ = /* @__PURE__ */ new WeakMap(), M_ = class {
8861
+ var M_ = /* @__PURE__ */ new WeakMap(), N_ = class {
8851
8862
  constructor() {
8852
- v(this, j_, []), x(j_, this, []);
8863
+ v(this, M_, []), x(M_, this, []);
8853
8864
  }
8854
8865
  addTextTrack(e, t, n) {
8855
8866
  let r = [], i = {
@@ -8866,37 +8877,37 @@ var j_ = /* @__PURE__ */ new WeakMap(), M_ = class {
8866
8877
  t !== -1 && r.splice(t, 1);
8867
8878
  }
8868
8879
  };
8869
- return b(j_, this).push(i), i;
8880
+ return b(M_, this).push(i), i;
8870
8881
  }
8871
8882
  set language(e) {
8872
- b(j_, this).forEach((t) => {
8883
+ b(M_, this).forEach((t) => {
8873
8884
  t.language === e ? t.mode = "showing" : t.mode = "hidden";
8874
8885
  });
8875
8886
  }
8876
8887
  get language() {
8877
8888
  var e;
8878
- return (e = b(j_, this).find((e) => e.mode === "showing")) == null ? void 0 : e.language;
8889
+ return (e = b(M_, this).find((e) => e.mode === "showing")) == null ? void 0 : e.language;
8879
8890
  }
8880
8891
  getActiveCues(e) {
8881
- let t = b(j_, this).find((e) => e.mode === "showing");
8892
+ let t = b(M_, this).find((e) => e.mode === "showing");
8882
8893
  return t ? t.cues.filter(({ startTime: t, endTime: n }) => e >= t && e <= n) : [];
8883
8894
  }
8884
- }, N_ = (e, t) => {
8895
+ }, P_ = (e, t) => {
8885
8896
  let n;
8886
8897
  for (n = t; e > 1; e--) n += t;
8887
8898
  return n;
8888
- }, P_ = class {
8899
+ }, F_ = class {
8889
8900
  constructor() {
8890
8901
  e(this, "audio", void 0), e(this, "unmute", () => this.audio.play().catch(o));
8891
8902
  let t = document.createElement("div");
8892
8903
  t.innerHTML = "<audio x-webkit-airplay='deny'></audio>";
8893
8904
  let n = t.children.item(0);
8894
- if (n instanceof HTMLAudioElement) this.audio = n, this.audio.controls = !1, this.audio.disableRemotePlayback = !0, this.audio.preload = "auto", this.audio.src = "data:audio/mpeg;base64,//uQx" + N_(23, "A") + "WGluZwAAAA8AAAACAAACcQCA" + N_(16, "gICA") + N_(66, "/") + "8AAABhTEFNRTMuMTAwA8MAAAAAAAAAABQgJAUHQQAB9AAAAnGMHkkI" + N_(320, "A") + "//sQxAADgnABGiAAQBCqgCRMAAgEAH" + N_(15, "/") + "7+n/9FTuQsQH//////2NG0jWUGlio5gLQTOtIoeR2WX////X4s9Atb/JRVCbBUpeRUq" + N_(18, "/") + "9RUi0f2jn/+xDECgPCjAEQAABN4AAANIAAAAQVTEFNRTMuMTAw" + N_(97, "V") + "Q==", this.audio.loop = !1, this.audio.load();
8905
+ if (n instanceof HTMLAudioElement) this.audio = n, this.audio.controls = !1, this.audio.disableRemotePlayback = !0, this.audio.preload = "auto", this.audio.src = "data:audio/mpeg;base64,//uQx" + P_(23, "A") + "WGluZwAAAA8AAAACAAACcQCA" + P_(16, "gICA") + P_(66, "/") + "8AAABhTEFNRTMuMTAwA8MAAAAAAAAAABQgJAUHQQAB9AAAAnGMHkkI" + P_(320, "A") + "//sQxAADgnABGiAAQBCqgCRMAAgEAH" + P_(15, "/") + "7+n/9FTuQsQH//////2NG0jWUGlio5gLQTOtIoeR2WX////X4s9Atb/JRVCbBUpeRUq" + P_(18, "/") + "9RUi0f2jn/+xDECgPCjAEQAABN4AAANIAAAAQVTEFNRTMuMTAw" + P_(97, "V") + "Q==", this.audio.loop = !1, this.audio.load();
8895
8906
  else throw Error("Failed to create audio tag");
8896
8907
  }
8897
- }, F_, I_ = class {
8908
+ }, I_, L_ = class {
8898
8909
  constructor(t, n, r, i, a, o, s, c) {
8899
- e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "audioPlayer", void 0), e(this, "videoPlayer", void 0), e(this, "pool", void 0), e(this, "unmuter", new P_()), e(this, "_isPaused", !1), e(this, "isDisconnected", !1), e(this, "timers", new j()), e(this, "isVideoRenderingEnabled", !0), e(this, "isLoaded", !1), e(this, "isSuspended", !0), e(this, "isVideoPlayerLoaded", !1), e(this, "textTracks", new M_()), e(this, "playbackRate", void 0), e(this, "reset", () => {}), e(this, "load", () => {
8910
+ e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "audioPlayer", void 0), e(this, "videoPlayer", void 0), e(this, "pool", void 0), e(this, "unmuter", new F_()), e(this, "_isPaused", !1), e(this, "isDisconnected", !1), e(this, "timers", new j()), e(this, "isVideoRenderingEnabled", !0), e(this, "isLoaded", !1), e(this, "isSuspended", !0), e(this, "isVideoPlayerLoaded", !1), e(this, "textTracks", new N_()), e(this, "playbackRate", void 0), e(this, "reset", () => {}), e(this, "load", () => {
8900
8911
  this.audioPlayer.useDefaultDestination(), this.emitter.on("decoded frame", this.onDecodedFrame), this.emitter.on("flush buffers", this.flushBuffers), this.isLoaded = !0, this.isVideoRenderingEnabled && (this.videoPlayer.load(), this.isVideoPlayerLoaded = !0, this.startTextTrackInterval());
8901
8912
  }), e(this, "unload", () => {
8902
8913
  this.emitter.off("target buffer time", this.onTargetBufferTime), this.emitter.off("decoded frame", this.onDecodedFrame), this.emitter.off("flush buffers", this.flushBuffers), this.audioPlayer.unload(), this.isVideoPlayerLoaded && (this.videoPlayer.unload(), this.isVideoPlayerLoaded = !1), this.timers.unload(), this.isLoaded = !1;
@@ -8932,7 +8943,7 @@ var j_ = /* @__PURE__ */ new WeakMap(), M_ = class {
8932
8943
  e instanceof Error && this.emitter.emit("error", re(!1, e));
8933
8944
  }
8934
8945
  this.isVideoRenderingEnabled && this.videoPlayer.onDecodedFrame(e);
8935
- }), this.logger = n, this.emitter = t, this.pool = r, this.emitter.on("target buffer time", this.onTargetBufferTime), this.audioPlayer = O_.create(this.logger.createContext("AudioPlayerModule"), i, {
8946
+ }), this.logger = n, this.emitter = t, this.pool = r, this.emitter.on("target buffer time", this.onTargetBufferTime), this.audioPlayer = k_.create(this.logger.createContext("AudioPlayerModule"), i, {
8936
8947
  muted: a,
8937
8948
  reInitWhenStuck: !0,
8938
8949
  bufferTime: c
@@ -8943,7 +8954,7 @@ var j_ = /* @__PURE__ */ new WeakMap(), M_ = class {
8943
8954
  volume: this.volume,
8944
8955
  isMuted: this.muted
8945
8956
  });
8946
- }), this.videoPlayer = A_.create(this.logger.createContext("VideoPlayerModule"), this.audioPlayer, this.pool, void 0, s);
8957
+ }), this.videoPlayer = j_.create(this.logger.createContext("VideoPlayerModule"), this.audioPlayer, this.pool, void 0, s);
8947
8958
  }
8948
8959
  get volume() {
8949
8960
  return this.audioPlayer.volume;
@@ -8999,12 +9010,12 @@ var j_ = /* @__PURE__ */ new WeakMap(), M_ = class {
8999
9010
  this._isPaused = !0, this.audioPlayer.pause(), this.emitter.emit("media element state", "paused");
9000
9011
  }
9001
9012
  };
9002
- F_ = I_, e(I_, "create", (e, t, n, r, i, a, o, s) => new F_(e, t, n, r, i, a, o, s));
9013
+ I_ = L_, e(L_, "create", (e, t, n, r, i, a, o, s) => new I_(e, t, n, r, i, a, o, s));
9003
9014
  //#endregion
9004
9015
  //#region ../../libs/web-sdk/src/modules/ModernCanvasModule.ts
9005
- var L_, R_ = class {
9016
+ var R_, z_ = class {
9006
9017
  constructor(t, n, r, i, { muted: a, volume: s, type: c, poster: l, offscreenCanvas: u, bufferTime: d }) {
9007
- e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "mediaElement", void 0), e(this, "audioPlayer", void 0), e(this, "videoPlayer", void 0), e(this, "pool", void 0), e(this, "isDisconnected", !0), e(this, "_userProvidedMuted", !1), e(this, "timers", new j()), e(this, "offscreenCanvas", void 0), e(this, "nativeTextTrack", void 0), e(this, "nativeTrackCues", []), e(this, "volumeState", void 0), e(this, "textTracks", new M_()), e(this, "reset", () => {}), e(this, "load", () => {
9018
+ e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "mediaElement", void 0), e(this, "audioPlayer", void 0), e(this, "videoPlayer", void 0), e(this, "pool", void 0), e(this, "isDisconnected", !0), e(this, "_userProvidedMuted", !1), e(this, "timers", new j()), e(this, "offscreenCanvas", void 0), e(this, "nativeTextTrack", void 0), e(this, "nativeTrackCues", []), e(this, "volumeState", void 0), e(this, "textTracks", new N_()), e(this, "reset", () => {}), e(this, "load", () => {
9008
9019
  this.mediaElement.load(), this.emitter.on("decoded frame", this.onDecodedFrame), this.emitter.on("flush buffers", this.flushBuffers), this.emitter.on("ios-hack: reset size", this.resetCanvasSize), this.emitter.on("enter picture in picture", this.onEnterIOSHack), this.emitter.on("exit picture in picture", this.onExitIOSHack), this.element().element.addEventListener("webkitendfullscreen", this.onExitIOSHack), this.element().element.addEventListener("webkitbeginfullscreen", this.onEnterIOSHack), this.videoPlayer.load(), this.nativeTextTrack = this.mediaElement.element.addTextTrack("subtitles", "", ""), this.nativeTextTrack.mode = "showing", this.timers.setInterval(() => {
9009
9020
  if (!this.textTracks.language) {
9010
9021
  this.clearNativeTrackCues();
@@ -9091,7 +9102,7 @@ var L_, R_ = class {
9091
9102
  this.updateVolumeState(), !e.isMuted && !this.audioPlayer.isContextRunning && this.activateAudioPlayer().catch(o), e.isMuted || (this._userProvidedMuted = !1);
9092
9103
  }), this.mediaElement.on("media element state", (e) => {
9093
9104
  e === "paused" && this.audioPlayer.flushBuffer(), this.emitter.emit("media element state", e);
9094
- }), this.audioPlayer = O_.create(this.logger.createContext("AudioPlayerModule"), i, {
9105
+ }), this.audioPlayer = k_.create(this.logger.createContext("AudioPlayerModule"), i, {
9095
9106
  muted: !1,
9096
9107
  reInitWhenStuck: !1,
9097
9108
  bufferTime: d
@@ -9099,7 +9110,7 @@ var L_, R_ = class {
9099
9110
  this.isDisconnected = !0;
9100
9111
  }), this.audioPlayer.on("state change", (e) => {
9101
9112
  e === "suspended" || e === "interrupted" ? this.mediaElement.muted = !0 : e === "running" && (this.mediaElement.muted = this._userProvidedMuted || document.visibilityState === "hidden"), this.updateVolumeState();
9102
- }), this.videoPlayer = A_.create(this.logger.createContext("VideoPlayerModule"), this.audioPlayer, this.pool, this.mediaElement.element, () => this.reconnectCanvasStream(), this.onVideoPlayerError), this.volumeState = {
9113
+ }), this.videoPlayer = j_.create(this.logger.createContext("VideoPlayerModule"), this.audioPlayer, this.pool, this.mediaElement.element, () => this.reconnectCanvasStream(), this.onVideoPlayerError), this.volumeState = {
9103
9114
  volume: this.volume,
9104
9115
  isMuted: this.muted
9105
9116
  };
@@ -9157,10 +9168,10 @@ var L_, R_ = class {
9157
9168
  this.mediaElement.pause();
9158
9169
  }
9159
9170
  };
9160
- L_ = R_, e(R_, "create", (e, t, n, r, i) => new L_(e, t, n, r, i));
9171
+ R_ = z_, e(z_, "create", (e, t, n, r, i) => new R_(e, t, n, r, i));
9161
9172
  //#endregion
9162
9173
  //#region ../../libs/mse/src/AsyncSourceBuffer.ts
9163
- var z_ = () => (e) => B_(e.buffered.start(0), e.buffered.end(e.buffered.length - 1)), B_ = (e, t) => (n) => n.remove(Math.max(0, e), Math.min(Infinity, t)), V_ = (e) => (t) => t.appendBuffer(e), H_ = (e) => (t) => t.changeType(e), U_ = (e) => (t) => e(t), W_ = class {
9174
+ var B_ = () => (e) => V_(e.buffered.start(0), e.buffered.end(e.buffered.length - 1)), V_ = (e, t) => (n) => n.remove(Math.max(0, e), Math.min(Infinity, t)), H_ = (e) => (t) => t.appendBuffer(e), U_ = (e) => (t) => t.changeType(e), W_ = (e) => (t) => e(t), G_ = class {
9164
9175
  constructor(t) {
9165
9176
  e(this, "commandQueue", []), e(this, "sourceBuffer", void 0), e(this, "errorCallback", void 0), e(this, "currentInit", void 0), e(this, "setErrorCallback", (e) => {
9166
9177
  this.errorCallback = e;
@@ -9174,30 +9185,30 @@ var z_ = () => (e) => B_(e.buffered.start(0), e.buffered.end(e.buffered.length -
9174
9185
  }
9175
9186
  }), e(this, "appendBuffer", (e, t) => new Promise((n, r) => {
9176
9187
  if (t && this.currentInit !== t) {
9177
- let e = new Dt(V_(t), n, r);
9188
+ let e = new Dt(H_(t), n, r);
9178
9189
  this.commandQueue.push(e), this.currentInit = t;
9179
9190
  }
9180
- let i = new Dt(V_(e), n, r);
9191
+ let i = new Dt(H_(e), n, r);
9181
9192
  this.commandQueue.push(i), this.handleQueue();
9182
9193
  })), e(this, "execute", (e) => new Promise((t, n) => {
9183
- let r = new Dt(U_(e), t, n);
9194
+ let r = new Dt(W_(e), t, n);
9184
9195
  this.commandQueue.push(r), this.handleQueue();
9185
9196
  })), e(this, "buffered", () => this.sourceBuffer.buffered), e(this, "removeFromMediaSource", (e) => {
9186
9197
  this.dispose(), e.removeSourceBuffer(this.sourceBuffer);
9187
9198
  }), e(this, "dispose", () => {
9188
9199
  this.sourceBuffer.removeEventListener("updateend", this.handleQueue), this.sourceBuffer.removeEventListener("error", this.onError), this.commandQueue = [], this.errorCallback = void 0;
9189
9200
  }), e(this, "changeType", (e) => new Promise((t, n) => {
9190
- let r = new Dt(H_(e), t, n);
9201
+ let r = new Dt(U_(e), t, n);
9191
9202
  this.commandQueue.push(r), this.handleQueue();
9192
9203
  })), e(this, "removeBuffer", (e, t) => new Promise((n, r) => {
9193
- let i = new Dt(B_(e, t), n, r);
9204
+ let i = new Dt(V_(e, t), n, r);
9194
9205
  this.commandQueue.push(i), this.handleQueue();
9195
9206
  })), e(this, "flush", () => new Promise((e, t) => {
9196
- let n = new Dt(z_, e, t);
9207
+ let n = new Dt(B_, e, t);
9197
9208
  this.commandQueue.push(n), this.handleQueue();
9198
9209
  })), this.sourceBuffer = t, this.sourceBuffer.addEventListener("updateend", this.handleQueue), this.sourceBuffer.addEventListener("error", this.onError);
9199
9210
  }
9200
- }, G_ = class extends _e {
9211
+ }, K_ = class extends _e {
9201
9212
  constructor() {
9202
9213
  super(), e(this, "MediaSource", Ve()), e(this, "mediaSource", new this.MediaSource()), e(this, "isOpen", () => this.mediaSource.readyState === "open"), e(this, "isClosed", () => this.mediaSource.readyState === "closed"), e(this, "isEnded", () => this.mediaSource.readyState === "ended"), e(this, "createObjectURL", () => URL.createObjectURL(this.mediaSource)), e(this, "attach", (e) => {
9203
9214
  let t = e;
@@ -9213,7 +9224,7 @@ var z_ = () => (e) => B_(e.buffered.start(0), e.buffered.end(e.buffered.length -
9213
9224
  this.mediaSource.endOfStream();
9214
9225
  } catch (e) {}
9215
9226
  e.srcObject && (e.srcObject = null), e.src !== "" && (URL.revokeObjectURL(e.src), e.removeAttribute("src")), e.load();
9216
- }), e(this, "addSourceBuffer", (e) => new W_(this.mediaSource.addSourceBuffer(e))), e(this, "removeSourceBuffer", (e) => {
9227
+ }), e(this, "addSourceBuffer", (e) => new G_(this.mediaSource.addSourceBuffer(e))), e(this, "removeSourceBuffer", (e) => {
9217
9228
  e.removeFromMediaSource(this.mediaSource);
9218
9229
  }), e(this, "endOfStream", (e) => {
9219
9230
  this.mediaSource.endOfStream(e);
@@ -9230,13 +9241,13 @@ var z_ = () => (e) => B_(e.buffered.start(0), e.buffered.end(e.buffered.length -
9230
9241
  }), this.mediaSource.addEventListener("sourceopen", this.onSourceOpen), this.mediaSource.addEventListener("sourceclose", this.onSourceClosed), this.mediaSource.addEventListener("sourceended", this.onSourceEnded);
9231
9242
  }
9232
9243
  };
9233
- e(G_, "isTypeSupported", (e) => {
9244
+ e(K_, "isTypeSupported", (e) => {
9234
9245
  var t, n;
9235
9246
  return (t = (n = Ve()) == null ? void 0 : n.isTypeSupported(e)) == null ? !1 : t;
9236
9247
  });
9237
9248
  //#endregion
9238
9249
  //#region ../../libs/web-sdk/src/modules/MseModule.ts
9239
- var K_, q_ = class {
9250
+ var q_, J_ = class {
9240
9251
  constructor() {
9241
9252
  e(this, "initSegments", /* @__PURE__ */ new Map()), e(this, "set", (e, t, n) => {
9242
9253
  var r;
@@ -9248,7 +9259,7 @@ var K_, q_ = class {
9248
9259
  });
9249
9260
  }
9250
9261
  };
9251
- function J_(e, { mediaSource: t, mimeType: n, codec: r }) {
9262
+ function Y_(e, { mediaSource: t, mimeType: n, codec: r }) {
9252
9263
  return C(C({}, e), {}, {
9253
9264
  state: "initialized",
9254
9265
  mimeType: n,
@@ -9260,10 +9271,10 @@ function J_(e, { mediaSource: t, mimeType: n, codec: r }) {
9260
9271
  lastBufferCleanupTime: Date.now()
9261
9272
  });
9262
9273
  }
9263
- function Y_({ initSegments: e, pendingSamples: t }) {
9274
+ function X_({ initSegments: e, pendingSamples: t }) {
9264
9275
  return {
9265
9276
  state: "uninitialized",
9266
- initSegments: e == null ? new q_() : e,
9277
+ initSegments: e == null ? new J_() : e,
9267
9278
  sequenceNumber: 0,
9268
9279
  isWorkingOnPendingSamples: !1,
9269
9280
  hasFirstSync: t.some((e) => e.isSync),
@@ -9273,10 +9284,10 @@ function Y_({ initSegments: e, pendingSamples: t }) {
9273
9284
  successfulAppendCalls: 0
9274
9285
  };
9275
9286
  }
9276
- var X_ = class {
9287
+ var Z_ = class {
9277
9288
  constructor(n, a, s) {
9278
9289
  var u = this;
9279
- e(this, "maxChunkSize", 20), e(this, "minConsecutiveErrorsBeforeEmit", 5), e(this, "maxSecondsInBuffer", 60), e(this, "logger", void 0), e(this, "timers", j.create()), e(this, "emitter", void 0), e(this, "mediaElement", void 0), e(this, "mediaSource", new G_()), e(this, "trackContexts", /* @__PURE__ */ new Map()), e(this, "autoRecoverFromMediaErrors", !0), e(this, "quotaErrorCount", 0), e(this, "recoveredFromErrorCount", 0), e(this, "sourceOpenStartTime", Date.now()), e(this, "sourceOpenEndTime", Date.now()), e(this, "pendingTracksToAddSourceBuffers", void 0), e(this, "hasAddedInitialPosterFrame", !0), e(this, "videoKeyframeTimestamps", []), e(this, "isReopening", !1), e(this, "playbackStallCount", 0), e(this, "hasStartedPlayback", !1), e(this, "isPlaybackStalled", !1), e(this, "load", () => {
9290
+ e(this, "maxChunkSize", 20), e(this, "minConsecutiveErrorsBeforeEmit", 5), e(this, "maxSecondsInBuffer", 60), e(this, "logger", void 0), e(this, "timers", j.create()), e(this, "emitter", void 0), e(this, "mediaElement", void 0), e(this, "mediaSource", new K_()), e(this, "trackContexts", /* @__PURE__ */ new Map()), e(this, "autoRecoverFromMediaErrors", !0), e(this, "quotaErrorCount", 0), e(this, "recoveredFromErrorCount", 0), e(this, "sourceOpenStartTime", Date.now()), e(this, "sourceOpenEndTime", Date.now()), e(this, "pendingTracksToAddSourceBuffers", void 0), e(this, "hasAddedInitialPosterFrame", !0), e(this, "videoKeyframeTimestamps", []), e(this, "isReopening", !1), e(this, "playbackStallCount", 0), e(this, "hasStartedPlayback", !1), e(this, "isPlaybackStalled", !1), e(this, "load", () => {
9280
9291
  this.emitter.on("init segment", this.init), this.emitter.on("coded sample", this.onCodedSample), this.emitter.on("flush buffers", this.flushBuffers), this.emitter.on("fragment", this.onFragment);
9281
9292
  }), e(this, "unload", () => {
9282
9293
  this.logger.debug("Unloading module..."), this.emitter.off("init segment", this.init), this.emitter.off("coded sample", this.onCodedSample), this.emitter.off("flush buffers", this.flushBuffers), this.emitter.off("fragment", this.onFragment), this.mediaSource.off("source ended", this.onSourceEnded), this.mediaSource.off("source open", this.onSourceOpen), this.mediaElement.removeEventListener("error", this.onMediaElementError), this.mediaElement.removeEventListener("waiting", this.onPlaybackStall), this.mediaElement.removeEventListener("stalled", this.onPlaybackStall), this.mediaElement.removeEventListener("playing", this.onPlaybackProgress), this.mediaElement.removeEventListener("pause", this.onPlaybackPauseOrSeek), this.mediaElement.removeEventListener("seeking", this.onPlaybackPauseOrSeek), this.mediaSource.detach(this.mediaElement), this.trackContexts.forEach((e) => {
@@ -9313,7 +9324,7 @@ var X_ = class {
9313
9324
  var n, r, i;
9314
9325
  let a = e.get(t), o = (n = a == null ? void 0 : a.pendingSamples) == null ? [] : n, s = a == null ? void 0 : a.initSegments, c = (r = a == null ? void 0 : a.pendingSamplesOffset) == null ? 0 : r;
9315
9326
  for (; c < o.length && !((i = o[c]) != null && i.isSync);) c++;
9316
- let l = Y_({
9327
+ let l = X_({
9317
9328
  pendingSamples: o,
9318
9329
  initSegments: s
9319
9330
  });
@@ -9324,14 +9335,14 @@ var X_ = class {
9324
9335
  this.trackContexts.forEach((e, n) => {
9325
9336
  if (t.has(n)) return;
9326
9337
  e.state === "initialized" && this.mediaSource.isOpen() && this.mediaSource.removeSourceBuffer(e.sourceBuffer);
9327
- let r = Y_({
9338
+ let r = X_({
9328
9339
  pendingSamples: [],
9329
9340
  initSegments: e.initSegments
9330
9341
  });
9331
9342
  this.trackContexts.set(n, r);
9332
9343
  });
9333
9344
  }), e(this, "isCurrentTrackContext", (e, t) => this.trackContexts.get(e) === t), e(this, "initializeSourceBuffer", (e, t) => {
9334
- let n = J_(e, {
9345
+ let n = Y_(e, {
9335
9346
  mimeType: t.mimeType,
9336
9347
  mediaSource: this.mediaSource,
9337
9348
  codec: t.codec
@@ -9358,9 +9369,9 @@ var X_ = class {
9358
9369
  }
9359
9370
  for (let t of e) {
9360
9371
  let n = u.trackContexts.get(t.type);
9361
- if (n || (n = Y_({
9372
+ if (n || (n = X_({
9362
9373
  pendingSamples: [],
9363
- initSegments: new q_()
9374
+ initSegments: new J_()
9364
9375
  }), u.trackContexts.set(t.type, n)), n.state === "initialized") {
9365
9376
  if (t.mimeType !== n.sourceBufferMimeType) try {
9366
9377
  yield n.sourceBuffer.changeType(t.mimeType), n.sourceBufferMimeType = t.mimeType;
@@ -9376,7 +9387,7 @@ var X_ = class {
9376
9387
  u.logger.warn("removeSourceBuffer failed", { removeError: t }), u.reopenMediaSource("changeType recovery failed"), u.pendingTracksToAddSourceBuffers = e;
9377
9388
  return;
9378
9389
  }
9379
- let i = Y_({
9390
+ let i = X_({
9380
9391
  pendingSamples: n.pendingSamples,
9381
9392
  initSegments: n.initSegments
9382
9393
  });
@@ -9400,7 +9411,7 @@ var X_ = class {
9400
9411
  };
9401
9412
  }), e(this, "getNextBufferedRangeStart", (e) => {
9402
9413
  let t = this.getCommonBufferedRangesForCurrentTracks();
9403
- if (t) return Q_(e, t);
9414
+ if (t) return $_(e, t);
9404
9415
  }), e(this, "getVideoKeyframeTimestamps", () => this.videoKeyframeTimestamps), e(this, "init", ({ initSegment: e, mimeType: t }) => {
9405
9416
  this.logger.debug("Added init segment", {
9406
9417
  channel: e.channelId,
@@ -9499,7 +9510,7 @@ var X_ = class {
9499
9510
  let t = (e.timestamp + ((n = e.compositionTimeOffset) == null ? 0 : n)) / e.timescale * 1e3, r = this.videoKeyframeTimestamps[this.videoKeyframeTimestamps.length - 1];
9500
9511
  r !== void 0 && t < r && (this.videoKeyframeTimestamps = []), this.videoKeyframeTimestamps.push(t), this.videoKeyframeTimestamps.length > 20 && (this.videoKeyframeTimestamps = this.videoKeyframeTimestamps.slice(-20));
9501
9512
  }
9502
- t.state !== "uninitialized" && (t.isWorkingOnPendingSamples || rv(t, this.append, this.maxChunkSize).catch((n) => {
9513
+ t.state !== "uninitialized" && (t.isWorkingOnPendingSamples || iv(t, this.append, this.maxChunkSize).catch((n) => {
9503
9514
  if (t.isWorkingOnPendingSamples = !1, !this.isReopening) {
9504
9515
  if (!this.isCurrentTrackContext(e.type, t)) {
9505
9516
  this.logger.debug("Suppressing append error from stale track context", { type: e.type });
@@ -9583,14 +9594,14 @@ var X_ = class {
9583
9594
  if (this.mediaSource.isClosed()) return;
9584
9595
  let e = this.getInitializedTrackBuffers();
9585
9596
  if (e.length !== 0) return this.getCommonBufferedRanges(e);
9586
- }), e(this, "getCommonBufferedRanges", (e) => e.slice(1).reduce((e, t) => $_(e, t), e[0] ? Array.from(e[0]) : [])), e(this, "getPlaybackStateForBufferedRanges", (e, t) => Z_(e, t) ? "playing" : "buffering"), this.logger = n, this.mediaElement = s, this.emitter = a;
9597
+ }), e(this, "getCommonBufferedRanges", (e) => e.slice(1).reduce((e, t) => ev(e, t), e[0] ? Array.from(e[0]) : [])), e(this, "getPlaybackStateForBufferedRanges", (e, t) => Q_(e, t) ? "playing" : "buffering"), this.logger = n, this.mediaElement = s, this.emitter = a;
9587
9598
  }
9588
9599
  };
9589
- K_ = X_, e(X_, "create", (e, t, n) => {
9590
- let r = new K_(e, t, n);
9600
+ q_ = Z_, e(Z_, "create", (e, t, n) => {
9601
+ let r = new q_(e, t, n);
9591
9602
  return r.setTrackContexts(), r.mediaSource.on("source ended", r.onSourceEnded), r.mediaSource.on("source open", r.onSourceOpen), n.addEventListener("error", r.onMediaElementError), n.addEventListener("waiting", r.onPlaybackStall), n.addEventListener("stalled", r.onPlaybackStall), n.addEventListener("playing", r.onPlaybackProgress), n.addEventListener("pause", r.onPlaybackPauseOrSeek), n.addEventListener("seeking", r.onPlaybackPauseOrSeek), r.mediaSource.attach(n), r;
9592
9603
  });
9593
- var Z_ = (e, t) => t.some((t) => t.start <= e && e < t.end), Q_ = (e, t) => {
9604
+ var Q_ = (e, t) => t.some((t) => t.start <= e && e < t.end), $_ = (e, t) => {
9594
9605
  for (let r = 0; r < t.length; r++) {
9595
9606
  let i = t[r];
9596
9607
  if (i) {
@@ -9601,7 +9612,7 @@ var Z_ = (e, t) => t.some((t) => t.start <= e && e < t.end), Q_ = (e, t) => {
9601
9612
  }
9602
9613
  }
9603
9614
  }
9604
- }, $_ = (e, t) => {
9615
+ }, ev = (e, t) => {
9605
9616
  let n = [], r = 0, i = 0;
9606
9617
  for (; r < e.length && i < t.length;) {
9607
9618
  let a = e[r], o = t[i];
@@ -9613,20 +9624,20 @@ var Z_ = (e, t) => t.some((t) => t.start <= e && e < t.end), Q_ = (e, t) => {
9613
9624
  }), a.end <= o.end ? r++ : i++;
9614
9625
  }
9615
9626
  return n;
9616
- }, ev = (e, t) => {
9627
+ }, tv = (e, t) => {
9617
9628
  var n;
9618
9629
  let r = e.renditionId !== t.renditionId, i = e.channelId !== t.channelId, a = ((n = e.timestamp) == null ? 0 : n) > t.timestamp, o = e.type === "video" && t.type === "video" && "levelIdc" in e && "levelIdc" in t && e.levelIdc !== t.levelIdc, s = !1;
9619
9630
  return e.type === "video" && t.type === "video" && "width" in e && "width" in t && (s = t.width !== e.width || t.height !== e.height), i || r || a || s || o;
9620
- }, tv = 32, nv = (e) => {
9631
+ }, nv = 32, rv = (e) => {
9621
9632
  let t = e.pendingSamplesOffset;
9622
9633
  if (t !== 0) {
9623
9634
  if (t >= e.pendingSamples.length) {
9624
9635
  e.pendingSamples = [], e.pendingSamplesOffset = 0;
9625
9636
  return;
9626
9637
  }
9627
- t < tv || t * 2 < e.pendingSamples.length || (e.pendingSamples = e.pendingSamples.slice(t), e.pendingSamplesOffset = 0);
9638
+ t < nv || t * 2 < e.pendingSamples.length || (e.pendingSamples = e.pendingSamples.slice(t), e.pendingSamplesOffset = 0);
9628
9639
  }
9629
- }, rv = function() {
9640
+ }, iv = function() {
9630
9641
  var e = t(function* (e, t, n) {
9631
9642
  for (e.isWorkingOnPendingSamples = !0; e.pendingSamplesOffset < e.pendingSamples.length;) {
9632
9643
  let r = [], i = e.pendingSamplesOffset;
@@ -9634,7 +9645,7 @@ var Z_ = (e, t) => t.some((t) => t.start <= e && e < t.end), Q_ = (e, t) => {
9634
9645
  i = t;
9635
9646
  let a = e.pendingSamples[t], o = e.pendingSamples[t + 1];
9636
9647
  if (a && (r.push(a), o)) {
9637
- if (ev(a, o)) break;
9648
+ if (tv(a, o)) break;
9638
9649
  let e = (a.timestamp + a.duration) / a.timescale;
9639
9650
  if (o.timestamp / o.timescale - e > .1) break;
9640
9651
  }
@@ -9642,14 +9653,14 @@ var Z_ = (e, t) => t.some((t) => t.start <= e && e < t.end), Q_ = (e, t) => {
9642
9653
  }
9643
9654
  let a = r[0];
9644
9655
  if (!a) break;
9645
- yield t(r, e.previousSample ? ev(e.previousSample, a) : !0), e.pendingSamplesOffset = i + 1, e.previousSample = r[r.length - 1], nv(e);
9656
+ yield t(r, e.previousSample ? tv(e.previousSample, a) : !0), e.pendingSamplesOffset = i + 1, e.previousSample = r[r.length - 1], rv(e);
9646
9657
  }
9647
9658
  e.isWorkingOnPendingSamples = !1;
9648
9659
  });
9649
9660
  return function(t, n, r) {
9650
9661
  return e.apply(this, arguments);
9651
9662
  };
9652
- }(), iv, av = class {
9663
+ }(), av, ov = class {
9653
9664
  constructor(n, r) {
9654
9665
  var i = this;
9655
9666
  e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "element", void 0), e(this, "pictureInPictureWindow", void 0), e(this, "unload", () => {
@@ -9681,10 +9692,10 @@ var Z_ = (e, t) => t.some((t) => t.start <= e && e < t.end), Q_ = (e, t) => {
9681
9692
  }()), e(this, "isWebkitPresentationModeSupported", () => !!this.element && xt(this.element)), this.emitter = n, this.logger = r, this.emitter.on("add picture in picture listener", this.onEnablePictureInPicture);
9682
9693
  }
9683
9694
  };
9684
- iv = av, e(av, "create", (e, t) => new iv(e, t));
9695
+ av = ov, e(ov, "create", (e, t) => new av(e, t));
9685
9696
  //#endregion
9686
9697
  //#region ../../libs/web-sdk/src/modules/PlaybackModule.ts
9687
- var ov, sv = class {
9698
+ var sv, cv = class {
9688
9699
  constructor(t, n, r, i) {
9689
9700
  e(this, "emitter", void 0), e(this, "logger", void 0), e(this, "clockSource", void 0), e(this, "state", "buffering"), e(this, "bufferFullness", 0), e(this, "targetBufferTime", void 0), e(this, "lastBufferStateEvent", "drained"), e(this, "firstFrameTime", void 0), e(this, "currentTimeIsInRange", !1), e(this, "needsInputForAudioCount", 0), e(this, "needsInputForVideoCount", 0), e(this, "unload", () => {
9690
9701
  this.emitter.off("buffer state", this.onBufferedStateChanged), this.emitter.off("needs user input", this.onNeedsUserInput);
@@ -9702,24 +9713,24 @@ var ov, sv = class {
9702
9713
  }), this.emitter = t, this.logger = n, this.clockSource = r, this.targetBufferTime = i, this.emitter.on("buffer state", this.onBufferedStateChanged), this.emitter.on("needs user input", this.onNeedsUserInput), this.emitter.emit("target buffer time", i);
9703
9714
  }
9704
9715
  };
9705
- ov = sv, e(sv, "create", (e, t, n, r) => new ov(e, t, n, r));
9716
+ sv = cv, e(cv, "create", (e, t, n, r) => new sv(e, t, n, r));
9706
9717
  //#endregion
9707
9718
  //#region ../../libs/web-sdk/src/modules/QualityOfServiceModule.ts
9708
- var cv, lv = () => ({
9719
+ var lv, uv = () => ({
9709
9720
  upgradesFromLevel: [],
9710
9721
  downgradesFromLevel: [],
9711
9722
  bufferingRanges: [],
9712
9723
  activeRanges: [],
9713
9724
  decodeRate: 2 ** 53 - 1
9714
- }), uv = () => ({
9725
+ }), dv = () => ({
9715
9726
  levels: {},
9716
9727
  levelDowngrades: [],
9717
9728
  levelUpgrades: [],
9718
9729
  bufferFullness: 0,
9719
- general: lv()
9720
- }), dv = class {
9730
+ general: uv()
9731
+ }), fv = class {
9721
9732
  constructor(t, n, r) {
9722
- e(this, "minBufferFullnessLengthForRegression", 6), e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "timers", j.create()), e(this, "metrics", uv()), e(this, "bufferFullness", new _(30)), e(this, "bufferFullnessRegression", void 0), e(this, "currentLevel", void 0), e(this, "isSuspended", !1), e(this, "_fatalQosCount", 0), e(this, "targetBufferTime", 0), e(this, "renditionLevelSource", void 0), e(this, "qualityIndexOrder", []), e(this, "hasAsserted", !1), e(this, "load", () => {
9733
+ e(this, "minBufferFullnessLengthForRegression", 6), e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "timers", j.create()), e(this, "metrics", dv()), e(this, "bufferFullness", new _(30)), e(this, "bufferFullnessRegression", void 0), e(this, "currentLevel", void 0), e(this, "isSuspended", !1), e(this, "_fatalQosCount", 0), e(this, "targetBufferTime", 0), e(this, "renditionLevelSource", void 0), e(this, "qualityIndexOrder", []), e(this, "hasAsserted", !1), e(this, "load", () => {
9723
9734
  this.emitter.on("playback state", this.onPlaybackState), this.emitter.on("buffer fullness", this.onBufferFullness), this.emitter.on("rendition level changed", this.onRenditionLevelChanged), this.emitter.on("video decode rate", this.onVideoDecodeRate), this.emitter.on("target buffer time", this.onTargetBufferTime);
9724
9735
  }), e(this, "unload", () => {
9725
9736
  this.emitter.off("playback state", this.onPlaybackState), this.emitter.off("buffer fullness", this.onBufferFullness), this.emitter.off("rendition level changed", this.onRenditionLevelChanged), this.emitter.off("video decode rate", this.onVideoDecodeRate), this.emitter.off("target buffer time", this.onTargetBufferTime), this.suspend();
@@ -9787,14 +9798,14 @@ var cv, lv = () => ({
9787
9798
  let d = !1;
9788
9799
  if (e.from) {
9789
9800
  var f;
9790
- let e = (f = this.metrics.levels[l]) == null ? lv() : f;
9801
+ let e = (f = this.metrics.levels[l]) == null ? uv() : f;
9791
9802
  l < u ? e.upgradesFromLevel.push(Date.now()) : e.downgradesFromLevel.push(Date.now()), sn(e.activeRanges);
9792
9803
  let t = e.bufferingRanges[e.bufferingRanges.length - 1];
9793
9804
  d = !!t && !t.end, sn(e.bufferingRanges), this.metrics.levels[l] = e;
9794
9805
  }
9795
9806
  if (e.to) {
9796
9807
  var p;
9797
- let e = (p = this.metrics.levels[u]) == null ? lv() : p;
9808
+ let e = (p = this.metrics.levels[u]) == null ? uv() : p;
9798
9809
  cn(e.activeRanges), d && cn(e.bufferingRanges), this.metrics.levels[u] = e, this.currentLevel = u;
9799
9810
  }
9800
9811
  }), e(this, "onBufferFullness", (e) => {
@@ -9863,10 +9874,10 @@ var cv, lv = () => ({
9863
9874
  cn(this.metrics.general.activeRanges);
9864
9875
  }
9865
9876
  };
9866
- cv = dv, e(dv, "create", (e, t, n) => new cv(e, t, n));
9877
+ lv = fv, e(fv, "create", (e, t, n) => new lv(e, t, n));
9867
9878
  //#endregion
9868
9879
  //#region ../../libs/web-sdk/src/modules/RenditionsModule.ts
9869
- var fv, pv = class {
9880
+ var pv, mv = class {
9870
9881
  constructor(t, n) {
9871
9882
  e(this, "renditions", /* @__PURE__ */ new Map()), e(this, "renditionLevels", []), e(this, "languages", []), e(this, "emitter", void 0), e(this, "subscriptionSource", void 0), e(this, "renditionLevelChangeCount", 0), e(this, "unload", () => {
9872
9883
  this.emitter.off("renditions", this.onRenditions), this.emitter.off("subscription changed", this.onSubscriptionChanged);
@@ -9941,10 +9952,10 @@ var fv, pv = class {
9941
9952
  }), e(this, "getCurrentSubscription", () => this.subscriptionSource.getCurrentSubscription()), this.subscriptionSource = n, this.emitter = t, this.emitter.on("renditions", this.onRenditions), this.emitter.on("subscription changed", this.onSubscriptionChanged);
9942
9953
  }
9943
9954
  };
9944
- fv = pv, e(pv, "create", (e, t) => new fv(e, t));
9955
+ pv = mv, e(mv, "create", (e, t) => new pv(e, t));
9945
9956
  //#endregion
9946
9957
  //#region ../../libs/web-sdk/src/modules/SubscriptionModule.ts
9947
- var mv, hv = (e) => JSON.parse(JSON.stringify(e)), gv = 1e4, _v = class {
9958
+ var hv, gv = (e) => JSON.parse(JSON.stringify(e)), _v = 1e4, vv = class {
9948
9959
  constructor(t, n, r) {
9949
9960
  e(this, "logger", void 0), e(this, "timers", new j()), e(this, "emitter", void 0), e(this, "targetSubscription", void 0), e(this, "currentSubscription", void 0), e(this, "_isSwitchingSubscription", !1), e(this, "pendingSubscriptionTimeoutId", void 0), e(this, "burstMs", 0), e(this, "unload", () => {
9950
9961
  this.logger.debug("Unloading module..."), this.timers.unload(), this.emitter.off("subscription changed", this.onSubscriptionChanged), this.logger.debug("Unloaded module");
@@ -9982,23 +9993,23 @@ var mv, hv = (e) => JSON.parse(JSON.stringify(e)), gv = 1e4, _v = class {
9982
9993
  this.logger.debug("onSubscriptionChanged", {
9983
9994
  to: e,
9984
9995
  reset: t
9985
- }), t ? this.targetSubscription = hv(this.currentSubscription) : this.currentSubscription = hv(e), this._isSwitchingSubscription = this.isNewSubscription();
9996
+ }), t ? this.targetSubscription = gv(this.currentSubscription) : this.currentSubscription = gv(e), this._isSwitchingSubscription = this.isNewSubscription();
9986
9997
  }), e(this, "scheduleSubscriptionChange", () => {
9987
- this.targetSubscription = hv(this.targetSubscription), this._isSwitchingSubscription = this.isNewSubscription();
9998
+ this.targetSubscription = gv(this.targetSubscription), this._isSwitchingSubscription = this.isNewSubscription();
9988
9999
  let e = this.currentSubscription.channelId, t = this.targetSubscription.channelId, n = e !== t;
9989
10000
  this._isSwitchingSubscription && (n && this.burstMs ? this.setBurst(this.burstMs) : this.setBurst(0), this.pendingSubscriptionTimeoutId && (this.timers.clearTimeout(this.pendingSubscriptionTimeoutId), this.pendingSubscriptionTimeoutId = void 0), n && this.timers.setTimeout(() => {
9990
- this.currentSubscription.channelId === e && this.targetSubscription.channelId === t && (this.logger.warn("Channel switch timeout", t), this.targetSubscription = hv(this.currentSubscription), this.emitter.emit("channel switch timeout", t));
9991
- }, gv), this.pendingSubscriptionTimeoutId = this.timers.setTimeout(() => this.emitter.emit("send signal", {
10001
+ this.currentSubscription.channelId === e && this.targetSubscription.channelId === t && (this.logger.warn("Channel switch timeout", t), this.targetSubscription = gv(this.currentSubscription), this.emitter.emit("channel switch timeout", t));
10002
+ }, _v), this.pendingSubscriptionTimeoutId = this.timers.setTimeout(() => this.emitter.emit("send signal", {
9992
10003
  type: "subscribe",
9993
10004
  subscription: this.getTargetSubscription()
9994
10005
  }), 0));
9995
- }), this.logger = t, this.targetSubscription = n, this.currentSubscription = hv(n), this.emitter = r, this.emitter.on("subscription changed", this.onSubscriptionChanged);
10006
+ }), this.logger = t, this.targetSubscription = n, this.currentSubscription = gv(n), this.emitter = r, this.emitter.on("subscription changed", this.onSubscriptionChanged);
9996
10007
  }
9997
10008
  };
9998
- mv = _v, e(_v, "create", (e, t, n) => new mv(e, n, t));
10009
+ hv = vv, e(vv, "create", (e, t, n) => new hv(e, n, t));
9999
10010
  //#endregion
10000
10011
  //#region ../../libs/web-sdk/src/modules/SyncModule.ts
10001
- var vv, yv = 5e3, bv = () => Ye() || Ke(), xv = (e) => e && bv() ? 100 : 0, Sv = (e) => (t) => t > e, Cv = {
10012
+ var yv, bv = 5e3, xv = () => Ye() || Ke(), Sv = (e) => e && xv() ? 100 : 0, Cv = (e) => (t) => t > e, wv = {
10002
10013
  seek: {
10003
10014
  toleranceMs: 200,
10004
10015
  toleranceMaxMs: 2500,
@@ -10030,7 +10041,7 @@ var vv, yv = 5e3, bv = () => Ye() || Ke(), xv = (e) => e && bv() ? 100 : 0, Sv =
10030
10041
  decayCooldownMultiplier: 3,
10031
10042
  decayCheckInterval: 15e3
10032
10043
  }
10033
- }, wv = class {
10044
+ }, Tv = class {
10034
10045
  get driftSamplesToCollect() {
10035
10046
  return this._driftSamplesToCollect;
10036
10047
  }
@@ -10076,7 +10087,7 @@ var vv, yv = 5e3, bv = () => Ye() || Ke(), xv = (e) => e && bv() ? 100 : 0, Sv =
10076
10087
  }), e(this, "processSample", (e) => {
10077
10088
  var t;
10078
10089
  if (!e.channelId) throw Error("Sample must be assigned to a channel");
10079
- this.currentChannelId || (this.currentChannelId = e.channelId), this.timestampOffset || (this.timestampOffset = e.timestamp / e.timescale * 1e3 - yv);
10090
+ this.currentChannelId || (this.currentChannelId = e.channelId), this.timestampOffset || (this.timestampOffset = e.timestamp / e.timescale * 1e3 - bv);
10080
10091
  let n = e.type === "video" && e.isSync;
10081
10092
  if (this.currentChannelId !== e.channelId) {
10082
10093
  let t = 2 ** 53 - 1;
@@ -10093,7 +10104,7 @@ var vv, yv = 5e3, bv = () => Ye() || Ke(), xv = (e) => e && bv() ? 100 : 0, Sv =
10093
10104
  this.currentChannelId || (this.currentChannelId = e);
10094
10105
  let r = t.mediaType();
10095
10106
  if (!r) throw Error("Fragment must have a media type");
10096
- this.timestampOffset || (this.timestampOffset = t.baseMediaDecodeTime() / t.timescale() * 1e3 - yv);
10107
+ this.timestampOffset || (this.timestampOffset = t.baseMediaDecodeTime() / t.timescale() * 1e3 - bv);
10097
10108
  let i = t.mediaType() === "video" && t.startsWithKeyframe();
10098
10109
  if (this.currentChannelId !== e) {
10099
10110
  let t = 2 ** 53 - 1;
@@ -10201,7 +10212,7 @@ var vv, yv = 5e3, bv = () => Ye() || Ke(), xv = (e) => e && bv() ? 100 : 0, Sv =
10201
10212
  return;
10202
10213
  }
10203
10214
  if (n >= this.getEffectiveSeekToleranceMs() || n < this.currentTimeshiftToleranceMs()) return;
10204
- let r = Date.now() - this.config.seek.timeoutMs * this.state.timeshiftToleranceMultiplier, i = this.timeshiftAdjustmentTimestamps.filter(Sv(r)).length;
10215
+ let r = Date.now() - this.config.seek.timeoutMs * this.state.timeshiftToleranceMultiplier, i = this.timeshiftAdjustmentTimestamps.filter(Cv(r)).length;
10205
10216
  if (i && this.state.timeshiftToleranceMultiplier > 2) {
10206
10217
  this.logger.debug("Too many timeshifts within sliding window", {
10207
10218
  timeshiftCooldownThreshold: r,
@@ -10281,7 +10292,7 @@ var vv, yv = 5e3, bv = () => Ye() || Ke(), xv = (e) => e && bv() ? 100 : 0, Sv =
10281
10292
  if (!r && !this.isAllowedToSyncIgnoringCooldown() || r && (this.isSeeking() || !this.currentChannelId || this.isSuspended || this.playbackSource.isPaused) || (this.driftSamples.push(t), !this.isSeekCooldownExpired()) || !r && this.driftSamples.items().length < this.driftSamplesToCollect && Math.abs(t) < 2e3) return;
10282
10293
  let i = r ? t : At(this.driftSamples.items());
10283
10294
  if (!r && this.tryPlaybackRateSync(i) || !r && this.shouldSkipNormalSeek(i)) return;
10284
- let a = Date.now() - this.config.seek.timeoutMs * this.state.seekToleranceMultiplier, o = this.seekAdjustmentTimestamps.filter(Sv(a)).length, s = this.currentEmergencySeekToleranceMs(), c = i > 0 && i >= s;
10295
+ let a = Date.now() - this.config.seek.timeoutMs * this.state.seekToleranceMultiplier, o = this.seekAdjustmentTimestamps.filter(Cv(a)).length, s = this.currentEmergencySeekToleranceMs(), c = i > 0 && i >= s;
10285
10296
  if (o && this.state.seekToleranceMultiplier > 2 && !r && !c) {
10286
10297
  this.logger.debug("Too many seek adjustments within sliding window", {
10287
10298
  seekCooldownThreshold: a,
@@ -10312,11 +10323,11 @@ var vv, yv = 5e3, bv = () => Ye() || Ke(), xv = (e) => e && bv() ? 100 : 0, Sv =
10312
10323
  let t = n >= e - this.config.seek.keyframeSearchBeforeMs, r = n <= e + this.config.seek.keyframeSearchAfterMs;
10313
10324
  if (t && r) return n;
10314
10325
  }
10315
- }), this.logger = n, this.emitter = t, this.playbackSource = r, this.bufferSource = i, this.usesMse = o, this.seekOvershoot = xv(o), this.config = {
10316
- seek: C({}, Cv.seek),
10317
- timeshift: C({}, Cv.timeshift),
10318
- playbackRate: C({}, Cv.playbackRate),
10319
- backoff: C({}, Cv.backoff)
10326
+ }), this.logger = n, this.emitter = t, this.playbackSource = r, this.bufferSource = i, this.usesMse = o, this.seekOvershoot = Sv(o), this.config = {
10327
+ seek: C({}, wv.seek),
10328
+ timeshift: C({}, wv.timeshift),
10329
+ playbackRate: C({}, wv.playbackRate),
10330
+ backoff: C({}, wv.backoff)
10320
10331
  }, this.config.timeshift.enabled = a, o || (this.config.seek.toleranceMs = 50, this.config.timeshift.toleranceMs = 20, this.config.seek.aheadToleranceMs = 40), this.state = {
10321
10332
  seekToleranceMultiplier: 1,
10322
10333
  timeshiftToleranceMultiplier: 1
@@ -10378,10 +10389,10 @@ var vv, yv = 5e3, bv = () => Ye() || Ke(), xv = (e) => e && bv() ? 100 : 0, Sv =
10378
10389
  return this.serverCurrentTime - this.playbackSource.currentTime;
10379
10390
  }
10380
10391
  };
10381
- vv = wv, e(wv, "create", (e, t, n, r, i, a = !0) => new vv(e, t, n, r, i, a));
10392
+ yv = Tv, e(Tv, "create", (e, t, n, r, i, a = !0) => new yv(e, t, n, r, i, a));
10382
10393
  //#endregion
10383
10394
  //#region ../../libs/web-sdk/src/modules/TelemetryModule.ts
10384
- var Tv, Ev = {
10395
+ var Ev, Dv = {
10385
10396
  enabled: !0,
10386
10397
  interval: 3e4,
10387
10398
  includeErrors: !0,
@@ -10390,11 +10401,11 @@ var Tv, Ev = {
10390
10401
  maxRetries: 10,
10391
10402
  maxErrorReports: 50,
10392
10403
  maxEvents: 50
10393
- }, Dv = (e, t) => C(C({}, t), {}, {
10404
+ }, Ov = (e, t) => C(C({}, t), {}, {
10394
10405
  type: e,
10395
10406
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
10396
10407
  discriminator: "web"
10397
- }), Ov = class {
10408
+ }), kv = class {
10398
10409
  constructor(n, r, i, a) {
10399
10410
  var o = this;
10400
10411
  e(this, "logger", void 0), e(this, "timers", new j()), e(this, "emitter", void 0), e(this, "options", void 0), e(this, "parentContext", void 0), e(this, "unsentLines", new _(100)), e(this, "retries", 0), e(this, "errorCount", 0), e(this, "eventCount", 0), e(this, "statsCount", 0), e(this, "unload", () => {
@@ -10411,7 +10422,7 @@ var Tv, Ev = {
10411
10422
  initiator: "interval"
10412
10423
  }, n = {}) => {
10413
10424
  if (!this.options.includeStats) return;
10414
- let r = this.parentContext.getStatistics(), i = Dv("stats", C(C(C({}, n), r), {}, {
10425
+ let r = this.parentContext.getStatistics(), i = Ov("stats", C(C(C({}, n), r), {}, {
10415
10426
  isFinal: e,
10416
10427
  initiator: t,
10417
10428
  count: this.statsCount++
@@ -10419,7 +10430,7 @@ var Tv, Ev = {
10419
10430
  this.unsentLines.push(i);
10420
10431
  }), e(this, "addEvent", (e) => {
10421
10432
  if (!this.options.includeEvents || this.eventCount > this.options.maxEvents) return;
10422
- let t = Dv("event", C(C({}, this.parentContext.getStatistics()), e));
10433
+ let t = Ov("event", C(C({}, this.parentContext.getStatistics()), e));
10423
10434
  this.eventCount++, this.unsentLines.push(t);
10424
10435
  }), e(this, "getStatistics", () => ({ errorCount: this.errorCount })), e(this, "send", function() {
10425
10436
  var e = t(function* (e) {
@@ -10465,15 +10476,15 @@ var Tv, Ev = {
10465
10476
  if (t && e instanceof g) {
10466
10477
  if (this.errorCount++, this.errorCount > n) return;
10467
10478
  let t = this.parentContext.getStatistics();
10468
- this.unsentLines.push(Dv("error", C(C({}, t), e.toStringifiable())));
10479
+ this.unsentLines.push(Ov("error", C(C({}, t), e.toStringifiable())));
10469
10480
  }
10470
- }), this.logger = n, this.emitter = r, this.options = C(C({}, Ev), i), this.parentContext = a;
10481
+ }), this.logger = n, this.emitter = r, this.options = C(C({}, Dv), i), this.parentContext = a;
10471
10482
  }
10472
10483
  };
10473
- Tv = Ov, e(Ov, "create", (e, t, n, r) => new Tv(e, t, n, r));
10484
+ Ev = kv, e(kv, "create", (e, t, n, r) => new Ev(e, t, n, r));
10474
10485
  //#endregion
10475
10486
  //#region ../../libs/web-sdk/src/modules/UnpauseModule.ts
10476
- var kv, Av = class {
10487
+ var Av, jv = class {
10477
10488
  constructor(t, n, r) {
10478
10489
  e(this, "logger", void 0), e(this, "element", void 0), e(this, "documentState", void 0), e(this, "timers", new j()), e(this, "unload", () => {
10479
10490
  this.timers.unload();
@@ -10482,10 +10493,10 @@ var kv, Av = class {
10482
10493
  }), this.logger = t, this.element = n, this.documentState = r, this.timers.setInterval(this.unpause, 100);
10483
10494
  }
10484
10495
  };
10485
- kv = Av, e(Av, "create", (e, t, n) => new kv(e, t, n));
10496
+ Av = jv, e(jv, "create", (e, t, n) => new Av(e, t, n));
10486
10497
  //#endregion
10487
10498
  //#region ../../libs/web-sdk/src/OptionsProvider.ts
10488
- var jv = [
10499
+ var Mv = [
10489
10500
  "minBufferTime",
10490
10501
  "maxBufferTime",
10491
10502
  "burstEnabled",
@@ -10495,10 +10506,10 @@ var jv = [
10495
10506
  "offscreenCanvasEnabled",
10496
10507
  "videoCodecs"
10497
10508
  ];
10498
- function Mv(e) {
10499
- return jv.includes(e);
10509
+ function Nv(e) {
10510
+ return Mv.includes(e);
10500
10511
  }
10501
- var Nv = class {
10512
+ var Pv = class {
10502
10513
  constructor(t) {
10503
10514
  e(this, "options", void 0), e(this, "overrides", /* @__PURE__ */ new Map()), this.options = t;
10504
10515
  }
@@ -10512,7 +10523,7 @@ var Nv = class {
10512
10523
  this.options[e] = t;
10513
10524
  }
10514
10525
  get(e, t) {
10515
- if (t && Mv(e)) {
10526
+ if (t && Nv(e)) {
10516
10527
  var n;
10517
10528
  let r = (n = this.overrides.get(t)) == null ? void 0 : n[e];
10518
10529
  if (r !== void 0) return r;
@@ -10523,7 +10534,7 @@ var Nv = class {
10523
10534
  var n;
10524
10535
  return (n = this.overrides.get(t)) == null ? void 0 : n[e];
10525
10536
  }
10526
- }, Pv = 6, Fv = (e) => {
10537
+ }, Fv = 6, Iv = (e) => {
10527
10538
  let t = [e], n = 0, r = 0, i = !1, a = (e, t) => {
10528
10539
  var i, a;
10529
10540
  if (e.flags && qo(e.flags)) {
@@ -10535,7 +10546,7 @@ var Nv = class {
10535
10546
  return u > 0 && (r = u), C(C({}, e), {}, { duration: u > 0 ? u : r });
10536
10547
  };
10537
10548
  return (e, n = !1) => {
10538
- if (e.flags && qo(e.flags) && n && (i = !i), !(n && t.length < Pv && i) && t.length > 0) {
10549
+ if (e.flags && qo(e.flags) && n && (i = !i), !(n && t.length < Fv && i) && t.length > 0) {
10539
10550
  i = !1;
10540
10551
  let n = e;
10541
10552
  for (let e = t.length - 1; e > 0; e--) {
@@ -10548,13 +10559,13 @@ var Nv = class {
10548
10559
  }
10549
10560
  return t.push(e), [];
10550
10561
  };
10551
- }, Iv = ["mse", "wasm"], Lv = (e) => e == null ? Iv : e, Rv = (e) => {
10562
+ }, Lv = ["mse", "wasm"], Rv = (e) => e == null ? Lv : e, zv = (e) => {
10552
10563
  if (!e) return !1;
10553
10564
  let t = e.headers && Object.keys(e.headers).length > 0, n = e.queryParams && Object.keys(e.queryParams).length > 0;
10554
10565
  return !!(t || n);
10555
- }, zv = (e, t, n) => {
10556
- if (Rv(n)) return "mse";
10557
- let r = Lv(e);
10566
+ }, Bv = (e, t, n) => {
10567
+ if (zv(n)) return "mse";
10568
+ let r = Rv(e);
10558
10569
  for (let e of r) switch (e) {
10559
10570
  case "mse":
10560
10571
  if (t) return "mse";
@@ -10565,7 +10576,7 @@ var Nv = class {
10565
10576
  case "wasm": return "wasm";
10566
10577
  }
10567
10578
  return "wasm";
10568
- }, Bv = (e, t, n) => {
10579
+ }, Vv = (e, t, n) => {
10569
10580
  if (gn(t)) return C(C({}, e), {}, {
10570
10581
  type: "video",
10571
10582
  codec: t.codec,
@@ -10586,8 +10597,8 @@ var Nv = class {
10586
10597
  data: e.payload,
10587
10598
  duration: 0
10588
10599
  });
10589
- }, Vv = (e, t) => e && typeof e == "object" && t in e, Hv = (e) => !(typeof e != "object" || !Vv(e, "channelId") || typeof e.channelId != "string" || !Vv(e, "url") || typeof e.url != "string" || e.channelId.length === 0 || e.url.length === 0), Uv = (e) => {
10590
- if (!Hv(e)) throw new g("Invalid options", {
10600
+ }, Hv = (e, t) => e && typeof e == "object" && t in e, Uv = (e) => !(typeof e != "object" || !Hv(e, "channelId") || typeof e.channelId != "string" || !Hv(e, "url") || typeof e.url != "string" || e.channelId.length === 0 || e.url.length === 0), Wv = (e) => {
10601
+ if (!Uv(e)) throw new g("Invalid options", {
10591
10602
  isFatal: !0,
10592
10603
  code: "invalid_options"
10593
10604
  });
@@ -10596,13 +10607,13 @@ var Nv = class {
10596
10607
  let n = t;
10597
10608
  n[e] === void 0 && delete n[e];
10598
10609
  }), t;
10599
- }, Wv = (e) => {
10610
+ }, Gv = (e) => {
10600
10611
  if (typeof e != "object" || !e) throw Error("not an object");
10601
10612
  if (!("video" in e)) throw Error("missing video in subscription");
10602
10613
  if (!("audio" in e)) throw Error("missing audio in subscription");
10603
10614
  if (!("channelId" in e)) throw Error("missing channelId");
10604
10615
  return !0;
10605
- }, Gv = class {
10616
+ }, Kv = class {
10606
10617
  constructor(n) {
10607
10618
  var r = this;
10608
10619
  e(this, "cache", /* @__PURE__ */ new Map()), e(this, "inFlight", /* @__PURE__ */ new Map()), e(this, "checkVideoSupport", function() {
@@ -10663,10 +10674,10 @@ var Nv = class {
10663
10674
  return this.inFlight.set(e, o), o;
10664
10675
  }), this.logger = n;
10665
10676
  }
10666
- }, Kv = /* @__PURE__ */ new WeakMap(), qv = /* @__PURE__ */ new WeakMap(), Jv = /* @__PURE__ */ new WeakMap(), Yv = class n extends _e {
10677
+ }, qv = /* @__PURE__ */ new WeakMap(), Jv = /* @__PURE__ */ new WeakMap(), Yv = /* @__PURE__ */ new WeakMap(), Xv = class n extends _e {
10667
10678
  constructor(r) {
10668
10679
  var i, a;
10669
- super(), i = this, e(this, "pictureInPicture", void 0), e(this, "drm", void 0), e(this, "browser", rt()), e(this, "options", void 0), e(this, "element", void 0), e(this, "playbackSource", void 0), e(this, "emitter", new _e()), e(this, "logger", void 0), e(this, "modules", void 0), e(this, "clientIp", void 0), e(this, "sessionId", void 0), e(this, "clientId", pn()), e(this, "_channels", []), e(this, "createdAt", Date.now()), e(this, "offscreenCanvasElement", void 0), e(this, "webCodecsRenditionSupport", void 0), e(this, "hasCalledConnect", !1), e(this, "latestEmittedLanguages", []), e(this, "wakeLock", void 0), e(this, "pool", new Se(n.MAX_POOL_SIZE)), e(this, "userAgentInformation", new fn()), e(this, "encryptedMediaExtensions", void 0), v(this, Kv, 0), v(this, qv, []), e(this, "sampleProcessingSesssions", /* @__PURE__ */ new Map()), e(this, "sizes", /* @__PURE__ */ new Map()), e(this, "isSuspended", !0), e(this, "disconnectTimeout", void 0), e(this, "offscreenSubtitleInterval", void 0), v(this, Jv, void 0), e(this, "attach", (e) => {
10680
+ super(), i = this, e(this, "pictureInPicture", void 0), e(this, "drm", void 0), e(this, "browser", rt()), e(this, "options", void 0), e(this, "element", void 0), e(this, "playbackSource", void 0), e(this, "emitter", new _e()), e(this, "logger", void 0), e(this, "modules", void 0), e(this, "clientIp", void 0), e(this, "sessionId", void 0), e(this, "clientId", pn()), e(this, "_channels", []), e(this, "createdAt", Date.now()), e(this, "offscreenCanvasElement", void 0), e(this, "webCodecsRenditionSupport", void 0), e(this, "hasCalledConnect", !1), e(this, "latestEmittedLanguages", []), e(this, "wakeLock", void 0), e(this, "pool", new Se(n.MAX_POOL_SIZE)), e(this, "userAgentInformation", new fn()), e(this, "encryptedMediaExtensions", void 0), v(this, qv, 0), v(this, Jv, []), e(this, "sampleProcessingSesssions", /* @__PURE__ */ new Map()), e(this, "sizes", /* @__PURE__ */ new Map()), e(this, "isSuspended", !0), e(this, "disconnectTimeout", void 0), e(this, "offscreenSubtitleInterval", void 0), v(this, Yv, void 0), e(this, "attach", (e) => {
10670
10681
  var t;
10671
10682
  (t = this.wakeLock) == null || t.attach(e), e.appendChild(this.element);
10672
10683
  }), e(this, "setElement", (e) => {
@@ -10749,20 +10760,20 @@ var Nv = class {
10749
10760
  }), e(this, "updateTextTracks", (e) => {
10750
10761
  let t = e.filter((e) => e.codec === "webvtt");
10751
10762
  t.forEach((e) => {
10752
- if (!b(qv, this).find((t) => t.language === e.language)) {
10763
+ if (!b(Jv, this).find((t) => t.language === e.language)) {
10753
10764
  if (this.modules.canvasModule) {
10754
10765
  let t = this.modules.canvasModule.textTracks.addTextTrack(e.kind, e.label || e.language || "", e.language || "");
10755
- b(qv, this).push(t);
10766
+ b(Jv, this).push(t);
10756
10767
  } else if (this.mediaElement instanceof HTMLVideoElement) {
10757
10768
  let t = this.mediaElement.addTextTrack(e.kind, e.label || e.language, e.language);
10758
- b(qv, this).push(t);
10769
+ b(Jv, this).push(t);
10759
10770
  }
10760
10771
  }
10761
10772
  });
10762
- for (let e of b(qv, this)) t.find((t) => t.language === e.language) ? e.mode === "disabled" && (e.mode = "hidden") : e.mode = "disabled";
10773
+ for (let e of b(Jv, this)) t.find((t) => t.language === e.language) ? e.mode === "disabled" && (e.mode = "hidden") : e.mode = "disabled";
10763
10774
  this.emit("text tracks", this.textTracks);
10764
10775
  }), e(this, "cleanupTextTracks", (e = this.currentTime - 2e4) => {
10765
- b(qv, this).forEach((t) => {
10776
+ b(Jv, this).forEach((t) => {
10766
10777
  if (t.cues) for (let n of t.cues) n.endTime * 1e3 < e - 2e3 && t.removeCue(n);
10767
10778
  });
10768
10779
  }), e(this, "filterRenditions", function() {
@@ -10896,8 +10907,8 @@ var Nv = class {
10896
10907
  u = void 0, d = void 0, i.logger.warn("Failed to enable OffscreenCanvas; falling back to main thread rendering", { error: e });
10897
10908
  }
10898
10909
  else s && i.logger.warn("OffscreenCanvas requested but not supported; falling back to main thread rendering");
10899
- let f = yield d_.create(i.emitter, i.logger.createContext("DecoderModule"), i.options.get("logLevel"), n, i.playbackSource, i.pool, a, o, u), { videoRenderer: p } = f.getStatistics(), m = i.modules.canvasModule;
10900
- if (m instanceof I_) if (p === "OffscreenCanvas" && d) {
10910
+ let f = yield f_.create(i.emitter, i.logger.createContext("DecoderModule"), i.options.get("logLevel"), n, i.playbackSource, i.pool, a, o, u), { videoRenderer: p } = f.getStatistics(), m = i.modules.canvasModule;
10911
+ if (m instanceof L_) if (p === "OffscreenCanvas" && d) {
10901
10912
  m.setVideoRenderingEnabled(!1);
10902
10913
  let e = i.element;
10903
10914
  e.parentElement ? e.parentElement.replaceChild(d, e) : i.logger.warn("OffscreenCanvas rendering is active but the current element is not attached to the DOM. Updating internal element reference only."), i.offscreenCanvasElement = d, i.setElement(d);
@@ -10909,10 +10920,10 @@ var Nv = class {
10909
10920
  t.parentElement && t.parentElement.replaceChild(e, t), i.setElement(e);
10910
10921
  }
10911
10922
  }
10912
- else m instanceof R_ && (p === "OffscreenCanvas" && d ? (m.setOffscreenCanvas(d), i.offscreenCanvasElement = d) : (m.setOffscreenCanvas(void 0), i.offscreenCanvasElement = void 0));
10923
+ else m instanceof z_ && (p === "OffscreenCanvas" && d ? (m.setOffscreenCanvas(d), i.offscreenCanvasElement = d) : (m.setOffscreenCanvas(void 0), i.offscreenCanvasElement = void 0));
10913
10924
  (e = i.modules.decoder) == null || e.unload(), i.modules.decoder = f, i.modules.decoder.load(), i.setupOffscreenSubtitleRouting();
10914
10925
  })), e(this, "setupOffscreenSubtitleRouting", () => {
10915
- if (this.offscreenSubtitleInterval !== void 0 && (clearInterval(this.offscreenSubtitleInterval), this.offscreenSubtitleInterval = void 0), !this.offscreenCanvasElement || !this.modules.decoder || this.modules.canvasModule instanceof R_) return;
10926
+ if (this.offscreenSubtitleInterval !== void 0 && (clearInterval(this.offscreenSubtitleInterval), this.offscreenSubtitleInterval = void 0), !this.offscreenCanvasElement || !this.modules.decoder || this.modules.canvasModule instanceof z_) return;
10916
10927
  let e = this.modules.decoder, t = this.modules.canvasModule;
10917
10928
  if (!t) return;
10918
10929
  let n = !1;
@@ -10951,10 +10962,10 @@ var Nv = class {
10951
10962
  e && "reset" in e && e.reset();
10952
10963
  }), this.sampleProcessingSesssions.clear(), this.playbackSource.currentTime = 0, this.playbackSource.isActivated = !1;
10953
10964
  }), e(this, "getRuntimeInfo", () => {
10954
- let e = this.modules.canvasModule instanceof R_ ? !0 : void 0;
10965
+ let e = this.modules.canvasModule instanceof z_ ? !0 : void 0;
10955
10966
  return C({
10956
10967
  uptime: Date.now() - this.createdAt,
10957
- version: "4.3.0-2-ged356a90",
10968
+ version: "4.3.0-4-g99bdcb75",
10958
10969
  clientId: this.clientId,
10959
10970
  sessionId: this.sessionId,
10960
10971
  channelId: this.channelId,
@@ -10988,7 +10999,7 @@ var Nv = class {
10988
10999
  }), e(this, "timeToFirstFrame", () => {
10989
11000
  let e = this.modules.playback.getFirstFrameTime(), t = this.modules.connection.firstConnectionTime;
10990
11001
  if (t && e) return e - t;
10991
- }), this.options = new Nv(C(C({}, Sn), Uv(r))), r.telemetryEnabled === void 0 && ["localhost", "127.0.0.1"].includes(location.hostname) && this.options.set("telemetryEnabled", !1);
11002
+ }), this.options = new Pv(C(C({}, Sn), Wv(r))), r.telemetryEnabled === void 0 && ["localhost", "127.0.0.1"].includes(location.hostname) && this.options.set("telemetryEnabled", !1);
10992
11003
  let o = {
10993
11004
  channelId: this.options.get("channelId"),
10994
11005
  audio: {
@@ -11001,16 +11012,16 @@ var Nv = class {
11001
11012
  height: this.options.get("maxSize").height
11002
11013
  }
11003
11014
  }, s = O.get();
11004
- s.setLevel(this.options.get("logLevel")), s.setDebug(!1), this.logger = s, this.webCodecsRenditionSupport = new Gv(s), r.iosMediaElementEnabled !== void 0 && this.logger.warn("Option iosMediaElementEnabled is deprecated and will be removed in a future release. Use streamToMediaElementEnabled instead.");
11015
+ s.setLevel(this.options.get("logLevel")), s.setDebug(!1), this.logger = s, this.webCodecsRenditionSupport = new Kv(s), r.iosMediaElementEnabled !== void 0 && this.logger.warn("Option iosMediaElementEnabled is deprecated and will be removed in a future release. Use streamToMediaElementEnabled instead.");
11005
11016
  let c = (a = r.streamToMediaElementEnabled) == null ? r.iosMediaElementEnabled : a;
11006
11017
  c !== void 0 && (this.options.set("streamToMediaElementEnabled", c), this.options.set("iosMediaElementEnabled", c));
11007
11018
  let l = r.mseEnabled !== void 0, f = r.decoders !== void 0;
11008
11019
  l && this.logger.warn("Option mseEnabled is deprecated and will be removed in a future release. Use decoders instead (e.g. decoders: [\"wasm\"])."), l && !f && r.mseEnabled === !1 && this.options.set("decoders", ["wasm"]);
11009
- let p = av.create(this.emitter, this.logger.createContext("PictureInPictureModule")), h = j.create(), ee = n_.create(this.emitter, this.logger.createContext("ConnectionModule"), {
11020
+ let p = ov.create(this.emitter, this.logger.createContext("PictureInPictureModule")), h = j.create(), ee = r_.create(this.emitter, this.logger.createContext("ConnectionModule"), {
11010
11021
  reconnectHandler: this.options.get("reconnectHandler"),
11011
11022
  options: this.options,
11012
11023
  onConnectInfo: this.onConnectInfo
11013
- }), te = _v.create(this.logger.createContext("SubscriptionModule"), this.emitter, o), ne = pv.create(this.emitter, te), re = dv.create(this.emitter, this.logger.createContext("QualityOfServiceModule"), ne), ie = sv.create(this.emitter, this.logger.createContext("PlaybackModule"), this, this.options.get("minBufferTime"));
11024
+ }), te = vv.create(this.logger.createContext("SubscriptionModule"), this.emitter, o), ne = mv.create(this.emitter, te), re = fv.create(this.emitter, this.logger.createContext("QualityOfServiceModule"), ne), ie = cv.create(this.emitter, this.logger.createContext("PlaybackModule"), this, this.options.get("minBufferTime"));
11014
11025
  this.encryptedMediaExtensions = new Vr(this.emitter, this.logger.createContext("EncryptedMediaExtensions"), r.drm), this.drm = {
11015
11026
  setHeaders: (e) => {
11016
11027
  this.encryptedMediaExtensions.headers = e;
@@ -11019,7 +11030,7 @@ var Nv = class {
11019
11030
  this.encryptedMediaExtensions.queryParams = e;
11020
11031
  }
11021
11032
  };
11022
- let ae = p_.create(this.emitter), oe = this.options.get("poster"), se = oe === !0 ? this.getThumbnailUrl() : oe || void 0, _, y, S;
11033
+ let ae = m_.create(this.emitter), oe = this.options.get("poster"), se = oe === !0 ? this.getThumbnailUrl() : oe || void 0, _, y, S;
11023
11034
  if (this.willUseMediaSource()) {
11024
11035
  let e = new ds({
11025
11036
  type: this.options.get("media") === "audio" ? "audio" : "video",
@@ -11029,9 +11040,9 @@ var Nv = class {
11029
11040
  logger: this.logger.createContext("MediaElement"),
11030
11041
  poster: se
11031
11042
  });
11032
- e.on("buffer state", (e) => this.onMediaElementBufferState(e, _)), e.on("needs user input", (e) => this.emitter.emit("needs user input", e)), e.on("volume state", (e) => this.emit("volume state", e)), e.on("media element state", (e) => this.onMediaElementState(e)), this.element = e.element, this.playbackSource = e, Vr.isSupported() && this.encryptedMediaExtensions.attach(e.element), _ = X_.create(this.logger.createContext("MseModule"), this.emitter, this.element), this.options.get("pauseSupportEnabled") || (y = Av.create(this.logger.createContext("UnpauseModule"), e, ae)), this.options.get("pictureInPictureEnabled") && this.emitter.emit("add picture in picture listener", { element: e.element });
11043
+ e.on("buffer state", (e) => this.onMediaElementBufferState(e, _)), e.on("needs user input", (e) => this.emitter.emit("needs user input", e)), e.on("volume state", (e) => this.emit("volume state", e)), e.on("media element state", (e) => this.onMediaElementState(e)), this.element = e.element, this.playbackSource = e, Vr.isSupported() && this.encryptedMediaExtensions.attach(e.element), _ = Z_.create(this.logger.createContext("MseModule"), this.emitter, this.element), this.options.get("pauseSupportEnabled") || (y = jv.create(this.logger.createContext("UnpauseModule"), e, ae)), this.options.get("pictureInPictureEnabled") && this.emitter.emit("add picture in picture listener", { element: e.element });
11033
11044
  } else if (this.options.get("streamToMediaElementEnabled") && Et(this.browser)) {
11034
- let e = R_.create(this.emitter, this.logger.createContext("ModernCanvasModule"), this.pool, this, {
11045
+ let e = z_.create(this.emitter, this.logger.createContext("ModernCanvasModule"), this.pool, this, {
11035
11046
  type: this.options.get("media") === "audio" ? "audio" : "video",
11036
11047
  muted: this.options.get("muted") || this.options.get("media") === "video",
11037
11048
  volume: this.options.get("volume"),
@@ -11041,10 +11052,10 @@ var Nv = class {
11041
11052
  }), t = e.element();
11042
11053
  this.element = t.element, this.playbackSource = e, S = e;
11043
11054
  let n = this.browser.platform.isIOS && this.browser.platform.iosVersion <= 15;
11044
- this.options.get("pictureInPictureEnabled") && !n && this.emitter.emit("add picture in picture listener", { element: this.element }), this.options.get("pauseSupportEnabled") || (y = Av.create(this.logger.createContext("UnpauseModule"), t, ae));
11055
+ this.options.get("pictureInPictureEnabled") && !n && this.emitter.emit("add picture in picture listener", { element: this.element }), this.options.get("pauseSupportEnabled") || (y = jv.create(this.logger.createContext("UnpauseModule"), t, ae));
11045
11056
  } else {
11046
11057
  let e;
11047
- e = I_.create(this.emitter, this.logger.createContext("LegacyCanvasModule"), this.pool, this, this.options.get("muted") || this.options.get("media") === "video", this.options.get("volume"), () => {
11058
+ e = L_.create(this.emitter, this.logger.createContext("LegacyCanvasModule"), this.pool, this, this.options.get("muted") || this.options.get("media") === "video", this.options.get("volume"), () => {
11048
11059
  this.setElement(e.element());
11049
11060
  }, this.options.get("minBufferTime")), this.element = e.element(), this.playbackSource = e, S = e, this.options.get("iosWakeLockEnabled") && (this.wakeLock = new ts());
11050
11061
  }
@@ -11061,9 +11072,9 @@ var Nv = class {
11061
11072
  let ce = this.willUseMediaSource(), ue = ce ? !this.browser.platform.isWebKit : !0, de = {
11062
11073
  getTargetBufferTime: () => ie.getTargetBufferTime(),
11063
11074
  getNextBufferedRangeStart: _ ? (e) => _.getNextBufferedRangeStart(e) : void 0
11064
- }, fe = wv.create(this.emitter, this.logger.createContext("SyncModule"), this.playbackSource, de, ue, ce), pe = x_.create(this.logger.createContext("JitterModule")), me = (this.options.get("edgeUrl") || this.options.get("url")).replace("wss://", "https://").replace("ws://", "http://").replace("//lb.", "//errors."), ge = new URL("/telemetry", me).toString();
11075
+ }, fe = Tv.create(this.emitter, this.logger.createContext("SyncModule"), this.playbackSource, de, ue, ce), pe = S_.create(this.logger.createContext("JitterModule")), me = (this.options.get("edgeUrl") || this.options.get("url")).replace("wss://", "https://").replace("ws://", "http://").replace("//lb.", "//errors."), ge = new URL("/telemetry", me).toString();
11065
11076
  this.modules = {
11066
- telemetry: Ov.create(this.logger.createContext("TelemetryModule"), this.emitter, {
11077
+ telemetry: kv.create(this.logger.createContext("TelemetryModule"), this.emitter, {
11067
11078
  url: ge,
11068
11079
  enabled: this.options.get("telemetryEnabled"),
11069
11080
  includeStats: !1,
@@ -11073,10 +11084,10 @@ var Nv = class {
11073
11084
  maxBufferTime: this.options.get("maxBufferTime"),
11074
11085
  minBufferTime: this.options.get("minBufferTime")
11075
11086
  }),
11076
- incomingData: v_.create(this.emitter),
11087
+ incomingData: y_.create(this.emitter),
11077
11088
  adaptivity: Ss.create(this.emitter, this.logger.createContext("AdaptivityModule"), re, { cooldownTime: Math.max(this.options.get("minBufferTime"), 2e3) }),
11078
- constraintCap: s_.create(this.emitter, this.element, ne, this.options.get("abrEnabled") ? this.options.get("sizeBasedResolutionCapEnabled") : !1),
11079
- event: g_.create(this.emitter, this.logger.createContext("EventModule"), fe),
11089
+ constraintCap: c_.create(this.emitter, this.element, ne, this.options.get("abrEnabled") ? this.options.get("sizeBasedResolutionCapEnabled") : !1),
11090
+ event: __.create(this.emitter, this.logger.createContext("EventModule"), fe),
11080
11091
  sync: fe,
11081
11092
  jitter: pe,
11082
11093
  documentState: ae,
@@ -11129,7 +11140,7 @@ var Nv = class {
11129
11140
  let r = ((t = (n = e.telemetry) == null ? void 0 : n.probability) == null ? 1 : t) >= Math.random();
11130
11141
  if (e.telemetry) {
11131
11142
  var i;
11132
- (i = this.modules.telemetry) == null || i.unload(), this.modules.telemetry = Ov.create(this.logger.createContext("TelemetryModule"), this.emitter, C(C({}, e.telemetry), {}, { enabled: this.options.get("telemetryEnabled") && r }), this), this.modules.telemetry.load();
11143
+ (i = this.modules.telemetry) == null || i.unload(), this.modules.telemetry = kv.create(this.logger.createContext("TelemetryModule"), this.emitter, C(C({}, e.telemetry), {}, { enabled: this.options.get("telemetryEnabled") && r }), this), this.modules.telemetry.load();
11133
11144
  }
11134
11145
  }), this.emitter.on("adapt level", (e) => {
11135
11146
  this.logger.debug("adapt level", { direction: e });
@@ -11161,8 +11172,8 @@ var Nv = class {
11161
11172
  audio: C(C({}, this.targetSubscription.audio), d == null ? void 0 : d.audio)
11162
11173
  })), this.emitter.emit("adapted level");
11163
11174
  }), this.emitter.on("text track data", (e) => {
11164
- let t = b(qv, this).find((t) => t.language === e.language), n = this.modules.sync.getTimeshiftOffset() / 1e3, r = n - b(Kv, this);
11165
- if (x(Kv, this, n), t) {
11175
+ let t = b(Jv, this).find((t) => t.language === e.language), n = this.modules.sync.getTimeshiftOffset() / 1e3, r = n - b(qv, this);
11176
+ if (x(qv, this, n), t) {
11166
11177
  if (t.cues) for (let e of t.cues) e.startTime -= r, e.endTime -= r;
11167
11178
  for (let r of e.cues) {
11168
11179
  let e = new VTTCue(r.startTime - n, r.endTime - n, r.text);
@@ -11176,19 +11187,19 @@ var Nv = class {
11176
11187
  this.clientIp = t.ip;
11177
11188
  break;
11178
11189
  case "renditions":
11179
- this.updateTextTracks(t.renditions), x(Jv, this, this.filterRenditions(t.renditions).then((e) => {
11190
+ this.updateTextTracks(t.renditions), x(Yv, this, this.filterRenditions(t.renditions).then((e) => {
11180
11191
  this.emitter.emit("renditions", {
11181
11192
  renditions: e,
11182
11193
  channelId: this.currentSubscription.channelId
11183
11194
  }), this.emit("rendition levels", this.modules.renditions.getRenditionLevels()), this.emitLanguagesIfChanged();
11184
11195
  }).finally(() => {
11185
- x(Jv, this, void 0);
11196
+ x(Yv, this, void 0);
11186
11197
  }));
11187
11198
  break;
11188
11199
  case "subscription changed":
11189
11200
  var r;
11190
11201
  try {
11191
- Wv(t.subscription);
11202
+ Gv(t.subscription);
11192
11203
  } catch (e) {
11193
11204
  this.emitter.emit("error", new g("Subscription failed validation", {
11194
11205
  source: e instanceof Error ? e : void 0,
@@ -11303,7 +11314,7 @@ var Nv = class {
11303
11314
  let xe = function() {
11304
11315
  var e = t(function* (e) {
11305
11316
  let t = e.channelId;
11306
- b(Jv, i) && (yield b(Jv, i));
11317
+ b(Yv, i) && (yield b(Yv, i));
11307
11318
  let n = i.modules.renditions.getRendition(e.renditionId, t);
11308
11319
  if (!Yo(e.flags)) {
11309
11320
  if (Xo(e.flags)) {
@@ -11311,8 +11322,8 @@ var Nv = class {
11311
11322
  if (e.renditionId !== 0) {
11312
11323
  let e = le(t);
11313
11324
  if (e && e.language !== void 0) {
11314
- let t = new ss().parse(e.content || ""), r = n / 1e3, a = b(qv, i).find((t) => t.language === e.language), o = r - b(Kv, i);
11315
- if (x(Kv, i, r), a) {
11325
+ let t = new ss().parse(e.content || ""), r = n / 1e3, a = b(Jv, i).find((t) => t.language === e.language), o = r - b(qv, i);
11326
+ if (x(qv, i, r), a) {
11316
11327
  if (a.cues) for (let e of a.cues) e.startTime -= o, e.endTime -= o;
11317
11328
  for (let e of t) {
11318
11329
  let t = new VTTCue(e.startTime - r, e.endTime - r, e.text);
@@ -11344,10 +11355,10 @@ var Nv = class {
11344
11355
  mimeType: s
11345
11356
  }), i.emit("initialized media");
11346
11357
  } else {
11347
- let t = Bv(e, n, i.sizes.get(e.renditionId));
11358
+ let t = Vv(e, n, i.sizes.get(e.renditionId));
11348
11359
  i.modules.jitter.recordSample(t);
11349
11360
  let a = i.sampleProcessingSesssions.get(r);
11350
- if (!a) a = Fv(i.modules.sync.processSample(t)), i.sampleProcessingSesssions.set(r, a);
11361
+ if (!a) a = Iv(i.modules.sync.processSample(t)), i.sampleProcessingSesssions.set(r, a);
11351
11362
  else {
11352
11363
  let e = i.willUseMediaSource() && i.isSwitchingRenditionLevel && t.type === "video", n = a(i.modules.sync.processSample(t), e), r = t;
11353
11364
  n.forEach((e) => {
@@ -11455,7 +11466,7 @@ var Nv = class {
11455
11466
  this.modules.subscription.setLanguage(e), this.alignSizeAndBitRate(this.targetSubscription);
11456
11467
  }
11457
11468
  set textTrack(e) {
11458
- e !== this.textTrack && (b(qv, this).forEach((t) => {
11469
+ e !== this.textTrack && (b(Jv, this).forEach((t) => {
11459
11470
  if (t.label === e) t.mode = "showing";
11460
11471
  else {
11461
11472
  if (t.mode === "showing" && t.cues) for (let e of [...t.cues]) t.removeCue(e);
@@ -11464,11 +11475,11 @@ var Nv = class {
11464
11475
  }), this.emitter.emit("text track", e));
11465
11476
  }
11466
11477
  get textTracks() {
11467
- return b(qv, this).filter((e) => e.mode !== "disabled").map((e) => e.label);
11478
+ return b(Jv, this).filter((e) => e.mode !== "disabled").map((e) => e.label);
11468
11479
  }
11469
11480
  get textTrack() {
11470
11481
  var e;
11471
- return (e = b(qv, this).find((e) => e.mode === "showing")) == null ? void 0 : e.label;
11482
+ return (e = b(Jv, this).find((e) => e.mode === "showing")) == null ? void 0 : e.label;
11472
11483
  }
11473
11484
  get channelId() {
11474
11485
  var e, t;
@@ -11602,7 +11613,7 @@ var Nv = class {
11602
11613
  return this.modules.subscription.getTargetSubscription();
11603
11614
  }
11604
11615
  resolvedDecoder(e) {
11605
- return zv(this.options.get("decoders", e), this.browser.supportsMediaSource, this.options.get("drm"));
11616
+ return Bv(this.options.get("decoders", e), this.browser.supportsMediaSource, this.options.get("drm"));
11606
11617
  }
11607
11618
  willUseMediaSource() {
11608
11619
  return this.resolvedDecoder() === "mse";
@@ -11621,6 +11632,6 @@ var Nv = class {
11621
11632
  return t === void 0 ? this.shouldUseWebCodecs(e) : t;
11622
11633
  }
11623
11634
  };
11624
- e(Yv, "MAX_POOL_SIZE", 10), e(Yv, "DISCONNECT_TIMEOUT", 15 * 1e3), e(Yv, "REMOVE_CUE_THRESHOLD", 1e3 * 10);
11635
+ e(Xv, "MAX_POOL_SIZE", 10), e(Xv, "DISCONNECT_TIMEOUT", 15 * 1e3), e(Xv, "REMOVE_CUE_THRESHOLD", 1e3 * 10);
11625
11636
  //#endregion
11626
- export { $e as _, ut as a, lt as c, wt as d, St as f, Tt as g, xt as h, mt as i, ft as l, _t as m, O as n, pt as o, bt as p, dt as r, yt as s, Yv as t, gt as u, Qe as v };
11637
+ export { $e as _, ut as a, lt as c, wt as d, St as f, Tt as g, xt as h, mt as i, ft as l, _t as m, O as n, pt as o, bt as p, dt as r, yt as s, Xv as t, gt as u, Qe as v };