@vindral/web-sdk 4.2.1-6-ga0191541 → 4.2.1-7-g15dd6d62

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.
@@ -6046,11 +6046,24 @@ function lp(e) {
6046
6046
  function up() {
6047
6047
  return up = t(function* (e) {
6048
6048
  if (self.WebTransport && (e == null ? void 0 : e.preferredTransport) !== "websocket" && e.url.protocol.startsWith("https")) {
6049
- if (!e.websocketFallbackTimeoutMs) return sp(e);
6050
- let t = sp(e).catch(() => ap(e));
6051
- return (yield Promise.race([t, mn(e.websocketFallbackTimeoutMs)])) || ap(e);
6049
+ if (!e.websocketFallbackTimeoutMs) return {
6050
+ session: yield sp(e),
6051
+ transportSelectionReason: void 0
6052
+ };
6053
+ let t = sp(e).catch(() => ap(e)), n = yield Promise.race([t, mn(e.websocketFallbackTimeoutMs)]);
6054
+ return n ? {
6055
+ session: n,
6056
+ transportSelectionReason: n.transportType() === "websocket" ? "fallback" : void 0
6057
+ } : {
6058
+ session: yield ap(e),
6059
+ transportSelectionReason: "fallback"
6060
+ };
6052
6061
  }
6053
- return ap(e);
6062
+ let t;
6063
+ return t = (e == null ? void 0 : e.preferredTransport) === "websocket" ? "disabled" : self.WebTransport ? "unavailable" : "unsupported", {
6064
+ session: yield ap(e),
6065
+ transportSelectionReason: t
6066
+ };
6054
6067
  }), up.apply(this, arguments);
6055
6068
  }
6056
6069
  //#endregion
@@ -7340,12 +7353,12 @@ function Jh(e, t, n) {
7340
7353
  let r = new URL("/voq/subscribe", e);
7341
7354
  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;
7342
7355
  }
7343
- var Yh = 1e4, Q = /* @__PURE__ */ new WeakMap(), Xh = /* @__PURE__ */ new WeakMap(), Zh = /* @__PURE__ */ new WeakMap(), Qh = /* @__PURE__ */ new WeakMap(), $ = /* @__PURE__ */ new WeakMap(), $h = /* @__PURE__ */ new WeakMap(), eg = /* @__PURE__ */ new WeakMap(), tg = /* @__PURE__ */ new WeakMap(), ng = /* @__PURE__ */ new WeakMap(), rg = /* @__PURE__ */ new WeakMap(), ig = /* @__PURE__ */ new WeakSet(), ag = /* @__PURE__ */ new WeakMap(), og = /* @__PURE__ */ new WeakMap(), sg = /* @__PURE__ */ new WeakMap(), cg = class n {
7356
+ var Yh = 1e4, Q = /* @__PURE__ */ new WeakMap(), Xh = /* @__PURE__ */ new WeakMap(), Zh = /* @__PURE__ */ new WeakMap(), Qh = /* @__PURE__ */ new WeakMap(), $ = /* @__PURE__ */ new WeakMap(), $h = /* @__PURE__ */ new WeakMap(), eg = /* @__PURE__ */ new WeakMap(), tg = /* @__PURE__ */ new WeakMap(), ng = /* @__PURE__ */ new WeakMap(), rg = /* @__PURE__ */ new WeakMap(), ig = /* @__PURE__ */ new WeakMap(), ag = /* @__PURE__ */ new WeakSet(), og = /* @__PURE__ */ new WeakMap(), sg = /* @__PURE__ */ new WeakMap(), cg = /* @__PURE__ */ new WeakMap(), lg = class n {
7344
7357
  get estimatedBandwidth() {
7345
7358
  return b(ng, this);
7346
7359
  }
7347
7360
  unload() {
7348
- b(Q, this).off("send signal", b(og, this)), b(Q, this).off("disconnect", this.disconnect), b(Q, this).off("text track", b(ag, this)), this.disconnect();
7361
+ b(Q, this).off("send signal", b(sg, this)), b(Q, this).off("disconnect", this.disconnect), b(Q, this).off("text track", b(og, this)), this.disconnect();
7349
7362
  }
7350
7363
  suspend() {}
7351
7364
  unsuspend() {}
@@ -7353,31 +7366,32 @@ var Yh = 1e4, Q = /* @__PURE__ */ new WeakMap(), Xh = /* @__PURE__ */ new WeakMa
7353
7366
  let e = b(Zh, this).transportType() === "webtransport" ? "moq" : "moq_ws";
7354
7367
  return {
7355
7368
  edgeUrl: b(Zh, this).url(),
7356
- connectionProtocol: e
7369
+ connectionProtocol: e,
7370
+ transportSelectionReason: b(rg, this)
7357
7371
  };
7358
7372
  }
7359
- constructor(t, n, r, i, a, s, c) {
7360
- S(this, ig), v(this, Q, void 0), v(this, Xh, void 0), v(this, Zh, void 0), v(this, Qh, "disconnected"), v(this, $, void 0), v(this, $h, /* @__PURE__ */ new Map()), v(this, eg, void 0), v(this, tg, void 0), v(this, ng, void 0), v(this, rg, /* @__PURE__ */ new Map()), v(this, ag, (e) => {
7373
+ constructor(t, n, r, i, a, s, c, l) {
7374
+ S(this, ag), v(this, Q, void 0), v(this, Xh, void 0), v(this, Zh, void 0), v(this, Qh, "disconnected"), v(this, $, void 0), v(this, $h, /* @__PURE__ */ new Map()), v(this, eg, void 0), v(this, tg, void 0), v(this, ng, void 0), v(this, rg, void 0), v(this, ig, /* @__PURE__ */ new Map()), v(this, og, (e) => {
7361
7375
  if (!e) {
7362
7376
  b($, this).setSubtitleTrack(void 0).catch(o);
7363
7377
  return;
7364
7378
  }
7365
7379
  let t = b($h, this).get(_p(b($, this).namespace())), n = t == null ? void 0 : t.getTextTrack(e);
7366
7380
  n && b($, this).setSubtitleTrack(n).catch(o);
7367
- }), v(this, og, (e) => {
7381
+ }), v(this, sg, (e) => {
7368
7382
  switch (e.type) {
7369
7383
  case "subscribe":
7370
- if (b(sg, this)) {
7384
+ if (b(cg, this)) {
7371
7385
  b(Xh, this).info("Ignoring - we are already switching");
7372
7386
  return;
7373
7387
  }
7374
- x(sg, this, !0), y(ig, this, dg).call(this, e.subscription).catch((t) => {
7388
+ x(cg, this, !0), y(ag, this, fg).call(this, e.subscription).catch((t) => {
7375
7389
  b(Xh, this).error("error handling subscription", t), b(Q, this).emit("received signal", {
7376
7390
  type: "subscription changed",
7377
7391
  subscription: e.subscription,
7378
7392
  reset: !0
7379
7393
  });
7380
- }).finally(() => x(sg, this, !1));
7394
+ }).finally(() => x(cg, this, !1));
7381
7395
  break;
7382
7396
  case "telemetry":
7383
7397
  me(new URL("/api/telemetry", b(Zh, this).url().replace("wss://", "https://")), {
@@ -7389,14 +7403,14 @@ var Yh = 1e4, Q = /* @__PURE__ */ new WeakMap(), Xh = /* @__PURE__ */ new WeakMa
7389
7403
  b(Zh, this).updateAuthToken(e.token);
7390
7404
  break;
7391
7405
  }
7392
- }), v(this, sg, !1), e(this, "disconnect", (e = "Disconnect Requested") => {
7393
- b(Xh, this).info("Disconnecting", e), b(Zh, this).close(), b($, this).close().catch(o), x(rg, this, /* @__PURE__ */ new Map()), y(ig, this, fg).call(this, "disconnected");
7394
- }), x(Q, this, t), x(Xh, this, n), x(Zh, this, r), x($, this, i), x($h, this, a), x(eg, this, s), x(tg, this, c), b(Q, this).on("send signal", b(og, this)), b(Q, this).on("disconnect", this.disconnect), b(Q, this).on("text track", b(ag, this)), y(ig, this, lg).call(this).catch(o), y(ig, this, pg).call(this).catch(o);
7406
+ }), v(this, cg, !1), e(this, "disconnect", (e = "Disconnect Requested") => {
7407
+ b(Xh, this).info("Disconnecting", e), b(Zh, this).close(), b($, this).close().catch(o), x(ig, this, /* @__PURE__ */ new Map()), y(ag, this, pg).call(this, "disconnected");
7408
+ }), x(Q, this, t), x(Xh, this, n), x(Zh, this, r), x($, this, i), x($h, this, a), x(eg, this, s), x(tg, this, c), x(rg, this, l), b(Q, this).on("send signal", b(sg, this)), b(Q, this).on("disconnect", this.disconnect), b(Q, this).on("text track", b(og, this)), y(ag, this, ug).call(this).catch(o), y(ag, this, mg).call(this).catch(o);
7395
7409
  }
7396
7410
  static start(e, r, i, a, o) {
7397
7411
  return t(function* () {
7398
7412
  var t, s, c;
7399
- let l = new Map(a.connectInfo.channels.map((e) => [_p(e.catalog.namespace), new bg(new A(e.catalog))])), u = yield a.onConnectInfo(a.connectInfo), d = a.options.get("authenticationToken"), f, p;
7413
+ let l = new Map(a.connectInfo.channels.map((e) => [_p(e.catalog.namespace), new xg(new A(e.catalog))])), u = yield a.onConnectInfo(a.connectInfo), d = a.options.get("authenticationToken"), f, p;
7400
7414
  switch (typeof a.edgeUrl) {
7401
7415
  case "string":
7402
7416
  f = Jh(a.edgeUrl, u, d);
@@ -7410,7 +7424,7 @@ var Yh = 1e4, Q = /* @__PURE__ */ new WeakMap(), Xh = /* @__PURE__ */ new WeakMa
7410
7424
  edgeUrl: f,
7411
7425
  edgeWsUrl: p
7412
7426
  }), de(m, "no catalog found");
7413
- let h = (s = l.get(_p(m.namespace))) == null ? void 0 : s.getVideoTrack(u.video), ee = (c = l.get(_p(m.namespace))) == null ? void 0 : c.getAudioTrack(u.audio), te = yield lp({
7427
+ let h = (s = l.get(_p(m.namespace))) == null ? void 0 : s.getVideoTrack(u.video), ee = (c = l.get(_p(m.namespace))) == null ? void 0 : c.getAudioTrack(u.audio), { session: te, transportSelectionReason: ne } = yield lp({
7414
7428
  url: f,
7415
7429
  wsUrl: p,
7416
7430
  handshakePipelining: !0,
@@ -7418,9 +7432,9 @@ var Yh = 1e4, Q = /* @__PURE__ */ new WeakMap(), Xh = /* @__PURE__ */ new WeakMa
7418
7432
  preferredTransport: a.options.get("webtransportEnabled") ? "webtransport" : "websocket",
7419
7433
  role: Ql.Subscriber,
7420
7434
  websocketFallbackTimeoutMs: 2e3
7421
- }), ne = te.closed().then((e) => {
7435
+ }), re = te.closed().then((e) => {
7422
7436
  throw e instanceof Error ? e : Error(e ? `Session closed before player started: ${String(e)}` : "Session closed before player started");
7423
- }), re = yield Promise.race([
7437
+ }), g = yield Promise.race([
7424
7438
  Uh.start(te.subscriber, {
7425
7439
  namespace: m.namespace,
7426
7440
  catalog: m,
@@ -7429,18 +7443,18 @@ var Yh = 1e4, Q = /* @__PURE__ */ new WeakMap(), Xh = /* @__PURE__ */ new WeakMa
7429
7443
  burstMs: u.burstMs || 0
7430
7444
  }),
7431
7445
  hn(Yh, /* @__PURE__ */ Error("Timeout waiting for player to start")),
7432
- ne
7433
- ]), g = new bg(re.catalog());
7434
- l.set(_p(m.namespace), g), e.emit("received signal", {
7446
+ re
7447
+ ]), ie = new xg(g.catalog());
7448
+ l.set(_p(m.namespace), ie), e.emit("received signal", {
7435
7449
  type: "client ip",
7436
- ip: re.connectionInfo().ip
7437
- }), re.drm().then((t) => {
7450
+ ip: g.connectionInfo().ip
7451
+ }), g.drm().then((t) => {
7438
7452
  t && e.emit("received drm data", t.value);
7439
7453
  }).catch((e) => {
7440
7454
  r.error("Error getting DRM data", e);
7441
7455
  });
7442
- let ie = new n(e, r, te, re, l, i, o);
7443
- return u.textTrack && b(ag, ie).call(ie, u.textTrack), ie;
7456
+ let ae = new n(e, r, te, g, l, i, o, ne);
7457
+ return u.textTrack && b(og, ae).call(ae, u.textTrack), ae;
7444
7458
  })();
7445
7459
  }
7446
7460
  getState() {
@@ -7453,7 +7467,7 @@ var Yh = 1e4, Q = /* @__PURE__ */ new WeakMap(), Xh = /* @__PURE__ */ new WeakMa
7453
7467
  return Promise.race([b(Zh, this).closed(), b($, this).closed()]);
7454
7468
  }
7455
7469
  };
7456
- function lg() {
7470
+ function ug() {
7457
7471
  var e = this;
7458
7472
  return t(function* () {
7459
7473
  b(Zh, e).transportType() === "websocket" && (yield mn(5e3));
@@ -7474,7 +7488,7 @@ function lg() {
7474
7488
  }
7475
7489
  })();
7476
7490
  }
7477
- function ug(e) {
7491
+ function dg(e) {
7478
7492
  var n = this;
7479
7493
  return t(function* () {
7480
7494
  var t;
@@ -7485,13 +7499,13 @@ function ug(e) {
7485
7499
  return i;
7486
7500
  })();
7487
7501
  }
7488
- function dg(e) {
7502
+ function fg(e) {
7489
7503
  var n = this;
7490
7504
  return t(function* () {
7491
7505
  var t, r;
7492
7506
  b(Xh, n).info("handle subscription", e);
7493
7507
  let i = b($, n), a = b($h, n).get(e.channelId);
7494
- if (a || (a = new bg(new A(yield y(ig, n, ug).call(n, e.channelId))), b($h, n).set(e.channelId, a)), i.namespace().join("/") !== a.namespace().join("/")) {
7508
+ if (a || (a = new xg(new A(yield y(ag, n, dg).call(n, e.channelId))), b($h, n).set(e.channelId, a)), i.namespace().join("/") !== a.namespace().join("/")) {
7495
7509
  var o;
7496
7510
  b(Xh, n).info("changing channel", e.channelId);
7497
7511
  let t = a.getVideoTrack(e.video), r = a.getAudioTrack(e.audio);
@@ -7517,26 +7531,26 @@ function dg(e) {
7517
7531
  });
7518
7532
  })();
7519
7533
  }
7520
- function fg(e) {
7534
+ function pg(e) {
7521
7535
  x(Qh, this, e), b(Q, this).emit("connection state", e);
7522
7536
  }
7523
- function pg() {
7537
+ function mg() {
7524
7538
  var e = this;
7525
7539
  return t(function* () {
7526
7540
  try {
7527
- y(ig, e, fg).call(e, "connecting"), b(Xh, e).info("Connecting..."), y(ig, e, fg).call(e, "connected"), yield Promise.all([
7528
- y(ig, e, hg).call(e, b($, e).referenceClock(), b($, e).audio),
7529
- y(ig, e, hg).call(e, b($, e).referenceClock(), b($, e).video),
7530
- y(ig, e, mg).call(e, b($, e).subtitles)
7541
+ y(ag, e, pg).call(e, "connecting"), b(Xh, e).info("Connecting..."), y(ag, e, pg).call(e, "connected"), yield Promise.all([
7542
+ y(ag, e, gg).call(e, b($, e).referenceClock(), b($, e).audio),
7543
+ y(ag, e, gg).call(e, b($, e).referenceClock(), b($, e).video),
7544
+ y(ag, e, hg).call(e, b($, e).subtitles)
7531
7545
  ]), yield b($, e).closed(), b(Zh, e).close(), b(Xh, e).info("Session closed");
7532
7546
  } catch (t) {
7533
7547
  b(Xh, e).warn("Session error", t);
7534
7548
  } finally {
7535
- y(ig, e, fg).call(e, "disconnected");
7549
+ y(ag, e, pg).call(e, "disconnected");
7536
7550
  }
7537
7551
  })();
7538
7552
  }
7539
- function mg(e) {
7553
+ function hg(e) {
7540
7554
  var n = this;
7541
7555
  return t(function* () {
7542
7556
  var t = !1, r = !1, i;
@@ -7556,7 +7570,7 @@ function mg(e) {
7556
7570
  }
7557
7571
  })();
7558
7572
  }
7559
- function hg(e, n) {
7573
+ function gg(e, n) {
7560
7574
  var r = this;
7561
7575
  return t(function* () {
7562
7576
  let t = "", i = "", a, o = b($, r).videoTrack() === void 0;
@@ -7581,9 +7595,9 @@ function hg(e, n) {
7581
7595
  drmTransition: a !== void 0 && a !== ne
7582
7596
  };
7583
7597
  t = s, i = c, a = ne;
7584
- let h = p.producerReferenceTime(), ee = b(rg, r).get(n.track.namespace) || 0;
7598
+ let h = p.producerReferenceTime(), ee = b(ig, r).get(n.track.namespace) || 0;
7585
7599
  if (h && Date.now() - ee > 1e3) {
7586
- b(rg, r).set(n.track.namespace, Date.now());
7600
+ b(ig, r).set(n.track.namespace, Date.now());
7587
7601
  let t = e.wallclock() - h.getTime();
7588
7602
  b(Xh, r).debug("timing-info", {
7589
7603
  mediaType: p.mediaType(),
@@ -7609,7 +7623,7 @@ function hg(e, n) {
7609
7623
  codec: l,
7610
7624
  codecString: u,
7611
7625
  switchInfo: m,
7612
- renditionId: gg(n.track.trackObject.name)
7626
+ renditionId: _g(n.track.trackObject.name)
7613
7627
  });
7614
7628
  }
7615
7629
  }
@@ -7635,52 +7649,52 @@ function hg(e, n) {
7635
7649
  }
7636
7650
  })();
7637
7651
  }
7638
- function gg(e) {
7652
+ function _g(e) {
7639
7653
  return e.split("").reduce((e, t) => e = t.charCodeAt(0) + (e << 6) + (e << 16) - e, 0);
7640
7654
  }
7641
- var _g = /* @__PURE__ */ new WeakMap(), vg = /* @__PURE__ */ new WeakMap(), yg = /* @__PURE__ */ new WeakSet(), bg = class {
7655
+ var vg = /* @__PURE__ */ new WeakMap(), yg = /* @__PURE__ */ new WeakMap(), bg = /* @__PURE__ */ new WeakSet(), xg = class {
7642
7656
  constructor(e) {
7643
- S(this, yg), v(this, _g, void 0), v(this, vg, void 0), x(_g, this, e), x(vg, this, y(yg, this, xg).call(this));
7657
+ S(this, bg), v(this, vg, void 0), v(this, yg, void 0), x(vg, this, e), x(yg, this, y(bg, this, Sg).call(this));
7644
7658
  }
7645
7659
  catalog() {
7646
- return b(_g, this).current();
7660
+ return b(vg, this).current();
7647
7661
  }
7648
7662
  namespace() {
7649
- return b(_g, this).current().namespace;
7663
+ return b(vg, this).current().namespace;
7650
7664
  }
7651
7665
  updateCatalog(e) {
7652
- x(_g, this, e);
7666
+ x(vg, this, e);
7653
7667
  }
7654
7668
  getTextTrack(e) {
7655
- return b(_g, this).current().tracks.find((t) => t.label === e);
7669
+ return b(vg, this).current().tracks.find((t) => t.label === e);
7656
7670
  }
7657
7671
  getAudioTrack(e) {
7658
7672
  if (!e.codec) return;
7659
- let t = b(vg, this).filter((t) => !(!_n(t) || t.bitRate > e.bitRate || e.codec && t.codec !== e.codec || e.language && t.language !== e.language));
7673
+ let t = b(yg, this).filter((t) => !(!_n(t) || t.bitRate > e.bitRate || e.codec && t.codec !== e.codec || e.language && t.language !== e.language));
7660
7674
  return t[t.length - 1];
7661
7675
  }
7662
7676
  getVideoTrack(e) {
7663
7677
  if (!e.codec) return;
7664
- let t = b(vg, this).filter((t) => !(!gn(t) || t.bitRate > e.bitRate || e.codec && t.codec !== e.codec));
7678
+ let t = b(yg, this).filter((t) => !(!gn(t) || t.bitRate > e.bitRate || e.codec && t.codec !== e.codec));
7665
7679
  return t[t.length - 1];
7666
7680
  }
7667
7681
  renditions() {
7668
- return b(vg, this);
7682
+ return b(yg, this);
7669
7683
  }
7670
7684
  };
7671
- function xg() {
7672
- let [e, t] = b(_g, this).value();
7685
+ function Sg() {
7686
+ let [e, t] = b(vg, this).value();
7673
7687
  return ue(e);
7674
7688
  }
7675
7689
  //#endregion
7676
7690
  //#region ../../libs/web-sdk/src/resolveEdgeUrl.ts
7677
- var Sg = (e, t) => {
7691
+ var Cg = (e, t) => {
7678
7692
  var n, r;
7679
7693
  let i = new URL("/subscribe", e);
7680
7694
  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();
7681
- }, Cg = /* @__PURE__ */ function(e) {
7695
+ }, wg = /* @__PURE__ */ function(e) {
7682
7696
  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;
7683
- }({}), wg = class extends _e {
7697
+ }({}), Tg = class extends _e {
7684
7698
  constructor(n, r) {
7685
7699
  var i;
7686
7700
  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", () => {
@@ -7722,19 +7736,19 @@ var Sg = (e, t) => {
7722
7736
  code: e.code,
7723
7737
  isSuspended: this.isSuspended
7724
7738
  })), this.close("one websocket was closed"), e.code) {
7725
- case Cg.AuthenticationFailed:
7739
+ case wg.AuthenticationFailed:
7726
7740
  this.emit("error", ne(se()));
7727
7741
  break;
7728
- case Cg.AuthenticationRefreshFailed:
7742
+ case wg.AuthenticationRefreshFailed:
7729
7743
  this.emit("error", ne(se()));
7730
7744
  break;
7731
- case Cg.AuthenticationExpired:
7745
+ case wg.AuthenticationExpired:
7732
7746
  this.emit("error", h(se()));
7733
7747
  break;
7734
- case Cg.ChannelNotFound:
7748
+ case wg.ChannelNotFound:
7735
7749
  this.emit("error", m("internal", se()));
7736
7750
  break;
7737
- case Cg.Inactivity:
7751
+ case wg.Inactivity:
7738
7752
  this.emit("error", oe("internal", se()));
7739
7753
  break;
7740
7754
  default:
@@ -7783,10 +7797,10 @@ var Sg = (e, t) => {
7783
7797
  get connectTime() {
7784
7798
  return this._connectTime;
7785
7799
  }
7786
- }, Tg, Eg = 65536 * 8, Dg = .9, Og = 40, kg = (e) => {
7787
- let t = e || Og;
7788
- return Eg * Dg * 1e3 / t;
7789
- }, Ag = class n {
7800
+ }, Eg, Dg = 65536 * 8, Og = .9, kg = 40, Ag = (e) => {
7801
+ let t = e || kg;
7802
+ return Dg * Og * 1e3 / t;
7803
+ }, jg = class n {
7790
7804
  constructor(r, i, a, s) {
7791
7805
  var c = this;
7792
7806
  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", () => {
@@ -7811,7 +7825,8 @@ var Sg = (e, t) => {
7811
7825
  var e;
7812
7826
  return {
7813
7827
  edgeUrl: (e = this.transport) == null ? void 0 : e.url(),
7814
- connectionProtocol: "vindral_ws"
7828
+ connectionProtocol: "vindral_ws",
7829
+ transportSelectionReason: void 0
7815
7830
  };
7816
7831
  }), e(this, "onMessage", (e, t) => {
7817
7832
  var n;
@@ -7835,7 +7850,7 @@ var Sg = (e, t) => {
7835
7850
  }), e(this, "resolveEdgeUrl", t(function* () {
7836
7851
  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;
7837
7852
  r && (i = n === !1 ? 1 : 2);
7838
- let a = Sg(c.config.edgeUrl, {
7853
+ let a = Cg(c.config.edgeUrl, {
7839
7854
  video: t.video,
7840
7855
  audio: t.audio,
7841
7856
  burstMs: t.burstMs,
@@ -7868,7 +7883,7 @@ var Sg = (e, t) => {
7868
7883
  }
7869
7884
  }
7870
7885
  }), e(this, "connectWebSocketTransport", () => {
7871
- let e = new wg({
7886
+ let e = new Tg({
7872
7887
  reconnectDelay: 1e3,
7873
7888
  onMessage: this.onMessage,
7874
7889
  reconnectHandler: this.config.reconnectHandler,
@@ -7909,47 +7924,47 @@ var Sg = (e, t) => {
7909
7924
  return this.disconnected.promise;
7910
7925
  }
7911
7926
  };
7912
- Tg = Ag, e(Ag, "PING_INTERVAL", 5e3), e(Ag, "MAX_MISSED_PINGS", 4), e(Ag, "TLS_ROUNDTRIPS", 3), e(Ag, "start", (e, t, n, r) => new Promise((i, a) => {
7913
- let o = new Tg(e, t, n, r);
7927
+ Eg = jg, e(jg, "PING_INTERVAL", 5e3), e(jg, "MAX_MISSED_PINGS", 4), e(jg, "TLS_ROUNDTRIPS", 3), e(jg, "start", (e, t, n, r) => new Promise((i, a) => {
7928
+ let o = new Eg(e, t, n, r);
7914
7929
  o.transport.once("error", (e) => a(e)), o.transport.once("open", () => i(o));
7915
7930
  }));
7916
7931
  //#endregion
7917
7932
  //#region ../../libs/web-sdk/src/EdgeSelector.ts
7918
- var jg = /* @__PURE__ */ new WeakMap(), Mg = /* @__PURE__ */ new WeakMap(), Ng = /* @__PURE__ */ new WeakMap(), Pg = class {
7933
+ var Mg = /* @__PURE__ */ new WeakMap(), Ng = /* @__PURE__ */ new WeakMap(), Pg = /* @__PURE__ */ new WeakMap(), Fg = class {
7919
7934
  constructor(e) {
7920
- v(this, jg, void 0), v(this, Mg, []), v(this, Ng, void 0), x(jg, this, e);
7935
+ v(this, Mg, void 0), v(this, Ng, []), v(this, Pg, void 0), x(Mg, this, e);
7921
7936
  }
7922
7937
  select(e) {
7923
- if (b(jg, this).edgeUrl) return b(jg, this).edgeUrl;
7924
- b(Mg, this).length === 0 && x(Mg, this, b(Mg, this).concat(e));
7925
- let t = b(Mg, this).shift();
7926
- if (x(Ng, this, t), t) return t;
7938
+ if (b(Mg, this).edgeUrl) return b(Mg, this).edgeUrl;
7939
+ b(Ng, this).length === 0 && x(Ng, this, b(Ng, this).concat(e));
7940
+ let t = b(Ng, this).shift();
7941
+ if (x(Pg, this, t), t) return t;
7927
7942
  }
7928
7943
  shiftedEdge() {
7929
- return b(Ng, this);
7944
+ return b(Pg, this);
7930
7945
  }
7931
7946
  reset() {
7932
- x(Ng, this, void 0), x(Mg, this, []);
7947
+ x(Pg, this, void 0), x(Ng, this, []);
7933
7948
  }
7934
- }, Fg, Ig = /* @__PURE__ */ new WeakMap(), Lg = /* @__PURE__ */ new WeakMap(), Rg = /* @__PURE__ */ new WeakMap(), zg = /* @__PURE__ */ new WeakMap(), Bg = /* @__PURE__ */ new WeakMap(), Vg = /* @__PURE__ */ new WeakMap(), Hg = /* @__PURE__ */ new WeakMap(), Ug = /* @__PURE__ */ new WeakMap(), Wg = /* @__PURE__ */ new WeakMap(), Gg = /* @__PURE__ */ new WeakMap(), Kg = /* @__PURE__ */ new WeakSet(), qg = class n {
7949
+ }, Ig, Lg = /* @__PURE__ */ new WeakMap(), Rg = /* @__PURE__ */ new WeakMap(), zg = /* @__PURE__ */ new WeakMap(), Bg = /* @__PURE__ */ new WeakMap(), 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 WeakSet(), Jg = class n {
7935
7950
  constructor(r, i, a) {
7936
7951
  var o = this;
7937
- S(this, Kg), 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, Ig, new _(10)), v(this, Lg, !0), v(this, Rg, void 0), v(this, zg, 0), v(this, Bg, 0), v(this, Vg, 0), v(this, Hg, void 0), v(this, Ug, void 0), e(this, "unload", () => {
7952
+ S(this, qg), 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, Lg, new _(10)), v(this, Rg, !0), v(this, zg, void 0), v(this, Bg, 0), v(this, Vg, 0), v(this, Hg, 0), v(this, Ug, void 0), v(this, Wg, void 0), e(this, "unload", () => {
7938
7953
  var e;
7939
7954
  this.logger.debug("Unloading module..."), this.disconnect("Unloading"), (e = this.connectionImpl) == null || e.unload(), this.logger.debug("Unloaded module");
7940
7955
  }), e(this, "suspend", () => {
7941
7956
  var e;
7942
- x(Lg, this, !1), (e = this.connectionImpl) == null || e.suspend();
7957
+ x(Rg, this, !1), (e = this.connectionImpl) == null || e.suspend();
7943
7958
  }), e(this, "unsuspend", () => {
7944
7959
  var e;
7945
- x(Lg, this, !0), (e = this.connectionImpl) == null || e.unsuspend(), this.connect();
7960
+ x(Rg, this, !0), (e = this.connectionImpl) == null || e.unsuspend(), this.connect();
7946
7961
  }), e(this, "getState", () => this.connectionImpl ? this.connectionImpl.getState() : "disconnected"), e(this, "getStatistics", () => {
7947
- let e = b(Bg, this) > 0 ? b(Vg, this) / b(Bg, this) : 0;
7962
+ let e = b(Vg, this) > 0 ? b(Hg, this) / b(Vg, this) : 0;
7948
7963
  return this.connectionImpl ? C(C({}, this.connectionImpl.getStatistics()), {}, {
7949
- rtt: jt(b(Ig, this).items()),
7964
+ rtt: jt(b(Lg, this).items()),
7950
7965
  estimatedBandwidth: this.estimatedBandwidth,
7951
- connectCount: b(Vg, this),
7952
- connectionAttemptCount: b(Bg, this),
7966
+ connectCount: b(Hg, this),
7967
+ connectionAttemptCount: b(Vg, this),
7953
7968
  connectionSuccessRatio: e
7954
7969
  }) : {
7955
7970
  rtt: {
@@ -7959,19 +7974,20 @@ var jg = /* @__PURE__ */ new WeakMap(), Mg = /* @__PURE__ */ new WeakMap(), Ng =
7959
7974
  last: 0
7960
7975
  },
7961
7976
  estimatedBandwidth: 0,
7962
- connectCount: b(Vg, this),
7963
- connectionAttemptCount: b(Bg, this),
7977
+ connectCount: b(Hg, this),
7978
+ connectionAttemptCount: b(Vg, this),
7964
7979
  connectionSuccessRatio: e,
7965
- connectionProtocol: void 0
7980
+ connectionProtocol: void 0,
7981
+ transportSelectionReason: void 0
7966
7982
  };
7967
7983
  }), e(this, "connect", () => {
7968
- x(Lg, this, !0), !b(Rg, this) && x(Rg, this, y(Kg, this, Jg).call(this));
7984
+ x(Rg, this, !0), !b(zg, this) && x(zg, this, y(qg, this, Yg).call(this));
7969
7985
  }), e(this, "disconnect", (e = "Disconnect Requested") => {
7970
7986
  var t;
7971
- x(Lg, this, !1), (t = this.connectionImpl) == null || t.close(e);
7987
+ x(Rg, this, !1), (t = this.connectionImpl) == null || t.close(e);
7972
7988
  }), e(this, "reconnect", (e) => {
7973
7989
  this.disconnect(e), this.connect();
7974
- }), v(this, Wg, t(function* () {
7990
+ }), v(this, Gg, t(function* () {
7975
7991
  try {
7976
7992
  return yield o.apiClient.connect(o.config.options.getOptions());
7977
7993
  } catch (e) {
@@ -7982,7 +7998,7 @@ var jg = /* @__PURE__ */ new WeakMap(), Mg = /* @__PURE__ */ new WeakMap(), Ng =
7982
7998
  }
7983
7999
  throw o.emitter.emit("error", te(e instanceof Error ? e : void 0)), e;
7984
8000
  }
7985
- })), v(this, Gg, t(function* () {
8001
+ })), v(this, Kg, t(function* () {
7986
8002
  let e = Date.now(), t = () => Date.now() - e, r = globalThis.AbortController ? new AbortController() : void 0, i = fetch(new URL("/api/v4/connect/ping", o.config.options.get("url")).toString(), {
7987
8003
  method: "HEAD",
7988
8004
  signal: r == null ? void 0 : r.signal
@@ -7994,43 +8010,43 @@ var jg = /* @__PURE__ */ new WeakMap(), Mg = /* @__PURE__ */ new WeakMap(), Ng =
7994
8010
  });
7995
8011
  }
7996
8012
  get rtt() {
7997
- return b(Ig, this).items().length > 0 ? Ot(b(Ig, this).items()) : 0;
8013
+ return b(Lg, this).items().length > 0 ? Ot(b(Lg, this).items()) : 0;
7998
8014
  }
7999
8015
  get estimatedBandwidth() {
8000
- return this.connectionImpl && "estimatedBandwidth" in this.connectionImpl && this.connectionImpl.estimatedBandwidth ? this.connectionImpl.estimatedBandwidth : kg(this.rtt);
8016
+ return this.connectionImpl && "estimatedBandwidth" in this.connectionImpl && this.connectionImpl.estimatedBandwidth ? this.connectionImpl.estimatedBandwidth : Ag(this.rtt);
8001
8017
  }
8002
8018
  get firstConnectionTime() {
8003
- return b(Hg, this);
8019
+ return b(Ug, this);
8004
8020
  }
8005
8021
  get lastConnectionTime() {
8006
- return b(Ug, this);
8022
+ return b(Wg, this);
8007
8023
  }
8008
8024
  };
8009
- Fg = qg;
8010
- function Jg() {
8025
+ Ig = Jg;
8026
+ function Yg() {
8011
8027
  var e = this;
8012
8028
  return t(function* () {
8013
- let t = new Pg({ edgeUrl: e.config.options.get("edgeUrl") });
8014
- for (x(zg, e, 0);;) {
8029
+ let t = new Fg({ edgeUrl: e.config.options.get("edgeUrl") });
8030
+ for (x(Bg, e, 0);;) {
8015
8031
  var n, r, i;
8016
- x(zg, e, (n = b(zg, e), n++, n)), x(Bg, e, (r = b(Bg, e), r++, r));
8032
+ x(Bg, e, (n = b(Bg, e), n++, n)), x(Vg, e, (r = b(Vg, e), r++, r));
8017
8033
  let o = !1;
8018
8034
  try {
8019
8035
  var a;
8020
- let [n, r] = yield Promise.all([b(Wg, e).call(e), b(Gg, e).call(e)]);
8021
- if (b(Ig, e).clear(), r !== void 0 && b(Ig, e).push(r / 2), !b(Lg, e)) break;
8036
+ let [n, r] = yield Promise.all([b(Gg, e).call(e), b(Kg, e).call(e)]);
8037
+ if (b(Lg, e).clear(), r !== void 0 && b(Lg, e).push(r / 2), !b(Rg, e)) break;
8022
8038
  let i = t.select(n.edges);
8023
8039
  if (!i) throw new g("Failed to resolve edge url", {
8024
8040
  isFatal: !0,
8025
8041
  code: "failed_to_resolve_edge_url"
8026
8042
  });
8027
- ce(n) ? e.connectionImpl = yield cg.start(e.emitter, e.logger, e.apiClient, C(C({}, e.config), {}, {
8043
+ ce(n) ? e.connectionImpl = yield lg.start(e.emitter, e.logger, e.apiClient, C(C({}, e.config), {}, {
8028
8044
  connectInfo: n,
8029
8045
  edgeUrl: i
8030
- }), b(Ig, e)) : (de(typeof i == "string", "Edge URL is expected to be a string"), e.connectionImpl = yield Ag.start(e.emitter, e.logger, C(C({}, e.config), {}, {
8046
+ }), b(Lg, e)) : (de(typeof i == "string", "Edge URL is expected to be a string"), e.connectionImpl = yield jg.start(e.emitter, e.logger, C(C({}, e.config), {}, {
8031
8047
  connectInfo: n,
8032
8048
  edgeUrl: i
8033
- }), b(Ig, e))), t.reset(), x(Vg, e, (a = b(Vg, e), a++, a)), x(zg, e, 0), x(Ug, e, Date.now()), b(Hg, e) || x(Hg, e, b(Ug, e)), yield e.connectionImpl.closed(), e.logger.info("Connection closed");
8049
+ }), b(Lg, e))), t.reset(), x(Hg, e, (a = b(Hg, e), a++, a)), x(Bg, e, 0), x(Wg, e, Date.now()), b(Ug, e) || x(Ug, e, b(Wg, e)), yield e.connectionImpl.closed(), e.logger.info("Connection closed");
8034
8050
  } catch (n) {
8035
8051
  e.logger.warn("Failed to connect", n);
8036
8052
  let r = t.shiftedEdge();
@@ -8043,30 +8059,30 @@ function Jg() {
8043
8059
  }));
8044
8060
  }
8045
8061
  if ((i = e.connectionImpl) == null || i.unload(), e.connectionImpl = void 0, o) {
8046
- x(Lg, e, !1);
8062
+ x(Rg, e, !1);
8047
8063
  break;
8048
8064
  }
8049
- if (!b(Lg, e)) break;
8050
- if (!(yield e.config.reconnectHandler({ reconnectRetries: b(zg, e) }))) {
8065
+ if (!b(Rg, e)) break;
8066
+ if (!(yield e.config.reconnectHandler({ reconnectRetries: b(Bg, e) }))) {
8051
8067
  e.emitter.emit("error", s());
8052
8068
  break;
8053
8069
  }
8054
- if (yield mn(1e3), !b(Lg, e)) break;
8070
+ if (yield mn(1e3), !b(Rg, e)) break;
8055
8071
  }
8056
- x(Rg, e, void 0);
8072
+ x(zg, e, void 0);
8057
8073
  })();
8058
8074
  }
8059
- e(qg, "PING_TIMEOUT", 1e3), e(qg, "create", (e, t, n) => new Fg(e, t, n));
8075
+ e(Jg, "PING_TIMEOUT", 1e3), e(Jg, "create", (e, t, n) => new Ig(e, t, n));
8060
8076
  //#endregion
8061
8077
  //#region ../../libs/web-sdk/src/modules/ConstraintCapModule.ts
8062
- var Yg, Xg = () => ({
8078
+ var Xg, Zg = () => ({
8063
8079
  video: C(C({}, bn()), {}, { bitRate: yn() }),
8064
8080
  audio: { bitRate: yn() }
8065
- }), Zg = () => ({
8081
+ }), Qg = () => ({
8066
8082
  width: window.innerWidth,
8067
8083
  height: window.innerHeight,
8068
8084
  bitRate: yn()
8069
- }), Qg = class t {
8085
+ }), $g = class t {
8070
8086
  constructor(n, r, i, a) {
8071
8087
  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", () => {
8072
8088
  var e;
@@ -8088,7 +8104,7 @@ var Yg, Xg = () => ({
8088
8104
  this.timers.unload();
8089
8105
  }), e(this, "setUserSpecifiedCap", (e) => {
8090
8106
  var t;
8091
- let n = (t = this.getUserSpecifiedCap()) == null ? Xg() : t;
8107
+ let n = (t = this.getUserSpecifiedCap()) == null ? Zg() : t;
8092
8108
  this.userSpecifiedCap = C(C({}, n), {}, {
8093
8109
  video: C(C({}, n.video), e.video),
8094
8110
  audio: C(C({}, n.audio), e.audio)
@@ -8112,7 +8128,7 @@ var Yg, Xg = () => ({
8112
8128
  });
8113
8129
  }), e(this, "evaluateConstraintCap", () => {
8114
8130
  var e, t, n, r;
8115
- let i = this.sizeBasedResolutionCapEnabled ? C(C({}, Xg()), {}, { video: Zg() }) : Xg();
8131
+ let i = this.sizeBasedResolutionCapEnabled ? C(C({}, Zg()), {}, { video: Qg() }) : Zg();
8116
8132
  if (!this.resizeObserver) {
8117
8133
  let e = this.element.getBoundingClientRect();
8118
8134
  this.elementSize = {
@@ -8149,14 +8165,14 @@ var Yg, Xg = () => ({
8149
8165
  this._sizeBasedResolutionCapEnabled = e, this.evaluateConstraintCap();
8150
8166
  }
8151
8167
  };
8152
- Yg = Qg, e(Qg, "CHECK_SIZE_INTERVAL", 1e3), e(Qg, "create", (e, t, n, r) => new Yg(e, t, n, r));
8168
+ Xg = $g, e($g, "CHECK_SIZE_INTERVAL", 1e3), e($g, "create", (e, t, n, r) => new Xg(e, t, n, r));
8153
8169
  //#endregion
8154
8170
  //#region ../../libs/web-sdk/src/modules/DecoderModule.ts
8155
- var $g = 5, e_ = 100, t_ = 1e3, n_ = class r {
8171
+ var e_ = 5, t_ = 100, n_ = 1e3, r_ = class r {
8156
8172
  constructor(t, n, r, i, a = !1, o = !1, s = !1) {
8157
8173
  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", () => {
8158
- let e = this._audioWebCodecsInUse ? 20 : e_;
8159
- this.timers.setInterval(this.emitDecodedFrames, e), this.timers.setInterval(this.emitDecodeRate, t_), this.emitter.on("init segment", this.onInitSegment), this.emitter.on("coded sample", this.decode);
8174
+ let e = this._audioWebCodecsInUse ? 20 : t_;
8175
+ this.timers.setInterval(this.emitDecodedFrames, e), this.timers.setInterval(this.emitDecodeRate, n_), this.emitter.on("init segment", this.onInitSegment), this.emitter.on("coded sample", this.decode);
8160
8176
  }), e(this, "unload", () => {
8161
8177
  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);
8162
8178
  }), e(this, "suspend", () => {
@@ -8213,7 +8229,7 @@ var $g = 5, e_ = 100, t_ = 1e3, n_ = class r {
8213
8229
  if (this.isSuspended) return;
8214
8230
  t.sampleDuration = e.duration / e.timescale * 1e3;
8215
8231
  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];
8216
- if (!s || a - $g > s.end ? i.push({
8232
+ if (!s || a - e_ > s.end ? i.push({
8217
8233
  start: a,
8218
8234
  end: a + o
8219
8235
  }) : a + o * 5 < s.end ? (t.buffer = [{
@@ -8333,7 +8349,7 @@ var $g = 5, e_ = 100, t_ = 1e3, n_ = class r {
8333
8349
  return new r(e, i, t, s, p, m, h);
8334
8350
  })();
8335
8351
  }
8336
- }, r_, i_ = class {
8352
+ }, i_, a_ = class {
8337
8353
  constructor(t) {
8338
8354
  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", () => {
8339
8355
  document.removeEventListener("visibilitychange", this.onVisibilityChanged), window.removeEventListener("pagehide", this.onPageHide), window.removeEventListener("online", this.onOnline), window.removeEventListener("offline", this.onOffline);
@@ -8367,12 +8383,12 @@ var $g = 5, e_ = 100, t_ = 1e3, n_ = class r {
8367
8383
  return document.visibilityState === "visible";
8368
8384
  }
8369
8385
  };
8370
- r_ = i_, e(i_, "create", (e) => new r_(e));
8386
+ i_ = a_, e(a_, "create", (e) => new i_(e));
8371
8387
  //#endregion
8372
8388
  //#region ../../libs/web-sdk/src/modules/EventModule.ts
8373
- var a_, o_ = (e) => (t, n, r) => t.timestamp <= n || t.timestampAdded <= r - e, s_ = class t {
8389
+ var o_, s_ = (e) => (t, n, r) => t.timestamp <= n || t.timestampAdded <= r - e, c_ = class t {
8374
8390
  constructor(n, r, i) {
8375
- e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "waitingEvents", []), e(this, "isTriggered", o_(t.EVENT_TIMEOUT)), e(this, "timeSource", void 0), e(this, "timers", new j()), e(this, "load", () => {
8391
+ e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "waitingEvents", []), e(this, "isTriggered", s_(t.EVENT_TIMEOUT)), e(this, "timeSource", void 0), e(this, "timers", new j()), e(this, "load", () => {
8376
8392
  this.timers.setInterval(this.onBufferedStateChanged, t.EVENT_CHECK_INTERVAL), this.emitter.on("add event", this.addEvent);
8377
8393
  }), e(this, "unload", () => {
8378
8394
  this.timers.unload(), this.emitter.off("add event", this.addEvent);
@@ -8399,10 +8415,10 @@ var a_, o_ = (e) => (t, n, r) => t.timestamp <= n || t.timestampAdded <= r - e,
8399
8415
  }), this.logger = r, this.emitter = n, this.timeSource = i;
8400
8416
  }
8401
8417
  };
8402
- a_ = s_, e(s_, "EVENT_TIMEOUT", 5e3), e(s_, "EVENT_CHECK_INTERVAL", 20), e(s_, "create", (e, t, n) => new a_(e, t, n));
8418
+ o_ = c_, e(c_, "EVENT_TIMEOUT", 5e3), e(c_, "EVENT_CHECK_INTERVAL", 20), e(c_, "create", (e, t, n) => new o_(e, t, n));
8403
8419
  //#endregion
8404
8420
  //#region ../../libs/web-sdk/src/modules/IncomingDataModule.ts
8405
- var c_, l_ = class t {
8421
+ var l_, u_ = class t {
8406
8422
  constructor(n) {
8407
8423
  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", () => {
8408
8424
  this.emitter.on("connection state", this.onConnectionState), this.timers.setInterval(() => this.bytesReceived.forEach((e) => e.tick()), 100);
@@ -8437,10 +8453,10 @@ var c_, l_ = class t {
8437
8453
  }), this.emitter = n;
8438
8454
  }
8439
8455
  };
8440
- c_ = l_, e(l_, "NO_DATA_ERROR_TIMEOUT", 20 * 1e3), e(l_, "NO_DATA_TIMEOUT", 5 * 1e3), e(l_, "UPDATE_RECEIVED_BYTES_INTERVAL", 1e3), e(l_, "create", (e) => new c_(e));
8456
+ l_ = u_, e(u_, "NO_DATA_ERROR_TIMEOUT", 20 * 1e3), e(u_, "NO_DATA_TIMEOUT", 5 * 1e3), e(u_, "UPDATE_RECEIVED_BYTES_INTERVAL", 1e3), e(u_, "create", (e) => new l_(e));
8441
8457
  //#endregion
8442
8458
  //#region ../../libs/web-sdk/src/modules/JitterModule.ts
8443
- var u_ = 1e3, d_ = 50, f_ = class t {
8459
+ var d_ = 1e3, f_ = 50, p_ = class t {
8444
8460
  constructor(t) {
8445
8461
  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", () => {
8446
8462
  this.logger.debug("JitterModule loaded");
@@ -8461,9 +8477,9 @@ var u_ = 1e3, d_ = 50, f_ = class t {
8461
8477
  this.trackingState.set(a, {
8462
8478
  lastArrivalTime: o,
8463
8479
  lastTimestampMs: s,
8464
- jitterSamples: new _(u_),
8465
- interArrivalTimes: new _(u_)
8466
- }), this.runningJitter.set(a, 0), this.recentJitterSamples.set(a, new _(d_));
8480
+ jitterSamples: new _(d_),
8481
+ interArrivalTimes: new _(d_)
8482
+ }), this.runningJitter.set(a, 0), this.recentJitterSamples.set(a, new _(f_));
8467
8483
  return;
8468
8484
  }
8469
8485
  let l = s - c.lastTimestampMs;
@@ -8476,7 +8492,7 @@ var u_ = 1e3, d_ = 50, f_ = class t {
8476
8492
  let f = (i = this.runningJitter.get(a)) == null ? 0 : i, p = f + (d - f) / 16;
8477
8493
  this.runningJitter.set(a, p);
8478
8494
  let m = this.recentJitterSamples.get(a);
8479
- m || (m = new _(d_), this.recentJitterSamples.set(a, m)), m.push(d), c.lastArrivalTime = o, c.lastTimestampMs = s;
8495
+ m || (m = new _(f_), this.recentJitterSamples.set(a, m)), m.push(d), c.lastArrivalTime = o, c.lastTimestampMs = s;
8480
8496
  }
8481
8497
  getJitterForType(e) {
8482
8498
  for (let [i, a] of this.trackingState) if (i.startsWith(e)) {
@@ -8507,10 +8523,10 @@ var u_ = 1e3, d_ = 50, f_ = class t {
8507
8523
  videoJitter: this.getJitterForType("video")
8508
8524
  };
8509
8525
  }
8510
- }, p_ = () => window.AudioContext || window.webkitAudioContext, m_ = class n extends _e {
8526
+ }, m_ = () => window.AudioContext || window.webkitAudioContext, h_ = class n extends _e {
8511
8527
  constructor() {
8512
8528
  var r;
8513
- super(), r = this, e(this, "context", new (p_())()), 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* () {
8529
+ super(), r = this, e(this, "context", new (m_())()), 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* () {
8514
8530
  try {
8515
8531
  return yield Promise.race([r.context.resume(), hn(1e3, p())]);
8516
8532
  } catch (e) {
@@ -8539,10 +8555,10 @@ var u_ = 1e3, d_ = 50, f_ = class t {
8539
8555
  return this.context.state;
8540
8556
  }
8541
8557
  };
8542
- e(m_, "CHECK_INTERVAL", 1e3);
8558
+ e(h_, "CHECK_INTERVAL", 1e3);
8543
8559
  //#endregion
8544
8560
  //#region ../../libs/web-audio-player/src/AudioPlayer.ts
8545
- var h_, g_ = 150, __ = 400, v_ = (e) => e === void 0 ? 5 : e <= g_ ? 1 : e <= __ ? 2 : 5, y_ = class extends _e {
8561
+ var g_, __ = 150, v_ = 400, y_ = (e) => e === void 0 ? 5 : e <= __ ? 1 : e <= v_ ? 2 : 5, b_ = class extends _e {
8546
8562
  get isContextRunning() {
8547
8563
  var e;
8548
8564
  return ((e = this.audio) == null ? void 0 : e.state) === "running";
@@ -8583,7 +8599,7 @@ var h_, g_ = 150, __ = 400, v_ = (e) => e === void 0 ? 5 : e <= g_ ? 1 : e <= __
8583
8599
  return this._bufferTime;
8584
8600
  }
8585
8601
  set bufferTime(e) {
8586
- this._bufferTime = e, this.audioBufferMultiplier = v_(e);
8602
+ this._bufferTime = e, this.audioBufferMultiplier = y_(e);
8587
8603
  }
8588
8604
  get audioNode() {
8589
8605
  return this.splitter;
@@ -8673,14 +8689,14 @@ var h_, g_ = 150, __ = 400, v_ = (e) => e === void 0 ? 5 : e <= g_ ? 1 : e <= __
8673
8689
  }
8674
8690
  })), e(this, "getAudioContext", () => this.audio ? this.audio : this.setupContext()), e(this, "setupContext", () => {
8675
8691
  var e, t, n;
8676
- return (e = this.audio) == null || e.unload(), this.audio = new m_(), this.audio.on("state", (e) => {
8692
+ return (e = this.audio) == null || e.unload(), this.audio = new h_(), this.audio.on("state", (e) => {
8677
8693
  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);
8678
8694
  }), this.audio.on("stuck", () => {
8679
8695
  this.reInitWhenStuck && (this.logger.info("Re-init audio context"), this.setupContext(), this.resume().catch(o), this.emit("stuck"));
8680
8696
  }), (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;
8681
8697
  }), e(this, "setGain", (e) => {
8682
8698
  this.gainNode && (this.gainNode.gain.value = this._muted ? 0 : e);
8683
- }), this._muted = i, this._userProvidedMuted = i, this.logger = n, this.clockSource = r, this.reInitWhenStuck = a, this._bufferTime = s, this.audioBufferMultiplier = v_(s);
8699
+ }), this._muted = i, this._userProvidedMuted = i, this.logger = n, this.clockSource = r, this.reInitWhenStuck = a, this._bufferTime = s, this.audioBufferMultiplier = y_(s);
8684
8700
  }
8685
8701
  useMediaStreamDestination() {
8686
8702
  var e;
@@ -8693,10 +8709,10 @@ var h_, g_ = 150, __ = 400, v_ = (e) => e === void 0 ? 5 : e <= g_ ? 1 : e <= __
8693
8709
  return (e = this.gainNode) == null || e.connect(t), t;
8694
8710
  }
8695
8711
  };
8696
- h_ = y_, e(y_, "create", (e, t, n) => new h_(e, t, n));
8712
+ g_ = b_, e(b_, "create", (e, t, n) => new g_(e, t, n));
8697
8713
  //#endregion
8698
8714
  //#region ../../libs/web-sdk/src/players/VideoPlayer.ts
8699
- var b_, x_ = class {
8715
+ var x_, S_ = class {
8700
8716
  constructor(t, n, r, i, a, o) {
8701
8717
  e(this, "staleFrameThresholdMs", 400), e(this, "pool", void 0), e(this, "logger", void 0), e(this, "videoRenderer", new ir()), 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", () => {
8702
8718
  this.videoRenderer.load(), this.subscribeToContextLost(this.videoRenderer);
@@ -8786,12 +8802,12 @@ var b_, x_ = class {
8786
8802
  }), this.logger = t, this.clockSource = n, this.pool = r, this.renderTargetSize = i || this.videoRenderer.canvas, this.onCanvasChangeCallback = a, this.onRendererErrorCallback = o;
8787
8803
  }
8788
8804
  };
8789
- b_ = x_, e(x_, "create", (e, t, n, r, i, a) => new b_(e, t, n, r, i, a));
8805
+ x_ = S_, e(S_, "create", (e, t, n, r, i, a) => new x_(e, t, n, r, i, a));
8790
8806
  //#endregion
8791
8807
  //#region ../../libs/web-sdk/src/TextTracks.ts
8792
- var S_ = /* @__PURE__ */ new WeakMap(), C_ = class {
8808
+ var C_ = /* @__PURE__ */ new WeakMap(), w_ = class {
8793
8809
  constructor() {
8794
- v(this, S_, []), x(S_, this, []);
8810
+ v(this, C_, []), x(C_, this, []);
8795
8811
  }
8796
8812
  addTextTrack(e, t, n) {
8797
8813
  let r = [], i = {
@@ -8808,37 +8824,37 @@ var S_ = /* @__PURE__ */ new WeakMap(), C_ = class {
8808
8824
  t !== -1 && r.splice(t, 1);
8809
8825
  }
8810
8826
  };
8811
- return b(S_, this).push(i), i;
8827
+ return b(C_, this).push(i), i;
8812
8828
  }
8813
8829
  set language(e) {
8814
- b(S_, this).forEach((t) => {
8830
+ b(C_, this).forEach((t) => {
8815
8831
  t.language === e ? t.mode = "showing" : t.mode = "hidden";
8816
8832
  });
8817
8833
  }
8818
8834
  get language() {
8819
8835
  var e;
8820
- return (e = b(S_, this).find((e) => e.mode === "showing")) == null ? void 0 : e.language;
8836
+ return (e = b(C_, this).find((e) => e.mode === "showing")) == null ? void 0 : e.language;
8821
8837
  }
8822
8838
  getActiveCues(e) {
8823
- let t = b(S_, this).find((e) => e.mode === "showing");
8839
+ let t = b(C_, this).find((e) => e.mode === "showing");
8824
8840
  return t ? t.cues.filter(({ startTime: t, endTime: n }) => e >= t && e <= n) : [];
8825
8841
  }
8826
- }, w_ = (e, t) => {
8842
+ }, T_ = (e, t) => {
8827
8843
  let n;
8828
8844
  for (n = t; e > 1; e--) n += t;
8829
8845
  return n;
8830
- }, T_ = class {
8846
+ }, E_ = class {
8831
8847
  constructor() {
8832
8848
  e(this, "audio", void 0), e(this, "unmute", () => this.audio.play().catch(o));
8833
8849
  let t = document.createElement("div");
8834
8850
  t.innerHTML = "<audio x-webkit-airplay='deny'></audio>";
8835
8851
  let n = t.children.item(0);
8836
- 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" + w_(23, "A") + "WGluZwAAAA8AAAACAAACcQCA" + w_(16, "gICA") + w_(66, "/") + "8AAABhTEFNRTMuMTAwA8MAAAAAAAAAABQgJAUHQQAB9AAAAnGMHkkI" + w_(320, "A") + "//sQxAADgnABGiAAQBCqgCRMAAgEAH" + w_(15, "/") + "7+n/9FTuQsQH//////2NG0jWUGlio5gLQTOtIoeR2WX////X4s9Atb/JRVCbBUpeRUq" + w_(18, "/") + "9RUi0f2jn/+xDECgPCjAEQAABN4AAANIAAAAQVTEFNRTMuMTAw" + w_(97, "V") + "Q==", this.audio.loop = !1, this.audio.load();
8852
+ 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" + T_(23, "A") + "WGluZwAAAA8AAAACAAACcQCA" + T_(16, "gICA") + T_(66, "/") + "8AAABhTEFNRTMuMTAwA8MAAAAAAAAAABQgJAUHQQAB9AAAAnGMHkkI" + T_(320, "A") + "//sQxAADgnABGiAAQBCqgCRMAAgEAH" + T_(15, "/") + "7+n/9FTuQsQH//////2NG0jWUGlio5gLQTOtIoeR2WX////X4s9Atb/JRVCbBUpeRUq" + T_(18, "/") + "9RUi0f2jn/+xDECgPCjAEQAABN4AAANIAAAAQVTEFNRTMuMTAw" + T_(97, "V") + "Q==", this.audio.loop = !1, this.audio.load();
8837
8853
  else throw Error("Failed to create audio tag");
8838
8854
  }
8839
- }, E_, D_ = class {
8855
+ }, D_, O_ = class {
8840
8856
  constructor(t, n, r, i, a, o, s, c) {
8841
- 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 T_()), 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 C_()), e(this, "playbackRate", void 0), e(this, "reset", () => {}), e(this, "load", () => {
8857
+ 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 E_()), 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 w_()), e(this, "playbackRate", void 0), e(this, "reset", () => {}), e(this, "load", () => {
8842
8858
  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());
8843
8859
  }), e(this, "unload", () => {
8844
8860
  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;
@@ -8874,7 +8890,7 @@ var S_ = /* @__PURE__ */ new WeakMap(), C_ = class {
8874
8890
  e instanceof Error && this.emitter.emit("error", re(!1, e));
8875
8891
  }
8876
8892
  this.isVideoRenderingEnabled && this.videoPlayer.onDecodedFrame(e);
8877
- }), this.logger = n, this.emitter = t, this.pool = r, this.emitter.on("target buffer time", this.onTargetBufferTime), this.audioPlayer = y_.create(this.logger.createContext("AudioPlayerModule"), i, {
8893
+ }), this.logger = n, this.emitter = t, this.pool = r, this.emitter.on("target buffer time", this.onTargetBufferTime), this.audioPlayer = b_.create(this.logger.createContext("AudioPlayerModule"), i, {
8878
8894
  muted: a,
8879
8895
  reInitWhenStuck: !0,
8880
8896
  bufferTime: c
@@ -8885,7 +8901,7 @@ var S_ = /* @__PURE__ */ new WeakMap(), C_ = class {
8885
8901
  volume: this.volume,
8886
8902
  isMuted: this.muted
8887
8903
  });
8888
- }), this.videoPlayer = x_.create(this.logger.createContext("VideoPlayerModule"), this.audioPlayer, this.pool, void 0, s);
8904
+ }), this.videoPlayer = S_.create(this.logger.createContext("VideoPlayerModule"), this.audioPlayer, this.pool, void 0, s);
8889
8905
  }
8890
8906
  get volume() {
8891
8907
  return this.audioPlayer.volume;
@@ -8941,12 +8957,12 @@ var S_ = /* @__PURE__ */ new WeakMap(), C_ = class {
8941
8957
  this._isPaused = !0, this.audioPlayer.pause(), this.emitter.emit("media element state", "paused");
8942
8958
  }
8943
8959
  };
8944
- E_ = D_, e(D_, "create", (e, t, n, r, i, a, o, s) => new E_(e, t, n, r, i, a, o, s));
8960
+ D_ = O_, e(O_, "create", (e, t, n, r, i, a, o, s) => new D_(e, t, n, r, i, a, o, s));
8945
8961
  //#endregion
8946
8962
  //#region ../../libs/web-sdk/src/modules/ModernCanvasModule.ts
8947
- var O_, k_ = class {
8963
+ var k_, A_ = class {
8948
8964
  constructor(t, n, r, i, { muted: a, volume: s, type: c, poster: l, offscreenCanvas: u, bufferTime: d }) {
8949
- 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 C_()), e(this, "reset", () => {}), e(this, "load", () => {
8965
+ 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 w_()), e(this, "reset", () => {}), e(this, "load", () => {
8950
8966
  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(() => {
8951
8967
  if (!this.textTracks.language) {
8952
8968
  this.clearNativeTrackCues();
@@ -9033,7 +9049,7 @@ var O_, k_ = class {
9033
9049
  this.updateVolumeState(), !e.isMuted && !this.audioPlayer.isContextRunning && this.activateAudioPlayer().catch(o), e.isMuted || (this._userProvidedMuted = !1);
9034
9050
  }), this.mediaElement.on("media element state", (e) => {
9035
9051
  e === "paused" && this.audioPlayer.flushBuffer(), this.emitter.emit("media element state", e);
9036
- }), this.audioPlayer = y_.create(this.logger.createContext("AudioPlayerModule"), i, {
9052
+ }), this.audioPlayer = b_.create(this.logger.createContext("AudioPlayerModule"), i, {
9037
9053
  muted: !1,
9038
9054
  reInitWhenStuck: !1,
9039
9055
  bufferTime: d
@@ -9041,7 +9057,7 @@ var O_, k_ = class {
9041
9057
  this.isDisconnected = !0;
9042
9058
  }), this.audioPlayer.on("state change", (e) => {
9043
9059
  e === "suspended" || e === "interrupted" ? this.mediaElement.muted = !0 : e === "running" && (this.mediaElement.muted = this._userProvidedMuted || document.visibilityState === "hidden"), this.updateVolumeState();
9044
- }), this.videoPlayer = x_.create(this.logger.createContext("VideoPlayerModule"), this.audioPlayer, this.pool, this.mediaElement.element, () => this.reconnectCanvasStream(), this.onVideoPlayerError), this.volumeState = {
9060
+ }), this.videoPlayer = S_.create(this.logger.createContext("VideoPlayerModule"), this.audioPlayer, this.pool, this.mediaElement.element, () => this.reconnectCanvasStream(), this.onVideoPlayerError), this.volumeState = {
9045
9061
  volume: this.volume,
9046
9062
  isMuted: this.muted
9047
9063
  };
@@ -9099,10 +9115,10 @@ var O_, k_ = class {
9099
9115
  this.mediaElement.pause();
9100
9116
  }
9101
9117
  };
9102
- O_ = k_, e(k_, "create", (e, t, n, r, i) => new O_(e, t, n, r, i));
9118
+ k_ = A_, e(A_, "create", (e, t, n, r, i) => new k_(e, t, n, r, i));
9103
9119
  //#endregion
9104
9120
  //#region ../../libs/mse/src/AsyncSourceBuffer.ts
9105
- var A_ = () => (e) => j_(e.buffered.start(0), e.buffered.end(e.buffered.length - 1)), j_ = (e, t) => (n) => n.remove(Math.max(0, e), Math.min(Infinity, t)), M_ = (e) => (t) => t.appendBuffer(e), N_ = (e) => (t) => t.changeType(e), P_ = (e) => (t) => e(t), F_ = class {
9121
+ var j_ = () => (e) => M_(e.buffered.start(0), e.buffered.end(e.buffered.length - 1)), M_ = (e, t) => (n) => n.remove(Math.max(0, e), Math.min(Infinity, t)), N_ = (e) => (t) => t.appendBuffer(e), P_ = (e) => (t) => t.changeType(e), F_ = (e) => (t) => e(t), I_ = class {
9106
9122
  constructor(t) {
9107
9123
  e(this, "commandQueue", []), e(this, "sourceBuffer", void 0), e(this, "errorCallback", void 0), e(this, "currentInit", void 0), e(this, "setErrorCallback", (e) => {
9108
9124
  this.errorCallback = e;
@@ -9116,30 +9132,30 @@ var A_ = () => (e) => j_(e.buffered.start(0), e.buffered.end(e.buffered.length -
9116
9132
  }
9117
9133
  }), e(this, "appendBuffer", (e, t) => new Promise((n, r) => {
9118
9134
  if (t && this.currentInit !== t) {
9119
- let e = new Dt(M_(t), n, r);
9135
+ let e = new Dt(N_(t), n, r);
9120
9136
  this.commandQueue.push(e), this.currentInit = t;
9121
9137
  }
9122
- let i = new Dt(M_(e), n, r);
9138
+ let i = new Dt(N_(e), n, r);
9123
9139
  this.commandQueue.push(i), this.handleQueue();
9124
9140
  })), e(this, "execute", (e) => new Promise((t, n) => {
9125
- let r = new Dt(P_(e), t, n);
9141
+ let r = new Dt(F_(e), t, n);
9126
9142
  this.commandQueue.push(r), this.handleQueue();
9127
9143
  })), e(this, "buffered", () => this.sourceBuffer.buffered), e(this, "removeFromMediaSource", (e) => {
9128
9144
  this.dispose(), e.removeSourceBuffer(this.sourceBuffer);
9129
9145
  }), e(this, "dispose", () => {
9130
9146
  this.sourceBuffer.removeEventListener("updateend", this.handleQueue), this.sourceBuffer.removeEventListener("error", this.onError), this.commandQueue = [], this.errorCallback = void 0;
9131
9147
  }), e(this, "changeType", (e) => new Promise((t, n) => {
9132
- let r = new Dt(N_(e), t, n);
9148
+ let r = new Dt(P_(e), t, n);
9133
9149
  this.commandQueue.push(r), this.handleQueue();
9134
9150
  })), e(this, "removeBuffer", (e, t) => new Promise((n, r) => {
9135
- let i = new Dt(j_(e, t), n, r);
9151
+ let i = new Dt(M_(e, t), n, r);
9136
9152
  this.commandQueue.push(i), this.handleQueue();
9137
9153
  })), e(this, "flush", () => new Promise((e, t) => {
9138
- let n = new Dt(A_, e, t);
9154
+ let n = new Dt(j_, e, t);
9139
9155
  this.commandQueue.push(n), this.handleQueue();
9140
9156
  })), this.sourceBuffer = t, this.sourceBuffer.addEventListener("updateend", this.handleQueue), this.sourceBuffer.addEventListener("error", this.onError);
9141
9157
  }
9142
- }, I_ = class extends _e {
9158
+ }, L_ = class extends _e {
9143
9159
  constructor() {
9144
9160
  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) => {
9145
9161
  let t = e;
@@ -9155,7 +9171,7 @@ var A_ = () => (e) => j_(e.buffered.start(0), e.buffered.end(e.buffered.length -
9155
9171
  this.mediaSource.endOfStream();
9156
9172
  } catch (e) {}
9157
9173
  e.srcObject && (e.srcObject = null), e.src !== "" && (URL.revokeObjectURL(e.src), e.removeAttribute("src")), e.load();
9158
- }), e(this, "addSourceBuffer", (e) => new F_(this.mediaSource.addSourceBuffer(e))), e(this, "removeSourceBuffer", (e) => {
9174
+ }), e(this, "addSourceBuffer", (e) => new I_(this.mediaSource.addSourceBuffer(e))), e(this, "removeSourceBuffer", (e) => {
9159
9175
  e.removeFromMediaSource(this.mediaSource);
9160
9176
  }), e(this, "endOfStream", (e) => {
9161
9177
  this.mediaSource.endOfStream(e);
@@ -9172,13 +9188,13 @@ var A_ = () => (e) => j_(e.buffered.start(0), e.buffered.end(e.buffered.length -
9172
9188
  }), this.mediaSource.addEventListener("sourceopen", this.onSourceOpen), this.mediaSource.addEventListener("sourceclose", this.onSourceClosed), this.mediaSource.addEventListener("sourceended", this.onSourceEnded);
9173
9189
  }
9174
9190
  };
9175
- e(I_, "isTypeSupported", (e) => {
9191
+ e(L_, "isTypeSupported", (e) => {
9176
9192
  var t, n;
9177
9193
  return (t = (n = Ve()) == null ? void 0 : n.isTypeSupported(e)) == null ? !1 : t;
9178
9194
  });
9179
9195
  //#endregion
9180
9196
  //#region ../../libs/web-sdk/src/modules/MseModule.ts
9181
- var L_, R_ = class {
9197
+ var R_, z_ = class {
9182
9198
  constructor() {
9183
9199
  e(this, "initSegments", /* @__PURE__ */ new Map()), e(this, "set", (e, t, n) => {
9184
9200
  var r;
@@ -9190,7 +9206,7 @@ var L_, R_ = class {
9190
9206
  });
9191
9207
  }
9192
9208
  };
9193
- function z_(e, { mediaSource: t, mimeType: n, codec: r }) {
9209
+ function B_(e, { mediaSource: t, mimeType: n, codec: r }) {
9194
9210
  return C(C({}, e), {}, {
9195
9211
  state: "initialized",
9196
9212
  mimeType: n,
@@ -9202,10 +9218,10 @@ function z_(e, { mediaSource: t, mimeType: n, codec: r }) {
9202
9218
  lastBufferCleanupTime: Date.now()
9203
9219
  });
9204
9220
  }
9205
- function B_({ initSegments: e, pendingSamples: t }) {
9221
+ function V_({ initSegments: e, pendingSamples: t }) {
9206
9222
  return {
9207
9223
  state: "uninitialized",
9208
- initSegments: e == null ? new R_() : e,
9224
+ initSegments: e == null ? new z_() : e,
9209
9225
  sequenceNumber: 0,
9210
9226
  isWorkingOnPendingSamples: !1,
9211
9227
  hasFirstSync: t.some((e) => e.isSync),
@@ -9215,10 +9231,10 @@ function B_({ initSegments: e, pendingSamples: t }) {
9215
9231
  successfulAppendCalls: 0
9216
9232
  };
9217
9233
  }
9218
- var V_ = class {
9234
+ var H_ = class {
9219
9235
  constructor(n, a, s) {
9220
9236
  var u = this;
9221
- 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 I_()), 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", () => {
9237
+ 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 L_()), 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", () => {
9222
9238
  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);
9223
9239
  }), e(this, "unload", () => {
9224
9240
  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) => {
@@ -9255,7 +9271,7 @@ var V_ = class {
9255
9271
  var n, r, i;
9256
9272
  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;
9257
9273
  for (; c < o.length && !((i = o[c]) != null && i.isSync);) c++;
9258
- let l = B_({
9274
+ let l = V_({
9259
9275
  pendingSamples: o,
9260
9276
  initSegments: s
9261
9277
  });
@@ -9266,7 +9282,7 @@ var V_ = class {
9266
9282
  this.trackContexts.forEach((e, n) => {
9267
9283
  if (t.has(n)) return;
9268
9284
  e.state === "initialized" && this.mediaSource.isOpen() && this.mediaSource.removeSourceBuffer(e.sourceBuffer);
9269
- let r = B_({
9285
+ let r = V_({
9270
9286
  pendingSamples: [],
9271
9287
  initSegments: e.initSegments
9272
9288
  });
@@ -9293,12 +9309,12 @@ var V_ = class {
9293
9309
  }
9294
9310
  for (let t of e) {
9295
9311
  let e = u.trackContexts.get(t.type);
9296
- if (e || (e = B_({
9312
+ if (e || (e = V_({
9297
9313
  pendingSamples: [],
9298
- initSegments: new R_()
9314
+ initSegments: new z_()
9299
9315
  }), u.trackContexts.set(t.type, e)), e.state === "initialized") t.mimeType !== e.sourceBufferMimeType && (yield e.sourceBuffer.changeType(t.mimeType), e.sourceBufferMimeType = t.mimeType);
9300
9316
  else {
9301
- let n = z_(e, {
9317
+ let n = B_(e, {
9302
9318
  mimeType: t.mimeType,
9303
9319
  mediaSource: u.mediaSource,
9304
9320
  codec: t.codec
@@ -9322,7 +9338,7 @@ var V_ = class {
9322
9338
  };
9323
9339
  }), e(this, "getNextBufferedRangeStart", (e) => {
9324
9340
  let t = this.getCommonBufferedRangesForCurrentTracks();
9325
- if (t) return U_(e, t);
9341
+ if (t) return W_(e, t);
9326
9342
  }), e(this, "getVideoKeyframeTimestamps", () => this.videoKeyframeTimestamps), e(this, "init", ({ initSegment: e, mimeType: t }) => {
9327
9343
  this.logger.debug("Added init segment", {
9328
9344
  channel: e.channelId,
@@ -9421,7 +9437,7 @@ var V_ = class {
9421
9437
  let t = (e.timestamp + ((n = e.compositionTimeOffset) == null ? 0 : n)) / e.timescale * 1e3, r = this.videoKeyframeTimestamps[this.videoKeyframeTimestamps.length - 1];
9422
9438
  r !== void 0 && t < r && (this.videoKeyframeTimestamps = []), this.videoKeyframeTimestamps.push(t), this.videoKeyframeTimestamps.length > 20 && (this.videoKeyframeTimestamps = this.videoKeyframeTimestamps.slice(-20));
9423
9439
  }
9424
- t.state !== "uninitialized" && (t.isWorkingOnPendingSamples || J_(t, this.append, this.maxChunkSize).catch((n) => {
9440
+ t.state !== "uninitialized" && (t.isWorkingOnPendingSamples || Y_(t, this.append, this.maxChunkSize).catch((n) => {
9425
9441
  if (t.isWorkingOnPendingSamples = !1, !this.isReopening) {
9426
9442
  if (!this.isCurrentTrackContext(e.type, t)) {
9427
9443
  this.logger.debug("Suppressing append error from stale track context", { type: e.type });
@@ -9505,14 +9521,14 @@ var V_ = class {
9505
9521
  if (this.mediaSource.isClosed()) return;
9506
9522
  let e = this.getInitializedTrackBuffers();
9507
9523
  if (e.length !== 0) return this.getCommonBufferedRanges(e);
9508
- }), e(this, "getCommonBufferedRanges", (e) => e.slice(1).reduce((e, t) => W_(e, t), e[0] ? Array.from(e[0]) : [])), e(this, "getPlaybackStateForBufferedRanges", (e, t) => H_(e, t) ? "playing" : "buffering"), this.logger = n, this.mediaElement = s, this.emitter = a;
9524
+ }), e(this, "getCommonBufferedRanges", (e) => e.slice(1).reduce((e, t) => G_(e, t), e[0] ? Array.from(e[0]) : [])), e(this, "getPlaybackStateForBufferedRanges", (e, t) => U_(e, t) ? "playing" : "buffering"), this.logger = n, this.mediaElement = s, this.emitter = a;
9509
9525
  }
9510
9526
  };
9511
- L_ = V_, e(V_, "create", (e, t, n) => {
9512
- let r = new L_(e, t, n);
9527
+ R_ = H_, e(H_, "create", (e, t, n) => {
9528
+ let r = new R_(e, t, n);
9513
9529
  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;
9514
9530
  });
9515
- var H_ = (e, t) => t.some((t) => t.start <= e && e < t.end), U_ = (e, t) => {
9531
+ var U_ = (e, t) => t.some((t) => t.start <= e && e < t.end), W_ = (e, t) => {
9516
9532
  for (let r = 0; r < t.length; r++) {
9517
9533
  let i = t[r];
9518
9534
  if (i) {
@@ -9523,7 +9539,7 @@ var H_ = (e, t) => t.some((t) => t.start <= e && e < t.end), U_ = (e, t) => {
9523
9539
  }
9524
9540
  }
9525
9541
  }
9526
- }, W_ = (e, t) => {
9542
+ }, G_ = (e, t) => {
9527
9543
  let n = [], r = 0, i = 0;
9528
9544
  for (; r < e.length && i < t.length;) {
9529
9545
  let a = e[r], o = t[i];
@@ -9535,20 +9551,20 @@ var H_ = (e, t) => t.some((t) => t.start <= e && e < t.end), U_ = (e, t) => {
9535
9551
  }), a.end <= o.end ? r++ : i++;
9536
9552
  }
9537
9553
  return n;
9538
- }, G_ = (e, t) => {
9554
+ }, K_ = (e, t) => {
9539
9555
  var n;
9540
9556
  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;
9541
9557
  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;
9542
- }, K_ = 32, q_ = (e) => {
9558
+ }, q_ = 32, J_ = (e) => {
9543
9559
  let t = e.pendingSamplesOffset;
9544
9560
  if (t !== 0) {
9545
9561
  if (t >= e.pendingSamples.length) {
9546
9562
  e.pendingSamples = [], e.pendingSamplesOffset = 0;
9547
9563
  return;
9548
9564
  }
9549
- t < K_ || t * 2 < e.pendingSamples.length || (e.pendingSamples = e.pendingSamples.slice(t), e.pendingSamplesOffset = 0);
9565
+ t < q_ || t * 2 < e.pendingSamples.length || (e.pendingSamples = e.pendingSamples.slice(t), e.pendingSamplesOffset = 0);
9550
9566
  }
9551
- }, J_ = function() {
9567
+ }, Y_ = function() {
9552
9568
  var e = t(function* (e, t, n) {
9553
9569
  for (e.isWorkingOnPendingSamples = !0; e.pendingSamplesOffset < e.pendingSamples.length;) {
9554
9570
  let r = [], i = e.pendingSamplesOffset;
@@ -9556,7 +9572,7 @@ var H_ = (e, t) => t.some((t) => t.start <= e && e < t.end), U_ = (e, t) => {
9556
9572
  i = t;
9557
9573
  let a = e.pendingSamples[t], o = e.pendingSamples[t + 1];
9558
9574
  if (a && (r.push(a), o)) {
9559
- if (G_(a, o)) break;
9575
+ if (K_(a, o)) break;
9560
9576
  let e = (a.timestamp + a.duration) / a.timescale;
9561
9577
  if (o.timestamp / o.timescale - e > .1) break;
9562
9578
  }
@@ -9564,14 +9580,14 @@ var H_ = (e, t) => t.some((t) => t.start <= e && e < t.end), U_ = (e, t) => {
9564
9580
  }
9565
9581
  let a = r[0];
9566
9582
  if (!a) break;
9567
- yield t(r, e.previousSample ? G_(e.previousSample, a) : !0), e.pendingSamplesOffset = i + 1, e.previousSample = r[r.length - 1], q_(e);
9583
+ yield t(r, e.previousSample ? K_(e.previousSample, a) : !0), e.pendingSamplesOffset = i + 1, e.previousSample = r[r.length - 1], J_(e);
9568
9584
  }
9569
9585
  e.isWorkingOnPendingSamples = !1;
9570
9586
  });
9571
9587
  return function(t, n, r) {
9572
9588
  return e.apply(this, arguments);
9573
9589
  };
9574
- }(), Y_, X_ = class {
9590
+ }(), X_, Z_ = class {
9575
9591
  constructor(n, r) {
9576
9592
  var i = this;
9577
9593
  e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "element", void 0), e(this, "pictureInPictureWindow", void 0), e(this, "unload", () => {
@@ -9603,10 +9619,10 @@ var H_ = (e, t) => t.some((t) => t.start <= e && e < t.end), U_ = (e, t) => {
9603
9619
  }()), e(this, "isWebkitPresentationModeSupported", () => !!this.element && xt(this.element)), this.emitter = n, this.logger = r, this.emitter.on("add picture in picture listener", this.onEnablePictureInPicture);
9604
9620
  }
9605
9621
  };
9606
- Y_ = X_, e(X_, "create", (e, t) => new Y_(e, t));
9622
+ X_ = Z_, e(Z_, "create", (e, t) => new X_(e, t));
9607
9623
  //#endregion
9608
9624
  //#region ../../libs/web-sdk/src/modules/PlaybackModule.ts
9609
- var Z_, Q_ = class {
9625
+ var Q_, $_ = class {
9610
9626
  constructor(t, n, r, i) {
9611
9627
  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", () => {
9612
9628
  this.emitter.off("buffer state", this.onBufferedStateChanged), this.emitter.off("needs user input", this.onNeedsUserInput);
@@ -9624,24 +9640,24 @@ var Z_, Q_ = class {
9624
9640
  }), 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);
9625
9641
  }
9626
9642
  };
9627
- Z_ = Q_, e(Q_, "create", (e, t, n, r) => new Z_(e, t, n, r));
9643
+ Q_ = $_, e($_, "create", (e, t, n, r) => new Q_(e, t, n, r));
9628
9644
  //#endregion
9629
9645
  //#region ../../libs/web-sdk/src/modules/QualityOfServiceModule.ts
9630
- var $_, ev = () => ({
9646
+ var ev, tv = () => ({
9631
9647
  upgradesFromLevel: [],
9632
9648
  downgradesFromLevel: [],
9633
9649
  bufferingRanges: [],
9634
9650
  activeRanges: [],
9635
9651
  decodeRate: 2 ** 53 - 1
9636
- }), tv = () => ({
9652
+ }), nv = () => ({
9637
9653
  levels: {},
9638
9654
  levelDowngrades: [],
9639
9655
  levelUpgrades: [],
9640
9656
  bufferFullness: 0,
9641
- general: ev()
9642
- }), nv = class {
9657
+ general: tv()
9658
+ }), rv = class {
9643
9659
  constructor(t, n, r) {
9644
- e(this, "minBufferFullnessLengthForRegression", 6), e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "timers", j.create()), e(this, "metrics", tv()), 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", () => {
9660
+ e(this, "minBufferFullnessLengthForRegression", 6), e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "timers", j.create()), e(this, "metrics", nv()), 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", () => {
9645
9661
  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);
9646
9662
  }), e(this, "unload", () => {
9647
9663
  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();
@@ -9709,14 +9725,14 @@ var $_, ev = () => ({
9709
9725
  let d = !1;
9710
9726
  if (e.from) {
9711
9727
  var f;
9712
- let e = (f = this.metrics.levels[l]) == null ? ev() : f;
9728
+ let e = (f = this.metrics.levels[l]) == null ? tv() : f;
9713
9729
  l < u ? e.upgradesFromLevel.push(Date.now()) : e.downgradesFromLevel.push(Date.now()), sn(e.activeRanges);
9714
9730
  let t = e.bufferingRanges[e.bufferingRanges.length - 1];
9715
9731
  d = !!t && !t.end, sn(e.bufferingRanges), this.metrics.levels[l] = e;
9716
9732
  }
9717
9733
  if (e.to) {
9718
9734
  var p;
9719
- let e = (p = this.metrics.levels[u]) == null ? ev() : p;
9735
+ let e = (p = this.metrics.levels[u]) == null ? tv() : p;
9720
9736
  cn(e.activeRanges), d && cn(e.bufferingRanges), this.metrics.levels[u] = e, this.currentLevel = u;
9721
9737
  }
9722
9738
  }), e(this, "onBufferFullness", (e) => {
@@ -9785,10 +9801,10 @@ var $_, ev = () => ({
9785
9801
  cn(this.metrics.general.activeRanges);
9786
9802
  }
9787
9803
  };
9788
- $_ = nv, e(nv, "create", (e, t, n) => new $_(e, t, n));
9804
+ ev = rv, e(rv, "create", (e, t, n) => new ev(e, t, n));
9789
9805
  //#endregion
9790
9806
  //#region ../../libs/web-sdk/src/modules/RenditionsModule.ts
9791
- var rv, iv = class {
9807
+ var iv, av = class {
9792
9808
  constructor(t, n) {
9793
9809
  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", () => {
9794
9810
  this.emitter.off("renditions", this.onRenditions), this.emitter.off("subscription changed", this.onSubscriptionChanged);
@@ -9863,10 +9879,10 @@ var rv, iv = class {
9863
9879
  }), 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);
9864
9880
  }
9865
9881
  };
9866
- rv = iv, e(iv, "create", (e, t) => new rv(e, t));
9882
+ iv = av, e(av, "create", (e, t) => new iv(e, t));
9867
9883
  //#endregion
9868
9884
  //#region ../../libs/web-sdk/src/modules/SubscriptionModule.ts
9869
- var av, ov = (e) => JSON.parse(JSON.stringify(e)), sv = 1e4, cv = class {
9885
+ var ov, sv = (e) => JSON.parse(JSON.stringify(e)), cv = 1e4, lv = class {
9870
9886
  constructor(t, n, r) {
9871
9887
  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", () => {
9872
9888
  this.logger.debug("Unloading module..."), this.timers.unload(), this.emitter.off("subscription changed", this.onSubscriptionChanged), this.logger.debug("Unloaded module");
@@ -9904,23 +9920,23 @@ var av, ov = (e) => JSON.parse(JSON.stringify(e)), sv = 1e4, cv = class {
9904
9920
  this.logger.debug("onSubscriptionChanged", {
9905
9921
  to: e,
9906
9922
  reset: t
9907
- }), t ? this.targetSubscription = ov(this.currentSubscription) : this.currentSubscription = ov(e), this._isSwitchingSubscription = this.isNewSubscription();
9923
+ }), t ? this.targetSubscription = sv(this.currentSubscription) : this.currentSubscription = sv(e), this._isSwitchingSubscription = this.isNewSubscription();
9908
9924
  }), e(this, "scheduleSubscriptionChange", () => {
9909
- this.targetSubscription = ov(this.targetSubscription), this._isSwitchingSubscription = this.isNewSubscription();
9925
+ this.targetSubscription = sv(this.targetSubscription), this._isSwitchingSubscription = this.isNewSubscription();
9910
9926
  let e = this.currentSubscription.channelId, t = this.targetSubscription.channelId, n = e !== t;
9911
9927
  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(() => {
9912
- this.currentSubscription.channelId === e && this.targetSubscription.channelId === t && (this.logger.warn("Channel switch timeout", t), this.targetSubscription = ov(this.currentSubscription), this.emitter.emit("channel switch timeout", t));
9913
- }, sv), this.pendingSubscriptionTimeoutId = this.timers.setTimeout(() => this.emitter.emit("send signal", {
9928
+ this.currentSubscription.channelId === e && this.targetSubscription.channelId === t && (this.logger.warn("Channel switch timeout", t), this.targetSubscription = sv(this.currentSubscription), this.emitter.emit("channel switch timeout", t));
9929
+ }, cv), this.pendingSubscriptionTimeoutId = this.timers.setTimeout(() => this.emitter.emit("send signal", {
9914
9930
  type: "subscribe",
9915
9931
  subscription: this.getTargetSubscription()
9916
9932
  }), 0));
9917
- }), this.logger = t, this.targetSubscription = n, this.currentSubscription = ov(n), this.emitter = r, this.emitter.on("subscription changed", this.onSubscriptionChanged);
9933
+ }), this.logger = t, this.targetSubscription = n, this.currentSubscription = sv(n), this.emitter = r, this.emitter.on("subscription changed", this.onSubscriptionChanged);
9918
9934
  }
9919
9935
  };
9920
- av = cv, e(cv, "create", (e, t, n) => new av(e, n, t));
9936
+ ov = lv, e(lv, "create", (e, t, n) => new ov(e, n, t));
9921
9937
  //#endregion
9922
9938
  //#region ../../libs/web-sdk/src/modules/SyncModule.ts
9923
- var lv, uv = 5e3, dv = () => Ye() || Ke(), fv = (e) => e && dv() ? 100 : 0, pv = (e) => (t) => t > e, mv = {
9939
+ var uv, dv = 5e3, fv = () => Ye() || Ke(), pv = (e) => e && fv() ? 100 : 0, mv = (e) => (t) => t > e, hv = {
9924
9940
  seek: {
9925
9941
  toleranceMs: 200,
9926
9942
  toleranceMaxMs: 2500,
@@ -9952,7 +9968,7 @@ var lv, uv = 5e3, dv = () => Ye() || Ke(), fv = (e) => e && dv() ? 100 : 0, pv =
9952
9968
  decayCooldownMultiplier: 3,
9953
9969
  decayCheckInterval: 15e3
9954
9970
  }
9955
- }, hv = class {
9971
+ }, gv = class {
9956
9972
  get driftSamplesToCollect() {
9957
9973
  return this._driftSamplesToCollect;
9958
9974
  }
@@ -9998,7 +10014,7 @@ var lv, uv = 5e3, dv = () => Ye() || Ke(), fv = (e) => e && dv() ? 100 : 0, pv =
9998
10014
  }), e(this, "processSample", (e) => {
9999
10015
  var t;
10000
10016
  if (!e.channelId) throw Error("Sample must be assigned to a channel");
10001
- this.currentChannelId || (this.currentChannelId = e.channelId), this.timestampOffset || (this.timestampOffset = e.timestamp / e.timescale * 1e3 - uv);
10017
+ this.currentChannelId || (this.currentChannelId = e.channelId), this.timestampOffset || (this.timestampOffset = e.timestamp / e.timescale * 1e3 - dv);
10002
10018
  let n = e.type === "video" && e.isSync;
10003
10019
  if (this.currentChannelId !== e.channelId) {
10004
10020
  let t = 2 ** 53 - 1;
@@ -10015,7 +10031,7 @@ var lv, uv = 5e3, dv = () => Ye() || Ke(), fv = (e) => e && dv() ? 100 : 0, pv =
10015
10031
  this.currentChannelId || (this.currentChannelId = e);
10016
10032
  let r = t.mediaType();
10017
10033
  if (!r) throw Error("Fragment must have a media type");
10018
- this.timestampOffset || (this.timestampOffset = t.baseMediaDecodeTime() / t.timescale() * 1e3 - uv);
10034
+ this.timestampOffset || (this.timestampOffset = t.baseMediaDecodeTime() / t.timescale() * 1e3 - dv);
10019
10035
  let i = t.mediaType() === "video" && t.startsWithKeyframe();
10020
10036
  if (this.currentChannelId !== e) {
10021
10037
  let t = 2 ** 53 - 1;
@@ -10123,7 +10139,7 @@ var lv, uv = 5e3, dv = () => Ye() || Ke(), fv = (e) => e && dv() ? 100 : 0, pv =
10123
10139
  return;
10124
10140
  }
10125
10141
  if (n >= this.getEffectiveSeekToleranceMs() || n < this.currentTimeshiftToleranceMs()) return;
10126
- let r = Date.now() - this.config.seek.timeoutMs * this.state.timeshiftToleranceMultiplier, i = this.timeshiftAdjustmentTimestamps.filter(pv(r)).length;
10142
+ let r = Date.now() - this.config.seek.timeoutMs * this.state.timeshiftToleranceMultiplier, i = this.timeshiftAdjustmentTimestamps.filter(mv(r)).length;
10127
10143
  if (i && this.state.timeshiftToleranceMultiplier > 2) {
10128
10144
  this.logger.debug("Too many timeshifts within sliding window", {
10129
10145
  timeshiftCooldownThreshold: r,
@@ -10203,7 +10219,7 @@ var lv, uv = 5e3, dv = () => Ye() || Ke(), fv = (e) => e && dv() ? 100 : 0, pv =
10203
10219
  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;
10204
10220
  let i = r ? t : At(this.driftSamples.items());
10205
10221
  if (!r && this.tryPlaybackRateSync(i) || !r && this.shouldSkipNormalSeek(i)) return;
10206
- let a = Date.now() - this.config.seek.timeoutMs * this.state.seekToleranceMultiplier, o = this.seekAdjustmentTimestamps.filter(pv(a)).length, s = this.currentEmergencySeekToleranceMs(), c = i > 0 && i >= s;
10222
+ let a = Date.now() - this.config.seek.timeoutMs * this.state.seekToleranceMultiplier, o = this.seekAdjustmentTimestamps.filter(mv(a)).length, s = this.currentEmergencySeekToleranceMs(), c = i > 0 && i >= s;
10207
10223
  if (o && this.state.seekToleranceMultiplier > 2 && !r && !c) {
10208
10224
  this.logger.debug("Too many seek adjustments within sliding window", {
10209
10225
  seekCooldownThreshold: a,
@@ -10234,11 +10250,11 @@ var lv, uv = 5e3, dv = () => Ye() || Ke(), fv = (e) => e && dv() ? 100 : 0, pv =
10234
10250
  let t = n >= e - this.config.seek.keyframeSearchBeforeMs, r = n <= e + this.config.seek.keyframeSearchAfterMs;
10235
10251
  if (t && r) return n;
10236
10252
  }
10237
- }), this.logger = n, this.emitter = t, this.playbackSource = r, this.bufferSource = i, this.usesMse = o, this.seekOvershoot = fv(o), this.config = {
10238
- seek: C({}, mv.seek),
10239
- timeshift: C({}, mv.timeshift),
10240
- playbackRate: C({}, mv.playbackRate),
10241
- backoff: C({}, mv.backoff)
10253
+ }), this.logger = n, this.emitter = t, this.playbackSource = r, this.bufferSource = i, this.usesMse = o, this.seekOvershoot = pv(o), this.config = {
10254
+ seek: C({}, hv.seek),
10255
+ timeshift: C({}, hv.timeshift),
10256
+ playbackRate: C({}, hv.playbackRate),
10257
+ backoff: C({}, hv.backoff)
10242
10258
  }, this.config.timeshift.enabled = a, o || (this.config.seek.toleranceMs = 50, this.config.timeshift.toleranceMs = 20, this.config.seek.aheadToleranceMs = 40), this.state = {
10243
10259
  seekToleranceMultiplier: 1,
10244
10260
  timeshiftToleranceMultiplier: 1
@@ -10300,10 +10316,10 @@ var lv, uv = 5e3, dv = () => Ye() || Ke(), fv = (e) => e && dv() ? 100 : 0, pv =
10300
10316
  return this.serverCurrentTime - this.playbackSource.currentTime;
10301
10317
  }
10302
10318
  };
10303
- lv = hv, e(hv, "create", (e, t, n, r, i, a = !0) => new lv(e, t, n, r, i, a));
10319
+ uv = gv, e(gv, "create", (e, t, n, r, i, a = !0) => new uv(e, t, n, r, i, a));
10304
10320
  //#endregion
10305
10321
  //#region ../../libs/web-sdk/src/modules/TelemetryModule.ts
10306
- var gv, _v = {
10322
+ var _v, vv = {
10307
10323
  enabled: !0,
10308
10324
  interval: 3e4,
10309
10325
  includeErrors: !0,
@@ -10312,11 +10328,11 @@ var gv, _v = {
10312
10328
  maxRetries: 10,
10313
10329
  maxErrorReports: 50,
10314
10330
  maxEvents: 50
10315
- }, vv = (e, t) => C(C({}, t), {}, {
10331
+ }, yv = (e, t) => C(C({}, t), {}, {
10316
10332
  type: e,
10317
10333
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
10318
10334
  discriminator: "web"
10319
- }), yv = class {
10335
+ }), bv = class {
10320
10336
  constructor(n, r, i, a) {
10321
10337
  var o = this;
10322
10338
  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", () => {
@@ -10333,7 +10349,7 @@ var gv, _v = {
10333
10349
  initiator: "interval"
10334
10350
  }, n = {}) => {
10335
10351
  if (!this.options.includeStats) return;
10336
- let r = this.parentContext.getStatistics(), i = vv("stats", C(C(C({}, n), r), {}, {
10352
+ let r = this.parentContext.getStatistics(), i = yv("stats", C(C(C({}, n), r), {}, {
10337
10353
  isFinal: e,
10338
10354
  initiator: t,
10339
10355
  count: this.statsCount++
@@ -10341,7 +10357,7 @@ var gv, _v = {
10341
10357
  this.unsentLines.push(i);
10342
10358
  }), e(this, "addEvent", (e) => {
10343
10359
  if (!this.options.includeEvents || this.eventCount > this.options.maxEvents) return;
10344
- let t = vv("event", C(C({}, this.parentContext.getStatistics()), e));
10360
+ let t = yv("event", C(C({}, this.parentContext.getStatistics()), e));
10345
10361
  this.eventCount++, this.unsentLines.push(t);
10346
10362
  }), e(this, "getStatistics", () => ({ errorCount: this.errorCount })), e(this, "send", function() {
10347
10363
  var e = t(function* (e) {
@@ -10387,15 +10403,15 @@ var gv, _v = {
10387
10403
  if (t && e instanceof g) {
10388
10404
  if (this.errorCount++, this.errorCount > n) return;
10389
10405
  let t = this.parentContext.getStatistics();
10390
- this.unsentLines.push(vv("error", C(C({}, t), e.toStringifiable())));
10406
+ this.unsentLines.push(yv("error", C(C({}, t), e.toStringifiable())));
10391
10407
  }
10392
- }), this.logger = n, this.emitter = r, this.options = C(C({}, _v), i), this.parentContext = a;
10408
+ }), this.logger = n, this.emitter = r, this.options = C(C({}, vv), i), this.parentContext = a;
10393
10409
  }
10394
10410
  };
10395
- gv = yv, e(yv, "create", (e, t, n, r) => new gv(e, t, n, r));
10411
+ _v = bv, e(bv, "create", (e, t, n, r) => new _v(e, t, n, r));
10396
10412
  //#endregion
10397
10413
  //#region ../../libs/web-sdk/src/modules/UnpauseModule.ts
10398
- var bv, xv = class {
10414
+ var xv, Sv = class {
10399
10415
  constructor(t, n, r) {
10400
10416
  e(this, "logger", void 0), e(this, "element", void 0), e(this, "documentState", void 0), e(this, "timers", new j()), e(this, "unload", () => {
10401
10417
  this.timers.unload();
@@ -10404,10 +10420,10 @@ var bv, xv = class {
10404
10420
  }), this.logger = t, this.element = n, this.documentState = r, this.timers.setInterval(this.unpause, 100);
10405
10421
  }
10406
10422
  };
10407
- bv = xv, e(xv, "create", (e, t, n) => new bv(e, t, n));
10423
+ xv = Sv, e(Sv, "create", (e, t, n) => new xv(e, t, n));
10408
10424
  //#endregion
10409
10425
  //#region ../../libs/web-sdk/src/OptionsProvider.ts
10410
- var Sv = [
10426
+ var Cv = [
10411
10427
  "minBufferTime",
10412
10428
  "maxBufferTime",
10413
10429
  "burstEnabled",
@@ -10417,10 +10433,10 @@ var Sv = [
10417
10433
  "offscreenCanvasEnabled",
10418
10434
  "videoCodecs"
10419
10435
  ];
10420
- function Cv(e) {
10421
- return Sv.includes(e);
10436
+ function wv(e) {
10437
+ return Cv.includes(e);
10422
10438
  }
10423
- var wv = class {
10439
+ var Tv = class {
10424
10440
  constructor(t) {
10425
10441
  e(this, "options", void 0), e(this, "overrides", /* @__PURE__ */ new Map()), this.options = t;
10426
10442
  }
@@ -10434,7 +10450,7 @@ var wv = class {
10434
10450
  this.options[e] = t;
10435
10451
  }
10436
10452
  get(e, t) {
10437
- if (t && Cv(e)) {
10453
+ if (t && wv(e)) {
10438
10454
  var n;
10439
10455
  let r = (n = this.overrides.get(t)) == null ? void 0 : n[e];
10440
10456
  if (r !== void 0) return r;
@@ -10445,7 +10461,7 @@ var wv = class {
10445
10461
  var n;
10446
10462
  return (n = this.overrides.get(t)) == null ? void 0 : n[e];
10447
10463
  }
10448
- }, Tv = 6, Ev = (e) => {
10464
+ }, Ev = 6, Dv = (e) => {
10449
10465
  let t = [e], n = 0, r = 0, i = !1, a = (e, t) => {
10450
10466
  var i, a;
10451
10467
  if (e.flags && Go(e.flags)) {
@@ -10457,7 +10473,7 @@ var wv = class {
10457
10473
  return u > 0 && (r = u), C(C({}, e), {}, { duration: u > 0 ? u : r });
10458
10474
  };
10459
10475
  return (e, n = !1) => {
10460
- if (e.flags && Go(e.flags) && n && (i = !i), !(n && t.length < Tv && i) && t.length > 0) {
10476
+ if (e.flags && Go(e.flags) && n && (i = !i), !(n && t.length < Ev && i) && t.length > 0) {
10461
10477
  i = !1;
10462
10478
  let n = e;
10463
10479
  for (let e = t.length - 1; e > 0; e--) {
@@ -10470,13 +10486,13 @@ var wv = class {
10470
10486
  }
10471
10487
  return t.push(e), [];
10472
10488
  };
10473
- }, Dv = ["mse", "wasm"], Ov = (e) => e == null ? Dv : e, kv = (e) => {
10489
+ }, Ov = ["mse", "wasm"], kv = (e) => e == null ? Ov : e, Av = (e) => {
10474
10490
  if (!e) return !1;
10475
10491
  let t = e.headers && Object.keys(e.headers).length > 0, n = e.queryParams && Object.keys(e.queryParams).length > 0;
10476
10492
  return !!(t || n);
10477
- }, Av = (e, t, n) => {
10478
- if (kv(n)) return "mse";
10479
- let r = Ov(e);
10493
+ }, jv = (e, t, n) => {
10494
+ if (Av(n)) return "mse";
10495
+ let r = kv(e);
10480
10496
  for (let e of r) switch (e) {
10481
10497
  case "mse":
10482
10498
  if (t) return "mse";
@@ -10487,7 +10503,7 @@ var wv = class {
10487
10503
  case "wasm": return "wasm";
10488
10504
  }
10489
10505
  return "wasm";
10490
- }, jv = (e, t, n) => {
10506
+ }, Mv = (e, t, n) => {
10491
10507
  if (gn(t)) return C(C({}, e), {}, {
10492
10508
  type: "video",
10493
10509
  codec: t.codec,
@@ -10508,8 +10524,8 @@ var wv = class {
10508
10524
  data: e.payload,
10509
10525
  duration: 0
10510
10526
  });
10511
- }, Mv = (e, t) => e && typeof e == "object" && t in e, Nv = (e) => !(typeof e != "object" || !Mv(e, "channelId") || typeof e.channelId != "string" || !Mv(e, "url") || typeof e.url != "string" || e.channelId.length === 0 || e.url.length === 0), Pv = (e) => {
10512
- if (!Nv(e)) throw new g("Invalid options", {
10527
+ }, Nv = (e, t) => e && typeof e == "object" && t in e, Pv = (e) => !(typeof e != "object" || !Nv(e, "channelId") || typeof e.channelId != "string" || !Nv(e, "url") || typeof e.url != "string" || e.channelId.length === 0 || e.url.length === 0), Fv = (e) => {
10528
+ if (!Pv(e)) throw new g("Invalid options", {
10513
10529
  isFatal: !0,
10514
10530
  code: "invalid_options"
10515
10531
  });
@@ -10518,13 +10534,13 @@ var wv = class {
10518
10534
  let n = t;
10519
10535
  n[e] === void 0 && delete n[e];
10520
10536
  }), t;
10521
- }, Fv = (e) => {
10537
+ }, Iv = (e) => {
10522
10538
  if (typeof e != "object" || !e) throw Error("not an object");
10523
10539
  if (!("video" in e)) throw Error("missing video in subscription");
10524
10540
  if (!("audio" in e)) throw Error("missing audio in subscription");
10525
10541
  if (!("channelId" in e)) throw Error("missing channelId");
10526
10542
  return !0;
10527
- }, Iv = class {
10543
+ }, Lv = class {
10528
10544
  constructor(n) {
10529
10545
  var r = this;
10530
10546
  e(this, "cache", /* @__PURE__ */ new Map()), e(this, "inFlight", /* @__PURE__ */ new Map()), e(this, "checkVideoSupport", function() {
@@ -10585,10 +10601,10 @@ var wv = class {
10585
10601
  return this.inFlight.set(e, o), o;
10586
10602
  }), this.logger = n;
10587
10603
  }
10588
- }, Lv = /* @__PURE__ */ new WeakMap(), Rv = /* @__PURE__ */ new WeakMap(), zv = /* @__PURE__ */ new WeakMap(), Bv = class n extends _e {
10604
+ }, Rv = /* @__PURE__ */ new WeakMap(), zv = /* @__PURE__ */ new WeakMap(), Bv = /* @__PURE__ */ new WeakMap(), Vv = class n extends _e {
10589
10605
  constructor(r) {
10590
10606
  var i, a;
10591
- 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, Lv, 0), v(this, Rv, []), 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, zv, void 0), e(this, "attach", (e) => {
10607
+ 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, Rv, 0), v(this, zv, []), 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, Bv, void 0), e(this, "attach", (e) => {
10592
10608
  var t;
10593
10609
  (t = this.wakeLock) == null || t.attach(e), e.appendChild(this.element);
10594
10610
  }), e(this, "setElement", (e) => {
@@ -10671,20 +10687,20 @@ var wv = class {
10671
10687
  }), e(this, "updateTextTracks", (e) => {
10672
10688
  let t = e.filter((e) => e.codec === "webvtt");
10673
10689
  t.forEach((e) => {
10674
- if (!b(Rv, this).find((t) => t.language === e.language)) {
10690
+ if (!b(zv, this).find((t) => t.language === e.language)) {
10675
10691
  if (this.modules.canvasModule) {
10676
10692
  let t = this.modules.canvasModule.textTracks.addTextTrack(e.kind, e.label || e.language || "", e.language || "");
10677
- b(Rv, this).push(t);
10693
+ b(zv, this).push(t);
10678
10694
  } else if (this.mediaElement instanceof HTMLVideoElement) {
10679
10695
  let t = this.mediaElement.addTextTrack(e.kind, e.label || e.language, e.language);
10680
- b(Rv, this).push(t);
10696
+ b(zv, this).push(t);
10681
10697
  }
10682
10698
  }
10683
10699
  });
10684
- for (let e of b(Rv, this)) t.find((t) => t.language === e.language) ? e.mode === "disabled" && (e.mode = "hidden") : e.mode = "disabled";
10700
+ for (let e of b(zv, this)) t.find((t) => t.language === e.language) ? e.mode === "disabled" && (e.mode = "hidden") : e.mode = "disabled";
10685
10701
  this.emit("text tracks", this.textTracks);
10686
10702
  }), e(this, "cleanupTextTracks", (e = this.currentTime - 2e4) => {
10687
- b(Rv, this).forEach((t) => {
10703
+ b(zv, this).forEach((t) => {
10688
10704
  if (t.cues) for (let n of t.cues) n.endTime * 1e3 < e - 2e3 && t.removeCue(n);
10689
10705
  });
10690
10706
  }), e(this, "filterRenditions", function() {
@@ -10818,8 +10834,8 @@ var wv = class {
10818
10834
  u = void 0, d = void 0, i.logger.warn("Failed to enable OffscreenCanvas; falling back to main thread rendering", { error: e });
10819
10835
  }
10820
10836
  else s && i.logger.warn("OffscreenCanvas requested but not supported; falling back to main thread rendering");
10821
- let f = yield n_.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;
10822
- if (m instanceof D_) if (p === "OffscreenCanvas" && d) {
10837
+ let f = yield r_.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;
10838
+ if (m instanceof O_) if (p === "OffscreenCanvas" && d) {
10823
10839
  m.setVideoRenderingEnabled(!1);
10824
10840
  let e = i.element;
10825
10841
  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);
@@ -10831,10 +10847,10 @@ var wv = class {
10831
10847
  t.parentElement && t.parentElement.replaceChild(e, t), i.setElement(e);
10832
10848
  }
10833
10849
  }
10834
- else m instanceof k_ && (p === "OffscreenCanvas" && d ? (m.setOffscreenCanvas(d), i.offscreenCanvasElement = d) : (m.setOffscreenCanvas(void 0), i.offscreenCanvasElement = void 0));
10850
+ else m instanceof A_ && (p === "OffscreenCanvas" && d ? (m.setOffscreenCanvas(d), i.offscreenCanvasElement = d) : (m.setOffscreenCanvas(void 0), i.offscreenCanvasElement = void 0));
10835
10851
  (e = i.modules.decoder) == null || e.unload(), i.modules.decoder = f, i.modules.decoder.load(), i.setupOffscreenSubtitleRouting();
10836
10852
  })), e(this, "setupOffscreenSubtitleRouting", () => {
10837
- if (this.offscreenSubtitleInterval !== void 0 && (clearInterval(this.offscreenSubtitleInterval), this.offscreenSubtitleInterval = void 0), !this.offscreenCanvasElement || !this.modules.decoder || this.modules.canvasModule instanceof k_) return;
10853
+ if (this.offscreenSubtitleInterval !== void 0 && (clearInterval(this.offscreenSubtitleInterval), this.offscreenSubtitleInterval = void 0), !this.offscreenCanvasElement || !this.modules.decoder || this.modules.canvasModule instanceof A_) return;
10838
10854
  let e = this.modules.decoder, t = this.modules.canvasModule;
10839
10855
  if (!t) return;
10840
10856
  let n = !1;
@@ -10873,10 +10889,10 @@ var wv = class {
10873
10889
  e && "reset" in e && e.reset();
10874
10890
  }), this.sampleProcessingSesssions.clear(), this.playbackSource.currentTime = 0, this.playbackSource.isActivated = !1;
10875
10891
  }), e(this, "getRuntimeInfo", () => {
10876
- let e = this.modules.canvasModule instanceof k_ ? !0 : void 0;
10892
+ let e = this.modules.canvasModule instanceof A_ ? !0 : void 0;
10877
10893
  return C({
10878
10894
  uptime: Date.now() - this.createdAt,
10879
- version: "4.2.1-6-ga0191541",
10895
+ version: "4.2.1-7-g15dd6d62",
10880
10896
  clientId: this.clientId,
10881
10897
  sessionId: this.sessionId,
10882
10898
  channelId: this.channelId,
@@ -10910,7 +10926,7 @@ var wv = class {
10910
10926
  }), e(this, "timeToFirstFrame", () => {
10911
10927
  let e = this.modules.playback.getFirstFrameTime(), t = this.modules.connection.firstConnectionTime;
10912
10928
  if (t && e) return e - t;
10913
- }), this.options = new wv(C(C({}, Sn), Pv(r))), r.telemetryEnabled === void 0 && ["localhost", "127.0.0.1"].includes(location.hostname) && this.options.set("telemetryEnabled", !1);
10929
+ }), this.options = new Tv(C(C({}, Sn), Fv(r))), r.telemetryEnabled === void 0 && ["localhost", "127.0.0.1"].includes(location.hostname) && this.options.set("telemetryEnabled", !1);
10914
10930
  let o = {
10915
10931
  channelId: this.options.get("channelId"),
10916
10932
  audio: {
@@ -10923,16 +10939,16 @@ var wv = class {
10923
10939
  height: this.options.get("maxSize").height
10924
10940
  }
10925
10941
  }, s = O.get();
10926
- s.setLevel(this.options.get("logLevel")), s.setDebug(!1), this.logger = s, this.webCodecsRenditionSupport = new Iv(s), r.iosMediaElementEnabled !== void 0 && this.logger.warn("Option iosMediaElementEnabled is deprecated and will be removed in a future release. Use streamToMediaElementEnabled instead.");
10942
+ s.setLevel(this.options.get("logLevel")), s.setDebug(!1), this.logger = s, this.webCodecsRenditionSupport = new Lv(s), r.iosMediaElementEnabled !== void 0 && this.logger.warn("Option iosMediaElementEnabled is deprecated and will be removed in a future release. Use streamToMediaElementEnabled instead.");
10927
10943
  let c = (a = r.streamToMediaElementEnabled) == null ? r.iosMediaElementEnabled : a;
10928
10944
  c !== void 0 && (this.options.set("streamToMediaElementEnabled", c), this.options.set("iosMediaElementEnabled", c));
10929
10945
  let l = r.mseEnabled !== void 0, f = r.decoders !== void 0;
10930
10946
  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"]);
10931
- let p = X_.create(this.emitter, this.logger.createContext("PictureInPictureModule")), h = j.create(), ee = qg.create(this.emitter, this.logger.createContext("ConnectionModule"), {
10947
+ let p = Z_.create(this.emitter, this.logger.createContext("PictureInPictureModule")), h = j.create(), ee = Jg.create(this.emitter, this.logger.createContext("ConnectionModule"), {
10932
10948
  reconnectHandler: this.options.get("reconnectHandler"),
10933
10949
  options: this.options,
10934
10950
  onConnectInfo: this.onConnectInfo
10935
- }), te = cv.create(this.logger.createContext("SubscriptionModule"), this.emitter, o), ne = iv.create(this.emitter, te), re = nv.create(this.emitter, this.logger.createContext("QualityOfServiceModule"), ne), ie = Q_.create(this.emitter, this.logger.createContext("PlaybackModule"), this, this.options.get("minBufferTime"));
10951
+ }), te = lv.create(this.logger.createContext("SubscriptionModule"), this.emitter, o), ne = av.create(this.emitter, te), re = rv.create(this.emitter, this.logger.createContext("QualityOfServiceModule"), ne), ie = $_.create(this.emitter, this.logger.createContext("PlaybackModule"), this, this.options.get("minBufferTime"));
10936
10952
  this.encryptedMediaExtensions = new zr(this.emitter, this.logger.createContext("EncryptedMediaExtensions"), r.drm), this.drm = {
10937
10953
  setHeaders: (e) => {
10938
10954
  this.encryptedMediaExtensions.headers = e;
@@ -10941,7 +10957,7 @@ var wv = class {
10941
10957
  this.encryptedMediaExtensions.queryParams = e;
10942
10958
  }
10943
10959
  };
10944
- let ae = i_.create(this.emitter), oe = this.options.get("poster"), se = oe === !0 ? this.getThumbnailUrl() : oe || void 0, _, y, S;
10960
+ let ae = a_.create(this.emitter), oe = this.options.get("poster"), se = oe === !0 ? this.getThumbnailUrl() : oe || void 0, _, y, S;
10945
10961
  if (this.willUseMediaSource()) {
10946
10962
  let e = new ls({
10947
10963
  type: this.options.get("media") === "audio" ? "audio" : "video",
@@ -10951,9 +10967,9 @@ var wv = class {
10951
10967
  logger: this.logger.createContext("MediaElement"),
10952
10968
  poster: se
10953
10969
  });
10954
- 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, zr.isSupported() && this.encryptedMediaExtensions.attach(e.element), _ = V_.create(this.logger.createContext("MseModule"), this.emitter, this.element), this.options.get("pauseSupportEnabled") || (y = xv.create(this.logger.createContext("UnpauseModule"), e, ae)), this.options.get("pictureInPictureEnabled") && this.emitter.emit("add picture in picture listener", { element: e.element });
10970
+ 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, zr.isSupported() && this.encryptedMediaExtensions.attach(e.element), _ = H_.create(this.logger.createContext("MseModule"), this.emitter, this.element), this.options.get("pauseSupportEnabled") || (y = Sv.create(this.logger.createContext("UnpauseModule"), e, ae)), this.options.get("pictureInPictureEnabled") && this.emitter.emit("add picture in picture listener", { element: e.element });
10955
10971
  } else if (this.options.get("streamToMediaElementEnabled") && Et(this.browser)) {
10956
- let e = k_.create(this.emitter, this.logger.createContext("ModernCanvasModule"), this.pool, this, {
10972
+ let e = A_.create(this.emitter, this.logger.createContext("ModernCanvasModule"), this.pool, this, {
10957
10973
  type: this.options.get("media") === "audio" ? "audio" : "video",
10958
10974
  muted: this.options.get("muted") || this.options.get("media") === "video",
10959
10975
  volume: this.options.get("volume"),
@@ -10963,10 +10979,10 @@ var wv = class {
10963
10979
  }), t = e.element();
10964
10980
  this.element = t.element, this.playbackSource = e, S = e;
10965
10981
  let n = this.browser.platform.isIOS && this.browser.platform.iosVersion <= 15;
10966
- this.options.get("pictureInPictureEnabled") && !n && this.emitter.emit("add picture in picture listener", { element: this.element }), this.options.get("pauseSupportEnabled") || (y = xv.create(this.logger.createContext("UnpauseModule"), t, ae));
10982
+ this.options.get("pictureInPictureEnabled") && !n && this.emitter.emit("add picture in picture listener", { element: this.element }), this.options.get("pauseSupportEnabled") || (y = Sv.create(this.logger.createContext("UnpauseModule"), t, ae));
10967
10983
  } else {
10968
10984
  let e;
10969
- e = D_.create(this.emitter, this.logger.createContext("LegacyCanvasModule"), this.pool, this, this.options.get("muted") || this.options.get("media") === "video", this.options.get("volume"), () => {
10985
+ e = O_.create(this.emitter, this.logger.createContext("LegacyCanvasModule"), this.pool, this, this.options.get("muted") || this.options.get("media") === "video", this.options.get("volume"), () => {
10970
10986
  this.setElement(e.element());
10971
10987
  }, this.options.get("minBufferTime")), this.element = e.element(), this.playbackSource = e, S = e, this.options.get("iosWakeLockEnabled") && (this.wakeLock = new $o());
10972
10988
  }
@@ -10983,9 +10999,9 @@ var wv = class {
10983
10999
  let ce = this.willUseMediaSource(), ue = ce ? !this.browser.platform.isWebKit : !0, de = {
10984
11000
  getTargetBufferTime: () => ie.getTargetBufferTime(),
10985
11001
  getNextBufferedRangeStart: _ ? (e) => _.getNextBufferedRangeStart(e) : void 0
10986
- }, fe = hv.create(this.emitter, this.logger.createContext("SyncModule"), this.playbackSource, de, ue, ce), pe = f_.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();
11002
+ }, fe = gv.create(this.emitter, this.logger.createContext("SyncModule"), this.playbackSource, de, ue, ce), pe = p_.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();
10987
11003
  this.modules = {
10988
- telemetry: yv.create(this.logger.createContext("TelemetryModule"), this.emitter, {
11004
+ telemetry: bv.create(this.logger.createContext("TelemetryModule"), this.emitter, {
10989
11005
  url: ge,
10990
11006
  enabled: this.options.get("telemetryEnabled"),
10991
11007
  includeStats: !1,
@@ -10995,10 +11011,10 @@ var wv = class {
10995
11011
  maxBufferTime: this.options.get("maxBufferTime"),
10996
11012
  minBufferTime: this.options.get("minBufferTime")
10997
11013
  }),
10998
- incomingData: l_.create(this.emitter),
11014
+ incomingData: u_.create(this.emitter),
10999
11015
  adaptivity: bs.create(this.emitter, this.logger.createContext("AdaptivityModule"), re, { cooldownTime: Math.max(this.options.get("minBufferTime"), 2e3) }),
11000
- constraintCap: Qg.create(this.emitter, this.element, ne, this.options.get("abrEnabled") ? this.options.get("sizeBasedResolutionCapEnabled") : !1),
11001
- event: s_.create(this.emitter, this.logger.createContext("EventModule"), fe),
11016
+ constraintCap: $g.create(this.emitter, this.element, ne, this.options.get("abrEnabled") ? this.options.get("sizeBasedResolutionCapEnabled") : !1),
11017
+ event: c_.create(this.emitter, this.logger.createContext("EventModule"), fe),
11002
11018
  sync: fe,
11003
11019
  jitter: pe,
11004
11020
  documentState: ae,
@@ -11051,7 +11067,7 @@ var wv = class {
11051
11067
  let r = ((t = (n = e.telemetry) == null ? void 0 : n.probability) == null ? 1 : t) >= Math.random();
11052
11068
  if (e.telemetry) {
11053
11069
  var i;
11054
- (i = this.modules.telemetry) == null || i.unload(), this.modules.telemetry = yv.create(this.logger.createContext("TelemetryModule"), this.emitter, C(C({}, e.telemetry), {}, { enabled: this.options.get("telemetryEnabled") && r }), this), this.modules.telemetry.load();
11070
+ (i = this.modules.telemetry) == null || i.unload(), this.modules.telemetry = bv.create(this.logger.createContext("TelemetryModule"), this.emitter, C(C({}, e.telemetry), {}, { enabled: this.options.get("telemetryEnabled") && r }), this), this.modules.telemetry.load();
11055
11071
  }
11056
11072
  }), this.emitter.on("adapt level", (e) => {
11057
11073
  this.logger.debug("adapt level", { direction: e });
@@ -11083,8 +11099,8 @@ var wv = class {
11083
11099
  audio: C(C({}, this.targetSubscription.audio), d == null ? void 0 : d.audio)
11084
11100
  })), this.emitter.emit("adapted level");
11085
11101
  }), this.emitter.on("text track data", (e) => {
11086
- let t = b(Rv, this).find((t) => t.language === e.language), n = this.modules.sync.getTimeshiftOffset() / 1e3, r = n - b(Lv, this);
11087
- if (x(Lv, this, n), t) {
11102
+ let t = b(zv, this).find((t) => t.language === e.language), n = this.modules.sync.getTimeshiftOffset() / 1e3, r = n - b(Rv, this);
11103
+ if (x(Rv, this, n), t) {
11088
11104
  if (t.cues) for (let e of t.cues) e.startTime -= r, e.endTime -= r;
11089
11105
  for (let r of e.cues) {
11090
11106
  let e = new VTTCue(r.startTime - n, r.endTime - n, r.text);
@@ -11098,19 +11114,19 @@ var wv = class {
11098
11114
  this.clientIp = t.ip;
11099
11115
  break;
11100
11116
  case "renditions":
11101
- this.updateTextTracks(t.renditions), x(zv, this, this.filterRenditions(t.renditions).then((e) => {
11117
+ this.updateTextTracks(t.renditions), x(Bv, this, this.filterRenditions(t.renditions).then((e) => {
11102
11118
  this.emitter.emit("renditions", {
11103
11119
  renditions: e,
11104
11120
  channelId: this.currentSubscription.channelId
11105
11121
  }), this.emit("rendition levels", this.modules.renditions.getRenditionLevels()), this.emitLanguagesIfChanged();
11106
11122
  }).finally(() => {
11107
- x(zv, this, void 0);
11123
+ x(Bv, this, void 0);
11108
11124
  }));
11109
11125
  break;
11110
11126
  case "subscription changed":
11111
11127
  var r;
11112
11128
  try {
11113
- Fv(t.subscription);
11129
+ Iv(t.subscription);
11114
11130
  } catch (e) {
11115
11131
  this.emitter.emit("error", new g("Subscription failed validation", {
11116
11132
  source: e instanceof Error ? e : void 0,
@@ -11225,7 +11241,7 @@ var wv = class {
11225
11241
  let xe = function() {
11226
11242
  var e = t(function* (e) {
11227
11243
  let t = e.channelId;
11228
- b(zv, i) && (yield b(zv, i));
11244
+ b(Bv, i) && (yield b(Bv, i));
11229
11245
  let n = i.modules.renditions.getRendition(e.renditionId, t);
11230
11246
  if (!qo(e.flags)) {
11231
11247
  if (Jo(e.flags)) {
@@ -11233,8 +11249,8 @@ var wv = class {
11233
11249
  if (e.renditionId !== 0) {
11234
11250
  let e = le(t);
11235
11251
  if (e && e.language !== void 0) {
11236
- let t = new as().parse(e.content || ""), r = n / 1e3, a = b(Rv, i).find((t) => t.language === e.language), o = r - b(Lv, i);
11237
- if (x(Lv, i, r), a) {
11252
+ let t = new as().parse(e.content || ""), r = n / 1e3, a = b(zv, i).find((t) => t.language === e.language), o = r - b(Rv, i);
11253
+ if (x(Rv, i, r), a) {
11238
11254
  if (a.cues) for (let e of a.cues) e.startTime -= o, e.endTime -= o;
11239
11255
  for (let e of t) {
11240
11256
  let t = new VTTCue(e.startTime - r, e.endTime - r, e.text);
@@ -11266,10 +11282,10 @@ var wv = class {
11266
11282
  mimeType: s
11267
11283
  }), i.emit("initialized media");
11268
11284
  } else {
11269
- let t = jv(e, n, i.sizes.get(e.renditionId));
11285
+ let t = Mv(e, n, i.sizes.get(e.renditionId));
11270
11286
  i.modules.jitter.recordSample(t);
11271
11287
  let a = i.sampleProcessingSesssions.get(r);
11272
- if (!a) a = Ev(i.modules.sync.processSample(t)), i.sampleProcessingSesssions.set(r, a);
11288
+ if (!a) a = Dv(i.modules.sync.processSample(t)), i.sampleProcessingSesssions.set(r, a);
11273
11289
  else {
11274
11290
  let e = i.willUseMediaSource() && i.isSwitchingRenditionLevel && t.type === "video", n = a(i.modules.sync.processSample(t), e), r = t;
11275
11291
  n.forEach((e) => {
@@ -11377,7 +11393,7 @@ var wv = class {
11377
11393
  this.modules.subscription.setLanguage(e), this.alignSizeAndBitRate(this.targetSubscription);
11378
11394
  }
11379
11395
  set textTrack(e) {
11380
- e !== this.textTrack && (b(Rv, this).forEach((t) => {
11396
+ e !== this.textTrack && (b(zv, this).forEach((t) => {
11381
11397
  if (t.label === e) t.mode = "showing";
11382
11398
  else {
11383
11399
  if (t.mode === "showing" && t.cues) for (let e of [...t.cues]) t.removeCue(e);
@@ -11386,11 +11402,11 @@ var wv = class {
11386
11402
  }), this.emitter.emit("text track", e));
11387
11403
  }
11388
11404
  get textTracks() {
11389
- return b(Rv, this).filter((e) => e.mode !== "disabled").map((e) => e.label);
11405
+ return b(zv, this).filter((e) => e.mode !== "disabled").map((e) => e.label);
11390
11406
  }
11391
11407
  get textTrack() {
11392
11408
  var e;
11393
- return (e = b(Rv, this).find((e) => e.mode === "showing")) == null ? void 0 : e.label;
11409
+ return (e = b(zv, this).find((e) => e.mode === "showing")) == null ? void 0 : e.label;
11394
11410
  }
11395
11411
  get channelId() {
11396
11412
  var e, t;
@@ -11524,7 +11540,7 @@ var wv = class {
11524
11540
  return this.modules.subscription.getTargetSubscription();
11525
11541
  }
11526
11542
  resolvedDecoder(e) {
11527
- return Av(this.options.get("decoders", e), this.browser.supportsMediaSource, this.options.get("drm"));
11543
+ return jv(this.options.get("decoders", e), this.browser.supportsMediaSource, this.options.get("drm"));
11528
11544
  }
11529
11545
  willUseMediaSource() {
11530
11546
  return this.resolvedDecoder() === "mse";
@@ -11543,6 +11559,6 @@ var wv = class {
11543
11559
  return t === void 0 ? this.shouldUseWebCodecs(e) : t;
11544
11560
  }
11545
11561
  };
11546
- e(Bv, "MAX_POOL_SIZE", 10), e(Bv, "DISCONNECT_TIMEOUT", 15 * 1e3), e(Bv, "REMOVE_CUE_THRESHOLD", 1e3 * 10);
11562
+ e(Vv, "MAX_POOL_SIZE", 10), e(Vv, "DISCONNECT_TIMEOUT", 15 * 1e3), e(Vv, "REMOVE_CUE_THRESHOLD", 1e3 * 10);
11547
11563
  //#endregion
11548
- 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, Bv as t, gt as u, Qe as v };
11564
+ 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, Vv as t, gt as u, Qe as v };