@vindral/web-sdk 4.1.2-4-gb79bb2ad → 4.1.2-5-g17cd929a

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/legacy.es.js CHANGED
@@ -21,10 +21,10 @@ var an = (i, A) => {
21
21
  A.indexOf(e) < 0 && nn.call(i, e) && (t[e] = i[e]);
22
22
  return t;
23
23
  };
24
- var Ge = (i) => {
24
+ var ke = (i) => {
25
25
  var A;
26
26
  return [, , , dr((A = i == null ? void 0 : i[ht("metadata")]) != null ? A : null)];
27
- }, En = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], Bg = (i) => i !== void 0 && typeof i != "function" ? bt("Function expected") : i, Dr = (i, A, t, e, g) => ({ kind: En[i], name: A, metadata: e, addInitializer: (B) => t._ ? bt("Already initialized") : g.push(Bg(B || null)) }), zt = (i, A) => aB(A, ht("metadata"), i[3]), ke = (i, A, t, e) => {
27
+ }, En = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"], Bg = (i) => i !== void 0 && typeof i != "function" ? bt("Function expected") : i, Dr = (i, A, t, e, g) => ({ kind: En[i], name: A, metadata: e, addInitializer: (B) => t._ ? bt("Already initialized") : g.push(Bg(B || null)) }), $t = (i, A) => aB(A, ht("metadata"), i[3]), Re = (i, A, t, e) => {
28
28
  for (var g = 0, B = i[A >> 1], C = B && B.length; g < C; g++) A & 1 ? B[g].call(t) : e = B[g].call(t, e);
29
29
  return e;
30
30
  }, FA = (i, A, t, e, g, B) => {
@@ -36,7 +36,7 @@ var Ge = (i) => {
36
36
  h ? u && h < 4 && Qn(B, (h > 2 ? "set " : h > 1 ? "get " : "") + t) : Qn(g, t);
37
37
  for (var U = e.length - 1; U >= 0; U--)
38
38
  a = Dr(h, t, o = {}, i[3], L), h && (a.static = l, a.private = u, c = a.access = { has: u ? (F) => Sr(g, F) : (F) => t in F }, h ^ 3 && (c.get = u ? (F) => (h ^ 1 ? s : d)(F, g, h ^ 4 ? B : y.get) : (F) => F[t]), h > 2 && (c.set = u ? (F, J) => E(F, g, J, h ^ 4 ? B : y.set) : (F, J) => F[t] = J)), Q = (0, e[U])(h ? h < 4 ? u ? B : y[p] : h > 4 ? void 0 : { get: y.get, set: y.set } : g, a), o._ = 1, h ^ 4 || Q === void 0 ? Bg(Q) && (h > 4 ? G.unshift(Q) : h ? u ? B = Q : y[p] = Q : g = Q) : typeof Q != "object" || Q === null ? bt("Object expected") : (Bg(C = Q.get) && (y.get = C), Bg(C = Q.set) && (y.set = C), Bg(C = Q.init) && G.unshift(C));
39
- return h || zt(i, g), y && aQ(g, t, y), u ? h ^ 4 ? B : y : g;
39
+ return h || $t(i, g), y && aQ(g, t, y), u ? h ^ 4 ? B : y : g;
40
40
  }, I = (i, A, t) => aB(i, typeof A != "symbol" ? A + "" : A, t), rQ = (i, A, t) => A.has(i) || bt("Cannot " + t), Sr = (i, A) => Object(A) !== A ? bt('Cannot use the "in" operator on this value') : i.has(A), s = (i, A, t) => (rQ(i, A, "read from private field"), t ? t.call(i) : A.get(i)), n = (i, A, t) => A.has(i) ? bt("Cannot add the same private member more than once") : A instanceof WeakSet ? A.add(i) : A.set(i, t), E = (i, A, t, e) => (rQ(i, A, "write to private field"), e ? e.call(i, t) : A.set(i, t), t), d = (i, A, t) => (rQ(i, A, "access private method"), t);
41
41
  var At = (i, A, t, e) => ({
42
42
  set _(g) {
@@ -429,13 +429,13 @@ const Po = () => {
429
429
  e = e * 256 + i[g];
430
430
  return e;
431
431
  };
432
- var BA, Mt, ie;
432
+ var BA, Mt, ge;
433
433
  class $I {
434
434
  constructor(A) {
435
435
  n(this, BA);
436
436
  n(this, Mt);
437
- n(this, ie);
438
- E(this, Mt, A), E(this, ie, new DataView(A.buffer, A.byteOffset, A.byteLength)), E(this, BA, 0);
437
+ n(this, ge);
438
+ E(this, Mt, A), E(this, ge, new DataView(A.buffer, A.byteOffset, A.byteLength)), E(this, BA, 0);
439
439
  }
440
440
  position() {
441
441
  return s(this, BA);
@@ -450,19 +450,19 @@ class $I {
450
450
  return s(this, Mt).length - s(this, BA);
451
451
  }
452
452
  readUint8() {
453
- const A = s(this, ie).getUint8(s(this, BA));
453
+ const A = s(this, ge).getUint8(s(this, BA));
454
454
  return E(this, BA, s(this, BA) + 1), A;
455
455
  }
456
456
  readUint24() {
457
- const A = s(this, ie).getUint32(s(this, BA)) >> 8 & 16777215;
457
+ const A = s(this, ge).getUint32(s(this, BA)) >> 8 & 16777215;
458
458
  return E(this, BA, s(this, BA) + 3), A;
459
459
  }
460
460
  readUint16() {
461
- const A = s(this, ie).getUint16(s(this, BA));
461
+ const A = s(this, ge).getUint16(s(this, BA));
462
462
  return E(this, BA, s(this, BA) + 2), A;
463
463
  }
464
464
  readUint32() {
465
- const A = s(this, ie).getUint32(s(this, BA));
465
+ const A = s(this, ge).getUint32(s(this, BA));
466
466
  return E(this, BA, s(this, BA) + 4), A;
467
467
  }
468
468
  readUint64() {
@@ -484,7 +484,7 @@ class $I {
484
484
  return new TextDecoder().decode(new Uint8Array(A));
485
485
  }
486
486
  }
487
- BA = new WeakMap(), Mt = new WeakMap(), ie = new WeakMap();
487
+ BA = new WeakMap(), Mt = new WeakMap(), ge = new WeakMap();
488
488
  class br {
489
489
  constructor(A = 100, t = 100) {
490
490
  I(this, "resizeSteps");
@@ -570,7 +570,7 @@ class Li {
570
570
  }
571
571
  }
572
572
  }
573
- const eg = (i) => i.reduce((A, t) => A + t, 0) / i.length, ee = (i) => ({
573
+ const eg = (i) => i.reduce((A, t) => A + t, 0) / i.length, Ie = (i) => ({
574
574
  last: i[i.length - 1] || 0,
575
575
  average: i.length === 0 ? 0 : eg(i),
576
576
  max: i.length === 0 ? 0 : Math.max(...i),
@@ -609,7 +609,7 @@ class Jr {
609
609
  return this.rates.isEmpty() ? 0 : eg(this.rates.items());
610
610
  }
611
611
  get minMaxAverage() {
612
- return ee(this.rates.items());
612
+ return Ie(this.rates.items());
613
613
  }
614
614
  }
615
615
  const Ri = (i, A) => {
@@ -653,12 +653,12 @@ class _A {
653
653
  const YQ = 1e3, TQ = YQ * 1e3, cn = TQ * 1e3, hQ = (i, A, t) => i % A === 0 ? i / A : (i / A).toFixed(t), Mr = (i, A = 1) => i >= cn ? `${hQ(i, cn, A)} Gbit/s` : i >= TQ ? `${hQ(i, TQ, A)} Mbit/s` : i >= YQ ? `${hQ(i, YQ, A)} Kbit/s` : `${i} bit/s`, Hr = ({ width: i, height: A }) => `${i}x${A}`, qr = (i) => i % 1e3 === 0 ? `${i / 1e3} kHz` : i > 1e3 ? `${(i / 1e3).toFixed(1)} kHz` : `${i} Hz`, hn = ["off", "error", "warn", "info", "debug", "trace"], vr = {
654
654
  OFF: "off"
655
655
  };
656
- var ve, Vg, Ke, $i, AI;
657
- const $t = class $t {
656
+ var Ke, Vg, Ye, $i, AI;
657
+ const te = class te {
658
658
  constructor({ context: A, logLevel: t, debug: e }) {
659
- n(this, ve, /* @__PURE__ */ new Map());
659
+ n(this, Ke, /* @__PURE__ */ new Map());
660
660
  n(this, Vg, "");
661
- n(this, Ke, !1);
661
+ n(this, Ye, !1);
662
662
  n(this, $i, "off");
663
663
  I(this, "trace", (...A) => {
664
664
  });
@@ -674,11 +674,11 @@ const $t = class $t {
674
674
  });
675
675
  I(this, "count", (...A) => {
676
676
  });
677
- E(this, Vg, A), E(this, $i, t), E(this, Ke, e || !1), this.setLevel(t), this.setDebug(s(this, Ke));
677
+ E(this, Vg, A), E(this, $i, t), E(this, Ye, e || !1), this.setLevel(t), this.setDebug(s(this, Ye));
678
678
  }
679
679
  setDebug(A) {
680
- E(this, Ke, A);
681
- for (const [t, e] of s(this, ve))
680
+ E(this, Ye, A);
681
+ for (const [t, e] of s(this, Ke))
682
682
  e.setDebug(A);
683
683
  A ? (this.table = console.table.bind(console), this.count = console.count.bind(console)) : (this.table = () => {
684
684
  }, this.count = () => {
@@ -686,7 +686,7 @@ const $t = class $t {
686
686
  }
687
687
  setLevel(A) {
688
688
  E(this, $i, A);
689
- for (const [e, g] of s(this, ve))
689
+ for (const [e, g] of s(this, Ke))
690
690
  g.setLevel(A);
691
691
  const t = hn.indexOf(A);
692
692
  for (const [e, g] of hn.entries())
@@ -701,19 +701,19 @@ const $t = class $t {
701
701
  });
702
702
  }
703
703
  createContext(A) {
704
- const t = s(this, ve).get(A);
704
+ const t = s(this, Ke).get(A);
705
705
  if (!t) {
706
- const e = new $t({ context: `${A}`, logLevel: s(this, $i), debug: s(this, Ke) });
707
- return s(this, ve).set(A, e), e;
706
+ const e = new te({ context: `${A}`, logLevel: s(this, $i), debug: s(this, Ye) });
707
+ return s(this, Ke).set(A, e), e;
708
708
  }
709
709
  return t;
710
710
  }
711
711
  static get() {
712
- return s($t, AI) || E($t, AI, new $t({ context: "Vindral", logLevel: "off" })), s($t, AI);
712
+ return s(te, AI) || E(te, AI, new te({ context: "Vindral", logLevel: "off" })), s(te, AI);
713
713
  }
714
714
  };
715
- ve = new WeakMap(), Vg = new WeakMap(), Ke = new WeakMap(), $i = new WeakMap(), AI = new WeakMap(), n($t, AI);
716
- let SA = $t;
715
+ Ke = new WeakMap(), Vg = new WeakMap(), Ye = new WeakMap(), $i = new WeakMap(), AI = new WeakMap(), n(te, AI);
716
+ let SA = te;
717
717
  function HA(i) {
718
718
  const A = SA.get().createContext(i.context);
719
719
  return function(e, g) {
@@ -762,31 +762,31 @@ class Kr {
762
762
  Zg = new WeakSet(), PQ = function() {
763
763
  this.unlocker.resolve(this.value);
764
764
  };
765
- var Ye, Te;
765
+ var Te, Pe;
766
766
  class Yr {
767
767
  constructor(A) {
768
- n(this, Ye);
769
- n(this, Te, new j());
770
- E(this, Ye, A), s(this, Te).resolve(A);
768
+ n(this, Te);
769
+ n(this, Pe, new j());
770
+ E(this, Te, A), s(this, Pe).resolve(A);
771
771
  }
772
772
  unsafeValue() {
773
- return s(this, Ye);
773
+ return s(this, Te);
774
774
  }
775
775
  isLocked() {
776
- return s(this, Te).pending;
776
+ return s(this, Pe).pending;
777
777
  }
778
778
  lock() {
779
779
  return r(this, null, function* () {
780
780
  const A = new j();
781
781
  A.promise.then((e) => {
782
- E(this, Ye, e);
782
+ E(this, Te, e);
783
783
  }).catch(q);
784
- const t = s(this, Te).promise.then(() => A);
785
- return E(this, Te, A), yield t, new Kr(s(this, Ye), A);
784
+ const t = s(this, Pe).promise.then(() => A);
785
+ return E(this, Pe, A), yield t, new Kr(s(this, Te), A);
786
786
  });
787
787
  }
788
788
  }
789
- Ye = new WeakMap(), Te = new WeakMap();
789
+ Te = new WeakMap(), Pe = new WeakMap();
790
790
  var VA, gt;
791
791
  class NA {
792
792
  constructor(A) {
@@ -852,14 +852,14 @@ const dn = (i, A) => {
852
852
  return typeof t != "object" || A.forEach((e) => {
853
853
  delete t[e];
854
854
  }), t;
855
- }, Ne = (i, A = Date.now()) => {
855
+ }, be = (i, A = Date.now()) => {
856
856
  const t = i.length;
857
857
  if (t > 0) {
858
858
  const e = t - 1, g = i[e];
859
859
  g.end || (g.end = A);
860
860
  }
861
861
  }, Ji = (i, A = Date.now()) => {
862
- Ne(i), i.push({ start: A });
862
+ be(i), i.push({ start: A });
863
863
  }, Mi = (i) => i.reduce((A, t) => {
864
864
  var e;
865
865
  return A + (((e = t.end) != null ? e : Date.now()) - t.start);
@@ -973,7 +973,7 @@ function xQ(i) {
973
973
  if (i.startsWith("webvtt"))
974
974
  return "webvtt";
975
975
  }
976
- const Si = (i) => "width" in i && typeof i.width == "number", mi = (i) => "sampleRate" in i && typeof i.sampleRate == "number", He = (i) => {
976
+ const Si = (i) => "width" in i && typeof i.width == "number", mi = (i) => "sampleRate" in i && typeof i.sampleRate == "number", qe = (i) => {
977
977
  switch (i.codec) {
978
978
  case "opus":
979
979
  return 'audio/mp4; codecs="opus"';
@@ -988,7 +988,7 @@ const Si = (i) => "width" in i && typeof i.width == "number", mi = (i) => "sampl
988
988
  case "av1":
989
989
  return i.codecString ? `video/mp4; codecs="${i.codecString}"` : "video/mp4";
990
990
  }
991
- }, fe = () => Number.MAX_SAFE_INTEGER, GB = () => ({
991
+ }, pe = () => Number.MAX_SAFE_INTEGER, GB = () => ({
992
992
  width: Number.MAX_SAFE_INTEGER,
993
993
  height: Number.MAX_SAFE_INTEGER
994
994
  }), wn = (i) => !(typeof i != "object" || i === null || !("type" in i)), Pr = (i) => i ? {
@@ -1324,8 +1324,8 @@ const zr = {
1324
1324
  maxBufferTime: 1500,
1325
1325
  logLevel: vr.OFF,
1326
1326
  maxSize: GB(),
1327
- maxVideoBitRate: fe(),
1328
- maxAudioBitRate: fe(),
1327
+ maxVideoBitRate: pe(),
1328
+ maxAudioBitRate: pe(),
1329
1329
  tags: [],
1330
1330
  media: "audio+video",
1331
1331
  poster: !0,
@@ -1522,7 +1522,7 @@ const hc = (i, A) => new v(
1522
1522
  mediaKeySystemAccess: g
1523
1523
  };
1524
1524
  });
1525
- var Pe, xe;
1525
+ var xe, We;
1526
1526
  class eQ {
1527
1527
  constructor(A, t, e, g) {
1528
1528
  I(this, "keySystem");
@@ -1530,20 +1530,20 @@ class eQ {
1530
1530
  I(this, "certificate");
1531
1531
  I(this, "headers", {});
1532
1532
  I(this, "queryParams", {});
1533
- n(this, Pe);
1534
1533
  n(this, xe);
1535
- E(this, Pe, t), this.keySystem = A, this.licenseServerUrl = e, this.certificate = g;
1534
+ n(this, We);
1535
+ E(this, xe, t), this.keySystem = A, this.licenseServerUrl = e, this.certificate = g;
1536
1536
  }
1537
1537
  get statistics() {
1538
1538
  return {
1539
- keySystem: s(this, Pe).keySystem,
1539
+ keySystem: s(this, xe).keySystem,
1540
1540
  licenseServerUrl: this.licenseServerUrl,
1541
- mediaKeySystemConfiguration: s(this, Pe).getConfiguration()
1541
+ mediaKeySystemConfiguration: s(this, xe).getConfiguration()
1542
1542
  };
1543
1543
  }
1544
1544
  getMediaKeys() {
1545
1545
  return r(this, null, function* () {
1546
- return s(this, xe) ? s(this, xe) : (E(this, xe, yield s(this, Pe).createMediaKeys()), s(this, xe));
1546
+ return s(this, We) ? s(this, We) : (E(this, We, yield s(this, xe).createMediaKeys()), s(this, We));
1547
1547
  });
1548
1548
  }
1549
1549
  requestLicense(A) {
@@ -1564,7 +1564,7 @@ class eQ {
1564
1564
  });
1565
1565
  }
1566
1566
  }
1567
- Pe = new WeakMap(), xe = new WeakMap();
1567
+ xe = new WeakMap(), We = new WeakMap();
1568
1568
  function va(i) {
1569
1569
  const A = window.atob(i.replace(/-/g, "+").replace(/_/g, "/"));
1570
1570
  let t = "";
@@ -1667,18 +1667,18 @@ class Jc extends eQ {
1667
1667
  }
1668
1668
  }
1669
1669
  const Mc = 5e3;
1670
- var V, We, Ht, st, ut, hA, Ie, ge, sC, tI, jg, zg, QA, Ka, Ya, Ta, Pa, BC, CC, xa, ng, QC, Wa, Oa;
1670
+ var V, Oe, Ht, st, ut, hA, se, Be, sC, tI, jg, zg, QA, Ka, Ya, Ta, Pa, BC, CC, xa, ng, QC, Wa, Oa;
1671
1671
  class Gn {
1672
1672
  constructor(A, t, e = {}) {
1673
1673
  n(this, QA);
1674
1674
  n(this, V);
1675
- n(this, We);
1675
+ n(this, Oe);
1676
1676
  n(this, Ht);
1677
1677
  n(this, st, new j());
1678
1678
  n(this, ut);
1679
1679
  n(this, hA);
1680
- n(this, Ie, /* @__PURE__ */ new Map());
1681
- n(this, ge);
1680
+ n(this, se, /* @__PURE__ */ new Map());
1681
+ n(this, Be);
1682
1682
  n(this, sC, Po());
1683
1683
  /**
1684
1684
  * Timeout to wait for new drm data when channel switch happens
@@ -1698,7 +1698,7 @@ class Gn {
1698
1698
  var B, C;
1699
1699
  s(this, V).debug("Session message received", { event: A });
1700
1700
  const t = A.target, e = A.message;
1701
- if (!s(this, Ie).get(t)) {
1701
+ if (!s(this, se).get(t)) {
1702
1702
  s(this, V).error("No active session found for event", { event: A });
1703
1703
  return;
1704
1704
  }
@@ -1737,7 +1737,7 @@ class Gn {
1737
1737
  let C = null;
1738
1738
  return g === "clearkey" ? (lA(A.clearkeys, "No clearkeys found"), C = new Uc(B, A.clearkeys)) : g === "playready" ? (lA(A.playreadyLicenseUrl, "No playreadyLicenseUrl found"), C = new Lc(B, A.playreadyLicenseUrl)) : g === "widevine" ? (lA(A.widevineLicenseUrl, "No widevineLicenseUrl found"), C = new Jc(B, A.widevineLicenseUrl)) : g === "fairplay" && (lA(A.fairplayLicenseUrl, "No fairplayLicenseUrl found"), lA(A.fairplayCertificate, "No fairplayCertificate found"), C = new Nc(B, A.fairplayLicenseUrl, A.fairplayCertificate)), C && (C.headers = s(this, ut).headers || {}, C.queryParams = s(this, ut).queryParams || {}), C;
1739
1739
  }));
1740
- E(this, We, A), E(this, V, t), E(this, ut, e), s(this, We).on("received drm data", s(this, jg));
1740
+ E(this, Oe, A), E(this, V, t), E(this, ut, e), s(this, Oe).on("received drm data", s(this, jg));
1741
1741
  }
1742
1742
  static isSupported() {
1743
1743
  return !!navigator.requestMediaKeySystemAccess;
@@ -1751,9 +1751,9 @@ class Gn {
1751
1751
  }
1752
1752
  unload() {
1753
1753
  var A;
1754
- s(this, V).info("Unloading EncryptedMediaExtensions"), s(this, We).off("received drm data", s(this, jg)), (A = s(this, Ht)) == null || A.removeEventListener("encrypted", s(this, zg)), s(this, Ie).forEach((t, e) => {
1754
+ s(this, V).info("Unloading EncryptedMediaExtensions"), s(this, Oe).off("received drm data", s(this, jg)), (A = s(this, Ht)) == null || A.removeEventListener("encrypted", s(this, zg)), s(this, se).forEach((t, e) => {
1755
1755
  e.close();
1756
- }), s(this, Ie).clear(), E(this, ge, void 0), E(this, hA, void 0);
1756
+ }), s(this, se).clear(), E(this, Be, void 0), E(this, hA, void 0);
1757
1757
  }
1758
1758
  set headers(A) {
1759
1759
  s(this, ut).headers = A, s(this, hA) && (s(this, hA).headers = A);
@@ -1776,7 +1776,7 @@ class Gn {
1776
1776
  }, Mc));
1777
1777
  }
1778
1778
  }
1779
- V = new WeakMap(), We = new WeakMap(), Ht = new WeakMap(), st = new WeakMap(), ut = new WeakMap(), hA = new WeakMap(), Ie = new WeakMap(), ge = new WeakMap(), sC = new WeakMap(), tI = new WeakMap(), jg = new WeakMap(), zg = new WeakMap(), QA = new WeakSet(), Ka = function(A) {
1779
+ V = new WeakMap(), Oe = new WeakMap(), Ht = new WeakMap(), st = new WeakMap(), ut = new WeakMap(), hA = new WeakMap(), se = new WeakMap(), Be = new WeakMap(), sC = new WeakMap(), tI = new WeakMap(), jg = new WeakMap(), zg = new WeakMap(), QA = new WeakSet(), Ka = function(A) {
1780
1780
  return r(this, null, function* () {
1781
1781
  try {
1782
1782
  yield d(this, QA, Ya).call(this), s(this, V).debug("Media keys initialization completed"), yield d(this, QA, Ta).call(this, A.initData, A.initDataType);
@@ -1793,16 +1793,16 @@ V = new WeakMap(), We = new WeakMap(), Ht = new WeakMap(), st = new WeakMap(), u
1793
1793
  s(this, V).debug("Media keys already set on media element");
1794
1794
  return;
1795
1795
  }
1796
- if (s(this, ge)) {
1797
- s(this, V).debug("Media keys initialization already in progress, waiting for completion"), yield s(this, ge);
1796
+ if (s(this, Be)) {
1797
+ s(this, V).debug("Media keys initialization already in progress, waiting for completion"), yield s(this, Be);
1798
1798
  return;
1799
1799
  }
1800
- E(this, ge, r(this, null, function* () {
1800
+ E(this, Be, r(this, null, function* () {
1801
1801
  const e = yield s(this, QC).call(this, A);
1802
1802
  s(this, V).debug("CDM obtained", { cdm: e }), lA(s(this, Ht), "No media element found"), lA(e, "No CDM found");
1803
1803
  const g = yield e.getMediaKeys();
1804
1804
  e.certificate && (yield d(this, QA, xa).call(this, g, e.certificate)), s(this, V).debug("Setting media keys on media element"), yield s(this, Ht).setMediaKeys(g), E(this, hA, e);
1805
- })), yield s(this, ge);
1805
+ })), yield s(this, Be);
1806
1806
  });
1807
1807
  }, Ta = function(A, t) {
1808
1808
  return r(this, null, function* () {
@@ -1815,10 +1815,10 @@ V = new WeakMap(), We = new WeakMap(), Ht = new WeakMap(), st = new WeakMap(), u
1815
1815
  const g = e.createSession();
1816
1816
  s(this, V).debug("Creating new session", { session: g }), g.addEventListener("keystatuseschange", s(this, CC)), g.closed.then((B) => {
1817
1817
  s(this, V).info("Session is closed", { reason: B });
1818
- }), g.addEventListener("message", s(this, BC)), s(this, Ie).set(g, A), s(this, V).debug("Generating request for session", { session: g, initDataType: t, initData: A }), yield g.generateRequest(t, A);
1818
+ }), g.addEventListener("message", s(this, BC)), s(this, se).set(g, A), s(this, V).debug("Generating request for session", { session: g, initDataType: t, initData: A }), yield g.generateRequest(t, A);
1819
1819
  });
1820
1820
  }, Pa = function(A) {
1821
- for (const [t, e] of s(this, Ie))
1821
+ for (const [t, e] of s(this, se))
1822
1822
  if (Rc(A, e)) return !1;
1823
1823
  return !0;
1824
1824
  }, BC = new WeakMap(), CC = new WeakMap(), xa = function(A, t) {
@@ -1831,7 +1831,7 @@ V = new WeakMap(), We = new WeakMap(), Ht = new WeakMap(), st = new WeakMap(), u
1831
1831
  });
1832
1832
  }, ng = function(A) {
1833
1833
  const { message: t, isFatal: e, error: g } = A;
1834
- s(this, V).error(t, { error: g }), s(this, We).emit("error", Ma(t, e, g));
1834
+ s(this, V).error(t, { error: g }), s(this, Oe).emit("error", Ma(t, e, g));
1835
1835
  }, QC = new WeakMap(), /**
1836
1836
  * Get the prioritized key system list based on the DRM data provided.
1837
1837
  * The order of the key systems in the list is the order in which they will be tried.
@@ -2032,7 +2032,7 @@ function zc(i, A) {
2032
2032
  const g = i.decodeData(e);
2033
2033
  return e.readRemaining(), g;
2034
2034
  }
2035
- function jt(i) {
2035
+ function _t(i) {
2036
2036
  const A = i.readUint8(), t = i.readUint24();
2037
2037
  return {
2038
2038
  version: A,
@@ -2062,7 +2062,7 @@ const Pi = class Pi {
2062
2062
  this.timescale = A, this.presentationTime = t, this.presentationTimeDelta = e, this.schemeIdUri = g, this.value = B, this.eventDuration = C, this.id = Q, this.data = o;
2063
2063
  }
2064
2064
  static decodeData(A) {
2065
- const { version: t } = jt(A);
2065
+ const { version: t } = _t(A);
2066
2066
  switch (t) {
2067
2067
  case 1: {
2068
2068
  const e = A.readUint32(), g = A.readUint64(), B = A.readUint32(), C = A.readUint32(), Q = A.readUtf8String(), o = A.readUtf8String(), a = A.remaining(), c = A.readBytes(a);
@@ -2112,7 +2112,7 @@ const wg = class wg {
2112
2112
  this.extra = A, this.byteOffset = t, this.baseMediaDecodeTime = e;
2113
2113
  }
2114
2114
  static decodeData(A) {
2115
- const t = jt(A), e = A.byteOffset();
2115
+ const t = _t(A), e = A.byteOffset();
2116
2116
  let g = 0;
2117
2117
  return t.version === 1 ? g = A.readUint64() : g = A.readUint32(), new wg(t, e, g);
2118
2118
  }
@@ -2139,7 +2139,7 @@ const gA = class gA {
2139
2139
  return (this.firstSampleFlags & t) === 0;
2140
2140
  }
2141
2141
  static decodeData(A) {
2142
- const { flags: t } = jt(A), e = A.readUint32();
2142
+ const { flags: t } = _t(A), e = A.readUint32();
2143
2143
  let g, B;
2144
2144
  t & gA.TRUN_DATA_OFFSET && (g = A.readUint32()), t & gA.TRUN_FIRST_SAMPLE_FLAGS && (B = A.readUint32());
2145
2145
  const C = new gA(e, g, B);
@@ -2160,7 +2160,7 @@ const _c = 1, $c = 2, Ah = 8, th = 16, eh = 32, Dg = class Dg {
2160
2160
  this.extra = A, this.defaultSampleDuration = t, this.defaultSampleSize = e, this.defaultSampleFlags = g;
2161
2161
  }
2162
2162
  static decodeData(A) {
2163
- const t = jt(A);
2163
+ const t = _t(A);
2164
2164
  let e, g, B;
2165
2165
  return A.readUint32(), (t.flags & _c) > 0 && A.readUint64(), (t.flags & $c) > 0 && A.readUint32(), (t.flags & Ah) > 0 && (e = A.readUint32()), (t.flags & th) > 0 && (g = A.readUint32()), (t.flags & eh) > 0 && (B = A.readUint32()), new Dg(t, e, g, B);
2166
2166
  }
@@ -2234,7 +2234,7 @@ const fg = class fg {
2234
2234
  }
2235
2235
  }
2236
2236
  static decodeData(A) {
2237
- jt(A), A.readUint32();
2237
+ _t(A), A.readUint32();
2238
2238
  const t = String.fromCharCode(...A.readBytes(4));
2239
2239
  return new fg(t);
2240
2240
  }
@@ -2251,7 +2251,7 @@ const xi = class xi {
2251
2251
  this.creationTime = A, this.modificationTime = t, this.timescale = e, this.duration = g;
2252
2252
  }
2253
2253
  static decodeData(A) {
2254
- const { version: t } = jt(A);
2254
+ const { version: t } = _t(A);
2255
2255
  if (t === 1) {
2256
2256
  const Q = A.readUint64(), o = A.readUint64(), a = A.readUint32(), c = A.readUint64();
2257
2257
  return new xi(Q, o, a, c);
@@ -2283,7 +2283,7 @@ const pg = class pg {
2283
2283
  return (A = this.avc1) == null ? void 0 : A.height;
2284
2284
  }
2285
2285
  static decodeData(A) {
2286
- jt(A);
2286
+ _t(A);
2287
2287
  const t = A.readUint32();
2288
2288
  let e, g, B, C;
2289
2289
  for (let Q = 0; Q < t; Q++)
@@ -2386,7 +2386,7 @@ const Rg = class Rg {
2386
2386
  this.modificationTime = A, this.creationTime = t, this.trackId = e, this.duration = g, this.alternateGroup = B, this.volume = C, this.width = Q, this.height = o;
2387
2387
  }
2388
2388
  static decodeData(A) {
2389
- const t = jt(A);
2389
+ const t = _t(A);
2390
2390
  let e = 0, g = 0;
2391
2391
  t.version === 1 ? (e = A.readUint64(), g = A.readUint64()) : (e = A.readUint32(), g = A.readUint32());
2392
2392
  const B = A.readUint32();
@@ -2558,7 +2558,7 @@ const Wi = class Wi {
2558
2558
  return new Date(g.getTime() + e);
2559
2559
  }
2560
2560
  static decodeData(A) {
2561
- const { version: t } = jt(A);
2561
+ const { version: t } = _t(A);
2562
2562
  A.readUint32();
2563
2563
  const e = A.readUint32(), g = A.readUint32();
2564
2564
  if (t === 1) {
@@ -3517,25 +3517,25 @@ class Dd {
3517
3517
  }
3518
3518
  }
3519
3519
  const Sd = /\r\n|\r|\n/;
3520
- var se, qt;
3520
+ var Ce, qt;
3521
3521
  class Ln {
3522
3522
  constructor(A) {
3523
- n(this, se);
3523
+ n(this, Ce);
3524
3524
  n(this, qt);
3525
- E(this, se, A), E(this, qt, 0);
3525
+ E(this, Ce, A), E(this, qt, 0);
3526
3526
  }
3527
3527
  skipEmptyLines() {
3528
3528
  let A = 0;
3529
- for (; s(this, se)[s(this, qt)] === ""; )
3529
+ for (; s(this, Ce)[s(this, qt)] === ""; )
3530
3530
  At(this, qt)._++, A++;
3531
3531
  return A;
3532
3532
  }
3533
3533
  readLine() {
3534
- return s(this, se)[At(this, qt)._++];
3534
+ return s(this, Ce)[At(this, qt)._++];
3535
3535
  }
3536
3536
  takeUntilEmptyLine() {
3537
3537
  const A = [];
3538
- for (; s(this, se)[s(this, qt)] !== ""; ) {
3538
+ for (; s(this, Ce)[s(this, qt)] !== ""; ) {
3539
3539
  const t = this.readLine();
3540
3540
  if (t === void 0)
3541
3541
  break;
@@ -3544,10 +3544,10 @@ class Ln {
3544
3544
  return A;
3545
3545
  }
3546
3546
  linesLeft() {
3547
- return s(this, se).length - s(this, qt);
3547
+ return s(this, Ce).length - s(this, qt);
3548
3548
  }
3549
3549
  }
3550
- se = new WeakMap(), qt = new WeakMap();
3550
+ Ce = new WeakMap(), qt = new WeakMap();
3551
3551
  var pi, AE, zQ;
3552
3552
  class $a {
3553
3553
  constructor() {
@@ -3832,7 +3832,7 @@ const pd = (i) => {
3832
3832
  return mi(i) ? A = {
3833
3833
  type: "media-source",
3834
3834
  audio: {
3835
- contentType: He(i),
3835
+ contentType: qe(i),
3836
3836
  bitrate: i.bitRate,
3837
3837
  channels: i.channels.toString(),
3838
3838
  samplerate: i.sampleRate
@@ -3840,7 +3840,7 @@ const pd = (i) => {
3840
3840
  } : A = {
3841
3841
  type: "media-source",
3842
3842
  video: {
3843
- contentType: He(i),
3843
+ contentType: qe(i),
3844
3844
  bitrate: i.bitRate,
3845
3845
  width: i.width,
3846
3846
  height: i.height,
@@ -3955,7 +3955,7 @@ const bd = {
3955
3955
  maxBufferingRatio: {
3956
3956
  last30Seconds: 0.15
3957
3957
  }
3958
- }, Ae = class Ae {
3958
+ }, ee = class ee {
3959
3959
  constructor(A, t, e, g, B) {
3960
3960
  I(this, "qualityOfServiceSource");
3961
3961
  I(this, "targetBufferTimeTarget");
@@ -3989,8 +3989,8 @@ const bd = {
3989
3989
  return;
3990
3990
  const B = this.qualityOfServiceSource.timeSpentBufferingLast(30 * 1e3), C = this.qualityOfServiceSource.bufferingEventsLast(30 * 1e3), Q = this.qualityOfServiceSource.timeSpentActiveLast(30 * 1e3), o = B / Q, a = Math.ceil(
3991
3991
  Math.max(
3992
- (e - t) / (Ae.BUFFER_TIME_MAX_STEPS - 1),
3993
- Ae.BUFFER_TIME_STEP_SIZE
3992
+ (e - t) / (ee.BUFFER_TIME_MAX_STEPS - 1),
3993
+ ee.BUFFER_TIME_STEP_SIZE
3994
3994
  )
3995
3995
  );
3996
3996
  (o > this.config.maxBufferingRatio.last30Seconds || C > this.config.maxBufferingEvents.last30Seconds) && (this.targetBufferTimeTarget.targetBufferTime = Math.min(
@@ -4004,8 +4004,8 @@ const bd = {
4004
4004
  this.config = D(D({}, this.config), A);
4005
4005
  }
4006
4006
  };
4007
- I(Ae, "BUFFER_TIME_STEP_SIZE", 500), I(Ae, "BUFFER_TIME_MAX_STEPS", 3), I(Ae, "create", (A, t, e, g, B = {}) => new Ae(A, t, e, g, B));
4008
- let Ao = Ae;
4007
+ I(ee, "BUFFER_TIME_STEP_SIZE", 500), I(ee, "BUFFER_TIME_MAX_STEPS", 3), I(ee, "create", (A, t, e, g, B = {}) => new ee(A, t, e, g, B));
4008
+ let Ao = ee;
4009
4009
  var VB = /* @__PURE__ */ ((i) => (i[i.StreamHeaderGroup = 4] = "StreamHeaderGroup", i[i.FetchHeader = 5] = "FetchHeader", i[i.StreamHeaderTrack = 60] = "StreamHeaderTrack", i))(VB || {});
4010
4010
  const UA = {
4011
4011
  Normal: 0,
@@ -4243,37 +4243,37 @@ function IE(i, A) {
4243
4243
  }
4244
4244
  });
4245
4245
  }
4246
- var Be, as;
4246
+ var Qe, as;
4247
4247
  class Hd {
4248
4248
  constructor(A, t) {
4249
- n(this, Be);
4249
+ n(this, Qe);
4250
4250
  n(this, as);
4251
- E(this, Be, A), E(this, as, t);
4251
+ E(this, Qe, A), E(this, as, t);
4252
4252
  }
4253
4253
  start(A) {
4254
- s(this, Be).addEventListener("message", (t) => {
4254
+ s(this, Qe).addEventListener("message", (t) => {
4255
4255
  if (typeof t.data == "object" && t.data instanceof ArrayBuffer) {
4256
4256
  const e = new Uint8Array(t.data);
4257
4257
  e[0] == s(this, as) && A.enqueue(e.subarray(1));
4258
4258
  }
4259
- }), s(this, Be).addEventListener("error", () => A.error(new Error("WebSocket error"))), s(this, Be).addEventListener("close", () => pa(() => A.close()));
4259
+ }), s(this, Qe).addEventListener("error", () => A.error(new Error("WebSocket error"))), s(this, Qe).addEventListener("close", () => pa(() => A.close()));
4260
4260
  }
4261
4261
  cancel(A) {
4262
- s(this, Be).close(void 0, A);
4262
+ s(this, Qe).close(void 0, A);
4263
4263
  }
4264
4264
  }
4265
- Be = new WeakMap(), as = new WeakMap();
4266
- var St, Oe, Ve, Ze;
4265
+ Qe = new WeakMap(), as = new WeakMap();
4266
+ var St, Ve, Ze, Xe;
4267
4267
  class qd {
4268
4268
  constructor(A) {
4269
4269
  n(this, St);
4270
- n(this, Oe, null);
4271
4270
  n(this, Ve, null);
4272
4271
  n(this, Ze, null);
4272
+ n(this, Xe, null);
4273
4273
  E(this, St, A);
4274
4274
  }
4275
4275
  start(A) {
4276
- E(this, Oe, (t) => {
4276
+ E(this, Ve, (t) => {
4277
4277
  if (typeof t.data == "object" && t.data instanceof ArrayBuffer) {
4278
4278
  const e = new Uint8Array(t.data), g = e[0] || 0, B = g & 127, C = (g >> 7 & 1) > 0;
4279
4279
  if (B && B !== 0) {
@@ -4281,27 +4281,27 @@ class qd {
4281
4281
  A.enqueue([C, B, Q]);
4282
4282
  }
4283
4283
  }
4284
- }), E(this, Ve, () => pa(() => A.close())), E(this, Ze, () => A.error(new Error("WebSocket error"))), s(this, St).addEventListener("message", s(this, Oe)), s(this, St).addEventListener("error", s(this, Ze)), s(this, St).addEventListener("close", s(this, Ve));
4284
+ }), E(this, Ze, () => pa(() => A.close())), E(this, Xe, () => A.error(new Error("WebSocket error"))), s(this, St).addEventListener("message", s(this, Ve)), s(this, St).addEventListener("error", s(this, Xe)), s(this, St).addEventListener("close", s(this, Ze));
4285
4285
  }
4286
4286
  cancel(A) {
4287
- s(this, Oe) && s(this, St).removeEventListener("message", s(this, Oe)), s(this, Ze) && s(this, St).removeEventListener("error", s(this, Ze)), s(this, Ve) && s(this, St).removeEventListener("close", s(this, Ve));
4287
+ s(this, Ve) && s(this, St).removeEventListener("message", s(this, Ve)), s(this, Xe) && s(this, St).removeEventListener("error", s(this, Xe)), s(this, Ze) && s(this, St).removeEventListener("close", s(this, Ze));
4288
4288
  }
4289
4289
  }
4290
- St = new WeakMap(), Oe = new WeakMap(), Ve = new WeakMap(), Ze = new WeakMap();
4291
- var mt, Es, Xe, yt, aC, X, ag, uB, be, wB, _t;
4290
+ St = new WeakMap(), Ve = new WeakMap(), Ze = new WeakMap(), Xe = new WeakMap();
4291
+ var mt, Es, je, yt, aC, X, ag, uB, Le, wB, Ae;
4292
4292
  class ZB {
4293
4293
  constructor(A, t) {
4294
4294
  n(this, X);
4295
4295
  n(this, mt);
4296
4296
  n(this, Es);
4297
- n(this, Xe);
4297
+ n(this, je);
4298
4298
  n(this, yt, 0);
4299
4299
  n(this, aC, new TextDecoder());
4300
- E(this, mt, A), E(this, Es, t), E(this, Xe, t.getReader());
4300
+ E(this, mt, A), E(this, Es, t), E(this, je, t.getReader());
4301
4301
  }
4302
4302
  readUnsigned8() {
4303
4303
  return r(this, null, function* () {
4304
- return yield d(this, X, be).call(this, 1), d(this, X, _t).call(this, 1)[0];
4304
+ return yield d(this, X, Le).call(this, 1), d(this, X, Ae).call(this, 1)[0];
4305
4305
  });
4306
4306
  }
4307
4307
  readString() {
@@ -4320,24 +4320,24 @@ class ZB {
4320
4320
  }
4321
4321
  readBigVarInt() {
4322
4322
  return r(this, null, function* () {
4323
- yield d(this, X, be).call(this, 1);
4323
+ yield d(this, X, Le).call(this, 1);
4324
4324
  const A = (d(this, X, wB).call(this, 1)[0] & 192) >> 6;
4325
4325
  switch (s(this, mt)[s(this, yt)] = d(this, X, wB).call(this, 1)[0] & 63, A) {
4326
4326
  case 0:
4327
- return H(d(this, X, _t).call(this, 1)[0]);
4327
+ return H(d(this, X, Ae).call(this, 1)[0]);
4328
4328
  case 1: {
4329
- yield d(this, X, be).call(this, 2);
4330
- const t = d(this, X, _t).call(this, 2), e = new DataView(t.buffer, t.byteOffset, t.byteLength);
4329
+ yield d(this, X, Le).call(this, 2);
4330
+ const t = d(this, X, Ae).call(this, 2), e = new DataView(t.buffer, t.byteOffset, t.byteLength);
4331
4331
  return H(e.getUint16(0));
4332
4332
  }
4333
4333
  case 2: {
4334
- yield d(this, X, be).call(this, 4);
4335
- const t = d(this, X, _t).call(this, 4), e = new DataView(t.buffer, t.byteOffset, t.byteLength);
4334
+ yield d(this, X, Le).call(this, 4);
4335
+ const t = d(this, X, Ae).call(this, 4), e = new DataView(t.buffer, t.byteOffset, t.byteLength);
4336
4336
  return H(e.getUint32(0));
4337
4337
  }
4338
4338
  case 3: {
4339
- yield d(this, X, be).call(this, 8);
4340
- const t = d(this, X, _t).call(this, 8), e = new DataView(t.buffer, t.byteOffset, t.byteLength);
4339
+ yield d(this, X, Le).call(this, 8);
4340
+ const t = d(this, X, Ae).call(this, 8), e = new DataView(t.buffer, t.byteOffset, t.byteLength);
4341
4341
  if (typeof e.getBigUint64 != "undefined")
4342
4342
  return H(e.getBigUint64(0));
4343
4343
  const g = xo(t, 0, 7);
@@ -4350,14 +4350,14 @@ class ZB {
4350
4350
  }
4351
4351
  read(A) {
4352
4352
  return r(this, null, function* () {
4353
- return yield d(this, X, be).call(this, A), d(this, X, _t).call(this, A);
4353
+ return yield d(this, X, Le).call(this, A), d(this, X, Ae).call(this, A);
4354
4354
  });
4355
4355
  }
4356
4356
  readAll() {
4357
4357
  return r(this, null, function* () {
4358
4358
  for (; yield d(this, X, uB).call(this); )
4359
4359
  ;
4360
- return d(this, X, _t).call(this, d(this, X, ag).call(this));
4360
+ return d(this, X, Ae).call(this, d(this, X, ag).call(this));
4361
4361
  });
4362
4362
  }
4363
4363
  isDone() {
@@ -4367,20 +4367,20 @@ class ZB {
4367
4367
  }
4368
4368
  closed() {
4369
4369
  return r(this, null, function* () {
4370
- return s(this, Xe).closed;
4370
+ return s(this, je).closed;
4371
4371
  });
4372
4372
  }
4373
4373
  close() {
4374
4374
  return r(this, null, function* () {
4375
- return s(this, Xe).releaseLock(), s(this, Es).cancel();
4375
+ return s(this, je).releaseLock(), s(this, Es).cancel();
4376
4376
  });
4377
4377
  }
4378
4378
  }
4379
- mt = new WeakMap(), Es = new WeakMap(), Xe = new WeakMap(), yt = new WeakMap(), aC = new WeakMap(), X = new WeakSet(), ag = function() {
4379
+ mt = new WeakMap(), Es = new WeakMap(), je = new WeakMap(), yt = new WeakMap(), aC = new WeakMap(), X = new WeakSet(), ag = function() {
4380
4380
  return s(this, mt).length - s(this, yt);
4381
4381
  }, uB = function() {
4382
4382
  return r(this, null, function* () {
4383
- const { value: A, done: t } = yield s(this, Xe).read();
4383
+ const { value: A, done: t } = yield s(this, je).read();
4384
4384
  if (t)
4385
4385
  return Promise.resolve(0);
4386
4386
  if (d(this, X, ag).call(this) === 0)
@@ -4391,7 +4391,7 @@ mt = new WeakMap(), Es = new WeakMap(), Xe = new WeakMap(), yt = new WeakMap(),
4391
4391
  }
4392
4392
  return E(this, yt, 0), Promise.resolve(A.length);
4393
4393
  });
4394
- }, be = function(A) {
4394
+ }, Le = function(A) {
4395
4395
  return r(this, null, function* () {
4396
4396
  for (; d(this, X, ag).call(this) < A; )
4397
4397
  if ((yield d(this, X, uB).call(this)) === 0)
@@ -4399,7 +4399,7 @@ mt = new WeakMap(), Es = new WeakMap(), Xe = new WeakMap(), yt = new WeakMap(),
4399
4399
  });
4400
4400
  }, wB = function(A) {
4401
4401
  return s(this, mt).subarray(s(this, yt), s(this, yt) + A);
4402
- }, _t = function(A) {
4402
+ }, Ae = function(A) {
4403
4403
  const t = d(this, X, wB).call(this, A);
4404
4404
  return E(this, yt, s(this, yt) + t.length), t;
4405
4405
  };
@@ -4444,14 +4444,14 @@ nI = new WeakMap(), aI = new WeakMap(), vt = new WeakMap(), EC = new WeakMap();
4444
4444
  const sE = {
4445
4445
  OPEN: 1
4446
4446
  };
4447
- var MA, vA, je, rC;
4447
+ var MA, vA, ze, rC;
4448
4448
  const Hg = class Hg {
4449
4449
  constructor(A) {
4450
4450
  n(this, MA, 0);
4451
4451
  n(this, vA, new Uint8Array(Hg.DEFAULT_BUFFER_SIZE));
4452
- n(this, je);
4452
+ n(this, ze);
4453
4453
  n(this, rC, new TextEncoder());
4454
- E(this, je, A);
4454
+ E(this, ze, A);
4455
4455
  }
4456
4456
  writeString(A) {
4457
4457
  return r(this, null, function* () {
@@ -4482,15 +4482,15 @@ const Hg = class Hg {
4482
4482
  return this.ensureBufferSpace(8), E(this, MA, s(this, MA) + cE(A, s(this, vA).subarray(s(this, MA))).byteLength), Promise.resolve();
4483
4483
  }
4484
4484
  flush() {
4485
- if (s(this, je).readyState !== sE.OPEN)
4485
+ if (s(this, ze).readyState !== sE.OPEN)
4486
4486
  throw new Error("Writer is not open");
4487
- return s(this, je).send(s(this, vA).subarray(0, s(this, MA))), E(this, MA, 0), E(this, vA, new Uint8Array(Hg.DEFAULT_BUFFER_SIZE)), Promise.resolve();
4487
+ return s(this, ze).send(s(this, vA).subarray(0, s(this, MA))), E(this, MA, 0), E(this, vA, new Uint8Array(Hg.DEFAULT_BUFFER_SIZE)), Promise.resolve();
4488
4488
  }
4489
4489
  close() {
4490
- return s(this, je).close(), Promise.resolve();
4490
+ return s(this, ze).close(), Promise.resolve();
4491
4491
  }
4492
4492
  };
4493
- MA = new WeakMap(), vA = new WeakMap(), je = new WeakMap(), rC = new WeakMap(), I(Hg, "DEFAULT_BUFFER_SIZE", 1024);
4493
+ MA = new WeakMap(), vA = new WeakMap(), ze = new WeakMap(), rC = new WeakMap(), I(Hg, "DEFAULT_BUFFER_SIZE", 1024);
4494
4494
  let xg = Hg;
4495
4495
  const BE = Math.pow(2, 6) - 1, CE = Math.pow(2, 14) - 1, QE = Math.pow(2, 30) - 1, vd = Number.MAX_SAFE_INTEGER, Kd = typeof BigInt == "function" ? EQ(H(2), H(62)) - H(1) : H(Number.MAX_SAFE_INTEGER);
4496
4496
  function gQ(i, A) {
@@ -5152,15 +5152,15 @@ class hl {
5152
5152
  this.state = A;
5153
5153
  }
5154
5154
  }
5155
- var lI, Ce, ze, dC, _e, Ct;
5155
+ var lI, oe, _e, dC, $e, Ct;
5156
5156
  const Vi = class Vi {
5157
5157
  constructor(A) {
5158
5158
  I(this, "subscribe");
5159
5159
  n(this, lI, new j());
5160
- n(this, Ce, new j());
5161
- n(this, ze, new j());
5162
- n(this, dC, Date.now());
5160
+ n(this, oe, new j());
5163
5161
  n(this, _e, new j());
5162
+ n(this, dC, Date.now());
5163
+ n(this, $e, new j());
5164
5164
  n(this, Ct);
5165
5165
  switch (this.subscribe = A, A.filterType.type) {
5166
5166
  case "absolute-start":
@@ -5176,24 +5176,24 @@ const Vi = class Vi {
5176
5176
  }
5177
5177
  onError(A) {
5178
5178
  const t = new Error(A.reason);
5179
- return s(this, lI).reject(t), s(this, Ce).reject(t), t;
5179
+ return s(this, lI).reject(t), s(this, oe).reject(t), t;
5180
5180
  }
5181
5181
  onDone(A) {
5182
- A.finalInfo && (s(this, Ct) || E(this, Ct, { startGroup: H(0) }), s(this, Ct).endGroup = A.finalInfo.group), s(this, Ce).resolve(A);
5182
+ A.finalInfo && (s(this, Ct) || E(this, Ct, { startGroup: H(0) }), s(this, Ct).endGroup = A.finalInfo.group), s(this, oe).resolve(A);
5183
5183
  }
5184
5184
  onUnsubscribe(A) {
5185
- s(this, ze).resolve(A);
5185
+ s(this, _e).resolve(A);
5186
5186
  }
5187
5187
  onOk(A) {
5188
5188
  const t = Math.max(0, Date.now() - s(this, dC)), e = Number(A.expires);
5189
5189
  if (e > 0) {
5190
5190
  const g = Math.max(Vi.minGraceTime, Math.min(e / 10, Vi.maxGraceTime));
5191
- Promise.race([yi(e - g - t), this.done().catch(q)]).then(() => s(this, _e).resolve(this.expiryState())).catch(q);
5191
+ Promise.race([yi(e - g - t), this.done().catch(q)]).then(() => s(this, $e).resolve(this.expiryState())).catch(q);
5192
5192
  }
5193
5193
  s(this, lI).resolve(A);
5194
5194
  }
5195
5195
  done() {
5196
- return s(this, Ce).promise;
5196
+ return s(this, oe).promise;
5197
5197
  }
5198
5198
  ok() {
5199
5199
  return s(this, lI).promise;
@@ -5202,27 +5202,27 @@ const Vi = class Vi {
5202
5202
  return s(this, Ct);
5203
5203
  }
5204
5204
  close() {
5205
- s(this, _e).promise.catch(q), s(this, _e).reject(new Error("Subscription closed"));
5205
+ s(this, $e).promise.catch(q), s(this, $e).reject(new Error("Subscription closed"));
5206
5206
  }
5207
5207
  // Returns whether the subscription is still active - i.e. hasn't received a done or unsubscribe
5208
5208
  expiryState() {
5209
- return s(this, Ce).resolved && s(this, Ce).resolved.errorCode !== io.Expired ? "done" : s(this, ze).pending ? "active" : "unsubscribed";
5209
+ return s(this, oe).resolved && s(this, oe).resolved.errorCode !== io.Expired ? "done" : s(this, _e).pending ? "active" : "unsubscribed";
5210
5210
  }
5211
5211
  unsubscribed() {
5212
- return s(this, ze).promise;
5212
+ return s(this, _e).promise;
5213
5213
  }
5214
5214
  isUnsubscribed() {
5215
- return s(this, ze).resolved;
5215
+ return s(this, _e).resolved;
5216
5216
  }
5217
5217
  /**
5218
5218
  * Returns a promise that resolves when the subscription is about to expire (15 seconds before expiry).
5219
5219
 
5220
5220
  */
5221
5221
  expiryNotification() {
5222
- return s(this, _e).promise;
5222
+ return s(this, $e).promise;
5223
5223
  }
5224
5224
  };
5225
- lI = new WeakMap(), Ce = new WeakMap(), ze = new WeakMap(), dC = new WeakMap(), _e = new WeakMap(), Ct = new WeakMap(), I(Vi, "maxGraceTime", 15e3), I(Vi, "minGraceTime", 3e3);
5225
+ lI = new WeakMap(), oe = new WeakMap(), _e = new WeakMap(), dC = new WeakMap(), $e = new WeakMap(), Ct = new WeakMap(), I(Vi, "maxGraceTime", 15e3), I(Vi, "minGraceTime", 3e3);
5226
5226
  let _B = Vi;
5227
5227
  var fA, ls;
5228
5228
  class dl {
@@ -5323,15 +5323,15 @@ us = new WeakMap(), ZA = new WeakMap(), ws = new WeakMap(), Ds = new WeakMap(),
5323
5323
  }
5324
5324
  });
5325
5325
  };
5326
- var $e, ms, wI, ys, DI;
5326
+ var Ai, ms, wI, ys, DI;
5327
5327
  class ul {
5328
5328
  constructor(A, t, e) {
5329
- n(this, $e);
5329
+ n(this, Ai);
5330
5330
  n(this, ms);
5331
5331
  n(this, wI);
5332
5332
  n(this, ys);
5333
5333
  n(this, DI);
5334
- E(this, $e, A), E(this, ms, t), E(this, wI, e), E(this, DI, SA.get().createContext(`GroupSubscriptionWriter:${e.subscribe.name}`));
5334
+ E(this, Ai, A), E(this, ms, t), E(this, wI, e), E(this, DI, SA.get().createContext(`GroupSubscriptionWriter:${e.subscribe.name}`));
5335
5335
  }
5336
5336
  finalGroup() {
5337
5337
  return s(this, ys);
@@ -5342,7 +5342,7 @@ class ul {
5342
5342
  try {
5343
5343
  for (var A = IA(s(this, ms)), t, e, g; t = !(e = yield A.next()).done; t = !1) {
5344
5344
  const B = e.value;
5345
- yield s(this, $e).write({
5345
+ yield s(this, Ai).write({
5346
5346
  subscribeId: s(this, wI).subscribe.id,
5347
5347
  trackAlias: s(this, wI).subscribe.trackAlias,
5348
5348
  subGroupId: H(0),
@@ -5367,21 +5367,21 @@ class ul {
5367
5367
  });
5368
5368
  }
5369
5369
  [Ut()]() {
5370
- return s(this, $e).close().catch(q);
5370
+ return s(this, Ai).close().catch(q);
5371
5371
  }
5372
5372
  [Symbol.asyncDispose]() {
5373
- return s(this, $e).close().catch(q);
5373
+ return s(this, Ai).close().catch(q);
5374
5374
  }
5375
5375
  }
5376
- $e = new WeakMap(), ms = new WeakMap(), wI = new WeakMap(), ys = new WeakMap(), DI = new WeakMap();
5377
- var fs, Ai, Qe, vi;
5376
+ Ai = new WeakMap(), ms = new WeakMap(), wI = new WeakMap(), ys = new WeakMap(), DI = new WeakMap();
5377
+ var fs, ti, ne, vi;
5378
5378
  class wl {
5379
5379
  constructor(A, t, e) {
5380
- n(this, Qe);
5380
+ n(this, ne);
5381
5381
  I(this, "state");
5382
5382
  n(this, fs);
5383
- n(this, Ai);
5384
- this.state = A, E(this, fs, t), E(this, Ai, e);
5383
+ n(this, ti);
5384
+ this.state = A, E(this, fs, t), E(this, ti, e);
5385
5385
  }
5386
5386
  /**
5387
5387
  * Accept the subscription and provide a track cache for the subscription
@@ -5399,23 +5399,23 @@ class wl {
5399
5399
  params: /* @__PURE__ */ new Map(),
5400
5400
  largestInfo: g ? { group: g, object: B } : void 0
5401
5401
  };
5402
- return yield s(this, Ai).push(Q), new ll(this.state, C, s(this, fs), s(this, Ai));
5402
+ return yield s(this, ti).push(Q), new ll(this.state, C, s(this, fs), s(this, ti));
5403
5403
  });
5404
5404
  }
5405
5405
  invalidRange() {
5406
- return d(this, Qe, vi).call(this, H(1), "Invalid range");
5406
+ return d(this, ne, vi).call(this, H(1), "Invalid range");
5407
5407
  }
5408
5408
  retryTrackAlias() {
5409
- return d(this, Qe, vi).call(this, H(2), "Retry track alias");
5409
+ return d(this, ne, vi).call(this, H(2), "Retry track alias");
5410
5410
  }
5411
5411
  trackDoesNotExist() {
5412
- return d(this, Qe, vi).call(this, H(3), "Track does not exist");
5412
+ return d(this, ne, vi).call(this, H(3), "Track does not exist");
5413
5413
  }
5414
5414
  unauthorized() {
5415
- return d(this, Qe, vi).call(this, H(4), "Unauthorized");
5415
+ return d(this, ne, vi).call(this, H(4), "Unauthorized");
5416
5416
  }
5417
5417
  timeout() {
5418
- return d(this, Qe, vi).call(this, H(5), "Timeout");
5418
+ return d(this, ne, vi).call(this, H(5), "Timeout");
5419
5419
  }
5420
5420
  [Ut()]() {
5421
5421
  return this.trackDoesNotExist();
@@ -5424,7 +5424,7 @@ class wl {
5424
5424
  return this.trackDoesNotExist();
5425
5425
  }
5426
5426
  }
5427
- fs = new WeakMap(), Ai = new WeakMap(), Qe = new WeakSet(), vi = function(A, t) {
5427
+ fs = new WeakMap(), ti = new WeakMap(), ne = new WeakSet(), vi = function(A, t) {
5428
5428
  const e = {
5429
5429
  type: R.SubscribeError,
5430
5430
  id: this.state.subscribe.id,
@@ -5432,25 +5432,25 @@ fs = new WeakMap(), Ai = new WeakMap(), Qe = new WeakSet(), vi = function(A, t)
5432
5432
  reason: t,
5433
5433
  trackAlias: this.state.subscribe.trackAlias
5434
5434
  };
5435
- return s(this, Ai).push(e);
5435
+ return s(this, ti).push(e);
5436
5436
  };
5437
- var Ca, SI, ps, mI, ti, oe, ne, ae, HQ;
5437
+ var Ca, SI, ps, mI, ei, ae, Ee, re, HQ;
5438
5438
  Ca = [HA({ context: "Session", enter: "info", error: "error" })];
5439
5439
  class Io {
5440
5440
  constructor(A, t, e) {
5441
- ke(HQ, 5, this);
5441
+ Re(HQ, 5, this);
5442
5442
  n(this, SI);
5443
5443
  n(this, ps);
5444
5444
  n(this, mI);
5445
- n(this, ti, SA.get().createContext("Publisher"));
5446
- n(this, oe, new NA(/* @__PURE__ */ new Map()));
5447
- n(this, ne, new NA(/* @__PURE__ */ new Map()));
5448
- n(this, ae, new AQ(10));
5445
+ n(this, ei, SA.get().createContext("Publisher"));
5446
+ n(this, ae, new NA(/* @__PURE__ */ new Map()));
5447
+ n(this, Ee, new NA(/* @__PURE__ */ new Map()));
5448
+ n(this, re, new AQ(10));
5449
5449
  E(this, SI, A), E(this, ps, t), E(this, mI, e);
5450
5450
  }
5451
5451
  announce(A) {
5452
5452
  return r(this, null, function* () {
5453
- if (s(this, oe).current().has(A.join("/")))
5453
+ if (s(this, ae).current().has(A.join("/")))
5454
5454
  throw new Error("Duplicate announcement");
5455
5455
  const t = /* @__PURE__ */ new Map(), e = s(this, SI).authToken();
5456
5456
  e && t.set(XB, { type: XB, payload: new TextEncoder().encode(e) });
@@ -5459,15 +5459,15 @@ class Io {
5459
5459
  namespace: A,
5460
5460
  params: t
5461
5461
  }, B = cl(g);
5462
- if (s(this, oe).update((Q) => Q.set(g.namespace.join("/"), B)), yield s(this, mI).push(g), !(yield Promise.race([B.state.ok(), s(this, SI).closed()])))
5462
+ if (s(this, ae).update((Q) => Q.set(g.namespace.join("/"), B)), yield s(this, mI).push(g), !(yield Promise.race([B.state.ok(), s(this, SI).closed()])))
5463
5463
  throw new Error("Session closed");
5464
5464
  });
5465
5465
  }
5466
5466
  close() {
5467
- s(this, ne).current().forEach((A) => A.close()), s(this, ne).close(), s(this, oe).close(), s(this, ae).close();
5467
+ s(this, Ee).current().forEach((A) => A.close()), s(this, Ee).close(), s(this, ae).close(), s(this, re).close();
5468
5468
  }
5469
5469
  incomingSubscriptions() {
5470
- return s(this, ae);
5470
+ return s(this, re);
5471
5471
  }
5472
5472
  onMessage(A) {
5473
5473
  return r(this, null, function* () {
@@ -5475,77 +5475,77 @@ class Io {
5475
5475
  case R.Subscribe:
5476
5476
  {
5477
5477
  const t = new _B(A);
5478
- if (s(this, ne).update((e) => (e.set(A.id, t), e)), s(this, ae).isFull()) {
5479
- const e = yield s(this, ae).pop();
5478
+ if (s(this, Ee).update((e) => (e.set(A.id, t), e)), s(this, re).isFull()) {
5479
+ const e = yield s(this, re).pop();
5480
5480
  yield e == null ? void 0 : e.timeout();
5481
5481
  }
5482
- yield s(this, ae).push(
5482
+ yield s(this, re).push(
5483
5483
  new wl(t, s(this, ps), s(this, mI))
5484
5484
  );
5485
5485
  }
5486
5486
  break;
5487
5487
  case R.SubscribeUpdate:
5488
5488
  {
5489
- const t = s(this, ne).current().get(A.id);
5490
- t || s(this, ti).debug("No subscription found", A), t == null || t.onUpdate(A);
5489
+ const t = s(this, Ee).current().get(A.id);
5490
+ t || s(this, ei).debug("No subscription found", A), t == null || t.onUpdate(A);
5491
5491
  }
5492
5492
  break;
5493
5493
  case R.Unsubscribe:
5494
5494
  {
5495
- const t = s(this, ne).current().get(A.id);
5496
- t || s(this, ti).debug("No subscription found", A), t == null || t.onUnsubscribe(A);
5495
+ const t = s(this, Ee).current().get(A.id);
5496
+ t || s(this, ei).debug("No subscription found", A), t == null || t.onUnsubscribe(A);
5497
5497
  }
5498
5498
  break;
5499
5499
  case R.AnnounceOk:
5500
5500
  {
5501
- const t = s(this, oe).current().get(A.namespace.join("/"));
5502
- t || s(this, ti).debug("No announcement found", A), t == null || t.state.onOk(A);
5501
+ const t = s(this, ae).current().get(A.namespace.join("/"));
5502
+ t || s(this, ei).debug("No announcement found", A), t == null || t.state.onOk(A);
5503
5503
  }
5504
5504
  break;
5505
5505
  case R.AnnounceError:
5506
5506
  {
5507
- const t = s(this, oe).current().get(A.namespace.join("/"));
5508
- t || s(this, ti).debug("No announcement found", A), t == null || t.state.onError(A);
5507
+ const t = s(this, ae).current().get(A.namespace.join("/"));
5508
+ t || s(this, ei).debug("No announcement found", A), t == null || t.state.onError(A);
5509
5509
  }
5510
5510
  break;
5511
5511
  }
5512
5512
  });
5513
5513
  }
5514
5514
  }
5515
- HQ = Ge(null), SI = new WeakMap(), ps = new WeakMap(), mI = new WeakMap(), ti = new WeakMap(), oe = new WeakMap(), ne = new WeakMap(), ae = new WeakMap(), FA(HQ, 1, "announce", Ca, Io), zt(HQ, Io);
5515
+ HQ = ke(null), SI = new WeakMap(), ps = new WeakMap(), mI = new WeakMap(), ei = new WeakMap(), ae = new WeakMap(), Ee = new WeakMap(), re = new WeakMap(), FA(HQ, 1, "announce", Ca, Io), $t(HQ, Io);
5516
5516
  function Dl(i, A) {
5517
5517
  const t = new _B(A), [e, g] = To(100), B = new Sl(t, e), C = new LE(i, t, g);
5518
5518
  return [B, C];
5519
5519
  }
5520
- var ei;
5520
+ var ii;
5521
5521
  class Sl {
5522
5522
  constructor(A, t) {
5523
5523
  I(this, "state");
5524
- n(this, ei);
5525
- this.state = A, E(this, ei, t);
5524
+ n(this, ii);
5525
+ this.state = A, E(this, ii, t);
5526
5526
  }
5527
5527
  onDone(A) {
5528
5528
  this.state.onDone(A);
5529
5529
  }
5530
5530
  onData(A) {
5531
- return s(this, ei).push(A);
5531
+ return s(this, ii).push(A);
5532
5532
  }
5533
5533
  onError(A) {
5534
5534
  const t = this.state.onError(A);
5535
- s(this, ei).abort(t);
5535
+ s(this, ii).abort(t);
5536
5536
  }
5537
5537
  /**
5538
5538
  * Closes the subscription producer so that no more objects an be emitted
5539
5539
  */
5540
5540
  close() {
5541
- this.state.close(), s(this, ei).close();
5541
+ this.state.close(), s(this, ii).close();
5542
5542
  }
5543
5543
  }
5544
- ei = new WeakMap();
5544
+ ii = new WeakMap();
5545
5545
  var Qa, yI, dA, fI, pI, qQ, FI, Eg;
5546
5546
  class LE {
5547
5547
  constructor(A, t, e) {
5548
- ke(qQ, 5, this);
5548
+ Re(qQ, 5, this);
5549
5549
  n(this, FI);
5550
5550
  n(this, yI);
5551
5551
  n(this, dA);
@@ -5712,17 +5712,17 @@ class LE {
5712
5712
  return d(this, FI, Eg).call(this);
5713
5713
  }
5714
5714
  }
5715
- qQ = Ge(null), yI = new WeakMap(), dA = new WeakMap(), fI = new WeakMap(), pI = new WeakMap(), FI = new WeakSet(), Eg = function() {
5715
+ qQ = ke(null), yI = new WeakMap(), dA = new WeakMap(), fI = new WeakMap(), pI = new WeakMap(), FI = new WeakSet(), Eg = function() {
5716
5716
  return r(this, null, function* () {
5717
5717
  return yield this.close(), this.unsubscribe();
5718
5718
  });
5719
- }, Eg = FA(qQ, 17, "#dispose", Qa, FI, Eg), zt(qQ, LE);
5719
+ }, Eg = FA(qQ, 17, "#dispose", Qa, FI, Eg), $t(qQ, LE);
5720
5720
  const ml = 2e3;
5721
- var oa, na, aa, Ea, Yt, KA, ii, Ii, Hi, Rt, SB, Ki;
5721
+ var oa, na, aa, Ea, Yt, KA, Ii, gi, Hi, Rt, SB, Ki;
5722
5722
  Ea = [HA({ context: "Session", return: "debug" })], aa = [HA({ context: "Session", enter: "info", error: "error" })], na = [HA({ context: "Session", enter: "debug" })], oa = [HA({ context: "Session", enter: "debug" })];
5723
5723
  class DB {
5724
5724
  constructor(A, t) {
5725
- ke(Hi, 5, this);
5725
+ Re(Hi, 5, this);
5726
5726
  n(this, Rt);
5727
5727
  // The owner session of the subscriber
5728
5728
  n(this, Yt);
@@ -5730,9 +5730,9 @@ class DB {
5730
5730
  I(this, "nextSubscribeId", H(0));
5731
5731
  // The active subscriptions
5732
5732
  n(this, KA, new NA(/* @__PURE__ */ new Map()));
5733
- n(this, ii);
5734
- n(this, Ii, SA.get().createContext("Subscriber"));
5735
- E(this, Yt, A), E(this, ii, t), d(this, Rt, SB).call(this).catch(q);
5733
+ n(this, Ii);
5734
+ n(this, gi, SA.get().createContext("Subscriber"));
5735
+ E(this, Yt, A), E(this, Ii, t), d(this, Rt, SB).call(this).catch(q);
5736
5736
  }
5737
5737
  subscribe(A, t) {
5738
5738
  return r(this, null, function* () {
@@ -5748,8 +5748,8 @@ class DB {
5748
5748
  subscriberPriority: t.priority,
5749
5749
  filterType: t.filterType,
5750
5750
  params: g
5751
- }, [Q, o] = Dl(s(this, ii), C);
5752
- if (s(this, KA).update((c) => c.set(e, Q)), yield s(this, ii).push(C), !(yield Promise.race([Q.state.ok(), s(this, Yt).closed()])))
5751
+ }, [Q, o] = Dl(s(this, Ii), C);
5752
+ if (s(this, KA).update((c) => c.set(e, Q)), yield s(this, Ii).push(C), !(yield Promise.race([Q.state.ok(), s(this, Yt).closed()])))
5753
5753
  throw new Error("Session closed");
5754
5754
  return o.closed().then(() => Promise.race([yi(ml), this.closed()])).then(() => d(this, Rt, Ki).call(this, o.id)).catch(() => d(this, Rt, Ki).call(this, o.id)), o;
5755
5755
  });
@@ -5767,7 +5767,7 @@ class DB {
5767
5767
  return r(this, null, function* () {
5768
5768
  switch (A.type) {
5769
5769
  case R.Announce:
5770
- yield s(this, ii).push({
5770
+ yield s(this, Ii).push({
5771
5771
  type: R.AnnounceOk,
5772
5772
  namespace: A.namespace
5773
5773
  });
@@ -5781,13 +5781,13 @@ class DB {
5781
5781
  case R.SubscribeError:
5782
5782
  {
5783
5783
  const t = s(this, KA).current().get(A.id);
5784
- t || s(this, Ii).debug("No subscription found", A), t == null || t.onError(A), d(this, Rt, Ki).call(this, A.id);
5784
+ t || s(this, gi).debug("No subscription found", A), t == null || t.onError(A), d(this, Rt, Ki).call(this, A.id);
5785
5785
  }
5786
5786
  break;
5787
5787
  case R.SubscribeDone:
5788
5788
  {
5789
5789
  const t = s(this, KA).current().get(A.id);
5790
- t || s(this, Ii).debug("No subscription found", A), t == null || t.onDone(A);
5790
+ t || s(this, gi).debug("No subscription found", A), t == null || t.onDone(A);
5791
5791
  }
5792
5792
  break;
5793
5793
  }
@@ -5797,7 +5797,7 @@ class DB {
5797
5797
  return r(this, null, function* () {
5798
5798
  const t = s(this, KA).current().get(A.subscribeId());
5799
5799
  if (!t) {
5800
- s(this, Ii).warn("No subscription found", A.subscribeId());
5800
+ s(this, gi).warn("No subscription found", A.subscribeId());
5801
5801
  return;
5802
5802
  }
5803
5803
  yield t.onData(A);
@@ -5807,13 +5807,13 @@ class DB {
5807
5807
  s(this, KA).current().forEach((A) => A.close()), s(this, KA).close();
5808
5808
  }
5809
5809
  }
5810
- Hi = Ge(null), Yt = new WeakMap(), KA = new WeakMap(), ii = new WeakMap(), Ii = new WeakMap(), Rt = new WeakSet(), SB = function() {
5810
+ Hi = ke(null), Yt = new WeakMap(), KA = new WeakMap(), Ii = new WeakMap(), gi = new WeakMap(), Rt = new WeakSet(), SB = function() {
5811
5811
  return r(this, null, function* () {
5812
5812
  try {
5813
5813
  for (var A = IA(s(this, KA)), t, e, g; t = !(e = yield A.next()).done; t = !1) {
5814
5814
  const B = e.value;
5815
5815
  const C = [...B.values()].map((Q) => Q.state.subscribe);
5816
- s(this, Ii).debug("current subscriptions", C);
5816
+ s(this, gi).debug("current subscriptions", C);
5817
5817
  }
5818
5818
  } catch (e) {
5819
5819
  g = [e];
@@ -5828,24 +5828,24 @@ Hi = Ge(null), Yt = new WeakMap(), KA = new WeakMap(), ii = new WeakMap(), Ii =
5828
5828
  });
5829
5829
  }, Ki = function(A) {
5830
5830
  s(this, KA).isClosed() || s(this, KA).update((t) => (t.delete(A), t));
5831
- }, SB = FA(Hi, 17, "#observeChanges", Ea, Rt, SB), FA(Hi, 1, "subscribe", aa, DB), FA(Hi, 1, "close", na, DB), Ki = FA(Hi, 17, "#deleteSubscription", oa, Rt, Ki), zt(Hi, DB);
5832
- var ra, ca, ha, da, Qt, Fs, gi, GI, kI, cA, JE, ME, qi, mB, yB, fB, rg;
5831
+ }, SB = FA(Hi, 17, "#observeChanges", Ea, Rt, SB), FA(Hi, 1, "subscribe", aa, DB), FA(Hi, 1, "close", na, DB), Ki = FA(Hi, 17, "#deleteSubscription", oa, Rt, Ki), $t(Hi, DB);
5832
+ var ra, ca, ha, da, Qt, Fs, si, GI, kI, cA, JE, ME, qi, mB, yB, fB, rg;
5833
5833
  class Vo {
5834
5834
  constructor(A, t) {
5835
- ke(qi, 5, this);
5835
+ Re(qi, 5, this);
5836
5836
  n(this, cA);
5837
5837
  // The underlying transport implementation
5838
5838
  n(this, Qt);
5839
5839
  // The background "thread" running the background tasks
5840
5840
  n(this, Fs);
5841
5841
  // Outgoing messages
5842
- n(this, gi);
5842
+ n(this, si);
5843
5843
  n(this, GI, SA.get().createContext("Session"));
5844
5844
  I(this, "subscriber");
5845
5845
  I(this, "publisher");
5846
5846
  n(this, kI);
5847
5847
  const [e, g] = To(100);
5848
- E(this, Qt, A), E(this, gi, g), this.subscriber = new DB(this, e), this.publisher = new Io(this, A, e), E(this, Fs, d(this, cA, ME).call(this)), E(this, kI, new NA(t)), this.closed().then(() => this.close()).catch(q);
5848
+ E(this, Qt, A), E(this, si, g), this.subscriber = new DB(this, e), this.publisher = new Io(this, A, e), E(this, Fs, d(this, cA, ME).call(this)), E(this, kI, new NA(t)), this.closed().then(() => this.close()).catch(q);
5849
5849
  }
5850
5850
  updateAuthToken(A) {
5851
5851
  s(this, kI).update(A);
@@ -5864,7 +5864,7 @@ class Vo {
5864
5864
  }
5865
5865
  close() {
5866
5866
  try {
5867
- this.subscriber.close(), this.publisher.close(), s(this, gi).cancel("closing"), s(this, Qt).close();
5867
+ this.subscriber.close(), this.publisher.close(), s(this, si).cancel("closing"), s(this, Qt).close();
5868
5868
  } catch (A) {
5869
5869
  s(this, GI).warn("Error closing session", A);
5870
5870
  }
@@ -5876,7 +5876,7 @@ class Vo {
5876
5876
  d(this, cA, rg).call(this);
5877
5877
  }
5878
5878
  }
5879
- qi = Ge(null), Qt = new WeakMap(), Fs = new WeakMap(), gi = new WeakMap(), GI = new WeakMap(), kI = new WeakMap(), cA = new WeakSet(), JE = function(A) {
5879
+ qi = ke(null), Qt = new WeakMap(), Fs = new WeakMap(), si = new WeakMap(), GI = new WeakMap(), kI = new WeakMap(), cA = new WeakSet(), JE = function(A) {
5880
5880
  return r(this, null, function* () {
5881
5881
  var t, e;
5882
5882
  switch (s(this, GI).debug("received message", A), yield (t = this.subscriber) == null ? void 0 : t.onMessage(A), yield (e = this.publisher) == null ? void 0 : e.onMessage(A), A.type) {
@@ -5892,7 +5892,7 @@ qi = Ge(null), Qt = new WeakMap(), Fs = new WeakMap(), gi = new WeakMap(), GI =
5892
5892
  return r(this, null, function* () {
5893
5893
  try {
5894
5894
  try {
5895
- for (var A = IA(s(this, gi)), t, e, g; t = !(e = yield A.next()).done; t = !1) {
5895
+ for (var A = IA(s(this, si)), t, e, g; t = !(e = yield A.next()).done; t = !1) {
5896
5896
  const B = e.value;
5897
5897
  s(this, GI).debug("sending message", B), yield s(this, Qt).writeMessage(B);
5898
5898
  }
@@ -5923,7 +5923,7 @@ qi = Ge(null), Qt = new WeakMap(), Fs = new WeakMap(), gi = new WeakMap(), GI =
5923
5923
  } catch (A) {
5924
5924
  return A;
5925
5925
  } finally {
5926
- s(this, gi).cancel("closing");
5926
+ s(this, si).cancel("closing");
5927
5927
  }
5928
5928
  });
5929
5929
  }, fB = function() {
@@ -5942,74 +5942,74 @@ qi = Ge(null), Qt = new WeakMap(), Fs = new WeakMap(), gi = new WeakMap(), GI =
5942
5942
  });
5943
5943
  }, rg = function() {
5944
5944
  this.close();
5945
- }, mB = FA(qi, 17, "#runOutgoingMessages", da, cA, mB), yB = FA(qi, 17, "#runControl", ha, cA, yB), fB = FA(qi, 17, "#runObjects", ca, cA, fB), rg = FA(qi, 17, "#dispose", ra, cA, rg), zt(qi, Vo);
5945
+ }, mB = FA(qi, 17, "#runOutgoingMessages", da, cA, mB), yB = FA(qi, 17, "#runControl", ha, cA, yB), fB = FA(qi, 17, "#runObjects", ca, cA, fB), rg = FA(qi, 17, "#dispose", ra, cA, rg), $t(qi, Vo);
5946
5946
  const yl = 128;
5947
- var XA, Gs, si, RI, ks, pA, Le, Je;
5947
+ var XA, Gs, Bi, RI, ks, pA, Je, Me;
5948
5948
  class fl {
5949
5949
  constructor(A, t, e) {
5950
5950
  n(this, pA);
5951
5951
  n(this, XA);
5952
5952
  n(this, Gs);
5953
- n(this, si, !0);
5953
+ n(this, Bi, !0);
5954
5954
  n(this, RI, !1);
5955
5955
  n(this, ks);
5956
5956
  E(this, XA, A), E(this, Gs, t), E(this, ks, e);
5957
5957
  }
5958
5958
  writeUnsigned8(A) {
5959
5959
  return r(this, null, function* () {
5960
- return d(this, pA, Le).call(this), yield d(this, pA, Je).call(this), s(this, XA).writeUnsigned8(A);
5960
+ return d(this, pA, Je).call(this), yield d(this, pA, Me).call(this), s(this, XA).writeUnsigned8(A);
5961
5961
  });
5962
5962
  }
5963
5963
  writeVarInt(A) {
5964
5964
  return r(this, null, function* () {
5965
- return d(this, pA, Le).call(this), yield d(this, pA, Je).call(this), s(this, XA).writeVarInt(A);
5965
+ return d(this, pA, Je).call(this), yield d(this, pA, Me).call(this), s(this, XA).writeVarInt(A);
5966
5966
  });
5967
5967
  }
5968
5968
  writeBigVarInt(A) {
5969
5969
  return r(this, null, function* () {
5970
- return d(this, pA, Le).call(this), yield d(this, pA, Je).call(this), s(this, XA).writeBigVarInt(A);
5970
+ return d(this, pA, Je).call(this), yield d(this, pA, Me).call(this), s(this, XA).writeBigVarInt(A);
5971
5971
  });
5972
5972
  }
5973
5973
  write(A) {
5974
5974
  return r(this, null, function* () {
5975
- return d(this, pA, Le).call(this), yield d(this, pA, Je).call(this), s(this, XA).write(A);
5975
+ return d(this, pA, Je).call(this), yield d(this, pA, Me).call(this), s(this, XA).write(A);
5976
5976
  });
5977
5977
  }
5978
5978
  writeString(A) {
5979
5979
  return r(this, null, function* () {
5980
- return d(this, pA, Le).call(this), yield d(this, pA, Je).call(this), s(this, XA).writeString(A);
5980
+ return d(this, pA, Je).call(this), yield d(this, pA, Me).call(this), s(this, XA).writeString(A);
5981
5981
  });
5982
5982
  }
5983
5983
  flush() {
5984
5984
  return r(this, null, function* () {
5985
- d(this, pA, Le).call(this), E(this, si, !0), yield s(this, XA).flush();
5985
+ d(this, pA, Je).call(this), E(this, Bi, !0), yield s(this, XA).flush();
5986
5986
  });
5987
5987
  }
5988
5988
  close() {
5989
5989
  return r(this, null, function* () {
5990
- s(this, RI) || (E(this, si, !0), yield d(this, pA, Je).call(this, !1), yield s(this, XA).flush(), E(this, RI, !0), s(this, ks).call(this));
5990
+ s(this, RI) || (E(this, Bi, !0), yield d(this, pA, Me).call(this, !1), yield s(this, XA).flush(), E(this, RI, !0), s(this, ks).call(this));
5991
5991
  });
5992
5992
  }
5993
5993
  }
5994
- XA = new WeakMap(), Gs = new WeakMap(), si = new WeakMap(), RI = new WeakMap(), ks = new WeakMap(), pA = new WeakSet(), Le = function() {
5994
+ XA = new WeakMap(), Gs = new WeakMap(), Bi = new WeakMap(), RI = new WeakMap(), ks = new WeakMap(), pA = new WeakSet(), Je = function() {
5995
5995
  if (s(this, RI))
5996
5996
  throw new Error("Stream is closed");
5997
- }, Je = function(A = !0) {
5998
- if (s(this, si))
5999
- return E(this, si, !1), s(this, XA).writeUnsigned8(s(this, Gs) | (A ? yl : 0));
5997
+ }, Me = function(A = !0) {
5998
+ if (s(this, Bi))
5999
+ return E(this, Bi, !1), s(this, XA).writeUnsigned8(s(this, Gs) | (A ? yl : 0));
6000
6000
  };
6001
- var Ee, Tt, UI, Bi, Pt, NI, bI, uC, HE;
6001
+ var ce, Tt, UI, Ci, Pt, NI, bI, uC, HE;
6002
6002
  class pl {
6003
6003
  constructor(A, t) {
6004
6004
  n(this, uC);
6005
- n(this, Ee);
6005
+ n(this, ce);
6006
6006
  n(this, Tt);
6007
6007
  n(this, UI);
6008
- n(this, Bi);
6008
+ n(this, Ci);
6009
6009
  n(this, Pt, /* @__PURE__ */ new Map());
6010
6010
  n(this, NI, SA.get().createContext("WebSocketConnection"));
6011
6011
  n(this, bI, new Set(new Array(128).fill(0).map((A, t) => t + 1)));
6012
- E(this, Ee, A), E(this, Tt, t), E(this, UI, new ReadableStream(new qd(A))), s(this, Ee).addEventListener("close", () => {
6012
+ E(this, ce, A), E(this, Tt, t), E(this, UI, new ReadableStream(new qd(A))), s(this, ce).addEventListener("close", () => {
6013
6013
  s(this, Tt).markPostHandshake(), s(this, Pt).forEach((e) => e.close());
6014
6014
  });
6015
6015
  }
@@ -6018,14 +6018,14 @@ class pl {
6018
6018
  if (!A)
6019
6019
  throw new Error("No stream IDs available");
6020
6020
  return s(this, bI).delete(A), Promise.resolve(
6021
- new fl(new xg(s(this, Ee)), A, () => d(this, uC, HE).call(this, A))
6021
+ new fl(new xg(s(this, ce)), A, () => d(this, uC, HE).call(this, A))
6022
6022
  );
6023
6023
  }
6024
6024
  transportType() {
6025
6025
  return "websocket";
6026
6026
  }
6027
6027
  url() {
6028
- return s(this, Ee).url;
6028
+ return s(this, ce).url;
6029
6029
  }
6030
6030
  afterHandshake() {
6031
6031
  return s(this, Tt).postHandshake();
@@ -6034,9 +6034,9 @@ class pl {
6034
6034
  return r(this, null, function* () {
6035
6035
  var A;
6036
6036
  for (; ; ) {
6037
- E(this, Bi, s(this, UI).getReader());
6037
+ E(this, Ci, s(this, UI).getReader());
6038
6038
  try {
6039
- const { value: t, done: e } = yield s(this, Bi).read();
6039
+ const { value: t, done: e } = yield s(this, Ci).read();
6040
6040
  if (e)
6041
6041
  return;
6042
6042
  const [g, B, C] = t;
@@ -6060,14 +6060,14 @@ class pl {
6060
6060
  return yield IE(new ZB(C, a), B);
6061
6061
  }
6062
6062
  } finally {
6063
- (A = s(this, Bi)) == null || A.releaseLock();
6063
+ (A = s(this, Ci)) == null || A.releaseLock();
6064
6064
  }
6065
6065
  }
6066
6066
  });
6067
6067
  }
6068
6068
  close() {
6069
6069
  var A;
6070
- return s(this, Tt).cancel().catch(q), s(this, UI).cancel("closing").catch(q), (A = s(this, Bi)) == null || A.cancel("closing").catch(q), s(this, Ee).close();
6070
+ return s(this, Tt).cancel().catch(q), s(this, UI).cancel("closing").catch(q), (A = s(this, Ci)) == null || A.cancel("closing").catch(q), s(this, ce).close();
6071
6071
  }
6072
6072
  closed() {
6073
6073
  return Promise.resolve();
@@ -6083,30 +6083,32 @@ class pl {
6083
6083
  });
6084
6084
  }
6085
6085
  }
6086
- Ee = new WeakMap(), Tt = new WeakMap(), UI = new WeakMap(), Bi = new WeakMap(), Pt = new WeakMap(), NI = new WeakMap(), bI = new WeakMap(), uC = new WeakSet(), /**
6086
+ ce = new WeakMap(), Tt = new WeakMap(), UI = new WeakMap(), Ci = new WeakMap(), Pt = new WeakMap(), NI = new WeakMap(), bI = new WeakMap(), uC = new WeakSet(), /**
6087
6087
  * Return a stream ID to the pool of available stream IDs
6088
6088
  * @param streamId - The stream ID to return
6089
6089
  */
6090
6090
  HE = function(A) {
6091
6091
  s(this, bI).add(A);
6092
6092
  };
6093
- var re, ce, Ci, Rs, Us, wC, DC, qE;
6093
+ var xt, Wt, he, Rs, Us, wC, DC, qE;
6094
6094
  class Fl {
6095
6095
  constructor(A, t, e) {
6096
6096
  n(this, DC);
6097
- n(this, re);
6098
- n(this, ce);
6099
- n(this, Ci, new AQ(100));
6097
+ n(this, xt);
6098
+ n(this, Wt);
6099
+ n(this, he, new AQ(100));
6100
6100
  n(this, Rs);
6101
6101
  n(this, Us, 0);
6102
6102
  n(this, wC, SA.get().createContext("WebTransportConnection"));
6103
- E(this, Rs, e), E(this, re, A), E(this, ce, t), d(this, DC, qE).call(this).catch((g) => {
6104
- s(this, wC).debug("Incoming streams handling ended with error", g), s(this, ce).markPostHandshake(), s(this, Ci).close();
6103
+ E(this, Rs, e), E(this, xt, A), E(this, Wt, t), d(this, DC, qE).call(this).catch((g) => {
6104
+ s(this, wC).debug("Incoming streams handling ended with error", g), s(this, Wt).markPostHandshake(), s(this, he).close();
6105
+ }), s(this, xt).closed.then(() => {
6106
+ s(this, Wt).markPostHandshake(), s(this, he).close();
6105
6107
  });
6106
6108
  }
6107
6109
  openSendStream() {
6108
6110
  return r(this, null, function* () {
6109
- const A = yield s(this, re).createUnidirectionalStream();
6111
+ const A = yield s(this, xt).createUnidirectionalStream();
6110
6112
  return new gE(A);
6111
6113
  });
6112
6114
  }
@@ -6117,43 +6119,43 @@ class Fl {
6117
6119
  return s(this, Rs);
6118
6120
  }
6119
6121
  afterHandshake() {
6120
- return s(this, ce).postHandshake();
6122
+ return s(this, Wt).postHandshake();
6121
6123
  }
6122
6124
  closed() {
6123
6125
  return r(this, null, function* () {
6124
- yield s(this, re).closed;
6126
+ yield s(this, xt).closed;
6125
6127
  });
6126
6128
  }
6127
6129
  close() {
6128
- s(this, re).close();
6130
+ s(this, xt).close();
6129
6131
  }
6130
6132
  writeMessage(A) {
6131
6133
  return r(this, null, function* () {
6132
- yield s(this, ce).write(A);
6134
+ yield s(this, Wt).write(A);
6133
6135
  });
6134
6136
  }
6135
6137
  readMessage() {
6136
6138
  return r(this, null, function* () {
6137
- return s(this, ce).read();
6139
+ return s(this, Wt).read();
6138
6140
  });
6139
6141
  }
6140
6142
  objectStream() {
6141
6143
  return r(this, null, function* () {
6142
- return s(this, Ci).pop();
6144
+ return s(this, he).pop();
6143
6145
  });
6144
6146
  }
6145
6147
  }
6146
- re = new WeakMap(), ce = new WeakMap(), Ci = new WeakMap(), Rs = new WeakMap(), Us = new WeakMap(), wC = new WeakMap(), DC = new WeakSet(), qE = function() {
6148
+ xt = new WeakMap(), Wt = new WeakMap(), he = new WeakMap(), Rs = new WeakMap(), Us = new WeakMap(), wC = new WeakMap(), DC = new WeakSet(), qE = function() {
6147
6149
  return r(this, null, function* () {
6148
- const A = s(this, re).incomingUnidirectionalStreams.getReader();
6150
+ const A = s(this, xt).incomingUnidirectionalStreams.getReader();
6149
6151
  for (; ; ) {
6150
6152
  const { value: t, done: e } = yield A.read();
6151
6153
  if (e) {
6152
- s(this, Ci).close();
6154
+ s(this, he).close();
6153
6155
  return;
6154
6156
  }
6155
6157
  const g = new ZB(new Uint8Array(), t);
6156
- yield s(this, Ci).push(IE(g, s(this, Us))), At(this, Us)._++;
6158
+ yield s(this, he).push(IE(g, s(this, Us))), At(this, Us)._++;
6157
6159
  }
6158
6160
  });
6159
6161
  };
@@ -6198,10 +6200,10 @@ function kl(i) {
6198
6200
  return yQ(i);
6199
6201
  });
6200
6202
  }
6201
- var xt;
6202
- class Xt {
6203
+ var Ot;
6204
+ class zt {
6203
6205
  constructor() {
6204
- n(this, xt, {
6206
+ n(this, Ot, {
6205
6207
  name: "",
6206
6208
  priority: 0,
6207
6209
  groupOrder: "descending",
@@ -6209,36 +6211,36 @@ class Xt {
6209
6211
  });
6210
6212
  }
6211
6213
  name(A) {
6212
- return s(this, xt).name = A, this;
6214
+ return s(this, Ot).name = A, this;
6213
6215
  }
6214
6216
  priority(A) {
6215
- return s(this, xt).priority = A, this;
6217
+ return s(this, Ot).priority = A, this;
6216
6218
  }
6217
6219
  groupOrder(A) {
6218
- return s(this, xt).groupOrder = A, this;
6220
+ return s(this, Ot).groupOrder = A, this;
6219
6221
  }
6220
6222
  /**
6221
6223
  * @param startGroup the group to start the subscription at
6222
6224
  * @returns the builder
6223
6225
  */
6224
6226
  startGroup(A) {
6225
- return s(this, xt).filterType = {
6227
+ return s(this, Ot).filterType = {
6226
6228
  type: "absolute-start",
6227
6229
  start: { group: A, object: H(0) }
6228
6230
  }, this;
6229
6231
  }
6230
6232
  range(A, t) {
6231
- return s(this, xt).filterType = {
6233
+ return s(this, Ot).filterType = {
6232
6234
  type: "absolute-range",
6233
6235
  start: { group: A, object: H(0) },
6234
6236
  end: { group: t, object: H(0) }
6235
6237
  }, this;
6236
6238
  }
6237
6239
  build() {
6238
- return s(this, xt);
6240
+ return s(this, Ot);
6239
6241
  }
6240
6242
  }
6241
- xt = new WeakMap();
6243
+ Ot = new WeakMap();
6242
6244
  var LI, Ns;
6243
6245
  class vE {
6244
6246
  constructor(A, t) {
@@ -6260,7 +6262,7 @@ LI = new WeakMap(), Ns = new WeakMap();
6260
6262
  function Rl(i, A) {
6261
6263
  return ["com.vindral.moq", i];
6262
6264
  }
6263
- function Re(i) {
6265
+ function Ue(i) {
6264
6266
  const A = i[1];
6265
6267
  if (!A)
6266
6268
  throw new Error("namespace must contain a channel ID");
@@ -6361,7 +6363,7 @@ YA = new WeakMap(), ft = new WeakMap(), Qi = new WeakMap(), jA = new WeakMap(),
6361
6363
  }), e;
6362
6364
  };
6363
6365
  let $B = An;
6364
- var ot, oi, Wt, pt, Js, so, Ms;
6366
+ var ot, oi, Vt, pt, Js, so, Ms;
6365
6367
  const tn = class tn {
6366
6368
  constructor(A) {
6367
6369
  n(this, Js);
@@ -6370,7 +6372,7 @@ const tn = class tn {
6370
6372
  // The current group iterator - gets replaced by the next in #groups when it runs out
6371
6373
  n(this, oi);
6372
6374
  // The next group iterators to switch to when the current one runs out
6373
- n(this, Wt, new AQ(10));
6375
+ n(this, Vt, new AQ(10));
6374
6376
  n(this, pt);
6375
6377
  n(this, Ms, (A, t) => r(this, null, function* () {
6376
6378
  var h = [];
@@ -6383,7 +6385,7 @@ const tn = class tn {
6383
6385
  }
6384
6386
  const B = e.value.largestGroupId();
6385
6387
  const C = B !== void 0;
6386
- const Q = new Xt().name(t.name).priority(t.priority).groupOrder(t.groupOrder);
6388
+ const Q = new zt().name(t.name).priority(t.priority).groupOrder(t.groupOrder);
6387
6389
  g.largestGroupId = B;
6388
6390
  s(this, pt).debug("Renewing subscription", g);
6389
6391
  switch (t.filterType.type) {
@@ -6406,7 +6408,7 @@ const tn = class tn {
6406
6408
  a.expiryNotification().then(() => s(this, Ms).call(this, A, o)).catch(q);
6407
6409
  const c = new $B(a, B);
6408
6410
  e.value = c;
6409
- yield s(this, Wt).push(c);
6411
+ yield s(this, Vt).push(c);
6410
6412
  s(this, pt).info("Subscription renewed", g);
6411
6413
  } catch (l) {
6412
6414
  var u = l, S = !0;
@@ -6436,7 +6438,7 @@ const tn = class tn {
6436
6438
  var g = [];
6437
6439
  try {
6438
6440
  const e = xA(g, yield s(this, ot).lock());
6439
- s(this, Wt).close();
6441
+ s(this, Vt).close();
6440
6442
  return e.value.update(A, t);
6441
6443
  } catch (B) {
6442
6444
  var C = B, Q = !0;
@@ -6450,7 +6452,7 @@ const tn = class tn {
6450
6452
  var e = [];
6451
6453
  try {
6452
6454
  const t = xA(e, yield s(this, ot).lock());
6453
- s(this, Wt).close();
6455
+ s(this, Vt).close();
6454
6456
  return t.value.endOfTrack(A);
6455
6457
  } catch (g) {
6456
6458
  var B = g, C = !0;
@@ -6464,7 +6466,7 @@ const tn = class tn {
6464
6466
  var t = [];
6465
6467
  try {
6466
6468
  const A = xA(t, yield s(this, ot).lock());
6467
- s(this, Wt).close();
6469
+ s(this, Vt).close();
6468
6470
  return A.value.unsubscribe();
6469
6471
  } catch (e) {
6470
6472
  var g = e, B = !0;
@@ -6478,7 +6480,7 @@ const tn = class tn {
6478
6480
  var t = [];
6479
6481
  try {
6480
6482
  const A = xA(t, yield s(this, ot).lock());
6481
- s(this, Wt).close();
6483
+ s(this, Vt).close();
6482
6484
  return A.value.return();
6483
6485
  } catch (e) {
6484
6486
  var g = e, B = !0;
@@ -6493,7 +6495,7 @@ const tn = class tn {
6493
6495
  const A = yield s(this, oi).next();
6494
6496
  if (A.done) {
6495
6497
  yield (e = (t = s(this, oi)).return) == null ? void 0 : e.call(t);
6496
- const g = yield s(this, Wt).pop();
6498
+ const g = yield s(this, Vt).pop();
6497
6499
  if (g)
6498
6500
  return E(this, oi, g), this.next();
6499
6501
  }
@@ -6532,7 +6534,7 @@ const tn = class tn {
6532
6534
  });
6533
6535
  }
6534
6536
  };
6535
- ot = new WeakMap(), oi = new WeakMap(), Wt = new WeakMap(), pt = new WeakMap(), Js = new WeakSet(), so = function(A) {
6537
+ ot = new WeakMap(), oi = new WeakMap(), Vt = new WeakMap(), pt = new WeakMap(), Js = new WeakSet(), so = function(A) {
6536
6538
  return r(this, null, function* () {
6537
6539
  var t;
6538
6540
  if (A.unsubscribed() || (t = A.range()) != null && t.endGroup) {
@@ -6546,7 +6548,7 @@ ot = new WeakMap(), oi = new WeakMap(), Wt = new WeakMap(), pt = new WeakMap(),
6546
6548
  return this.return();
6547
6549
  });
6548
6550
  }, Ms = new WeakMap();
6549
- let pe = tn;
6551
+ let Fe = tn;
6550
6552
  const bl = "catalog";
6551
6553
  function Hn(i) {
6552
6554
  const A = Nl(i.payload);
@@ -6554,33 +6556,33 @@ function Hn(i) {
6554
6556
  throw new Error("unexpected catalog type");
6555
6557
  return A;
6556
6558
  }
6557
- var he, Hs, qs, vs, mC, KE;
6559
+ var de, Hs, qs, vs, mC, KE;
6558
6560
  const yC = class yC {
6559
6561
  constructor(A, t, e) {
6560
6562
  n(this, mC);
6561
- n(this, he);
6563
+ n(this, de);
6562
6564
  n(this, Hs);
6563
6565
  n(this, qs);
6564
6566
  n(this, vs);
6565
- E(this, Hs, A), E(this, he, t), E(this, qs, e), E(this, vs, d(this, mC, KE).call(this)), this.closed().finally(() => s(this, he).close()).catch(q);
6567
+ E(this, Hs, A), E(this, de, t), E(this, qs, e), E(this, vs, d(this, mC, KE).call(this)), this.closed().finally(() => s(this, de).close()).catch(q);
6566
6568
  }
6567
6569
  catalog() {
6568
- return s(this, he);
6570
+ return s(this, de);
6569
6571
  }
6570
6572
  closed() {
6571
6573
  return s(this, vs);
6572
6574
  }
6573
6575
  close() {
6574
6576
  return r(this, null, function* () {
6575
- return s(this, he).close(), (yield s(this, Hs).promise).unsubscribe();
6577
+ return s(this, de).close(), (yield s(this, Hs).promise).unsubscribe();
6576
6578
  });
6577
6579
  }
6578
6580
  static start(A, t) {
6579
6581
  return r(this, null, function* () {
6580
6582
  const e = j.fromPromise(
6581
- pe.subscribe(
6583
+ Fe.subscribe(
6582
6584
  A,
6583
- new Xt().name(t.catalogName || bl).groupOrder("ascending").build()
6585
+ new zt().name(t.catalogName || bl).groupOrder("ascending").build()
6584
6586
  )
6585
6587
  ), g = j.fromPromise(e.promise.then((o) => o.objects()));
6586
6588
  if (t.catalog)
@@ -6593,7 +6595,7 @@ const yC = class yC {
6593
6595
  });
6594
6596
  }
6595
6597
  };
6596
- he = new WeakMap(), Hs = new WeakMap(), qs = new WeakMap(), vs = new WeakMap(), mC = new WeakSet(), KE = function() {
6598
+ de = new WeakMap(), Hs = new WeakMap(), qs = new WeakMap(), vs = new WeakMap(), mC = new WeakSet(), KE = function() {
6597
6599
  return r(this, null, function* () {
6598
6600
  const A = yield s(this, qs).promise;
6599
6601
  try {
@@ -6602,7 +6604,7 @@ he = new WeakMap(), Hs = new WeakMap(), qs = new WeakMap(), vs = new WeakMap(),
6602
6604
  if (C.objectStatus !== UA.Normal)
6603
6605
  continue;
6604
6606
  const Q = Hn(C);
6605
- s(this, he).update(Q);
6607
+ s(this, de).update(Q);
6606
6608
  }
6607
6609
  } catch (g) {
6608
6610
  B = [g];
@@ -6695,18 +6697,18 @@ const Zi = class Zi {
6695
6697
  var c;
6696
6698
  if (t.format !== "cmaf")
6697
6699
  throw new Error("format must be cmaf");
6698
- const B = new Xt().name(t.name);
6700
+ const B = new zt().name(t.name);
6699
6701
  g && B.startGroup(g);
6700
6702
  const C = B.build();
6701
6703
  if (t.initTrack) {
6702
- const h = new Xt().name(t.initTrack).build(), [l, u] = yield Promise.all([
6704
+ const h = new zt().name(t.initTrack).build(), [l, u] = yield Promise.all([
6703
6705
  d(c = Zi, fC, YE).call(c, A, h),
6704
- pe.subscribe(A, C, g ? g - H(1) : void 0)
6706
+ Fe.subscribe(A, C, g ? g - H(1) : void 0)
6705
6707
  ]), S = new Rn(l);
6706
6708
  return new Zi(t, A.namespace(), u, S, e);
6707
6709
  }
6708
6710
  lA(t.initData, "no init data found on track");
6709
- const Q = Sa(t.initData), o = new Rn(new Uint8Array(Q)), a = yield pe.subscribe(A, C, g ? g - H(1) : void 0);
6711
+ const Q = Sa(t.initData), o = new Rn(new Uint8Array(Q)), a = yield Fe.subscribe(A, C, g ? g - H(1) : void 0);
6710
6712
  return new Zi(t, A.namespace(), a, o, e);
6711
6713
  });
6712
6714
  }
@@ -6776,17 +6778,17 @@ Ps = new WeakMap(), Ft = new WeakMap(), xs = new WeakMap(), Ws = new WeakMap(),
6776
6778
  }, n(Zi, fC);
6777
6779
  let Qo = Zi;
6778
6780
  const qn = 1e4, Jl = 3e4;
6779
- var pC, de, ni, Os, Vs, Zs, ki, no, TE;
6781
+ var pC, le, ni, Os, Vs, Zs, ki, no, TE;
6780
6782
  const en = class en {
6781
6783
  constructor(A, t, e) {
6782
6784
  n(this, ki);
6783
6785
  n(this, pC, SA.get().createContext("Timeline"));
6784
- n(this, de, new NA([]));
6786
+ n(this, le, new NA([]));
6785
6787
  n(this, ni);
6786
6788
  n(this, Os);
6787
6789
  n(this, Vs);
6788
6790
  n(this, Zs);
6789
- E(this, Os, A), E(this, Vs, e), E(this, ni, t), E(this, Zs, d(this, ki, no).call(this, s(this, ni))), this.closed().finally(() => s(this, de).close()).catch(q);
6791
+ E(this, Os, A), E(this, Vs, e), E(this, ni, t), E(this, Zs, d(this, ki, no).call(this, s(this, ni))), this.closed().finally(() => s(this, le).close()).catch(q);
6790
6792
  }
6791
6793
  closed() {
6792
6794
  return s(this, Zs);
@@ -6797,7 +6799,7 @@ const en = class en {
6797
6799
  });
6798
6800
  }
6799
6801
  timeline() {
6800
- const [A, t] = s(this, de).value();
6802
+ const [A, t] = s(this, le).value();
6801
6803
  return A;
6802
6804
  }
6803
6805
  /**
@@ -6809,25 +6811,25 @@ const en = class en {
6809
6811
  }
6810
6812
  static start(A, t) {
6811
6813
  const e = j.fromPromise(
6812
- pe.subscribe(A, new Xt().name(t).groupOrder("ascending").build())
6814
+ Fe.subscribe(A, new zt().name(t).groupOrder("ascending").build())
6813
6815
  );
6814
6816
  return new en(A, e, t);
6815
6817
  }
6816
6818
  waitForWallclockTime(A) {
6817
6819
  return r(this, null, function* () {
6818
- return yield s(this, de).waitFor((t) => !!t.find((e) => e.wallclock >= A)), this.timeline();
6820
+ return yield s(this, le).waitFor((t) => !!t.find((e) => e.wallclock >= A)), this.timeline();
6819
6821
  });
6820
6822
  }
6821
6823
  waitForTimelineToHaveMinDuration() {
6822
6824
  return r(this, null, function* () {
6823
- return yield s(this, de).waitFor((A) => {
6825
+ return yield s(this, le).waitFor((A) => {
6824
6826
  const t = A[0], e = A[A.length - 1];
6825
6827
  return !t || !e ? !1 : e.wallclock - t.wallclock > qn;
6826
6828
  }), this.timeline();
6827
6829
  });
6828
6830
  }
6829
6831
  };
6830
- pC = new WeakMap(), de = new WeakMap(), ni = new WeakMap(), Os = new WeakMap(), Vs = new WeakMap(), Zs = new WeakMap(), ki = new WeakSet(), no = function(A) {
6832
+ pC = new WeakMap(), le = new WeakMap(), ni = new WeakMap(), Os = new WeakMap(), Vs = new WeakMap(), Zs = new WeakMap(), ki = new WeakSet(), no = function(A) {
6831
6833
  return r(this, null, function* () {
6832
6834
  const t = yield A.promise;
6833
6835
  try {
@@ -6842,7 +6844,7 @@ pC = new WeakMap(), de = new WeakMap(), ni = new WeakMap(), Os = new WeakMap(),
6842
6844
  if (y.objectStatus !== UA.Normal)
6843
6845
  continue;
6844
6846
  const U = Ml(y.payload);
6845
- s(this, de).update((F) => {
6847
+ s(this, le).update((F) => {
6846
6848
  var J, T;
6847
6849
  for (F.push(...U), F.sort((nA, $) => nA.wallclock - $.wallclock); F[0] && ((T = (J = F[F.length - 1]) == null ? void 0 : J.wallclock) != null ? T : 0) - F[0].wallclock > Jl; )
6848
6850
  F.shift();
@@ -6885,9 +6887,9 @@ pC = new WeakMap(), de = new WeakMap(), ni = new WeakMap(), Os = new WeakMap(),
6885
6887
  if (!g || !B || B.wallclock - g.wallclock > qn)
6886
6888
  return;
6887
6889
  const C = j.fromPromise(
6888
- pe.subscribe(
6890
+ Fe.subscribe(
6889
6891
  s(this, Os),
6890
- new Xt().name(s(this, Vs)).groupOrder("ascending").range(t, t).build()
6892
+ new zt().name(s(this, Vs)).groupOrder("ascending").range(t, t).build()
6891
6893
  )
6892
6894
  );
6893
6895
  return d(this, ki, no).call(this, C);
@@ -6914,33 +6916,33 @@ function Ml(i) {
6914
6916
  function Hl(i) {
6915
6917
  return typeof i.language == "string";
6916
6918
  }
6917
- var FC, Xs, le, HI;
6919
+ var FC, Xs, ue, HI;
6918
6920
  const In = class In {
6919
6921
  constructor(A, t, e, g, B) {
6920
6922
  n(this, FC, new $a());
6921
6923
  n(this, Xs);
6922
- n(this, le);
6924
+ n(this, ue);
6923
6925
  n(this, HI, 0);
6924
6926
  I(this, "trackObject");
6925
6927
  I(this, "namespace");
6926
- E(this, le, A), E(this, Xs, t), this.trackObject = e, this.namespace = g, E(this, HI, B);
6928
+ E(this, ue, A), E(this, Xs, t), this.trackObject = e, this.namespace = g, E(this, HI, B);
6927
6929
  }
6928
6930
  static subscribe(A, t, e) {
6929
6931
  return r(this, null, function* () {
6930
6932
  if (!Hl(t))
6931
6933
  throw new Error("track object language is required");
6932
- const g = new Xt().name(t.name).build(), B = yield pe.subscribe(A, g), C = B.objects();
6934
+ const g = new zt().name(t.name).build(), B = yield Fe.subscribe(A, g), C = B.objects();
6933
6935
  return new In(B, C, t, A.namespace(), e);
6934
6936
  });
6935
6937
  }
6936
6938
  largestGroupId() {
6937
- return s(this, le).largestGroupId();
6939
+ return s(this, ue).largestGroupId();
6938
6940
  }
6939
6941
  update(A, t) {
6940
- return s(this, le).update(A, t);
6942
+ return s(this, ue).update(A, t);
6941
6943
  }
6942
6944
  unsubscribe() {
6943
- return s(this, le).unsubscribe();
6945
+ return s(this, ue).unsubscribe();
6944
6946
  }
6945
6947
  next() {
6946
6948
  return r(this, null, function* () {
@@ -6960,7 +6962,7 @@ const In = class In {
6960
6962
  }
6961
6963
  return() {
6962
6964
  return r(this, null, function* () {
6963
- return yield s(this, le).return(), { done: !0, value: void 0 };
6965
+ return yield s(this, ue).return(), { done: !0, value: void 0 };
6964
6966
  });
6965
6967
  }
6966
6968
  [Symbol.asyncIterator]() {
@@ -6973,9 +6975,9 @@ const In = class In {
6973
6975
  return this.unsubscribe();
6974
6976
  }
6975
6977
  };
6976
- FC = new WeakMap(), Xs = new WeakMap(), le = new WeakMap(), HI = new WeakMap();
6978
+ FC = new WeakMap(), Xs = new WeakMap(), ue = new WeakMap(), HI = new WeakMap();
6977
6979
  let ao = In;
6978
- var la, ai, Ei, ri, ue, vQ, qI, pB;
6980
+ var la, ai, Ei, ri, we, vQ, qI, pB;
6979
6981
  la = [HA({ context: "Channel", enter: "info" })];
6980
6982
  const Xi = class Xi {
6981
6983
  constructor(A, t, e, g, B) {
@@ -6984,8 +6986,8 @@ const Xi = class Xi {
6984
6986
  n(this, ai);
6985
6987
  n(this, Ei);
6986
6988
  n(this, ri);
6987
- n(this, ue);
6988
- this.namespace = g, E(this, ai, A), E(this, Ei, t), E(this, ri, e), E(this, ue, B);
6989
+ n(this, we);
6990
+ this.namespace = g, E(this, ai, A), E(this, Ei, t), E(this, ri, e), E(this, we, B);
6989
6991
  }
6990
6992
  static start(A, t) {
6991
6993
  return r(this, null, function* () {
@@ -7006,20 +7008,20 @@ const Xi = class Xi {
7006
7008
  return s(this, Ei).timestampWallclockOffset();
7007
7009
  }
7008
7010
  timestampOffsetMs() {
7009
- return s(this, ue);
7011
+ return s(this, we);
7010
7012
  }
7011
7013
  setTimestampOffsetMs(A) {
7012
- E(this, ue, A);
7014
+ E(this, we, A);
7013
7015
  }
7014
7016
  waitForWallclockTime(A) {
7015
7017
  return s(this, Ei).waitForWallclockTime(A);
7016
7018
  }
7017
7019
  subscribeCmafTrack(A, t) {
7018
7020
  const e = this.catalog().current().tracks, g = A["com.vindral.variant_uid"] !== void 0 ? e.find((B) => B["com.vindral.variant_uid"] === A["com.vindral.variant_uid"]) : void 0;
7019
- return d(this, qI, pB).call(this, () => Qo.subscribe(s(this, ai), g != null ? g : A, s(this, ue), t));
7021
+ return d(this, qI, pB).call(this, () => Qo.subscribe(s(this, ai), g != null ? g : A, s(this, we), t));
7020
7022
  }
7021
7023
  subscribeWebVttTrack(A) {
7022
- return d(this, qI, pB).call(this, () => ao.subscribe(s(this, ai), A, s(this, ue)));
7024
+ return d(this, qI, pB).call(this, () => ao.subscribe(s(this, ai), A, s(this, we)));
7023
7025
  }
7024
7026
  subscribeTrack(A) {
7025
7027
  return d(this, qI, pB).call(this, () => s(this, ai).subscribe(A));
@@ -7031,7 +7033,7 @@ const Xi = class Xi {
7031
7033
  return Promise.all([s(this, ri).close(), s(this, Ei).close()]);
7032
7034
  }
7033
7035
  };
7034
- vQ = Ge(null), ai = new WeakMap(), Ei = new WeakMap(), ri = new WeakMap(), ue = new WeakMap(), qI = new WeakSet(), pB = function(A) {
7036
+ vQ = ke(null), ai = new WeakMap(), Ei = new WeakMap(), ri = new WeakMap(), we = new WeakMap(), qI = new WeakSet(), pB = function(A) {
7035
7037
  return r(this, null, function* () {
7036
7038
  const [t, e] = this.catalog().value();
7037
7039
  try {
@@ -7042,7 +7044,7 @@ vQ = Ge(null), ai = new WeakMap(), Ei = new WeakMap(), ri = new WeakMap(), ue =
7042
7044
  throw g;
7043
7045
  }
7044
7046
  });
7045
- }, FA(vQ, 9, "start", la, Xi), zt(vQ, Xi), ke(vQ, 3, Xi);
7047
+ }, FA(vQ, 9, "start", la, Xi), $t(vQ, Xi), Re(vQ, 3, Xi);
7046
7048
  let AC = Xi;
7047
7049
  var ci, js, GC, PE;
7048
7050
  const gn = class gn {
@@ -7126,7 +7128,7 @@ class Zo {
7126
7128
  return r(this, null, function* () {
7127
7129
  var o = [];
7128
7130
  try {
7129
- const g = xA(o, yield A.subscribeTrack(new Xt().name("drm").build()), !0);
7131
+ const g = xA(o, yield A.subscribeTrack(new zt().name("drm").build()), !0);
7130
7132
  const B = g.objects();
7131
7133
  const C = yield B.next();
7132
7134
  if (C.done)
@@ -7178,7 +7180,7 @@ const sn = class sn {
7178
7180
  }
7179
7181
  static start(A) {
7180
7182
  return r(this, null, function* () {
7181
- const e = (yield A.subscribe(new Xt().name("stats").groupOrder("ascending").build())).objects(), g = yield e.next();
7183
+ const e = (yield A.subscribe(new zt().name("stats").groupOrder("ascending").build())).objects(), g = yield e.next();
7182
7184
  if (g.done)
7183
7185
  throw new Error("No stats object received");
7184
7186
  const B = vn(g.value.payload);
@@ -7279,10 +7281,10 @@ class fQ {
7279
7281
  }
7280
7282
  }
7281
7283
  KI = new WeakMap(), _s = new WeakMap(), $s = new WeakMap();
7282
- var ua, wa, Da, YI, TI, hi, uA, nt, at, we, PI, AB, og, Ot, bA, FB, cg, WE, co;
7283
- let xl = (Da = [HA({ context: "Player", enter: "info" })], wa = [HA({ context: "Player", enter: "info", return: "info" })], ua = [HA({ context: "Player", enter: "info" })], Ot = class {
7284
+ var ua, wa, Da, YI, TI, hi, uA, nt, at, De, PI, AB, og, Zt, bA, FB, cg, WE, co;
7285
+ let xl = (Da = [HA({ context: "Player", enter: "info" })], wa = [HA({ context: "Player", enter: "info", return: "info" })], ua = [HA({ context: "Player", enter: "info" })], Zt = class {
7284
7286
  constructor(A, t, e) {
7285
- ke(og, 5, this);
7287
+ Re(og, 5, this);
7286
7288
  n(this, bA);
7287
7289
  n(this, YI);
7288
7290
  n(this, TI);
@@ -7290,10 +7292,10 @@ let xl = (Da = [HA({ context: "Player", enter: "info" })], wa = [HA({ context: "
7290
7292
  n(this, uA);
7291
7293
  n(this, nt, new NA(void 0));
7292
7294
  n(this, at, new NA(void 0));
7293
- n(this, we, new NA(void 0));
7295
+ n(this, De, new NA(void 0));
7294
7296
  n(this, PI);
7295
7297
  n(this, AB);
7296
- I(this, "subtitles", new fQ(s(this, we), "subtitles"));
7298
+ I(this, "subtitles", new fQ(s(this, De), "subtitles"));
7297
7299
  I(this, "video", new fQ(s(this, at), "video"));
7298
7300
  I(this, "audio", new fQ(s(this, nt), "audio"));
7299
7301
  E(this, YI, A), E(this, TI, Eo.start(e)), E(this, hi, e), E(this, uA, new NA(t)), E(this, PI, new Pl(t)), E(this, AB, Promise.race([e.idleTimeout(), d(this, bA, WE).call(this), s(this, PI).closed()])), s(this, YI).closed().then(() => this.close()).catch(q);
@@ -7310,7 +7312,7 @@ let xl = (Da = [HA({ context: "Player", enter: "info" })], wa = [HA({ context: "
7310
7312
  t.audioTrack ? a.subscribeCmafTrack(t.audioTrack) : void 0
7311
7313
  ])),
7312
7314
  ro.start(e)
7313
- ]), o = new Ot(A, g, Q);
7315
+ ]), o = new Zt(A, g, Q);
7314
7316
  return C && s(o, nt).update(C), B && s(o, at).update(B), o;
7315
7317
  });
7316
7318
  }
@@ -7358,7 +7360,7 @@ let xl = (Da = [HA({ context: "Player", enter: "info" })], wa = [HA({ context: "
7358
7360
  // Close the consumers so that the iterators will stop
7359
7361
  d(this, bA, FB).call(this, s(this, nt)),
7360
7362
  d(this, bA, FB).call(this, s(this, at)),
7361
- d(this, bA, FB).call(this, s(this, we))
7363
+ d(this, bA, FB).call(this, s(this, De))
7362
7364
  ]);
7363
7365
  }
7364
7366
  zap(A, t) {
@@ -7379,14 +7381,14 @@ let xl = (Da = [HA({ context: "Player", enter: "info" })], wa = [HA({ context: "
7379
7381
  return r(this, null, function* () {
7380
7382
  var e, g;
7381
7383
  if (!A) {
7382
- yield (e = s(this, we).current()) == null ? void 0 : e.unsubscribe();
7384
+ yield (e = s(this, De).current()) == null ? void 0 : e.unsubscribe();
7383
7385
  return;
7384
7386
  }
7385
7387
  const [t] = yield Promise.all([
7386
7388
  s(this, uA).current().subscribeWebVttTrack(A),
7387
- (g = s(this, we).current()) == null ? void 0 : g.unsubscribe()
7389
+ (g = s(this, De).current()) == null ? void 0 : g.unsubscribe()
7388
7390
  ]);
7389
- s(this, we).update(t);
7391
+ s(this, De).update(t);
7390
7392
  });
7391
7393
  }
7392
7394
  setVideoTrack(A, t) {
@@ -7401,7 +7403,7 @@ let xl = (Da = [HA({ context: "Player", enter: "info" })], wa = [HA({ context: "
7401
7403
  s(this, nt).update(e);
7402
7404
  });
7403
7405
  }
7404
- }, og = Ge(null), YI = new WeakMap(), TI = new WeakMap(), hi = new WeakMap(), uA = new WeakMap(), nt = new WeakMap(), at = new WeakMap(), we = new WeakMap(), PI = new WeakMap(), AB = new WeakMap(), bA = new WeakSet(), FB = function(A) {
7406
+ }, og = ke(null), YI = new WeakMap(), TI = new WeakMap(), hi = new WeakMap(), uA = new WeakMap(), nt = new WeakMap(), at = new WeakMap(), De = new WeakMap(), PI = new WeakMap(), AB = new WeakMap(), bA = new WeakSet(), FB = function(A) {
7405
7407
  const t = A.current(), e = t == null ? void 0 : t.largestGroupId();
7406
7408
  return A.isClosed() || A.update(void 0), A.close(), e ? t == null ? void 0 : t.update(e, e) : t == null ? void 0 : t.unsubscribe();
7407
7409
  }, cg = function(A, t, e, g) {
@@ -7464,13 +7466,13 @@ let xl = (Da = [HA({ context: "Player", enter: "info" })], wa = [HA({ context: "
7464
7466
  t.update(yield s(this, uA).current().subscribeCmafTrack(Q));
7465
7467
  }
7466
7468
  });
7467
- }, FA(og, 1, "close", Da, Ot), FA(og, 1, "zap", wa, Ot), cg = FA(og, 17, "#replaceTrack", ua, bA, cg), zt(og, Ot), Ot);
7469
+ }, FA(og, 1, "close", Da, Zt), FA(og, 1, "zap", wa, Zt), cg = FA(og, 17, "#replaceTrack", ua, bA, cg), $t(og, Zt), Zt);
7468
7470
  function pQ(i, A, t) {
7469
7471
  const e = new URL("/voq/subscribe", i);
7470
7472
  return e.searchParams.set("sessionId", A.sessionId), e.searchParams.set("clientId", A.clientId), e.searchParams.set("channelId", A.channelId), t && e.searchParams.set("authToken", t), e;
7471
7473
  }
7472
7474
  const Wl = 1e4;
7473
- var wA, kA, Et, di, iA, De, tB, eB, UC, xI, LA, OE, WI, iB, OI, VE, ZE, XE, jE, lo;
7475
+ var wA, kA, Et, di, iA, Se, tB, eB, UC, xI, LA, OE, WI, iB, OI, VE, ZE, XE, jE, lo;
7474
7476
  const Bn = class Bn {
7475
7477
  constructor(A, t, e, g, B, C) {
7476
7478
  n(this, LA);
@@ -7479,7 +7481,7 @@ const Bn = class Bn {
7479
7481
  n(this, Et);
7480
7482
  n(this, di, "disconnected");
7481
7483
  n(this, iA);
7482
- n(this, De, /* @__PURE__ */ new Map());
7484
+ n(this, Se, /* @__PURE__ */ new Map());
7483
7485
  n(this, tB);
7484
7486
  n(this, eB, new rA(10));
7485
7487
  n(this, UC, Number.MAX_SAFE_INTEGER);
@@ -7489,7 +7491,7 @@ const Bn = class Bn {
7489
7491
  s(this, iA).setSubtitleTrack(void 0).catch(q);
7490
7492
  return;
7491
7493
  }
7492
- const t = s(this, De).get(Re(s(this, iA).namespace())), e = t == null ? void 0 : t.getTextTrack(A);
7494
+ const t = s(this, Se).get(Ue(s(this, iA).namespace())), e = t == null ? void 0 : t.getTextTrack(A);
7493
7495
  e && s(this, iA).setSubtitleTrack(e).catch(q);
7494
7496
  });
7495
7497
  n(this, iB, (A) => {
@@ -7524,7 +7526,7 @@ const Bn = class Bn {
7524
7526
  I(this, "disconnect", (A = "Disconnect Requested") => {
7525
7527
  s(this, kA).info("Disconnecting", A), s(this, Et).close(), s(this, iA).close().catch(q), E(this, xI, /* @__PURE__ */ new Map()), E(this, di, "disconnected");
7526
7528
  });
7527
- E(this, wA, A), E(this, kA, t), E(this, Et, e), E(this, iA, g), E(this, De, B), E(this, tB, C), s(this, wA).on("send signal", s(this, iB)), s(this, wA).on("disconnect", this.disconnect), s(this, wA).on("text track", s(this, WI)), d(this, LA, OE).call(this).catch(q), d(this, LA, XE).call(this).catch(q);
7529
+ E(this, wA, A), E(this, kA, t), E(this, Et, e), E(this, iA, g), E(this, Se, B), E(this, tB, C), s(this, wA).on("send signal", s(this, iB)), s(this, wA).on("disconnect", this.disconnect), s(this, wA).on("text track", s(this, WI)), d(this, LA, OE).call(this).catch(q), d(this, LA, XE).call(this).catch(q);
7528
7530
  }
7529
7531
  get estimatedBandwidth() {
7530
7532
  return s(this, UC);
@@ -7539,7 +7541,7 @@ const Bn = class Bn {
7539
7541
  getStatistics() {
7540
7542
  const t = s(this, iA).connectionInfo().estimatedBandwidth;
7541
7543
  return {
7542
- rtt: ee(s(this, eB).items()),
7544
+ rtt: Ie(s(this, eB).items()),
7543
7545
  estimatedBandwidth: t,
7544
7546
  connectCount: 0,
7545
7547
  connectionAttemptCount: 0,
@@ -7552,7 +7554,7 @@ const Bn = class Bn {
7552
7554
  var L, y, U, F;
7553
7555
  const B = new Map(
7554
7556
  g.connectInfo.channels.map((J) => [
7555
- Re(J.catalog.namespace),
7557
+ Ue(J.catalog.namespace),
7556
7558
  new FQ(new NA(J.catalog))
7557
7559
  ])
7558
7560
  ), C = yield g.onConnectInfo(g.connectInfo), Q = g.options.get("authenticationToken");
@@ -7568,7 +7570,7 @@ const Bn = class Bn {
7568
7570
  }
7569
7571
  const c = (L = g.connectInfo.channels.find((J) => J.channelId === C.channelId)) == null ? void 0 : L.catalog;
7570
7572
  t.debug("Resolved edge url", { edgeUrl: o, edgeWsUrl: a }), lA(c, "no catalog found");
7571
- const h = (y = B.get(Re(c.namespace))) == null ? void 0 : y.getVideoTrack(C.video), l = (U = B.get(Re(c.namespace))) == null ? void 0 : U.getAudioTrack(C.audio), u = yield kl({
7573
+ const h = (y = B.get(Ue(c.namespace))) == null ? void 0 : y.getVideoTrack(C.video), l = (U = B.get(Ue(c.namespace))) == null ? void 0 : U.getAudioTrack(C.audio), u = yield kl({
7572
7574
  url: o,
7573
7575
  wsUrl: a,
7574
7576
  authToken: g.options.get("authenticationToken"),
@@ -7585,7 +7587,7 @@ const Bn = class Bn {
7585
7587
  Wo(Wl, new Error("Timeout waiting for player to start")),
7586
7588
  Tr(u.closed(), "Session closed before player started")
7587
7589
  ]), p = new FQ(S.catalog());
7588
- B.set(Re(c.namespace), p), A.emit("received signal", {
7590
+ B.set(Ue(c.namespace), p), A.emit("received signal", {
7589
7591
  type: "client ip",
7590
7592
  ip: S.connectionInfo().ip
7591
7593
  }), S.drm().then((J) => {
@@ -7610,7 +7612,7 @@ const Bn = class Bn {
7610
7612
  return Promise.race([s(this, Et).closed(), s(this, iA).closed()]);
7611
7613
  }
7612
7614
  };
7613
- wA = new WeakMap(), kA = new WeakMap(), Et = new WeakMap(), di = new WeakMap(), iA = new WeakMap(), De = new WeakMap(), tB = new WeakMap(), eB = new WeakMap(), UC = new WeakMap(), xI = new WeakMap(), LA = new WeakSet(), OE = function() {
7615
+ wA = new WeakMap(), kA = new WeakMap(), Et = new WeakMap(), di = new WeakMap(), iA = new WeakMap(), Se = new WeakMap(), tB = new WeakMap(), eB = new WeakMap(), UC = new WeakMap(), xI = new WeakMap(), LA = new WeakSet(), OE = function() {
7614
7616
  return r(this, null, function* () {
7615
7617
  try {
7616
7618
  for (var A = IA(s(this, iA).stats()), t, e, g; t = !(e = yield A.next()).done; t = !1) {
@@ -7644,8 +7646,8 @@ wA = new WeakMap(), kA = new WeakMap(), Et = new WeakMap(), di = new WeakMap(),
7644
7646
  var C, Q, o;
7645
7647
  s(this, kA).info("handle subscription", A);
7646
7648
  const t = s(this, iA);
7647
- let e = s(this, De).get(A.channelId);
7648
- if (e || (e = new FQ(new NA(yield d(this, LA, VE).call(this, A.channelId))), s(this, De).set(A.channelId, e)), t.namespace().join("/") !== e.namespace().join("/")) {
7649
+ let e = s(this, Se).get(A.channelId);
7650
+ if (e || (e = new FQ(new NA(yield d(this, LA, VE).call(this, A.channelId))), s(this, Se).set(A.channelId, e)), t.namespace().join("/") !== e.namespace().join("/")) {
7649
7651
  s(this, kA).info("changing channel", A.channelId);
7650
7652
  const a = e.getVideoTrack(A.video), c = e.getAudioTrack(A.audio);
7651
7653
  yield t.zap(
@@ -7660,7 +7662,7 @@ wA = new WeakMap(), kA = new WeakMap(), Et = new WeakMap(), di = new WeakMap(),
7660
7662
  h && s(this, wA).emit("received drm data", h.value);
7661
7663
  }).catch((h) => {
7662
7664
  s(this, kA).error("Error getting DRM data", h);
7663
- }), s(this, kA).info("switched channel", A.channelId), (C = s(this, De).get(Re(t.namespace()))) == null || C.updateCatalog(t.catalog()), s(this, wA).emit("received signal", {
7665
+ }), s(this, kA).info("switched channel", A.channelId), (C = s(this, Se).get(Ue(t.namespace()))) == null || C.updateCatalog(t.catalog()), s(this, wA).emit("received signal", {
7664
7666
  type: "subscription changed",
7665
7667
  subscription: A
7666
7668
  });
@@ -7713,7 +7715,7 @@ wA = new WeakMap(), kA = new WeakMap(), Et = new WeakMap(), di = new WeakMap(),
7713
7715
  try {
7714
7716
  for (var l = IA(t), u, S, p; u = !(S = yield l.next()).done; u = !1) {
7715
7717
  const G = S.value;
7716
- const L = Re(G.track.namespace), y = G.track.trackObject.language, U = xQ((Q = G.track.trackObject.codec) != null ? Q : ""), F = G.track.trackObject.codec, J = U ? He({ codec: U, codecString: F }) : void 0, T = !!G.track.trackObject["com.vindral.drm"];
7718
+ const L = Ue(G.track.namespace), y = G.track.trackObject.language, U = xQ((Q = G.track.trackObject.codec) != null ? Q : ""), F = G.track.trackObject.codec, J = U ? qe({ codec: U, codecString: F }) : void 0, T = !!G.track.trackObject["com.vindral.drm"];
7717
7719
  try {
7718
7720
  for (var o = IA(G), a, c, h; a = !(c = yield o.next()).done; a = !1) {
7719
7721
  const [nA, $] = c.value;
@@ -7784,25 +7786,25 @@ function Ol(i) {
7784
7786
  0
7785
7787
  );
7786
7788
  }
7787
- var Vt, li, NC, zE;
7789
+ var Xt, li, NC, zE;
7788
7790
  class FQ {
7789
7791
  constructor(A) {
7790
7792
  n(this, NC);
7791
- n(this, Vt);
7793
+ n(this, Xt);
7792
7794
  n(this, li);
7793
- E(this, Vt, A), E(this, li, d(this, NC, zE).call(this));
7795
+ E(this, Xt, A), E(this, li, d(this, NC, zE).call(this));
7794
7796
  }
7795
7797
  catalog() {
7796
- return s(this, Vt).current();
7798
+ return s(this, Xt).current();
7797
7799
  }
7798
7800
  namespace() {
7799
- return s(this, Vt).current().namespace;
7801
+ return s(this, Xt).current().namespace;
7800
7802
  }
7801
7803
  updateCatalog(A) {
7802
- E(this, Vt, A);
7804
+ E(this, Xt, A);
7803
7805
  }
7804
7806
  getTextTrack(A) {
7805
- return s(this, Vt).current().tracks.find((t) => t.label === A);
7807
+ return s(this, Xt).current().tracks.find((t) => t.label === A);
7806
7808
  }
7807
7809
  getAudioTrack(A) {
7808
7810
  if (!A.codec)
@@ -7820,8 +7822,8 @@ class FQ {
7820
7822
  return s(this, li);
7821
7823
  }
7822
7824
  }
7823
- Vt = new WeakMap(), li = new WeakMap(), NC = new WeakSet(), zE = function() {
7824
- const [A, t] = s(this, Vt).value();
7825
+ Xt = new WeakMap(), li = new WeakMap(), NC = new WeakSet(), zE = function() {
7826
+ const [A, t] = s(this, Xt).value();
7825
7827
  return ka(A);
7826
7828
  };
7827
7829
  const Vl = (i, A) => {
@@ -8009,7 +8011,7 @@ const Xl = 65536 * 8, jl = 0.9, GQ = (i) => Xl * jl * 1e3 / i, dt = class dt {
8009
8011
  });
8010
8012
  I(this, "getStatistics", () => {
8011
8013
  var t;
8012
- const A = ee(this.rtts.items());
8014
+ const A = Ie(this.rtts.items());
8013
8015
  return {
8014
8016
  rtt: A,
8015
8017
  estimatedBandwidth: GQ(A.average),
@@ -8144,11 +8146,11 @@ I(dt, "PING_INTERVAL", 5e3), I(dt, "MAX_MISSED_PINGS", 4), I(dt, "TLS_ROUNDTRIPS
8144
8146
  C.transport.once("error", (Q) => B(Q)), C.transport.once("open", () => g(C));
8145
8147
  }));
8146
8148
  let uo = dt;
8147
- var VI, Se, ZI;
8149
+ var VI, me, ZI;
8148
8150
  class zl {
8149
8151
  constructor(A) {
8150
8152
  n(this, VI);
8151
- n(this, Se, []);
8153
+ n(this, me, []);
8152
8154
  n(this, ZI);
8153
8155
  E(this, VI, A);
8154
8156
  }
@@ -8165,8 +8167,8 @@ class zl {
8165
8167
  select(A) {
8166
8168
  if (s(this, VI).edgeUrl)
8167
8169
  return s(this, VI).edgeUrl;
8168
- s(this, Se).length === 0 && E(this, Se, s(this, Se).concat(A));
8169
- const t = s(this, Se).shift();
8170
+ s(this, me).length === 0 && E(this, me, s(this, me).concat(A));
8171
+ const t = s(this, me).shift();
8170
8172
  if (E(this, ZI, t), t)
8171
8173
  return t;
8172
8174
  }
@@ -8181,11 +8183,11 @@ class zl {
8181
8183
  * Resets the cached list of edges
8182
8184
  */
8183
8185
  reset() {
8184
- E(this, ZI, void 0), E(this, Se, []);
8186
+ E(this, ZI, void 0), E(this, me, []);
8185
8187
  }
8186
8188
  }
8187
- VI = new WeakMap(), Se = new WeakMap(), ZI = new WeakMap();
8188
- var Gt, XI, Zt, jI, zI, _I, bC, LC, JC, _E;
8189
+ VI = new WeakMap(), me = new WeakMap(), ZI = new WeakMap();
8190
+ var Gt, XI, jt, jI, zI, _I, bC, LC, JC, _E;
8189
8191
  const ji = class ji {
8190
8192
  constructor(A, t, e) {
8191
8193
  n(this, JC);
@@ -8196,7 +8198,7 @@ const ji = class ji {
8196
8198
  I(this, "connectionImpl");
8197
8199
  n(this, Gt, !0);
8198
8200
  n(this, XI);
8199
- n(this, Zt, 0);
8201
+ n(this, jt, 0);
8200
8202
  n(this, jI, 0);
8201
8203
  n(this, zI);
8202
8204
  n(this, _I);
@@ -8215,12 +8217,12 @@ const ji = class ji {
8215
8217
  I(this, "getState", () => this.connectionImpl ? this.connectionImpl.getState() : "disconnected");
8216
8218
  I(this, "getStatistics", () => this.connectionImpl ? Y(D({}, this.connectionImpl.getStatistics()), {
8217
8219
  connectCount: s(this, jI),
8218
- connectionAttemptCount: s(this, Zt)
8220
+ connectionAttemptCount: s(this, jt)
8219
8221
  }) : {
8220
8222
  rtt: { min: 0, max: 0, average: 0, last: 0 },
8221
8223
  estimatedBandwidth: 0,
8222
8224
  connectCount: s(this, jI),
8223
- connectionAttemptCount: s(this, Zt),
8225
+ connectionAttemptCount: s(this, jt),
8224
8226
  connectionProtocol: void 0
8225
8227
  });
8226
8228
  I(this, "connect", () => {
@@ -8282,12 +8284,12 @@ const ji = class ji {
8282
8284
  return s(this, _I);
8283
8285
  }
8284
8286
  };
8285
- Gt = new WeakMap(), XI = new WeakMap(), Zt = new WeakMap(), jI = new WeakMap(), zI = new WeakMap(), _I = new WeakMap(), bC = new WeakMap(), LC = new WeakMap(), JC = new WeakSet(), _E = function() {
8287
+ Gt = new WeakMap(), XI = new WeakMap(), jt = new WeakMap(), jI = new WeakMap(), zI = new WeakMap(), _I = new WeakMap(), bC = new WeakMap(), LC = new WeakMap(), JC = new WeakSet(), _E = function() {
8286
8288
  return r(this, null, function* () {
8287
8289
  var t;
8288
8290
  const A = new zl({ edgeUrl: this.config.options.get("edgeUrl") });
8289
- for (E(this, Zt, 0); ; ) {
8290
- At(this, Zt)._++;
8291
+ for (E(this, jt, 0); ; ) {
8292
+ At(this, jt)._++;
8291
8293
  try {
8292
8294
  const [g, B] = yield Promise.all([s(this, bC).call(this), s(this, LC).call(this)]), C = B / 2;
8293
8295
  if (!s(this, Gt))
@@ -8303,7 +8305,7 @@ Gt = new WeakMap(), XI = new WeakMap(), Zt = new WeakMap(), jI = new WeakMap(),
8303
8305
  connectInfo: g,
8304
8306
  estimatedRtt: C,
8305
8307
  edgeUrl: Q
8306
- }))), A.reset(), At(this, jI)._++, E(this, Zt, 0), E(this, _I, Date.now()), s(this, zI) || E(this, zI, s(this, _I)), yield this.connectionImpl.closed();
8308
+ }))), A.reset(), At(this, jI)._++, E(this, jt, 0), E(this, _I, Date.now()), s(this, zI) || E(this, zI, s(this, _I)), yield this.connectionImpl.closed();
8307
8309
  } catch (g) {
8308
8310
  this.logger.info("Failed to connect", g);
8309
8311
  const B = A.shiftedEdge();
@@ -8315,7 +8317,7 @@ Gt = new WeakMap(), XI = new WeakMap(), Zt = new WeakMap(), jI = new WeakMap(),
8315
8317
  if ((t = this.connectionImpl) == null || t.unload(), this.connectionImpl = void 0, !s(this, Gt))
8316
8318
  break;
8317
8319
  if (!(yield this.config.reconnectHandler({
8318
- reconnectRetries: s(this, Zt)
8320
+ reconnectRetries: s(this, jt)
8319
8321
  }))) {
8320
8322
  this.emitter.emit("error", Ja());
8321
8323
  break;
@@ -8329,15 +8331,15 @@ Gt = new WeakMap(), XI = new WeakMap(), Zt = new WeakMap(), jI = new WeakMap(),
8329
8331
  let wo = ji;
8330
8332
  const kQ = () => ({
8331
8333
  video: Y(D({}, GB()), {
8332
- bitRate: fe()
8334
+ bitRate: pe()
8333
8335
  }),
8334
8336
  audio: {
8335
- bitRate: fe()
8337
+ bitRate: pe()
8336
8338
  }
8337
8339
  }), _l = () => ({
8338
8340
  width: window.innerWidth,
8339
8341
  height: window.innerHeight,
8340
- bitRate: fe()
8342
+ bitRate: pe()
8341
8343
  }), zi = class zi {
8342
8344
  constructor(A, t, e, g) {
8343
8345
  I(this, "emitter");
@@ -8457,12 +8459,12 @@ class Xo {
8457
8459
  });
8458
8460
  I(this, "videoDecodeRate", () => {
8459
8461
  var B, C, Q;
8460
- const A = this.trackContexts.get("video"), t = (B = A == null ? void 0 : A.sampleDuration) != null ? B : 40, e = ee((C = A == null ? void 0 : A.decodeTime.items()) != null ? C : []), g = ee((Q = A == null ? void 0 : A.transportTime.items()) != null ? Q : []);
8462
+ const A = this.trackContexts.get("video"), t = (B = A == null ? void 0 : A.sampleDuration) != null ? B : 40, e = Ie((C = A == null ? void 0 : A.decodeTime.items()) != null ? C : []), g = Ie((Q = A == null ? void 0 : A.transportTime.items()) != null ? Q : []);
8461
8463
  return t / (e.average + g.average);
8462
8464
  });
8463
8465
  I(this, "getStatistics", () => {
8464
8466
  var B, C, Q, o;
8465
- const A = this.trackContexts.get("video"), t = ee((B = A == null ? void 0 : A.decodeTime.items()) != null ? B : []), e = ee((C = A == null ? void 0 : A.transportTime.items()) != null ? C : []), g = ee((o = (Q = this.trackContexts.get("audio")) == null ? void 0 : Q.decodeTime.items()) != null ? o : []);
8467
+ const A = this.trackContexts.get("video"), t = Ie((B = A == null ? void 0 : A.decodeTime.items()) != null ? B : []), e = Ie((C = A == null ? void 0 : A.transportTime.items()) != null ? C : []), g = Ie((o = (Q = this.trackContexts.get("audio")) == null ? void 0 : Q.decodeTime.items()) != null ? o : []);
8466
8468
  return {
8467
8469
  videoDecodeRate: this.videoDecodeRate(),
8468
8470
  videoDecodeTime: t,
@@ -8618,16 +8620,16 @@ const MC = class MC {
8618
8620
  };
8619
8621
  I(MC, "create", (A) => new MC(A));
8620
8622
  let So = MC;
8621
- const eu = (i) => (A, t, e) => A.timestamp <= t || A.timestampAdded <= e - i, te = class te {
8623
+ const eu = (i) => (A, t, e) => A.timestamp <= t || A.timestampAdded <= e - i, ie = class ie {
8622
8624
  constructor(A, t, e) {
8623
8625
  I(this, "logger");
8624
8626
  I(this, "emitter");
8625
8627
  I(this, "waitingEvents", []);
8626
- I(this, "isTriggered", eu(te.EVENT_TIMEOUT));
8628
+ I(this, "isTriggered", eu(ie.EVENT_TIMEOUT));
8627
8629
  I(this, "timeSource");
8628
8630
  I(this, "timers", new mA());
8629
8631
  I(this, "load", () => {
8630
- this.timers.setInterval(this.onBufferedStateChanged, te.EVENT_CHECK_INTERVAL), this.emitter.on("add event", this.addEvent);
8632
+ this.timers.setInterval(this.onBufferedStateChanged, ie.EVENT_CHECK_INTERVAL), this.emitter.on("add event", this.addEvent);
8631
8633
  });
8632
8634
  I(this, "unload", () => {
8633
8635
  this.timers.unload(), this.emitter.off("add event", this.addEvent);
@@ -8659,8 +8661,8 @@ const eu = (i) => (A, t, e) => A.timestamp <= t || A.timestampAdded <= e - i, te
8659
8661
  this.logger = t, this.emitter = A, this.timeSource = e;
8660
8662
  }
8661
8663
  };
8662
- I(te, "EVENT_TIMEOUT", 5e3), I(te, "EVENT_CHECK_INTERVAL", 20), I(te, "create", (A, t, e) => new te(A, t, e));
8663
- let mo = te;
8664
+ I(ie, "EVENT_TIMEOUT", 5e3), I(ie, "EVENT_CHECK_INTERVAL", 20), I(ie, "create", (A, t, e) => new ie(A, t, e));
8665
+ let mo = ie;
8664
8666
  const tt = class tt {
8665
8667
  constructor(A) {
8666
8668
  I(this, "emitter");
@@ -8938,11 +8940,11 @@ const qC = class qC extends _A {
8938
8940
  };
8939
8941
  I(qC, "create", (t, e, g) => new qC(t, e, g));
8940
8942
  let tC = qC;
8941
- var me;
8943
+ var ye;
8942
8944
  class $E {
8943
8945
  constructor() {
8944
- n(this, me, []);
8945
- E(this, me, []);
8946
+ n(this, ye, []);
8947
+ E(this, ye, []);
8946
8948
  }
8947
8949
  addTextTrack(A, t, e) {
8948
8950
  const g = [], B = {
@@ -8959,24 +8961,24 @@ class $E {
8959
8961
  Q !== -1 && g.splice(Q, 1);
8960
8962
  }
8961
8963
  };
8962
- return s(this, me).push(B), B;
8964
+ return s(this, ye).push(B), B;
8963
8965
  }
8964
8966
  set language(A) {
8965
- s(this, me).forEach((t) => {
8967
+ s(this, ye).forEach((t) => {
8966
8968
  t.language === A ? t.mode = "showing" : t.mode = "hidden";
8967
8969
  });
8968
8970
  }
8969
8971
  get language() {
8970
8972
  var A;
8971
- return (A = s(this, me).find((t) => t.mode === "showing")) == null ? void 0 : A.language;
8973
+ return (A = s(this, ye).find((t) => t.mode === "showing")) == null ? void 0 : A.language;
8972
8974
  }
8973
8975
  getActiveCues(A) {
8974
- const t = s(this, me).find((e) => e.mode === "showing");
8976
+ const t = s(this, ye).find((e) => e.mode === "showing");
8975
8977
  return t ? t.cues.filter(({ startTime: e, endTime: g }) => A >= e && A <= g) : [];
8976
8978
  }
8977
8979
  }
8978
- me = new WeakMap();
8979
- const Ue = (i, A) => {
8980
+ ye = new WeakMap();
8981
+ const Ne = (i, A) => {
8980
8982
  let t;
8981
8983
  for (t = A; i > 1; i--) t += A;
8982
8984
  return t;
@@ -8989,7 +8991,7 @@ class Iu {
8989
8991
  A.innerHTML = "<audio x-webkit-airplay='deny'></audio>";
8990
8992
  const t = A.children.item(0);
8991
8993
  if (t instanceof HTMLAudioElement)
8992
- this.audio = t, this.audio.controls = !1, this.audio.disableRemotePlayback = !0, this.audio.preload = "auto", this.audio.src = "data:audio/mpeg;base64,//uQx" + Ue(23, "A") + "WGluZwAAAA8AAAACAAACcQCA" + Ue(16, "gICA") + Ue(66, "/") + "8AAABhTEFNRTMuMTAwA8MAAAAAAAAAABQgJAUHQQAB9AAAAnGMHkkI" + Ue(320, "A") + "//sQxAADgnABGiAAQBCqgCRMAAgEAH" + Ue(15, "/") + "7+n/9FTuQsQH//////2NG0jWUGlio5gLQTOtIoeR2WX////X4s9Atb/JRVCbBUpeRUq" + Ue(18, "/") + "9RUi0f2jn/+xDECgPCjAEQAABN4AAANIAAAAQVTEFNRTMuMTAw" + Ue(97, "V") + "Q==", this.audio.loop = !1, this.audio.load();
8994
+ this.audio = t, this.audio.controls = !1, this.audio.disableRemotePlayback = !0, this.audio.preload = "auto", this.audio.src = "data:audio/mpeg;base64,//uQx" + Ne(23, "A") + "WGluZwAAAA8AAAACAAACcQCA" + Ne(16, "gICA") + Ne(66, "/") + "8AAABhTEFNRTMuMTAwA8MAAAAAAAAAABQgJAUHQQAB9AAAAnGMHkkI" + Ne(320, "A") + "//sQxAADgnABGiAAQBCqgCRMAAgEAH" + Ne(15, "/") + "7+n/9FTuQsQH//////2NG0jWUGlio5gLQTOtIoeR2WX////X4s9Atb/JRVCbBUpeRUq" + Ne(18, "/") + "9RUi0f2jn/+xDECgPCjAEQAABN4AAANIAAAAQVTEFNRTMuMTAw" + Ne(97, "V") + "Q==", this.audio.loop = !1, this.audio.load();
8993
8995
  else
8994
8996
  throw new Error("Failed to create audio tag");
8995
8997
  }
@@ -9101,7 +9103,7 @@ void main() {
9101
9103
  });
9102
9104
  }
9103
9105
  return e;
9104
- }, Me = (i) => {
9106
+ }, He = (i) => {
9105
9107
  const A = i.createTexture();
9106
9108
  if (!A)
9107
9109
  throw new v("Failed to create texture", {
@@ -9133,7 +9135,7 @@ void main() {
9133
9135
  }
9134
9136
  return e;
9135
9137
  };
9136
- var vC, W, gB, sB, BB, ye, Ag, er, ir, KC;
9138
+ var vC, W, gB, sB, BB, fe, Ag, er, ir, KC;
9137
9139
  class Cu {
9138
9140
  constructor(A) {
9139
9141
  n(this, Ag);
@@ -9142,7 +9144,7 @@ class Cu {
9142
9144
  n(this, gB);
9143
9145
  n(this, sB);
9144
9146
  n(this, BB);
9145
- n(this, ye);
9147
+ n(this, fe);
9146
9148
  I(this, "subtitleRenderer", new gu());
9147
9149
  // prettier-ignore
9148
9150
  n(this, KC, (A, t, e, g) => [
@@ -9163,14 +9165,14 @@ class Cu {
9163
9165
  0,
9164
9166
  1
9165
9167
  ]);
9166
- E(this, W, A), E(this, gB, Me(A)), E(this, sB, Ti(A, A.FRAGMENT_SHADER, su)), E(this, BB, Ti(A, A.VERTEX_SHADER, Bu)), E(this, ye, po(A, s(this, BB), s(this, sB))), this.subtitleRenderer.config.fontSize = "64px";
9168
+ E(this, W, A), E(this, gB, He(A)), E(this, sB, Ti(A, A.FRAGMENT_SHADER, su)), E(this, BB, Ti(A, A.VERTEX_SHADER, Bu)), E(this, fe, po(A, s(this, BB), s(this, sB))), this.subtitleRenderer.config.fontSize = "64px";
9167
9169
  }
9168
9170
  setActiveCues(A, t) {
9169
9171
  this.subtitleRenderer.setActiveCues(A), this.subtitleRenderer.render(t);
9170
9172
  }
9171
9173
  render(A) {
9172
9174
  const t = this.subtitleRenderer.canvas, e = (A.padding + s(this, vC)) * window.devicePixelRatio;
9173
- t.width !== 0 && (s(this, W).useProgram(s(this, ye)), d(this, Ag, er).call(this), d(this, Ag, ir).call(this, this.subtitleRenderer.canvas.width / A.width, this.subtitleRenderer.canvas.height / A.height, -this.subtitleRenderer.canvas.width / A.width / 2, -(1 - (this.subtitleRenderer.canvas.height + e) / A.height)), s(this, W).uniform1i(s(this, W).getUniformLocation(s(this, ye), "texture"), 4), s(this, W).activeTexture(s(this, W).TEXTURE4), s(this, W).bindTexture(s(this, W).TEXTURE_2D, s(this, gB)), s(this, W).enable(s(this, W).BLEND), s(this, W).blendFunc(s(this, W).SRC_ALPHA, s(this, W).ONE_MINUS_SRC_ALPHA), s(this, W).texImage2D(
9175
+ t.width !== 0 && (s(this, W).useProgram(s(this, fe)), d(this, Ag, er).call(this), d(this, Ag, ir).call(this, this.subtitleRenderer.canvas.width / A.width, this.subtitleRenderer.canvas.height / A.height, -this.subtitleRenderer.canvas.width / A.width / 2, -(1 - (this.subtitleRenderer.canvas.height + e) / A.height)), s(this, W).uniform1i(s(this, W).getUniformLocation(s(this, fe), "texture"), 4), s(this, W).activeTexture(s(this, W).TEXTURE4), s(this, W).bindTexture(s(this, W).TEXTURE_2D, s(this, gB)), s(this, W).enable(s(this, W).BLEND), s(this, W).blendFunc(s(this, W).SRC_ALPHA, s(this, W).ONE_MINUS_SRC_ALPHA), s(this, W).texImage2D(
9174
9176
  s(this, W).TEXTURE_2D,
9175
9177
  0,
9176
9178
  s(this, W).RGBA,
@@ -9180,11 +9182,11 @@ class Cu {
9180
9182
  ), s(this, W).texParameteri(s(this, W).TEXTURE_2D, s(this, W).TEXTURE_MAG_FILTER, s(this, W).LINEAR), s(this, W).drawArrays(s(this, W).TRIANGLE_STRIP, 0, 4));
9181
9183
  }
9182
9184
  }
9183
- vC = new WeakMap(), W = new WeakMap(), gB = new WeakMap(), sB = new WeakMap(), BB = new WeakMap(), ye = new WeakMap(), Ag = new WeakSet(), er = function() {
9184
- const A = s(this, W).getAttribLocation(s(this, ye), "position");
9185
+ vC = new WeakMap(), W = new WeakMap(), gB = new WeakMap(), sB = new WeakMap(), BB = new WeakMap(), fe = new WeakMap(), Ag = new WeakSet(), er = function() {
9186
+ const A = s(this, W).getAttribLocation(s(this, fe), "position");
9185
9187
  s(this, W).enableVertexAttribArray(A), s(this, W).vertexAttribPointer(A, 2, s(this, W).FLOAT, !1, 0, 0);
9186
9188
  }, ir = function(A, t, e, g) {
9187
- const B = s(this, W).getUniformLocation(s(this, ye), "model");
9189
+ const B = s(this, W).getUniformLocation(s(this, fe), "model");
9188
9190
  s(this, W).uniformMatrix4fv(B, !1, s(this, KC).call(this, A, t, e, g));
9189
9191
  }, KC = new WeakMap();
9190
9192
  const Tn = `
@@ -9234,9 +9236,9 @@ void main() {
9234
9236
  I(this, "buffer", Yn(this.context, qg.SQUARE_VERTICES));
9235
9237
  I(this, "program", po(this.context, this.vertexShader, this.pixelShader));
9236
9238
  I(this, "textures", {
9237
- y: Me(this.context),
9238
- u: Me(this.context),
9239
- v: Me(this.context)
9239
+ y: He(this.context),
9240
+ u: He(this.context),
9241
+ v: He(this.context)
9240
9242
  });
9241
9243
  // Lazy loaded when needed
9242
9244
  I(this, "textRenderer");
@@ -9248,9 +9250,9 @@ void main() {
9248
9250
  });
9249
9251
  I(this, "onContextRestored", () => {
9250
9252
  this.emit("context restored"), this.context = Kn(this.canvas, Wn), this.pixelShader = Ti(this.context, this.context.FRAGMENT_SHADER, Tn), this.vertexShader = Ti(this.context, this.context.VERTEX_SHADER, Pn), this.buffer = Yn(this.context, qg.SQUARE_VERTICES), this.program = po(this.context, this.vertexShader, this.pixelShader), this.textures = {
9251
- y: Me(this.context),
9252
- u: Me(this.context),
9253
- v: Me(this.context)
9253
+ y: He(this.context),
9254
+ u: He(this.context),
9255
+ v: He(this.context)
9254
9256
  }, this.load();
9255
9257
  });
9256
9258
  I(this, "load", () => {
@@ -10298,9 +10300,9 @@ const bo = () => ({
10298
10300
  let g = !1;
10299
10301
  if (A.from) {
10300
10302
  const U = (L = this.metrics.levels[t]) != null ? L : bo();
10301
- t < e ? U.upgradesFromLevel.push(Date.now()) : U.downgradesFromLevel.push(Date.now()), Ne(U.activeRanges);
10303
+ t < e ? U.upgradesFromLevel.push(Date.now()) : U.downgradesFromLevel.push(Date.now()), be(U.activeRanges);
10302
10304
  const F = U.bufferingRanges[U.bufferingRanges.length - 1];
10303
- g = !!F && !F.end, Ne(U.bufferingRanges), this.metrics.levels[t] = U;
10305
+ g = !!F && !F.end, be(U.bufferingRanges), this.metrics.levels[t] = U;
10304
10306
  }
10305
10307
  if (A.to) {
10306
10308
  const U = (y = this.metrics.levels[e]) != null ? y : bo();
@@ -10336,9 +10338,9 @@ const bo = () => ({
10336
10338
  I(this, "stopBuffering", () => {
10337
10339
  if (this.currentLevel) {
10338
10340
  const A = this.metrics.levels[this.currentLevel];
10339
- A && Ne(A.bufferingRanges);
10341
+ A && be(A.bufferingRanges);
10340
10342
  }
10341
- Ne(this.metrics.general.bufferingRanges);
10343
+ be(this.metrics.general.bufferingRanges);
10342
10344
  });
10343
10345
  I(this, "startBuffering", () => {
10344
10346
  if (this.currentLevel) {
@@ -10350,9 +10352,9 @@ const bo = () => ({
10350
10352
  I(this, "unsetActive", () => {
10351
10353
  if (this.currentLevel) {
10352
10354
  const A = this.metrics.levels[this.currentLevel];
10353
- A && Ne(A.activeRanges);
10355
+ A && be(A.activeRanges);
10354
10356
  }
10355
- Ne(this.metrics.general.activeRanges);
10357
+ be(this.metrics.general.activeRanges);
10356
10358
  });
10357
10359
  this.logger = t, this.emitter = A;
10358
10360
  }
@@ -11304,7 +11306,7 @@ const OA = class OA extends _A {
11304
11306
  I(this, "isSupportedVideoCodecProfile", (t, e) => {
11305
11307
  if (this.willUseMediaSource()) {
11306
11308
  const g = Yg();
11307
- return g ? g.isTypeSupported(He({ codec: t, codecString: e })) : !0;
11309
+ return g ? g.isTypeSupported(qe({ codec: t, codecString: e })) : !0;
11308
11310
  }
11309
11311
  if (t === "h264") {
11310
11312
  const g = !!(e != null && e.startsWith("avc1.42")), B = !!(e != null && e.startsWith("avc1.66."));
@@ -11325,12 +11327,12 @@ const OA = class OA extends _A {
11325
11327
  throw new v("No currentRenditionLevel", { code: "no_current_rendition_level", isFatal: !1 });
11326
11328
  if (t != null && t.video && e.push({
11327
11329
  type: "video",
11328
- mimeType: He(t.video),
11330
+ mimeType: qe(t.video),
11329
11331
  codec: t.video.codec
11330
11332
  }), t != null && t.audio && e.push({
11331
11333
  type: "audio",
11332
11334
  codec: t.audio.codec,
11333
- mimeType: He(t.audio)
11335
+ mimeType: qe(t.audio)
11334
11336
  }), e.length === 0)
11335
11337
  throw new v("Can't initialize decoding module without tracks", { code: "no_tracks", isFatal: !1 });
11336
11338
  if (this.willUseMediaSource() && this.element instanceof HTMLMediaElement)
@@ -11420,7 +11422,7 @@ const OA = class OA extends _A {
11420
11422
  const t = this.modules.canvasModule ? this.options.get("iosMediaElementEnabled") : void 0;
11421
11423
  return D({
11422
11424
  uptime: Date.now() - this.createdAt,
11423
- version: "4.1.2-4-gb79bb2ad",
11425
+ version: "4.1.2-5-g17cd929a",
11424
11426
  clientId: this.clientId,
11425
11427
  sessionId: this.sessionId,
11426
11428
  channelId: this.channelId,
@@ -11651,7 +11653,7 @@ const OA = class OA extends _A {
11651
11653
  switch (w) {
11652
11654
  case "upgrade":
11653
11655
  {
11654
- const k = Math.min(O + 1, K), z = f[k], Ui = (yA = this.modules.connection.estimatedBandwidth) != null ? yA : fe(), Ni = ((b = (m = z == null ? void 0 : z.audio) == null ? void 0 : m.bitRate) != null ? b : 0) + ((AA = (x = z == null ? void 0 : z.video) == null ? void 0 : x.bitRate) != null ? AA : 0), gg = Ui * 2 > Ni;
11656
+ const k = Math.min(O + 1, K), z = f[k], Ui = (yA = this.modules.connection.estimatedBandwidth) != null ? yA : pe(), Ni = ((b = (m = z == null ? void 0 : z.audio) == null ? void 0 : m.bitRate) != null ? b : 0) + ((AA = (x = z == null ? void 0 : z.video) == null ? void 0 : x.bitRate) != null ? AA : 0), gg = Ui * 2 > Ni;
11655
11657
  z && gg && this.modules.adaptivity.isQoSOk(z) && (P = k);
11656
11658
  }
11657
11659
  break;
@@ -11830,7 +11832,7 @@ const OA = class OA extends _A {
11830
11832
  channelId: f
11831
11833
  }), P = Qd(K.codec, K.payload);
11832
11834
  P && this.sizes.set(K.renditionId, P);
11833
- const tA = He({ codec: M.codec, codecString: M.codecString });
11835
+ const tA = qe({ codec: M.codec, codecString: M.codecString });
11834
11836
  this.emitter.emit("init segment", { initSegment: K, mimeType: tA }), this.emit("initialized media");
11835
11837
  } else {
11836
11838
  const K = Du(w, M, this.sizes.get(w.renditionId));
@@ -12112,7 +12114,7 @@ const OA = class OA extends _A {
12112
12114
  */
12113
12115
  get maxVideoBitRate() {
12114
12116
  var t, e;
12115
- return (e = (t = this.modules.constraintCap.getCurrentConstraintCap()) == null ? void 0 : t.video.bitRate) != null ? e : fe();
12117
+ return (e = (t = this.modules.constraintCap.getCurrentConstraintCap()) == null ? void 0 : t.video.bitRate) != null ? e : pe();
12116
12118
  }
12117
12119
  /**
12118
12120
  * Set max video bit rate that will be subscribed to
@@ -12129,7 +12131,7 @@ const OA = class OA extends _A {
12129
12131
  */
12130
12132
  get maxAudioBitRate() {
12131
12133
  var t, e;
12132
- return (e = (t = this.modules.constraintCap.getCurrentConstraintCap()) == null ? void 0 : t.audio.bitRate) != null ? e : fe();
12134
+ return (e = (t = this.modules.constraintCap.getCurrentConstraintCap()) == null ? void 0 : t.audio.bitRate) != null ? e : pe();
12133
12135
  }
12134
12136
  /**
12135
12137
  * Set max audio bit rate that will be subscribed to
@@ -12449,7 +12451,7 @@ const Gu = "_bar_zames_1", ku = "_hidden_zames_45", Cr = {
12449
12451
  play: Lu,
12450
12452
  airPlay: xu
12451
12453
  }, Wu = Uu["icon-button"];
12452
- class qe extends $A {
12454
+ class ve extends $A {
12453
12455
  constructor(t, e, g) {
12454
12456
  super(document.createElement("div"));
12455
12457
  I(this, "iconElement");
@@ -12533,7 +12535,7 @@ class QQ extends $A {
12533
12535
  I(this, "show", () => {
12534
12536
  this.element.classList.remove(ea);
12535
12537
  });
12536
- this.element.className = ew, this.onItemClick = g, this.onToggle = C, this.items = e, this.iconButton = new qe(t, B, this.onButtonClick), this.iconButton.attach(this.element);
12538
+ this.element.className = ew, this.onItemClick = g, this.onToggle = C, this.items = e, this.iconButton = new ve(t, B, this.onButtonClick), this.iconButton.attach(this.element);
12537
12539
  }
12538
12540
  }
12539
12541
  const iw = CB["hide-on-small"], Iw = CB["channel-selection-item"], gw = CB["channel-selection-item-selected"], sw = CB["channel-selection-item-image"], Bw = CB.withThumbnails;
@@ -12603,7 +12605,7 @@ class aw extends $A {
12603
12605
  this.vindral.playbackState !== "paused" ? this.vindral.pause() : this.vindral.play(), this.playButton.setIcon(this.playIcon());
12604
12606
  });
12605
12607
  I(this, "playIcon", () => this.vindral.playbackState === "paused" ? "play" : "pause");
12606
- this.element.style.cursor = "pointer", this.vindral = t, this.playButton = new qe("Play", this.playIcon(), this.onPlayClick), this.playButton.attach(this.element);
12608
+ this.element.style.cursor = "pointer", this.vindral = t, this.playButton = new ve("Play", this.playIcon(), this.onPlayClick), this.playButton.attach(this.element);
12607
12609
  }
12608
12610
  }
12609
12611
  const Ew = "_item_5vhyo_1", rw = "_title_5vhyo_10", QB = {
@@ -12693,7 +12695,7 @@ class mw extends $A {
12693
12695
  this.vindral.muted = !this.vindral.muted, this.muteButton.setIcon(this.muteIcon());
12694
12696
  });
12695
12697
  I(this, "muteIcon", () => this.vindral.muted ? "mute" : "unmute");
12696
- this.element.style.cursor = "pointer", this.vindral = t, this.muteButton = new qe("Mute", this.muteIcon(), this.onMuteClick), this.muteButton.attach(this.element);
12698
+ this.element.style.cursor = "pointer", this.vindral = t, this.muteButton = new ve("Mute", this.muteIcon(), this.onMuteClick), this.muteButton.attach(this.element);
12697
12699
  }
12698
12700
  }
12699
12701
  const dB = Cr.hidden, yw = Cr.bar;
@@ -12752,8 +12754,8 @@ class fw extends $A {
12752
12754
  });
12753
12755
  this.element.className = [yw, dB].join(" ");
12754
12756
  const L = new Dw();
12755
- this.oneToOneButton = new qe("One to One", "oneToOne", g), this.fullscreenButton = new qe("Fullscreen", "enter", e), this.airPlayButton = new qe("AirPlay", "airPlay", C);
12756
- const y = new qe("Picture in Picture", "pip", B), U = new Cw({
12757
+ this.oneToOneButton = new ve("One to One", "oneToOne", g), this.fullscreenButton = new ve("Fullscreen", "enter", e), this.airPlayButton = new ve("AirPlay", "airPlay", C);
12758
+ const y = new ve("Picture in Picture", "pip", B), U = new Cw({
12757
12759
  vindral: t,
12758
12760
  enabled: c,
12759
12761
  thumbnailsEnabled: h,
@@ -13321,21 +13323,21 @@ var tD = (function() {
13321
13323
  var sg = S[Ui + gg], oQ = O[m];
13322
13324
  if (sg === 0 || sg === 10) {
13323
13325
  sg = m === 1 ? o : a;
13324
- for (var ct = oQ, Nt = 0, Fe = Nt + NaN, bi = Nt; ct[bi] && !(bi >= Fe); ) ++bi;
13326
+ for (var ct = oQ, Nt = 0, Ge = Nt + NaN, bi = Nt; ct[bi] && !(bi >= Ge); ) ++bi;
13325
13327
  if (16 < bi - Nt && ct.subarray && u) ct = u.decode(ct.subarray(Nt, bi));
13326
13328
  else {
13327
- for (Fe = ""; Nt < bi; ) {
13329
+ for (Ge = ""; Nt < bi; ) {
13328
13330
  var qA = ct[Nt++];
13329
13331
  if (qA & 128) {
13330
13332
  var nQ = ct[Nt++] & 63;
13331
- if ((qA & 224) == 192) Fe += String.fromCharCode((qA & 31) << 6 | nQ);
13333
+ if ((qA & 224) == 192) Ge += String.fromCharCode((qA & 31) << 6 | nQ);
13332
13334
  else {
13333
13335
  var Cn = ct[Nt++] & 63;
13334
- qA = (qA & 240) == 224 ? (qA & 15) << 12 | nQ << 6 | Cn : (qA & 7) << 18 | nQ << 12 | Cn << 6 | ct[Nt++] & 63, 65536 > qA ? Fe += String.fromCharCode(qA) : (qA -= 65536, Fe += String.fromCharCode(55296 | qA >> 10, 56320 | qA & 1023));
13336
+ qA = (qA & 240) == 224 ? (qA & 15) << 12 | nQ << 6 | Cn : (qA & 7) << 18 | nQ << 12 | Cn << 6 | ct[Nt++] & 63, 65536 > qA ? Ge += String.fromCharCode(qA) : (qA -= 65536, Ge += String.fromCharCode(55296 | qA >> 10, 56320 | qA & 1023));
13335
13337
  }
13336
- } else Fe += String.fromCharCode(qA);
13338
+ } else Ge += String.fromCharCode(qA);
13337
13339
  }
13338
- ct = Fe;
13340
+ ct = Ge;
13339
13341
  }
13340
13342
  sg(ct), oQ.length = 0;
13341
13343
  } else oQ.push(sg);