@vindral/web-sdk 4.1.4-5-ge6e3510c → 4.1.4-6-g7bc4e5ae

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.
@@ -296,17 +296,11 @@ class Oc {
296
296
  }
297
297
  }
298
298
  Ut = new WeakMap(), zs = new WeakMap(), Ye = new WeakMap(), xr = new WeakMap();
299
- function bu(s) {
300
- const e = atob(s), t = new Uint8Array(e.length);
301
- for (let i = 0; i < e.length; i++)
302
- t[i] = e.charCodeAt(i);
303
- return t.buffer;
304
- }
305
299
  function R(s) {
306
300
  return typeof BigInt == "function" ? BigInt(s) : s;
307
301
  }
308
302
  var Lr, ut, Je;
309
- class yu {
303
+ class bu {
310
304
  constructor(e, t = 0) {
311
305
  u(this, Lr);
312
306
  u(this, ut);
@@ -338,7 +332,6 @@ class yu {
338
332
  return t - 1;
339
333
  });
340
334
  // Safety: We assume that base has enough elements
341
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
342
335
  r(this, "getBit", (e, t) => {
343
336
  if (e.byteLength * 8 <= t)
344
337
  throw new Error("BitReader: Out of bounds");
@@ -351,59 +344,7 @@ class yu {
351
344
  }
352
345
  }
353
346
  Lr = new WeakMap(), ut = new WeakMap(), Je = new WeakMap();
354
- function Br() {
355
- const s = self.MediaSource, e = self.ManagedMediaSource;
356
- return s != null ? s : e;
357
- }
358
- const mm = new RegExp(
359
- "(android|bbd+|meego).+mobile|avantgo|bada/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)/|plucker|pocket|psp|series(4|6)0|symbian|treo|up.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/",
360
- "i"
361
- ), Ee = navigator.userAgent.toLowerCase(), fm = mm.test(Ee), pm = () => {
362
- const s = document.createElement("video");
363
- return s.canPlayType("application/vnd.apple.mpegURL") !== "" || s.canPlayType("audio/mpegurl") !== "";
364
- }, gm = () => {
365
- try {
366
- if (typeof WebAssembly == "object" && typeof WebAssembly.instantiate == "function") {
367
- const s = new WebAssembly.Module(Uint8Array.of(0, 97, 115, 109, 1, 0, 0, 0));
368
- if (s instanceof WebAssembly.Module) return new WebAssembly.Instance(s) instanceof WebAssembly.Instance;
369
- }
370
- } catch (s) {
371
- return !1;
372
- }
373
- return !1;
374
- }, Am = () => Ee.indexOf("CrKey") !== -1, vu = () => navigator.platform === "MacIntel" && navigator.maxTouchPoints === 0, Mc = () => navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1, wm = () => Ee.indexOf("iphone") >= 0 && Ee.indexOf("like iphone") < 0 || Ee.indexOf("ipad") >= 0 && Ee.indexOf("like ipad") < 0 || Ee.indexOf("ipod") >= 0 && Ee.indexOf("like ipod") < 0 || Mc(), bm = () => {
375
- var s, e;
376
- return Mc() ? !1 : (e = (s = Br()) == null ? void 0 : s.isTypeSupported('audio/mp4; codecs="opus"')) != null ? e : !1;
377
- }, uw = () => "ontouchstart" in window || navigator.maxTouchPoints > 0, ym = () => /^(?!.*chrome).*safari/i.test(Ee);
378
- function vm() {
379
- var s, e;
380
- if (/(iPhone|iPod|iPad)/i.test(Ee))
381
- return (e = (s = Ee == null ? void 0 : Ee.match(/OS [\d_]+/i)) == null ? void 0 : s[0]) == null ? void 0 : e.substring(3).split("_").map((t) => parseInt(t))[0];
382
- }
383
- function Sm() {
384
- var s, e;
385
- if (/^((?!chrome|android).)*safari/i.test(Ee))
386
- return (e = (s = Ee.match(/version\/([\d.]+)/)) == null ? void 0 : s[1]) == null ? void 0 : e.split(".").map((t) => parseInt(t))[0];
387
- }
388
- const Su = () => {
389
- var t, i;
390
- const s = !!Br();
391
- let e = !1;
392
- return s && (e = bm()), {
393
- isMobile: fm,
394
- supportsMp4Opus: e,
395
- supportsMediaSource: s,
396
- supportsHls: pm(),
397
- supportsWebAssembly: gm(),
398
- platform: {
399
- iosVersion: (t = vm()) != null ? t : Number.MAX_SAFE_INTEGER,
400
- safariVersion: (i = Sm()) != null ? i : Number.MAX_SAFE_INTEGER,
401
- isIpadOS: Mc(),
402
- isMacOS: vu(),
403
- isIOS: wm()
404
- }
405
- };
406
- }, td = (s, e, t) => {
347
+ const td = (s, e, t) => {
407
348
  let i = 0;
408
349
  for (let n = e; n <= t; n++)
409
350
  if (n === e) {
@@ -469,7 +410,7 @@ class Qn {
469
410
  }
470
411
  }
471
412
  se = new WeakMap(), Pt = new WeakMap(), Kt = new WeakMap();
472
- class Em {
413
+ class mm {
473
414
  constructor(e = 100, t = 100) {
474
415
  r(this, "resizeSteps");
475
416
  r(this, "internalBuffer");
@@ -539,6 +480,62 @@ class Em {
539
480
  }
540
481
  }
541
482
  }
483
+ function yu(s) {
484
+ const e = atob(s), t = new Uint8Array(e.length);
485
+ for (let i = 0; i < e.length; i++)
486
+ t[i] = e.charCodeAt(i);
487
+ return t.buffer;
488
+ }
489
+ function Br() {
490
+ const s = self.MediaSource, e = self.ManagedMediaSource;
491
+ return s != null ? s : e;
492
+ }
493
+ const fm = /(android|bbd+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up.(browser|link)|vodafone|wap|windows ce|xda|xiino\/i.test(a)||\/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-\//i, Ee = navigator.userAgent.toLowerCase(), pm = fm.test(Ee), gm = () => {
494
+ const s = document.createElement("video");
495
+ return s.canPlayType("application/vnd.apple.mpegURL") !== "" || s.canPlayType("audio/mpegurl") !== "";
496
+ }, Am = () => {
497
+ try {
498
+ if (typeof WebAssembly == "object" && typeof WebAssembly.instantiate == "function") {
499
+ const s = new WebAssembly.Module(Uint8Array.of(0, 97, 115, 109, 1, 0, 0, 0));
500
+ if (s instanceof WebAssembly.Module) return new WebAssembly.Instance(s) instanceof WebAssembly.Instance;
501
+ }
502
+ } catch (s) {
503
+ return !1;
504
+ }
505
+ return !1;
506
+ }, wm = () => Ee.indexOf("CrKey") !== -1, vu = () => navigator.platform === "MacIntel" && navigator.maxTouchPoints === 0, Mc = () => navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1, bm = () => Ee.indexOf("iphone") >= 0 && Ee.indexOf("like iphone") < 0 || Ee.indexOf("ipad") >= 0 && Ee.indexOf("like ipad") < 0 || Ee.indexOf("ipod") >= 0 && Ee.indexOf("like ipod") < 0 || Mc(), ym = () => {
507
+ var s, e;
508
+ return Mc() ? !1 : (e = (s = Br()) == null ? void 0 : s.isTypeSupported('audio/mp4; codecs="opus"')) != null ? e : !1;
509
+ }, uw = () => "ontouchstart" in window || navigator.maxTouchPoints > 0, vm = () => /^(?!.*chrome).*safari/i.test(Ee);
510
+ function Sm() {
511
+ var s, e;
512
+ if (/(iPhone|iPod|iPad)/i.test(Ee))
513
+ return (e = (s = Ee == null ? void 0 : Ee.match(/OS [\d_]+/i)) == null ? void 0 : s[0]) == null ? void 0 : e.substring(3).split("_").map((t) => parseInt(t))[0];
514
+ }
515
+ function Em() {
516
+ var s, e;
517
+ if (/^((?!chrome|android).)*safari/i.test(Ee))
518
+ return (e = (s = Ee.match(/version\/([\d.]+)/)) == null ? void 0 : s[1]) == null ? void 0 : e.split(".").map((t) => parseInt(t))[0];
519
+ }
520
+ const Su = () => {
521
+ var t, i;
522
+ const s = !!Br();
523
+ let e = !1;
524
+ return s && (e = ym()), {
525
+ isMobile: pm,
526
+ supportsMp4Opus: e,
527
+ supportsMediaSource: s,
528
+ supportsHls: gm(),
529
+ supportsWebAssembly: Am(),
530
+ platform: {
531
+ iosVersion: (t = Sm()) != null ? t : Number.MAX_SAFE_INTEGER,
532
+ safariVersion: (i = Em()) != null ? i : Number.MAX_SAFE_INTEGER,
533
+ isIpadOS: Mc(),
534
+ isMacOS: vu(),
535
+ isIOS: bm()
536
+ }
537
+ };
538
+ };
542
539
  class Is {
543
540
  constructor(e, t, i) {
544
541
  r(this, "onSuccess");
@@ -565,10 +562,7 @@ const Ht = (s) => s.reduce((e, t) => e + t, 0) / s.length, Li = (s) => ({
565
562
  const { x: p, y: g } = s[m];
566
563
  e += p, t += g, i += p * g, n += p * p, o += g * g;
567
564
  }
568
- const c = (s.length * i - e * t) / (s.length * n - e * e), h = (t - c * e) / s.length, d = Math.pow(
569
- (s.length * i - e * t) / Math.sqrt((s.length * n - e * e) * (s.length * o - t * t)),
570
- 2
571
- );
565
+ const c = (s.length * i - e * t) / (s.length * n - e * e), h = (t - c * e) / s.length, d = ((s.length * i - e * t) / Math.sqrt((s.length * n - e * e) * (s.length * o - t * t))) ** 2;
572
566
  return { slope: c, intercept: h, r2: d, predict: (m) => c * (s.length + m) + h };
573
567
  };
574
568
  class Im {
@@ -806,22 +800,7 @@ const Sd = (s, e) => {
806
800
  return typeof t != "object" || e.forEach((i) => {
807
801
  delete t[i];
808
802
  }), t;
809
- }, Bi = (s, e = Date.now()) => {
810
- const t = s.length;
811
- if (t > 0) {
812
- const i = t - 1, n = s[i];
813
- n.end || (n.end = e);
814
- }
815
- }, Cs = (s, e = Date.now()) => {
816
- Bi(s), s.push({ start: e });
817
- }, ks = (s) => s.reduce((e, t) => {
818
- var i;
819
- return e + (((i = t.end) != null ? i : Date.now()) - t.start);
820
- }, 0), Ed = (s, e, t = Date.now()) => s.reduce((i, n) => {
821
- var h;
822
- const o = Math.max(t - e, n.start), c = (h = n.end) != null ? h : t;
823
- return Math.max(0, c - o) + i;
824
- }, 0), jo = class jo {
803
+ }, jo = class jo {
825
804
  constructor() {
826
805
  r(this, "pendingTimeouts", /* @__PURE__ */ new Set());
827
806
  r(this, "pendingIntervals", /* @__PURE__ */ new Set());
@@ -850,6 +829,22 @@ const Sd = (s, e) => {
850
829
  };
851
830
  r(jo, "create", () => new jo());
852
831
  let ge = jo;
832
+ const Bi = (s, e = Date.now()) => {
833
+ const t = s.length;
834
+ if (t > 0) {
835
+ const i = t - 1, n = s[i];
836
+ n.end || (n.end = e);
837
+ }
838
+ }, Cs = (s, e = Date.now()) => {
839
+ Bi(s), s.push({ start: e });
840
+ }, ks = (s) => s.reduce((e, t) => {
841
+ var i;
842
+ return e + (((i = t.end) != null ? i : Date.now()) - t.start);
843
+ }, 0), Ed = (s, e, t = Date.now()) => s.reduce((i, n) => {
844
+ var h;
845
+ const o = Math.max(t - e, n.start), c = (h = n.end) != null ? h : t;
846
+ return Math.max(0, c - o) + i;
847
+ }, 0);
853
848
  function Tu(s) {
854
849
  try {
855
850
  return s();
@@ -884,39 +879,7 @@ const Td = () => {
884
879
  }, yi = () => Number.MAX_SAFE_INTEGER, uo = () => ({
885
880
  width: Number.MAX_SAFE_INTEGER,
886
881
  height: Number.MAX_SAFE_INTEGER
887
- }), Id = (s) => !(typeof s != "object" || s === null || !("type" in s)), Um = {
888
- sizeBasedResolutionCapEnabled: !0,
889
- pictureInPictureEnabled: !0,
890
- abrEnabled: !0,
891
- burstEnabled: !1,
892
- mseEnabled: !0,
893
- mseOpusEnabled: !1,
894
- muted: !1,
895
- minBufferTime: 1500,
896
- maxBufferTime: 1500,
897
- logLevel: Cm.OFF,
898
- maxSize: uo(),
899
- maxVideoBitRate: yi(),
900
- maxAudioBitRate: yi(),
901
- tags: [],
902
- media: "audio+video",
903
- poster: !0,
904
- reconnectHandler: (s) => s.reconnectRetries < 30,
905
- iosWakeLockEnabled: !1,
906
- telemetryEnabled: !0,
907
- iosMediaElementEnabled: !1,
908
- pauseSupportEnabled: !0,
909
- advanced: {
910
- // Allow 1280 in both directions to support portait mode as well
911
- wasmDecodingConstraint: {
912
- bitRate: Number.MAX_SAFE_INTEGER,
913
- width: 1280,
914
- height: 1280
915
- }
916
- },
917
- videoCodecs: ["av1", "h264"],
918
- webtransportEnabled: !0
919
- }, Pm = "connection_failed", xm = "connection_failed_will_not_attempt_again", Lm = "authentication_error", Dm = "authentication_expired", Om = "channel_not_found", Mm = "no_incoming_data_error", Fm = "connection_inactivity", _m = "missing_init_segment", Nm = "no_track_context", Vm = "invalid_track_context_state", Gm = "disconnected_by_edge", jm = "decoder_error", Wm = "audio_player_error", zm = "media_source_error", Hm = "webgl_context_lost_error", Xm = "access_forbidden", Qm = "channel_switch_failed", Zm = "drm_error";
882
+ }), Id = (s) => !(typeof s != "object" || s === null || !("type" in s)), Um = "connection_failed", Pm = "connection_failed_will_not_attempt_again", xm = "authentication_error", Lm = "authentication_expired", Dm = "channel_not_found", Om = "no_incoming_data_error", Mm = "connection_inactivity", Fm = "missing_init_segment", _m = "no_track_context", Nm = "invalid_track_context_state", Vm = "disconnected_by_edge", Gm = "decoder_error", jm = "audio_player_error", Wm = "media_source_error", zm = "webgl_context_lost_error", Hm = "access_forbidden", Xm = "channel_switch_failed", Qm = "drm_error";
920
883
  class x extends Error {
921
884
  constructor(t, i, n = {}) {
922
885
  super(t);
@@ -959,141 +922,74 @@ class x extends Error {
959
922
  this.props = i, this.extra = n, Object.setPrototypeOf(this, new.target.prototype);
960
923
  }
961
924
  }
962
- const qm = (s, e) => new x(
925
+ const Zm = (s, e) => new x(
963
926
  "MediaElement Error",
964
927
  { isFatal: s, code: "media_element_error", source: e },
965
928
  { mediaErrorCode: e.code }
966
- ), $m = (s, e) => new x("Decoder Error", { isFatal: s, code: jm, source: e, type: "internal" }), Iu = (s, e) => new x("Audio Player Error", { isFatal: s, code: Wm, source: e, type: "internal" }), Ym = (s, e) => new x(`No init segment for rendition id ${s} for channel ${e}`, {
929
+ ), qm = (s, e) => new x("Decoder Error", { isFatal: s, code: Gm, source: e, type: "internal" }), Iu = (s, e) => new x("Audio Player Error", { isFatal: s, code: jm, source: e, type: "internal" }), $m = (s, e) => new x(`No init segment for rendition id ${s} for channel ${e}`, {
967
930
  isFatal: !1,
968
- code: _m,
931
+ code: Fm,
969
932
  type: "internal"
970
933
  }), Cd = (s, e, t, i) => new x(
971
934
  "MediaSource Error",
972
- { isFatal: s, code: zm, source: e, type: "internal" },
935
+ { isFatal: s, code: Wm, source: e, type: "internal" },
973
936
  { type: i, consecutiveErrorsCount: t }
974
937
  ), Ya = (s, e) => new x(`No track context for ${s}${e ? `, rendition id ${e}` : ""}`, {
975
938
  isFatal: !1,
976
- code: Nm,
939
+ code: _m,
977
940
  type: "internal"
978
- }), Jm = (s, e) => new x(
941
+ }), Ym = (s, e) => new x(
979
942
  `Track context is in an invalid state for ${s}${e ? `, rendition id ${e}` : ""}`,
980
943
  {
981
944
  isFatal: !1,
982
- code: Vm,
945
+ code: Nm,
983
946
  type: "internal"
984
947
  }
985
- ), Km = () => new x("Web Audio Context resume timeout", { isFatal: !1, code: "web_audio_context_resume_timeout" }), Jn = (s) => new x("Disconnected From Edge Server", {
948
+ ), Jm = () => new x("Web Audio Context resume timeout", { isFatal: !1, code: "web_audio_context_resume_timeout" }), Jn = (s) => new x("Disconnected From Edge Server", {
986
949
  type: "external",
987
950
  source: s,
988
951
  isFatal: !1,
989
- code: Gm
990
- }), lo = (s) => new x("Authentication Failed", { isFatal: !0, code: Lm, source: s }), ef = (s) => new x("Authentication Expired", { isFatal: !0, code: Dm, source: s }), tf = (s, e) => new x("Connection closed due to inactivity", { isFatal: !1, code: Fm, source: e, type: s }), Cu = (s, e) => new x("Channel not found", { isFatal: !1, code: Om, source: e, type: s }), sf = (s) => new x("No Incoming Data", { isFatal: !1, code: Mm, source: s }), nf = (s) => new x("Connection attempt failed", {
952
+ code: Vm
953
+ }), lo = (s) => new x("Authentication Failed", { isFatal: !0, code: xm, source: s }), Km = (s) => new x("Authentication Expired", { isFatal: !0, code: Lm, source: s }), ef = (s, e) => new x("Connection closed due to inactivity", { isFatal: !1, code: Mm, source: e, type: s }), Cu = (s, e) => new x("Channel not found", { isFatal: !1, code: Dm, source: e, type: s }), tf = (s) => new x("No Incoming Data", { isFatal: !1, code: Om, source: s }), sf = (s) => new x("Connection attempt failed", {
991
954
  isFatal: !1,
992
- code: Pm,
955
+ code: Um,
993
956
  source: s
994
957
  }), ku = () => new x("Connection failed - no more reconnect attempts", {
995
958
  isFatal: !0,
996
- code: xm
997
- }), rf = (s) => new x("WebGL Context Lost", { isFatal: !1, code: Hm, source: s, type: "internal" }), kd = (s) => new x(s, { isFatal: !0, code: Xm }), Bd = (s) => new x(`Channel switch to '${s}' failed`, { isFatal: !1, code: Qm }), Bu = (s, e = !1, t) => new x(s, { isFatal: e, code: Zm, source: t }), Rd = (s, e) => s && typeof s == "object" && e in s, af = (s) => !(typeof s != "object" || !Rd(s, "channelId") || typeof s.channelId != "string" || !Rd(s, "url") || typeof s.url != "string" || s.channelId.length === 0 || s.url.length === 0), of = (s) => {
998
- if (!af(s))
999
- throw new x("Invalid options", { isFatal: !0, code: "invalid_options" });
1000
- const e = v({}, s);
1001
- return Object.keys(e).forEach((t) => {
1002
- const i = e;
1003
- typeof i[t] == "undefined" && delete i[t];
1004
- }), e;
1005
- }, Ud = {
1006
- playready: ["150", "2000", "3000"],
1007
- widevine: ["SW_SECURE_CRYPTO", "SW_SECURE_DECODE", "HW_SECURE_CRYPTO", "HW_SECURE_DECODE", "HW_SECURE_ALL"],
1008
- fairplay: [""],
1009
- clearkey: [""]
1010
- }, Hc = {
1011
- initDataTypes: ["cenc"],
1012
- audioCapabilities: [
1013
- {
1014
- contentType: 'audio/mp4; codecs="mp4a.40.2"'
1015
- }
1016
- ],
1017
- videoCapabilities: [
1018
- {
1019
- contentType: 'video/mp4; codecs="avc1.42c01f"'
1020
- }
1021
- ]
1022
- }, cf = {
1023
- fairplay: {
1024
- keySystem: "com.apple.fps",
1025
- supportedConfig: {
1026
- initDataTypes: ["sinf"],
1027
- videoCapabilities: [
1028
- {
1029
- contentType: 'video/mp4; codecs="avc1.42c01f"'
1030
- }
1031
- ]
959
+ code: Pm
960
+ }), nf = (s) => new x("WebGL Context Lost", { isFatal: !1, code: zm, source: s, type: "internal" }), kd = (s) => new x(s, { isFatal: !0, code: Hm }), Bd = (s) => new x(`Channel switch to '${s}' failed`, { isFatal: !1, code: Xm }), Bu = (s, e = !1, t) => new x(s, { isFatal: e, code: Qm, source: t }), rf = {
961
+ sizeBasedResolutionCapEnabled: !0,
962
+ pictureInPictureEnabled: !0,
963
+ abrEnabled: !0,
964
+ burstEnabled: !1,
965
+ mseEnabled: !0,
966
+ mseOpusEnabled: !1,
967
+ muted: !1,
968
+ minBufferTime: 1500,
969
+ maxBufferTime: 1500,
970
+ logLevel: Cm.OFF,
971
+ maxSize: uo(),
972
+ maxVideoBitRate: yi(),
973
+ maxAudioBitRate: yi(),
974
+ tags: [],
975
+ media: "audio+video",
976
+ poster: !0,
977
+ reconnectHandler: (s) => s.reconnectRetries < 30,
978
+ iosWakeLockEnabled: !1,
979
+ telemetryEnabled: !0,
980
+ iosMediaElementEnabled: !1,
981
+ pauseSupportEnabled: !0,
982
+ advanced: {
983
+ // Allow 1280 in both directions to support portait mode as well
984
+ wasmDecodingConstraint: {
985
+ bitRate: Number.MAX_SAFE_INTEGER,
986
+ width: 1280,
987
+ height: 1280
1032
988
  }
1033
989
  },
1034
- playready: {
1035
- keySystem: "com.microsoft.playready",
1036
- supportedConfig: Hc
1037
- },
1038
- widevine: {
1039
- keySystem: "com.widevine.alpha",
1040
- supportedConfig: Hc
1041
- },
1042
- clearkey: {
1043
- keySystem: "org.w3.clearkey",
1044
- supportedConfig: Hc
1045
- }
1046
- }, Ru = (s, e) => f(null, null, function* () {
1047
- return navigator.requestMediaKeySystemAccess(s, [e]).catch(() => {
1048
- });
1049
- }), Pd = (s, e, t, i, n, o) => f(null, null, function* () {
1050
- let c;
1051
- for (const h of i) {
1052
- const d = t == null ? void 0 : t.map((p) => F(v({}, p), {
1053
- robustness: h,
1054
- contentType: o ? `${n === "audioCapabilities" ? "audio/mp4" : "video/mp4"}; codecs="${o}"` : p.contentType
1055
- }));
1056
- if (!(yield Ru(s, {
1057
- initDataTypes: e,
1058
- [n]: d
1059
- })))
1060
- break;
1061
- c = d;
1062
- }
1063
- return c;
1064
- }), hf = (s, e, t, i) => f(null, null, function* () {
1065
- const { keySystem: n, supportedConfig: o } = cf[s], { initDataTypes: c, videoCapabilities: h, audioCapabilities: d } = o, m = i == null ? void 0 : i[s], p = (m == null ? void 0 : m.videoRobustness) || Ud[s], g = (m == null ? void 0 : m.audioRobustness) || Ud[s], [w, b] = yield Promise.all([
1066
- Pd(
1067
- n,
1068
- c,
1069
- h,
1070
- p,
1071
- "videoCapabilities",
1072
- e
1073
- ),
1074
- Pd(
1075
- n,
1076
- c,
1077
- d,
1078
- g,
1079
- "audioCapabilities",
1080
- t
1081
- )
1082
- ]);
1083
- return !w && !b ? void 0 : yield Ru(n, {
1084
- initDataTypes: c,
1085
- videoCapabilities: w,
1086
- audioCapabilities: b
1087
- });
1088
- }), df = (s, e, t, i) => f(null, null, function* () {
1089
- let n;
1090
- for (const o of s)
1091
- if (n = yield hf(o, e, t, i), n)
1092
- return {
1093
- keySystem: o,
1094
- mediaKeySystemAccess: n
1095
- };
1096
- });
990
+ videoCodecs: ["av1", "h264"],
991
+ webtransportEnabled: !0
992
+ };
1097
993
  var Ni, Vi;
1098
994
  class Fc {
1099
995
  constructor(e, t, i, n) {
@@ -1137,20 +1033,20 @@ class Fc {
1137
1033
  }
1138
1034
  }
1139
1035
  Ni = new WeakMap(), Vi = new WeakMap();
1140
- function Uu(s) {
1036
+ function Ru(s) {
1141
1037
  const e = window.atob(s.replace(/-/g, "+").replace(/_/g, "/"));
1142
1038
  let t = "";
1143
1039
  for (let i = 0; i < e.length; i++)
1144
1040
  t += ("0" + e.charCodeAt(i).toString(16)).substr(-2);
1145
1041
  return t;
1146
1042
  }
1147
- function uf(s) {
1043
+ function af(s) {
1148
1044
  let e = "";
1149
1045
  for (let t = 0; t < s.length; t += 2)
1150
1046
  e += String.fromCharCode(parseInt(s.substr(t, 2), 16));
1151
1047
  return window.btoa(e).replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_");
1152
1048
  }
1153
- function lf(s, e) {
1049
+ function of(s, e) {
1154
1050
  if (s.byteLength !== e.byteLength) return !1;
1155
1051
  const t = new Uint8Array(s), i = new Uint8Array(e);
1156
1052
  for (let n = 0; n < t.length; n++)
@@ -1158,7 +1054,7 @@ function lf(s, e) {
1158
1054
  return !0;
1159
1055
  }
1160
1056
  var Mr;
1161
- class mf extends Fc {
1057
+ class cf extends Fc {
1162
1058
  constructor(t, i) {
1163
1059
  super("clearkey", t, "");
1164
1060
  u(this, Mr);
@@ -1169,12 +1065,12 @@ class mf extends Fc {
1169
1065
  for (let m = 0; m < o.kids.length; m++) {
1170
1066
  const p = o.kids[m];
1171
1067
  if (p) {
1172
- const g = Uu(p).toLowerCase(), w = a(this, Mr)[g];
1068
+ const g = Ru(p).toLowerCase(), w = a(this, Mr)[g];
1173
1069
  w && c.push({
1174
1070
  kty: "oct",
1175
1071
  alg: "A128KW",
1176
1072
  kid: p,
1177
- k: uf(w)
1073
+ k: af(w)
1178
1074
  });
1179
1075
  }
1180
1076
  }
@@ -1186,12 +1082,104 @@ class mf extends Fc {
1186
1082
  }
1187
1083
  }
1188
1084
  Mr = new WeakMap();
1189
- class ff extends Fc {
1085
+ const Rd = {
1086
+ playready: ["150", "2000", "3000"],
1087
+ widevine: ["SW_SECURE_CRYPTO", "SW_SECURE_DECODE", "HW_SECURE_CRYPTO", "HW_SECURE_DECODE", "HW_SECURE_ALL"],
1088
+ fairplay: [""],
1089
+ clearkey: [""]
1090
+ }, Hc = {
1091
+ initDataTypes: ["cenc"],
1092
+ audioCapabilities: [
1093
+ {
1094
+ contentType: 'audio/mp4; codecs="mp4a.40.2"'
1095
+ }
1096
+ ],
1097
+ videoCapabilities: [
1098
+ {
1099
+ contentType: 'video/mp4; codecs="avc1.42c01f"'
1100
+ }
1101
+ ]
1102
+ }, hf = {
1103
+ fairplay: {
1104
+ keySystem: "com.apple.fps",
1105
+ supportedConfig: {
1106
+ initDataTypes: ["sinf"],
1107
+ videoCapabilities: [
1108
+ {
1109
+ contentType: 'video/mp4; codecs="avc1.42c01f"'
1110
+ }
1111
+ ]
1112
+ }
1113
+ },
1114
+ playready: {
1115
+ keySystem: "com.microsoft.playready",
1116
+ supportedConfig: Hc
1117
+ },
1118
+ widevine: {
1119
+ keySystem: "com.widevine.alpha",
1120
+ supportedConfig: Hc
1121
+ },
1122
+ clearkey: {
1123
+ keySystem: "org.w3.clearkey",
1124
+ supportedConfig: Hc
1125
+ }
1126
+ }, Uu = (s, e) => f(null, null, function* () {
1127
+ return navigator.requestMediaKeySystemAccess(s, [e]).catch(() => {
1128
+ });
1129
+ }), Ud = (s, e, t, i, n, o) => f(null, null, function* () {
1130
+ let c;
1131
+ for (const h of i) {
1132
+ const d = t == null ? void 0 : t.map((p) => F(v({}, p), {
1133
+ robustness: h,
1134
+ contentType: o ? `${n === "audioCapabilities" ? "audio/mp4" : "video/mp4"}; codecs="${o}"` : p.contentType
1135
+ }));
1136
+ if (!(yield Uu(s, {
1137
+ initDataTypes: e,
1138
+ [n]: d
1139
+ })))
1140
+ break;
1141
+ c = d;
1142
+ }
1143
+ return c;
1144
+ }), df = (s, e, t, i) => f(null, null, function* () {
1145
+ const { keySystem: n, supportedConfig: o } = hf[s], { initDataTypes: c, videoCapabilities: h, audioCapabilities: d } = o, m = i == null ? void 0 : i[s], p = (m == null ? void 0 : m.videoRobustness) || Rd[s], g = (m == null ? void 0 : m.audioRobustness) || Rd[s], [w, b] = yield Promise.all([
1146
+ Ud(
1147
+ n,
1148
+ c,
1149
+ h,
1150
+ p,
1151
+ "videoCapabilities",
1152
+ e
1153
+ ),
1154
+ Ud(
1155
+ n,
1156
+ c,
1157
+ d,
1158
+ g,
1159
+ "audioCapabilities",
1160
+ t
1161
+ )
1162
+ ]);
1163
+ return !w && !b ? void 0 : yield Uu(n, {
1164
+ initDataTypes: c,
1165
+ videoCapabilities: w,
1166
+ audioCapabilities: b
1167
+ });
1168
+ }), uf = (s, e, t, i) => f(null, null, function* () {
1169
+ let n;
1170
+ for (const o of s)
1171
+ if (n = yield df(o, e, t, i), n)
1172
+ return {
1173
+ keySystem: o,
1174
+ mediaKeySystemAccess: n
1175
+ };
1176
+ });
1177
+ class lf extends Fc {
1190
1178
  constructor(e, t, i) {
1191
1179
  super("fairplay", e, t, i);
1192
1180
  }
1193
1181
  }
1194
- const pf = (s) => {
1182
+ const mf = (s) => {
1195
1183
  var h, d, m, p;
1196
1184
  const e = String.fromCharCode(...new Uint16Array(s)), t = new window.DOMParser().parseFromString(e, "application/xml"), i = t.getElementsByTagName("HttpHeaders")[0];
1197
1185
  let n = {};
@@ -1212,7 +1200,7 @@ const pf = (s) => {
1212
1200
  message: c
1213
1201
  };
1214
1202
  };
1215
- class gf extends Fc {
1203
+ class ff extends Fc {
1216
1204
  constructor(e, t) {
1217
1205
  super("playready", e, t);
1218
1206
  }
@@ -1222,7 +1210,7 @@ class gf extends Fc {
1222
1210
  const t = new URL(this.licenseServerUrl);
1223
1211
  for (const [o, c] of Object.entries(this.queryParams))
1224
1212
  t.searchParams.append(o, c);
1225
- const i = pf(e), n = yield fetch(t, {
1213
+ const i = mf(e), n = yield fetch(t, {
1226
1214
  method: "POST",
1227
1215
  headers: v(v({}, i.headers), this.headers),
1228
1216
  body: i.message
@@ -1233,14 +1221,14 @@ class gf extends Fc {
1233
1221
  });
1234
1222
  }
1235
1223
  }
1236
- class Af extends Fc {
1224
+ class pf extends Fc {
1237
1225
  constructor(e, t) {
1238
1226
  super("widevine", e, t);
1239
1227
  }
1240
1228
  }
1241
- const wf = 5e3;
1229
+ const gf = 5e3;
1242
1230
  var V, Gi, xt, et, lt, de, ei, ti, Wo, Qs, Fr, _r, re, Pu, xu, Lu, Du, zo, Ho, Ou, tr, Xo, Mu, Fu;
1243
- class xd {
1231
+ class Pd {
1244
1232
  constructor(e, t, i = {}) {
1245
1233
  u(this, re);
1246
1234
  u(this, V);
@@ -1288,7 +1276,7 @@ class xd {
1288
1276
  u(this, Ho, (e) => {
1289
1277
  const t = e.target;
1290
1278
  a(this, V).debug("Key status changed for session", { sessionId: t.sessionId }), t.keyStatuses.forEach((i, n) => {
1291
- const o = Uu(window.btoa(String.fromCharCode(...new Uint8Array(n))));
1279
+ const o = Ru(window.btoa(String.fromCharCode(...new Uint8Array(n))));
1292
1280
  a(this, V).debug("Key status", { base64kid: o, status: i });
1293
1281
  });
1294
1282
  });
@@ -1298,7 +1286,7 @@ class xd {
1298
1286
  u(this, Xo, (e) => f(this, null, function* () {
1299
1287
  const t = A(this, re, Mu).call(this, e);
1300
1288
  a(this, V).debug("Prioritized key system list", { keySystemList: t });
1301
- const i = yield df(t, e.videoCodec, e.audioCodec, {
1289
+ const i = yield uf(t, e.videoCodec, e.audioCodec, {
1302
1290
  widevine: a(this, lt).widevine,
1303
1291
  playready: a(this, lt).playready
1304
1292
  });
@@ -1307,7 +1295,7 @@ class xd {
1307
1295
  a(this, V).debug("Supported key system found", i.mediaKeySystemAccess.getConfiguration());
1308
1296
  const { keySystem: n, mediaKeySystemAccess: o } = i;
1309
1297
  let c = null;
1310
- return n === "clearkey" ? (Qe(e.clearkeys, "No clearkeys found"), c = new mf(o, e.clearkeys)) : n === "playready" ? (Qe(e.playreadyLicenseUrl, "No playreadyLicenseUrl found"), c = new gf(o, e.playreadyLicenseUrl)) : n === "widevine" ? (Qe(e.widevineLicenseUrl, "No widevineLicenseUrl found"), c = new Af(o, e.widevineLicenseUrl)) : n === "fairplay" && (Qe(e.fairplayLicenseUrl, "No fairplayLicenseUrl found"), Qe(e.fairplayCertificate, "No fairplayCertificate found"), c = new ff(o, e.fairplayLicenseUrl, e.fairplayCertificate)), c && (c.headers = a(this, lt).headers || {}, c.queryParams = a(this, lt).queryParams || {}), c;
1298
+ return n === "clearkey" ? (Qe(e.clearkeys, "No clearkeys found"), c = new cf(o, e.clearkeys)) : n === "playready" ? (Qe(e.playreadyLicenseUrl, "No playreadyLicenseUrl found"), c = new ff(o, e.playreadyLicenseUrl)) : n === "widevine" ? (Qe(e.widevineLicenseUrl, "No widevineLicenseUrl found"), c = new pf(o, e.widevineLicenseUrl)) : n === "fairplay" && (Qe(e.fairplayLicenseUrl, "No fairplayLicenseUrl found"), Qe(e.fairplayCertificate, "No fairplayCertificate found"), c = new lf(o, e.fairplayLicenseUrl, e.fairplayCertificate)), c && (c.headers = a(this, lt).headers || {}, c.queryParams = a(this, lt).queryParams || {}), c;
1311
1299
  }));
1312
1300
  l(this, Gi, e), l(this, V, t), l(this, lt, i), a(this, Gi).on("received drm data", a(this, Fr));
1313
1301
  }
@@ -1338,14 +1326,14 @@ class xd {
1338
1326
  a(this, V).debug("DRM is not used, skipping channel switch handling");
1339
1327
  return;
1340
1328
  }
1341
- ym() && a(this, Wo).platform.safariVersion < 18 && A(this, re, tr).call(this, {
1329
+ vm() && a(this, Wo).platform.safariVersion < 18 && A(this, re, tr).call(this, {
1342
1330
  message: "DRM channel switch not supported on Safari < 18",
1343
1331
  isFatal: !0
1344
1332
  }), window.clearTimeout(a(this, Qs));
1345
1333
  const e = a(this, et).resolved;
1346
1334
  l(this, et, new z()), l(this, Qs, window.setTimeout(() => {
1347
1335
  a(this, et).resolve(e);
1348
- }, wf));
1336
+ }, gf));
1349
1337
  }
1350
1338
  }
1351
1339
  V = new WeakMap(), Gi = new WeakMap(), xt = new WeakMap(), et = new WeakMap(), lt = new WeakMap(), de = new WeakMap(), ei = new WeakMap(), ti = new WeakMap(), Wo = new WeakMap(), Qs = new WeakMap(), Fr = new WeakMap(), _r = new WeakMap(), re = new WeakSet(), Pu = function(e) {
@@ -1391,7 +1379,7 @@ V = new WeakMap(), Gi = new WeakMap(), xt = new WeakMap(), et = new WeakMap(), l
1391
1379
  });
1392
1380
  }, Du = function(e) {
1393
1381
  for (const [t, i] of a(this, ei))
1394
- if (lf(e, i)) return !1;
1382
+ if (of(e, i)) return !1;
1395
1383
  return !0;
1396
1384
  }, zo = new WeakMap(), Ho = new WeakMap(), Ou = function(e, t) {
1397
1385
  return f(this, null, function* () {
@@ -1421,28 +1409,28 @@ Mu = function(e) {
1421
1409
  clearkey: void 0
1422
1410
  };
1423
1411
  };
1424
- const bf = 7, yf = 8, vf = (s) => {
1412
+ const Af = 7, wf = 8, bf = (s) => {
1425
1413
  const e = s.getUint32(0, !1), t = s.getUint8(0) << 16 | s.getUint16(1, !1);
1426
1414
  let i = 0;
1427
1415
  return t === 1 ? i += 3 : e === 1 && (i += 4), i;
1428
- }, Sf = (s) => vf(new DataView(s, 0)) !== 0, Ld = (s, e = 0) => {
1416
+ }, yf = (s) => bf(new DataView(s, 0)) !== 0, xd = (s, e = 0) => {
1429
1417
  for (let t = e; t < s.byteLength - 4; t++) {
1430
1418
  const i = s.getUint32(t) === 1, n = (s.getUint8(t) << 16 | s.getUint16(t + 1)) === 1;
1431
1419
  if (i || n)
1432
1420
  return { position: t, nalPrefixSize: i ? 4 : 3 };
1433
1421
  }
1434
- }, Ef = (s) => s & 31, Tf = (s, e) => {
1422
+ }, vf = (s) => s & 31, Sf = (s, e) => {
1435
1423
  const t = new DataView(s, 0);
1436
- let i = Ld(t);
1424
+ let i = xd(t);
1437
1425
  for (; i; ) {
1438
- const { position: n, nalPrefixSize: o } = i, c = Ld(t, n + 4), h = c ? c.position - n - o : void 0;
1426
+ const { position: n, nalPrefixSize: o } = i, c = xd(t, n + 4), h = c ? c.position - n - o : void 0;
1439
1427
  if (!e(new DataView(s, n + o, h), o))
1440
1428
  return;
1441
1429
  i = c;
1442
1430
  }
1443
1431
  }, _u = (s) => {
1444
1432
  const e = [], t = [];
1445
- if (!Sf(s)) {
1433
+ if (!yf(s)) {
1446
1434
  const i = new DataView(s, 0), n = i.getUint8(5) & 31;
1447
1435
  let o = 6;
1448
1436
  for (let h = 0; h < n; h++) {
@@ -1460,21 +1448,21 @@ const bf = 7, yf = 8, vf = (s) => {
1460
1448
  pictureParameterSets: t
1461
1449
  };
1462
1450
  }
1463
- return Tf(s, (i) => {
1451
+ return Sf(s, (i) => {
1464
1452
  const n = i.byteOffset + i.byteLength;
1465
- switch (Ef(i.getUint8(0))) {
1466
- case yf:
1453
+ switch (vf(i.getUint8(0))) {
1454
+ case wf:
1467
1455
  t.push(i.buffer.slice(i.byteOffset, n));
1468
1456
  break;
1469
- case bf:
1457
+ case Af:
1470
1458
  e.push(i.buffer.slice(i.byteOffset, n));
1471
1459
  break;
1472
1460
  }
1473
1461
  return !0;
1474
1462
  }), { sequenceParameterSets: e, pictureParameterSets: t };
1475
- }, If = (s) => {
1463
+ }, Ef = (s) => {
1476
1464
  var S;
1477
- const e = new DataView(s), t = e.getUint8(1), i = e.getUint8(2), n = e.getUint8(3), o = new yu(s, 32);
1465
+ const e = new DataView(s), t = e.getUint8(1), i = e.getUint8(2), n = e.getUint8(3), o = new bu(s, 32);
1478
1466
  o.readUnsignedExpGolomb();
1479
1467
  let c = 1;
1480
1468
  switch (t) {
@@ -1519,7 +1507,7 @@ const bf = 7, yf = 8, vf = (s) => {
1519
1507
  numerator: 1,
1520
1508
  denumerator: 1
1521
1509
  };
1522
- return o.readBit() && o.readBit() && (b = (S = Cf[o.readBits(8)]) != null ? S : { numerator: 0, denumerator: 0 }), {
1510
+ return o.readBit() && o.readBit() && (b = (S = Tf[o.readBits(8)]) != null ? S : { numerator: 0, denumerator: 0 }), {
1523
1511
  width: g,
1524
1512
  height: w,
1525
1513
  pixelAspectRatio: b,
@@ -1527,7 +1515,7 @@ const bf = 7, yf = 8, vf = (s) => {
1527
1515
  constraintFlags: i,
1528
1516
  levelIdc: n
1529
1517
  };
1530
- }, Cf = [
1518
+ }, Tf = [
1531
1519
  { numerator: 0, denumerator: 0 },
1532
1520
  { numerator: 1, denumerator: 1 },
1533
1521
  { numerator: 12, denumerator: 11 },
@@ -1545,20 +1533,20 @@ const bf = 7, yf = 8, vf = (s) => {
1545
1533
  { numerator: 4, denumerator: 3 },
1546
1534
  { numerator: 3, denumerator: 2 },
1547
1535
  { numerator: 2, denumerator: 1 }
1548
- ], kf = 184549376;
1549
- function Bf(s) {
1550
- const e = new Qn(s), t = Rf(e);
1551
- (t.flags & kf) !== 0 && Uf(e);
1552
- const i = Pf(e);
1536
+ ], If = 184549376;
1537
+ function Cf(s) {
1538
+ const e = new Qn(s), t = kf(e);
1539
+ (t.flags & If) !== 0 && Bf(e);
1540
+ const i = Rf(e);
1553
1541
  if (String.fromCharCode(...i.frameId) === "TXXX") {
1554
1542
  const o = new Qn(e.readBytes(i.size));
1555
1543
  return {
1556
1544
  header: t,
1557
- txx: xf(o)
1545
+ txx: Uf(o)
1558
1546
  };
1559
1547
  }
1560
1548
  }
1561
- function Rf(s) {
1549
+ function kf(s) {
1562
1550
  const e = s.readBytes(3), t = s.readUint8(), i = s.readUint8(), n = s.readUint8(), o = s.readUint32();
1563
1551
  return {
1564
1552
  id: e,
@@ -1568,11 +1556,11 @@ function Rf(s) {
1568
1556
  size: o
1569
1557
  };
1570
1558
  }
1571
- function Uf(s) {
1559
+ function Bf(s) {
1572
1560
  const e = s.readUint32();
1573
1561
  return s.readBytes(e - 4), {};
1574
1562
  }
1575
- function Pf(s) {
1563
+ function Rf(s) {
1576
1564
  const e = s.readBytes(4), t = s.readUint32(), i = s.readUint16();
1577
1565
  return {
1578
1566
  frameId: e,
@@ -1580,7 +1568,7 @@ function Pf(s) {
1580
1568
  flags: i
1581
1569
  };
1582
1570
  }
1583
- function xf(s) {
1571
+ function Uf(s) {
1584
1572
  const e = s.readUint8(), t = s.readUtf8String(), i = s.readUtf8String();
1585
1573
  return {
1586
1574
  encoding: e,
@@ -1597,7 +1585,7 @@ function Nu(s) {
1597
1585
  type: i
1598
1586
  };
1599
1587
  }
1600
- function Lf(s, e) {
1588
+ function Pf(s, e) {
1601
1589
  const t = Nu(e), i = new Qn(e.readBytes(t.size));
1602
1590
  if (t.type !== s.type)
1603
1591
  throw new Error(`invalid error type: ${t.type}, expected ${s.type}`);
@@ -1691,6 +1679,23 @@ const hr = class hr {
1691
1679
  };
1692
1680
  r(hr, "type", "tfdt");
1693
1681
  let po = hr;
1682
+ const xf = 1, Lf = 2, Df = 8, Of = 16, Mf = 32, dr = class dr {
1683
+ constructor(e, t, i, n) {
1684
+ r(this, "type", dr.type);
1685
+ r(this, "extra");
1686
+ r(this, "defaultSampleDuration");
1687
+ r(this, "defaultSampleSize");
1688
+ r(this, "defaultSampleFlags");
1689
+ this.extra = e, this.defaultSampleDuration = t, this.defaultSampleSize = i, this.defaultSampleFlags = n;
1690
+ }
1691
+ static decodeData(e) {
1692
+ const t = Qt(e);
1693
+ let i, n, o;
1694
+ return e.readUint32(), (t.flags & xf) > 0 && e.readUint64(), (t.flags & Lf) > 0 && e.readUint32(), (t.flags & Df) > 0 && (i = e.readUint32()), (t.flags & Of) > 0 && (n = e.readUint32()), (t.flags & Mf) > 0 && (o = e.readUint32()), new dr(t, i, n, o);
1695
+ }
1696
+ };
1697
+ r(dr, "type", "tfhd");
1698
+ let go = dr;
1694
1699
  const K = class K {
1695
1700
  constructor(e, t, i) {
1696
1701
  r(this, "type", K.type);
@@ -1722,23 +1727,6 @@ const K = class K {
1722
1727
  };
1723
1728
  r(K, "TRUN_DATA_OFFSET", 1), r(K, "TRUN_FIRST_SAMPLE_FLAGS", 4), r(K, "SAMPLE_DURATION", 256), r(K, "SAMPLE_SIZE", 512), r(K, "SAMPLE_FLAGS", 1024), r(K, "SAMPLE_CTS", 2048), r(K, "FLAG_SAMPLE_FLAG_IS_NON_SYNC", 65536), r(K, "FLAG_SAMPLE_DEPENDS_NO", 33554432), r(K, "FLAG_SAMPLE_DEPENDS_YES", 16777216), r(K, "type", "trun");
1724
1729
  let Rr = K;
1725
- const Df = 1, Of = 2, Mf = 8, Ff = 16, _f = 32, dr = class dr {
1726
- constructor(e, t, i, n) {
1727
- r(this, "type", dr.type);
1728
- r(this, "extra");
1729
- r(this, "defaultSampleDuration");
1730
- r(this, "defaultSampleSize");
1731
- r(this, "defaultSampleFlags");
1732
- this.extra = e, this.defaultSampleDuration = t, this.defaultSampleSize = i, this.defaultSampleFlags = n;
1733
- }
1734
- static decodeData(e) {
1735
- const t = Qt(e);
1736
- let i, n, o;
1737
- return e.readUint32(), (t.flags & Df) > 0 && e.readUint64(), (t.flags & Of) > 0 && e.readUint32(), (t.flags & Mf) > 0 && (i = e.readUint32()), (t.flags & Ff) > 0 && (n = e.readUint32()), (t.flags & _f) > 0 && (o = e.readUint32()), new dr(t, i, n, o);
1738
- }
1739
- };
1740
- r(dr, "type", "tfhd");
1741
- let go = dr;
1742
1730
  const ur = class ur {
1743
1731
  constructor(e, t, i) {
1744
1732
  r(this, "type", ur.type);
@@ -2112,7 +2100,7 @@ const Ir = class Ir {
2112
2100
  e.readUint16(), e.readUint32();
2113
2101
  const n = e.readUint16();
2114
2102
  e.readUint16(), t === 1 && (e.readUint64(), e.readUint64());
2115
- const o = Lf(hh, e);
2103
+ const o = Pf(hh, e);
2116
2104
  return new Ir(o, i, n);
2117
2105
  }
2118
2106
  };
@@ -2144,7 +2132,7 @@ const Ms = class Ms {
2144
2132
  r(Ms, "type", "prft");
2145
2133
  let Ro = Ms;
2146
2134
  var Nr, Vr;
2147
- class Nf {
2135
+ class Ff {
2148
2136
  constructor(e, t) {
2149
2137
  u(this, Nr);
2150
2138
  u(this, Vr);
@@ -2158,7 +2146,7 @@ class Nf {
2158
2146
  }
2159
2147
  }
2160
2148
  Nr = new WeakMap(), Vr = new WeakMap();
2161
- const Vf = {
2149
+ const _f = {
2162
2150
  moov: Bo,
2163
2151
  trak: ko,
2164
2152
  tkhd: Co,
@@ -2182,15 +2170,15 @@ const Vf = {
2182
2170
  emsg: mo
2183
2171
  };
2184
2172
  function ot(s) {
2185
- const e = Nu(s), t = Vf[e.type], i = new Qn(s.readBytes(e.size));
2173
+ const e = Nu(s), t = _f[e.type], i = new Qn(s.readBytes(e.size));
2186
2174
  if (!t) {
2187
- const o = new Nf(e, i);
2175
+ const o = new Ff(e, i);
2188
2176
  return i.readRemaining(), o;
2189
2177
  }
2190
2178
  const n = t.decodeData(i);
2191
2179
  return i.readRemaining(), n;
2192
2180
  }
2193
- function Gf(s) {
2181
+ function Nf(s) {
2194
2182
  if (s.byteLength < 8)
2195
2183
  throw new Error("Buffer too small");
2196
2184
  const e = new Qn(s), t = /* @__PURE__ */ new Map();
@@ -2208,7 +2196,7 @@ function Gf(s) {
2208
2196
  moov: n
2209
2197
  };
2210
2198
  }
2211
- function jf(s) {
2199
+ function Vf(s) {
2212
2200
  if (s.byteLength < 8)
2213
2201
  throw new Error("Buffer too small");
2214
2202
  const e = new Qn(s), t = /* @__PURE__ */ new Map(), i = [];
@@ -2231,11 +2219,11 @@ function jf(s) {
2231
2219
  };
2232
2220
  }
2233
2221
  var Gr, jr;
2234
- class Wf {
2222
+ class Gf {
2235
2223
  constructor(e) {
2236
2224
  u(this, Gr);
2237
2225
  u(this, jr);
2238
- l(this, Gr, e), l(this, jr, Gf(e));
2226
+ l(this, Gr, e), l(this, jr, Nf(e));
2239
2227
  }
2240
2228
  rawBytes() {
2241
2229
  return a(this, Gr);
@@ -2251,7 +2239,7 @@ const od = class od {
2251
2239
  u(this, ve);
2252
2240
  u(this, Re);
2253
2241
  u(this, H);
2254
- l(this, ve, t), l(this, Re, e), l(this, H, jf(t));
2242
+ l(this, ve, t), l(this, Re, e), l(this, H, Vf(t));
2255
2243
  }
2256
2244
  /**
2257
2245
  * @returns a new fragment with a clone of the raw bytes
@@ -2369,10 +2357,10 @@ const od = class od {
2369
2357
  ve = new WeakMap(), Re = new WeakMap(), H = new WeakMap();
2370
2358
  let uh = od;
2371
2359
  var Zs;
2372
- class Dd {
2360
+ class Ld {
2373
2361
  constructor(e) {
2374
2362
  u(this, Zs);
2375
- l(this, Zs, new Wf(e));
2363
+ l(this, Zs, new Gf(e));
2376
2364
  }
2377
2365
  header() {
2378
2366
  return a(this, Zs);
@@ -2428,7 +2416,7 @@ const G = {
2428
2416
  prft: C("prft"),
2429
2417
  dOps: C("dOps"),
2430
2418
  emsg: C("emsg")
2431
- }, zf = 1e3, Ur = C("iso6"), Od = new Uint8Array([0, 0, 2, 0]), Hf = [
2419
+ }, jf = 1e3, Ur = C("iso6"), Dd = new Uint8Array([0, 0, 2, 0]), Wf = [
2432
2420
  Ur,
2433
2421
  new Uint8Array([105, 115, 111, 109]),
2434
2422
  // isom
@@ -2438,7 +2426,7 @@ const G = {
2438
2426
  // avc1
2439
2427
  new Uint8Array([109, 112, 52, 49])
2440
2428
  // mp41
2441
- ], Xf = [
2429
+ ], zf = [
2442
2430
  Ur,
2443
2431
  new Uint8Array([105, 115, 111, 109]),
2444
2432
  // isom
@@ -2448,7 +2436,7 @@ const G = {
2448
2436
  // av01
2449
2437
  new Uint8Array([109, 112, 52, 49])
2450
2438
  // mp41
2451
- ], Qf = [
2439
+ ], Hf = [
2452
2440
  Ur,
2453
2441
  new Uint8Array([105, 115, 111, 109]),
2454
2442
  // isom
@@ -2459,7 +2447,7 @@ const G = {
2459
2447
  ];
2460
2448
  class Vu {
2461
2449
  constructor() {
2462
- r(this, "writer", new Em());
2450
+ r(this, "writer", new mm());
2463
2451
  r(this, "moofOffset", 0);
2464
2452
  }
2465
2453
  }
@@ -2471,13 +2459,13 @@ const ne = (s, e, t) => {
2471
2459
  ne(
2472
2460
  s,
2473
2461
  G.ftyp,
2474
- Ur.byteLength + Od.byteLength + e.reduce((t, i) => t + i.byteLength, 0)
2475
- ), s.writer.writeBytes(Ur), s.writer.writeBytes(Od), e.forEach((t) => s.writer.writeBytes(t));
2476
- }, Zf = Math.pow(2, 32), qf = 2208988800, $f = (s, e, t, i) => {
2462
+ Ur.byteLength + Dd.byteLength + e.reduce((t, i) => t + i.byteLength, 0)
2463
+ ), s.writer.writeBytes(Ur), s.writer.writeBytes(Dd), e.forEach((t) => s.writer.writeBytes(t));
2464
+ }, Xf = 2 ** 32, Qf = 2208988800, Zf = (s, e, t, i) => {
2477
2465
  ae(s, G.prft, 20, 1, 0);
2478
- const o = t / 1e3, c = Math.floor(o), d = (o - c) * 1e3 * 1e3 * Zf / 1e6;
2479
- s.writer.writeUint32(e), s.writer.writeUint32(c + qf), s.writer.writeUint32(d), s.writer.writeUint64(i);
2480
- }, Yf = (s, e, t) => {
2466
+ const o = t / 1e3, c = Math.floor(o), d = (o - c) * 1e3 * 1e3 * Xf / 1e6;
2467
+ s.writer.writeUint32(e), s.writer.writeUint32(c + Qf), s.writer.writeUint32(d), s.writer.writeUint64(i);
2468
+ }, qf = (s, e, t) => {
2481
2469
  ae(s, G.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([
2482
2470
  // reserved and unused junk
2483
2471
  0,
@@ -2551,7 +2539,7 @@ const ne = (s, e, t) => {
2551
2539
  0,
2552
2540
  0
2553
2541
  ])), s.writer.writeUint32(2);
2554
- }, Gu = (s) => "sequenceParameterSets" in s, lh = (s) => "sequenceHeader" in s, bs = (s) => s.type == "video", ar = (s) => s.type == "audio", Jf = (s, e, t) => {
2542
+ }, Gu = (s) => "sequenceParameterSets" in s, lh = (s) => "sequenceHeader" in s, bs = (s) => s.type == "video", ar = (s) => s.type == "audio", $f = (s, e, t) => {
2555
2543
  const i = s.writer.position();
2556
2544
  ae(s, G.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(ar(e) ? 1 : 0), s.writer.writeUint16(ar(e) ? 256 : 0), s.writer.writeUint16(0), s.writer.writeBytes(new Uint8Array(
2557
2545
  [
@@ -2593,24 +2581,24 @@ const ne = (s, e, t) => {
2593
2581
  0
2594
2582
  ]
2595
2583
  )), bs(e) ? (s.writer.writeUint32(e.width * 65536), s.writer.writeUint32(e.height * 65536)) : ar(e) && (s.writer.writeUint32(0), s.writer.writeUint32(0)), s.writer.writeUint32At(i, s.writer.position() - i);
2596
- }, Kf = (s, e) => {
2584
+ }, Yf = (s, e) => {
2597
2585
  ae(s, G.mdhd, 20, 0, 0), s.writer.writeUint32(0), s.writer.writeUint32(0), s.writer.writeUint32(e.timescale), s.writer.writeUint32(e.duration);
2598
2586
  const t = e.lang || "und", i = (t.charCodeAt(0) & 31) << 10 | (t.charCodeAt(1) & 31) << 5 | t.charCodeAt(2) & 31;
2599
2587
  s.writer.writeUint16(i), s.writer.writeUint16(0);
2600
- }, ep = (s, e) => {
2588
+ }, Jf = (s, e) => {
2601
2589
  const t = s.writer.position();
2602
2590
  ae(s, G.hdlr, 0, 0, 0), s.writer.writeUint32(0), s.writer.writeBytes(C(bs(e) ? "vide" : "soun")), s.writer.writeUint32(0), s.writer.writeUint32(0), s.writer.writeUint32(0), s.writer.writeBytes(C(bs(e) ? "VideoHandler\0" : "SoundHandler\0")), s.writer.writeUint32At(t, s.writer.position() - t);
2603
- }, tp = (s) => {
2591
+ }, Kf = (s) => {
2604
2592
  const e = s.writer.position();
2605
2593
  ne(s, G.dinf, 0), ae(s, G.dref, 16, 0, 0), s.writer.writeUint32(1), ae(s, C("url "), 0, 0, 1), s.writer.writeUint32At(e, s.writer.position() - e);
2606
- }, ip = (s, e) => {
2594
+ }, ep = (s, e) => {
2607
2595
  const t = s.writer.position();
2608
2596
  ne(s, G.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) => {
2609
2597
  s.writer.writeUint16(i.byteLength), s.writer.writeBytes(i);
2610
2598
  }), s.writer.writeUint8(e.pictureParameterSets.length), e.pictureParameterSets.forEach((i) => {
2611
2599
  s.writer.writeUint16(i.byteLength), s.writer.writeBytes(i);
2612
2600
  }), s.writer.writeUint32At(t, s.writer.position() - t);
2613
- }, sp = (s, e) => {
2601
+ }, tp = (s, e) => {
2614
2602
  var h, d;
2615
2603
  const t = s.writer.position();
2616
2604
  ne(s, G.av1C, 0);
@@ -2618,20 +2606,20 @@ const ne = (s, e, t) => {
2618
2606
  s.writer.writeUint8(129), s.writer.writeUint8(i << 5 | ((h = c == null ? void 0 : c.seqLevelIdx) != null ? h : 0)), s.writer.writeUint8(
2619
2607
  ((d = c == null ? void 0 : c.tier) != null ? d : 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
2620
2608
  ), s.writer.writeUint8(0), s.writer.writeBytes(e.sequenceHeader), s.writer.writeUint32At(t, s.writer.position() - t);
2621
- }, np = (s, e) => {
2609
+ }, ip = (s, e) => {
2622
2610
  const t = s.writer.position(), i = lh(e) ? G.av01 : G.avc1;
2623
- ne(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), Gu(e) ? ip(s, e) : lh(e) && (sp(s, e), e.parsedSequenceHeader.colorConfig && (ne(s, C("colr"), 11), s.writer.writeBytes(G.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 && (ne(s, C("pasp"), 8), s.writer.writeUint32(e.pixelAspectRatio.numerator), s.writer.writeUint32(e.pixelAspectRatio.denumerator)), e.bitrate && (ne(s, C("btrt"), 12), s.writer.writeUint32(0), s.writer.writeUint32(e.bitrate), s.writer.writeUint32(e.bitrate)), s.writer.writeUint32At(t, s.writer.position() - t);
2611
+ ne(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), Gu(e) ? ep(s, e) : lh(e) && (tp(s, e), e.parsedSequenceHeader.colorConfig && (ne(s, C("colr"), 11), s.writer.writeBytes(G.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 && (ne(s, C("pasp"), 8), s.writer.writeUint32(e.pixelAspectRatio.numerator), s.writer.writeUint32(e.pixelAspectRatio.denumerator)), e.bitrate && (ne(s, C("btrt"), 12), s.writer.writeUint32(0), s.writer.writeUint32(e.bitrate), s.writer.writeUint32(e.bitrate)), s.writer.writeUint32At(t, s.writer.position() - t);
2624
2612
  }, Ja = (s, e, t) => {
2625
2613
  let i = 3;
2626
2614
  for (s.writer.writeUint8(e); i > 0; i--)
2627
2615
  s.writer.writeUint8(t >> 7 * i | 128);
2628
2616
  s.writer.writeUint8(t & 127);
2629
- }, rp = (s, e) => {
2617
+ }, sp = (s, e) => {
2630
2618
  const t = e.decoderConfig.byteLength > 0 ? e.decoderConfig.byteLength + 5 : 0, i = s.writer.position();
2631
2619
  ae(s, G.esds, 0, 0, 0), Ja(s, 3, 21 + t + 5 + 1), s.writer.writeUint16(e.trackId), s.writer.writeUint8(0), Ja(s, 4, 13 + t);
2632
2620
  const n = e.codec === "mp3" && e.sampleRate > 24e3 ? 107 : 64;
2633
2621
  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 && (Ja(s, 5, e.decoderConfig.byteLength), s.writer.writeBytes(e.decoderConfig)), Ja(s, 6, 1), s.writer.writeUint8(2), s.writer.writeUint32At(i, s.writer.position() - i);
2634
- }, ap = (s) => {
2622
+ }, np = (s) => {
2635
2623
  switch (s) {
2636
2624
  case "aac":
2637
2625
  case "mp3":
@@ -2639,54 +2627,54 @@ const ne = (s, e, t) => {
2639
2627
  case "opus":
2640
2628
  return "Opus";
2641
2629
  }
2642
- }, op = (s, e) => {
2630
+ }, rp = (s, e) => {
2643
2631
  const t = s.writer.position();
2644
2632
  ne(s, C("dOps"), 0), s.writer.writeUint8(0);
2645
2633
  const i = e.decoderConfig, n = new DataView(i.buffer, i.byteOffset, i.byteLength);
2646
2634
  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);
2647
- }, cp = (s, e) => {
2635
+ }, ap = (s, e) => {
2648
2636
  const t = s.writer.position();
2649
- switch (ne(s, C(ap(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) {
2637
+ switch (ne(s, C(np(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) {
2650
2638
  case "aac":
2651
2639
  case "mp3":
2652
- rp(s, e);
2640
+ sp(s, e);
2653
2641
  break;
2654
2642
  case "opus":
2655
- op(s, e);
2643
+ rp(s, e);
2656
2644
  break;
2657
2645
  }
2658
2646
  e.bitrate && (ne(s, C("btrt"), 12), s.writer.writeUint32(0), s.writer.writeUint32(e.bitrate), s.writer.writeUint32(e.bitrate)), s.writer.writeUint32At(t, s.writer.position() - t);
2659
- }, hp = (s, e) => {
2647
+ }, op = (s, e) => {
2660
2648
  const t = s.writer.position();
2661
2649
  ne(s, G.stbl, 0);
2662
2650
  const i = s.writer.position();
2663
- ae(s, G.stsd, 0, 0, 0), s.writer.writeUint32(1), bs(e) ? np(s, e) : ar(e) && cp(s, e), s.writer.writeUint32At(i, s.writer.position() - i), ae(s, C("stts"), 4, 0, 0), s.writer.writeUint32(0), ae(s, C("stsc"), 4, 0, 0), s.writer.writeUint32(0), ae(s, C("stsz"), 8, 0, 0), s.writer.writeUint32(0), s.writer.writeUint32(0), ae(s, C("stco"), 4, 0, 0), s.writer.writeUint32(0), s.writer.writeUint32At(t, s.writer.position() - t);
2664
- }, dp = (s, e) => {
2651
+ ae(s, G.stsd, 0, 0, 0), s.writer.writeUint32(1), bs(e) ? ip(s, e) : ar(e) && ap(s, e), s.writer.writeUint32At(i, s.writer.position() - i), ae(s, C("stts"), 4, 0, 0), s.writer.writeUint32(0), ae(s, C("stsc"), 4, 0, 0), s.writer.writeUint32(0), ae(s, C("stsz"), 8, 0, 0), s.writer.writeUint32(0), s.writer.writeUint32(0), ae(s, C("stco"), 4, 0, 0), s.writer.writeUint32(0), s.writer.writeUint32At(t, s.writer.position() - t);
2652
+ }, cp = (s, e) => {
2665
2653
  const t = s.writer.position();
2666
- ne(s, G.minf, 0), bs(e) ? (ae(s, G.vmhd, 8, 0, 1), s.writer.writeUint32(0), s.writer.writeUint32(0)) : ar(e) && (ae(s, G.smhd, 4, 0, 0), s.writer.writeUint16(0), s.writer.writeUint16(0)), tp(s), hp(s, e), s.writer.writeUint32At(t, s.writer.position() - t);
2667
- }, up = (s, e) => {
2654
+ ne(s, G.minf, 0), bs(e) ? (ae(s, G.vmhd, 8, 0, 1), s.writer.writeUint32(0), s.writer.writeUint32(0)) : ar(e) && (ae(s, G.smhd, 4, 0, 0), s.writer.writeUint16(0), s.writer.writeUint16(0)), Kf(s), op(s, e), s.writer.writeUint32At(t, s.writer.position() - t);
2655
+ }, hp = (s, e) => {
2668
2656
  const t = s.writer.position();
2669
- ne(s, G.mdia, 0), Kf(s, e), ep(s, e), dp(s, e), s.writer.writeUint32At(t, s.writer.position() - t);
2670
- }, lp = (s, e, t) => {
2657
+ ne(s, G.mdia, 0), Yf(s, e), Jf(s, e), cp(s, e), s.writer.writeUint32At(t, s.writer.position() - t);
2658
+ }, dp = (s, e, t) => {
2671
2659
  const i = s.writer.position();
2672
- ne(s, G.trak, 0), Jf(s, e, t), up(s, e), s.writer.writeUint32At(i, s.writer.position() - i);
2673
- }, mp = (s, e) => {
2660
+ ne(s, G.trak, 0), $f(s, e, t), hp(s, e), s.writer.writeUint32At(i, s.writer.position() - i);
2661
+ }, up = (s, e) => {
2674
2662
  ae(s, G.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);
2675
- }, fp = (s, e) => {
2663
+ }, lp = (s, e) => {
2676
2664
  const t = s.writer.position();
2677
- ne(s, G.mvex, 0), e.forEach((i) => mp(s, i)), s.writer.writeUint32At(t, s.writer.position() - t);
2678
- }, pp = (s, e, t, i) => {
2665
+ ne(s, G.mvex, 0), e.forEach((i) => up(s, i)), s.writer.writeUint32At(t, s.writer.position() - t);
2666
+ }, mp = (s, e, t, i) => {
2679
2667
  const n = s.writer.position();
2680
- ne(s, G.moov, 0), Yf(s, 0, t), e.forEach((o) => lp(s, o, t)), fp(s, e), s.writer.writeUint32At(n, s.writer.position() - n);
2681
- }, gp = (s, e) => {
2668
+ ne(s, G.moov, 0), qf(s, 0, t), e.forEach((o) => dp(s, o, t)), lp(s, e), s.writer.writeUint32At(n, s.writer.position() - n);
2669
+ }, fp = (s, e) => {
2682
2670
  const t = s.writer.position();
2683
2671
  ae(s, G.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);
2684
- }, Ap = (s, e) => {
2672
+ }, pp = (s, e) => {
2685
2673
  const t = s.writer.position();
2686
2674
  ae(s, G.tfdt, 8, 1, 0);
2687
2675
  const i = Math.floor(e.timestamp / 4294967296), n = (e.timestamp & 4294967295) >>> 0;
2688
2676
  s.writer.writeUint32(i), s.writer.writeUint32(n), s.writer.writeUint32At(t, s.writer.position() - t);
2689
- }, wp = (s, e) => {
2677
+ }, gp = (s, e) => {
2690
2678
  if (!e.samples[0])
2691
2679
  throw new Error("At least one sample must be provided");
2692
2680
  const t = e.samples.some((d) => !!d.compositionTimeOffset), i = Qc(e.samples[0]) !== e.defaultFlags, n = e.samples.length > 1;
@@ -2699,25 +2687,25 @@ const ne = (s, e, t) => {
2699
2687
  for (const d of e.samples)
2700
2688
  n && (s.writer.writeUint32(d.duration), s.writer.writeUint32(d.data.byteLength), s.writer.writeUint32(Qc(d))), t && s.writer.writeUint32(d.compositionTimeOffset || 0);
2701
2689
  s.writer.writeUint32At(h, s.writer.position() - s.moofOffset + 8), s.writer.writeUint32At(c, s.writer.position() - c);
2702
- }, Qc = (s) => s.isSync ? 33554432 : 16842752, bp = (s, e) => {
2690
+ }, Qc = (s) => s.isSync ? 33554432 : 16842752, Ap = (s, e) => {
2703
2691
  const t = s.writer.position();
2704
- ne(s, G.traf, 0), gp(s, e), Ap(s, e), wp(s, e), s.writer.writeUint32At(t, s.writer.position() - t);
2705
- }, yp = (s, e) => {
2692
+ ne(s, G.traf, 0), fp(s, e), pp(s, e), gp(s, e), s.writer.writeUint32At(t, s.writer.position() - t);
2693
+ }, wp = (s, e) => {
2706
2694
  ae(s, G.mfhd, 4, 0, 0), s.writer.writeUint32(e);
2707
- }, vp = (s, e) => {
2695
+ }, bp = (s, e) => {
2708
2696
  const t = s.writer.position();
2709
- ne(s, G.moof, 0), yp(s, e.sequenceNumber), bp(s, e), s.writer.writeUint32At(t, s.writer.position() - t);
2710
- }, Sp = (s, e) => {
2697
+ ne(s, G.moof, 0), wp(s, e.sequenceNumber), Ap(s, e), s.writer.writeUint32At(t, s.writer.position() - t);
2698
+ }, yp = (s, e) => {
2711
2699
  const t = e.samples.reduce((i, n) => i + n.data.byteLength, 0);
2712
2700
  ne(s, G.mdat, t), e.samples.forEach((i) => s.writer.writeBytes(i.data));
2713
2701
  }, _c = (s, e) => {
2714
2702
  const t = new Vu(), i = s.filter((o) => bs(o) && Gu(o)).length > 0;
2715
- return s.filter((o) => bs(o) && lh(o)).length > 0 ? Xc(t, Xf) : i ? Xc(t, Hf) : Xc(t, Qf), pp(t, s, zf), t.writer.buffer();
2703
+ return s.filter((o) => bs(o) && lh(o)).length > 0 ? Xc(t, zf) : i ? Xc(t, Wf) : Xc(t, Hf), mp(t, s, jf), t.writer.buffer();
2716
2704
  }, Nc = (s) => {
2717
2705
  var t;
2718
2706
  const e = new Vu();
2719
- return ((t = s.samples[0]) == null ? void 0 : t.producerReferenceTime) !== void 0 && $f(e, s.trackId, s.samples[0].producerReferenceTime, s.timestamp), e.moofOffset = e.writer.position(), vp(e, s), Sp(e, s), e.writer.buffer();
2720
- }, Ep = (s, e) => {
2707
+ return ((t = s.samples[0]) == null ? void 0 : t.producerReferenceTime) !== void 0 && Zf(e, s.trackId, s.samples[0].producerReferenceTime, s.timestamp), e.moofOffset = e.writer.position(), bp(e, s), yp(e, s), e.writer.buffer();
2708
+ }, vp = (s, e) => {
2721
2709
  const t = s.map((c) => F(v({}, c), {
2722
2710
  data: new Uint8Array(c.data)
2723
2711
  }));
@@ -2733,7 +2721,7 @@ const ne = (s, e, t) => {
2733
2721
  defaultDuration: o,
2734
2722
  samples: t
2735
2723
  });
2736
- }, Tp = (s, e, t, i) => _c([
2724
+ }, Sp = (s, e, t, i) => _c([
2737
2725
  {
2738
2726
  type: "audio",
2739
2727
  codec: "aac",
@@ -2748,8 +2736,8 @@ const ne = (s, e, t) => {
2748
2736
  const { sequenceParameterSets: e, pictureParameterSets: t } = _u(s), i = e[0], n = t[0];
2749
2737
  if (!i || !n)
2750
2738
  throw new Error("No sps or pps provided");
2751
- return If(i);
2752
- }, Ip = (s, e) => {
2739
+ return Ef(i);
2740
+ }, Ep = (s, e) => {
2753
2741
  const t = s.map((h) => F(v({}, h), {
2754
2742
  data: new Uint8Array(h.data)
2755
2743
  }));
@@ -2765,7 +2753,7 @@ const ne = (s, e, t) => {
2765
2753
  defaultDuration: c,
2766
2754
  samples: t
2767
2755
  });
2768
- }, Cp = (s, e) => {
2756
+ }, Tp = (s, e) => {
2769
2757
  const { sequenceParameterSets: t, pictureParameterSets: i } = _u(s), n = ju(s);
2770
2758
  return _c([
2771
2759
  {
@@ -2779,7 +2767,7 @@ const ne = (s, e, t) => {
2779
2767
  trackId: 1
2780
2768
  }
2781
2769
  ]);
2782
- }, kp = (s, e, t) => _c([
2770
+ }, Ip = (s, e, t) => _c([
2783
2771
  {
2784
2772
  type: "audio",
2785
2773
  trackId: 1,
@@ -2790,7 +2778,7 @@ const ne = (s, e, t) => {
2790
2778
  duration: 0,
2791
2779
  sampleRate: 48e3
2792
2780
  }
2793
- ]), Bp = (s, e) => {
2781
+ ]), Cp = (s, e) => {
2794
2782
  const t = s.map((c) => F(v({}, c), {
2795
2783
  data: new Uint8Array(c.data)
2796
2784
  }));
@@ -2807,9 +2795,9 @@ const ne = (s, e, t) => {
2807
2795
  samples: t
2808
2796
  });
2809
2797
  }, Wu = (s) => {
2810
- const e = new yu(s);
2811
- return e.peekBit() === 1 && e.readBits(32), Pp(e), Np(e);
2812
- }, Rp = (s) => {
2798
+ const e = new bu(s);
2799
+ return e.peekBit() === 1 && e.readBits(32), Rp(e), Fp(e);
2800
+ }, kp = (s) => {
2813
2801
  let e = 0, t = 0;
2814
2802
  for (let i = 0; i < 8; i++) {
2815
2803
  const n = s.readBits(8);
@@ -2817,40 +2805,40 @@ const ne = (s, e, t) => {
2817
2805
  break;
2818
2806
  }
2819
2807
  return [t, e];
2820
- }, Up = (s) => {
2808
+ }, Bp = (s) => {
2821
2809
  let e = 0;
2822
2810
  for (; e < 100 && s.readBit() === 0; )
2823
2811
  e++;
2824
2812
  return e >= 32 ? 0 : s.readBits(e) + (1 << e) - 1;
2825
- }, Pp = (s) => {
2813
+ }, Rp = (s) => {
2826
2814
  const e = s.remainingBits() / 8, t = s.readBits(8);
2827
2815
  if ((t >> 7 & 1) !== 0)
2828
2816
  return;
2829
2817
  const n = t >> 3 & 15, o = t >> 2 & 1, c = t >> 1 & 1;
2830
2818
  o == 1 && s.readBits(8);
2831
- const [h, d] = c ? Rp(s) : [0, e];
2819
+ const [h, d] = c ? kp(s) : [0, e];
2832
2820
  return {
2833
2821
  headerLength: 1 + o + h,
2834
2822
  type: n,
2835
2823
  obuSize: d
2836
2824
  };
2837
- }, xp = (s) => {
2825
+ }, Up = (s) => {
2838
2826
  const e = s.readBits(32), t = s.readBits(32), i = s.readBit() !== 0;
2839
2827
  let n = 0;
2840
- return i && (n = Up(s) + 1), {
2828
+ return i && (n = Bp(s) + 1), {
2841
2829
  timescale: t,
2842
2830
  equalPictureInterval: i,
2843
2831
  numUnitsInDisplayTick: e,
2844
2832
  numTicksPerPicture: n
2845
2833
  };
2846
- }, Md = 2, Zc = 2, Lp = 1, Dp = 2, Op = 2, Mp = 13, Fp = 0, _p = 2, Fd = 0, Np = (s) => {
2834
+ }, Od = 2, Zc = 2, Pp = 1, xp = 2, Lp = 2, Dp = 13, Op = 0, Mp = 2, Md = 0, Fp = (s) => {
2847
2835
  const e = s.readBits(3), i = s.readBit() !== 0, n = s.readBit() !== 0;
2848
2836
  let o, c = !1, h = !1, d = !1, m = 0, p = 0;
2849
2837
  const g = [];
2850
2838
  if (n)
2851
2839
  s.readBits(5);
2852
2840
  else {
2853
- if (h = s.readBit() !== 0, h && (o = xp(s), c = s.readBit() !== 0, c))
2841
+ if (h = s.readBit() !== 0, h && (o = Up(s), c = s.readBit() !== 0, c))
2854
2842
  throw new Error("Not implemented");
2855
2843
  d = s.readBit() !== 0;
2856
2844
  const Fe = s.readBits(5) + 1;
@@ -2866,8 +2854,8 @@ const ne = (s, e, t) => {
2866
2854
  let U = !1;
2867
2855
  n ? U = !1 : U = s.readBit() !== 0, U && (m = s.readBits(4) + 2, p = s.readBits(3) + 1);
2868
2856
  const D = s.readBit() !== 0, T = s.readBit() !== 0, P = s.readBit() !== 0;
2869
- let k = !1, Q = !1, X = !1, Me = !1, q = !1, Ct = !1, kt = !1, y = Md, E = Zc, L = 0;
2870
- n || (k = s.readBit() !== 0, Q = s.readBit() !== 0, X = s.readBit() !== 0, Me = s.readBit() !== 0, q = s.readBit() !== 0, q && (Ct = s.readBit() !== 0, kt = s.readBit() !== 0), s.readBit() !== 0 ? y = Md : y = s.readBit(), y > 0 ? s.readBit() > 0 ? E = Zc : E = s.readBit() : E = Zc, q ? L = s.readBits(3) : L = 0);
2857
+ let k = !1, Q = !1, X = !1, Me = !1, q = !1, Ct = !1, kt = !1, y = Od, E = Zc, L = 0;
2858
+ n || (k = s.readBit() !== 0, Q = s.readBit() !== 0, X = s.readBit() !== 0, Me = s.readBit() !== 0, q = s.readBit() !== 0, q && (Ct = s.readBit() !== 0, kt = s.readBit() !== 0), s.readBit() !== 0 ? y = Od : y = s.readBit(), y > 0 ? s.readBit() > 0 ? E = Zc : E = s.readBit() : E = Zc, q ? L = s.readBits(3) : L = 0);
2871
2859
  const j = s.readBit() !== 0, M = s.readBit() !== 0, _ = s.readBit() !== 0;
2872
2860
  return {
2873
2861
  seqProfile: e,
@@ -2906,16 +2894,16 @@ const ne = (s, e, t) => {
2906
2894
  enableSuperres: j,
2907
2895
  enableCdef: M,
2908
2896
  enableRestoration: _,
2909
- colorConfig: Vp(s, e),
2897
+ colorConfig: _p(s, e),
2910
2898
  filmGrainParamsPresent: s.readBit() !== 0
2911
2899
  };
2912
- }, Vp = (s, e) => {
2900
+ }, _p = (s, e) => {
2913
2901
  const t = s.readBit() !== 0;
2914
2902
  let i = 8, n = !1;
2915
2903
  e === 2 && t ? i = s.readBit() !== 0 ? 12 : 10 : e <= 2 && (i = t ? 10 : 8), e === 1 ? n = !1 : n = s.readBit() !== 0;
2916
2904
  const o = n ? 1 : 3, c = s.readBit() !== 0;
2917
- let h = Dp, d = Op, m = _p, p = !1, g = 0, w = 0, b = Fd, S = !1;
2918
- return c && (h = s.readBits(8), d = s.readBits(8), m = s.readBits(8)), n ? (p = s.readBit() !== 0, g = 1, w = 1, b = Fd, S = !1, {
2905
+ let h = xp, d = Lp, m = Mp, p = !1, g = 0, w = 0, b = Md, S = !1;
2906
+ return c && (h = s.readBits(8), d = s.readBits(8), m = s.readBits(8)), n ? (p = s.readBit() !== 0, g = 1, w = 1, b = Md, S = !1, {
2919
2907
  highBitDepth: t,
2920
2908
  bitDepth: i,
2921
2909
  monoChrome: n,
@@ -2928,7 +2916,7 @@ const ne = (s, e, t) => {
2928
2916
  subsamplingX: g,
2929
2917
  subsamplingY: w,
2930
2918
  transferCharacteristics: d
2931
- }) : h === Lp && d == Mp && m == Fp ? (p = !0, g = 0, w = 0, {
2919
+ }) : h === Pp && d == Dp && m == Op ? (p = !0, g = 0, w = 0, {
2932
2920
  highBitDepth: t,
2933
2921
  bitDepth: i,
2934
2922
  monoChrome: n,
@@ -2955,14 +2943,14 @@ const ne = (s, e, t) => {
2955
2943
  subsamplingY: w,
2956
2944
  transferCharacteristics: d
2957
2945
  });
2958
- }, Gp = (s) => {
2946
+ }, Np = (s) => {
2959
2947
  const e = Wu(s);
2960
2948
  if (e)
2961
2949
  return {
2962
2950
  width: e.maxFrameWidth,
2963
2951
  height: e.maxFrameHeight
2964
2952
  };
2965
- }, jp = (s, e) => {
2953
+ }, Vp = (s, e) => {
2966
2954
  const t = s.map((h) => F(v({}, h), {
2967
2955
  data: new Uint8Array(h.data)
2968
2956
  }));
@@ -2978,7 +2966,7 @@ const ne = (s, e, t) => {
2978
2966
  defaultDuration: c,
2979
2967
  samples: t
2980
2968
  });
2981
- }, Wp = (s, e) => {
2969
+ }, Gp = (s, e) => {
2982
2970
  const t = Wu(s);
2983
2971
  if (!t)
2984
2972
  throw new Error("Failed to parse sequence header");
@@ -2994,47 +2982,47 @@ const ne = (s, e, t) => {
2994
2982
  trackId: 1
2995
2983
  }
2996
2984
  ]);
2997
- }, zp = (s) => {
2985
+ }, jp = (s) => {
2998
2986
  const { codec: e, initData: t, timescale: i } = s;
2999
2987
  switch (e) {
3000
2988
  case "h264":
3001
- return Xp(t, i);
2989
+ return zp(t, i);
3002
2990
  case "av1":
3003
- return Qp(t, i);
2991
+ return Hp(t, i);
3004
2992
  case "opus":
3005
- return Zp(t, i, s.channelCount || 2);
2993
+ return Xp(t, i, s.channelCount || 2);
3006
2994
  case "aac":
3007
- return qp(t, i, s.channelCount || 2);
2995
+ return Qp(t, i, s.channelCount || 2);
3008
2996
  default:
3009
2997
  throw new Error(`Failed to initialize ${e} segment`);
3010
2998
  }
3011
- }, Hp = (s, e) => {
2999
+ }, Wp = (s, e) => {
3012
3000
  switch (s) {
3013
3001
  case "h264":
3014
3002
  return ju(e);
3015
3003
  case "av1":
3016
- return Gp(e);
3004
+ return Np(e);
3017
3005
  }
3018
- }, Xp = (s, e) => Cp(s, e), Qp = (s, e) => Wp(s, e), Zp = (s, e, t) => kp(new Uint8Array(s), t, e), qp = (s, e, t) => Tp(new Uint8Array(s), t, e, e), $p = (s, e) => {
3006
+ }, zp = (s, e) => Tp(s, e), Hp = (s, e) => Gp(s, e), Xp = (s, e, t) => Ip(new Uint8Array(s), t, e), Qp = (s, e, t) => Sp(new Uint8Array(s), t, e, e), Zp = (s, e) => {
3019
3007
  if (!s[0])
3020
3008
  throw new Error("At least one sample must be provided");
3021
3009
  switch (s[0].codec) {
3022
3010
  case "h264":
3023
- return Ip(s, e);
3011
+ return Ep(s, e);
3024
3012
  case "opus":
3025
- return Bp(s, e);
3013
+ return Cp(s, e);
3026
3014
  case "aac":
3027
- return Ep(s, e);
3015
+ return vp(s, e);
3028
3016
  case "av1":
3029
- return jp(s, e);
3017
+ return Vp(s, e);
3030
3018
  default:
3031
3019
  throw new Error(`Unsupported codec ${s[0].codec}`);
3032
3020
  }
3033
- }, or = (s) => !!(s & 1), Yp = (s) => !!(s & 2), Jp = (s) => !!(s & 4), Kp = (s) => !!(s & 8), eg = (s) => !!(s & 16), tg = (s) => {
3034
- const e = new DataView(s, 0), t = e.getUint8(0), i = e.getUint16(1), n = e.getUint8(3), o = e.getUint8(4), c = td(new Uint8Array(s), 5, 12), h = e.getUint32(13), d = eg(n) ? e.getInt16(17) : void 0, m = s.slice(i);
3021
+ }, or = (s) => !!(s & 1), qp = (s) => !!(s & 2), $p = (s) => !!(s & 4), Yp = (s) => !!(s & 8), Jp = (s) => !!(s & 16), Kp = (s) => {
3022
+ const e = new DataView(s, 0), t = e.getUint8(0), i = e.getUint16(1), n = e.getUint8(3), o = e.getUint8(4), c = td(new Uint8Array(s), 5, 12), h = e.getUint32(13), d = Jp(n) ? e.getInt16(17) : void 0, m = s.slice(i);
3035
3023
  return { version: t, renditionId: o, flags: n, timestamp: c, timescale: h, payload: m, compositionTimeOffset: d };
3036
- }, ig = "data:video/mp4;base64,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", Ka = () => "wakeLock" in navigator && window.navigator.userAgent.indexOf("Samsung") === -1;
3037
- class sg {
3024
+ }, eg = "data:video/mp4;base64,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", Ka = () => "wakeLock" in navigator && window.navigator.userAgent.indexOf("Samsung") === -1;
3025
+ class tg {
3038
3026
  constructor() {
3039
3027
  r(this, "enabled", !1);
3040
3028
  r(this, "wakeLockVideo");
@@ -3055,7 +3043,7 @@ class sg {
3055
3043
  if (!Ka()) {
3056
3044
  if (!this.wakeLockVideo) {
3057
3045
  const t = document.createElement("video");
3058
- this.wakeLockVideo = t, this.wakeLockVideo.setAttribute("title", "Live Stream"), this.wakeLockVideo.setAttribute("playsinline", ""), this._addSourceToVideo(this.wakeLockVideo, "mp4", ig), Object.assign(this.wakeLockVideo.style, {
3046
+ this.wakeLockVideo = t, this.wakeLockVideo.setAttribute("title", "Live Stream"), this.wakeLockVideo.setAttribute("playsinline", ""), this._addSourceToVideo(this.wakeLockVideo, "mp4", eg), Object.assign(this.wakeLockVideo.style, {
3059
3047
  position: "absolute",
3060
3048
  left: "-100%",
3061
3049
  top: "-100%"
@@ -3089,9 +3077,9 @@ class sg {
3089
3077
  document.removeEventListener("visibilitychange", this.handleVisibilityChange), document.removeEventListener("fullscreenchange", this.handleVisibilityChange), this.disable();
3090
3078
  }
3091
3079
  }
3092
- const ng = /\r\n|\r|\n/;
3080
+ const ig = /\r\n|\r|\n/;
3093
3081
  var ii, Lt;
3094
- class _d {
3082
+ class Fd {
3095
3083
  constructor(e) {
3096
3084
  u(this, ii);
3097
3085
  u(this, Lt);
@@ -3127,7 +3115,7 @@ class zu {
3127
3115
  u(this, ys);
3128
3116
  }
3129
3117
  parse(e) {
3130
- const t = [], i = e.split(ng), n = new _d(i), o = n.readLine();
3118
+ const t = [], i = e.split(ig), n = new Fd(i), o = n.readLine();
3131
3119
  if (!o || !o.startsWith("WEBVTT"))
3132
3120
  throw new Error("missing 'WEBVTT' signature");
3133
3121
  for (; n.readLine() !== ""; )
@@ -3141,7 +3129,7 @@ class zu {
3141
3129
  }
3142
3130
  ys = new WeakSet(), Hu = function(e) {
3143
3131
  e.skipEmptyLines();
3144
- const t = e.takeUntilEmptyLine(), i = new _d(t);
3132
+ const t = e.takeUntilEmptyLine(), i = new Fd(t);
3145
3133
  let n = i.readLine(), o;
3146
3134
  if (n != null && n.startsWith("NOTE"))
3147
3135
  return;
@@ -3172,6 +3160,10 @@ ys = new WeakSet(), Hu = function(e) {
3172
3160
  const [i = 0, n = 0, o = 0] = t.map((h) => parseFloat(h));
3173
3161
  return i * 60 * 60 + n * 60 + o;
3174
3162
  };
3163
+ const sg = (s) => {
3164
+ const e = window;
3165
+ e.vindralInstances = e.vindralInstances || {}, e.vindralInstances[s.getStatistics().clientId.substring(0, 8)] = s;
3166
+ };
3175
3167
  class fh extends vi {
3176
3168
  constructor({ type: t, autoplay: i, muted: n, logger: o, poster: c }) {
3177
3169
  super();
@@ -3328,77 +3320,7 @@ class fh extends vi {
3328
3320
  return this._isPaused;
3329
3321
  }
3330
3322
  }
3331
- const rg = [
3332
- "minBufferTime",
3333
- "maxBufferTime",
3334
- "burstEnabled",
3335
- "sizeBasedResolutionCapEnabled",
3336
- "separateVideoSocketEnabled",
3337
- "videoCodecs"
3338
- ];
3339
- function ag(s) {
3340
- return rg.includes(s);
3341
- }
3342
- class og {
3343
- constructor(e) {
3344
- r(this, "options");
3345
- r(this, "overrides", /* @__PURE__ */ new Map());
3346
- this.options = e;
3347
- }
3348
- /**
3349
- *
3350
- * @returns the options excluding any overrides
3351
- */
3352
- getOptions() {
3353
- return this.options;
3354
- }
3355
- /**
3356
- * Add overrides for a specific channel
3357
- * @param channelId the channel to add overrides to
3358
- * @param overrides the overrides to insert
3359
- */
3360
- addOverrides(e, t) {
3361
- this.overrides.set(e, t);
3362
- }
3363
- /**
3364
- * Sets an option value
3365
- * @param key the option key to set
3366
- * @param value the option value to insert into the key
3367
- */
3368
- set(e, t) {
3369
- this.options[e] = t;
3370
- }
3371
- /**
3372
- * Gets the option value for a specific key. If a channelId is provided, it will also apply any overrides
3373
- * to the options value.
3374
- * @param key the key to get from the options
3375
- * @param channelId the channelId to get channel specific overrides from
3376
- * @returns the option value, potentially overridden by channel overrides if a channelId is provided
3377
- */
3378
- get(e, t) {
3379
- var i;
3380
- if (t && ag(e)) {
3381
- const n = (i = this.overrides.get(t)) == null ? void 0 : i[e];
3382
- if (typeof n != "undefined")
3383
- return n;
3384
- }
3385
- return this.options[e];
3386
- }
3387
- /**
3388
- *
3389
- * @param key the key to get from the overrides
3390
- * @param channelId the channel overrides to get the override from
3391
- * @returns the override value for that channel
3392
- */
3393
- getOverride(e, t) {
3394
- var i;
3395
- return (i = this.overrides.get(t)) == null ? void 0 : i[e];
3396
- }
3397
- }
3398
- const cg = (s) => {
3399
- const e = window;
3400
- e.vindralInstances = e.vindralInstances || {}, e.vindralInstances[s.getStatistics().clientId.substring(0, 8)] = s;
3401
- }, hg = (s) => {
3323
+ const ng = (s) => {
3402
3324
  if (!navigator.mediaCapabilities)
3403
3325
  return Promise.resolve({ smooth: !0, supported: !0, powerEfficient: !0, failedToQuery: !0 });
3404
3326
  if (s.codec === "webvtt")
@@ -3422,7 +3344,7 @@ const cg = (s) => {
3422
3344
  framerate: s.frameRate[0] / s.frameRate[1]
3423
3345
  }
3424
3346
  }, navigator.mediaCapabilities.decodingInfo(e);
3425
- }, dg = 0.15, ug = 0.2, Nd = 0.4, lg = 0.5, mg = 0.6, qc = 15, fg = {
3347
+ }, rg = 0.15, ag = 0.2, _d = 0.4, og = 0.5, cg = 0.6, qc = 15, hg = {
3426
3348
  cooldownTime: 3e3,
3427
3349
  maxBufferingEvents: {
3428
3350
  last10Seconds: 0
@@ -3494,7 +3416,7 @@ const cg = (s) => {
3494
3416
  const { bufferFullness: t, general: i } = this.qualityOfServiceSource.getMetrics(), n = this.qualityOfServiceSource.getBufferFullnessRegression();
3495
3417
  if (!n)
3496
3418
  return;
3497
- const o = 10 * 1e3, { slope: c } = n, h = n.predict(qc), d = c < 0, m = n.predict(qc) < Nd && n.slope < 0, p = n.predict(qc) > mg, g = this.qualityOfServiceSource.timeSpentBufferingLast(30 * 1e3), w = this.qualityOfServiceSource.timeSpentActiveLast(30 * 1e3), b = g / w;
3419
+ const o = 10 * 1e3, { slope: c } = n, h = n.predict(qc), d = c < 0, m = n.predict(qc) < _d && n.slope < 0, p = n.predict(qc) > cg, g = this.qualityOfServiceSource.timeSpentBufferingLast(30 * 1e3), w = this.qualityOfServiceSource.timeSpentActiveLast(30 * 1e3), b = g / w;
3498
3420
  if (t < 0.15 && b > 0.8) {
3499
3421
  this.adaptLevel("reconnect");
3500
3422
  return;
@@ -3503,13 +3425,13 @@ const cg = (s) => {
3503
3425
  this.adaptLevel("downgrade");
3504
3426
  return;
3505
3427
  }
3506
- m || t < dg ? d && t < Nd && h < ug && this.adaptLevel(e.playbackState === "buffering" ? "double downgrade" : "downgrade") : t > lg && p && !this.tooMuchTimeBuffering(o) && !this.tooManyBufferingEvents(o) && this.adaptLevel("upgrade");
3428
+ m || t < rg ? d && t < _d && h < ag && this.adaptLevel(e.playbackState === "buffering" ? "double downgrade" : "downgrade") : t > og && p && !this.tooMuchTimeBuffering(o) && !this.tooManyBufferingEvents(o) && this.adaptLevel("upgrade");
3507
3429
  });
3508
3430
  r(this, "onAdaptedLevel", () => {
3509
3431
  this.reset();
3510
3432
  });
3511
3433
  r(this, "adaptLevel", (e) => this.emitter.emit("adapt level", e));
3512
- this.qualityOfServiceSource = i, this.config = v(v({}, fg), n), this.emitter = e, this.logger = t;
3434
+ this.qualityOfServiceSource = i, this.config = v(v({}, hg), n), this.emitter = e, this.logger = t;
3513
3435
  }
3514
3436
  tooMuchTimeBuffering(e) {
3515
3437
  return this.qualityOfServiceSource.timeSpentBufferingLast(e) / this.qualityOfServiceSource.timeSpentActiveLast(e) > this.config.maxBufferingRatio.last10Seconds;
@@ -3520,7 +3442,7 @@ const cg = (s) => {
3520
3442
  };
3521
3443
  r(Qo, "create", (e, t, i, n = {}) => new Qo(e, t, i, n));
3522
3444
  let ph = Qo;
3523
- const pg = {
3445
+ const dg = {
3524
3446
  minBufferTime: 1500,
3525
3447
  maxBufferTime: 1500,
3526
3448
  cooldownTime: 3e4,
@@ -3573,7 +3495,7 @@ const pg = {
3573
3495
  this.targetBufferTimeTarget.targetBufferTime + m
3574
3496
  ), this.bufferTimeAdjustmentCount++, this.reset());
3575
3497
  });
3576
- this.qualityOfServiceSource = i, this.targetBufferTimeTarget = n, this.config = v(v({}, pg), o), this.emitter = e, this.logger = t;
3498
+ this.qualityOfServiceSource = i, this.targetBufferTimeTarget = n, this.config = v(v({}, dg), o), this.emitter = e, this.logger = t;
3577
3499
  }
3578
3500
  updateConfig(e) {
3579
3501
  this.config = v(v({}, this.config), e);
@@ -3601,7 +3523,7 @@ function Xu(s) {
3601
3523
  throw new Error("Unknown object status " + s);
3602
3524
  }
3603
3525
  var mt, qs, $s, Wr, zr, Ys, Hr, Xr;
3604
- class gg {
3526
+ class ug {
3605
3527
  constructor(e, t, i, n, o, c) {
3606
3528
  u(this, mt);
3607
3529
  u(this, qs);
@@ -3665,7 +3587,7 @@ class gg {
3665
3587
  }
3666
3588
  mt = new WeakMap(), qs = new WeakMap(), $s = new WeakMap(), Wr = new WeakMap(), zr = new WeakMap(), Ys = new WeakMap(), Hr = new WeakMap(), Xr = new WeakMap();
3667
3589
  var ft, Js, Qr, Zr, Ks, vs, Qu, Ah;
3668
- class Ag {
3590
+ class lg {
3669
3591
  constructor(e, t, i, n, o) {
3670
3592
  u(this, vs);
3671
3593
  u(this, ft);
@@ -3705,7 +3627,7 @@ class Ag {
3705
3627
  ft = new WeakMap(), Js = new WeakMap(), Qr = new WeakMap(), Zr = new WeakMap(), Ks = new WeakMap(), vs = new WeakSet(), Qu = function() {
3706
3628
  return Rt(this, null, function* () {
3707
3629
  for (; !(yield new $(a(this, ft).isDone())); ) {
3708
- const e = yield new $(a(this, ft).readBigVarInt()), t = new gg(
3630
+ const e = yield new $(a(this, ft).readBigVarInt()), t = new ug(
3709
3631
  a(this, ft),
3710
3632
  e,
3711
3633
  a(this, Js),
@@ -3722,7 +3644,7 @@ ft = new WeakMap(), Js = new WeakMap(), Qr = new WeakMap(), Zr = new WeakMap(),
3722
3644
  });
3723
3645
  };
3724
3646
  var tt, en, qr, tn, $r, Yr, Jr, sn, Zo, Ss, Zu, wh;
3725
- class wg {
3647
+ class mg {
3726
3648
  constructor(e, t, i, n, o, c, h) {
3727
3649
  u(this, Ss);
3728
3650
  u(this, tt);
@@ -3807,11 +3729,11 @@ function qu(s, e) {
3807
3729
  switch (t) {
3808
3730
  case Uo.StreamHeaderGroup: {
3809
3731
  const i = yield s.readBigVarInt(), n = yield s.readBigVarInt(), o = yield s.readBigVarInt(), c = yield s.readBigVarInt(), h = yield s.readUnsigned8();
3810
- return new wg(s, i, n, o, c, h, e);
3732
+ return new mg(s, i, n, o, c, h, e);
3811
3733
  }
3812
3734
  case Uo.StreamHeaderTrack: {
3813
3735
  const i = yield s.readBigVarInt(), n = yield s.readBigVarInt(), o = yield s.readUnsigned8();
3814
- return new Ag(s, i, n, o, e);
3736
+ return new lg(s, i, n, o, e);
3815
3737
  }
3816
3738
  default:
3817
3739
  throw new Error("Unexpected message type " + t);
@@ -3819,7 +3741,7 @@ function qu(s, e) {
3819
3741
  });
3820
3742
  }
3821
3743
  var si, Kr;
3822
- class bg {
3744
+ class fg {
3823
3745
  constructor(e, t) {
3824
3746
  u(this, si);
3825
3747
  u(this, Kr);
@@ -3839,7 +3761,7 @@ class bg {
3839
3761
  }
3840
3762
  si = new WeakMap(), Kr = new WeakMap();
3841
3763
  var pt, ji, Wi, zi;
3842
- class yg {
3764
+ class pg {
3843
3765
  constructor(e) {
3844
3766
  u(this, pt);
3845
3767
  u(this, ji, null);
@@ -4067,7 +3989,7 @@ const Cr = class Cr {
4067
3989
  };
4068
3990
  Ue = new WeakMap(), xe = new WeakMap(), Xi = new WeakMap(), Yo = new WeakMap(), r(Cr, "DEFAULT_BUFFER_SIZE", 1024);
4069
3991
  let Pr = Cr;
4070
- const Ju = Math.pow(2, 6) - 1, Ku = Math.pow(2, 14) - 1, el = Math.pow(2, 30) - 1, vg = Number.MAX_SAFE_INTEGER, Sg = typeof BigInt == "function" ? R(2) ** R(62) - R(1) : R(Number.MAX_SAFE_INTEGER);
3992
+ const Ju = 2 ** 6 - 1, Ku = 2 ** 14 - 1, el = 2 ** 30 - 1, gg = Number.MAX_SAFE_INTEGER, Ag = typeof BigInt == "function" ? R(2) ** R(62) - R(1) : R(Number.MAX_SAFE_INTEGER);
4071
3993
  function Vc(s, e) {
4072
3994
  return e[0] = s, e.subarray(0, 1);
4073
3995
  }
@@ -4094,7 +4016,7 @@ function rl(s, e) {
4094
4016
  return tl(s | 16384, e);
4095
4017
  if (s <= el)
4096
4018
  return il(s | 2147483648, e);
4097
- if (s <= vg)
4019
+ if (s <= gg)
4098
4020
  return typeof BigInt == "function" ? sl(BigInt(s) | BigInt(3221225472) << BigInt(32), e) : nl(Number(s), e);
4099
4021
  throw new Error(`overflow, value larger than 53-bits: ${s}`);
4100
4022
  }
@@ -4105,7 +4027,7 @@ function al(s, e) {
4105
4027
  return tl(Number(s) | 16384, e);
4106
4028
  if (s <= el)
4107
4029
  return il(Number(s) | 2147483648, e);
4108
- if (s <= Sg)
4030
+ if (s <= Ag)
4109
4031
  return typeof BigInt == "function" ? sl(BigInt(s) | BigInt(3221225472) << BigInt(32), e) : nl(Number(s), e);
4110
4032
  throw new Error(`overflow, value larger than 62-bits: ${s}`);
4111
4033
  }
@@ -4146,7 +4068,7 @@ function $n(s, e) {
4146
4068
  yield s.writeBigVarInt(t), yield s.writeVarInt(i.payload.length), yield s.write(i.payload);
4147
4069
  });
4148
4070
  }
4149
- function Eg(s) {
4071
+ function wg(s) {
4150
4072
  return f(this, null, function* () {
4151
4073
  return {
4152
4074
  type: I.Announce,
@@ -4155,12 +4077,12 @@ function Eg(s) {
4155
4077
  };
4156
4078
  });
4157
4079
  }
4158
- function Tg(s, e) {
4080
+ function bg(s, e) {
4159
4081
  return f(this, null, function* () {
4160
4082
  yield sd(s, e.namespace), yield $n(s, e.params);
4161
4083
  });
4162
4084
  }
4163
- function Ig(s) {
4085
+ function yg(s) {
4164
4086
  return f(this, null, function* () {
4165
4087
  return {
4166
4088
  type: I.AnnounceOk,
@@ -4168,79 +4090,18 @@ function Ig(s) {
4168
4090
  };
4169
4091
  });
4170
4092
  }
4171
- function Cg(s, e) {
4093
+ function vg(s, e) {
4172
4094
  return f(this, null, function* () {
4173
4095
  yield sd(s, e.namespace);
4174
4096
  });
4175
4097
  }
4176
- const kg = {
4177
- Subscriber: 2
4178
- }, Lo = {
4179
- Role: R(0)
4180
- }, ol = {
4181
- Draft07: 4278190087
4182
- };
4183
- function cl(s) {
4184
- return f(this, null, function* () {
4185
- const e = yield s.readVarInt();
4186
- switch (e) {
4187
- case ol.Draft07:
4188
- return { type: "known", value: e };
4189
- default:
4190
- return { type: "unknown", value: e };
4191
- }
4192
- });
4193
- }
4194
- function Bg(s, e) {
4195
- return f(this, null, function* () {
4196
- yield s.writeVarInt(e.supportedVersions.length);
4197
- for (const t of e.supportedVersions)
4198
- yield s.writeVarInt(t.value);
4199
- yield $n(s, e.parameters);
4200
- });
4201
- }
4202
- function Rg(s) {
4203
- return f(this, null, function* () {
4204
- const e = [], t = yield s.readVarInt();
4205
- for (let n = 0; n < t; n++)
4206
- e.push(yield cl(s));
4207
- const i = yield qn(s);
4208
- if (!i.has(Lo.Role))
4209
- throw new Error("Role parameter is required");
4210
- return {
4211
- type: I.ClientSetup,
4212
- supportedVersions: e,
4213
- parameters: i
4214
- };
4215
- });
4216
- }
4217
- function Ug(s, e) {
4218
- return f(this, null, function* () {
4219
- yield s.writeVarInt(e.selectedVersion.value), yield $n(s, e.parameters);
4220
- });
4221
- }
4222
- function Pg(s) {
4223
- return f(this, null, function* () {
4224
- const e = yield cl(s);
4225
- if (e.type !== "known")
4226
- throw new Error("Expected known version");
4227
- const t = yield qn(s);
4228
- if (!t.has(Lo.Role))
4229
- throw new Error("Role parameter is required");
4230
- return {
4231
- type: I.ServerSetup,
4232
- selectedVersion: e,
4233
- parameters: t
4234
- };
4235
- });
4236
- }
4237
- const xg = {
4098
+ const Sg = {
4238
4099
  "latest-group": 1,
4239
4100
  "latest-object": 2,
4240
4101
  "absolute-start": 3,
4241
4102
  "absolute-range": 4
4242
4103
  };
4243
- function Lg(s) {
4104
+ function Eg(s) {
4244
4105
  return f(this, null, function* () {
4245
4106
  const e = yield s.readVarInt();
4246
4107
  switch (e) {
@@ -4273,9 +4134,9 @@ function Lg(s) {
4273
4134
  }
4274
4135
  });
4275
4136
  }
4276
- function Dg(s, e) {
4137
+ function Tg(s, e) {
4277
4138
  return f(this, null, function* () {
4278
- const t = xg[e.type];
4139
+ const t = Sg[e.type];
4279
4140
  switch (yield s.writeVarInt(t), e.type) {
4280
4141
  case "absolute-range":
4281
4142
  yield s.writeBigVarInt(e.start.group), yield s.writeBigVarInt(e.start.object), yield s.writeBigVarInt(e.end.group), yield s.writeBigVarInt(e.end.object);
@@ -4291,7 +4152,7 @@ function Dg(s, e) {
4291
4152
  }
4292
4153
  });
4293
4154
  }
4294
- function hl(s) {
4155
+ function ol(s) {
4295
4156
  return f(this, null, function* () {
4296
4157
  const e = yield s.readUnsigned8();
4297
4158
  switch (e) {
@@ -4306,7 +4167,7 @@ function hl(s) {
4306
4167
  }
4307
4168
  });
4308
4169
  }
4309
- function dl(s, e) {
4170
+ function cl(s, e) {
4310
4171
  return f(this, null, function* () {
4311
4172
  switch (e) {
4312
4173
  case "inherit-publisher":
@@ -4321,9 +4182,9 @@ function dl(s, e) {
4321
4182
  }
4322
4183
  });
4323
4184
  }
4324
- function Og(s) {
4185
+ function Ig(s) {
4325
4186
  return f(this, null, function* () {
4326
- const e = yield s.readBigVarInt(), t = yield s.readBigVarInt(), i = yield Gc(s), n = yield s.readString(), o = yield s.readUnsigned8(), c = yield hl(s), h = yield Lg(s), d = yield qn(s);
4187
+ const e = yield s.readBigVarInt(), t = yield s.readBigVarInt(), i = yield Gc(s), n = yield s.readString(), o = yield s.readUnsigned8(), c = yield ol(s), h = yield Eg(s), d = yield qn(s);
4327
4188
  if (h.type === "absolute-range") {
4328
4189
  const m = h.start.group > h.end.group, p = h.start.group === h.end.group && h.start.object > h.end.object;
4329
4190
  if (m || p)
@@ -4342,16 +4203,16 @@ function Og(s) {
4342
4203
  };
4343
4204
  });
4344
4205
  }
4345
- function Mg(s, e) {
4206
+ function Cg(s, e) {
4346
4207
  return f(this, null, function* () {
4347
- yield s.writeBigVarInt(e.id), yield s.writeBigVarInt(e.trackAlias), yield sd(s, e.namespace), yield s.writeString(e.name), yield s.writeUnsigned8(e.subscriberPriority), yield dl(s, e.groupOrder), yield Dg(s, e.filterType), yield $n(s, e.params);
4208
+ yield s.writeBigVarInt(e.id), yield s.writeBigVarInt(e.trackAlias), yield sd(s, e.namespace), yield s.writeString(e.name), yield s.writeUnsigned8(e.subscriberPriority), yield cl(s, e.groupOrder), yield Tg(s, e.filterType), yield $n(s, e.params);
4348
4209
  });
4349
4210
  }
4350
4211
  const bh = {
4351
4212
  TrackEnded: 3,
4352
4213
  Expired: 6
4353
4214
  };
4354
- function Fg(s) {
4215
+ function kg(s) {
4355
4216
  return f(this, null, function* () {
4356
4217
  const e = yield s.readBigVarInt(), t = yield s.readVarInt(), i = yield s.readString(), n = (yield s.readUnsigned8()) == 1;
4357
4218
  let o;
@@ -4367,12 +4228,12 @@ function Fg(s) {
4367
4228
  };
4368
4229
  });
4369
4230
  }
4370
- function _g(s, e) {
4231
+ function Bg(s, e) {
4371
4232
  return f(this, null, function* () {
4372
4233
  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
4234
  });
4374
4235
  }
4375
- function Ng(s) {
4236
+ function Rg(s) {
4376
4237
  return f(this, null, function* () {
4377
4238
  return {
4378
4239
  type: I.SubscribeError,
@@ -4383,14 +4244,14 @@ function Ng(s) {
4383
4244
  };
4384
4245
  });
4385
4246
  }
4386
- function Vg(s, e) {
4247
+ function Ug(s, e) {
4387
4248
  return f(this, null, function* () {
4388
4249
  yield s.writeBigVarInt(e.id), yield s.writeBigVarInt(e.errorCode), yield s.writeString(e.reason), yield s.writeBigVarInt(e.trackAlias);
4389
4250
  });
4390
4251
  }
4391
- function Gg(s) {
4252
+ function Pg(s) {
4392
4253
  return f(this, null, function* () {
4393
- const e = yield s.readBigVarInt(), t = yield s.readBigVarInt(), i = yield hl(s), n = (yield s.readUnsigned8()) == 1;
4254
+ const e = yield s.readBigVarInt(), t = yield s.readBigVarInt(), i = yield ol(s), n = (yield s.readUnsigned8()) == 1;
4394
4255
  let o;
4395
4256
  if (i == "inherit-publisher")
4396
4257
  throw new Error("SusbcribeOk cannot have inherit publisher group order");
@@ -4409,32 +4270,93 @@ function Gg(s) {
4409
4270
  };
4410
4271
  });
4411
4272
  }
4412
- function jg(s, e) {
4273
+ function xg(s, e) {
4274
+ return f(this, null, function* () {
4275
+ yield s.writeBigVarInt(e.id), yield s.writeBigVarInt(e.expires), yield cl(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 $n(s, e.params);
4276
+ });
4277
+ }
4278
+ function Lg(s) {
4279
+ return f(this, null, function* () {
4280
+ 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 qn(s), d = t > n, m = t === n && i > o;
4281
+ if (d || m)
4282
+ throw new Error("Invalid filter range");
4283
+ return {
4284
+ type: I.SubscribeUpdate,
4285
+ id: e,
4286
+ start: { group: t, object: i },
4287
+ end: { group: n, object: o },
4288
+ subscriberPriority: c,
4289
+ params: h
4290
+ };
4291
+ });
4292
+ }
4293
+ function Dg(s, e) {
4294
+ return f(this, null, function* () {
4295
+ 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 $n(s, e.params);
4296
+ });
4297
+ }
4298
+ const Og = {
4299
+ Subscriber: 2
4300
+ }, Lo = {
4301
+ Role: R(0)
4302
+ }, hl = {
4303
+ Draft07: 4278190087
4304
+ };
4305
+ function dl(s) {
4306
+ return f(this, null, function* () {
4307
+ const e = yield s.readVarInt();
4308
+ switch (e) {
4309
+ case hl.Draft07:
4310
+ return { type: "known", value: e };
4311
+ default:
4312
+ return { type: "unknown", value: e };
4313
+ }
4314
+ });
4315
+ }
4316
+ function Mg(s, e) {
4413
4317
  return f(this, null, function* () {
4414
- yield s.writeBigVarInt(e.id), yield s.writeBigVarInt(e.expires), yield dl(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 $n(s, e.params);
4318
+ yield s.writeVarInt(e.supportedVersions.length);
4319
+ for (const t of e.supportedVersions)
4320
+ yield s.writeVarInt(t.value);
4321
+ yield $n(s, e.parameters);
4415
4322
  });
4416
4323
  }
4417
- function Wg(s) {
4324
+ function Fg(s) {
4418
4325
  return f(this, null, function* () {
4419
- 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 qn(s), d = t > n, m = t === n && i > o;
4420
- if (d || m)
4421
- throw new Error("Invalid filter range");
4326
+ const e = [], t = yield s.readVarInt();
4327
+ for (let n = 0; n < t; n++)
4328
+ e.push(yield dl(s));
4329
+ const i = yield qn(s);
4330
+ if (!i.has(Lo.Role))
4331
+ throw new Error("Role parameter is required");
4422
4332
  return {
4423
- type: I.SubscribeUpdate,
4424
- id: e,
4425
- start: { group: t, object: i },
4426
- end: { group: n, object: o },
4427
- subscriberPriority: c,
4428
- params: h
4333
+ type: I.ClientSetup,
4334
+ supportedVersions: e,
4335
+ parameters: i
4429
4336
  };
4430
4337
  });
4431
4338
  }
4432
- function zg(s, e) {
4339
+ function _g(s, e) {
4433
4340
  return f(this, null, function* () {
4434
- 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 $n(s, e.params);
4341
+ yield s.writeVarInt(e.selectedVersion.value), yield $n(s, e.parameters);
4342
+ });
4343
+ }
4344
+ function Ng(s) {
4345
+ return f(this, null, function* () {
4346
+ const e = yield dl(s);
4347
+ if (e.type !== "known")
4348
+ throw new Error("Expected known version");
4349
+ const t = yield qn(s);
4350
+ if (!t.has(Lo.Role))
4351
+ throw new Error("Role parameter is required");
4352
+ return {
4353
+ type: I.ServerSetup,
4354
+ selectedVersion: e,
4355
+ parameters: t
4356
+ };
4435
4357
  });
4436
4358
  }
4437
- function Hg(s) {
4359
+ function Vg(s) {
4438
4360
  return f(this, null, function* () {
4439
4361
  return {
4440
4362
  type: I.Unsubscribe,
@@ -4442,7 +4364,7 @@ function Hg(s) {
4442
4364
  };
4443
4365
  });
4444
4366
  }
4445
- function Xg(s, e) {
4367
+ function Gg(s, e) {
4446
4368
  return f(this, null, function* () {
4447
4369
  yield s.writeBigVarInt(e.id);
4448
4370
  });
@@ -4513,47 +4435,47 @@ class ul {
4513
4435
  }
4514
4436
  Ot = new WeakMap(), an = new WeakMap(), te = new WeakSet(), ll = function(e, t) {
4515
4437
  return f(this, null, function* () {
4516
- yield Bg(e, t);
4438
+ yield Mg(e, t);
4517
4439
  });
4518
4440
  }, ml = function(e, t) {
4519
4441
  return f(this, null, function* () {
4520
- yield Ug(e, t);
4442
+ yield _g(e, t);
4521
4443
  });
4522
4444
  }, fl = function(e, t) {
4523
4445
  return f(this, null, function* () {
4524
- yield Mg(e, t);
4446
+ yield Cg(e, t);
4525
4447
  });
4526
4448
  }, pl = function(e, t) {
4527
4449
  return f(this, null, function* () {
4528
- yield jg(e, t);
4450
+ yield xg(e, t);
4529
4451
  });
4530
4452
  }, gl = function(e, t) {
4531
4453
  return f(this, null, function* () {
4532
- yield Vg(e, t);
4454
+ yield Ug(e, t);
4533
4455
  });
4534
4456
  }, Al = function(e, t) {
4535
4457
  return f(this, null, function* () {
4536
- yield zg(e, t);
4458
+ yield Dg(e, t);
4537
4459
  });
4538
4460
  }, wl = function(e, t) {
4539
4461
  return f(this, null, function* () {
4540
- yield _g(e, t);
4462
+ yield Bg(e, t);
4541
4463
  });
4542
4464
  }, bl = function(e, t) {
4543
4465
  return f(this, null, function* () {
4544
- yield Xg(e, t);
4466
+ yield Gg(e, t);
4545
4467
  });
4546
4468
  }, yl = function(e, t) {
4547
4469
  return f(this, null, function* () {
4548
- yield Tg(e, t);
4470
+ yield bg(e, t);
4549
4471
  });
4550
4472
  }, vl = function(e, t) {
4551
4473
  return f(this, null, function* () {
4552
- yield Cg(e, t);
4474
+ yield vg(e, t);
4553
4475
  });
4554
4476
  };
4555
4477
  var on, ta, ia;
4556
- class Qg {
4478
+ class jg {
4557
4479
  constructor(e, t) {
4558
4480
  u(this, on);
4559
4481
  u(this, ta);
@@ -4570,7 +4492,7 @@ class Qg {
4570
4492
  }
4571
4493
  }
4572
4494
  on = new WeakMap(), ta = new WeakMap(), ia = new WeakMap();
4573
- function Zg(s) {
4495
+ function Wg(s) {
4574
4496
  return f(this, null, function* () {
4575
4497
  return {
4576
4498
  type: I.AnnounceError,
@@ -4580,7 +4502,7 @@ function Zg(s) {
4580
4502
  };
4581
4503
  });
4582
4504
  }
4583
- function qg(s, e, t) {
4505
+ function zg(s, e, t) {
4584
4506
  return f(this, null, function* () {
4585
4507
  return {
4586
4508
  type: I.Unknown,
@@ -4590,7 +4512,7 @@ function qg(s, e, t) {
4590
4512
  });
4591
4513
  }
4592
4514
  var oe;
4593
- class Vd {
4515
+ class Nd {
4594
4516
  constructor(e) {
4595
4517
  u(this, oe);
4596
4518
  l(this, oe, e);
@@ -4603,29 +4525,29 @@ class Vd {
4603
4525
  const e = yield a(this, oe).readVarInt(), t = yield a(this, oe).readVarInt();
4604
4526
  switch (e) {
4605
4527
  case I.ServerSetup:
4606
- return Pg(a(this, oe));
4528
+ return Ng(a(this, oe));
4607
4529
  case I.ClientSetup:
4608
- return Rg(a(this, oe));
4530
+ return Fg(a(this, oe));
4609
4531
  case I.Subscribe:
4610
- return Og(a(this, oe));
4532
+ return Ig(a(this, oe));
4611
4533
  case I.SubscribeOk:
4612
- return Gg(a(this, oe));
4534
+ return Pg(a(this, oe));
4613
4535
  case I.SubscribeDone:
4614
- return Fg(a(this, oe));
4536
+ return kg(a(this, oe));
4615
4537
  case I.SubscribeError:
4616
- return Ng(a(this, oe));
4538
+ return Rg(a(this, oe));
4617
4539
  case I.SubscribeUpdate:
4618
- return Wg(a(this, oe));
4540
+ return Lg(a(this, oe));
4619
4541
  case I.Unsubscribe:
4620
- return Hg(a(this, oe));
4542
+ return Vg(a(this, oe));
4621
4543
  case I.Announce:
4622
- return Eg(a(this, oe));
4544
+ return wg(a(this, oe));
4623
4545
  case I.AnnounceOk:
4624
- return Ig(a(this, oe));
4546
+ return yg(a(this, oe));
4625
4547
  case I.AnnounceError:
4626
- return Zg(a(this, oe));
4548
+ return Wg(a(this, oe));
4627
4549
  }
4628
- return qg(a(this, oe), R(e), t);
4550
+ return zg(a(this, oe), R(e), t);
4629
4551
  });
4630
4552
  }
4631
4553
  }
@@ -4667,15 +4589,15 @@ const Fs = class Fs {
4667
4589
  }
4668
4590
  static wrapWebsocket(e) {
4669
4591
  const t = new ReadableStream(
4670
- new bg(e, a(Fs, Ko))
4671
- ), i = new Vd(new Po(new Uint8Array([]), t)), n = new Qg(new Pr(e), new Uint8Array([0]));
4592
+ new fg(e, a(Fs, Ko))
4593
+ ), i = new Nd(new Po(new Uint8Array([]), t)), n = new jg(new Pr(e), new Uint8Array([0]));
4672
4594
  return new Fs(n, i);
4673
4595
  }
4674
4596
  static wrapWebTransport(e) {
4675
4597
  const t = e.writable, i = e.readable;
4676
4598
  return new Fs(
4677
4599
  new ul(new $u(t)),
4678
- new Vd(new Po(new Uint8Array(), i))
4600
+ new Nd(new Po(new Uint8Array(), i))
4679
4601
  );
4680
4602
  }
4681
4603
  };
@@ -4688,7 +4610,7 @@ function El(s, e) {
4688
4610
  return f(this, null, function* () {
4689
4611
  yield s.write({
4690
4612
  type: I.ClientSetup,
4691
- supportedVersions: [{ type: "known", value: ol.Draft07 }],
4613
+ supportedVersions: [{ type: "known", value: hl.Draft07 }],
4692
4614
  parameters: /* @__PURE__ */ new Map([[Lo.Role, { type: Lo.Role, payload: new Uint8Array([e]) }]])
4693
4615
  });
4694
4616
  const t = yield s.read();
@@ -4699,7 +4621,7 @@ function El(s, e) {
4699
4621
  });
4700
4622
  }
4701
4623
  var dn;
4702
- class $g {
4624
+ class Hg {
4703
4625
  constructor(e) {
4704
4626
  r(this, "announce");
4705
4627
  u(this, dn, new z());
@@ -4717,11 +4639,11 @@ class $g {
4717
4639
  }
4718
4640
  }
4719
4641
  dn = new WeakMap();
4720
- function Yg(s) {
4721
- const e = new $g(s);
4722
- return new Jg(e);
4642
+ function Xg(s) {
4643
+ const e = new Hg(s);
4644
+ return new Qg(e);
4723
4645
  }
4724
- class Jg {
4646
+ class Qg {
4725
4647
  constructor(e) {
4726
4648
  r(this, "state");
4727
4649
  this.state = e;
@@ -4800,7 +4722,7 @@ const _s = class _s {
4800
4722
  un = new WeakMap(), ni = new WeakMap(), Qi = new WeakMap(), ec = new WeakMap(), Zi = new WeakMap(), it = new WeakMap(), r(_s, "maxGraceTime", 15e3), r(_s, "minGraceTime", 3e3);
4801
4723
  let Oo = _s;
4802
4724
  var Ae, ra;
4803
- class Kg {
4725
+ class Zg {
4804
4726
  constructor(e) {
4805
4727
  u(this, Ae);
4806
4728
  u(this, ra, !1);
@@ -4819,7 +4741,7 @@ class Kg {
4819
4741
  }
4820
4742
  Ae = new WeakMap(), ra = new WeakMap();
4821
4743
  var aa, We, oa, ca, ln, ha, tc, Tl;
4822
- class eA {
4744
+ class qg {
4823
4745
  constructor(e, t, i, n) {
4824
4746
  u(this, tc);
4825
4747
  u(this, aa);
@@ -4875,8 +4797,8 @@ aa = new WeakMap(), We = new WeakMap(), oa = new WeakMap(), ca = new WeakMap(),
4875
4797
  if (g && (g.startGroup > p.id || g.endGroup && g.endGroup < p.id))
4876
4798
  break;
4877
4799
  const w = yield a(this, oa).openSendStream();
4878
- const b = new Kg(w);
4879
- const S = Ne(e, new tA(b, p.consume(), a(this, We)), !0);
4800
+ const b = new Zg(w);
4801
+ const S = Ne(e, new $g(b, p.consume(), a(this, We)), !0);
4880
4802
  yield S.run();
4881
4803
  l(this, ln, S.finalGroup());
4882
4804
  } catch (t) {
@@ -4899,7 +4821,7 @@ aa = new WeakMap(), We = new WeakMap(), oa = new WeakMap(), ca = new WeakMap(),
4899
4821
  });
4900
4822
  };
4901
4823
  var qi, da, mn, ua, fn;
4902
- class tA {
4824
+ class $g {
4903
4825
  constructor(e, t, i) {
4904
4826
  u(this, qi);
4905
4827
  u(this, da);
@@ -4950,7 +4872,7 @@ class tA {
4950
4872
  }
4951
4873
  qi = new WeakMap(), da = new WeakMap(), mn = new WeakMap(), ua = new WeakMap(), fn = new WeakMap();
4952
4874
  var la, $i, ri, Us;
4953
- class iA {
4875
+ class Yg {
4954
4876
  constructor(e, t, i) {
4955
4877
  u(this, ri);
4956
4878
  r(this, "state");
@@ -4974,7 +4896,7 @@ class iA {
4974
4896
  params: /* @__PURE__ */ new Map(),
4975
4897
  largestInfo: n ? { group: n, object: o } : void 0
4976
4898
  };
4977
- return yield a(this, $i).push(h), new eA(this.state, c, a(this, la), a(this, $i));
4899
+ return yield a(this, $i).push(h), new qg(this.state, c, a(this, la), a(this, $i));
4978
4900
  });
4979
4901
  }
4980
4902
  invalidRange() {
@@ -5033,7 +4955,7 @@ class yh {
5033
4955
  type: I.Announce,
5034
4956
  namespace: e,
5035
4957
  params: t
5036
- }, o = Yg(n);
4958
+ }, o = Xg(n);
5037
4959
  if (a(this, ai).update((h) => h.set(n.namespace.join("/"), o)), yield a(this, gn).push(n), !(yield Promise.race([o.state.ok(), a(this, pn).closed()])))
5038
4960
  throw new Error("Session closed");
5039
4961
  });
@@ -5055,7 +4977,7 @@ class yh {
5055
4977
  yield i == null ? void 0 : i.timeout();
5056
4978
  }
5057
4979
  yield a(this, ci).push(
5058
- new iA(t, a(this, ma), a(this, gn))
4980
+ new Yg(t, a(this, ma), a(this, gn))
5059
4981
  );
5060
4982
  }
5061
4983
  break;
@@ -5088,12 +5010,12 @@ class yh {
5088
5010
  }
5089
5011
  }
5090
5012
  sh = Ti(null), pn = new WeakMap(), ma = new WeakMap(), gn = new WeakMap(), Yi = new WeakMap(), ai = new WeakMap(), oi = new WeakMap(), ci = new WeakMap(), ye(sh, 1, "announce", su, yh), Zt(sh, yh);
5091
- function sA(s, e) {
5092
- const t = new Oo(e), [i, n] = ed(100), o = new nA(t, i), c = new Il(s, t, n);
5013
+ function Jg(s, e) {
5014
+ const t = new Oo(e), [i, n] = ed(100), o = new Kg(t, i), c = new Il(s, t, n);
5093
5015
  return [o, c];
5094
5016
  }
5095
5017
  var Ji;
5096
- class nA {
5018
+ class Kg {
5097
5019
  constructor(e, t) {
5098
5020
  r(this, "state");
5099
5021
  u(this, Ji);
@@ -5292,7 +5214,7 @@ nh = Ti(null), An = new WeakMap(), ue = new WeakMap(), wn = new WeakMap(), bn =
5292
5214
  return yield this.close(), this.unsubscribe();
5293
5215
  });
5294
5216
  }, sr = ye(nh, 17, "#dispose", nu, yn, sr), Zt(nh, Il);
5295
- const rA = 2e3;
5217
+ const eA = 2e3;
5296
5218
  var ru, au, ou, cu, Mt, Le, Ki, es, Bs, Tt, no, Ps;
5297
5219
  cu = [Pe({ context: "Session", return: "debug" })], ou = [Pe({ context: "Session", enter: "info", error: "error" })], au = [Pe({ context: "Session", enter: "debug" })], ru = [Pe({ context: "Session", enter: "debug" })];
5298
5220
  class so {
@@ -5323,10 +5245,10 @@ class so {
5323
5245
  subscriberPriority: t.priority,
5324
5246
  filterType: t.filterType,
5325
5247
  params: i
5326
- }, [m, p] = sA(a(this, Ki), d);
5248
+ }, [m, p] = Jg(a(this, Ki), d);
5327
5249
  if (a(this, Le).update((w) => w.set(c, m)), yield a(this, Ki).push(d), !(yield Promise.race([m.state.ok(), a(this, Mt).closed()])))
5328
5250
  throw new Error("Session closed");
5329
- return p.closed().then(() => Promise.race([Si(rA), this.closed()])).then(() => A(this, Tt, Ps).call(this, p.id)).catch(() => A(this, Tt, Ps).call(this, p.id)), p;
5251
+ return p.closed().then(() => Promise.race([Si(eA), this.closed()])).then(() => A(this, Tt, Ps).call(this, p.id)).catch(() => A(this, Tt, Ps).call(this, p.id)), p;
5330
5252
  });
5331
5253
  }
5332
5254
  closed() {
@@ -5518,9 +5440,9 @@ Rs = Ti(null), st = new WeakMap(), fa = new WeakMap(), ts = new WeakMap(), vn =
5518
5440
  }, nr = function() {
5519
5441
  this.close();
5520
5442
  }, ro = ye(Rs, 17, "#runOutgoingMessages", lu, ce, ro), ao = ye(Rs, 17, "#runControl", uu, ce, ao), oo = ye(Rs, 17, "#runObjects", du, ce, oo), nr = ye(Rs, 17, "#dispose", hu, ce, nr), Zt(Rs, nd);
5521
- const aA = 128;
5443
+ const tA = 128;
5522
5444
  var ze, pa, is, En, ga, we, Ui, Pi;
5523
- class oA {
5445
+ class iA {
5524
5446
  constructor(e, t, i) {
5525
5447
  u(this, we);
5526
5448
  u(this, ze);
@@ -5571,10 +5493,10 @@ ze = new WeakMap(), pa = new WeakMap(), is = new WeakMap(), En = new WeakMap(),
5571
5493
  throw new Error("Stream is closed");
5572
5494
  }, Pi = function(e = !0) {
5573
5495
  if (a(this, is))
5574
- return l(this, is, !1), a(this, ze).writeUnsigned8(a(this, pa) | (e ? aA : 0));
5496
+ return l(this, is, !1), a(this, ze).writeUnsigned8(a(this, pa) | (e ? tA : 0));
5575
5497
  };
5576
5498
  var hi, Ft, Tn, ss, _t, In, Cn, ic, Bl;
5577
- class cA {
5499
+ class sA {
5578
5500
  constructor(e, t) {
5579
5501
  u(this, ic);
5580
5502
  u(this, hi);
@@ -5584,7 +5506,7 @@ class cA {
5584
5506
  u(this, _t, /* @__PURE__ */ new Map());
5585
5507
  u(this, In, pe.get().createContext("WebSocketConnection"));
5586
5508
  u(this, Cn, new Set(new Array(128).fill(0).map((e, t) => t + 1)));
5587
- l(this, hi, e), l(this, Ft, t), l(this, Tn, new ReadableStream(new yg(e))), a(this, hi).addEventListener("close", () => {
5509
+ l(this, hi, e), l(this, Ft, t), l(this, Tn, new ReadableStream(new pg(e))), a(this, hi).addEventListener("close", () => {
5588
5510
  a(this, Ft).markPostHandshake(), a(this, _t).forEach((i) => i.close());
5589
5511
  });
5590
5512
  }
@@ -5593,7 +5515,7 @@ class cA {
5593
5515
  if (!e)
5594
5516
  throw new Error("No stream IDs available");
5595
5517
  return a(this, Cn).delete(e), Promise.resolve(
5596
- new oA(new Pr(a(this, hi)), e, () => A(this, ic, Bl).call(this, e))
5518
+ new iA(new Pr(a(this, hi)), e, () => A(this, ic, Bl).call(this, e))
5597
5519
  );
5598
5520
  }
5599
5521
  transportType() {
@@ -5666,7 +5588,7 @@ Bl = function(e) {
5666
5588
  a(this, Cn).add(e);
5667
5589
  };
5668
5590
  var Nt, Vt, di, Aa, wa, sc, nc, Rl;
5669
- class hA {
5591
+ class nA {
5670
5592
  constructor(e, t, i) {
5671
5593
  u(this, nc);
5672
5594
  u(this, Nt);
@@ -5744,11 +5666,11 @@ function Yc(s) {
5744
5666
  El(t, s.role).catch(() => {
5745
5667
  e.close();
5746
5668
  });
5747
- const i = new cA(e, t);
5669
+ const i = new sA(e, t);
5748
5670
  return new nd(i, s.authToken);
5749
5671
  });
5750
5672
  }
5751
- function dA(s) {
5673
+ function rA(s) {
5752
5674
  return f(this, null, function* () {
5753
5675
  const e = "60b82e8021689e163c1041b4475ef9c86e7565bc45d1a0aa43f5148769f461c7", t = new Uint8Array(e.length / 2);
5754
5676
  for (let d = 0; d < t.length; d += 1)
@@ -5762,14 +5684,14 @@ function dA(s) {
5762
5684
  El(o, s.role).catch(() => {
5763
5685
  i.close();
5764
5686
  });
5765
- const c = new hA(i, o, s.url.toString());
5687
+ const c = new nA(i, o, s.url.toString());
5766
5688
  return new nd(c, s.authToken);
5767
5689
  });
5768
5690
  }
5769
- function uA(s) {
5691
+ function aA(s) {
5770
5692
  return f(this, null, function* () {
5771
5693
  if (self.WebTransport && (s == null ? void 0 : s.preferredTransport) !== "websocket" && s.url.protocol.startsWith("https")) {
5772
- const e = dA(s).catch(() => Yc(s)), t = yield Promise.race([e, Si(s.websocketFallbackTimeoutMs)]);
5694
+ const e = rA(s).catch(() => Yc(s)), t = yield Promise.race([e, Si(s.websocketFallbackTimeoutMs)]);
5773
5695
  return t || Yc(s);
5774
5696
  }
5775
5697
  return Yc(s);
@@ -5834,7 +5756,7 @@ class Ul {
5834
5756
  }
5835
5757
  }
5836
5758
  kn = new WeakMap(), ba = new WeakMap();
5837
- function lA(s, e) {
5759
+ function oA(s, e) {
5838
5760
  return ["com.vindral.moq", s];
5839
5761
  }
5840
5762
  function Ci(s) {
@@ -5843,10 +5765,10 @@ function Ci(s) {
5843
5765
  throw new Error("namespace must contain a channel ID");
5844
5766
  return e;
5845
5767
  }
5846
- function mA(s) {
5768
+ function cA(s) {
5847
5769
  return "tracks" in s;
5848
5770
  }
5849
- function fA(s) {
5771
+ function hA(s) {
5850
5772
  const e = new TextDecoder().decode(s);
5851
5773
  return JSON.parse(e);
5852
5774
  }
@@ -6124,10 +6046,10 @@ nt = new WeakMap(), rs = new WeakMap(), jt = new WeakMap(), bt = new WeakMap(),
6124
6046
  });
6125
6047
  }, Ea = new WeakMap();
6126
6048
  let Ei = hd;
6127
- const pA = "catalog";
6128
- function Gd(s) {
6129
- const e = fA(s.payload);
6130
- if (!mA(e))
6049
+ const dA = "catalog";
6050
+ function Vd(s) {
6051
+ const e = hA(s.payload);
6052
+ if (!cA(e))
6131
6053
  throw new Error("unexpected catalog type");
6132
6054
  return e;
6133
6055
  }
@@ -6157,7 +6079,7 @@ const oc = class oc {
6157
6079
  const i = z.fromPromise(
6158
6080
  Ei.subscribe(
6159
6081
  e,
6160
- new Xt().name(t.catalogName || pA).groupOrder("ascending").build()
6082
+ new Xt().name(t.catalogName || dA).groupOrder("ascending").build()
6161
6083
  )
6162
6084
  ), n = z.fromPromise(i.promise.then((d) => d.objects()));
6163
6085
  if (t.catalog)
@@ -6165,7 +6087,7 @@ const oc = class oc {
6165
6087
  const c = yield (yield n.promise).next();
6166
6088
  if (!c.value)
6167
6089
  throw new Error("No catalog found");
6168
- const h = Gd(c.value);
6090
+ const h = Vd(c.value);
6169
6091
  return new oc(i, new Ie(h), n);
6170
6092
  });
6171
6093
  }
@@ -6178,7 +6100,7 @@ ui = new WeakMap(), Ta = new WeakMap(), Ia = new WeakMap(), Ca = new WeakMap(),
6178
6100
  const c = n.value;
6179
6101
  if (c.objectStatus !== Te.Normal)
6180
6102
  continue;
6181
- const h = Gd(c);
6103
+ const h = Vd(c);
6182
6104
  a(this, ui).update(h);
6183
6105
  }
6184
6106
  } catch (n) {
@@ -6195,7 +6117,7 @@ ui = new WeakMap(), Ta = new WeakMap(), Ia = new WeakMap(), Ca = new WeakMap(),
6195
6117
  };
6196
6118
  let Eh = oc;
6197
6119
  var ka, Bn, Ba, Rn, Ra, Th;
6198
- class gA {
6120
+ class uA {
6199
6121
  constructor(e, t, i, n) {
6200
6122
  u(this, Ra);
6201
6123
  u(this, ka);
@@ -6283,11 +6205,11 @@ const Ns = class Ns {
6283
6205
  const B = new Xt().name(t.initTrack).build(), [U, D] = yield Promise.all([
6284
6206
  A(S = Ns, cc, xl).call(S, e, B),
6285
6207
  Ei.subscribe(e, p, { params: o, largestGroupId: n ? n - R(1) : void 0 })
6286
- ]), T = new Dd(U);
6208
+ ]), T = new Ld(U);
6287
6209
  return new Ns(t, e.namespace(), D, T, i);
6288
6210
  }
6289
6211
  Qe(t.initData, "no init data found on track");
6290
- const g = bu(t.initData), w = new Dd(new Uint8Array(g)), b = yield Ei.subscribe(e, p, {
6212
+ const g = yu(t.initData), w = new Ld(new Uint8Array(g)), b = yield Ei.subscribe(e, p, {
6291
6213
  params: o,
6292
6214
  largestGroupId: n ? n - R(1) : void 0
6293
6215
  });
@@ -6319,7 +6241,7 @@ const Ns = class Ns {
6319
6241
  const e = yield a(this, yt).next();
6320
6242
  return e.done ? e : {
6321
6243
  done: !1,
6322
- value: new gA(e.value, a(this, Ua), a(this, Pa), this)
6244
+ value: new uA(e.value, a(this, Ua), a(this, Pa), this)
6323
6245
  };
6324
6246
  });
6325
6247
  }
@@ -6359,7 +6281,7 @@ Ua = new WeakMap(), yt = new WeakMap(), Pa = new WeakMap(), xa = new WeakMap(),
6359
6281
  });
6360
6282
  }, u(Ns, cc);
6361
6283
  let Ih = Ns;
6362
- const jd = 1e4, AA = 3e4;
6284
+ const Gd = 1e4, lA = 3e4;
6363
6285
  var hc, li, as, La, Da, Oa, Es, kh, Ll;
6364
6286
  const dd = class dd {
6365
6287
  constructor(e, t, i) {
@@ -6406,7 +6328,7 @@ const dd = class dd {
6406
6328
  return f(this, null, function* () {
6407
6329
  return yield a(this, li).waitFor((e) => {
6408
6330
  const t = e[0], i = e[e.length - 1];
6409
- return !t || !i ? !1 : i.wallclock - t.wallclock > jd;
6331
+ return !t || !i ? !1 : i.wallclock - t.wallclock > Gd;
6410
6332
  }), this.timeline();
6411
6333
  });
6412
6334
  }
@@ -6425,10 +6347,10 @@ hc = new WeakMap(), li = new WeakMap(), as = new WeakMap(), La = new WeakMap(),
6425
6347
  const T = o.value;
6426
6348
  if (T.objectStatus !== Te.Normal)
6427
6349
  continue;
6428
- const P = wA(T.payload);
6350
+ const P = mA(T.payload);
6429
6351
  a(this, li).update((k) => {
6430
6352
  var Q, X;
6431
- for (k.push(...P), k.sort((Me, q) => Me.wallclock - q.wallclock); k[0] && ((X = (Q = k[k.length - 1]) == null ? void 0 : Q.wallclock) != null ? X : 0) - k[0].wallclock > AA; )
6353
+ for (k.push(...P), k.sort((Me, q) => Me.wallclock - q.wallclock); k[0] && ((X = (Q = k[k.length - 1]) == null ? void 0 : Q.wallclock) != null ? X : 0) - k[0].wallclock > lA; )
6432
6354
  k.shift();
6433
6355
  return k;
6434
6356
  }), t === a(this, as).resolved && T.groupId > R(0) && T.objectId == R(0) && A(this, Es, Ll).call(this, T.groupId).catch((k) => {
@@ -6466,7 +6388,7 @@ hc = new WeakMap(), li = new WeakMap(), as = new WeakMap(), La = new WeakMap(),
6466
6388
  }, Ll = function(e) {
6467
6389
  return f(this, null, function* () {
6468
6390
  const t = e - R(1), i = this.timeline(), n = i[0], o = i[i.length - 1];
6469
- if (!n || !o || o.wallclock - n.wallclock > jd)
6391
+ if (!n || !o || o.wallclock - n.wallclock > Gd)
6470
6392
  return;
6471
6393
  const c = z.fromPromise(
6472
6394
  Ei.subscribe(
@@ -6478,7 +6400,7 @@ hc = new WeakMap(), li = new WeakMap(), as = new WeakMap(), La = new WeakMap(),
6478
6400
  });
6479
6401
  };
6480
6402
  let Ch = dd;
6481
- function wA(s) {
6403
+ function mA(s) {
6482
6404
  var t;
6483
6405
  const e = new TextDecoder("utf-8").decode(s).split(`
6484
6406
  `);
@@ -6495,7 +6417,7 @@ function wA(s) {
6495
6417
  };
6496
6418
  });
6497
6419
  }
6498
- function bA(s) {
6420
+ function fA(s) {
6499
6421
  return typeof s.language == "string";
6500
6422
  }
6501
6423
  var dc, Ma, mi, Un;
@@ -6511,7 +6433,7 @@ const ud = class ud {
6511
6433
  }
6512
6434
  static subscribe(e, t, i) {
6513
6435
  return f(this, null, function* () {
6514
- if (!bA(t))
6436
+ if (!fA(t))
6515
6437
  throw new Error("track object language is required");
6516
6438
  const n = new Xt().name(t.name).build(), o = yield Ei.subscribe(e, n), c = o.objects();
6517
6439
  return new ud(o, c, t, e.namespace(), i);
@@ -6632,6 +6554,13 @@ rh = Ti(null), os = new WeakMap(), cs = new WeakMap(), hs = new WeakMap(), fi =
6632
6554
  });
6633
6555
  }, ye(rh, 9, "start", mu, Vs), Zt(rh, Vs), Ii(rh, 3, Vs);
6634
6556
  let Fo = Vs;
6557
+ const pA = R(8);
6558
+ function gA(s) {
6559
+ if (s < 0 || s > 65535)
6560
+ throw new RangeError("burstMs must be between 0 and 65535 inclusive");
6561
+ const e = new Uint8Array([s >> 8 & 255, s & 255]);
6562
+ return { type: pA, payload: e };
6563
+ }
6635
6564
  var ds, Fa, uc, Dl;
6636
6565
  const ld = class ld {
6637
6566
  constructor(e) {
@@ -6686,23 +6615,23 @@ let Rh = ld;
6686
6615
  function eo(s) {
6687
6616
  return typeof s == "string" || s === null || s === void 0;
6688
6617
  }
6689
- function yA(s) {
6618
+ function AA(s) {
6690
6619
  return "provider" in s && typeof s.provider == "string" && (!("widevineLicenseUrl" in s) || eo(s.widevineLicenseUrl)) && (!("playreadyLicenseUrl" in s) || eo(s.playreadyLicenseUrl)) && (!("fairplayLicenseUrl" in s) || eo(s.fairplayLicenseUrl)) && (!("fairplayCertificate" in s) || eo(s.fairplayCertificate));
6691
6620
  }
6692
- function vA(s) {
6621
+ function wA(s) {
6693
6622
  try {
6694
- return bu(s);
6623
+ return yu(s);
6695
6624
  } catch (e) {
6696
6625
  throw new Error("Failed to convert fairplayCertificate");
6697
6626
  }
6698
6627
  }
6699
- function SA(s) {
6628
+ function bA(s) {
6700
6629
  const e = new TextDecoder().decode(s), t = JSON.parse(e);
6701
- if (!yA(t))
6630
+ if (!AA(t))
6702
6631
  throw new Error("Invalid drm object");
6703
6632
  const o = t, { fairplayCertificate: i } = o, n = wd(o, ["fairplayCertificate"]);
6704
6633
  return F(v({}, n), {
6705
- fairplayCertificate: i ? vA(i) : void 0
6634
+ fairplayCertificate: i ? wA(i) : void 0
6706
6635
  });
6707
6636
  }
6708
6637
  class rd {
@@ -6719,7 +6648,7 @@ class rd {
6719
6648
  const c = yield o.next();
6720
6649
  if (c.done)
6721
6650
  throw new Error("No drm object received");
6722
- const h = SA(c.value.payload);
6651
+ const h = bA(c.value.payload);
6723
6652
  return new rd(F(v({}, h), { videoCodec: t, audioCodec: i }));
6724
6653
  } catch (m) {
6725
6654
  var p = m, g = !0;
@@ -6730,16 +6659,16 @@ class rd {
6730
6659
  });
6731
6660
  }
6732
6661
  }
6733
- function EA(s) {
6662
+ function yA(s) {
6734
6663
  return "rtt" in s && typeof s.rtt == "number" && "ntpTimestamp" in s && typeof s.ntpTimestamp == "number" && "estimatedBandwidth" in s && typeof s.estimatedBandwidth == "number";
6735
6664
  }
6736
- function Wd(s) {
6665
+ function jd(s) {
6737
6666
  const e = new TextDecoder().decode(s), t = JSON.parse(e);
6738
- if (!EA(t))
6667
+ if (!yA(t))
6739
6668
  throw new Error("Invalid stats object");
6740
6669
  return t;
6741
6670
  }
6742
- const TA = 1e4;
6671
+ const vA = 1e4;
6743
6672
  var _a, lc, Ol;
6744
6673
  const md = class md {
6745
6674
  constructor(e, t, i) {
@@ -6757,7 +6686,7 @@ const md = class md {
6757
6686
  for (; ; ) {
6758
6687
  const [e, t] = this.value.value();
6759
6688
  try {
6760
- yield Promise.race([id(TA, new Error("Idle timeout")), t]);
6689
+ yield Promise.race([id(vA, new Error("Idle timeout")), t]);
6761
6690
  } catch (i) {
6762
6691
  return i;
6763
6692
  }
@@ -6769,7 +6698,7 @@ const md = class md {
6769
6698
  const i = (yield e.subscribe(new Xt().name("stats").groupOrder("ascending").build())).objects(), n = yield i.next();
6770
6699
  if (n.done)
6771
6700
  throw new Error("No stats object received");
6772
- const o = Wd(n.value.payload);
6701
+ const o = jd(n.value.payload);
6773
6702
  if (!o.ip)
6774
6703
  throw new Error("Expected IP in initial stats object");
6775
6704
  return new md(i, o, o.ip);
@@ -6783,7 +6712,7 @@ _a = new WeakMap(), lc = new WeakSet(), Ol = function(e) {
6783
6712
  const c = n.value;
6784
6713
  if (c.objectStatus !== Te.Normal)
6785
6714
  continue;
6786
- const h = Wd(c.payload);
6715
+ const h = jd(c.payload);
6787
6716
  this.value.update(h);
6788
6717
  }
6789
6718
  } catch (n) {
@@ -6800,7 +6729,7 @@ _a = new WeakMap(), lc = new WeakSet(), Ol = function(e) {
6800
6729
  };
6801
6730
  let Uh = md;
6802
6731
  var mc, xn;
6803
- class IA {
6732
+ class SA {
6804
6733
  constructor(e) {
6805
6734
  u(this, mc, pe.get().createContext("UpstreamWatcher"));
6806
6735
  u(this, xn);
@@ -6830,13 +6759,6 @@ class IA {
6830
6759
  }
6831
6760
  }
6832
6761
  mc = new WeakMap(), xn = new WeakMap();
6833
- const CA = R(8);
6834
- function kA(s) {
6835
- if (s < 0 || s > 65535)
6836
- throw new RangeError("burstMs must be between 0 and 65535 inclusive");
6837
- const e = new Uint8Array([s >> 8 & 255, s & 255]);
6838
- return { type: CA, payload: e };
6839
- }
6840
6762
  var Ln, Na, Va;
6841
6763
  class Jc {
6842
6764
  constructor(e, t) {
@@ -6892,7 +6814,7 @@ const Gs = class Gs {
6892
6814
  r(this, "subtitles", new Jc(a(this, pi), "subtitles"));
6893
6815
  r(this, "video", new Jc(a(this, at), "video"));
6894
6816
  r(this, "audio", new Jc(a(this, rt), "audio"));
6895
- l(this, Dn, e), l(this, On, Rh.start(i)), l(this, us, i), l(this, me, new Ie(t)), l(this, Mn, new IA(t)), l(this, Ga, Promise.race([i.idleTimeout(), A(this, Ce, Ml).call(this), a(this, Mn).closed()])), a(this, Dn).closed().then(() => this.close()).catch(O);
6817
+ l(this, Dn, e), l(this, On, Rh.start(i)), l(this, us, i), l(this, me, new Ie(t)), l(this, Mn, new SA(t)), l(this, Ga, Promise.race([i.idleTimeout(), A(this, Ce, Ml).call(this), a(this, Mn).closed()])), a(this, Dn).closed().then(() => this.close()).catch(O);
6896
6818
  }
6897
6819
  closed() {
6898
6820
  return a(this, Ga);
@@ -6901,10 +6823,10 @@ const Gs = class Gs {
6901
6823
  return f(this, null, function* () {
6902
6824
  const i = /* @__PURE__ */ new Map();
6903
6825
  if (t.burstMs !== void 0) {
6904
- const p = kA(t.burstMs);
6826
+ const p = gA(t.burstMs);
6905
6827
  i.set(p.type, p);
6906
6828
  }
6907
- const n = new Ul(e, { namespace: lA("auxiliary") }), [[o, c, h], d] = yield Promise.all([
6829
+ const n = new Ul(e, { namespace: oA("auxiliary") }), [[o, c, h], d] = yield Promise.all([
6908
6830
  Fo.start(e, t).then((p) => Promise.all([
6909
6831
  Promise.resolve(p),
6910
6832
  t.videoTrack ? p.subscribeCmafTrack(t.videoTrack, { params: i }) : void 0,
@@ -7071,7 +6993,7 @@ function Kc(s, e, t) {
7071
6993
  const i = new URL("/voq/subscribe", s);
7072
6994
  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;
7073
6995
  }
7074
- const BA = 1e4;
6996
+ const EA = 1e4;
7075
6997
  var le, Se, Xe, ls, ee, gi, ja, Fn, Wa, _n, ke, Fl, Nn, za, Vn, _l, Nl, Vl, Gl, Dh;
7076
6998
  const fd = class fd {
7077
6999
  constructor(e, t, i, n, o, c, h) {
@@ -7165,12 +7087,12 @@ const fd = class fd {
7165
7087
  }
7166
7088
  const g = (T = n.connectInfo.channels.find((X) => X.channelId === h.channelId)) == null ? void 0 : T.catalog;
7167
7089
  t.debug("Resolved edge url", { edgeUrl: m, edgeWsUrl: p }), Qe(g, "no catalog found");
7168
- const w = (P = c.get(Ci(g.namespace))) == null ? void 0 : P.getVideoTrack(h.video), b = (k = c.get(Ci(g.namespace))) == null ? void 0 : k.getAudioTrack(h.audio), S = yield uA({
7090
+ const w = (P = c.get(Ci(g.namespace))) == null ? void 0 : P.getVideoTrack(h.video), b = (k = c.get(Ci(g.namespace))) == null ? void 0 : k.getAudioTrack(h.audio), S = yield aA({
7169
7091
  url: m,
7170
7092
  wsUrl: p,
7171
7093
  authToken: n.options.get("authenticationToken"),
7172
7094
  preferredTransport: n.options.get("webtransportEnabled") ? "webtransport" : "websocket",
7173
- role: kg.Subscriber,
7095
+ role: Og.Subscriber,
7174
7096
  websocketFallbackTimeoutMs: 2e3
7175
7097
  }), B = yield Promise.race([
7176
7098
  Ph.start(S.subscriber, {
@@ -7180,7 +7102,7 @@ const fd = class fd {
7180
7102
  audioTrack: b == null ? void 0 : b.track,
7181
7103
  burstMs: h.burstMs || 0
7182
7104
  }),
7183
- id(BA, new Error("Timeout waiting for player to start")),
7105
+ id(EA, new Error("Timeout waiting for player to start")),
7184
7106
  Rm(S.closed(), "Session closed before player started")
7185
7107
  ]), U = new eh(B.catalog());
7186
7108
  c.set(Ci(g.namespace), U), e.emit("received signal", {
@@ -7347,7 +7269,7 @@ le = new WeakMap(), Se = new WeakMap(), Xe = new WeakMap(), ls = new WeakMap(),
7347
7269
  codec: P,
7348
7270
  switchInfo: kt,
7349
7271
  // FIXME: We should replace this with something better than hashing the track name
7350
- renditionId: RA(U.track.trackObject.name)
7272
+ renditionId: TA(U.track.trackObject.name)
7351
7273
  });
7352
7274
  }
7353
7275
  } catch (p) {
@@ -7374,7 +7296,7 @@ le = new WeakMap(), Se = new WeakMap(), Xe = new WeakMap(), ls = new WeakMap(),
7374
7296
  });
7375
7297
  };
7376
7298
  let Lh = fd;
7377
- function RA(s) {
7299
+ function TA(s) {
7378
7300
  return s.split("").reduce(
7379
7301
  (t, i) => t = i.charCodeAt(0) + (t << 6) + (t << 16) - t,
7380
7302
  0
@@ -7420,11 +7342,11 @@ Wt = new WeakMap(), ms = new WeakMap(), fc = new WeakSet(), jl = function() {
7420
7342
  const [e, t] = a(this, Wt).value();
7421
7343
  return cm(e);
7422
7344
  };
7423
- const UA = (s, e) => {
7345
+ const IA = (s, e) => {
7424
7346
  const t = new URL("/subscribe", s);
7425
7347
  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();
7426
7348
  };
7427
- class PA extends vi {
7349
+ class CA extends vi {
7428
7350
  constructor(t, i) {
7429
7351
  super();
7430
7352
  r(this, "options");
@@ -7492,13 +7414,13 @@ class PA extends vi {
7492
7414
  this.emit("error", lo(Jn()));
7493
7415
  break;
7494
7416
  case 4002:
7495
- this.emit("error", ef(Jn()));
7417
+ this.emit("error", Km(Jn()));
7496
7418
  break;
7497
7419
  case 4003:
7498
7420
  this.emit("error", Cu("internal", Jn()));
7499
7421
  break;
7500
7422
  case 4010:
7501
- this.emit("error", tf("internal", Jn()));
7423
+ this.emit("error", ef("internal", Jn()));
7502
7424
  break;
7503
7425
  }
7504
7426
  this.emit("close", this);
@@ -7561,7 +7483,7 @@ class PA extends vi {
7561
7483
  return this._connectTime;
7562
7484
  }
7563
7485
  }
7564
- const xA = 65536 * 8, LA = 0.9, DA = (s) => xA * LA * 1e3 / s, dt = class dt {
7486
+ const kA = 65536 * 8, BA = 0.9, RA = (s) => kA * BA * 1e3 / s, dt = class dt {
7565
7487
  constructor(e, t, i, n) {
7566
7488
  r(this, "emitter");
7567
7489
  r(this, "transport");
@@ -7636,7 +7558,7 @@ const xA = 65536 * 8, LA = 0.9, DA = (s) => xA * LA * 1e3 / s, dt = class dt {
7636
7558
  ), n = this.config.options.get("media") === "audio+video";
7637
7559
  let o = 1;
7638
7560
  n && (o = i !== !1 ? 2 : 1);
7639
- const c = UA(this.config.edgeUrl, {
7561
+ const c = IA(this.config.edgeUrl, {
7640
7562
  video: t.video,
7641
7563
  audio: t.audio,
7642
7564
  burstMs: t.burstMs,
@@ -7670,7 +7592,7 @@ const xA = 65536 * 8, LA = 0.9, DA = (s) => xA * LA * 1e3 / s, dt = class dt {
7670
7592
  }
7671
7593
  });
7672
7594
  r(this, "connectWebSocketTransport", () => {
7673
- const e = new PA(
7595
+ const e = new CA(
7674
7596
  {
7675
7597
  reconnectDelay: 1e3,
7676
7598
  onMessage: this.onMessage,
@@ -7731,7 +7653,7 @@ r(dt, "PING_INTERVAL", 5e3), r(dt, "MAX_MISSED_PINGS", 4), r(dt, "TLS_ROUNDTRIPS
7731
7653
  }));
7732
7654
  let Oh = dt;
7733
7655
  var Gn, Ai, jn;
7734
- class OA {
7656
+ class UA {
7735
7657
  constructor(e) {
7736
7658
  u(this, Gn);
7737
7659
  u(this, Ai, []);
@@ -7833,7 +7755,7 @@ const js = class js {
7833
7755
  case 403:
7834
7756
  throw this.emitter.emit("error", kd(e.message)), kd(e.message);
7835
7757
  }
7836
- throw this.emitter.emit("error", nf(e instanceof Error ? e : void 0)), e;
7758
+ throw this.emitter.emit("error", sf(e instanceof Error ? e : void 0)), e;
7837
7759
  }
7838
7760
  }));
7839
7761
  u(this, gc, () => f(this, null, function* () {
@@ -7854,7 +7776,7 @@ const js = class js {
7854
7776
  return a(this, vt).items().length > 0 ? Ht(a(this, vt).items()) : 0;
7855
7777
  }
7856
7778
  get estimatedBandwidth() {
7857
- return this.connectionImpl && "estimatedBandwidth" in this.connectionImpl && this.connectionImpl.estimatedBandwidth ? this.connectionImpl.estimatedBandwidth : DA(this.rtt);
7779
+ return this.connectionImpl && "estimatedBandwidth" in this.connectionImpl && this.connectionImpl.estimatedBandwidth ? this.connectionImpl.estimatedBandwidth : RA(this.rtt);
7858
7780
  }
7859
7781
  /**
7860
7782
  * The timestamp when the first connection was made
@@ -7872,7 +7794,7 @@ const js = class js {
7872
7794
  vt = new WeakMap(), St = new WeakMap(), Wn = new WeakMap(), zt = new WeakMap(), zn = new WeakMap(), Hn = new WeakMap(), Xn = new WeakMap(), pc = new WeakMap(), gc = new WeakMap(), Ac = new WeakSet(), Wl = function() {
7873
7795
  return f(this, null, function* () {
7874
7796
  var t;
7875
- const e = new OA({ edgeUrl: this.config.options.get("edgeUrl") });
7797
+ const e = new UA({ edgeUrl: this.config.options.get("edgeUrl") });
7876
7798
  for (l(this, zt, 0); ; ) {
7877
7799
  qe(this, zt)._++;
7878
7800
  try {
@@ -7930,7 +7852,7 @@ const th = () => ({
7930
7852
  audio: {
7931
7853
  bitRate: yi()
7932
7854
  }
7933
- }), MA = () => ({
7855
+ }), PA = () => ({
7934
7856
  width: window.innerWidth,
7935
7857
  height: window.innerHeight,
7936
7858
  bitRate: yi()
@@ -7988,7 +7910,7 @@ const th = () => ({
7988
7910
  });
7989
7911
  r(this, "evaluateConstraintCap", () => {
7990
7912
  var c, h, d, m, p;
7991
- const e = this.sizeBasedResolutionCapEnabled ? F(v({}, th()), { video: MA() }) : th();
7913
+ const e = this.sizeBasedResolutionCapEnabled ? F(v({}, th()), { video: PA() }) : th();
7992
7914
  if (!this.resizeObserver) {
7993
7915
  const g = this.element.getBoundingClientRect();
7994
7916
  this.elementSize = { width: g.width, height: g.height };
@@ -8026,7 +7948,7 @@ const th = () => ({
8026
7948
  };
8027
7949
  r(Ws, "CHECK_SIZE_INTERVAL", 1e3), r(Ws, "create", (e, t, i, n) => new Ws(e, t, i, n));
8028
7950
  let Fh = Ws;
8029
- const FA = 5, _A = 100, NA = 1e3;
7951
+ const xA = 5, LA = 100, DA = 1e3;
8030
7952
  class ad {
8031
7953
  constructor(e, t, i, n) {
8032
7954
  r(this, "timers", ge.create());
@@ -8036,7 +7958,7 @@ class ad {
8036
7958
  r(this, "playbackSource");
8037
7959
  r(this, "isSuspended", !1);
8038
7960
  r(this, "load", () => {
8039
- this.timers.setInterval(this.emitDecodedFrames, _A), this.timers.setInterval(this.emitDecodeRate, NA), this.emitter.on("init segment", this.onInitSegment), this.emitter.on("coded sample", this.decode);
7961
+ this.timers.setInterval(this.emitDecodedFrames, LA), this.timers.setInterval(this.emitDecodeRate, DA), this.emitter.on("init segment", this.onInitSegment), this.emitter.on("coded sample", this.decode);
8040
7962
  });
8041
7963
  r(this, "unload", () => {
8042
7964
  this.trackContexts.forEach(({ decoderContext: e }) => e.unload()), this.timers.unload(), this.emitter.off("init segment", this.onInitSegment), this.emitter.off("coded sample", this.decode);
@@ -8087,7 +8009,7 @@ class ad {
8087
8009
  return;
8088
8010
  t.sampleDuration = e.duration / e.timescale * 1e3;
8089
8011
  const { decoderContext: i, buffer: n } = t, o = e.timestamp / e.timescale * 1e3, c = e.duration / e.timescale * 1e3, h = n[n.length - 1];
8090
- !h || o - FA > h.end ? n.push({ start: o, end: o + c }) : o + c * 5 < h.end ? t.buffer = [{ start: o, end: o + c }] : h.end = o + c, i.enqueue(e), this.emitDecodedFrames();
8012
+ !h || o - xA > h.end ? n.push({ start: o, end: o + c }) : o + c * 5 < h.end ? t.buffer = [{ start: o, end: o + c }] : h.end = o + c, i.enqueue(e), this.emitDecodedFrames();
8091
8013
  });
8092
8014
  r(this, "emitDecodedFrames", () => {
8093
8015
  let e;
@@ -8095,7 +8017,7 @@ class ad {
8095
8017
  var n, o;
8096
8018
  let i;
8097
8019
  for (; (i = (o = (n = t.decoderContext).error) == null ? void 0 : o.call(n)) !== void 0; )
8098
- this.emitter.emit("error", $m(!1, i));
8020
+ this.emitter.emit("error", qm(!1, i));
8099
8021
  for (; (e = t.decoderContext.take()) !== void 0; ) {
8100
8022
  const { statistics: c } = e;
8101
8023
  c && (t.decodeTime.push(c.decodeTime), t.transportTime.push(
@@ -8136,7 +8058,7 @@ class ad {
8136
8058
  for (const h of i)
8137
8059
  switch (h.type) {
8138
8060
  case "audio": {
8139
- const { OpusDecoderContext: d } = yield import("./zOn8hGms.js");
8061
+ const { OpusDecoderContext: d } = yield import("./DZKKTJrC.js");
8140
8062
  c.set(h.type, {
8141
8063
  buffer: [],
8142
8064
  decoderContext: yield d.create(48e3, 2),
@@ -8147,7 +8069,7 @@ class ad {
8147
8069
  break;
8148
8070
  }
8149
8071
  case "video": {
8150
- const { H264DecoderWorkerContext: d } = yield import("./Bf7FyEIE.js");
8072
+ const { H264DecoderWorkerContext: d } = yield import("./D3kGf05a.js");
8151
8073
  c.set(h.type, {
8152
8074
  buffer: [],
8153
8075
  decoderContext: yield d.create(o),
@@ -8214,12 +8136,12 @@ const wc = class wc {
8214
8136
  };
8215
8137
  r(wc, "create", (e) => new wc(e));
8216
8138
  let _h = wc;
8217
- const VA = (s) => (e, t, i) => e.timestamp <= t || e.timestampAdded <= i - s, Jt = class Jt {
8139
+ const OA = (s) => (e, t, i) => e.timestamp <= t || e.timestampAdded <= i - s, Jt = class Jt {
8218
8140
  constructor(e, t, i) {
8219
8141
  r(this, "logger");
8220
8142
  r(this, "emitter");
8221
8143
  r(this, "waitingEvents", []);
8222
- r(this, "isTriggered", VA(Jt.EVENT_TIMEOUT));
8144
+ r(this, "isTriggered", OA(Jt.EVENT_TIMEOUT));
8223
8145
  r(this, "timeSource");
8224
8146
  r(this, "timers", new ge());
8225
8147
  r(this, "load", () => {
@@ -8301,7 +8223,7 @@ const $e = class $e {
8301
8223
  r(this, "checkTimeout", () => {
8302
8224
  const e = Date.now() - this.lastBytesUpdated;
8303
8225
  if (this.totalBytesReceived() === 0 && e > $e.NO_DATA_ERROR_TIMEOUT) {
8304
- this.emitter.emit("error", sf()), this.emitter.emit("reconnect", "no incoming data"), this.clearTimeoutInterval();
8226
+ this.emitter.emit("error", tf()), this.emitter.emit("reconnect", "no incoming data"), this.clearTimeoutInterval();
8305
8227
  return;
8306
8228
  }
8307
8229
  e > $e.NO_DATA_TIMEOUT && this.totalBytesReceived() > 0 && (this.emitter.emit("no data timeout", this.totalBytesReceived()), this.clearTimeoutInterval());
@@ -8314,11 +8236,11 @@ const $e = class $e {
8314
8236
  };
8315
8237
  r($e, "NO_DATA_ERROR_TIMEOUT", 20 * 1e3), r($e, "NO_DATA_TIMEOUT", 5 * 1e3), r($e, "UPDATE_RECEIVED_BYTES_INTERVAL", 1e3), r($e, "create", (e) => new $e(e));
8316
8238
  let Vh = $e;
8317
- const GA = () => window.AudioContext || window.webkitAudioContext, bc = class bc extends vi {
8239
+ const MA = () => window.AudioContext || window.webkitAudioContext, bc = class bc extends vi {
8318
8240
  constructor() {
8319
8241
  super();
8320
8242
  // TODO: Checkout what happens when limit is reached
8321
- r(this, "context", new (GA())());
8243
+ r(this, "context", new (MA())());
8322
8244
  r(this, "timers", ge.create());
8323
8245
  r(this, "previousCurrentTime", 0);
8324
8246
  r(this, "_isStuck", !1);
@@ -8332,7 +8254,7 @@ const GA = () => window.AudioContext || window.webkitAudioContext, bc = class bc
8332
8254
  r(this, "createSplitter", () => this.context.createChannelSplitter(2));
8333
8255
  r(this, "resume", () => f(this, null, function* () {
8334
8256
  try {
8335
- return yield Promise.race([this.context.resume(), id(1e3, Km())]);
8257
+ return yield Promise.race([this.context.resume(), id(1e3, Jm())]);
8336
8258
  } catch (t) {
8337
8259
  throw this.suspend().catch(O), t;
8338
8260
  }
@@ -8534,64 +8456,8 @@ const yc = class yc extends vi {
8534
8456
  };
8535
8457
  r(yc, "create", (t, i, n) => new yc(t, i, n));
8536
8458
  let _o = yc;
8537
- var wi;
8538
- class zl {
8539
- constructor() {
8540
- u(this, wi, []);
8541
- l(this, wi, []);
8542
- }
8543
- addTextTrack(e, t, i) {
8544
- const n = [], o = {
8545
- kind: e,
8546
- label: t,
8547
- language: i,
8548
- mode: "disabled",
8549
- cues: n,
8550
- addCue: (c) => {
8551
- n.push(c);
8552
- },
8553
- removeCue: (c) => {
8554
- const h = n.findIndex((d) => d === c);
8555
- h !== -1 && n.splice(h, 1);
8556
- }
8557
- };
8558
- return a(this, wi).push(o), o;
8559
- }
8560
- set language(e) {
8561
- a(this, wi).forEach((t) => {
8562
- t.language === e ? t.mode = "showing" : t.mode = "hidden";
8563
- });
8564
- }
8565
- get language() {
8566
- var e;
8567
- return (e = a(this, wi).find((t) => t.mode === "showing")) == null ? void 0 : e.language;
8568
- }
8569
- getActiveCues(e) {
8570
- const t = a(this, wi).find((i) => i.mode === "showing");
8571
- return t ? t.cues.filter(({ startTime: i, endTime: n }) => e >= i && e <= n) : [];
8572
- }
8573
- }
8574
- wi = new WeakMap();
8575
- const ki = (s, e) => {
8576
- let t;
8577
- for (t = e; s > 1; s--) t += e;
8578
- return t;
8579
- };
8580
- class jA {
8581
- constructor() {
8582
- r(this, "audio");
8583
- r(this, "unmute", () => this.audio.play().catch(O));
8584
- const e = document.createElement("div");
8585
- e.innerHTML = "<audio x-webkit-airplay='deny'></audio>";
8586
- const t = e.children.item(0);
8587
- if (t instanceof HTMLAudioElement)
8588
- this.audio = t, this.audio.controls = !1, this.audio.disableRemotePlayback = !0, this.audio.preload = "auto", this.audio.src = "data:audio/mpeg;base64,//uQx" + ki(23, "A") + "WGluZwAAAA8AAAACAAACcQCA" + ki(16, "gICA") + ki(66, "/") + "8AAABhTEFNRTMuMTAwA8MAAAAAAAAAABQgJAUHQQAB9AAAAnGMHkkI" + ki(320, "A") + "//sQxAADgnABGiAAQBCqgCRMAAgEAH" + ki(15, "/") + "7+n/9FTuQsQH//////2NG0jWUGlio5gLQTOtIoeR2WX////X4s9Atb/JRVCbBUpeRUq" + ki(18, "/") + "9RUi0f2jn/+xDECgPCjAEQAABN4AAANIAAAAQVTEFNRTMuMTAw" + ki(97, "V") + "Q==", this.audio.loop = !1, this.audio.load();
8589
- else
8590
- throw new Error("Failed to create audio tag");
8591
- }
8592
- }
8593
- var Ha, Et, fe, fs, Ze, Hl, xs, Xl;
8594
- class WA {
8459
+ var Ha, Et, fe, fs, Ze, zl, xs, Hl;
8460
+ class FA {
8595
8461
  constructor() {
8596
8462
  u(this, Ze);
8597
8463
  u(this, Ha, []);
@@ -8617,7 +8483,7 @@ class WA {
8617
8483
  }
8618
8484
  render(e, t = !1) {
8619
8485
  const i = a(this, Ha).flatMap((h) => h.text.split(`
8620
- `).flatMap((m) => A(this, Ze, Xl).call(this, m, e.width)).map((m) => {
8486
+ `).flatMap((m) => A(this, Ze, Hl).call(this, m, e.width)).map((m) => {
8621
8487
  A(this, Ze, xs).call(this);
8622
8488
  const p = a(this, fe).measureText(m);
8623
8489
  return {
@@ -8630,17 +8496,17 @@ class WA {
8630
8496
  };
8631
8497
  })), n = Math.max(...i.map((h) => h.size.width)), o = i.reduce((h, { size: d }) => h + d.height, 0) + (i.length - 1) * this.config.lineGap;
8632
8498
  let c = 0;
8633
- A(this, Ze, Hl).call(this, n, o), a(this, fe).clearRect(0, 0, a(this, Et).width, a(this, Et).height);
8499
+ A(this, Ze, zl).call(this, n, o), a(this, fe).clearRect(0, 0, a(this, Et).width, a(this, Et).height);
8634
8500
  for (const { size: h, text: d } of i)
8635
8501
  A(this, Ze, xs).call(this), a(this, fe).fillStyle = this.config.backgroundColor, a(this, fe).fillRect(0, c, h.width, h.height), A(this, Ze, xs).call(this), a(this, fe).fillText(d, this.config.textPadding, c + this.config.textPadding), c += h.height + this.config.lineGap;
8636
8502
  t && (a(this, fe).strokeStyle = "red", a(this, fe).strokeRect(0, 0, e.width, a(this, Et).height));
8637
8503
  }
8638
8504
  }
8639
- Ha = new WeakMap(), Et = new WeakMap(), fe = new WeakMap(), fs = new WeakMap(), Ze = new WeakSet(), Hl = function(e, t) {
8505
+ Ha = new WeakMap(), Et = new WeakMap(), fe = new WeakMap(), fs = new WeakMap(), Ze = new WeakSet(), zl = function(e, t) {
8640
8506
  a(this, Et).width = e * a(this, fs), a(this, Et).height = t * a(this, fs), a(this, fe).scale(a(this, fs), a(this, fs)), this.canvas.style.width = `${e}px`, this.canvas.style.height = `${t}px`;
8641
8507
  }, xs = function() {
8642
8508
  a(this, fe).fillStyle = "white", a(this, fe).textAlign = "left", a(this, fe).textBaseline = "top", a(this, fe).font = `${this.config.fontSize} sans-serif`;
8643
- }, Xl = function(e, t) {
8509
+ }, Hl = function(e, t) {
8644
8510
  const i = [], n = e.split(" ");
8645
8511
  let o = "";
8646
8512
  for (; n.length > 0; ) {
@@ -8656,7 +8522,7 @@ Ha = new WeakMap(), Et = new WeakMap(), fe = new WeakMap(), fs = new WeakMap(),
8656
8522
  }
8657
8523
  return i;
8658
8524
  };
8659
- const zA = `
8525
+ const _A = `
8660
8526
  precision mediump float;
8661
8527
  uniform sampler2D texture;
8662
8528
 
@@ -8668,7 +8534,7 @@ void main() {
8668
8534
 
8669
8535
  gl_FragColor = vec4(y, y, y, a);
8670
8536
  }
8671
- `, HA = `
8537
+ `, NA = `
8672
8538
  attribute vec2 position;
8673
8539
  varying vec2 texture_coordinate;
8674
8540
  uniform mat4 model;
@@ -8677,7 +8543,7 @@ void main() {
8677
8543
  texture_coordinate = position;
8678
8544
  gl_Position = model * vec4(position, 0.0, 1.0);
8679
8545
  }
8680
- `, zd = (s, e) => {
8546
+ `, Wd = (s, e) => {
8681
8547
  let t = s.getContext("webgl", e);
8682
8548
  if (t || (t = s.getContext("experimental-webgl", e)), !t)
8683
8549
  throw new x("Failed to create webgl context", {
@@ -8705,7 +8571,7 @@ void main() {
8705
8571
  code: "failed_to_create_texture"
8706
8572
  });
8707
8573
  return s.bindTexture(s.TEXTURE_2D, e), s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, s.NEAREST), s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, s.NEAREST), s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, s.CLAMP_TO_EDGE), s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, s.CLAMP_TO_EDGE), e;
8708
- }, Hd = (s, e) => {
8574
+ }, zd = (s, e) => {
8709
8575
  const t = s.createBuffer();
8710
8576
  if (!t)
8711
8577
  throw new x("Failed to create buffer", {
@@ -8729,8 +8595,8 @@ void main() {
8729
8595
  }
8730
8596
  return i;
8731
8597
  };
8732
- var vc, N, Xa, Qa, Za, bi, Zn, Ql, Zl, Sc;
8733
- class XA {
8598
+ var vc, N, Xa, Qa, Za, wi, Zn, Xl, Ql, Sc;
8599
+ class VA {
8734
8600
  constructor(e) {
8735
8601
  u(this, Zn);
8736
8602
  u(this, vc, 96);
@@ -8738,9 +8604,9 @@ class XA {
8738
8604
  u(this, Xa);
8739
8605
  u(this, Qa);
8740
8606
  u(this, Za);
8741
- u(this, bi);
8742
- r(this, "subtitleRenderer", new WA());
8743
- // prettier-ignore
8607
+ u(this, wi);
8608
+ r(this, "subtitleRenderer", new FA());
8609
+ // biome-ignore format: special formatting
8744
8610
  u(this, Sc, (e, t, i, n) => [
8745
8611
  e,
8746
8612
  0,
@@ -8759,14 +8625,14 @@ class XA {
8759
8625
  0,
8760
8626
  1
8761
8627
  ]);
8762
- l(this, N, e), l(this, Xa, xi(e)), l(this, Qa, Ls(e, e.FRAGMENT_SHADER, zA)), l(this, Za, Ls(e, e.VERTEX_SHADER, HA)), l(this, bi, jh(e, a(this, Za), a(this, Qa))), this.subtitleRenderer.config.fontSize = "64px";
8628
+ l(this, N, e), l(this, Xa, xi(e)), l(this, Qa, Ls(e, e.FRAGMENT_SHADER, _A)), l(this, Za, Ls(e, e.VERTEX_SHADER, NA)), l(this, wi, jh(e, a(this, Za), a(this, Qa))), this.subtitleRenderer.config.fontSize = "64px";
8763
8629
  }
8764
8630
  setActiveCues(e, t) {
8765
8631
  this.subtitleRenderer.setActiveCues(e), this.subtitleRenderer.render(t);
8766
8632
  }
8767
8633
  render(e) {
8768
8634
  const t = this.subtitleRenderer.canvas, i = (e.padding + a(this, vc)) * window.devicePixelRatio;
8769
- t.width !== 0 && (a(this, N).useProgram(a(this, bi)), A(this, Zn, Ql).call(this), A(this, Zn, Zl).call(this, this.subtitleRenderer.canvas.width / e.width, this.subtitleRenderer.canvas.height / e.height, -this.subtitleRenderer.canvas.width / e.width / 2, -(1 - (this.subtitleRenderer.canvas.height + i) / e.height)), a(this, N).uniform1i(a(this, N).getUniformLocation(a(this, bi), "texture"), 4), a(this, N).activeTexture(a(this, N).TEXTURE4), a(this, N).bindTexture(a(this, N).TEXTURE_2D, a(this, Xa)), a(this, N).enable(a(this, N).BLEND), a(this, N).blendFunc(a(this, N).SRC_ALPHA, a(this, N).ONE_MINUS_SRC_ALPHA), a(this, N).texImage2D(
8635
+ t.width !== 0 && (a(this, N).useProgram(a(this, wi)), A(this, Zn, Xl).call(this), A(this, Zn, Ql).call(this, this.subtitleRenderer.canvas.width / e.width, this.subtitleRenderer.canvas.height / e.height, -this.subtitleRenderer.canvas.width / e.width / 2, -(1 - (this.subtitleRenderer.canvas.height + i) / e.height)), a(this, N).uniform1i(a(this, N).getUniformLocation(a(this, wi), "texture"), 4), a(this, N).activeTexture(a(this, N).TEXTURE4), a(this, N).bindTexture(a(this, N).TEXTURE_2D, a(this, Xa)), a(this, N).enable(a(this, N).BLEND), a(this, N).blendFunc(a(this, N).SRC_ALPHA, a(this, N).ONE_MINUS_SRC_ALPHA), a(this, N).texImage2D(
8770
8636
  a(this, N).TEXTURE_2D,
8771
8637
  0,
8772
8638
  a(this, N).RGBA,
@@ -8776,14 +8642,14 @@ class XA {
8776
8642
  ), a(this, N).texParameteri(a(this, N).TEXTURE_2D, a(this, N).TEXTURE_MAG_FILTER, a(this, N).LINEAR), a(this, N).drawArrays(a(this, N).TRIANGLE_STRIP, 0, 4));
8777
8643
  }
8778
8644
  }
8779
- vc = new WeakMap(), N = new WeakMap(), Xa = new WeakMap(), Qa = new WeakMap(), Za = new WeakMap(), bi = new WeakMap(), Zn = new WeakSet(), Ql = function() {
8780
- const e = a(this, N).getAttribLocation(a(this, bi), "position");
8645
+ vc = new WeakMap(), N = new WeakMap(), Xa = new WeakMap(), Qa = new WeakMap(), Za = new WeakMap(), wi = new WeakMap(), Zn = new WeakSet(), Xl = function() {
8646
+ const e = a(this, N).getAttribLocation(a(this, wi), "position");
8781
8647
  a(this, N).enableVertexAttribArray(e), a(this, N).vertexAttribPointer(e, 2, a(this, N).FLOAT, !1, 0, 0);
8782
- }, Zl = function(e, t, i, n) {
8783
- const o = a(this, N).getUniformLocation(a(this, bi), "model");
8648
+ }, Ql = function(e, t, i, n) {
8649
+ const o = a(this, N).getUniformLocation(a(this, wi), "model");
8784
8650
  a(this, N).uniformMatrix4fv(o, !1, a(this, Sc).call(this, e, t, i, n));
8785
8651
  }, Sc = new WeakMap();
8786
- const Xd = `
8652
+ const Hd = `
8787
8653
  precision mediump float;
8788
8654
  uniform sampler2D y_texture;
8789
8655
  uniform sampler2D u_texture;
@@ -8799,7 +8665,7 @@ void main() {
8799
8665
 
8800
8666
  gl_FragColor = vec4(y, u, v, 1) * conversion;
8801
8667
  }
8802
- `, Qd = `
8668
+ `, Xd = `
8803
8669
  attribute vec2 position;
8804
8670
  varying vec2 texture_coordinate;
8805
8671
  uniform mat4 model;
@@ -8808,12 +8674,12 @@ void main() {
8808
8674
  texture_coordinate = position;
8809
8675
  gl_Position = model * vec4(position, 0.0, 1.0);
8810
8676
  }
8811
- `, Zd = {
8677
+ `, Qd = {
8812
8678
  width: 256,
8813
8679
  codedWidth: 256,
8814
8680
  height: 144,
8815
8681
  codedHeight: 144
8816
- }, qd = {
8682
+ }, Zd = {
8817
8683
  preserveDrawingBuffer: !1,
8818
8684
  alpha: !1,
8819
8685
  depth: !1,
@@ -8824,10 +8690,10 @@ void main() {
8824
8690
  constructor() {
8825
8691
  super();
8826
8692
  r(this, "canvas", document.createElement("canvas"));
8827
- r(this, "context", zd(this.canvas, qd));
8828
- r(this, "pixelShader", Ls(this.context, this.context.FRAGMENT_SHADER, Xd));
8829
- r(this, "vertexShader", Ls(this.context, this.context.VERTEX_SHADER, Qd));
8830
- r(this, "buffer", Hd(this.context, kr.SQUARE_VERTICES));
8693
+ r(this, "context", Wd(this.canvas, Zd));
8694
+ r(this, "pixelShader", Ls(this.context, this.context.FRAGMENT_SHADER, Hd));
8695
+ r(this, "vertexShader", Ls(this.context, this.context.VERTEX_SHADER, Xd));
8696
+ r(this, "buffer", zd(this.context, kr.SQUARE_VERTICES));
8831
8697
  r(this, "program", jh(this.context, this.vertexShader, this.pixelShader));
8832
8698
  r(this, "textures", {
8833
8699
  y: xi(this.context),
@@ -8836,21 +8702,21 @@ void main() {
8836
8702
  });
8837
8703
  // Lazy loaded when needed
8838
8704
  r(this, "textRenderer");
8839
- r(this, "size", Zd);
8705
+ r(this, "size", Qd);
8840
8706
  r(this, "onContextLost", (t) => {
8841
8707
  this.textRenderer = void 0;
8842
8708
  const i = new Error(t instanceof WebGLContextEvent ? t.statusMessage : "webgl context lost");
8843
- this.emit("context lost", rf(i)), t.preventDefault();
8709
+ this.emit("context lost", nf(i)), t.preventDefault();
8844
8710
  });
8845
8711
  r(this, "onContextRestored", () => {
8846
- this.emit("context restored"), this.context = zd(this.canvas, qd), this.pixelShader = Ls(this.context, this.context.FRAGMENT_SHADER, Xd), this.vertexShader = Ls(this.context, this.context.VERTEX_SHADER, Qd), this.buffer = Hd(this.context, kr.SQUARE_VERTICES), this.program = jh(this.context, this.vertexShader, this.pixelShader), this.textures = {
8712
+ this.emit("context restored"), this.context = Wd(this.canvas, Zd), this.pixelShader = Ls(this.context, this.context.FRAGMENT_SHADER, Hd), this.vertexShader = Ls(this.context, this.context.VERTEX_SHADER, Xd), this.buffer = zd(this.context, kr.SQUARE_VERTICES), this.program = jh(this.context, this.vertexShader, this.pixelShader), this.textures = {
8847
8713
  y: xi(this.context),
8848
8714
  u: xi(this.context),
8849
8715
  v: xi(this.context)
8850
8716
  }, this.load();
8851
8717
  });
8852
8718
  r(this, "load", () => {
8853
- this.context.useProgram(this.program), this.setupPositionVertexAttributes(), this.setSize(Zd), this.context.uniform1i(this.context.getUniformLocation(this.program, "y_texture"), 0), this.context.uniform1i(this.context.getUniformLocation(this.program, "u_texture"), 1), this.context.uniform1i(this.context.getUniformLocation(this.program, "v_texture"), 2), this.setConversionMatrix(this.rec709());
8719
+ this.context.useProgram(this.program), this.setupPositionVertexAttributes(), this.setSize(Qd), this.context.uniform1i(this.context.getUniformLocation(this.program, "y_texture"), 0), this.context.uniform1i(this.context.getUniformLocation(this.program, "u_texture"), 1), this.context.uniform1i(this.context.getUniformLocation(this.program, "v_texture"), 2), this.setConversionMatrix(this.rec709());
8854
8720
  });
8855
8721
  r(this, "unload", () => {
8856
8722
  var i;
@@ -8896,7 +8762,7 @@ void main() {
8896
8762
  const i = this.context.getUniformLocation(this.program, "conversion");
8897
8763
  this.context.uniformMatrix4fv(i, !1, t);
8898
8764
  });
8899
- // prettier-ignore
8765
+ // biome-ignore format: special formatting
8900
8766
  r(this, "transformMatrix", (t, i) => [
8901
8767
  2 / t,
8902
8768
  0,
@@ -8915,7 +8781,7 @@ void main() {
8915
8781
  0,
8916
8782
  1
8917
8783
  ]);
8918
- // prettier-ignore
8784
+ // biome-ignore format: special formatting
8919
8785
  r(this, "rec709", () => [
8920
8786
  1.16438,
8921
8787
  0,
@@ -8934,7 +8800,7 @@ void main() {
8934
8800
  0,
8935
8801
  1
8936
8802
  ]);
8937
- // prettier-ignore
8803
+ // biome-ignore format: special formatting
8938
8804
  r(this, "rec601", () => [
8939
8805
  1.16438,
8940
8806
  0,
@@ -8956,7 +8822,7 @@ void main() {
8956
8822
  this.canvas.addEventListener("webglcontextlost", this.onContextLost), this.canvas.addEventListener("webglcontextrestored", this.onContextRestored, !1), this.canvas.style.width = "100%", this.canvas.style.position = "relative";
8957
8823
  }
8958
8824
  getTextRenderer() {
8959
- return this.textRenderer || (this.textRenderer = new XA(this.context)), this.textRenderer;
8825
+ return this.textRenderer || (this.textRenderer = new VA(this.context)), this.textRenderer;
8960
8826
  }
8961
8827
  };
8962
8828
  r(kr, "SQUARE_VERTICES", new Float32Array([0, 0, 0, 1, 1, 0, 1, 1]));
@@ -9029,6 +8895,62 @@ const Ec = class Ec {
9029
8895
  };
9030
8896
  r(Ec, "create", (e, t, i, n) => new Ec(e, t, i, n));
9031
8897
  let No = Ec;
8898
+ var bi;
8899
+ class Zl {
8900
+ constructor() {
8901
+ u(this, bi, []);
8902
+ l(this, bi, []);
8903
+ }
8904
+ addTextTrack(e, t, i) {
8905
+ const n = [], o = {
8906
+ kind: e,
8907
+ label: t,
8908
+ language: i,
8909
+ mode: "disabled",
8910
+ cues: n,
8911
+ addCue: (c) => {
8912
+ n.push(c);
8913
+ },
8914
+ removeCue: (c) => {
8915
+ const h = n.findIndex((d) => d === c);
8916
+ h !== -1 && n.splice(h, 1);
8917
+ }
8918
+ };
8919
+ return a(this, bi).push(o), o;
8920
+ }
8921
+ set language(e) {
8922
+ a(this, bi).forEach((t) => {
8923
+ t.language === e ? t.mode = "showing" : t.mode = "hidden";
8924
+ });
8925
+ }
8926
+ get language() {
8927
+ var e;
8928
+ return (e = a(this, bi).find((t) => t.mode === "showing")) == null ? void 0 : e.language;
8929
+ }
8930
+ getActiveCues(e) {
8931
+ const t = a(this, bi).find((i) => i.mode === "showing");
8932
+ return t ? t.cues.filter(({ startTime: i, endTime: n }) => e >= i && e <= n) : [];
8933
+ }
8934
+ }
8935
+ bi = new WeakMap();
8936
+ const ki = (s, e) => {
8937
+ let t;
8938
+ for (t = e; s > 1; s--) t += e;
8939
+ return t;
8940
+ };
8941
+ class GA {
8942
+ constructor() {
8943
+ r(this, "audio");
8944
+ r(this, "unmute", () => this.audio.play().catch(O));
8945
+ const e = document.createElement("div");
8946
+ e.innerHTML = "<audio x-webkit-airplay='deny'></audio>";
8947
+ const t = e.children.item(0);
8948
+ if (t instanceof HTMLAudioElement)
8949
+ this.audio = t, this.audio.controls = !1, this.audio.disableRemotePlayback = !0, this.audio.preload = "auto", this.audio.src = "data:audio/mpeg;base64,//uQx" + ki(23, "A") + "WGluZwAAAA8AAAACAAACcQCA" + ki(16, "gICA") + ki(66, "/") + "8AAABhTEFNRTMuMTAwA8MAAAAAAAAAABQgJAUHQQAB9AAAAnGMHkkI" + ki(320, "A") + "//sQxAADgnABGiAAQBCqgCRMAAgEAH" + ki(15, "/") + "7+n/9FTuQsQH//////2NG0jWUGlio5gLQTOtIoeR2WX////X4s9Atb/JRVCbBUpeRUq" + ki(18, "/") + "9RUi0f2jn/+xDECgPCjAEQAABN4AAANIAAAAQVTEFNRTMuMTAw" + ki(97, "V") + "Q==", this.audio.loop = !1, this.audio.load();
8950
+ else
8951
+ throw new Error("Failed to create audio tag");
8952
+ }
8953
+ }
9032
8954
  const Tc = class Tc {
9033
8955
  constructor(e, t, i, n, o) {
9034
8956
  r(this, "logger");
@@ -9036,11 +8958,11 @@ const Tc = class Tc {
9036
8958
  r(this, "audioPlayer");
9037
8959
  r(this, "videoPlayer");
9038
8960
  r(this, "pool");
9039
- r(this, "unmuter", new jA());
8961
+ r(this, "unmuter", new GA());
9040
8962
  r(this, "_isPaused", !1);
9041
8963
  r(this, "isDisconnected", !1);
9042
8964
  r(this, "timers", new ge());
9043
- r(this, "textTracks", new zl());
8965
+ r(this, "textTracks", new Zl());
9044
8966
  r(this, "playbackRate");
9045
8967
  r(this, "reset", () => {
9046
8968
  });
@@ -9155,7 +9077,7 @@ const Ic = class Ic {
9155
9077
  r(this, "_userProvidedMuted", !1);
9156
9078
  r(this, "timers", new ge());
9157
9079
  r(this, "volumeState");
9158
- r(this, "textTracks", new zl());
9080
+ r(this, "textTracks", new Zl());
9159
9081
  r(this, "reset", () => {
9160
9082
  });
9161
9083
  r(this, "load", () => {
@@ -9289,8 +9211,8 @@ const Ic = class Ic {
9289
9211
  };
9290
9212
  r(Ic, "create", (e, t, i, n, o) => new Ic(e, t, i, n, o));
9291
9213
  let Hh = Ic;
9292
- const QA = () => (s) => ql(s.buffered.start(0), s.buffered.end(s.buffered.length - 1)), ql = (s, e) => (t) => t.remove(Math.max(0, s), Math.min(Number.POSITIVE_INFINITY, e)), $d = (s) => (e) => e.appendBuffer(s), ZA = (s) => (e) => e.changeType(s), qA = (s) => (e) => s(e);
9293
- class $A {
9214
+ const jA = () => (s) => ql(s.buffered.start(0), s.buffered.end(s.buffered.length - 1)), ql = (s, e) => (t) => t.remove(Math.max(0, s), Math.min(Number.POSITIVE_INFINITY, e)), qd = (s) => (e) => e.appendBuffer(s), WA = (s) => (e) => e.changeType(s), zA = (s) => (e) => s(e);
9215
+ class HA {
9294
9216
  constructor(e) {
9295
9217
  r(this, "commandQueue", []);
9296
9218
  r(this, "sourceBuffer");
@@ -9301,14 +9223,14 @@ class $A {
9301
9223
  });
9302
9224
  r(this, "appendBuffer", (e, t) => new Promise((i, n) => {
9303
9225
  if (t && this.currentInit !== t) {
9304
- const c = new Is($d(t), i, n);
9226
+ const c = new Is(qd(t), i, n);
9305
9227
  this.commandQueue.push(c), this.currentInit = t;
9306
9228
  }
9307
- const o = new Is($d(e), i, n);
9229
+ const o = new Is(qd(e), i, n);
9308
9230
  this.commandQueue.push(o), this.handleQueue();
9309
9231
  }));
9310
9232
  r(this, "execute", (e) => new Promise((t, i) => {
9311
- const n = new Is(qA(e), t, i);
9233
+ const n = new Is(zA(e), t, i);
9312
9234
  this.commandQueue.push(n), this.handleQueue();
9313
9235
  }));
9314
9236
  r(this, "buffered", () => this.sourceBuffer.buffered);
@@ -9316,7 +9238,7 @@ class $A {
9316
9238
  e.removeSourceBuffer(this.sourceBuffer);
9317
9239
  });
9318
9240
  r(this, "changeType", (e) => new Promise((t, i) => {
9319
- const n = new Is(ZA(e), t, i);
9241
+ const n = new Is(WA(e), t, i);
9320
9242
  this.commandQueue.push(n), this.handleQueue();
9321
9243
  }));
9322
9244
  r(this, "removeBuffer", (e, t) => new Promise((i, n) => {
@@ -9324,7 +9246,7 @@ class $A {
9324
9246
  this.commandQueue.push(o), this.handleQueue();
9325
9247
  }));
9326
9248
  r(this, "flush", () => new Promise((e, t) => {
9327
- const i = new Is(QA, e, t);
9249
+ const i = new Is(jA, e, t);
9328
9250
  this.commandQueue.push(i), this.handleQueue();
9329
9251
  }));
9330
9252
  this.sourceBuffer = e, this.sourceBuffer.addEventListener("updateend", this.handleQueue);
@@ -9362,7 +9284,7 @@ class $l extends vi {
9362
9284
  });
9363
9285
  r(this, "addSourceBuffer", (t) => {
9364
9286
  const i = this.mediaSource.addSourceBuffer(t);
9365
- return new $A(i);
9287
+ return new HA(i);
9366
9288
  });
9367
9289
  r(this, "removeSourceBuffer", (t) => {
9368
9290
  t.removeFromMediaSource(this.mediaSource);
@@ -9406,7 +9328,7 @@ class Yl {
9406
9328
  });
9407
9329
  }
9408
9330
  }
9409
- function YA(s, { mediaSource: e, mimeType: t, codec: i }) {
9331
+ function XA(s, { mediaSource: e, mimeType: t, codec: i }) {
9410
9332
  return F(v({}, s), {
9411
9333
  state: "initialized",
9412
9334
  mimeType: t,
@@ -9417,7 +9339,7 @@ function YA(s, { mediaSource: e, mimeType: t, codec: i }) {
9417
9339
  lastBufferCleanupTime: Date.now()
9418
9340
  });
9419
9341
  }
9420
- function Yd({
9342
+ function $d({
9421
9343
  initSegments: s,
9422
9344
  pendingSamples: e
9423
9345
  }) {
@@ -9483,7 +9405,7 @@ const Cc = class Cc {
9483
9405
  const n = (h = (c = e.get(i)) == null ? void 0 : c.pendingSamples) != null ? h : [], o = (d = e.get(i)) == null ? void 0 : d.initSegments;
9484
9406
  for (; n.length > 0 && !((m = n[0]) != null && m.isSync); )
9485
9407
  n.shift();
9486
- this.trackContexts.set(i, Yd({ pendingSamples: n, initSegments: o }));
9408
+ this.trackContexts.set(i, $d({ pendingSamples: n, initSegments: o }));
9487
9409
  });
9488
9410
  });
9489
9411
  r(this, "setSourceBuffers", (e) => f(this, null, function* () {
@@ -9505,9 +9427,9 @@ const Cc = class Cc {
9505
9427
  }
9506
9428
  for (const i of e) {
9507
9429
  let n = this.trackContexts.get(i.type);
9508
- n || (n = Yd({ pendingSamples: [], initSegments: new Yl() }), this.trackContexts.set(i.type, n)), n.state === "initialized" ? i.mimeType !== n.mimeType && (yield n.sourceBuffer.changeType(i.mimeType)) : this.trackContexts.set(
9430
+ n || (n = $d({ pendingSamples: [], initSegments: new Yl() }), this.trackContexts.set(i.type, n)), n.state === "initialized" ? i.mimeType !== n.mimeType && (yield n.sourceBuffer.changeType(i.mimeType)) : this.trackContexts.set(
9509
9431
  i.type,
9510
- YA(n, {
9432
+ XA(n, {
9511
9433
  mimeType: i.mimeType,
9512
9434
  mediaSource: this.mediaSource,
9513
9435
  codec: i.codec
@@ -9539,7 +9461,7 @@ const Cc = class Cc {
9539
9461
  if (!i)
9540
9462
  throw Ya(e.type, e.renditionId);
9541
9463
  i.state === "initialized" && (i.mimeType = t);
9542
- const n = zp({
9464
+ const n = jp({
9543
9465
  codec: e.codec,
9544
9466
  timescale: e.timescale,
9545
9467
  initData: e.data
@@ -9555,11 +9477,11 @@ const Cc = class Cc {
9555
9477
  if (this.mediaSource.isClosed())
9556
9478
  return;
9557
9479
  if (!o)
9558
- throw Ym(i.renditionId, i.channelId);
9480
+ throw $m(i.renditionId, i.channelId);
9559
9481
  if (!n)
9560
9482
  throw Ya(i.type, i.renditionId);
9561
9483
  if (n.state === "uninitialized")
9562
- throw Jm(i.type, i.renditionId);
9484
+ throw Ym(i.type, i.renditionId);
9563
9485
  if (t) {
9564
9486
  const d = (i.timestamp + ((h = i.compositionTimeOffset) != null ? h : 0)) / i.timescale;
9565
9487
  yield n.sourceBuffer.removeBuffer(d, Number.POSITIVE_INFINITY);
@@ -9579,7 +9501,7 @@ const Cc = class Cc {
9579
9501
  for (const m of e)
9580
9502
  "initData" in m && (yield n.sourceBuffer.appendBuffer(m.data, m.initData));
9581
9503
  else {
9582
- const m = $p(e, d++);
9504
+ const m = Zp(e, d++);
9583
9505
  yield n.sourceBuffer.appendBuffer(m);
9584
9506
  }
9585
9507
  n.sequenceNumber = d, n.consecutiveQuotaExceededErrorCount = 0, n.successfulAppendCalls++;
@@ -9636,7 +9558,7 @@ const Cc = class Cc {
9636
9558
  const i = v({}, e);
9637
9559
  "fragment" in i ? (i.fragment = i.fragment.clone(), i.fragment.updateBaseMediaDecodeTime(0), i.data = i.fragment.rawBytes()) : i.timestamp = 0, t.pendingSamples.push(i);
9638
9560
  }
9639
- t.hasFirstSync = !0, t.pendingSamples.push(e), t.state !== "uninitialized" && (t.isWorkingOnPendingSamples || JA(t, this.append, this.maxChunkSize).catch((i) => {
9561
+ t.hasFirstSync = !0, t.pendingSamples.push(e), t.state !== "uninitialized" && (t.isWorkingOnPendingSamples || QA(t, this.append, this.maxChunkSize).catch((i) => {
9640
9562
  if (t.isWorkingOnPendingSamples = !1, i instanceof Error) {
9641
9563
  if (this.logger.error("append failed", { message: i.message, name: i.name }), i instanceof DOMException && i.code === DOMException.QUOTA_EXCEEDED_ERR) {
9642
9564
  if (t.consecutiveQuotaExceededErrorCount >= this.minConsecutiveErrorsBeforeEmit) {
@@ -9658,7 +9580,7 @@ const Cc = class Cc {
9658
9580
  r(this, "onSourceEnded", () => {
9659
9581
  const { error: e } = this.mediaElement;
9660
9582
  if (e) {
9661
- const t = /AUDIO_RENDERER/.test(e.message) || !this.autoRecoverFromMediaErrors, i = qm(t, e);
9583
+ const t = /AUDIO_RENDERER/.test(e.message) || !this.autoRecoverFromMediaErrors, i = Zm(t, e);
9662
9584
  if (this.logger.error("MediaElement error", { error: i }), this.emitter.emit("error", i), !i.isFatal()) {
9663
9585
  this.logger.info("Re-opening MediaSource"), this.emitter.emit("recovered from media error", { error: i, count: this.recoveredFromErrorCount }), this.recoveredFromErrorCount++;
9664
9586
  const n = !this.mediaElement.paused, o = [];
@@ -9677,12 +9599,12 @@ r(Cc, "create", (e, t, i) => {
9677
9599
  return n.setTrackContexts(), n.mediaSource.on("source ended", n.onSourceEnded), n.mediaSource.on("source open", n.onSourceOpen), n.mediaSource.attach(i), n;
9678
9600
  });
9679
9601
  let Xh = Cc;
9680
- const Jd = (s, e) => {
9602
+ const Yd = (s, e) => {
9681
9603
  var h;
9682
9604
  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;
9683
9605
  let c = !1;
9684
9606
  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;
9685
- }, JA = (s, e, t) => f(null, null, function* () {
9607
+ }, QA = (s, e, t) => f(null, null, function* () {
9686
9608
  for (s.isWorkingOnPendingSamples = !0; s.pendingSamples.length > 0; ) {
9687
9609
  const i = [];
9688
9610
  let n = 0;
@@ -9690,7 +9612,7 @@ const Jd = (s, e) => {
9690
9612
  n = h;
9691
9613
  const d = s.pendingSamples[h], m = s.pendingSamples[h + 1];
9692
9614
  if (d && (i.push(d), m)) {
9693
- if (Jd(d, m))
9615
+ if (Yd(d, m))
9694
9616
  break;
9695
9617
  const p = (d.timestamp + d.duration) / d.timescale;
9696
9618
  if (m.timestamp / m.timescale - p > 0.1)
@@ -9702,7 +9624,7 @@ const Jd = (s, e) => {
9702
9624
  const o = i[0];
9703
9625
  if (!o)
9704
9626
  break;
9705
- const c = s.previousSample ? Jd(s.previousSample, o) : !0;
9627
+ const c = s.previousSample ? Yd(s.previousSample, o) : !0;
9706
9628
  yield e(i, c), s.pendingSamples = s.pendingSamples.slice(n + 1), s.previousSample = i[i.length - 1];
9707
9629
  }
9708
9630
  s.isWorkingOnPendingSamples = !1;
@@ -9730,7 +9652,6 @@ const Jd = (s, e) => {
9730
9652
  r(this, "getStatistics", () => ({
9731
9653
  isPictureInPictureActive: this.isPictureInPictureActive()
9732
9654
  }));
9733
- /* eslint-disable @typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-explicit-any,@typescript-eslint/no-unsafe-call */
9734
9655
  r(this, "requestStandardPictureInPicture", () => f(this, null, function* () {
9735
9656
  return yield this.element.requestPictureInPicture();
9736
9657
  }));
@@ -9746,7 +9667,6 @@ const Jd = (s, e) => {
9746
9667
  r(this, "isWebkitPresentationModeSupported", () => !!this.element && !!this.element.webkitSetPresentationMode);
9747
9668
  this.emitter = e, this.logger = t, this.emitter.on("add picture in picture listener", this.onEnablePictureInPicture);
9748
9669
  }
9749
- /* eslint-enable @typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-explicit-any,@typescript-eslint/no-unsafe-call */
9750
9670
  };
9751
9671
  r(kc, "create", (e, t) => new kc(e, t));
9752
9672
  let Qh = kc;
@@ -9795,7 +9715,7 @@ const qh = () => ({
9795
9715
  bufferingRanges: [],
9796
9716
  activeRanges: [],
9797
9717
  decodeRate: Number.MAX_SAFE_INTEGER
9798
- }), KA = () => ({
9718
+ }), ZA = () => ({
9799
9719
  levels: {},
9800
9720
  levelDowngrades: [],
9801
9721
  levelUpgrades: [],
@@ -9807,7 +9727,7 @@ const qh = () => ({
9807
9727
  r(this, "logger");
9808
9728
  r(this, "emitter");
9809
9729
  r(this, "timers", ge.create());
9810
- r(this, "metrics", KA());
9730
+ r(this, "metrics", ZA());
9811
9731
  r(this, "bufferFullness", new be(30));
9812
9732
  r(this, "bufferFullnessRegression");
9813
9733
  r(this, "currentLevel");
@@ -10070,7 +9990,7 @@ const Uc = class Uc {
10070
9990
  };
10071
9991
  r(Uc, "create", (e, t) => new Uc(e, t));
10072
9992
  let Yh = Uc;
10073
- const Kn = (s) => JSON.parse(JSON.stringify(s)), ew = 1e4, Pc = class Pc {
9993
+ const Kn = (s) => JSON.parse(JSON.stringify(s)), qA = 1e4, Pc = class Pc {
10074
9994
  constructor(e, t, i) {
10075
9995
  r(this, "logger");
10076
9996
  r(this, "timers", new ge());
@@ -10131,7 +10051,7 @@ const Kn = (s) => JSON.parse(JSON.stringify(s)), ew = 1e4, Pc = class Pc {
10131
10051
  const e = this.currentSubscription.channelId, t = this.targetSubscription.channelId, i = e !== t;
10132
10052
  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(() => {
10133
10053
  this.currentSubscription.channelId === e && this.targetSubscription.channelId === t && (this.logger.warn("Channel switch timeout", t), this.targetSubscription = Kn(this.currentSubscription), this.emitter.emit("channel switch timeout", t));
10134
- }, ew), this.pendingSubscriptionTimeoutId = this.timers.setTimeout(
10054
+ }, qA), this.pendingSubscriptionTimeoutId = this.timers.setTimeout(
10135
10055
  () => this.emitter.emit("send signal", {
10136
10056
  type: "subscribe",
10137
10057
  subscription: this.getTargetSubscription()
@@ -10144,7 +10064,7 @@ const Kn = (s) => JSON.parse(JSON.stringify(s)), ew = 1e4, Pc = class Pc {
10144
10064
  };
10145
10065
  r(Pc, "create", (e, t, i) => new Pc(e, i, t));
10146
10066
  let Jh = Pc;
10147
- const Kd = 5e3, tw = () => vu() || Mc() || Am(), eu = () => tw() ? 100 : 0, tu = (s) => (e) => e > s, xc = class xc {
10067
+ const Jd = 5e3, $A = () => vu() || Mc() || wm(), Kd = () => $A() ? 100 : 0, eu = (s) => (e) => e > s, xc = class xc {
10148
10068
  constructor(e, t, i, n, o) {
10149
10069
  r(this, "emitter");
10150
10070
  r(this, "logger");
@@ -10176,8 +10096,8 @@ const Kd = 5e3, tw = () => vu() || Mc() || Am(), eu = () => tw() ? 100 : 0, tu =
10176
10096
  maxBehind: 50,
10177
10097
  multiplier: 1,
10178
10098
  maxBehindAllowed: 600,
10179
- overshoot: eu(),
10180
- minOvershootAllowed: eu(),
10099
+ overshoot: Kd(),
10100
+ minOvershootAllowed: Kd(),
10181
10101
  maxOvershootAllowed: 500
10182
10102
  });
10183
10103
  /**
@@ -10273,7 +10193,7 @@ const Kd = 5e3, tw = () => vu() || Mc() || Am(), eu = () => tw() ? 100 : 0, tu =
10273
10193
  var n;
10274
10194
  if (!e.channelId)
10275
10195
  throw new Error("Sample must be assigned to a channel");
10276
- this.currentChannelId || (this.currentChannelId = e.channelId), this.timestampOffset || (this.timestampOffset = e.timestamp / e.timescale * 1e3 - Kd);
10196
+ this.currentChannelId || (this.currentChannelId = e.channelId), this.timestampOffset || (this.timestampOffset = e.timestamp / e.timescale * 1e3 - Jd);
10277
10197
  const t = e.type === "video" && e.isSync;
10278
10198
  if (this.currentChannelId !== e.channelId) {
10279
10199
  let o = Number.MAX_SAFE_INTEGER;
@@ -10296,7 +10216,7 @@ const Kd = 5e3, tw = () => vu() || Mc() || Am(), eu = () => tw() ? 100 : 0, tu =
10296
10216
  const i = t.mediaType();
10297
10217
  if (!i)
10298
10218
  throw new Error("Fragment must have a media type");
10299
- this.timestampOffset || (this.timestampOffset = t.baseMediaDecodeTime() / t.timescale() * 1e3 - Kd);
10219
+ this.timestampOffset || (this.timestampOffset = t.baseMediaDecodeTime() / t.timescale() * 1e3 - Jd);
10300
10220
  const n = t.mediaType() === "video" && t.startsWithKeyframe();
10301
10221
  this.currentChannelId !== e ? (console.assert(this.highestSeenTimestamps.size !== 0, "no known timestamps"), this.highestSeenTimestamps.forEach((h) => {
10302
10222
  }), this.currentChannelId = e) : (n || this.timeshiftOnAudio) && this.tryTimeshiftSync();
@@ -10342,7 +10262,7 @@ const Kd = 5e3, tw = () => vu() || Mc() || Am(), eu = () => tw() ? 100 : 0, tu =
10342
10262
  }
10343
10263
  if (!this.timestampOffset)
10344
10264
  return;
10345
- const t = Date.now() - this.seekTimeoutTime * this.timeshiftSync.multiplier, i = this.timeShiftAdjustments.filter(tu(t)).length;
10265
+ const t = Date.now() - this.seekTimeoutTime * this.timeshiftSync.multiplier, i = this.timeShiftAdjustments.filter(eu(t)).length;
10346
10266
  if (i && this.timeshiftSync.multiplier > 2)
10347
10267
  return this.logger.debug("Too many diff timeShifts within sliding window", {
10348
10268
  timeShiftsCooldownMs: t,
@@ -10370,7 +10290,7 @@ const Kd = 5e3, tw = () => vu() || Mc() || Am(), eu = () => tw() ? 100 : 0, tu =
10370
10290
  const e = (h = this.drift) != null ? h : 0;
10371
10291
  if (e < 0 && -e < this.currentSyncMaxAhead() || e > 0 && e < this.currentSyncMaxBehind() || Math.abs(e) < 1 || !this.isSeekCooldownExpired())
10372
10292
  return;
10373
- const t = Date.now() - this.seekTimeoutTime * this.syncMaxBehindMultiplier, i = this.driftAdjustments.filter(tu(t)).length;
10293
+ const t = Date.now() - this.seekTimeoutTime * this.syncMaxBehindMultiplier, i = this.driftAdjustments.filter(eu(t)).length;
10374
10294
  if (i && this.syncMaxBehindMultiplier > 2)
10375
10295
  return this.logger.debug("Too many diff adjustments within sliding window", {
10376
10296
  adjustmentsCooldownMs: t,
@@ -10455,7 +10375,7 @@ const Kd = 5e3, tw = () => vu() || Mc() || Am(), eu = () => tw() ? 100 : 0, tu =
10455
10375
  };
10456
10376
  r(xc, "create", (e, t, i, n, o) => new xc(e, t, i, n, o));
10457
10377
  let Kh = xc;
10458
- const iw = {
10378
+ const YA = {
10459
10379
  enabled: !0,
10460
10380
  interval: 3e4,
10461
10381
  includeErrors: !0,
@@ -10542,7 +10462,7 @@ const iw = {
10542
10462
  );
10543
10463
  }
10544
10464
  });
10545
- this.logger = e, this.emitter = t, this.options = v(v({}, iw), i), this.parentContext = n;
10465
+ this.logger = e, this.emitter = t, this.options = v(v({}, YA), i), this.parentContext = n;
10546
10466
  }
10547
10467
  };
10548
10468
  r(Lc, "create", (e, t, i, n) => new Lc(e, t, i, n));
@@ -10564,7 +10484,74 @@ const Dc = class Dc {
10564
10484
  };
10565
10485
  r(Dc, "create", (e, t, i) => new Dc(e, t, i));
10566
10486
  let Go = Dc;
10567
- const sw = 6, nw = (s) => {
10487
+ const JA = [
10488
+ "minBufferTime",
10489
+ "maxBufferTime",
10490
+ "burstEnabled",
10491
+ "sizeBasedResolutionCapEnabled",
10492
+ "separateVideoSocketEnabled",
10493
+ "videoCodecs"
10494
+ ];
10495
+ function KA(s) {
10496
+ return JA.includes(s);
10497
+ }
10498
+ class ew {
10499
+ constructor(e) {
10500
+ r(this, "options");
10501
+ r(this, "overrides", /* @__PURE__ */ new Map());
10502
+ this.options = e;
10503
+ }
10504
+ /**
10505
+ *
10506
+ * @returns the options excluding any overrides
10507
+ */
10508
+ getOptions() {
10509
+ return this.options;
10510
+ }
10511
+ /**
10512
+ * Add overrides for a specific channel
10513
+ * @param channelId the channel to add overrides to
10514
+ * @param overrides the overrides to insert
10515
+ */
10516
+ addOverrides(e, t) {
10517
+ this.overrides.set(e, t);
10518
+ }
10519
+ /**
10520
+ * Sets an option value
10521
+ * @param key the option key to set
10522
+ * @param value the option value to insert into the key
10523
+ */
10524
+ set(e, t) {
10525
+ this.options[e] = t;
10526
+ }
10527
+ /**
10528
+ * Gets the option value for a specific key. If a channelId is provided, it will also apply any overrides
10529
+ * to the options value.
10530
+ * @param key the key to get from the options
10531
+ * @param channelId the channelId to get channel specific overrides from
10532
+ * @returns the option value, potentially overridden by channel overrides if a channelId is provided
10533
+ */
10534
+ get(e, t) {
10535
+ var i;
10536
+ if (t && KA(e)) {
10537
+ const n = (i = this.overrides.get(t)) == null ? void 0 : i[e];
10538
+ if (typeof n != "undefined")
10539
+ return n;
10540
+ }
10541
+ return this.options[e];
10542
+ }
10543
+ /**
10544
+ *
10545
+ * @param key the key to get from the overrides
10546
+ * @param channelId the channel overrides to get the override from
10547
+ * @returns the override value for that channel
10548
+ */
10549
+ getOverride(e, t) {
10550
+ var i;
10551
+ return (i = this.overrides.get(t)) == null ? void 0 : i[e];
10552
+ }
10553
+ }
10554
+ const tw = 6, iw = (s) => {
10568
10555
  let e = [s], t = 0, i = 0, n = !1;
10569
10556
  const o = (h, d) => {
10570
10557
  var U, D, T;
@@ -10579,7 +10566,7 @@ const sw = 6, nw = (s) => {
10579
10566
  });
10580
10567
  };
10581
10568
  return (h, d = !1) => {
10582
- if (h.flags && or(h.flags) && d && (n = !n), !(d && e.length < sw && n) && e.length > 0) {
10569
+ if (h.flags && or(h.flags) && d && (n = !n), !(d && e.length < tw && n) && e.length > 0) {
10583
10570
  n = !1;
10584
10571
  let p = h;
10585
10572
  for (let w = e.length - 1; w > 0; w--) {
@@ -10595,7 +10582,7 @@ const sw = 6, nw = (s) => {
10595
10582
  }
10596
10583
  return e.push(h), [];
10597
10584
  };
10598
- }, rw = (s, e, t) => {
10585
+ }, sw = (s, e, t) => {
10599
10586
  if (As(e))
10600
10587
  return v(F(v({}, s), {
10601
10588
  type: "video",
@@ -10619,7 +10606,7 @@ const sw = 6, nw = (s) => {
10619
10606
  duration: 0
10620
10607
  });
10621
10608
  };
10622
- class aw {
10609
+ class nw {
10623
10610
  constructor() {
10624
10611
  r(this, "highEntropyValues");
10625
10612
  var e;
@@ -10664,7 +10651,15 @@ class aw {
10664
10651
  }, n);
10665
10652
  }
10666
10653
  }
10667
- const ow = (s) => {
10654
+ const tu = (s, e) => s && typeof s == "object" && e in s, rw = (s) => !(typeof s != "object" || !tu(s, "channelId") || typeof s.channelId != "string" || !tu(s, "url") || typeof s.url != "string" || s.channelId.length === 0 || s.url.length === 0), aw = (s) => {
10655
+ if (!rw(s))
10656
+ throw new x("Invalid options", { isFatal: !0, code: "invalid_options" });
10657
+ const e = v({}, s);
10658
+ return Object.keys(e).forEach((t) => {
10659
+ const i = e;
10660
+ typeof i[t] == "undefined" && delete i[t];
10661
+ }), e;
10662
+ }, ow = (s) => {
10668
10663
  if (typeof s != "object" || s === null)
10669
10664
  throw new Error("not an object");
10670
10665
  if (!("video" in s))
@@ -10701,7 +10696,7 @@ const Ge = class Ge extends vi {
10701
10696
  r(this, "latestEmittedLanguages", []);
10702
10697
  r(this, "wakeLock");
10703
10698
  r(this, "pool", new yd(Ge.MAX_POOL_SIZE));
10704
- r(this, "userAgentInformation", new aw());
10699
+ r(this, "userAgentInformation", new nw());
10705
10700
  r(this, "encryptedMediaExtensions");
10706
10701
  u(this, ps, 0);
10707
10702
  u(this, Oe, []);
@@ -10856,7 +10851,7 @@ const Ge = class Ge extends vi {
10856
10851
  const b = this.options.get("advanced"), S = (p = b.wasmDecodingConstraint.bitRate) != null ? p : Number.MAX_SAFE_INTEGER, B = (g = b.wasmDecodingConstraint.width) != null ? g : Number.MAX_SAFE_INTEGER, U = (w = b.wasmDecodingConstraint.height) != null ? w : Number.MAX_SAFE_INTEGER;
10857
10852
  return h.bitRate <= S && h.width <= B && h.height <= U;
10858
10853
  }
10859
- const d = yield hg(h);
10854
+ const d = yield ng(h);
10860
10855
  if (!d.supported || h.codec == "av1" && !d.smooth && !d.powerEfficient)
10861
10856
  return !1;
10862
10857
  const m = this.options.getOverride("maxVideoBitRate", this.channelId);
@@ -10978,7 +10973,7 @@ const Ge = class Ge extends vi {
10978
10973
  this.options.get("pauseSupportEnabled") && this.playbackState !== "paused" && (this.playbackSource.pause(), this.hasCalledConnect && this.suspend());
10979
10974
  });
10980
10975
  r(this, "registerDebugInstance", () => {
10981
- cg(this);
10976
+ sg(this);
10982
10977
  });
10983
10978
  /**
10984
10979
  *
@@ -11020,7 +11015,7 @@ const Ge = class Ge extends vi {
11020
11015
  const t = this.modules.canvasModule ? this.options.get("iosMediaElementEnabled") : void 0;
11021
11016
  return v({
11022
11017
  uptime: Date.now() - this.createdAt,
11023
- version: "4.1.4-5-ge6e3510c",
11018
+ version: "4.1.4-6-g7bc4e5ae",
11024
11019
  clientId: this.clientId,
11025
11020
  sessionId: this.sessionId,
11026
11021
  channelId: this.channelId,
@@ -11052,7 +11047,7 @@ const Ge = class Ge extends vi {
11052
11047
  if (i && t)
11053
11048
  return t - i;
11054
11049
  });
11055
- this.options = new og(v(v({}, Um), of(t)));
11050
+ this.options = new ew(v(v({}, rf), aw(t)));
11056
11051
  const i = ["localhost", "127.0.0.1"];
11057
11052
  t.telemetryEnabled === void 0 && i.includes(location.hostname) && this.options.set("telemetryEnabled", !1);
11058
11053
  const n = {
@@ -11088,7 +11083,7 @@ const Ge = class Ge extends vi {
11088
11083
  this,
11089
11084
  this.options.get("minBufferTime")
11090
11085
  );
11091
- this.encryptedMediaExtensions = new xd(
11086
+ this.encryptedMediaExtensions = new Pd(
11092
11087
  this.emitter,
11093
11088
  this.logger.createContext("EncryptedMediaExtensions"),
11094
11089
  t.drm
@@ -11110,7 +11105,7 @@ const Ge = class Ge extends vi {
11110
11105
  logger: this.logger.createContext("MediaElement"),
11111
11106
  poster: B
11112
11107
  });
11113
- 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, xd.isSupported() && this.encryptedMediaExtensions.attach(y.element), U = Xh.create(this.logger.createContext("MseModule"), this.emitter, this.element), this.options.get("pauseSupportEnabled") || (D = Go.create(this.logger.createContext("UnpauseModule"), y, b)), this.options.get("pictureInPictureEnabled") && this.emitter.emit("add picture in picture listener", { element: y.element });
11108
+ 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, Pd.isSupported() && this.encryptedMediaExtensions.attach(y.element), U = Xh.create(this.logger.createContext("MseModule"), this.emitter, this.element), this.options.get("pauseSupportEnabled") || (D = Go.create(this.logger.createContext("UnpauseModule"), y, b)), this.options.get("pictureInPictureEnabled") && this.emitter.emit("add picture in picture listener", { element: y.element });
11114
11109
  } else if (this.browser.platform.iosVersion >= 15 && this.options.get("iosMediaElementEnabled")) {
11115
11110
  const y = Hh.create(
11116
11111
  this.emitter,
@@ -11132,7 +11127,7 @@ const Ge = class Ge extends vi {
11132
11127
  this,
11133
11128
  this.options.get("muted") || this.options.get("media") === "video"
11134
11129
  );
11135
- this.element = y.element(), this.playbackSource = y, T = y, this.options.get("iosWakeLockEnabled") && (this.wakeLock = new sg());
11130
+ this.element = y.element(), this.playbackSource = y, T = y, this.options.get("iosWakeLockEnabled") && (this.wakeLock = new tg());
11136
11131
  }
11137
11132
  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) => {
11138
11133
  this.logger.info("new cap set", { cap: y }), this.alignSizeAndBitRate(this.targetSubscription);
@@ -11331,7 +11326,7 @@ const Ge = class Ge extends vi {
11331
11326
  }), this.emitter.on("channel switch timeout", (y) => {
11332
11327
  this.emit("error", Bd(y)), this.emit("channel switch failed", { channelId: this.currentSubscription.channelId });
11333
11328
  }), this.emitter.on("received data", (y) => {
11334
- const E = this.modules.subscription.getCurrentSubscription(), L = tg(y);
11329
+ const E = this.modules.subscription.getCurrentSubscription(), L = Kp(y);
11335
11330
  if (!E) {
11336
11331
  this.logger.warn("Received unwanted message", v({}, L));
11337
11332
  return;
@@ -11351,7 +11346,7 @@ const Ge = class Ge extends vi {
11351
11346
  }), this.modules.incomingData.add(E, y.payload.rawBytes().byteLength), M.fragment().emsgs.forEach((Z) => {
11352
11347
  if (!Z.presentationTime)
11353
11348
  return;
11354
- const he = Bf(Z.data);
11349
+ const he = Cf(Z.data);
11355
11350
  he && this.modules.event.addEvent({
11356
11351
  id: Z.id,
11357
11352
  timestamp: Z.presentationTime / Z.timescale * 1e3 - this.modules.sync.getTimeshiftOffset(),
@@ -11394,8 +11389,8 @@ const Ge = class Ge extends vi {
11394
11389
  const E = y.channelId;
11395
11390
  a(this, gs) && (yield a(this, gs));
11396
11391
  const L = this.modules.renditions.getRendition(y.renditionId, E);
11397
- if (!Jp(y.flags)) {
11398
- if (Kp(y.flags)) {
11392
+ if (!$p(y.flags)) {
11393
+ if (Yp(y.flags)) {
11399
11394
  const M = new TextDecoder().decode(y.payload), _ = this.modules.sync.getTimeshiftOffset();
11400
11395
  if (y.renditionId !== 0) {
11401
11396
  const ie = um(M);
@@ -11421,22 +11416,22 @@ const Ge = class Ge extends vi {
11421
11416
  const j = lm(L.codec);
11422
11417
  if (j === "text")
11423
11418
  throw new Error("Subtitles are not supported");
11424
- if (this.modules.incomingData.add(j, y.payload.byteLength), Yp(y.flags)) {
11419
+ if (this.modules.incomingData.add(j, y.payload.byteLength), qp(y.flags)) {
11425
11420
  const M = F(v({
11426
11421
  type: j,
11427
11422
  data: y.payload,
11428
11423
  codec: L.codec
11429
11424
  }, y), {
11430
11425
  channelId: E
11431
- }), _ = Hp(M.codec, M.payload);
11426
+ }), _ = Wp(M.codec, M.payload);
11432
11427
  _ && this.sizes.set(M.renditionId, _);
11433
11428
  const ie = Di({ codec: L.codec, codecString: L.codecString });
11434
11429
  this.emitter.emit("init segment", { initSegment: M, mimeType: ie }), this.emit("initialized media");
11435
11430
  } else {
11436
- const M = rw(y, L, this.sizes.get(y.renditionId));
11431
+ const M = sw(y, L, this.sizes.get(y.renditionId));
11437
11432
  let _ = this.sampleProcessingSesssions.get(j);
11438
11433
  if (!_)
11439
- _ = nw(
11434
+ _ = iw(
11440
11435
  this.modules.sync.processSample(M)
11441
11436
  ), this.sampleProcessingSesssions.set(j, _);
11442
11437
  else {
@@ -11871,21 +11866,21 @@ const Ge = class Ge extends vi {
11871
11866
  ps = new WeakMap(), Oe = new WeakMap(), gs = new WeakMap(), r(Ge, "MAX_POOL_SIZE", 10), r(Ge, "INITIAL_MAX_BIT_RATE", 2.5 * 1e3 * 1e3), r(Ge, "DISCONNECT_TIMEOUT", 15 * 1e3), r(Ge, "REMOVE_CUE_THRESHOLD", 1e3 * 10);
11872
11867
  let iu = Ge;
11873
11868
  export {
11874
- Xm as A,
11875
- Pm as C,
11876
- Gm as D,
11869
+ Hm as A,
11870
+ Um as C,
11871
+ Vm as D,
11877
11872
  be as F,
11878
- Fm as I,
11873
+ Mm as I,
11879
11874
  pe as L,
11880
- Mm as N,
11875
+ Om as N,
11881
11876
  iu as V,
11882
- xm as a,
11877
+ Pm as a,
11883
11878
  uw as b,
11884
- Dm as c,
11885
- $m as d,
11886
- Lm as e,
11887
- Om as f,
11879
+ Lm as c,
11880
+ qm as d,
11881
+ xm as e,
11882
+ Dm as f,
11888
11883
  x as g,
11889
- ym as i,
11884
+ vm as i,
11890
11885
  O as n
11891
11886
  };