@vindral/web-sdk 4.1.9-22-g8338ea8a → 4.1.9-24-g9e27ab17

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.
@@ -12,7 +12,7 @@ var to = (s, e, t) => e in s ? Jc(s, e, { enumerable: !0, configurable: !0, writ
12
12
  for (var t of eo(e))
13
13
  Bu.call(e, t) && to(s, t, e[t]);
14
14
  return s;
15
- }, _ = (s, e) => Am(s, bm(e)), Cu = (s, e) => Jc(s, "name", { value: e, configurable: !0 });
15
+ }, _ = (s, e) => Am(s, bm(e)), Iu = (s, e) => Jc(s, "name", { value: e, configurable: !0 });
16
16
  var Uu = (s, e) => {
17
17
  var t = {};
18
18
  for (var i in s)
@@ -29,14 +29,14 @@ var Bi = (s) => {
29
29
  for (var n = 0, o = s[e >> 1], c = o && o.length; n < c; n++) e & 1 ? o[n].call(t) : i = o[n].call(t, i);
30
30
  return i;
31
31
  }, ve = (s, e, t, i, n, o) => {
32
- var c, h, u, l, p, g = e & 7, A = !!(e & 8), b = !!(e & 16), v = g > 3 ? s.length + 1 : g ? A ? 1 : 2 : 0, k = Pu[g + 5], I = g > 3 && (s[v - 1] = []), x = s[v] || (s[v] = []), T = g && (!b && !A && (n = n.prototype), g < 5 && (g > 3 || !b) && wm(g < 4 ? n : { get [t]() {
32
+ var c, h, u, l, p, g = e & 7, A = !!(e & 8), b = !!(e & 16), v = g > 3 ? s.length + 1 : g ? A ? 1 : 2 : 0, k = Pu[g + 5], C = g > 3 && (s[v - 1] = []), x = s[v] || (s[v] = []), T = g && (!b && !A && (n = n.prototype), g < 5 && (g > 3 || !b) && wm(g < 4 ? n : { get [t]() {
33
33
  return a(this, o);
34
34
  }, set [t](B) {
35
35
  return m(this, o, B);
36
36
  } }, t));
37
- g ? b && g < 4 && Cu(o, (g > 2 ? "set " : g > 1 ? "get " : "") + t) : Cu(n, t);
37
+ g ? b && g < 4 && Iu(o, (g > 2 ? "set " : g > 1 ? "get " : "") + t) : Iu(n, t);
38
38
  for (var U = i.length - 1; U >= 0; U--)
39
- l = ym(g, t, u = {}, s[3], x), g && (l.static = A, l.private = b, p = l.access = { has: b ? (B) => Sm(n, B) : (B) => t in B }, g ^ 3 && (p.get = b ? (B) => (g ^ 1 ? a : w)(B, n, g ^ 4 ? o : T.get) : (B) => B[t]), g > 2 && (p.set = b ? (B, Q) => m(B, n, Q, g ^ 4 ? o : T.set) : (B, Q) => B[t] = Q)), h = (0, i[U])(g ? g < 4 ? b ? o : T[k] : g > 4 ? void 0 : { get: T.get, set: T.set } : n, l), u._ = 1, g ^ 4 || h === void 0 ? tr(h) && (g > 4 ? I.unshift(h) : g ? b ? o = h : T[k] = h : n = h) : typeof h != "object" || h === null ? Mt("Object expected") : (tr(c = h.get) && (T.get = c), tr(c = h.set) && (T.set = c), tr(c = h.init) && I.unshift(c));
39
+ l = ym(g, t, u = {}, s[3], x), g && (l.static = A, l.private = b, p = l.access = { has: b ? (B) => Sm(n, B) : (B) => t in B }, g ^ 3 && (p.get = b ? (B) => (g ^ 1 ? a : w)(B, n, g ^ 4 ? o : T.get) : (B) => B[t]), g > 2 && (p.set = b ? (B, Q) => m(B, n, Q, g ^ 4 ? o : T.set) : (B, Q) => B[t] = Q)), h = (0, i[U])(g ? g < 4 ? b ? o : T[k] : g > 4 ? void 0 : { get: T.get, set: T.set } : n, l), u._ = 1, g ^ 4 || h === void 0 ? tr(h) && (g > 4 ? C.unshift(h) : g ? b ? o = h : T[k] = h : n = h) : typeof h != "object" || h === null ? Mt("Object expected") : (tr(c = h.get) && (T.get = c), tr(c = h.set) && (T.set = c), tr(c = h.init) && C.unshift(c));
40
40
  return g || $t(s, n), T && Jc(n, t, T), b ? g ^ 4 ? o : T : n;
41
41
  }, r = (s, e, t) => to(s, typeof e != "symbol" ? e + "" : e, t), $c = (s, e, t) => e.has(s) || Mt("Cannot " + t), Sm = (s, e) => Object(e) !== e ? Mt('Cannot use the "in" operator on this value') : s.has(e), a = (s, e, t) => ($c(s, e, "read from private field"), t ? t.call(s) : e.get(s)), d = (s, e, t) => e.has(s) ? Mt("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(s) : e.set(s, t), m = (s, e, t, i) => ($c(s, e, "write to private field"), i ? i.call(s, t) : e.set(s, t), t), w = (s, e, t) => ($c(s, e, "access private method"), t);
42
42
  var Pe = (s, e, t, i) => ({
@@ -105,7 +105,7 @@ var We = (s, e, t) => {
105
105
  }), s.push([t, i, e]);
106
106
  } else t && s.push([t]);
107
107
  return e;
108
- }, ze = (s, e, t) => {
108
+ }, He = (s, e, t) => {
109
109
  var i = typeof SuppressedError == "function" ? SuppressedError : function(c, h, u, l) {
110
110
  return l = Error(u), l.name = "SuppressedError", l.error = c, l.suppressed = h, l;
111
111
  }, n = (c) => e = t ? new i(c, e, "An error was suppressed during disposal") : (t = !0, c), o = (c) => {
@@ -120,8 +120,8 @@ var We = (s, e, t) => {
120
120
  };
121
121
  return o();
122
122
  };
123
- import { E as Ii } from "./uEFjK_x4.js";
124
- import { a as Je, p as Ud, i as Pd, c as vm, b as Tm, A as Em, d as km, t as Im, e as Cm } from "./CPEMXA01.js";
123
+ import { E as Ci } from "./uEFjK_x4.js";
124
+ import { a as Je, p as Ud, i as Pd, c as vm, b as Tm, A as Em, d as km, t as Cm, e as Im } from "./CPEMXA01.js";
125
125
  class Mu {
126
126
  constructor(e) {
127
127
  r(this, "maxSize", 0);
@@ -228,11 +228,11 @@ class ee {
228
228
  }
229
229
  }
230
230
  function lu(s) {
231
- const e = new zc(s);
231
+ const e = new Hc(s);
232
232
  return [e, e];
233
233
  }
234
234
  var Dt, qs, it, Dr;
235
- class zc {
235
+ class Hc {
236
236
  constructor(e) {
237
237
  /// The internal queue
238
238
  d(this, Dt);
@@ -507,10 +507,10 @@ const Bm = /(android|bbd+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal
507
507
  return !1;
508
508
  }
509
509
  return !1;
510
- }, xm = () => ke.indexOf("CrKey") !== -1, Lm = () => navigator.platform === "MacIntel" && navigator.maxTouchPoints === 0, Hc = () => navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1, Dd = () => Od() || Hc() ? !0 : /AppleWebKit/i.test(navigator.userAgent) && !/Chrome|Chromium|Edg|OPR|Opera/i.test(navigator.userAgent), Od = () => ke.indexOf("iphone") >= 0 && ke.indexOf("like iphone") < 0 || ke.indexOf("ipad") >= 0 && ke.indexOf("like ipad") < 0 || ke.indexOf("ipod") >= 0 && ke.indexOf("like ipod") < 0 || Hc(), Dm = () => {
510
+ }, xm = () => ke.indexOf("CrKey") !== -1, Lm = () => navigator.platform === "MacIntel" && navigator.maxTouchPoints === 0, zc = () => navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1, Dd = () => Od() || zc() ? !0 : /AppleWebKit/i.test(navigator.userAgent) && !/Chrome|Chromium|Edg|OPR|Opera/i.test(navigator.userAgent), Od = () => ke.indexOf("iphone") >= 0 && ke.indexOf("like iphone") < 0 || ke.indexOf("ipad") >= 0 && ke.indexOf("like ipad") < 0 || ke.indexOf("ipod") >= 0 && ke.indexOf("like ipod") < 0 || zc(), Dm = () => {
511
511
  var s, e;
512
- return Hc() ? !1 : (e = (s = Jn()) == null ? void 0 : s.isTypeSupported('audio/mp4; codecs="opus"')) != null ? e : !1;
513
- }, Dw = () => "ontouchstart" in window || navigator.maxTouchPoints > 0, Om = () => /^(?!.*chrome).*safari/i.test(ke);
512
+ return zc() ? !1 : (e = (s = Jn()) == null ? void 0 : s.isTypeSupported('audio/mp4; codecs="opus"')) != null ? e : !1;
513
+ }, Ow = () => "ontouchstart" in window || navigator.maxTouchPoints > 0, Om = () => /^(?!.*chrome).*safari/i.test(ke);
514
514
  function Fm() {
515
515
  var s, e;
516
516
  if (/(iPhone|iPod|iPad)/i.test(ke))
@@ -521,7 +521,7 @@ function _m() {
521
521
  if (/^((?!chrome|android).)*safari/i.test(ke))
522
522
  return (e = (s = ke.match(/version\/([\d.]+)/)) == null ? void 0 : s[1]) == null ? void 0 : e.split(".").map((t) => parseInt(t))[0];
523
523
  }
524
- const Fd = () => {
524
+ const Nm = () => typeof HTMLCanvasElement != "undefined" && typeof HTMLCanvasElement.prototype.captureStream == "function", Fd = () => {
525
525
  var t, i;
526
526
  const s = !!Jn();
527
527
  let e = !1;
@@ -531,10 +531,11 @@ const Fd = () => {
531
531
  supportsMediaSource: s,
532
532
  supportsHls: Pm(),
533
533
  supportsWebAssembly: Mm(),
534
+ supportsCanvasCaptureStream: Nm(),
534
535
  platform: {
535
536
  iosVersion: (t = Fm()) != null ? t : Number.MAX_SAFE_INTEGER,
536
537
  safariVersion: (i = _m()) != null ? i : Number.MAX_SAFE_INTEGER,
537
- isIpadOS: Hc(),
538
+ isIpadOS: zc(),
538
539
  isMacOS: Lm(),
539
540
  isIOS: Od(),
540
541
  isWebKit: Dd()
@@ -561,7 +562,7 @@ const lt = (s) => s.reduce((e, t) => e + t, 0) / s.length, Zt = (s) => ({
561
562
  average: s.length === 0 ? 0 : lt(s),
562
563
  max: s.length === 0 ? 0 : Math.max(...s),
563
564
  min: s.length === 0 ? 0 : Math.min(...s)
564
- }), Nm = (s) => {
565
+ }), Vm = (s) => {
565
566
  let e = 0, t = 0, i = 0, n = 0, o = 0;
566
567
  for (let l = 0; l < s.length; l++) {
567
568
  const { x: p, y: g } = s[l];
@@ -570,7 +571,7 @@ const lt = (s) => s.reduce((e, t) => e + t, 0) / s.length, Zt = (s) => ({
570
571
  const c = (s.length * i - e * t) / (s.length * n - e * e), h = (t - c * e) / s.length, u = ((s.length * i - e * t) / Math.sqrt((s.length * n - e * e) * (s.length * o - t * t))) ** 2;
571
572
  return { slope: c, intercept: h, r2: u, predict: (l) => c * (s.length + l) + h };
572
573
  };
573
- class Vm {
574
+ class Gm {
574
575
  constructor(e = 10) {
575
576
  r(this, "rates");
576
577
  r(this, "_total", 0);
@@ -603,7 +604,7 @@ const Yn = (s, e) => {
603
604
  for (const n in e)
604
605
  if (i += 1, !(n in s) || !Yn(s[n], e[n])) return !1;
605
606
  return t == i;
606
- }, xu = ["off", "error", "warn", "info", "debug", "trace"], Gm = {
607
+ }, xu = ["off", "error", "warn", "info", "debug", "trace"], jm = {
607
608
  OFF: "off"
608
609
  };
609
610
  var _i, Fr, Ni, Zs, Js;
@@ -694,7 +695,7 @@ function _d() {
694
695
  return typeof Symbol.dispose != "symbol" && Object.defineProperty(Symbol, "dispose", { value: /* @__PURE__ */ Symbol.for("dispose") }), Symbol.dispose;
695
696
  }
696
697
  var _r, fh;
697
- class jm {
698
+ class Wm {
698
699
  constructor(e, t) {
699
700
  d(this, _r);
700
701
  r(this, "value");
@@ -716,7 +717,7 @@ _r = new WeakSet(), fh = function() {
716
717
  this.unlocker.resolve(this.value);
717
718
  };
718
719
  var Vi, Gi;
719
- class Wm {
720
+ class Hm {
720
721
  constructor(e) {
721
722
  d(this, Vi);
722
723
  d(this, Gi, new W());
@@ -735,17 +736,17 @@ class Wm {
735
736
  m(this, Vi, i);
736
737
  }).catch(D);
737
738
  const t = a(this, Gi).promise.then(() => e);
738
- return m(this, Gi, e), yield t, new jm(a(this, Vi), e);
739
+ return m(this, Gi, e), yield t, new Wm(a(this, Vi), e);
739
740
  });
740
741
  }
741
742
  }
742
743
  Vi = new WeakMap(), Gi = new WeakMap();
743
- var He, nt;
744
- class Ce {
744
+ var ze, nt;
745
+ class Ie {
745
746
  constructor(e) {
746
- d(this, He);
747
+ d(this, ze);
747
748
  d(this, nt);
748
- m(this, He, e), m(this, nt, new W());
749
+ m(this, ze, e), m(this, nt, new W());
749
750
  }
750
751
  isClosed() {
751
752
  var e;
@@ -755,29 +756,29 @@ class Ce {
755
756
  * Return only the current value
756
757
  */
757
758
  current() {
758
- return a(this, He);
759
+ return a(this, ze);
759
760
  }
760
761
  /**
761
762
  * Return the current value and a promise for the next value
762
763
  */
763
764
  value() {
764
765
  var e;
765
- return [a(this, He), (e = a(this, nt)) == null ? void 0 : e.promise];
766
+ return [a(this, ze), (e = a(this, nt)) == null ? void 0 : e.promise];
766
767
  }
767
768
  update(e) {
768
769
  var t;
769
770
  if (!((t = a(this, nt)) != null && t.pending))
770
771
  throw new Error("ObservableValue is closed");
771
- m(this, He, e instanceof Function ? e(a(this, He)) : e), a(this, nt).resolve(a(this, He)), m(this, nt, new W());
772
+ m(this, ze, e instanceof Function ? e(a(this, ze)) : e), a(this, nt).resolve(a(this, ze)), m(this, nt, new W());
772
773
  }
773
774
  close() {
774
775
  var e;
775
- (e = a(this, nt)) == null || e.resolve(a(this, He)), m(this, nt, void 0);
776
+ (e = a(this, nt)) == null || e.resolve(a(this, ze)), m(this, nt, void 0);
776
777
  }
777
778
  waitFor(e) {
778
779
  return f(this, null, function* () {
779
- if (e(a(this, He)))
780
- return a(this, He);
780
+ if (e(a(this, ze)))
781
+ return a(this, ze);
781
782
  for (; ; ) {
782
783
  const [t, i] = this.value();
783
784
  if (!i)
@@ -799,7 +800,7 @@ class Ce {
799
800
  });
800
801
  }
801
802
  }
802
- He = new WeakMap(), nt = new WeakMap();
803
+ ze = new WeakMap(), nt = new WeakMap();
803
804
  const Lu = (s, e) => {
804
805
  const t = S({}, s);
805
806
  return typeof t != "object" || e.forEach((i) => {
@@ -857,14 +858,59 @@ function Nd(s) {
857
858
  return e;
858
859
  }
859
860
  }
861
+ class zm {
862
+ constructor() {
863
+ r(this, "highEntropyValues");
864
+ var e;
865
+ (e = self.navigator.userAgentData) == null || e.getHighEntropyValues(["architecture", "model", "platformVersion", "fullVersionList"]).then((t) => {
866
+ this.highEntropyValues = t;
867
+ }).catch(D);
868
+ }
869
+ getUserAgentInformation() {
870
+ var o, c, h, u, l, p;
871
+ const e = window.location.origin, i = !e || e == "null" ? "" : `${window.location.pathname}${window.location.search}`.substring(0, 1e3), n = {
872
+ locationOrigin: window.location.origin,
873
+ locationPath: i,
874
+ ancestorOrigins: ((o = window.location.ancestorOrigins) == null ? void 0 : o.length) > 0 ? Array.from(window.location.ancestorOrigins) : void 0,
875
+ hardwareConcurrency: navigator.hardwareConcurrency,
876
+ deviceMemory: navigator.deviceMemory
877
+ };
878
+ if (self.navigator.userAgentData && this.highEntropyValues) {
879
+ const A = [...(c = this.highEntropyValues.brands) != null ? c : []];
880
+ A.sort((T, U) => T.brand.localeCompare(U.brand));
881
+ const b = [...(h = this.highEntropyValues.fullVersionList) != null ? h : []];
882
+ b.sort((T, U) => T.brand.localeCompare(U.brand));
883
+ const v = b.map((T) => T.version), k = A.map((T) => T.brand), C = A.map((T) => T.version), x = parseInt((l = (u = this.highEntropyValues.platformVersion) == null ? void 0 : u.split(".")[0]) != null ? l : "1", 10);
884
+ return S({
885
+ userAgentLegacy: window.navigator.userAgent,
886
+ ua: {
887
+ browser: {
888
+ brands: k,
889
+ fullVersionBrands: v,
890
+ majorVersions: C
891
+ },
892
+ device: this.highEntropyValues.model || "Other",
893
+ os: {
894
+ family: this.highEntropyValues.platform || "Other",
895
+ version: (p = this.highEntropyValues.platformVersion) != null ? p : "1",
896
+ major_version: Number.isFinite(x) ? x : 0
897
+ }
898
+ }
899
+ }, n);
900
+ } else
901
+ return S({
902
+ userAgent: window.navigator.userAgent
903
+ }, n);
904
+ }
905
+ }
860
906
  const Ou = () => {
861
907
  const s = [...Array(256).keys()].map((t) => t.toString(16).padStart(2, "0")), e = crypto.getRandomValues(new Uint8Array(16));
862
908
  return e[6] = e[6] & 15 | 64, e[8] = e[8] & 63 | 128, [...e.entries()].map(([t, i]) => [4, 6, 8, 10].includes(t) ? `-${s[i]}` : s[i]).join("");
863
- }, Ci = (s) => f(null, null, function* () {
909
+ }, Ii = (s) => f(null, null, function* () {
864
910
  return new Promise((e) => setTimeout(e, s));
865
911
  }), mu = (t, ...i) => f(null, [t, ...i], function* (s, e = new Error("Timeout")) {
866
912
  return new Promise((n, o) => setTimeout(() => o(e), s));
867
- }), zm = (s, e) => f(null, null, function* () {
913
+ }), Qm = (s, e) => f(null, null, function* () {
868
914
  throw yield s, new Error(e);
869
915
  }), vs = (s) => "width" in s && typeof s.width == "number", Ts = (s) => "sampleRate" in s && typeof s.sampleRate == "number", ii = (s) => {
870
916
  switch (s.codec) {
@@ -884,7 +930,7 @@ const Ou = () => {
884
930
  }, ki = () => Number.MAX_SAFE_INTEGER, go = () => ({
885
931
  width: Number.MAX_SAFE_INTEGER,
886
932
  height: Number.MAX_SAFE_INTEGER
887
- }), Fu = (s) => !(typeof s != "object" || s === null || !("type" in s)), Hm = "connection_failed", Qm = "connection_failed_will_not_attempt_again", Xm = "authentication_error", qm = "authentication_expired", Zm = "channel_not_found", Jm = "no_incoming_data_error", $m = "connection_inactivity", Ym = "missing_init_segment", Km = "no_track_context", ef = "invalid_track_context_state", tf = "disconnected_by_edge", sf = "decoder_error", nf = "audio_player_error", rf = "media_source_error", af = "webgl_context_lost_error", of = "access_forbidden", cf = "channel_switch_failed", hf = "drm_error";
933
+ }), Fu = (s) => !(typeof s != "object" || s === null || !("type" in s)), Xm = "connection_failed", qm = "connection_failed_will_not_attempt_again", Zm = "authentication_error", Jm = "authentication_expired", $m = "channel_not_found", Ym = "no_incoming_data_error", Km = "connection_inactivity", ef = "missing_init_segment", tf = "no_track_context", sf = "invalid_track_context_state", nf = "disconnected_by_edge", rf = "decoder_error", af = "audio_player_error", of = "media_source_error", cf = "webgl_context_lost_error", hf = "access_forbidden", uf = "channel_switch_failed", df = "drm_error";
888
934
  class L extends Error {
889
935
  constructor(t, i, n = {}) {
890
936
  super(t);
@@ -927,42 +973,42 @@ class L extends Error {
927
973
  this.props = i, this.extra = n, Object.setPrototypeOf(this, new.target.prototype);
928
974
  }
929
975
  }
930
- const uf = (s, e) => new L(
976
+ const lf = (s, e) => new L(
931
977
  "MediaElement Error",
932
978
  { isFatal: s, code: "media_element_error", source: e },
933
979
  { mediaErrorCode: e.code }
934
- ), df = (s, e) => new L("Decoder Error", { isFatal: s, code: sf, source: e, type: "internal" }), Vd = (s, e) => new L("Audio Player Error", { isFatal: s, code: nf, source: e, type: "internal" }), lf = (s, e) => new L(`No init segment for rendition id ${s} for channel ${e}`, {
980
+ ), mf = (s, e) => new L("Decoder Error", { isFatal: s, code: rf, source: e, type: "internal" }), Vd = (s, e) => new L("Audio Player Error", { isFatal: s, code: af, source: e, type: "internal" }), ff = (s, e) => new L(`No init segment for rendition id ${s} for channel ${e}`, {
935
981
  isFatal: !1,
936
- code: Ym,
982
+ code: ef,
937
983
  type: "internal"
938
984
  }), _u = (s, e, t, i) => new L(
939
985
  "MediaSource Error",
940
- { isFatal: s, code: rf, source: e, type: "internal" },
986
+ { isFatal: s, code: of, source: e, type: "internal" },
941
987
  { type: i, consecutiveErrorsCount: t }
942
988
  ), io = (s, e) => new L(`No track context for ${s}${e ? `, rendition id ${e}` : ""}`, {
943
989
  isFatal: !1,
944
- code: Km,
990
+ code: tf,
945
991
  type: "internal"
946
- }), mf = (s, e) => new L(
992
+ }), pf = (s, e) => new L(
947
993
  `Track context is in an invalid state for ${s}${e ? `, rendition id ${e}` : ""}`,
948
994
  {
949
995
  isFatal: !1,
950
- code: ef,
996
+ code: sf,
951
997
  type: "internal"
952
998
  }
953
- ), ff = () => new L("Web Audio Context resume timeout", { isFatal: !1, code: "web_audio_context_resume_timeout" }), ir = (s) => new L("Disconnected From Edge Server", {
999
+ ), gf = () => new L("Web Audio Context resume timeout", { isFatal: !1, code: "web_audio_context_resume_timeout" }), ir = (s) => new L("Disconnected From Edge Server", {
954
1000
  type: "external",
955
1001
  source: s,
956
1002
  isFatal: !1,
957
- code: tf
958
- }), Ao = (s) => new L("Authentication Failed", { isFatal: !0, code: Xm, source: s }), pf = (s) => new L("Authentication Expired", { isFatal: !0, code: qm, source: s }), gf = (s, e) => new L("Connection closed due to inactivity", { isFatal: !1, code: $m, source: e, type: s }), Gd = (s, e) => new L("Channel not found", { isFatal: !1, code: Zm, source: e, type: s }), Af = (s) => new L("No Incoming Data", { isFatal: !1, code: Jm, source: s }), wf = (s) => new L("Connection attempt failed", {
1003
+ code: nf
1004
+ }), Ao = (s) => new L("Authentication Failed", { isFatal: !0, code: Zm, source: s }), Af = (s) => new L("Authentication Expired", { isFatal: !0, code: Jm, source: s }), wf = (s, e) => new L("Connection closed due to inactivity", { isFatal: !1, code: Km, source: e, type: s }), Gd = (s, e) => new L("Channel not found", { isFatal: !1, code: $m, source: e, type: s }), bf = (s) => new L("No Incoming Data", { isFatal: !1, code: Ym, source: s }), yf = (s) => new L("Connection attempt failed", {
959
1005
  isFatal: !1,
960
- code: Hm,
1006
+ code: Xm,
961
1007
  source: s
962
1008
  }), jd = () => new L("Connection failed - no more reconnect attempts", {
963
1009
  isFatal: !0,
964
- code: Qm
965
- }), bf = (s) => new L("WebGL Context Lost", { isFatal: !1, code: af, source: s, type: "internal" }), Nu = (s) => new L(s, { isFatal: !0, code: of }), Vu = (s) => new L(`Channel switch to '${s}' failed`, { isFatal: !1, code: cf }), Wd = (s, e = !1, t) => new L(s, { isFatal: e, code: hf, source: t }), yf = {
1010
+ code: qm
1011
+ }), Sf = (s) => new L("WebGL Context Lost", { isFatal: !1, code: cf, source: s, type: "internal" }), Nu = (s) => new L(s, { isFatal: !0, code: hf }), Vu = (s) => new L(`Channel switch to '${s}' failed`, { isFatal: !1, code: uf }), Wd = (s, e = !1, t) => new L(s, { isFatal: e, code: df, source: t }), vf = {
966
1012
  sizeBasedResolutionCapEnabled: !0,
967
1013
  pictureInPictureEnabled: !0,
968
1014
  abrEnabled: !0,
@@ -973,7 +1019,7 @@ const uf = (s, e) => new L(
973
1019
  volume: 1,
974
1020
  minBufferTime: 1500,
975
1021
  maxBufferTime: 1500,
976
- logLevel: Gm.OFF,
1022
+ logLevel: jm.OFF,
977
1023
  maxSize: go(),
978
1024
  maxVideoBitRate: ki(),
979
1025
  maxAudioBitRate: ki(),
@@ -1044,20 +1090,20 @@ class Qc {
1044
1090
  }
1045
1091
  }
1046
1092
  ji = new WeakMap(), Wi = new WeakMap();
1047
- function zd(s) {
1093
+ function Hd(s) {
1048
1094
  const e = window.atob(s.replace(/-/g, "+").replace(/_/g, "/"));
1049
1095
  let t = "";
1050
1096
  for (let i = 0; i < e.length; i++)
1051
1097
  t += ("0" + e.charCodeAt(i).toString(16)).substr(-2);
1052
1098
  return t;
1053
1099
  }
1054
- function Sf(s) {
1100
+ function Tf(s) {
1055
1101
  let e = "";
1056
1102
  for (let t = 0; t < s.length; t += 2)
1057
1103
  e += String.fromCharCode(parseInt(s.substr(t, 2), 16));
1058
1104
  return window.btoa(e).replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_");
1059
1105
  }
1060
- function vf(s, e) {
1106
+ function Ef(s, e) {
1061
1107
  if (s.byteLength !== e.byteLength) return !1;
1062
1108
  const t = new Uint8Array(s), i = new Uint8Array(e);
1063
1109
  for (let n = 0; n < t.length; n++)
@@ -1065,7 +1111,7 @@ function vf(s, e) {
1065
1111
  return !0;
1066
1112
  }
1067
1113
  var Nr;
1068
- class Tf extends Qc {
1114
+ class kf extends Qc {
1069
1115
  constructor(t, i) {
1070
1116
  super("clearkey", t, "");
1071
1117
  d(this, Nr);
@@ -1076,12 +1122,12 @@ class Tf extends Qc {
1076
1122
  for (let l = 0; l < o.kids.length; l++) {
1077
1123
  const p = o.kids[l];
1078
1124
  if (p) {
1079
- const g = zd(p).toLowerCase(), A = a(this, Nr)[g];
1125
+ const g = Hd(p).toLowerCase(), A = a(this, Nr)[g];
1080
1126
  A && c.push({
1081
1127
  kty: "oct",
1082
1128
  alg: "A128KW",
1083
1129
  kid: p,
1084
- k: Sf(A)
1130
+ k: Tf(A)
1085
1131
  });
1086
1132
  }
1087
1133
  }
@@ -1110,7 +1156,7 @@ const Gu = {
1110
1156
  contentType: 'video/mp4; codecs="avc1.42c01f"'
1111
1157
  }
1112
1158
  ]
1113
- }, Ef = {
1159
+ }, Cf = {
1114
1160
  fairplay: {
1115
1161
  keySystem: "com.apple.fps",
1116
1162
  supportedConfig: {
@@ -1134,7 +1180,7 @@ const Gu = {
1134
1180
  keySystem: "org.w3.clearkey",
1135
1181
  supportedConfig: Kc
1136
1182
  }
1137
- }, Hd = (s, e) => f(null, null, function* () {
1183
+ }, zd = (s, e) => f(null, null, function* () {
1138
1184
  return navigator.requestMediaKeySystemAccess(s, [e]).catch(() => {
1139
1185
  });
1140
1186
  }), ju = (s, e, t, i, n, o) => f(null, null, function* () {
@@ -1144,7 +1190,7 @@ const Gu = {
1144
1190
  robustness: h,
1145
1191
  contentType: o ? `${n === "audioCapabilities" ? "audio/mp4" : "video/mp4"}; codecs="${o}"` : p.contentType
1146
1192
  }));
1147
- if (!(yield Hd(s, {
1193
+ if (!(yield zd(s, {
1148
1194
  initDataTypes: e,
1149
1195
  [n]: u
1150
1196
  })))
@@ -1152,8 +1198,8 @@ const Gu = {
1152
1198
  c = u;
1153
1199
  }
1154
1200
  return c;
1155
- }), kf = (s, e, t, i) => f(null, null, function* () {
1156
- const { keySystem: n, supportedConfig: o } = Ef[s], { initDataTypes: c, videoCapabilities: h, audioCapabilities: u } = o, l = i == null ? void 0 : i[s], p = (l == null ? void 0 : l.videoRobustness) || Gu[s], g = (l == null ? void 0 : l.audioRobustness) || Gu[s], [A, b] = yield Promise.all([
1201
+ }), If = (s, e, t, i) => f(null, null, function* () {
1202
+ const { keySystem: n, supportedConfig: o } = Cf[s], { initDataTypes: c, videoCapabilities: h, audioCapabilities: u } = o, l = i == null ? void 0 : i[s], p = (l == null ? void 0 : l.videoRobustness) || Gu[s], g = (l == null ? void 0 : l.audioRobustness) || Gu[s], [A, b] = yield Promise.all([
1157
1203
  ju(
1158
1204
  n,
1159
1205
  c,
@@ -1171,26 +1217,26 @@ const Gu = {
1171
1217
  t
1172
1218
  )
1173
1219
  ]);
1174
- return !A && !b ? void 0 : yield Hd(n, {
1220
+ return !A && !b ? void 0 : yield zd(n, {
1175
1221
  initDataTypes: c,
1176
1222
  videoCapabilities: A,
1177
1223
  audioCapabilities: b
1178
1224
  });
1179
- }), If = (s, e, t, i) => f(null, null, function* () {
1225
+ }), Rf = (s, e, t, i) => f(null, null, function* () {
1180
1226
  let n;
1181
1227
  for (const o of s)
1182
- if (n = yield kf(o, e, t, i), n)
1228
+ if (n = yield If(o, e, t, i), n)
1183
1229
  return {
1184
1230
  keySystem: o,
1185
1231
  mediaKeySystemAccess: n
1186
1232
  };
1187
1233
  });
1188
- class Cf extends Qc {
1234
+ class Bf extends Qc {
1189
1235
  constructor(e, t, i) {
1190
1236
  super("fairplay", e, t, i);
1191
1237
  }
1192
1238
  }
1193
- const Rf = (s) => {
1239
+ const Uf = (s) => {
1194
1240
  var h, u, l, p;
1195
1241
  const e = String.fromCharCode(...new Uint16Array(s)), t = new window.DOMParser().parseFromString(e, "application/xml"), i = t.getElementsByTagName("HttpHeaders")[0];
1196
1242
  let n = {};
@@ -1211,7 +1257,7 @@ const Rf = (s) => {
1211
1257
  message: c
1212
1258
  };
1213
1259
  };
1214
- class Bf extends Qc {
1260
+ class Pf extends Qc {
1215
1261
  constructor(e, t) {
1216
1262
  super("playready", e, t);
1217
1263
  }
@@ -1221,7 +1267,7 @@ class Bf extends Qc {
1221
1267
  const t = new URL(this.licenseServerUrl);
1222
1268
  for (const [o, c] of Object.entries(this.queryParams))
1223
1269
  t.searchParams.append(o, c);
1224
- const i = Rf(e), n = yield fetch(t, {
1270
+ const i = Uf(e), n = yield fetch(t, {
1225
1271
  method: "POST",
1226
1272
  headers: S(S({}, i.headers), this.headers),
1227
1273
  body: i.message
@@ -1232,18 +1278,18 @@ class Bf extends Qc {
1232
1278
  });
1233
1279
  }
1234
1280
  }
1235
- class Uf extends Qc {
1281
+ class Mf extends Qc {
1236
1282
  constructor(e, t) {
1237
1283
  super("widevine", e, t);
1238
1284
  }
1239
1285
  }
1240
- const Pf = 5e3;
1241
- var G, zi, Ft, rt, wt, le, ni, ri, qo, $s, Vr, Gr, ae, Qd, Xd, qd, Zd, Zo, Jo, Jd, rr, $o, $d, Yd;
1286
+ const xf = 5e3;
1287
+ var G, Hi, Ft, rt, wt, le, ni, ri, qo, $s, Vr, Gr, ae, Qd, Xd, qd, Zd, Zo, Jo, Jd, rr, $o, $d, Yd;
1242
1288
  class Wu {
1243
1289
  constructor(e, t, i = {}) {
1244
1290
  d(this, ae);
1245
1291
  d(this, G);
1246
- d(this, zi);
1292
+ d(this, Hi);
1247
1293
  d(this, Ft);
1248
1294
  d(this, rt, new W());
1249
1295
  d(this, wt);
@@ -1287,7 +1333,7 @@ class Wu {
1287
1333
  d(this, Jo, (e) => {
1288
1334
  const t = e.target;
1289
1335
  a(this, G).debug("Key status changed for session", { sessionId: t.sessionId }), t.keyStatuses.forEach((i, n) => {
1290
- const o = zd(window.btoa(String.fromCharCode(...new Uint8Array(n))));
1336
+ const o = Hd(window.btoa(String.fromCharCode(...new Uint8Array(n))));
1291
1337
  a(this, G).debug("Key status", { base64kid: o, status: i });
1292
1338
  });
1293
1339
  });
@@ -1297,7 +1343,7 @@ class Wu {
1297
1343
  d(this, $o, (e) => f(this, null, function* () {
1298
1344
  const t = w(this, ae, $d).call(this, e);
1299
1345
  a(this, G).debug("Prioritized key system list", { keySystemList: t });
1300
- const i = yield If(t, e.videoCodec, e.audioCodec, {
1346
+ const i = yield Rf(t, e.videoCodec, e.audioCodec, {
1301
1347
  widevine: a(this, wt).widevine,
1302
1348
  playready: a(this, wt).playready
1303
1349
  });
@@ -1306,9 +1352,9 @@ class Wu {
1306
1352
  a(this, G).debug("Supported key system found", i.mediaKeySystemAccess.getConfiguration());
1307
1353
  const { keySystem: n, mediaKeySystemAccess: o } = i;
1308
1354
  let c = null;
1309
- return n === "clearkey" ? (Je(e.clearkeys, "No clearkeys found"), c = new Tf(o, e.clearkeys)) : n === "playready" ? (Je(e.playreadyLicenseUrl, "No playreadyLicenseUrl found"), c = new Bf(o, e.playreadyLicenseUrl)) : n === "widevine" ? (Je(e.widevineLicenseUrl, "No widevineLicenseUrl found"), c = new Uf(o, e.widevineLicenseUrl)) : n === "fairplay" && (Je(e.fairplayLicenseUrl, "No fairplayLicenseUrl found"), Je(e.fairplayCertificate, "No fairplayCertificate found"), c = new Cf(o, e.fairplayLicenseUrl, e.fairplayCertificate)), c && (c.headers = a(this, wt).headers || {}, c.queryParams = a(this, wt).queryParams || {}), c;
1355
+ return n === "clearkey" ? (Je(e.clearkeys, "No clearkeys found"), c = new kf(o, e.clearkeys)) : n === "playready" ? (Je(e.playreadyLicenseUrl, "No playreadyLicenseUrl found"), c = new Pf(o, e.playreadyLicenseUrl)) : n === "widevine" ? (Je(e.widevineLicenseUrl, "No widevineLicenseUrl found"), c = new Mf(o, e.widevineLicenseUrl)) : n === "fairplay" && (Je(e.fairplayLicenseUrl, "No fairplayLicenseUrl found"), Je(e.fairplayCertificate, "No fairplayCertificate found"), c = new Bf(o, e.fairplayLicenseUrl, e.fairplayCertificate)), c && (c.headers = a(this, wt).headers || {}, c.queryParams = a(this, wt).queryParams || {}), c;
1310
1356
  }));
1311
- m(this, zi, e), m(this, G, t), m(this, wt, i), a(this, zi).on("received drm data", a(this, Vr));
1357
+ m(this, Hi, e), m(this, G, t), m(this, wt, i), a(this, Hi).on("received drm data", a(this, Vr));
1312
1358
  }
1313
1359
  static isSupported() {
1314
1360
  return !!navigator.requestMediaKeySystemAccess;
@@ -1322,7 +1368,7 @@ class Wu {
1322
1368
  }
1323
1369
  unload() {
1324
1370
  var e;
1325
- a(this, G).info("Unloading EncryptedMediaExtensions"), a(this, zi).off("received drm data", a(this, Vr)), (e = a(this, Ft)) == null || e.removeEventListener("encrypted", a(this, Gr)), a(this, ni).forEach((t, i) => {
1371
+ a(this, G).info("Unloading EncryptedMediaExtensions"), a(this, Hi).off("received drm data", a(this, Vr)), (e = a(this, Ft)) == null || e.removeEventListener("encrypted", a(this, Gr)), a(this, ni).forEach((t, i) => {
1326
1372
  i.close();
1327
1373
  }), a(this, ni).clear(), m(this, ri, void 0), m(this, le, void 0);
1328
1374
  }
@@ -1344,10 +1390,10 @@ class Wu {
1344
1390
  const e = a(this, rt).resolved;
1345
1391
  m(this, rt, new W()), m(this, $s, window.setTimeout(() => {
1346
1392
  a(this, rt).resolve(e);
1347
- }, Pf));
1393
+ }, xf));
1348
1394
  }
1349
1395
  }
1350
- G = new WeakMap(), zi = new WeakMap(), Ft = new WeakMap(), rt = new WeakMap(), wt = new WeakMap(), le = new WeakMap(), ni = new WeakMap(), ri = new WeakMap(), qo = new WeakMap(), $s = new WeakMap(), Vr = new WeakMap(), Gr = new WeakMap(), ae = new WeakSet(), Qd = function(e) {
1396
+ G = new WeakMap(), Hi = new WeakMap(), Ft = new WeakMap(), rt = new WeakMap(), wt = new WeakMap(), le = new WeakMap(), ni = new WeakMap(), ri = new WeakMap(), qo = new WeakMap(), $s = new WeakMap(), Vr = new WeakMap(), Gr = new WeakMap(), ae = new WeakSet(), Qd = function(e) {
1351
1397
  return f(this, null, function* () {
1352
1398
  try {
1353
1399
  yield w(this, ae, Xd).call(this), a(this, G).debug("Media keys initialization completed"), yield w(this, ae, qd).call(this, e.initData, e.initDataType);
@@ -1390,7 +1436,7 @@ G = new WeakMap(), zi = new WeakMap(), Ft = new WeakMap(), rt = new WeakMap(), w
1390
1436
  });
1391
1437
  }, Zd = function(e) {
1392
1438
  for (const [t, i] of a(this, ni))
1393
- if (vf(e, i)) return !1;
1439
+ if (Ef(e, i)) return !1;
1394
1440
  return !0;
1395
1441
  }, Zo = new WeakMap(), Jo = new WeakMap(), Jd = function(e, t) {
1396
1442
  return f(this, null, function* () {
@@ -1402,7 +1448,7 @@ G = new WeakMap(), zi = new WeakMap(), Ft = new WeakMap(), rt = new WeakMap(), w
1402
1448
  });
1403
1449
  }, rr = function(e) {
1404
1450
  const { message: t, isFatal: i, error: n } = e;
1405
- a(this, G).error(t, { error: n }), a(this, zi).emit("error", Wd(t, i, n));
1451
+ a(this, G).error(t, { error: n }), a(this, Hi).emit("error", Wd(t, i, n));
1406
1452
  }, $o = new WeakMap(), /**
1407
1453
  * Get the prioritized key system list based on the DRM data provided.
1408
1454
  * The order of the key systems in the list is the order in which they will be tried.
@@ -1420,28 +1466,28 @@ $d = function(e) {
1420
1466
  clearkey: void 0
1421
1467
  };
1422
1468
  };
1423
- const Mf = 7, xf = 8, Lf = (s) => {
1469
+ const Lf = 7, Df = 8, Of = (s) => {
1424
1470
  const e = s.getUint32(0, !1), t = s.getUint8(0) << 16 | s.getUint16(1, !1);
1425
1471
  let i = 0;
1426
1472
  return t === 1 ? i += 3 : e === 1 && (i += 4), i;
1427
- }, Df = (s) => Lf(new DataView(s, 0)) !== 0, zu = (s, e = 0) => {
1473
+ }, Ff = (s) => Of(new DataView(s, 0)) !== 0, Hu = (s, e = 0) => {
1428
1474
  for (let t = e; t < s.byteLength - 4; t++) {
1429
1475
  const i = s.getUint32(t) === 1, n = (s.getUint8(t) << 16 | s.getUint16(t + 1)) === 1;
1430
1476
  if (i || n)
1431
1477
  return { position: t, nalPrefixSize: i ? 4 : 3 };
1432
1478
  }
1433
- }, Of = (s) => s & 31, Ff = (s, e) => {
1479
+ }, _f = (s) => s & 31, Nf = (s, e) => {
1434
1480
  const t = new DataView(s, 0);
1435
- let i = zu(t);
1481
+ let i = Hu(t);
1436
1482
  for (; i; ) {
1437
- const { position: n, nalPrefixSize: o } = i, c = zu(t, n + 4), h = c ? c.position - n - o : void 0;
1483
+ const { position: n, nalPrefixSize: o } = i, c = Hu(t, n + 4), h = c ? c.position - n - o : void 0;
1438
1484
  if (!e(new DataView(s, n + o, h), o))
1439
1485
  return;
1440
1486
  i = c;
1441
1487
  }
1442
1488
  }, Kd = (s) => {
1443
1489
  const e = [], t = [];
1444
- if (!Df(s)) {
1490
+ if (!Ff(s)) {
1445
1491
  const i = new DataView(s, 0), n = i.getUint8(5) & 31;
1446
1492
  let o = 6;
1447
1493
  for (let h = 0; h < n; h++) {
@@ -1459,19 +1505,19 @@ const Mf = 7, xf = 8, Lf = (s) => {
1459
1505
  pictureParameterSets: t
1460
1506
  };
1461
1507
  }
1462
- return Ff(s, (i) => {
1508
+ return Nf(s, (i) => {
1463
1509
  const n = i.byteOffset + i.byteLength;
1464
- switch (Of(i.getUint8(0))) {
1465
- case xf:
1510
+ switch (_f(i.getUint8(0))) {
1511
+ case Df:
1466
1512
  t.push(i.buffer.slice(i.byteOffset, n));
1467
1513
  break;
1468
- case Mf:
1514
+ case Lf:
1469
1515
  e.push(i.buffer.slice(i.byteOffset, n));
1470
1516
  break;
1471
1517
  }
1472
1518
  return !0;
1473
1519
  }), { sequenceParameterSets: e, pictureParameterSets: t };
1474
- }, _f = (s) => {
1520
+ }, Vf = (s) => {
1475
1521
  var v;
1476
1522
  const e = new DataView(s), t = e.getUint8(1), i = e.getUint8(2), n = e.getUint8(3), o = new Md(s, 32);
1477
1523
  o.readUnsignedExpGolomb();
@@ -1489,11 +1535,11 @@ const Mf = 7, xf = 8, Lf = (s) => {
1489
1535
  case 138:
1490
1536
  case 144: {
1491
1537
  if (c = o.readUnsignedExpGolomb(), c === 3 && o.readBits(1), o.readUnsignedExpGolomb() + 8, o.readUnsignedExpGolomb() + 8, o.readBit(), o.readBit()) {
1492
- for (let I = 0; I < (c != 3 ? 8 : 12); I++)
1538
+ for (let C = 0; C < (c != 3 ? 8 : 12); C++)
1493
1539
  if (o.readBit()) {
1494
- const T = I < 6 ? 16 : 64;
1540
+ const T = C < 6 ? 16 : 64;
1495
1541
  let U = 0, B = 8, Q = 8;
1496
- for (let H = 0; H < T; H++)
1542
+ for (let z = 0; z < T; z++)
1497
1543
  Q != 0 && (U = o.readSignedExpGolomb(), Q = (B + U + 256) % 256), B = Q == 0 ? B : Q;
1498
1544
  }
1499
1545
  }
@@ -1511,14 +1557,14 @@ const Mf = 7, xf = 8, Lf = (s) => {
1511
1557
  p === 0 && o.readBit(), o.readBit();
1512
1558
  let g = u + 1, A = l + 1;
1513
1559
  if (A *= 2 - p, A *= 16, g *= 16, o.readBit()) {
1514
- const k = c == 1 ? 1 : 0, x = 1 << (c == 1 || c == 2 ? 1 : 0), T = 2 - p << k, U = o.readUnsignedExpGolomb() * x, B = o.readUnsignedExpGolomb() * x, Q = o.readUnsignedExpGolomb() * T, H = o.readUnsignedExpGolomb() * T;
1515
- g -= U + B, A -= Q + H;
1560
+ const k = c == 1 ? 1 : 0, x = 1 << (c == 1 || c == 2 ? 1 : 0), T = 2 - p << k, U = o.readUnsignedExpGolomb() * x, B = o.readUnsignedExpGolomb() * x, Q = o.readUnsignedExpGolomb() * T, z = o.readUnsignedExpGolomb() * T;
1561
+ g -= U + B, A -= Q + z;
1516
1562
  }
1517
1563
  let b = {
1518
1564
  numerator: 1,
1519
1565
  denumerator: 1
1520
1566
  };
1521
- return o.readBit() && o.readBit() && (b = (v = Nf[o.readBits(8)]) != null ? v : { numerator: 0, denumerator: 0 }), {
1567
+ return o.readBit() && o.readBit() && (b = (v = Gf[o.readBits(8)]) != null ? v : { numerator: 0, denumerator: 0 }), {
1522
1568
  width: g,
1523
1569
  height: A,
1524
1570
  pixelAspectRatio: b,
@@ -1526,7 +1572,7 @@ const Mf = 7, xf = 8, Lf = (s) => {
1526
1572
  constraintFlags: i,
1527
1573
  levelIdc: n
1528
1574
  };
1529
- }, Nf = [
1575
+ }, Gf = [
1530
1576
  { numerator: 0, denumerator: 0 },
1531
1577
  { numerator: 1, denumerator: 1 },
1532
1578
  { numerator: 12, denumerator: 11 },
@@ -1544,20 +1590,20 @@ const Mf = 7, xf = 8, Lf = (s) => {
1544
1590
  { numerator: 4, denumerator: 3 },
1545
1591
  { numerator: 3, denumerator: 2 },
1546
1592
  { numerator: 2, denumerator: 1 }
1547
- ], Vf = 184549376;
1548
- function Gf(s) {
1549
- const e = new Zn(s), t = jf(e);
1550
- (t.flags & Vf) !== 0 && Wf(e);
1551
- const i = zf(e);
1593
+ ], jf = 184549376;
1594
+ function Wf(s) {
1595
+ const e = new Zn(s), t = Hf(e);
1596
+ (t.flags & jf) !== 0 && zf(e);
1597
+ const i = Qf(e);
1552
1598
  if (String.fromCharCode(...i.frameId) === "TXXX") {
1553
1599
  const o = new Zn(e.readBytes(i.size));
1554
1600
  return {
1555
1601
  header: t,
1556
- txx: Hf(o)
1602
+ txx: Xf(o)
1557
1603
  };
1558
1604
  }
1559
1605
  }
1560
- function jf(s) {
1606
+ function Hf(s) {
1561
1607
  const e = s.readBytes(3), t = s.readUint8(), i = s.readUint8(), n = s.readUint8(), o = s.readUint32();
1562
1608
  return {
1563
1609
  id: e,
@@ -1567,11 +1613,11 @@ function jf(s) {
1567
1613
  size: o
1568
1614
  };
1569
1615
  }
1570
- function Wf(s) {
1616
+ function zf(s) {
1571
1617
  const e = s.readUint32();
1572
1618
  return s.readBytes(e - 4), {};
1573
1619
  }
1574
- function zf(s) {
1620
+ function Qf(s) {
1575
1621
  const e = s.readBytes(4), t = s.readUint32(), i = s.readUint16();
1576
1622
  return {
1577
1623
  frameId: e,
@@ -1579,7 +1625,7 @@ function zf(s) {
1579
1625
  flags: i
1580
1626
  };
1581
1627
  }
1582
- function Hf(s) {
1628
+ function Xf(s) {
1583
1629
  const e = s.readUint8(), t = s.readUtf8String(), i = s.readUtf8String();
1584
1630
  return {
1585
1631
  encoding: e,
@@ -1596,7 +1642,7 @@ function el(s) {
1596
1642
  type: t
1597
1643
  };
1598
1644
  }
1599
- function Qf(s, e) {
1645
+ function qf(s, e) {
1600
1646
  const t = el(e), i = new Zn(e.readBytes(t.size));
1601
1647
  if (t.type !== s.type)
1602
1648
  throw new Error(`invalid error type: ${t.type}, expected ${s.type}`);
@@ -1690,7 +1736,7 @@ const mr = class mr {
1690
1736
  };
1691
1737
  r(mr, "type", "tfdt");
1692
1738
  let yo = mr;
1693
- const Xf = 1, qf = 2, Zf = 8, Jf = 16, $f = 32, fr = class fr {
1739
+ const Zf = 1, Jf = 2, $f = 8, Yf = 16, Kf = 32, fr = class fr {
1694
1740
  constructor(e, t, i, n) {
1695
1741
  r(this, "type", fr.type);
1696
1742
  r(this, "extra");
@@ -1702,7 +1748,7 @@ const Xf = 1, qf = 2, Zf = 8, Jf = 16, $f = 32, fr = class fr {
1702
1748
  static decodeData(e) {
1703
1749
  const t = Pt(e);
1704
1750
  let i, n, o;
1705
- return e.readUint32(), (t.flags & Xf) > 0 && e.readUint64(), (t.flags & qf) > 0 && e.readUint32(), (t.flags & Zf) > 0 && (i = e.readUint32()), (t.flags & Jf) > 0 && (n = e.readUint32()), (t.flags & $f) > 0 && (o = e.readUint32()), new fr(t, i, n, o);
1751
+ return e.readUint32(), (t.flags & Zf) > 0 && e.readUint64(), (t.flags & Jf) > 0 && e.readUint32(), (t.flags & $f) > 0 && (i = e.readUint32()), (t.flags & Yf) > 0 && (n = e.readUint32()), (t.flags & Kf) > 0 && (o = e.readUint32()), new fr(t, i, n, o);
1706
1752
  }
1707
1753
  };
1708
1754
  r(fr, "type", "tfhd");
@@ -1832,7 +1878,7 @@ const Ns = class Ns {
1832
1878
  }
1833
1879
  };
1834
1880
  r(Ns, "type", "mdhd");
1835
- let Io = Ns;
1881
+ let Co = Ns;
1836
1882
  const br = class br {
1837
1883
  constructor(e, t, i, n, o) {
1838
1884
  r(this, "type", br.type);
@@ -1880,7 +1926,7 @@ const br = class br {
1880
1926
  }
1881
1927
  };
1882
1928
  r(br, "type", "stsd");
1883
- let Co = br;
1929
+ let Io = br;
1884
1930
  const yr = class yr {
1885
1931
  constructor(e) {
1886
1932
  r(this, "type", yr.type);
@@ -1891,7 +1937,7 @@ const yr = class yr {
1891
1937
  let t;
1892
1938
  for (; e.remaining() > 0; ) {
1893
1939
  const i = Ke(e);
1894
- i instanceof Co && (t = i);
1940
+ i instanceof Io && (t = i);
1895
1941
  }
1896
1942
  if (!t)
1897
1943
  throw new Error("No stsd found");
@@ -1931,7 +1977,7 @@ const vr = class vr {
1931
1977
  let t, i, n;
1932
1978
  for (; e.remaining() > 0; ) {
1933
1979
  const o = Ke(e);
1934
- o instanceof ko && (t = o), o instanceof Bo && (i = o), o instanceof Io && (n = o);
1980
+ o instanceof ko && (t = o), o instanceof Bo && (i = o), o instanceof Co && (n = o);
1935
1981
  }
1936
1982
  if (!t)
1937
1983
  throw new Error("No hdlr found");
@@ -2018,9 +2064,9 @@ const kr = class kr {
2018
2064
  };
2019
2065
  r(kr, "type", "moov");
2020
2066
  let xo = kr;
2021
- const Ir = class Ir {
2067
+ const Cr = class Cr {
2022
2068
  constructor(e, t, i, n, o, c, h, u) {
2023
- r(this, "type", Ir.type);
2069
+ r(this, "type", Cr.type);
2024
2070
  r(this, "configurationVersion");
2025
2071
  r(this, "avcProfileIndication");
2026
2072
  r(this, "profileCompatibility");
@@ -2042,7 +2088,7 @@ const Ir = class Ir {
2042
2088
  const b = e.readBytes(e.readUint16());
2043
2089
  g.push(b);
2044
2090
  }
2045
- return new Ir(
2091
+ return new Cr(
2046
2092
  i,
2047
2093
  n,
2048
2094
  o,
@@ -2054,11 +2100,11 @@ const Ir = class Ir {
2054
2100
  );
2055
2101
  }
2056
2102
  };
2057
- r(Ir, "type", "avcC");
2058
- let ph = Ir;
2059
- const Cr = class Cr {
2103
+ r(Cr, "type", "avcC");
2104
+ let ph = Cr;
2105
+ const Ir = class Ir {
2060
2106
  constructor(e, t, i, n, o) {
2061
- r(this, "type", Cr.type);
2107
+ r(this, "type", Ir.type);
2062
2108
  r(this, "avcC");
2063
2109
  r(this, "width");
2064
2110
  r(this, "height");
@@ -2077,12 +2123,12 @@ const Cr = class Cr {
2077
2123
  }
2078
2124
  if (!c)
2079
2125
  throw new Error("no avcC");
2080
- return new Cr(c, t, i, n, o);
2126
+ return new Ir(c, t, i, n, o);
2081
2127
  }
2082
2128
  };
2083
- r(Cr, "type", "avc1");
2084
- let gh = Cr;
2085
- const Yf = (s) => {
2129
+ r(Ir, "type", "avc1");
2130
+ let gh = Ir;
2131
+ const ep = (s) => {
2086
2132
  for (let e = 0; e < s.length - 1; e++) {
2087
2133
  if (s[e] !== 5)
2088
2134
  continue;
@@ -2107,7 +2153,7 @@ const Yf = (s) => {
2107
2153
  static decodeData(e) {
2108
2154
  var n;
2109
2155
  Pt(e);
2110
- const t = e.readRemaining(), i = (n = Yf(t)) != null ? n : new Uint8Array(0);
2156
+ const t = e.readRemaining(), i = (n = ep(t)) != null ? n : new Uint8Array(0);
2111
2157
  return new Rr(i);
2112
2158
  }
2113
2159
  };
@@ -2182,7 +2228,7 @@ const Pr = class Pr {
2182
2228
  e.readUint16(), e.readUint32();
2183
2229
  const n = e.readUint16();
2184
2230
  e.readUint16(), t === 1 && (e.readUint64(), e.readUint64());
2185
- const o = Qf(bh, e);
2231
+ const o = qf(bh, e);
2186
2232
  return new Pr(o, i, n);
2187
2233
  }
2188
2234
  };
@@ -2214,7 +2260,7 @@ const Vs = class Vs {
2214
2260
  r(Vs, "type", "prft");
2215
2261
  let Lo = Vs;
2216
2262
  var jr, Wr;
2217
- class Kf {
2263
+ class tp {
2218
2264
  constructor(e, t) {
2219
2265
  d(this, jr);
2220
2266
  d(this, Wr);
@@ -2228,7 +2274,7 @@ class Kf {
2228
2274
  }
2229
2275
  }
2230
2276
  jr = new WeakMap(), Wr = new WeakMap();
2231
- const ep = {
2277
+ const ip = {
2232
2278
  moov: xo,
2233
2279
  trak: Mo,
2234
2280
  tkhd: Po,
@@ -2243,8 +2289,8 @@ const ep = {
2243
2289
  hdlr: ko,
2244
2290
  minf: Bo,
2245
2291
  stbl: Ro,
2246
- mdhd: Io,
2247
- stsd: Co,
2292
+ mdhd: Co,
2293
+ stsd: Io,
2248
2294
  prft: Lo,
2249
2295
  avc1: gh,
2250
2296
  avcC: ph,
@@ -2254,15 +2300,15 @@ const ep = {
2254
2300
  emsg: wo
2255
2301
  };
2256
2302
  function Ke(s) {
2257
- const e = el(s), t = ep[e.type], i = new Zn(s.readBytes(e.size));
2303
+ const e = el(s), t = ip[e.type], i = new Zn(s.readBytes(e.size));
2258
2304
  if (!t) {
2259
- const o = new Kf(e, i);
2305
+ const o = new tp(e, i);
2260
2306
  return i.readRemaining(), o;
2261
2307
  }
2262
2308
  const n = t.decodeData(i);
2263
2309
  return i.readRemaining(), n;
2264
2310
  }
2265
- function tp(s) {
2311
+ function sp(s) {
2266
2312
  if (s.byteLength < 8)
2267
2313
  throw new Error("Buffer too small");
2268
2314
  const e = new Zn(s), t = /* @__PURE__ */ new Map();
@@ -2280,7 +2326,7 @@ function tp(s) {
2280
2326
  moov: n
2281
2327
  };
2282
2328
  }
2283
- function ip(s) {
2329
+ function np(s) {
2284
2330
  if (s.byteLength < 8)
2285
2331
  throw new Error("Buffer too small");
2286
2332
  const e = new Zn(s), t = /* @__PURE__ */ new Map(), i = [];
@@ -2302,28 +2348,28 @@ function ip(s) {
2302
2348
  emsgs: i
2303
2349
  };
2304
2350
  }
2305
- var zr, Hr;
2306
- class sp {
2351
+ var Hr, zr;
2352
+ class rp {
2307
2353
  constructor(e) {
2308
- d(this, zr);
2309
2354
  d(this, Hr);
2310
- m(this, zr, e), m(this, Hr, tp(e));
2355
+ d(this, zr);
2356
+ m(this, Hr, e), m(this, zr, sp(e));
2311
2357
  }
2312
2358
  rawBytes() {
2313
- return a(this, zr);
2359
+ return a(this, Hr);
2314
2360
  }
2315
2361
  init() {
2316
- return a(this, Hr);
2362
+ return a(this, zr);
2317
2363
  }
2318
2364
  }
2319
- zr = new WeakMap(), Hr = new WeakMap();
2320
- var Te, De, z;
2365
+ Hr = new WeakMap(), zr = new WeakMap();
2366
+ var Te, De, H;
2321
2367
  const bu = class bu {
2322
2368
  constructor(e, t) {
2323
2369
  d(this, Te);
2324
2370
  d(this, De);
2325
- d(this, z);
2326
- m(this, Te, t), m(this, De, e), m(this, z, ip(t));
2371
+ d(this, H);
2372
+ m(this, Te, t), m(this, De, e), m(this, H, np(t));
2327
2373
  }
2328
2374
  /**
2329
2375
  * @returns a new fragment with a clone of the raw bytes
@@ -2340,19 +2386,19 @@ const bu = class bu {
2340
2386
  */
2341
2387
  updateBaseMediaDecodeTime(e) {
2342
2388
  const t = new DataView(a(this, Te).buffer, a(this, Te).byteOffset, a(this, Te).byteLength);
2343
- if (a(this, z).moof.traf.tfdt)
2344
- if (a(this, z).moof.traf.tfdt.baseMediaDecodeTime = e, a(this, z).moof.traf.tfdt.extra.version === 1) {
2389
+ if (a(this, H).moof.traf.tfdt)
2390
+ if (a(this, H).moof.traf.tfdt.baseMediaDecodeTime = e, a(this, H).moof.traf.tfdt.extra.version === 1) {
2345
2391
  const i = Math.floor(e / 4294967296), n = (e & 4294967295) >>> 0;
2346
- t.setUint32(a(this, z).moof.traf.tfdt.byteOffset - a(this, Te).byteOffset, i), t.setUint32(a(this, z).moof.traf.tfdt.byteOffset - a(this, Te).byteOffset + 4, n);
2392
+ t.setUint32(a(this, H).moof.traf.tfdt.byteOffset - a(this, Te).byteOffset, i), t.setUint32(a(this, H).moof.traf.tfdt.byteOffset - a(this, Te).byteOffset + 4, n);
2347
2393
  } else
2348
- t.setUint32(a(this, z).moof.traf.tfdt.byteOffset - a(this, Te).byteOffset, e);
2394
+ t.setUint32(a(this, H).moof.traf.tfdt.byteOffset - a(this, Te).byteOffset, e);
2349
2395
  }
2350
2396
  producerReferenceTime() {
2351
- if (a(this, z).prft)
2352
- return a(this, z).prft.date();
2397
+ if (a(this, H).prft)
2398
+ return a(this, H).prft.date();
2353
2399
  }
2354
2400
  duration() {
2355
- const e = a(this, z).moof.traf.trun, t = a(this, z).moof.traf.tfhd;
2401
+ const e = a(this, H).moof.traf.trun, t = a(this, H).moof.traf.tfhd;
2356
2402
  if ((e == null ? void 0 : e.sampleDurations.length) === 0) {
2357
2403
  const i = (e == null ? void 0 : e.samplesCount) || 1;
2358
2404
  if (t != null && t.defaultSampleDuration)
@@ -2362,19 +2408,19 @@ const bu = class bu {
2362
2408
  }
2363
2409
  baseMediaDecodeTime() {
2364
2410
  var t;
2365
- const e = (t = a(this, z).moof.traf.tfdt) == null ? void 0 : t.baseMediaDecodeTime;
2411
+ const e = (t = a(this, H).moof.traf.tfdt) == null ? void 0 : t.baseMediaDecodeTime;
2366
2412
  if (!e)
2367
2413
  throw new Error("no baseMediaDecodeTime");
2368
2414
  return e;
2369
2415
  }
2370
2416
  startsWithKeyframe() {
2371
2417
  var i;
2372
- const e = a(this, z).moof.traf.trun, t = (e == null ? void 0 : e.firstSampleFlags) || (e == null ? void 0 : e.sampleFlags[0]) || ((i = a(this, z).moof.traf.tfhd) == null ? void 0 : i.defaultSampleFlags);
2418
+ const e = a(this, H).moof.traf.trun, t = (e == null ? void 0 : e.firstSampleFlags) || (e == null ? void 0 : e.sampleFlags[0]) || ((i = a(this, H).moof.traf.tfhd) == null ? void 0 : i.defaultSampleFlags);
2373
2419
  return t ? (t & Mr.FLAG_SAMPLE_DEPENDS_NO) !== 0 : !1;
2374
2420
  }
2375
2421
  compositionTimeOffset(e) {
2376
2422
  var t;
2377
- return (t = a(this, z).moof.traf.trun) == null ? void 0 : t.sampleCts[e];
2423
+ return (t = a(this, H).moof.traf.trun) == null ? void 0 : t.sampleCts[e];
2378
2424
  }
2379
2425
  timescale() {
2380
2426
  const e = a(this, De).init().moov.traks[0];
@@ -2393,18 +2439,18 @@ const bu = class bu {
2393
2439
  return a(this, De);
2394
2440
  }
2395
2441
  fragment() {
2396
- return a(this, z);
2442
+ return a(this, H);
2397
2443
  }
2398
2444
  samplesCount() {
2399
2445
  var e;
2400
- return ((e = a(this, z).moof.traf.trun) == null ? void 0 : e.samplesCount) || 0;
2446
+ return ((e = a(this, H).moof.traf.trun) == null ? void 0 : e.samplesCount) || 0;
2401
2447
  }
2402
2448
  sample(e) {
2403
- var k, I, x, T, U, B, Q, H, Ve, ie, et, mt, Ue, y, E, j;
2404
- const t = (k = a(this, De).init().moov.traks[0]) == null ? void 0 : k.mdia.minf.stbl.stsd.codec, i = ((I = a(this, z).moof.traf.trun) == null ? void 0 : I.samplesCount) || 0, n = (x = a(this, z).moof.traf.tfdt) == null ? void 0 : x.baseMediaDecodeTime;
2449
+ var k, C, x, T, U, B, Q, z, Ve, ie, et, mt, Ue, y, E, j;
2450
+ const t = (k = a(this, De).init().moov.traks[0]) == null ? void 0 : k.mdia.minf.stbl.stsd.codec, i = ((C = a(this, H).moof.traf.trun) == null ? void 0 : C.samplesCount) || 0, n = (x = a(this, H).moof.traf.tfdt) == null ? void 0 : x.baseMediaDecodeTime;
2405
2451
  if (e >= i || typeof n == "undefined" || !t)
2406
2452
  return;
2407
- const o = this.compositionTimeOffset(e), c = ((T = a(this, z).moof.traf.trun) == null ? void 0 : T.sampleDurations[e]) || 0, h = ((U = a(this, z).moof.traf.trun) == null ? void 0 : U.sampleDurations.slice(0, e).reduce((O, M) => O + M, 0)) || 0, u = n + h, l = ((B = a(this, De).init().moov.traks[0]) == null ? void 0 : B.mdia.mdhd.timescale) || 1e3, p = ((Q = a(this, z).moof.traf.trun) == null ? void 0 : Q.sampleSizes[e]) || a(this, z).mdat.data.byteLength, g = ((H = a(this, z).moof.traf.trun) == null ? void 0 : H.sampleSizes.slice(0, e).reduce((O, M) => O + M, 0)) || 0, A = a(this, z).mdat.data.subarray(g, g + p), b = ((Ve = a(this, z).moof.traf.trun) == null ? void 0 : Ve.is_sync_sample(e)) || !1;
2453
+ const o = this.compositionTimeOffset(e), c = ((T = a(this, H).moof.traf.trun) == null ? void 0 : T.sampleDurations[e]) || 0, h = ((U = a(this, H).moof.traf.trun) == null ? void 0 : U.sampleDurations.slice(0, e).reduce((O, M) => O + M, 0)) || 0, u = n + h, l = ((B = a(this, De).init().moov.traks[0]) == null ? void 0 : B.mdia.mdhd.timescale) || 1e3, p = ((Q = a(this, H).moof.traf.trun) == null ? void 0 : Q.sampleSizes[e]) || a(this, H).mdat.data.byteLength, g = ((z = a(this, H).moof.traf.trun) == null ? void 0 : z.sampleSizes.slice(0, e).reduce((O, M) => O + M, 0)) || 0, A = a(this, H).mdat.data.subarray(g, g + p), b = ((Ve = a(this, H).moof.traf.trun) == null ? void 0 : Ve.is_sync_sample(e)) || !1;
2408
2454
  if (this.mediaType() === "video") {
2409
2455
  const O = ((ie = a(this, De).init().moov.traks[0]) == null ? void 0 : ie.tkhd.width) || 0, M = ((et = a(this, De).init().moov.traks[0]) == null ? void 0 : et.tkhd.height) || 0;
2410
2456
  return {
@@ -2441,13 +2487,13 @@ const bu = class bu {
2441
2487
  return a(this, Te);
2442
2488
  }
2443
2489
  };
2444
- Te = new WeakMap(), De = new WeakMap(), z = new WeakMap();
2490
+ Te = new WeakMap(), De = new WeakMap(), H = new WeakMap();
2445
2491
  let Sh = bu;
2446
2492
  var Ys;
2447
- class Hu {
2493
+ class zu {
2448
2494
  constructor(e) {
2449
2495
  d(this, Ys);
2450
- m(this, Ys, new sp(e));
2496
+ m(this, Ys, new rp(e));
2451
2497
  }
2452
2498
  header() {
2453
2499
  return a(this, Ys);
@@ -2457,68 +2503,68 @@ class Hu {
2457
2503
  }
2458
2504
  }
2459
2505
  Ys = new WeakMap();
2460
- function C(s) {
2506
+ function I(s) {
2461
2507
  const e = new ArrayBuffer(s.length), t = new Uint8Array(e);
2462
2508
  for (let i = 0, n = s.length; i < n; i++)
2463
2509
  t[i] = s.charCodeAt(i);
2464
2510
  return new Uint8Array(e);
2465
2511
  }
2466
2512
  const F = {
2467
- ftyp: C("ftyp"),
2468
- mvhd: C("mvhd"),
2469
- moov: C("moov"),
2470
- trak: C("trak"),
2471
- tkhd: C("tkhd"),
2472
- mdia: C("mdia"),
2473
- mdhd: C("mdhd"),
2474
- hdlr: C("hdlr"),
2475
- minf: C("minf"),
2476
- vmhd: C("vmhd"),
2477
- smhd: C("smhd"),
2478
- dinf: C("dinf"),
2479
- dref: C("dref"),
2480
- stbl: C("stbl"),
2481
- stsd: C("stsd"),
2482
- avc1: C("avc1"),
2483
- av01: C("av01"),
2484
- av1C: C("av1C"),
2485
- avcC: C("avcC"),
2486
- esds: C("esds"),
2487
- colr: C("colr"),
2488
- nclx: C("nclx"),
2489
- mvex: C("mvex"),
2490
- trex: C("trex"),
2491
- udta: C("udta"),
2492
- meta: C("meta"),
2493
- ilst: C("ilst"),
2494
- moof: C("moof"),
2495
- mfhd: C("mfhd"),
2496
- traf: C("traf"),
2497
- tfhd: C("tfhd"),
2498
- tfdt: C("tfdt"),
2499
- trun: C("trun"),
2500
- mdat: C("mdat"),
2501
- mp4a: C("mp4a"),
2502
- Opus: C("Opus"),
2503
- prft: C("prft"),
2504
- dOps: C("dOps"),
2505
- emsg: C("emsg")
2506
- }, np = 1e3, Ye = {
2507
- vide: C("vide"),
2508
- soun: C("soun"),
2509
- videoHandler: C("VideoHandler\0"),
2510
- soundHandler: C("SoundHandler\0"),
2511
- url: C("url "),
2512
- pasp: C("pasp"),
2513
- btrt: C("btrt"),
2514
- stts: C("stts"),
2515
- stsc: C("stsc"),
2516
- stsz: C("stsz"),
2517
- stco: C("stco"),
2518
- data: C("data"),
2519
- mdir: C("mdir"),
2520
- appl: C("appl")
2521
- }, xr = C("iso6"), Qu = new Uint8Array([0, 0, 2, 0]), rp = [
2513
+ ftyp: I("ftyp"),
2514
+ mvhd: I("mvhd"),
2515
+ moov: I("moov"),
2516
+ trak: I("trak"),
2517
+ tkhd: I("tkhd"),
2518
+ mdia: I("mdia"),
2519
+ mdhd: I("mdhd"),
2520
+ hdlr: I("hdlr"),
2521
+ minf: I("minf"),
2522
+ vmhd: I("vmhd"),
2523
+ smhd: I("smhd"),
2524
+ dinf: I("dinf"),
2525
+ dref: I("dref"),
2526
+ stbl: I("stbl"),
2527
+ stsd: I("stsd"),
2528
+ avc1: I("avc1"),
2529
+ av01: I("av01"),
2530
+ av1C: I("av1C"),
2531
+ avcC: I("avcC"),
2532
+ esds: I("esds"),
2533
+ colr: I("colr"),
2534
+ nclx: I("nclx"),
2535
+ mvex: I("mvex"),
2536
+ trex: I("trex"),
2537
+ udta: I("udta"),
2538
+ meta: I("meta"),
2539
+ ilst: I("ilst"),
2540
+ moof: I("moof"),
2541
+ mfhd: I("mfhd"),
2542
+ traf: I("traf"),
2543
+ tfhd: I("tfhd"),
2544
+ tfdt: I("tfdt"),
2545
+ trun: I("trun"),
2546
+ mdat: I("mdat"),
2547
+ mp4a: I("mp4a"),
2548
+ Opus: I("Opus"),
2549
+ prft: I("prft"),
2550
+ dOps: I("dOps"),
2551
+ emsg: I("emsg")
2552
+ }, ap = 1e3, Ye = {
2553
+ vide: I("vide"),
2554
+ soun: I("soun"),
2555
+ videoHandler: I("VideoHandler\0"),
2556
+ soundHandler: I("SoundHandler\0"),
2557
+ url: I("url "),
2558
+ pasp: I("pasp"),
2559
+ btrt: I("btrt"),
2560
+ stts: I("stts"),
2561
+ stsc: I("stsc"),
2562
+ stsz: I("stsz"),
2563
+ stco: I("stco"),
2564
+ data: I("data"),
2565
+ mdir: I("mdir"),
2566
+ appl: I("appl")
2567
+ }, xr = I("iso6"), Qu = new Uint8Array([0, 0, 2, 0]), op = [
2522
2568
  xr,
2523
2569
  new Uint8Array([105, 115, 111, 109]),
2524
2570
  // isom
@@ -2528,7 +2574,7 @@ const F = {
2528
2574
  // avc1
2529
2575
  new Uint8Array([109, 112, 52, 49])
2530
2576
  // mp41
2531
- ], ap = [
2577
+ ], cp = [
2532
2578
  xr,
2533
2579
  new Uint8Array([105, 115, 111, 109]),
2534
2580
  // isom
@@ -2538,7 +2584,7 @@ const F = {
2538
2584
  // av01
2539
2585
  new Uint8Array([109, 112, 52, 49])
2540
2586
  // mp41
2541
- ], op = [
2587
+ ], hp = [
2542
2588
  xr,
2543
2589
  new Uint8Array([105, 115, 111, 109]),
2544
2590
  // isom
@@ -2564,11 +2610,11 @@ const re = (s, e, t) => {
2564
2610
  F.ftyp,
2565
2611
  xr.byteLength + Qu.byteLength + e.reduce((t, i) => t + i.byteLength, 0)
2566
2612
  ), s.writer.writeBytes(xr), s.writer.writeBytes(Qu), e.forEach((t) => s.writer.writeBytes(t));
2567
- }, cp = 2 ** 32, hp = 2208988800, up = (s, e, t, i) => {
2613
+ }, up = 2 ** 32, dp = 2208988800, lp = (s, e, t, i) => {
2568
2614
  oe(s, F.prft, 20, 1, 0);
2569
- const o = t / 1e3, c = Math.floor(o), u = (o - c) * 1e3 * 1e3 * cp / 1e6;
2570
- s.writer.writeUint32(e), s.writer.writeUint32(c + hp), s.writer.writeUint32(u), s.writer.writeUint64(i);
2571
- }, dp = (s, e, t) => {
2615
+ const o = t / 1e3, c = Math.floor(o), u = (o - c) * 1e3 * 1e3 * up / 1e6;
2616
+ s.writer.writeUint32(e), s.writer.writeUint32(c + dp), s.writer.writeUint32(u), s.writer.writeUint64(i);
2617
+ }, mp = (s, e, t) => {
2572
2618
  oe(s, F.mvhd, 96, 0, 0), s.writer.writeUint32(0), s.writer.writeUint32(0), s.writer.writeUint32(t), s.writer.writeUint32(e), s.writer.writeUint32(65536), s.writer.writeUint16(256), s.writer.writeBytes(new Uint8Array([
2573
2619
  // reserved and unused junk
2574
2620
  0,
@@ -2642,7 +2688,7 @@ const re = (s, e, t) => {
2642
2688
  0,
2643
2689
  0
2644
2690
  ])), s.writer.writeUint32(2);
2645
- }, il = (s) => "sequenceParameterSets" in s, vh = (s) => "sequenceHeader" in s, Es = (s) => s.type == "video", ur = (s) => s.type == "audio", lp = (s, e, t) => {
2691
+ }, il = (s) => "sequenceParameterSets" in s, vh = (s) => "sequenceHeader" in s, Es = (s) => s.type == "video", ur = (s) => s.type == "audio", fp = (s, e, t) => {
2646
2692
  const i = s.writer.position();
2647
2693
  oe(s, F.tkhd, 0, 0, 3), s.writer.writeUint32(0), s.writer.writeUint32(0), s.writer.writeUint32(e.trackId), s.writer.writeUint32(0), s.writer.writeUint32(e.duration * t / e.timescale), s.writer.writeUint32(0), s.writer.writeUint32(0), s.writer.writeUint16(0), s.writer.writeUint16(ur(e) ? 1 : 0), s.writer.writeUint16(ur(e) ? 256 : 0), s.writer.writeUint16(0), s.writer.writeBytes(new Uint8Array(
2648
2694
  [
@@ -2684,24 +2730,24 @@ const re = (s, e, t) => {
2684
2730
  0
2685
2731
  ]
2686
2732
  )), Es(e) ? (s.writer.writeUint32(e.width * 65536), s.writer.writeUint32(e.height * 65536)) : ur(e) && (s.writer.writeUint32(0), s.writer.writeUint32(0)), s.writer.writeUint32At(i, s.writer.position() - i);
2687
- }, mp = (s, e) => {
2733
+ }, pp = (s, e) => {
2688
2734
  oe(s, F.mdhd, 20, 0, 0), s.writer.writeUint32(0), s.writer.writeUint32(0), s.writer.writeUint32(e.timescale), s.writer.writeUint32(e.duration);
2689
2735
  const t = e.lang || "und", i = (t.charCodeAt(0) & 31) << 10 | (t.charCodeAt(1) & 31) << 5 | t.charCodeAt(2) & 31;
2690
2736
  s.writer.writeUint16(i), s.writer.writeUint16(0);
2691
- }, fp = (s, e) => {
2737
+ }, gp = (s, e) => {
2692
2738
  const t = s.writer.position();
2693
2739
  oe(s, F.hdlr, 0, 0, 0), s.writer.writeUint32(0), s.writer.writeBytes(Es(e) ? Ye.vide : Ye.soun), s.writer.writeUint32(0), s.writer.writeUint32(0), s.writer.writeUint32(0), s.writer.writeBytes(Es(e) ? Ye.videoHandler : Ye.soundHandler), s.writer.writeUint32At(t, s.writer.position() - t);
2694
- }, pp = (s) => {
2740
+ }, Ap = (s) => {
2695
2741
  const e = s.writer.position();
2696
2742
  re(s, F.dinf, 0), oe(s, F.dref, 16, 0, 0), s.writer.writeUint32(1), oe(s, Ye.url, 0, 0, 1), s.writer.writeUint32At(e, s.writer.position() - e);
2697
- }, gp = (s, e) => {
2743
+ }, wp = (s, e) => {
2698
2744
  const t = s.writer.position();
2699
2745
  re(s, F.avcC, 0), s.writer.writeUint8(1), s.writer.writeUint8(e.sequenceParameterSets[0][1]), s.writer.writeUint8(e.sequenceParameterSets[0][2]), s.writer.writeUint8(e.sequenceParameterSets[0][3]), s.writer.writeUint8(255), s.writer.writeUint8(224 | e.sequenceParameterSets.length), e.sequenceParameterSets.forEach((i) => {
2700
2746
  s.writer.writeUint16(i.byteLength), s.writer.writeBytes(i);
2701
2747
  }), s.writer.writeUint8(e.pictureParameterSets.length), e.pictureParameterSets.forEach((i) => {
2702
2748
  s.writer.writeUint16(i.byteLength), s.writer.writeBytes(i);
2703
2749
  }), s.writer.writeUint32At(t, s.writer.position() - t);
2704
- }, Ap = (s, e) => {
2750
+ }, bp = (s, e) => {
2705
2751
  var h, u;
2706
2752
  const t = s.writer.position();
2707
2753
  re(s, F.av1C, 0);
@@ -2709,20 +2755,20 @@ const re = (s, e, t) => {
2709
2755
  s.writer.writeUint8(129), s.writer.writeUint8(i << 5 | ((h = c == null ? void 0 : c.seqLevelIdx) != null ? h : 0)), s.writer.writeUint8(
2710
2756
  ((u = c == null ? void 0 : c.tier) != null ? u : 0) | (o.highBitDepth ? 1 : 0) | (o.bitDepth === 12 ? 1 : 0) << 5 | (o.monoChrome ? 1 : 0) << 4 | o.subsamplingX << 3 | o.subsamplingY << 2 | o.chromaSamplePosition & 65535
2711
2757
  ), s.writer.writeUint8(0), s.writer.writeBytes(e.sequenceHeader), s.writer.writeUint32At(t, s.writer.position() - t);
2712
- }, wp = (s, e) => {
2758
+ }, yp = (s, e) => {
2713
2759
  const t = s.writer.position(), i = vh(e) ? F.av01 : F.avc1;
2714
- re(s, i, 0), s.writer.writeUint32(0), s.writer.writeUint16(0), s.writer.writeUint16(1), s.writer.writeUint16(0), s.writer.writeUint16(0), s.writer.writeUint32(0), s.writer.writeUint32(0), s.writer.writeUint32(0), s.writer.writeUint16(e.width), s.writer.writeUint16(e.height), s.writer.writeUint32(4718592), s.writer.writeUint32(4718592), s.writer.writeUint32(0), s.writer.writeUint16(1), s.writer.writeUint8(0), s.writer.writeBytes(new Uint8Array(31)), s.writer.writeUint16(24), s.writer.writeUint16(-1), il(e) ? gp(s, e) : vh(e) && (Ap(s, e), e.parsedSequenceHeader.colorConfig && (re(s, F.colr, 11), s.writer.writeBytes(F.nclx), s.writer.writeUint16(e.parsedSequenceHeader.colorConfig.colorPrimaries), s.writer.writeUint16(e.parsedSequenceHeader.colorConfig.transferCharacteristics), s.writer.writeUint16(e.parsedSequenceHeader.colorConfig.matrixCoefficients), s.writer.writeUint8(e.parsedSequenceHeader.colorConfig.colorRange ? 1 : 0))), e.pixelAspectRatio && (re(s, Ye.pasp, 8), s.writer.writeUint32(e.pixelAspectRatio.numerator), s.writer.writeUint32(e.pixelAspectRatio.denumerator)), e.bitrate && (re(s, Ye.btrt, 12), s.writer.writeUint32(0), s.writer.writeUint32(e.bitrate), s.writer.writeUint32(e.bitrate)), s.writer.writeUint32At(t, s.writer.position() - t);
2760
+ re(s, i, 0), s.writer.writeUint32(0), s.writer.writeUint16(0), s.writer.writeUint16(1), s.writer.writeUint16(0), s.writer.writeUint16(0), s.writer.writeUint32(0), s.writer.writeUint32(0), s.writer.writeUint32(0), s.writer.writeUint16(e.width), s.writer.writeUint16(e.height), s.writer.writeUint32(4718592), s.writer.writeUint32(4718592), s.writer.writeUint32(0), s.writer.writeUint16(1), s.writer.writeUint8(0), s.writer.writeBytes(new Uint8Array(31)), s.writer.writeUint16(24), s.writer.writeUint16(-1), il(e) ? wp(s, e) : vh(e) && (bp(s, e), e.parsedSequenceHeader.colorConfig && (re(s, F.colr, 11), s.writer.writeBytes(F.nclx), s.writer.writeUint16(e.parsedSequenceHeader.colorConfig.colorPrimaries), s.writer.writeUint16(e.parsedSequenceHeader.colorConfig.transferCharacteristics), s.writer.writeUint16(e.parsedSequenceHeader.colorConfig.matrixCoefficients), s.writer.writeUint8(e.parsedSequenceHeader.colorConfig.colorRange ? 1 : 0))), e.pixelAspectRatio && (re(s, Ye.pasp, 8), s.writer.writeUint32(e.pixelAspectRatio.numerator), s.writer.writeUint32(e.pixelAspectRatio.denumerator)), e.bitrate && (re(s, Ye.btrt, 12), s.writer.writeUint32(0), s.writer.writeUint32(e.bitrate), s.writer.writeUint32(e.bitrate)), s.writer.writeUint32At(t, s.writer.position() - t);
2715
2761
  }, so = (s, e, t) => {
2716
2762
  let i = 3;
2717
2763
  for (s.writer.writeUint8(e); i > 0; i--)
2718
2764
  s.writer.writeUint8(t >> 7 * i | 128);
2719
2765
  s.writer.writeUint8(t & 127);
2720
- }, bp = (s, e) => {
2766
+ }, Sp = (s, e) => {
2721
2767
  const t = e.decoderConfig.byteLength > 0 ? e.decoderConfig.byteLength + 5 : 0, i = s.writer.position();
2722
2768
  oe(s, F.esds, 0, 0, 0), so(s, 3, 21 + t + 5 + 1), s.writer.writeUint16(e.trackId), s.writer.writeUint8(0), so(s, 4, 13 + t);
2723
2769
  const n = e.codec === "mp3" && e.sampleRate > 24e3 ? 107 : 64;
2724
2770
  s.writer.writeUint8(n), s.writer.writeUint8(21), s.writer.writeUint24(0), s.writer.writeUint32(e.bitrate || 0), s.writer.writeUint32(e.bitrate || 0), e.decoderConfig.byteLength > 0 && (so(s, 5, e.decoderConfig.byteLength), s.writer.writeBytes(e.decoderConfig)), so(s, 6, 1), s.writer.writeUint8(2), s.writer.writeUint32At(i, s.writer.position() - i);
2725
- }, yp = (s) => {
2771
+ }, vp = (s) => {
2726
2772
  switch (s) {
2727
2773
  case "aac":
2728
2774
  case "mp3":
@@ -2730,54 +2776,54 @@ const re = (s, e, t) => {
2730
2776
  case "opus":
2731
2777
  return F.Opus;
2732
2778
  }
2733
- }, Sp = (s, e) => {
2779
+ }, Tp = (s, e) => {
2734
2780
  const t = s.writer.position();
2735
2781
  re(s, F.dOps, 0), s.writer.writeUint8(0);
2736
2782
  const i = e.decoderConfig, n = new DataView(i.buffer, i.byteOffset, i.byteLength);
2737
2783
  s.writer.writeUint8(n.getUint8(9)), s.writer.writeUint16(n.getUint16(10, !0)), s.writer.writeUint32(n.getUint32(12, !0)), s.writer.writeUint16(n.getUint16(16, !0)), s.writer.writeBytes(e.decoderConfig.slice(18)), s.writer.writeUint32At(t, s.writer.position() - t);
2738
- }, vp = (s, e) => {
2784
+ }, Ep = (s, e) => {
2739
2785
  const t = s.writer.position();
2740
- switch (re(s, yp(e.codec), 0), s.writer.writeUint32(0), s.writer.writeUint16(0), s.writer.writeUint16(1), s.writer.writeUint16(0), s.writer.writeUint16(0), s.writer.writeUint32(0), s.writer.writeUint16(e.channelCount), s.writer.writeUint16(16), s.writer.writeUint32(0), s.writer.writeUint16(e.sampleRate), s.writer.writeUint16(0), e.codec) {
2786
+ switch (re(s, vp(e.codec), 0), s.writer.writeUint32(0), s.writer.writeUint16(0), s.writer.writeUint16(1), s.writer.writeUint16(0), s.writer.writeUint16(0), s.writer.writeUint32(0), s.writer.writeUint16(e.channelCount), s.writer.writeUint16(16), s.writer.writeUint32(0), s.writer.writeUint16(e.sampleRate), s.writer.writeUint16(0), e.codec) {
2741
2787
  case "aac":
2742
2788
  case "mp3":
2743
- bp(s, e);
2789
+ Sp(s, e);
2744
2790
  break;
2745
2791
  case "opus":
2746
- Sp(s, e);
2792
+ Tp(s, e);
2747
2793
  break;
2748
2794
  }
2749
2795
  e.bitrate && (re(s, Ye.btrt, 12), s.writer.writeUint32(0), s.writer.writeUint32(e.bitrate), s.writer.writeUint32(e.bitrate)), s.writer.writeUint32At(t, s.writer.position() - t);
2750
- }, Tp = (s, e) => {
2796
+ }, kp = (s, e) => {
2751
2797
  const t = s.writer.position();
2752
2798
  re(s, F.stbl, 0);
2753
2799
  const i = s.writer.position();
2754
- oe(s, F.stsd, 0, 0, 0), s.writer.writeUint32(1), Es(e) ? wp(s, e) : ur(e) && vp(s, e), s.writer.writeUint32At(i, s.writer.position() - i), oe(s, Ye.stts, 4, 0, 0), s.writer.writeUint32(0), oe(s, Ye.stsc, 4, 0, 0), s.writer.writeUint32(0), oe(s, Ye.stsz, 8, 0, 0), s.writer.writeUint32(0), s.writer.writeUint32(0), oe(s, Ye.stco, 4, 0, 0), s.writer.writeUint32(0), s.writer.writeUint32At(t, s.writer.position() - t);
2755
- }, Ep = (s, e) => {
2800
+ oe(s, F.stsd, 0, 0, 0), s.writer.writeUint32(1), Es(e) ? yp(s, e) : ur(e) && Ep(s, e), s.writer.writeUint32At(i, s.writer.position() - i), oe(s, Ye.stts, 4, 0, 0), s.writer.writeUint32(0), oe(s, Ye.stsc, 4, 0, 0), s.writer.writeUint32(0), oe(s, Ye.stsz, 8, 0, 0), s.writer.writeUint32(0), s.writer.writeUint32(0), oe(s, Ye.stco, 4, 0, 0), s.writer.writeUint32(0), s.writer.writeUint32At(t, s.writer.position() - t);
2801
+ }, Cp = (s, e) => {
2756
2802
  const t = s.writer.position();
2757
- re(s, F.minf, 0), Es(e) ? (oe(s, F.vmhd, 8, 0, 1), s.writer.writeUint32(0), s.writer.writeUint32(0)) : ur(e) && (oe(s, F.smhd, 4, 0, 0), s.writer.writeUint16(0), s.writer.writeUint16(0)), pp(s), Tp(s, e), s.writer.writeUint32At(t, s.writer.position() - t);
2758
- }, kp = (s, e) => {
2803
+ re(s, F.minf, 0), Es(e) ? (oe(s, F.vmhd, 8, 0, 1), s.writer.writeUint32(0), s.writer.writeUint32(0)) : ur(e) && (oe(s, F.smhd, 4, 0, 0), s.writer.writeUint16(0), s.writer.writeUint16(0)), Ap(s), kp(s, e), s.writer.writeUint32At(t, s.writer.position() - t);
2804
+ }, Ip = (s, e) => {
2759
2805
  const t = s.writer.position();
2760
- re(s, F.mdia, 0), mp(s, e), fp(s, e), Ep(s, e), s.writer.writeUint32At(t, s.writer.position() - t);
2761
- }, Ip = (s, e, t) => {
2806
+ re(s, F.mdia, 0), pp(s, e), gp(s, e), Cp(s, e), s.writer.writeUint32At(t, s.writer.position() - t);
2807
+ }, Rp = (s, e, t) => {
2762
2808
  const i = s.writer.position();
2763
- re(s, F.trak, 0), lp(s, e, t), kp(s, e), s.writer.writeUint32At(i, s.writer.position() - i);
2764
- }, Cp = (s, e) => {
2809
+ re(s, F.trak, 0), fp(s, e, t), Ip(s, e), s.writer.writeUint32At(i, s.writer.position() - i);
2810
+ }, Bp = (s, e) => {
2765
2811
  oe(s, F.trex, 20, 0, 0), s.writer.writeUint32(e.trackId), s.writer.writeUint32(1), s.writer.writeUint32(0), s.writer.writeUint32(0), s.writer.writeUint32(0);
2766
- }, Rp = (s, e) => {
2812
+ }, Up = (s, e) => {
2767
2813
  const t = s.writer.position();
2768
- re(s, F.mvex, 0), e.forEach((i) => Cp(s, i)), s.writer.writeUint32At(t, s.writer.position() - t);
2769
- }, Bp = (s, e, t, i) => {
2814
+ re(s, F.mvex, 0), e.forEach((i) => Bp(s, i)), s.writer.writeUint32At(t, s.writer.position() - t);
2815
+ }, Pp = (s, e, t, i) => {
2770
2816
  const n = s.writer.position();
2771
- re(s, F.moov, 0), dp(s, 0, t), e.forEach((o) => Ip(s, o, t)), Rp(s, e), s.writer.writeUint32At(n, s.writer.position() - n);
2772
- }, Up = (s, e) => {
2817
+ re(s, F.moov, 0), mp(s, 0, t), e.forEach((o) => Rp(s, o, t)), Up(s, e), s.writer.writeUint32At(n, s.writer.position() - n);
2818
+ }, Mp = (s, e) => {
2773
2819
  const t = s.writer.position();
2774
2820
  oe(s, F.tfhd, 16, 0, 56), s.writer.writeUint32(e.trackId), s.writer.writeUint32(e.defaultDuration || 0), s.writer.writeUint32(e.defaultSize || 0), s.writer.writeUint32(e.defaultFlags || 0), s.writer.writeUint32At(t, s.writer.position() - t);
2775
- }, Pp = (s, e) => {
2821
+ }, xp = (s, e) => {
2776
2822
  const t = s.writer.position();
2777
2823
  oe(s, F.tfdt, 8, 1, 0);
2778
2824
  const i = Math.floor(e.timestamp / 4294967296), n = (e.timestamp & 4294967295) >>> 0;
2779
2825
  s.writer.writeUint32(i), s.writer.writeUint32(n), s.writer.writeUint32At(t, s.writer.position() - t);
2780
- }, Mp = (s, e) => {
2826
+ }, Lp = (s, e) => {
2781
2827
  if (!e.samples[0])
2782
2828
  throw new Error("At least one sample must be provided");
2783
2829
  const t = e.samples.some((u) => !!u.compositionTimeOffset), i = th(e.samples[0]) !== e.defaultFlags, n = e.samples.length > 1;
@@ -2790,15 +2836,15 @@ const re = (s, e, t) => {
2790
2836
  for (const u of e.samples)
2791
2837
  n && (s.writer.writeUint32(u.duration), s.writer.writeUint32(u.data.byteLength), s.writer.writeUint32(th(u))), t && s.writer.writeUint32(u.compositionTimeOffset || 0);
2792
2838
  s.writer.writeUint32At(h, s.writer.position() - s.moofOffset + 8), s.writer.writeUint32At(c, s.writer.position() - c);
2793
- }, th = (s) => s.isSync ? 33554432 : 16842752, xp = (s, e) => {
2839
+ }, th = (s) => s.isSync ? 33554432 : 16842752, Dp = (s, e) => {
2794
2840
  const t = s.writer.position();
2795
- re(s, F.traf, 0), Up(s, e), Pp(s, e), Mp(s, e), s.writer.writeUint32At(t, s.writer.position() - t);
2796
- }, Lp = (s, e) => {
2841
+ re(s, F.traf, 0), Mp(s, e), xp(s, e), Lp(s, e), s.writer.writeUint32At(t, s.writer.position() - t);
2842
+ }, Op = (s, e) => {
2797
2843
  oe(s, F.mfhd, 4, 0, 0), s.writer.writeUint32(e);
2798
- }, Dp = (s, e) => {
2844
+ }, Fp = (s, e) => {
2799
2845
  const t = s.writer.position();
2800
- re(s, F.moof, 0), Lp(s, e.sequenceNumber), xp(s, e), s.writer.writeUint32At(t, s.writer.position() - t);
2801
- }, Op = (s, e, t) => {
2846
+ re(s, F.moof, 0), Op(s, e.sequenceNumber), Dp(s, e), s.writer.writeUint32At(t, s.writer.position() - t);
2847
+ }, _p = (s, e, t) => {
2802
2848
  re(s, F.mdat, t);
2803
2849
  for (const i of e.samples) {
2804
2850
  const n = i.data instanceof ArrayBuffer ? new Uint8Array(i.data) : i.data;
@@ -2806,15 +2852,15 @@ const re = (s, e, t) => {
2806
2852
  }
2807
2853
  }, Xc = (s, e) => {
2808
2854
  const t = new tl(), i = s.filter((o) => Es(o) && il(o)).length > 0;
2809
- return s.filter((o) => Es(o) && vh(o)).length > 0 ? eh(t, ap) : i ? eh(t, rp) : eh(t, op), Bp(t, s, np), t.writer.buffer();
2855
+ return s.filter((o) => Es(o) && vh(o)).length > 0 ? eh(t, cp) : i ? eh(t, op) : eh(t, hp), Pp(t, s, ap), t.writer.buffer();
2810
2856
  }, qc = (s) => {
2811
2857
  var i;
2812
2858
  let e = 0;
2813
2859
  for (const n of s.samples)
2814
2860
  e += n.data.byteLength;
2815
2861
  const t = new tl(e + 256);
2816
- return ((i = s.samples[0]) == null ? void 0 : i.producerReferenceTime) !== void 0 && up(t, s.trackId, s.samples[0].producerReferenceTime, s.timestamp), t.moofOffset = t.writer.position(), Dp(t, s), Op(t, s, e), t.writer.bufferExact();
2817
- }, Fp = (s, e) => {
2862
+ return ((i = s.samples[0]) == null ? void 0 : i.producerReferenceTime) !== void 0 && lp(t, s.trackId, s.samples[0].producerReferenceTime, s.timestamp), t.moofOffset = t.writer.position(), Fp(t, s), _p(t, s, e), t.writer.bufferExact();
2863
+ }, Np = (s, e) => {
2818
2864
  const t = s[0];
2819
2865
  if (!t)
2820
2866
  throw new Error("At least one sample must be provided");
@@ -2827,7 +2873,7 @@ const re = (s, e, t) => {
2827
2873
  defaultDuration: t.duration,
2828
2874
  samples: s
2829
2875
  });
2830
- }, _p = (s, e, t, i) => Xc([
2876
+ }, Vp = (s, e, t, i) => Xc([
2831
2877
  {
2832
2878
  type: "audio",
2833
2879
  codec: "aac",
@@ -2842,8 +2888,8 @@ const re = (s, e, t) => {
2842
2888
  const { sequenceParameterSets: e, pictureParameterSets: t } = Kd(s), i = e[0], n = t[0];
2843
2889
  if (!i || !n)
2844
2890
  throw new Error("No sps or pps provided");
2845
- return _f(i);
2846
- }, Np = (s, e) => {
2891
+ return Vf(i);
2892
+ }, Gp = (s, e) => {
2847
2893
  const t = s[0];
2848
2894
  if (!t)
2849
2895
  throw new Error("At least one sample must be provided");
@@ -2856,7 +2902,7 @@ const re = (s, e, t) => {
2856
2902
  defaultDuration: t.duration,
2857
2903
  samples: s
2858
2904
  });
2859
- }, Vp = (s, e) => {
2905
+ }, jp = (s, e) => {
2860
2906
  const { sequenceParameterSets: t, pictureParameterSets: i } = Kd(s), n = sl(s);
2861
2907
  return Xc([
2862
2908
  {
@@ -2870,7 +2916,7 @@ const re = (s, e, t) => {
2870
2916
  trackId: 1
2871
2917
  }
2872
2918
  ]);
2873
- }, Gp = (s, e, t) => Xc([
2919
+ }, Wp = (s, e, t) => Xc([
2874
2920
  {
2875
2921
  type: "audio",
2876
2922
  trackId: 1,
@@ -2881,7 +2927,7 @@ const re = (s, e, t) => {
2881
2927
  duration: 0,
2882
2928
  sampleRate: 48e3
2883
2929
  }
2884
- ]), jp = (s, e) => {
2930
+ ]), Hp = (s, e) => {
2885
2931
  const t = s[0];
2886
2932
  if (!t)
2887
2933
  throw new Error("At least one sample must be provided");
@@ -2896,8 +2942,8 @@ const re = (s, e, t) => {
2896
2942
  });
2897
2943
  }, nl = (s) => {
2898
2944
  const e = new Md(s);
2899
- return e.peekBit() === 1 && e.readBits(32), Hp(e), Kp(e);
2900
- }, Wp = (s) => {
2945
+ return e.peekBit() === 1 && e.readBits(32), Xp(e), tg(e);
2946
+ }, zp = (s) => {
2901
2947
  let e = 0, t = 0;
2902
2948
  for (let i = 0; i < 8; i++) {
2903
2949
  const n = s.readBits(8);
@@ -2905,40 +2951,40 @@ const re = (s, e, t) => {
2905
2951
  break;
2906
2952
  }
2907
2953
  return [t, e];
2908
- }, zp = (s) => {
2954
+ }, Qp = (s) => {
2909
2955
  let e = 0;
2910
2956
  for (; e < 100 && s.readBit() === 0; )
2911
2957
  e++;
2912
2958
  return e >= 32 ? 0 : s.readBits(e) + (1 << e) - 1;
2913
- }, Hp = (s) => {
2959
+ }, Xp = (s) => {
2914
2960
  const e = s.remainingBits() / 8, t = s.readBits(8);
2915
2961
  if ((t >> 7 & 1) !== 0)
2916
2962
  return;
2917
2963
  const n = t >> 3 & 15, o = t >> 2 & 1, c = t >> 1 & 1;
2918
2964
  o == 1 && s.readBits(8);
2919
- const [h, u] = c ? Wp(s) : [0, e];
2965
+ const [h, u] = c ? zp(s) : [0, e];
2920
2966
  return {
2921
2967
  headerLength: 1 + o + h,
2922
2968
  type: n,
2923
2969
  obuSize: u
2924
2970
  };
2925
- }, Qp = (s) => {
2971
+ }, qp = (s) => {
2926
2972
  const e = s.readBits(32), t = s.readBits(32), i = s.readBit() !== 0;
2927
2973
  let n = 0;
2928
- return i && (n = zp(s) + 1), {
2974
+ return i && (n = Qp(s) + 1), {
2929
2975
  timescale: t,
2930
2976
  equalPictureInterval: i,
2931
2977
  numUnitsInDisplayTick: e,
2932
2978
  numTicksPerPicture: n
2933
2979
  };
2934
- }, Xu = 2, ih = 2, Xp = 1, qp = 2, Zp = 2, Jp = 13, $p = 0, Yp = 2, qu = 0, Kp = (s) => {
2980
+ }, Xu = 2, ih = 2, Zp = 1, Jp = 2, $p = 2, Yp = 13, Kp = 0, eg = 2, qu = 0, tg = (s) => {
2935
2981
  const e = s.readBits(3), i = s.readBit() !== 0, n = s.readBit() !== 0;
2936
2982
  let o, c = !1, h = !1, u = !1, l = 0, p = 0;
2937
2983
  const g = [];
2938
2984
  if (n)
2939
2985
  s.readBits(5);
2940
2986
  else {
2941
- if (h = s.readBit() !== 0, h && (o = Qp(s), c = s.readBit() !== 0, c))
2987
+ if (h = s.readBit() !== 0, h && (o = qp(s), c = s.readBit() !== 0, c))
2942
2988
  throw new Error("Not implemented");
2943
2989
  u = s.readBit() !== 0;
2944
2990
  const q = s.readBits(5) + 1;
@@ -2951,11 +2997,11 @@ const re = (s, e, t) => {
2951
2997
  }
2952
2998
  }
2953
2999
  const A = s.readBits(4) + 1, b = s.readBits(4) + 1, v = s.readBits(A) + 1, k = s.readBits(b) + 1;
2954
- let I = !1;
2955
- n ? I = !1 : I = s.readBit() !== 0, I && (l = s.readBits(4) + 2, p = s.readBits(3) + 1);
3000
+ let C = !1;
3001
+ n ? C = !1 : C = s.readBit() !== 0, C && (l = s.readBits(4) + 2, p = s.readBits(3) + 1);
2956
3002
  const x = s.readBit() !== 0, T = s.readBit() !== 0, U = s.readBit() !== 0;
2957
- let B = !1, Q = !1, H = !1, Ve = !1, ie = !1, et = !1, mt = !1, Ue = Xu, y = ih, E = 0;
2958
- n || (B = s.readBit() !== 0, Q = s.readBit() !== 0, H = s.readBit() !== 0, Ve = s.readBit() !== 0, ie = s.readBit() !== 0, ie && (et = s.readBit() !== 0, mt = s.readBit() !== 0), s.readBit() !== 0 ? Ue = Xu : Ue = s.readBit(), Ue > 0 ? s.readBit() > 0 ? y = ih : y = s.readBit() : y = ih, ie ? E = s.readBits(3) : E = 0);
3003
+ let B = !1, Q = !1, z = !1, Ve = !1, ie = !1, et = !1, mt = !1, Ue = Xu, y = ih, E = 0;
3004
+ n || (B = s.readBit() !== 0, Q = s.readBit() !== 0, z = s.readBit() !== 0, Ve = s.readBit() !== 0, ie = s.readBit() !== 0, ie && (et = s.readBit() !== 0, mt = s.readBit() !== 0), s.readBit() !== 0 ? Ue = Xu : Ue = s.readBit(), Ue > 0 ? s.readBit() > 0 ? y = ih : y = s.readBit() : y = ih, ie ? E = s.readBits(3) : E = 0);
2959
3005
  const j = s.readBit() !== 0, O = s.readBit() !== 0, M = s.readBit() !== 0;
2960
3006
  return {
2961
3007
  seqProfile: e,
@@ -2975,7 +3021,7 @@ const re = (s, e, t) => {
2975
3021
  frameHeightBits: b,
2976
3022
  maxFrameWidth: v,
2977
3023
  maxFrameHeight: k,
2978
- frameIdNumbersPresentFlag: I,
3024
+ frameIdNumbersPresentFlag: C,
2979
3025
  deltaFrameIdLength: l,
2980
3026
  additionalFrameIdLength: p,
2981
3027
  use_128x128Superblock: x,
@@ -2983,7 +3029,7 @@ const re = (s, e, t) => {
2983
3029
  enableIntraEdgeFilter: U,
2984
3030
  enableInterintraCompound: B,
2985
3031
  enableMaskedCompound: Q,
2986
- enableWarpedMotion: H,
3032
+ enableWarpedMotion: z,
2987
3033
  enableDualFilter: Ve,
2988
3034
  enableOrderHint: ie,
2989
3035
  enableJntComp: et,
@@ -2994,15 +3040,15 @@ const re = (s, e, t) => {
2994
3040
  enableSuperres: j,
2995
3041
  enableCdef: O,
2996
3042
  enableRestoration: M,
2997
- colorConfig: eg(s, e),
3043
+ colorConfig: ig(s, e),
2998
3044
  filmGrainParamsPresent: s.readBit() !== 0
2999
3045
  };
3000
- }, eg = (s, e) => {
3046
+ }, ig = (s, e) => {
3001
3047
  const t = s.readBit() !== 0;
3002
3048
  let i = 8, n = !1;
3003
3049
  e === 2 && t ? i = s.readBit() !== 0 ? 12 : 10 : e <= 2 && (i = t ? 10 : 8), e === 1 ? n = !1 : n = s.readBit() !== 0;
3004
3050
  const o = n ? 1 : 3, c = s.readBit() !== 0;
3005
- let h = qp, u = Zp, l = Yp, p = !1, g = 0, A = 0, b = qu, v = !1;
3051
+ let h = Jp, u = $p, l = eg, p = !1, g = 0, A = 0, b = qu, v = !1;
3006
3052
  return c && (h = s.readBits(8), u = s.readBits(8), l = s.readBits(8)), n ? (p = s.readBit() !== 0, g = 1, A = 1, b = qu, v = !1, {
3007
3053
  highBitDepth: t,
3008
3054
  bitDepth: i,
@@ -3016,7 +3062,7 @@ const re = (s, e, t) => {
3016
3062
  subsamplingX: g,
3017
3063
  subsamplingY: A,
3018
3064
  transferCharacteristics: u
3019
- }) : h === Xp && u == Jp && l == $p ? (p = !0, g = 0, A = 0, {
3065
+ }) : h === Zp && u == Yp && l == Kp ? (p = !0, g = 0, A = 0, {
3020
3066
  highBitDepth: t,
3021
3067
  bitDepth: i,
3022
3068
  monoChrome: n,
@@ -3043,14 +3089,14 @@ const re = (s, e, t) => {
3043
3089
  subsamplingY: A,
3044
3090
  transferCharacteristics: u
3045
3091
  });
3046
- }, tg = (s) => {
3092
+ }, sg = (s) => {
3047
3093
  const e = nl(s);
3048
3094
  if (e)
3049
3095
  return {
3050
3096
  width: e.maxFrameWidth,
3051
3097
  height: e.maxFrameHeight
3052
3098
  };
3053
- }, ig = (s, e) => {
3099
+ }, ng = (s, e) => {
3054
3100
  const t = s[0];
3055
3101
  if (!t)
3056
3102
  throw new Error("At least one sample must be provided");
@@ -3063,7 +3109,7 @@ const re = (s, e, t) => {
3063
3109
  defaultDuration: t.duration,
3064
3110
  samples: s
3065
3111
  });
3066
- }, sg = (s, e) => {
3112
+ }, rg = (s, e) => {
3067
3113
  const t = nl(s);
3068
3114
  if (!t)
3069
3115
  throw new Error("Failed to parse sequence header");
@@ -3079,47 +3125,47 @@ const re = (s, e, t) => {
3079
3125
  trackId: 1
3080
3126
  }
3081
3127
  ]);
3082
- }, ng = (s) => {
3128
+ }, ag = (s) => {
3083
3129
  const { codec: e, initData: t, timescale: i } = s;
3084
3130
  switch (e) {
3085
3131
  case "h264":
3086
- return ag(t, i);
3132
+ return cg(t, i);
3087
3133
  case "av1":
3088
- return og(t, i);
3134
+ return hg(t, i);
3089
3135
  case "opus":
3090
- return cg(t, i, s.channelCount || 2);
3136
+ return ug(t, i, s.channelCount || 2);
3091
3137
  case "aac":
3092
- return hg(t, i, s.channelCount || 2);
3138
+ return dg(t, i, s.channelCount || 2);
3093
3139
  default:
3094
3140
  throw new Error(`Failed to initialize ${e} segment`);
3095
3141
  }
3096
- }, rg = (s, e) => {
3142
+ }, og = (s, e) => {
3097
3143
  switch (s) {
3098
3144
  case "h264":
3099
3145
  return sl(e);
3100
3146
  case "av1":
3101
- return tg(e);
3147
+ return sg(e);
3102
3148
  }
3103
- }, ag = (s, e) => Vp(s, e), og = (s, e) => sg(s, e), cg = (s, e, t) => Gp(new Uint8Array(s), t, e), hg = (s, e, t) => _p(new Uint8Array(s), t, e, e), ug = (s, e) => {
3149
+ }, cg = (s, e) => jp(s, e), hg = (s, e) => rg(s, e), ug = (s, e, t) => Wp(new Uint8Array(s), t, e), dg = (s, e, t) => Vp(new Uint8Array(s), t, e, e), lg = (s, e) => {
3104
3150
  if (!s[0])
3105
3151
  throw new Error("At least one sample must be provided");
3106
3152
  switch (s[0].codec) {
3107
3153
  case "h264":
3108
- return Np(s, e);
3154
+ return Gp(s, e);
3109
3155
  case "opus":
3110
- return jp(s, e);
3156
+ return Hp(s, e);
3111
3157
  case "aac":
3112
- return Fp(s, e);
3158
+ return Np(s, e);
3113
3159
  case "av1":
3114
- return ig(s, e);
3160
+ return ng(s, e);
3115
3161
  default:
3116
3162
  throw new Error(`Unsupported codec ${s[0].codec}`);
3117
3163
  }
3118
- }, dr = (s) => !!(s & 1), dg = (s) => !!(s & 2), lg = (s) => !!(s & 4), mg = (s) => !!(s & 8), fg = (s) => !!(s & 16), pg = (s) => {
3119
- const e = new DataView(s, 0), t = e.getUint8(0), i = e.getUint16(1), n = e.getUint8(3), o = e.getUint8(4), c = xd(new Uint8Array(s), 5, 12), h = e.getUint32(13), u = fg(n) ? e.getInt16(17) : void 0, l = s.slice(i);
3164
+ }, dr = (s) => !!(s & 1), mg = (s) => !!(s & 2), fg = (s) => !!(s & 4), pg = (s) => !!(s & 8), gg = (s) => !!(s & 16), Ag = (s) => {
3165
+ const e = new DataView(s, 0), t = e.getUint8(0), i = e.getUint16(1), n = e.getUint8(3), o = e.getUint8(4), c = xd(new Uint8Array(s), 5, 12), h = e.getUint32(13), u = gg(n) ? e.getInt16(17) : void 0, l = s.slice(i);
3120
3166
  return { version: t, renditionId: o, flags: n, timestamp: c, timescale: h, payload: l, compositionTimeOffset: u };
3121
- }, gg = "data:video/mp4;base64,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", no = () => "wakeLock" in navigator && window.navigator.userAgent.indexOf("Samsung") === -1;
3122
- class Ag {
3167
+ }, wg = "data:video/mp4;base64,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", no = () => "wakeLock" in navigator && window.navigator.userAgent.indexOf("Samsung") === -1;
3168
+ class bg {
3123
3169
  constructor() {
3124
3170
  r(this, "enabled", !1);
3125
3171
  r(this, "wakeLockVideo");
@@ -3140,7 +3186,7 @@ class Ag {
3140
3186
  if (!no()) {
3141
3187
  if (!this.wakeLockVideo) {
3142
3188
  const t = document.createElement("video");
3143
- this.wakeLockVideo = t, this.wakeLockVideo.setAttribute("title", "Live Stream"), this.wakeLockVideo.setAttribute("playsinline", ""), this._addSourceToVideo(this.wakeLockVideo, "mp4", gg), Object.assign(this.wakeLockVideo.style, {
3189
+ this.wakeLockVideo = t, this.wakeLockVideo.setAttribute("title", "Live Stream"), this.wakeLockVideo.setAttribute("playsinline", ""), this._addSourceToVideo(this.wakeLockVideo, "mp4", wg), Object.assign(this.wakeLockVideo.style, {
3144
3190
  position: "absolute",
3145
3191
  left: "-100%",
3146
3192
  top: "-100%"
@@ -3174,7 +3220,7 @@ class Ag {
3174
3220
  document.removeEventListener("visibilitychange", this.handleVisibilityChange), document.removeEventListener("fullscreenchange", this.handleVisibilityChange), this.disable();
3175
3221
  }
3176
3222
  }
3177
- const wg = /\r\n|\r|\n/;
3223
+ const yg = /\r\n|\r|\n/;
3178
3224
  var ai, _t;
3179
3225
  class Zu {
3180
3226
  constructor(e) {
@@ -3212,7 +3258,7 @@ class rl {
3212
3258
  d(this, ks);
3213
3259
  }
3214
3260
  parse(e) {
3215
- const t = [], i = e.split(wg), n = new Zu(i), o = n.readLine();
3261
+ const t = [], i = e.split(yg), n = new Zu(i), o = n.readLine();
3216
3262
  if (!o || !o.startsWith("WEBVTT"))
3217
3263
  throw new Error("missing 'WEBVTT' signature");
3218
3264
  for (; n.readLine() !== ""; )
@@ -3257,11 +3303,11 @@ ks = new WeakSet(), al = function(e) {
3257
3303
  const [i = 0, n = 0, o = 0] = t.map((h) => parseFloat(h));
3258
3304
  return i * 60 * 60 + n * 60 + o;
3259
3305
  };
3260
- const bg = (s) => {
3306
+ const Sg = (s) => {
3261
3307
  const e = window;
3262
3308
  e.vindralInstances = e.vindralInstances || {}, e.vindralInstances[s.getStatistics().clientId.substring(0, 8)] = s;
3263
3309
  };
3264
- class Eh extends Ii {
3310
+ class Eh extends Ci {
3265
3311
  constructor({ type: t, autoplay: i, muted: n, volume: o, logger: c, poster: h }) {
3266
3312
  super();
3267
3313
  r(this, "element");
@@ -3426,7 +3472,7 @@ class Eh extends Ii {
3426
3472
  return this._isPaused;
3427
3473
  }
3428
3474
  }
3429
- const yg = (s) => {
3475
+ const vg = (s) => {
3430
3476
  if (!navigator.mediaCapabilities)
3431
3477
  return Promise.resolve({ smooth: !0, supported: !0, powerEfficient: !0, failedToQuery: !0 });
3432
3478
  if (s.codec === "webvtt")
@@ -3450,7 +3496,7 @@ const yg = (s) => {
3450
3496
  framerate: s.frameRate[0] / s.frameRate[1]
3451
3497
  }
3452
3498
  }, navigator.mediaCapabilities.decodingInfo(e);
3453
- }, Sg = 0.15, vg = 0.2, Ju = 0.4, Tg = 0.5, Eg = 0.6, sh = 15, kg = {
3499
+ }, Tg = 0.15, Eg = 0.2, Ju = 0.4, kg = 0.5, Cg = 0.6, sh = 15, Ig = {
3454
3500
  cooldownTime: 3e3,
3455
3501
  maxBufferingEvents: {
3456
3502
  last10Seconds: 0
@@ -3522,7 +3568,7 @@ const yg = (s) => {
3522
3568
  const { bufferFullness: t, general: i } = this.qualityOfServiceSource.getMetrics(), n = this.qualityOfServiceSource.getBufferFullnessRegression();
3523
3569
  if (!n)
3524
3570
  return;
3525
- const o = 10 * 1e3, c = 30 * 1e3, { slope: h } = n, u = n.predict(sh), l = h < 0, p = n.predict(sh) < Ju && n.slope < 0, g = n.predict(sh) > Eg, A = this.qualityOfServiceSource.timeSpentBufferingLast(c), b = this.qualityOfServiceSource.timeSpentActiveLast(c), v = this.qualityOfServiceSource.bufferingEventsLast(c), k = b > 0 ? A / b : 0, I = this.qualityOfServiceSource.getTargetBufferTime();
3571
+ const o = 10 * 1e3, c = 30 * 1e3, { slope: h } = n, u = n.predict(sh), l = h < 0, p = n.predict(sh) < Ju && n.slope < 0, g = n.predict(sh) > Cg, A = this.qualityOfServiceSource.timeSpentBufferingLast(c), b = this.qualityOfServiceSource.timeSpentActiveLast(c), v = this.qualityOfServiceSource.bufferingEventsLast(c), k = b > 0 ? A / b : 0, C = this.qualityOfServiceSource.getTargetBufferTime();
3526
3572
  if (t < 0.15 && k > 0.8) {
3527
3573
  this.adaptLevel("reconnect");
3528
3574
  return;
@@ -3531,21 +3577,21 @@ const yg = (s) => {
3531
3577
  this.adaptLevel("downgrade");
3532
3578
  return;
3533
3579
  }
3534
- if (t > Tg && g && !this.tooMuchTimeBuffering(o) && !this.tooManyBufferingEvents(o)) {
3580
+ if (t > kg && g && !this.tooMuchTimeBuffering(o) && !this.tooManyBufferingEvents(o)) {
3535
3581
  this.adaptLevel("upgrade");
3536
3582
  return;
3537
3583
  }
3538
- if (I < 1e3) {
3584
+ if (C < 1e3) {
3539
3585
  e.playbackState === "buffering" && (v > 5 || k > 0.3) && this.adaptLevel("downgrade");
3540
3586
  return;
3541
3587
  }
3542
- (p || t < Sg) && l && t < Ju && u < vg && this.adaptLevel(e.playbackState === "buffering" ? "double downgrade" : "downgrade");
3588
+ (p || t < Tg) && l && t < Ju && u < Eg && this.adaptLevel(e.playbackState === "buffering" ? "double downgrade" : "downgrade");
3543
3589
  });
3544
3590
  r(this, "onAdaptedLevel", () => {
3545
3591
  this.reset();
3546
3592
  });
3547
3593
  r(this, "adaptLevel", (e) => this.emitter.emit("adapt level", e));
3548
- this.qualityOfServiceSource = i, this.config = S(S({}, kg), n), this.emitter = e, this.logger = t;
3594
+ this.qualityOfServiceSource = i, this.config = S(S({}, Ig), n), this.emitter = e, this.logger = t;
3549
3595
  }
3550
3596
  tooMuchTimeBuffering(e) {
3551
3597
  const t = this.qualityOfServiceSource.timeSpentActiveLast(e);
@@ -3557,7 +3603,7 @@ const yg = (s) => {
3557
3603
  };
3558
3604
  r(Yo, "create", (e, t, i, n = {}) => new Yo(e, t, i, n));
3559
3605
  let kh = Yo;
3560
- const Ig = {
3606
+ const Rg = {
3561
3607
  minBufferTime: 1500,
3562
3608
  maxBufferTime: 1500,
3563
3609
  cooldownTime: 3e4,
@@ -3610,16 +3656,16 @@ const Ig = {
3610
3656
  this.targetBufferTimeTarget.targetBufferTime + l
3611
3657
  ), this.bufferTimeAdjustmentCount++, this.reset());
3612
3658
  });
3613
- this.qualityOfServiceSource = i, this.targetBufferTimeTarget = n, this.config = S(S({}, Ig), o), this.emitter = e, this.logger = t;
3659
+ this.qualityOfServiceSource = i, this.targetBufferTimeTarget = n, this.config = S(S({}, Rg), o), this.emitter = e, this.logger = t;
3614
3660
  }
3615
3661
  updateConfig(e) {
3616
3662
  this.config = S(S({}, this.config), e);
3617
3663
  }
3618
3664
  };
3619
3665
  r(Kt, "BUFFER_TIME_STEP_SIZE", 500), r(Kt, "BUFFER_TIME_MAX_STEPS", 3), r(Kt, "create", (e, t, i, n, o = {}) => new Kt(e, t, i, n, o));
3620
- let Ih = Kt;
3666
+ let Ch = Kt;
3621
3667
  var Do = /* @__PURE__ */ ((s) => (s[s.StreamHeaderGroup = 4] = "StreamHeaderGroup", s[s.FetchHeader = 5] = "FetchHeader", s[s.StreamHeaderTrack = 60] = "StreamHeaderTrack", s))(Do || {});
3622
- const Ie = {
3668
+ const Ce = {
3623
3669
  Normal: 0,
3624
3670
  ObjectDoesNotExist: 1,
3625
3671
  GroupDoesNotExist: 2,
@@ -3628,17 +3674,17 @@ const Ie = {
3628
3674
  };
3629
3675
  function ol(s) {
3630
3676
  switch (s) {
3631
- case Ie.Normal:
3632
- case Ie.ObjectDoesNotExist:
3633
- case Ie.GroupDoesNotExist:
3634
- case Ie.EndOfGroup:
3635
- case Ie.EndOfTrackAndGroup:
3677
+ case Ce.Normal:
3678
+ case Ce.ObjectDoesNotExist:
3679
+ case Ce.GroupDoesNotExist:
3680
+ case Ce.EndOfGroup:
3681
+ case Ce.EndOfTrackAndGroup:
3636
3682
  return;
3637
3683
  }
3638
3684
  throw new Error("Unknown object status " + s);
3639
3685
  }
3640
3686
  var bt, Ks, en, Qr, Xr, tn, qr, Zr;
3641
- class Cg {
3687
+ class Bg {
3642
3688
  constructor(e, t, i, n, o, c) {
3643
3689
  d(this, bt);
3644
3690
  d(this, Ks);
@@ -3667,7 +3713,7 @@ class Cg {
3667
3713
  return { done: !0, value: void 0 };
3668
3714
  const e = a(this, qr) === 0 ? a(this, Ks) : yield a(this, bt).readBigVarInt(), t = yield a(this, bt).readBigVarInt(), i = yield a(this, bt).readVarInt();
3669
3715
  let n = 0, o = new Uint8Array();
3670
- return i > 0 ? o = yield a(this, bt).read(i) : n = yield a(this, bt).readVarInt(), ol(n), (n === Ie.EndOfTrackAndGroup || n === Ie.EndOfGroup) && a(this, tn).resolve(n), Pe(this, qr)._++, {
3716
+ return i > 0 ? o = yield a(this, bt).read(i) : n = yield a(this, bt).readVarInt(), ol(n), (n === Ce.EndOfTrackAndGroup || n === Ce.EndOfGroup) && a(this, tn).resolve(n), Pe(this, qr)._++, {
3671
3717
  done: !1,
3672
3718
  value: {
3673
3719
  subscribeId: a(this, en),
@@ -3701,10 +3747,10 @@ class Cg {
3701
3747
  }
3702
3748
  }
3703
3749
  bt = new WeakMap(), Ks = new WeakMap(), en = new WeakMap(), Qr = new WeakMap(), Xr = new WeakMap(), tn = new WeakMap(), qr = new WeakMap(), Zr = new WeakMap();
3704
- var yt, sn, Jr, $r, nn, Is, cl, Ch;
3705
- class Rg {
3750
+ var yt, sn, Jr, $r, nn, Cs, cl, Ih;
3751
+ class Ug {
3706
3752
  constructor(e, t, i, n, o) {
3707
- d(this, Is);
3753
+ d(this, Cs);
3708
3754
  d(this, yt);
3709
3755
  d(this, sn);
3710
3756
  d(this, Jr);
@@ -3719,7 +3765,7 @@ class Rg {
3719
3765
  return a(this, nn);
3720
3766
  }
3721
3767
  groups() {
3722
- return w(this, Is, cl).call(this);
3768
+ return w(this, Cs, cl).call(this);
3723
3769
  }
3724
3770
  subscribeId() {
3725
3771
  return a(this, sn);
@@ -3733,16 +3779,16 @@ class Rg {
3733
3779
  return this;
3734
3780
  }
3735
3781
  [Ut()]() {
3736
- return w(this, Is, Ch).call(this);
3782
+ return w(this, Cs, Ih).call(this);
3737
3783
  }
3738
3784
  [Symbol.asyncDispose]() {
3739
- return w(this, Is, Ch).call(this);
3785
+ return w(this, Cs, Ih).call(this);
3740
3786
  }
3741
3787
  }
3742
- yt = new WeakMap(), sn = new WeakMap(), Jr = new WeakMap(), $r = new WeakMap(), nn = new WeakMap(), Is = new WeakSet(), cl = function() {
3788
+ yt = new WeakMap(), sn = new WeakMap(), Jr = new WeakMap(), $r = new WeakMap(), nn = new WeakMap(), Cs = new WeakSet(), cl = function() {
3743
3789
  return xt(this, null, function* () {
3744
3790
  for (; !(yield new X(a(this, yt).isDone())); ) {
3745
- const e = yield new X(a(this, yt).readBigVarInt()), t = new Cg(
3791
+ const e = yield new X(a(this, yt).readBigVarInt()), t = new Bg(
3746
3792
  a(this, yt),
3747
3793
  e,
3748
3794
  a(this, sn),
@@ -3750,18 +3796,18 @@ yt = new WeakMap(), sn = new WeakMap(), Jr = new WeakMap(), $r = new WeakMap(),
3750
3796
  a(this, $r),
3751
3797
  a(this, nn)
3752
3798
  );
3753
- if (yield t, (yield new X(Promise.race([t.endStatus(), a(this, yt).closed()]))) === Ie.EndOfTrackAndGroup)
3799
+ if (yield t, (yield new X(Promise.race([t.endStatus(), a(this, yt).closed()]))) === Ce.EndOfTrackAndGroup)
3754
3800
  return;
3755
3801
  }
3756
3802
  });
3757
- }, Ch = function() {
3803
+ }, Ih = function() {
3758
3804
  return a(this, yt).close().catch(() => {
3759
3805
  });
3760
3806
  };
3761
- var at, rn, Yr, an, Kr, ea, ta, on, Ko, Cs, hl, Rh;
3762
- class Bg {
3807
+ var at, rn, Yr, an, Kr, ea, ta, on, Ko, Is, hl, Rh;
3808
+ class Pg {
3763
3809
  constructor(e, t, i, n, o, c, h) {
3764
- d(this, Cs);
3810
+ d(this, Is);
3765
3811
  d(this, at);
3766
3812
  d(this, rn);
3767
3813
  d(this, Yr);
@@ -3792,7 +3838,7 @@ class Bg {
3792
3838
  return { done: !0, value: void 0 };
3793
3839
  const e = yield a(this, at).readBigVarInt(), t = yield a(this, at).readVarInt();
3794
3840
  let i = 0, n = new Uint8Array();
3795
- return t > 0 ? n = yield a(this, at).read(t) : i = yield a(this, at).readVarInt(), ol(i), i === Ie.EndOfGroup && m(this, ta, !0), {
3841
+ return t > 0 ? n = yield a(this, at).read(t) : i = yield a(this, at).readVarInt(), ol(i), i === Ce.EndOfGroup && m(this, ta, !0), {
3796
3842
  done: !1,
3797
3843
  value: {
3798
3844
  subscribeId: a(this, rn),
@@ -3818,19 +3864,19 @@ class Bg {
3818
3864
  });
3819
3865
  }
3820
3866
  groups() {
3821
- return w(this, Cs, hl).call(this);
3867
+ return w(this, Is, hl).call(this);
3822
3868
  }
3823
3869
  [Symbol.asyncIterator]() {
3824
3870
  return this;
3825
3871
  }
3826
3872
  [Ut()]() {
3827
- return w(this, Cs, Rh).call(this);
3873
+ return w(this, Is, Rh).call(this);
3828
3874
  }
3829
3875
  [Symbol.asyncDispose]() {
3830
- return w(this, Cs, Rh).call(this);
3876
+ return w(this, Is, Rh).call(this);
3831
3877
  }
3832
3878
  }
3833
- at = new WeakMap(), rn = new WeakMap(), Yr = new WeakMap(), an = new WeakMap(), Kr = new WeakMap(), ea = new WeakMap(), ta = new WeakMap(), on = new WeakMap(), Ko = new WeakMap(), Cs = new WeakSet(), hl = function() {
3879
+ at = new WeakMap(), rn = new WeakMap(), Yr = new WeakMap(), an = new WeakMap(), Kr = new WeakMap(), ea = new WeakMap(), ta = new WeakMap(), on = new WeakMap(), Ko = new WeakMap(), Is = new WeakSet(), hl = function() {
3834
3880
  return xt(this, null, function* () {
3835
3881
  yield this;
3836
3882
  });
@@ -3844,11 +3890,11 @@ function ul(s, e) {
3844
3890
  switch (t) {
3845
3891
  case Do.StreamHeaderGroup: {
3846
3892
  const i = yield s.readBigVarInt(), n = yield s.readBigVarInt(), o = yield s.readBigVarInt(), c = yield s.readBigVarInt(), h = yield s.readUnsigned8();
3847
- return new Bg(s, i, n, o, c, h, e);
3893
+ return new Pg(s, i, n, o, c, h, e);
3848
3894
  }
3849
3895
  case Do.StreamHeaderTrack: {
3850
3896
  const i = yield s.readBigVarInt(), n = yield s.readBigVarInt(), o = yield s.readUnsigned8();
3851
- return new Rg(s, i, n, o, e);
3897
+ return new Ug(s, i, n, o, e);
3852
3898
  }
3853
3899
  default:
3854
3900
  throw new Error("Unexpected message type " + t);
@@ -3856,7 +3902,7 @@ function ul(s, e) {
3856
3902
  });
3857
3903
  }
3858
3904
  var oi, ia;
3859
- class Ug {
3905
+ class Mg {
3860
3906
  constructor(e, t) {
3861
3907
  d(this, oi);
3862
3908
  d(this, ia);
@@ -3875,17 +3921,17 @@ class Ug {
3875
3921
  }
3876
3922
  }
3877
3923
  oi = new WeakMap(), ia = new WeakMap();
3878
- var St, Hi, Qi, Xi;
3879
- class Pg {
3924
+ var St, zi, Qi, Xi;
3925
+ class xg {
3880
3926
  constructor(e) {
3881
3927
  d(this, St);
3882
- d(this, Hi, null);
3928
+ d(this, zi, null);
3883
3929
  d(this, Qi, null);
3884
3930
  d(this, Xi, null);
3885
3931
  m(this, St, e);
3886
3932
  }
3887
3933
  start(e) {
3888
- m(this, Hi, (t) => {
3934
+ m(this, zi, (t) => {
3889
3935
  if (typeof t.data == "object" && t.data instanceof ArrayBuffer) {
3890
3936
  const i = new Uint8Array(t.data), n = i[0] || 0, o = n & 127, c = (n >> 7 & 1) > 0;
3891
3937
  if (o && o !== 0) {
@@ -3893,17 +3939,17 @@ class Pg {
3893
3939
  e.enqueue([c, o, h]);
3894
3940
  }
3895
3941
  }
3896
- }), m(this, Qi, () => Nd(() => e.close())), m(this, Xi, () => e.error(new Error("WebSocket error"))), a(this, St).addEventListener("message", a(this, Hi)), a(this, St).addEventListener("error", a(this, Xi)), a(this, St).addEventListener("close", a(this, Qi));
3942
+ }), m(this, Qi, () => Nd(() => e.close())), m(this, Xi, () => e.error(new Error("WebSocket error"))), a(this, St).addEventListener("message", a(this, zi)), a(this, St).addEventListener("error", a(this, Xi)), a(this, St).addEventListener("close", a(this, Qi));
3897
3943
  }
3898
3944
  cancel(e) {
3899
- a(this, Hi) && a(this, St).removeEventListener("message", a(this, Hi)), a(this, Xi) && a(this, St).removeEventListener("error", a(this, Xi)), a(this, Qi) && a(this, St).removeEventListener("close", a(this, Qi));
3945
+ a(this, zi) && a(this, St).removeEventListener("message", a(this, zi)), a(this, Xi) && a(this, St).removeEventListener("error", a(this, Xi)), a(this, Qi) && a(this, St).removeEventListener("close", a(this, Qi));
3900
3946
  }
3901
3947
  }
3902
- St = new WeakMap(), Hi = new WeakMap(), Qi = new WeakMap(), Xi = new WeakMap();
3903
- function Mg(s, e) {
3948
+ St = new WeakMap(), zi = new WeakMap(), Qi = new WeakMap(), Xi = new WeakMap();
3949
+ function Lg(s, e) {
3904
3950
  return s[e] << 8 | s[e + 1];
3905
3951
  }
3906
- function xg(s, e) {
3952
+ function Dg(s, e) {
3907
3953
  return (s[e] << 24 | s[e + 1] << 16 | s[e + 2] << 8 | s[e + 3]) >>> 0;
3908
3954
  }
3909
3955
  var pe, sa, qi, he, ec, $, ar, oo, Li, dl, Bh;
@@ -3955,12 +4001,12 @@ class Oo {
3955
4001
  case 1: {
3956
4002
  yield w(this, $, Li).call(this, 2);
3957
4003
  const i = a(this, he);
3958
- return m(this, he, a(this, he) + 2), P(Mg(a(this, pe), i));
4004
+ return m(this, he, a(this, he) + 2), P(Lg(a(this, pe), i));
3959
4005
  }
3960
4006
  case 2: {
3961
4007
  yield w(this, $, Li).call(this, 4);
3962
4008
  const i = a(this, he);
3963
- return m(this, he, a(this, he) + 4), P(xg(a(this, pe), i));
4009
+ return m(this, he, a(this, he) + 4), P(Dg(a(this, pe), i));
3964
4010
  }
3965
4011
  case 3: {
3966
4012
  yield w(this, $, Li).call(this, 8);
@@ -4138,7 +4184,7 @@ const ac = class ac {
4138
4184
  };
4139
4185
  Me = new WeakMap(), Qe = new WeakMap(), Zi = new WeakMap(), rc = new WeakMap(), r(ac, "DEFAULT_BUFFER_SIZE", 1024);
4140
4186
  let Lr = ac;
4141
- const fl = 2 ** 6 - 1, pl = 2 ** 14 - 1, gl = 2 ** 30 - 1, Lg = Number.MAX_SAFE_INTEGER, Dg = P(2) ** P(62) - P(1);
4187
+ const fl = 2 ** 6 - 1, pl = 2 ** 14 - 1, gl = 2 ** 30 - 1, Og = Number.MAX_SAFE_INTEGER, Fg = P(2) ** P(62) - P(1);
4142
4188
  function Al(s, e, t) {
4143
4189
  e[t] = s >> 8 & 255, e[t + 1] = s & 255;
4144
4190
  }
@@ -4155,7 +4201,7 @@ function yl(s, e, t) {
4155
4201
  return Al(s | 16384, e, t), 2;
4156
4202
  if (s <= gl)
4157
4203
  return wl(s | 2147483648, e, t), 4;
4158
- if (s <= Lg)
4204
+ if (s <= Og)
4159
4205
  return bl(BigInt(s) | /* @__PURE__ */ BigInt(0xc000000000000000), e, t), 8;
4160
4206
  throw new Error(`overflow, value larger than 53-bits: ${s}`);
4161
4207
  }
@@ -4166,7 +4212,7 @@ function Sl(s, e, t) {
4166
4212
  return Al(Number(s) | 16384, e, t), 2;
4167
4213
  if (s <= gl)
4168
4214
  return wl(Number(s) | 2147483648, e, t), 4;
4169
- if (s <= Dg)
4215
+ if (s <= Fg)
4170
4216
  return bl(s | /* @__PURE__ */ BigInt(0xc000000000000000), e, t), 8;
4171
4217
  throw new Error(`overflow, value larger than 62-bits: ${s}`);
4172
4218
  }
@@ -4207,7 +4253,7 @@ function er(s, e) {
4207
4253
  yield s.writeBigVarInt(t), yield s.writeVarInt(i.payload.length), yield s.write(i.payload);
4208
4254
  });
4209
4255
  }
4210
- function Og(s) {
4256
+ function _g(s) {
4211
4257
  return f(this, null, function* () {
4212
4258
  return {
4213
4259
  type: R.Announce,
@@ -4216,12 +4262,12 @@ function Og(s) {
4216
4262
  };
4217
4263
  });
4218
4264
  }
4219
- function Fg(s, e) {
4265
+ function Ng(s, e) {
4220
4266
  return f(this, null, function* () {
4221
4267
  yield fu(s, e.namespace), yield er(s, e.params);
4222
4268
  });
4223
4269
  }
4224
- function _g(s) {
4270
+ function Vg(s) {
4225
4271
  return f(this, null, function* () {
4226
4272
  return {
4227
4273
  type: R.AnnounceOk,
@@ -4229,18 +4275,18 @@ function _g(s) {
4229
4275
  };
4230
4276
  });
4231
4277
  }
4232
- function Ng(s, e) {
4278
+ function Gg(s, e) {
4233
4279
  return f(this, null, function* () {
4234
4280
  yield fu(s, e.namespace);
4235
4281
  });
4236
4282
  }
4237
- const Vg = {
4283
+ const jg = {
4238
4284
  "latest-group": 1,
4239
4285
  "latest-object": 2,
4240
4286
  "absolute-start": 3,
4241
4287
  "absolute-range": 4
4242
4288
  };
4243
- function Gg(s) {
4289
+ function Wg(s) {
4244
4290
  return f(this, null, function* () {
4245
4291
  const e = yield s.readVarInt();
4246
4292
  switch (e) {
@@ -4273,9 +4319,9 @@ function Gg(s) {
4273
4319
  }
4274
4320
  });
4275
4321
  }
4276
- function jg(s, e) {
4322
+ function Hg(s, e) {
4277
4323
  return f(this, null, function* () {
4278
- const t = Vg[e.type];
4324
+ const t = jg[e.type];
4279
4325
  switch (yield s.writeVarInt(t), e.type) {
4280
4326
  case "absolute-range":
4281
4327
  yield s.writeBigVarInt(e.start.group), yield s.writeBigVarInt(e.start.object), yield s.writeBigVarInt(e.end.group), yield s.writeBigVarInt(e.end.object);
@@ -4321,9 +4367,9 @@ function Tl(s, e) {
4321
4367
  }
4322
4368
  });
4323
4369
  }
4324
- function Wg(s) {
4370
+ function zg(s) {
4325
4371
  return f(this, null, function* () {
4326
- const e = yield s.readBigVarInt(), t = yield s.readBigVarInt(), i = yield Zc(s), n = yield s.readString(), o = yield s.readUnsigned8(), c = yield vl(s), h = yield Gg(s), u = yield Kn(s);
4372
+ const e = yield s.readBigVarInt(), t = yield s.readBigVarInt(), i = yield Zc(s), n = yield s.readString(), o = yield s.readUnsigned8(), c = yield vl(s), h = yield Wg(s), u = yield Kn(s);
4327
4373
  if (h.type === "absolute-range") {
4328
4374
  const l = h.start.group > h.end.group, p = h.start.group === h.end.group && h.start.object > h.end.object;
4329
4375
  if (l || p)
@@ -4342,16 +4388,16 @@ function Wg(s) {
4342
4388
  };
4343
4389
  });
4344
4390
  }
4345
- function zg(s, e) {
4391
+ function Qg(s, e) {
4346
4392
  return f(this, null, function* () {
4347
- yield s.writeBigVarInt(e.id), yield s.writeBigVarInt(e.trackAlias), yield fu(s, e.namespace), yield s.writeString(e.name), yield s.writeUnsigned8(e.subscriberPriority), yield Tl(s, e.groupOrder), yield jg(s, e.filterType), yield er(s, e.params);
4393
+ yield s.writeBigVarInt(e.id), yield s.writeBigVarInt(e.trackAlias), yield fu(s, e.namespace), yield s.writeString(e.name), yield s.writeUnsigned8(e.subscriberPriority), yield Tl(s, e.groupOrder), yield Hg(s, e.filterType), yield er(s, e.params);
4348
4394
  });
4349
4395
  }
4350
4396
  const Ph = {
4351
4397
  TrackEnded: 3,
4352
4398
  Expired: 6
4353
4399
  };
4354
- function Hg(s) {
4400
+ function Xg(s) {
4355
4401
  return f(this, null, function* () {
4356
4402
  const e = yield s.readBigVarInt(), t = yield s.readVarInt(), i = yield s.readString(), n = (yield s.readUnsigned8()) == 1;
4357
4403
  let o;
@@ -4367,12 +4413,12 @@ function Hg(s) {
4367
4413
  };
4368
4414
  });
4369
4415
  }
4370
- function Qg(s, e) {
4416
+ function qg(s, e) {
4371
4417
  return f(this, null, function* () {
4372
4418
  yield s.writeBigVarInt(e.id), yield s.writeVarInt(e.errorCode), yield s.writeString(e.reason), yield s.writeUnsigned8(e.finalInfo ? 1 : 0), e.finalInfo && (yield s.writeBigVarInt(e.finalInfo.group), yield s.writeBigVarInt(e.finalInfo.object));
4373
4419
  });
4374
4420
  }
4375
- function Xg(s) {
4421
+ function Zg(s) {
4376
4422
  return f(this, null, function* () {
4377
4423
  return {
4378
4424
  type: R.SubscribeError,
@@ -4383,12 +4429,12 @@ function Xg(s) {
4383
4429
  };
4384
4430
  });
4385
4431
  }
4386
- function qg(s, e) {
4432
+ function Jg(s, e) {
4387
4433
  return f(this, null, function* () {
4388
4434
  yield s.writeBigVarInt(e.id), yield s.writeBigVarInt(e.errorCode), yield s.writeString(e.reason), yield s.writeBigVarInt(e.trackAlias);
4389
4435
  });
4390
4436
  }
4391
- function Zg(s) {
4437
+ function $g(s) {
4392
4438
  return f(this, null, function* () {
4393
4439
  const e = yield s.readBigVarInt(), t = yield s.readBigVarInt(), i = yield vl(s), n = (yield s.readUnsigned8()) == 1;
4394
4440
  let o;
@@ -4409,12 +4455,12 @@ function Zg(s) {
4409
4455
  };
4410
4456
  });
4411
4457
  }
4412
- function Jg(s, e) {
4458
+ function Yg(s, e) {
4413
4459
  return f(this, null, function* () {
4414
4460
  yield s.writeBigVarInt(e.id), yield s.writeBigVarInt(e.expires), yield Tl(s, e.groupOrder), yield s.writeUnsigned8(e.largestInfo ? 1 : 0), e.largestInfo && (yield s.writeBigVarInt(e.largestInfo.group), yield s.writeBigVarInt(e.largestInfo.object)), yield er(s, e.params);
4415
4461
  });
4416
4462
  }
4417
- function $g(s) {
4463
+ function Kg(s) {
4418
4464
  return f(this, null, function* () {
4419
4465
  const e = yield s.readBigVarInt(), t = yield s.readBigVarInt(), i = yield s.readBigVarInt(), n = yield s.readBigVarInt(), o = yield s.readBigVarInt(), c = yield s.readUnsigned8(), h = yield Kn(s), u = t > n, l = t === n && i > o;
4420
4466
  if (u || l)
@@ -4429,12 +4475,12 @@ function $g(s) {
4429
4475
  };
4430
4476
  });
4431
4477
  }
4432
- function Yg(s, e) {
4478
+ function eA(s, e) {
4433
4479
  return f(this, null, function* () {
4434
4480
  yield s.writeBigVarInt(e.id), yield s.writeBigVarInt(e.start.group), yield s.writeBigVarInt(e.start.object), yield s.writeBigVarInt(e.end.group), yield s.writeBigVarInt(e.end.object), yield s.writeUnsigned8(e.subscriberPriority), yield er(s, e.params);
4435
4481
  });
4436
4482
  }
4437
- const Kg = {
4483
+ const tA = {
4438
4484
  Subscriber: 2
4439
4485
  }, _o = {
4440
4486
  Role: P(0)
@@ -4447,7 +4493,7 @@ function kl(s) {
4447
4493
  return e === El.Draft07 ? { type: "known", value: e } : { type: "unknown", value: e };
4448
4494
  });
4449
4495
  }
4450
- function eA(s, e) {
4496
+ function iA(s, e) {
4451
4497
  return f(this, null, function* () {
4452
4498
  yield s.writeVarInt(e.supportedVersions.length);
4453
4499
  for (const t of e.supportedVersions)
@@ -4455,7 +4501,7 @@ function eA(s, e) {
4455
4501
  yield er(s, e.parameters);
4456
4502
  });
4457
4503
  }
4458
- function tA(s) {
4504
+ function sA(s) {
4459
4505
  return f(this, null, function* () {
4460
4506
  const e = [], t = yield s.readVarInt();
4461
4507
  for (let n = 0; n < t; n++)
@@ -4470,12 +4516,12 @@ function tA(s) {
4470
4516
  };
4471
4517
  });
4472
4518
  }
4473
- function iA(s, e) {
4519
+ function nA(s, e) {
4474
4520
  return f(this, null, function* () {
4475
4521
  yield s.writeVarInt(e.selectedVersion.value), yield er(s, e.parameters);
4476
4522
  });
4477
4523
  }
4478
- function sA(s) {
4524
+ function rA(s) {
4479
4525
  return f(this, null, function* () {
4480
4526
  const e = yield kl(s);
4481
4527
  if (e.type !== "known")
@@ -4490,7 +4536,7 @@ function sA(s) {
4490
4536
  };
4491
4537
  });
4492
4538
  }
4493
- function nA(s) {
4539
+ function aA(s) {
4494
4540
  return f(this, null, function* () {
4495
4541
  return {
4496
4542
  type: R.Unsubscribe,
@@ -4498,13 +4544,13 @@ function nA(s) {
4498
4544
  };
4499
4545
  });
4500
4546
  }
4501
- function rA(s, e) {
4547
+ function oA(s, e) {
4502
4548
  return f(this, null, function* () {
4503
4549
  yield s.writeBigVarInt(e.id);
4504
4550
  });
4505
4551
  }
4506
- var Vt, hn, te, Cl, Rl, Bl, Ul, Pl, Ml, xl, Ll, Dl, Ol;
4507
- class Il {
4552
+ var Vt, hn, te, Il, Rl, Bl, Ul, Pl, Ml, xl, Ll, Dl, Ol;
4553
+ class Cl {
4508
4554
  constructor(e) {
4509
4555
  d(this, te);
4510
4556
  d(this, Vt);
@@ -4547,7 +4593,7 @@ class Il {
4547
4593
  yield w(this, te, Ll).call(this, t, e);
4548
4594
  break;
4549
4595
  case R.ClientSetup:
4550
- yield w(this, te, Cl).call(this, t, e);
4596
+ yield w(this, te, Il).call(this, t, e);
4551
4597
  break;
4552
4598
  case R.ServerSetup:
4553
4599
  yield w(this, te, Rl).call(this, t, e);
@@ -4567,54 +4613,54 @@ class Il {
4567
4613
  });
4568
4614
  }
4569
4615
  }
4570
- Vt = new WeakMap(), hn = new WeakMap(), te = new WeakSet(), Cl = function(e, t) {
4616
+ Vt = new WeakMap(), hn = new WeakMap(), te = new WeakSet(), Il = function(e, t) {
4571
4617
  return f(this, null, function* () {
4572
- yield eA(e, t);
4618
+ yield iA(e, t);
4573
4619
  });
4574
4620
  }, Rl = function(e, t) {
4575
4621
  return f(this, null, function* () {
4576
- yield iA(e, t);
4622
+ yield nA(e, t);
4577
4623
  });
4578
4624
  }, Bl = function(e, t) {
4579
4625
  return f(this, null, function* () {
4580
- yield zg(e, t);
4626
+ yield Qg(e, t);
4581
4627
  });
4582
4628
  }, Ul = function(e, t) {
4583
4629
  return f(this, null, function* () {
4584
- yield Jg(e, t);
4630
+ yield Yg(e, t);
4585
4631
  });
4586
4632
  }, Pl = function(e, t) {
4587
4633
  return f(this, null, function* () {
4588
- yield qg(e, t);
4634
+ yield Jg(e, t);
4589
4635
  });
4590
4636
  }, Ml = function(e, t) {
4591
4637
  return f(this, null, function* () {
4592
- yield Yg(e, t);
4638
+ yield eA(e, t);
4593
4639
  });
4594
4640
  }, xl = function(e, t) {
4595
4641
  return f(this, null, function* () {
4596
- yield Qg(e, t);
4642
+ yield qg(e, t);
4597
4643
  });
4598
4644
  }, Ll = function(e, t) {
4599
4645
  return f(this, null, function* () {
4600
- yield rA(e, t);
4646
+ yield oA(e, t);
4601
4647
  });
4602
4648
  }, Dl = function(e, t) {
4603
4649
  return f(this, null, function* () {
4604
- yield Fg(e, t);
4650
+ yield Ng(e, t);
4605
4651
  });
4606
4652
  }, Ol = function(e, t) {
4607
4653
  return f(this, null, function* () {
4608
- yield Ng(e, t);
4654
+ yield Gg(e, t);
4609
4655
  });
4610
4656
  };
4611
4657
  var un, aa, oa;
4612
- class aA {
4658
+ class cA {
4613
4659
  constructor(e, t) {
4614
4660
  d(this, un);
4615
4661
  d(this, aa);
4616
4662
  d(this, oa);
4617
- m(this, un, e), m(this, aa, new Il(e)), m(this, oa, t);
4663
+ m(this, un, e), m(this, aa, new Cl(e)), m(this, oa, t);
4618
4664
  }
4619
4665
  write(e) {
4620
4666
  return f(this, null, function* () {
@@ -4627,12 +4673,12 @@ class aA {
4627
4673
  }
4628
4674
  un = new WeakMap(), aa = new WeakMap(), oa = new WeakMap();
4629
4675
  P(1025), P(1027), P(1033), P(2048);
4630
- class oA extends Error {
4676
+ class hA extends Error {
4631
4677
  constructor(e, t) {
4632
4678
  super(e), this.errorCode = t;
4633
4679
  }
4634
4680
  }
4635
- function cA(s) {
4681
+ function uA(s) {
4636
4682
  return f(this, null, function* () {
4637
4683
  return {
4638
4684
  type: R.AnnounceError,
@@ -4642,7 +4688,7 @@ function cA(s) {
4642
4688
  };
4643
4689
  });
4644
4690
  }
4645
- function hA(s, e, t) {
4691
+ function dA(s, e, t) {
4646
4692
  return f(this, null, function* () {
4647
4693
  return {
4648
4694
  type: R.Unknown,
@@ -4665,29 +4711,29 @@ class $u {
4665
4711
  const e = yield a(this, ue).readVarInt(), t = yield a(this, ue).readVarInt();
4666
4712
  switch (e) {
4667
4713
  case R.ServerSetup:
4668
- return sA(a(this, ue));
4714
+ return rA(a(this, ue));
4669
4715
  case R.ClientSetup:
4670
- return tA(a(this, ue));
4716
+ return sA(a(this, ue));
4671
4717
  case R.Subscribe:
4672
- return Wg(a(this, ue));
4718
+ return zg(a(this, ue));
4673
4719
  case R.SubscribeOk:
4674
- return Zg(a(this, ue));
4720
+ return $g(a(this, ue));
4675
4721
  case R.SubscribeDone:
4676
- return Hg(a(this, ue));
4677
- case R.SubscribeError:
4678
4722
  return Xg(a(this, ue));
4723
+ case R.SubscribeError:
4724
+ return Zg(a(this, ue));
4679
4725
  case R.SubscribeUpdate:
4680
- return $g(a(this, ue));
4726
+ return Kg(a(this, ue));
4681
4727
  case R.Unsubscribe:
4682
- return nA(a(this, ue));
4728
+ return aA(a(this, ue));
4683
4729
  case R.Announce:
4684
- return Og(a(this, ue));
4685
- case R.AnnounceOk:
4686
4730
  return _g(a(this, ue));
4731
+ case R.AnnounceOk:
4732
+ return Vg(a(this, ue));
4687
4733
  case R.AnnounceError:
4688
- return cA(a(this, ue));
4734
+ return uA(a(this, ue));
4689
4735
  }
4690
- return hA(a(this, ue), P(e), t);
4736
+ return dA(a(this, ue), P(e), t);
4691
4737
  });
4692
4738
  }
4693
4739
  }
@@ -4729,14 +4775,14 @@ const Gs = class Gs {
4729
4775
  }
4730
4776
  static wrapWebsocket(e) {
4731
4777
  const t = new ReadableStream(
4732
- new Ug(e, a(Gs, cc))
4733
- ), i = new $u(new Oo(new Uint8Array([]), t)), n = new aA(new Lr(e), new Uint8Array([0]));
4778
+ new Mg(e, a(Gs, cc))
4779
+ ), i = new $u(new Oo(new Uint8Array([]), t)), n = new cA(new Lr(e), new Uint8Array([0]));
4734
4780
  return new Gs(n, i);
4735
4781
  }
4736
4782
  static wrapWebTransport(e) {
4737
4783
  const t = e.writable, i = e.readable;
4738
4784
  return new Gs(
4739
- new Il(new ll(t)),
4785
+ new Cl(new ll(t)),
4740
4786
  new $u(new Oo(new Uint8Array(), i))
4741
4787
  );
4742
4788
  }
@@ -4761,7 +4807,7 @@ function _l(s, e) {
4761
4807
  });
4762
4808
  }
4763
4809
  var mn;
4764
- class uA {
4810
+ class lA {
4765
4811
  constructor(e) {
4766
4812
  r(this, "announce");
4767
4813
  d(this, mn, new W());
@@ -4771,7 +4817,7 @@ class uA {
4771
4817
  a(this, mn).resolve(e);
4772
4818
  }
4773
4819
  onError(e) {
4774
- const t = new oA(e.reason, e.errorCode);
4820
+ const t = new hA(e.reason, e.errorCode);
4775
4821
  return a(this, mn).reject(t), t;
4776
4822
  }
4777
4823
  ok() {
@@ -4779,11 +4825,11 @@ class uA {
4779
4825
  }
4780
4826
  }
4781
4827
  mn = new WeakMap();
4782
- function dA(s) {
4783
- const e = new uA(s);
4784
- return new lA(e);
4828
+ function mA(s) {
4829
+ const e = new lA(s);
4830
+ return new fA(e);
4785
4831
  }
4786
- class lA {
4832
+ class fA {
4787
4833
  constructor(e) {
4788
4834
  r(this, "state");
4789
4835
  this.state = e;
@@ -4825,7 +4871,7 @@ const js = class js {
4825
4871
  const t = Math.max(0, Date.now() - a(this, hc)), i = Number(e.expires);
4826
4872
  if (i > 0) {
4827
4873
  const n = Math.max(js.minGraceTime, Math.min(i / 10, js.maxGraceTime));
4828
- Promise.race([Ci(i - n - t), this.done().catch(D)]).then(() => a(this, $i).resolve(this.expiryState())).catch(D);
4874
+ Promise.race([Ii(i - n - t), this.done().catch(D)]).then(() => a(this, $i).resolve(this.expiryState())).catch(D);
4829
4875
  }
4830
4876
  a(this, fn).resolve(e);
4831
4877
  }
@@ -4862,7 +4908,7 @@ const js = class js {
4862
4908
  fn = new WeakMap(), ci = new WeakMap(), Ji = new WeakMap(), hc = new WeakMap(), $i = new WeakMap(), ot = new WeakMap(), r(js, "maxGraceTime", 15e3), r(js, "minGraceTime", 3e3);
4863
4909
  let Vo = js;
4864
4910
  var ye, ua;
4865
- class mA {
4911
+ class pA {
4866
4912
  constructor(e) {
4867
4913
  d(this, ye);
4868
4914
  d(this, ua, !1);
@@ -4881,7 +4927,7 @@ class mA {
4881
4927
  }
4882
4928
  ye = new WeakMap(), ua = new WeakMap();
4883
4929
  var da, Xe, la, ma, pn, fa, uc, Nl;
4884
- class fA {
4930
+ class gA {
4885
4931
  constructor(e, t, i, n) {
4886
4932
  d(this, uc);
4887
4933
  d(this, da);
@@ -4937,14 +4983,14 @@ da = new WeakMap(), Xe = new WeakMap(), la = new WeakMap(), ma = new WeakMap(),
4937
4983
  if (g && (g.startGroup > p.id || g.endGroup && g.endGroup < p.id))
4938
4984
  break;
4939
4985
  const A = yield a(this, la).openSendStream();
4940
- const b = new mA(A);
4941
- const v = We(e, new pA(b, p.consume(), a(this, Xe)), !0);
4986
+ const b = new pA(A);
4987
+ const v = We(e, new AA(b, p.consume(), a(this, Xe)), !0);
4942
4988
  yield v.run();
4943
4989
  m(this, pn, v.finalGroup());
4944
4990
  } catch (t) {
4945
4991
  var i = t, n = !0;
4946
4992
  } finally {
4947
- var o = ze(e, i, n);
4993
+ var o = He(e, i, n);
4948
4994
  o && (yield o);
4949
4995
  }
4950
4996
  }
@@ -4961,7 +5007,7 @@ da = new WeakMap(), Xe = new WeakMap(), la = new WeakMap(), ma = new WeakMap(),
4961
5007
  });
4962
5008
  };
4963
5009
  var Yi, pa, gn, ga, An;
4964
- class pA {
5010
+ class AA {
4965
5011
  constructor(e, t, i) {
4966
5012
  d(this, Yi);
4967
5013
  d(this, pa);
@@ -5012,7 +5058,7 @@ class pA {
5012
5058
  }
5013
5059
  Yi = new WeakMap(), pa = new WeakMap(), gn = new WeakMap(), ga = new WeakMap(), An = new WeakMap();
5014
5060
  var Aa, Ki, hi, Ls;
5015
- class gA {
5061
+ class wA {
5016
5062
  constructor(e, t, i) {
5017
5063
  d(this, hi);
5018
5064
  r(this, "state");
@@ -5036,7 +5082,7 @@ class gA {
5036
5082
  params: /* @__PURE__ */ new Map(),
5037
5083
  largestInfo: n ? { group: n, object: o } : void 0
5038
5084
  };
5039
- return yield a(this, Ki).push(h), new fA(this.state, c, a(this, Aa), a(this, Ki));
5085
+ return yield a(this, Ki).push(h), new gA(this.state, c, a(this, Aa), a(this, Ki));
5040
5086
  });
5041
5087
  }
5042
5088
  invalidRange() {
@@ -5080,9 +5126,9 @@ class Mh {
5080
5126
  d(this, wa);
5081
5127
  d(this, bn);
5082
5128
  d(this, es, we.get().createContext("Publisher"));
5083
- d(this, ui, new Ce(/* @__PURE__ */ new Map()));
5084
- d(this, di, new Ce(/* @__PURE__ */ new Map()));
5085
- d(this, li, new zc(10));
5129
+ d(this, ui, new Ie(/* @__PURE__ */ new Map()));
5130
+ d(this, di, new Ie(/* @__PURE__ */ new Map()));
5131
+ d(this, li, new Hc(10));
5086
5132
  m(this, wn, e), m(this, wa, t), m(this, bn, i);
5087
5133
  }
5088
5134
  announce(e) {
@@ -5095,7 +5141,7 @@ class Mh {
5095
5141
  type: R.Announce,
5096
5142
  namespace: e,
5097
5143
  params: t
5098
- }, o = dA(n);
5144
+ }, o = mA(n);
5099
5145
  if (a(this, ui).update((h) => h.set(n.namespace.join("/"), o)), yield a(this, bn).push(n), !(yield Promise.race([o.state.ok(), a(this, wn).closed()])))
5100
5146
  throw new Error("Session closed");
5101
5147
  });
@@ -5117,7 +5163,7 @@ class Mh {
5117
5163
  yield i == null ? void 0 : i.timeout();
5118
5164
  }
5119
5165
  yield a(this, li).push(
5120
- new gA(t, a(this, wa), a(this, bn))
5166
+ new wA(t, a(this, wa), a(this, bn))
5121
5167
  );
5122
5168
  }
5123
5169
  break;
@@ -5150,12 +5196,12 @@ class Mh {
5150
5196
  }
5151
5197
  }
5152
5198
  dh = Bi(null), wn = new WeakMap(), wa = new WeakMap(), bn = new WeakMap(), es = new WeakMap(), ui = new WeakMap(), di = new WeakMap(), li = new WeakMap(), ve(dh, 1, "announce", gd, Mh), $t(dh, Mh);
5153
- function AA(s, e) {
5154
- const t = new Vo(e), [i, n] = lu(100), o = new wA(t, i), c = new Vl(s, t, n);
5199
+ function bA(s, e) {
5200
+ const t = new Vo(e), [i, n] = lu(100), o = new yA(t, i), c = new Vl(s, t, n);
5155
5201
  return [o, c];
5156
5202
  }
5157
5203
  var ts;
5158
- class wA {
5204
+ class yA {
5159
5205
  constructor(e, t) {
5160
5206
  r(this, "state");
5161
5207
  d(this, ts);
@@ -5259,7 +5305,7 @@ class Vl {
5259
5305
  return xt(this, null, function* () {
5260
5306
  var e, t;
5261
5307
  try {
5262
- for (var b = J(a(this, Sn)), v, k, I; v = !(k = yield new X(b.next())).done; v = !1) {
5308
+ for (var b = J(a(this, Sn)), v, k, C; v = !(k = yield new X(b.next())).done; v = !1) {
5263
5309
  var h = k.value;
5264
5310
  var u = [];
5265
5311
  try {
@@ -5287,18 +5333,18 @@ class Vl {
5287
5333
  } catch (l) {
5288
5334
  var p = l, g = !0;
5289
5335
  } finally {
5290
- var A = ze(u, p, g);
5336
+ var A = He(u, p, g);
5291
5337
  A && (yield new X(A));
5292
5338
  }
5293
5339
  }
5294
5340
  } catch (k) {
5295
- I = [k];
5341
+ C = [k];
5296
5342
  } finally {
5297
5343
  try {
5298
5344
  v && (k = b.return) && (yield new X(k.call(b)));
5299
5345
  } finally {
5300
- if (I)
5301
- throw I[0];
5346
+ if (C)
5347
+ throw C[0];
5302
5348
  }
5303
5349
  }
5304
5350
  });
@@ -5354,7 +5400,7 @@ lh = Bi(null), yn = new WeakMap(), me = new WeakMap(), Sn = new WeakMap(), vn =
5354
5400
  return yield this.close(), this.unsubscribe();
5355
5401
  });
5356
5402
  }, or = ve(lh, 17, "#dispose", Ad, Tn, or), $t(lh, Vl);
5357
- const bA = 2e3;
5403
+ const SA = 2e3;
5358
5404
  var wd, bd, yd, Sd, Gt, Oe, is, ss, Ms, Bt, ho, Ds;
5359
5405
  Sd = [xe({ context: "Session", return: "debug" })], yd = [xe({ context: "Session", enter: "info", error: "error" })], bd = [xe({ context: "Session", enter: "debug" })], wd = [xe({ context: "Session", enter: "debug" })];
5360
5406
  class co {
@@ -5366,7 +5412,7 @@ class co {
5366
5412
  // The next subscribe id
5367
5413
  r(this, "nextSubscribeId", P(0));
5368
5414
  // The active subscriptions
5369
- d(this, Oe, new Ce(/* @__PURE__ */ new Map()));
5415
+ d(this, Oe, new Ie(/* @__PURE__ */ new Map()));
5370
5416
  d(this, is);
5371
5417
  d(this, ss, we.get().createContext("Subscriber"));
5372
5418
  m(this, Gt, e), m(this, is, t), w(this, Bt, ho).call(this).catch(D);
@@ -5385,10 +5431,10 @@ class co {
5385
5431
  subscriberPriority: t.priority,
5386
5432
  filterType: t.filterType,
5387
5433
  params: i
5388
- }, [l, p] = AA(a(this, is), u);
5434
+ }, [l, p] = bA(a(this, is), u);
5389
5435
  if (a(this, Oe).update((A) => A.set(c, l)), yield a(this, is).push(u), !(yield Promise.race([l.state.ok(), a(this, Gt).closed()])))
5390
5436
  throw new Error("Session closed");
5391
- return p.closed().then(() => Promise.race([Ci(bA), this.closed()])).then(() => w(this, Bt, Ds).call(this, p.id)).catch(() => w(this, Bt, Ds).call(this, p.id)), p;
5437
+ return p.closed().then(() => Promise.race([Ii(SA), this.closed()])).then(() => w(this, Bt, Ds).call(this, p.id)).catch(() => w(this, Bt, Ds).call(this, p.id)), p;
5392
5438
  });
5393
5439
  }
5394
5440
  closed() {
@@ -5482,7 +5528,7 @@ class pu {
5482
5528
  r(this, "publisher");
5483
5529
  d(this, kn);
5484
5530
  const [i, n] = lu(100);
5485
- m(this, ct, e), m(this, ns, n), this.subscriber = new co(this, i), this.publisher = new Mh(this, e, i), m(this, ba, w(this, de, jl).call(this)), m(this, kn, new Ce(t)), this.closed().then(() => this.close()).catch(D);
5531
+ m(this, ct, e), m(this, ns, n), this.subscriber = new co(this, i), this.publisher = new Mh(this, e, i), m(this, ba, w(this, de, jl).call(this)), m(this, kn, new Ie(t)), this.closed().then(() => this.close()).catch(D);
5486
5532
  }
5487
5533
  updateAuthToken(e) {
5488
5534
  a(this, kn).update(e);
@@ -5577,15 +5623,15 @@ xs = Bi(null), ct = new WeakMap(), ba = new WeakMap(), ns = new WeakMap(), En =
5577
5623
  }, cr = function() {
5578
5624
  this.close();
5579
5625
  }, uo = ve(xs, 17, "#runOutgoingMessages", kd, de, uo), lo = ve(xs, 17, "#runControl", Ed, de, lo), mo = ve(xs, 17, "#runObjects", Td, de, mo), cr = ve(xs, 17, "#dispose", vd, de, cr), $t(xs, pu);
5580
- const yA = 128;
5581
- var qe, ya, rs, In, Sa, Se, Di, Oi;
5582
- class SA {
5626
+ const vA = 128;
5627
+ var qe, ya, rs, Cn, Sa, Se, Di, Oi;
5628
+ class TA {
5583
5629
  constructor(e, t, i) {
5584
5630
  d(this, Se);
5585
5631
  d(this, qe);
5586
5632
  d(this, ya);
5587
5633
  d(this, rs, !0);
5588
- d(this, In, !1);
5634
+ d(this, Cn, !1);
5589
5635
  d(this, Sa);
5590
5636
  m(this, qe, e), m(this, ya, t), m(this, Sa, i);
5591
5637
  }
@@ -5621,29 +5667,29 @@ class SA {
5621
5667
  }
5622
5668
  close() {
5623
5669
  return f(this, null, function* () {
5624
- a(this, In) || (m(this, rs, !0), yield w(this, Se, Oi).call(this, !1), yield a(this, qe).flush(), m(this, In, !0), a(this, Sa).call(this));
5670
+ a(this, Cn) || (m(this, rs, !0), yield w(this, Se, Oi).call(this, !1), yield a(this, qe).flush(), m(this, Cn, !0), a(this, Sa).call(this));
5625
5671
  });
5626
5672
  }
5627
5673
  }
5628
- qe = new WeakMap(), ya = new WeakMap(), rs = new WeakMap(), In = new WeakMap(), Sa = new WeakMap(), Se = new WeakSet(), Di = function() {
5629
- if (a(this, In))
5674
+ qe = new WeakMap(), ya = new WeakMap(), rs = new WeakMap(), Cn = new WeakMap(), Sa = new WeakMap(), Se = new WeakSet(), Di = function() {
5675
+ if (a(this, Cn))
5630
5676
  throw new Error("Stream is closed");
5631
5677
  }, Oi = function(e = !0) {
5632
5678
  if (a(this, rs))
5633
- return m(this, rs, !1), a(this, qe).writeUnsigned8(a(this, ya) | (e ? yA : 0));
5679
+ return m(this, rs, !1), a(this, qe).writeUnsigned8(a(this, ya) | (e ? vA : 0));
5634
5680
  };
5635
- var mi, jt, Cn, as, Wt, Rn, Bn, dc, Wl;
5636
- class vA {
5681
+ var mi, jt, In, as, Wt, Rn, Bn, dc, Wl;
5682
+ class EA {
5637
5683
  constructor(e, t) {
5638
5684
  d(this, dc);
5639
5685
  d(this, mi);
5640
5686
  d(this, jt);
5641
- d(this, Cn);
5687
+ d(this, In);
5642
5688
  d(this, as);
5643
5689
  d(this, Wt, /* @__PURE__ */ new Map());
5644
5690
  d(this, Rn, we.get().createContext("WebSocketConnection"));
5645
5691
  d(this, Bn, new Set(new Array(128).fill(0).map((e, t) => t + 1)));
5646
- m(this, mi, e), m(this, jt, t), m(this, Cn, new ReadableStream(new Pg(e))), a(this, mi).addEventListener("close", () => {
5692
+ m(this, mi, e), m(this, jt, t), m(this, In, new ReadableStream(new xg(e))), a(this, mi).addEventListener("close", () => {
5647
5693
  a(this, jt).markPostHandshake(), a(this, Wt).forEach((i) => i.close());
5648
5694
  });
5649
5695
  }
@@ -5652,7 +5698,7 @@ class vA {
5652
5698
  if (!e)
5653
5699
  throw new Error("No stream IDs available");
5654
5700
  return a(this, Bn).delete(e), Promise.resolve(
5655
- new SA(new Lr(a(this, mi)), e, () => w(this, dc, Wl).call(this, e))
5701
+ new TA(new Lr(a(this, mi)), e, () => w(this, dc, Wl).call(this, e))
5656
5702
  );
5657
5703
  }
5658
5704
  transportType() {
@@ -5668,7 +5714,7 @@ class vA {
5668
5714
  return f(this, null, function* () {
5669
5715
  var e;
5670
5716
  for (; ; ) {
5671
- m(this, as, a(this, Cn).getReader());
5717
+ m(this, as, a(this, In).getReader());
5672
5718
  try {
5673
5719
  const { value: t, done: i } = yield a(this, as).read();
5674
5720
  if (i)
@@ -5701,7 +5747,7 @@ class vA {
5701
5747
  }
5702
5748
  close() {
5703
5749
  var e;
5704
- return a(this, jt).cancel().catch(D), a(this, Cn).cancel("closing").catch(D), (e = a(this, as)) == null || e.cancel("closing").catch(D), a(this, mi).close();
5750
+ return a(this, jt).cancel().catch(D), a(this, In).cancel("closing").catch(D), (e = a(this, as)) == null || e.cancel("closing").catch(D), a(this, mi).close();
5705
5751
  }
5706
5752
  closed() {
5707
5753
  return Promise.resolve();
@@ -5717,32 +5763,32 @@ class vA {
5717
5763
  });
5718
5764
  }
5719
5765
  }
5720
- mi = new WeakMap(), jt = new WeakMap(), Cn = new WeakMap(), as = new WeakMap(), Wt = new WeakMap(), Rn = new WeakMap(), Bn = new WeakMap(), dc = new WeakSet(), /**
5766
+ mi = new WeakMap(), jt = new WeakMap(), In = new WeakMap(), as = new WeakMap(), Wt = new WeakMap(), Rn = new WeakMap(), Bn = new WeakMap(), dc = new WeakSet(), /**
5721
5767
  * Return a stream ID to the pool of available stream IDs
5722
5768
  * @param streamId - The stream ID to return
5723
5769
  */
5724
5770
  Wl = function(e) {
5725
5771
  a(this, Bn).add(e);
5726
5772
  };
5727
- var zt, Ht, fi, va, Ta, lc, mc, zl;
5728
- class TA {
5773
+ var Ht, zt, fi, va, Ta, lc, mc, Hl;
5774
+ class kA {
5729
5775
  constructor(e, t, i) {
5730
5776
  d(this, mc);
5731
- d(this, zt);
5732
5777
  d(this, Ht);
5733
- d(this, fi, new zc(100));
5778
+ d(this, zt);
5779
+ d(this, fi, new Hc(100));
5734
5780
  d(this, va);
5735
5781
  d(this, Ta, 0);
5736
5782
  d(this, lc, we.get().createContext("WebTransportConnection"));
5737
- m(this, va, i), m(this, zt, e), m(this, Ht, t), w(this, mc, zl).call(this).catch((n) => {
5738
- a(this, lc).debug("Incoming streams handling ended with error", n), a(this, Ht).markPostHandshake(), a(this, fi).close();
5739
- }), a(this, zt).closed.then(() => {
5740
- a(this, Ht).markPostHandshake(), a(this, fi).close();
5783
+ m(this, va, i), m(this, Ht, e), m(this, zt, t), w(this, mc, Hl).call(this).catch((n) => {
5784
+ a(this, lc).debug("Incoming streams handling ended with error", n), a(this, zt).markPostHandshake(), a(this, fi).close();
5785
+ }), a(this, Ht).closed.then(() => {
5786
+ a(this, zt).markPostHandshake(), a(this, fi).close();
5741
5787
  });
5742
5788
  }
5743
5789
  openSendStream() {
5744
5790
  return f(this, null, function* () {
5745
- const e = yield a(this, zt).createUnidirectionalStream();
5791
+ const e = yield a(this, Ht).createUnidirectionalStream();
5746
5792
  return new ll(e);
5747
5793
  });
5748
5794
  }
@@ -5753,24 +5799,24 @@ class TA {
5753
5799
  return a(this, va);
5754
5800
  }
5755
5801
  afterHandshake() {
5756
- return a(this, Ht).postHandshake();
5802
+ return a(this, zt).postHandshake();
5757
5803
  }
5758
5804
  closed() {
5759
5805
  return f(this, null, function* () {
5760
- yield a(this, zt).closed;
5806
+ yield a(this, Ht).closed;
5761
5807
  });
5762
5808
  }
5763
5809
  close() {
5764
- a(this, zt).close();
5810
+ a(this, Ht).close();
5765
5811
  }
5766
5812
  writeMessage(e) {
5767
5813
  return f(this, null, function* () {
5768
- yield a(this, Ht).write(e);
5814
+ yield a(this, zt).write(e);
5769
5815
  });
5770
5816
  }
5771
5817
  readMessage() {
5772
5818
  return f(this, null, function* () {
5773
- return a(this, Ht).read();
5819
+ return a(this, zt).read();
5774
5820
  });
5775
5821
  }
5776
5822
  objectStream() {
@@ -5779,9 +5825,9 @@ class TA {
5779
5825
  });
5780
5826
  }
5781
5827
  }
5782
- zt = new WeakMap(), Ht = new WeakMap(), fi = new WeakMap(), va = new WeakMap(), Ta = new WeakMap(), lc = new WeakMap(), mc = new WeakSet(), zl = function() {
5828
+ Ht = new WeakMap(), zt = new WeakMap(), fi = new WeakMap(), va = new WeakMap(), Ta = new WeakMap(), lc = new WeakMap(), mc = new WeakSet(), Hl = function() {
5783
5829
  return f(this, null, function* () {
5784
- const e = a(this, zt).incomingUnidirectionalStreams.getReader();
5830
+ const e = a(this, Ht).incomingUnidirectionalStreams.getReader();
5785
5831
  for (; ; ) {
5786
5832
  const { value: t, done: i } = yield e.read();
5787
5833
  if (i) {
@@ -5803,11 +5849,11 @@ function rh(s) {
5803
5849
  _l(t, s.role).catch(() => {
5804
5850
  e.close();
5805
5851
  });
5806
- const i = new vA(e, t);
5852
+ const i = new EA(e, t);
5807
5853
  return new pu(i, s.authToken);
5808
5854
  });
5809
5855
  }
5810
- function EA(s) {
5856
+ function CA(s) {
5811
5857
  return f(this, null, function* () {
5812
5858
  const e = "60b82e8021689e163c1041b4475ef9c86e7565bc45d1a0aa43f5148769f461c7", t = new Uint8Array(e.length / 2);
5813
5859
  for (let u = 0; u < t.length; u += 1)
@@ -5821,14 +5867,14 @@ function EA(s) {
5821
5867
  _l(o, s.role).catch(() => {
5822
5868
  i.close();
5823
5869
  });
5824
- const c = new TA(i, o, s.url.toString());
5870
+ const c = new kA(i, o, s.url.toString());
5825
5871
  return new pu(c, s.authToken);
5826
5872
  });
5827
5873
  }
5828
- function kA(s) {
5874
+ function IA(s) {
5829
5875
  return f(this, null, function* () {
5830
5876
  if (self.WebTransport && (s == null ? void 0 : s.preferredTransport) !== "websocket" && s.url.protocol.startsWith("https")) {
5831
- const e = EA(s).catch(() => rh(s)), t = yield Promise.race([e, Ci(s.websocketFallbackTimeoutMs)]);
5877
+ const e = CA(s).catch(() => rh(s)), t = yield Promise.race([e, Ii(s.websocketFallbackTimeoutMs)]);
5832
5878
  return t || rh(s);
5833
5879
  }
5834
5880
  return rh(s);
@@ -5876,7 +5922,7 @@ class Jt {
5876
5922
  }
5877
5923
  Qt = new WeakMap();
5878
5924
  var Un, Ea;
5879
- class Hl {
5925
+ class zl {
5880
5926
  constructor(e, t) {
5881
5927
  d(this, Un);
5882
5928
  d(this, Ea);
@@ -5893,7 +5939,7 @@ class Hl {
5893
5939
  }
5894
5940
  }
5895
5941
  Un = new WeakMap(), Ea = new WeakMap();
5896
- function IA(s, e) {
5942
+ function RA(s, e) {
5897
5943
  return ["com.vindral.moq", s];
5898
5944
  }
5899
5945
  function Pi(s) {
@@ -5902,17 +5948,17 @@ function Pi(s) {
5902
5948
  throw new Error("namespace must contain a channel ID");
5903
5949
  return e;
5904
5950
  }
5905
- function CA(s) {
5951
+ function BA(s) {
5906
5952
  return "tracks" in s;
5907
5953
  }
5908
- function RA(s) {
5954
+ function UA(s) {
5909
5955
  const e = new TextDecoder().decode(s);
5910
5956
  return JSON.parse(e);
5911
5957
  }
5912
- var Fe, Tt, os, Ze, ka, fc, Ia, xh;
5958
+ var Fe, Tt, os, Ze, ka, fc, Ca, xh;
5913
5959
  const yu = class yu {
5914
5960
  constructor(e, t) {
5915
- d(this, Ia);
5961
+ d(this, Ca);
5916
5962
  d(this, Fe);
5917
5963
  // The largest group id seen so far - used to switch seamlessly between tracks
5918
5964
  d(this, Tt);
@@ -5927,7 +5973,7 @@ const yu = class yu {
5927
5973
  if (a(this, Ze))
5928
5974
  return;
5929
5975
  const t = a(this, os).items().reduce((i, n) => i < n ? i : n, e);
5930
- m(this, Ze, w(this, Ia, xh).call(this, t, e)), a(this, Ze).size === 0 && (yield a(this, Fe).close());
5976
+ m(this, Ze, w(this, Ca, xh).call(this, t, e)), a(this, Ze).size === 0 && (yield a(this, Fe).close());
5931
5977
  }));
5932
5978
  m(this, Fe, e), m(this, Tt, t), e.done().then((i) => f(this, null, function* () {
5933
5979
  var n;
@@ -5963,7 +6009,7 @@ const yu = class yu {
5963
6009
  }
5964
6010
  update(e, t) {
5965
6011
  return f(this, null, function* () {
5966
- return m(this, Ze, w(this, Ia, xh).call(this, e, t)), a(this, Ze).size === 0 && (yield a(this, Fe).close()), a(this, Fe).update(e, t);
6012
+ return m(this, Ze, w(this, Ca, xh).call(this, e, t)), a(this, Ze).size === 0 && (yield a(this, Fe).close()), a(this, Fe).update(e, t);
5967
6013
  });
5968
6014
  }
5969
6015
  unsubscribe() {
@@ -5988,7 +6034,7 @@ const yu = class yu {
5988
6034
  return this;
5989
6035
  }
5990
6036
  };
5991
- Fe = new WeakMap(), Tt = new WeakMap(), os = new WeakMap(), Ze = new WeakMap(), ka = new WeakMap(), fc = new WeakMap(), Ia = new WeakSet(), xh = function(e, t) {
6037
+ Fe = new WeakMap(), Tt = new WeakMap(), os = new WeakMap(), Ze = new WeakMap(), ka = new WeakMap(), fc = new WeakMap(), Ca = new WeakSet(), xh = function(e, t) {
5992
6038
  const i = /* @__PURE__ */ new Set();
5993
6039
  for (let n = e; n <= t; n++)
5994
6040
  i == null || i.add(n);
@@ -5997,16 +6043,16 @@ Fe = new WeakMap(), Tt = new WeakMap(), os = new WeakMap(), Ze = new WeakMap(),
5997
6043
  }), i;
5998
6044
  };
5999
6045
  let Go = yu;
6000
- var ht, cs, Xt, Et, Ca, Lh, Ra;
6046
+ var ht, cs, Xt, Et, Ia, Lh, Ra;
6001
6047
  const Su = class Su {
6002
6048
  constructor(e) {
6003
- d(this, Ca);
6049
+ d(this, Ia);
6004
6050
  // The current active subscription
6005
6051
  d(this, ht);
6006
6052
  // The current group iterator - gets replaced by the next in #groups when it runs out
6007
6053
  d(this, cs);
6008
6054
  // The next group iterators to switch to when the current one runs out
6009
- d(this, Xt, new zc(10));
6055
+ d(this, Xt, new Hc(10));
6010
6056
  d(this, Et);
6011
6057
  d(this, Ra, (e, t) => f(this, null, function* () {
6012
6058
  var g = [];
@@ -6038,7 +6084,7 @@ const Su = class Su {
6038
6084
  e.subscribe(u),
6039
6085
  c ? i.value.update(o, o) : i.value.unsubscribe()
6040
6086
  ]);
6041
- l.done().then(() => w(this, Ca, Lh).call(this, l)).catch(D);
6087
+ l.done().then(() => w(this, Ia, Lh).call(this, l)).catch(D);
6042
6088
  l.expiryNotification().then(() => a(this, Ra).call(this, e, u)).catch(D);
6043
6089
  const p = new Go(l, o);
6044
6090
  i.value = p;
@@ -6047,17 +6093,17 @@ const Su = class Su {
6047
6093
  } catch (A) {
6048
6094
  var b = A, v = !0;
6049
6095
  } finally {
6050
- ze(g, b, v);
6096
+ He(g, b, v);
6051
6097
  }
6052
6098
  }));
6053
- m(this, ht, new Wm(e)), m(this, cs, e), m(this, Et, we.get().createContext(`Renewable '${e.name()}'`));
6099
+ m(this, ht, new Hm(e)), m(this, cs, e), m(this, Et, we.get().createContext(`Renewable '${e.name()}'`));
6054
6100
  }
6055
6101
  static subscribe(e, t, i) {
6056
6102
  return f(this, null, function* () {
6057
6103
  const n = i == null ? void 0 : i.params, o = i == null ? void 0 : i.largestGroupId, c = yield e.subscribe(t, n), h = new Su(new Go(c, o));
6058
6104
  return c.done().then(() => {
6059
6105
  var u;
6060
- return w(u = h, Ca, Lh).call(u, c);
6106
+ return w(u = h, Ia, Lh).call(u, c);
6061
6107
  }).catch(D), c.expiryNotification().then(() => {
6062
6108
  var u;
6063
6109
  return a(u = h, Ra).call(u, e, t);
@@ -6077,7 +6123,7 @@ const Su = class Su {
6077
6123
  } catch (o) {
6078
6124
  var c = o, h = !0;
6079
6125
  } finally {
6080
- ze(n, c, h);
6126
+ He(n, c, h);
6081
6127
  }
6082
6128
  });
6083
6129
  }
@@ -6091,7 +6137,7 @@ const Su = class Su {
6091
6137
  } catch (n) {
6092
6138
  var o = n, c = !0;
6093
6139
  } finally {
6094
- ze(i, o, c);
6140
+ He(i, o, c);
6095
6141
  }
6096
6142
  });
6097
6143
  }
@@ -6105,7 +6151,7 @@ const Su = class Su {
6105
6151
  } catch (i) {
6106
6152
  var n = i, o = !0;
6107
6153
  } finally {
6108
- ze(t, n, o);
6154
+ He(t, n, o);
6109
6155
  }
6110
6156
  });
6111
6157
  }
@@ -6119,7 +6165,7 @@ const Su = class Su {
6119
6165
  } catch (i) {
6120
6166
  var n = i, o = !0;
6121
6167
  } finally {
6122
- ze(t, n, o);
6168
+ He(t, n, o);
6123
6169
  }
6124
6170
  });
6125
6171
  }
@@ -6151,7 +6197,7 @@ const Su = class Su {
6151
6197
  } catch (i) {
6152
6198
  var n = i, o = !0;
6153
6199
  } finally {
6154
- var c = ze(t, n, o);
6200
+ var c = He(t, n, o);
6155
6201
  c && (yield new X(c));
6156
6202
  }
6157
6203
  }
@@ -6168,7 +6214,7 @@ const Su = class Su {
6168
6214
  });
6169
6215
  }
6170
6216
  };
6171
- ht = new WeakMap(), cs = new WeakMap(), Xt = new WeakMap(), Et = new WeakMap(), Ca = new WeakSet(), Lh = function(e) {
6217
+ ht = new WeakMap(), cs = new WeakMap(), Xt = new WeakMap(), Et = new WeakMap(), Ia = new WeakSet(), Lh = function(e) {
6172
6218
  return f(this, null, function* () {
6173
6219
  var t;
6174
6220
  if (e.unsubscribed() || (t = e.range()) != null && t.endGroup) {
@@ -6183,10 +6229,10 @@ ht = new WeakMap(), cs = new WeakMap(), Xt = new WeakMap(), Et = new WeakMap(),
6183
6229
  });
6184
6230
  }, Ra = new WeakMap();
6185
6231
  let Ri = Su;
6186
- const BA = "catalog";
6232
+ const PA = "catalog";
6187
6233
  function Yu(s) {
6188
- const e = RA(s.payload);
6189
- if (!CA(e))
6234
+ const e = UA(s.payload);
6235
+ if (!BA(e))
6190
6236
  throw new Error("unexpected catalog type");
6191
6237
  return e;
6192
6238
  }
@@ -6216,16 +6262,16 @@ const gc = class gc {
6216
6262
  const i = W.fromPromise(
6217
6263
  Ri.subscribe(
6218
6264
  e,
6219
- new Jt().name(t.catalogName || BA).groupOrder("ascending").build()
6265
+ new Jt().name(t.catalogName || PA).groupOrder("ascending").build()
6220
6266
  )
6221
6267
  ), n = W.fromPromise(i.promise.then((u) => u.objects()));
6222
6268
  if (t.catalog)
6223
- return new gc(i, new Ce(t.catalog), n);
6269
+ return new gc(i, new Ie(t.catalog), n);
6224
6270
  const c = yield (yield n.promise).next();
6225
6271
  if (!c.value)
6226
6272
  throw new Error("No catalog found");
6227
6273
  const h = Yu(c.value);
6228
- return new gc(i, new Ce(h), n);
6274
+ return new gc(i, new Ie(h), n);
6229
6275
  });
6230
6276
  }
6231
6277
  };
@@ -6235,7 +6281,7 @@ pi = new WeakMap(), Ba = new WeakMap(), Ua = new WeakMap(), Pa = new WeakMap(),
6235
6281
  try {
6236
6282
  for (var t = J(e), i, n, o; i = !(n = yield t.next()).done; i = !1) {
6237
6283
  const c = n.value;
6238
- if (c.objectStatus !== Ie.Normal)
6284
+ if (c.objectStatus !== Ce.Normal)
6239
6285
  continue;
6240
6286
  const h = Yu(c);
6241
6287
  a(this, pi).update(h);
@@ -6254,7 +6300,7 @@ pi = new WeakMap(), Ba = new WeakMap(), Ua = new WeakMap(), Pa = new WeakMap(),
6254
6300
  };
6255
6301
  let Dh = gc;
6256
6302
  var Ma, Pn, xa, Mn, La, Oh;
6257
- class UA {
6303
+ class MA {
6258
6304
  constructor(e, t, i, n) {
6259
6305
  d(this, La);
6260
6306
  d(this, Ma);
@@ -6271,7 +6317,7 @@ class UA {
6271
6317
  try {
6272
6318
  for (var t = J(a(this, Pn)), i, n, o; i = !(n = yield new X(t.next())).done; i = !1) {
6273
6319
  const c = n.value;
6274
- if (c.objectStatus === Ie.EndOfTrackAndGroup && (yield new X(this.track.endOfTrack(c.groupId))), c.objectStatus !== Ie.Normal)
6320
+ if (c.objectStatus === Ce.EndOfTrackAndGroup && (yield new X(this.track.endOfTrack(c.groupId))), c.objectStatus !== Ce.Normal)
6275
6321
  continue;
6276
6322
  const h = a(this, xa).createFragment(c.payload), u = h.timescale(), l = h.baseMediaDecodeTime() / u * 1e3, p = h.duration() / u * 1e3, g = l + p, A = a(this, Ma) / 1e3 * u;
6277
6323
  h.updateBaseMediaDecodeTime(h.baseMediaDecodeTime() - A);
@@ -6339,14 +6385,14 @@ const Ws = class Ws {
6339
6385
  n && l.startGroup(n);
6340
6386
  const p = l.build();
6341
6387
  if (t.initTrack) {
6342
- const k = new Jt().name(t.initTrack).build(), [I, x] = yield Promise.all([
6388
+ const k = new Jt().name(t.initTrack).build(), [C, x] = yield Promise.all([
6343
6389
  w(v = Ws, Ac, Xl).call(v, e, k),
6344
6390
  Ri.subscribe(e, p, { params: o, largestGroupId: n ? n - P(1) : void 0 })
6345
- ]), T = new Hu(I);
6391
+ ]), T = new zu(C);
6346
6392
  return new Ws(t, e.namespace(), x, T, i);
6347
6393
  }
6348
6394
  Je(t.initData, "no init data found on track");
6349
- const g = Ld(t.initData), A = new Hu(new Uint8Array(g)), b = yield Ri.subscribe(e, p, {
6395
+ const g = Ld(t.initData), A = new zu(new Uint8Array(g)), b = yield Ri.subscribe(e, p, {
6350
6396
  params: o,
6351
6397
  largestGroupId: n ? n - P(1) : void 0
6352
6398
  });
@@ -6378,7 +6424,7 @@ const Ws = class Ws {
6378
6424
  const e = yield a(this, kt).next();
6379
6425
  return e.done ? e : {
6380
6426
  done: !1,
6381
- value: new UA(e.value, a(this, Da), a(this, Oa), this)
6427
+ value: new MA(e.value, a(this, Da), a(this, Oa), this)
6382
6428
  };
6383
6429
  });
6384
6430
  }
@@ -6412,19 +6458,19 @@ Da = new WeakMap(), kt = new WeakMap(), Oa = new WeakMap(), Fa = new WeakMap(),
6412
6458
  } catch (c) {
6413
6459
  var h = c, u = !0;
6414
6460
  } finally {
6415
- var l = ze(o, h, u);
6461
+ var l = He(o, h, u);
6416
6462
  l && (yield l);
6417
6463
  }
6418
6464
  });
6419
6465
  }, d(Ws, Ac);
6420
6466
  let Fh = Ws;
6421
- const Ku = 1e4, PA = 3e4;
6467
+ const Ku = 1e4, xA = 3e4;
6422
6468
  var wc, gi, hs, _a, Na, Va, Rs, Nh, ql;
6423
6469
  const vu = class vu {
6424
6470
  constructor(e, t, i) {
6425
6471
  d(this, Rs);
6426
6472
  d(this, wc, we.get().createContext("Timeline"));
6427
- d(this, gi, new Ce([]));
6473
+ d(this, gi, new Ie([]));
6428
6474
  d(this, hs);
6429
6475
  d(this, _a);
6430
6476
  d(this, Na);
@@ -6474,7 +6520,7 @@ wc = new WeakMap(), gi = new WeakMap(), hs = new WeakMap(), _a = new WeakMap(),
6474
6520
  return f(this, null, function* () {
6475
6521
  const t = yield e.promise;
6476
6522
  try {
6477
- for (var b = J(t), v, k, I; v = !(k = yield b.next()).done; v = !1) {
6523
+ for (var b = J(t), v, k, C; v = !(k = yield b.next()).done; v = !1) {
6478
6524
  var h = k.value;
6479
6525
  var u = [];
6480
6526
  try {
@@ -6482,12 +6528,12 @@ wc = new WeakMap(), gi = new WeakMap(), hs = new WeakMap(), _a = new WeakMap(),
6482
6528
  try {
6483
6529
  for (var i = J(x), n, o, c; n = !(o = yield i.next()).done; n = !1) {
6484
6530
  const T = o.value;
6485
- if (T.objectStatus !== Ie.Normal)
6531
+ if (T.objectStatus !== Ce.Normal)
6486
6532
  continue;
6487
- const U = MA(T.payload);
6533
+ const U = LA(T.payload);
6488
6534
  a(this, gi).update((B) => {
6489
- var Q, H;
6490
- for (B.push(...U), B.sort((Ve, ie) => Ve.wallclock - ie.wallclock); B[0] && ((H = (Q = B[B.length - 1]) == null ? void 0 : Q.wallclock) != null ? H : 0) - B[0].wallclock > PA; )
6535
+ var Q, z;
6536
+ for (B.push(...U), B.sort((Ve, ie) => Ve.wallclock - ie.wallclock); B[0] && ((z = (Q = B[B.length - 1]) == null ? void 0 : Q.wallclock) != null ? z : 0) - B[0].wallclock > xA; )
6491
6537
  B.shift();
6492
6538
  return B;
6493
6539
  }), t === a(this, hs).resolved && T.groupId > P(0) && T.objectId == P(0) && w(this, Rs, ql).call(this, T.groupId).catch((B) => {
@@ -6507,18 +6553,18 @@ wc = new WeakMap(), gi = new WeakMap(), hs = new WeakMap(), _a = new WeakMap(),
6507
6553
  } catch (l) {
6508
6554
  var p = l, g = !0;
6509
6555
  } finally {
6510
- var A = ze(u, p, g);
6556
+ var A = He(u, p, g);
6511
6557
  A && (yield A);
6512
6558
  }
6513
6559
  }
6514
6560
  } catch (k) {
6515
- I = [k];
6561
+ C = [k];
6516
6562
  } finally {
6517
6563
  try {
6518
6564
  v && (k = b.return) && (yield k.call(b));
6519
6565
  } finally {
6520
- if (I)
6521
- throw I[0];
6566
+ if (C)
6567
+ throw C[0];
6522
6568
  }
6523
6569
  }
6524
6570
  });
@@ -6537,7 +6583,7 @@ wc = new WeakMap(), gi = new WeakMap(), hs = new WeakMap(), _a = new WeakMap(),
6537
6583
  });
6538
6584
  };
6539
6585
  let _h = vu;
6540
- function MA(s) {
6586
+ function LA(s) {
6541
6587
  var t;
6542
6588
  const e = new TextDecoder("utf-8").decode(s).split(`
6543
6589
  `);
@@ -6554,7 +6600,7 @@ function MA(s) {
6554
6600
  };
6555
6601
  });
6556
6602
  }
6557
- function xA(s) {
6603
+ function DA(s) {
6558
6604
  return typeof s.language == "string";
6559
6605
  }
6560
6606
  var bc, Ga, Ai, xn;
@@ -6570,7 +6616,7 @@ const Tu = class Tu {
6570
6616
  }
6571
6617
  static subscribe(e, t, i) {
6572
6618
  return f(this, null, function* () {
6573
- if (!xA(t))
6619
+ if (!DA(t))
6574
6620
  throw new Error("track object language is required");
6575
6621
  const n = new Jt().name(t.name).build(), o = yield Ri.subscribe(e, n), c = o.objects();
6576
6622
  return new Tu(o, c, t, e.namespace(), i);
@@ -6591,7 +6637,7 @@ const Tu = class Tu {
6591
6637
  const e = yield a(this, Ga).next();
6592
6638
  if (e.done)
6593
6639
  return e;
6594
- if (e.value.objectStatus !== Ie.Normal)
6640
+ if (e.value.objectStatus !== Ce.Normal)
6595
6641
  continue;
6596
6642
  const t = new TextDecoder().decode(e.value.payload), i = a(this, bc).parse(t).map((o) => (o.startTime -= a(this, xn) / 1e3, o.endTime -= a(this, xn) / 1e3, o));
6597
6643
  return {
@@ -6618,9 +6664,9 @@ const Tu = class Tu {
6618
6664
  };
6619
6665
  bc = new WeakMap(), Ga = new WeakMap(), Ai = new WeakMap(), xn = new WeakMap();
6620
6666
  let Vh = Tu;
6621
- var Id, us, ds, ls, wi, mh, Ln, fo;
6622
- Id = [xe({ context: "Channel", enter: "info" })];
6623
- const zs = class zs {
6667
+ var Cd, us, ds, ls, wi, mh, Ln, fo;
6668
+ Cd = [xe({ context: "Channel", enter: "info" })];
6669
+ const Hs = class Hs {
6624
6670
  constructor(e, t, i, n, o) {
6625
6671
  d(this, Ln);
6626
6672
  r(this, "namespace");
@@ -6632,11 +6678,11 @@ const zs = class zs {
6632
6678
  }
6633
6679
  static start(e, t) {
6634
6680
  return f(this, null, function* () {
6635
- const i = new Hl(e, { namespace: t.namespace }), [n, o] = yield Promise.all([
6681
+ const i = new zl(e, { namespace: t.namespace }), [n, o] = yield Promise.all([
6636
6682
  _h.start(i, "timeline"),
6637
6683
  Dh.start(i, { catalog: t.catalog, namespace: t.namespace })
6638
6684
  ]);
6639
- return new zs(i, n, o, t.namespace, 0);
6685
+ return new Hs(i, n, o, t.namespace, 0);
6640
6686
  });
6641
6687
  }
6642
6688
  closed() {
@@ -6684,19 +6730,19 @@ mh = Bi(null), us = new WeakMap(), ds = new WeakMap(), ls = new WeakMap(), wi =
6684
6730
  try {
6685
6731
  return yield e();
6686
6732
  } catch (n) {
6687
- if (t === this.catalog().current() && i && (yield Promise.race([i, Ci(500)])), t !== this.catalog().current())
6733
+ if (t === this.catalog().current() && i && (yield Promise.race([i, Ii(500)])), t !== this.catalog().current())
6688
6734
  return e();
6689
6735
  throw n;
6690
6736
  }
6691
6737
  });
6692
- }, ve(mh, 9, "start", Id, zs), $t(mh, zs), Ui(mh, 3, zs);
6693
- let jo = zs;
6694
- const LA = P(8);
6695
- function DA(s) {
6738
+ }, ve(mh, 9, "start", Cd, Hs), $t(mh, Hs), Ui(mh, 3, Hs);
6739
+ let jo = Hs;
6740
+ const OA = P(8);
6741
+ function FA(s) {
6696
6742
  if (s < 0 || s > 65535)
6697
6743
  throw new RangeError("burstMs must be between 0 and 65535 inclusive");
6698
6744
  const e = new Uint8Array([s >> 8 & 255, s & 255]);
6699
- return { type: LA, payload: e };
6745
+ return { type: OA, payload: e };
6700
6746
  }
6701
6747
  var ms, ja, yc, Zl;
6702
6748
  const Eu = class Eu {
@@ -6752,23 +6798,23 @@ let Gh = Eu;
6752
6798
  function ro(s) {
6753
6799
  return typeof s == "string" || s === null || s === void 0;
6754
6800
  }
6755
- function OA(s) {
6801
+ function _A(s) {
6756
6802
  return "provider" in s && typeof s.provider == "string" && (!("widevineLicenseUrl" in s) || ro(s.widevineLicenseUrl)) && (!("playreadyLicenseUrl" in s) || ro(s.playreadyLicenseUrl)) && (!("fairplayLicenseUrl" in s) || ro(s.fairplayLicenseUrl)) && (!("fairplayCertificate" in s) || ro(s.fairplayCertificate));
6757
6803
  }
6758
- function FA(s) {
6804
+ function NA(s) {
6759
6805
  try {
6760
6806
  return Ld(s);
6761
6807
  } catch (e) {
6762
6808
  throw new Error("Failed to convert fairplayCertificate");
6763
6809
  }
6764
6810
  }
6765
- function _A(s) {
6811
+ function VA(s) {
6766
6812
  const e = new TextDecoder().decode(s), t = JSON.parse(e);
6767
- if (!OA(t))
6813
+ if (!_A(t))
6768
6814
  throw new Error("Invalid drm object");
6769
6815
  const o = t, { fairplayCertificate: i } = o, n = Uu(o, ["fairplayCertificate"]);
6770
6816
  return _(S({}, n), {
6771
- fairplayCertificate: i ? FA(i) : void 0
6817
+ fairplayCertificate: i ? NA(i) : void 0
6772
6818
  });
6773
6819
  }
6774
6820
  class gu {
@@ -6785,27 +6831,27 @@ class gu {
6785
6831
  const c = yield o.next();
6786
6832
  if (c.done)
6787
6833
  throw new Error("No drm object received");
6788
- const h = _A(c.value.payload);
6834
+ const h = VA(c.value.payload);
6789
6835
  return new gu(_(S({}, h), { videoCodec: t, audioCodec: i }));
6790
6836
  } catch (l) {
6791
6837
  var p = l, g = !0;
6792
6838
  } finally {
6793
- var A = ze(u, p, g);
6839
+ var A = He(u, p, g);
6794
6840
  A && (yield A);
6795
6841
  }
6796
6842
  });
6797
6843
  }
6798
6844
  }
6799
- function NA(s) {
6845
+ function GA(s) {
6800
6846
  return "rtt" in s && typeof s.rtt == "number" && "ntpTimestamp" in s && typeof s.ntpTimestamp == "number" && "estimatedBandwidth" in s && typeof s.estimatedBandwidth == "number";
6801
6847
  }
6802
6848
  function ed(s) {
6803
6849
  const e = new TextDecoder().decode(s), t = JSON.parse(e);
6804
- if (!NA(t))
6850
+ if (!GA(t))
6805
6851
  throw new Error("Invalid stats object");
6806
6852
  return t;
6807
6853
  }
6808
- const VA = 1e4;
6854
+ const jA = 1e4;
6809
6855
  var Wa, Sc, Jl;
6810
6856
  const ku = class ku {
6811
6857
  constructor(e, t, i) {
@@ -6813,7 +6859,7 @@ const ku = class ku {
6813
6859
  r(this, "ip");
6814
6860
  r(this, "value");
6815
6861
  d(this, Wa);
6816
- this.ip = i, this.value = new Ce(t), m(this, Wa, w(this, Sc, Jl).call(this, e));
6862
+ this.ip = i, this.value = new Ie(t), m(this, Wa, w(this, Sc, Jl).call(this, e));
6817
6863
  }
6818
6864
  closed() {
6819
6865
  return a(this, Wa);
@@ -6823,7 +6869,7 @@ const ku = class ku {
6823
6869
  for (; ; ) {
6824
6870
  const [e, t] = this.value.value();
6825
6871
  try {
6826
- yield Promise.race([mu(VA, new Error("Idle timeout")), t]);
6872
+ yield Promise.race([mu(jA, new Error("Idle timeout")), t]);
6827
6873
  } catch (i) {
6828
6874
  return i;
6829
6875
  }
@@ -6847,7 +6893,7 @@ Wa = new WeakMap(), Sc = new WeakSet(), Jl = function(e) {
6847
6893
  try {
6848
6894
  for (var t = J(e), i, n, o; i = !(n = yield t.next()).done; i = !1) {
6849
6895
  const c = n.value;
6850
- if (c.objectStatus !== Ie.Normal)
6896
+ if (c.objectStatus !== Ce.Normal)
6851
6897
  continue;
6852
6898
  const h = ed(c.payload);
6853
6899
  this.value.update(h);
@@ -6866,11 +6912,11 @@ Wa = new WeakMap(), Sc = new WeakSet(), Jl = function(e) {
6866
6912
  };
6867
6913
  let jh = ku;
6868
6914
  var vc, Dn;
6869
- class GA {
6915
+ class WA {
6870
6916
  constructor(e) {
6871
6917
  d(this, vc, we.get().createContext("UpstreamWatcher"));
6872
6918
  d(this, Dn);
6873
- m(this, Dn, new Ce(W.fromPromise(e.closed())));
6919
+ m(this, Dn, new Ie(W.fromPromise(e.closed())));
6874
6920
  }
6875
6921
  update(e) {
6876
6922
  a(this, Dn).update(W.fromPromise(e.closed()));
@@ -6896,19 +6942,19 @@ class GA {
6896
6942
  }
6897
6943
  }
6898
6944
  vc = new WeakMap(), Dn = new WeakMap();
6899
- var On, za, Ha;
6945
+ var On, Ha, za;
6900
6946
  class ah {
6901
6947
  constructor(e, t) {
6902
6948
  d(this, On, we.get().createContext("TracksIterator"));
6903
- d(this, za);
6904
6949
  d(this, Ha);
6905
- m(this, za, e), m(this, Ha, t);
6950
+ d(this, za);
6951
+ m(this, Ha, e), m(this, za, t);
6906
6952
  }
6907
6953
  [Symbol.asyncIterator]() {
6908
6954
  return xt(this, null, function* () {
6909
- const e = a(this, Ha);
6955
+ const e = a(this, za);
6910
6956
  try {
6911
- for (var t = J(a(this, za)), i, n, o; i = !(n = yield new X(t.next())).done; i = !1) {
6957
+ for (var t = J(a(this, Ha)), i, n, o; i = !(n = yield new X(t.next())).done; i = !1) {
6912
6958
  const c = n.value;
6913
6959
  if (!c)
6914
6960
  continue;
@@ -6932,10 +6978,10 @@ class ah {
6932
6978
  });
6933
6979
  }
6934
6980
  }
6935
- On = new WeakMap(), za = new WeakMap(), Ha = new WeakMap();
6936
- var Cd, Rd, Bd, Fn, _n, fs, ge, ut, dt, bi, Nn, Qa, nr, Re, po, hr, $l, zh;
6937
- Bd = [xe({ context: "Player", enter: "info" })], Rd = [xe({ context: "Player", enter: "info", return: "info" })], Cd = [xe({ context: "Player", enter: "info" })];
6938
- const Hs = class Hs {
6981
+ On = new WeakMap(), Ha = new WeakMap(), za = new WeakMap();
6982
+ var Id, Rd, Bd, Fn, _n, fs, ge, ut, dt, bi, Nn, Qa, nr, Re, po, hr, $l, Hh;
6983
+ Bd = [xe({ context: "Player", enter: "info" })], Rd = [xe({ context: "Player", enter: "info", return: "info" })], Id = [xe({ context: "Player", enter: "info" })];
6984
+ const zs = class zs {
6939
6985
  constructor(e, t, i) {
6940
6986
  Ui(nr, 5, this);
6941
6987
  d(this, Re);
@@ -6943,15 +6989,15 @@ const Hs = class Hs {
6943
6989
  d(this, _n);
6944
6990
  d(this, fs);
6945
6991
  d(this, ge);
6946
- d(this, ut, new Ce(void 0));
6947
- d(this, dt, new Ce(void 0));
6948
- d(this, bi, new Ce(void 0));
6992
+ d(this, ut, new Ie(void 0));
6993
+ d(this, dt, new Ie(void 0));
6994
+ d(this, bi, new Ie(void 0));
6949
6995
  d(this, Nn);
6950
6996
  d(this, Qa);
6951
6997
  r(this, "subtitles", new ah(a(this, bi), "subtitles"));
6952
6998
  r(this, "video", new ah(a(this, dt), "video"));
6953
6999
  r(this, "audio", new ah(a(this, ut), "audio"));
6954
- m(this, Fn, e), m(this, _n, Gh.start(i)), m(this, fs, i), m(this, ge, new Ce(t)), m(this, Nn, new GA(t)), m(this, Qa, Promise.race([i.idleTimeout(), w(this, Re, $l).call(this), a(this, Nn).closed()])), a(this, Fn).closed().then(() => this.close()).catch(D);
7000
+ m(this, Fn, e), m(this, _n, Gh.start(i)), m(this, fs, i), m(this, ge, new Ie(t)), m(this, Nn, new WA(t)), m(this, Qa, Promise.race([i.idleTimeout(), w(this, Re, $l).call(this), a(this, Nn).closed()])), a(this, Fn).closed().then(() => this.close()).catch(D);
6955
7001
  }
6956
7002
  closed() {
6957
7003
  return a(this, Qa);
@@ -6960,17 +7006,17 @@ const Hs = class Hs {
6960
7006
  return f(this, null, function* () {
6961
7007
  const i = /* @__PURE__ */ new Map();
6962
7008
  if (t.burstMs !== void 0) {
6963
- const p = DA(t.burstMs);
7009
+ const p = FA(t.burstMs);
6964
7010
  i.set(p.type, p);
6965
7011
  }
6966
- const n = new Hl(e, { namespace: IA("auxiliary") }), [[o, c, h], u] = yield Promise.all([
7012
+ const n = new zl(e, { namespace: RA("auxiliary") }), [[o, c, h], u] = yield Promise.all([
6967
7013
  jo.start(e, t).then((p) => Promise.all([
6968
7014
  Promise.resolve(p),
6969
7015
  t.videoTrack ? p.subscribeCmafTrack(t.videoTrack, { params: i }) : void 0,
6970
7016
  t.audioTrack ? p.subscribeCmafTrack(t.audioTrack, { params: i }) : void 0
6971
7017
  ])),
6972
7018
  jh.start(n)
6973
- ]), l = new Hs(e, o, u);
7019
+ ]), l = new zs(e, o, u);
6974
7020
  return h && a(l, ut).update(h), c && a(l, dt).update(c), l;
6975
7021
  });
6976
7022
  }
@@ -7026,7 +7072,7 @@ const Hs = class Hs {
7026
7072
  var v, k;
7027
7073
  const i = yield jo.start(a(this, Fn), e), n = a(this, _n).wallclock() - t, o = a(this, ge).current(), c = o.timestampWallclockOffset(), h = yield i.waitForWallclockTime(n);
7028
7074
  a(this, Nn).update(i), yield a(this, ge).current().close();
7029
- const u = h.toReversed().find((I) => I.wallclock <= n), l = u != null && u.mediaPts ? u.mediaPts - o.timestampOffsetMs() : void 0, A = i.timestampWallclockOffset() - c + o.timestampOffsetMs();
7075
+ const u = h.toReversed().find((C) => C.wallclock <= n), l = u != null && u.mediaPts ? u.mediaPts - o.timestampOffsetMs() : void 0, A = i.timestampWallclockOffset() - c + o.timestampOffsetMs();
7030
7076
  i.setTimestampOffsetMs(A);
7031
7077
  const b = u != null && u.groupId ? P(u.groupId) : void 0;
7032
7078
  l && ((v = a(this, dt).current()) == null || v.stopAfterTimestampReached(l), (k = a(this, ut).current()) == null || k.stopAfterTimestampReached(l)), a(this, ge).update(i), yield Promise.all([
@@ -7084,8 +7130,8 @@ nr = Bi(null), Fn = new WeakMap(), _n = new WeakMap(), fs = new WeakMap(), ge =
7084
7130
  for (var e = J(l.catalog()), t, i, n; t = !(i = yield e.next()).done; t = !1) {
7085
7131
  const p = i.value;
7086
7132
  yield Promise.all([
7087
- w(this, Re, zh).call(this, p, a(this, dt)),
7088
- w(this, Re, zh).call(this, p, a(this, ut))
7133
+ w(this, Re, Hh).call(this, p, a(this, dt)),
7134
+ w(this, Re, Hh).call(this, p, a(this, ut))
7089
7135
  ]);
7090
7136
  }
7091
7137
  } catch (i) {
@@ -7110,7 +7156,7 @@ nr = Bi(null), Fn = new WeakMap(), _n = new WeakMap(), fs = new WeakMap(), ge =
7110
7156
  }
7111
7157
  }
7112
7158
  });
7113
- }, zh = function(e, t) {
7159
+ }, Hh = function(e, t) {
7114
7160
  return f(this, null, function* () {
7115
7161
  const i = t.current();
7116
7162
  if (!i)
@@ -7124,15 +7170,15 @@ nr = Bi(null), Fn = new WeakMap(), _n = new WeakMap(), fs = new WeakMap(), ge =
7124
7170
  t.update(yield a(this, ge).current().subscribeCmafTrack(h));
7125
7171
  }
7126
7172
  });
7127
- }, ve(nr, 1, "close", Bd, Hs), ve(nr, 1, "zap", Rd, Hs), hr = ve(nr, 17, "#replaceTrack", Cd, Re, hr), $t(nr, Hs);
7128
- let Wh = Hs;
7173
+ }, ve(nr, 1, "close", Bd, zs), ve(nr, 1, "zap", Rd, zs), hr = ve(nr, 17, "#replaceTrack", Id, Re, hr), $t(nr, zs);
7174
+ let Wh = zs;
7129
7175
  function oh(s, e, t) {
7130
7176
  const i = new URL("/voq/subscribe", s);
7131
7177
  return i.searchParams.set("sessionId", e.sessionId), i.searchParams.set("clientId", e.clientId), i.searchParams.set("channelId", e.channelId), t && i.searchParams.set("authToken", t), i;
7132
7178
  }
7133
- const jA = 1e4;
7179
+ const HA = 1e4;
7134
7180
  var fe, Ee, _e, ps, K, yi, Xa, Vn, qa, Gn, Be, Yl, jn, Za, Wn, Kl, em, tm, im, Qh;
7135
- const Iu = class Iu {
7181
+ const Cu = class Cu {
7136
7182
  constructor(e, t, i, n, o, c, h) {
7137
7183
  d(this, Be);
7138
7184
  d(this, fe);
@@ -7208,21 +7254,21 @@ const Iu = class Iu {
7208
7254
  return f(this, null, function* () {
7209
7255
  var T, U, B, Q;
7210
7256
  const c = new Map(
7211
- n.connectInfo.channels.map((H) => [
7212
- Pi(H.catalog.namespace),
7213
- new ch(new Ce(H.catalog))
7257
+ n.connectInfo.channels.map((z) => [
7258
+ Pi(z.catalog.namespace),
7259
+ new ch(new Ie(z.catalog))
7214
7260
  ])
7215
7261
  ), h = yield n.onConnectInfo(n.connectInfo), u = n.options.get("authenticationToken");
7216
7262
  let l, p;
7217
7263
  typeof n.edgeUrl === "string" ? l = oh(n.edgeUrl, h, u) : (l = oh(n.edgeUrl.moqUrl || n.edgeUrl.moqWsUrl, h, u), p = oh(n.edgeUrl.moqWsUrl, h, u));
7218
- const g = (T = n.connectInfo.channels.find((H) => H.channelId === h.channelId)) == null ? void 0 : T.catalog;
7264
+ const g = (T = n.connectInfo.channels.find((z) => z.channelId === h.channelId)) == null ? void 0 : T.catalog;
7219
7265
  t.debug("Resolved edge url", { edgeUrl: l, edgeWsUrl: p }), Je(g, "no catalog found");
7220
- const A = (U = c.get(Pi(g.namespace))) == null ? void 0 : U.getVideoTrack(h.video), b = (B = c.get(Pi(g.namespace))) == null ? void 0 : B.getAudioTrack(h.audio), v = yield kA({
7266
+ const A = (U = c.get(Pi(g.namespace))) == null ? void 0 : U.getVideoTrack(h.video), b = (B = c.get(Pi(g.namespace))) == null ? void 0 : B.getAudioTrack(h.audio), v = yield IA({
7221
7267
  url: l,
7222
7268
  wsUrl: p,
7223
7269
  authToken: n.options.get("authenticationToken"),
7224
7270
  preferredTransport: n.options.get("webtransportEnabled") ? "webtransport" : "websocket",
7225
- role: Kg.Subscriber,
7271
+ role: tA.Subscriber,
7226
7272
  websocketFallbackTimeoutMs: 2e3
7227
7273
  }), k = yield Promise.race([
7228
7274
  Wh.start(v.subscriber, {
@@ -7232,18 +7278,18 @@ const Iu = class Iu {
7232
7278
  audioTrack: b == null ? void 0 : b.track,
7233
7279
  burstMs: h.burstMs || 0
7234
7280
  }),
7235
- mu(jA, new Error("Timeout waiting for player to start")),
7236
- zm(v.closed(), "Session closed before player started")
7237
- ]), I = new ch(k.catalog());
7238
- c.set(Pi(g.namespace), I), e.emit("received signal", {
7281
+ mu(HA, new Error("Timeout waiting for player to start")),
7282
+ Qm(v.closed(), "Session closed before player started")
7283
+ ]), C = new ch(k.catalog());
7284
+ c.set(Pi(g.namespace), C), e.emit("received signal", {
7239
7285
  type: "client ip",
7240
7286
  ip: k.connectionInfo().ip
7241
- }), k.drm().then((H) => {
7242
- H && e.emit("received drm data", H.value);
7243
- }).catch((H) => {
7244
- t.error("Error getting DRM data", H);
7287
+ }), k.drm().then((z) => {
7288
+ z && e.emit("received drm data", z.value);
7289
+ }).catch((z) => {
7290
+ t.error("Error getting DRM data", z);
7245
7291
  });
7246
- const x = new Iu(e, t, v, k, c, i, o);
7292
+ const x = new Cu(e, t, v, k, c, i, o);
7247
7293
  return h.textTrack && a(Q = x, jn).call(Q, h.textTrack), x;
7248
7294
  });
7249
7295
  }
@@ -7259,7 +7305,7 @@ const Iu = class Iu {
7259
7305
  };
7260
7306
  fe = new WeakMap(), Ee = new WeakMap(), _e = new WeakMap(), ps = new WeakMap(), K = new WeakMap(), yi = new WeakMap(), Xa = new WeakMap(), Vn = new WeakMap(), qa = new WeakMap(), Gn = new WeakMap(), Be = new WeakSet(), Yl = function() {
7261
7307
  return f(this, null, function* () {
7262
- a(this, _e).transportType() === "websocket" && (yield Ci(5e3));
7308
+ a(this, _e).transportType() === "websocket" && (yield Ii(5e3));
7263
7309
  try {
7264
7310
  for (var e = J(a(this, K).stats()), t, i, n; t = !(i = yield e.next()).done; t = !1) {
7265
7311
  const { rtt: o, estimatedBandwidth: c } = i.value;
@@ -7293,7 +7339,7 @@ fe = new WeakMap(), Ee = new WeakMap(), _e = new WeakMap(), ps = new WeakMap(),
7293
7339
  a(this, Ee).info("handle subscription", e);
7294
7340
  const t = a(this, K);
7295
7341
  let i = a(this, yi).get(e.channelId);
7296
- if (i || (i = new ch(new Ce(yield w(this, Be, Kl).call(this, e.channelId))), a(this, yi).set(e.channelId, i)), t.namespace().join("/") !== i.namespace().join("/")) {
7342
+ if (i || (i = new ch(new Ie(yield w(this, Be, Kl).call(this, e.channelId))), a(this, yi).set(e.channelId, i)), t.namespace().join("/") !== i.namespace().join("/")) {
7297
7343
  a(this, Ee).info("changing channel", e.channelId);
7298
7344
  const l = i.getVideoTrack(e.video), p = i.getAudioTrack(e.audio);
7299
7345
  yield t.zap(
@@ -7360,20 +7406,20 @@ fe = new WeakMap(), Ee = new WeakMap(), _e = new WeakMap(), ps = new WeakMap(),
7360
7406
  const c = a(this, K).videoTrack() === void 0;
7361
7407
  try {
7362
7408
  for (var A = J(t), b, v, k; b = !(v = yield A.next()).done; b = !1) {
7363
- const I = v.value;
7364
- const x = Pi(I.track.namespace), T = I.track.trackObject.language, U = vm((h = I.track.trackObject.codec) != null ? h : ""), B = I.track.trackObject.codec, Q = U ? ii({ codec: U, codecString: B }) : void 0, H = !!I.track.trackObject["com.vindral.drm"];
7409
+ const C = v.value;
7410
+ const x = Pi(C.track.namespace), T = C.track.trackObject.language, U = vm((h = C.track.trackObject.codec) != null ? h : ""), B = C.track.trackObject.codec, Q = U ? ii({ codec: U, codecString: B }) : void 0, z = !!C.track.trackObject["com.vindral.drm"];
7365
7411
  try {
7366
- for (var u = J(I), l, p, g; l = !(p = yield u.next()).done; l = !1) {
7412
+ for (var u = J(C), l, p, g; l = !(p = yield u.next()).done; l = !1) {
7367
7413
  const [Ve, ie] = p.value;
7368
7414
  const mt = {
7369
7415
  channelId: i !== "" && (c || ie.mediaType() === "video") && i !== x ? x : void 0,
7370
7416
  language: ie.mediaType() === "audio" && n !== T ? T : void 0,
7371
- drmTransition: o !== void 0 && o !== H
7417
+ drmTransition: o !== void 0 && o !== z
7372
7418
  };
7373
- i = x, n = T, o = H;
7374
- const Ue = ie.producerReferenceTime(), y = a(this, Gn).get(I.track.namespace) || 0;
7419
+ i = x, n = T, o = z;
7420
+ const Ue = ie.producerReferenceTime(), y = a(this, Gn).get(C.track.namespace) || 0;
7375
7421
  if (Ue && Date.now() - y > 1e3) {
7376
- a(this, Gn).set(I.track.namespace, Date.now());
7422
+ a(this, Gn).set(C.track.namespace, Date.now());
7377
7423
  const E = e.wallclock() - Ue.getTime();
7378
7424
  a(this, Ee).debug("timing-info", {
7379
7425
  mediaType: ie.mediaType(),
@@ -7399,7 +7445,7 @@ fe = new WeakMap(), Ee = new WeakMap(), _e = new WeakMap(), ps = new WeakMap(),
7399
7445
  codec: U,
7400
7446
  switchInfo: mt,
7401
7447
  // FIXME: We should replace this with something better than hashing the track name
7402
- renditionId: WA(I.track.trackObject.name)
7448
+ renditionId: zA(C.track.trackObject.name)
7403
7449
  });
7404
7450
  }
7405
7451
  } catch (p) {
@@ -7425,8 +7471,8 @@ fe = new WeakMap(), Ee = new WeakMap(), _e = new WeakMap(), ps = new WeakMap(),
7425
7471
  }
7426
7472
  });
7427
7473
  };
7428
- let Hh = Iu;
7429
- function WA(s) {
7474
+ let zh = Cu;
7475
+ function zA(s) {
7430
7476
  return s.split("").reduce(
7431
7477
  (t, i) => t = i.charCodeAt(0) + (t << 6) + (t << 16) - t,
7432
7478
  0
@@ -7472,11 +7518,11 @@ qt = new WeakMap(), gs = new WeakMap(), Tc = new WeakSet(), sm = function() {
7472
7518
  const [e, t] = a(this, qt).value();
7473
7519
  return Tm(e);
7474
7520
  };
7475
- const zA = (s, e) => {
7521
+ const QA = (s, e) => {
7476
7522
  const t = new URL("/subscribe", s);
7477
7523
  return t.searchParams.append("channelId", e.channelId), t.searchParams.append("sessionId", e.sessionId), t.searchParams.append("clientId", e.clientId), e.audio && e.audio.codec && (t.searchParams.append("audio.bitRate", Math.round(e.audio.bitRate).toString()), t.searchParams.append("audio.codec", e.audio.codec), e.audio.language && t.searchParams.append("audio.language", e.audio.language)), e.video && e.video.codec && (t.searchParams.append("video.width", e.video.width.toString()), t.searchParams.append("video.height", e.video.height.toString()), t.searchParams.append("video.bitRate", Math.round(e.video.bitRate).toString()), t.searchParams.append("video.codec", e.video.codec)), e.expectAdditionalConnection && t.searchParams.append("expectAdditionalConnection", e.expectAdditionalConnection.toString()), e.burstMs && t.searchParams.append("burstMs", e.burstMs.toString()), e.channelGroupId && t.searchParams.append("channelGroupId", e.channelGroupId), e.authToken && (t.searchParams.append("auth.token", e.authToken), t.searchParams.append("auth.type", "jwt")), t.toString();
7478
7524
  };
7479
- class HA extends Ii {
7525
+ class XA extends Ci {
7480
7526
  constructor(t, i) {
7481
7527
  super();
7482
7528
  r(this, "options");
@@ -7540,13 +7586,13 @@ class HA extends Ii {
7540
7586
  this.emit("error", Ao(ir()));
7541
7587
  break;
7542
7588
  case 4002:
7543
- this.emit("error", pf(ir()));
7589
+ this.emit("error", Af(ir()));
7544
7590
  break;
7545
7591
  case 4003:
7546
7592
  this.emit("error", Gd("internal", ir()));
7547
7593
  break;
7548
7594
  case 4010:
7549
- this.emit("error", gf("internal", ir()));
7595
+ this.emit("error", wf("internal", ir()));
7550
7596
  break;
7551
7597
  }
7552
7598
  this.emit("close", this);
@@ -7564,7 +7610,7 @@ class HA extends Ii {
7564
7610
  if (this.isSuspended)
7565
7611
  return !1;
7566
7612
  if (this.readyState() !== WebSocket.CLOSED && this.close("new connection in progress"), this.shouldContinueConnecting = !0, this._isConnectInProgress = !0, t && this.options.reconnectDelay > 0) {
7567
- this.logger.info("Waiting for reconnect delay", S({}, this.options)), yield Ci(this.options.reconnectDelay);
7613
+ this.logger.info("Waiting for reconnect delay", S({}, this.options)), yield Ii(this.options.reconnectDelay);
7568
7614
  const i = yield this.options.reconnectHandler(this.reconnectState);
7569
7615
  if (this.reconnectState.reconnectRetries++, !i)
7570
7616
  return this._isConnectInProgress = !1, this.emit("error", jd()), !1;
@@ -7609,9 +7655,9 @@ class HA extends Ii {
7609
7655
  return this._connectTime;
7610
7656
  }
7611
7657
  }
7612
- const QA = 65536 * 8, XA = 0.9, qA = 40, ZA = (s) => {
7613
- const e = s || qA;
7614
- return QA * XA * 1e3 / e;
7658
+ const qA = 65536 * 8, ZA = 0.9, JA = 40, $A = (s) => {
7659
+ const e = s || JA;
7660
+ return qA * ZA * 1e3 / e;
7615
7661
  }, gt = class gt {
7616
7662
  constructor(e, t, i, n) {
7617
7663
  r(this, "emitter");
@@ -7687,7 +7733,7 @@ const QA = 65536 * 8, XA = 0.9, qA = 40, ZA = (s) => {
7687
7733
  ), n = this.config.options.get("media") === "audio+video";
7688
7734
  let o = 1;
7689
7735
  n && (o = i !== !1 ? 2 : 1);
7690
- const c = zA(this.config.edgeUrl, {
7736
+ const c = QA(this.config.edgeUrl, {
7691
7737
  video: t.video,
7692
7738
  audio: t.audio,
7693
7739
  burstMs: t.burstMs,
@@ -7721,7 +7767,7 @@ const QA = 65536 * 8, XA = 0.9, qA = 40, ZA = (s) => {
7721
7767
  }
7722
7768
  });
7723
7769
  r(this, "connectWebSocketTransport", () => {
7724
- const e = new HA(
7770
+ const e = new XA(
7725
7771
  {
7726
7772
  reconnectDelay: 1e3,
7727
7773
  onMessage: this.onMessage,
@@ -7773,13 +7819,13 @@ r(gt, "PING_INTERVAL", 5e3), r(gt, "MAX_MISSED_PINGS", 4), r(gt, "TLS_ROUNDTRIPS
7773
7819
  h.transport.once("error", (u) => c(u)), h.transport.once("open", () => o(h));
7774
7820
  }));
7775
7821
  let Xh = gt;
7776
- var zn, Si, Hn;
7777
- class JA {
7822
+ var Hn, Si, zn;
7823
+ class YA {
7778
7824
  constructor(e) {
7779
- d(this, zn);
7780
- d(this, Si, []);
7781
7825
  d(this, Hn);
7782
- m(this, zn, e);
7826
+ d(this, Si, []);
7827
+ d(this, zn);
7828
+ m(this, Hn, e);
7783
7829
  }
7784
7830
  /**
7785
7831
  * Select an edge url based on the provided list of edge urls, previous cached edges or the edgeUrl option
@@ -7792,11 +7838,11 @@ class JA {
7792
7838
  * @returns
7793
7839
  */
7794
7840
  select(e) {
7795
- if (a(this, zn).edgeUrl)
7796
- return a(this, zn).edgeUrl;
7841
+ if (a(this, Hn).edgeUrl)
7842
+ return a(this, Hn).edgeUrl;
7797
7843
  a(this, Si).length === 0 && m(this, Si, a(this, Si).concat(e));
7798
7844
  const t = a(this, Si).shift();
7799
- if (m(this, Hn, t), t)
7845
+ if (m(this, zn, t), t)
7800
7846
  return t;
7801
7847
  }
7802
7848
  /**
@@ -7804,27 +7850,27 @@ class JA {
7804
7850
  * @returns
7805
7851
  */
7806
7852
  shiftedEdge() {
7807
- return a(this, Hn);
7853
+ return a(this, zn);
7808
7854
  }
7809
7855
  /**
7810
7856
  * Resets the cached list of edges
7811
7857
  */
7812
7858
  reset() {
7813
- m(this, Hn, void 0), m(this, Si, []);
7859
+ m(this, zn, void 0), m(this, Si, []);
7814
7860
  }
7815
7861
  }
7816
- zn = new WeakMap(), Si = new WeakMap(), Hn = new WeakMap();
7817
- var It, Ct, Qn, As, vi, ws, Xn, qn, Ec, kc, Ic, nm;
7862
+ Hn = new WeakMap(), Si = new WeakMap(), zn = new WeakMap();
7863
+ var Ct, It, Qn, As, vi, ws, Xn, qn, Ec, kc, Cc, nm;
7818
7864
  const Qs = class Qs {
7819
7865
  constructor(e, t, i) {
7820
- d(this, Ic);
7866
+ d(this, Cc);
7821
7867
  r(this, "emitter");
7822
7868
  r(this, "logger");
7823
7869
  r(this, "config");
7824
7870
  r(this, "apiClient");
7825
7871
  r(this, "connectionImpl");
7826
- d(this, It, new ee(10));
7827
- d(this, Ct, !0);
7872
+ d(this, Ct, new ee(10));
7873
+ d(this, It, !0);
7828
7874
  d(this, Qn);
7829
7875
  // used for tracking current connection attempt count for reconnects
7830
7876
  d(this, As, 0);
@@ -7839,17 +7885,17 @@ const Qs = class Qs {
7839
7885
  });
7840
7886
  r(this, "suspend", () => {
7841
7887
  var e;
7842
- m(this, Ct, !1), (e = this.connectionImpl) == null || e.suspend();
7888
+ m(this, It, !1), (e = this.connectionImpl) == null || e.suspend();
7843
7889
  });
7844
7890
  r(this, "unsuspend", () => {
7845
7891
  var e;
7846
- m(this, Ct, !0), (e = this.connectionImpl) == null || e.unsuspend(), this.connect();
7892
+ m(this, It, !0), (e = this.connectionImpl) == null || e.unsuspend(), this.connect();
7847
7893
  });
7848
7894
  r(this, "getState", () => this.connectionImpl ? this.connectionImpl.getState() : "disconnected");
7849
7895
  r(this, "getStatistics", () => {
7850
7896
  const e = a(this, vi) > 0 ? a(this, ws) / a(this, vi) : 0;
7851
7897
  return this.connectionImpl ? _(S({}, this.connectionImpl.getStatistics()), {
7852
- rtt: Zt(a(this, It).items()),
7898
+ rtt: Zt(a(this, Ct).items()),
7853
7899
  estimatedBandwidth: this.estimatedBandwidth,
7854
7900
  connectCount: a(this, ws),
7855
7901
  connectionAttemptCount: a(this, vi),
@@ -7864,11 +7910,11 @@ const Qs = class Qs {
7864
7910
  };
7865
7911
  });
7866
7912
  r(this, "connect", () => {
7867
- m(this, Ct, !0), !a(this, Qn) && m(this, Qn, w(this, Ic, nm).call(this));
7913
+ m(this, It, !0), !a(this, Qn) && m(this, Qn, w(this, Cc, nm).call(this));
7868
7914
  });
7869
7915
  r(this, "disconnect", (e = "Disconnect Requested") => {
7870
7916
  var t;
7871
- m(this, Ct, !1), (t = this.connectionImpl) == null || t.close(e);
7917
+ m(this, It, !1), (t = this.connectionImpl) == null || t.close(e);
7872
7918
  });
7873
7919
  r(this, "reconnect", (e) => {
7874
7920
  this.disconnect(e), this.connect();
@@ -7884,13 +7930,13 @@ const Qs = class Qs {
7884
7930
  case 403:
7885
7931
  throw this.emitter.emit("error", Nu(e.message)), Nu(e.message);
7886
7932
  }
7887
- throw this.emitter.emit("error", wf(e instanceof Error ? e : void 0)), e;
7933
+ throw this.emitter.emit("error", yf(e instanceof Error ? e : void 0)), e;
7888
7934
  }
7889
7935
  }));
7890
7936
  d(this, kc, () => f(this, null, function* () {
7891
7937
  const e = Date.now(), t = () => Date.now() - e;
7892
7938
  return Promise.race([
7893
- Ci(Qs.PING_TIMEOUT),
7939
+ Ii(Qs.PING_TIMEOUT),
7894
7940
  fetch(new URL("/api/v4/connect/ping", this.config.options.get("url")).toString(), {
7895
7941
  method: "HEAD"
7896
7942
  })
@@ -7902,10 +7948,10 @@ const Qs = class Qs {
7902
7948
  });
7903
7949
  }
7904
7950
  get rtt() {
7905
- return a(this, It).items().length > 0 ? lt(a(this, It).items()) : 0;
7951
+ return a(this, Ct).items().length > 0 ? lt(a(this, Ct).items()) : 0;
7906
7952
  }
7907
7953
  get estimatedBandwidth() {
7908
- return this.connectionImpl && "estimatedBandwidth" in this.connectionImpl && this.connectionImpl.estimatedBandwidth ? this.connectionImpl.estimatedBandwidth : ZA(this.rtt);
7954
+ return this.connectionImpl && "estimatedBandwidth" in this.connectionImpl && this.connectionImpl.estimatedBandwidth ? this.connectionImpl.estimatedBandwidth : $A(this.rtt);
7909
7955
  }
7910
7956
  /**
7911
7957
  * The timestamp when the first connection was made
@@ -7920,20 +7966,20 @@ const Qs = class Qs {
7920
7966
  return a(this, qn);
7921
7967
  }
7922
7968
  };
7923
- It = new WeakMap(), Ct = new WeakMap(), Qn = new WeakMap(), As = new WeakMap(), vi = new WeakMap(), ws = new WeakMap(), Xn = new WeakMap(), qn = new WeakMap(), Ec = new WeakMap(), kc = new WeakMap(), Ic = new WeakSet(), nm = function() {
7969
+ Ct = new WeakMap(), It = new WeakMap(), Qn = new WeakMap(), As = new WeakMap(), vi = new WeakMap(), ws = new WeakMap(), Xn = new WeakMap(), qn = new WeakMap(), Ec = new WeakMap(), kc = new WeakMap(), Cc = new WeakSet(), nm = function() {
7924
7970
  return f(this, null, function* () {
7925
7971
  var t;
7926
- const e = new JA({ edgeUrl: this.config.options.get("edgeUrl") });
7972
+ const e = new YA({ edgeUrl: this.config.options.get("edgeUrl") });
7927
7973
  for (m(this, As, 0); ; ) {
7928
7974
  Pe(this, As)._++, Pe(this, vi)._++;
7929
7975
  try {
7930
7976
  const [n, o] = yield Promise.all([a(this, Ec).call(this), a(this, kc).call(this)]), c = o / 2;
7931
- if (a(this, It).clear(), a(this, It).push(c), !a(this, Ct))
7977
+ if (a(this, Ct).clear(), a(this, Ct).push(c), !a(this, It))
7932
7978
  break;
7933
7979
  const h = e.select(n.edges);
7934
7980
  if (!h)
7935
7981
  throw new L("Failed to resolve edge url", { isFatal: !0, code: "failed_to_resolve_edge_url" });
7936
- Pd(n) ? this.connectionImpl = yield Hh.start(
7982
+ Pd(n) ? this.connectionImpl = yield zh.start(
7937
7983
  this.emitter,
7938
7984
  this.logger,
7939
7985
  this.apiClient,
@@ -7941,7 +7987,7 @@ It = new WeakMap(), Ct = new WeakMap(), Qn = new WeakMap(), As = new WeakMap(),
7941
7987
  connectInfo: n,
7942
7988
  edgeUrl: h
7943
7989
  }),
7944
- a(this, It)
7990
+ a(this, Ct)
7945
7991
  ) : (Je(typeof h == "string", "Edge URL is expected to be a string"), this.connectionImpl = yield Xh.start(
7946
7992
  this.emitter,
7947
7993
  this.logger,
@@ -7949,7 +7995,7 @@ It = new WeakMap(), Ct = new WeakMap(), Qn = new WeakMap(), As = new WeakMap(),
7949
7995
  connectInfo: n,
7950
7996
  edgeUrl: h
7951
7997
  }),
7952
- a(this, It)
7998
+ a(this, Ct)
7953
7999
  )), e.reset(), Pe(this, ws)._++, m(this, As, 0), m(this, qn, Date.now()), a(this, Xn) || m(this, Xn, a(this, qn)), yield this.connectionImpl.closed();
7954
8000
  } catch (n) {
7955
8001
  this.logger.info("Failed to connect", n);
@@ -7959,7 +8005,7 @@ It = new WeakMap(), Ct = new WeakMap(), Qn = new WeakMap(), As = new WeakMap(),
7959
8005
  edgeUrl: typeof o == "string" ? o : o.moqUrl || o.moqWsUrl
7960
8006
  }), n instanceof L ? this.emitter.emit("error", n) : n instanceof Error && this.emitter.emit("error", new L(n.message, { code: "start_failed", isFatal: !1 }));
7961
8007
  }
7962
- if ((t = this.connectionImpl) == null || t.unload(), this.connectionImpl = void 0, !a(this, Ct))
8008
+ if ((t = this.connectionImpl) == null || t.unload(), this.connectionImpl = void 0, !a(this, It))
7963
8009
  break;
7964
8010
  if (!(yield this.config.reconnectHandler({
7965
8011
  reconnectRetries: a(this, As)
@@ -7967,7 +8013,7 @@ It = new WeakMap(), Ct = new WeakMap(), Qn = new WeakMap(), As = new WeakMap(),
7967
8013
  this.emitter.emit("error", jd());
7968
8014
  break;
7969
8015
  }
7970
- if (yield Ci(1e3), !a(this, Ct))
8016
+ if (yield Ii(1e3), !a(this, It))
7971
8017
  break;
7972
8018
  }
7973
8019
  m(this, Qn, void 0);
@@ -7981,7 +8027,7 @@ const hh = () => ({
7981
8027
  audio: {
7982
8028
  bitRate: ki()
7983
8029
  }
7984
- }), $A = () => ({
8030
+ }), KA = () => ({
7985
8031
  width: window.innerWidth,
7986
8032
  height: window.innerHeight,
7987
8033
  bitRate: ki()
@@ -8039,7 +8085,7 @@ const hh = () => ({
8039
8085
  });
8040
8086
  r(this, "evaluateConstraintCap", () => {
8041
8087
  var c, h, u, l, p;
8042
- const e = this.sizeBasedResolutionCapEnabled ? _(S({}, hh()), { video: $A() }) : hh();
8088
+ const e = this.sizeBasedResolutionCapEnabled ? _(S({}, hh()), { video: KA() }) : hh();
8043
8089
  if (!this.resizeObserver) {
8044
8090
  const g = this.element.getBoundingClientRect();
8045
8091
  this.elementSize = { width: g.width, height: g.height };
@@ -8077,7 +8123,7 @@ const hh = () => ({
8077
8123
  };
8078
8124
  r(Xs, "CHECK_SIZE_INTERVAL", 1e3), r(Xs, "create", (e, t, i, n) => new Xs(e, t, i, n));
8079
8125
  let Zh = Xs;
8080
- const YA = 5, KA = 100, ew = 1e3;
8126
+ const ew = 5, tw = 100, iw = 1e3;
8081
8127
  class Au {
8082
8128
  constructor(e, t, i, n) {
8083
8129
  r(this, "timers", be.create());
@@ -8087,7 +8133,7 @@ class Au {
8087
8133
  r(this, "playbackSource");
8088
8134
  r(this, "isSuspended", !1);
8089
8135
  r(this, "load", () => {
8090
- this.timers.setInterval(this.emitDecodedFrames, KA), this.timers.setInterval(this.emitDecodeRate, ew), this.emitter.on("init segment", this.onInitSegment), this.emitter.on("coded sample", this.decode);
8136
+ this.timers.setInterval(this.emitDecodedFrames, tw), this.timers.setInterval(this.emitDecodeRate, iw), this.emitter.on("init segment", this.onInitSegment), this.emitter.on("coded sample", this.decode);
8091
8137
  });
8092
8138
  r(this, "unload", () => {
8093
8139
  this.trackContexts.forEach(({ decoderContext: e }) => e.unload()), this.timers.unload(), this.emitter.off("init segment", this.onInitSegment), this.emitter.off("coded sample", this.decode);
@@ -8138,7 +8184,7 @@ class Au {
8138
8184
  return;
8139
8185
  t.sampleDuration = e.duration / e.timescale * 1e3;
8140
8186
  const i = e.compositionTimeOffset || 0, { decoderContext: n, buffer: o } = t, c = (e.timestamp + i) / e.timescale * 1e3, h = e.duration / e.timescale * 1e3, u = o[o.length - 1];
8141
- !u || c - YA > u.end ? o.push({ start: c, end: c + h }) : c + h * 5 < u.end ? t.buffer = [{ start: c, end: c + h }] : u.end = c + h, n.enqueue(e), this.emitDecodedFrames();
8187
+ !u || c - ew > u.end ? o.push({ start: c, end: c + h }) : c + h * 5 < u.end ? t.buffer = [{ start: c, end: c + h }] : u.end = c + h, n.enqueue(e), this.emitDecodedFrames();
8142
8188
  });
8143
8189
  r(this, "emitDecodedFrames", () => {
8144
8190
  let e;
@@ -8146,7 +8192,7 @@ class Au {
8146
8192
  var n, o;
8147
8193
  let i;
8148
8194
  for (; (i = (o = (n = t.decoderContext).error) == null ? void 0 : o.call(n)) !== void 0; )
8149
- this.emitter.emit("error", df(!1, i));
8195
+ this.emitter.emit("error", mf(!1, i));
8150
8196
  for (; (e = t.decoderContext.take()) !== void 0; ) {
8151
8197
  const { statistics: c } = e;
8152
8198
  c && (t.decodeTime.push(c.decodeTime), t.transportTime.push(
@@ -8193,7 +8239,7 @@ class Au {
8193
8239
  for (const h of i)
8194
8240
  switch (h.type) {
8195
8241
  case "audio": {
8196
- const { OpusDecoderContext: u } = yield import("./CWJV2199.js");
8242
+ const { OpusDecoderContext: u } = yield import("./CzxdGCq-.js");
8197
8243
  c.set(h.type, {
8198
8244
  buffer: [],
8199
8245
  decoderContext: yield u.create(48e3, 2),
@@ -8204,7 +8250,7 @@ class Au {
8204
8250
  break;
8205
8251
  }
8206
8252
  case "video": {
8207
- const { H264DecoderWorkerContext: u } = yield import("./bMIdtcts.js");
8253
+ const { H264DecoderWorkerContext: u } = yield import("./C_l8ZZsF.js");
8208
8254
  c.set(h.type, {
8209
8255
  buffer: [],
8210
8256
  decoderContext: yield u.create(o),
@@ -8219,7 +8265,7 @@ class Au {
8219
8265
  });
8220
8266
  }
8221
8267
  }
8222
- const Cc = class Cc {
8268
+ const Ic = class Ic {
8223
8269
  constructor(e) {
8224
8270
  r(this, "emitter");
8225
8271
  r(this, "isVisibleCount", 0);
@@ -8269,14 +8315,14 @@ const Cc = class Cc {
8269
8315
  return document.visibilityState === "visible";
8270
8316
  }
8271
8317
  };
8272
- r(Cc, "create", (e) => new Cc(e));
8273
- let Jh = Cc;
8274
- const tw = (s) => (e, t, i) => e.timestamp <= t || e.timestampAdded <= i - s, ei = class ei {
8318
+ r(Ic, "create", (e) => new Ic(e));
8319
+ let Jh = Ic;
8320
+ const sw = (s) => (e, t, i) => e.timestamp <= t || e.timestampAdded <= i - s, ei = class ei {
8275
8321
  constructor(e, t, i) {
8276
8322
  r(this, "logger");
8277
8323
  r(this, "emitter");
8278
8324
  r(this, "waitingEvents", []);
8279
- r(this, "isTriggered", tw(ei.EVENT_TIMEOUT));
8325
+ r(this, "isTriggered", sw(ei.EVENT_TIMEOUT));
8280
8326
  r(this, "timeSource");
8281
8327
  r(this, "timers", new be());
8282
8328
  r(this, "load", () => {
@@ -8339,7 +8385,7 @@ const tt = class tt {
8339
8385
  });
8340
8386
  r(this, "add", (e, t) => {
8341
8387
  let i = this.bytesReceived.get(e);
8342
- i || (i = new Vm(20), this.bytesReceived.set(e, i)), t > 0 && (this.lastBytesUpdated = Date.now(), this.timeoutInterval || (this.timeoutInterval = this.timers.setInterval(
8388
+ i || (i = new Gm(20), this.bytesReceived.set(e, i)), t > 0 && (this.lastBytesUpdated = Date.now(), this.timeoutInterval || (this.timeoutInterval = this.timers.setInterval(
8343
8389
  this.checkTimeout,
8344
8390
  tt.UPDATE_RECEIVED_BYTES_INTERVAL
8345
8391
  ))), i.add(t);
@@ -8358,7 +8404,7 @@ const tt = class tt {
8358
8404
  r(this, "checkTimeout", () => {
8359
8405
  const e = Date.now() - this.lastBytesUpdated;
8360
8406
  if (this.totalBytesReceived() === 0 && e > tt.NO_DATA_ERROR_TIMEOUT) {
8361
- this.emitter.emit("error", Af()), this.emitter.emit("reconnect", "no incoming data"), this.clearTimeoutInterval();
8407
+ this.emitter.emit("error", bf()), this.emitter.emit("reconnect", "no incoming data"), this.clearTimeoutInterval();
8362
8408
  return;
8363
8409
  }
8364
8410
  e > tt.NO_DATA_TIMEOUT && this.totalBytesReceived() > 0 && (this.emitter.emit("no data timeout", this.totalBytesReceived()), this.clearTimeoutInterval());
@@ -8476,11 +8522,11 @@ class wu {
8476
8522
  };
8477
8523
  }
8478
8524
  }
8479
- const iw = () => window.AudioContext || window.webkitAudioContext, Rc = class Rc extends Ii {
8525
+ const nw = () => window.AudioContext || window.webkitAudioContext, Rc = class Rc extends Ci {
8480
8526
  constructor() {
8481
8527
  super();
8482
8528
  // TODO: Checkout what happens when limit is reached
8483
- r(this, "context", new (iw())());
8529
+ r(this, "context", new (nw())());
8484
8530
  r(this, "timers", be.create());
8485
8531
  r(this, "previousCurrentTime", 0);
8486
8532
  r(this, "_isStuck", !1);
@@ -8494,7 +8540,7 @@ const iw = () => window.AudioContext || window.webkitAudioContext, Rc = class Rc
8494
8540
  r(this, "createSplitter", () => this.context.createChannelSplitter(2));
8495
8541
  r(this, "resume", () => f(this, null, function* () {
8496
8542
  try {
8497
- return yield Promise.race([this.context.resume(), mu(1e3, ff())]);
8543
+ return yield Promise.race([this.context.resume(), mu(1e3, gf())]);
8498
8544
  } catch (t) {
8499
8545
  throw this.suspend().catch(D), t;
8500
8546
  }
@@ -8526,7 +8572,7 @@ const iw = () => window.AudioContext || window.webkitAudioContext, Rc = class Rc
8526
8572
  };
8527
8573
  r(Rc, "CHECK_INTERVAL", 1e3);
8528
8574
  let Kh = Rc;
8529
- const sw = 400, Bc = class Bc extends Ii {
8575
+ const rw = 400, Bc = class Bc extends Ci {
8530
8576
  constructor(t, i, { muted: n, reInitWhenStuck: o, bufferTime: c }) {
8531
8577
  super();
8532
8578
  r(this, "logger");
@@ -8655,7 +8701,7 @@ const sw = 400, Bc = class Bc extends Ii {
8655
8701
  r(this, "setGain", (t) => {
8656
8702
  this.gainNode && (this.gainNode.gain.value = this._muted ? 0 : t);
8657
8703
  });
8658
- this._muted = n, this._userProvidedMuted = n, this.logger = t, this.clockSource = i, this.reInitWhenStuck = o, this.audioBufferMultiplier = c !== void 0 && c < sw ? 2 : 5;
8704
+ this._muted = n, this._userProvidedMuted = n, this.logger = t, this.clockSource = i, this.reInitWhenStuck = o, this.audioBufferMultiplier = c !== void 0 && c < rw ? 2 : 5;
8659
8705
  }
8660
8706
  get isContextRunning() {
8661
8707
  var t;
@@ -8711,7 +8757,7 @@ const sw = 400, Bc = class Bc extends Ii {
8711
8757
  r(Bc, "create", (t, i, n) => new Bc(t, i, n));
8712
8758
  let Wo = Bc;
8713
8759
  var Ja, Rt, Ae, bs, $e, rm, Os, am;
8714
- class nw {
8760
+ class aw {
8715
8761
  constructor() {
8716
8762
  d(this, $e);
8717
8763
  d(this, Ja, []);
@@ -8776,7 +8822,7 @@ Ja = new WeakMap(), Rt = new WeakMap(), Ae = new WeakMap(), bs = new WeakMap(),
8776
8822
  }
8777
8823
  return i;
8778
8824
  };
8779
- const rw = `
8825
+ const ow = `
8780
8826
  precision mediump float;
8781
8827
  uniform sampler2D texture;
8782
8828
 
@@ -8788,7 +8834,7 @@ void main() {
8788
8834
 
8789
8835
  gl_FragColor = vec4(y, y, y, a);
8790
8836
  }
8791
- `, aw = `
8837
+ `, cw = `
8792
8838
  attribute vec2 position;
8793
8839
  varying vec2 texture_coordinate;
8794
8840
  uniform mat4 model;
@@ -8850,7 +8896,7 @@ void main() {
8850
8896
  return i;
8851
8897
  };
8852
8898
  var Uc, N, $a, Ya, Ka, Ti, $n, om, cm, Pc;
8853
- class ow {
8899
+ class hw {
8854
8900
  constructor(e) {
8855
8901
  d(this, $n);
8856
8902
  d(this, Uc, 96);
@@ -8859,7 +8905,7 @@ class ow {
8859
8905
  d(this, Ya);
8860
8906
  d(this, Ka);
8861
8907
  d(this, Ti);
8862
- r(this, "subtitleRenderer", new nw());
8908
+ r(this, "subtitleRenderer", new aw());
8863
8909
  // biome-ignore format: special formatting
8864
8910
  d(this, Pc, (e, t, i, n) => [
8865
8911
  e,
@@ -8879,7 +8925,7 @@ class ow {
8879
8925
  0,
8880
8926
  1
8881
8927
  ]);
8882
- m(this, N, e), m(this, $a, Fi(e)), m(this, Ya, Fs(e, e.FRAGMENT_SHADER, rw)), m(this, Ka, Fs(e, e.VERTEX_SHADER, aw)), m(this, Ti, eu(e, a(this, Ka), a(this, Ya))), this.subtitleRenderer.config.fontSize = "64px";
8928
+ m(this, N, e), m(this, $a, Fi(e)), m(this, Ya, Fs(e, e.FRAGMENT_SHADER, ow)), m(this, Ka, Fs(e, e.VERTEX_SHADER, cw)), m(this, Ti, eu(e, a(this, Ka), a(this, Ya))), this.subtitleRenderer.config.fontSize = "64px";
8883
8929
  }
8884
8930
  setActiveCues(e, t) {
8885
8931
  this.subtitleRenderer.setActiveCues(e), this.subtitleRenderer.render(t);
@@ -8940,7 +8986,7 @@ void main() {
8940
8986
  stencil: !1,
8941
8987
  antialias: !1,
8942
8988
  premultipliedAlpha: !1
8943
- }, ti = class ti extends Ii {
8989
+ }, ti = class ti extends Ci {
8944
8990
  constructor() {
8945
8991
  super();
8946
8992
  r(this, "canvas", document.createElement("canvas"));
@@ -8966,7 +9012,7 @@ void main() {
8966
9012
  r(this, "onContextLost", (t) => {
8967
9013
  this.textRenderer = void 0;
8968
9014
  const i = new Error(t instanceof WebGLContextEvent ? t.statusMessage : "webgl context lost");
8969
- this.emit("context lost", bf(i)), t.preventDefault();
9015
+ this.emit("context lost", Sf(i)), t.preventDefault();
8970
9016
  });
8971
9017
  r(this, "onContextRestored", () => {
8972
9018
  this.emit("context restored"), this.context = sd(this.canvas, cd), this.pixelShader = Fs(this.context, this.context.FRAGMENT_SHADER, rd), this.vertexShader = Fs(this.context, this.context.VERTEX_SHADER, ad), this.buffer = nd(this.context, ti.SQUARE_VERTICES), this.program = eu(this.context, this.vertexShader, this.pixelShader), this.textures = {
@@ -9044,7 +9090,7 @@ void main() {
9044
9090
  this.canvas.addEventListener("webglcontextlost", this.onContextLost), this.canvas.addEventListener("webglcontextrestored", this.onContextRestored, !1), this.canvas.style.width = "100%", this.canvas.style.position = "relative";
9045
9091
  }
9046
9092
  getTextRenderer() {
9047
- return this.textRenderer || (this.textRenderer = new ow(this.context)), this.textRenderer;
9093
+ return this.textRenderer || (this.textRenderer = new hw(this.context)), this.textRenderer;
9048
9094
  }
9049
9095
  };
9050
9096
  r(ti, "SQUARE_VERTICES", new Float32Array([0, 0, 0, 1, 1, 0, 1, 1])), // biome-ignore format: special formatting
@@ -9152,7 +9198,7 @@ const Mc = class Mc {
9152
9198
  }
9153
9199
  };
9154
9200
  r(Mc, "create", (e, t, i, n) => new Mc(e, t, i, n));
9155
- let zo = Mc;
9201
+ let Ho = Mc;
9156
9202
  var Ei;
9157
9203
  class hm {
9158
9204
  constructor() {
@@ -9196,7 +9242,7 @@ const Mi = (s, e) => {
9196
9242
  for (t = e; s > 1; s--) t += e;
9197
9243
  return t;
9198
9244
  };
9199
- class cw {
9245
+ class uw {
9200
9246
  constructor() {
9201
9247
  r(this, "audio");
9202
9248
  r(this, "unmute", () => this.audio.play().catch(D));
@@ -9216,7 +9262,7 @@ const xc = class xc {
9216
9262
  r(this, "audioPlayer");
9217
9263
  r(this, "videoPlayer");
9218
9264
  r(this, "pool");
9219
- r(this, "unmuter", new cw());
9265
+ r(this, "unmuter", new uw());
9220
9266
  r(this, "_isPaused", !1);
9221
9267
  r(this, "isDisconnected", !1);
9222
9268
  r(this, "timers", new be());
@@ -9268,7 +9314,7 @@ const xc = class xc {
9268
9314
  volume: this.volume,
9269
9315
  isMuted: this.muted
9270
9316
  });
9271
- }), this.videoPlayer = zo.create(this.logger.createContext("VideoPlayerModule"), this.audioPlayer, this.pool);
9317
+ }), this.videoPlayer = Ho.create(this.logger.createContext("VideoPlayerModule"), this.audioPlayer, this.pool);
9272
9318
  }
9273
9319
  get volume() {
9274
9320
  return this.audioPlayer.volume;
@@ -9414,7 +9460,7 @@ const Lc = class Lc {
9414
9460
  this.isDisconnected = !0;
9415
9461
  }), this.audioPlayer.on("state change", (l) => {
9416
9462
  l === "suspended" || l === "interrupted" ? this.mediaElement.muted = !0 : l === "running" && (this.mediaElement.muted = this._userProvidedMuted || document.visibilityState === "hidden"), this.updateVolumeState();
9417
- }), this.videoPlayer = zo.create(
9463
+ }), this.videoPlayer = Ho.create(
9418
9464
  this.logger.createContext("VideoPlayerModule"),
9419
9465
  this.audioPlayer,
9420
9466
  this.pool,
@@ -9476,8 +9522,8 @@ const Lc = class Lc {
9476
9522
  };
9477
9523
  r(Lc, "create", (e, t, i, n, o) => new Lc(e, t, i, n, o));
9478
9524
  let su = Lc;
9479
- const hw = () => (s) => um(s.buffered.start(0), s.buffered.end(s.buffered.length - 1)), um = (s, e) => (t) => t.remove(Math.max(0, s), Math.min(Number.POSITIVE_INFINITY, e)), hd = (s) => (e) => e.appendBuffer(s), uw = (s) => (e) => e.changeType(s), dw = (s) => (e) => s(e);
9480
- class lw {
9525
+ const dw = () => (s) => um(s.buffered.start(0), s.buffered.end(s.buffered.length - 1)), um = (s, e) => (t) => t.remove(Math.max(0, s), Math.min(Number.POSITIVE_INFINITY, e)), hd = (s) => (e) => e.appendBuffer(s), lw = (s) => (e) => e.changeType(s), mw = (s) => (e) => s(e);
9526
+ class fw {
9481
9527
  constructor(e) {
9482
9528
  r(this, "commandQueue", []);
9483
9529
  r(this, "sourceBuffer");
@@ -9495,7 +9541,7 @@ class lw {
9495
9541
  this.commandQueue.push(o), this.handleQueue();
9496
9542
  }));
9497
9543
  r(this, "execute", (e) => new Promise((t, i) => {
9498
- const n = new Bs(dw(e), t, i);
9544
+ const n = new Bs(mw(e), t, i);
9499
9545
  this.commandQueue.push(n), this.handleQueue();
9500
9546
  }));
9501
9547
  r(this, "buffered", () => this.sourceBuffer.buffered);
@@ -9503,7 +9549,7 @@ class lw {
9503
9549
  e.removeSourceBuffer(this.sourceBuffer);
9504
9550
  });
9505
9551
  r(this, "changeType", (e) => new Promise((t, i) => {
9506
- const n = new Bs(uw(e), t, i);
9552
+ const n = new Bs(lw(e), t, i);
9507
9553
  this.commandQueue.push(n), this.handleQueue();
9508
9554
  }));
9509
9555
  r(this, "removeBuffer", (e, t) => new Promise((i, n) => {
@@ -9511,13 +9557,13 @@ class lw {
9511
9557
  this.commandQueue.push(o), this.handleQueue();
9512
9558
  }));
9513
9559
  r(this, "flush", () => new Promise((e, t) => {
9514
- const i = new Bs(hw, e, t);
9560
+ const i = new Bs(dw, e, t);
9515
9561
  this.commandQueue.push(i), this.handleQueue();
9516
9562
  }));
9517
9563
  this.sourceBuffer = e, this.sourceBuffer.addEventListener("updateend", this.handleQueue);
9518
9564
  }
9519
9565
  }
9520
- class dm extends Ii {
9566
+ class dm extends Ci {
9521
9567
  constructor() {
9522
9568
  super();
9523
9569
  r(this, "MediaSource", Jn());
@@ -9549,7 +9595,7 @@ class dm extends Ii {
9549
9595
  });
9550
9596
  r(this, "addSourceBuffer", (t) => {
9551
9597
  const i = this.mediaSource.addSourceBuffer(t);
9552
- return new lw(i);
9598
+ return new fw(i);
9553
9599
  });
9554
9600
  r(this, "removeSourceBuffer", (t) => {
9555
9601
  t.removeFromMediaSource(this.mediaSource);
@@ -9593,7 +9639,7 @@ class lm {
9593
9639
  });
9594
9640
  }
9595
9641
  }
9596
- function mw(s, { mediaSource: e, mimeType: t, codec: i }) {
9642
+ function pw(s, { mediaSource: e, mimeType: t, codec: i }) {
9597
9643
  return _(S({}, s), {
9598
9644
  state: "initialized",
9599
9645
  mimeType: t,
@@ -9699,7 +9745,7 @@ const Dc = class Dc {
9699
9745
  let n = this.trackContexts.get(i.type);
9700
9746
  n || (n = ud({ pendingSamples: [], initSegments: new lm() }), this.trackContexts.set(i.type, n)), n.state === "initialized" ? i.mimeType !== n.mimeType && (yield n.sourceBuffer.changeType(i.mimeType)) : this.trackContexts.set(
9701
9747
  i.type,
9702
- mw(n, {
9748
+ pw(n, {
9703
9749
  mimeType: i.mimeType,
9704
9750
  mediaSource: this.mediaSource,
9705
9751
  codec: i.codec
@@ -9731,7 +9777,7 @@ const Dc = class Dc {
9731
9777
  if (!i)
9732
9778
  throw io(e.type, e.renditionId);
9733
9779
  i.state === "initialized" && (i.mimeType = t);
9734
- const n = ng({
9780
+ const n = ag({
9735
9781
  codec: e.codec,
9736
9782
  timescale: e.timescale,
9737
9783
  initData: e.data
@@ -9747,11 +9793,11 @@ const Dc = class Dc {
9747
9793
  if (this.mediaSource.isClosed())
9748
9794
  return;
9749
9795
  if (!o)
9750
- throw lf(i.renditionId, i.channelId);
9796
+ throw ff(i.renditionId, i.channelId);
9751
9797
  if (!n)
9752
9798
  throw io(i.type, i.renditionId);
9753
9799
  if (n.state === "uninitialized")
9754
- throw mf(i.type, i.renditionId);
9800
+ throw pf(i.type, i.renditionId);
9755
9801
  if (t) {
9756
9802
  const u = (i.timestamp + ((h = i.compositionTimeOffset) != null ? h : 0)) / i.timescale;
9757
9803
  yield n.sourceBuffer.removeBuffer(u, Number.POSITIVE_INFINITY);
@@ -9771,7 +9817,7 @@ const Dc = class Dc {
9771
9817
  for (const l of e)
9772
9818
  "initData" in l && (yield n.sourceBuffer.appendBuffer(l.data, l.initData));
9773
9819
  else {
9774
- const l = ug(e, u++);
9820
+ const l = lg(e, u++);
9775
9821
  yield n.sourceBuffer.appendBuffer(l);
9776
9822
  }
9777
9823
  n.sequenceNumber = u, n.consecutiveQuotaExceededErrorCount = 0, n.successfulAppendCalls++;
@@ -9828,7 +9874,7 @@ const Dc = class Dc {
9828
9874
  const i = S({}, e);
9829
9875
  "fragment" in i ? (i.fragment = i.fragment.clone(), i.fragment.updateBaseMediaDecodeTime(0), i.data = i.fragment.rawBytes()) : i.timestamp = 0, t.pendingSamples.push(i);
9830
9876
  }
9831
- t.hasFirstSync = !0, t.pendingSamples.push(e), t.state !== "uninitialized" && (t.isWorkingOnPendingSamples || gw(t, this.append, this.maxChunkSize).catch((i) => {
9877
+ t.hasFirstSync = !0, t.pendingSamples.push(e), t.state !== "uninitialized" && (t.isWorkingOnPendingSamples || ww(t, this.append, this.maxChunkSize).catch((i) => {
9832
9878
  if (t.isWorkingOnPendingSamples = !1, i instanceof Error) {
9833
9879
  if (this.logger.error("append failed", { message: i.message, name: i.name }), i instanceof DOMException && i.code === DOMException.QUOTA_EXCEEDED_ERR) {
9834
9880
  if (t.consecutiveQuotaExceededErrorCount >= this.minConsecutiveErrorsBeforeEmit) {
@@ -9850,7 +9896,7 @@ const Dc = class Dc {
9850
9896
  r(this, "onSourceEnded", () => {
9851
9897
  const { error: e } = this.mediaElement;
9852
9898
  if (e) {
9853
- const t = /AUDIO_RENDERER/.test(e.message) || !this.autoRecoverFromMediaErrors, i = uf(t, e);
9899
+ const t = /AUDIO_RENDERER/.test(e.message) || !this.autoRecoverFromMediaErrors, i = lf(t, e);
9854
9900
  if (this.logger.error("MediaElement error", { error: i }), this.emitter.emit("error", i), !i.isFatal()) {
9855
9901
  this.logger.info("Re-opening MediaSource"), this.emitter.emit("recovered from media error", { error: i, count: this.recoveredFromErrorCount }), this.recoveredFromErrorCount++;
9856
9902
  const n = !this.mediaElement.paused, o = [];
@@ -9874,16 +9920,16 @@ const dd = (s, e) => {
9874
9920
  const t = s.renditionId !== e.renditionId, i = s.channelId !== e.channelId, n = ((h = s.timestamp) != null ? h : 0) > e.timestamp, o = s.type === "video" && e.type === "video" && "levelIdc" in s && "levelIdc" in e && s.levelIdc !== e.levelIdc;
9875
9921
  let c = !1;
9876
9922
  return s.type === "video" && e.type === "video" && "width" in s && "width" in e && (c = e.width !== s.width || e.height !== s.height), i || t || n || c || o;
9877
- }, fw = 32, pw = (s) => {
9923
+ }, gw = 32, Aw = (s) => {
9878
9924
  const e = s.pendingSamplesOffset;
9879
9925
  if (e !== 0) {
9880
9926
  if (e >= s.pendingSamples.length) {
9881
9927
  s.pendingSamples = [], s.pendingSamplesOffset = 0;
9882
9928
  return;
9883
9929
  }
9884
- e < fw || e * 2 < s.pendingSamples.length || (s.pendingSamples = s.pendingSamples.slice(e), s.pendingSamplesOffset = 0);
9930
+ e < gw || e * 2 < s.pendingSamples.length || (s.pendingSamples = s.pendingSamples.slice(e), s.pendingSamplesOffset = 0);
9885
9931
  }
9886
- }, gw = (s, e, t) => f(null, null, function* () {
9932
+ }, ww = (s, e, t) => f(null, null, function* () {
9887
9933
  for (s.isWorkingOnPendingSamples = !0; s.pendingSamplesOffset < s.pendingSamples.length; ) {
9888
9934
  const i = [];
9889
9935
  let n = s.pendingSamplesOffset;
@@ -9904,7 +9950,7 @@ const dd = (s, e) => {
9904
9950
  if (!o)
9905
9951
  break;
9906
9952
  const c = s.previousSample ? dd(s.previousSample, o) : !0;
9907
- yield e(i, c), s.pendingSamplesOffset = n + 1, s.previousSample = i[i.length - 1], pw(s);
9953
+ yield e(i, c), s.pendingSamplesOffset = n + 1, s.previousSample = i[i.length - 1], Aw(s);
9908
9954
  }
9909
9955
  s.isWorkingOnPendingSamples = !1;
9910
9956
  }), Oc = class Oc {
@@ -9998,7 +10044,7 @@ const ou = () => ({
9998
10044
  bufferingRanges: [],
9999
10045
  activeRanges: [],
10000
10046
  decodeRate: Number.MAX_SAFE_INTEGER
10001
- }), Aw = () => ({
10047
+ }), bw = () => ({
10002
10048
  levels: {},
10003
10049
  levelDowngrades: [],
10004
10050
  levelUpgrades: [],
@@ -10010,7 +10056,7 @@ const ou = () => ({
10010
10056
  r(this, "logger");
10011
10057
  r(this, "emitter");
10012
10058
  r(this, "timers", be.create());
10013
- r(this, "metrics", Aw());
10059
+ r(this, "metrics", bw());
10014
10060
  r(this, "bufferFullness", new ee(30));
10015
10061
  r(this, "bufferFullnessRegression");
10016
10062
  r(this, "currentLevel");
@@ -10087,15 +10133,15 @@ const ou = () => ({
10087
10133
  var u, l, p, g;
10088
10134
  const t = this.timeSpentBuffering(), i = this.timeActive(), n = this.bufferingRatios(), o = this.activeRatios(), c = ((l = (u = e.video) == null ? void 0 : u.bitRate) != null ? l : 0) + ((g = (p = e.audio) == null ? void 0 : p.bitRate) != null ? g : 0), h = t / i;
10089
10135
  return Object.keys(this.metrics.levels).map((A) => parseInt(A, 10)).filter((A) => A >= c).reduce((A, b) => {
10090
- var k, I;
10136
+ var k, C;
10091
10137
  const v = this.getQualityIndex(b).toString();
10092
- return ((k = o.get(v)) != null ? k : 0) - ((I = n.get(v)) != null ? I : 0) * h + A;
10138
+ return ((k = o.get(v)) != null ? k : 0) - ((C = n.get(v)) != null ? C : 0) * h + A;
10093
10139
  }, 0);
10094
10140
  });
10095
10141
  r(this, "timeSpentBuffering", () => Ps(this.metrics.general.bufferingRanges));
10096
10142
  r(this, "timeActive", () => Ps(this.metrics.general.activeRanges));
10097
10143
  r(this, "getStatistics", () => {
10098
- const e = this.timeSpentBuffering(), t = this.timeActive(), i = this.metrics.general.bufferingRanges.length, n = this.activeRatios(), o = t / 6e4, c = t > 0 ? e / t : 0, h = Math.max(o, 1), u = o > 0 ? i / h : 0, l = [...n].reduce((x, [T, U]) => x + parseInt(T, 10) * U, 0), p = 6e4, g = this.timeSpentActiveLast(p), A = this.timeSpentBufferingLast(p), b = g > 0 ? A / g : 0, v = this.metrics.general.upgradesFromLevel.length + this.metrics.general.downgradesFromLevel.length, k = o > 0 ? v / h : 0, I = i > 0 ? e / i : 0;
10144
+ const e = this.timeSpentBuffering(), t = this.timeActive(), i = this.metrics.general.bufferingRanges.length, n = this.activeRatios(), o = t / 6e4, c = t > 0 ? e / t : 0, h = Math.max(o, 1), u = o > 0 ? i / h : 0, l = [...n].reduce((x, [T, U]) => x + parseInt(T, 10) * U, 0), p = 6e4, g = this.timeSpentActiveLast(p), A = this.timeSpentBufferingLast(p), b = g > 0 ? A / g : 0, v = this.metrics.general.upgradesFromLevel.length + this.metrics.general.downgradesFromLevel.length, k = o > 0 ? v / h : 0, C = i > 0 ? e / i : 0;
10099
10145
  return {
10100
10146
  timeSpentBuffering: e,
10101
10147
  bufferingEventsCount: i,
@@ -10106,12 +10152,12 @@ const ou = () => ({
10106
10152
  averageRenditionIndex: l,
10107
10153
  bufferingRatioPerMinute: b,
10108
10154
  renditionChangesPerMinute: k,
10109
- timePerBufferingEvent: I
10155
+ timePerBufferingEvent: C
10110
10156
  };
10111
10157
  });
10112
10158
  r(this, "onRenditionLevelChanged", (e) => {
10113
- var o, c, h, u, l, p, g, A, b, v, k, I, x, T;
10114
- const t = ((h = (c = (o = e.from) == null ? void 0 : o.video) == null ? void 0 : c.bitRate) != null ? h : 0) + ((p = (l = (u = e.from) == null ? void 0 : u.audio) == null ? void 0 : l.bitRate) != null ? p : 0), i = ((b = (A = (g = e.to) == null ? void 0 : g.video) == null ? void 0 : A.bitRate) != null ? b : 0) + ((I = (k = (v = e.to) == null ? void 0 : v.audio) == null ? void 0 : k.bitRate) != null ? I : 0);
10159
+ var o, c, h, u, l, p, g, A, b, v, k, C, x, T;
10160
+ const t = ((h = (c = (o = e.from) == null ? void 0 : o.video) == null ? void 0 : c.bitRate) != null ? h : 0) + ((p = (l = (u = e.from) == null ? void 0 : u.audio) == null ? void 0 : l.bitRate) != null ? p : 0), i = ((b = (A = (g = e.to) == null ? void 0 : g.video) == null ? void 0 : A.bitRate) != null ? b : 0) + ((C = (k = (v = e.to) == null ? void 0 : v.audio) == null ? void 0 : k.bitRate) != null ? C : 0);
10115
10161
  this.logger.info("rendition level changed", { fromLevel: t, toLevel: i }), this.metrics.general.activeRanges.length === 0 && this.setActive(), e.from && e.to && (t < i ? this.metrics.general.upgradesFromLevel.push(Date.now()) : this.metrics.general.downgradesFromLevel.push(Date.now()));
10116
10162
  let n = !1;
10117
10163
  if (e.from) {
@@ -10148,7 +10194,7 @@ const ou = () => ({
10148
10194
  r(this, "onTargetBufferTime", (e) => {
10149
10195
  this.targetBufferTime = e;
10150
10196
  });
10151
- r(this, "calculateLinearRegression", () => Nm(
10197
+ r(this, "calculateLinearRegression", () => Vm(
10152
10198
  this.bufferFullness.items().map((e, t) => ({
10153
10199
  x: t,
10154
10200
  y: e
@@ -10303,7 +10349,7 @@ const Nc = class Nc {
10303
10349
  };
10304
10350
  r(Nc, "create", (e, t) => new Nc(e, t));
10305
10351
  let hu = Nc;
10306
- const sr = (s) => JSON.parse(JSON.stringify(s)), ww = 1e4, Vc = class Vc {
10352
+ const sr = (s) => JSON.parse(JSON.stringify(s)), yw = 1e4, Vc = class Vc {
10307
10353
  constructor(e, t, i) {
10308
10354
  r(this, "logger");
10309
10355
  r(this, "timers", new be());
@@ -10364,7 +10410,7 @@ const sr = (s) => JSON.parse(JSON.stringify(s)), ww = 1e4, Vc = class Vc {
10364
10410
  const e = this.currentSubscription.channelId, t = this.targetSubscription.channelId, i = e !== t;
10365
10411
  this._isSwitchingSubscription && (i && this.burstMs ? this.setBurst(this.burstMs) : this.setBurst(0), this.pendingSubscriptionTimeoutId && (this.timers.clearTimeout(this.pendingSubscriptionTimeoutId), this.pendingSubscriptionTimeoutId = void 0), i && this.timers.setTimeout(() => {
10366
10412
  this.currentSubscription.channelId === e && this.targetSubscription.channelId === t && (this.logger.warn("Channel switch timeout", t), this.targetSubscription = sr(this.currentSubscription), this.emitter.emit("channel switch timeout", t));
10367
- }, ww), this.pendingSubscriptionTimeoutId = this.timers.setTimeout(
10413
+ }, yw), this.pendingSubscriptionTimeoutId = this.timers.setTimeout(
10368
10414
  () => this.emitter.emit("send signal", {
10369
10415
  type: "subscribe",
10370
10416
  subscription: this.getTargetSubscription()
@@ -10377,7 +10423,7 @@ const sr = (s) => JSON.parse(JSON.stringify(s)), ww = 1e4, Vc = class Vc {
10377
10423
  };
10378
10424
  r(Vc, "create", (e, t, i) => new Vc(e, i, t));
10379
10425
  let uu = Vc;
10380
- const ld = 5e3, bw = () => Dd() || xm(), yw = () => bw() ? 100 : 0, md = (s) => (e) => e > s, ao = {
10426
+ const ld = 5e3, Sw = () => Dd() || xm(), vw = () => Sw() ? 100 : 0, md = (s) => (e) => e > s, ao = {
10381
10427
  seek: {
10382
10428
  toleranceMs: 200,
10383
10429
  toleranceMaxMs: 2500,
@@ -10437,7 +10483,7 @@ const ld = 5e3, bw = () => Dd() || xm(), yw = () => bw() ? 100 : 0, md = (s) =>
10437
10483
  /** Max difference tolerated between server sync info and local estimation */
10438
10484
  r(this, "syncInfoToleranceMaxMs", 150);
10439
10485
  r(this, "syncInfoToleranceStep", 20);
10440
- r(this, "seekOvershoot", yw());
10486
+ r(this, "seekOvershoot", vw());
10441
10487
  // ─────────────────────────────────────────────────────────────────────────────
10442
10488
  // Runtime State
10443
10489
  // ─────────────────────────────────────────────────────────────────────────────
@@ -10893,7 +10939,7 @@ const ld = 5e3, bw = () => Dd() || xm(), yw = () => bw() ? 100 : 0, md = (s) =>
10893
10939
  };
10894
10940
  r(Gc, "create", (e, t, i, n, o) => new Gc(e, t, i, n, o));
10895
10941
  let du = Gc;
10896
- const Sw = {
10942
+ const Tw = {
10897
10943
  enabled: !0,
10898
10944
  interval: 3e4,
10899
10945
  includeErrors: !0,
@@ -10971,11 +11017,11 @@ const Sw = {
10971
11017
  );
10972
11018
  }
10973
11019
  });
10974
- this.logger = e, this.emitter = t, this.options = S(S({}, Sw), i), this.parentContext = n;
11020
+ this.logger = e, this.emitter = t, this.options = S(S({}, Tw), i), this.parentContext = n;
10975
11021
  }
10976
11022
  };
10977
11023
  r(jc, "create", (e, t, i, n) => new jc(e, t, i, n));
10978
- let Ho = jc;
11024
+ let zo = jc;
10979
11025
  const Wc = class Wc {
10980
11026
  constructor(e, t, i) {
10981
11027
  r(this, "logger");
@@ -10993,7 +11039,7 @@ const Wc = class Wc {
10993
11039
  };
10994
11040
  r(Wc, "create", (e, t, i) => new Wc(e, t, i));
10995
11041
  let Qo = Wc;
10996
- const vw = [
11042
+ const Ew = [
10997
11043
  "minBufferTime",
10998
11044
  "maxBufferTime",
10999
11045
  "burstEnabled",
@@ -11004,10 +11050,10 @@ const vw = [
11004
11050
  "offscreenCanvasEnabled",
11005
11051
  "videoCodecs"
11006
11052
  ];
11007
- function Tw(s) {
11008
- return vw.includes(s);
11053
+ function kw(s) {
11054
+ return Ew.includes(s);
11009
11055
  }
11010
- class Ew {
11056
+ class Cw {
11011
11057
  constructor(e) {
11012
11058
  r(this, "options");
11013
11059
  r(this, "overrides", /* @__PURE__ */ new Map());
@@ -11045,7 +11091,7 @@ class Ew {
11045
11091
  */
11046
11092
  get(e, t) {
11047
11093
  var i;
11048
- if (t && Tw(e)) {
11094
+ if (t && kw(e)) {
11049
11095
  const n = (i = this.overrides.get(t)) == null ? void 0 : i[e];
11050
11096
  if (typeof n != "undefined")
11051
11097
  return n;
@@ -11063,11 +11109,11 @@ class Ew {
11063
11109
  return (i = this.overrides.get(t)) == null ? void 0 : i[e];
11064
11110
  }
11065
11111
  }
11066
- const kw = 6, Iw = (s) => {
11112
+ const Iw = 6, Rw = (s) => {
11067
11113
  let e = [s], t = 0, i = 0, n = !1;
11068
11114
  const o = (h, u) => {
11069
- var I, x, T;
11070
- h.flags && dr(h.flags) && (t = (I = h.compositionTimeOffset) != null ? I : 0), h.timestamp += t, h.compositionTimeOffset = ((x = h.compositionTimeOffset) != null ? x : 0) - t;
11115
+ var C, x, T;
11116
+ h.flags && dr(h.flags) && (t = (C = h.compositionTimeOffset) != null ? C : 0), h.timestamp += t, h.compositionTimeOffset = ((x = h.compositionTimeOffset) != null ? x : 0) - t;
11071
11117
  const l = h.timestamp / h.timescale, g = u.flags && dr(u.flags) ? (T = u.compositionTimeOffset) != null ? T : 0 : t, b = (u.timestamp + g) / u.timescale, v = Math.max(0, Math.round((b - l) * h.timescale));
11072
11118
  return v > 0 && (i = v), _(S({}, h), {
11073
11119
  /*
@@ -11078,7 +11124,7 @@ const kw = 6, Iw = (s) => {
11078
11124
  });
11079
11125
  };
11080
11126
  return (h, u = !1) => {
11081
- if (h.flags && dr(h.flags) && u && (n = !n), !(u && e.length < kw && n) && e.length > 0) {
11127
+ if (h.flags && dr(h.flags) && u && (n = !n), !(u && e.length < Iw && n) && e.length > 0) {
11082
11128
  n = !1;
11083
11129
  let p = h;
11084
11130
  for (let A = e.length - 1; A > 0; A--) {
@@ -11094,7 +11140,7 @@ const kw = 6, Iw = (s) => {
11094
11140
  }
11095
11141
  return e.push(h), [];
11096
11142
  };
11097
- }, Cw = (s, e, t) => {
11143
+ }, Bw = (s, e, t) => {
11098
11144
  if (vs(e))
11099
11145
  return S(_(S({}, s), {
11100
11146
  type: "video",
@@ -11117,61 +11163,15 @@ const kw = 6, Iw = (s) => {
11117
11163
  data: s.payload,
11118
11164
  duration: 0
11119
11165
  });
11120
- };
11121
- class Rw {
11122
- constructor() {
11123
- r(this, "highEntropyValues");
11124
- var e;
11125
- (e = self.navigator.userAgentData) == null || e.getHighEntropyValues(["architecture", "model", "platformVersion", "fullVersionList"]).then((t) => {
11126
- this.highEntropyValues = t;
11127
- });
11128
- }
11129
- getUserAgentInformation() {
11130
- var o, c, h, u, l, p;
11131
- const e = window.location.origin, i = !e || e == "null" ? "" : `${window.location.pathname}${window.location.search}`.substring(0, 1e3), n = {
11132
- locationOrigin: window.location.origin,
11133
- locationPath: i,
11134
- ancestorOrigins: ((o = window.location.ancestorOrigins) == null ? void 0 : o.length) > 0 ? Array.from(window.location.ancestorOrigins) : void 0,
11135
- hardwareConcurrency: navigator.hardwareConcurrency,
11136
- deviceMemory: navigator.deviceMemory
11137
- };
11138
- if (self.navigator.userAgentData && this.highEntropyValues) {
11139
- const A = [...(c = this.highEntropyValues.brands) != null ? c : []];
11140
- A.sort((T, U) => T.brand.localeCompare(U.brand));
11141
- const b = [...(h = this.highEntropyValues.fullVersionList) != null ? h : []];
11142
- b.sort((T, U) => T.brand.localeCompare(U.brand));
11143
- const v = b.map((T) => T.version), k = A.map((T) => T.brand), I = A.map((T) => T.version), x = parseInt((l = (u = this.highEntropyValues.platformVersion) == null ? void 0 : u.split(".")[0]) != null ? l : "1");
11144
- return S({
11145
- userAgentLegacy: window.navigator.userAgent,
11146
- ua: {
11147
- browser: {
11148
- brands: k,
11149
- fullVersionBrands: v,
11150
- majorVersions: I
11151
- },
11152
- device: this.highEntropyValues.model || "Other",
11153
- os: {
11154
- family: this.highEntropyValues.platform || "Other",
11155
- version: (p = this.highEntropyValues.platformVersion) != null ? p : "1",
11156
- major_version: Number.isFinite(x) ? x : 0
11157
- }
11158
- }
11159
- }, n);
11160
- } else
11161
- return S({
11162
- userAgent: window.navigator.userAgent
11163
- }, n);
11164
- }
11165
- }
11166
- const fd = (s, e) => s && typeof s == "object" && e in s, Bw = (s) => !(typeof s != "object" || !fd(s, "channelId") || typeof s.channelId != "string" || !fd(s, "url") || typeof s.url != "string" || s.channelId.length === 0 || s.url.length === 0), Uw = (s) => {
11167
- if (!Bw(s))
11166
+ }, fd = (s, e) => s && typeof s == "object" && e in s, Uw = (s) => !(typeof s != "object" || !fd(s, "channelId") || typeof s.channelId != "string" || !fd(s, "url") || typeof s.url != "string" || s.channelId.length === 0 || s.url.length === 0), Pw = (s) => {
11167
+ if (!Uw(s))
11168
11168
  throw new L("Invalid options", { isFatal: !0, code: "invalid_options" });
11169
11169
  const e = S({}, s);
11170
11170
  return Object.keys(e).forEach((t) => {
11171
11171
  const i = e;
11172
11172
  typeof i[t] == "undefined" && delete i[t];
11173
11173
  }), e;
11174
- }, Pw = (s) => {
11174
+ }, Mw = (s) => {
11175
11175
  if (typeof s != "object" || s === null)
11176
11176
  throw new Error("not an object");
11177
11177
  if (!("video" in s))
@@ -11183,7 +11183,7 @@ const fd = (s, e) => s && typeof s == "object" && e in s, Bw = (s) => !(typeof s
11183
11183
  return !0;
11184
11184
  };
11185
11185
  var ys, Ne, Ss;
11186
- const Lt = class Lt extends Ii {
11186
+ const Lt = class Lt extends Ci {
11187
11187
  constructor(t) {
11188
11188
  super();
11189
11189
  // 10s
@@ -11196,7 +11196,7 @@ const Lt = class Lt extends Ii {
11196
11196
  r(this, "options");
11197
11197
  r(this, "element");
11198
11198
  r(this, "playbackSource");
11199
- r(this, "emitter", new Ii());
11199
+ r(this, "emitter", new Ci());
11200
11200
  r(this, "logger");
11201
11201
  r(this, "modules");
11202
11202
  r(this, "clientIp");
@@ -11208,7 +11208,7 @@ const Lt = class Lt extends Ii {
11208
11208
  r(this, "latestEmittedLanguages", []);
11209
11209
  r(this, "wakeLock");
11210
11210
  r(this, "pool", new Mu(Lt.MAX_POOL_SIZE));
11211
- r(this, "userAgentInformation", new Rw());
11211
+ r(this, "userAgentInformation", new zm());
11212
11212
  r(this, "encryptedMediaExtensions");
11213
11213
  d(this, ys, 0);
11214
11214
  d(this, Ne, []);
@@ -11362,10 +11362,10 @@ const Lt = class Lt extends Ii {
11362
11362
  if (!vs(h) || !this.isSupportedVideoCodecProfile(h.codec, h.codecString))
11363
11363
  return !1;
11364
11364
  if (!this.willUseMediaSource()) {
11365
- const v = this.options.get("advanced"), k = (g = v.wasmDecodingConstraint.bitRate) != null ? g : Number.MAX_SAFE_INTEGER, I = (A = v.wasmDecodingConstraint.width) != null ? A : Number.MAX_SAFE_INTEGER, x = (b = v.wasmDecodingConstraint.height) != null ? b : Number.MAX_SAFE_INTEGER;
11366
- return h.bitRate <= k && h.width <= I && h.height <= x;
11365
+ const v = this.options.get("advanced"), k = (g = v.wasmDecodingConstraint.bitRate) != null ? g : Number.MAX_SAFE_INTEGER, C = (A = v.wasmDecodingConstraint.width) != null ? A : Number.MAX_SAFE_INTEGER, x = (b = v.wasmDecodingConstraint.height) != null ? b : Number.MAX_SAFE_INTEGER;
11366
+ return h.bitRate <= k && h.width <= C && h.height <= x;
11367
11367
  }
11368
- const u = yield yg(h);
11368
+ const u = yield vg(h);
11369
11369
  if (!u.supported || h.codec == "av1" && !u.smooth && !u.powerEfficient)
11370
11370
  return !1;
11371
11371
  const l = this.options.getOverride("maxVideoBitRate", this.channelId);
@@ -11391,7 +11391,7 @@ const Lt = class Lt extends Ii {
11391
11391
  n,
11392
11392
  i,
11393
11393
  this.targetSubscription.audio.bitRate
11394
- ), h = this.options.get("media") === "audio" ? [] : this.options.get("videoCodecs", this.channelId), u = this.supportedAudioCodecs(), l = t.renditions.filter(Ts), p = t.renditions.filter(vs), g = u.find((k) => l.find((I) => I.codec === k) !== void 0), A = h.find((k) => p.find((I) => I.codec === k) !== void 0), b = l.map((k) => k.language);
11394
+ ), h = this.options.get("media") === "audio" ? [] : this.options.get("videoCodecs", this.channelId), u = this.supportedAudioCodecs(), l = t.renditions.filter(Ts), p = t.renditions.filter(vs), g = u.find((k) => l.find((C) => C.codec === k) !== void 0), A = h.find((k) => p.find((C) => C.codec === k) !== void 0), b = l.map((k) => k.language);
11395
11395
  if (this.logger.debug("supported and selected codecs", { audioCodecs: u, videoCodecs: h, audioCodec: g, videoCodec: A }), A) {
11396
11396
  const k = this.options.get("maxSize");
11397
11397
  this.modules.subscription.setVideoConstraint(S({
@@ -11487,7 +11487,7 @@ const Lt = class Lt extends Ii {
11487
11487
  this.options.get("pauseSupportEnabled") && this.playbackState !== "paused" && (this.playbackSource.pause(), this.hasCalledConnect && this.suspend());
11488
11488
  });
11489
11489
  r(this, "registerDebugInstance", () => {
11490
- bg(this);
11490
+ Sg(this);
11491
11491
  });
11492
11492
  /**
11493
11493
  *
@@ -11539,7 +11539,7 @@ const Lt = class Lt extends Ii {
11539
11539
  const t = this.modules.canvasModule ? this.options.get("iosMediaElementEnabled") : void 0;
11540
11540
  return S({
11541
11541
  uptime: Date.now() - this.createdAt,
11542
- version: "4.1.9-22-g8338ea8a",
11542
+ version: "4.1.9-24-g9e27ab17",
11543
11543
  clientId: this.clientId,
11544
11544
  sessionId: this.sessionId,
11545
11545
  channelId: this.channelId,
@@ -11571,7 +11571,7 @@ const Lt = class Lt extends Ii {
11571
11571
  if (i && t)
11572
11572
  return t - i;
11573
11573
  });
11574
- this.options = new Ew(S(S({}, yf), Uw(t)));
11574
+ this.options = new Cw(S(S({}, vf), Pw(t)));
11575
11575
  const i = ["localhost", "127.0.0.1"];
11576
11576
  t.telemetryEnabled === void 0 && i.includes(location.hostname) && this.options.set("telemetryEnabled", !1);
11577
11577
  const n = {
@@ -11621,7 +11621,7 @@ const Lt = class Lt extends Ii {
11621
11621
  }
11622
11622
  };
11623
11623
  const b = Jh.create(this.emitter), v = this.options.get("poster"), k = v === !0 ? this.getThumbnailUrl() : v || void 0;
11624
- let I, x, T;
11624
+ let C, x, T;
11625
11625
  if (this.willUseMediaSource()) {
11626
11626
  const y = new Eh({
11627
11627
  type: this.options.get("media") == "audio" ? "audio" : "video",
@@ -11631,8 +11631,8 @@ const Lt = class Lt extends Ii {
11631
11631
  logger: this.logger.createContext("MediaElement"),
11632
11632
  poster: k
11633
11633
  });
11634
- y.on("buffer state", (E) => this.emitter.emit("buffer state", E)), y.on("needs user input", (E) => this.emitter.emit("needs user input", E)), y.on("volume state", (E) => this.emit("volume state", E)), y.on("media element state", (E) => this.onMediaElementState(E)), this.element = y.element, this.playbackSource = y, Wu.isSupported() && this.encryptedMediaExtensions.attach(y.element), I = nu.create(this.logger.createContext("MseModule"), this.emitter, this.element), this.options.get("pauseSupportEnabled") || (x = Qo.create(this.logger.createContext("UnpauseModule"), y, b)), this.options.get("pictureInPictureEnabled") && this.emitter.emit("add picture in picture listener", { element: y.element });
11635
- } else if (this.browser.platform.iosVersion >= 15 && this.options.get("iosMediaElementEnabled")) {
11634
+ y.on("buffer state", (E) => this.emitter.emit("buffer state", E)), y.on("needs user input", (E) => this.emitter.emit("needs user input", E)), y.on("volume state", (E) => this.emit("volume state", E)), y.on("media element state", (E) => this.onMediaElementState(E)), this.element = y.element, this.playbackSource = y, Wu.isSupported() && this.encryptedMediaExtensions.attach(y.element), C = nu.create(this.logger.createContext("MseModule"), this.emitter, this.element), this.options.get("pauseSupportEnabled") || (x = Qo.create(this.logger.createContext("UnpauseModule"), y, b)), this.options.get("pictureInPictureEnabled") && this.emitter.emit("add picture in picture listener", { element: y.element });
11635
+ } else if (this.browser.platform.iosVersion >= 15 && this.options.get("iosMediaElementEnabled") && this.browser.supportsCanvasCaptureStream) {
11636
11636
  const y = su.create(
11637
11637
  this.emitter,
11638
11638
  this.logger.createContext("ModernCanvasModule"),
@@ -11655,7 +11655,7 @@ const Lt = class Lt extends Ii {
11655
11655
  this.options.get("muted") || this.options.get("media") === "video",
11656
11656
  this.options.get("volume")
11657
11657
  );
11658
- this.element = y.element(), this.playbackSource = y, T = y, this.options.get("iosWakeLockEnabled") && (this.wakeLock = new Ag());
11658
+ this.element = y.element(), this.playbackSource = y, T = y, this.options.get("iosWakeLockEnabled") && (this.wakeLock = new bg());
11659
11659
  }
11660
11660
  this.emitter.on("channel reset", this.resetModules), this.emitter.on("no data timeout", this.resetModules), this.emitter.on("media element state", (y) => this.onMediaElementState(y)), this.emitter.on("volume state", (y) => this.emit("volume state", y)), this.options.get("pauseSupportEnabled") || this.emitter.on("exit picture in picture", () => h.setTimeout(() => this.play(), 0)), this.emitter.on("constraint cap changed", (y) => {
11661
11661
  this.logger.info("new cap set", { cap: y }), this.alignSizeAndBitRate(this.targetSubscription);
@@ -11676,7 +11676,7 @@ const Lt = class Lt extends Ii {
11676
11676
  this.playbackSource,
11677
11677
  A,
11678
11678
  this.willUseMediaSource() && !U
11679
- ), Q = wu.create(this.logger.createContext("JitterModule")), H = (this.options.get("edgeUrl") || this.options.get("url")).replace("wss://", "https://").replace("ws://", "http://").replace("//lb.", "//errors."), Ve = new URL("/telemetry", H).toString(), ie = Ho.create(
11679
+ ), Q = wu.create(this.logger.createContext("JitterModule")), z = (this.options.get("edgeUrl") || this.options.get("url")).replace("wss://", "https://").replace("ws://", "http://").replace("//lb.", "//errors."), Ve = new URL("/telemetry", z).toString(), ie = zo.create(
11680
11680
  this.logger.createContext("TelemetryModule"),
11681
11681
  this.emitter,
11682
11682
  {
@@ -11689,7 +11689,7 @@ const Lt = class Lt extends Ii {
11689
11689
  );
11690
11690
  this.modules = {
11691
11691
  telemetry: ie,
11692
- bufferTime: Ih.create(
11692
+ bufferTime: Ch.create(
11693
11693
  this.emitter,
11694
11694
  this.logger.createContext("BufferTimeModule"),
11695
11695
  g,
@@ -11725,7 +11725,7 @@ const Lt = class Lt extends Ii {
11725
11725
  subscription: l,
11726
11726
  renditions: p,
11727
11727
  qualityOfService: g,
11728
- mseModule: I,
11728
+ mseModule: C,
11729
11729
  unpause: x,
11730
11730
  canvasModule: T
11731
11731
  }, this.modules.adaptivity.isEnabled = this.options.get("abrEnabled"), this.emitter.on("page active", (y) => {
@@ -11761,7 +11761,7 @@ const Lt = class Lt extends Ii {
11761
11761
  }), this.emitter.once("connect info", (y) => {
11762
11762
  var O, M, V;
11763
11763
  const j = ((M = (O = y.telemetry) == null ? void 0 : O.probability) != null ? M : 1) >= Math.random();
11764
- y.telemetry && ((V = this.modules.telemetry) == null || V.unload(), this.modules.telemetry = Ho.create(
11764
+ y.telemetry && ((V = this.modules.telemetry) == null || V.unload(), this.modules.telemetry = zo.create(
11765
11765
  this.logger.createContext("TelemetryModule"),
11766
11766
  this.emitter,
11767
11767
  _(S({}, y.telemetry), {
@@ -11833,7 +11833,7 @@ const Lt = class Lt extends Ii {
11833
11833
  break;
11834
11834
  case "subscription changed":
11835
11835
  try {
11836
- Pw(E.subscription);
11836
+ Mw(E.subscription);
11837
11837
  } catch (M) {
11838
11838
  this.emitter.emit(
11839
11839
  "error",
@@ -11857,7 +11857,7 @@ const Lt = class Lt extends Ii {
11857
11857
  }), this.emitter.on("channel switch timeout", (y) => {
11858
11858
  this.emit("error", Vu(y)), this.emit("channel switch failed", { channelId: this.currentSubscription.channelId });
11859
11859
  }), this.emitter.on("received data", (y) => {
11860
- const E = this.modules.subscription.getCurrentSubscription(), j = pg(y);
11860
+ const E = this.modules.subscription.getCurrentSubscription(), j = Ag(y);
11861
11861
  if (!E) {
11862
11862
  this.logger.warn("Received unwanted message", S({}, j));
11863
11863
  return;
@@ -11882,7 +11882,7 @@ const Lt = class Lt extends Ii {
11882
11882
  }), this.modules.incomingData.add(E, y.payload.rawBytes().byteLength), M.fragment().emsgs.forEach((Z) => {
11883
11883
  if (!Z.presentationTime)
11884
11884
  return;
11885
- const ce = Gf(Z.data);
11885
+ const ce = Wf(Z.data);
11886
11886
  ce && this.modules.event.addEvent({
11887
11887
  id: Z.id,
11888
11888
  timestamp: Z.presentationTime / Z.timescale * 1e3 - this.modules.sync.getTimeshiftOffset(),
@@ -11925,11 +11925,11 @@ const Lt = class Lt extends Ii {
11925
11925
  const E = y.channelId;
11926
11926
  a(this, Ss) && (yield a(this, Ss));
11927
11927
  const j = this.modules.renditions.getRendition(y.renditionId, E);
11928
- if (!lg(y.flags)) {
11929
- if (mg(y.flags)) {
11928
+ if (!fg(y.flags)) {
11929
+ if (pg(y.flags)) {
11930
11930
  const M = new TextDecoder().decode(y.payload), V = this.modules.sync.getTimeshiftOffset();
11931
11931
  if (y.renditionId !== 0) {
11932
- const q = Im(M);
11932
+ const q = Cm(M);
11933
11933
  if (q && q.language !== void 0) {
11934
11934
  const Z = new rl().parse(q.content || ""), ce = V / 1e3, Ge = a(this, Ne).find((se) => se.language === q.language), je = ce - a(this, ys);
11935
11935
  if (m(this, ys, ce), Ge) {
@@ -11949,26 +11949,26 @@ const Lt = class Lt extends Ii {
11949
11949
  type: "metadata"
11950
11950
  });
11951
11951
  } else if (j != null && j.codec) {
11952
- const O = Cm(j.codec);
11952
+ const O = Im(j.codec);
11953
11953
  if (O === "text")
11954
11954
  throw new Error("Subtitles are not supported");
11955
- if (this.modules.incomingData.add(O, y.payload.byteLength), dg(y.flags)) {
11955
+ if (this.modules.incomingData.add(O, y.payload.byteLength), mg(y.flags)) {
11956
11956
  const M = _(S({
11957
11957
  type: O,
11958
11958
  data: y.payload,
11959
11959
  codec: j.codec
11960
11960
  }, y), {
11961
11961
  channelId: E
11962
- }), V = rg(M.codec, M.payload);
11962
+ }), V = og(M.codec, M.payload);
11963
11963
  V && this.sizes.set(M.renditionId, V);
11964
11964
  const q = ii({ codec: j.codec, codecString: j.codecString });
11965
11965
  this.emitter.emit("init segment", { initSegment: M, mimeType: q }), this.emit("initialized media");
11966
11966
  } else {
11967
- const M = Cw(y, j, this.sizes.get(y.renditionId));
11967
+ const M = Bw(y, j, this.sizes.get(y.renditionId));
11968
11968
  this.modules.jitter.recordSample(M);
11969
11969
  let V = this.sampleProcessingSesssions.get(O);
11970
11970
  if (!V)
11971
- V = Iw(
11971
+ V = Rw(
11972
11972
  this.modules.sync.processSample(M)
11973
11973
  ), this.sampleProcessingSesssions.set(O, V);
11974
11974
  else {
@@ -12417,20 +12417,20 @@ const Lt = class Lt extends Ii {
12417
12417
  ys = new WeakMap(), Ne = new WeakMap(), Ss = new WeakMap(), r(Lt, "MAX_POOL_SIZE", 10), r(Lt, "DISCONNECT_TIMEOUT", 15 * 1e3), r(Lt, "REMOVE_CUE_THRESHOLD", 1e3 * 10);
12418
12418
  let pd = Lt;
12419
12419
  export {
12420
- of as A,
12421
- Hm as C,
12422
- tf as D,
12420
+ hf as A,
12421
+ Xm as C,
12422
+ nf as D,
12423
12423
  ee as F,
12424
- $m as I,
12424
+ Km as I,
12425
12425
  we as L,
12426
- Jm as N,
12426
+ Ym as N,
12427
12427
  pd as V,
12428
- Qm as a,
12429
- Dw as b,
12430
- qm as c,
12431
- df as d,
12432
- Xm as e,
12433
- Zm as f,
12428
+ qm as a,
12429
+ Ow as b,
12430
+ Jm as c,
12431
+ mf as d,
12432
+ Zm as e,
12433
+ $m as f,
12434
12434
  L as g,
12435
12435
  Om as i,
12436
12436
  D as n