@vindral/web-sdk 4.8.2-27-ge01b9d3a → 4.8.2-29-g2c54a2bf

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.
@@ -6581,22 +6581,22 @@ function Km(e = !0) {
6581
6581
  if (i(Bm, this)) return n(Bm, this, !1), i(Rm, this).writeUnsigned8(i(zm, this) | (e ? Lm : 0));
6582
6582
  }
6583
6583
  // ../../libs/moq/src/transport/WebSocketConnection.ts
6584
- var qm = /* @__PURE__ */ new WeakMap(), Jm = /* @__PURE__ */ new WeakMap(), Ym = /* @__PURE__ */ new WeakMap(), Xm = /* @__PURE__ */ new WeakMap(), Zm = /* @__PURE__ */ new WeakMap(), Qm = /* @__PURE__ */ new WeakMap(), $m = /* @__PURE__ */ new WeakMap(), eh = /* @__PURE__ */ new WeakMap(), th = /* @__PURE__ */ new WeakMap(), nh = /* @__PURE__ */ new WeakSet(), rh = class {
6584
+ var qm = /* @__PURE__ */ new WeakMap(), Jm = /* @__PURE__ */ new WeakMap(), Ym = /* @__PURE__ */ new WeakMap(), Xm = /* @__PURE__ */ new WeakMap(), Zm = /* @__PURE__ */ new WeakMap(), Qm = /* @__PURE__ */ new WeakMap(), $m = /* @__PURE__ */ new WeakMap(), eh = /* @__PURE__ */ new WeakMap(), th = /* @__PURE__ */ new WeakSet(), nh = class {
6585
6585
  constructor(e, t) {
6586
- k(this, nh), c(this, qm, void 0), c(this, Jm, void 0), c(this, Ym, void 0), c(this, Xm, void 0), c(this, Zm, /* @__PURE__ */ new Map()), c(this, Qm, /* @__PURE__ */ new Set()), c(this, $m, a.get().createContext("WebSocketConnection")), c(this, eh, performance.now()), c(this, th, new Set(Array(127).fill(0).map((e, t) => t + 1))), n(qm, this, e), n(Jm, this, t), n(Ym, this, new ReadableStream(new eu(e))), i(qm, this).addEventListener("message", () => {
6587
- n(eh, this, performance.now());
6586
+ k(this, th), c(this, qm, void 0), c(this, Jm, void 0), c(this, Ym, void 0), c(this, Xm, /* @__PURE__ */ new Map()), c(this, Zm, /* @__PURE__ */ new Set()), c(this, Qm, a.get().createContext("WebSocketConnection")), c(this, $m, performance.now()), c(this, eh, new Set(Array(127).fill(0).map((e, t) => t + 1))), n(qm, this, e), n(Jm, this, t), n(Ym, this, new ReadableStream(new eu(e)).getReader()), i(qm, this).addEventListener("message", () => {
6587
+ n($m, this, performance.now());
6588
6588
  }), i(qm, this).addEventListener("close", (e) => {
6589
- i($m, this).info("WebSocket closed", {
6589
+ i(Qm, this).info("WebSocket closed", {
6590
6590
  code: e.code,
6591
6591
  reason: e.reason,
6592
6592
  wasClean: e.wasClean
6593
- }), i(Jm, this).markPostHandshake(), i(Zm, this).forEach((e) => e.close());
6593
+ }), i(Jm, this).markPostHandshake(), i(Xm, this).forEach((e) => e.close());
6594
6594
  });
6595
6595
  }
6596
6596
  openSendStream() {
6597
- let e = i(th, this).values().next().value;
6597
+ let e = i(eh, this).values().next().value;
6598
6598
  if (!e) throw Error("No stream IDs available");
6599
- return i(th, this).delete(e), Promise.resolve(new Wm(new Ou(i(qm, this)), e, () => o(nh, this, ih).call(this, e)));
6599
+ return i(eh, this).delete(e), Promise.resolve(new Wm(new Ou(i(qm, this)), e, () => o(th, this, rh).call(this, e)));
6600
6600
  }
6601
6601
  transportType() {
6602
6602
  return "websocket";
@@ -6605,7 +6605,7 @@ var qm = /* @__PURE__ */ new WeakMap(), Jm = /* @__PURE__ */ new WeakMap(), Ym =
6605
6605
  return i(qm, this).url;
6606
6606
  }
6607
6607
  lastReceived() {
6608
- return i(eh, this);
6608
+ return i($m, this);
6609
6609
  }
6610
6610
  afterHandshake() {
6611
6611
  return i(Jm, this).postHandshake();
@@ -6614,42 +6614,32 @@ var qm = /* @__PURE__ */ new WeakMap(), Jm = /* @__PURE__ */ new WeakMap(), Ym =
6614
6614
  var e = this;
6615
6615
  return t(function* () {
6616
6616
  for (;;) {
6617
- n(Xm, e, i(Ym, e).getReader());
6618
- try {
6619
- let { value: n, done: r } = yield i(Xm, e).read();
6620
- if (r) return;
6621
- let [a, s, c] = n, l = D(s);
6622
- if (i(Qm, e).has(l)) {
6623
- a || i(Qm, e).delete(l);
6624
- continue;
6625
- }
6626
- if (i(Zm, e).has(l)) {
6627
- let t = i(Zm, e).get(l);
6628
- if (!t) throw Error("Stream not found");
6629
- c.length > 0 && (yield t.push(c)), a || (i($m, e).debug("Closing stream", { streamId: s }), t.close(), i(Zm, e).delete(l), i(Qm, e).delete(l));
6630
- } else {
6631
- i($m, e).debug("Creating new stream", { streamId: s });
6632
- let [n, r] = te(1e3), u = new ReadableStream({
6633
- pull(e) {
6634
- return t(function* () {
6635
- let t = yield r.pop();
6636
- t ? e.enqueue(t) : e.close();
6637
- })();
6638
- },
6639
- cancel: () => o(nh, e, ah).call(e, l, n, r)
6640
- });
6641
- if (i(Zm, e).set(l, n), a || (i($m, e).debug("Closing new stream", { streamId: s }), i(Zm, e).delete(l), yield u.cancel()), c.length > 0) return yield Wl(new su(c, u), s);
6642
- }
6643
- } finally {
6644
- var r;
6645
- (r = i(Xm, e)) == null || r.releaseLock();
6617
+ let { value: n, done: r } = yield i(Ym, e).read();
6618
+ if (r) return;
6619
+ let [a, s, c] = n, l = D(s);
6620
+ if (i(Zm, e).has(l)) a || i(Zm, e).delete(l);
6621
+ else if (i(Xm, e).has(l)) {
6622
+ let t = i(Xm, e).get(l);
6623
+ if (!t) throw Error("Stream not found");
6624
+ c.length > 0 && (yield t.push(c)), a || (i(Qm, e).debug("Closing stream", { streamId: s }), t.close(), i(Xm, e).delete(l), i(Zm, e).delete(l));
6625
+ } else {
6626
+ i(Qm, e).debug("Creating new stream", { streamId: s });
6627
+ let [n, r] = te(1e3), u = new ReadableStream({
6628
+ pull(e) {
6629
+ return t(function* () {
6630
+ let t = yield r.pop();
6631
+ t ? e.enqueue(t) : e.close();
6632
+ })();
6633
+ },
6634
+ cancel: () => o(th, e, ih).call(e, l, n, r)
6635
+ });
6636
+ if (i(Xm, e).set(l, n), a || (i(Qm, e).debug("Closing new stream", { streamId: s }), i(Xm, e).delete(l), yield u.cancel()), c.length > 0) return yield Wl(new su(c, u), s);
6646
6637
  }
6647
6638
  }
6648
6639
  })();
6649
6640
  }
6650
6641
  close() {
6651
- var e;
6652
- return i(Jm, this).cancel().catch(b), i(Ym, this).cancel("closing").catch(b), (e = i(Xm, this)) == null || e.cancel("closing").catch(b), i(qm, this).close();
6642
+ return i(Jm, this).cancel().catch(b), i(Ym, this).cancel("closing").catch(b), i(qm, this).close();
6653
6643
  }
6654
6644
  closed() {
6655
6645
  return Promise.resolve();
@@ -6667,87 +6657,87 @@ var qm = /* @__PURE__ */ new WeakMap(), Jm = /* @__PURE__ */ new WeakMap(), Ym =
6667
6657
  })();
6668
6658
  }
6669
6659
  };
6670
- function ih(e) {
6671
- i(th, this).add(e);
6660
+ function rh(e) {
6661
+ i(eh, this).add(e);
6672
6662
  }
6673
- function ah(e, n, r) {
6674
- i(Zm, this).get(e) === n && (i($m, this).debug("Discarding cancelled stream", { streamId: e }), i(Zm, this).delete(e), i(Qm, this).add(e), n.close(), t(function* () {
6663
+ function ih(e, n, r) {
6664
+ i(Xm, this).get(e) === n && (i(Qm, this).debug("Discarding cancelled stream", { streamId: e }), i(Xm, this).delete(e), i(Zm, this).add(e), n.close(), t(function* () {
6675
6665
  for (; yield r.pop(););
6676
6666
  })().catch(b));
6677
6667
  }
6678
6668
  // ../../libs/moq/src/transport/WebTransportConnection.ts
6679
- var oh = 3, sh = 32, ch = 250, lh = (e, t = performance.now()) => e.acceptedAt + ch - t, uh = /* @__PURE__ */ new WeakMap(), dh = /* @__PURE__ */ new WeakMap(), fh = /* @__PURE__ */ new WeakMap(), ph = /* @__PURE__ */ new WeakMap(), mh = /* @__PURE__ */ new WeakMap(), hh = /* @__PURE__ */ new WeakMap(), gh = /* @__PURE__ */ new WeakMap(), _h = /* @__PURE__ */ new WeakMap(), vh = /* @__PURE__ */ new WeakMap(), yh = /* @__PURE__ */ new WeakMap(), bh = /* @__PURE__ */ new WeakMap(), xh = /* @__PURE__ */ new WeakSet(), Sh = class {
6669
+ var ah = 3, oh = 32, sh = 250, ch = (e, t = performance.now()) => e.acceptedAt + sh - t, lh = /* @__PURE__ */ new WeakMap(), uh = /* @__PURE__ */ new WeakMap(), dh = /* @__PURE__ */ new WeakMap(), fh = /* @__PURE__ */ new WeakMap(), ph = /* @__PURE__ */ new WeakMap(), mh = /* @__PURE__ */ new WeakMap(), hh = /* @__PURE__ */ new WeakMap(), gh = /* @__PURE__ */ new WeakMap(), _h = /* @__PURE__ */ new WeakMap(), vh = /* @__PURE__ */ new WeakMap(), yh = /* @__PURE__ */ new WeakMap(), bh = /* @__PURE__ */ new WeakSet(), xh = class {
6680
6670
  constructor(e, t, r) {
6681
- k(this, xh), c(this, uh, void 0), c(this, dh, void 0), c(this, fh, []), c(this, ph, void 0), c(this, mh, !1), c(this, hh, void 0), c(this, gh, 0), c(this, _h, !1), c(this, vh, performance.now()), c(this, yh, a.get().createContext("WebTransportConnection")), c(this, bh, () => {
6682
- n(vh, this, performance.now());
6683
- }), n(hh, this, r), n(uh, this, e), n(dh, this, t), o(xh, this, Ch).call(this).catch((e) => {
6684
- i(yh, this).warn("Incoming streams handling ended with error", e), i(dh, this).markPostHandshake();
6685
- }), i(uh, this).closed.finally(() => {
6686
- n(_h, this, !0), i(dh, this).markPostHandshake(), o(xh, this, Dh).call(this);
6671
+ k(this, bh), c(this, lh, void 0), c(this, uh, void 0), c(this, dh, []), c(this, fh, void 0), c(this, ph, !1), c(this, mh, void 0), c(this, hh, 0), c(this, gh, !1), c(this, _h, performance.now()), c(this, vh, a.get().createContext("WebTransportConnection")), c(this, yh, () => {
6672
+ n(_h, this, performance.now());
6673
+ }), n(mh, this, r), n(lh, this, e), n(uh, this, t), o(bh, this, Sh).call(this).catch((e) => {
6674
+ i(vh, this).warn("Incoming streams handling ended with error", e), i(uh, this).markPostHandshake();
6675
+ }), i(lh, this).closed.finally(() => {
6676
+ n(gh, this, !0), i(uh, this).markPostHandshake(), o(bh, this, Eh).call(this);
6687
6677
  }).catch(b);
6688
6678
  }
6689
6679
  openSendStream() {
6690
6680
  var e = this;
6691
6681
  return t(function* () {
6692
- return new Su(yield i(uh, e).createUnidirectionalStream());
6682
+ return new Su(yield i(lh, e).createUnidirectionalStream());
6693
6683
  })();
6694
6684
  }
6695
6685
  transportType() {
6696
6686
  return "webtransport";
6697
6687
  }
6698
6688
  url() {
6699
- return i(hh, this);
6689
+ return i(mh, this);
6700
6690
  }
6701
6691
  lastReceived() {
6702
- return i(vh, this);
6692
+ return i(_h, this);
6703
6693
  }
6704
6694
  afterHandshake() {
6705
- return i(dh, this).postHandshake();
6695
+ return i(uh, this).postHandshake();
6706
6696
  }
6707
6697
  closed() {
6708
6698
  var e = this;
6709
6699
  return t(function* () {
6710
- yield i(uh, e).closed.catch(b);
6700
+ yield i(lh, e).closed.catch(b);
6711
6701
  })();
6712
6702
  }
6713
6703
  close(e) {
6714
- i(_h, this) || (n(_h, this, !0), o(xh, this, Dh).call(this), i(uh, this).close(e));
6704
+ i(gh, this) || (n(gh, this, !0), o(bh, this, Eh).call(this), i(lh, this).close(e));
6715
6705
  }
6716
6706
  writeMessage(e) {
6717
6707
  var n = this;
6718
6708
  return t(function* () {
6719
- yield i(dh, n).write(e);
6709
+ yield i(uh, n).write(e);
6720
6710
  })();
6721
6711
  }
6722
6712
  readMessage() {
6723
6713
  var e = this;
6724
6714
  return t(function* () {
6725
- return i(dh, e).read();
6715
+ return i(uh, e).read();
6726
6716
  })();
6727
6717
  }
6728
6718
  objectStream() {
6729
6719
  var e = this;
6730
6720
  return t(function* () {
6731
6721
  for (;;) {
6732
- if (i(_h, e)) return;
6722
+ if (i(gh, e)) return;
6733
6723
  let t = performance.now(), n;
6734
- for (let r = 0; r < i(fh, e).length; r++) {
6735
- let a = i(fh, e)[r];
6736
- if (a.groups) return i(fh, e).splice(r, 1), o(xh, e, Th).call(e), a.groups;
6737
- if (lh(a, t) > 0) {
6738
- i(fh, e).some((e) => e.groups) && (n = lh(a, t));
6724
+ for (let r = 0; r < i(dh, e).length; r++) {
6725
+ let a = i(dh, e)[r];
6726
+ if (a.groups) return i(dh, e).splice(r, 1), o(bh, e, wh).call(e), a.groups;
6727
+ if (ch(a, t) > 0) {
6728
+ i(dh, e).some((e) => e.groups) && (n = ch(a, t));
6739
6729
  break;
6740
6730
  }
6741
6731
  }
6742
- if (i(mh, e) && i(fh, e).length === 0) return;
6743
- yield o(xh, e, wh).call(e, n);
6732
+ if (i(ph, e) && i(dh, e).length === 0) return;
6733
+ yield o(bh, e, Ch).call(e, n);
6744
6734
  }
6745
6735
  })();
6746
6736
  }
6747
6737
  getStats() {
6748
6738
  var e = this;
6749
6739
  return t(function* () {
6750
- let t = i(uh, e);
6740
+ let t = i(lh, e);
6751
6741
  if (typeof t.getStats != "function") return;
6752
6742
  let n = yield t.getStats();
6753
6743
  if (n != null) return {
@@ -6757,85 +6747,85 @@ var oh = 3, sh = 32, ch = 250, lh = (e, t = performance.now()) => e.acceptedAt +
6757
6747
  })();
6758
6748
  }
6759
6749
  };
6760
- function Ch() {
6750
+ function Sh() {
6761
6751
  var e = this;
6762
6752
  return t(function* () {
6763
- let t = i(uh, e).incomingUnidirectionalStreams.getReader();
6753
+ let t = i(lh, e).incomingUnidirectionalStreams.getReader();
6764
6754
  try {
6765
6755
  for (;;) {
6766
6756
  var r, a;
6767
6757
  let { value: s, done: c } = yield t.read();
6768
6758
  if (c) return;
6769
- for (; i(fh, e).length >= sh && !i(_h, e);) {
6770
- let t = i(fh, e).find((e) => !e.groups);
6759
+ for (; i(dh, e).length >= oh && !i(gh, e);) {
6760
+ let t = i(dh, e).find((e) => !e.groups);
6771
6761
  if (!t) {
6772
- yield o(xh, e, wh).call(e);
6762
+ yield o(bh, e, Ch).call(e);
6773
6763
  continue;
6774
6764
  }
6775
- let n = lh(t);
6776
- n > 0 ? yield o(xh, e, wh).call(e, n) : o(xh, e, Eh).call(e, t);
6765
+ let n = ch(t);
6766
+ n > 0 ? yield o(bh, e, Ch).call(e, n) : o(bh, e, Th).call(e, t);
6777
6767
  }
6778
- if (i(_h, e)) {
6768
+ if (i(gh, e)) {
6779
6769
  s.cancel().catch(b);
6780
6770
  return;
6781
6771
  }
6782
- let l = new su(/* @__PURE__ */ new Uint8Array(), s, i(bh, e)), u = (n(gh, e, (r = i(gh, e), a = r++, r)), a), d = {
6772
+ let l = new su(/* @__PURE__ */ new Uint8Array(), s, i(yh, e)), u = (n(hh, e, (r = i(hh, e), a = r++, r)), a), d = {
6783
6773
  reader: l,
6784
6774
  streamId: u,
6785
6775
  acceptedAt: performance.now()
6786
6776
  };
6787
- i(fh, e).push(d), Wl(l, u).then((t) => {
6788
- d.groups = t, o(xh, e, Th).call(e);
6777
+ i(dh, e).push(d), Wl(l, u).then((t) => {
6778
+ d.groups = t, o(bh, e, wh).call(e);
6789
6779
  }, (t) => {
6790
- let n = i(fh, e).indexOf(d);
6791
- n < 0 || (i(fh, e).splice(n, 1), o(xh, e, Oh).call(e, t, u, l), o(xh, e, Th).call(e));
6780
+ let n = i(dh, e).indexOf(d);
6781
+ n < 0 || (i(dh, e).splice(n, 1), o(bh, e, Dh).call(e, t, u, l), o(bh, e, wh).call(e));
6792
6782
  });
6793
6783
  }
6794
6784
  } finally {
6795
- n(mh, e, !0), o(xh, e, Th).call(e);
6785
+ n(ph, e, !0), o(bh, e, wh).call(e);
6796
6786
  }
6797
6787
  })();
6798
6788
  }
6799
- function wh(e) {
6789
+ function Ch(e) {
6800
6790
  var r = this;
6801
6791
  return t(function* () {
6802
- if (i(ph, r) != null || n(ph, r, new x()), e === void 0) return i(ph, r).promise;
6792
+ if (i(fh, r) != null || n(fh, r, new x()), e === void 0) return i(fh, r).promise;
6803
6793
  let t = new AbortController();
6804
- yield Promise.race([i(ph, r).promise, on(e, t.signal).catch(b)]), t.abort();
6794
+ yield Promise.race([i(fh, r).promise, on(e, t.signal).catch(b)]), t.abort();
6805
6795
  })();
6806
6796
  }
6807
- function Th() {
6797
+ function wh() {
6808
6798
  var e;
6809
- (e = i(ph, this)) == null || e.resolve(), n(ph, this, void 0);
6799
+ (e = i(fh, this)) == null || e.resolve(), n(fh, this, void 0);
6810
6800
  }
6811
- function Eh(e) {
6812
- i(fh, this).splice(i(fh, this).indexOf(e), 1), e.reader.close().catch(b), i(yh, this).warn("Cancelling object stream whose header stalled past its hold", { streamId: e.streamId }), o(xh, this, Th).call(this);
6801
+ function Th(e) {
6802
+ i(dh, this).splice(i(dh, this).indexOf(e), 1), e.reader.close().catch(b), i(vh, this).warn("Cancelling object stream whose header stalled past its hold", { streamId: e.streamId }), o(bh, this, wh).call(this);
6813
6803
  }
6814
- function Dh() {
6815
- for (let { reader: e } of i(fh, this).splice(0)) e.close().catch(b);
6816
- o(xh, this, Th).call(this);
6804
+ function Eh() {
6805
+ for (let { reader: e } of i(dh, this).splice(0)) e.close().catch(b);
6806
+ o(bh, this, wh).call(this);
6817
6807
  }
6818
- function Oh(e, t, n) {
6808
+ function Dh(e, t, n) {
6819
6809
  var r;
6820
- if (n.close().catch(b), i(_h, this)) return;
6810
+ if (n.close().catch(b), i(gh, this)) return;
6821
6811
  let a = qc(e), o = {
6822
6812
  streamId: t,
6823
6813
  error: e,
6824
6814
  source: a == null ? void 0 : a.source,
6825
6815
  streamErrorCode: (r = a == null ? void 0 : a.streamErrorCode) == null ? void 0 : r
6826
6816
  };
6827
- (a == null ? void 0 : a.source) === "stream" ? (Jc(e) ? i(yh, this).debug : i(yh, this).warn)("Discarding object stream whose header could not be read", o) : (i(yh, this).warn("Closing session after object stream header failure", o), this.close(a ? void 0 : {
6828
- closeCode: oh,
6817
+ (a == null ? void 0 : a.source) === "stream" ? (Jc(e) ? i(vh, this).debug : i(vh, this).warn)("Discarding object stream whose header could not be read", o) : (i(vh, this).warn("Closing session after object stream header failure", o), this.close(a ? void 0 : {
6818
+ closeCode: ah,
6829
6819
  reason: "Invalid object stream header"
6830
6820
  }));
6831
6821
  }
6832
6822
  // ../../libs/moq/src/client.ts
6833
- var kh = a.get().createContext("MoqClient");
6834
- function Ah(e) {
6835
- return jh.apply(this, arguments);
6823
+ var Oh = a.get().createContext("MoqClient");
6824
+ function kh(e) {
6825
+ return Ah.apply(this, arguments);
6836
6826
  }
6837
- function jh() {
6838
- return jh = t(function* (e) {
6827
+ function Ah() {
6828
+ return Ah = t(function* (e) {
6839
6829
  var t;
6840
6830
  ae(e.signal);
6841
6831
  let n = new WebSocket(e.wsUrl || e.url);
@@ -6854,30 +6844,30 @@ function jh() {
6854
6844
  i(), t(/* @__PURE__ */ Error("WebSocket closed before open"));
6855
6845
  };
6856
6846
  r = setTimeout(() => {
6857
- i(), n.close(), kh.warn("WebSocket connect timed out", { timeoutMs: yt }), t(/* @__PURE__ */ Error("WebSocket connect timed out"));
6847
+ i(), n.close(), Oh.warn("WebSocket connect timed out", { timeoutMs: yt }), t(/* @__PURE__ */ Error("WebSocket connect timed out"));
6858
6848
  }, yt), n.addEventListener("error", a), n.addEventListener("open", o), n.addEventListener("close", s);
6859
6849
  }), e.signal).catch(r), (t = e.signal) != null && t.aborted && r(E(e.signal));
6860
6850
  let i = wf.wrapWebsocket(n), a = Df(i, e.role).catch((e) => {
6861
- throw kh.warn("MoQ handshake failed, closing WebSocket", { error: e }), n.close(), e;
6851
+ throw Oh.warn("MoQ handshake failed, closing WebSocket", { error: e }), n.close(), e;
6862
6852
  });
6863
6853
  if (!e.handshakePipelining) {
6864
6854
  var o;
6865
6855
  yield se(a, e.signal).catch(r), (o = e.signal) != null && o.aborted && r(E(e.signal));
6866
6856
  }
6867
- let s = new Am(new rh(n, i), e.authToken);
6868
- return kh.info("connected", {
6857
+ let s = new Am(new nh(n, i), e.authToken);
6858
+ return Oh.info("connected", {
6869
6859
  url: e.wsUrl || e.url,
6870
6860
  transport: "websocket"
6871
6861
  }), e.handshakePipelining && a.catch((e) => {
6872
6862
  s.fail(e);
6873
6863
  }), s;
6874
- }), jh.apply(this, arguments);
6864
+ }), Ah.apply(this, arguments);
6875
6865
  }
6876
- function Mh(e) {
6877
- return Nh.apply(this, arguments);
6866
+ function jh(e) {
6867
+ return Mh.apply(this, arguments);
6878
6868
  }
6879
- function Nh() {
6880
- return Nh = t(function* (e, t = e.signal) {
6869
+ function Mh() {
6870
+ return Mh = t(function* (e, t = e.signal) {
6881
6871
  ae(t);
6882
6872
  let n = new WebTransport(e.url, {
6883
6873
  congestionControl: "low-latency",
@@ -6891,29 +6881,29 @@ function Nh() {
6891
6881
  window.removeEventListener("beforeunload", i);
6892
6882
  }).catch(() => {})), yield se(Promise.race([n.ready, n.closed.then(() => Promise.reject(/* @__PURE__ */ Error("WebTransport closed")))]), t).catch(r);
6893
6883
  let a = yield se(n.createBidirectionalStream(), t).catch(r), o = wf.wrapWebTransport(a), s = Df(o, e.role).catch((e) => {
6894
- throw kh.warn("MoQ handshake failed, closing WebTransport", { error: e }), n.close(), e;
6884
+ throw Oh.warn("MoQ handshake failed, closing WebTransport", { error: e }), n.close(), e;
6895
6885
  });
6896
6886
  e.handshakePipelining || (yield se(s, t).catch(r)), t != null && t.aborted && r(E(t));
6897
- let c = new Am(new Sh(n, o, e.url.toString()), e.authToken);
6898
- return kh.info("connected", {
6887
+ let c = new Am(new xh(n, o, e.url.toString()), e.authToken);
6888
+ return Oh.info("connected", {
6899
6889
  url: e.url,
6900
6890
  transport: "webtransport"
6901
6891
  }), e.handshakePipelining && s.catch((e) => {
6902
6892
  c.fail(e);
6903
6893
  }), c;
6904
- }), Nh.apply(this, arguments);
6894
+ }), Mh.apply(this, arguments);
6905
6895
  }
6906
- function Ph(e) {
6907
- return Fh.apply(this, arguments);
6896
+ function Nh(e) {
6897
+ return Ph.apply(this, arguments);
6908
6898
  }
6909
- function Fh() {
6910
- return Fh = t(function* (e) {
6899
+ function Ph() {
6900
+ return Ph = t(function* (e) {
6911
6901
  if (self.WebTransport && (e == null ? void 0 : e.preferredTransport) !== "websocket" && e.url.protocol.startsWith("https")) {
6912
6902
  if (!e.websocketFallbackTimeoutMs) return {
6913
- session: yield Mh(e),
6903
+ session: yield jh(e),
6914
6904
  transportSelectionReason: void 0
6915
6905
  };
6916
- let t = new AbortController(), n = oe(e.signal, (e) => t.abort(e.reason)), r = Mh(e, t.signal).catch(() => void 0), i, a = new Promise((t) => {
6906
+ let t = new AbortController(), n = oe(e.signal, (e) => t.abort(e.reason)), r = jh(e, t.signal).catch(() => void 0), i, a = new Promise((t) => {
6917
6907
  i = setTimeout(() => t(void 0), e.websocketFallbackTimeoutMs);
6918
6908
  }), o = yield Promise.race([r, a]).finally(() => {
6919
6909
  clearTimeout(i), n();
@@ -6922,21 +6912,21 @@ function Fh() {
6922
6912
  session: o,
6923
6913
  transportSelectionReason: void 0
6924
6914
  } : (t.abort(), r.then((e) => e == null ? void 0 : e.close()), {
6925
- session: yield Ah(e),
6915
+ session: yield kh(e),
6926
6916
  transportSelectionReason: "fallback"
6927
6917
  });
6928
6918
  }
6929
6919
  let t;
6930
6920
  return t = (e == null ? void 0 : e.preferredTransport) === "websocket" ? "disabled" : self.WebTransport ? "unavailable" : "unsupported", {
6931
- session: yield Ah(e),
6921
+ session: yield kh(e),
6932
6922
  transportSelectionReason: t
6933
6923
  };
6934
- }), Fh.apply(this, arguments);
6924
+ }), Ph.apply(this, arguments);
6935
6925
  }
6936
6926
  // ../../libs/moq/src/session/Track.ts
6937
- var Ih = /* @__PURE__ */ new WeakMap(), Lh = class {
6927
+ var Fh = /* @__PURE__ */ new WeakMap(), Ih = class {
6938
6928
  constructor() {
6939
- c(this, Ih, {
6929
+ c(this, Fh, {
6940
6930
  name: "",
6941
6931
  priority: 0,
6942
6932
  groupOrder: "ascending",
@@ -6944,16 +6934,16 @@ var Ih = /* @__PURE__ */ new WeakMap(), Lh = class {
6944
6934
  });
6945
6935
  }
6946
6936
  name(e) {
6947
- return i(Ih, this).name = e, this;
6937
+ return i(Fh, this).name = e, this;
6948
6938
  }
6949
6939
  priority(e) {
6950
- return i(Ih, this).priority = e, this;
6940
+ return i(Fh, this).priority = e, this;
6951
6941
  }
6952
6942
  groupOrder(e) {
6953
- return i(Ih, this).groupOrder = e, this;
6943
+ return i(Fh, this).groupOrder = e, this;
6954
6944
  }
6955
6945
  startGroup(e) {
6956
- return i(Ih, this).filterType = {
6946
+ return i(Fh, this).filterType = {
6957
6947
  type: "absolute-start",
6958
6948
  start: {
6959
6949
  group: e,
@@ -6962,7 +6952,7 @@ var Ih = /* @__PURE__ */ new WeakMap(), Lh = class {
6962
6952
  }, this;
6963
6953
  }
6964
6954
  range(e, t) {
6965
- return i(Ih, this).filterType = {
6955
+ return i(Fh, this).filterType = {
6966
6956
  type: "absolute-range",
6967
6957
  start: {
6968
6958
  group: e,
@@ -6975,70 +6965,70 @@ var Ih = /* @__PURE__ */ new WeakMap(), Lh = class {
6975
6965
  }, this;
6976
6966
  }
6977
6967
  build() {
6978
- return i(Ih, this);
6968
+ return i(Fh, this);
6979
6969
  }
6980
- }, Rh = /* @__PURE__ */ new WeakMap(), zh = /* @__PURE__ */ new WeakMap(), Bh = class {
6970
+ }, Lh = /* @__PURE__ */ new WeakMap(), Rh = /* @__PURE__ */ new WeakMap(), zh = class {
6981
6971
  constructor(e, t) {
6982
- c(this, Rh, void 0), c(this, zh, void 0), n(Rh, this, e), n(zh, this, t);
6972
+ c(this, Lh, void 0), c(this, Rh, void 0), n(Lh, this, e), n(Rh, this, t);
6983
6973
  }
6984
6974
  subscribe(e, t = /* @__PURE__ */ new Map()) {
6985
- return i(Rh, this).subscribe(this.namespace(), e, t);
6975
+ return i(Lh, this).subscribe(this.namespace(), e, t);
6986
6976
  }
6987
6977
  closed() {
6988
- return i(Rh, this).closed();
6978
+ return i(Lh, this).closed();
6989
6979
  }
6990
6980
  namespace() {
6991
- return i(zh, this).namespace;
6981
+ return i(Rh, this).namespace;
6992
6982
  }
6993
6983
  };
6994
6984
  // ../../libs/voq-catalog/src/catalog/Catalog.ts
6995
- function Vh(e, t) {
6985
+ function Bh(e, t) {
6996
6986
  return t ? [
6997
6987
  "com.vindral.moq",
6998
6988
  e,
6999
6989
  t
7000
6990
  ] : ["com.vindral.moq", e];
7001
6991
  }
7002
- function Hh(e) {
6992
+ function Vh(e) {
7003
6993
  let t = e[1];
7004
6994
  if (!t) throw Error("namespace must contain a channel ID");
7005
6995
  return t;
7006
6996
  }
7007
- function Uh(e) {
6997
+ function Hh(e) {
7008
6998
  return "tracks" in e;
7009
6999
  }
7010
- function Wh(e) {
7000
+ function Uh(e) {
7011
7001
  let t = new TextDecoder().decode(e);
7012
7002
  return JSON.parse(t);
7013
7003
  }
7014
7004
  // ../../libs/voq/src/tracks/Track.ts
7015
- var Gh, Kh = 2e3, qh = /* @__PURE__ */ new WeakMap(), Jh = /* @__PURE__ */ new WeakMap(), Yh = /* @__PURE__ */ new WeakMap(), Xh = /* @__PURE__ */ new WeakMap(), Zh = /* @__PURE__ */ new WeakMap(), Qh = /* @__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 WeakMap(), og = /* @__PURE__ */ new WeakMap(), Y = /* @__PURE__ */ new WeakSet();
7016
- Gh = Symbol.asyncIterator;
7017
- var sg = class e {
7005
+ var Wh, Gh = 2e3, Kh = /* @__PURE__ */ new WeakMap(), qh = /* @__PURE__ */ new WeakMap(), Jh = /* @__PURE__ */ new WeakMap(), Yh = /* @__PURE__ */ new WeakMap(), Xh = /* @__PURE__ */ new WeakMap(), Zh = /* @__PURE__ */ new WeakMap(), Qh = /* @__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 WeakMap(), Y = /* @__PURE__ */ new WeakSet();
7006
+ Wh = Symbol.asyncIterator;
7007
+ var og = class e {
7018
7008
  constructor(e, r) {
7019
7009
  var a = this;
7020
- k(this, Y), c(this, qh, void 0), c(this, Jh, void 0), c(this, Yh, new S(100)), c(this, Xh, void 0), c(this, Zh, !1), c(this, Qh, void 0), c(this, $h, void 0), c(this, eg, !1), c(this, tg, /* @__PURE__ */ new Set()), c(this, ng, !1), c(this, rg, !1), c(this, ig, !1), c(this, ag, void 0), c(this, og, function() {
7010
+ k(this, Y), c(this, Kh, void 0), c(this, qh, void 0), c(this, Jh, new S(100)), c(this, Yh, void 0), c(this, Xh, !1), c(this, Zh, void 0), c(this, Qh, void 0), c(this, $h, !1), c(this, eg, /* @__PURE__ */ new Set()), c(this, tg, !1), c(this, ng, !1), c(this, rg, !1), c(this, ig, void 0), c(this, ag, function() {
7021
7011
  var e = t(function* (e) {
7022
- if (e === void 0) return i(qh, a).close();
7023
- if (n(Zh, a, !0), i(Xh, a)) for (let t of i(Xh, a)) t > e && i(Xh, a).delete(t);
7012
+ if (e === void 0) return i(Kh, a).close();
7013
+ if (n(Xh, a, !0), i(Yh, a)) for (let t of i(Yh, a)) t > e && i(Yh, a).delete(t);
7024
7014
  else {
7025
- let t = i(Yh, a).items().reduce((e, t) => e < t ? e : t, e);
7026
- n(Xh, a, o(Y, a, bg).call(a, t, e));
7015
+ let t = i(Jh, a).items().reduce((e, t) => e < t ? e : t, e);
7016
+ n(Yh, a, o(Y, a, yg).call(a, t, e));
7027
7017
  }
7028
- o(Y, a, cg).call(a, !0);
7018
+ o(Y, a, sg).call(a, !0);
7029
7019
  });
7030
7020
  return function(t) {
7031
7021
  return e.apply(this, arguments);
7032
7022
  };
7033
- }()), n(qh, this, e), n(Jh, this, r), e.done().then(function() {
7023
+ }()), n(Kh, this, e), n(qh, this, r), e.done().then(function() {
7034
7024
  var e = t(function* (e) {
7035
7025
  var t;
7036
- return i(og, a).call(a, (t = e.finalInfo) == null ? void 0 : t.group);
7026
+ return i(ag, a).call(a, (t = e.finalInfo) == null ? void 0 : t.group);
7037
7027
  });
7038
7028
  return function(t) {
7039
7029
  return e.apply(this, arguments);
7040
7030
  };
7041
- }()).catch(b), n(ag, this, e.groups());
7031
+ }()).catch(b), n(ig, this, e.groups());
7042
7032
  }
7043
7033
  static subscribe(n, r) {
7044
7034
  return t(function* () {
@@ -7047,161 +7037,161 @@ var sg = class e {
7047
7037
  })();
7048
7038
  }
7049
7039
  subscribeId() {
7050
- return i(qh, this).id;
7040
+ return i(Kh, this).id;
7051
7041
  }
7052
7042
  name() {
7053
- return i(qh, this).name;
7043
+ return i(Kh, this).name;
7054
7044
  }
7055
7045
  largestGroupId() {
7056
- return i(Jh, this);
7046
+ return i(qh, this);
7057
7047
  }
7058
7048
  needsRenewal() {
7059
- return i(qh, this).expiryState() === "active" && i(Xh, this) === void 0;
7049
+ return i(Kh, this).expiryState() === "active" && i(Yh, this) === void 0;
7060
7050
  }
7061
7051
  endOfTrack(e) {
7062
7052
  var n = this;
7063
7053
  return t(function* () {
7064
- if (i(Zh, n)) return o(Y, n, fg).call(n, void 0, e);
7065
- let t = i(Yh, n).items().reduce((e, t) => e < t ? e : t, e);
7054
+ if (i(Xh, n)) return o(Y, n, dg).call(n, void 0, e);
7055
+ let t = i(Jh, n).items().reduce((e, t) => e < t ? e : t, e);
7066
7056
  return n.update(t, e);
7067
7057
  })();
7068
7058
  }
7069
7059
  update(e, r) {
7070
7060
  var a = this;
7071
7061
  return t(function* () {
7072
- return i(Zh, a) ? o(Y, a, fg).call(a, e, r) : (n(Xh, a, o(Y, a, bg).call(a, e, r)), i(Xh, a).size === 0 && (yield i(qh, a).close()), i(qh, a).update(e, r));
7062
+ return i(Xh, a) ? o(Y, a, dg).call(a, e, r) : (n(Yh, a, o(Y, a, yg).call(a, e, r)), i(Yh, a).size === 0 && (yield i(Kh, a).close()), i(Kh, a).update(e, r));
7073
7063
  })();
7074
7064
  }
7075
7065
  unsubscribe() {
7076
- return i(qh, this).unsubscribe();
7066
+ return i(Kh, this).unsubscribe();
7077
7067
  }
7078
7068
  next() {
7079
7069
  var e = this;
7080
7070
  return t(function* () {
7081
- n(ig, e, !0), o(Y, e, lg).call(e);
7071
+ n(rg, e, !0), o(Y, e, cg).call(e);
7082
7072
  try {
7083
- return yield o(Y, e, mg).call(e);
7073
+ return yield o(Y, e, pg).call(e);
7084
7074
  } finally {
7085
- n(ig, e, !1), clearTimeout(i($h, e));
7075
+ n(rg, e, !1), clearTimeout(i(Qh, e));
7086
7076
  }
7087
7077
  })();
7088
7078
  }
7089
7079
  return() {
7090
7080
  var e;
7091
- return (e = i(qh, this).close()) == null || e.catch(b), n(ng, this, !0), o(Y, this, dg).call(this), o(Y, this, vg).call(this), i(qh, this).return();
7081
+ return (e = i(Kh, this).close()) == null || e.catch(b), n(tg, this, !0), o(Y, this, ug).call(this), o(Y, this, _g).call(this), i(Kh, this).return();
7092
7082
  }
7093
- [Gh]() {
7083
+ [Wh]() {
7094
7084
  return this;
7095
7085
  }
7096
7086
  };
7097
- function cg(e) {
7087
+ function sg(e) {
7098
7088
  var t;
7099
- i(rg, this) || (((t = i(Xh, this)) == null ? void 0 : t.size) === 0 ? o(Y, this, ug).call(this) : e && o(Y, this, lg).call(this));
7089
+ i(ng, this) || (((t = i(Yh, this)) == null ? void 0 : t.size) === 0 ? o(Y, this, lg).call(this) : e && o(Y, this, cg).call(this));
7100
7090
  }
7101
- function lg() {
7102
- !i(rg, this) && i(Zh, this) && i(ig, this) && (clearTimeout(i($h, this)), n($h, this, setTimeout(() => o(Y, this, ug).call(this), Kh)));
7091
+ function cg() {
7092
+ !i(ng, this) && i(Xh, this) && i(rg, this) && (clearTimeout(i(Qh, this)), n(Qh, this, setTimeout(() => o(Y, this, lg).call(this), Gh)));
7103
7093
  }
7104
- function ug() {
7105
- if (o(Y, this, dg).call(this), o(Y, this, vg).call(this), !i(ng, this)) {
7094
+ function lg() {
7095
+ if (o(Y, this, ug).call(this), o(Y, this, _g).call(this), !i(tg, this)) {
7106
7096
  var e;
7107
- (e = i(qh, this).close()) == null || e.catch(b);
7097
+ (e = i(Kh, this).close()) == null || e.catch(b);
7108
7098
  }
7109
7099
  }
7110
- function dg() {
7111
- n(rg, this, !0), clearTimeout(i($h, this));
7100
+ function ug() {
7101
+ n(ng, this, !0), clearTimeout(i(Qh, this));
7112
7102
  }
7113
- function fg(e, t) {
7103
+ function dg(e, t) {
7114
7104
  var r;
7115
- let a = i(Qh, this), s = e == null ? D(0) : e, c = {
7105
+ let a = i(Zh, this), s = e == null ? D(0) : e, c = {
7116
7106
  startGroup: a && a.startGroup > s ? a.startGroup : s,
7117
7107
  endGroup: a && a.endGroup < t ? a.endGroup : t
7118
7108
  };
7119
- n(Qh, this, c);
7120
- for (let e of (r = i(Xh, this)) == null ? [] : r) if (!o(Y, this, pg).call(this, e)) {
7109
+ n(Zh, this, c);
7110
+ for (let e of (r = i(Yh, this)) == null ? [] : r) if (!o(Y, this, fg).call(this, e)) {
7121
7111
  var l;
7122
- (l = i(Xh, this)) == null || l.delete(e);
7112
+ (l = i(Yh, this)) == null || l.delete(e);
7123
7113
  }
7124
- o(Y, this, cg).call(this, !1);
7114
+ o(Y, this, sg).call(this, !1);
7125
7115
  }
7126
- function pg(e) {
7127
- let t = i(Qh, this);
7116
+ function fg(e) {
7117
+ let t = i(Zh, this);
7128
7118
  return !t || e >= t.startGroup && e <= t.endGroup;
7129
7119
  }
7130
- function mg() {
7120
+ function pg() {
7131
7121
  var e = this;
7132
7122
  return t(function* () {
7133
7123
  let t = !1;
7134
7124
  for (;;) {
7135
- if (i(Xh, e) && i(Xh, e).size === 0) return t ? o(Y, e, hg).call(e) : {
7125
+ if (i(Yh, e) && i(Yh, e).size === 0) return t ? o(Y, e, mg).call(e) : {
7136
7126
  done: !0,
7137
7127
  value: void 0
7138
7128
  };
7139
7129
  let n;
7140
7130
  try {
7141
- n = yield o(Y, e, _g).call(e, () => i(ag, e).next());
7131
+ n = yield o(Y, e, gg).call(e, () => i(ig, e).next());
7142
7132
  } catch (n) {
7143
- if (t) return o(Y, e, hg).call(e);
7133
+ if (t) return o(Y, e, mg).call(e);
7144
7134
  throw n;
7145
7135
  }
7146
- if (n === void 0) return o(Y, e, hg).call(e);
7136
+ if (n === void 0) return o(Y, e, mg).call(e);
7147
7137
  if (n.done) return n;
7148
- if (o(Y, e, pg).call(e, n.value.groupId())) return o(Y, e, yg).call(e, n);
7149
- if (!(yield o(Y, e, gg).call(e, n.value))) return o(Y, e, hg).call(e);
7138
+ if (o(Y, e, fg).call(e, n.value.groupId())) return o(Y, e, vg).call(e, n);
7139
+ if (!(yield o(Y, e, hg).call(e, n.value))) return o(Y, e, mg).call(e);
7150
7140
  t = !0;
7151
7141
  }
7152
7142
  })();
7153
7143
  }
7154
- function hg() {
7144
+ function mg() {
7155
7145
  var e, t, n;
7156
- return (e = i(Xh, this)) == null || e.clear(), o(Y, this, ug).call(this), (t = (n = i(ag, this)).return) == null || (t = t.call(n)) == null || t.catch(b), {
7146
+ return (e = i(Yh, this)) == null || e.clear(), o(Y, this, lg).call(this), (t = (n = i(ig, this)).return) == null || (t = t.call(n)) == null || t.catch(b), {
7157
7147
  done: !0,
7158
7148
  value: void 0
7159
7149
  };
7160
7150
  }
7161
- function gg(e) {
7151
+ function hg(e) {
7162
7152
  var n = this;
7163
7153
  return t(function* () {
7164
7154
  var t;
7165
- return !i(ng, n) && (t = yield o(Y, n, _g).call(n, () => {
7155
+ return !i(tg, n) && (t = yield o(Y, n, gg).call(n, () => {
7166
7156
  var t, n;
7167
7157
  return ((t = (n = e.return) == null ? void 0 : n.call(e)) == null ? Promise.resolve() : t).then(() => !0, () => !1);
7168
7158
  })) != null && t;
7169
7159
  })();
7170
7160
  }
7171
- function _g(e) {
7161
+ function gg(e) {
7172
7162
  var n = this;
7173
7163
  return t(function* () {
7174
- if (i(eg, n)) return;
7164
+ if (i($h, n)) return;
7175
7165
  let t = e(), r, a = new Promise((e) => {
7176
7166
  r = () => e(void 0);
7177
7167
  });
7178
- i(tg, n).add(r);
7168
+ i(eg, n).add(r);
7179
7169
  try {
7180
7170
  return yield Promise.race([t, a]);
7181
7171
  } finally {
7182
- i(tg, n).delete(r);
7172
+ i(eg, n).delete(r);
7183
7173
  }
7184
7174
  })();
7185
7175
  }
7186
- function vg() {
7187
- n(eg, this, !0);
7188
- for (let e of i(tg, this)) e();
7189
- i(tg, this).clear();
7176
+ function _g() {
7177
+ n($h, this, !0);
7178
+ for (let e of i(eg, this)) e();
7179
+ i(eg, this).clear();
7190
7180
  }
7191
- function yg(e) {
7181
+ function vg(e) {
7192
7182
  var t;
7193
7183
  let r = e.value.groupId();
7194
- return (t = i(Xh, this)) != null && t.delete(r) && i(Zh, this) && o(Y, this, cg).call(this, !0), i(Yh, this).push(r), i(Jh, this) || n(Jh, this, r), n(Jh, this, i(Jh, this) < r ? r : i(Jh, this)), e;
7184
+ return (t = i(Yh, this)) != null && t.delete(r) && i(Xh, this) && o(Y, this, sg).call(this, !0), i(Jh, this).push(r), i(qh, this) || n(qh, this, r), n(qh, this, i(qh, this) < r ? r : i(qh, this)), e;
7195
7185
  }
7196
- function bg(e, t) {
7186
+ function yg(e, t) {
7197
7187
  let n = /* @__PURE__ */ new Set();
7198
7188
  for (let r = e; r <= t; r++) n == null || n.add(r);
7199
- return i(Yh, this).items().forEach((e) => {
7189
+ return i(Jh, this).items().forEach((e) => {
7200
7190
  n == null || n.delete(e);
7201
7191
  }), n;
7202
7192
  }
7203
7193
  // \0@oxc-project+runtime@0.156.0/helpers/esm/asyncGeneratorDelegate.js
7204
- function xg(e) {
7194
+ function bg(e) {
7205
7195
  var t = {}, n = !1;
7206
7196
  function r(t, r) {
7207
7197
  return n = !0, r = new Promise(function(n) {
@@ -7223,24 +7213,24 @@ function xg(e) {
7223
7213
  }), t;
7224
7214
  }
7225
7215
  // ../../libs/voq/src/tracks/Renewable.ts
7226
- var Sg, Cg = /* @__PURE__ */ new WeakMap(), wg = /* @__PURE__ */ new WeakMap(), Tg = /* @__PURE__ */ new WeakMap(), Eg = /* @__PURE__ */ new WeakMap(), Dg = /* @__PURE__ */ new WeakSet(), Og = /* @__PURE__ */ new WeakMap();
7227
- Sg = Symbol.asyncIterator;
7228
- var kg = class e {
7216
+ var xg, Sg = /* @__PURE__ */ new WeakMap(), Cg = /* @__PURE__ */ new WeakMap(), wg = /* @__PURE__ */ new WeakMap(), Tg = /* @__PURE__ */ new WeakMap(), Eg = /* @__PURE__ */ new WeakSet(), Dg = /* @__PURE__ */ new WeakMap();
7217
+ xg = Symbol.asyncIterator;
7218
+ var Og = class e {
7229
7219
  constructor(e) {
7230
7220
  var r = this;
7231
- k(this, Dg), c(this, Cg, void 0), c(this, wg, void 0), c(this, Tg, new ie(10)), c(this, Eg, void 0), c(this, Og, function() {
7221
+ k(this, Eg), c(this, Sg, void 0), c(this, Cg, void 0), c(this, wg, new ie(10)), c(this, Tg, void 0), c(this, Dg, function() {
7232
7222
  var e = t(function* (e, t) {
7233
7223
  try {
7234
7224
  var n = Ap();
7235
- let a = n.u(yield i(Cg, r).lock()), s = { subscribeId: a.value.subscribeId() };
7225
+ let a = n.u(yield i(Sg, r).lock()), s = { subscribeId: a.value.subscribeId() };
7236
7226
  if (!a.value.needsRenewal()) {
7237
- i(Eg, r).debug("Subscription does not need renewal", s);
7227
+ i(Tg, r).debug("Subscription does not need renewal", s);
7238
7228
  return;
7239
7229
  }
7240
- let c = a.value.largestGroupId(), l = c !== void 0, u = new Lh().name(t.name).priority(t.priority).groupOrder(t.groupOrder);
7241
- switch (s.largestGroupId = c, i(Eg, r).debug("Renewing subscription", s), t.filterType.type) {
7230
+ let c = a.value.largestGroupId(), l = c !== void 0, u = new Ih().name(t.name).priority(t.priority).groupOrder(t.groupOrder);
7231
+ switch (s.largestGroupId = c, i(Tg, r).debug("Renewing subscription", s), t.filterType.type) {
7242
7232
  case "absolute-range":
7243
- i(Eg, r).debug("Absolute range is not renewed", s);
7233
+ i(Tg, r).debug("Absolute range is not renewed", s);
7244
7234
  return;
7245
7235
  case "absolute-start":
7246
7236
  case "latest-group":
@@ -7249,9 +7239,9 @@ var kg = class e {
7249
7239
  let d = u.build();
7250
7240
  s.newTrack = d;
7251
7241
  let [f] = yield Promise.all([e.subscribe(d), l ? a.value.update(c, c) : a.value.unsubscribe()]);
7252
- f.done().then((e) => o(Dg, r, Ag).call(r, f, e.finalInfo !== void 0)).catch(b), f.expiryNotification().then(() => i(Og, r).call(r, e, d)).catch(b);
7253
- let p = new sg(f, c);
7254
- a.value = p, yield i(Tg, r).push(p), i(Eg, r).info("Subscription renewed", s);
7242
+ f.done().then((e) => o(Eg, r, kg).call(r, f, e.finalInfo !== void 0)).catch(b), f.expiryNotification().then(() => i(Dg, r).call(r, e, d)).catch(b);
7243
+ let p = new og(f, c);
7244
+ a.value = p, yield i(wg, r).push(p), i(Tg, r).info("Subscription renewed", s);
7255
7245
  } catch (e) {
7256
7246
  n.e = e;
7257
7247
  } finally {
@@ -7261,24 +7251,24 @@ var kg = class e {
7261
7251
  return function(t, n) {
7262
7252
  return e.apply(this, arguments);
7263
7253
  };
7264
- }()), n(Cg, this, new Mt(e)), n(wg, this, e), n(Eg, this, a.get().createContext(`Renewable '${e.name()}'`));
7254
+ }()), n(Sg, this, new Mt(e)), n(Cg, this, e), n(Tg, this, a.get().createContext(`Renewable '${e.name()}'`));
7265
7255
  }
7266
7256
  static subscribe(n, r, a) {
7267
7257
  return t(function* () {
7268
- let t = a == null ? void 0 : a.params, s = a == null ? void 0 : a.largestGroupId, c = yield n.subscribe(r, t), l = new e(new sg(c, s));
7269
- return c.done().then((e) => o(Dg, l, Ag).call(l, c, e.finalInfo !== void 0)).catch(b), c.expiryNotification().then(() => i(Og, l).call(l, n, r)).catch(b), l;
7258
+ let t = a == null ? void 0 : a.params, s = a == null ? void 0 : a.largestGroupId, c = yield n.subscribe(r, t), l = new e(new og(c, s));
7259
+ return c.done().then((e) => o(Eg, l, kg).call(l, c, e.finalInfo !== void 0)).catch(b), c.expiryNotification().then(() => i(Dg, l).call(l, n, r)).catch(b), l;
7270
7260
  })();
7271
7261
  }
7272
7262
  largestGroupId() {
7273
- return i(Cg, this).unsafeValue().largestGroupId();
7263
+ return i(Sg, this).unsafeValue().largestGroupId();
7274
7264
  }
7275
7265
  update(e, n) {
7276
7266
  var r = this;
7277
7267
  return t(function* () {
7278
7268
  try {
7279
7269
  var t = Ap();
7280
- let a = t.u(yield i(Cg, r).lock());
7281
- return i(Tg, r).close(), a.value.update(e, n);
7270
+ let a = t.u(yield i(Sg, r).lock());
7271
+ return i(wg, r).close(), a.value.update(e, n);
7282
7272
  } catch (e) {
7283
7273
  t.e = e;
7284
7274
  } finally {
@@ -7291,8 +7281,8 @@ var kg = class e {
7291
7281
  return t(function* () {
7292
7282
  try {
7293
7283
  var t = Ap();
7294
- let r = t.u(yield i(Cg, n).lock());
7295
- return i(Tg, n).close(), r.value.endOfTrack(e);
7284
+ let r = t.u(yield i(Sg, n).lock());
7285
+ return i(wg, n).close(), r.value.endOfTrack(e);
7296
7286
  } catch (e) {
7297
7287
  t.e = e;
7298
7288
  } finally {
@@ -7305,8 +7295,8 @@ var kg = class e {
7305
7295
  return t(function* () {
7306
7296
  try {
7307
7297
  var t = Ap();
7308
- let n = t.u(yield i(Cg, e).lock());
7309
- return i(Tg, e).close(), n.value.unsubscribe();
7298
+ let n = t.u(yield i(Sg, e).lock());
7299
+ return i(wg, e).close(), n.value.unsubscribe();
7310
7300
  } catch (e) {
7311
7301
  t.e = e;
7312
7302
  } finally {
@@ -7319,8 +7309,8 @@ var kg = class e {
7319
7309
  return t(function* () {
7320
7310
  try {
7321
7311
  var t = Ap();
7322
- let n = t.u(yield i(Cg, e).lock());
7323
- return i(Tg, e).close(), n.value.return();
7312
+ let n = t.u(yield i(Sg, e).lock());
7313
+ return i(wg, e).close(), n.value.return();
7324
7314
  } catch (e) {
7325
7315
  t.e = e;
7326
7316
  } finally {
@@ -7331,17 +7321,17 @@ var kg = class e {
7331
7321
  next() {
7332
7322
  var e = this;
7333
7323
  return t(function* () {
7334
- let t = yield i(wg, e).next();
7324
+ let t = yield i(Cg, e).next();
7335
7325
  if (t.done) {
7336
7326
  var r, a;
7337
- yield (r = (a = i(wg, e)).return) == null ? void 0 : r.call(a);
7338
- let t = yield i(Tg, e).pop();
7339
- if (t) return n(wg, e, t), e.next();
7327
+ yield (r = (a = i(Cg, e)).return) == null ? void 0 : r.call(a);
7328
+ let t = yield i(wg, e).pop();
7329
+ if (t) return n(Cg, e, t), e.next();
7340
7330
  }
7341
7331
  return t;
7342
7332
  })();
7343
7333
  }
7344
- [Sg]() {
7334
+ [xg]() {
7345
7335
  return this;
7346
7336
  }
7347
7337
  objects() {
@@ -7351,7 +7341,7 @@ var kg = class e {
7351
7341
  try {
7352
7342
  for (var i = H(e), a; t = !(a = yield A(i.next())).done; t = !1) try {
7353
7343
  var o = Ap();
7354
- yield* xg(H(o.a(a.value)));
7344
+ yield* bg(H(o.a(a.value)));
7355
7345
  } catch (e) {
7356
7346
  o.e = e;
7357
7347
  } finally {
@@ -7369,61 +7359,61 @@ var kg = class e {
7369
7359
  })();
7370
7360
  }
7371
7361
  };
7372
- function Ag(e, n) {
7362
+ function kg(e, n) {
7373
7363
  var r = this;
7374
7364
  return t(function* () {
7375
- if (e.unsubscribed() || e.endRequested()) i(Eg, r).info("Server initiated subscribe done but the subscription is already closing");
7376
- else if (i(Cg, r).unsafeValue().subscribeId() !== e.id) i(Eg, r).info("subscribeId mismatch - the subscription already has been renewed");
7377
- else if (n) i(Tg, r).close();
7365
+ if (e.unsubscribed() || e.endRequested()) i(Tg, r).info("Server initiated subscribe done but the subscription is already closing");
7366
+ else if (i(Sg, r).unsafeValue().subscribeId() !== e.id) i(Tg, r).info("subscribeId mismatch - the subscription already has been renewed");
7367
+ else if (n) i(wg, r).close();
7378
7368
  else return r.return();
7379
7369
  })();
7380
7370
  }
7381
7371
  // ../../libs/voq/src/tracks/Catalog.ts
7382
- var jg = "catalog";
7383
- function Mg(e) {
7384
- let t = Wh(e.payload);
7385
- if (!Uh(t)) throw Error("unexpected catalog type");
7372
+ var Ag = "catalog";
7373
+ function jg(e) {
7374
+ let t = Uh(e.payload);
7375
+ if (!Hh(t)) throw Error("unexpected catalog type");
7386
7376
  return t;
7387
7377
  }
7388
- var Ng = /* @__PURE__ */ new WeakMap(), Pg = /* @__PURE__ */ new WeakMap(), Fg = /* @__PURE__ */ new WeakMap(), Ig = /* @__PURE__ */ new WeakMap(), Lg = /* @__PURE__ */ new WeakSet(), Rg = class e {
7378
+ var Mg = /* @__PURE__ */ new WeakMap(), Ng = /* @__PURE__ */ new WeakMap(), Pg = /* @__PURE__ */ new WeakMap(), Fg = /* @__PURE__ */ new WeakMap(), Ig = /* @__PURE__ */ new WeakSet(), Lg = class e {
7389
7379
  constructor(e, t, r) {
7390
- k(this, Lg), c(this, Ng, void 0), c(this, Pg, void 0), c(this, Fg, void 0), c(this, Ig, void 0), n(Pg, this, e), n(Ng, this, t), n(Fg, this, r), n(Ig, this, o(Lg, this, zg).call(this)), this.closed().finally(() => i(Ng, this).close()).catch(b);
7380
+ k(this, Ig), c(this, Mg, void 0), c(this, Ng, void 0), c(this, Pg, void 0), c(this, Fg, void 0), n(Ng, this, e), n(Mg, this, t), n(Pg, this, r), n(Fg, this, o(Ig, this, Rg).call(this)), this.closed().finally(() => i(Mg, this).close()).catch(b);
7391
7381
  }
7392
7382
  catalog() {
7393
- return i(Ng, this);
7383
+ return i(Mg, this);
7394
7384
  }
7395
7385
  closed() {
7396
- return i(Ig, this);
7386
+ return i(Fg, this);
7397
7387
  }
7398
7388
  close() {
7399
7389
  var e = this;
7400
7390
  return t(function* () {
7401
- return i(Ng, e).close(), (yield i(Pg, e).promise).unsubscribe();
7391
+ return i(Mg, e).close(), (yield i(Ng, e).promise).unsubscribe();
7402
7392
  })();
7403
7393
  }
7404
7394
  static start(n, r) {
7405
7395
  return t(function* () {
7406
- let t = x.fromPromise(kg.subscribe(n, new Lh().name(r.catalogName || jg).groupOrder("ascending").build())), i = x.fromPromise(t.promise.then((e) => e.objects()));
7396
+ let t = x.fromPromise(Og.subscribe(n, new Ih().name(r.catalogName || Ag).groupOrder("ascending").build())), i = x.fromPromise(t.promise.then((e) => e.objects()));
7407
7397
  if (r.catalog) return new e(t, new Vt(r.catalog), i);
7408
7398
  let a = yield (yield i.promise).next();
7409
7399
  if (!a.value) throw Error("No catalog found");
7410
- let o = Mg(a.value);
7400
+ let o = jg(a.value);
7411
7401
  return new e(t, new Vt(o), i);
7412
7402
  })();
7413
7403
  }
7414
7404
  };
7415
- function zg() {
7405
+ function Rg() {
7416
7406
  var e = this;
7417
7407
  return t(function* () {
7418
- let t = yield i(Fg, e).promise;
7408
+ let t = yield i(Pg, e).promise;
7419
7409
  var n = !1, r = !1, a;
7420
7410
  try {
7421
7411
  for (var o = H(t), s; n = !(s = yield o.next()).done; n = !1) {
7422
7412
  let t = s.value;
7423
7413
  {
7424
7414
  if (t.objectStatus !== al.Normal) continue;
7425
- let n = Mg(t);
7426
- i(Ng, e).update(n);
7415
+ let n = jg(t);
7416
+ i(Mg, e).update(n);
7427
7417
  }
7428
7418
  }
7429
7419
  } catch (e) {
@@ -7438,51 +7428,51 @@ function zg() {
7438
7428
  })();
7439
7429
  }
7440
7430
  // ../../libs/voq/src/tracks/Cmaf.ts
7441
- var Bg, Vg, Hg, Ug, Wg, Gg, Kg, qg, Jg = /* @__PURE__ */ new WeakMap(), Yg = /* @__PURE__ */ new WeakMap(), Xg = /* @__PURE__ */ new WeakMap(), Zg = /* @__PURE__ */ new WeakMap(), Qg = /* @__PURE__ */ new WeakMap(), $g = /* @__PURE__ */ new WeakMap(), e_ = /* @__PURE__ */ new WeakMap(), t_ = /* @__PURE__ */ new WeakMap(), n_ = /* @__PURE__ */ new WeakSet();
7442
- Bg = wt(), Vg = Symbol.dispose;
7443
- var r_ = class {
7431
+ var zg, Bg, Vg, Hg, Ug, Wg, Gg, Kg, qg = /* @__PURE__ */ new WeakMap(), Jg = /* @__PURE__ */ new WeakMap(), Yg = /* @__PURE__ */ new WeakMap(), Xg = /* @__PURE__ */ new WeakMap(), Zg = /* @__PURE__ */ new WeakMap(), Qg = /* @__PURE__ */ new WeakMap(), $g = /* @__PURE__ */ new WeakMap(), e_ = /* @__PURE__ */ new WeakMap(), t_ = /* @__PURE__ */ new WeakSet();
7432
+ zg = wt(), Bg = Symbol.dispose;
7433
+ var n_ = class {
7444
7434
  constructor(e, t) {
7445
- k(this, n_), c(this, Jg, void 0), c(this, Yg, void 0), c(this, Xg, void 0), c(this, Zg, void 0), c(this, Qg, void 0), c(this, $g, void 0), c(this, e_, void 0), c(this, t_, 0), n(Jg, this, e), n(Yg, this, t);
7435
+ k(this, t_), c(this, qg, void 0), c(this, Jg, void 0), c(this, Yg, void 0), c(this, Xg, void 0), c(this, Zg, void 0), c(this, Qg, void 0), c(this, $g, void 0), c(this, e_, 0), n(qg, this, e), n(Jg, this, t);
7446
7436
  }
7447
7437
  onFragment(e, t, r, a, o) {
7448
7438
  var s;
7449
- i(Xg, this) === void 0 && (n(Xg, this, e), n(Zg, this, t), n(Qg, this, r), n($g, this, a), i(Jg, this).debug("group start", {
7450
- name: i(Yg, this).name,
7439
+ i(Yg, this) === void 0 && (n(Yg, this, e), n(Xg, this, t), n(Zg, this, r), n(Qg, this, a), i(qg, this).debug("group start", {
7440
+ name: i(Jg, this).name,
7451
7441
  groupId: e,
7452
7442
  startTimeMs: a,
7453
7443
  endTimeMs: o,
7454
7444
  subscribeId: t,
7455
7445
  mediaType: r,
7456
- namespace: i(Yg, this).namespace
7457
- })), n(t_, this, (s = i(t_, this), s++, s)), n(e_, this, o);
7446
+ namespace: i(Jg, this).namespace
7447
+ })), n(e_, this, (s = i(e_, this), s++, s)), n($g, this, o);
7458
7448
  }
7459
- [Bg]() {
7460
- o(n_, this, i_).call(this);
7449
+ [zg]() {
7450
+ o(t_, this, r_).call(this);
7461
7451
  }
7462
- [Vg]() {
7463
- o(n_, this, i_).call(this);
7452
+ [Bg]() {
7453
+ o(t_, this, r_).call(this);
7464
7454
  }
7465
7455
  };
7466
- function i_() {
7467
- i(Xg, this) !== void 0 && i($g, this) !== void 0 && i(e_, this) !== void 0 && i(Jg, this).debug("group end", {
7468
- name: i(Yg, this).name,
7469
- groupId: i(Xg, this),
7470
- startTimeMs: i($g, this),
7471
- endTimeMs: i(e_, this),
7472
- durationMs: i(e_, this) - i($g, this),
7473
- fragmentCount: i(t_, this),
7474
- subscribeId: i(Zg, this),
7475
- mediaType: i(Qg, this),
7476
- namespace: i(Yg, this).namespace
7456
+ function r_() {
7457
+ i(Yg, this) !== void 0 && i(Qg, this) !== void 0 && i($g, this) !== void 0 && i(qg, this).debug("group end", {
7458
+ name: i(Jg, this).name,
7459
+ groupId: i(Yg, this),
7460
+ startTimeMs: i(Qg, this),
7461
+ endTimeMs: i($g, this),
7462
+ durationMs: i($g, this) - i(Qg, this),
7463
+ fragmentCount: i(e_, this),
7464
+ subscribeId: i(Xg, this),
7465
+ mediaType: i(Zg, this),
7466
+ namespace: i(Jg, this).namespace
7477
7467
  });
7478
7468
  }
7479
- var a_ = /* @__PURE__ */ new WeakMap(), o_ = /* @__PURE__ */ new WeakMap(), s_ = /* @__PURE__ */ new WeakMap(), c_ = /* @__PURE__ */ new WeakMap(), l_ = /* @__PURE__ */ new WeakSet();
7480
- Hg = Symbol.asyncIterator, Ug = Ct(), Wg = Symbol.asyncDispose;
7481
- var u_ = class {
7469
+ var i_ = /* @__PURE__ */ new WeakMap(), a_ = /* @__PURE__ */ new WeakMap(), o_ = /* @__PURE__ */ new WeakMap(), s_ = /* @__PURE__ */ new WeakMap(), c_ = /* @__PURE__ */ new WeakSet();
7470
+ Vg = Symbol.asyncIterator, Hg = Ct(), Ug = Symbol.asyncDispose;
7471
+ var l_ = class {
7482
7472
  constructor(t, r, i, o) {
7483
- k(this, l_), c(this, a_, void 0), c(this, o_, void 0), c(this, s_, void 0), e(this, "track", void 0), c(this, c_, a.get().createContext("CmafGroup")), this.track = o, n(a_, this, i), n(o_, this, t), n(s_, this, r);
7473
+ k(this, c_), c(this, i_, void 0), c(this, a_, void 0), c(this, o_, void 0), e(this, "track", void 0), c(this, s_, a.get().createContext("CmafGroup")), this.track = o, n(i_, this, i), n(a_, this, t), n(o_, this, r);
7484
7474
  }
7485
- [Hg]() {
7475
+ [Vg]() {
7486
7476
  var e = this;
7487
7477
  return Pt(function* () {
7488
7478
  try {
@@ -7490,18 +7480,18 @@ var u_ = class {
7490
7480
  let c = {
7491
7481
  name: e.track.trackObject.name,
7492
7482
  namespace: e.track.namespace
7493
- }, l = t.u(new r_(i(c_, e), c));
7483
+ }, l = t.u(new n_(i(s_, e), c));
7494
7484
  var n = !1, r = !1, a;
7495
7485
  try {
7496
- for (var o = H(i(o_, e)), s; n = !(s = yield A(o.next())).done; n = !1) {
7486
+ for (var o = H(i(a_, e)), s; n = !(s = yield A(o.next())).done; n = !1) {
7497
7487
  let t = s.value;
7498
7488
  {
7499
7489
  if (t.objectStatus === al.EndOfTrackAndGroup && (yield A(e.track.endOfTrack(t.groupId))), t.objectStatus !== al.Normal) continue;
7500
- let n = i(s_, e).createFragment(t.payload), r = n.timescale(), a = n.baseMediaDecodeTime() / r * 1e3, o = a + n.duration() / r * 1e3, s = i(a_, e) / 1e3 * r;
7490
+ let n = i(o_, e).createFragment(t.payload), r = n.timescale(), a = n.baseMediaDecodeTime() / r * 1e3, o = a + n.duration() / r * 1e3, s = i(i_, e) / 1e3 * r;
7501
7491
  n.updateBaseMediaDecodeTime(n.baseMediaDecodeTime() - s);
7502
7492
  let u = e.track.timestampRange();
7503
7493
  if (u && a >= u[1]) break;
7504
- i(c_, e).trace("fragment", p(p({}, c), {}, {
7494
+ i(s_, e).trace("fragment", p(p({}, c), {}, {
7505
7495
  startTime: a,
7506
7496
  endTime: o,
7507
7497
  subscribeId: t.subscribeId,
@@ -7527,41 +7517,41 @@ var u_ = class {
7527
7517
  }
7528
7518
  })();
7529
7519
  }
7530
- [Ug]() {
7531
- return o(l_, this, d_).call(this);
7520
+ [Hg]() {
7521
+ return o(c_, this, u_).call(this);
7532
7522
  }
7533
- [Wg]() {
7534
- return o(l_, this, d_).call(this);
7523
+ [Ug]() {
7524
+ return o(c_, this, u_).call(this);
7535
7525
  }
7536
7526
  };
7537
- function d_() {
7527
+ function u_() {
7538
7528
  var e = this;
7539
7529
  return t(function* () {
7540
7530
  var t, n;
7541
- return yield (t = (n = i(o_, e)).return) == null ? void 0 : t.call(n), Promise.resolve();
7531
+ return yield (t = (n = i(a_, e)).return) == null ? void 0 : t.call(n), Promise.resolve();
7542
7532
  })();
7543
7533
  }
7544
- var f_ = /* @__PURE__ */ new WeakMap(), p_ = /* @__PURE__ */ new WeakMap(), m_ = /* @__PURE__ */ new WeakMap(), h_ = /* @__PURE__ */ new WeakMap();
7545
- Gg = Symbol.asyncIterator, Kg = Ct(), qg = Symbol.asyncDispose;
7546
- var g_ = class r {
7534
+ var d_ = /* @__PURE__ */ new WeakMap(), f_ = /* @__PURE__ */ new WeakMap(), p_ = /* @__PURE__ */ new WeakMap(), m_ = /* @__PURE__ */ new WeakMap();
7535
+ Wg = Symbol.asyncIterator, Gg = Ct(), Kg = Symbol.asyncDispose;
7536
+ var h_ = class r {
7547
7537
  constructor(t, r, i, a, o) {
7548
- c(this, f_, void 0), c(this, p_, void 0), c(this, m_, void 0), c(this, h_, void 0), e(this, "trackObject", void 0), e(this, "namespace", void 0), this.trackObject = t, this.namespace = r, n(p_, this, i), n(f_, this, a), n(m_, this, o);
7538
+ c(this, d_, void 0), c(this, f_, void 0), c(this, p_, void 0), c(this, m_, void 0), e(this, "trackObject", void 0), e(this, "namespace", void 0), this.trackObject = t, this.namespace = r, n(f_, this, i), n(d_, this, a), n(p_, this, o);
7549
7539
  }
7550
7540
  static subscribe(e, n, { timestampOffsetMs: i, startGroup: a, params: o }) {
7551
7541
  return t(function* () {
7552
7542
  if (n.format !== "cmaf") throw Error("format must be cmaf");
7553
- let t = new Lh().name(n.name);
7543
+ let t = new Ih().name(n.name);
7554
7544
  a !== void 0 && t.startGroup(a);
7555
7545
  let s = t.build();
7556
7546
  if (n.initTrack) {
7557
- let t = new Lh().name(n.initTrack).build(), [c, l] = yield Promise.all([__.call(r, e, t), kg.subscribe(e, s, {
7547
+ let t = new Ih().name(n.initTrack).build(), [c, l] = yield Promise.all([g_.call(r, e, t), Og.subscribe(e, s, {
7558
7548
  params: o,
7559
7549
  largestGroupId: a ? a - D(1) : void 0
7560
7550
  })]), u = new ao(c);
7561
7551
  return new r(n, e.namespace(), l, u, i);
7562
7552
  }
7563
7553
  v(n.initData, "no init data found on track");
7564
- let c = be(n.initData), l = new ao(new Uint8Array(c)), u = yield kg.subscribe(e, s, {
7554
+ let c = be(n.initData), l = new ao(new Uint8Array(c)), u = yield Og.subscribe(e, s, {
7565
7555
  params: o,
7566
7556
  largestGroupId: a ? a - D(1) : void 0
7567
7557
  });
@@ -7569,59 +7559,59 @@ var g_ = class r {
7569
7559
  })();
7570
7560
  }
7571
7561
  largestGroupId() {
7572
- return i(p_, this).largestGroupId();
7562
+ return i(f_, this).largestGroupId();
7573
7563
  }
7574
7564
  stopAfterTimestampReached(e) {
7575
- n(h_, this, [0, e]);
7565
+ n(m_, this, [0, e]);
7576
7566
  }
7577
7567
  timestampRange() {
7578
- return i(h_, this);
7568
+ return i(m_, this);
7579
7569
  }
7580
7570
  endOfTrack(e) {
7581
- return i(p_, this).endOfTrack(e);
7571
+ return i(f_, this).endOfTrack(e);
7582
7572
  }
7583
7573
  update(e, t) {
7584
- return i(p_, this).update(e, t);
7574
+ return i(f_, this).update(e, t);
7585
7575
  }
7586
7576
  unsubscribe() {
7587
7577
  var e = this;
7588
7578
  return t(function* () {
7589
- return i(p_, e).unsubscribe();
7579
+ return i(f_, e).unsubscribe();
7590
7580
  })();
7591
7581
  }
7592
7582
  next() {
7593
7583
  var e = this;
7594
7584
  return t(function* () {
7595
- let t = yield i(p_, e).next();
7585
+ let t = yield i(f_, e).next();
7596
7586
  return t.done ? t : {
7597
7587
  done: !1,
7598
- value: new u_(t.value, i(f_, e), i(m_, e), e)
7588
+ value: new l_(t.value, i(d_, e), i(p_, e), e)
7599
7589
  };
7600
7590
  })();
7601
7591
  }
7602
7592
  return() {
7603
7593
  var e = this;
7604
7594
  return t(function* () {
7605
- return yield i(p_, e).return(), {
7595
+ return yield i(f_, e).return(), {
7606
7596
  done: !0,
7607
7597
  value: void 0
7608
7598
  };
7609
7599
  })();
7610
7600
  }
7611
- [Gg]() {
7601
+ [Wg]() {
7612
7602
  return this;
7613
7603
  }
7614
- [Kg]() {
7604
+ [Gg]() {
7615
7605
  return this.unsubscribe();
7616
7606
  }
7617
- [qg]() {
7607
+ [Kg]() {
7618
7608
  var e = this;
7619
7609
  return t(function* () {
7620
7610
  return e.unsubscribe();
7621
7611
  })();
7622
7612
  }
7623
7613
  };
7624
- function __(e, n) {
7614
+ function g_(e, n) {
7625
7615
  return t(function* () {
7626
7616
  try {
7627
7617
  var t = Ap();
@@ -7636,47 +7626,47 @@ function __(e, n) {
7636
7626
  })();
7637
7627
  }
7638
7628
  // ../../libs/voq/src/tracks/Timeline.ts
7639
- var v_ = 1e4, y_ = 3e4, b_ = /* @__PURE__ */ new WeakMap(), x_ = /* @__PURE__ */ new WeakMap(), S_ = /* @__PURE__ */ new WeakMap(), C_ = /* @__PURE__ */ new WeakMap(), w_ = /* @__PURE__ */ new WeakMap(), T_ = /* @__PURE__ */ new WeakMap(), E_ = /* @__PURE__ */ new WeakSet(), D_ = class e {
7629
+ var __ = 1e4, v_ = 3e4, y_ = /* @__PURE__ */ new WeakMap(), b_ = /* @__PURE__ */ new WeakMap(), x_ = /* @__PURE__ */ new WeakMap(), S_ = /* @__PURE__ */ new WeakMap(), C_ = /* @__PURE__ */ new WeakMap(), w_ = /* @__PURE__ */ new WeakMap(), T_ = /* @__PURE__ */ new WeakSet(), E_ = class e {
7640
7630
  constructor(e, t, r) {
7641
- k(this, E_), c(this, b_, a.get().createContext("Timeline")), c(this, x_, new Vt([])), c(this, S_, void 0), c(this, C_, void 0), c(this, w_, void 0), c(this, T_, void 0), n(C_, this, e), n(w_, this, r), n(S_, this, t), n(T_, this, o(E_, this, O_).call(this, i(S_, this))), this.closed().finally(() => i(x_, this).close()).catch(b);
7631
+ k(this, T_), c(this, y_, a.get().createContext("Timeline")), c(this, b_, new Vt([])), c(this, x_, void 0), c(this, S_, void 0), c(this, C_, void 0), c(this, w_, void 0), n(S_, this, e), n(C_, this, r), n(x_, this, t), n(w_, this, o(T_, this, D_).call(this, i(x_, this))), this.closed().finally(() => i(b_, this).close()).catch(b);
7642
7632
  }
7643
7633
  closed() {
7644
- return i(T_, this);
7634
+ return i(w_, this);
7645
7635
  }
7646
7636
  close() {
7647
7637
  var e = this;
7648
7638
  return t(function* () {
7649
- return (yield i(S_, e).promise).unsubscribe();
7639
+ return (yield i(x_, e).promise).unsubscribe();
7650
7640
  })();
7651
7641
  }
7652
7642
  timeline() {
7653
- let [e, t] = i(x_, this).value();
7643
+ let [e, t] = i(b_, this).value();
7654
7644
  return e;
7655
7645
  }
7656
7646
  timestampWallclockOffset() {
7657
7647
  return pt(this.timeline().map((e) => e.mediaPts - e.wallclock));
7658
7648
  }
7659
7649
  static start(t, n) {
7660
- let r = x.fromPromise(kg.subscribe(t, new Lh().name(n).groupOrder("ascending").build()));
7650
+ let r = x.fromPromise(Og.subscribe(t, new Ih().name(n).groupOrder("ascending").build()));
7661
7651
  return new e(t, r, n);
7662
7652
  }
7663
7653
  waitForWallclockTime(e) {
7664
7654
  var n = this;
7665
7655
  return t(function* () {
7666
- return yield i(x_, n).waitFor((t) => !!t.find((t) => t.wallclock >= e)), n.timeline();
7656
+ return yield i(b_, n).waitFor((t) => !!t.find((t) => t.wallclock >= e)), n.timeline();
7667
7657
  })();
7668
7658
  }
7669
7659
  waitForTimelineToHaveMinDuration() {
7670
7660
  var e = this;
7671
7661
  return t(function* () {
7672
- return yield i(x_, e).waitFor((e) => {
7662
+ return yield i(b_, e).waitFor((e) => {
7673
7663
  let t = e[0], n = e[e.length - 1];
7674
- return !t || !n ? !1 : n.wallclock - t.wallclock > v_;
7664
+ return !t || !n ? !1 : n.wallclock - t.wallclock > __;
7675
7665
  }), e.timeline();
7676
7666
  })();
7677
7667
  }
7678
7668
  };
7679
- function O_(e) {
7669
+ function D_(e) {
7680
7670
  var n = this;
7681
7671
  return t(function* () {
7682
7672
  let t = yield e.promise;
@@ -7691,13 +7681,13 @@ function O_(e) {
7691
7681
  let e = h.value;
7692
7682
  {
7693
7683
  if (e.objectStatus !== al.Normal) continue;
7694
- let r = A_(e.payload);
7695
- i(x_, n).update((e) => {
7684
+ let r = k_(e.payload);
7685
+ i(b_, n).update((e) => {
7696
7686
  var t, n;
7697
- for (e.push(...r), e.sort((e, t) => e.wallclock - t.wallclock); e[0] && ((t = (n = e[e.length - 1]) == null ? void 0 : n.wallclock) == null ? 0 : t) - e[0].wallclock > y_;) e.shift();
7687
+ for (e.push(...r), e.sort((e, t) => e.wallclock - t.wallclock); e[0] && ((t = (n = e[e.length - 1]) == null ? void 0 : n.wallclock) == null ? 0 : t) - e[0].wallclock > v_;) e.shift();
7698
7688
  return e;
7699
- }), t === i(S_, n).resolved && e.groupId > D(0) && e.objectId === D(0) && o(E_, n, k_).call(n, e.groupId).catch((e) => {
7700
- i(b_, n).warn("backfill failed", e);
7689
+ }), t === i(x_, n).resolved && e.groupId > D(0) && e.objectId === D(0) && o(T_, n, O_).call(n, e.groupId).catch((e) => {
7690
+ i(y_, n).warn("backfill failed", e);
7701
7691
  });
7702
7692
  }
7703
7693
  }
@@ -7726,20 +7716,20 @@ function O_(e) {
7726
7716
  }
7727
7717
  })();
7728
7718
  }
7729
- function k_(e) {
7719
+ function O_(e) {
7730
7720
  var n = this;
7731
7721
  return t(function* () {
7732
7722
  let t = e - D(1), r = n.timeline(), a = r[0], s = r[r.length - 1];
7733
- if (!a || !s || s.wallclock - a.wallclock > v_) return;
7734
- i(b_, n).debug("backfilling timeline", {
7723
+ if (!a || !s || s.wallclock - a.wallclock > __) return;
7724
+ i(y_, n).debug("backfilling timeline", {
7735
7725
  currentGroupId: e,
7736
7726
  backfillGroupId: t
7737
7727
  });
7738
- let c = x.fromPromise(kg.subscribe(i(C_, n), new Lh().name(i(w_, n)).groupOrder("ascending").range(t, t).build()));
7739
- return o(E_, n, O_).call(n, c);
7728
+ let c = x.fromPromise(Og.subscribe(i(S_, n), new Ih().name(i(C_, n)).groupOrder("ascending").range(t, t).build()));
7729
+ return o(T_, n, D_).call(n, c);
7740
7730
  })();
7741
7731
  }
7742
- function A_(e) {
7732
+ function k_(e) {
7743
7733
  var t;
7744
7734
  let n = new TextDecoder("utf-8").decode(e).split("\n");
7745
7735
  return (t = n[0]) != null && t.startsWith("MEDIA_PTS") && n.shift(), n.filter((e) => e.length > 0).map((e) => {
@@ -7755,46 +7745,46 @@ function A_(e) {
7755
7745
  });
7756
7746
  }
7757
7747
  // ../../libs/voq/src/tracks/WebVTT.ts
7758
- var j_, M_, N_;
7759
- function P_(e) {
7748
+ var A_, j_, M_;
7749
+ function N_(e) {
7760
7750
  return typeof e.language == "string";
7761
7751
  }
7762
- var F_ = /* @__PURE__ */ new WeakMap(), I_ = /* @__PURE__ */ new WeakMap(), L_ = /* @__PURE__ */ new WeakMap(), R_ = /* @__PURE__ */ new WeakMap();
7763
- j_ = Symbol.asyncIterator, M_ = Ct(), N_ = Symbol.asyncDispose;
7764
- var z_ = class r {
7752
+ var P_ = /* @__PURE__ */ new WeakMap(), F_ = /* @__PURE__ */ new WeakMap(), I_ = /* @__PURE__ */ new WeakMap(), L_ = /* @__PURE__ */ new WeakMap();
7753
+ A_ = Symbol.asyncIterator, j_ = Ct(), M_ = Symbol.asyncDispose;
7754
+ var R_ = class r {
7765
7755
  constructor(t, r, i, a, o) {
7766
- c(this, F_, new fc()), c(this, I_, void 0), c(this, L_, void 0), c(this, R_, 0), e(this, "trackObject", void 0), e(this, "namespace", void 0), n(L_, this, t), n(I_, this, r), this.trackObject = i, this.namespace = a, n(R_, this, o);
7756
+ c(this, P_, new fc()), c(this, F_, void 0), c(this, I_, void 0), c(this, L_, 0), e(this, "trackObject", void 0), e(this, "namespace", void 0), n(I_, this, t), n(F_, this, r), this.trackObject = i, this.namespace = a, n(L_, this, o);
7767
7757
  }
7768
7758
  static subscribe(e, n, i) {
7769
7759
  return t(function* () {
7770
- if (!P_(n)) throw Error("track object language is required");
7771
- let t = new Lh().name(n.name).build(), a = yield kg.subscribe(e, t), o = a.objects();
7760
+ if (!N_(n)) throw Error("track object language is required");
7761
+ let t = new Ih().name(n.name).build(), a = yield Og.subscribe(e, t), o = a.objects();
7772
7762
  return new r(a, o, n, e.namespace(), i);
7773
7763
  })();
7774
7764
  }
7775
7765
  largestGroupId() {
7776
- return i(L_, this).largestGroupId();
7766
+ return i(I_, this).largestGroupId();
7777
7767
  }
7778
7768
  update(e, t) {
7779
- return i(L_, this).update(e, t);
7769
+ return i(I_, this).update(e, t);
7780
7770
  }
7781
7771
  unsubscribe() {
7782
- return i(L_, this).unsubscribe();
7772
+ return i(I_, this).unsubscribe();
7783
7773
  }
7784
7774
  next() {
7785
7775
  var e = this;
7786
7776
  return t(function* () {
7787
7777
  for (;;) {
7788
- let t = yield i(I_, e).next();
7778
+ let t = yield i(F_, e).next();
7789
7779
  if (t.done) return t;
7790
7780
  if (t.value.objectStatus !== al.Normal) continue;
7791
7781
  let n = new TextDecoder().decode(t.value.payload), r;
7792
7782
  try {
7793
- r = i(F_, e).parse(n);
7783
+ r = i(P_, e).parse(n);
7794
7784
  } catch (e) {
7795
7785
  continue;
7796
7786
  }
7797
- let a = r.map((t) => (t.startTime -= i(R_, e) / 1e3, t.endTime -= i(R_, e) / 1e3, t));
7787
+ let a = r.map((t) => (t.startTime -= i(L_, e) / 1e3, t.endTime -= i(L_, e) / 1e3, t));
7798
7788
  return {
7799
7789
  done: !1,
7800
7790
  value: {
@@ -7808,29 +7798,29 @@ var z_ = class r {
7808
7798
  return() {
7809
7799
  var e = this;
7810
7800
  return t(function* () {
7811
- return yield i(L_, e).return(), {
7801
+ return yield i(I_, e).return(), {
7812
7802
  done: !0,
7813
7803
  value: void 0
7814
7804
  };
7815
7805
  })();
7816
7806
  }
7817
- [j_]() {
7807
+ [A_]() {
7818
7808
  return this;
7819
7809
  }
7820
- [M_]() {
7810
+ [j_]() {
7821
7811
  return this.unsubscribe();
7822
7812
  }
7823
- [N_]() {
7813
+ [M_]() {
7824
7814
  return this.unsubscribe();
7825
7815
  }
7826
- }, B_ = /* @__PURE__ */ new WeakMap(), V_ = /* @__PURE__ */ new WeakMap(), H_ = /* @__PURE__ */ new WeakMap(), U_ = /* @__PURE__ */ new WeakMap(), W_ = /* @__PURE__ */ new WeakSet(), G_ = class r {
7816
+ }, z_ = /* @__PURE__ */ new WeakMap(), B_ = /* @__PURE__ */ new WeakMap(), V_ = /* @__PURE__ */ new WeakMap(), H_ = /* @__PURE__ */ new WeakMap(), U_ = /* @__PURE__ */ new WeakSet(), W_ = class r {
7827
7817
  constructor(t, r, i, a, o) {
7828
- k(this, W_), e(this, "namespace", void 0), c(this, B_, void 0), c(this, V_, void 0), c(this, H_, void 0), c(this, U_, void 0), this.namespace = a, n(B_, this, t), n(V_, this, r), n(H_, this, i), n(U_, this, o);
7818
+ k(this, U_), e(this, "namespace", void 0), c(this, z_, void 0), c(this, B_, void 0), c(this, V_, void 0), c(this, H_, void 0), this.namespace = a, n(z_, this, t), n(B_, this, r), n(V_, this, i), n(H_, this, o);
7829
7819
  }
7830
7820
  static start(e, n) {
7831
7821
  return t(function* () {
7832
- q_._.info("Enter 'start'", { config: n });
7833
- let t = new Bh(e, { namespace: n.namespace }), [i, a] = yield Promise.all([D_.start(t, "timeline"), Rg.start(t, {
7822
+ K_._.info("Enter 'start'", { config: n });
7823
+ let t = new zh(e, { namespace: n.namespace }), [i, a] = yield Promise.all([E_.start(t, "timeline"), Lg.start(t, {
7834
7824
  catalog: n.catalog,
7835
7825
  namespace: n.namespace
7836
7826
  })]);
@@ -7838,42 +7828,42 @@ var z_ = class r {
7838
7828
  })();
7839
7829
  }
7840
7830
  closed() {
7841
- return Promise.race([i(H_, this).closed(), i(V_, this).closed()]);
7831
+ return Promise.race([i(V_, this).closed(), i(B_, this).closed()]);
7842
7832
  }
7843
7833
  catalog() {
7844
- return i(H_, this).catalog();
7834
+ return i(V_, this).catalog();
7845
7835
  }
7846
7836
  timestampWallclockOffset() {
7847
- return i(V_, this).timestampWallclockOffset();
7837
+ return i(B_, this).timestampWallclockOffset();
7848
7838
  }
7849
7839
  timestampOffsetMs() {
7850
- return i(U_, this);
7840
+ return i(H_, this);
7851
7841
  }
7852
7842
  setTimestampOffsetMs(e) {
7853
- n(U_, this, e);
7843
+ n(H_, this, e);
7854
7844
  }
7855
7845
  waitForWallclockTime(e) {
7856
- return i(V_, this).waitForWallclockTime(e);
7846
+ return i(B_, this).waitForWallclockTime(e);
7857
7847
  }
7858
7848
  subscribeCmafTrack(e, t) {
7859
7849
  let n = t == null ? void 0 : t.startGroup, r = t == null ? void 0 : t.params, a = this.catalog().current().tracks, s = e["com.vindral.variant_uid"] === void 0 ? void 0 : a.find((t) => t["com.vindral.variant_uid"] === e["com.vindral.variant_uid"]);
7860
- return o(W_, this, K_).call(this, () => g_.subscribe(i(B_, this), s == null ? e : s, {
7861
- timestampOffsetMs: i(U_, this),
7850
+ return o(U_, this, G_).call(this, () => h_.subscribe(i(z_, this), s == null ? e : s, {
7851
+ timestampOffsetMs: i(H_, this),
7862
7852
  startGroup: n,
7863
7853
  params: r
7864
7854
  }));
7865
7855
  }
7866
7856
  subscribeWebVttTrack(e) {
7867
- return o(W_, this, K_).call(this, () => z_.subscribe(i(B_, this), e, i(U_, this)));
7857
+ return o(U_, this, G_).call(this, () => R_.subscribe(i(z_, this), e, i(H_, this)));
7868
7858
  }
7869
7859
  subscribeTrack(e) {
7870
- return o(W_, this, K_).call(this, () => i(B_, this).subscribe(e));
7860
+ return o(U_, this, G_).call(this, () => i(z_, this).subscribe(e));
7871
7861
  }
7872
7862
  close() {
7873
- return Promise.all([i(H_, this).close(), i(V_, this).close()]);
7863
+ return Promise.all([i(V_, this).close(), i(B_, this).close()]);
7874
7864
  }
7875
7865
  };
7876
- function K_(e) {
7866
+ function G_(e) {
7877
7867
  var n = this;
7878
7868
  return t(function* () {
7879
7869
  let [t, r] = n.catalog().value();
@@ -7885,44 +7875,44 @@ function K_(e) {
7885
7875
  }
7886
7876
  })();
7887
7877
  }
7888
- var q_ = { _: a.get().createContext("Channel") }, J_ = D(8);
7889
- function Y_(e) {
7878
+ var K_ = { _: a.get().createContext("Channel") }, q_ = D(8);
7879
+ function J_(e) {
7890
7880
  if (e < 0 || e > 65535) throw RangeError("burstMs must be between 0 and 65535 inclusive");
7891
7881
  return {
7892
- type: J_,
7882
+ type: q_,
7893
7883
  payload: new Uint8Array([e >> 8 & 255, e & 255])
7894
7884
  };
7895
7885
  }
7896
7886
  // ../../libs/voq/src/ProducerReferenceClock.ts
7897
- var X_ = /* @__PURE__ */ new WeakMap(), Z_ = /* @__PURE__ */ new WeakMap(), Q_ = /* @__PURE__ */ new WeakSet(), $_ = class e {
7887
+ var Y_ = /* @__PURE__ */ new WeakMap(), X_ = /* @__PURE__ */ new WeakMap(), Z_ = /* @__PURE__ */ new WeakSet(), Q_ = class e {
7898
7888
  constructor(e) {
7899
- k(this, Q_), c(this, X_, void 0), c(this, Z_, void 0);
7889
+ k(this, Z_), c(this, Y_, void 0), c(this, X_, void 0);
7900
7890
  let [t, r] = e.value.value();
7901
- n(X_, this, {
7891
+ n(Y_, this, {
7902
7892
  createdAt: /* @__PURE__ */ new Date(),
7903
7893
  wallclock: new Date(t.ntpTimestamp),
7904
7894
  rtt: t.rtt
7905
- }), n(Z_, this, o(Q_, this, ev).call(this, e));
7895
+ }), n(X_, this, o(Z_, this, $_).call(this, e));
7906
7896
  }
7907
7897
  wallclock() {
7908
- let e = Date.now() - i(X_, this).createdAt.getTime();
7909
- return i(X_, this).wallclock.getTime() + e;
7898
+ let e = Date.now() - i(Y_, this).createdAt.getTime();
7899
+ return i(Y_, this).wallclock.getTime() + e;
7910
7900
  }
7911
7901
  closed() {
7912
- return i(Z_, this);
7902
+ return i(X_, this);
7913
7903
  }
7914
7904
  static start(t) {
7915
7905
  return new e(t);
7916
7906
  }
7917
7907
  };
7918
- function ev(e) {
7908
+ function $_(e) {
7919
7909
  var r = this;
7920
7910
  return t(function* () {
7921
7911
  var t = !1, i = !1, a;
7922
7912
  try {
7923
7913
  for (var o = H(e.value), s; t = !(s = yield o.next()).done; t = !1) {
7924
7914
  let e = s.value;
7925
- n(X_, r, {
7915
+ n(Y_, r, {
7926
7916
  createdAt: /* @__PURE__ */ new Date(),
7927
7917
  wallclock: new Date(e.ntpTimestamp),
7928
7918
  rtt: e.rtt
@@ -7940,7 +7930,7 @@ function ev(e) {
7940
7930
  })();
7941
7931
  }
7942
7932
  // \0@oxc-project+runtime@0.156.0/helpers/esm/objectWithoutPropertiesLoose.js
7943
- function tv(e, t) {
7933
+ function ev(e, t) {
7944
7934
  if (e == null) return {};
7945
7935
  var n = {};
7946
7936
  for (var r in e) if ({}.hasOwnProperty.call(e, r)) {
@@ -7950,9 +7940,9 @@ function tv(e, t) {
7950
7940
  return n;
7951
7941
  }
7952
7942
  // \0@oxc-project+runtime@0.156.0/helpers/esm/objectWithoutProperties.js
7953
- function nv(e, t) {
7943
+ function tv(e, t) {
7954
7944
  if (e == null) return {};
7955
- var n, r, i = tv(e, t);
7945
+ var n, r, i = ev(e, t);
7956
7946
  if (Object.getOwnPropertySymbols) {
7957
7947
  var a = Object.getOwnPropertySymbols(e);
7958
7948
  for (r = 0; r < a.length; r++) n = a[r], t.includes(n) || {}.propertyIsEnumerable.call(e, n) && (i[n] = e[n]);
@@ -7960,27 +7950,27 @@ function nv(e, t) {
7960
7950
  return i;
7961
7951
  }
7962
7952
  // ../../libs/voq/src/tracks/Drm.ts
7963
- var rv = ["fairplayCertificate"];
7964
- function iv(e) {
7953
+ var nv = ["fairplayCertificate"];
7954
+ function rv(e) {
7965
7955
  return typeof e == "string" || e == null;
7966
7956
  }
7967
- function av(e) {
7968
- return "provider" in e && typeof e.provider == "string" && (!("widevineLicenseUrl" in e) || iv(e.widevineLicenseUrl)) && (!("playreadyLicenseUrl" in e) || iv(e.playreadyLicenseUrl)) && (!("fairplayLicenseUrl" in e) || iv(e.fairplayLicenseUrl)) && (!("fairplayCertificate" in e) || iv(e.fairplayCertificate));
7957
+ function iv(e) {
7958
+ return "provider" in e && typeof e.provider == "string" && (!("widevineLicenseUrl" in e) || rv(e.widevineLicenseUrl)) && (!("playreadyLicenseUrl" in e) || rv(e.playreadyLicenseUrl)) && (!("fairplayLicenseUrl" in e) || rv(e.fairplayLicenseUrl)) && (!("fairplayCertificate" in e) || rv(e.fairplayCertificate));
7969
7959
  }
7970
- function ov(e) {
7960
+ function av(e) {
7971
7961
  try {
7972
7962
  return be(e);
7973
7963
  } catch (e) {
7974
7964
  throw Error("Failed to convert fairplayCertificate");
7975
7965
  }
7976
7966
  }
7977
- function sv(e) {
7967
+ function ov(e) {
7978
7968
  let t = new TextDecoder().decode(e), n = JSON.parse(t);
7979
- if (!av(n)) throw Error("Invalid drm object");
7980
- let { fairplayCertificate: r } = n, i = nv(n, rv);
7981
- return p(p({}, i), {}, { fairplayCertificate: r ? ov(r) : void 0 });
7969
+ if (!iv(n)) throw Error("Invalid drm object");
7970
+ let { fairplayCertificate: r } = n, i = tv(n, nv);
7971
+ return p(p({}, i), {}, { fairplayCertificate: r ? av(r) : void 0 });
7982
7972
  }
7983
- var cv = class n {
7973
+ var sv = class n {
7984
7974
  constructor(t) {
7985
7975
  e(this, "value", void 0), this.value = t;
7986
7976
  }
@@ -7988,9 +7978,9 @@ var cv = class n {
7988
7978
  return t(function* () {
7989
7979
  try {
7990
7980
  var t = Ap();
7991
- let a = yield t.a(yield e.subscribeTrack(new Lh().name("drm").build())).objects().next();
7981
+ let a = yield t.a(yield e.subscribeTrack(new Ih().name("drm").build())).objects().next();
7992
7982
  if (a.done) throw Error("No drm object received");
7993
- let o = sv(a.value.payload);
7983
+ let o = ov(a.value.payload);
7994
7984
  return new n(p(p({}, o), {}, {
7995
7985
  videoCodec: r,
7996
7986
  audioCodec: i
@@ -8004,32 +7994,32 @@ var cv = class n {
8004
7994
  }
8005
7995
  };
8006
7996
  // ../../libs/voq/src/tracks/Stats.ts
8007
- function lv(e) {
7997
+ function cv(e) {
8008
7998
  return "rtt" in e && typeof e.rtt == "number" && "ntpTimestamp" in e && typeof e.ntpTimestamp == "number" && "estimatedBandwidth" in e && typeof e.estimatedBandwidth == "number";
8009
7999
  }
8010
- function uv(e) {
8000
+ function lv(e) {
8011
8001
  let t = new TextDecoder().decode(e), n = JSON.parse(t);
8012
- if (!lv(n)) throw Error("Invalid stats object");
8002
+ if (!cv(n)) throw Error("Invalid stats object");
8013
8003
  return n;
8014
8004
  }
8015
- var dv = /* @__PURE__ */ new WeakMap(), fv = /* @__PURE__ */ new WeakSet(), pv = class r {
8005
+ var uv = /* @__PURE__ */ new WeakMap(), dv = /* @__PURE__ */ new WeakSet(), fv = class r {
8016
8006
  constructor(t, r, i, a) {
8017
- k(this, fv), e(this, "ip", void 0), e(this, "value", void 0), c(this, dv, void 0), this.ip = i, this.value = new Vt(r), n(dv, this, o(fv, this, mv).call(this, t, a)), this.closed().catch(b);
8007
+ k(this, dv), e(this, "ip", void 0), e(this, "value", void 0), c(this, uv, void 0), this.ip = i, this.value = new Vt(r), n(uv, this, o(dv, this, pv).call(this, t, a)), this.closed().catch(b);
8018
8008
  }
8019
8009
  closed() {
8020
- return i(dv, this);
8010
+ return i(uv, this);
8021
8011
  }
8022
8012
  static start(e, n) {
8023
8013
  return t(function* () {
8024
- let t = (yield e.subscribe(new Lh().name("stats").groupOrder("ascending").build())).objects(), i = yield t.next(), a = performance.now();
8014
+ let t = (yield e.subscribe(new Ih().name("stats").groupOrder("ascending").build())).objects(), i = yield t.next(), a = performance.now();
8025
8015
  if (i.done) throw Error("No stats object received");
8026
- let o = uv(i.value.payload);
8016
+ let o = lv(i.value.payload);
8027
8017
  if (!o.ip) throw Error("Expected IP in initial stats object");
8028
8018
  return n == null || n(o, a), new r(t, o, o.ip, n);
8029
8019
  })();
8030
8020
  }
8031
8021
  };
8032
- function mv(e, n) {
8022
+ function pv(e, n) {
8033
8023
  var r = this;
8034
8024
  return t(function* () {
8035
8025
  var t = !1, i = !1, a;
@@ -8038,7 +8028,7 @@ function mv(e, n) {
8038
8028
  let e = s.value;
8039
8029
  {
8040
8030
  if (e.objectStatus !== al.Normal) continue;
8041
- let t = performance.now(), i = uv(e.payload);
8031
+ let t = performance.now(), i = lv(e.payload);
8042
8032
  n == null || n(i, t), r.value.update(i);
8043
8033
  }
8044
8034
  }
@@ -8054,21 +8044,21 @@ function mv(e, n) {
8054
8044
  })();
8055
8045
  }
8056
8046
  // ../../libs/voq/src/UpstreamWatcher.ts
8057
- var hv = /* @__PURE__ */ new WeakMap(), gv = /* @__PURE__ */ new WeakMap(), _v = class {
8047
+ var mv = /* @__PURE__ */ new WeakMap(), hv = /* @__PURE__ */ new WeakMap(), gv = class {
8058
8048
  constructor(e) {
8059
- c(this, hv, a.get().createContext("UpstreamWatcher")), c(this, gv, void 0), n(gv, this, new Vt(x.fromPromise(e.closed())));
8049
+ c(this, mv, a.get().createContext("UpstreamWatcher")), c(this, hv, void 0), n(hv, this, new Vt(x.fromPromise(e.closed())));
8060
8050
  }
8061
8051
  update(e) {
8062
- i(gv, this).update(x.fromPromise(e.closed()));
8052
+ i(hv, this).update(x.fromPromise(e.closed()));
8063
8053
  }
8064
8054
  closed() {
8065
8055
  var e = this;
8066
8056
  return t(function* () {
8067
8057
  try {
8068
8058
  for (;;) {
8069
- let [t, n] = i(gv, e).value(), r = !1;
8059
+ let [t, n] = i(hv, e).value(), r = !1;
8070
8060
  yield Promise.race([n == null ? void 0 : n.then(() => r = !0), t.promise.then(() => {
8071
- if (!r) throw i(hv, e).warn("Upstream closed"), Error("Upstream closed");
8061
+ if (!r) throw i(mv, e).warn("Upstream closed"), Error("Upstream closed");
8072
8062
  })]);
8073
8063
  }
8074
8064
  } catch (e) {
@@ -8076,19 +8066,19 @@ var hv = /* @__PURE__ */ new WeakMap(), gv = /* @__PURE__ */ new WeakMap(), _v =
8076
8066
  }
8077
8067
  })();
8078
8068
  }
8079
- }, vv, yv = 5e3, bv = /* @__PURE__ */ new WeakMap(), xv = /* @__PURE__ */ new WeakMap(), Sv = /* @__PURE__ */ new WeakMap();
8080
- vv = Symbol.asyncIterator;
8081
- var Cv = class {
8069
+ }, _v, vv = 5e3, yv = /* @__PURE__ */ new WeakMap(), bv = /* @__PURE__ */ new WeakMap(), xv = /* @__PURE__ */ new WeakMap();
8070
+ _v = Symbol.asyncIterator;
8071
+ var Sv = class {
8082
8072
  constructor(e, t) {
8083
- c(this, bv, a.get().createContext("TracksIterator")), c(this, xv, void 0), c(this, Sv, void 0), n(xv, this, e), n(Sv, this, t);
8073
+ c(this, yv, a.get().createContext("TracksIterator")), c(this, bv, void 0), c(this, xv, void 0), n(bv, this, e), n(xv, this, t);
8084
8074
  }
8085
- [vv]() {
8075
+ [_v]() {
8086
8076
  var e = this;
8087
8077
  return Pt(function* () {
8088
- let t = i(Sv, e);
8078
+ let t = i(xv, e);
8089
8079
  var n = !1, r = !1, a;
8090
8080
  try {
8091
- for (var o = H(i(xv, e)), s; n = !(s = yield A(o.next())).done; n = !1) {
8081
+ for (var o = H(i(bv, e)), s; n = !(s = yield A(o.next())).done; n = !1) {
8092
8082
  let n = s.value;
8093
8083
  {
8094
8084
  if (!n) continue;
@@ -8096,7 +8086,7 @@ var Cv = class {
8096
8086
  name: n.trackObject.name,
8097
8087
  namespace: n.namespace
8098
8088
  };
8099
- i(bv, e).debug("track start", p({ mediaType: t }, r)), yield* xg(H(n)), i(bv, e).debug("track end", p({ mediaType: t }, r));
8089
+ i(yv, e).debug("track start", p({ mediaType: t }, r)), yield* bg(H(n)), i(yv, e).debug("track end", p({ mediaType: t }, r));
8100
8090
  }
8101
8091
  }
8102
8092
  } catch (e) {
@@ -8108,97 +8098,97 @@ var Cv = class {
8108
8098
  if (r) throw a;
8109
8099
  }
8110
8100
  }
8111
- i(bv, e).debug("tracks ended", { mediaType: t });
8101
+ i(yv, e).debug("tracks ended", { mediaType: t });
8112
8102
  })();
8113
8103
  }
8114
- }, wv = /* @__PURE__ */ new WeakMap(), Tv = /* @__PURE__ */ new WeakMap(), Ev = /* @__PURE__ */ new WeakMap(), Dv = /* @__PURE__ */ new WeakMap(), Ov = /* @__PURE__ */ new WeakMap(), kv = /* @__PURE__ */ new WeakMap(), Av = /* @__PURE__ */ new WeakMap(), jv = /* @__PURE__ */ new WeakMap(), Mv = /* @__PURE__ */ new WeakMap(), Nv = /* @__PURE__ */ new WeakMap(), Pv = /* @__PURE__ */ new WeakSet(), Fv = class r {
8104
+ }, Cv = /* @__PURE__ */ new WeakMap(), wv = /* @__PURE__ */ new WeakMap(), Tv = /* @__PURE__ */ new WeakMap(), Ev = /* @__PURE__ */ new WeakMap(), Dv = /* @__PURE__ */ new WeakMap(), Ov = /* @__PURE__ */ new WeakMap(), kv = /* @__PURE__ */ new WeakMap(), Av = /* @__PURE__ */ new WeakMap(), jv = /* @__PURE__ */ new WeakMap(), Mv = /* @__PURE__ */ new WeakMap(), Nv = /* @__PURE__ */ new WeakSet(), Pv = class r {
8115
8105
  constructor(t, r, s) {
8116
- k(this, Pv), c(this, wv, void 0), c(this, Tv, void 0), c(this, Ev, void 0), c(this, Dv, a.get().createContext("Player")), c(this, Ov, void 0), c(this, kv, new Vt(void 0)), c(this, Av, new Vt(void 0)), c(this, jv, new Vt(void 0)), c(this, Mv, void 0), c(this, Nv, void 0), e(this, "subtitles", new Cv(i(jv, this), "subtitles")), e(this, "video", new Cv(i(Av, this), "video")), e(this, "audio", new Cv(i(kv, this), "audio")), n(wv, this, t), n(Tv, this, $_.start(s)), n(Ev, this, s), n(Ov, this, new Vt(r)), n(Mv, this, new _v(r)), n(Nv, this, Promise.race([
8117
- o(Pv, this, Bv).call(this),
8118
- o(Pv, this, Iv).call(this),
8119
- o(Pv, this, zv).call(this),
8120
- i(Mv, this).closed()
8121
- ])), i(wv, this).closed().then(() => this.close()).catch(b);
8106
+ k(this, Nv), c(this, Cv, void 0), c(this, wv, void 0), c(this, Tv, void 0), c(this, Ev, a.get().createContext("Player")), c(this, Dv, void 0), c(this, Ov, new Vt(void 0)), c(this, kv, new Vt(void 0)), c(this, Av, new Vt(void 0)), c(this, jv, void 0), c(this, Mv, void 0), e(this, "subtitles", new Sv(i(Av, this), "subtitles")), e(this, "video", new Sv(i(kv, this), "video")), e(this, "audio", new Sv(i(Ov, this), "audio")), n(Cv, this, t), n(wv, this, Q_.start(s)), n(Tv, this, s), n(Dv, this, new Vt(r)), n(jv, this, new gv(r)), n(Mv, this, Promise.race([
8107
+ o(Nv, this, zv).call(this),
8108
+ o(Nv, this, Fv).call(this),
8109
+ o(Nv, this, Rv).call(this),
8110
+ i(jv, this).closed()
8111
+ ])), i(Cv, this).closed().then(() => this.close()).catch(b);
8122
8112
  }
8123
8113
  closed() {
8124
- return i(Nv, this);
8114
+ return i(Mv, this);
8125
8115
  }
8126
8116
  static start(e, n) {
8127
8117
  return t(function* () {
8128
8118
  let t = /* @__PURE__ */ new Map();
8129
8119
  if (n.burstMs !== void 0) {
8130
- let e = Y_(n.burstMs);
8120
+ let e = J_(n.burstMs);
8131
8121
  t.set(e.type, e);
8132
8122
  }
8133
- let a = new Bh(e, { namespace: Vh("auxiliary") }), [[o, s, c], l] = yield Promise.all([G_.start(e, n).then((e) => Promise.all([
8123
+ let a = new zh(e, { namespace: Bh("auxiliary") }), [[o, s, c], l] = yield Promise.all([W_.start(e, n).then((e) => Promise.all([
8134
8124
  Promise.resolve(e),
8135
8125
  n.videoTrack ? e.subscribeCmafTrack(n.videoTrack, { params: t }) : void 0,
8136
8126
  n.audioTrack ? e.subscribeCmafTrack(n.audioTrack, { params: t }) : void 0
8137
- ])), pv.start(a, n.onStats)]), u = new r(e, o, l);
8138
- return c && i(kv, u).update(c), s && i(Av, u).update(s), u;
8127
+ ])), fv.start(a, n.onStats)]), u = new r(e, o, l);
8128
+ return c && i(Ov, u).update(c), s && i(kv, u).update(s), u;
8139
8129
  })();
8140
8130
  }
8141
8131
  connectionInfo() {
8142
- let e = i(Ev, this).value.current();
8132
+ let e = i(Tv, this).value.current();
8143
8133
  return {
8144
- ip: i(Ev, this).ip,
8134
+ ip: i(Tv, this).ip,
8145
8135
  rtt: e.rtt,
8146
8136
  estimatedBandwidth: e.estimatedBandwidth
8147
8137
  };
8148
8138
  }
8149
8139
  stats() {
8150
- return i(Ev, this).value;
8140
+ return i(Tv, this).value;
8151
8141
  }
8152
8142
  catalog() {
8153
- return i(Ov, this).current().catalog();
8143
+ return i(Dv, this).current().catalog();
8154
8144
  }
8155
8145
  namespace() {
8156
- return i(Ov, this).current().namespace;
8146
+ return i(Dv, this).current().namespace;
8157
8147
  }
8158
8148
  videoTrack() {
8159
8149
  var e;
8160
- return (e = i(Av, this).current()) == null ? void 0 : e.trackObject;
8150
+ return (e = i(kv, this).current()) == null ? void 0 : e.trackObject;
8161
8151
  }
8162
8152
  audioTrack() {
8163
8153
  var e;
8164
- return (e = i(kv, this).current()) == null ? void 0 : e.trackObject;
8154
+ return (e = i(Ov, this).current()) == null ? void 0 : e.trackObject;
8165
8155
  }
8166
8156
  referenceClock() {
8167
- return i(Tv, this);
8157
+ return i(wv, this);
8168
8158
  }
8169
8159
  drm() {
8170
8160
  var e = this;
8171
8161
  return t(function* () {
8172
8162
  var t, n;
8173
- if (e.catalog().current().tracks.find(({ name: e }) => e === "drm")) return cv.create(i(Ov, e).current(), (t = e.videoTrack()) == null ? void 0 : t.codec, (n = e.audioTrack()) == null ? void 0 : n.codec);
8163
+ if (e.catalog().current().tracks.find(({ name: e }) => e === "drm")) return sv.create(i(Dv, e).current(), (t = e.videoTrack()) == null ? void 0 : t.codec, (n = e.audioTrack()) == null ? void 0 : n.codec);
8174
8164
  })();
8175
8165
  }
8176
8166
  close() {
8177
- return i(Dv, this).info("Enter 'close'"), Promise.all([
8178
- i(Ov, this).current().close(),
8179
- i(Ov, this).close(),
8180
- o(Pv, this, Lv).call(this, i(kv, this)),
8181
- o(Pv, this, Lv).call(this, i(Av, this)),
8182
- o(Pv, this, Lv).call(this, i(jv, this))
8167
+ return i(Ev, this).info("Enter 'close'"), Promise.all([
8168
+ i(Dv, this).current().close(),
8169
+ i(Dv, this).close(),
8170
+ o(Nv, this, Iv).call(this, i(Ov, this)),
8171
+ o(Nv, this, Iv).call(this, i(kv, this)),
8172
+ o(Nv, this, Iv).call(this, i(Av, this))
8183
8173
  ]);
8184
8174
  }
8185
8175
  zap(e, n) {
8186
8176
  var r = this;
8187
8177
  return t(function* () {
8188
- i(Dv, r).info("Enter 'zap'", {
8178
+ i(Ev, r).info("Enter 'zap'", {
8189
8179
  config: e,
8190
8180
  zapOffsetMs: n
8191
8181
  });
8192
- let t = yield G_.start(i(wv, r), e), a = i(Tv, r).wallclock() - n, o = i(Ov, r).current(), s = o.timestampWallclockOffset(), c = yield t.waitForWallclockTime(a);
8193
- i(Mv, r).update(t), yield i(Ov, r).current().close();
8182
+ let t = yield W_.start(i(Cv, r), e), a = i(wv, r).wallclock() - n, o = i(Dv, r).current(), s = o.timestampWallclockOffset(), c = yield t.waitForWallclockTime(a);
8183
+ i(jv, r).update(t), yield i(Dv, r).current().close();
8194
8184
  let l = [...c].reverse().find((e) => e.wallclock <= a), u = l != null && l.mediaPts ? l.mediaPts - o.timestampOffsetMs() : void 0, d = t.timestampWallclockOffset() - s + o.timestampOffsetMs();
8195
8185
  t.setTimestampOffsetMs(d);
8196
8186
  let f = (l == null ? void 0 : l.groupId) !== void 0 && !Number.isNaN(l.groupId) ? D(l.groupId) : void 0;
8197
8187
  if (u) {
8198
8188
  var p, m;
8199
- (p = i(Av, r).current()) == null || p.stopAfterTimestampReached(u), (m = i(kv, r).current()) == null || m.stopAfterTimestampReached(u);
8189
+ (p = i(kv, r).current()) == null || p.stopAfterTimestampReached(u), (m = i(Ov, r).current()) == null || m.stopAfterTimestampReached(u);
8200
8190
  }
8201
- i(Ov, r).update(t), yield Promise.all([e.videoTrack ? r.setVideoTrack(e.videoTrack, f) : void 0, e.audioTrack ? r.setAudioTrack(e.audioTrack, f) : void 0]), i(Dv, r).info("Return 'zap'");
8191
+ i(Dv, r).update(t), yield Promise.all([e.videoTrack ? r.setVideoTrack(e.videoTrack, f) : void 0, e.audioTrack ? r.setAudioTrack(e.audioTrack, f) : void 0]), i(Ev, r).info("Return 'zap'");
8202
8192
  })();
8203
8193
  }
8204
8194
  setSubtitleTrack(e) {
@@ -8207,49 +8197,49 @@ var Cv = class {
8207
8197
  var t;
8208
8198
  if (!e) {
8209
8199
  var r;
8210
- yield (r = i(jv, n).current()) == null ? void 0 : r.unsubscribe();
8200
+ yield (r = i(Av, n).current()) == null ? void 0 : r.unsubscribe();
8211
8201
  return;
8212
8202
  }
8213
- let [a] = yield Promise.all([i(Ov, n).current().subscribeWebVttTrack(e), (t = i(jv, n).current()) == null ? void 0 : t.unsubscribe()]);
8214
- i(jv, n).update(a);
8203
+ let [a] = yield Promise.all([i(Dv, n).current().subscribeWebVttTrack(e), (t = i(Av, n).current()) == null ? void 0 : t.unsubscribe()]);
8204
+ i(Av, n).update(a);
8215
8205
  })();
8216
8206
  }
8217
8207
  setVideoTrack(e, n) {
8218
8208
  var r = this;
8219
8209
  return t(function* () {
8220
- let t = yield o(Pv, r, Rv).call(r, i(Ov, r).current(), e, i(Av, r).current(), n);
8221
- i(Av, r).update(t);
8210
+ let t = yield o(Nv, r, Lv).call(r, i(Dv, r).current(), e, i(kv, r).current(), n);
8211
+ i(kv, r).update(t);
8222
8212
  })();
8223
8213
  }
8224
8214
  setAudioTrack(e, n) {
8225
8215
  var r = this;
8226
8216
  return t(function* () {
8227
- let t = yield o(Pv, r, Rv).call(r, i(Ov, r).current(), e, i(kv, r).current(), n);
8228
- i(kv, r).update(t);
8217
+ let t = yield o(Nv, r, Lv).call(r, i(Dv, r).current(), e, i(Ov, r).current(), n);
8218
+ i(Ov, r).update(t);
8229
8219
  })();
8230
8220
  }
8231
8221
  };
8232
- function Iv() {
8222
+ function Fv() {
8233
8223
  var e = this;
8234
8224
  return t(function* () {
8235
8225
  let t = !1;
8236
- for (i(wv, e).closed().then(() => {
8226
+ for (i(Cv, e).closed().then(() => {
8237
8227
  t = !0;
8238
8228
  }).catch(b);;) {
8239
- let n = performance.now() - i(wv, e).lastReceived();
8240
- if (n >= yv) return t ? void 0 : /* @__PURE__ */ Error("Idle timeout");
8241
- if (yield on(yv - n), t) return;
8229
+ let n = performance.now() - i(Cv, e).lastReceived();
8230
+ if (n >= vv) return t ? void 0 : /* @__PURE__ */ Error("Idle timeout");
8231
+ if (yield on(vv - n), t) return;
8242
8232
  }
8243
8233
  })();
8244
8234
  }
8245
- function Lv(e) {
8235
+ function Iv(e) {
8246
8236
  let t = e.current(), n = t == null ? void 0 : t.largestGroupId();
8247
8237
  return e.isClosed() || e.update(void 0), e.close(), n === void 0 ? t == null ? void 0 : t.unsubscribe() : t == null ? void 0 : t.update(n, n);
8248
8238
  }
8249
- function Rv(e, n, r, a) {
8239
+ function Lv(e, n, r, a) {
8250
8240
  var o = this;
8251
8241
  return t(function* () {
8252
- i(Dv, o).info("Enter '#replaceTrack'", {
8242
+ i(Ev, o).info("Enter '#replaceTrack'", {
8253
8243
  trackObject: n,
8254
8244
  startGroupId: a
8255
8245
  });
@@ -8257,18 +8247,18 @@ function Rv(e, n, r, a) {
8257
8247
  return s;
8258
8248
  })();
8259
8249
  }
8260
- function zv() {
8250
+ function Rv() {
8261
8251
  var e = this;
8262
8252
  return t(function* () {
8263
8253
  var t = !1, n = !1, r;
8264
8254
  try {
8265
- for (var a = H(i(Ov, e)), s; t = !(s = yield a.next()).done; t = !1) {
8255
+ for (var a = H(i(Dv, e)), s; t = !(s = yield a.next()).done; t = !1) {
8266
8256
  let t = s.value;
8267
8257
  var c = !1, l = !1, u;
8268
8258
  try {
8269
8259
  for (var d = H(t.catalog()), f; c = !(f = yield d.next()).done; c = !1) {
8270
8260
  let t = f.value;
8271
- yield Promise.all([o(Pv, e, Vv).call(e, t, i(Av, e)), o(Pv, e, Vv).call(e, t, i(kv, e))]);
8261
+ yield Promise.all([o(Nv, e, Bv).call(e, t, i(kv, e)), o(Nv, e, Bv).call(e, t, i(Ov, e))]);
8272
8262
  }
8273
8263
  } catch (e) {
8274
8264
  l = !0, u = e;
@@ -8291,17 +8281,17 @@ function zv() {
8291
8281
  }
8292
8282
  })();
8293
8283
  }
8294
- function Bv() {
8284
+ function zv() {
8295
8285
  var e = this;
8296
8286
  return t(function* () {
8297
8287
  try {
8298
- return yield i(Ev, e).closed(), /* @__PURE__ */ Error("Stats closed");
8288
+ return yield i(Tv, e).closed(), /* @__PURE__ */ Error("Stats closed");
8299
8289
  } catch (e) {
8300
8290
  return e;
8301
8291
  }
8302
8292
  })();
8303
8293
  }
8304
- function Vv(e, n) {
8294
+ function Bv(e, n) {
8305
8295
  var r = this;
8306
8296
  return t(function* () {
8307
8297
  let t = n.current();
@@ -8312,17 +8302,17 @@ function Vv(e, n) {
8312
8302
  n.update(void 0);
8313
8303
  return;
8314
8304
  }
8315
- n.update(yield i(Ov, r).current().subscribeCmafTrack(c));
8305
+ n.update(yield i(Dv, r).current().subscribeCmafTrack(c));
8316
8306
  }
8317
8307
  })();
8318
8308
  }
8319
8309
  // ../../libs/web-sdk/src/modules/SubscriptionModule.ts
8320
- var Hv, Uv = (e) => JSON.parse(JSON.stringify(e)), Wv = [
8310
+ var Vv, Hv = (e) => JSON.parse(JSON.stringify(e)), Uv = [
8321
8311
  "burstMs",
8322
8312
  "meta",
8323
8313
  "initiator",
8324
8314
  "channelGroupId"
8325
- ], Gv = (e, t) => xt(Ut(e, Wv), Ut(t, Wv)), Kv = 1e4, qv = class {
8315
+ ], Wv = (e, t) => xt(Ut(e, Uv), Ut(t, Uv)), Gv = 1e4, Kv = class {
8326
8316
  constructor(t, n, r) {
8327
8317
  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, "channelSwitchTimeout", void 0), e(this, "requestedSubscription", void 0), e(this, "burstMs", 0), e(this, "unload", () => {
8328
8318
  this.logger.debug("Unloading module..."), this.timers.unload(), this.emitter.off("subscription changed", this.onSubscriptionChanged), this.logger.debug("Unloaded module");
@@ -8348,20 +8338,20 @@ var Hv, Uv = (e) => JSON.parse(JSON.stringify(e)), Wv = [
8348
8338
  this.targetSubscription.audio.codec = e, this.scheduleSubscriptionChange();
8349
8339
  }), e(this, "setBurst", (e) => {
8350
8340
  e ? this.targetSubscription.burstMs = e : delete this.targetSubscription.burstMs;
8351
- }), e(this, "isNewSubscription", () => !Gv(this.currentSubscription, this.targetSubscription)), e(this, "isRequestOutdated", () => this.requestedSubscription !== void 0 && !Gv(this.requestedSubscription, this.targetSubscription)), e(this, "onSubscriptionChanged", ({ to: e, reset: t }) => {
8341
+ }), e(this, "isNewSubscription", () => !Wv(this.currentSubscription, this.targetSubscription)), e(this, "isRequestOutdated", () => this.requestedSubscription !== void 0 && !Wv(this.requestedSubscription, this.targetSubscription)), e(this, "onSubscriptionChanged", ({ to: e, reset: t }) => {
8352
8342
  var n;
8353
8343
  this.logger.debug("onSubscriptionChanged", {
8354
8344
  to: e,
8355
8345
  reset: t
8356
- }), t ? (this.targetSubscription = Uv(this.currentSubscription), this.requestedSubscription = void 0) : (this.currentSubscription = Uv(e), this.requestedSubscription && (Gv(this.requestedSubscription, e) || Gv(this.targetSubscription, e)) && (this.requestedSubscription = void 0)), (t || ((n = this.channelSwitchTimeout) == null ? void 0 : n.channelId) === this.currentSubscription.channelId) && this.clearChannelSwitchTimeout(), this.requestedSubscription && e.initiator !== "edge" && this.armChannelSwitchDeadline(), this._isSwitchingSubscription = this.isSwitching();
8346
+ }), t ? (this.targetSubscription = Hv(this.currentSubscription), this.requestedSubscription = void 0) : (this.currentSubscription = Hv(e), this.requestedSubscription && (Wv(this.requestedSubscription, e) || Wv(this.targetSubscription, e)) && (this.requestedSubscription = void 0)), (t || ((n = this.channelSwitchTimeout) == null ? void 0 : n.channelId) === this.currentSubscription.channelId) && this.clearChannelSwitchTimeout(), this.requestedSubscription && e.initiator !== "edge" && this.armChannelSwitchDeadline(), this._isSwitchingSubscription = this.isSwitching();
8357
8347
  }), e(this, "armChannelSwitchDeadline", () => {
8358
8348
  let e = this.targetSubscription.channelId;
8359
8349
  if (this.channelSwitchTimeout || this.currentSubscription.channelId === e) return;
8360
8350
  let t = this.timers.setTimeout(() => {
8361
8351
  this.channelSwitchTimeout = void 0, this.logger.warn("Channel switch timeout", e);
8362
8352
  let { video: t, audio: n } = this.targetSubscription;
8363
- this.targetSubscription = Uv(this.currentSubscription), this.targetSubscription.video.bitRate = Math.min(this.targetSubscription.video.bitRate, t.bitRate), this.targetSubscription.video.width = Math.min(this.targetSubscription.video.width, t.width), this.targetSubscription.video.height = Math.min(this.targetSubscription.video.height, t.height), this.targetSubscription.audio.bitRate = Math.min(this.targetSubscription.audio.bitRate, n.bitRate), this.setBurst(0), this.emitter.emit("channel switch timeout", e), this._isSwitchingSubscription = this.isSwitching(), this.isRequestOutdated() && this.sendTargetSubscription();
8364
- }, Kv);
8353
+ this.targetSubscription = Hv(this.currentSubscription), this.targetSubscription.video.bitRate = Math.min(this.targetSubscription.video.bitRate, t.bitRate), this.targetSubscription.video.width = Math.min(this.targetSubscription.video.width, t.width), this.targetSubscription.video.height = Math.min(this.targetSubscription.video.height, t.height), this.targetSubscription.audio.bitRate = Math.min(this.targetSubscription.audio.bitRate, n.bitRate), this.setBurst(0), this.emitter.emit("channel switch timeout", e), this._isSwitchingSubscription = this.isSwitching(), this.isRequestOutdated() && this.sendTargetSubscription();
8354
+ }, Gv);
8365
8355
  this.channelSwitchTimeout = {
8366
8356
  id: t,
8367
8357
  channelId: e
@@ -8369,137 +8359,137 @@ var Hv, Uv = (e) => JSON.parse(JSON.stringify(e)), Wv = [
8369
8359
  }), e(this, "clearChannelSwitchTimeout", () => {
8370
8360
  this.channelSwitchTimeout && (this.timers.clearTimeout(this.channelSwitchTimeout.id), this.channelSwitchTimeout = void 0);
8371
8361
  }), e(this, "isSwitching", () => this.isNewSubscription() || this.isRequestOutdated()), e(this, "scheduleSubscriptionChange", () => {
8372
- this.targetSubscription = Uv(this.targetSubscription);
8362
+ this.targetSubscription = Hv(this.targetSubscription);
8373
8363
  let e = this.isSwitching();
8374
8364
  this._isSwitchingSubscription = e || this._isSwitchingSubscription && this.requestedSubscription !== void 0;
8375
8365
  let t = this.targetSubscription.channelId, n = this.currentSubscription.channelId !== t;
8376
8366
  this.channelSwitchTimeout && this.channelSwitchTimeout.channelId !== t && this.clearChannelSwitchTimeout(), e && (n && this.burstMs ? this.setBurst(this.burstMs) : this.setBurst(0), this.pendingSubscriptionTimeoutId && (this.timers.clearTimeout(this.pendingSubscriptionTimeoutId), this.pendingSubscriptionTimeoutId = void 0), this.armChannelSwitchDeadline(), this.pendingSubscriptionTimeoutId = this.timers.setTimeout(this.sendTargetSubscription, 0));
8377
8367
  }), e(this, "sendTargetSubscription", () => {
8378
8368
  this.pendingSubscriptionTimeoutId && (this.timers.clearTimeout(this.pendingSubscriptionTimeoutId), this.pendingSubscriptionTimeoutId = void 0);
8379
- let e = Uv(this.targetSubscription);
8369
+ let e = Hv(this.targetSubscription);
8380
8370
  this.requestedSubscription = e, this.armChannelSwitchDeadline(), this.emitter.emit("send signal", {
8381
8371
  type: "subscribe",
8382
8372
  subscription: e
8383
8373
  });
8384
- }), this.logger = t, this.targetSubscription = n, this.currentSubscription = Uv(n), this.emitter = r, this.emitter.on("subscription changed", this.onSubscriptionChanged);
8374
+ }), this.logger = t, this.targetSubscription = n, this.currentSubscription = Hv(n), this.emitter = r, this.emitter.on("subscription changed", this.onSubscriptionChanged);
8385
8375
  }
8386
8376
  };
8387
- Hv = qv, e(qv, "create", (e, t, n) => new Hv(e, n, t));
8377
+ Vv = Kv, e(Kv, "create", (e, t, n) => new Vv(e, n, t));
8388
8378
  // ../../libs/web-sdk/src/resolveEdgeUrl.ts
8389
- var Jv = (e, t) => {
8379
+ var qv = (e, t) => {
8390
8380
  var n, r;
8391
8381
  let i = new URL("/subscribe", e);
8392
8382
  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.burstMs !== void 0 && 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();
8393
- }, Yv = (e) => {
8383
+ }, Jv = (e) => {
8394
8384
  try {
8395
8385
  return e ? new URL(e).origin : void 0;
8396
8386
  } catch (e) {
8397
8387
  return;
8398
8388
  }
8399
- }, Xv = 5e3, Zv = 500, Qv = 2e3, $v = Xv, ey = /* @__PURE__ */ new WeakMap(), ty = /* @__PURE__ */ new WeakMap(), ny = /* @__PURE__ */ new WeakMap(), ry = /* @__PURE__ */ new WeakMap(), iy = /* @__PURE__ */ new WeakMap(), ay = /* @__PURE__ */ new WeakMap(), oy = /* @__PURE__ */ new WeakMap(), sy = /* @__PURE__ */ new WeakMap(), cy = /* @__PURE__ */ new WeakSet(), ly = class {
8389
+ }, Yv = 5e3, Xv = 500, Zv = 2e3, Qv = Yv, $v = /* @__PURE__ */ new WeakMap(), ey = /* @__PURE__ */ new WeakMap(), ty = /* @__PURE__ */ new WeakMap(), ny = /* @__PURE__ */ new WeakMap(), ry = /* @__PURE__ */ new WeakMap(), iy = /* @__PURE__ */ new WeakMap(), ay = /* @__PURE__ */ new WeakMap(), oy = /* @__PURE__ */ new WeakMap(), sy = /* @__PURE__ */ new WeakSet(), cy = class {
8400
8390
  constructor(t, r, a, s = () => performance.timeOrigin + performance.now()) {
8401
- k(this, cy), c(this, ey, void 0), c(this, ty, void 0), c(this, ny, void 0), c(this, ry, void 0), c(this, iy, void 0), c(this, ay, void 0), c(this, oy, void 0), c(this, sy, void 0), e(this, "alive", () => {
8402
- o(cy, this, uy).call(this, i(ry, this).call(this));
8391
+ k(this, sy), c(this, $v, void 0), c(this, ey, void 0), c(this, ty, void 0), c(this, ny, void 0), c(this, ry, void 0), c(this, iy, void 0), c(this, ay, void 0), c(this, oy, void 0), e(this, "alive", () => {
8392
+ o(sy, this, ly).call(this, i(ny, this).call(this));
8403
8393
  }), e(this, "check", () => {
8404
- let e = i(ry, this).call(this);
8405
- if (o(cy, this, uy).call(this, e), i(iy, this) === void 0 || !i(ty, this).call(this)) return;
8406
- if (i(oy, this) !== void 0 && i(sy, this) !== void 0) {
8407
- if (!i(ey, this).sentSince(i(sy, this)) && e - i(oy, this) < $v) return;
8408
- n(oy, this, void 0), n(sy, this, void 0);
8394
+ let e = i(ny, this).call(this);
8395
+ if (o(sy, this, ly).call(this, e), i(ry, this) === void 0 || !i(ey, this).call(this)) return;
8396
+ if (i(ay, this) !== void 0 && i(oy, this) !== void 0) {
8397
+ if (!i($v, this).sentSince(i(oy, this)) && e - i(ay, this) < Qv) return;
8398
+ n(ay, this, void 0), n(oy, this, void 0);
8409
8399
  }
8410
- let t = i(ey, this).level();
8411
- t === void 0 || t <= Xv || (this.stop(), i(ny, this).call(this, t));
8412
- }), n(ey, this, t), n(ty, this, r), n(ny, this, a), n(ry, this, s);
8400
+ let t = i($v, this).level();
8401
+ t === void 0 || t <= Yv || (this.stop(), i(ty, this).call(this, t));
8402
+ }), n($v, this, t), n(ey, this, r), n(ty, this, a), n(ny, this, s);
8413
8403
  }
8414
8404
  start() {
8415
- this.stop(), n(ay, this, i(ry, this).call(this)), n(oy, this, void 0), n(sy, this, void 0), n(iy, this, setInterval(this.check, Zv));
8405
+ this.stop(), n(iy, this, i(ny, this).call(this)), n(ay, this, void 0), n(oy, this, void 0), n(ry, this, setInterval(this.check, Xv));
8416
8406
  }
8417
8407
  stop() {
8418
- clearInterval(i(iy, this)), n(iy, this, void 0);
8408
+ clearInterval(i(ry, this)), n(ry, this, void 0);
8419
8409
  }
8420
8410
  };
8421
- function uy(e) {
8422
- i(ay, this) !== void 0 && e - i(ay, this) > Qv && (i(oy, this) != null || n(oy, this, e), n(sy, this, e)), n(ay, this, e);
8411
+ function ly(e) {
8412
+ i(iy, this) !== void 0 && e - i(iy, this) > Zv && (i(ay, this) != null || n(ay, this, e), n(oy, this, e)), n(iy, this, e);
8423
8413
  }
8424
8414
  // ../../libs/web-sdk/src/adapters/EdgeClock.ts
8425
- var dy = /* @__PURE__ */ new WeakMap(), fy = /* @__PURE__ */ new WeakMap(), py = /* @__PURE__ */ new WeakMap(), my = /* @__PURE__ */ new WeakMap(), hy = class {
8415
+ var uy = /* @__PURE__ */ new WeakMap(), dy = /* @__PURE__ */ new WeakMap(), fy = /* @__PURE__ */ new WeakMap(), py = /* @__PURE__ */ new WeakMap(), my = class {
8426
8416
  constructor(e, t = () => performance.timeOrigin + performance.now()) {
8427
- c(this, dy, void 0), c(this, fy, void 0), c(this, py, void 0), c(this, my, 0), n(dy, this, e), n(fy, this, t);
8417
+ c(this, uy, void 0), c(this, dy, void 0), c(this, fy, void 0), c(this, py, 0), n(uy, this, e), n(dy, this, t);
8428
8418
  }
8429
8419
  sample(e, t) {
8430
8420
  var r;
8431
- Number.isFinite(e) && Number.isFinite(t) && (n(my, this, (r = i(dy, this).delayOf(e, t)) == null ? i(my, this) : r), n(py, this, {
8432
- edgeTime: e + i(my, this),
8421
+ Number.isFinite(e) && Number.isFinite(t) && (n(py, this, (r = i(uy, this).delayOf(e, t)) == null ? i(py, this) : r), n(fy, this, {
8422
+ edgeTime: e + i(py, this),
8433
8423
  localTime: t
8434
8424
  }));
8435
8425
  }
8436
8426
  wallclock() {
8437
- if (i(py, this)) return i(py, this).edgeTime + (i(fy, this).call(this) - i(py, this).localTime);
8427
+ if (i(fy, this)) return i(fy, this).edgeTime + (i(dy, this).call(this) - i(fy, this).localTime);
8438
8428
  }
8439
- }, gy = 3e5, _y = 3, vy = 1e4, yy = 1e3, by = 250, xy = 200, Sy = /* @__PURE__ */ new WeakMap(), Cy = /* @__PURE__ */ new WeakMap(), wy = /* @__PURE__ */ new WeakMap(), Ty = /* @__PURE__ */ new WeakMap(), Ey = /* @__PURE__ */ new WeakMap(), Dy = /* @__PURE__ */ new WeakMap(), Oy = /* @__PURE__ */ new WeakMap(), ky = /* @__PURE__ */ new WeakMap(), Ay = /* @__PURE__ */ new WeakSet(), jy = class {
8429
+ }, hy = 3e5, gy = 3, _y = 1e4, vy = 1e3, yy = 250, by = 200, xy = /* @__PURE__ */ new WeakMap(), Sy = /* @__PURE__ */ new WeakMap(), Cy = /* @__PURE__ */ new WeakMap(), wy = /* @__PURE__ */ new WeakMap(), Ty = /* @__PURE__ */ new WeakMap(), Ey = /* @__PURE__ */ new WeakMap(), Dy = /* @__PURE__ */ new WeakMap(), Oy = /* @__PURE__ */ new WeakMap(), ky = /* @__PURE__ */ new WeakSet(), Ay = class {
8440
8430
  constructor(e = () => performance.timeOrigin + performance.now()) {
8441
- k(this, Ay), c(this, Sy, void 0), c(this, Cy, []), c(this, wy, 0), c(this, Ty, void 0), c(this, Ey, void 0), c(this, Dy, void 0), c(this, Oy, 0), c(this, ky, []), n(Sy, this, e);
8431
+ k(this, ky), c(this, xy, void 0), c(this, Sy, []), c(this, Cy, 0), c(this, wy, void 0), c(this, Ty, void 0), c(this, Ey, void 0), c(this, Dy, 0), c(this, Oy, []), n(xy, this, e);
8442
8432
  }
8443
8433
  sample(e, t) {
8444
8434
  var r;
8445
8435
  if (!Number.isFinite(e) || !Number.isFinite(t)) return;
8446
8436
  let a = t - e;
8447
- if (i(Ty, this) !== void 0) {
8437
+ if (i(wy, this) !== void 0) {
8448
8438
  var s, c;
8449
- let t = e - i(Ty, this), r = i(ky, this).length >= 2 && a < o(Ay, this, My).call(this) - yy && t > ((s = Iy(i(ky, this))) == null ? 0 : s) + yy, l = Iy(i(ky, this)), u = l === void 0 ? 0 : l - t;
8450
- t < -1e3 || u > yy && a - ((c = i(Dy, this)) == null ? a : c) > u - by || r ? (n(Cy, this, []), n(wy, this, 0), n(ky, this, [])) : t >= xy && n(ky, this, [...i(ky, this).slice(-4), t]);
8439
+ let t = e - i(wy, this), r = i(Oy, this).length >= 2 && a < o(ky, this, jy).call(this) - vy && t > ((s = Fy(i(Oy, this))) == null ? 0 : s) + vy, l = Fy(i(Oy, this)), u = l === void 0 ? 0 : l - t;
8440
+ t < -1e3 || u > vy && a - ((c = i(Ey, this)) == null ? a : c) > u - yy || r ? (n(Sy, this, []), n(Cy, this, 0), n(Oy, this, [])) : t >= by && n(Oy, this, [...i(Oy, this).slice(-4), t]);
8451
8441
  }
8452
- n(Ty, this, e), n(Ey, this, t), n(Dy, this, a), n(wy, this, (r = i(wy, this), r++, r)), n(Cy, this, i(Cy, this).filter((e) => e.arrivedAt > t - gy)), i(Cy, this).push({
8442
+ n(wy, this, e), n(Ty, this, t), n(Ey, this, a), n(Cy, this, (r = i(Cy, this), r++, r)), n(Sy, this, i(Sy, this).filter((e) => e.arrivedAt > t - hy)), i(Sy, this).push({
8453
8443
  arrivedAt: t,
8454
8444
  delay: a
8455
- }), n(Oy, this, a - o(Ay, this, My).call(this));
8445
+ }), n(Dy, this, a - o(ky, this, jy).call(this));
8456
8446
  }
8457
8447
  sentSince(e) {
8458
- return i(Ty, this) === void 0 || i(Cy, this).length === 0 ? !1 : i(Ty, this) + o(Ay, this, My).call(this) >= e;
8448
+ return i(wy, this) === void 0 || i(Sy, this).length === 0 ? !1 : i(wy, this) + o(ky, this, jy).call(this) >= e;
8459
8449
  }
8460
- level(e = i(Sy, this).call(this)) {
8461
- if (i(wy, this) < _y || i(Ey, this) === void 0) return;
8462
- let t = o(Ay, this, Ny).call(this, e);
8463
- if (!(t <= 0 && e - i(Ey, this) > vy)) return Math.max(i(Oy, this), t);
8450
+ level(e = i(xy, this).call(this)) {
8451
+ if (i(Cy, this) < gy || i(Ty, this) === void 0) return;
8452
+ let t = o(ky, this, My).call(this, e);
8453
+ if (!(t <= 0 && e - i(Ty, this) > _y)) return Math.max(i(Dy, this), t);
8464
8454
  }
8465
8455
  delayOf(e, t) {
8466
- if (this.level(t) !== void 0 && Number.isFinite(e)) return Math.max(0, t - e - o(Ay, this, My).call(this));
8456
+ if (this.level(t) !== void 0 && Number.isFinite(e)) return Math.max(0, t - e - o(ky, this, jy).call(this));
8467
8457
  }
8468
- peak(e, t = i(Sy, this).call(this)) {
8458
+ peak(e, t = i(xy, this).call(this)) {
8469
8459
  var n;
8470
8460
  return (n = this.summary(e, t)) == null ? void 0 : n.max;
8471
8461
  }
8472
- summary(e, t = i(Sy, this).call(this)) {
8462
+ summary(e, t = i(xy, this).call(this)) {
8473
8463
  let n = this.level(t);
8474
8464
  if (n === void 0) return;
8475
- let r = o(Ay, this, My).call(this);
8476
- return gt([...i(Cy, this).filter((n) => n.arrivedAt >= t - e).map((e) => e.delay - r), n]);
8465
+ let r = o(ky, this, jy).call(this);
8466
+ return gt([...i(Sy, this).filter((n) => n.arrivedAt >= t - e).map((e) => e.delay - r), n]);
8477
8467
  }
8478
8468
  };
8479
- function My() {
8480
- return i(Cy, this).reduce((e, t) => Math.min(e, t.delay), Infinity);
8469
+ function jy() {
8470
+ return i(Sy, this).reduce((e, t) => Math.min(e, t.delay), Infinity);
8481
8471
  }
8482
- function Ny(e) {
8483
- let t = Iy(i(ky, this));
8484
- return t === void 0 || i(Ey, this) === void 0 ? 0 : e - (i(Ey, this) - i(Oy, this) + t);
8472
+ function My(e) {
8473
+ let t = Fy(i(Oy, this));
8474
+ return t === void 0 || i(Ty, this) === void 0 ? 0 : e - (i(Ty, this) - i(Dy, this) + t);
8485
8475
  }
8486
- var Py = 3e3, Fy = (e, t) => {
8487
- let n = t.summary(Py);
8476
+ var Ny = 3e3, Py = (e, t) => {
8477
+ let n = t.summary(Ny);
8488
8478
  n !== void 0 && e.debug("Link queue", {
8489
8479
  levelMs: Math.round(n.last),
8490
8480
  peak3sMs: Math.round(n.max)
8491
8481
  });
8492
- }, Iy = (e) => {
8482
+ }, Fy = (e) => {
8493
8483
  if (e.length === 0) return;
8494
8484
  let t = [...e].sort((e, t) => e - t);
8495
8485
  return t[Math.floor(t.length / 2)];
8496
8486
  };
8497
8487
  // ../../libs/web-sdk/src/adapters/MoqConnectionAdapter.ts
8498
- function Ly(e, t, n) {
8488
+ function Iy(e, t, n) {
8499
8489
  let r = new URL("/voq/subscribe", e);
8500
8490
  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;
8501
8491
  }
8502
- function Ry(e, t) {
8492
+ function Ly(e, t) {
8503
8493
  let n = [];
8504
8494
  for (let r of e == null ? [] : e) try {
8505
8495
  n.push({
@@ -8514,84 +8504,84 @@ function Ry(e, t) {
8514
8504
  }
8515
8505
  return n.length > 0 ? n : void 0;
8516
8506
  }
8517
- function zy(e, t, n) {
8507
+ function Ry(e, t, n) {
8518
8508
  return n !== void 0 && e.get("webtransportEnabled") && !e.get("unstableWebtransportEnabled") && !!self.WebTransport && t.protocol.startsWith("https") && Me();
8519
8509
  }
8520
- var By = 1e4, X = /* @__PURE__ */ new WeakMap(), Vy = /* @__PURE__ */ new WeakMap(), Hy = /* @__PURE__ */ new WeakMap(), Uy = /* @__PURE__ */ new WeakMap(), Z = /* @__PURE__ */ new WeakMap(), Wy = /* @__PURE__ */ new WeakMap(), Gy = /* @__PURE__ */ new WeakMap(), Ky = /* @__PURE__ */ new WeakMap(), qy = /* @__PURE__ */ new WeakMap(), Jy = /* @__PURE__ */ new WeakMap(), Yy = /* @__PURE__ */ new WeakMap(), Xy = /* @__PURE__ */ new WeakMap(), Zy = /* @__PURE__ */ new WeakMap(), Q = /* @__PURE__ */ new WeakSet(), Qy = /* @__PURE__ */ new WeakMap(), $y = /* @__PURE__ */ new WeakMap(), eb = /* @__PURE__ */ new WeakMap(), tb = /* @__PURE__ */ new WeakMap(), nb = /* @__PURE__ */ new WeakMap(), rb = /* @__PURE__ */ new WeakMap(), ib = class r {
8510
+ var zy = 1e4, X = /* @__PURE__ */ new WeakMap(), By = /* @__PURE__ */ new WeakMap(), Vy = /* @__PURE__ */ new WeakMap(), Hy = /* @__PURE__ */ new WeakMap(), Z = /* @__PURE__ */ new WeakMap(), Uy = /* @__PURE__ */ new WeakMap(), Wy = /* @__PURE__ */ new WeakMap(), Gy = /* @__PURE__ */ new WeakMap(), Ky = /* @__PURE__ */ new WeakMap(), qy = /* @__PURE__ */ new WeakMap(), Jy = /* @__PURE__ */ new WeakMap(), Yy = /* @__PURE__ */ new WeakMap(), Xy = /* @__PURE__ */ new WeakMap(), Q = /* @__PURE__ */ new WeakSet(), Zy = /* @__PURE__ */ new WeakMap(), Qy = /* @__PURE__ */ new WeakMap(), $y = /* @__PURE__ */ new WeakMap(), eb = /* @__PURE__ */ new WeakMap(), tb = /* @__PURE__ */ new WeakMap(), nb = /* @__PURE__ */ new WeakMap(), rb = class r {
8521
8511
  get estimatedBandwidth() {
8522
- return i(qy, this);
8512
+ return i(Ky, this);
8523
8513
  }
8524
8514
  unload() {
8525
- i(X, this).off("send signal", i($y, this)), i(X, this).off("disconnect", this.disconnect), i(X, this).off("text track", i(Qy, this)), this.disconnect();
8515
+ i(X, this).off("send signal", i(Qy, this)), i(X, this).off("disconnect", this.disconnect), i(X, this).off("text track", i(Zy, this)), this.disconnect();
8526
8516
  }
8527
8517
  suspend() {}
8528
8518
  unsuspend() {}
8529
8519
  getStatistics() {
8530
- let e = i(Hy, this).transportType() === "webtransport" ? "moq" : "moq_ws";
8520
+ let e = i(Vy, this).transportType() === "webtransport" ? "moq" : "moq_ws";
8531
8521
  return {
8532
- edgeUrl: Yv(i(Hy, this).url()),
8522
+ edgeUrl: Jv(i(Vy, this).url()),
8533
8523
  connectionProtocol: e,
8534
- transportSelectionReason: i(Jy, this)
8524
+ transportSelectionReason: i(qy, this)
8535
8525
  };
8536
8526
  }
8537
8527
  constructor(t, r, a, s, l, u, d, f, p, m) {
8538
- k(this, Q), c(this, X, void 0), c(this, Vy, void 0), c(this, Hy, void 0), c(this, Uy, "disconnected"), c(this, Z, void 0), c(this, Wy, /* @__PURE__ */ new Map()), c(this, Gy, void 0), c(this, Ky, void 0), c(this, qy, void 0), c(this, Jy, void 0), c(this, Yy, /* @__PURE__ */ new Map()), e(this, "linkQueue", void 0), c(this, Xy, void 0), c(this, Zy, void 0), e(this, "closedForBacklog", !1), c(this, Qy, (e) => {
8528
+ k(this, Q), c(this, X, void 0), c(this, By, void 0), c(this, Vy, void 0), c(this, Hy, "disconnected"), c(this, Z, void 0), c(this, Uy, /* @__PURE__ */ new Map()), c(this, Wy, void 0), c(this, Gy, void 0), c(this, Ky, void 0), c(this, qy, void 0), c(this, Jy, /* @__PURE__ */ new Map()), e(this, "linkQueue", void 0), c(this, Yy, void 0), c(this, Xy, void 0), e(this, "closedForBacklog", !1), c(this, Zy, (e) => {
8539
8529
  if (!e) {
8540
8530
  i(Z, this).setSubtitleTrack(void 0).catch(b);
8541
8531
  return;
8542
8532
  }
8543
- let t = i(Wy, this).get(Hh(i(Z, this).namespace())), n = t == null ? void 0 : t.getTextTrack(e);
8533
+ let t = i(Uy, this).get(Vh(i(Z, this).namespace())), n = t == null ? void 0 : t.getTextTrack(e);
8544
8534
  n && i(Z, this).setSubtitleTrack(n).catch(b);
8545
- }), c(this, $y, (e) => {
8535
+ }), c(this, Qy, (e) => {
8546
8536
  switch (e.type) {
8547
8537
  case "subscribe":
8548
8538
  {
8549
- if (i(eb, this)) return;
8550
- let t = i(nb, this);
8539
+ if (i($y, this)) return;
8540
+ let t = i(tb, this);
8551
8541
  if (t) {
8552
- if (Gv(t, e.subscription)) {
8553
- n(tb, this, void 0);
8542
+ if (Wv(t, e.subscription)) {
8543
+ n(eb, this, void 0);
8554
8544
  return;
8555
8545
  }
8556
- i(Vy, this).info("Queueing - we are already switching"), n(tb, this, e.subscription);
8546
+ i(By, this).info("Queueing - we are already switching"), n(eb, this, e.subscription);
8557
8547
  return;
8558
8548
  }
8559
- o(Q, this, sb).call(this, e.subscription);
8549
+ o(Q, this, ob).call(this, e.subscription);
8560
8550
  }
8561
8551
  break;
8562
8552
  case "telemetry":
8563
- g(new URL("/api/telemetry", i(Hy, this).url().replace("wss://", "https://")), {
8553
+ g(new URL("/api/telemetry", i(Vy, this).url().replace("wss://", "https://")), {
8564
8554
  body: e.body,
8565
8555
  headers: { "Content-Type": "text/plain" }
8566
8556
  }).catch(b);
8567
8557
  break;
8568
- case "refresh auth": i(Hy, this).updateAuthToken(e.token);
8558
+ case "refresh auth": i(Vy, this).updateAuthToken(e.token);
8569
8559
  }
8570
- }), c(this, eb, !1), c(this, tb, void 0), c(this, nb, void 0), e(this, "disconnect", (e = "Disconnect Requested") => {
8560
+ }), c(this, $y, !1), c(this, eb, void 0), c(this, tb, void 0), e(this, "disconnect", (e = "Disconnect Requested") => {
8571
8561
  var t;
8572
- i(Vy, this).info("Disconnecting", e), (t = i(Zy, this)) == null || t.stop(), o(Q, this, ob).call(this), i(Hy, this).close(), i(Z, this).close().catch(b), n(Yy, this, /* @__PURE__ */ new Map()), o(Q, this, ub).call(this, "disconnected");
8573
- }), c(this, rb, (e) => {
8574
- o(Q, this, ob).call(this), this.closedForBacklog = !0, i(Vy, this).info("Link queue over the breaker, reconnecting", { levelMs: Math.round(e) }), i(Hy, this).close(), i(X, this).emit("ping timeout");
8575
- }), n(X, this, t), n(Vy, this, r), n(Hy, this, a), n(Z, this, s), n(Wy, this, l), n(Gy, this, u), n(Ky, this, d), n(Jy, this, f), this.linkQueue = p, n(Xy, this, m), i(X, this).on("send signal", i($y, this)), i(X, this).on("disconnect", this.disconnect), i(X, this).on("text track", i(Qy, this)), o(Q, this, ab).call(this).catch(b), o(Q, this, db).call(this).catch(b), p && (n(Zy, this, new ly(p, () => i(Uy, this) === "connected", i(rb, this))), i(Zy, this).start());
8562
+ i(By, this).info("Disconnecting", e), (t = i(Xy, this)) == null || t.stop(), o(Q, this, ab).call(this), i(Vy, this).close(), i(Z, this).close().catch(b), n(Jy, this, /* @__PURE__ */ new Map()), o(Q, this, lb).call(this, "disconnected");
8563
+ }), c(this, nb, (e) => {
8564
+ o(Q, this, ab).call(this), this.closedForBacklog = !0, i(By, this).info("Link queue over the breaker, reconnecting", { levelMs: Math.round(e) }), i(Vy, this).close(), i(X, this).emit("ping timeout");
8565
+ }), n(X, this, t), n(By, this, r), n(Vy, this, a), n(Z, this, s), n(Uy, this, l), n(Wy, this, u), n(Gy, this, d), n(qy, this, f), this.linkQueue = p, n(Yy, this, m), i(X, this).on("send signal", i(Qy, this)), i(X, this).on("disconnect", this.disconnect), i(X, this).on("text track", i(Zy, this)), o(Q, this, ib).call(this).catch(b), o(Q, this, ub).call(this).catch(b), p && (n(Xy, this, new cy(p, () => i(Hy, this) === "connected", i(nb, this))), i(Xy, this).start());
8576
8566
  }
8577
8567
  static start(e, n, a, o, s) {
8578
8568
  return t(function* () {
8579
8569
  var t, c, l, u, d;
8580
- let f = new Map(o.connectInfo.channels.map((e) => [Hh(e.catalog.namespace), new vb(new Vt(e.catalog))])), p = yield o.onConnectInfo(o.connectInfo), m = o.options.get("authenticationToken"), h, g, ee;
8570
+ let f = new Map(o.connectInfo.channels.map((e) => [Vh(e.catalog.namespace), new _b(new Vt(e.catalog))])), p = yield o.onConnectInfo(o.connectInfo), m = o.options.get("authenticationToken"), h, g, ee;
8581
8571
  switch (typeof o.edgeUrl) {
8582
8572
  case "string":
8583
- h = Ly(o.edgeUrl, p, m);
8573
+ h = Iy(o.edgeUrl, p, m);
8584
8574
  break;
8585
- default: h = Ly(o.edgeUrl.moqUrl || o.edgeUrl.moqWsUrl, p, m), g = Ly(o.edgeUrl.moqWsUrl, p, m), ee = Ry(o.edgeUrl.serverCertificateHashes, n);
8575
+ default: h = Iy(o.edgeUrl.moqUrl || o.edgeUrl.moqWsUrl, p, m), g = Iy(o.edgeUrl.moqWsUrl, p, m), ee = Ly(o.edgeUrl.serverCertificateHashes, n);
8586
8576
  }
8587
8577
  let _ = (t = o.connectInfo.channels.find((e) => e.channelId === p.channelId)) == null ? void 0 : t.catalog;
8588
8578
  n.debug("Resolved edge url", {
8589
8579
  edgeUrl: h,
8590
8580
  edgeWsUrl: g
8591
8581
  }), v(_, "no catalog found");
8592
- let y = (c = f.get(Hh(_.namespace))) == null ? void 0 : c.getVideoTrack(p.video), b = (l = f.get(Hh(_.namespace))) == null ? void 0 : l.getAudioTrack(p.audio), x = zy(o.options, h, g), S;
8582
+ let y = (c = f.get(Vh(_.namespace))) == null ? void 0 : c.getVideoTrack(p.video), b = (l = f.get(Vh(_.namespace))) == null ? void 0 : l.getAudioTrack(p.audio), x = Ry(o.options, h, g), S;
8593
8583
  try {
8594
- S = yield Ph({
8584
+ S = yield Nh({
8595
8585
  url: h,
8596
8586
  wsUrl: g,
8597
8587
  serverCertificateHashes: ee,
@@ -8608,10 +8598,10 @@ var By = 1e4, X = /* @__PURE__ */ new WeakMap(), Vy = /* @__PURE__ */ new WeakMa
8608
8598
  (u = o.onTransportConnected) == null || u.call(o);
8609
8599
  let ne = C.closed().then((e) => {
8610
8600
  throw e instanceof Error ? e : Error(e ? `Session closed before player started: ${String(e)}` : "Session closed before player started");
8611
- }), w = C.transportType() === "websocket" ? new jy() : void 0, T = w == null ? new jy() : w, re = new hy(T), ie, E;
8601
+ }), w = C.transportType() === "websocket" ? new Ay() : void 0, T = w == null ? new Ay() : w, re = new my(T), ie, E;
8612
8602
  try {
8613
8603
  E = yield Promise.race([
8614
- Fv.start(C.subscriber, {
8604
+ Pv.start(C.subscriber, {
8615
8605
  namespace: _.namespace,
8616
8606
  catalog: _,
8617
8607
  videoTrack: y == null ? void 0 : y.track,
@@ -8619,17 +8609,17 @@ var By = 1e4, X = /* @__PURE__ */ new WeakMap(), Vy = /* @__PURE__ */ new WeakMa
8619
8609
  burstMs: p.burstMs || 0,
8620
8610
  onStats: (e, t) => {
8621
8611
  let r = performance.timeOrigin + t;
8622
- T.sample(e.ntpTimestamp, r), re.sample(e.ntpTimestamp, r), w && (Fy(n, w), ie == null || ie());
8612
+ T.sample(e.ntpTimestamp, r), re.sample(e.ntpTimestamp, r), w && (Py(n, w), ie == null || ie());
8623
8613
  }
8624
8614
  }),
8625
- sn(By, /* @__PURE__ */ Error("Timeout waiting for player to start")),
8615
+ sn(zy, /* @__PURE__ */ Error("Timeout waiting for player to start")),
8626
8616
  ne
8627
8617
  ]);
8628
8618
  } catch (e) {
8629
8619
  throw C.close(), e;
8630
8620
  }
8631
- let ae = new vb(E.catalog());
8632
- f.set(Hh(_.namespace), ae), e.emit("received signal", {
8621
+ let ae = new _b(E.catalog());
8622
+ f.set(Vh(_.namespace), ae), e.emit("received signal", {
8633
8623
  type: "client ip",
8634
8624
  ip: E.connectionInfo().ip
8635
8625
  }), E.drm().then((t) => {
@@ -8638,29 +8628,29 @@ var By = 1e4, X = /* @__PURE__ */ new WeakMap(), Vy = /* @__PURE__ */ new WeakMa
8638
8628
  n.error("Error getting DRM data", e);
8639
8629
  });
8640
8630
  let oe = new r(e, n, C, E, f, a, s, te, w, re);
8641
- return ie = (d = i(Zy, oe)) == null ? void 0 : d.check, p.textTrack && i(Qy, oe).call(oe, p.textTrack), oe;
8631
+ return ie = (d = i(Xy, oe)) == null ? void 0 : d.check, p.textTrack && i(Zy, oe).call(oe, p.textTrack), oe;
8642
8632
  })();
8643
8633
  }
8644
8634
  getState() {
8645
- return i(Uy, this);
8635
+ return i(Hy, this);
8646
8636
  }
8647
8637
  close() {
8648
8638
  var e;
8649
- (e = i(Zy, this)) == null || e.stop(), o(Q, this, ob).call(this), i(Hy, this).close();
8639
+ (e = i(Xy, this)) == null || e.stop(), o(Q, this, ab).call(this), i(Vy, this).close();
8650
8640
  }
8651
8641
  closed() {
8652
- return Promise.race([i(Hy, this).closed(), i(Z, this).closed()]);
8642
+ return Promise.race([i(Vy, this).closed(), i(Z, this).closed()]);
8653
8643
  }
8654
8644
  };
8655
- function ab() {
8645
+ function ib() {
8656
8646
  var e = this;
8657
8647
  return t(function* () {
8658
- i(Hy, e).transportType() === "websocket" && (yield on(5e3));
8648
+ i(Vy, e).transportType() === "websocket" && (yield on(5e3));
8659
8649
  var t = !1, r = !1, a;
8660
8650
  try {
8661
8651
  for (var o = H(i(Z, e).stats()), s; t = !(s = yield o.next()).done; t = !1) {
8662
8652
  let { rtt: t, estimatedBandwidth: r } = s.value;
8663
- n(qy, e, r), i(Ky, e).push(t), i(X, e).emit("rtt", pt(i(Ky, e).items()));
8653
+ n(Ky, e, r), i(Gy, e).push(t), i(X, e).emit("rtt", pt(i(Gy, e).items()));
8664
8654
  }
8665
8655
  } catch (e) {
8666
8656
  r = !0, a = e;
@@ -8673,45 +8663,45 @@ function ab() {
8673
8663
  }
8674
8664
  })();
8675
8665
  }
8676
- function ob() {
8677
- n(eb, this, !0), n(tb, this, void 0);
8678
- }
8679
- function sb(e) {
8680
- n(nb, this, e), o(Q, this, lb).call(this, e).catch((t) => {
8681
- if (i(eb, this)) return;
8682
- i(Vy, this).error("error handling subscription", t);
8683
- let r = i(tb, this);
8684
- n(tb, this, void 0), i(X, this).emit("received signal", {
8666
+ function ab() {
8667
+ n($y, this, !0), n(eb, this, void 0);
8668
+ }
8669
+ function ob(e) {
8670
+ n(tb, this, e), o(Q, this, cb).call(this, e).catch((t) => {
8671
+ if (i($y, this)) return;
8672
+ i(By, this).error("error handling subscription", t);
8673
+ let r = i(eb, this);
8674
+ n(eb, this, void 0), i(X, this).emit("received signal", {
8685
8675
  type: "subscription changed",
8686
8676
  subscription: r == null ? e : r,
8687
8677
  reset: !0
8688
8678
  });
8689
8679
  }).finally(() => {
8690
- n(nb, this, void 0);
8691
- let e = i(tb, this);
8692
- n(tb, this, void 0), e && !i(eb, this) && o(Q, this, sb).call(this, e);
8680
+ n(tb, this, void 0);
8681
+ let e = i(eb, this);
8682
+ n(eb, this, void 0), e && !i($y, this) && o(Q, this, ob).call(this, e);
8693
8683
  });
8694
8684
  }
8695
- function cb(e) {
8685
+ function sb(e) {
8696
8686
  var n = this;
8697
8687
  return t(function* () {
8698
8688
  var t;
8699
- let r = yield i(Gy, n).connect({ channelId: e });
8689
+ let r = yield i(Wy, n).connect({ channelId: e });
8700
8690
  if (!u(r)) throw Error("no moq connect info found");
8701
8691
  let a = (t = r.channels.find((t) => t.channelId === e)) == null ? void 0 : t.catalog;
8702
8692
  if (!a) throw Error("no catalog found");
8703
8693
  return a;
8704
8694
  })();
8705
8695
  }
8706
- function lb(e) {
8696
+ function cb(e) {
8707
8697
  var n = this;
8708
8698
  return t(function* () {
8709
8699
  var t, r;
8710
- i(Vy, n).info("handle subscription", e);
8711
- let a = i(Z, n), s = i(Wy, n).get(e.channelId);
8712
- if (s || (s = new vb(new Vt(yield o(Q, n, cb).call(n, e.channelId))), i(Wy, n).set(e.channelId, s)), a.namespace().join("/") !== s.namespace().join("/")) {
8700
+ i(By, n).info("handle subscription", e);
8701
+ let a = i(Z, n), s = i(Uy, n).get(e.channelId);
8702
+ if (s || (s = new _b(new Vt(yield o(Q, n, sb).call(n, e.channelId))), i(Uy, n).set(e.channelId, s)), a.namespace().join("/") !== s.namespace().join("/")) {
8713
8703
  var c;
8714
- i(Vy, n).info("changing channel", e.channelId);
8704
+ i(By, n).info("changing channel", e.channelId);
8715
8705
  let t = s.getVideoTrack(e.video), r = s.getAudioTrack(e.audio);
8716
8706
  if (yield a.zap({
8717
8707
  namespace: s.namespace(),
@@ -8721,8 +8711,8 @@ function lb(e) {
8721
8711
  }, 500), a.drm().then((e) => {
8722
8712
  e && i(X, n).emit("received drm data", e.value);
8723
8713
  }).catch((e) => {
8724
- i(Vy, n).error("Error getting DRM data", e);
8725
- }), i(Vy, n).info("switched channel", e.channelId), (c = i(Wy, n).get(Hh(a.namespace()))) == null || c.updateCatalog(a.catalog()), i(eb, n)) return;
8714
+ i(By, n).error("Error getting DRM data", e);
8715
+ }), i(By, n).info("switched channel", e.channelId), (c = i(Uy, n).get(Vh(a.namespace()))) == null || c.updateCatalog(a.catalog()), i($y, n)) return;
8726
8716
  i(X, n).emit("received signal", {
8727
8717
  type: "subscription changed",
8728
8718
  subscription: e
@@ -8730,32 +8720,32 @@ function lb(e) {
8730
8720
  return;
8731
8721
  }
8732
8722
  let l = s.getVideoTrack(e.video), u = s.getAudioTrack(e.audio);
8733
- yield Promise.all([l && l.track.name !== ((t = i(Z, n).videoTrack()) == null ? void 0 : t.name) ? i(Z, n).setVideoTrack(l.track) : void 0, u && u.track.name !== ((r = i(Z, n).audioTrack()) == null ? void 0 : r.name) ? i(Z, n).setAudioTrack(u.track) : void 0]), i(eb, n) || i(X, n).emit("received signal", {
8723
+ yield Promise.all([l && l.track.name !== ((t = i(Z, n).videoTrack()) == null ? void 0 : t.name) ? i(Z, n).setVideoTrack(l.track) : void 0, u && u.track.name !== ((r = i(Z, n).audioTrack()) == null ? void 0 : r.name) ? i(Z, n).setAudioTrack(u.track) : void 0]), i($y, n) || i(X, n).emit("received signal", {
8734
8724
  type: "subscription changed",
8735
8725
  subscription: e
8736
8726
  });
8737
8727
  })();
8738
8728
  }
8739
- function ub(e) {
8740
- n(Uy, this, e), i(X, this).emit("connection state", e);
8729
+ function lb(e) {
8730
+ n(Hy, this, e), i(X, this).emit("connection state", e);
8741
8731
  }
8742
- function db() {
8732
+ function ub() {
8743
8733
  var e = this;
8744
8734
  return t(function* () {
8745
8735
  try {
8746
- o(Q, e, ub).call(e, "connecting"), i(Vy, e).info("Connecting..."), o(Q, e, ub).call(e, "connected"), yield Promise.all([
8747
- o(Q, e, pb).call(e, i(Z, e).referenceClock(), i(Z, e).audio),
8748
- o(Q, e, pb).call(e, i(Z, e).referenceClock(), i(Z, e).video),
8749
- o(Q, e, fb).call(e, i(Z, e).subtitles)
8750
- ]), yield i(Z, e).closed(), i(Hy, e).close(), i(Vy, e).info("Session closed");
8736
+ o(Q, e, lb).call(e, "connecting"), i(By, e).info("Connecting..."), o(Q, e, lb).call(e, "connected"), yield Promise.all([
8737
+ o(Q, e, fb).call(e, i(Z, e).referenceClock(), i(Z, e).audio),
8738
+ o(Q, e, fb).call(e, i(Z, e).referenceClock(), i(Z, e).video),
8739
+ o(Q, e, db).call(e, i(Z, e).subtitles)
8740
+ ]), yield i(Z, e).closed(), i(Vy, e).close(), i(By, e).info("Session closed");
8751
8741
  } catch (t) {
8752
- i(Vy, e).warn("Session error", t), i(Hy, e).close();
8742
+ i(By, e).warn("Session error", t), i(Vy, e).close();
8753
8743
  } finally {
8754
- o(Q, e, ub).call(e, "disconnected");
8744
+ o(Q, e, lb).call(e, "disconnected");
8755
8745
  }
8756
8746
  })();
8757
8747
  }
8758
- function fb(e) {
8748
+ function db(e) {
8759
8749
  var n = this;
8760
8750
  return t(function* () {
8761
8751
  var t = !1, r = !1, a;
@@ -8775,7 +8765,7 @@ function fb(e) {
8775
8765
  }
8776
8766
  })();
8777
8767
  }
8778
- function pb(e, n) {
8768
+ function fb(e, n) {
8779
8769
  var r = this;
8780
8770
  return t(function* () {
8781
8771
  let t = "", a = "", o, s = i(Z, r).videoTrack() === void 0;
@@ -8785,7 +8775,7 @@ function pb(e, n) {
8785
8775
  let n = f.value;
8786
8776
  {
8787
8777
  var p;
8788
- let c = Hh(n.track.namespace), l = n.track.trackObject.language, u = h((p = n.track.trackObject.codec) == null ? "" : p), d = n.track.trackObject.codec, f = u ? un({
8778
+ let c = Vh(n.track.namespace), l = n.track.trackObject.language, u = h((p = n.track.trackObject.codec) == null ? "" : p), d = n.track.trackObject.codec, f = u ? un({
8789
8779
  codec: u,
8790
8780
  codecString: d
8791
8781
  }) : void 0, x = !!n.track.trackObject["com.vindral.drm"];
@@ -8795,19 +8785,19 @@ function pb(e, n) {
8795
8785
  let [p, m] = v.value;
8796
8786
  {
8797
8787
  var y;
8798
- (y = i(Zy, r)) == null || y.alive();
8788
+ (y = i(Xy, r)) == null || y.alive();
8799
8789
  let h = {
8800
8790
  channelId: t !== "" && (s || m.mediaType() === "video") && t !== c ? c : void 0,
8801
8791
  language: m.mediaType() === "audio" && a !== l ? l : void 0,
8802
8792
  drmTransition: o !== void 0 && o !== x
8803
8793
  };
8804
8794
  t = c, a = l, o = x;
8805
- let g = m.producerReferenceTime(), ee = i(Yy, r).get(n.track.namespace), _ = performance.now();
8795
+ let g = m.producerReferenceTime(), ee = i(Jy, r).get(n.track.namespace), _ = performance.now();
8806
8796
  if (g && (ee === void 0 || _ - ee > 1e3)) {
8807
8797
  var b;
8808
- i(Yy, r).set(n.track.namespace, _);
8809
- let t = ((b = i(Xy, r).wallclock()) == null ? e.wallclock() : b) - g.getTime();
8810
- i(Vy, r).debug("timing-info", {
8798
+ i(Jy, r).set(n.track.namespace, _);
8799
+ let t = ((b = i(Yy, r).wallclock()) == null ? e.wallclock() : b) - g.getTime();
8800
+ i(By, r).debug("timing-info", {
8811
8801
  mediaType: m.mediaType(),
8812
8802
  referenceClock: e,
8813
8803
  delta: t,
@@ -8831,7 +8821,7 @@ function pb(e, n) {
8831
8821
  codec: u,
8832
8822
  codecString: d,
8833
8823
  switchInfo: h,
8834
- renditionId: mb(n.track.trackObject.name)
8824
+ renditionId: pb(n.track.trackObject.name)
8835
8825
  });
8836
8826
  }
8837
8827
  }
@@ -8857,45 +8847,45 @@ function pb(e, n) {
8857
8847
  }
8858
8848
  })();
8859
8849
  }
8860
- function mb(e) {
8850
+ function pb(e) {
8861
8851
  return e.split("").reduce((e, t) => e = t.charCodeAt(0) + (e << 6) + (e << 16) - e, 0);
8862
8852
  }
8863
- var hb = /* @__PURE__ */ new WeakMap(), gb = /* @__PURE__ */ new WeakMap(), _b = /* @__PURE__ */ new WeakSet(), vb = class {
8853
+ var mb = /* @__PURE__ */ new WeakMap(), hb = /* @__PURE__ */ new WeakMap(), gb = /* @__PURE__ */ new WeakSet(), _b = class {
8864
8854
  constructor(e) {
8865
- k(this, _b), c(this, hb, void 0), c(this, gb, void 0), n(hb, this, e), n(gb, this, o(_b, this, yb).call(this));
8855
+ k(this, gb), c(this, mb, void 0), c(this, hb, void 0), n(mb, this, e), n(hb, this, o(gb, this, vb).call(this));
8866
8856
  }
8867
8857
  catalog() {
8868
- return i(hb, this).current();
8858
+ return i(mb, this).current();
8869
8859
  }
8870
8860
  namespace() {
8871
- return i(hb, this).current().namespace;
8861
+ return i(mb, this).current().namespace;
8872
8862
  }
8873
8863
  updateCatalog(e) {
8874
- n(hb, this, e);
8864
+ n(mb, this, e);
8875
8865
  }
8876
8866
  getTextTrack(e) {
8877
- return i(hb, this).current().tracks.find((t) => t.label === e);
8867
+ return i(mb, this).current().tracks.find((t) => t.label === e);
8878
8868
  }
8879
8869
  getAudioTrack(e) {
8880
8870
  if (!e.codec) return;
8881
- let t = i(gb, this).filter((t) => !(!ln(t) || t.bitRate > e.bitRate || e.codec && t.codec !== e.codec || e.language && t.language !== e.language));
8871
+ let t = i(hb, this).filter((t) => !(!ln(t) || t.bitRate > e.bitRate || e.codec && t.codec !== e.codec || e.language && t.language !== e.language));
8882
8872
  return t[t.length - 1];
8883
8873
  }
8884
8874
  getVideoTrack(e) {
8885
8875
  if (!e.codec) return;
8886
- let t = i(gb, this).filter((t) => !(!cn(t) || t.bitRate > e.bitRate || e.codec && t.codec !== e.codec));
8876
+ let t = i(hb, this).filter((t) => !(!cn(t) || t.bitRate > e.bitRate || e.codec && t.codec !== e.codec));
8887
8877
  return t[t.length - 1];
8888
8878
  }
8889
8879
  renditions() {
8890
- return i(gb, this);
8880
+ return i(hb, this);
8891
8881
  }
8892
8882
  };
8893
- function yb() {
8894
- let [e, t] = i(hb, this).value();
8883
+ function vb() {
8884
+ let [e, t] = i(mb, this).value();
8895
8885
  return f(e);
8896
8886
  }
8897
8887
  // ../../libs/web-sdk/src/transports/WebSocket.ts
8898
- var bb = 1e3, xb = class extends s {
8888
+ var yb = 1e3, bb = class extends s {
8899
8889
  constructor(n, r) {
8900
8890
  var i;
8901
8891
  super(), i = this, e(this, "options", void 0), e(this, "websocket", void 0), 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, "connectTimeout", void 0), e(this, "openedAt", void 0), e(this, "erroredAt", void 0), e(this, "closeAfterErrorTimeout", void 0), e(this, "shouldContinueConnecting", !1), e(this, "_isConnectInProgress", !1), e(this, "readyState", () => {
@@ -8925,7 +8915,7 @@ var bb = 1e3, xb = class extends s {
8925
8915
  this.logger.warn("On error", p({}, this.options)), this.openedAt === void 0 ? (this.close("websocket had an error"), this.emit("error", new M("WebSocket error", {
8926
8916
  code: "websocket_error",
8927
8917
  isFatal: !1
8928
- }))) : (this.erroredAt != null || (this.erroredAt = performance.now()), this.closeAfterErrorTimeout != null || (this.closeAfterErrorTimeout = setTimeout(() => this.handleClose(), bb)));
8918
+ }))) : (this.erroredAt != null || (this.erroredAt = performance.now()), this.closeAfterErrorTimeout != null || (this.closeAfterErrorTimeout = setTimeout(() => this.handleClose(), yb)));
8929
8919
  }), e(this, "onClose", (e) => {
8930
8920
  this.handleClose(e);
8931
8921
  }), e(this, "handleClose", (e) => {
@@ -9007,10 +8997,10 @@ var bb = 1e3, xb = class extends s {
9007
8997
  get connectTime() {
9008
8998
  return this._connectTime;
9009
8999
  }
9010
- }, Sb, Cb = 524288, wb = .9, Tb = 40, Eb = (e) => Cb * wb * 1e3 / (e || Tb), Db = class n {
9000
+ }, xb, Sb = 524288, Cb = .9, wb = 40, Tb = (e) => Sb * Cb * 1e3 / (e || wb), Eb = class n {
9011
9001
  constructor(r, i, a, o) {
9012
9002
  var s = this;
9013
- 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", performance.now()), e(this, "isPingInFlight", !1), e(this, "lastSignalSentTime", performance.now()), e(this, "connectCount", 0), e(this, "missedPings", 0), e(this, "closedForBacklog", !1), e(this, "isContextSwitchInProgress", !1), e(this, "signalBuffer", []), e(this, "dataBuffer", []), e(this, "disconnected", new x()), e(this, "linkQueue", new jy()), e(this, "clockCorrection", 0), e(this, "backlogBreaker", new ly(this.linkQueue, () => this.getState() === "connected", (e) => {
9003
+ 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", performance.now()), e(this, "isPingInFlight", !1), e(this, "lastSignalSentTime", performance.now()), e(this, "connectCount", 0), e(this, "missedPings", 0), e(this, "closedForBacklog", !1), e(this, "isContextSwitchInProgress", !1), e(this, "signalBuffer", []), e(this, "dataBuffer", []), e(this, "disconnected", new x()), e(this, "linkQueue", new Ay()), e(this, "clockCorrection", 0), e(this, "backlogBreaker", new cy(this.linkQueue, () => this.getState() === "connected", (e) => {
9014
9004
  this.logger.info("Link queue over the breaker, reconnecting", { levelMs: Math.round(e) }), this.closeForBacklog("link queue over the breaker");
9015
9005
  })), e(this, "unload", () => {
9016
9006
  this.logger.debug("Unloading module..."), this.close("Unloading"), this.emitter.off("send signal", this.sendSignal), this.emitter.off("disconnect", this.close), this.emitter.off("reconnect", this.reconnect), this.logger.debug("Unloaded module");
@@ -9027,7 +9017,7 @@ var bb = 1e3, xb = class extends s {
9027
9017
  }), e(this, "sendSignal", (e) => {
9028
9018
  this.logger.debug("sending signal", { signal: e }), this.transport.readyState() === WebSocket.OPEN ? (this.transport.send(JSON.stringify(e)), this.lastSignalSentTime = performance.now()) : this.logger.debug("transport is closed");
9029
9019
  }), e(this, "getStatistics", () => ({
9030
- edgeUrl: Yv(this.config.edgeUrl),
9020
+ edgeUrl: Jv(this.config.edgeUrl),
9031
9021
  connectionProtocol: "vindral_ws",
9032
9022
  transportSelectionReason: void 0
9033
9023
  })), e(this, "onMessage", (e) => {
@@ -9054,7 +9044,7 @@ var bb = 1e3, xb = class extends s {
9054
9044
  this.signalBuffer.push(e);
9055
9045
  } else this.handleMessage(e);
9056
9046
  }), e(this, "resolveEdgeUrl", t(function* () {
9057
- let e = s.config.connectInfo, t = yield s.config.onConnectInfo(e), n = Jv(s.config.edgeUrl, {
9047
+ let e = s.config.connectInfo, t = yield s.config.onConnectInfo(e), n = qv(s.config.edgeUrl, {
9058
9048
  video: t.video,
9059
9049
  audio: t.audio,
9060
9050
  burstMs: t.burstMs,
@@ -9092,7 +9082,7 @@ var bb = 1e3, xb = class extends s {
9092
9082
  }
9093
9083
  }
9094
9084
  }), e(this, "connectWebSocketTransport", () => {
9095
- let e = new xb({
9085
+ let e = new bb({
9096
9086
  reconnectDelay: 1e3,
9097
9087
  onMessage: this.onMessage,
9098
9088
  reconnectHandler: this.config.reconnectHandler,
@@ -9118,7 +9108,7 @@ var bb = 1e3, xb = class extends s {
9118
9108
  }), e(this, "closeUnlessConnecting", (e) => this.transport.isConnectInProgress ? (this.logger.debug("Stopping reconnect, already mid-connection"), !1) : (this.close(e), !0)), e(this, "sampleLinkQueue", (e) => {
9119
9109
  if (this.isContextSwitchInProgress || !e.includes("\"timing info\"")) return !1;
9120
9110
  let t = JSON.parse(e);
9121
- return !pn(t) || t.type !== "timing info" ? !1 : (this.linkQueue.sample(t.timingInfo.wallclockTime, performance.timeOrigin + performance.now()), Fy(this.logger, this.linkQueue), !0);
9111
+ return !pn(t) || t.type !== "timing info" ? !1 : (this.linkQueue.sample(t.timingInfo.wallclockTime, performance.timeOrigin + performance.now()), Py(this.logger, this.linkQueue), !0);
9122
9112
  }), e(this, "correctTimingInfo", (e) => {
9123
9113
  var t;
9124
9114
  if (!e.includes("\"timing info\"")) return e;
@@ -9149,68 +9139,68 @@ var bb = 1e3, xb = class extends s {
9149
9139
  return this.disconnected.promise;
9150
9140
  }
9151
9141
  };
9152
- Sb = Db, e(Db, "PING_INTERVAL", 5e3), e(Db, "PING_TIMEOUT", 15e3), e(Db, "MAX_MISSED_PINGS", 4), e(Db, "TLS_ROUNDTRIPS", 3), e(Db, "start", (e, t, n, r) => new Promise((i, a) => {
9153
- let o = new Sb(e, t, n, r);
9142
+ xb = Eb, e(Eb, "PING_INTERVAL", 5e3), e(Eb, "PING_TIMEOUT", 15e3), e(Eb, "MAX_MISSED_PINGS", 4), e(Eb, "TLS_ROUNDTRIPS", 3), e(Eb, "start", (e, t, n, r) => new Promise((i, a) => {
9143
+ let o = new xb(e, t, n, r);
9154
9144
  o.transport.once("error", (e) => a(e)), o.transport.once("open", () => {
9155
9145
  var e;
9156
9146
  (e = n.onTransportConnected) == null || e.call(n), i(o);
9157
9147
  });
9158
9148
  }));
9159
9149
  // ../../libs/web-sdk/src/EdgeSelector.ts
9160
- var Ob = (e) => {
9150
+ var Db = (e) => {
9161
9151
  var t;
9162
9152
  return typeof e == "string" ? e : `${e.moqWsUrl}|${(t = e.moqUrl) == null ? "" : t}`;
9163
- }, kb = (e) => typeof e == "string" ? e : e.moqUrl || e.moqWsUrl, Ab = /* @__PURE__ */ new WeakMap(), jb = /* @__PURE__ */ new WeakMap(), Mb = /* @__PURE__ */ new WeakMap(), Nb = /* @__PURE__ */ new WeakMap(), Pb = class {
9153
+ }, Ob = (e) => typeof e == "string" ? e : e.moqUrl || e.moqWsUrl, kb = /* @__PURE__ */ new WeakMap(), Ab = /* @__PURE__ */ new WeakMap(), jb = /* @__PURE__ */ new WeakMap(), Mb = /* @__PURE__ */ new WeakMap(), Nb = class {
9164
9154
  constructor(e) {
9165
- c(this, Ab, void 0), c(this, jb, []), c(this, Mb, /* @__PURE__ */ new Set()), c(this, Nb, void 0), n(Ab, this, e);
9155
+ c(this, kb, void 0), c(this, Ab, []), c(this, jb, /* @__PURE__ */ new Set()), c(this, Mb, void 0), n(kb, this, e);
9166
9156
  }
9167
9157
  select(e) {
9168
- if (i(Ab, this).edgeUrl) return i(Ab, this).edgeUrl;
9158
+ if (i(kb, this).edgeUrl) return i(kb, this).edgeUrl;
9169
9159
  if (e.length > 0) {
9170
- n(jb, this, [...e]);
9171
- let t = new Set(i(jb, this).map((e) => Ob(e)));
9172
- for (let e of i(Mb, this)) t.has(e) || i(Mb, this).delete(e);
9160
+ n(Ab, this, [...e]);
9161
+ let t = new Set(i(Ab, this).map((e) => Db(e)));
9162
+ for (let e of i(jb, this)) t.has(e) || i(jb, this).delete(e);
9173
9163
  }
9174
- if (i(jb, this).length === 0) return;
9175
- let t = i(jb, this).filter((e) => !i(Mb, this).has(Ob(e)));
9176
- t.length === 0 && (i(Mb, this).clear(), t = i(jb, this));
9164
+ if (i(Ab, this).length === 0) return;
9165
+ let t = i(Ab, this).filter((e) => !i(jb, this).has(Db(e)));
9166
+ t.length === 0 && (i(jb, this).clear(), t = i(Ab, this));
9177
9167
  let r = t[0];
9178
- if (r) return i(Mb, this).add(Ob(r)), n(Nb, this, r), r;
9168
+ if (r) return i(jb, this).add(Db(r)), n(Mb, this, r), r;
9179
9169
  }
9180
9170
  shiftedEdge() {
9181
- return i(Nb, this);
9171
+ return i(Mb, this);
9182
9172
  }
9183
9173
  hasRemainingEdges() {
9184
- return i(jb, this).some((e) => !i(Mb, this).has(Ob(e)));
9174
+ return i(Ab, this).some((e) => !i(jb, this).has(Db(e)));
9185
9175
  }
9186
9176
  reset() {
9187
- n(Nb, this, void 0), n(jb, this, []), i(Mb, this).clear();
9177
+ n(Mb, this, void 0), n(Ab, this, []), i(jb, this).clear();
9188
9178
  }
9189
- }, Fb, Ib = (e) => {
9179
+ }, Pb, Fb = (e) => {
9190
9180
  if (e instanceof M && (e.code() === "channel_not_live" || e.code() === "channel_not_found")) return !0;
9191
9181
  let t = e instanceof M ? e.source() : e;
9192
9182
  if (!(t instanceof Error) || !m(t)) return !1;
9193
9183
  let { status: n } = t;
9194
9184
  return n >= 400 && n < 500 && n !== 408 && n !== 429;
9195
- }, Lb = 3e4, Rb = /* @__PURE__ */ new WeakMap(), $ = /* @__PURE__ */ new WeakMap(), zb = /* @__PURE__ */ new WeakMap(), Bb = /* @__PURE__ */ new WeakMap(), Vb = /* @__PURE__ */ new WeakMap(), Hb = /* @__PURE__ */ new WeakMap(), Ub = /* @__PURE__ */ new WeakMap(), Wb = /* @__PURE__ */ new WeakMap(), Gb = /* @__PURE__ */ new WeakMap(), Kb = /* @__PURE__ */ new WeakMap(), qb = /* @__PURE__ */ new WeakMap(), Jb = /* @__PURE__ */ new WeakMap(), Yb = /* @__PURE__ */ new WeakMap(), Xb = /* @__PURE__ */ new WeakMap(), Zb = /* @__PURE__ */ new WeakMap(), Qb = /* @__PURE__ */ new WeakMap(), $b = /* @__PURE__ */ new WeakMap(), ex = /* @__PURE__ */ new WeakMap(), tx = /* @__PURE__ */ new WeakMap(), nx = /* @__PURE__ */ new WeakMap(), rx = /* @__PURE__ */ new WeakMap(), ix = /* @__PURE__ */ new WeakMap(), ax = /* @__PURE__ */ new WeakMap(), ox = /* @__PURE__ */ new WeakSet(), sx = /* @__PURE__ */ new WeakMap(), cx = /* @__PURE__ */ new WeakMap(), lx = /* @__PURE__ */ new WeakMap(), ux = /* @__PURE__ */ new WeakMap(), dx = /* @__PURE__ */ new WeakMap(), fx = /* @__PURE__ */ new WeakMap(), px = /* @__PURE__ */ new WeakMap(), mx = /* @__PURE__ */ new WeakMap(), hx = /* @__PURE__ */ new WeakMap(), gx = class r {
9185
+ }, Ib = 3e4, Lb = /* @__PURE__ */ new WeakMap(), $ = /* @__PURE__ */ new WeakMap(), Rb = /* @__PURE__ */ new WeakMap(), zb = /* @__PURE__ */ new WeakMap(), Bb = /* @__PURE__ */ new WeakMap(), Vb = /* @__PURE__ */ new WeakMap(), Hb = /* @__PURE__ */ new WeakMap(), Ub = /* @__PURE__ */ new WeakMap(), Wb = /* @__PURE__ */ new WeakMap(), Gb = /* @__PURE__ */ new WeakMap(), Kb = /* @__PURE__ */ new WeakMap(), qb = /* @__PURE__ */ new WeakMap(), Jb = /* @__PURE__ */ new WeakMap(), Yb = /* @__PURE__ */ new WeakMap(), Xb = /* @__PURE__ */ new WeakMap(), Zb = /* @__PURE__ */ new WeakMap(), Qb = /* @__PURE__ */ new WeakMap(), $b = /* @__PURE__ */ new WeakMap(), ex = /* @__PURE__ */ new WeakMap(), tx = /* @__PURE__ */ new WeakMap(), nx = /* @__PURE__ */ new WeakMap(), rx = /* @__PURE__ */ new WeakMap(), ix = /* @__PURE__ */ new WeakMap(), ax = /* @__PURE__ */ new WeakSet(), ox = /* @__PURE__ */ new WeakMap(), sx = /* @__PURE__ */ new WeakMap(), cx = /* @__PURE__ */ new WeakMap(), lx = /* @__PURE__ */ new WeakMap(), ux = /* @__PURE__ */ new WeakMap(), dx = /* @__PURE__ */ new WeakMap(), fx = /* @__PURE__ */ new WeakMap(), px = /* @__PURE__ */ new WeakMap(), mx = /* @__PURE__ */ new WeakMap(), hx = class r {
9196
9186
  constructor(a, s, l) {
9197
9187
  var u = this;
9198
- k(this, ox), 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), c(this, Rb, new S(10)), c(this, $, !0), c(this, zb, void 0), c(this, Bb, 0), c(this, Vb, 0), c(this, Hb, void 0), c(this, Ub, !1), c(this, Wb, 0), c(this, Gb, 0), c(this, Kb, 0), c(this, qb, void 0), c(this, Jb, void 0), c(this, Yb, void 0), c(this, Xb, void 0), c(this, Zb, void 0), c(this, Qb, void 0), c(this, $b, void 0), c(this, ex, []), c(this, tx, void 0), e(this, "unload", () => {
9188
+ k(this, ax), 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), c(this, Lb, new S(10)), c(this, $, !0), c(this, Rb, void 0), c(this, zb, 0), c(this, Bb, 0), c(this, Vb, void 0), c(this, Hb, !1), c(this, Ub, 0), c(this, Wb, 0), c(this, Gb, 0), c(this, Kb, void 0), c(this, qb, void 0), c(this, Jb, void 0), c(this, Yb, void 0), c(this, Xb, void 0), c(this, Zb, void 0), c(this, Qb, void 0), c(this, $b, []), c(this, ex, void 0), e(this, "unload", () => {
9199
9189
  var e;
9200
- this.logger.debug("Unloading module..."), this.emitter.off("page active", i(dx, this)), this.emitter.off("network online", i(fx, this)), this.disconnect("Unloading"), (e = this.connectionImpl) == null || e.unload(), n($b, this, void 0), this.logger.debug("Unloaded module");
9190
+ this.logger.debug("Unloading module..."), this.emitter.off("page active", i(ux, this)), this.emitter.off("network online", i(dx, this)), this.disconnect("Unloading"), (e = this.connectionImpl) == null || e.unload(), n(Qb, this, void 0), this.logger.debug("Unloaded module");
9201
9191
  }), e(this, "finishPendingDrop", () => {
9202
- this.connectionImpl instanceof Db && this.connectionImpl.finishPendingDrop();
9192
+ this.connectionImpl instanceof Eb && this.connectionImpl.finishPendingDrop();
9203
9193
  }), e(this, "suspend", () => {
9204
9194
  var e;
9205
- n($, this, !1), i(ux, this).call(this), (e = this.connectionImpl) == null || e.suspend();
9195
+ n($, this, !1), i(lx, this).call(this), (e = this.connectionImpl) == null || e.suspend();
9206
9196
  }), e(this, "unsuspend", () => {
9207
9197
  var e;
9208
9198
  n($, this, !0), (e = this.connectionImpl) == null || e.unsuspend(), this.connect();
9209
9199
  }), e(this, "getState", () => this.connectionImpl ? this.connectionImpl.getState() : "disconnected"), e(this, "getStatistics", () => {
9210
9200
  var e;
9211
- let t = i(Wb, this) > 0 ? i(Gb, this) / i(Wb, this) : 0;
9201
+ let t = i(Ub, this) > 0 ? i(Wb, this) / i(Ub, this) : 0;
9212
9202
  if (!this.connectionImpl) {
9213
- let e = i(nx, this).call(this);
9203
+ let e = i(tx, this).call(this);
9214
9204
  return {
9215
9205
  rtt: {
9216
9206
  min: 0,
@@ -9219,17 +9209,17 @@ var Ob = (e) => {
9219
9209
  last: 0
9220
9210
  },
9221
9211
  estimatedBandwidth: 0,
9222
- connectCount: i(Gb, this),
9223
- backlogReconnectCount: i(Kb, this),
9224
- connectionAttemptCount: i(Wb, this),
9212
+ connectCount: i(Wb, this),
9213
+ backlogReconnectCount: i(Gb, this),
9214
+ connectionAttemptCount: i(Ub, this),
9225
9215
  connectionSuccessRatio: t,
9226
- timeToConnected: i(Xb, this),
9216
+ timeToConnected: i(Yb, this),
9227
9217
  edgeUrl: e == null ? void 0 : e.edgeUrl,
9228
9218
  connectionProtocol: e == null ? void 0 : e.connectionProtocol,
9229
9219
  transportSelectionReason: e == null ? void 0 : e.transportSelectionReason
9230
9220
  };
9231
9221
  }
9232
- let n = this.connectionImpl.getStatistics(), r = (e = this.linkQueue) == null ? void 0 : e.summary(Lb);
9222
+ let n = this.connectionImpl.getStatistics(), r = (e = this.linkQueue) == null ? void 0 : e.summary(Ib);
9233
9223
  return p(p({}, n), {}, {
9234
9224
  linkQueue: r && {
9235
9225
  last: Math.round(r.last),
@@ -9237,29 +9227,29 @@ var Ob = (e) => {
9237
9227
  max: Math.round(r.max),
9238
9228
  min: Math.round(r.min)
9239
9229
  },
9240
- rtt: gt(i(Rb, this).items()),
9230
+ rtt: gt(i(Lb, this).items()),
9241
9231
  estimatedBandwidth: this.estimatedBandwidth,
9242
- connectCount: i(Gb, this),
9243
- backlogReconnectCount: i(Kb, this),
9244
- connectionAttemptCount: i(Wb, this),
9232
+ connectCount: i(Wb, this),
9233
+ backlogReconnectCount: i(Gb, this),
9234
+ connectionAttemptCount: i(Ub, this),
9245
9235
  connectionSuccessRatio: t,
9246
- timeToConnected: i(Xb, this)
9236
+ timeToConnected: i(Yb, this)
9247
9237
  });
9248
- }), c(this, nx, () => i($, this) && i(Qb, this) ? i(Qb, this) : i(Zb, this)), e(this, "connect", () => {
9249
- if (n($, this, !0), i(zb, this)) {
9250
- i(ux, this).call(this);
9238
+ }), c(this, tx, () => i($, this) && i(Zb, this) ? i(Zb, this) : i(Xb, this)), e(this, "connect", () => {
9239
+ if (n($, this, !0), i(Rb, this)) {
9240
+ i(lx, this).call(this);
9251
9241
  return;
9252
9242
  }
9253
9243
  let e = performance.now();
9254
- i(Xb, this) === void 0 && n(qb, this, e), i(Jb, this) === void 0 && n(Jb, this, e), n(zb, this, o(ox, this, _x).call(this));
9255
- }), c(this, rx, () => {
9256
- i(Xb, this) === void 0 && i(qb, this) !== void 0 && i($, this) && (n(Xb, this, performance.now() - i(qb, this)), n(qb, this, void 0));
9244
+ i(Yb, this) === void 0 && n(Kb, this, e), i(qb, this) === void 0 && n(qb, this, e), n(Rb, this, o(ax, this, gx).call(this));
9245
+ }), c(this, nx, () => {
9246
+ i(Yb, this) === void 0 && i(Kb, this) !== void 0 && i($, this) && (n(Yb, this, performance.now() - i(Kb, this)), n(Kb, this, void 0));
9257
9247
  }), e(this, "disconnect", (e = "Disconnect Requested") => {
9258
9248
  var t;
9259
- n($, this, !1), i(ux, this).call(this), i(cx, this).call(this), (t = this.connectionImpl) == null || t.close(e);
9249
+ n($, this, !1), i(lx, this).call(this), i(sx, this).call(this), (t = this.connectionImpl) == null || t.close(e);
9260
9250
  }), e(this, "reconnect", (e) => {
9261
9251
  this.disconnect(e), this.connect();
9262
- }), c(this, ix, t(function* () {
9252
+ }), c(this, rx, t(function* () {
9263
9253
  try {
9264
9254
  return yield u.apiClient.connect(u.config.options.getOptions());
9265
9255
  } catch (e) {
@@ -9269,7 +9259,7 @@ var Ob = (e) => {
9269
9259
  }
9270
9260
  throw Xn(e instanceof Error ? e : void 0);
9271
9261
  }
9272
- })), c(this, ax, () => new Promise((e) => {
9262
+ })), c(this, ix, () => new Promise((e) => {
9273
9263
  let t = performance.now(), n = () => e(performance.now() - t), i = () => e(void 0);
9274
9264
  try {
9275
9265
  let e = new XMLHttpRequest();
@@ -9277,161 +9267,161 @@ var Ob = (e) => {
9277
9267
  } catch (e) {
9278
9268
  i();
9279
9269
  }
9280
- })), c(this, sx, () => {
9281
- i(cx, this).call(this), n(tx, this, setTimeout(() => {
9270
+ })), c(this, ox, () => {
9271
+ i(sx, this).call(this), n(ex, this, setTimeout(() => {
9282
9272
  var e;
9283
- i($b, this) && ((e = this.connectionImpl) == null ? void 0 : e.getState()) === "connected" && (this.logger.debug("Connection remained stable for long enough, clearing cached fallback edges"), i($b, this).reset(), n(tx, this, void 0));
9273
+ i(Qb, this) && ((e = this.connectionImpl) == null ? void 0 : e.getState()) === "connected" && (this.logger.debug("Connection remained stable for long enough, clearing cached fallback edges"), i(Qb, this).reset(), n(ex, this, void 0));
9284
9274
  }, r.EDGE_SELECTOR_RESET_TIMEOUT));
9285
- }), c(this, cx, () => {
9286
- i(tx, this) !== void 0 && (clearTimeout(i(tx, this)), n(tx, this, void 0));
9287
- }), c(this, lx, function() {
9275
+ }), c(this, sx, () => {
9276
+ i(ex, this) !== void 0 && (clearTimeout(i(ex, this)), n(ex, this, void 0));
9277
+ }), c(this, cx, function() {
9288
9278
  var e = t(function* (e) {
9289
- n(Ub, u, !1);
9279
+ n(Hb, u, !1);
9290
9280
  try {
9291
- let o = yield u.config.reconnectHandler({ reconnectRetries: i(Bb, u) });
9281
+ let o = yield u.config.reconnectHandler({ reconnectRetries: i(zb, u) });
9292
9282
  if (!i($, u)) return !1;
9293
9283
  if (!o) return n($, u, !1), u.emitter.emit("error", Zn()), !1;
9294
9284
  let { isVisible: s, isOnline: c } = u.config.documentState;
9295
9285
  if (!s || !c) {
9296
- if (i(Ub, u)) return i($, u);
9286
+ if (i(Hb, u)) return i($, u);
9297
9287
  let e = r.OFFLINE_RETRY_MS;
9298
9288
  if (!c) u.logger.info("Browser offline, waiting for the network before retrying", { delay: e });
9299
9289
  else {
9300
9290
  var t, a;
9301
- let o = r.HIDDEN_BACKOFF_BASE_MS * 2 ** (n(Vb, u, (t = i(Vb, u), a = t++, t)), a);
9291
+ let o = r.HIDDEN_BACKOFF_BASE_MS * 2 ** (n(Bb, u, (t = i(Bb, u), a = t++, t)), a);
9302
9292
  e = Math.min(r.HIDDEN_BACKOFF_MAX_MS, o), u.logger.info("Page hidden, backing off before retrying", { delay: e });
9303
9293
  }
9304
9294
  return yield new Promise((t) => {
9305
9295
  let r = setTimeout(t, e);
9306
- n(Hb, u, () => {
9296
+ n(Vb, u, () => {
9307
9297
  clearTimeout(r), t();
9308
9298
  });
9309
9299
  }), i($, u);
9310
9300
  }
9311
- return n(Vb, u, 0), i(mx, u).call(u) ? (u.logger.info("Reconnect burst detected, applying backoff before retrying"), yield on(r.RECONNECT_BACKOFF_MS)) : u.logger.info(e === "cached_edge" ? "Retrying with next cached edge without backoff" : "Retrying without backoff"), i($, u);
9301
+ return n(Bb, u, 0), i(px, u).call(u) ? (u.logger.info("Reconnect burst detected, applying backoff before retrying"), yield on(r.RECONNECT_BACKOFF_MS)) : u.logger.info(e === "cached_edge" ? "Retrying with next cached edge without backoff" : "Retrying without backoff"), i($, u);
9312
9302
  } finally {
9313
- n(Hb, u, void 0);
9303
+ n(Vb, u, void 0);
9314
9304
  }
9315
9305
  });
9316
9306
  return function(t) {
9317
9307
  return e.apply(this, arguments);
9318
9308
  };
9319
- }()), c(this, ux, () => {
9309
+ }()), c(this, lx, () => {
9320
9310
  var e;
9321
- n(Ub, this, !0), (e = i(Hb, this)) == null || e.call(this);
9322
- }), c(this, dx, (e) => {
9323
- e && i(ux, this).call(this);
9324
- }), c(this, fx, () => {
9325
- i(ux, this).call(this);
9326
- }), c(this, px, (e = performance.now()) => {
9327
- i(hx, this).call(this, e), i(ex, this).push(e);
9328
- }), c(this, mx, (e = performance.now()) => (i(hx, this).call(this, e), i(ex, this).length >= r.RECONNECT_BACKOFF_BURST_THRESHOLD)), c(this, hx, (e) => {
9329
- for (; i(ex, this).length > 0;) {
9330
- let t = i(ex, this)[0];
9311
+ n(Hb, this, !0), (e = i(Vb, this)) == null || e.call(this);
9312
+ }), c(this, ux, (e) => {
9313
+ e && i(lx, this).call(this);
9314
+ }), c(this, dx, () => {
9315
+ i(lx, this).call(this);
9316
+ }), c(this, fx, (e = performance.now()) => {
9317
+ i(mx, this).call(this, e), i($b, this).push(e);
9318
+ }), c(this, px, (e = performance.now()) => (i(mx, this).call(this, e), i($b, this).length >= r.RECONNECT_BACKOFF_BURST_THRESHOLD)), c(this, mx, (e) => {
9319
+ for (; i($b, this).length > 0;) {
9320
+ let t = i($b, this)[0];
9331
9321
  if (t === void 0 || t > e - r.RECONNECT_BACKOFF_BURST_WINDOW_MS) return;
9332
- i(ex, this).shift();
9322
+ i($b, this).shift();
9333
9323
  }
9334
9324
  }), this.logger = s, this.emitter = a, this.config = l, this.apiClient = new _({
9335
9325
  publicEndpoint: this.config.options.get("url").toString(),
9336
9326
  tokenFactory: () => this.config.options.get("authenticationToken")
9337
- }), this.emitter.on("page active", i(dx, this)), this.emitter.on("network online", i(fx, this));
9327
+ }), this.emitter.on("page active", i(ux, this)), this.emitter.on("network online", i(dx, this));
9338
9328
  }
9339
9329
  get rtt() {
9340
- return i(Rb, this).items().length > 0 ? pt(i(Rb, this).items()) : 0;
9330
+ return i(Lb, this).items().length > 0 ? pt(i(Lb, this).items()) : 0;
9341
9331
  }
9342
9332
  get isMoq() {
9343
- return this.connectionImpl instanceof ib;
9333
+ return this.connectionImpl instanceof rb;
9344
9334
  }
9345
9335
  get estimatedBandwidth() {
9346
9336
  if (this.connectionImpl && "estimatedBandwidth" in this.connectionImpl) {
9347
9337
  let e = this.connectionImpl.estimatedBandwidth;
9348
9338
  if (e && Number.isFinite(e)) return e;
9349
9339
  }
9350
- return Eb(this.rtt);
9340
+ return Tb(this.rtt);
9351
9341
  }
9352
9342
  get linkQueue() {
9353
9343
  var e;
9354
9344
  return (e = this.connectionImpl) == null ? void 0 : e.linkQueue;
9355
9345
  }
9356
9346
  get firstConnectStartTime() {
9357
- return i(Jb, this);
9347
+ return i(qb, this);
9358
9348
  }
9359
9349
  get lastConnectionTime() {
9360
- return i(Yb, this);
9350
+ return i(Jb, this);
9361
9351
  }
9362
9352
  };
9363
- Fb = gx;
9364
- function _x() {
9353
+ Pb = hx;
9354
+ function gx() {
9365
9355
  var e = this;
9366
9356
  return t(function* () {
9367
- let t = new Pb({ edgeUrl: e.config.options.get("edgeUrl") });
9368
- for (n($b, e, t), i(cx, e).call(e), n(Bb, e, 0), n(Vb, e, 0), n(ex, e, []);;) {
9357
+ let t = new Nb({ edgeUrl: e.config.options.get("edgeUrl") });
9358
+ for (n(Qb, e, t), i(sx, e).call(e), n(zb, e, 0), n(Bb, e, 0), n($b, e, []);;) {
9369
9359
  var r, a;
9370
9360
  let l = "standard";
9371
- n(Wb, e, (r = i(Wb, e), r++, r)), i(px, e).call(e);
9361
+ n(Ub, e, (r = i(Ub, e), r++, r)), i(fx, e).call(e);
9372
9362
  let d = !1;
9373
- n(Qb, e, {});
9363
+ n(Zb, e, {});
9374
9364
  try {
9375
9365
  var o, s;
9376
- let [r, a] = yield Promise.all([i(ix, e).call(e), i(ax, e).call(e)]);
9377
- if (i(Rb, e).clear(), a !== void 0 && i(Rb, e).push(a / 2), !i($, e)) break;
9366
+ let [r, a] = yield Promise.all([i(rx, e).call(e), i(ix, e).call(e)]);
9367
+ if (i(Lb, e).clear(), a !== void 0 && i(Lb, e).push(a / 2), !i($, e)) break;
9378
9368
  let c = t.select(r.edges);
9379
9369
  if (!c) throw new M("Failed to resolve edge url", {
9380
9370
  isFatal: !0,
9381
9371
  code: "failed_to_resolve_edge_url"
9382
9372
  });
9383
- n(Qb, e, { edgeUrl: Yv(kb(c)) });
9373
+ n(Zb, e, { edgeUrl: Jv(Ob(c)) });
9384
9374
  try {
9385
- u(r) ? e.connectionImpl = yield ib.start(e.emitter, e.logger, e.apiClient, p(p({}, e.config), {}, {
9375
+ u(r) ? e.connectionImpl = yield rb.start(e.emitter, e.logger, e.apiClient, p(p({}, e.config), {}, {
9386
9376
  connectInfo: r,
9387
9377
  edgeUrl: c,
9388
- onTransportConnected: i(rx, e)
9389
- }), i(Rb, e)) : (v(typeof c == "string", "Edge URL is expected to be a string"), e.connectionImpl = yield Db.start(e.emitter, e.logger, p(p({}, e.config), {}, {
9378
+ onTransportConnected: i(nx, e)
9379
+ }), i(Lb, e)) : (v(typeof c == "string", "Edge URL is expected to be a string"), e.connectionImpl = yield Eb.start(e.emitter, e.logger, p(p({}, e.config), {}, {
9390
9380
  connectInfo: r,
9391
9381
  edgeUrl: c,
9392
- onTransportConnected: i(rx, e)
9393
- }), i(Rb, e)));
9382
+ onTransportConnected: i(nx, e)
9383
+ }), i(Lb, e)));
9394
9384
  } catch (e) {
9395
9385
  throw l = "cached_edge", e;
9396
9386
  }
9397
- n(Zb, e, e.connectionImpl.getStatistics()), n(Qb, e, void 0), i($, e) || e.connectionImpl.close("Disconnected during connect"), i(sx, e).call(e), n(Gb, e, (o = i(Gb, e), o++, o)), n(Bb, e, 0), n(Vb, e, 0), n(Yb, e, performance.now()), i(rx, e).call(e);
9387
+ n(Xb, e, e.connectionImpl.getStatistics()), n(Zb, e, void 0), i($, e) || e.connectionImpl.close("Disconnected during connect"), i(ox, e).call(e), n(Wb, e, (o = i(Wb, e), o++, o)), n(zb, e, 0), n(Bb, e, 0), n(Jb, e, performance.now()), i(nx, e).call(e);
9398
9388
  let d = yield e.connectionImpl.closed();
9399
- e.connectionImpl.closedForBacklog && n(Kb, e, (s = i(Kb, e), s++, s)), e.logger.info("Connection closed", { reason: d instanceof Error ? d.message : d }), l = "cached_edge";
9389
+ e.connectionImpl.closedForBacklog && n(Gb, e, (s = i(Gb, e), s++, s)), e.logger.info("Connection closed", { reason: d instanceof Error ? d.message : d }), l = "cached_edge";
9400
9390
  } catch (r) {
9401
9391
  e.logger.warn("Failed to connect", r);
9402
9392
  let { isVisible: a, isOnline: o } = e.config.documentState;
9403
- if (!e.connectionImpl && (a && o || Ib(r))) {
9393
+ if (!e.connectionImpl && (a && o || Fb(r))) {
9404
9394
  var c;
9405
- n(Bb, e, (c = i(Bb, e), c++, c));
9395
+ n(zb, e, (c = i(zb, e), c++, c));
9406
9396
  }
9407
9397
  let s = t.shiftedEdge();
9408
9398
  s && e.emitter.emit("telemetry event", {
9409
9399
  code: "shifted_edge",
9410
- edgeUrl: kb(s)
9400
+ edgeUrl: Ob(s)
9411
9401
  }), r instanceof M ? (e.emitter.emit("error", r), d = r.isFatal()) : r instanceof Error && e.emitter.emit("error", new M(r.message, {
9412
9402
  code: "start_failed",
9413
9403
  isFatal: !1
9414
9404
  }));
9415
9405
  }
9416
- if ((a = e.connectionImpl) == null || a.unload(), e.connectionImpl = void 0, i(cx, e).call(e), d) {
9406
+ if ((a = e.connectionImpl) == null || a.unload(), e.connectionImpl = void 0, i(sx, e).call(e), d) {
9417
9407
  n($, e, !1);
9418
9408
  break;
9419
9409
  }
9420
- if (!i($, e) || !(yield i(lx, e).call(e, l === "cached_edge" && t.hasRemainingEdges() ? "cached_edge" : "standard"))) break;
9410
+ if (!i($, e) || !(yield i(cx, e).call(e, l === "cached_edge" && t.hasRemainingEdges() ? "cached_edge" : "standard"))) break;
9421
9411
  }
9422
- n(Qb, e, void 0), n($b, e, void 0), i(cx, e).call(e), n(zb, e, void 0), i($, e) && e.connect();
9412
+ n(Zb, e, void 0), n(Qb, e, void 0), i(sx, e).call(e), n(Rb, e, void 0), i($, e) && e.connect();
9423
9413
  })();
9424
9414
  }
9425
- e(gx, "PING_TIMEOUT", 1e3), e(gx, "RECONNECT_BACKOFF_MS", 1e3), e(gx, "RECONNECT_BACKOFF_BURST_WINDOW_MS", 5e3), e(gx, "RECONNECT_BACKOFF_BURST_THRESHOLD", 3), e(gx, "EDGE_SELECTOR_RESET_TIMEOUT", 6e4), e(gx, "HIDDEN_BACKOFF_BASE_MS", 1e3), e(gx, "HIDDEN_BACKOFF_MAX_MS", 3e4), e(gx, "OFFLINE_RETRY_MS", 3e4), e(gx, "create", (e, t, n) => new Fb(e, t, n));
9415
+ e(hx, "PING_TIMEOUT", 1e3), e(hx, "RECONNECT_BACKOFF_MS", 1e3), e(hx, "RECONNECT_BACKOFF_BURST_WINDOW_MS", 5e3), e(hx, "RECONNECT_BACKOFF_BURST_THRESHOLD", 3), e(hx, "EDGE_SELECTOR_RESET_TIMEOUT", 6e4), e(hx, "HIDDEN_BACKOFF_BASE_MS", 1e3), e(hx, "HIDDEN_BACKOFF_MAX_MS", 3e4), e(hx, "OFFLINE_RETRY_MS", 3e4), e(hx, "create", (e, t, n) => new Pb(e, t, n));
9426
9416
  // ../../libs/web-sdk/src/modules/ConstraintCapModule.ts
9427
- var vx, yx = () => ({
9417
+ var _x, vx = () => ({
9428
9418
  video: p(p({}, fn()), {}, { bitRate: dn() }),
9429
9419
  audio: { bitRate: dn() }
9430
- }), bx = () => ({
9420
+ }), yx = () => ({
9431
9421
  width: window.innerWidth,
9432
9422
  height: window.innerHeight,
9433
9423
  bitRate: dn()
9434
- }), xx = class t {
9424
+ }), bx = class t {
9435
9425
  constructor(n, r, i, a) {
9436
9426
  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", () => {
9437
9427
  var e;
@@ -9453,7 +9443,7 @@ var vx, yx = () => ({
9453
9443
  this.timers.unload();
9454
9444
  }), e(this, "setUserSpecifiedCap", (e) => {
9455
9445
  var t;
9456
- let n = (t = this.getUserSpecifiedCap()) == null ? yx() : t;
9446
+ let n = (t = this.getUserSpecifiedCap()) == null ? vx() : t;
9457
9447
  this.userSpecifiedCap = p(p({}, n), {}, {
9458
9448
  video: p(p({}, n.video), e.video),
9459
9449
  audio: p(p({}, n.audio), e.audio)
@@ -9477,7 +9467,7 @@ var vx, yx = () => ({
9477
9467
  });
9478
9468
  }), e(this, "evaluateConstraintCap", () => {
9479
9469
  var e, t, n, r;
9480
- let i = this.sizeBasedResolutionCapEnabled ? p(p({}, yx()), {}, { video: bx() }) : yx();
9470
+ let i = this.sizeBasedResolutionCapEnabled ? p(p({}, vx()), {}, { video: yx() }) : vx();
9481
9471
  if (!this.resizeObserver) {
9482
9472
  let e = this.element.getBoundingClientRect();
9483
9473
  this.elementSize = {
@@ -9514,19 +9504,19 @@ var vx, yx = () => ({
9514
9504
  this._sizeBasedResolutionCapEnabled = e, this.evaluateConstraintCap();
9515
9505
  }
9516
9506
  };
9517
- vx = xx, e(xx, "CHECK_SIZE_INTERVAL", 1e3), e(xx, "create", (e, t, n, r) => new vx(e, t, n, r));
9507
+ _x = bx, e(bx, "CHECK_SIZE_INTERVAL", 1e3), e(bx, "create", (e, t, n, r) => new _x(e, t, n, r));
9518
9508
  // ../../libs/web-sdk/src/renditionKey.ts
9519
- var Sx = (e, t) => `${e}\u0000${t == null ? "" : t}`, Cx = (e, t, n, r) => e === n && t === r, wx = class {
9509
+ var xx = (e, t) => `${e}\u0000${t == null ? "" : t}`, Sx = (e, t, n, r) => e === n && t === r, Cx = class {
9520
9510
  constructor() {
9521
9511
  e(this, "lastKey", void 0), e(this, "shouldNotify", (e, t) => {
9522
- let n = Sx(e, t);
9512
+ let n = xx(e, t);
9523
9513
  return this.lastKey !== n && (this.lastKey = n, !0);
9524
9514
  });
9525
9515
  }
9526
- }, Tx = 5, Ex = 40, Dx = 1, Ox = 3e4, kx = 5, Ax = (e) => {
9516
+ }, wx = 5, Tx = 40, Ex = 1, Dx = 3e4, Ox = 5, kx = (e) => {
9527
9517
  var t, n;
9528
9518
  return ((t = e.maxCompositionOffsetMs) == null ? 0 : t) - ((n = e.minCompositionOffsetMs) == null ? 0 : n);
9529
- }, jx = (e, t, n) => {
9519
+ }, Ax = (e, t, n) => {
9530
9520
  let r = [];
9531
9521
  for (let i of e) {
9532
9522
  let e = r[r.length - 1];
@@ -9536,10 +9526,10 @@ var Sx = (e, t) => `${e}\u0000${t == null ? "" : t}`, Cx = (e, t, n, r) => e ===
9536
9526
  });
9537
9527
  }
9538
9528
  return r;
9539
- }, Mx = (e, t) => {
9529
+ }, jx = (e, t) => {
9540
9530
  let n = e[e.length - 1];
9541
9531
  n && n.end > t && n.start < t && (n.end = t);
9542
- }, Nx = 100, Px = 1e3, Fx = class n {
9532
+ }, Mx = 100, Nx = 1e3, Px = class n {
9543
9533
  constructor(t, n, r, i, a = !1, o = !1, s = !1) {
9544
9534
  e(this, "backgroundTimersEnabled", !1), e(this, "timers", this.createTimers()), e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "trackContexts", void 0), e(this, "playbackSource", void 0), e(this, "isLoaded", !1), 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", () => {
9545
9535
  this.isLoaded = !0, this.armTimers(), this.emitter.on("init segment", this.onInitSegment), this.emitter.on("coded sample", this.decode), this.emitter.on("flush buffers", this.resetContexts);
@@ -9557,8 +9547,8 @@ var Sx = (e, t) => `${e}\u0000${t == null ? "" : t}`, Cx = (e, t, n, r) => e ===
9557
9547
  }), e(this, "unsuspend", () => {
9558
9548
  this.isSuspended = !1, this.emitDecodedFrames(), this._audioWebCodecsInUse && this.scheduleAudioEmitRetry();
9559
9549
  }), e(this, "armTimers", () => {
9560
- let e = this._audioWebCodecsInUse ? 20 : Nx;
9561
- this.timers.setInterval(this.emitDecodedFrames, e), this.timers.setInterval(this.emitDecodeRate, Px);
9550
+ let e = this._audioWebCodecsInUse ? 20 : Mx;
9551
+ this.timers.setInterval(this.emitDecodedFrames, e), this.timers.setInterval(this.emitDecodeRate, Nx);
9562
9552
  }), e(this, "replaceTimers", () => {
9563
9553
  let e = this.isAudioEmitRetryScheduled;
9564
9554
  this.isAudioEmitRetryScheduled = !1, this.timers.unload(), this.timers = this.createTimers(), this.timers.isWorkerBackendUnavailable() && this.logger.warn("Background timer worker is unavailable (likely blocked by CSP or unsupported in this environment). Falling back to main-thread timers; hidden-tab playback may be throttled."), this.isLoaded && (this.armTimers(), e && this.scheduleAudioEmitRetry());
@@ -9627,27 +9617,27 @@ var Sx = (e, t) => `${e}\u0000${t == null ? "" : t}`, Cx = (e, t, n, r) => e ===
9627
9617
  i.stream = `${e.channelId}/${e.renditionId}`;
9628
9618
  let c = (e.timestamp + a) / e.timescale * 1e3, l = e.duration / e.timescale * 1e3;
9629
9619
  l > 0 && (i.sampleDuration = l);
9630
- let u = i.sampleDuration || Ex, d = e.timestamp / e.timescale * 1e3, f = a / e.timescale * 1e3, p = Ax(i), m = (t = s[s.length - 1]) == null ? void 0 : t.end, h = Math.max(u * kx, p + ((n = i.frontierSampleDurationMs) == null ? u : n)), g = m !== void 0 && c + h < m;
9620
+ let u = i.sampleDuration || Tx, d = e.timestamp / e.timescale * 1e3, f = a / e.timescale * 1e3, p = kx(i), m = (t = s[s.length - 1]) == null ? void 0 : t.end, h = Math.max(u * Ox, p + ((n = i.frontierSampleDurationMs) == null ? u : n)), g = m !== void 0 && c + h < m;
9631
9621
  i.lastDecodeTimestampMs = g ? d : Math.max((r = i.lastDecodeTimestampMs) == null ? d : r, d);
9632
- let ee = i.channelId !== void 0 && !Cx(i.channelId, i.renditionId, e.channelId, e.renditionId);
9622
+ let ee = i.channelId !== void 0 && !Sx(i.channelId, i.renditionId, e.channelId, e.renditionId);
9633
9623
  i.channelId = e.channelId, i.renditionId = e.renditionId, (g || ee) && (i.minCompositionOffsetMs = void 0, i.maxCompositionOffsetMs = void 0, i.hasAnchoredGop = !1, i.isReorderStructureStale = !0);
9634
9624
  let _ = i.hasAnchoredGop === !0;
9635
9625
  if (e.isSync && (i.hasAnchoredGop = !0), !g && i.hasAnchoredGop) {
9636
9626
  var v, y;
9637
9627
  i.minCompositionOffsetMs = Math.min((v = i.minCompositionOffsetMs) == null ? f : v, f), i.maxCompositionOffsetMs = Math.max((y = i.maxCompositionOffsetMs) == null ? f : y, f), _ && (i.isReorderStructureStale = !1);
9638
9628
  }
9639
- let b = Ax(i) > 0;
9629
+ let b = kx(i) > 0;
9640
9630
  if (g) i.buffer = [{
9641
9631
  start: c,
9642
9632
  end: c + u
9643
9633
  }], i.frontierSampleDurationMs = u, e.type === "video" && (this.videoKeyframeTimestamps = []);
9644
9634
  else {
9645
9635
  var x;
9646
- !b && !i.isReorderStructureStale && Mx(s, c + u);
9636
+ !b && !i.isReorderStructureStale && jx(s, c + u);
9647
9637
  let e = (x = s[s.length - 1]) == null ? void 0 : x.end;
9648
- (e === void 0 || c + u >= e) && (i.frontierSampleDurationMs = u), $t(s, c, c + u, Tx);
9638
+ (e === void 0 || c + u >= e) && (i.frontierSampleDurationMs = u), $t(s, c, c + u, wx);
9649
9639
  }
9650
- if (tn(i.buffer, this.playbackSource.currentTime - Ox), i.playableRangesCache = void 0, e.type === "video" && e.isSync) {
9640
+ if (tn(i.buffer, this.playbackSource.currentTime - Dx), i.playableRangesCache = void 0, e.type === "video" && e.isSync) {
9651
9641
  let e = this.videoKeyframeTimestamps[this.videoKeyframeTimestamps.length - 1];
9652
9642
  e !== void 0 && c < e && (this.videoKeyframeTimestamps = []), this.videoKeyframeTimestamps.push(c), this.videoKeyframeTimestamps.length > 20 && (this.videoKeyframeTimestamps = this.videoKeyframeTimestamps.slice(-20));
9653
9643
  }
@@ -9680,11 +9670,11 @@ var Sx = (e, t) => `${e}\u0000${t == null ? "" : t}`, Cx = (e, t, n, r) => e ===
9680
9670
  }), e(this, "emitDecodeRate", () => {
9681
9671
  this.decodeRateGraceIntervals > 0 ? this.decodeRateGraceIntervals-- : (this.currentVideoDecodeRate = this.calculateVideoDecodeRate(), this.emitter.emit("video decode rate", this.currentVideoDecodeRate));
9682
9672
  }), e(this, "playableRanges", (e) => {
9683
- let t = Ax(e);
9673
+ let t = kx(e);
9684
9674
  if (t <= 0) return e.buffer;
9685
9675
  if (e.playableRangesCache === void 0) {
9686
9676
  var n, r;
9687
- e.playableRangesCache = jx(e.buffer, ((n = e.lastDecodeTimestampMs) == null ? Infinity : n) - Math.max(0, -((r = e.minCompositionOffsetMs) == null ? 0 : r)) - Dx, t + (e.sampleDuration || Ex) + Dx);
9677
+ e.playableRangesCache = Ax(e.buffer, ((n = e.lastDecodeTimestampMs) == null ? Infinity : n) - Math.max(0, -((r = e.minCompositionOffsetMs) == null ? 0 : r)) - Ex, t + (e.sampleDuration || Tx) + Ex);
9688
9678
  }
9689
9679
  return e.playableRangesCache;
9690
9680
  }), e(this, "updateBufferState", () => {
@@ -9719,7 +9709,7 @@ var Sx = (e, t) => `${e}\u0000${t == null ? "" : t}`, Cx = (e, t, n, r) => e ===
9719
9709
  case "audio": {
9720
9710
  let n, i, a = !1;
9721
9711
  if (c) {
9722
- let { WebCodecsAudioDecoderContext: t } = yield import("./DeDKEcFp.js");
9712
+ let { WebCodecsAudioDecoderContext: t } = yield import("./de9FRek3.js");
9723
9713
  if (a = t.isSupported(), a) try {
9724
9714
  n = yield t.create(r.createContext("WebCodecsAudio")), h = !0;
9725
9715
  } catch (t) {
@@ -9731,7 +9721,7 @@ var Sx = (e, t) => `${e}\u0000${t == null ? "" : t}`, Cx = (e, t, n, r) => e ===
9731
9721
  }
9732
9722
  if (!n) {
9733
9723
  if (e.codec === "opus") {
9734
- let { OpusDecoderContext: t } = yield import("./OwGxSXha.js");
9724
+ let { OpusDecoderContext: t } = yield import("./t_21OUKh.js");
9735
9725
  n = yield t.create(e.sampleRate || 48e3, e.channels || 2);
9736
9726
  } else {
9737
9727
  let t = c ? i ? `WebCodecs audio decoder initialization failed: ${i.message}` : a ? "WebCodecs audio decoder could not be initialized." : "WebCodecs AudioDecoder API is not supported in this environment." : "WebCodecs audio decoding is disabled.";
@@ -9748,7 +9738,7 @@ var Sx = (e, t) => `${e}\u0000${t == null ? "" : t}`, Cx = (e, t, n, r) => e ===
9748
9738
  break;
9749
9739
  }
9750
9740
  case "video": {
9751
- let { VideoDecoderWorkerContext: n } = yield import("./ooDqeHgz.js"), a = yield n.create(r.createContext("VideoDecoderWorker"), i, s, c, l, u, () => o.currentTime, d, f);
9741
+ let { VideoDecoderWorkerContext: n } = yield import("./BMEhrui6.js"), a = yield n.create(r.createContext("VideoDecoderWorker"), i, s, c, l, u, () => o.currentTime, d, f);
9752
9742
  m = a.isWebCodecs, g = a.usingOffscreenCanvas, t.set(e.type, {
9753
9743
  buffer: [],
9754
9744
  decoderContext: a,
@@ -9767,7 +9757,7 @@ var Sx = (e, t) => `${e}\u0000${t == null ? "" : t}`, Cx = (e, t, n, r) => e ===
9767
9757
  var e;
9768
9758
  if (this._offscreenCanvasInUse) return (e = this.trackContexts.get("video")) == null ? void 0 : e.decoderContext.videoTrack;
9769
9759
  }
9770
- }, Ix, Lx = class {
9760
+ }, Fx, Ix = class {
9771
9761
  constructor(t) {
9772
9762
  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, "isBehindAnotherApp", !1), e(this, "unload", () => {
9773
9763
  this.emitter.off("fullscreen app switch", this.onFullscreenAppSwitch), window.removeEventListener("focus", this.onVisibilityChanged), document.removeEventListener("visibilitychange", this.onVisibilityChanged), window.removeEventListener("pageshow", this.onPageShow), window.removeEventListener("pagehide", this.onPageHide), window.removeEventListener("online", this.onOnline), window.removeEventListener("offline", this.onOffline);
@@ -9799,11 +9789,11 @@ var Sx = (e, t) => `${e}\u0000${t == null ? "" : t}`, Cx = (e, t, n, r) => e ===
9799
9789
  return document.visibilityState === "visible" && !this.isBehindAnotherApp;
9800
9790
  }
9801
9791
  };
9802
- Ix = Lx, e(Lx, "create", (e) => new Ix(e));
9792
+ Fx = Ix, e(Ix, "create", (e) => new Fx(e));
9803
9793
  // ../../libs/web-sdk/src/modules/EventModule.ts
9804
- var Rx, zx = (e) => (t, n, r) => t.timestamp <= n || t.timestampAdded <= r - e, Bx = class t {
9794
+ var Lx, Rx = (e) => (t, n, r) => t.timestamp <= n || t.timestampAdded <= r - e, zx = class t {
9805
9795
  constructor(n, r, i) {
9806
- e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "waitingEvents", []), e(this, "isTriggered", zx(t.EVENT_TIMEOUT)), e(this, "timeSource", void 0), e(this, "timers", new j()), e(this, "load", () => {
9796
+ e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "waitingEvents", []), e(this, "isTriggered", Rx(t.EVENT_TIMEOUT)), e(this, "timeSource", void 0), e(this, "timers", new j()), e(this, "load", () => {
9807
9797
  this.timers.setInterval(this.onBufferedStateChanged, t.EVENT_CHECK_INTERVAL), this.emitter.on("add event", this.addEvent);
9808
9798
  }), e(this, "unload", () => {
9809
9799
  this.timers.unload(), this.emitter.off("add event", this.addEvent);
@@ -9830,9 +9820,9 @@ var Rx, zx = (e) => (t, n, r) => t.timestamp <= n || t.timestampAdded <= r - e,
9830
9820
  }), this.logger = r, this.emitter = n, this.timeSource = i;
9831
9821
  }
9832
9822
  };
9833
- Rx = Bx, e(Bx, "EVENT_TIMEOUT", 5e3), e(Bx, "EVENT_CHECK_INTERVAL", 20), e(Bx, "create", (e, t, n) => new Rx(e, t, n));
9823
+ Lx = zx, e(zx, "EVENT_TIMEOUT", 5e3), e(zx, "EVENT_CHECK_INTERVAL", 20), e(zx, "create", (e, t, n) => new Lx(e, t, n));
9834
9824
  // ../../libs/web-sdk/src/modules/JitterModule.ts
9835
- var Vx = 1e3, Hx = 50, Ux = class t {
9825
+ var Bx = 1e3, Vx = 50, Hx = class t {
9836
9826
  constructor(t) {
9837
9827
  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", () => {
9838
9828
  this.logger.debug("JitterModule loaded");
@@ -9853,9 +9843,9 @@ var Vx = 1e3, Hx = 50, Ux = class t {
9853
9843
  this.trackingState.set(n, {
9854
9844
  lastArrivalTime: r,
9855
9845
  lastTimestampMs: i,
9856
- jitterSamples: new S(Vx),
9857
- interArrivalTimes: new S(Vx)
9858
- }), this.runningJitter.set(n, 0), this.recentJitterSamples.set(n, new S(Hx));
9846
+ jitterSamples: new S(Bx),
9847
+ interArrivalTimes: new S(Bx)
9848
+ }), this.runningJitter.set(n, 0), this.recentJitterSamples.set(n, new S(Vx));
9859
9849
  return;
9860
9850
  }
9861
9851
  let o = i - a.lastTimestampMs;
@@ -9868,7 +9858,7 @@ var Vx = 1e3, Hx = 50, Ux = class t {
9868
9858
  let l = (t = this.runningJitter.get(n)) == null ? 0 : t, u = l + (c - l) / 16;
9869
9859
  this.runningJitter.set(n, u);
9870
9860
  let d = this.recentJitterSamples.get(n);
9871
- d || (d = new S(Hx), this.recentJitterSamples.set(n, d)), d.push(c), a.lastArrivalTime = r, a.lastTimestampMs = i;
9861
+ d || (d = new S(Vx), this.recentJitterSamples.set(n, d)), d.push(c), a.lastArrivalTime = r, a.lastTimestampMs = i;
9872
9862
  }
9873
9863
  getJitterForType(e) {
9874
9864
  for (let [i, a] of this.trackingState) if (i.startsWith(e)) {
@@ -9899,10 +9889,10 @@ var Vx = 1e3, Hx = 50, Ux = class t {
9899
9889
  videoJitter: this.getJitterForType("video")
9900
9890
  };
9901
9891
  }
9902
- }, Wx = () => window.AudioContext || window.webkitAudioContext, Gx = class n extends s {
9892
+ }, Ux = () => window.AudioContext || window.webkitAudioContext, Wx = class n extends s {
9903
9893
  constructor() {
9904
9894
  var r;
9905
- super(), r = this, e(this, "context", new (Wx())()), 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* () {
9895
+ super(), r = this, e(this, "context", new (Ux())()), 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* () {
9906
9896
  let e = !0, t = r.context.resume();
9907
9897
  t.then(() => {
9908
9898
  e = !1;
@@ -9937,9 +9927,9 @@ var Vx = 1e3, Hx = 50, Ux = class t {
9937
9927
  return this.context.state;
9938
9928
  }
9939
9929
  };
9940
- e(Gx, "CHECK_INTERVAL", 1e3);
9930
+ e(Wx, "CHECK_INTERVAL", 1e3);
9941
9931
  // ../../libs/web-audio-player/src/AudioPlayer.ts
9942
- var Kx, qx = 150, Jx = 400, Yx = (e) => e === void 0 ? 5 : e <= qx ? 1 : e <= Jx ? 2 : 5, Xx = class extends s {
9932
+ var Gx, Kx = 150, qx = 400, Jx = (e) => e === void 0 ? 5 : e <= Kx ? 1 : e <= qx ? 2 : 5, Yx = class extends s {
9943
9933
  get isContextRunning() {
9944
9934
  var e;
9945
9935
  return ((e = this.audio) == null ? void 0 : e.state) === "running";
@@ -9986,7 +9976,7 @@ var Kx, qx = 150, Jx = 400, Yx = (e) => e === void 0 ? 5 : e <= qx ? 1 : e <= Jx
9986
9976
  return this._bufferTime;
9987
9977
  }
9988
9978
  set bufferTime(e) {
9989
- this._bufferTime = e, this.audioBufferMultiplier = Yx(e);
9979
+ this._bufferTime = e, this.audioBufferMultiplier = Jx(e);
9990
9980
  }
9991
9981
  get sinkPaused() {
9992
9982
  return this._sinkPaused;
@@ -10088,14 +10078,14 @@ var Kx, qx = 150, Jx = 400, Yx = (e) => e === void 0 ? 5 : e <= qx ? 1 : e <= Jx
10088
10078
  this.ignoreSuspendCalls = !1, this.emit("state change", "suspended");
10089
10079
  }), e(this, "getAudioContext", () => this.audio ? this.audio : this.setupContext()), e(this, "setupContext", () => {
10090
10080
  var e, t, n;
10091
- return (e = this.audio) == null || e.unload(), this.audio = new Gx(), this.audio.on("state", (e) => {
10081
+ return (e = this.audio) == null || e.unload(), this.audio = new Wx(), this.audio.on("state", (e) => {
10092
10082
  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);
10093
10083
  }), this.audio.on("stuck", () => {
10094
10084
  this.reInitWhenStuck ? (this.logger.info("Re-init audio context"), this.setupContext(), this.resume().catch(b), this.emit("stuck")) : this.restartContext();
10095
10085
  }), (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;
10096
10086
  }), e(this, "setGain", (e) => {
10097
10087
  this.gainNode && (this.gainNode.gain.value = this._muted ? 0 : e);
10098
- }), this._muted = i, this._userProvidedMuted = i, this.logger = n, this.clockSource = r, this.reInitWhenStuck = a, this._bufferTime = o, this.audioBufferMultiplier = Yx(o);
10088
+ }), this._muted = i, this._userProvidedMuted = i, this.logger = n, this.clockSource = r, this.reInitWhenStuck = a, this._bufferTime = o, this.audioBufferMultiplier = Jx(o);
10099
10089
  }
10100
10090
  useMediaStreamDestination() {
10101
10091
  var e;
@@ -10108,9 +10098,9 @@ var Kx, qx = 150, Jx = 400, Yx = (e) => e === void 0 ? 5 : e <= qx ? 1 : e <= Jx
10108
10098
  return (e = this.gainNode) == null || e.connect(t), t;
10109
10099
  }
10110
10100
  };
10111
- Kx = Xx, e(Xx, "create", (e, t, n) => new Kx(e, t, n));
10101
+ Gx = Yx, e(Yx, "create", (e, t, n) => new Gx(e, t, n));
10112
10102
  // ../../libs/web-sdk/src/players/VideoPlayer.ts
10113
- var Zx, Qx = class {
10103
+ var Xx, Zx = class {
10114
10104
  constructor(t, n, r, i, a, o) {
10115
10105
  e(this, "staleFrameThresholdMs", 400), e(this, "pool", void 0), e(this, "logger", void 0), e(this, "videoRenderer", new zr()), 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", () => {
10116
10106
  this.videoRenderer.load(), this.subscribeToContextLost(this.videoRenderer);
@@ -10202,11 +10192,11 @@ var Zx, Qx = class {
10202
10192
  }), this.logger = t, this.clockSource = n, this.pool = r, this.renderTargetSize = i || this.videoRenderer.canvas, this.onCanvasChangeCallback = a, this.onRendererErrorCallback = o;
10203
10193
  }
10204
10194
  };
10205
- Zx = Qx, e(Qx, "create", (e, t, n, r, i, a) => new Zx(e, t, n, r, i, a));
10195
+ Xx = Zx, e(Zx, "create", (e, t, n, r, i, a) => new Xx(e, t, n, r, i, a));
10206
10196
  // ../../libs/web-sdk/src/TextTracks.ts
10207
- var $x = /* @__PURE__ */ new WeakMap(), eS = class {
10197
+ var Qx = /* @__PURE__ */ new WeakMap(), $x = class {
10208
10198
  constructor() {
10209
- c(this, $x, []), n($x, this, []);
10199
+ c(this, Qx, []), n(Qx, this, []);
10210
10200
  }
10211
10201
  addTextTrack(e, t, n) {
10212
10202
  let r = [], a = {
@@ -10223,43 +10213,43 @@ var $x = /* @__PURE__ */ new WeakMap(), eS = class {
10223
10213
  t !== -1 && r.splice(t, 1);
10224
10214
  }
10225
10215
  };
10226
- return i($x, this).push(a), a;
10216
+ return i(Qx, this).push(a), a;
10227
10217
  }
10228
10218
  set language(e) {
10229
- i($x, this).forEach((t) => {
10219
+ i(Qx, this).forEach((t) => {
10230
10220
  t.mode = t.language === e ? "showing" : "hidden";
10231
10221
  });
10232
10222
  }
10233
10223
  get language() {
10234
10224
  var e;
10235
- return (e = i($x, this).find((e) => e.mode === "showing")) == null ? void 0 : e.language;
10225
+ return (e = i(Qx, this).find((e) => e.mode === "showing")) == null ? void 0 : e.language;
10236
10226
  }
10237
10227
  get tracks() {
10238
- return i($x, this);
10228
+ return i(Qx, this);
10239
10229
  }
10240
10230
  get activeTrack() {
10241
- return i($x, this).find((e) => e.mode === "showing");
10231
+ return i(Qx, this).find((e) => e.mode === "showing");
10242
10232
  }
10243
10233
  getActiveCues(e) {
10244
- let t = i($x, this).find((e) => e.mode === "showing");
10234
+ let t = i(Qx, this).find((e) => e.mode === "showing");
10245
10235
  return t ? t.cues.filter(({ startTime: t, endTime: n }) => e >= t && e < n) : [];
10246
10236
  }
10247
- }, tS = (e, t) => {
10237
+ }, eS = (e, t) => {
10248
10238
  let n;
10249
10239
  for (n = t; e > 1; e--) n += t;
10250
10240
  return n;
10251
- }, nS = class {
10241
+ }, tS = class {
10252
10242
  constructor() {
10253
10243
  e(this, "audio", void 0), e(this, "unmute", () => this.audio.play().catch(b));
10254
10244
  let t = document.createElement("div");
10255
10245
  t.innerHTML = "<audio x-webkit-airplay='deny'></audio>";
10256
10246
  let n = t.children.item(0);
10257
- 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" + tS(23, "A") + "WGluZwAAAA8AAAACAAACcQCA" + tS(16, "gICA") + tS(66, "/") + "8AAABhTEFNRTMuMTAwA8MAAAAAAAAAABQgJAUHQQAB9AAAAnGMHkkI" + tS(320, "A") + "//sQxAADgnABGiAAQBCqgCRMAAgEAH" + tS(15, "/") + "7+n/9FTuQsQH//////2NG0jWUGlio5gLQTOtIoeR2WX////X4s9Atb/JRVCbBUpeRUq" + tS(18, "/") + "9RUi0f2jn/+xDECgPCjAEQAABN4AAANIAAAAQVTEFNRTMuMTAw" + tS(97, "V") + "Q==", this.audio.loop = !1, this.audio.load();
10247
+ 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" + eS(23, "A") + "WGluZwAAAA8AAAACAAACcQCA" + eS(16, "gICA") + eS(66, "/") + "8AAABhTEFNRTMuMTAwA8MAAAAAAAAAABQgJAUHQQAB9AAAAnGMHkkI" + eS(320, "A") + "//sQxAADgnABGiAAQBCqgCRMAAgEAH" + eS(15, "/") + "7+n/9FTuQsQH//////2NG0jWUGlio5gLQTOtIoeR2WX////X4s9Atb/JRVCbBUpeRUq" + eS(18, "/") + "9RUi0f2jn/+xDECgPCjAEQAABN4AAANIAAAAQVTEFNRTMuMTAw" + eS(97, "V") + "Q==", this.audio.loop = !1, this.audio.load();
10258
10248
  else throw Error("Failed to create audio tag");
10259
10249
  }
10260
- }, rS, iS = class {
10250
+ }, nS, rS = class {
10261
10251
  constructor(t, n, r, i, a, o, s, c) {
10262
- 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 nS()), 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, "volumeState", void 0), e(this, "textTracks", new eS()), e(this, "playbackRate", void 0), e(this, "emitVolumeState", () => {
10252
+ 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 tS()), 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, "volumeState", void 0), e(this, "textTracks", new $x()), e(this, "playbackRate", void 0), e(this, "emitVolumeState", () => {
10263
10253
  let e = {
10264
10254
  volume: this.volume,
10265
10255
  isMuted: this.userMuted
@@ -10295,13 +10285,13 @@ var $x = /* @__PURE__ */ new WeakMap(), eS = class {
10295
10285
  e instanceof Error && this.emitter.emit("error", Ln(!1, e));
10296
10286
  }
10297
10287
  this.isVideoRenderingEnabled && this.videoPlayer.onDecodedFrame(e);
10298
- }), this.logger = n, this.emitter = t, this.pool = r, this.emitter.on("target buffer time", this.onTargetBufferTime), this.audioPlayer = Xx.create(this.logger.createContext("AudioPlayerModule"), i, {
10288
+ }), this.logger = n, this.emitter = t, this.pool = r, this.emitter.on("target buffer time", this.onTargetBufferTime), this.audioPlayer = Yx.create(this.logger.createContext("AudioPlayerModule"), i, {
10299
10289
  muted: a,
10300
10290
  reInitWhenStuck: !0,
10301
10291
  bufferTime: c
10302
10292
  }), o !== void 0 && (this.audioPlayer.volume = o), this.audioPlayer.on("stuck", () => {
10303
10293
  this.isDisconnected = !0;
10304
- }), this.audioPlayer.on("state change", this.emitVolumeState), this.videoPlayer = Qx.create(this.logger.createContext("VideoPlayerModule"), this.audioPlayer, this.pool, void 0, s);
10294
+ }), this.audioPlayer.on("state change", this.emitVolumeState), this.videoPlayer = Zx.create(this.logger.createContext("VideoPlayerModule"), this.audioPlayer, this.pool, void 0, s);
10305
10295
  }
10306
10296
  get volume() {
10307
10297
  return this.audioPlayer.volume;
@@ -10360,28 +10350,28 @@ var $x = /* @__PURE__ */ new WeakMap(), eS = class {
10360
10350
  this._isPaused = !0, this.audioPlayer.pause(), this.emitter.emit("media element state", "paused");
10361
10351
  }
10362
10352
  };
10363
- rS = iS, e(iS, "create", (e, t, n, r, i, a, o, s) => new rS(e, t, n, r, i, a, o, s));
10353
+ nS = rS, e(rS, "create", (e, t, n, r, i, a, o, s) => new nS(e, t, n, r, i, a, o, s));
10364
10354
  // ../../libs/web-sdk/src/modules/MediaSessionModule.ts
10365
- var aS, oS = [
10355
+ var iS, aS = [
10366
10356
  "play",
10367
10357
  "pause",
10368
10358
  "stop"
10369
- ], sS, cS = /* @__PURE__ */ new Set(), lS = class t {
10359
+ ], oS, sS = /* @__PURE__ */ new Set(), cS = class t {
10370
10360
  constructor(n, r, i) {
10371
10361
  e(this, "emitter", void 0), e(this, "logger", void 0), e(this, "options", void 0), e(this, "isLoaded", !1), e(this, "playbackState", void 0), e(this, "pageMetadata", null), e(this, "load", () => {
10372
- !this.isLoaded && t.isSupported() && (this.isLoaded = !0, cS.add(this), this.emitter.on("playback state", this.onPlaybackState), this.emitter.on("volume state", this.update));
10362
+ !this.isLoaded && t.isSupported() && (this.isLoaded = !0, sS.add(this), this.emitter.on("playback state", this.onPlaybackState), this.emitter.on("volume state", this.update));
10373
10363
  }), e(this, "unload", () => {
10374
10364
  var e;
10375
- this.isLoaded && (this.isLoaded = !1, cS.delete(this), this.emitter.off("playback state", this.onPlaybackState), this.emitter.off("volume state", this.update), this.handOverOwnership("on unload"), (e = this.options.decoy) == null || e.unload());
10365
+ this.isLoaded && (this.isLoaded = !1, sS.delete(this), this.emitter.off("playback state", this.onPlaybackState), this.emitter.off("volume state", this.update), this.handOverOwnership("on unload"), (e = this.options.decoy) == null || e.unload());
10376
10366
  }), e(this, "stop", () => {
10377
10367
  var e;
10378
- this.playbackState = void 0, (e = this.options.decoy) == null || e.unload(), sS === this && this.handOverOwnership("on stop");
10368
+ this.playbackState = void 0, (e = this.options.decoy) == null || e.unload(), oS === this && this.handOverOwnership("on stop");
10379
10369
  }), e(this, "getStatistics", () => {
10380
10370
  var e;
10381
10371
  return {
10382
10372
  mediaSessionSupported: t.isSupported(),
10383
- mediaSessionOwner: sS === this,
10384
- mediaSessionPlaybackState: sS === this ? this.isPaused ? "paused" : "playing" : "none",
10373
+ mediaSessionOwner: oS === this,
10374
+ mediaSessionPlaybackState: oS === this ? this.isPaused ? "paused" : "playing" : "none",
10385
10375
  decoyState: (e = this.options.decoy) == null ? void 0 : e.getStatistics().decoyState
10386
10376
  };
10387
10377
  }), e(this, "onPlaybackState", (e) => {
@@ -10389,18 +10379,18 @@ var aS, oS = [
10389
10379
  }), e(this, "refresh", () => {
10390
10380
  this.update();
10391
10381
  }), e(this, "update", () => {
10392
- this.isLoaded && (this.isEligibleToOwn && sS !== this ? this.claimOwnership() : this.sync());
10382
+ this.isLoaded && (this.isEligibleToOwn && oS !== this ? this.claimOwnership() : this.sync());
10393
10383
  }), e(this, "handOverOwnership", (e) => {
10394
- if (sS === this) {
10384
+ if (oS === this) {
10395
10385
  this.logger.debug(`Handing over the media session ${e}`), this.releaseOwnership();
10396
- for (let e of cS) if (e !== this && e.isEligibleToOwn) {
10386
+ for (let e of sS) if (e !== this && e.isEligibleToOwn) {
10397
10387
  e.claimOwnership();
10398
10388
  return;
10399
10389
  }
10400
10390
  }
10401
10391
  }), e(this, "sync", () => {
10402
10392
  var e, t, n, r, i, a;
10403
- if (sS !== this) return;
10393
+ if (oS !== this) return;
10404
10394
  if ((e = (t = this.options).isSuppressed) != null && e.call(t)) {
10405
10395
  var o;
10406
10396
  (o = this.options.decoy) == null || o.unload(), this.handOverOwnership("as suppressed");
@@ -10433,8 +10423,8 @@ var aS, oS = [
10433
10423
  (f = this.options.decoy) == null || f.play();
10434
10424
  }
10435
10425
  }), e(this, "claimOwnership", () => {
10436
- sS == null || sS.releaseOwnership(), sS = this, this.pageMetadata = navigator.mediaSession.metadata, this.applyMetadata();
10437
- for (let e of oS) this.safely(e, () => navigator.mediaSession.setActionHandler(e, this.onAction[e]));
10426
+ oS == null || oS.releaseOwnership(), oS = this, this.pageMetadata = navigator.mediaSession.metadata, this.applyMetadata();
10427
+ for (let e of aS) this.safely(e, () => navigator.mediaSession.setActionHandler(e, this.onAction[e]));
10438
10428
  this.safely("position state", () => {
10439
10429
  var e, t;
10440
10430
  return (e = (t = navigator.mediaSession).setPositionState) == null ? void 0 : e.call(t, {
@@ -10450,9 +10440,9 @@ var aS, oS = [
10450
10440
  });
10451
10441
  }), e(this, "releaseOwnership", () => {
10452
10442
  var e;
10453
- if (sS === this) {
10454
- sS = void 0, (e = this.options.decoy) == null || e.pause();
10455
- for (let e of oS) this.safely(e, () => navigator.mediaSession.setActionHandler(e, null));
10443
+ if (oS === this) {
10444
+ oS = void 0, (e = this.options.decoy) == null || e.pause();
10445
+ for (let e of aS) this.safely(e, () => navigator.mediaSession.setActionHandler(e, null));
10456
10446
  this.options.metadata && this.safely("metadata restore", () => {
10457
10447
  navigator.mediaSession.metadata = this.pageMetadata;
10458
10448
  }), this.safely("release", () => {
@@ -10486,14 +10476,14 @@ var aS, oS = [
10486
10476
  return this.playbackState !== void 0 && !this.isPaused && !this.options.isMuted() && ((e = (t = this.options).isSuppressed) == null ? void 0 : e.call(t)) !== !0;
10487
10477
  }
10488
10478
  };
10489
- aS = lS, e(lS, "create", (e, t, n) => new aS(e, t, n)), e(lS, "isSupported", () => typeof navigator < "u" && "mediaSession" in navigator && typeof MediaMetadata < "u");
10479
+ iS = cS, e(cS, "create", (e, t, n) => new iS(e, t, n)), e(cS, "isSupported", () => typeof navigator < "u" && "mediaSession" in navigator && typeof MediaMetadata < "u");
10490
10480
  // ../../libs/web-sdk/src/modules/ModernCanvasModule.ts
10491
- var uS, dS = class {
10481
+ var lS, uS = class {
10492
10482
  constructor(t, n, r, i, { muted: a, volume: o, type: s, poster: c, offscreenCanvas: l, bufferTime: u, backgroundPlaybackEnabled: d, splitAudio: f }) {
10493
10483
  if (e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "mediaElement", void 0), e(this, "sound", void 0), e(this, "wantsPlay", 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, "videoTrack", void 0), e(this, "canvasCaptureTracks", []), e(this, "backgroundPlaybackEnabled", void 0), e(this, "nativeTracksByLanguage", /* @__PURE__ */ new Map()), e(this, "nativeCuesByLanguage", /* @__PURE__ */ new Map()), e(this, "lastCanvasCueTexts", []), e(this, "isIOSNativeFullscreen", !1), e(this, "knownNativeLanguage", void 0), e(this, "renderCanvasSubtitlesInNativeFullscreen", (() => {
10494
10484
  let e = He().platform;
10495
10485
  return e.isIOS && e.iosVersion <= 16;
10496
- })()), e(this, "volumeState", void 0), e(this, "textTracks", new eS()), e(this, "reset", () => {}), e(this, "load", () => {
10486
+ })()), e(this, "volumeState", void 0), e(this, "textTracks", new $x()), e(this, "reset", () => {}), e(this, "load", () => {
10497
10487
  this.mediaElement.load(), this.sound && (this.sound.load(), document.body.appendChild(this.sound.element), this.mediaElement.element.addEventListener("pause", this.onVideoPause), this.mediaElement.element.addEventListener("play", this.onVideoPlay), window.addEventListener("focus", this.onWindowFocus)), 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.textTracks.addEventListener("change", this.onNativeTextTrackChange), this.element().element.addEventListener("webkitendfullscreen", this.onExitIOSHack), this.element().element.addEventListener("webkitbeginfullscreen", this.onEnterIOSHack), this.videoPlayer.load(), this.timers.setInterval(this.syncNativeTextTracks, 100);
10498
10488
  }), e(this, "unload", () => {
10499
10489
  this.emitter.off("target buffer time", this.onTargetBufferTime), this.emitter.off("decoded frame", this.onDecodedFrame), this.emitter.off("flush buffers", this.flushBuffers), this.emitter.off("ios-hack: reset size", this.resetCanvasSize), this.emitter.off("enter picture in picture", this.onEnterIOSHack), this.emitter.off("exit picture in picture", this.onExitIOSHack), this.element().element.textTracks.removeEventListener("change", this.onNativeTextTrackChange), this.element().element.removeEventListener("webkitendfullscreen", this.onExitIOSHack), this.element().element.removeEventListener("webkitbeginfullscreen", this.onEnterIOSHack);
@@ -10636,13 +10626,13 @@ var uS, dS = class {
10636
10626
  }), this.soundElement.on("media element state", (e) => {
10637
10627
  e === "paused" && this.audioPlayer.flushBuffer(), this.audioPlayer.sinkPaused = e === "paused", this.emitPlaybackState();
10638
10628
  }), this.sound) for (let e of this.elements()) e.on("needs user input", (e) => this.emitter.emit("needs user input", e)), e.on("error", (e) => this.emitter.emit("error", e));
10639
- this.audioPlayer = Xx.create(this.logger.createContext("AudioPlayerModule"), i, {
10629
+ this.audioPlayer = Yx.create(this.logger.createContext("AudioPlayerModule"), i, {
10640
10630
  muted: !1,
10641
10631
  reInitWhenStuck: !1,
10642
10632
  bufferTime: u
10643
10633
  }), this.audioPlayer.on("state change", (e) => {
10644
10634
  e === "suspended" || e === "interrupted" ? this.soundElement.muted = !0 : e === "running" && this.applyVisibilityMutePolicy(), this.updateVolumeState();
10645
- }), this.videoPlayer = Qx.create(this.logger.createContext("VideoPlayerModule"), this.audioPlayer, this.pool, this.mediaElement.element, () => this.reconnectCanvasStream(), this.onVideoPlayerError);
10635
+ }), this.videoPlayer = Zx.create(this.logger.createContext("VideoPlayerModule"), this.audioPlayer, this.pool, this.mediaElement.element, () => this.reconnectCanvasStream(), this.onVideoPlayerError);
10646
10636
  }
10647
10637
  get volume() {
10648
10638
  return this.soundElement.volume;
@@ -10714,9 +10704,9 @@ var uS, dS = class {
10714
10704
  return this.renderCanvasSubtitlesInNativeFullscreen && !this.offscreenCanvas;
10715
10705
  }
10716
10706
  };
10717
- uS = dS, e(dS, "create", (e, t, n, r, i) => new uS(e, t, n, r, i));
10707
+ lS = uS, e(uS, "create", (e, t, n, r, i) => new lS(e, t, n, r, i));
10718
10708
  // ../../libs/web-sdk/src/modules/MseModule.ts
10719
- var fS, pS = class {
10709
+ var dS, fS = class {
10720
10710
  constructor() {
10721
10711
  e(this, "initSegments", /* @__PURE__ */ new Map()), e(this, "set", (e, t, n) => {
10722
10712
  var r;
@@ -10728,7 +10718,7 @@ var fS, pS = class {
10728
10718
  });
10729
10719
  }
10730
10720
  };
10731
- function mS(e, { mediaSource: t, mimeType: n, codec: r }) {
10721
+ function pS(e, { mediaSource: t, mimeType: n, codec: r }) {
10732
10722
  return p(p({}, e), {}, {
10733
10723
  state: "initialized",
10734
10724
  mimeType: n,
@@ -10740,10 +10730,10 @@ function mS(e, { mediaSource: t, mimeType: n, codec: r }) {
10740
10730
  lastBufferCleanupTime: performance.now()
10741
10731
  });
10742
10732
  }
10743
- function hS({ initSegments: e, pendingSamples: t }) {
10733
+ function mS({ initSegments: e, pendingSamples: t }) {
10744
10734
  return {
10745
10735
  state: "uninitialized",
10746
- initSegments: e == null ? new pS() : e,
10736
+ initSegments: e == null ? new fS() : e,
10747
10737
  sequenceNumber: 0,
10748
10738
  isWorkingOnPendingSamples: !1,
10749
10739
  hasFirstSync: t.some((e) => e.isSync),
@@ -10753,7 +10743,7 @@ function hS({ initSegments: e, pendingSamples: t }) {
10753
10743
  successfulAppendCalls: 0
10754
10744
  };
10755
10745
  }
10756
- var gS = class {
10746
+ var hS = class {
10757
10747
  constructor(n, r, i) {
10758
10748
  var a = this;
10759
10749
  e(this, "maxChunkSize", 20), e(this, "minConsecutiveErrorsBeforeEmit", 5), e(this, "maxSecondsInBuffer", 60), e(this, "recoveryBeforeHideWindowMs", 1e3), e(this, "logger", void 0), e(this, "timers", j.create()), e(this, "emitter", void 0), e(this, "mediaElement", void 0), e(this, "mediaSource", new rc()), e(this, "trackContexts", /* @__PURE__ */ new Map()), e(this, "autoRecoverFromMediaErrors", !0), e(this, "quotaErrorCount", 0), e(this, "recoveredFromErrorCount", 0), e(this, "sourceOpenStartTime", performance.now()), e(this, "sourceOpenEndTime", performance.now()), e(this, "pendingTracksToAddSourceBuffers", void 0), e(this, "hasAddedInitialPosterFrame", !0), e(this, "videoKeyframeTimestamps", []), e(this, "isReopening", !1), e(this, "pendingMediaError", void 0), e(this, "isFlushDeferred", !1), e(this, "hasRecoveredSinceShown", !1), e(this, "lastRecoveredAt", -Infinity), e(this, "playbackStallCount", 0), e(this, "hasStartedPlayback", !1), e(this, "isPlaybackStalled", !1), e(this, "load", () => {
@@ -10799,7 +10789,7 @@ var gS = class {
10799
10789
  var n, r, i;
10800
10790
  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;
10801
10791
  for (; c < o.length && !((i = o[c]) != null && i.isSync);) c++;
10802
- let l = hS({
10792
+ let l = mS({
10803
10793
  pendingSamples: o,
10804
10794
  initSegments: s
10805
10795
  });
@@ -10810,14 +10800,14 @@ var gS = class {
10810
10800
  this.trackContexts.forEach((e, n) => {
10811
10801
  if (t.has(n)) return;
10812
10802
  e.state === "initialized" && this.mediaSource.isOpen() && this.mediaSource.removeSourceBuffer(e.sourceBuffer);
10813
- let r = hS({
10803
+ let r = mS({
10814
10804
  pendingSamples: [],
10815
10805
  initSegments: e.initSegments
10816
10806
  });
10817
10807
  this.trackContexts.set(n, r);
10818
10808
  });
10819
10809
  }), e(this, "isCurrentTrackContext", (e, t) => this.trackContexts.get(e) === t), e(this, "initializeSourceBuffer", (e, t) => {
10820
- let n = mS(e, {
10810
+ let n = pS(e, {
10821
10811
  mimeType: t.mimeType,
10822
10812
  mediaSource: this.mediaSource,
10823
10813
  codec: t.codec
@@ -10841,9 +10831,9 @@ var gS = class {
10841
10831
  if (t) a.logger.debug("Already setup with the correct mime types");
10842
10832
  else for (let t of e) {
10843
10833
  let n = a.trackContexts.get(t.type);
10844
- if (n || (n = hS({
10834
+ if (n || (n = mS({
10845
10835
  pendingSamples: [],
10846
- initSegments: new pS()
10836
+ initSegments: new fS()
10847
10837
  }), a.trackContexts.set(t.type, n)), n.state === "initialized") {
10848
10838
  if (t.mimeType !== n.sourceBufferMimeType) try {
10849
10839
  yield n.sourceBuffer.changeType(t.mimeType), n.sourceBufferMimeType = t.mimeType;
@@ -10860,7 +10850,7 @@ var gS = class {
10860
10850
  a.logger.warn("removeSourceBuffer failed", { removeError: t }), a.reopenMediaSource("changeType recovery failed"), a.pendingTracksToAddSourceBuffers = e;
10861
10851
  return;
10862
10852
  }
10863
- let i = hS({
10853
+ let i = mS({
10864
10854
  pendingSamples: n.pendingSamples,
10865
10855
  initSegments: n.initSegments
10866
10856
  });
@@ -10884,7 +10874,7 @@ var gS = class {
10884
10874
  };
10885
10875
  }), e(this, "getNextBufferedRangeStart", (e) => {
10886
10876
  let t = this.getCommonBufferedRangesForCurrentTracks();
10887
- if (t) return _S(e, t);
10877
+ if (t) return gS(e, t);
10888
10878
  }), e(this, "getBufferedEndAt", (e) => {
10889
10879
  var t;
10890
10880
  let n = this.getCommonBufferedRangesForCurrentTracks();
@@ -10934,9 +10924,9 @@ var gS = class {
10934
10924
  s > 0 && performance.now() - r.lastBufferCleanupTime > 1e4 && (r.lastBufferCleanupTime = performance.now(), yield r.sourceBuffer.removeBuffer(0, s + 10));
10935
10925
  try {
10936
10926
  let t = r.sequenceNumber;
10937
- if ("fragmented" in n) for (let t of SS(e)) {
10927
+ if ("fragmented" in n) for (let t of xS(e)) {
10938
10928
  var c;
10939
- yield r.sourceBuffer.appendBuffer(CS(t.map((e) => e.data)), (c = t[0]) == null ? void 0 : c.initData);
10929
+ yield r.sourceBuffer.appendBuffer(SS(t.map((e) => e.data)), (c = t[0]) == null ? void 0 : c.initData);
10940
10930
  }
10941
10931
  else {
10942
10932
  let n = Hs(e, t++);
@@ -10984,7 +10974,7 @@ var gS = class {
10984
10974
  let t = this.trackContexts.get(e.type);
10985
10975
  if (!t) throw Bn(e.type, e.renditionId);
10986
10976
  let n = t.pendingSamples.length - t.pendingSamplesOffset;
10987
- if (t.state === "uninitialized" && n >= yS && (e.isSync || n >= 2 * yS) && (t.pendingSamples = [], t.pendingSamplesOffset = 0, t.hasFirstSync = !1), t.hasFirstSync || e.isSync) {
10977
+ if (t.state === "uninitialized" && n >= vS && (e.isSync || n >= 2 * vS) && (t.pendingSamples = [], t.pendingSamplesOffset = 0, t.hasFirstSync = !1), t.hasFirstSync || e.isSync) {
10988
10978
  if (this.hasAddedInitialPosterFrame && e.isSync && e.type === "video") {
10989
10979
  this.hasAddedInitialPosterFrame = !1;
10990
10980
  let n = p({}, e);
@@ -10995,7 +10985,7 @@ var gS = class {
10995
10985
  let t = (e.timestamp + ((r = e.compositionTimeOffset) == null ? 0 : r)) / e.timescale * 1e3, n = this.videoKeyframeTimestamps[this.videoKeyframeTimestamps.length - 1];
10996
10986
  n !== void 0 && t < n && (this.videoKeyframeTimestamps = []), this.videoKeyframeTimestamps.push(t), this.videoKeyframeTimestamps.length > 20 && (this.videoKeyframeTimestamps = this.videoKeyframeTimestamps.slice(-20));
10997
10987
  }
10998
- t.state !== "uninitialized" && (t.isWorkingOnPendingSamples || TS(t, this.append, this.maxChunkSize).catch((n) => {
10988
+ t.state !== "uninitialized" && (t.isWorkingOnPendingSamples || wS(t, this.append, this.maxChunkSize).catch((n) => {
10999
10989
  if (t.isWorkingOnPendingSamples = !1, !this.isReopening) {
11000
10990
  if (!this.isCurrentTrackContext(e.type, t)) this.logger.debug("Suppressing append error from stale track context", { type: e.type });
11001
10991
  else if (n instanceof tc) this.logger.debug("Suppressing append error from a disposed source buffer", { type: e.type });
@@ -11109,14 +11099,14 @@ var gS = class {
11109
11099
  if (this.mediaSource.isClosed()) return;
11110
11100
  let e = this.getInitializedTrackBuffers();
11111
11101
  if (e.length !== 0) return this.getCommonBufferedRanges(e);
11112
- }), e(this, "getCommonBufferedRanges", (e) => e.slice(1).reduce((e, t) => xS(e, t), e[0] ? Array.from(e[0]) : [])), e(this, "getPlaybackStateForBufferedRanges", (e, t) => en(t, e) ? "playing" : "buffering"), this.logger = n, this.mediaElement = i, this.emitter = r;
11102
+ }), e(this, "getCommonBufferedRanges", (e) => e.slice(1).reduce((e, t) => bS(e, t), e[0] ? Array.from(e[0]) : [])), e(this, "getPlaybackStateForBufferedRanges", (e, t) => en(t, e) ? "playing" : "buffering"), this.logger = n, this.mediaElement = i, this.emitter = r;
11113
11103
  }
11114
11104
  };
11115
- fS = gS, e(gS, "create", (e, t, n) => {
11116
- let r = new fS(e, t, n);
11105
+ dS = hS, e(hS, "create", (e, t, n) => {
11106
+ let r = new dS(e, t, n);
11117
11107
  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("play", r.onPlay), n.addEventListener("seeking", r.onPlaybackPauseOrSeek), r.mediaSource.attach(n), r;
11118
11108
  });
11119
- var _S = (e, t) => {
11109
+ var gS = (e, t) => {
11120
11110
  for (let r = 0; r < t.length; r++) {
11121
11111
  let i = t[r];
11122
11112
  if (i) {
@@ -11127,11 +11117,11 @@ var _S = (e, t) => {
11127
11117
  }
11128
11118
  }
11129
11119
  }
11130
- }, vS = (e, t) => {
11120
+ }, _S = (e, t) => {
11131
11121
  var n;
11132
11122
  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;
11133
11123
  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;
11134
- }, yS = 1e3, bS = 32, xS = (e, t) => {
11124
+ }, vS = 1e3, yS = 32, bS = (e, t) => {
11135
11125
  let n = [], r = 0, i = 0;
11136
11126
  for (; r < e.length && i < t.length;) {
11137
11127
  let a = e[r], o = t[i];
@@ -11143,7 +11133,7 @@ var _S = (e, t) => {
11143
11133
  }), a.end <= o.end ? r++ : i++;
11144
11134
  }
11145
11135
  return n;
11146
- }, SS = (e) => {
11136
+ }, xS = (e) => {
11147
11137
  let t = [];
11148
11138
  for (let r of e) {
11149
11139
  var n;
@@ -11152,15 +11142,15 @@ var _S = (e, t) => {
11152
11142
  (e == null || (n = e[0]) == null ? void 0 : n.initData) === r.initData ? e.push(r) : t.push([r]);
11153
11143
  }
11154
11144
  return t;
11155
- }, CS = (e) => {
11145
+ }, SS = (e) => {
11156
11146
  if (e.length === 1 && e[0]) return e[0];
11157
11147
  let t = new Uint8Array(e.reduce((e, t) => e + t.byteLength, 0)), n = 0;
11158
11148
  for (let r of e) t.set(r, n), n += r.byteLength;
11159
11149
  return t;
11160
- }, wS = (e) => {
11150
+ }, CS = (e) => {
11161
11151
  let t = e.pendingSamplesOffset;
11162
- t !== 0 && (t >= e.pendingSamples.length ? (e.pendingSamples = [], e.pendingSamplesOffset = 0) : t < bS || t * 2 < e.pendingSamples.length || (e.pendingSamples = e.pendingSamples.slice(t), e.pendingSamplesOffset = 0));
11163
- }, TS = function() {
11152
+ t !== 0 && (t >= e.pendingSamples.length ? (e.pendingSamples = [], e.pendingSamplesOffset = 0) : t < yS || t * 2 < e.pendingSamples.length || (e.pendingSamples = e.pendingSamples.slice(t), e.pendingSamplesOffset = 0));
11153
+ }, wS = function() {
11164
11154
  var e = t(function* (e, t, n) {
11165
11155
  for (e.isWorkingOnPendingSamples = !0; e.pendingSamplesOffset < e.pendingSamples.length;) {
11166
11156
  let r = [], i = e.pendingSamplesOffset;
@@ -11168,7 +11158,7 @@ var _S = (e, t) => {
11168
11158
  i = t;
11169
11159
  let a = e.pendingSamples[t], o = e.pendingSamples[t + 1];
11170
11160
  if (a && (r.push(a), o)) {
11171
- if (vS(a, o)) break;
11161
+ if (_S(a, o)) break;
11172
11162
  let e = (a.timestamp + a.duration) / a.timescale;
11173
11163
  if (o.timestamp / o.timescale - e > .1) break;
11174
11164
  }
@@ -11176,14 +11166,14 @@ var _S = (e, t) => {
11176
11166
  }
11177
11167
  let a = r[0];
11178
11168
  if (!a) break;
11179
- yield t(r, !e.previousSample || vS(e.previousSample, a)), e.pendingSamplesOffset = i + 1, e.previousSample = r[r.length - 1], wS(e);
11169
+ yield t(r, !e.previousSample || _S(e.previousSample, a)), e.pendingSamplesOffset = i + 1, e.previousSample = r[r.length - 1], CS(e);
11180
11170
  }
11181
11171
  e.isWorkingOnPendingSamples = !1;
11182
11172
  });
11183
11173
  return function(t, n, r) {
11184
11174
  return e.apply(this, arguments);
11185
11175
  };
11186
- }(), ES, DS = class {
11176
+ }(), TS, ES = class {
11187
11177
  constructor(n, r) {
11188
11178
  var i = this;
11189
11179
  e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "element", void 0), e(this, "pictureInPictureWindow", void 0), e(this, "unload", () => {
@@ -11215,9 +11205,9 @@ var _S = (e, t) => {
11215
11205
  }()), e(this, "isWebkitPresentationModeSupported", () => !!this.element && ot(this.element)), this.emitter = n, this.logger = r, this.emitter.on("add picture in picture listener", this.onEnablePictureInPicture);
11216
11206
  }
11217
11207
  };
11218
- ES = DS, e(DS, "create", (e, t) => new ES(e, t));
11208
+ TS = ES, e(ES, "create", (e, t) => new TS(e, t));
11219
11209
  // ../../libs/web-sdk/src/modules/PlaybackModule.ts
11220
- var OS, kS = class {
11210
+ var DS, OS = class {
11221
11211
  constructor(t, n, r, i) {
11222
11212
  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", () => {
11223
11213
  this.emitter.off("buffer state", this.onBufferedStateChanged), this.emitter.off("needs user input", this.onNeedsUserInput);
@@ -11235,23 +11225,23 @@ var OS, kS = class {
11235
11225
  }), 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);
11236
11226
  }
11237
11227
  };
11238
- OS = kS, e(kS, "create", (e, t, n, r) => new OS(e, t, n, r));
11228
+ DS = OS, e(OS, "create", (e, t, n, r) => new DS(e, t, n, r));
11239
11229
  // ../../libs/web-sdk/src/modules/QualityOfServiceModule.ts
11240
- var AS, jS = 6e4, MS = () => ({
11230
+ var kS, AS = 6e4, jS = () => ({
11241
11231
  upgradesFromLevel: [],
11242
11232
  downgradesFromLevel: [],
11243
11233
  bufferingRanges: [],
11244
11234
  activeRanges: [],
11245
11235
  decodeRate: 2 ** 53 - 1
11246
- }), NS = () => ({
11236
+ }), MS = () => ({
11247
11237
  levels: {},
11248
11238
  levelDowngrades: [],
11249
11239
  levelUpgrades: [],
11250
11240
  bufferFullness: 0,
11251
- general: MS()
11252
- }), PS = 100, FS = 3600, IS = 1e3, LS = class {
11241
+ general: jS()
11242
+ }), NS = 100, PS = 3600, FS = 1e3, IS = class {
11253
11243
  constructor(t, n, r, i) {
11254
- e(this, "minBufferFullnessLengthForRegression", 6), e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "timers", j.create()), e(this, "metrics", NS()), e(this, "bufferFullness", new S(Infinity)), e(this, "bufferFullnessRegression", void 0), e(this, "lastDeliveryResumeTime", -Infinity), e(this, "currentLevel", void 0), e(this, "isSuspended", !1), e(this, "_fatalQosCount", 0), e(this, "recentFatalQosCount", 0), e(this, "healthyPlaybackMs", 0), e(this, "healthyPlaybackStartedAt", void 0), e(this, "playbackIsPlaying", !1), e(this, "stallClockStart", 0), e(this, "renditionLevelSource", void 0), e(this, "targetBufferTimeSource", void 0), e(this, "qualityIndexOrder", []), e(this, "hasPlayedInSession", !1), e(this, "hasAsserted", !1), e(this, "load", () => {
11244
+ e(this, "minBufferFullnessLengthForRegression", 6), e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "timers", j.create()), e(this, "metrics", MS()), e(this, "bufferFullness", new S(Infinity)), e(this, "bufferFullnessRegression", void 0), e(this, "lastDeliveryResumeTime", -Infinity), e(this, "currentLevel", void 0), e(this, "isSuspended", !1), e(this, "_fatalQosCount", 0), e(this, "recentFatalQosCount", 0), e(this, "healthyPlaybackMs", 0), e(this, "healthyPlaybackStartedAt", void 0), e(this, "playbackIsPlaying", !1), e(this, "stallClockStart", 0), e(this, "renditionLevelSource", void 0), e(this, "targetBufferTimeSource", void 0), e(this, "qualityIndexOrder", []), e(this, "hasPlayedInSession", !1), e(this, "hasAsserted", !1), e(this, "load", () => {
11255
11245
  this.emitter.on("playback state", this.onPlaybackState), this.emitter.on("buffer fullness", this.onBufferFullness), this.emitter.on("media delivery resumed", this.onMediaDeliveryResumed), this.emitter.on("rendition level changed", this.onRenditionLevelChanged), this.emitter.on("video decode rate", this.onVideoDecodeRate), this.emitter.on("connection state", this.onConnectionState), this.emitter.on("subscription changed", this.onSubscriptionChanged), this.emitter.on("pagehide", this.onPageHide);
11256
11246
  }), e(this, "unload", () => {
11257
11247
  this.emitter.off("playback state", this.onPlaybackState), this.emitter.off("buffer fullness", this.onBufferFullness), this.emitter.off("media delivery resumed", this.onMediaDeliveryResumed), this.emitter.off("rendition level changed", this.onRenditionLevelChanged), this.emitter.off("video decode rate", this.onVideoDecodeRate), this.emitter.off("connection state", this.onConnectionState), this.emitter.off("subscription changed", this.onSubscriptionChanged), this.emitter.off("pagehide", this.onPageHide), this.suspend();
@@ -11269,7 +11259,7 @@ var AS, jS = 6e4, MS = () => ({
11269
11259
  return this.metrics.levels[a];
11270
11260
  }), e(this, "getBufferFullnessRegression", (e = !1) => {
11271
11261
  if (!e) return this.bufferFullnessRegression;
11272
- if (performance.now() - this.lastDeliveryResumeTime < IS) return;
11262
+ if (performance.now() - this.lastDeliveryResumeTime < FS) return;
11273
11263
  let t = this.bufferFullness.items().filter(({ time: e }) => e >= this.lastDeliveryResumeTime);
11274
11264
  return t.length >= this.minBufferFullnessLengthForRegression ? this.calculateLinearRegression(t) : void 0;
11275
11265
  }), e(this, "getTargetBufferTime", () => {
@@ -11334,21 +11324,21 @@ var AS, jS = 6e4, MS = () => ({
11334
11324
  let d = !1;
11335
11325
  if (e.from) {
11336
11326
  var f;
11337
- let e = (f = this.metrics.levels[l]) == null ? MS() : f;
11327
+ let e = (f = this.metrics.levels[l]) == null ? jS() : f;
11338
11328
  l < u ? e.upgradesFromLevel.push(performance.now()) : e.downgradesFromLevel.push(performance.now()), Jt(e.activeRanges);
11339
11329
  let t = e.bufferingRanges[e.bufferingRanges.length - 1];
11340
11330
  d = !!t && !t.end, Jt(e.bufferingRanges), this.metrics.levels[l] = e;
11341
11331
  }
11342
11332
  if (e.to) {
11343
11333
  var p;
11344
- let e = (p = this.metrics.levels[u]) == null ? MS() : p;
11334
+ let e = (p = this.metrics.levels[u]) == null ? jS() : p;
11345
11335
  Yt(e.activeRanges), d && Yt(e.bufferingRanges), this.metrics.levels[u] = e, this.currentLevel = u;
11346
11336
  }
11347
11337
  }), e(this, "onMediaDeliveryResumed", () => {
11348
11338
  this.lastDeliveryResumeTime = performance.now();
11349
11339
  }), e(this, "onBufferFullness", (e) => {
11350
11340
  if (this.metrics.bufferFullness = e, this.isSuspended) return;
11351
- let t = performance.now(), n = this.bufferFullness.peekLast(), r = (e) => Math.floor(e / PS);
11341
+ let t = performance.now(), n = this.bufferFullness.peekLast(), r = (e) => Math.floor(e / NS);
11352
11342
  if (n && r(n.time) === r(t)) n.time = t, n.value = e;
11353
11343
  else {
11354
11344
  var i, a;
@@ -11356,7 +11346,7 @@ var AS, jS = 6e4, MS = () => ({
11356
11346
  time: t,
11357
11347
  value: e
11358
11348
  });
11359
- let n = this.bufferFullness.items(), r = (i = (a = n[n.length - this.minBufferFullnessLengthForRegression]) == null ? void 0 : a.time) == null ? -Infinity : i, o = Math.min(t - FS, r);
11349
+ let n = this.bufferFullness.items(), r = (i = (a = n[n.length - this.minBufferFullnessLengthForRegression]) == null ? void 0 : a.time) == null ? -Infinity : i, o = Math.min(t - PS, r);
11360
11350
  this.bufferFullness.filterPop(({ time: e }) => e >= o);
11361
11351
  }
11362
11352
  this.bufferFullnessRegression = this.bufferFullness.items().length >= this.minBufferFullnessLengthForRegression ? this.calculateLinearRegression() : void 0;
@@ -11371,7 +11361,7 @@ var AS, jS = 6e4, MS = () => ({
11371
11361
  case "paused":
11372
11362
  this.playbackIsPlaying = !1, this.hasPlayedInSession || this.stopHealthyPlayback();
11373
11363
  break;
11374
- case "buffering": this.stopHealthyPlayback(), this.playbackIsPlaying = !1, this.healthyPlaybackMs >= jS && (this.recentFatalQosCount = 0), !this.isSuspended && this.hasPlayedInSession ? (this.healthyPlaybackMs = 0, this.startBuffering()) : this.isSuspended && (this.healthyPlaybackMs = 0);
11364
+ case "buffering": this.stopHealthyPlayback(), this.playbackIsPlaying = !1, this.healthyPlaybackMs >= AS && (this.recentFatalQosCount = 0), !this.isSuspended && this.hasPlayedInSession ? (this.healthyPlaybackMs = 0, this.startBuffering()) : this.isSuspended && (this.healthyPlaybackMs = 0);
11375
11365
  }
11376
11366
  }), e(this, "onPageHide", ({ persisted: e }) => {
11377
11367
  e && (this.suspend(), this.playbackIsPlaying = !1);
@@ -11436,9 +11426,9 @@ var AS, jS = 6e4, MS = () => ({
11436
11426
  Yt(this.metrics.general.activeRanges);
11437
11427
  }
11438
11428
  };
11439
- AS = LS, e(LS, "create", (e, t, n, r) => new AS(e, t, n, r));
11429
+ kS = IS, e(IS, "create", (e, t, n, r) => new kS(e, t, n, r));
11440
11430
  // ../../libs/web-sdk/src/modules/RenditionsModule.ts
11441
- var RS, zS = class {
11431
+ var LS, RS = class {
11442
11432
  constructor(t, n) {
11443
11433
  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", () => {
11444
11434
  this.emitter.off("renditions", this.onRenditions), this.emitter.off("subscription changed", this.onSubscriptionChanged);
@@ -11513,9 +11503,9 @@ var RS, zS = class {
11513
11503
  }), 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);
11514
11504
  }
11515
11505
  };
11516
- RS = zS, e(zS, "create", (e, t) => new RS(e, t));
11506
+ LS = RS, e(RS, "create", (e, t) => new LS(e, t));
11517
11507
  // ../../libs/web-sdk/src/BFrameTracker.ts
11518
- var BS = class t {
11508
+ var zS = class t {
11519
11509
  constructor() {
11520
11510
  e(this, "channelId", void 0), e(this, "renditionId", void 0), e(this, "anchorCts", void 0), e(this, "hasBFramesValue", !1), e(this, "isAwaitingAssessment", !1), e(this, "zeroOffsetSamples", 0), e(this, "omittedBoundaryCrossings", 0), e(this, "hasSeenKeyframe", !1), e(this, "hasObservedReordering", !1), e(this, "rememberedRenditions", new St(t.MAX_REMEMBERED_RENDITIONS));
11521
11511
  }
@@ -11551,7 +11541,7 @@ var BS = class t {
11551
11541
  this.channelId = void 0, this.renditionId = void 0, this.anchorCts = void 0, this.hasBFramesValue = !1, this.zeroOffsetSamples = 0, this.omittedBoundaryCrossings = 0, this.hasSeenKeyframe = !1, this.hasObservedReordering = !1, this.isAwaitingAssessment = !0;
11552
11542
  }
11553
11543
  remember(e) {
11554
- this.channelId !== void 0 && this.rememberedRenditions.set(Sx(this.channelId, this.renditionId), e);
11544
+ this.channelId !== void 0 && this.rememberedRenditions.set(xx(this.channelId, this.renditionId), e);
11555
11545
  }
11556
11546
  latchBFrames() {
11557
11547
  this.hasBFramesValue = !0, this.hasObservedReordering = !0, this.isAwaitingAssessment = !1, this.remember(!0);
@@ -11563,17 +11553,17 @@ var BS = class t {
11563
11553
  this.hasSeenKeyframe && !this.hasObservedReordering && (this.remember(!1), this.hasBFramesValue = !1), this.hasSeenKeyframe = !0, this.omittedBoundaryCrossings = 0;
11564
11554
  }
11565
11555
  resetOnSwitch(e, t) {
11566
- if (!Cx(e, t, this.channelId, this.renditionId)) {
11556
+ if (!Sx(e, t, this.channelId, this.renditionId)) {
11567
11557
  let n = this.channelId !== void 0;
11568
11558
  this.channelId = e, this.renditionId = t, this.anchorCts = void 0, this.zeroOffsetSamples = 0, this.omittedBoundaryCrossings = 0, this.hasSeenKeyframe = !1, this.hasObservedReordering = !1;
11569
- let r = this.rememberedRenditions.get(Sx(e, t));
11559
+ let r = this.rememberedRenditions.get(xx(e, t));
11570
11560
  this.hasBFramesValue = r != null && r, n && (this.isAwaitingAssessment = r === void 0);
11571
11561
  }
11572
11562
  }
11573
11563
  };
11574
- e(BS, "MAX_REMEMBERED_RENDITIONS", 32);
11564
+ e(zS, "MAX_REMEMBERED_RENDITIONS", 32);
11575
11565
  // ../../libs/web-sdk/src/modules/SyncModule.ts
11576
- var VS, HS = 5e3, US = .5, WS = 3e3, GS = () => Ae() || De(), KS = (e) => e && GS() ? 100 : 0, qS = (e) => (t) => t > e, JS = 100, YS = 1e3, XS = 1e3, ZS = 1e3, QS = 100, $S = 50, eC = {
11566
+ var BS, VS = 5e3, HS = .5, US = 3e3, WS = () => Ae() || De(), GS = (e) => e && WS() ? 100 : 0, KS = (e) => (t) => t > e, qS = 100, JS = 1e3, YS = 1e3, XS = 1e3, ZS = 100, QS = 50, $S = {
11577
11567
  seek: {
11578
11568
  toleranceMs: 200,
11579
11569
  toleranceMaxMs: 2500,
@@ -11605,7 +11595,7 @@ var VS, HS = 5e3, US = .5, WS = 3e3, GS = () => Ae() || De(), KS = (e) => e && G
11605
11595
  decayCooldownMultiplier: 3,
11606
11596
  decayCheckInterval: 15e3
11607
11597
  }
11608
- }, tC = class {
11598
+ }, eC = class {
11609
11599
  get driftSamplesToCollect() {
11610
11600
  return this._driftSamplesToCollect;
11611
11601
  }
@@ -11613,8 +11603,8 @@ var VS, HS = 5e3, US = .5, WS = 3e3, GS = () => Ae() || De(), KS = (e) => e && G
11613
11603
  this._driftSamplesToCollect = e, this.driftSamples = new S(e);
11614
11604
  }
11615
11605
  constructor(t, n, r, i, a, o = !0) {
11616
- e(this, "emitter", void 0), e(this, "logger", void 0), e(this, "playbackSource", void 0), e(this, "bufferSource", void 0), e(this, "keyframeTimestamps", new S(10)), e(this, "lastSeekTime", void 0), e(this, "timeshiftDeferralStartedAt", void 0), e(this, "needsMediaSourceRecovery", !1), e(this, "lastAdjustmentTime", performance.now()), e(this, "lastDecayCheckTime", performance.now()), e(this, "syncInterval", void 0), e(this, "currentSyncIntervalMs", JS), e(this, "config", void 0), e(this, "state", void 0), e(this, "allowTimeshiftOnAudio", !1), e(this, "syncInfoToleranceMaxMs", 150), e(this, "syncInfoToleranceStep", 20), e(this, "seekOvershoot", void 0), e(this, "timers", j.create()), e(this, "rtt", 0), e(this, "channelSyncInfo", /* @__PURE__ */ new Map()), e(this, "seekAdjustmentCount", 0), e(this, "timeshiftAdjustmentCount", 0), e(this, "syncInfoCorrectionCount", 0), e(this, "playbackRateAdjustmentCount", 0), e(this, "lastPlaybackRateChangeTime", 0), e(this, "seekAdjustmentTimestamps", []), e(this, "timeshiftAdjustmentTimestamps", []), e(this, "_driftSamplesToCollect", 5), e(this, "driftSamples", new S(this._driftSamplesToCollect)), e(this, "timestampOffset", void 0), e(this, "hasObservedBFrames", !1), e(this, "bFrameDetector", new BS()), e(this, "currentChannelId", void 0), e(this, "highestSeenTimestamps", /* @__PURE__ */ new Map()), e(this, "isSuspended", !1), e(this, "isSyncAdjustmentActivated", !1), e(this, "queuedTimeshift", !1), e(this, "playbackState", void 0), e(this, "hasPerformedRecoverySeekInCurrentRecoveryState", !1), e(this, "shouldSeekAfterBuffering", !1), e(this, "shouldSeekWhileStuck", !1), e(this, "hasPerformedStuckSeekInCurrentStillness", !1), e(this, "positionSetBySeek", void 0), e(this, "lastPlayheadPosition", void 0), e(this, "lastPlayheadProgressAt", performance.now()), e(this, "usesMse", void 0), e(this, "load", () => {
11617
- this.emitter.on("page active", this.onPageActive), this.emitter.on("pageshow", this.onPageShow), this.setSyncInterval(document.visibilityState === "hidden" ? YS : JS);
11606
+ e(this, "emitter", void 0), e(this, "logger", void 0), e(this, "playbackSource", void 0), e(this, "bufferSource", void 0), e(this, "keyframeTimestamps", new S(10)), e(this, "lastSeekTime", void 0), e(this, "timeshiftDeferralStartedAt", void 0), e(this, "needsMediaSourceRecovery", !1), e(this, "lastAdjustmentTime", performance.now()), e(this, "lastDecayCheckTime", performance.now()), e(this, "syncInterval", void 0), e(this, "currentSyncIntervalMs", qS), e(this, "config", void 0), e(this, "state", void 0), e(this, "allowTimeshiftOnAudio", !1), e(this, "syncInfoToleranceMaxMs", 150), e(this, "syncInfoToleranceStep", 20), e(this, "seekOvershoot", void 0), e(this, "timers", j.create()), e(this, "rtt", 0), e(this, "channelSyncInfo", /* @__PURE__ */ new Map()), e(this, "seekAdjustmentCount", 0), e(this, "timeshiftAdjustmentCount", 0), e(this, "syncInfoCorrectionCount", 0), e(this, "playbackRateAdjustmentCount", 0), e(this, "lastPlaybackRateChangeTime", 0), e(this, "seekAdjustmentTimestamps", []), e(this, "timeshiftAdjustmentTimestamps", []), e(this, "_driftSamplesToCollect", 5), e(this, "driftSamples", new S(this._driftSamplesToCollect)), e(this, "timestampOffset", void 0), e(this, "hasObservedBFrames", !1), e(this, "bFrameDetector", new zS()), e(this, "currentChannelId", void 0), e(this, "highestSeenTimestamps", /* @__PURE__ */ new Map()), e(this, "isSuspended", !1), e(this, "isSyncAdjustmentActivated", !1), e(this, "queuedTimeshift", !1), e(this, "playbackState", void 0), e(this, "hasPerformedRecoverySeekInCurrentRecoveryState", !1), e(this, "shouldSeekAfterBuffering", !1), e(this, "shouldSeekWhileStuck", !1), e(this, "hasPerformedStuckSeekInCurrentStillness", !1), e(this, "positionSetBySeek", void 0), e(this, "lastPlayheadPosition", void 0), e(this, "lastPlayheadProgressAt", performance.now()), e(this, "usesMse", void 0), e(this, "load", () => {
11607
+ this.emitter.on("page active", this.onPageActive), this.emitter.on("pageshow", this.onPageShow), this.setSyncInterval(document.visibilityState === "hidden" ? JS : qS);
11618
11608
  }), e(this, "unload", () => {
11619
11609
  this.logger.debug("Unloading module..."), this.emitter.off("rtt", this.updateRtt), this.emitter.off("playback state", this.onPlaybackState), this.emitter.off("page active", this.onPageActive), this.emitter.off("pageshow", this.onPageShow), this.emitter.off("buffers flushed", this.clearBFrameLatch), this.emitter.off("recovered from media error", this.onMediaSourceRecovered), this.clearSyncInterval(), this.timers.unload(), this.logger.debug("Unloaded module");
11620
11610
  }), e(this, "suspend", () => {
@@ -11656,7 +11646,7 @@ var VS, HS = 5e3, US = .5, WS = 3e3, GS = () => Ae() || De(), KS = (e) => e && G
11656
11646
  }), e(this, "processSample", (e) => {
11657
11647
  var t;
11658
11648
  if (!e.channelId) throw Error("Sample must be assigned to a channel");
11659
- this.currentChannelId || (this.currentChannelId = e.channelId), this.timestampOffset || (this.timestampOffset = e.timestamp / e.timescale * 1e3 - HS);
11649
+ this.currentChannelId || (this.currentChannelId = e.channelId), this.timestampOffset || (this.timestampOffset = e.timestamp / e.timescale * 1e3 - VS);
11660
11650
  let n = e.type === "video" && e.isSync;
11661
11651
  if (this.bFrameDetector.update(e), this.latchBFramesIfDetected(), this.currentChannelId !== e.channelId) {
11662
11652
  let t = 2 ** 53 - 1;
@@ -11673,7 +11663,7 @@ var VS, HS = 5e3, US = .5, WS = 3e3, GS = () => Ae() || De(), KS = (e) => e && G
11673
11663
  this.currentChannelId || (this.currentChannelId = e);
11674
11664
  let i = t.mediaType();
11675
11665
  if (!i) throw Error("Fragment must have a media type");
11676
- this.timestampOffset || (this.timestampOffset = t.baseMediaDecodeTime() / t.timescale() * 1e3 - HS);
11666
+ this.timestampOffset || (this.timestampOffset = t.baseMediaDecodeTime() / t.timescale() * 1e3 - VS);
11677
11667
  let a = i === "video" && t.startsWithKeyframe();
11678
11668
  if (i === "video" && (this.bFrameDetector.updateFromFragment({
11679
11669
  type: i,
@@ -11798,7 +11788,7 @@ var VS, HS = 5e3, US = .5, WS = 3e3, GS = () => Ae() || De(), KS = (e) => e && G
11798
11788
  this.timeshiftDeferralStartedAt = void 0;
11799
11789
  return;
11800
11790
  }
11801
- let i = performance.now() - this.config.seek.timeoutMs * this.state.timeshiftToleranceMultiplier, a = this.timeshiftAdjustmentTimestamps.filter(qS(i)).length;
11791
+ let i = performance.now() - this.config.seek.timeoutMs * this.state.timeshiftToleranceMultiplier, a = this.timeshiftAdjustmentTimestamps.filter(KS(i)).length;
11802
11792
  if (a && this.state.timeshiftToleranceMultiplier > 2) this.logger.debug("Too many timeshifts within sliding window", {
11803
11793
  timeshiftCooldownThreshold: i,
11804
11794
  recentTimeshiftCount: a
@@ -11807,12 +11797,12 @@ var VS, HS = 5e3, US = .5, WS = 3e3, GS = () => Ae() || De(), KS = (e) => e && G
11807
11797
  if (e) {
11808
11798
  var o, s;
11809
11799
  let e = this.playbackSource.currentTime, t = (o = (s = this.bufferSource).getBufferedEndAt) == null ? void 0 : o.call(s, e), n = Math.max(0, (t == null ? e : t) - e);
11810
- if (n - r < this.bufferSource.getTargetBufferTime() * US) {
11800
+ if (n - r < this.bufferSource.getTargetBufferTime() * HS) {
11811
11801
  let e = performance.now();
11812
11802
  if (this.timeshiftDeferralStartedAt === void 0 && (this.timeshiftDeferralStartedAt = e, this.logger.debug("Deferring timeshift while buffered ahead is thin", {
11813
11803
  drift: r,
11814
11804
  bufferedAhead: n
11815
- })), e - this.timeshiftDeferralStartedAt < WS) return;
11805
+ })), e - this.timeshiftDeferralStartedAt < US) return;
11816
11806
  }
11817
11807
  this.timeshiftDeferralStartedAt !== void 0 && this.logger.debug("Releasing timeshift deferral", { deferredMs: performance.now() - this.timeshiftDeferralStartedAt });
11818
11808
  }
@@ -11833,20 +11823,20 @@ var VS, HS = 5e3, US = .5, WS = 3e3, GS = () => Ae() || De(), KS = (e) => e && G
11833
11823
  let n = (e = (t = this.bufferSource).getNextBufferedRangeStart) == null ? void 0 : e.call(t, this.playbackSource.currentTime);
11834
11824
  return this.shouldSeekAfterBuffering = n !== void 0, n;
11835
11825
  }), e(this, "observePlayheadProgress", () => {
11836
- let e = this.playbackSource.currentTime, t = e !== this.lastPlayheadPosition, n = t && (this.positionSetBySeek === void 0 || e - this.positionSetBySeek > $S);
11826
+ let e = this.playbackSource.currentTime, t = e !== this.lastPlayheadPosition, n = t && (this.positionSetBySeek === void 0 || e - this.positionSetBySeek > QS);
11837
11827
  this.positionSetBySeek = void 0, (n || this.playbackSource.isPaused) && (this.hasPerformedStuckSeekInCurrentStillness = !1), (t || this.playbackSource.isPaused || this.isSeeking()) && (this.lastPlayheadPosition = e, this.lastPlayheadProgressAt = performance.now());
11838
11828
  }), e(this, "isPlayheadStuckInBuffer", () => {
11839
11829
  var e, t;
11840
- if (performance.now() - this.lastPlayheadProgressAt < XS) return !1;
11830
+ if (performance.now() - this.lastPlayheadProgressAt < YS) return !1;
11841
11831
  let n = this.playbackSource.currentTime, r = (e = (t = this.bufferSource).getBufferedEndAt) == null ? void 0 : e.call(t, n);
11842
- return r !== void 0 && r - n >= ZS;
11832
+ return r !== void 0 && r - n >= XS;
11843
11833
  }), e(this, "getRecoverySeekReason", () => {
11844
11834
  if (this.needsMediaSourceRecovery) return "media source reopen";
11845
11835
  if (this.shouldSeekWhileStuck) return "stuck in buffer";
11846
11836
  if (this.shouldSeekAfterBuffering) return "buffering";
11847
11837
  }), e(this, "shouldSkipNormalSeek", (e) => e < 0 && -e < this.currentAheadToleranceMs() || e > 0 && e < this.currentSeekToleranceMs() || Math.abs(e) < 1 || !this.isAllowedToSync()), e(this, "shouldDeferRecoverySeek", (e, t) => t !== void 0 && t > e), e(this, "buildStuckInBufferSeekPlan", () => {
11848
11838
  var e, t;
11849
- let n = this.playbackSource.currentTime, r = (e = (t = this.bufferSource).getBufferedEndAt) == null ? void 0 : e.call(t, n), i = n + Math.max(this.seekOvershoot, QS);
11839
+ let n = this.playbackSource.currentTime, r = (e = (t = this.bufferSource).getBufferedEndAt) == null ? void 0 : e.call(t, n), i = n + Math.max(this.seekOvershoot, ZS);
11850
11840
  if (r === void 0 || i >= r) return;
11851
11841
  let a = this.findKeyframeCloseToTimestamp(i);
11852
11842
  return {
@@ -11927,7 +11917,7 @@ var VS, HS = 5e3, US = .5, WS = 3e3, GS = () => Ae() || De(), KS = (e) => e && G
11927
11917
  if (r && (this.isSeeking() || !this.currentChannelId || this.isSuspended || this.playbackSource.isPaused) || (this.driftSamples.push(t), ht(this.driftSamples.items()) < this.currentTimeshiftToleranceMs() && (this.timeshiftDeferralStartedAt = void 0), !this.isSeekCooldownExpired()) || !r && this.driftSamples.items().length < this.driftSamplesToCollect && Math.abs(t) < 2e3) return;
11928
11918
  let i = r ? t : ht(this.driftSamples.items());
11929
11919
  if (!r && this.tryPlaybackRateSync(i) || !r && this.shouldSkipNormalSeek(i)) return;
11930
- let a = performance.now() - this.config.seek.timeoutMs * this.state.seekToleranceMultiplier, o = this.seekAdjustmentTimestamps.filter(qS(a)).length, s = this.currentEmergencySeekToleranceMs(), c = i > 0 && i >= s;
11920
+ let a = performance.now() - this.config.seek.timeoutMs * this.state.seekToleranceMultiplier, o = this.seekAdjustmentTimestamps.filter(KS(a)).length, s = this.currentEmergencySeekToleranceMs(), c = i > 0 && i >= s;
11931
11921
  o && this.state.seekToleranceMultiplier > 2 && !r && !c ? this.logger.debug("Too many seek adjustments within sliding window", {
11932
11922
  seekCooldownThreshold: a,
11933
11923
  recentSeekCount: o
@@ -11945,9 +11935,9 @@ var VS, HS = 5e3, US = .5, WS = 3e3, GS = () => Ae() || De(), KS = (e) => e && G
11945
11935
  let t = this.playbackState === "buffering";
11946
11936
  this.playbackState = e, e === "buffering" ? (t || (this.hasPerformedRecoverySeekInCurrentRecoveryState = !1), (this.refreshRecoverySeekState() !== void 0 || this.shouldSeekWhileStuck) && this.onSync()) : (this.hasPerformedRecoverySeekInCurrentRecoveryState = !1, this.hasPerformedStuckSeekInCurrentStillness = !1, this.clearRecoverySeekFlags());
11947
11937
  }), e(this, "onPageActive", (e) => {
11948
- this.setSyncInterval(e ? JS : YS), e && this.onSync();
11938
+ this.setSyncInterval(e ? qS : JS), e && this.onSync();
11949
11939
  }), e(this, "onPageShow", (e) => {
11950
- e.persisted && (this.setSyncInterval(document.visibilityState === "hidden" ? YS : JS), this.onSync());
11940
+ e.persisted && (this.setSyncInterval(document.visibilityState === "hidden" ? JS : qS), this.onSync());
11951
11941
  }), e(this, "setSyncInterval", (e) => {
11952
11942
  (this.syncInterval === void 0 || this.currentSyncIntervalMs !== e) && (this.clearSyncInterval(), this.currentSyncIntervalMs = e, this.syncInterval = this.timers.setInterval(this.onSync, e));
11953
11943
  }), e(this, "clearSyncInterval", () => {
@@ -11958,11 +11948,11 @@ var VS, HS = 5e3, US = .5, WS = 3e3, GS = () => Ae() || De(), KS = (e) => e && G
11958
11948
  let t = n >= e - this.config.seek.keyframeSearchBeforeMs, r = n <= e + this.config.seek.keyframeSearchAfterMs;
11959
11949
  if (t && r) return n;
11960
11950
  }
11961
- }), this.logger = n, this.emitter = t, this.playbackSource = r, this.bufferSource = i, this.usesMse = o, this.seekOvershoot = KS(o), this.config = {
11962
- seek: p({}, eC.seek),
11963
- timeshift: p({}, eC.timeshift),
11964
- playbackRate: p({}, eC.playbackRate),
11965
- backoff: p({}, eC.backoff)
11951
+ }), this.logger = n, this.emitter = t, this.playbackSource = r, this.bufferSource = i, this.usesMse = o, this.seekOvershoot = GS(o), this.config = {
11952
+ seek: p({}, $S.seek),
11953
+ timeshift: p({}, $S.timeshift),
11954
+ playbackRate: p({}, $S.playbackRate),
11955
+ backoff: p({}, $S.backoff)
11966
11956
  }, this.config.timeshift.enabled = a, o || (this.config.seek.toleranceMs = 50, this.config.timeshift.toleranceMs = 20, this.config.seek.aheadToleranceMs = 40), this.state = {
11967
11957
  seekToleranceMultiplier: 1,
11968
11958
  timeshiftToleranceMultiplier: 1
@@ -12020,9 +12010,9 @@ var VS, HS = 5e3, US = .5, WS = 3e3, GS = () => Ae() || De(), KS = (e) => e && G
12020
12010
  return this.serverCurrentTime - this.playbackSource.currentTime;
12021
12011
  }
12022
12012
  };
12023
- VS = tC, e(tC, "create", (e, t, n, r, i, a = !0) => new VS(e, t, n, r, i, a));
12013
+ BS = eC, e(eC, "create", (e, t, n, r, i, a = !0) => new BS(e, t, n, r, i, a));
12024
12014
  // ../../libs/web-sdk/src/modules/TelemetryModule.ts
12025
- var nC, rC = {
12015
+ var tC, nC = {
12026
12016
  enabled: !0,
12027
12017
  interval: 3e4,
12028
12018
  includeErrors: !0,
@@ -12031,11 +12021,11 @@ var nC, rC = {
12031
12021
  maxRetries: 10,
12032
12022
  maxErrorReports: 50,
12033
12023
  maxEvents: 50
12034
- }, iC = (e, t) => p(p({}, t), {}, {
12024
+ }, rC = (e, t) => p(p({}, t), {}, {
12035
12025
  type: e,
12036
12026
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
12037
12027
  discriminator: "web"
12038
- }), aC = class {
12028
+ }), iC = class {
12039
12029
  constructor(n, r, i, a) {
12040
12030
  var o = this;
12041
12031
  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 S(100)), e(this, "retries", 0), e(this, "errorCount", 0), e(this, "eventCount", 0), e(this, "statsCount", 0), e(this, "unload", () => {
@@ -12052,7 +12042,7 @@ var nC, rC = {
12052
12042
  initiator: "interval"
12053
12043
  }, n = {}) => {
12054
12044
  if (!this.options.includeStats) return;
12055
- let r = this.parentContext.getStatistics(), i = iC("stats", p(p(p({}, n), r), {}, {
12045
+ let r = this.parentContext.getStatistics(), i = rC("stats", p(p(p({}, n), r), {}, {
12056
12046
  isFinal: e,
12057
12047
  initiator: t,
12058
12048
  count: this.statsCount++
@@ -12060,7 +12050,7 @@ var nC, rC = {
12060
12050
  this.unsentLines.push(i);
12061
12051
  }), e(this, "addEvent", (e) => {
12062
12052
  if (!this.options.includeEvents || this.eventCount > this.options.maxEvents) return;
12063
- let t = this.parentContext.getStatistics(), n = iC("event", p(p({}, t), e));
12053
+ let t = this.parentContext.getStatistics(), n = rC("event", p(p({}, t), e));
12064
12054
  this.eventCount++, this.unsentLines.push(n);
12065
12055
  }), e(this, "getStatistics", () => ({ errorCount: this.errorCount })), e(this, "send", function() {
12066
12056
  var e = t(function* (e) {
@@ -12103,13 +12093,13 @@ var nC, rC = {
12103
12093
  let { includeErrors: t, maxErrorReports: n } = this.options;
12104
12094
  if (!(e instanceof M) || e.code() === "channel_not_live" || !t || (this.errorCount++, this.errorCount > n)) return;
12105
12095
  let r = this.parentContext.getStatistics();
12106
- this.unsentLines.push(iC("error", p(p({}, r), e.toStringifiable())));
12107
- }), this.logger = n, this.emitter = r, this.options = p(p({}, rC), i), this.parentContext = a;
12096
+ this.unsentLines.push(rC("error", p(p({}, r), e.toStringifiable())));
12097
+ }), this.logger = n, this.emitter = r, this.options = p(p({}, nC), i), this.parentContext = a;
12108
12098
  }
12109
12099
  };
12110
- nC = aC, e(aC, "create", (e, t, n, r) => new nC(e, t, n, r));
12100
+ tC = iC, e(iC, "create", (e, t, n, r) => new tC(e, t, n, r));
12111
12101
  // ../../libs/web-sdk/src/modules/UnpauseModule.ts
12112
- var oC, sC = class {
12102
+ var aC, oC = class {
12113
12103
  constructor(t, n, r) {
12114
12104
  e(this, "logger", void 0), e(this, "elements", void 0), e(this, "documentState", void 0), e(this, "timers", new j()), e(this, "unload", () => {
12115
12105
  this.timers.unload();
@@ -12118,9 +12108,9 @@ var oC, sC = class {
12118
12108
  }), this.logger = t, this.elements = n, this.documentState = r, this.timers.setInterval(this.unpause, 100);
12119
12109
  }
12120
12110
  };
12121
- oC = sC, e(sC, "create", (e, t, n) => new oC(e, t, n));
12111
+ aC = oC, e(oC, "create", (e, t, n) => new aC(e, t, n));
12122
12112
  // ../../libs/web-sdk/src/OptionsProvider.ts
12123
- var cC = [
12113
+ var sC = [
12124
12114
  "minBufferTime",
12125
12115
  "maxBufferTime",
12126
12116
  "burstEnabled",
@@ -12129,10 +12119,10 @@ var cC = [
12129
12119
  "offscreenCanvasEnabled",
12130
12120
  "videoCodecs"
12131
12121
  ];
12132
- function lC(e) {
12133
- return cC.includes(e);
12122
+ function cC(e) {
12123
+ return sC.includes(e);
12134
12124
  }
12135
- var uC = class {
12125
+ var lC = class {
12136
12126
  constructor(t) {
12137
12127
  e(this, "options", void 0), e(this, "overrides", /* @__PURE__ */ new Map()), this.options = t;
12138
12128
  }
@@ -12146,7 +12136,7 @@ var uC = class {
12146
12136
  this.options[e] = t;
12147
12137
  }
12148
12138
  get(e, t) {
12149
- if (t && lC(e)) {
12139
+ if (t && cC(e)) {
12150
12140
  var n;
12151
12141
  let r = (n = this.overrides.get(t)) == null ? void 0 : n[e];
12152
12142
  if (r !== void 0) return r;
@@ -12157,7 +12147,7 @@ var uC = class {
12157
12147
  var n;
12158
12148
  return (n = this.overrides.get(t)) == null ? void 0 : n[e];
12159
12149
  }
12160
- }, dC = 6, fC = (e) => {
12150
+ }, uC = 6, dC = (e) => {
12161
12151
  let t = [e], n = 0, r = 0, i = !1, a = (e, t) => {
12162
12152
  var i, a;
12163
12153
  if (e.flags && Gs(e.flags)) {
@@ -12169,7 +12159,7 @@ var uC = class {
12169
12159
  return u > 0 && (r = u), p(p({}, e), {}, { duration: u > 0 ? u : r });
12170
12160
  };
12171
12161
  return (e, n = !1) => {
12172
- if (e.flags && Gs(e.flags) && n && (i = !i), !(n && t.length < dC && i) && t.length > 0) {
12162
+ if (e.flags && Gs(e.flags) && n && (i = !i), !(n && t.length < uC && i) && t.length > 0) {
12173
12163
  i = !1;
12174
12164
  let n = e;
12175
12165
  for (let e = t.length - 1; e > 0; e--) {
@@ -12182,13 +12172,13 @@ var uC = class {
12182
12172
  }
12183
12173
  return t.push(e), [];
12184
12174
  };
12185
- }, pC = ["mse", "wasm"], mC = (e) => e == null ? pC : e, hC = (e) => {
12175
+ }, fC = ["mse", "wasm"], pC = (e) => e == null ? fC : e, mC = (e) => {
12186
12176
  if (!e) return !1;
12187
12177
  let t = e.headers && Object.keys(e.headers).length > 0, n = e.queryParams && Object.keys(e.queryParams).length > 0;
12188
12178
  return !!(t || n);
12189
- }, gC = (e, t, n) => {
12190
- if (hC(n)) return "mse";
12191
- let r = mC(e);
12179
+ }, hC = (e, t, n) => {
12180
+ if (mC(n)) return "mse";
12181
+ let r = pC(e);
12192
12182
  for (let e of r) switch (e) {
12193
12183
  case "mse":
12194
12184
  if (t) return "mse";
@@ -12199,7 +12189,7 @@ var uC = class {
12199
12189
  case "wasm": return "wasm";
12200
12190
  }
12201
12191
  return "wasm";
12202
- }, _C = (e, t, n) => {
12192
+ }, gC = (e, t, n) => {
12203
12193
  if (cn(t)) return p(p({}, e), {}, {
12204
12194
  type: "video",
12205
12195
  codec: t.codec,
@@ -12220,12 +12210,12 @@ var uC = class {
12220
12210
  data: e.payload,
12221
12211
  duration: 0
12222
12212
  });
12223
- }, vC = ({ average: e, last: t, max: n, min: r }) => ({
12213
+ }, _C = ({ average: e, last: t, max: n, min: r }) => ({
12224
12214
  average: Math.round(e),
12225
12215
  last: Math.round(t),
12226
12216
  max: Math.round(n),
12227
12217
  min: Math.round(r)
12228
- }), yC = [
12218
+ }), vC = [
12229
12219
  "timeSpentBuffering",
12230
12220
  "timePerBufferingEvent",
12231
12221
  "drift",
@@ -12237,24 +12227,24 @@ var uC = class {
12237
12227
  "videoKeyframeIntervalMs",
12238
12228
  "timeToConnected",
12239
12229
  "mediaSourceOpenTime"
12240
- ], bC = [
12230
+ ], yC = [
12241
12231
  "videoDecodeTime",
12242
12232
  "audioDecodeTime",
12243
12233
  "videoTransportTime",
12244
12234
  "rtt"
12245
- ], xC = (e) => typeof e == "object" && !!e && "min" in e && "max" in e && "average" in e && "last" in e, SC = (e) => {
12235
+ ], bC = (e) => typeof e == "object" && !!e && "min" in e && "max" in e && "average" in e && "last" in e, xC = (e) => {
12246
12236
  let t = p({}, e);
12247
- for (let e of yC) {
12237
+ for (let e of vC) {
12248
12238
  let n = t[e];
12249
12239
  typeof n == "number" && (t[e] = Math.round(n));
12250
12240
  }
12251
- for (let e of bC) {
12241
+ for (let e of yC) {
12252
12242
  let n = t[e];
12253
- xC(n) && (t[e] = vC(n));
12243
+ bC(n) && (t[e] = _C(n));
12254
12244
  }
12255
12245
  return t;
12256
- }, CC = (e, t) => e && typeof e == "object" && t in e, wC = (e) => !(typeof e != "object" || !CC(e, "channelId") || typeof e.channelId != "string" || !CC(e, "url") || typeof e.url != "string" || e.channelId.length === 0 || e.url.length === 0), TC = (e) => {
12257
- if (!wC(e)) throw new M("Invalid options", {
12246
+ }, SC = (e, t) => e && typeof e == "object" && t in e, CC = (e) => !(typeof e != "object" || !SC(e, "channelId") || typeof e.channelId != "string" || !SC(e, "url") || typeof e.url != "string" || e.channelId.length === 0 || e.url.length === 0), wC = (e) => {
12247
+ if (!CC(e)) throw new M("Invalid options", {
12258
12248
  isFatal: !0,
12259
12249
  code: "invalid_options"
12260
12250
  });
@@ -12263,20 +12253,20 @@ var uC = class {
12263
12253
  let n = t;
12264
12254
  n[e] === void 0 && delete n[e];
12265
12255
  }), t;
12266
- }, EC = (e) => {
12256
+ }, TC = (e) => {
12267
12257
  if (typeof e != "object" || !e) throw Error("not an object");
12268
12258
  if (!("video" in e)) throw Error("missing video in subscription");
12269
12259
  if (!("audio" in e)) throw Error("missing audio in subscription");
12270
12260
  if (!("channelId" in e)) throw Error("missing channelId");
12271
12261
  return !0;
12272
- }, DC = (e) => {
12262
+ }, EC = (e) => {
12273
12263
  switch (e) {
12274
12264
  case "opus": return "opus";
12275
12265
  case "aac": return "mp4a.40.2";
12276
12266
  case "mp3": return "mp3";
12277
12267
  default: throw Error(`Unsupported audio codec: ${e}`);
12278
12268
  }
12279
- }, OC = class {
12269
+ }, DC = class {
12280
12270
  constructor(n) {
12281
12271
  var r = this;
12282
12272
  e(this, "logger", void 0), e(this, "cache", /* @__PURE__ */ new Map()), e(this, "inFlight", /* @__PURE__ */ new Map()), e(this, "checkVideoSupport", function() {
@@ -12307,7 +12297,7 @@ var uC = class {
12307
12297
  if (typeof AudioDecoder > "u") return !1;
12308
12298
  let n = AudioDecoder.isConfigSupported;
12309
12299
  if (typeof n != "function") return !0;
12310
- let i = (t = e.codecString) == null ? DC(e.codec) : t, a = `audio|${i}|${e.sampleRate}|${e.channels}`, o = e.codec === "aac" ? Ai(e.channels, e.sampleRate) : e.codec === "opus" ? Ws(e.channels, e.sampleRate) : void 0;
12300
+ let i = (t = e.codecString) == null ? EC(e.codec) : t, a = `audio|${i}|${e.sampleRate}|${e.channels}`, o = e.codec === "aac" ? Ai(e.channels, e.sampleRate) : e.codec === "opus" ? Ws(e.channels, e.sampleRate) : void 0;
12311
12301
  return r.check(a, () => n({
12312
12302
  codec: i,
12313
12303
  sampleRate: e.sampleRate,
@@ -12337,7 +12327,7 @@ var uC = class {
12337
12327
  return this.inFlight.set(e, o), o;
12338
12328
  }), this.logger = n;
12339
12329
  }
12340
- }, kC = 1e4, AC = 300, jC = 3e3, MC = 1e4, NC = 250, PC = 921600, FC = /* @__PURE__ */ new WeakMap(), IC = /* @__PURE__ */ new WeakMap(), LC = /* @__PURE__ */ new WeakMap(), RC = /* @__PURE__ */ new WeakMap(), zC = class r extends s {
12330
+ }, OC = 1e4, kC = 300, AC = 3e3, jC = 1e4, MC = 250, NC = 921600, PC = /* @__PURE__ */ new WeakMap(), FC = /* @__PURE__ */ new WeakMap(), IC = /* @__PURE__ */ new WeakMap(), LC = /* @__PURE__ */ new WeakMap(), RC = class r extends s {
12341
12331
  handleListenerError(e, t) {
12342
12332
  let n = Object.assign(/* @__PURE__ */ Error(`Listener for "${String(t)}" threw`), { cause: e });
12343
12333
  setTimeout(() => {
@@ -12346,7 +12336,7 @@ var uC = class {
12346
12336
  }
12347
12337
  constructor(o) {
12348
12338
  var l, u, f;
12349
- super(), l = this, e(this, "pictureInPicture", void 0), e(this, "drm", void 0), e(this, "browser", He()), e(this, "options", void 0), e(this, "element", void 0), e(this, "playbackSource", void 0), e(this, "emitter", new s()), e(this, "logger", void 0), e(this, "modules", void 0), e(this, "clientIp", void 0), e(this, "sessionId", void 0), e(this, "clientId", an()), e(this, "_channels", []), e(this, "createdAt", performance.now()), e(this, "offscreenCanvasElement", void 0), e(this, "webCodecsRenditionSupport", void 0), e(this, "hasCalledConnect", !1), e(this, "shortBurstRejoin", !1), e(this, "upgradeHeld", !1), e(this, "hasRequestedAudioSession", !1), e(this, "isUserPaused", !1), e(this, "isMediaElementPaused", !1), e(this, "latestEmittedLanguages", []), e(this, "wakeLock", void 0), e(this, "pool", new y(r.MAX_POOL_SIZE)), e(this, "userAgentInformation", new rn()), e(this, "encryptedMediaExtensions", void 0), c(this, FC, 0), c(this, IC, []), e(this, "sampleProcessingSesssions", /* @__PURE__ */ new Map()), e(this, "unbackedSamplesWarned", new wx()), e(this, "unextractableSamplesWarned", new wx()), e(this, "sizes", /* @__PURE__ */ new Map()), e(this, "isSuspended", !0), e(this, "inactivityDisconnectInterval", void 0), e(this, "visiblePauseTimeout", void 0), e(this, "offscreenSubtitleInterval", void 0), c(this, LC, void 0), c(this, RC, void 0), e(this, "attach", (e) => {
12339
+ super(), l = this, e(this, "pictureInPicture", void 0), e(this, "drm", void 0), e(this, "browser", He()), e(this, "options", void 0), e(this, "element", void 0), e(this, "playbackSource", void 0), e(this, "emitter", new s()), e(this, "logger", void 0), e(this, "modules", void 0), e(this, "clientIp", void 0), e(this, "sessionId", void 0), e(this, "clientId", an()), e(this, "_channels", []), e(this, "createdAt", performance.now()), e(this, "offscreenCanvasElement", void 0), e(this, "webCodecsRenditionSupport", void 0), e(this, "hasCalledConnect", !1), e(this, "shortBurstRejoin", !1), e(this, "upgradeHeld", !1), e(this, "hasRequestedAudioSession", !1), e(this, "isUserPaused", !1), e(this, "isMediaElementPaused", !1), e(this, "latestEmittedLanguages", []), e(this, "wakeLock", void 0), e(this, "pool", new y(r.MAX_POOL_SIZE)), e(this, "userAgentInformation", new rn()), e(this, "encryptedMediaExtensions", void 0), c(this, PC, 0), c(this, FC, []), e(this, "sampleProcessingSesssions", /* @__PURE__ */ new Map()), e(this, "unbackedSamplesWarned", new Cx()), e(this, "unextractableSamplesWarned", new Cx()), e(this, "sizes", /* @__PURE__ */ new Map()), e(this, "isSuspended", !0), e(this, "inactivityDisconnectInterval", void 0), e(this, "visiblePauseTimeout", void 0), e(this, "offscreenSubtitleInterval", void 0), c(this, IC, void 0), c(this, LC, void 0), e(this, "attach", (e) => {
12350
12340
  var t;
12351
12341
  (t = this.wakeLock) == null || t.attach(e), e.appendChild(this.element);
12352
12342
  }), e(this, "setElement", (e) => {
@@ -12438,7 +12428,7 @@ var uC = class {
12438
12428
  video: p(p({}, t.video), n.video),
12439
12429
  audio: p(p({}, t.audio), n.audio)
12440
12430
  })), n.audio && this.modules.subscription.setAudioBitRate(n.audio.bitRate), !0);
12441
- }), e(this, "joinBurstMs", (e) => this.options.get("burstEnabled", this.channelId) ? !this.shortBurstRejoin && this.burstFits(e) ? this.targetBufferTime : Math.min(NC, this.targetBufferTime) : 0), e(this, "onPingTimeout", () => {
12431
+ }), e(this, "joinBurstMs", (e) => this.options.get("burstEnabled", this.channelId) ? !this.shortBurstRejoin && this.burstFits(e) ? this.targetBufferTime : Math.min(MC, this.targetBufferTime) : 0), e(this, "onPingTimeout", () => {
12442
12432
  this.shortBurstRejoin = !0, this.lowerTargetForRejoin() && this.emitter.emit("adapted level");
12443
12433
  }), e(this, "emitLanguagesIfChanged", () => {
12444
12434
  let e = this.modules.renditions.getLanguages(), t = this.latestEmittedLanguages;
@@ -12446,20 +12436,20 @@ var uC = class {
12446
12436
  }), e(this, "updateTextTracks", (e) => {
12447
12437
  let t = e.filter((e) => e.codec === "webvtt");
12448
12438
  t.forEach((e) => {
12449
- if (!i(IC, this).find((t) => t.language === e.language)) {
12439
+ if (!i(FC, this).find((t) => t.language === e.language)) {
12450
12440
  if (this.modules.canvasModule) {
12451
12441
  let t = this.modules.canvasModule.textTracks.addTextTrack(e.kind, e.label || e.language || "", e.language || "");
12452
- i(IC, this).push(t);
12442
+ i(FC, this).push(t);
12453
12443
  } else if (this.mediaElement instanceof HTMLVideoElement) {
12454
12444
  let t = this.mediaElement.addTextTrack(e.kind, e.label || e.language, e.language);
12455
- i(IC, this).push(t);
12445
+ i(FC, this).push(t);
12456
12446
  }
12457
12447
  }
12458
12448
  });
12459
- for (let e of i(IC, this)) t.find((t) => t.language === e.language) ? e.mode === "disabled" && (e.mode = "hidden") : e.mode = "disabled";
12449
+ for (let e of i(FC, this)) t.find((t) => t.language === e.language) ? e.mode === "disabled" && (e.mode = "hidden") : e.mode = "disabled";
12460
12450
  this.emit("text tracks", this.textTracks);
12461
12451
  }), e(this, "cleanupTextTracks", (e = this.currentTime - 2e4) => {
12462
- i(IC, this).forEach((t) => {
12452
+ i(FC, this).forEach((t) => {
12463
12453
  if (t.cues) for (let n of Array.from(t.cues)) n.endTime * 1e3 < e - 2e3 && t.removeCue(n);
12464
12454
  });
12465
12455
  }), e(this, "filterRenditions", function() {
@@ -12528,7 +12518,7 @@ var uC = class {
12528
12518
  var e;
12529
12519
  let t = this.modules.connection.linkQueue;
12530
12520
  if (!t) return !1;
12531
- let n = Math.max(this.targetBufferTime, jC), r = t.peak(n), i = performance.now() - ((e = this.modules.connection.lastConnectionTime) == null ? performance.now() : e), a = r === void 0 ? i < MC : !(r < AC);
12521
+ let n = Math.max(this.targetBufferTime, AC), r = t.peak(n), i = performance.now() - ((e = this.modules.connection.lastConnectionTime) == null ? performance.now() : e), a = r === void 0 ? i < jC : !(r < kC);
12532
12522
  return a && !this.upgradeHeld && this.logger.debug("Holding the upgrade while the link queues", {
12533
12523
  linkQueuePeakMs: r === void 0 ? void 0 : Math.round(r),
12534
12524
  windowMs: n
@@ -12633,8 +12623,8 @@ var uC = class {
12633
12623
  u = void 0, d = void 0, l.logger.warn("Failed to enable OffscreenCanvas; falling back to main thread rendering", { error: e });
12634
12624
  }
12635
12625
  else o && l.logger.warn("OffscreenCanvas requested but not supported; falling back to main thread rendering");
12636
- let f = l.capturesCanvasOnWebKit(u), p = yield Fx.create(l.emitter, l.logger.createContext("DecoderModule"), l.options.get("logLevel"), n, l.playbackSource, l.pool, i, a, u, f), { videoRenderer: m } = p.getStatistics(), h = l.modules.canvasModule;
12637
- if (h instanceof iS) {
12626
+ let f = l.capturesCanvasOnWebKit(u), p = yield Px.create(l.emitter, l.logger.createContext("DecoderModule"), l.options.get("logLevel"), n, l.playbackSource, l.pool, i, a, u, f), { videoRenderer: m } = p.getStatistics(), h = l.modules.canvasModule;
12627
+ if (h instanceof rS) {
12638
12628
  if (m === "OffscreenCanvas" && d) {
12639
12629
  h.setVideoRenderingEnabled(!1);
12640
12630
  let e = l.element;
@@ -12647,11 +12637,11 @@ var uC = class {
12647
12637
  t.parentElement && t.parentElement.replaceChild(e, t), l.setElement(e);
12648
12638
  }
12649
12639
  }
12650
- } else h instanceof dS && (h.setBackgroundPlaybackEnabled(l.isBackgroundPlayEnabled(l.channelId)), m === "OffscreenCanvas" && d ? (h.setOffscreenCanvas(d), l.offscreenCanvasElement = d, f && l.connectWebKitVideoOutput(p, h)) : (h.setVideoTrack(void 0), h.setOffscreenCanvas(void 0), l.offscreenCanvasElement = void 0));
12640
+ } else h instanceof uS && (h.setBackgroundPlaybackEnabled(l.isBackgroundPlayEnabled(l.channelId)), m === "OffscreenCanvas" && d ? (h.setOffscreenCanvas(d), l.offscreenCanvasElement = d, f && l.connectWebKitVideoOutput(p, h)) : (h.setVideoTrack(void 0), h.setOffscreenCanvas(void 0), l.offscreenCanvasElement = void 0));
12651
12641
  (e = l.modules.decoder) == null || e.unload(), l.modules.decoder = p, l.isHiddenWithBackgroundPlayback() && l.modules.decoder.enableBackgroundTimers(), l.modules.decoder.setVideoRenderingEnabled(l.isVideoOnScreen()), l.modules.decoder.load(), l.setupOffscreenSubtitleRouting();
12652
- })), e(this, "capturesCanvasOnWebKit", (e) => !!e && this.browser.platform.isWebKit && this.modules.canvasModule instanceof dS), e(this, "connectWebKitVideoOutput", (e, t) => {
12642
+ })), e(this, "capturesCanvasOnWebKit", (e) => !!e && this.browser.platform.isWebKit && this.modules.canvasModule instanceof uS), e(this, "connectWebKitVideoOutput", (e, t) => {
12653
12643
  let n = () => {
12654
- t.setVideoTrack(void 0), this.browser.platform.isIOS && e.setMaxVideoCanvasPixels(PC);
12644
+ t.setVideoTrack(void 0), this.browser.platform.isIOS && e.setMaxVideoCanvasPixels(NC);
12655
12645
  };
12656
12646
  e.onVideoTrackLost((e) => {
12657
12647
  this.logger.warn("Worker video track lost, falling back to canvas capture", { error: e }), n();
@@ -12659,7 +12649,7 @@ var uC = class {
12659
12649
  let r = e.videoTrack;
12660
12650
  r ? t.setVideoTrack(r) : n();
12661
12651
  }), e(this, "setupOffscreenSubtitleRouting", () => {
12662
- if (this.offscreenSubtitleInterval !== void 0 && (clearInterval(this.offscreenSubtitleInterval), this.offscreenSubtitleInterval = void 0), !this.offscreenCanvasElement || !this.modules.decoder || this.modules.canvasModule instanceof dS) return;
12652
+ if (this.offscreenSubtitleInterval !== void 0 && (clearInterval(this.offscreenSubtitleInterval), this.offscreenSubtitleInterval = void 0), !this.offscreenCanvasElement || !this.modules.decoder || this.modules.canvasModule instanceof uS) return;
12663
12653
  let e = this.modules.decoder, t = this.modules.canvasModule;
12664
12654
  if (!t) return;
12665
12655
  let n = !1;
@@ -12697,7 +12687,7 @@ var uC = class {
12697
12687
  this.clearVisiblePauseDisconnect(), this.isUserPaused = !1, this.requestAudioSessionOnce(), this.hasCalledConnect ? this.unsuspend() : this.playbackState !== "playing" && (this._connect(), self.addEventListener("__vindral_register_debug__", this.registerDebugInstance), this.modules.timer.setInterval(() => this.cleanupTextTracks(), r.REMOVE_CUE_THRESHOLD)), (e = this.wakeLock) == null || e.enable(), this.playbackState === "paused" && this.playbackSource.isActivated && (this.resetModules(), this.emitter.emit("flush buffers"), this.cleanupTextTracks(2 ** 53 - 1)), this.playbackSource.play(), this.isHiddenWithBackgroundPlayback() && this.scheduleInactivityDisconnect();
12698
12688
  }), e(this, "getStatistics", () => {
12699
12689
  let e = Object.values(this.modules).reduce((e, t) => t && "getStatistics" in t ? p(p({}, e), t.getStatistics()) : e, this.getRuntimeInfo()), t = Math.round(this.timeActive > 0 ? (e.bytesReceived || 0) * 8 / (this.timeActive / 1e3) : 0), n = this.uptime / 36e5, r = Math.max(0, (e.connectCount || 0) - 1), i = n > 0 ? r / n : 0, a = this.timeActive / 6e4, o = Math.max(a, 1), s = a > 0 ? (e.seekAdjustmentCount || 0) / o : 0, c = a > 0 ? (e.timeshiftAdjustmentCount || 0) / o : 0;
12700
- return SC(p(p({}, e), {}, {
12690
+ return xC(p(p({}, e), {}, {
12701
12691
  averageBitRate: t,
12702
12692
  reconnectsPerHour: i,
12703
12693
  seekAdjustmentsPerMinute: s,
@@ -12706,7 +12696,7 @@ var uC = class {
12706
12696
  }), e(this, "resetModules", () => {
12707
12697
  Object.values(this.modules).forEach((e) => {
12708
12698
  e && "reset" in e && e.reset();
12709
- }), this.playbackSource instanceof yc && this.modules.adaptivity.holdReconnect(kC), this.sampleProcessingSesssions.clear(), this.cleanupTextTracks(Infinity), this.playbackSource.currentTime = 0, this.playbackSource.isActivated = !1;
12699
+ }), this.playbackSource instanceof yc && this.modules.adaptivity.holdReconnect(OC), this.sampleProcessingSesssions.clear(), this.cleanupTextTracks(Infinity), this.playbackSource.currentTime = 0, this.playbackSource.isActivated = !1;
12710
12700
  }), e(this, "disconnectForInactivePage", (e) => {
12711
12701
  if (this.clearInactivityDisconnect(), this.emitter.emit("flush buffers"), !this.isBackgroundPlayEnabled(this.channelId)) {
12712
12702
  var t;
@@ -12733,10 +12723,10 @@ var uC = class {
12733
12723
  e && "unsuspend" in e && e.unsuspend();
12734
12724
  });
12735
12725
  }), e(this, "getRuntimeInfo", () => {
12736
- let e = this.modules.canvasModule instanceof dS || void 0;
12726
+ let e = this.modules.canvasModule instanceof uS || void 0;
12737
12727
  return p({
12738
12728
  uptime: this.uptime,
12739
- version: "4.8.2-27-ge01b9d3a",
12729
+ version: "4.8.2-29-g2c54a2bf",
12740
12730
  clientId: this.clientId,
12741
12731
  sessionId: this.sessionId,
12742
12732
  channelId: this.channelId,
@@ -12783,7 +12773,7 @@ var uC = class {
12783
12773
  if (this.browser.platform.isWebKit || !this.browser.isMobile) return !1;
12784
12774
  let t = (e = this.modules) == null ? void 0 : e.decoder;
12785
12775
  return t ? t.audioWebCodecsInUse : this.isWebCodecsAudioAvailable(this.channelId);
12786
- }), this.options = new uC(p(p({}, nr), TC(o))), o.telemetryEnabled === void 0 && ["localhost", "127.0.0.1"].includes(location.hostname) && this.options.set("telemetryEnabled", !1);
12776
+ }), this.options = new lC(p(p({}, nr), wC(o))), o.telemetryEnabled === void 0 && ["localhost", "127.0.0.1"].includes(location.hostname) && this.options.set("telemetryEnabled", !1);
12787
12777
  let m = {
12788
12778
  channelId: this.options.get("channelId"),
12789
12779
  audio: {
@@ -12796,14 +12786,14 @@ var uC = class {
12796
12786
  height: this.options.get("maxSize").height
12797
12787
  }
12798
12788
  }, h = a.get();
12799
- h.setLevel(this.options.get("logLevel")), h.setDebug(!1), this.logger = h, this.webCodecsRenditionSupport = new OC(h), o.iosMediaElementEnabled !== void 0 && this.logger.warn("Option iosMediaElementEnabled is deprecated and will be removed in a future release. Use streamToMediaElementEnabled instead.");
12789
+ h.setLevel(this.options.get("logLevel")), h.setDebug(!1), this.logger = h, this.webCodecsRenditionSupport = new DC(h), o.iosMediaElementEnabled !== void 0 && this.logger.warn("Option iosMediaElementEnabled is deprecated and will be removed in a future release. Use streamToMediaElementEnabled instead.");
12800
12790
  let g = (u = o.streamToMediaElementEnabled) == null ? o.iosMediaElementEnabled : u;
12801
12791
  g !== void 0 && (this.options.set("streamToMediaElementEnabled", g), this.options.set("iosMediaElementEnabled", g)), o.iosBackgroundPlayEnabled !== void 0 && this.logger.warn("Option iosBackgroundPlayEnabled is deprecated and will be removed in a future release. Use backgroundPlayEnabled instead.");
12802
12792
  let _ = (f = o.backgroundPlayEnabled) == null ? o.iosBackgroundPlayEnabled : f;
12803
12793
  _ !== void 0 && (this.options.set("backgroundPlayEnabled", _), this.options.set("iosBackgroundPlayEnabled", _));
12804
12794
  let v = o.mseEnabled !== void 0, b = o.decoders !== void 0;
12805
12795
  v && this.logger.warn("Option mseEnabled is deprecated and will be removed in a future release. Use decoders instead (e.g. decoders: [\"wasm\"])."), v && !b && o.mseEnabled === !1 && this.options.set("decoders", ["wasm"]);
12806
- let x = DS.create(this.emitter, this.logger.createContext("PictureInPictureModule")), S = this.options.get("mediaSessionEnabled") ? lS.create(this.emitter, this.logger.createContext("MediaSessionModule"), {
12796
+ let x = ES.create(this.emitter, this.logger.createContext("PictureInPictureModule")), S = this.options.get("mediaSessionEnabled") ? cS.create(this.emitter, this.logger.createContext("MediaSessionModule"), {
12807
12797
  metadata: this.options.get("mediaSessionMetadata"),
12808
12798
  decoy: this.willUseMediaSource() || this.usesSplitCanvasAudio() ? void 0 : Hc.create(this.logger.createContext("AudioFocusDecoy"), this.yieldToInterruption),
12809
12799
  isMuted: () => this.playbackSource.userMuted,
@@ -12814,12 +12804,12 @@ var uC = class {
12814
12804
  holdDecoyWhilePaused: this.holdsDecoyWhilePaused(),
12815
12805
  keepDecoyWhenMuted: this.isWebKitCanvasPath(),
12816
12806
  pauseMeansMute: !this.options.get("pauseSupportEnabled")
12817
- }) : void 0, C = j.create(), te = Lx.create(this.emitter), ne = gx.create(this.emitter, this.logger.createContext("ConnectionModule"), {
12807
+ }) : void 0, C = j.create(), te = Ix.create(this.emitter), ne = hx.create(this.emitter, this.logger.createContext("ConnectionModule"), {
12818
12808
  reconnectHandler: this.options.get("reconnectHandler"),
12819
12809
  options: this.options,
12820
12810
  onConnectInfo: this.onConnectInfo,
12821
12811
  documentState: te
12822
- }), w = qv.create(this.logger.createContext("SubscriptionModule"), this.emitter, m), T = zS.create(this.emitter, w), re = kS.create(this.emitter, this.logger.createContext("PlaybackModule"), this, this.options.get("minBufferTime")), ie = LS.create(this.emitter, this.logger.createContext("QualityOfServiceModule"), T, re);
12812
+ }), w = Kv.create(this.logger.createContext("SubscriptionModule"), this.emitter, m), T = RS.create(this.emitter, w), re = OS.create(this.emitter, this.logger.createContext("PlaybackModule"), this, this.options.get("minBufferTime")), ie = IS.create(this.emitter, this.logger.createContext("QualityOfServiceModule"), T, re);
12823
12813
  this.encryptedMediaExtensions = new bi(this.emitter, this.logger.createContext("EncryptedMediaExtensions"), o.drm), this.drm = {
12824
12814
  setHeaders: (e) => {
12825
12815
  this.encryptedMediaExtensions.headers = e;
@@ -12838,9 +12828,9 @@ var uC = class {
12838
12828
  logger: this.logger.createContext("MediaElement"),
12839
12829
  poster: ae
12840
12830
  });
12841
- e.on("buffer state", (e) => this.onMediaElementBufferState(e, oe)), e.on("needs user input", (e) => this.emitter.emit("needs user input", e)), e.on("volume state", (e) => this.emitter.emit("volume state", e)), e.on("media element state", (e) => this.onMediaElementState(e)), this.element = e.element, this.playbackSource = e, bi.isSupported() && this.encryptedMediaExtensions.attach(e.element), oe = gS.create(this.logger.createContext("MseModule"), this.emitter, this.element), this.options.get("pauseSupportEnabled") || (se = sC.create(this.logger.createContext("UnpauseModule"), [e], te)), this.options.get("pictureInPictureEnabled") && this.emitter.emit("add picture in picture listener", { element: e.element });
12831
+ e.on("buffer state", (e) => this.onMediaElementBufferState(e, oe)), e.on("needs user input", (e) => this.emitter.emit("needs user input", e)), e.on("volume state", (e) => this.emitter.emit("volume state", e)), e.on("media element state", (e) => this.onMediaElementState(e)), this.element = e.element, this.playbackSource = e, bi.isSupported() && this.encryptedMediaExtensions.attach(e.element), oe = hS.create(this.logger.createContext("MseModule"), this.emitter, this.element), this.options.get("pauseSupportEnabled") || (se = oC.create(this.logger.createContext("UnpauseModule"), [e], te)), this.options.get("pictureInPictureEnabled") && this.emitter.emit("add picture in picture listener", { element: e.element });
12842
12832
  } else if (this.streamsToMediaElement()) {
12843
- let e = dS.create(this.emitter, this.logger.createContext("ModernCanvasModule"), this.pool, this, {
12833
+ let e = uS.create(this.emitter, this.logger.createContext("ModernCanvasModule"), this.pool, this, {
12844
12834
  type: this.options.get("media") === "audio" ? "audio" : "video",
12845
12835
  muted: this.options.get("muted") || this.options.get("media") === "video",
12846
12836
  volume: this.options.get("volume"),
@@ -12852,10 +12842,10 @@ var uC = class {
12852
12842
  }), t = e.element();
12853
12843
  this.element = t.element, this.playbackSource = e, ce = e;
12854
12844
  let n = this.browser.platform.isIOS && this.browser.platform.iosVersion <= 15;
12855
- this.options.get("pictureInPictureEnabled") && !n && this.emitter.emit("add picture in picture listener", { element: this.element }), this.options.get("pauseSupportEnabled") || (se = sC.create(this.logger.createContext("UnpauseModule"), e.elements(), te));
12845
+ this.options.get("pictureInPictureEnabled") && !n && this.emitter.emit("add picture in picture listener", { element: this.element }), this.options.get("pauseSupportEnabled") || (se = oC.create(this.logger.createContext("UnpauseModule"), e.elements(), te));
12856
12846
  } else {
12857
12847
  let e;
12858
- e = iS.create(this.emitter, this.logger.createContext("LegacyCanvasModule"), this.pool, this, this.options.get("muted") || this.options.get("media") === "video", this.options.get("volume"), () => {
12848
+ e = rS.create(this.emitter, this.logger.createContext("LegacyCanvasModule"), this.pool, this, this.options.get("muted") || this.options.get("media") === "video", this.options.get("volume"), () => {
12859
12849
  this.setElement(e.element());
12860
12850
  }, this.options.get("minBufferTime")), this.element = e.element(), this.playbackSource = e, ce = e, this.options.get("iosWakeLockEnabled") && (this.wakeLock = new oc());
12861
12851
  }
@@ -12873,7 +12863,7 @@ var uC = class {
12873
12863
  getTargetBufferTime: () => re.getTargetBufferTime(),
12874
12864
  getNextBufferedRangeStart: oe ? (e) => oe.getNextBufferedRangeStart(e) : void 0,
12875
12865
  getBufferedEndAt: oe ? (e) => oe.getBufferedEndAt(e) : void 0
12876
- }, de = tC.create(this.emitter, this.logger.createContext("SyncModule"), this.playbackSource, D, ue, le), fe = Ux.create(this.logger.createContext("JitterModule")), pe = Tc.create(this.emitter), me = (this.options.get("edgeUrl") || this.options.get("url")).replace("wss://", "https://").replace("ws://", "http://").replace("//lb.", "//errors."), he = new URL("/telemetry", me).toString(), O = aC.create(this.logger.createContext("TelemetryModule"), this.emitter, {
12866
+ }, de = eC.create(this.emitter, this.logger.createContext("SyncModule"), this.playbackSource, D, ue, le), fe = Hx.create(this.logger.createContext("JitterModule")), pe = Tc.create(this.emitter), me = (this.options.get("edgeUrl") || this.options.get("url")).replace("wss://", "https://").replace("ws://", "http://").replace("//lb.", "//errors."), he = new URL("/telemetry", me).toString(), O = iC.create(this.logger.createContext("TelemetryModule"), this.emitter, {
12877
12867
  url: he,
12878
12868
  enabled: this.options.get("telemetryEnabled"),
12879
12869
  includeStats: !1,
@@ -12887,8 +12877,8 @@ var uC = class {
12887
12877
  }),
12888
12878
  incomingData: pe,
12889
12879
  adaptivity: Ic.create(this.emitter, this.logger.createContext("AdaptivityModule"), ie, pe, { cooldownTime: Math.max(this.options.get("minBufferTime"), 2e3) }),
12890
- constraintCap: xx.create(this.emitter, this.element, T, this.options.get("abrEnabled") ? this.options.get("sizeBasedResolutionCapEnabled") : !1),
12891
- event: Bx.create(this.emitter, this.logger.createContext("EventModule"), de),
12880
+ constraintCap: bx.create(this.emitter, this.element, T, this.options.get("abrEnabled") ? this.options.get("sizeBasedResolutionCapEnabled") : !1),
12881
+ event: zx.create(this.emitter, this.logger.createContext("EventModule"), de),
12892
12882
  sync: de,
12893
12883
  jitter: fe,
12894
12884
  documentState: te,
@@ -12957,7 +12947,7 @@ var uC = class {
12957
12947
  let r = ((t = (n = e.telemetry) == null ? void 0 : n.probability) == null ? 1 : t) >= Math.random();
12958
12948
  if (e.telemetry) {
12959
12949
  var i;
12960
- (i = this.modules.telemetry) == null || i.unload(), this.modules.telemetry = aC.create(this.logger.createContext("TelemetryModule"), this.emitter, p(p({}, e.telemetry), {}, { enabled: this.options.get("telemetryEnabled") && r }), this), this.modules.telemetry.load();
12950
+ (i = this.modules.telemetry) == null || i.unload(), this.modules.telemetry = iC.create(this.logger.createContext("TelemetryModule"), this.emitter, p(p({}, e.telemetry), {}, { enabled: this.options.get("telemetryEnabled") && r }), this), this.modules.telemetry.load();
12961
12951
  }
12962
12952
  }), this.emitter.on("adapt level", (e) => {
12963
12953
  let t = this.modules.renditions.getRenditionLevels(), n = this.modules.renditions.getRenditionLevel(), r = t.findIndex((e) => e === n), i = t.length - 1, a = r;
@@ -13000,8 +12990,8 @@ var uC = class {
13000
12990
  audio: p(p({}, this.targetSubscription.audio), f == null ? void 0 : f.audio)
13001
12991
  })), this.emitter.emit("adapted level");
13002
12992
  }), this.emitter.on("ping timeout", this.onPingTimeout), this.emitter.on("text track data", (e) => {
13003
- let t = i(IC, this).find((t) => t.language === e.language), r = this.modules.sync.getTimeshiftOffset() / 1e3, a = r - i(FC, this);
13004
- if (n(FC, this, r), t) {
12993
+ let t = i(FC, this).find((t) => t.language === e.language), r = this.modules.sync.getTimeshiftOffset() / 1e3, a = r - i(PC, this);
12994
+ if (n(PC, this, r), t) {
13005
12995
  if (t.cues) for (let e of t.cues) e.startTime -= a, e.endTime -= a;
13006
12996
  for (let n of e.cues) {
13007
12997
  let e = new VTTCue(n.startTime - r, n.endTime - r, n.text);
@@ -13019,7 +13009,7 @@ var uC = class {
13019
13009
  case "renditions": {
13020
13010
  var o;
13021
13011
  this.updateTextTracks(t.renditions);
13022
- let e = r.channelId, s = JSON.stringify(t.renditions), c = ((o = i(LC, this)) == null ? void 0 : o.sessionId) === a ? i(LC, this) : void 0, l = i(RC, this);
13012
+ let e = r.channelId, s = JSON.stringify(t.renditions), c = ((o = i(IC, this)) == null ? void 0 : o.sessionId) === a ? i(IC, this) : void 0, l = i(LC, this);
13023
13013
  if (!c && l && l.sessionId === a && l.channelId === e && l.table === s) {
13024
13014
  this.emit("rendition levels", this.modules.renditions.getRenditionLevels());
13025
13015
  break;
@@ -13028,16 +13018,16 @@ var uC = class {
13028
13018
  a === this.sessionId && ("error" in t ? this.logger.warn("Failed to filter renditions, keeping the current ones", { error: t.error }) : (this.emitter.emit("renditions", {
13029
13019
  renditions: t.renditions,
13030
13020
  channelId: e
13031
- }), n(RC, this, t.allProbesAnswered ? {
13021
+ }), n(LC, this, t.allProbesAnswered ? {
13032
13022
  sessionId: a,
13033
13023
  channelId: e,
13034
13024
  table: s
13035
13025
  } : void 0), this.emit("rendition levels", this.modules.renditions.getRenditionLevels()), this.emitLanguagesIfChanged()));
13036
13026
  }).finally(() => {
13037
13027
  var e;
13038
- ((e = i(LC, this)) == null ? void 0 : e.promise) === u && n(LC, this, void 0);
13028
+ ((e = i(IC, this)) == null ? void 0 : e.promise) === u && n(IC, this, void 0);
13039
13029
  });
13040
- n(LC, this, {
13030
+ n(IC, this, {
13041
13031
  sessionId: a,
13042
13032
  promise: u
13043
13033
  });
@@ -13046,7 +13036,7 @@ var uC = class {
13046
13036
  case "subscription changed":
13047
13037
  var s;
13048
13038
  try {
13049
- EC(t.subscription);
13039
+ TC(t.subscription);
13050
13040
  } catch (e) {
13051
13041
  this.emitter.emit("error", new M("Subscription failed validation", {
13052
13042
  source: e instanceof Error ? e : void 0,
@@ -13166,7 +13156,7 @@ var uC = class {
13166
13156
  _e && this.attach(_e), this.logger.info("Created Vindral instance", { options: this.options });
13167
13157
  let ve = function() {
13168
13158
  var e = t(function* (e) {
13169
- let t = e.channelId, r = l.sessionId, a = i(LC, l);
13159
+ let t = e.channelId, r = l.sessionId, a = i(IC, l);
13170
13160
  if (a && a.sessionId === r && (yield a.promise, r !== l.sessionId)) return;
13171
13161
  let o = l.modules.renditions.getRendition(e.renditionId, t);
13172
13162
  if (!qs(e.flags)) {
@@ -13181,8 +13171,8 @@ var uC = class {
13181
13171
  } catch (e) {
13182
13172
  l.logger.warn("failed to parse WebVTT segment, dropping it", e);
13183
13173
  }
13184
- let o = r / 1e3, s = i(IC, l).find((t) => t.language === e.language), c = o - i(FC, l);
13185
- if (n(FC, l, o), s) {
13174
+ let o = r / 1e3, s = i(FC, l).find((t) => t.language === e.language), c = o - i(PC, l);
13175
+ if (n(PC, l, o), s) {
13186
13176
  if (s.cues) for (let e of s.cues) e.startTime -= c, e.endTime -= c;
13187
13177
  for (let e of a) {
13188
13178
  let t = new VTTCue(e.startTime - o, e.endTime - o, e.text);
@@ -13218,10 +13208,10 @@ var uC = class {
13218
13208
  mimeType: a
13219
13209
  }), l.emit("initialized media");
13220
13210
  } else {
13221
- let t = _C(e, o, l.sizes.get(e.renditionId));
13211
+ let t = gC(e, o, l.sizes.get(e.renditionId));
13222
13212
  l.modules.jitter.recordSample(t);
13223
13213
  let r = l.sampleProcessingSesssions.get(n);
13224
- if (!r) r = fC(l.modules.sync.processSample(t)), l.sampleProcessingSesssions.set(n, r);
13214
+ if (!r) r = dC(l.modules.sync.processSample(t)), l.sampleProcessingSesssions.set(n, r);
13225
13215
  else {
13226
13216
  let e = l.willUseMediaSource() && l.isSwitchingRenditionLevel && t.type === "video", n = r(l.modules.sync.processSample(t), e), i = t;
13227
13217
  n.forEach((e) => {
@@ -13324,7 +13314,7 @@ var uC = class {
13324
13314
  e !== void 0 && t.length > 0 && !t.includes(e) ? this.logger.warn(`Language "${e}" is not available. Available languages: ${t.join(", ")}`) : (this.modules.subscription.setLanguage(e), this.modules.qualityOfService.restartStallClock(), this.alignSizeAndBitRate(this.targetSubscription));
13325
13315
  }
13326
13316
  set textTrack(e) {
13327
- e !== this.textTrack && (i(IC, this).forEach((t) => {
13317
+ e !== this.textTrack && (i(FC, this).forEach((t) => {
13328
13318
  if (t.label === e) t.mode = "showing";
13329
13319
  else {
13330
13320
  if (t.mode === "showing" && t.cues) for (let e of [...t.cues]) t.removeCue(e);
@@ -13333,11 +13323,11 @@ var uC = class {
13333
13323
  }), this.emitter.emit("text track", e));
13334
13324
  }
13335
13325
  get textTracks() {
13336
- return i(IC, this).filter((e) => e.mode !== "disabled").map((e) => e.label);
13326
+ return i(FC, this).filter((e) => e.mode !== "disabled").map((e) => e.label);
13337
13327
  }
13338
13328
  get textTrack() {
13339
13329
  var e;
13340
- return (e = i(IC, this).find((e) => e.mode === "showing")) == null ? void 0 : e.label;
13330
+ return (e = i(FC, this).find((e) => e.mode === "showing")) == null ? void 0 : e.label;
13341
13331
  }
13342
13332
  get channelId() {
13343
13333
  var e, t;
@@ -13469,7 +13459,7 @@ var uC = class {
13469
13459
  return this.modules.subscription.getTargetSubscription();
13470
13460
  }
13471
13461
  resolvedDecoder(e) {
13472
- return gC(this.options.get("decoders", e), this.browser.supportsMediaSource, this.options.get("drm"));
13462
+ return hC(this.options.get("decoders", e), this.browser.supportsMediaSource, this.options.get("drm"));
13473
13463
  }
13474
13464
  usesSplitCanvasAudio() {
13475
13465
  return !this.willUseMediaSource() && this.options.get("streamToMediaElementEnabled") && dt(this.browser) && this.options.get("media") !== "audio" && this.options.get("media") !== "video" && this.browser.platform.isIOS;
@@ -13509,5 +13499,5 @@ var uC = class {
13509
13499
  return this.hasCalledConnect && this.isBackgroundPlayEnabled(e) && !this.isUserPaused;
13510
13500
  }
13511
13501
  };
13512
- e(zC, "MAX_POOL_SIZE", 10), e(zC, "REMOVE_CUE_THRESHOLD", 1e4), e(zC, "BACKGROUND_INACTIVITY_DISCONNECT_TIMEOUT", 15e3), e(zC, "VISIBLE_PAUSE_DISCONNECT_DELAY", 1e3);
13513
- export { ot as A, Je as C, st as D, lt as E, b as F, Ie as M, Fe as N, at as O, S as P, it as S, tt as T, k as _, jn as a, Ye as b, vn as c, mn as d, Tn as f, Wt as g, M as h, Ai as i, ut as j, nt as k, yn as l, bn as m, DC as n, _n as o, xn as p, Ws as r, gn as s, zC as t, hn as u, Xe as v, Ze as w, Qe as x, $e as y };
13502
+ e(RC, "MAX_POOL_SIZE", 10), e(RC, "REMOVE_CUE_THRESHOLD", 1e4), e(RC, "BACKGROUND_INACTIVITY_DISCONNECT_TIMEOUT", 15e3), e(RC, "VISIBLE_PAUSE_DISCONNECT_DELAY", 1e3);
13503
+ export { ot as A, Je as C, st as D, lt as E, b as F, Ie as M, Fe as N, at as O, S as P, it as S, tt as T, k as _, jn as a, Ye as b, vn as c, mn as d, Tn as f, Wt as g, M as h, Ai as i, ut as j, nt as k, yn as l, bn as m, EC as n, _n as o, xn as p, Ws as r, gn as s, RC as t, hn as u, Xe as v, Ze as w, Qe as x, $e as y };