@vindral/web-sdk 4.7.0-1-gb0d0369b → 4.7.0-3-gf2e79bd5

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.
@@ -5823,18 +5823,25 @@ function rp() {
5823
5823
  //#region ../../libs/moq/src/session/Subscription.ts
5824
5824
  var ip, ap, op;
5825
5825
  function sp(e, t) {
5826
- let n = new mf(t), [r, i] = se(100);
5827
- return [new lp(n, r), new hp(e, n, i)];
5826
+ let n = new mf(t), [r, i] = se(100), a = new yp(e, n, i);
5827
+ return [new up(n, r, a), a];
5828
5828
  }
5829
- var cp = /* @__PURE__ */ new WeakMap(), lp = class {
5830
- constructor(t, n) {
5831
- e(this, "state", void 0), i(this, cp, void 0), this.state = t, a(cp, this, n);
5829
+ var cp = /* @__PURE__ */ new WeakMap(), lp = /* @__PURE__ */ new WeakMap(), up = class {
5830
+ constructor(t, n, r) {
5831
+ e(this, "state", void 0), i(this, cp, void 0), i(this, lp, void 0), this.state = t, a(cp, this, n), a(lp, this, r);
5832
5832
  }
5833
5833
  onDone(e) {
5834
5834
  this.state.onDone(e);
5835
5835
  }
5836
5836
  onData(e) {
5837
- return s(cp, this).push(e);
5837
+ var n = this;
5838
+ return t(function* () {
5839
+ if (!s(lp, n).willRead()) {
5840
+ yield e[Symbol.asyncDispose]();
5841
+ return;
5842
+ }
5843
+ yield s(cp, n).push(e), s(lp, n).willRead() || (yield s(lp, n).discardQueued());
5844
+ })();
5838
5845
  }
5839
5846
  onError(e) {
5840
5847
  let t = this.state.onError(e);
@@ -5843,11 +5850,11 @@ var cp = /* @__PURE__ */ new WeakMap(), lp = class {
5843
5850
  close() {
5844
5851
  this.state.close(), s(cp, this).close();
5845
5852
  }
5846
- }, up = /* @__PURE__ */ new WeakMap(), X = /* @__PURE__ */ new WeakMap(), dp = /* @__PURE__ */ new WeakMap(), fp = /* @__PURE__ */ new WeakMap(), pp = /* @__PURE__ */ new WeakMap(), mp = /* @__PURE__ */ new WeakSet();
5853
+ }, dp = /* @__PURE__ */ new WeakMap(), X = /* @__PURE__ */ new WeakMap(), fp = /* @__PURE__ */ new WeakMap(), pp = /* @__PURE__ */ new WeakMap(), mp = /* @__PURE__ */ new WeakMap(), hp = /* @__PURE__ */ new WeakMap(), gp = /* @__PURE__ */ new WeakMap(), _p = /* @__PURE__ */ new WeakSet(), vp = /* @__PURE__ */ new WeakMap();
5847
5854
  ip = Symbol.asyncIterator, ap = wt(), op = Symbol.asyncDispose;
5848
- var hp = class {
5855
+ var yp = class {
5849
5856
  constructor(e, t, n) {
5850
- S(this, mp), i(this, up, void 0), i(this, X, void 0), i(this, dp, void 0), i(this, fp, new C()), i(this, pp, b.get().createContext("SubscriptionConsumer")), a(up, this, e), a(X, this, t), a(dp, this, n);
5857
+ S(this, _p), i(this, dp, void 0), i(this, X, void 0), i(this, fp, void 0), i(this, pp, new C()), i(this, mp, !1), i(this, hp, 0), i(this, gp, /* @__PURE__ */ new Set()), i(this, vp, b.get().createContext("SubscriptionConsumer")), a(dp, this, e), a(X, this, t), a(fp, this, n);
5851
5858
  }
5852
5859
  get id() {
5853
5860
  return s(X, this).subscribe.id;
@@ -5884,7 +5891,7 @@ var hp = class {
5884
5891
  params: /* @__PURE__ */ new Map(),
5885
5892
  subscriberPriority: 0
5886
5893
  };
5887
- s(X, r).onUpdate(t), yield s(up, r).push(t);
5894
+ s(X, r).onUpdate(t), yield s(dp, r).push(t);
5888
5895
  })();
5889
5896
  }
5890
5897
  unsubscribe() {
@@ -5894,15 +5901,15 @@ var hp = class {
5894
5901
  type: J.Unsubscribe,
5895
5902
  id: s(X, e).subscribe.id
5896
5903
  };
5897
- s(X, e).onUnsubscribe(t), yield s(up, e).push(t);
5904
+ s(X, e).onUnsubscribe(t), yield s(dp, e).push(t);
5898
5905
  })();
5899
5906
  }
5900
5907
  close() {
5901
5908
  var e, t;
5902
- return s(fp, this).resolve(), (e = (t = s(dp, this)).return) == null ? void 0 : e.call(t);
5909
+ return s(pp, this).resolve(), (e = (t = s(fp, this)).return) == null ? void 0 : e.call(t);
5903
5910
  }
5904
5911
  closed() {
5905
- return s(fp, this).promise;
5912
+ return s(pp, this).promise;
5906
5913
  }
5907
5914
  done() {
5908
5915
  return s(X, this).done();
@@ -5913,62 +5920,57 @@ var hp = class {
5913
5920
  unsubscribed() {
5914
5921
  return s(X, this).isUnsubscribed();
5915
5922
  }
5923
+ willRead() {
5924
+ return s(mp, this) ? !1 : s(pp, this).pending || s(hp, this) > 0;
5925
+ }
5916
5926
  return() {
5917
5927
  var e = this;
5918
5928
  return t(function* () {
5919
- return s(fp, e).resolve(), yield e.unsubscribe(), {
5929
+ return a(mp, e, !0), s(pp, e).resolve(), yield o(_p, e, Sp).call(e), yield e.discardQueued(), yield e.unsubscribe(), {
5920
5930
  done: !0,
5921
5931
  value: void 0
5922
5932
  };
5923
5933
  })();
5924
5934
  }
5925
- groups() {
5935
+ discardQueued() {
5926
5936
  var e = this;
5927
- return Ft(function* () {
5928
- var t = !1, n = !1, r;
5929
- try {
5930
- for (var i = U(s(dp, e)), a; t = !(a = yield O(i.next())).done; t = !1) try {
5931
- var o = rp();
5932
- let t = o.a(a.value);
5933
- var c = !1, l = !1, u;
5934
- try {
5935
- for (var d = U(t.groups()), f; c = !(f = yield O(d.next())).done; c = !1) {
5936
- let t = f.value;
5937
- {
5938
- var p, m;
5939
- let n = (p = s(X, e).range()) == null ? void 0 : p.startGroup, r = (m = s(X, e).range()) == null ? void 0 : m.endGroup;
5940
- if (n !== void 0 && t.groupId() < n || r !== void 0 && t.groupId() > r) return {
5941
- done: !0,
5942
- value: void 0
5943
- };
5944
- yield t;
5945
- }
5946
- }
5947
- } catch (e) {
5948
- l = !0, u = e;
5949
- } finally {
5950
- try {
5951
- c && d.return != null && (yield O(d.return()));
5952
- } finally {
5953
- if (l) throw u;
5954
- }
5955
- }
5956
- } catch (e) {
5957
- o.e = e;
5958
- } finally {
5959
- yield O(o.d());
5960
- }
5961
- } catch (e) {
5962
- n = !0, r = e;
5963
- } finally {
5964
- try {
5965
- t && i.return != null && (yield O(i.return()));
5966
- } finally {
5967
- if (n) throw r;
5968
- }
5937
+ return t(function* () {
5938
+ var t, n;
5939
+ for (yield (t = (n = s(fp, e)).return) == null ? void 0 : t.call(n);;) {
5940
+ let t = yield s(fp, e).next();
5941
+ if (t.done) return;
5942
+ yield t.value[Symbol.asyncDispose]();
5969
5943
  }
5970
5944
  })();
5971
5945
  }
5946
+ groups() {
5947
+ var e;
5948
+ a(hp, this, (e = s(hp, this), e++, e));
5949
+ let n = o(_p, this, bp).call(this), r = !0, i = () => {
5950
+ if (r) {
5951
+ var e;
5952
+ r = !1, a(hp, this, (e = s(hp, this), e--, e));
5953
+ }
5954
+ }, c = function() {
5955
+ var e = t(function* (e) {
5956
+ try {
5957
+ let t = yield e;
5958
+ return t.done && i(), t;
5959
+ } catch (e) {
5960
+ throw i(), e;
5961
+ }
5962
+ });
5963
+ return function(t) {
5964
+ return e.apply(this, arguments);
5965
+ };
5966
+ }(), l = {
5967
+ next: () => c(n.next()),
5968
+ return: () => c(n.return(void 0)),
5969
+ throw: (e) => c(n.throw(e)),
5970
+ [Symbol.asyncIterator]: () => l
5971
+ };
5972
+ return l;
5973
+ }
5972
5974
  [ip]() {
5973
5975
  return this.groups();
5974
5976
  }
@@ -6004,33 +6006,95 @@ var hp = class {
6004
6006
  })();
6005
6007
  }
6006
6008
  [ap]() {
6007
- return o(mp, this, gp).call(this);
6009
+ return o(_p, this, xp).call(this);
6008
6010
  }
6009
6011
  [op]() {
6010
- return o(mp, this, gp).call(this);
6012
+ return o(_p, this, xp).call(this);
6011
6013
  }
6012
6014
  };
6013
- function gp() {
6015
+ function bp() {
6016
+ var e = this;
6017
+ return Ft(function* () {
6018
+ let t = !1;
6019
+ var n = !1, r = !1, i;
6020
+ try {
6021
+ readers: for (var o = U(s(fp, e)), c; n = !(c = yield O(o.next())).done; n = !1) try {
6022
+ var l = rp();
6023
+ let n = l.a(c.value);
6024
+ if (s(mp, e)) return;
6025
+ s(gp, e).add(n);
6026
+ try {
6027
+ var u = !1, d = !1, f;
6028
+ try {
6029
+ for (var p = U(n.groups()), m; u = !(m = yield O(p.next())).done; u = !1) {
6030
+ let n = m.value;
6031
+ {
6032
+ var h, g;
6033
+ let r = (h = s(X, e).range()) == null ? void 0 : h.startGroup, i = (g = s(X, e).range()) == null ? void 0 : g.endGroup;
6034
+ if (r !== void 0 && n.groupId() < r || i !== void 0 && n.groupId() > i) {
6035
+ t = !0;
6036
+ break readers;
6037
+ }
6038
+ yield n;
6039
+ }
6040
+ }
6041
+ } catch (e) {
6042
+ d = !0, f = e;
6043
+ } finally {
6044
+ try {
6045
+ u && p.return != null && (yield O(p.return()));
6046
+ } finally {
6047
+ if (d) throw f;
6048
+ }
6049
+ }
6050
+ } finally {
6051
+ s(gp, e).delete(n);
6052
+ }
6053
+ } catch (e) {
6054
+ l.e = e;
6055
+ } finally {
6056
+ yield O(l.d());
6057
+ }
6058
+ } catch (e) {
6059
+ r = !0, i = e;
6060
+ } finally {
6061
+ try {
6062
+ n && o.return != null && (yield O(o.return()));
6063
+ } finally {
6064
+ if (r) throw i;
6065
+ }
6066
+ }
6067
+ t && s(hp, e) === 1 && (a(mp, e, !0), s(pp, e).resolve(), yield O(e.discardQueued()));
6068
+ })();
6069
+ }
6070
+ function xp() {
6014
6071
  var e = this;
6015
6072
  return t(function* () {
6016
- return s(pp, e).info("Enter 'dispose'"), yield e.close(), e.unsubscribe();
6073
+ return s(vp, e).info("Enter 'dispose'"), a(mp, e, !0), yield e.close(), yield o(_p, e, Sp).call(e), yield e.discardQueued(), e.unsubscribe();
6074
+ })();
6075
+ }
6076
+ function Sp() {
6077
+ var e = this;
6078
+ return t(function* () {
6079
+ let t = [...s(gp, e)];
6080
+ s(gp, e).clear(), yield Promise.all(t.map((e) => Promise.resolve(e[Symbol.asyncDispose]()).catch(n)));
6017
6081
  })();
6018
6082
  }
6019
6083
  //#endregion
6020
6084
  //#region ../../libs/moq/src/session/Subscriber.ts
6021
- var _p = 2e3, vp = /* @__PURE__ */ new WeakMap(), yp = /* @__PURE__ */ new WeakMap(), bp = /* @__PURE__ */ new WeakMap(), xp = /* @__PURE__ */ new WeakMap(), Sp = /* @__PURE__ */ new WeakSet(), Cp = class {
6085
+ var Cp = 2e3, wp = /* @__PURE__ */ new WeakMap(), Tp = /* @__PURE__ */ new WeakMap(), Ep = /* @__PURE__ */ new WeakMap(), Dp = /* @__PURE__ */ new WeakMap(), Op = /* @__PURE__ */ new WeakSet(), kp = class {
6022
6086
  constructor(t, r) {
6023
- S(this, Sp), i(this, vp, void 0), e(this, "nextSubscribeId", T(0)), i(this, yp, new k(/* @__PURE__ */ new Map())), i(this, bp, void 0), i(this, xp, b.get().createContext("Subscriber")), a(vp, this, t), a(bp, this, r), o(Sp, this, wp).call(this).catch(n);
6087
+ S(this, Op), i(this, wp, void 0), e(this, "nextSubscribeId", T(0)), i(this, Tp, new k(/* @__PURE__ */ new Map())), i(this, Ep, void 0), i(this, Dp, b.get().createContext("Subscriber")), a(wp, this, t), a(Ep, this, r), o(Op, this, Ap).call(this).catch(n);
6024
6088
  }
6025
6089
  subscribe(e, n) {
6026
6090
  var r = this;
6027
6091
  return t(function* (e, t, n = /* @__PURE__ */ new Map()) {
6028
- s(xp, r).info("Enter 'subscribe'", {
6092
+ s(Dp, r).info("Enter 'subscribe'", {
6029
6093
  namespace: e,
6030
6094
  track: t
6031
6095
  });
6032
6096
  try {
6033
- let i = r.nextSubscribeId++, a = s(vp, r).authToken();
6097
+ let i = r.nextSubscribeId++, a = s(wp, r).authToken();
6034
6098
  a && n.set(gu, {
6035
6099
  type: gu,
6036
6100
  payload: new TextEncoder().encode(a)
@@ -6045,52 +6109,52 @@ var _p = 2e3, vp = /* @__PURE__ */ new WeakMap(), yp = /* @__PURE__ */ new WeakM
6045
6109
  subscriberPriority: t.priority,
6046
6110
  filterType: t.filterType,
6047
6111
  params: n
6048
- }, [l, u] = sp(s(bp, r), c);
6049
- if (s(yp, r).update((e) => e.set(i, l)), yield s(bp, r).push(c), !(yield Promise.race([l.state.ok(), s(vp, r).closed().then(() => void 0)]))) throw Error("Session closed");
6050
- return u.closed().then(() => Promise.race([rn(_p), r.closed()])).then(() => o(Sp, r, Tp).call(r, u.id)).catch(() => o(Sp, r, Tp).call(r, u.id)), u;
6112
+ }, [l, u] = sp(s(Ep, r), c);
6113
+ if (s(Tp, r).update((e) => e.set(i, l)), yield s(Ep, r).push(c), !(yield Promise.race([l.state.ok(), s(wp, r).closed().then(() => void 0)]))) throw Error("Session closed");
6114
+ return u.closed().then(() => Promise.race([rn(Cp), r.closed()])).then(() => o(Op, r, jp).call(r, u.id)).catch(() => o(Op, r, jp).call(r, u.id)), u;
6051
6115
  } catch (e) {
6052
- throw s(xp, r).error("Error 'subscribe'", e), e;
6116
+ throw s(Dp, r).error("Error 'subscribe'", e), e;
6053
6117
  }
6054
6118
  }).apply(this, arguments);
6055
6119
  }
6056
6120
  closed() {
6057
- return s(vp, this).closed();
6121
+ return s(wp, this).closed();
6058
6122
  }
6059
6123
  lastReceived() {
6060
- return s(vp, this).lastReceived();
6124
+ return s(wp, this).lastReceived();
6061
6125
  }
6062
6126
  transportType() {
6063
- return s(vp, this).transportType();
6127
+ return s(wp, this).transportType();
6064
6128
  }
6065
6129
  url() {
6066
- return s(vp, this).url();
6130
+ return s(wp, this).url();
6067
6131
  }
6068
6132
  onMessage(e) {
6069
6133
  var n = this;
6070
6134
  return t(function* () {
6071
6135
  switch (e.type) {
6072
6136
  case J.Announce:
6073
- yield s(bp, n).push({
6137
+ yield s(Ep, n).push({
6074
6138
  type: J.AnnounceOk,
6075
6139
  namespace: e.namespace
6076
6140
  });
6077
6141
  break;
6078
6142
  case J.SubscribeOk:
6079
6143
  {
6080
- let t = s(yp, n).current().get(e.id);
6144
+ let t = s(Tp, n).current().get(e.id);
6081
6145
  t && t.state.onOk(e);
6082
6146
  }
6083
6147
  break;
6084
6148
  case J.SubscribeError:
6085
6149
  {
6086
- let t = s(yp, n).current().get(e.id);
6087
- t || s(xp, n).warn("No subscription found", e), t == null || t.onError(e), o(Sp, n, Tp).call(n, e.id);
6150
+ let t = s(Tp, n).current().get(e.id);
6151
+ t || s(Dp, n).warn("No subscription found", e), t == null || t.onError(e), o(Op, n, jp).call(n, e.id);
6088
6152
  }
6089
6153
  break;
6090
6154
  case J.SubscribeDone:
6091
6155
  {
6092
- let t = s(yp, n).current().get(e.id);
6093
- t || s(xp, n).debug("No subscription found", e), t == null || t.onDone(e);
6156
+ let t = s(Tp, n).current().get(e.id);
6157
+ t || s(Dp, n).debug("No subscription found", e), t == null || t.onDone(e);
6094
6158
  }
6095
6159
  break;
6096
6160
  default: break;
@@ -6100,28 +6164,28 @@ var _p = 2e3, vp = /* @__PURE__ */ new WeakMap(), yp = /* @__PURE__ */ new WeakM
6100
6164
  onObjectReader(e) {
6101
6165
  var n = this;
6102
6166
  return t(function* () {
6103
- let t = s(yp, n).current().get(e.subscribeId());
6167
+ let t = s(Tp, n).current().get(e.subscribeId());
6104
6168
  if (!t) {
6105
- s(xp, n).warn("No subscription found", e.subscribeId());
6169
+ s(Dp, n).warn("No subscription found", e.subscribeId()), yield e[Symbol.asyncDispose]();
6106
6170
  return;
6107
6171
  }
6108
6172
  yield t.onData(e);
6109
6173
  })();
6110
6174
  }
6111
6175
  close() {
6112
- s(xp, this).debug("Enter 'close'"), s(yp, this).current().forEach((e) => e.close()), s(yp, this).close();
6176
+ s(Dp, this).debug("Enter 'close'"), s(Tp, this).current().forEach((e) => e.close()), s(Tp, this).close();
6113
6177
  }
6114
6178
  };
6115
- function wp() {
6179
+ function Ap() {
6116
6180
  var e = this;
6117
6181
  return t(function* () {
6118
6182
  var t = !1, n = !1, r;
6119
6183
  try {
6120
- for (var i = U(s(yp, e)), a; t = !(a = yield i.next()).done; t = !1) {
6184
+ for (var i = U(s(Tp, e)), a; t = !(a = yield i.next()).done; t = !1) {
6121
6185
  let t = a.value;
6122
6186
  {
6123
6187
  let n = [...t.values()].map((e) => e.state.subscribe);
6124
- s(xp, e).debug("current subscriptions", n);
6188
+ s(Dp, e).debug("current subscriptions", n);
6125
6189
  }
6126
6190
  }
6127
6191
  } catch (e) {
@@ -6133,95 +6197,95 @@ function wp() {
6133
6197
  if (n) throw r;
6134
6198
  }
6135
6199
  }
6136
- s(xp, e).debug("Return 'observeChanges'");
6200
+ s(Dp, e).debug("Return 'observeChanges'");
6137
6201
  })();
6138
6202
  }
6139
- function Tp(e) {
6140
- s(xp, this).debug("Enter 'deleteSubscription'"), !s(yp, this).isClosed() && s(yp, this).update((t) => (t.delete(e), t));
6203
+ function jp(e) {
6204
+ s(Dp, this).debug("Enter 'deleteSubscription'"), !s(Tp, this).isClosed() && s(Tp, this).update((t) => (t.delete(e), t));
6141
6205
  }
6142
6206
  //#endregion
6143
6207
  //#region ../../libs/moq/src/session/Session.ts
6144
- var Ep, Dp, Op = /* @__PURE__ */ new WeakMap(), kp = /* @__PURE__ */ new WeakMap(), Ap = /* @__PURE__ */ new WeakMap(), jp = /* @__PURE__ */ new WeakMap(), Mp = /* @__PURE__ */ new WeakMap(), Np = /* @__PURE__ */ new WeakMap(), Pp = /* @__PURE__ */ new WeakMap(), Fp = /* @__PURE__ */ new WeakMap(), Ip = /* @__PURE__ */ new WeakSet();
6145
- Ep = Tt(), Dp = Symbol.dispose;
6146
- var Lp = class {
6208
+ var Mp, Np, Pp = /* @__PURE__ */ new WeakMap(), Fp = /* @__PURE__ */ new WeakMap(), Ip = /* @__PURE__ */ new WeakMap(), Lp = /* @__PURE__ */ new WeakMap(), Rp = /* @__PURE__ */ new WeakMap(), zp = /* @__PURE__ */ new WeakMap(), Bp = /* @__PURE__ */ new WeakMap(), Vp = /* @__PURE__ */ new WeakMap(), Hp = /* @__PURE__ */ new WeakSet();
6209
+ Mp = Tt(), Np = Symbol.dispose;
6210
+ var Up = class {
6147
6211
  constructor(t, r) {
6148
- S(this, Ip), i(this, Op, void 0), i(this, kp, void 0), i(this, Ap, new C()), i(this, jp, void 0), i(this, Mp, b.get().createContext("Session")), e(this, "subscriber", void 0), e(this, "publisher", void 0), i(this, Np, void 0), i(this, Pp, !1), i(this, Fp, performance.now());
6212
+ S(this, Hp), i(this, Pp, void 0), i(this, Fp, void 0), i(this, Ip, new C()), i(this, Lp, void 0), i(this, Rp, b.get().createContext("Session")), e(this, "subscriber", void 0), e(this, "publisher", void 0), i(this, zp, void 0), i(this, Bp, !1), i(this, Vp, performance.now());
6149
6213
  let [s, c] = se(100);
6150
- a(Op, this, t), a(jp, this, c), this.subscriber = new Cp(this, s), this.publisher = new tp(this, t, s), a(kp, this, o(Ip, this, zp).call(this)), a(Np, this, new k(r)), this.closed().then(() => this.close()).catch(n);
6214
+ a(Pp, this, t), a(Lp, this, c), this.subscriber = new kp(this, s), this.publisher = new tp(this, t, s), a(Fp, this, o(Hp, this, Gp).call(this)), a(zp, this, new k(r)), this.closed().then(() => this.close()).catch(n);
6151
6215
  }
6152
6216
  updateAuthToken(e) {
6153
- s(Np, this).update(e);
6217
+ s(zp, this).update(e);
6154
6218
  }
6155
6219
  authToken() {
6156
- return s(Np, this).current();
6220
+ return s(zp, this).current();
6157
6221
  }
6158
6222
  transportType() {
6159
- return s(Op, this).transportType();
6223
+ return s(Pp, this).transportType();
6160
6224
  }
6161
6225
  lastReceived() {
6162
- return Math.max(s(Fp, this), s(Op, this).lastReceived());
6226
+ return Math.max(s(Vp, this), s(Pp, this).lastReceived());
6163
6227
  }
6164
6228
  getStats() {
6165
6229
  var e, t, n;
6166
- return (e = (t = (n = s(Op, this)).getStats) == null ? void 0 : t.call(n)) == null ? Promise.resolve(void 0) : e;
6230
+ return (e = (t = (n = s(Pp, this)).getStats) == null ? void 0 : t.call(n)) == null ? Promise.resolve(void 0) : e;
6167
6231
  }
6168
6232
  url() {
6169
- return s(Op, this).url();
6233
+ return s(Pp, this).url();
6170
6234
  }
6171
6235
  closed() {
6172
- return Promise.race([s(kp, this), s(Ap, this).promise]);
6236
+ return Promise.race([s(Fp, this), s(Ip, this).promise]);
6173
6237
  }
6174
6238
  fail(e) {
6175
- s(Ap, this).pending && s(Ap, this).resolve(e);
6239
+ s(Ip, this).pending && s(Ip, this).resolve(e);
6176
6240
  }
6177
6241
  close() {
6178
- a(Pp, this, !0);
6242
+ a(Bp, this, !0);
6179
6243
  try {
6180
- this.subscriber.close(), this.publisher.close(), s(jp, this).cancel("closing"), s(Op, this).close();
6244
+ this.subscriber.close(), this.publisher.close(), s(Lp, this).cancel("closing"), s(Pp, this).close();
6181
6245
  } catch (e) {
6182
- s(Mp, this).warn("Error closing session", e);
6246
+ s(Rp, this).warn("Error closing session", e);
6183
6247
  }
6184
6248
  }
6185
- [Ep]() {
6186
- o(Ip, this, Up).call(this);
6249
+ [Mp]() {
6250
+ o(Hp, this, Yp).call(this);
6187
6251
  }
6188
- [Dp]() {
6189
- o(Ip, this, Up).call(this);
6252
+ [Np]() {
6253
+ o(Hp, this, Yp).call(this);
6190
6254
  }
6191
6255
  };
6192
- function Rp(e) {
6256
+ function Wp(e) {
6193
6257
  var n = this;
6194
6258
  return t(function* () {
6195
6259
  var t, r;
6196
- switch (s(Mp, n).debug("received message", e), yield (t = n.subscriber) == null ? void 0 : t.onMessage(e), yield (r = n.publisher) == null ? void 0 : r.onMessage(e), e.type) {
6260
+ switch (s(Rp, n).debug("received message", e), yield (t = n.subscriber) == null ? void 0 : t.onMessage(e), yield (r = n.publisher) == null ? void 0 : r.onMessage(e), e.type) {
6197
6261
  case J.Goaway:
6198
- s(Mp, n).info("received GoAway", e);
6262
+ s(Rp, n).info("received GoAway", e);
6199
6263
  break;
6200
6264
  default: break;
6201
6265
  }
6202
6266
  })();
6203
6267
  }
6204
- function zp() {
6268
+ function Gp() {
6205
6269
  var e = this;
6206
6270
  return t(function* () {
6207
6271
  var t;
6208
6272
  let n = yield Promise.all([
6209
- o(Ip, e, Vp).call(e),
6210
- o(Ip, e, Hp).call(e),
6211
- o(Ip, e, Bp).call(e)
6273
+ o(Hp, e, qp).call(e),
6274
+ o(Hp, e, Jp).call(e),
6275
+ o(Hp, e, Kp).call(e)
6212
6276
  ]);
6213
- return (t = s(Ap, e).resolved) == null ? n.find((e) => e instanceof Error) : t;
6277
+ return (t = s(Ip, e).resolved) == null ? n.find((e) => e instanceof Error) : t;
6214
6278
  })();
6215
6279
  }
6216
- function Bp() {
6280
+ function Kp() {
6217
6281
  var e = this;
6218
6282
  return t(function* () {
6219
6283
  try {
6220
6284
  var t = !1, n = !1, r;
6221
6285
  try {
6222
- for (var i = U(s(jp, e)), a; t = !(a = yield i.next()).done; t = !1) {
6286
+ for (var i = U(s(Lp, e)), a; t = !(a = yield i.next()).done; t = !1) {
6223
6287
  let t = a.value;
6224
- s(Mp, e).debug("sending message", t), yield s(Op, e).writeMessage(t);
6288
+ s(Rp, e).debug("sending message", t), yield s(Pp, e).writeMessage(t);
6225
6289
  }
6226
6290
  } catch (e) {
6227
6291
  n = !0, r = e;
@@ -6233,169 +6297,176 @@ function Bp() {
6233
6297
  }
6234
6298
  }
6235
6299
  } catch (t) {
6236
- return s(Pp, e) ? s(Mp, e).debug("Closed while sending 'runOutgoingMessages'", t) : s(Mp, e).error("Error 'runOutgoingMessages'", t), t;
6300
+ return s(Bp, e) ? s(Rp, e).debug("Closed while sending 'runOutgoingMessages'", t) : s(Rp, e).error("Error 'runOutgoingMessages'", t), t;
6237
6301
  }
6238
- s(Mp, e).info("Return 'runOutgoingMessages'");
6302
+ s(Rp, e).info("Return 'runOutgoingMessages'");
6239
6303
  })();
6240
6304
  }
6241
- function Vp() {
6305
+ function qp() {
6242
6306
  var e = this;
6243
6307
  return t(function* () {
6244
6308
  try {
6245
- for (yield s(Op, e).afterHandshake();;) {
6246
- let t = yield s(Op, e).readMessage().catch(() => void 0);
6309
+ for (yield s(Pp, e).afterHandshake();;) {
6310
+ let t = yield s(Pp, e).readMessage().catch(() => void 0);
6247
6311
  if (!t) break;
6248
- a(Fp, e, performance.now()), yield o(Ip, e, Rp).call(e, t);
6312
+ a(Vp, e, performance.now()), yield o(Hp, e, Wp).call(e, t);
6249
6313
  }
6250
6314
  } catch (t) {
6251
- return s(Mp, e).error("Error 'runControl'", t), t;
6315
+ return s(Rp, e).error("Error 'runControl'", t), t;
6252
6316
  } finally {
6253
- s(jp, e).cancel("closing");
6317
+ s(Lp, e).cancel("closing");
6254
6318
  }
6255
- s(Mp, e).info("Return 'runControl'");
6319
+ s(Rp, e).info("Return 'runControl'");
6256
6320
  })();
6257
6321
  }
6258
- function Hp() {
6322
+ function Jp() {
6259
6323
  var e = this;
6260
6324
  return t(function* () {
6261
6325
  try {
6262
6326
  for (;;) {
6263
6327
  var t;
6264
- let n = yield s(Op, e).objectStream();
6328
+ let n = yield s(Pp, e).objectStream();
6265
6329
  if (!n) break;
6266
6330
  yield (t = e.subscriber) == null ? void 0 : t.onObjectReader(n);
6267
6331
  }
6268
6332
  } catch (t) {
6269
- return s(Mp, e).error("Error 'runObjects'", t), t;
6333
+ return s(Rp, e).error("Error 'runObjects'", t), t;
6270
6334
  }
6271
- s(Mp, e).info("Return 'runObjects'");
6335
+ s(Rp, e).info("Return 'runObjects'");
6272
6336
  })();
6273
6337
  }
6274
- function Up() {
6275
- s(Mp, this).debug("Enter 'dispose'"), this.close();
6338
+ function Yp() {
6339
+ s(Rp, this).debug("Enter 'dispose'"), this.close();
6276
6340
  }
6277
6341
  //#endregion
6278
6342
  //#region ../../libs/moq/src/protocol/StreamIdBufferWriter.ts
6279
- var Wp = 128;
6280
- Wp - 1;
6281
- var Gp = /* @__PURE__ */ new WeakMap(), Kp = /* @__PURE__ */ new WeakMap(), qp = /* @__PURE__ */ new WeakMap(), Jp = /* @__PURE__ */ new WeakMap(), Yp = /* @__PURE__ */ new WeakMap(), Xp = /* @__PURE__ */ new WeakSet(), Zp = class {
6343
+ var Xp = 128;
6344
+ Xp - 1;
6345
+ var Zp = /* @__PURE__ */ new WeakMap(), Qp = /* @__PURE__ */ new WeakMap(), $p = /* @__PURE__ */ new WeakMap(), em = /* @__PURE__ */ new WeakMap(), tm = /* @__PURE__ */ new WeakMap(), nm = /* @__PURE__ */ new WeakSet(), rm = class {
6282
6346
  constructor(e, t, n) {
6283
- if (S(this, Xp), i(this, Gp, void 0), i(this, Kp, void 0), i(this, qp, !0), i(this, Jp, !1), i(this, Yp, void 0), !Number.isInteger(t) || t < 1 || t > 127) throw Error(`Invalid stream ID ${t}: must be an integer in 1..127`);
6284
- a(Gp, this, e), a(Kp, this, t), a(Yp, this, n);
6347
+ if (S(this, nm), i(this, Zp, void 0), i(this, Qp, void 0), i(this, $p, !0), i(this, em, !1), i(this, tm, void 0), !Number.isInteger(t) || t < 1 || t > 127) throw Error(`Invalid stream ID ${t}: must be an integer in 1..127`);
6348
+ a(Zp, this, e), a(Qp, this, t), a(tm, this, n);
6285
6349
  }
6286
6350
  writeUnsigned8(e) {
6287
6351
  var n = this;
6288
6352
  return t(function* () {
6289
- return o(Xp, n, Qp).call(n), yield o(Xp, n, $p).call(n), s(Gp, n).writeUnsigned8(e);
6353
+ return o(nm, n, im).call(n), yield o(nm, n, am).call(n), s(Zp, n).writeUnsigned8(e);
6290
6354
  })();
6291
6355
  }
6292
6356
  writeVarInt(e) {
6293
6357
  var n = this;
6294
6358
  return t(function* () {
6295
- return o(Xp, n, Qp).call(n), yield o(Xp, n, $p).call(n), s(Gp, n).writeVarInt(e);
6359
+ return o(nm, n, im).call(n), yield o(nm, n, am).call(n), s(Zp, n).writeVarInt(e);
6296
6360
  })();
6297
6361
  }
6298
6362
  writeBigVarInt(e) {
6299
6363
  var n = this;
6300
6364
  return t(function* () {
6301
- return o(Xp, n, Qp).call(n), yield o(Xp, n, $p).call(n), s(Gp, n).writeBigVarInt(e);
6365
+ return o(nm, n, im).call(n), yield o(nm, n, am).call(n), s(Zp, n).writeBigVarInt(e);
6302
6366
  })();
6303
6367
  }
6304
6368
  write(e) {
6305
6369
  var n = this;
6306
6370
  return t(function* () {
6307
- return o(Xp, n, Qp).call(n), yield o(Xp, n, $p).call(n), s(Gp, n).write(e);
6371
+ return o(nm, n, im).call(n), yield o(nm, n, am).call(n), s(Zp, n).write(e);
6308
6372
  })();
6309
6373
  }
6310
6374
  writeString(e) {
6311
6375
  var n = this;
6312
6376
  return t(function* () {
6313
- return o(Xp, n, Qp).call(n), yield o(Xp, n, $p).call(n), s(Gp, n).writeString(e);
6377
+ return o(nm, n, im).call(n), yield o(nm, n, am).call(n), s(Zp, n).writeString(e);
6314
6378
  })();
6315
6379
  }
6316
6380
  flush() {
6317
6381
  var e = this;
6318
6382
  return t(function* () {
6319
- o(Xp, e, Qp).call(e), a(qp, e, !0), yield s(Gp, e).flush();
6383
+ o(nm, e, im).call(e), a($p, e, !0), yield s(Zp, e).flush();
6320
6384
  })();
6321
6385
  }
6322
6386
  close() {
6323
6387
  var e = this;
6324
6388
  return t(function* () {
6325
- s(Jp, e) || (a(qp, e, !0), yield o(Xp, e, $p).call(e, !1), yield s(Gp, e).flush(), a(Jp, e, !0), s(Yp, e).call(e));
6389
+ s(em, e) || (a($p, e, !0), yield o(nm, e, am).call(e, !1), yield s(Zp, e).flush(), a(em, e, !0), s(tm, e).call(e));
6326
6390
  })();
6327
6391
  }
6328
6392
  };
6329
- function Qp() {
6330
- if (s(Jp, this)) throw Error("Stream is closed");
6393
+ function im() {
6394
+ if (s(em, this)) throw Error("Stream is closed");
6331
6395
  }
6332
- function $p(e = !0) {
6333
- if (s(qp, this)) return a(qp, this, !1), s(Gp, this).writeUnsigned8(s(Kp, this) | (e ? Wp : 0));
6396
+ function am(e = !0) {
6397
+ if (s($p, this)) return a($p, this, !1), s(Zp, this).writeUnsigned8(s(Qp, this) | (e ? Xp : 0));
6334
6398
  }
6335
6399
  //#endregion
6336
6400
  //#region ../../libs/moq/src/transport/WebSocketConnection.ts
6337
- var em = /* @__PURE__ */ new WeakMap(), tm = /* @__PURE__ */ new WeakMap(), nm = /* @__PURE__ */ new WeakMap(), rm = /* @__PURE__ */ new WeakMap(), im = /* @__PURE__ */ new WeakMap(), am = /* @__PURE__ */ new WeakMap(), om = /* @__PURE__ */ new WeakMap(), sm = /* @__PURE__ */ new WeakMap(), cm = /* @__PURE__ */ new WeakSet(), lm = class {
6401
+ var om = /* @__PURE__ */ new WeakMap(), sm = /* @__PURE__ */ new WeakMap(), cm = /* @__PURE__ */ new WeakMap(), lm = /* @__PURE__ */ new WeakMap(), um = /* @__PURE__ */ new WeakMap(), dm = /* @__PURE__ */ new WeakMap(), fm = /* @__PURE__ */ new WeakMap(), pm = /* @__PURE__ */ new WeakMap(), mm = /* @__PURE__ */ new WeakMap(), hm = /* @__PURE__ */ new WeakSet(), gm = class {
6338
6402
  constructor(e, t) {
6339
- S(this, cm), i(this, em, void 0), i(this, tm, void 0), i(this, nm, void 0), i(this, rm, void 0), i(this, im, /* @__PURE__ */ new Map()), i(this, am, b.get().createContext("WebSocketConnection")), i(this, om, performance.now()), i(this, sm, new Set(Array(127).fill(0).map((e, t) => t + 1))), a(em, this, e), a(tm, this, t), a(nm, this, new ReadableStream(new Ol(e))), s(em, this).addEventListener("message", () => {
6340
- a(om, this, performance.now());
6341
- }), s(em, this).addEventListener("close", (e) => {
6342
- s(am, this).info("WebSocket closed", {
6403
+ S(this, hm), i(this, om, void 0), i(this, sm, void 0), i(this, cm, void 0), i(this, lm, void 0), i(this, um, /* @__PURE__ */ new Map()), i(this, dm, /* @__PURE__ */ new Set()), i(this, fm, b.get().createContext("WebSocketConnection")), i(this, pm, performance.now()), i(this, mm, new Set(Array(127).fill(0).map((e, t) => t + 1))), a(om, this, e), a(sm, this, t), a(cm, this, new ReadableStream(new Ol(e))), s(om, this).addEventListener("message", () => {
6404
+ a(pm, this, performance.now());
6405
+ }), s(om, this).addEventListener("close", (e) => {
6406
+ s(fm, this).info("WebSocket closed", {
6343
6407
  code: e.code,
6344
6408
  reason: e.reason,
6345
6409
  wasClean: e.wasClean
6346
- }), s(tm, this).markPostHandshake(), s(im, this).forEach((e) => e.close());
6410
+ }), s(sm, this).markPostHandshake(), s(um, this).forEach((e) => e.close());
6347
6411
  });
6348
6412
  }
6349
6413
  openSendStream() {
6350
- let e = s(sm, this).values().next().value;
6414
+ let e = s(mm, this).values().next().value;
6351
6415
  if (!e) throw Error("No stream IDs available");
6352
- return s(sm, this).delete(e), Promise.resolve(new Zp(new nu(s(em, this)), e, () => o(cm, this, um).call(this, e)));
6416
+ return s(mm, this).delete(e), Promise.resolve(new rm(new nu(s(om, this)), e, () => o(hm, this, _m).call(this, e)));
6353
6417
  }
6354
6418
  transportType() {
6355
6419
  return "websocket";
6356
6420
  }
6357
6421
  url() {
6358
- return s(em, this).url;
6422
+ return s(om, this).url;
6359
6423
  }
6360
6424
  lastReceived() {
6361
- return s(om, this);
6425
+ return s(pm, this);
6362
6426
  }
6363
6427
  afterHandshake() {
6364
- return s(tm, this).postHandshake();
6428
+ return s(sm, this).postHandshake();
6365
6429
  }
6366
6430
  objectStream() {
6367
6431
  var e = this;
6368
6432
  return t(function* () {
6369
6433
  for (;;) {
6370
- a(rm, e, s(nm, e).getReader());
6434
+ a(lm, e, s(cm, e).getReader());
6371
6435
  try {
6372
- let { value: n, done: r } = yield s(rm, e).read();
6436
+ let { value: n, done: r } = yield s(lm, e).read();
6373
6437
  if (r) return;
6374
- let [i, a, o] = n;
6375
- if (s(im, e).has(T(a))) {
6376
- let t = s(im, e).get(T(a));
6438
+ let [i, a, c] = n, l = T(a);
6439
+ if (s(dm, e).has(l)) {
6440
+ i || s(dm, e).delete(l);
6441
+ continue;
6442
+ }
6443
+ if (s(um, e).has(l)) {
6444
+ let t = s(um, e).get(l);
6377
6445
  if (!t) throw Error("Stream not found");
6378
- o.length > 0 && (yield t.push(o)), i || (s(am, e).debug("Closing stream", { streamId: a }), t.close(), s(im, e).delete(T(a)));
6446
+ c.length > 0 && (yield t.push(c)), i || (s(fm, e).debug("Closing stream", { streamId: a }), t.close(), s(um, e).delete(l), s(dm, e).delete(l));
6379
6447
  } else {
6380
- s(am, e).debug("Creating new stream", { streamId: a });
6381
- let [n, r] = se(1e3), c = new ReadableStream({ pull(e) {
6382
- return t(function* () {
6383
- let t = yield r.pop();
6384
- t ? e.enqueue(t) : e.close();
6385
- })();
6386
- } });
6387
- if (s(im, e).set(T(a), n), i || (s(am, e).debug("Closing new stream", { streamId: a }), yield c.cancel(), s(im, e).delete(T(a))), o.length > 0) return yield vl(new Fl(o, c), a);
6448
+ s(fm, e).debug("Creating new stream", { streamId: a });
6449
+ let [n, r] = se(1e3), u = new ReadableStream({
6450
+ pull(e) {
6451
+ return t(function* () {
6452
+ let t = yield r.pop();
6453
+ t ? e.enqueue(t) : e.close();
6454
+ })();
6455
+ },
6456
+ cancel: () => o(hm, e, vm).call(e, l, n, r)
6457
+ });
6458
+ if (s(um, e).set(l, n), i || (s(fm, e).debug("Closing new stream", { streamId: a }), s(um, e).delete(l), yield u.cancel()), c.length > 0) return yield vl(new Fl(c, u), a);
6388
6459
  }
6389
6460
  } finally {
6390
6461
  var n;
6391
- (n = s(rm, e)) == null || n.releaseLock();
6462
+ (n = s(lm, e)) == null || n.releaseLock();
6392
6463
  }
6393
6464
  }
6394
6465
  })();
6395
6466
  }
6396
6467
  close() {
6397
6468
  var e;
6398
- return s(tm, this).cancel().catch(n), s(nm, this).cancel("closing").catch(n), (e = s(rm, this)) == null || e.cancel("closing").catch(n), s(em, this).close();
6469
+ return s(sm, this).cancel().catch(n), s(cm, this).cancel("closing").catch(n), (e = s(lm, this)) == null || e.cancel("closing").catch(n), s(om, this).close();
6399
6470
  }
6400
6471
  closed() {
6401
6472
  return Promise.resolve();
@@ -6403,78 +6474,83 @@ var em = /* @__PURE__ */ new WeakMap(), tm = /* @__PURE__ */ new WeakMap(), nm =
6403
6474
  writeMessage(e) {
6404
6475
  var n = this;
6405
6476
  return t(function* () {
6406
- yield s(tm, n).write(e);
6477
+ yield s(sm, n).write(e);
6407
6478
  })();
6408
6479
  }
6409
6480
  readMessage() {
6410
6481
  var e = this;
6411
6482
  return t(function* () {
6412
- return s(tm, e).read();
6483
+ return s(sm, e).read();
6413
6484
  })();
6414
6485
  }
6415
6486
  };
6416
- function um(e) {
6417
- s(sm, this).add(e);
6487
+ function _m(e) {
6488
+ s(mm, this).add(e);
6489
+ }
6490
+ function vm(e, r, i) {
6491
+ s(um, this).get(e) === r && (s(fm, this).debug("Discarding cancelled stream", { streamId: e }), s(um, this).delete(e), s(dm, this).add(e), r.close(), t(function* () {
6492
+ for (; yield i.pop(););
6493
+ })().catch(n));
6418
6494
  }
6419
6495
  //#endregion
6420
6496
  //#region ../../libs/moq/src/transport/WebTransportConnection.ts
6421
- var dm = 3, fm = /* @__PURE__ */ new WeakMap(), pm = /* @__PURE__ */ new WeakMap(), mm = /* @__PURE__ */ new WeakMap(), hm = /* @__PURE__ */ new WeakMap(), gm = /* @__PURE__ */ new WeakMap(), _m = /* @__PURE__ */ new WeakMap(), vm = /* @__PURE__ */ new WeakMap(), ym = /* @__PURE__ */ new WeakMap(), bm = /* @__PURE__ */ new WeakMap(), xm = /* @__PURE__ */ new WeakSet(), Sm = class {
6497
+ var ym = 3, bm = /* @__PURE__ */ new WeakMap(), xm = /* @__PURE__ */ new WeakMap(), Sm = /* @__PURE__ */ new WeakMap(), Cm = /* @__PURE__ */ new WeakMap(), wm = /* @__PURE__ */ new WeakMap(), Tm = /* @__PURE__ */ new WeakMap(), Em = /* @__PURE__ */ new WeakMap(), Dm = /* @__PURE__ */ new WeakMap(), Om = /* @__PURE__ */ new WeakMap(), km = /* @__PURE__ */ new WeakSet(), Am = class {
6422
6498
  constructor(e, t, r) {
6423
- S(this, xm), i(this, fm, void 0), i(this, pm, void 0), i(this, mm, new de(100)), i(this, hm, void 0), i(this, gm, 0), i(this, _m, !1), i(this, vm, performance.now()), i(this, ym, b.get().createContext("WebTransportConnection")), i(this, bm, () => {
6424
- a(vm, this, performance.now());
6425
- }), a(hm, this, r), a(fm, this, e), a(pm, this, t), o(xm, this, Cm).call(this).catch((e) => {
6426
- s(ym, this).warn("Incoming streams handling ended with error", e), s(pm, this).markPostHandshake(), s(mm, this).close();
6427
- }), s(fm, this).closed.finally(() => {
6428
- a(_m, this, !0), s(pm, this).markPostHandshake(), s(mm, this).close();
6499
+ S(this, km), i(this, bm, void 0), i(this, xm, void 0), i(this, Sm, new de(100)), i(this, Cm, void 0), i(this, wm, 0), i(this, Tm, !1), i(this, Em, performance.now()), i(this, Dm, b.get().createContext("WebTransportConnection")), i(this, Om, () => {
6500
+ a(Em, this, performance.now());
6501
+ }), a(Cm, this, r), a(bm, this, e), a(xm, this, t), o(km, this, jm).call(this).catch((e) => {
6502
+ s(Dm, this).warn("Incoming streams handling ended with error", e), s(xm, this).markPostHandshake(), s(Sm, this).close();
6503
+ }), s(bm, this).closed.finally(() => {
6504
+ a(Tm, this, !0), s(xm, this).markPostHandshake(), s(Sm, this).close();
6429
6505
  }).catch(n);
6430
6506
  }
6431
6507
  openSendStream() {
6432
6508
  var e = this;
6433
6509
  return t(function* () {
6434
- return new Xl(yield s(fm, e).createUnidirectionalStream());
6510
+ return new Xl(yield s(bm, e).createUnidirectionalStream());
6435
6511
  })();
6436
6512
  }
6437
6513
  transportType() {
6438
6514
  return "webtransport";
6439
6515
  }
6440
6516
  url() {
6441
- return s(hm, this);
6517
+ return s(Cm, this);
6442
6518
  }
6443
6519
  lastReceived() {
6444
- return s(vm, this);
6520
+ return s(Em, this);
6445
6521
  }
6446
6522
  afterHandshake() {
6447
- return s(pm, this).postHandshake();
6523
+ return s(xm, this).postHandshake();
6448
6524
  }
6449
6525
  closed() {
6450
6526
  var e = this;
6451
6527
  return t(function* () {
6452
- yield s(fm, e).closed.catch(n);
6528
+ yield s(bm, e).closed.catch(n);
6453
6529
  })();
6454
6530
  }
6455
6531
  close(e) {
6456
- s(_m, this) || (a(_m, this, !0), s(mm, this).close(), s(fm, this).close(e));
6532
+ s(Tm, this) || (a(Tm, this, !0), s(Sm, this).close(), s(bm, this).close(e));
6457
6533
  }
6458
6534
  writeMessage(e) {
6459
6535
  var n = this;
6460
6536
  return t(function* () {
6461
- yield s(pm, n).write(e);
6537
+ yield s(xm, n).write(e);
6462
6538
  })();
6463
6539
  }
6464
6540
  readMessage() {
6465
6541
  var e = this;
6466
6542
  return t(function* () {
6467
- return s(pm, e).read();
6543
+ return s(xm, e).read();
6468
6544
  })();
6469
6545
  }
6470
6546
  objectStream() {
6471
6547
  var e = this;
6472
6548
  return t(function* () {
6473
6549
  for (;;) {
6474
- let t = yield s(mm, e).pop();
6475
- if (!t || s(_m, e)) return;
6550
+ let t = yield s(Sm, e).pop();
6551
+ if (!t || s(Tm, e)) return;
6476
6552
  let n = yield t.groups;
6477
- if (s(_m, e)) return;
6553
+ if (s(Tm, e)) return;
6478
6554
  if (n) return n;
6479
6555
  }
6480
6556
  })();
@@ -6482,7 +6558,7 @@ var dm = 3, fm = /* @__PURE__ */ new WeakMap(), pm = /* @__PURE__ */ new WeakMap
6482
6558
  getStats() {
6483
6559
  var e = this;
6484
6560
  return t(function* () {
6485
- let t = s(fm, e);
6561
+ let t = s(bm, e);
6486
6562
  if (typeof t.getStats != "function") return;
6487
6563
  let n = yield t.getStats();
6488
6564
  if (n != null) return {
@@ -6492,44 +6568,44 @@ var dm = 3, fm = /* @__PURE__ */ new WeakMap(), pm = /* @__PURE__ */ new WeakMap
6492
6568
  })();
6493
6569
  }
6494
6570
  };
6495
- function Cm() {
6571
+ function jm() {
6496
6572
  var e = this;
6497
6573
  return t(function* () {
6498
- let t = s(fm, e).incomingUnidirectionalStreams.getReader();
6574
+ let t = s(bm, e).incomingUnidirectionalStreams.getReader();
6499
6575
  for (;;) {
6500
6576
  var n;
6501
6577
  let { value: r, done: i } = yield t.read();
6502
- if (i || s(_m, e)) {
6503
- s(mm, e).close();
6578
+ if (i || s(Tm, e)) {
6579
+ s(Sm, e).close();
6504
6580
  return;
6505
6581
  }
6506
- let c = new Fl(new Uint8Array(), r, s(bm, e)), l = s(gm, e), u = vl(c, l).catch((t) => o(xm, e, wm).call(e, t, l, c));
6507
- yield s(mm, e).push({ groups: u }), a(gm, e, (n = s(gm, e), n++, n));
6582
+ let c = new Fl(new Uint8Array(), r, s(Om, e)), l = s(wm, e), u = vl(c, l).catch((t) => o(km, e, Mm).call(e, t, l, c));
6583
+ yield s(Sm, e).push({ groups: u }), a(wm, e, (n = s(wm, e), n++, n));
6508
6584
  }
6509
6585
  })();
6510
6586
  }
6511
- function wm(e, t, r) {
6587
+ function Mm(e, t, r) {
6512
6588
  var i;
6513
- if (r.close().catch(n), s(_m, this)) return;
6589
+ if (r.close().catch(n), s(Tm, this)) return;
6514
6590
  let a = Oc(e), o = {
6515
6591
  streamId: t,
6516
6592
  error: e,
6517
6593
  source: a == null ? void 0 : a.source,
6518
6594
  streamErrorCode: (i = a == null ? void 0 : a.streamErrorCode) == null ? void 0 : i
6519
6595
  };
6520
- (a == null ? void 0 : a.source) === "stream" ? (kc(e) ? s(ym, this).debug : s(ym, this).warn)("Discarding object stream whose header could not be read", o) : (s(ym, this).warn("Closing session after object stream header failure", o), this.close(a ? void 0 : {
6521
- closeCode: dm,
6596
+ (a == null ? void 0 : a.source) === "stream" ? (kc(e) ? s(Dm, this).debug : s(Dm, this).warn)("Discarding object stream whose header could not be read", o) : (s(Dm, this).warn("Closing session after object stream header failure", o), this.close(a ? void 0 : {
6597
+ closeCode: ym,
6522
6598
  reason: "Invalid object stream header"
6523
6599
  }));
6524
6600
  }
6525
6601
  //#endregion
6526
6602
  //#region ../../libs/moq/src/client.ts
6527
- var Tm = b.get().createContext("MoqClient");
6528
- function Em(e) {
6529
- return Dm.apply(this, arguments);
6603
+ var Nm = b.get().createContext("MoqClient");
6604
+ function Pm(e) {
6605
+ return Fm.apply(this, arguments);
6530
6606
  }
6531
- function Dm() {
6532
- return Dm = t(function* (e) {
6607
+ function Fm() {
6608
+ return Fm = t(function* (e) {
6533
6609
  var t;
6534
6610
  pe(e.signal);
6535
6611
  let n = new WebSocket(e.wsUrl || e.url);
@@ -6548,30 +6624,30 @@ function Dm() {
6548
6624
  i(), t(/* @__PURE__ */ Error("WebSocket closed before open"));
6549
6625
  };
6550
6626
  r = setTimeout(() => {
6551
- i(), n.close(), Tm.warn("WebSocket connect timed out", { timeoutMs: bt }), t(/* @__PURE__ */ Error("WebSocket connect timed out"));
6627
+ i(), n.close(), Nm.warn("WebSocket connect timed out", { timeoutMs: bt }), t(/* @__PURE__ */ Error("WebSocket connect timed out"));
6552
6628
  }, bt), n.addEventListener("error", a), n.addEventListener("open", o), n.addEventListener("close", s);
6553
6629
  }), e.signal).catch(r), (t = e.signal) != null && t.aborted && r(fe(e.signal));
6554
6630
  let i = Zd.wrapWebsocket(n), a = ef(i, e.role).catch((e) => {
6555
- throw Tm.warn("MoQ handshake failed, closing WebSocket", { error: e }), n.close(), e;
6631
+ throw Nm.warn("MoQ handshake failed, closing WebSocket", { error: e }), n.close(), e;
6556
6632
  });
6557
6633
  if (!e.handshakePipelining) {
6558
6634
  var o;
6559
6635
  yield he(a, e.signal).catch(r), (o = e.signal) != null && o.aborted && r(fe(e.signal));
6560
6636
  }
6561
- let s = new Lp(new lm(n, i), e.authToken);
6562
- return Tm.info("connected", {
6637
+ let s = new Up(new gm(n, i), e.authToken);
6638
+ return Nm.info("connected", {
6563
6639
  url: e.wsUrl || e.url,
6564
6640
  transport: "websocket"
6565
6641
  }), e.handshakePipelining && a.catch((e) => {
6566
6642
  s.fail(e);
6567
6643
  }), s;
6568
- }), Dm.apply(this, arguments);
6644
+ }), Fm.apply(this, arguments);
6569
6645
  }
6570
- function Om(e) {
6571
- return km.apply(this, arguments);
6646
+ function Im(e) {
6647
+ return Lm.apply(this, arguments);
6572
6648
  }
6573
- function km() {
6574
- return km = t(function* (e, t = e.signal) {
6649
+ function Lm() {
6650
+ return Lm = t(function* (e, t = e.signal) {
6575
6651
  pe(t);
6576
6652
  let n = new WebTransport(e.url, {
6577
6653
  congestionControl: "low-latency",
@@ -6585,29 +6661,29 @@ function km() {
6585
6661
  window.removeEventListener("beforeunload", i);
6586
6662
  }).catch(() => {})), yield he(Promise.race([n.ready, n.closed.then(() => Promise.reject(/* @__PURE__ */ Error("WebTransport closed")))]), t).catch(r);
6587
6663
  let a = yield he(n.createBidirectionalStream(), t).catch(r), o = Zd.wrapWebTransport(a), s = ef(o, e.role).catch((e) => {
6588
- throw Tm.warn("MoQ handshake failed, closing WebTransport", { error: e }), n.close(), e;
6664
+ throw Nm.warn("MoQ handshake failed, closing WebTransport", { error: e }), n.close(), e;
6589
6665
  });
6590
6666
  e.handshakePipelining || (yield he(s, t).catch(r)), t != null && t.aborted && r(fe(t));
6591
- let c = new Lp(new Sm(n, o, e.url.toString()), e.authToken);
6592
- return Tm.info("connected", {
6667
+ let c = new Up(new Am(n, o, e.url.toString()), e.authToken);
6668
+ return Nm.info("connected", {
6593
6669
  url: e.url,
6594
6670
  transport: "webtransport"
6595
6671
  }), e.handshakePipelining && s.catch((e) => {
6596
6672
  c.fail(e);
6597
6673
  }), c;
6598
- }), km.apply(this, arguments);
6674
+ }), Lm.apply(this, arguments);
6599
6675
  }
6600
- function Am(e) {
6601
- return jm.apply(this, arguments);
6676
+ function Rm(e) {
6677
+ return zm.apply(this, arguments);
6602
6678
  }
6603
- function jm() {
6604
- return jm = t(function* (e) {
6679
+ function zm() {
6680
+ return zm = t(function* (e) {
6605
6681
  if (self.WebTransport && (e == null ? void 0 : e.preferredTransport) !== "websocket" && e.url.protocol.startsWith("https")) {
6606
6682
  if (!e.websocketFallbackTimeoutMs) return {
6607
- session: yield Om(e),
6683
+ session: yield Im(e),
6608
6684
  transportSelectionReason: void 0
6609
6685
  };
6610
- let t = new AbortController(), n = me(e.signal, (e) => t.abort(e.reason)), r = Om(e, t.signal).catch(() => void 0), i, a = new Promise((t) => {
6686
+ let t = new AbortController(), n = me(e.signal, (e) => t.abort(e.reason)), r = Im(e, t.signal).catch(() => void 0), i, a = new Promise((t) => {
6611
6687
  i = setTimeout(() => t(void 0), e.websocketFallbackTimeoutMs);
6612
6688
  }), o = yield Promise.race([r, a]).finally(() => {
6613
6689
  clearTimeout(i), n();
@@ -6616,22 +6692,22 @@ function jm() {
6616
6692
  session: o,
6617
6693
  transportSelectionReason: void 0
6618
6694
  } : (t.abort(), r.then((e) => e == null ? void 0 : e.close()), {
6619
- session: yield Em(e),
6695
+ session: yield Pm(e),
6620
6696
  transportSelectionReason: "fallback"
6621
6697
  });
6622
6698
  }
6623
6699
  let t;
6624
6700
  return t = (e == null ? void 0 : e.preferredTransport) === "websocket" ? "disabled" : self.WebTransport ? "unavailable" : "unsupported", {
6625
- session: yield Em(e),
6701
+ session: yield Pm(e),
6626
6702
  transportSelectionReason: t
6627
6703
  };
6628
- }), jm.apply(this, arguments);
6704
+ }), zm.apply(this, arguments);
6629
6705
  }
6630
6706
  //#endregion
6631
6707
  //#region ../../libs/moq/src/session/Track.ts
6632
- var Mm = /* @__PURE__ */ new WeakMap(), Nm = class {
6708
+ var Bm = /* @__PURE__ */ new WeakMap(), Vm = class {
6633
6709
  constructor() {
6634
- i(this, Mm, {
6710
+ i(this, Bm, {
6635
6711
  name: "",
6636
6712
  priority: 0,
6637
6713
  groupOrder: "ascending",
@@ -6639,16 +6715,16 @@ var Mm = /* @__PURE__ */ new WeakMap(), Nm = class {
6639
6715
  });
6640
6716
  }
6641
6717
  name(e) {
6642
- return s(Mm, this).name = e, this;
6718
+ return s(Bm, this).name = e, this;
6643
6719
  }
6644
6720
  priority(e) {
6645
- return s(Mm, this).priority = e, this;
6721
+ return s(Bm, this).priority = e, this;
6646
6722
  }
6647
6723
  groupOrder(e) {
6648
- return s(Mm, this).groupOrder = e, this;
6724
+ return s(Bm, this).groupOrder = e, this;
6649
6725
  }
6650
6726
  startGroup(e) {
6651
- return s(Mm, this).filterType = {
6727
+ return s(Bm, this).filterType = {
6652
6728
  type: "absolute-start",
6653
6729
  start: {
6654
6730
  group: e,
@@ -6657,7 +6733,7 @@ var Mm = /* @__PURE__ */ new WeakMap(), Nm = class {
6657
6733
  }, this;
6658
6734
  }
6659
6735
  range(e, t) {
6660
- return s(Mm, this).filterType = {
6736
+ return s(Bm, this).filterType = {
6661
6737
  type: "absolute-range",
6662
6738
  start: {
6663
6739
  group: e,
@@ -6670,69 +6746,69 @@ var Mm = /* @__PURE__ */ new WeakMap(), Nm = class {
6670
6746
  }, this;
6671
6747
  }
6672
6748
  build() {
6673
- return s(Mm, this);
6749
+ return s(Bm, this);
6674
6750
  }
6675
- }, Pm = /* @__PURE__ */ new WeakMap(), Fm = /* @__PURE__ */ new WeakMap(), Im = class {
6751
+ }, Hm = /* @__PURE__ */ new WeakMap(), Um = /* @__PURE__ */ new WeakMap(), Wm = class {
6676
6752
  constructor(e, t) {
6677
- i(this, Pm, void 0), i(this, Fm, void 0), a(Pm, this, e), a(Fm, this, t);
6753
+ i(this, Hm, void 0), i(this, Um, void 0), a(Hm, this, e), a(Um, this, t);
6678
6754
  }
6679
6755
  subscribe(e, t = /* @__PURE__ */ new Map()) {
6680
- return s(Pm, this).subscribe(this.namespace(), e, t);
6756
+ return s(Hm, this).subscribe(this.namespace(), e, t);
6681
6757
  }
6682
6758
  closed() {
6683
- return s(Pm, this).closed();
6759
+ return s(Hm, this).closed();
6684
6760
  }
6685
6761
  namespace() {
6686
- return s(Fm, this).namespace;
6762
+ return s(Um, this).namespace;
6687
6763
  }
6688
6764
  };
6689
6765
  //#endregion
6690
6766
  //#region ../../libs/voq-catalog/src/catalog/Catalog.ts
6691
- function Lm(e, t) {
6767
+ function Gm(e, t) {
6692
6768
  return t ? [
6693
6769
  "com.vindral.moq",
6694
6770
  e,
6695
6771
  t
6696
6772
  ] : ["com.vindral.moq", e];
6697
6773
  }
6698
- function Rm(e) {
6774
+ function Km(e) {
6699
6775
  let t = e[1];
6700
6776
  if (!t) throw Error("namespace must contain a channel ID");
6701
6777
  return t;
6702
6778
  }
6703
- function zm(e) {
6779
+ function qm(e) {
6704
6780
  return "tracks" in e;
6705
6781
  }
6706
- function Bm(e) {
6782
+ function Jm(e) {
6707
6783
  let t = new TextDecoder().decode(e);
6708
6784
  return JSON.parse(t);
6709
6785
  }
6710
6786
  //#endregion
6711
6787
  //#region ../../libs/voq/src/tracks/Track.ts
6712
- var Vm, Hm = /* @__PURE__ */ new WeakMap(), Um = /* @__PURE__ */ new WeakMap(), Wm = /* @__PURE__ */ new WeakMap(), Gm = /* @__PURE__ */ new WeakMap(), Km = /* @__PURE__ */ new WeakMap(), qm = /* @__PURE__ */ new WeakMap(), Jm = /* @__PURE__ */ new WeakSet();
6713
- Vm = Symbol.asyncIterator;
6714
- var Ym = class e {
6788
+ var Ym, Xm = /* @__PURE__ */ new WeakMap(), Zm = /* @__PURE__ */ new WeakMap(), Qm = /* @__PURE__ */ new WeakMap(), $m = /* @__PURE__ */ new WeakMap(), eh = /* @__PURE__ */ new WeakMap(), th = /* @__PURE__ */ new WeakMap(), nh = /* @__PURE__ */ new WeakSet();
6789
+ Ym = Symbol.asyncIterator;
6790
+ var rh = class e {
6715
6791
  constructor(e, c) {
6716
6792
  var l = this;
6717
- S(this, Jm), i(this, Hm, void 0), i(this, Um, void 0), i(this, Wm, new r(100)), i(this, Gm, void 0), i(this, Km, void 0), i(this, qm, function() {
6793
+ S(this, nh), i(this, Xm, void 0), i(this, Zm, void 0), i(this, Qm, new r(100)), i(this, $m, void 0), i(this, eh, void 0), i(this, th, function() {
6718
6794
  var e = t(function* (e) {
6719
- if (e === void 0) return s(Hm, l).close();
6720
- if (s(Gm, l)) return;
6721
- let t = s(Wm, l).items().reduce((e, t) => e < t ? e : t, e);
6722
- a(Gm, l, o(Jm, l, Xm).call(l, t, e)), s(Gm, l).size === 0 && (yield s(Hm, l).close());
6795
+ if (e === void 0) return s(Xm, l).close();
6796
+ if (s($m, l)) return;
6797
+ let t = s(Qm, l).items().reduce((e, t) => e < t ? e : t, e);
6798
+ a($m, l, o(nh, l, ih).call(l, t, e)), s($m, l).size === 0 && (yield s(Xm, l).close());
6723
6799
  });
6724
6800
  return function(t) {
6725
6801
  return e.apply(this, arguments);
6726
6802
  };
6727
- }()), a(Hm, this, e), a(Um, this, c), e.done().then(function() {
6803
+ }()), a(Xm, this, e), a(Zm, this, c), e.done().then(function() {
6728
6804
  var e = t(function* (e) {
6729
6805
  var t;
6730
- return s(qm, l).call(l, (t = e.finalInfo) == null ? void 0 : t.group);
6806
+ return s(th, l).call(l, (t = e.finalInfo) == null ? void 0 : t.group);
6731
6807
  });
6732
6808
  return function(t) {
6733
6809
  return e.apply(this, arguments);
6734
6810
  };
6735
- }()).catch(n), a(Km, this, e.groups());
6811
+ }()).catch(n), a(eh, this, e.groups());
6736
6812
  }
6737
6813
  static subscribe(n, r) {
6738
6814
  return t(function* () {
@@ -6740,61 +6816,61 @@ var Ym = class e {
6740
6816
  })();
6741
6817
  }
6742
6818
  subscribeId() {
6743
- return s(Hm, this).id;
6819
+ return s(Xm, this).id;
6744
6820
  }
6745
6821
  name() {
6746
- return s(Hm, this).name;
6822
+ return s(Xm, this).name;
6747
6823
  }
6748
6824
  largestGroupId() {
6749
- return s(Um, this);
6825
+ return s(Zm, this);
6750
6826
  }
6751
6827
  needsRenewal() {
6752
- return s(Hm, this).expiryState() === "active" && s(Gm, this) === void 0;
6828
+ return s(Xm, this).expiryState() === "active" && s($m, this) === void 0;
6753
6829
  }
6754
6830
  endOfTrack(e) {
6755
- let t = s(Wm, this).items().reduce((e, t) => e < t ? e : t, e);
6831
+ let t = s(Qm, this).items().reduce((e, t) => e < t ? e : t, e);
6756
6832
  return this.update(t, e);
6757
6833
  }
6758
6834
  update(e, n) {
6759
6835
  var r = this;
6760
6836
  return t(function* () {
6761
- return a(Gm, r, o(Jm, r, Xm).call(r, e, n)), s(Gm, r).size === 0 && (yield s(Hm, r).close()), s(Hm, r).update(e, n);
6837
+ return a($m, r, o(nh, r, ih).call(r, e, n)), s($m, r).size === 0 && (yield s(Xm, r).close()), s(Xm, r).update(e, n);
6762
6838
  })();
6763
6839
  }
6764
6840
  unsubscribe() {
6765
- return s(Hm, this).unsubscribe();
6841
+ return s(Xm, this).unsubscribe();
6766
6842
  }
6767
6843
  next() {
6768
6844
  var e = this;
6769
6845
  return t(function* () {
6770
6846
  var t;
6771
- if (s(Gm, e) && s(Gm, e).size === 0) return {
6847
+ if (s($m, e) && s($m, e).size === 0) return {
6772
6848
  done: !0,
6773
6849
  value: void 0
6774
6850
  };
6775
- let n = yield s(Km, e).next();
6851
+ let n = yield s(eh, e).next();
6776
6852
  if (n.done) return n;
6777
6853
  let r = n.value.groupId();
6778
- return (t = s(Gm, e)) == null || t.delete(r), s(Wm, e).push(r), s(Um, e) || a(Um, e, r), a(Um, e, s(Um, e) < r ? r : s(Um, e)), n;
6854
+ return (t = s($m, e)) == null || t.delete(r), s(Qm, e).push(r), s(Zm, e) || a(Zm, e, r), a(Zm, e, s(Zm, e) < r ? r : s(Zm, e)), n;
6779
6855
  })();
6780
6856
  }
6781
6857
  return() {
6782
- return s(Hm, this).return();
6858
+ return s(Xm, this).return();
6783
6859
  }
6784
- [Vm]() {
6860
+ [Ym]() {
6785
6861
  return this;
6786
6862
  }
6787
6863
  };
6788
- function Xm(e, t) {
6864
+ function ih(e, t) {
6789
6865
  let n = /* @__PURE__ */ new Set();
6790
6866
  for (let r = e; r <= t; r++) n == null || n.add(r);
6791
- return s(Wm, this).items().forEach((e) => {
6867
+ return s(Qm, this).items().forEach((e) => {
6792
6868
  n == null || n.delete(e);
6793
6869
  }), n;
6794
6870
  }
6795
6871
  //#endregion
6796
6872
  //#region \0@oxc-project+runtime@0.115.0/helpers/asyncGeneratorDelegate.js
6797
- function Zm(e) {
6873
+ function ah(e) {
6798
6874
  var t = {}, n = !1;
6799
6875
  function r(t, r) {
6800
6876
  return n = !0, r = new Promise(function(n) {
@@ -6817,24 +6893,24 @@ function Zm(e) {
6817
6893
  }
6818
6894
  //#endregion
6819
6895
  //#region ../../libs/voq/src/tracks/Renewable.ts
6820
- var Qm, $m = /* @__PURE__ */ new WeakMap(), eh = /* @__PURE__ */ new WeakMap(), th = /* @__PURE__ */ new WeakMap(), nh = /* @__PURE__ */ new WeakMap(), rh = /* @__PURE__ */ new WeakSet(), ih = /* @__PURE__ */ new WeakMap();
6821
- Qm = Symbol.asyncIterator;
6822
- var ah = class e {
6896
+ var oh, sh = /* @__PURE__ */ new WeakMap(), ch = /* @__PURE__ */ new WeakMap(), lh = /* @__PURE__ */ new WeakMap(), uh = /* @__PURE__ */ new WeakMap(), dh = /* @__PURE__ */ new WeakSet(), fh = /* @__PURE__ */ new WeakMap();
6897
+ oh = Symbol.asyncIterator;
6898
+ var ph = class e {
6823
6899
  constructor(e) {
6824
6900
  var r = this;
6825
- S(this, rh), i(this, $m, void 0), i(this, eh, void 0), i(this, th, new de(10)), i(this, nh, void 0), i(this, ih, function() {
6901
+ S(this, dh), i(this, sh, void 0), i(this, ch, void 0), i(this, lh, new de(10)), i(this, uh, void 0), i(this, fh, function() {
6826
6902
  var e = t(function* (e, t) {
6827
6903
  try {
6828
6904
  var i = rp();
6829
- let a = i.u(yield s($m, r).lock()), c = { subscribeId: a.value.subscribeId() };
6905
+ let a = i.u(yield s(sh, r).lock()), c = { subscribeId: a.value.subscribeId() };
6830
6906
  if (!a.value.needsRenewal()) {
6831
- s(nh, r).debug("Subscription does not need renewal", c);
6907
+ s(uh, r).debug("Subscription does not need renewal", c);
6832
6908
  return;
6833
6909
  }
6834
- let l = a.value.largestGroupId(), u = l !== void 0, d = new Nm().name(t.name).priority(t.priority).groupOrder(t.groupOrder);
6835
- switch (c.largestGroupId = l, s(nh, r).debug("Renewing subscription", c), t.filterType.type) {
6910
+ let l = a.value.largestGroupId(), u = l !== void 0, d = new Vm().name(t.name).priority(t.priority).groupOrder(t.groupOrder);
6911
+ switch (c.largestGroupId = l, s(uh, r).debug("Renewing subscription", c), t.filterType.type) {
6836
6912
  case "absolute-range":
6837
- s(nh, r).debug("Absolute range is not renewed", c);
6913
+ s(uh, r).debug("Absolute range is not renewed", c);
6838
6914
  return;
6839
6915
  case "absolute-start":
6840
6916
  case "latest-group":
@@ -6845,9 +6921,9 @@ var ah = class e {
6845
6921
  let f = d.build();
6846
6922
  c.newTrack = f;
6847
6923
  let [p] = yield Promise.all([e.subscribe(f), u ? a.value.update(l, l) : a.value.unsubscribe()]);
6848
- p.done().then((e) => o(rh, r, oh).call(r, p, e.finalInfo !== void 0)).catch(n), p.expiryNotification().then(() => s(ih, r).call(r, e, f)).catch(n);
6849
- let m = new Ym(p, l);
6850
- a.value = m, yield s(th, r).push(m), s(nh, r).info("Subscription renewed", c);
6924
+ p.done().then((e) => o(dh, r, mh).call(r, p, e.finalInfo !== void 0)).catch(n), p.expiryNotification().then(() => s(fh, r).call(r, e, f)).catch(n);
6925
+ let m = new rh(p, l);
6926
+ a.value = m, yield s(lh, r).push(m), s(uh, r).info("Subscription renewed", c);
6851
6927
  } catch (e) {
6852
6928
  i.e = e;
6853
6929
  } finally {
@@ -6857,24 +6933,24 @@ var ah = class e {
6857
6933
  return function(t, n) {
6858
6934
  return e.apply(this, arguments);
6859
6935
  };
6860
- }()), a($m, this, new Nt(e)), a(eh, this, e), a(nh, this, b.get().createContext(`Renewable '${e.name()}'`));
6936
+ }()), a(sh, this, new Nt(e)), a(ch, this, e), a(uh, this, b.get().createContext(`Renewable '${e.name()}'`));
6861
6937
  }
6862
6938
  static subscribe(r, i, a) {
6863
6939
  return t(function* () {
6864
- let t = a == null ? void 0 : a.params, c = a == null ? void 0 : a.largestGroupId, l = yield r.subscribe(i, t), u = new e(new Ym(l, c));
6865
- return l.done().then((e) => o(rh, u, oh).call(u, l, e.finalInfo !== void 0)).catch(n), l.expiryNotification().then(() => s(ih, u).call(u, r, i)).catch(n), u;
6940
+ let t = a == null ? void 0 : a.params, c = a == null ? void 0 : a.largestGroupId, l = yield r.subscribe(i, t), u = new e(new rh(l, c));
6941
+ return l.done().then((e) => o(dh, u, mh).call(u, l, e.finalInfo !== void 0)).catch(n), l.expiryNotification().then(() => s(fh, u).call(u, r, i)).catch(n), u;
6866
6942
  })();
6867
6943
  }
6868
6944
  largestGroupId() {
6869
- return s($m, this).unsafeValue().largestGroupId();
6945
+ return s(sh, this).unsafeValue().largestGroupId();
6870
6946
  }
6871
6947
  update(e, n) {
6872
6948
  var r = this;
6873
6949
  return t(function* () {
6874
6950
  try {
6875
6951
  var t = rp();
6876
- let i = t.u(yield s($m, r).lock());
6877
- return s(th, r).close(), i.value.update(e, n);
6952
+ let i = t.u(yield s(sh, r).lock());
6953
+ return s(lh, r).close(), i.value.update(e, n);
6878
6954
  } catch (e) {
6879
6955
  t.e = e;
6880
6956
  } finally {
@@ -6887,8 +6963,8 @@ var ah = class e {
6887
6963
  return t(function* () {
6888
6964
  try {
6889
6965
  var t = rp();
6890
- let r = t.u(yield s($m, n).lock());
6891
- return s(th, n).close(), r.value.endOfTrack(e);
6966
+ let r = t.u(yield s(sh, n).lock());
6967
+ return s(lh, n).close(), r.value.endOfTrack(e);
6892
6968
  } catch (e) {
6893
6969
  t.e = e;
6894
6970
  } finally {
@@ -6901,8 +6977,8 @@ var ah = class e {
6901
6977
  return t(function* () {
6902
6978
  try {
6903
6979
  var t = rp();
6904
- let n = t.u(yield s($m, e).lock());
6905
- return s(th, e).close(), n.value.unsubscribe();
6980
+ let n = t.u(yield s(sh, e).lock());
6981
+ return s(lh, e).close(), n.value.unsubscribe();
6906
6982
  } catch (e) {
6907
6983
  t.e = e;
6908
6984
  } finally {
@@ -6915,8 +6991,8 @@ var ah = class e {
6915
6991
  return t(function* () {
6916
6992
  try {
6917
6993
  var t = rp();
6918
- let n = t.u(yield s($m, e).lock());
6919
- return s(th, e).close(), n.value.return();
6994
+ let n = t.u(yield s(sh, e).lock());
6995
+ return s(lh, e).close(), n.value.return();
6920
6996
  } catch (e) {
6921
6997
  t.e = e;
6922
6998
  } finally {
@@ -6927,17 +7003,17 @@ var ah = class e {
6927
7003
  next() {
6928
7004
  var e = this;
6929
7005
  return t(function* () {
6930
- let t = yield s(eh, e).next();
7006
+ let t = yield s(ch, e).next();
6931
7007
  if (t.done) {
6932
7008
  var n, r;
6933
- yield (n = (r = s(eh, e)).return) == null ? void 0 : n.call(r);
6934
- let t = yield s(th, e).pop();
6935
- if (t) return a(eh, e, t), e.next();
7009
+ yield (n = (r = s(ch, e)).return) == null ? void 0 : n.call(r);
7010
+ let t = yield s(lh, e).pop();
7011
+ if (t) return a(ch, e, t), e.next();
6936
7012
  }
6937
7013
  return t;
6938
7014
  })();
6939
7015
  }
6940
- [Qm]() {
7016
+ [oh]() {
6941
7017
  return this;
6942
7018
  }
6943
7019
  objects() {
@@ -6947,7 +7023,7 @@ var ah = class e {
6947
7023
  try {
6948
7024
  for (var i = U(e), a; t = !(a = yield O(i.next())).done; t = !1) try {
6949
7025
  var o = rp();
6950
- yield* Zm(U(o.a(a.value)));
7026
+ yield* ah(U(o.a(a.value)));
6951
7027
  } catch (e) {
6952
7028
  o.e = e;
6953
7029
  } finally {
@@ -6965,19 +7041,19 @@ var ah = class e {
6965
7041
  })();
6966
7042
  }
6967
7043
  };
6968
- function oh(e, n) {
7044
+ function mh(e, n) {
6969
7045
  var r = this;
6970
7046
  return t(function* () {
6971
7047
  if (e.unsubscribed() || e.endRequested()) {
6972
- s(nh, r).info("Server initiated subscribe done but the subscription is already closing");
7048
+ s(uh, r).info("Server initiated subscribe done but the subscription is already closing");
6973
7049
  return;
6974
7050
  }
6975
- if (s($m, r).unsafeValue().subscribeId() !== e.id) {
6976
- s(nh, r).info("subscribeId mismatch - the subscription already has been renewed");
7051
+ if (s(sh, r).unsafeValue().subscribeId() !== e.id) {
7052
+ s(uh, r).info("subscribeId mismatch - the subscription already has been renewed");
6977
7053
  return;
6978
7054
  }
6979
7055
  if (n) {
6980
- s(th, r).close();
7056
+ s(lh, r).close();
6981
7057
  return;
6982
7058
  }
6983
7059
  return r.return();
@@ -6985,50 +7061,50 @@ function oh(e, n) {
6985
7061
  }
6986
7062
  //#endregion
6987
7063
  //#region ../../libs/voq/src/tracks/Catalog.ts
6988
- var sh = "catalog";
6989
- function ch(e) {
6990
- let t = Bm(e.payload);
6991
- if (!zm(t)) throw Error("unexpected catalog type");
7064
+ var hh = "catalog";
7065
+ function gh(e) {
7066
+ let t = Jm(e.payload);
7067
+ if (!qm(t)) throw Error("unexpected catalog type");
6992
7068
  return t;
6993
7069
  }
6994
- var lh = /* @__PURE__ */ new WeakMap(), uh = /* @__PURE__ */ new WeakMap(), dh = /* @__PURE__ */ new WeakMap(), fh = /* @__PURE__ */ new WeakMap(), ph = /* @__PURE__ */ new WeakSet(), mh = class e {
7070
+ var _h = /* @__PURE__ */ new WeakMap(), vh = /* @__PURE__ */ new WeakMap(), yh = /* @__PURE__ */ new WeakMap(), bh = /* @__PURE__ */ new WeakMap(), xh = /* @__PURE__ */ new WeakSet(), Sh = class e {
6995
7071
  constructor(e, t, r) {
6996
- S(this, ph), i(this, lh, void 0), i(this, uh, void 0), i(this, dh, void 0), i(this, fh, void 0), a(uh, this, e), a(lh, this, t), a(dh, this, r), a(fh, this, o(ph, this, hh).call(this)), this.closed().finally(() => s(lh, this).close()).catch(n);
7072
+ S(this, xh), i(this, _h, void 0), i(this, vh, void 0), i(this, yh, void 0), i(this, bh, void 0), a(vh, this, e), a(_h, this, t), a(yh, this, r), a(bh, this, o(xh, this, Ch).call(this)), this.closed().finally(() => s(_h, this).close()).catch(n);
6997
7073
  }
6998
7074
  catalog() {
6999
- return s(lh, this);
7075
+ return s(_h, this);
7000
7076
  }
7001
7077
  closed() {
7002
- return s(fh, this);
7078
+ return s(bh, this);
7003
7079
  }
7004
7080
  close() {
7005
7081
  var e = this;
7006
7082
  return t(function* () {
7007
- return s(lh, e).close(), (yield s(uh, e).promise).unsubscribe();
7083
+ return s(_h, e).close(), (yield s(vh, e).promise).unsubscribe();
7008
7084
  })();
7009
7085
  }
7010
7086
  static start(n, r) {
7011
7087
  return t(function* () {
7012
- let t = C.fromPromise(ah.subscribe(n, new Nm().name(r.catalogName || sh).groupOrder("ascending").build())), i = C.fromPromise(t.promise.then((e) => e.objects()));
7088
+ let t = C.fromPromise(ph.subscribe(n, new Vm().name(r.catalogName || hh).groupOrder("ascending").build())), i = C.fromPromise(t.promise.then((e) => e.objects()));
7013
7089
  if (r.catalog) return new e(t, new k(r.catalog), i);
7014
7090
  let a = yield (yield i.promise).next();
7015
7091
  if (!a.value) throw Error("No catalog found");
7016
- return new e(t, new k(ch(a.value)), i);
7092
+ return new e(t, new k(gh(a.value)), i);
7017
7093
  })();
7018
7094
  }
7019
7095
  };
7020
- function hh() {
7096
+ function Ch() {
7021
7097
  var e = this;
7022
7098
  return t(function* () {
7023
- let t = yield s(dh, e).promise;
7099
+ let t = yield s(yh, e).promise;
7024
7100
  var n = !1, r = !1, i;
7025
7101
  try {
7026
7102
  for (var a = U(t), o; n = !(o = yield a.next()).done; n = !1) {
7027
7103
  let t = o.value;
7028
7104
  {
7029
7105
  if (t.objectStatus !== H.Normal) continue;
7030
- let n = ch(t);
7031
- s(lh, e).update(n);
7106
+ let n = gh(t);
7107
+ s(_h, e).update(n);
7032
7108
  }
7033
7109
  }
7034
7110
  } catch (e) {
@@ -7044,51 +7120,51 @@ function hh() {
7044
7120
  }
7045
7121
  //#endregion
7046
7122
  //#region ../../libs/voq/src/tracks/Cmaf.ts
7047
- var gh, _h, vh, yh, bh, xh, Sh, Ch, wh = /* @__PURE__ */ new WeakMap(), Th = /* @__PURE__ */ new WeakMap(), Eh = /* @__PURE__ */ new WeakMap(), Dh = /* @__PURE__ */ new WeakMap(), Oh = /* @__PURE__ */ new WeakMap(), kh = /* @__PURE__ */ new WeakMap(), Ah = /* @__PURE__ */ new WeakMap(), jh = /* @__PURE__ */ new WeakMap(), Mh = /* @__PURE__ */ new WeakSet();
7048
- gh = Tt(), _h = Symbol.dispose;
7049
- var Nh = class {
7123
+ var wh, Th, Eh, Dh, Oh, kh, Ah, jh, Mh = /* @__PURE__ */ new WeakMap(), Nh = /* @__PURE__ */ new WeakMap(), Ph = /* @__PURE__ */ new WeakMap(), Fh = /* @__PURE__ */ new WeakMap(), Ih = /* @__PURE__ */ new WeakMap(), Lh = /* @__PURE__ */ new WeakMap(), Rh = /* @__PURE__ */ new WeakMap(), zh = /* @__PURE__ */ new WeakMap(), Bh = /* @__PURE__ */ new WeakSet();
7124
+ wh = Tt(), Th = Symbol.dispose;
7125
+ var Vh = class {
7050
7126
  constructor(e, t) {
7051
- S(this, Mh), i(this, wh, void 0), i(this, Th, void 0), i(this, Eh, void 0), i(this, Dh, void 0), i(this, Oh, void 0), i(this, kh, void 0), i(this, Ah, void 0), i(this, jh, 0), a(wh, this, e), a(Th, this, t);
7127
+ S(this, Bh), i(this, Mh, void 0), i(this, Nh, void 0), i(this, Ph, void 0), i(this, Fh, void 0), i(this, Ih, void 0), i(this, Lh, void 0), i(this, Rh, void 0), i(this, zh, 0), a(Mh, this, e), a(Nh, this, t);
7052
7128
  }
7053
7129
  onFragment(e, t, n, r, i) {
7054
7130
  var o;
7055
- s(Eh, this) === void 0 && (a(Eh, this, e), a(Dh, this, t), a(Oh, this, n), a(kh, this, r), s(wh, this).debug("group start", {
7056
- name: s(Th, this).name,
7131
+ s(Ph, this) === void 0 && (a(Ph, this, e), a(Fh, this, t), a(Ih, this, n), a(Lh, this, r), s(Mh, this).debug("group start", {
7132
+ name: s(Nh, this).name,
7057
7133
  groupId: e,
7058
7134
  startTimeMs: r,
7059
7135
  endTimeMs: i,
7060
7136
  subscribeId: t,
7061
7137
  mediaType: n,
7062
- namespace: s(Th, this).namespace
7063
- })), a(jh, this, (o = s(jh, this), o++, o)), a(Ah, this, i);
7138
+ namespace: s(Nh, this).namespace
7139
+ })), a(zh, this, (o = s(zh, this), o++, o)), a(Rh, this, i);
7064
7140
  }
7065
- [gh]() {
7066
- o(Mh, this, Ph).call(this);
7141
+ [wh]() {
7142
+ o(Bh, this, Hh).call(this);
7067
7143
  }
7068
- [_h]() {
7069
- o(Mh, this, Ph).call(this);
7144
+ [Th]() {
7145
+ o(Bh, this, Hh).call(this);
7070
7146
  }
7071
7147
  };
7072
- function Ph() {
7073
- s(Eh, this) !== void 0 && s(kh, this) !== void 0 && s(Ah, this) !== void 0 && s(wh, this).debug("group end", {
7074
- name: s(Th, this).name,
7075
- groupId: s(Eh, this),
7076
- startTimeMs: s(kh, this),
7077
- endTimeMs: s(Ah, this),
7078
- durationMs: s(Ah, this) - s(kh, this),
7079
- fragmentCount: s(jh, this),
7080
- subscribeId: s(Dh, this),
7081
- mediaType: s(Oh, this),
7082
- namespace: s(Th, this).namespace
7148
+ function Hh() {
7149
+ s(Ph, this) !== void 0 && s(Lh, this) !== void 0 && s(Rh, this) !== void 0 && s(Mh, this).debug("group end", {
7150
+ name: s(Nh, this).name,
7151
+ groupId: s(Ph, this),
7152
+ startTimeMs: s(Lh, this),
7153
+ endTimeMs: s(Rh, this),
7154
+ durationMs: s(Rh, this) - s(Lh, this),
7155
+ fragmentCount: s(zh, this),
7156
+ subscribeId: s(Fh, this),
7157
+ mediaType: s(Ih, this),
7158
+ namespace: s(Nh, this).namespace
7083
7159
  });
7084
7160
  }
7085
- var Fh = /* @__PURE__ */ new WeakMap(), Ih = /* @__PURE__ */ new WeakMap(), Lh = /* @__PURE__ */ new WeakMap(), Rh = /* @__PURE__ */ new WeakMap(), zh = /* @__PURE__ */ new WeakSet();
7086
- vh = Symbol.asyncIterator, yh = wt(), bh = Symbol.asyncDispose;
7087
- var Bh = class {
7161
+ var Uh = /* @__PURE__ */ new WeakMap(), Wh = /* @__PURE__ */ new WeakMap(), Gh = /* @__PURE__ */ new WeakMap(), Kh = /* @__PURE__ */ new WeakMap(), qh = /* @__PURE__ */ new WeakSet();
7162
+ Eh = Symbol.asyncIterator, Dh = wt(), Oh = Symbol.asyncDispose;
7163
+ var Jh = class {
7088
7164
  constructor(t, n, r, o) {
7089
- S(this, zh), i(this, Fh, void 0), i(this, Ih, void 0), i(this, Lh, void 0), e(this, "track", void 0), i(this, Rh, b.get().createContext("CmafGroup")), this.track = o, a(Fh, this, r), a(Ih, this, t), a(Lh, this, n);
7165
+ S(this, qh), i(this, Uh, void 0), i(this, Wh, void 0), i(this, Gh, void 0), e(this, "track", void 0), i(this, Kh, b.get().createContext("CmafGroup")), this.track = o, a(Uh, this, r), a(Wh, this, t), a(Gh, this, n);
7090
7166
  }
7091
- [vh]() {
7167
+ [Eh]() {
7092
7168
  var e = this;
7093
7169
  return Ft(function* () {
7094
7170
  try {
@@ -7096,18 +7172,18 @@ var Bh = class {
7096
7172
  let c = {
7097
7173
  name: e.track.trackObject.name,
7098
7174
  namespace: e.track.namespace
7099
- }, l = t.u(new Nh(s(Rh, e), c));
7175
+ }, l = t.u(new Vh(s(Kh, e), c));
7100
7176
  var n = !1, r = !1, i;
7101
7177
  try {
7102
- for (var a = U(s(Ih, e)), o; n = !(o = yield O(a.next())).done; n = !1) {
7178
+ for (var a = U(s(Wh, e)), o; n = !(o = yield O(a.next())).done; n = !1) {
7103
7179
  let t = o.value;
7104
7180
  {
7105
7181
  if (t.objectStatus === H.EndOfTrackAndGroup && (yield O(e.track.endOfTrack(t.groupId))), t.objectStatus !== H.Normal) continue;
7106
- let n = s(Lh, e).createFragment(t.payload), r = n.timescale(), i = n.baseMediaDecodeTime() / r * 1e3, a = i + n.duration() / r * 1e3, o = s(Fh, e) / 1e3 * r;
7182
+ let n = s(Gh, e).createFragment(t.payload), r = n.timescale(), i = n.baseMediaDecodeTime() / r * 1e3, a = i + n.duration() / r * 1e3, o = s(Uh, e) / 1e3 * r;
7107
7183
  n.updateBaseMediaDecodeTime(n.baseMediaDecodeTime() - o);
7108
7184
  let u = e.track.timestampRange();
7109
7185
  if (u && i >= u[1]) break;
7110
- s(Rh, e).trace("fragment", y(y({}, c), {}, {
7186
+ s(Kh, e).trace("fragment", y(y({}, c), {}, {
7111
7187
  startTime: i,
7112
7188
  endTime: a,
7113
7189
  subscribeId: t.subscribeId,
@@ -7133,41 +7209,41 @@ var Bh = class {
7133
7209
  }
7134
7210
  })();
7135
7211
  }
7136
- [yh]() {
7137
- return o(zh, this, Vh).call(this);
7212
+ [Dh]() {
7213
+ return o(qh, this, Yh).call(this);
7138
7214
  }
7139
- [bh]() {
7140
- return o(zh, this, Vh).call(this);
7215
+ [Oh]() {
7216
+ return o(qh, this, Yh).call(this);
7141
7217
  }
7142
7218
  };
7143
- function Vh() {
7219
+ function Yh() {
7144
7220
  var e = this;
7145
7221
  return t(function* () {
7146
7222
  var t, n;
7147
- return yield (t = (n = s(Ih, e)).return) == null ? void 0 : t.call(n), Promise.resolve();
7223
+ return yield (t = (n = s(Wh, e)).return) == null ? void 0 : t.call(n), Promise.resolve();
7148
7224
  })();
7149
7225
  }
7150
- var Hh = /* @__PURE__ */ new WeakMap(), Uh = /* @__PURE__ */ new WeakMap(), Wh = /* @__PURE__ */ new WeakMap(), Gh = /* @__PURE__ */ new WeakMap();
7151
- xh = Symbol.asyncIterator, Sh = wt(), Ch = Symbol.asyncDispose;
7152
- var Kh = class n {
7226
+ var Xh = /* @__PURE__ */ new WeakMap(), Zh = /* @__PURE__ */ new WeakMap(), Qh = /* @__PURE__ */ new WeakMap(), $h = /* @__PURE__ */ new WeakMap();
7227
+ kh = Symbol.asyncIterator, Ah = wt(), jh = Symbol.asyncDispose;
7228
+ var eg = class n {
7153
7229
  constructor(t, n, r, o, s) {
7154
- i(this, Hh, void 0), i(this, Uh, void 0), i(this, Wh, void 0), i(this, Gh, void 0), e(this, "trackObject", void 0), e(this, "namespace", void 0), this.trackObject = t, this.namespace = n, a(Uh, this, r), a(Hh, this, o), a(Wh, this, s);
7230
+ i(this, Xh, void 0), i(this, Zh, void 0), i(this, Qh, void 0), i(this, $h, void 0), e(this, "trackObject", void 0), e(this, "namespace", void 0), this.trackObject = t, this.namespace = n, a(Zh, this, r), a(Xh, this, o), a(Qh, this, s);
7155
7231
  }
7156
7232
  static subscribe(e, r, { timestampOffsetMs: i, startGroup: a, params: o }) {
7157
7233
  return t(function* () {
7158
7234
  if (r.format !== "cmaf") throw Error("format must be cmaf");
7159
- let t = new Nm().name(r.name);
7235
+ let t = new Vm().name(r.name);
7160
7236
  a !== void 0 && t.startGroup(a);
7161
7237
  let s = t.build();
7162
7238
  if (r.initTrack) {
7163
- let t = new Nm().name(r.initTrack).build(), [c, l] = yield Promise.all([qh.call(n, e, t), ah.subscribe(e, s, {
7239
+ let t = new Vm().name(r.initTrack).build(), [c, l] = yield Promise.all([tg.call(n, e, t), ph.subscribe(e, s, {
7164
7240
  params: o,
7165
7241
  largestGroupId: a ? a - T(1) : void 0
7166
7242
  })]), u = new Ja(c);
7167
7243
  return new n(r, e.namespace(), l, u, i);
7168
7244
  }
7169
7245
  d(r.initData, "no init data found on track");
7170
- let c = we(r.initData), l = new Ja(new Uint8Array(c)), u = yield ah.subscribe(e, s, {
7246
+ let c = we(r.initData), l = new Ja(new Uint8Array(c)), u = yield ph.subscribe(e, s, {
7171
7247
  params: o,
7172
7248
  largestGroupId: a ? a - T(1) : void 0
7173
7249
  });
@@ -7175,59 +7251,59 @@ var Kh = class n {
7175
7251
  })();
7176
7252
  }
7177
7253
  largestGroupId() {
7178
- return s(Uh, this).largestGroupId();
7254
+ return s(Zh, this).largestGroupId();
7179
7255
  }
7180
7256
  stopAfterTimestampReached(e) {
7181
- a(Gh, this, [0, e]);
7257
+ a($h, this, [0, e]);
7182
7258
  }
7183
7259
  timestampRange() {
7184
- return s(Gh, this);
7260
+ return s($h, this);
7185
7261
  }
7186
7262
  endOfTrack(e) {
7187
- return s(Uh, this).endOfTrack(e);
7263
+ return s(Zh, this).endOfTrack(e);
7188
7264
  }
7189
7265
  update(e, t) {
7190
- return s(Uh, this).update(e, t);
7266
+ return s(Zh, this).update(e, t);
7191
7267
  }
7192
7268
  unsubscribe() {
7193
7269
  var e = this;
7194
7270
  return t(function* () {
7195
- return s(Uh, e).unsubscribe();
7271
+ return s(Zh, e).unsubscribe();
7196
7272
  })();
7197
7273
  }
7198
7274
  next() {
7199
7275
  var e = this;
7200
7276
  return t(function* () {
7201
- let t = yield s(Uh, e).next();
7277
+ let t = yield s(Zh, e).next();
7202
7278
  return t.done ? t : {
7203
7279
  done: !1,
7204
- value: new Bh(t.value, s(Hh, e), s(Wh, e), e)
7280
+ value: new Jh(t.value, s(Xh, e), s(Qh, e), e)
7205
7281
  };
7206
7282
  })();
7207
7283
  }
7208
7284
  return() {
7209
7285
  var e = this;
7210
7286
  return t(function* () {
7211
- return yield s(Uh, e).return(), {
7287
+ return yield s(Zh, e).return(), {
7212
7288
  done: !0,
7213
7289
  value: void 0
7214
7290
  };
7215
7291
  })();
7216
7292
  }
7217
- [xh]() {
7293
+ [kh]() {
7218
7294
  return this;
7219
7295
  }
7220
- [Sh]() {
7296
+ [Ah]() {
7221
7297
  return this.unsubscribe();
7222
7298
  }
7223
- [Ch]() {
7299
+ [jh]() {
7224
7300
  var e = this;
7225
7301
  return t(function* () {
7226
7302
  return e.unsubscribe();
7227
7303
  })();
7228
7304
  }
7229
7305
  };
7230
- function qh(e, n) {
7306
+ function tg(e, n) {
7231
7307
  return t(function* () {
7232
7308
  try {
7233
7309
  var t = rp();
@@ -7243,46 +7319,46 @@ function qh(e, n) {
7243
7319
  }
7244
7320
  //#endregion
7245
7321
  //#region ../../libs/voq/src/tracks/Timeline.ts
7246
- var Jh = 1e4, Yh = 3e4, Xh = /* @__PURE__ */ new WeakMap(), Zh = /* @__PURE__ */ new WeakMap(), Qh = /* @__PURE__ */ new WeakMap(), $h = /* @__PURE__ */ new WeakMap(), eg = /* @__PURE__ */ new WeakMap(), tg = /* @__PURE__ */ new WeakMap(), ng = /* @__PURE__ */ new WeakSet(), rg = class e {
7322
+ var ng = 1e4, rg = 3e4, ig = /* @__PURE__ */ new WeakMap(), ag = /* @__PURE__ */ new WeakMap(), og = /* @__PURE__ */ new WeakMap(), sg = /* @__PURE__ */ new WeakMap(), cg = /* @__PURE__ */ new WeakMap(), lg = /* @__PURE__ */ new WeakMap(), ug = /* @__PURE__ */ new WeakSet(), dg = class e {
7247
7323
  constructor(e, t, r) {
7248
- S(this, ng), i(this, Xh, b.get().createContext("Timeline")), i(this, Zh, new k([])), i(this, Qh, void 0), i(this, $h, void 0), i(this, eg, void 0), i(this, tg, void 0), a($h, this, e), a(eg, this, r), a(Qh, this, t), a(tg, this, o(ng, this, ig).call(this, s(Qh, this))), this.closed().finally(() => s(Zh, this).close()).catch(n);
7324
+ S(this, ug), i(this, ig, b.get().createContext("Timeline")), i(this, ag, new k([])), i(this, og, void 0), i(this, sg, void 0), i(this, cg, void 0), i(this, lg, void 0), a(sg, this, e), a(cg, this, r), a(og, this, t), a(lg, this, o(ug, this, fg).call(this, s(og, this))), this.closed().finally(() => s(ag, this).close()).catch(n);
7249
7325
  }
7250
7326
  closed() {
7251
- return s(tg, this);
7327
+ return s(lg, this);
7252
7328
  }
7253
7329
  close() {
7254
7330
  var e = this;
7255
7331
  return t(function* () {
7256
- return (yield s(Qh, e).promise).unsubscribe();
7332
+ return (yield s(og, e).promise).unsubscribe();
7257
7333
  })();
7258
7334
  }
7259
7335
  timeline() {
7260
- let [e, t] = s(Zh, this).value();
7336
+ let [e, t] = s(ag, this).value();
7261
7337
  return e;
7262
7338
  }
7263
7339
  timestampWallclockOffset() {
7264
7340
  return mt(this.timeline().map((e) => e.mediaPts - e.wallclock));
7265
7341
  }
7266
7342
  static start(t, n) {
7267
- return new e(t, C.fromPromise(ah.subscribe(t, new Nm().name(n).groupOrder("ascending").build())), n);
7343
+ return new e(t, C.fromPromise(ph.subscribe(t, new Vm().name(n).groupOrder("ascending").build())), n);
7268
7344
  }
7269
7345
  waitForWallclockTime(e) {
7270
7346
  var n = this;
7271
7347
  return t(function* () {
7272
- return yield s(Zh, n).waitFor((t) => !!t.find((t) => t.wallclock >= e)), n.timeline();
7348
+ return yield s(ag, n).waitFor((t) => !!t.find((t) => t.wallclock >= e)), n.timeline();
7273
7349
  })();
7274
7350
  }
7275
7351
  waitForTimelineToHaveMinDuration() {
7276
7352
  var e = this;
7277
7353
  return t(function* () {
7278
- return yield s(Zh, e).waitFor((e) => {
7354
+ return yield s(ag, e).waitFor((e) => {
7279
7355
  let t = e[0], n = e[e.length - 1];
7280
- return !t || !n ? !1 : n.wallclock - t.wallclock > Jh;
7356
+ return !t || !n ? !1 : n.wallclock - t.wallclock > ng;
7281
7357
  }), e.timeline();
7282
7358
  })();
7283
7359
  }
7284
7360
  };
7285
- function ig(e) {
7361
+ function fg(e) {
7286
7362
  var n = this;
7287
7363
  return t(function* () {
7288
7364
  let t = yield e.promise;
@@ -7297,13 +7373,13 @@ function ig(e) {
7297
7373
  let e = h.value;
7298
7374
  {
7299
7375
  if (e.objectStatus !== H.Normal) continue;
7300
- let r = og(e.payload);
7301
- s(Zh, n).update((e) => {
7376
+ let r = mg(e.payload);
7377
+ s(ag, n).update((e) => {
7302
7378
  var t, n;
7303
- for (e.push(...r), e.sort((e, t) => e.wallclock - t.wallclock); e[0] && ((t = (n = e[e.length - 1]) == null ? void 0 : n.wallclock) == null ? 0 : t) - e[0].wallclock > Yh;) e.shift();
7379
+ for (e.push(...r), e.sort((e, t) => e.wallclock - t.wallclock); e[0] && ((t = (n = e[e.length - 1]) == null ? void 0 : n.wallclock) == null ? 0 : t) - e[0].wallclock > rg;) e.shift();
7304
7380
  return e;
7305
- }), t === s(Qh, n).resolved && e.groupId > T(0) && e.objectId === T(0) && o(ng, n, ag).call(n, e.groupId).catch((e) => {
7306
- s(Xh, n).warn("backfill failed", e);
7381
+ }), t === s(og, n).resolved && e.groupId > T(0) && e.objectId === T(0) && o(ug, n, pg).call(n, e.groupId).catch((e) => {
7382
+ s(ig, n).warn("backfill failed", e);
7307
7383
  });
7308
7384
  }
7309
7385
  }
@@ -7332,20 +7408,20 @@ function ig(e) {
7332
7408
  }
7333
7409
  })();
7334
7410
  }
7335
- function ag(e) {
7411
+ function pg(e) {
7336
7412
  var n = this;
7337
7413
  return t(function* () {
7338
7414
  let t = e - T(1), r = n.timeline(), i = r[0], a = r[r.length - 1];
7339
- if (!i || !a || a.wallclock - i.wallclock > Jh) return;
7340
- s(Xh, n).debug("backfilling timeline", {
7415
+ if (!i || !a || a.wallclock - i.wallclock > ng) return;
7416
+ s(ig, n).debug("backfilling timeline", {
7341
7417
  currentGroupId: e,
7342
7418
  backfillGroupId: t
7343
7419
  });
7344
- let c = C.fromPromise(ah.subscribe(s($h, n), new Nm().name(s(eg, n)).groupOrder("ascending").range(t, t).build()));
7345
- return o(ng, n, ig).call(n, c);
7420
+ let c = C.fromPromise(ph.subscribe(s(sg, n), new Vm().name(s(cg, n)).groupOrder("ascending").range(t, t).build()));
7421
+ return o(ug, n, fg).call(n, c);
7346
7422
  })();
7347
7423
  }
7348
- function og(e) {
7424
+ function mg(e) {
7349
7425
  var t;
7350
7426
  let n = new TextDecoder("utf-8").decode(e).split("\n");
7351
7427
  return (t = n[0]) != null && t.startsWith("MEDIA_PTS") && n.shift(), n.filter((e) => e.length > 0).map((e) => {
@@ -7362,46 +7438,46 @@ function og(e) {
7362
7438
  }
7363
7439
  //#endregion
7364
7440
  //#region ../../libs/voq/src/tracks/WebVTT.ts
7365
- var sg, cg, lg;
7366
- function ug(e) {
7441
+ var hg, gg, _g;
7442
+ function vg(e) {
7367
7443
  return typeof e.language == "string";
7368
7444
  }
7369
- var dg = /* @__PURE__ */ new WeakMap(), fg = /* @__PURE__ */ new WeakMap(), pg = /* @__PURE__ */ new WeakMap(), mg = /* @__PURE__ */ new WeakMap();
7370
- sg = Symbol.asyncIterator, cg = wt(), lg = Symbol.asyncDispose;
7371
- var hg = class n {
7445
+ var yg = /* @__PURE__ */ new WeakMap(), bg = /* @__PURE__ */ new WeakMap(), xg = /* @__PURE__ */ new WeakMap(), Sg = /* @__PURE__ */ new WeakMap();
7446
+ hg = Symbol.asyncIterator, gg = wt(), _g = Symbol.asyncDispose;
7447
+ var Cg = class n {
7372
7448
  constructor(t, n, r, o, s) {
7373
- i(this, dg, new $s()), i(this, fg, void 0), i(this, pg, void 0), i(this, mg, 0), e(this, "trackObject", void 0), e(this, "namespace", void 0), a(pg, this, t), a(fg, this, n), this.trackObject = r, this.namespace = o, a(mg, this, s);
7449
+ i(this, yg, new $s()), i(this, bg, void 0), i(this, xg, void 0), i(this, Sg, 0), e(this, "trackObject", void 0), e(this, "namespace", void 0), a(xg, this, t), a(bg, this, n), this.trackObject = r, this.namespace = o, a(Sg, this, s);
7374
7450
  }
7375
7451
  static subscribe(e, r, i) {
7376
7452
  return t(function* () {
7377
- if (!ug(r)) throw Error("track object language is required");
7378
- let t = new Nm().name(r.name).build(), a = yield ah.subscribe(e, t);
7453
+ if (!vg(r)) throw Error("track object language is required");
7454
+ let t = new Vm().name(r.name).build(), a = yield ph.subscribe(e, t);
7379
7455
  return new n(a, a.objects(), r, e.namespace(), i);
7380
7456
  })();
7381
7457
  }
7382
7458
  largestGroupId() {
7383
- return s(pg, this).largestGroupId();
7459
+ return s(xg, this).largestGroupId();
7384
7460
  }
7385
7461
  update(e, t) {
7386
- return s(pg, this).update(e, t);
7462
+ return s(xg, this).update(e, t);
7387
7463
  }
7388
7464
  unsubscribe() {
7389
- return s(pg, this).unsubscribe();
7465
+ return s(xg, this).unsubscribe();
7390
7466
  }
7391
7467
  next() {
7392
7468
  var e = this;
7393
7469
  return t(function* () {
7394
7470
  for (;;) {
7395
- let t = yield s(fg, e).next();
7471
+ let t = yield s(bg, e).next();
7396
7472
  if (t.done) return t;
7397
7473
  if (t.value.objectStatus !== H.Normal) continue;
7398
7474
  let n = new TextDecoder().decode(t.value.payload), r;
7399
7475
  try {
7400
- r = s(dg, e).parse(n);
7476
+ r = s(yg, e).parse(n);
7401
7477
  } catch (e) {
7402
7478
  continue;
7403
7479
  }
7404
- let i = r.map((t) => (t.startTime -= s(mg, e) / 1e3, t.endTime -= s(mg, e) / 1e3, t));
7480
+ let i = r.map((t) => (t.startTime -= s(Sg, e) / 1e3, t.endTime -= s(Sg, e) / 1e3, t));
7405
7481
  return {
7406
7482
  done: !1,
7407
7483
  value: {
@@ -7415,29 +7491,29 @@ var hg = class n {
7415
7491
  return() {
7416
7492
  var e = this;
7417
7493
  return t(function* () {
7418
- return yield s(pg, e).return(), {
7494
+ return yield s(xg, e).return(), {
7419
7495
  done: !0,
7420
7496
  value: void 0
7421
7497
  };
7422
7498
  })();
7423
7499
  }
7424
- [sg]() {
7500
+ [hg]() {
7425
7501
  return this;
7426
7502
  }
7427
- [cg]() {
7503
+ [gg]() {
7428
7504
  return this.unsubscribe();
7429
7505
  }
7430
- [lg]() {
7506
+ [_g]() {
7431
7507
  return this.unsubscribe();
7432
7508
  }
7433
- }, gg = /* @__PURE__ */ new WeakMap(), _g = /* @__PURE__ */ new WeakMap(), vg = /* @__PURE__ */ new WeakMap(), yg = /* @__PURE__ */ new WeakMap(), bg = /* @__PURE__ */ new WeakSet(), xg = class n {
7509
+ }, wg = /* @__PURE__ */ new WeakMap(), Tg = /* @__PURE__ */ new WeakMap(), Eg = /* @__PURE__ */ new WeakMap(), Dg = /* @__PURE__ */ new WeakMap(), Og = /* @__PURE__ */ new WeakSet(), kg = class n {
7434
7510
  constructor(t, n, r, o, s) {
7435
- S(this, bg), e(this, "namespace", void 0), i(this, gg, void 0), i(this, _g, void 0), i(this, vg, void 0), i(this, yg, void 0), this.namespace = o, a(gg, this, t), a(_g, this, n), a(vg, this, r), a(yg, this, s);
7511
+ S(this, Og), e(this, "namespace", void 0), i(this, wg, void 0), i(this, Tg, void 0), i(this, Eg, void 0), i(this, Dg, void 0), this.namespace = o, a(wg, this, t), a(Tg, this, n), a(Eg, this, r), a(Dg, this, s);
7436
7512
  }
7437
7513
  static start(e, r) {
7438
7514
  return t(function* () {
7439
- Cg._.info("Enter 'start'", { config: r });
7440
- let t = new Im(e, { namespace: r.namespace }), [i, a] = yield Promise.all([rg.start(t, "timeline"), mh.start(t, {
7515
+ jg._.info("Enter 'start'", { config: r });
7516
+ let t = new Wm(e, { namespace: r.namespace }), [i, a] = yield Promise.all([dg.start(t, "timeline"), Sh.start(t, {
7441
7517
  catalog: r.catalog,
7442
7518
  namespace: r.namespace
7443
7519
  })]);
@@ -7445,42 +7521,42 @@ var hg = class n {
7445
7521
  })();
7446
7522
  }
7447
7523
  closed() {
7448
- return Promise.race([s(vg, this).closed(), s(_g, this).closed()]);
7524
+ return Promise.race([s(Eg, this).closed(), s(Tg, this).closed()]);
7449
7525
  }
7450
7526
  catalog() {
7451
- return s(vg, this).catalog();
7527
+ return s(Eg, this).catalog();
7452
7528
  }
7453
7529
  timestampWallclockOffset() {
7454
- return s(_g, this).timestampWallclockOffset();
7530
+ return s(Tg, this).timestampWallclockOffset();
7455
7531
  }
7456
7532
  timestampOffsetMs() {
7457
- return s(yg, this);
7533
+ return s(Dg, this);
7458
7534
  }
7459
7535
  setTimestampOffsetMs(e) {
7460
- a(yg, this, e);
7536
+ a(Dg, this, e);
7461
7537
  }
7462
7538
  waitForWallclockTime(e) {
7463
- return s(_g, this).waitForWallclockTime(e);
7539
+ return s(Tg, this).waitForWallclockTime(e);
7464
7540
  }
7465
7541
  subscribeCmafTrack(e, t) {
7466
7542
  let n = t == null ? void 0 : t.startGroup, r = t == null ? void 0 : t.params, i = this.catalog().current().tracks, a = e["com.vindral.variant_uid"] === void 0 ? void 0 : i.find((t) => t["com.vindral.variant_uid"] === e["com.vindral.variant_uid"]);
7467
- return o(bg, this, Sg).call(this, () => Kh.subscribe(s(gg, this), a == null ? e : a, {
7468
- timestampOffsetMs: s(yg, this),
7543
+ return o(Og, this, Ag).call(this, () => eg.subscribe(s(wg, this), a == null ? e : a, {
7544
+ timestampOffsetMs: s(Dg, this),
7469
7545
  startGroup: n,
7470
7546
  params: r
7471
7547
  }));
7472
7548
  }
7473
7549
  subscribeWebVttTrack(e) {
7474
- return o(bg, this, Sg).call(this, () => hg.subscribe(s(gg, this), e, s(yg, this)));
7550
+ return o(Og, this, Ag).call(this, () => Cg.subscribe(s(wg, this), e, s(Dg, this)));
7475
7551
  }
7476
7552
  subscribeTrack(e) {
7477
- return o(bg, this, Sg).call(this, () => s(gg, this).subscribe(e));
7553
+ return o(Og, this, Ag).call(this, () => s(wg, this).subscribe(e));
7478
7554
  }
7479
7555
  close() {
7480
- return Promise.all([s(vg, this).close(), s(_g, this).close()]);
7556
+ return Promise.all([s(Eg, this).close(), s(Tg, this).close()]);
7481
7557
  }
7482
7558
  };
7483
- function Sg(e) {
7559
+ function Ag(e) {
7484
7560
  var n = this;
7485
7561
  return t(function* () {
7486
7562
  let [t, r] = n.catalog().value();
@@ -7492,45 +7568,45 @@ function Sg(e) {
7492
7568
  }
7493
7569
  })();
7494
7570
  }
7495
- var Cg = { _: b.get().createContext("Channel") }, wg = T(8);
7496
- function Tg(e) {
7571
+ var jg = { _: b.get().createContext("Channel") }, Mg = T(8);
7572
+ function Ng(e) {
7497
7573
  if (e < 0 || e > 65535) throw RangeError("burstMs must be between 0 and 65535 inclusive");
7498
7574
  return {
7499
- type: wg,
7575
+ type: Mg,
7500
7576
  payload: new Uint8Array([e >> 8 & 255, e & 255])
7501
7577
  };
7502
7578
  }
7503
7579
  //#endregion
7504
7580
  //#region ../../libs/voq/src/ProducerReferenceClock.ts
7505
- var Eg = /* @__PURE__ */ new WeakMap(), Dg = /* @__PURE__ */ new WeakMap(), Og = /* @__PURE__ */ new WeakSet(), kg = class e {
7581
+ var Pg = /* @__PURE__ */ new WeakMap(), Fg = /* @__PURE__ */ new WeakMap(), Ig = /* @__PURE__ */ new WeakSet(), Lg = class e {
7506
7582
  constructor(e) {
7507
- S(this, Og), i(this, Eg, void 0), i(this, Dg, void 0);
7583
+ S(this, Ig), i(this, Pg, void 0), i(this, Fg, void 0);
7508
7584
  let [t, n] = e.value.value();
7509
- a(Eg, this, {
7585
+ a(Pg, this, {
7510
7586
  createdAt: /* @__PURE__ */ new Date(),
7511
7587
  wallclock: new Date(t.ntpTimestamp),
7512
7588
  rtt: t.rtt
7513
- }), a(Dg, this, o(Og, this, Ag).call(this, e));
7589
+ }), a(Fg, this, o(Ig, this, Rg).call(this, e));
7514
7590
  }
7515
7591
  wallclock() {
7516
- let e = Date.now() - s(Eg, this).createdAt.getTime();
7517
- return s(Eg, this).wallclock.getTime() + e;
7592
+ let e = Date.now() - s(Pg, this).createdAt.getTime();
7593
+ return s(Pg, this).wallclock.getTime() + e;
7518
7594
  }
7519
7595
  closed() {
7520
- return s(Dg, this);
7596
+ return s(Fg, this);
7521
7597
  }
7522
7598
  static start(t) {
7523
7599
  return new e(t);
7524
7600
  }
7525
7601
  };
7526
- function Ag(e) {
7602
+ function Rg(e) {
7527
7603
  var n = this;
7528
7604
  return t(function* () {
7529
7605
  var t = !1, r = !1, i;
7530
7606
  try {
7531
7607
  for (var o = U(e.value), s; t = !(s = yield o.next()).done; t = !1) {
7532
7608
  let e = s.value;
7533
- a(Eg, n, {
7609
+ a(Pg, n, {
7534
7610
  createdAt: /* @__PURE__ */ new Date(),
7535
7611
  wallclock: new Date(e.ntpTimestamp),
7536
7612
  rtt: e.rtt
@@ -7549,7 +7625,7 @@ function Ag(e) {
7549
7625
  }
7550
7626
  //#endregion
7551
7627
  //#region \0@oxc-project+runtime@0.115.0/helpers/objectWithoutPropertiesLoose.js
7552
- function jg(e, t) {
7628
+ function zg(e, t) {
7553
7629
  if (e == null) return {};
7554
7630
  var n = {};
7555
7631
  for (var r in e) if ({}.hasOwnProperty.call(e, r)) {
@@ -7560,9 +7636,9 @@ function jg(e, t) {
7560
7636
  }
7561
7637
  //#endregion
7562
7638
  //#region \0@oxc-project+runtime@0.115.0/helpers/objectWithoutProperties.js
7563
- function Mg(e, t) {
7639
+ function Bg(e, t) {
7564
7640
  if (e == null) return {};
7565
- var n, r, i = jg(e, t);
7641
+ var n, r, i = zg(e, t);
7566
7642
  if (Object.getOwnPropertySymbols) {
7567
7643
  var a = Object.getOwnPropertySymbols(e);
7568
7644
  for (r = 0; r < a.length; r++) n = a[r], t.includes(n) || {}.propertyIsEnumerable.call(e, n) && (i[n] = e[n]);
@@ -7571,27 +7647,27 @@ function Mg(e, t) {
7571
7647
  }
7572
7648
  //#endregion
7573
7649
  //#region ../../libs/voq/src/tracks/Drm.ts
7574
- var Ng = ["fairplayCertificate"];
7575
- function Pg(e) {
7650
+ var Vg = ["fairplayCertificate"];
7651
+ function Hg(e) {
7576
7652
  return typeof e == "string" || e == null;
7577
7653
  }
7578
- function Fg(e) {
7579
- return "provider" in e && typeof e.provider == "string" && (!("widevineLicenseUrl" in e) || Pg(e.widevineLicenseUrl)) && (!("playreadyLicenseUrl" in e) || Pg(e.playreadyLicenseUrl)) && (!("fairplayLicenseUrl" in e) || Pg(e.fairplayLicenseUrl)) && (!("fairplayCertificate" in e) || Pg(e.fairplayCertificate));
7654
+ function Ug(e) {
7655
+ return "provider" in e && typeof e.provider == "string" && (!("widevineLicenseUrl" in e) || Hg(e.widevineLicenseUrl)) && (!("playreadyLicenseUrl" in e) || Hg(e.playreadyLicenseUrl)) && (!("fairplayLicenseUrl" in e) || Hg(e.fairplayLicenseUrl)) && (!("fairplayCertificate" in e) || Hg(e.fairplayCertificate));
7580
7656
  }
7581
- function Ig(e) {
7657
+ function Wg(e) {
7582
7658
  try {
7583
7659
  return we(e);
7584
7660
  } catch (e) {
7585
7661
  throw Error("Failed to convert fairplayCertificate");
7586
7662
  }
7587
7663
  }
7588
- function Lg(e) {
7664
+ function Gg(e) {
7589
7665
  let t = new TextDecoder().decode(e), n = JSON.parse(t);
7590
- if (!Fg(n)) throw Error("Invalid drm object");
7666
+ if (!Ug(n)) throw Error("Invalid drm object");
7591
7667
  let { fairplayCertificate: r } = n;
7592
- return y(y({}, Mg(n, Ng)), {}, { fairplayCertificate: r ? Ig(r) : void 0 });
7668
+ return y(y({}, Bg(n, Vg)), {}, { fairplayCertificate: r ? Wg(r) : void 0 });
7593
7669
  }
7594
- var Rg = class n {
7670
+ var Kg = class n {
7595
7671
  constructor(t) {
7596
7672
  e(this, "value", void 0), this.value = t;
7597
7673
  }
@@ -7599,9 +7675,9 @@ var Rg = class n {
7599
7675
  return t(function* () {
7600
7676
  try {
7601
7677
  var t = rp();
7602
- let a = yield t.a(yield e.subscribeTrack(new Nm().name("drm").build())).objects().next();
7678
+ let a = yield t.a(yield e.subscribeTrack(new Vm().name("drm").build())).objects().next();
7603
7679
  if (a.done) throw Error("No drm object received");
7604
- return new n(y(y({}, Lg(a.value.payload)), {}, {
7680
+ return new n(y(y({}, Gg(a.value.payload)), {}, {
7605
7681
  videoCodec: r,
7606
7682
  audioCodec: i
7607
7683
  }));
@@ -7615,32 +7691,32 @@ var Rg = class n {
7615
7691
  };
7616
7692
  //#endregion
7617
7693
  //#region ../../libs/voq/src/tracks/Stats.ts
7618
- function zg(e) {
7694
+ function qg(e) {
7619
7695
  return "rtt" in e && typeof e.rtt == "number" && "ntpTimestamp" in e && typeof e.ntpTimestamp == "number" && "estimatedBandwidth" in e && typeof e.estimatedBandwidth == "number";
7620
7696
  }
7621
- function Bg(e) {
7697
+ function Jg(e) {
7622
7698
  let t = new TextDecoder().decode(e), n = JSON.parse(t);
7623
- if (!zg(n)) throw Error("Invalid stats object");
7699
+ if (!qg(n)) throw Error("Invalid stats object");
7624
7700
  return n;
7625
7701
  }
7626
- var Vg = /* @__PURE__ */ new WeakMap(), Hg = /* @__PURE__ */ new WeakSet(), Ug = class r {
7702
+ var Yg = /* @__PURE__ */ new WeakMap(), Xg = /* @__PURE__ */ new WeakSet(), Zg = class r {
7627
7703
  constructor(t, r, s) {
7628
- S(this, Hg), e(this, "ip", void 0), e(this, "value", void 0), i(this, Vg, void 0), this.ip = s, this.value = new k(r), a(Vg, this, o(Hg, this, Wg).call(this, t)), this.closed().catch(n);
7704
+ S(this, Xg), e(this, "ip", void 0), e(this, "value", void 0), i(this, Yg, void 0), this.ip = s, this.value = new k(r), a(Yg, this, o(Xg, this, Qg).call(this, t)), this.closed().catch(n);
7629
7705
  }
7630
7706
  closed() {
7631
- return s(Vg, this);
7707
+ return s(Yg, this);
7632
7708
  }
7633
7709
  static start(e) {
7634
7710
  return t(function* () {
7635
- let t = (yield e.subscribe(new Nm().name("stats").groupOrder("ascending").build())).objects(), n = yield t.next();
7711
+ let t = (yield e.subscribe(new Vm().name("stats").groupOrder("ascending").build())).objects(), n = yield t.next();
7636
7712
  if (n.done) throw Error("No stats object received");
7637
- let i = Bg(n.value.payload);
7713
+ let i = Jg(n.value.payload);
7638
7714
  if (!i.ip) throw Error("Expected IP in initial stats object");
7639
7715
  return new r(t, i, i.ip);
7640
7716
  })();
7641
7717
  }
7642
7718
  };
7643
- function Wg(e) {
7719
+ function Qg(e) {
7644
7720
  var n = this;
7645
7721
  return t(function* () {
7646
7722
  var t = !1, r = !1, i;
@@ -7649,7 +7725,7 @@ function Wg(e) {
7649
7725
  let e = o.value;
7650
7726
  {
7651
7727
  if (e.objectStatus !== H.Normal) continue;
7652
- let t = Bg(e.payload);
7728
+ let t = Jg(e.payload);
7653
7729
  n.value.update(t);
7654
7730
  }
7655
7731
  }
@@ -7666,21 +7742,21 @@ function Wg(e) {
7666
7742
  }
7667
7743
  //#endregion
7668
7744
  //#region ../../libs/voq/src/UpstreamWatcher.ts
7669
- var Gg = /* @__PURE__ */ new WeakMap(), Kg = /* @__PURE__ */ new WeakMap(), qg = class {
7745
+ var $g = /* @__PURE__ */ new WeakMap(), e_ = /* @__PURE__ */ new WeakMap(), t_ = class {
7670
7746
  constructor(e) {
7671
- i(this, Gg, b.get().createContext("UpstreamWatcher")), i(this, Kg, void 0), a(Kg, this, new k(C.fromPromise(e.closed())));
7747
+ i(this, $g, b.get().createContext("UpstreamWatcher")), i(this, e_, void 0), a(e_, this, new k(C.fromPromise(e.closed())));
7672
7748
  }
7673
7749
  update(e) {
7674
- s(Kg, this).update(C.fromPromise(e.closed()));
7750
+ s(e_, this).update(C.fromPromise(e.closed()));
7675
7751
  }
7676
7752
  closed() {
7677
7753
  var e = this;
7678
7754
  return t(function* () {
7679
7755
  try {
7680
7756
  for (;;) {
7681
- let [t, n] = s(Kg, e).value(), r = !1;
7757
+ let [t, n] = s(e_, e).value(), r = !1;
7682
7758
  yield Promise.race([n == null ? void 0 : n.then(() => r = !0), t.promise.then(() => {
7683
- if (!r) throw s(Gg, e).warn("Upstream closed"), Error("Upstream closed");
7759
+ if (!r) throw s($g, e).warn("Upstream closed"), Error("Upstream closed");
7684
7760
  })]);
7685
7761
  }
7686
7762
  } catch (e) {
@@ -7688,19 +7764,19 @@ var Gg = /* @__PURE__ */ new WeakMap(), Kg = /* @__PURE__ */ new WeakMap(), qg =
7688
7764
  }
7689
7765
  })();
7690
7766
  }
7691
- }, Jg, Yg = 5e3, Xg = /* @__PURE__ */ new WeakMap(), Zg = /* @__PURE__ */ new WeakMap(), Qg = /* @__PURE__ */ new WeakMap();
7692
- Jg = Symbol.asyncIterator;
7693
- var $g = class {
7767
+ }, n_, r_ = 5e3, i_ = /* @__PURE__ */ new WeakMap(), a_ = /* @__PURE__ */ new WeakMap(), o_ = /* @__PURE__ */ new WeakMap();
7768
+ n_ = Symbol.asyncIterator;
7769
+ var s_ = class {
7694
7770
  constructor(e, t) {
7695
- i(this, Xg, b.get().createContext("TracksIterator")), i(this, Zg, void 0), i(this, Qg, void 0), a(Zg, this, e), a(Qg, this, t);
7771
+ i(this, i_, b.get().createContext("TracksIterator")), i(this, a_, void 0), i(this, o_, void 0), a(a_, this, e), a(o_, this, t);
7696
7772
  }
7697
- [Jg]() {
7773
+ [n_]() {
7698
7774
  var e = this;
7699
7775
  return Ft(function* () {
7700
- let t = s(Qg, e);
7776
+ let t = s(o_, e);
7701
7777
  var n = !1, r = !1, i;
7702
7778
  try {
7703
- for (var a = U(s(Zg, e)), o; n = !(o = yield O(a.next())).done; n = !1) {
7779
+ for (var a = U(s(a_, e)), o; n = !(o = yield O(a.next())).done; n = !1) {
7704
7780
  let n = o.value;
7705
7781
  {
7706
7782
  if (!n) continue;
@@ -7708,7 +7784,7 @@ var $g = class {
7708
7784
  name: n.trackObject.name,
7709
7785
  namespace: n.namespace
7710
7786
  };
7711
- s(Xg, e).debug("track start", y({ mediaType: t }, r)), yield* Zm(U(n)), s(Xg, e).debug("track end", y({ mediaType: t }, r));
7787
+ s(i_, e).debug("track start", y({ mediaType: t }, r)), yield* ah(U(n)), s(i_, e).debug("track end", y({ mediaType: t }, r));
7712
7788
  }
7713
7789
  }
7714
7790
  } catch (e) {
@@ -7720,46 +7796,46 @@ var $g = class {
7720
7796
  if (r) throw i;
7721
7797
  }
7722
7798
  }
7723
- s(Xg, e).debug("tracks ended", { mediaType: t });
7799
+ s(i_, e).debug("tracks ended", { mediaType: t });
7724
7800
  })();
7725
7801
  }
7726
- }, e_ = /* @__PURE__ */ new WeakMap(), t_ = /* @__PURE__ */ new WeakMap(), n_ = /* @__PURE__ */ new WeakMap(), r_ = /* @__PURE__ */ new WeakMap(), Z = /* @__PURE__ */ new WeakMap(), i_ = /* @__PURE__ */ new WeakMap(), a_ = /* @__PURE__ */ new WeakMap(), o_ = /* @__PURE__ */ new WeakMap(), s_ = /* @__PURE__ */ new WeakMap(), c_ = /* @__PURE__ */ new WeakMap(), l_ = /* @__PURE__ */ new WeakSet(), u_ = class r {
7802
+ }, c_ = /* @__PURE__ */ new WeakMap(), l_ = /* @__PURE__ */ new WeakMap(), u_ = /* @__PURE__ */ new WeakMap(), d_ = /* @__PURE__ */ new WeakMap(), Z = /* @__PURE__ */ new WeakMap(), f_ = /* @__PURE__ */ new WeakMap(), p_ = /* @__PURE__ */ new WeakMap(), m_ = /* @__PURE__ */ new WeakMap(), h_ = /* @__PURE__ */ new WeakMap(), g_ = /* @__PURE__ */ new WeakMap(), __ = /* @__PURE__ */ new WeakSet(), v_ = class r {
7727
7803
  constructor(t, r, c) {
7728
- S(this, l_), i(this, e_, void 0), i(this, t_, void 0), i(this, n_, void 0), i(this, r_, b.get().createContext("Player")), i(this, Z, void 0), i(this, i_, new k(void 0)), i(this, a_, new k(void 0)), i(this, o_, new k(void 0)), i(this, s_, void 0), i(this, c_, void 0), e(this, "subtitles", new $g(s(o_, this), "subtitles")), e(this, "video", new $g(s(a_, this), "video")), e(this, "audio", new $g(s(i_, this), "audio")), a(e_, this, t), a(t_, this, kg.start(c)), a(n_, this, c), a(Z, this, new k(r)), a(s_, this, new qg(r)), a(c_, this, Promise.race([
7729
- o(l_, this, h_).call(this),
7730
- o(l_, this, d_).call(this),
7731
- o(l_, this, m_).call(this),
7732
- s(s_, this).closed()
7733
- ])), s(e_, this).closed().then(() => this.close()).catch(n);
7804
+ S(this, __), i(this, c_, void 0), i(this, l_, void 0), i(this, u_, void 0), i(this, d_, b.get().createContext("Player")), i(this, Z, void 0), i(this, f_, new k(void 0)), i(this, p_, new k(void 0)), i(this, m_, new k(void 0)), i(this, h_, void 0), i(this, g_, void 0), e(this, "subtitles", new s_(s(m_, this), "subtitles")), e(this, "video", new s_(s(p_, this), "video")), e(this, "audio", new s_(s(f_, this), "audio")), a(c_, this, t), a(l_, this, Lg.start(c)), a(u_, this, c), a(Z, this, new k(r)), a(h_, this, new t_(r)), a(g_, this, Promise.race([
7805
+ o(__, this, C_).call(this),
7806
+ o(__, this, y_).call(this),
7807
+ o(__, this, S_).call(this),
7808
+ s(h_, this).closed()
7809
+ ])), s(c_, this).closed().then(() => this.close()).catch(n);
7734
7810
  }
7735
7811
  closed() {
7736
- return s(c_, this);
7812
+ return s(g_, this);
7737
7813
  }
7738
7814
  static start(e, n) {
7739
7815
  return t(function* () {
7740
7816
  let t = /* @__PURE__ */ new Map();
7741
7817
  if (n.burstMs !== void 0) {
7742
- let e = Tg(n.burstMs);
7818
+ let e = Ng(n.burstMs);
7743
7819
  t.set(e.type, e);
7744
7820
  }
7745
- let i = new Im(e, { namespace: Lm("auxiliary") }), [[a, o, c], l] = yield Promise.all([xg.start(e, n).then((e) => Promise.all([
7821
+ let i = new Wm(e, { namespace: Gm("auxiliary") }), [[a, o, c], l] = yield Promise.all([kg.start(e, n).then((e) => Promise.all([
7746
7822
  Promise.resolve(e),
7747
7823
  n.videoTrack ? e.subscribeCmafTrack(n.videoTrack, { params: t }) : void 0,
7748
7824
  n.audioTrack ? e.subscribeCmafTrack(n.audioTrack, { params: t }) : void 0
7749
- ])), Ug.start(i)]), u = new r(e, a, l);
7750
- return c && s(i_, u).update(c), o && s(a_, u).update(o), u;
7825
+ ])), Zg.start(i)]), u = new r(e, a, l);
7826
+ return c && s(f_, u).update(c), o && s(p_, u).update(o), u;
7751
7827
  })();
7752
7828
  }
7753
7829
  connectionInfo() {
7754
- let e = s(n_, this).value.current();
7830
+ let e = s(u_, this).value.current();
7755
7831
  return {
7756
- ip: s(n_, this).ip,
7832
+ ip: s(u_, this).ip,
7757
7833
  rtt: e.rtt,
7758
7834
  estimatedBandwidth: e.estimatedBandwidth
7759
7835
  };
7760
7836
  }
7761
7837
  stats() {
7762
- return s(n_, this).value;
7838
+ return s(u_, this).value;
7763
7839
  }
7764
7840
  catalog() {
7765
7841
  return s(Z, this).current().catalog();
@@ -7769,48 +7845,48 @@ var $g = class {
7769
7845
  }
7770
7846
  videoTrack() {
7771
7847
  var e;
7772
- return (e = s(a_, this).current()) == null ? void 0 : e.trackObject;
7848
+ return (e = s(p_, this).current()) == null ? void 0 : e.trackObject;
7773
7849
  }
7774
7850
  audioTrack() {
7775
7851
  var e;
7776
- return (e = s(i_, this).current()) == null ? void 0 : e.trackObject;
7852
+ return (e = s(f_, this).current()) == null ? void 0 : e.trackObject;
7777
7853
  }
7778
7854
  referenceClock() {
7779
- return s(t_, this);
7855
+ return s(l_, this);
7780
7856
  }
7781
7857
  drm() {
7782
7858
  var e = this;
7783
7859
  return t(function* () {
7784
7860
  var t, n;
7785
- if (e.catalog().current().tracks.find(({ name: e }) => e === "drm")) return Rg.create(s(Z, e).current(), (t = e.videoTrack()) == null ? void 0 : t.codec, (n = e.audioTrack()) == null ? void 0 : n.codec);
7861
+ if (e.catalog().current().tracks.find(({ name: e }) => e === "drm")) return Kg.create(s(Z, e).current(), (t = e.videoTrack()) == null ? void 0 : t.codec, (n = e.audioTrack()) == null ? void 0 : n.codec);
7786
7862
  })();
7787
7863
  }
7788
7864
  close() {
7789
- return s(r_, this).info("Enter 'close'"), Promise.all([
7865
+ return s(d_, this).info("Enter 'close'"), Promise.all([
7790
7866
  s(Z, this).current().close(),
7791
7867
  s(Z, this).close(),
7792
- o(l_, this, f_).call(this, s(i_, this)),
7793
- o(l_, this, f_).call(this, s(a_, this)),
7794
- o(l_, this, f_).call(this, s(o_, this))
7868
+ o(__, this, b_).call(this, s(f_, this)),
7869
+ o(__, this, b_).call(this, s(p_, this)),
7870
+ o(__, this, b_).call(this, s(m_, this))
7795
7871
  ]);
7796
7872
  }
7797
7873
  zap(e, n) {
7798
7874
  var r = this;
7799
7875
  return t(function* () {
7800
- s(r_, r).info("Enter 'zap'", {
7876
+ s(d_, r).info("Enter 'zap'", {
7801
7877
  config: e,
7802
7878
  zapOffsetMs: n
7803
7879
  });
7804
- let t = yield xg.start(s(e_, r), e), i = s(t_, r).wallclock() - n, a = s(Z, r).current(), o = a.timestampWallclockOffset(), c = yield t.waitForWallclockTime(i);
7805
- s(s_, r).update(t), yield s(Z, r).current().close();
7880
+ let t = yield kg.start(s(c_, r), e), i = s(l_, r).wallclock() - n, a = s(Z, r).current(), o = a.timestampWallclockOffset(), c = yield t.waitForWallclockTime(i);
7881
+ s(h_, r).update(t), yield s(Z, r).current().close();
7806
7882
  let l = c.toReversed().find((e) => e.wallclock <= i), u = l != null && l.mediaPts ? l.mediaPts - a.timestampOffsetMs() : void 0, d = t.timestampWallclockOffset() - o + a.timestampOffsetMs();
7807
7883
  t.setTimestampOffsetMs(d);
7808
7884
  let f = (l == null ? void 0 : l.groupId) !== void 0 && !Number.isNaN(l.groupId) ? T(l.groupId) : void 0;
7809
7885
  if (u) {
7810
7886
  var p, m;
7811
- (p = s(a_, r).current()) == null || p.stopAfterTimestampReached(u), (m = s(i_, r).current()) == null || m.stopAfterTimestampReached(u);
7887
+ (p = s(p_, r).current()) == null || p.stopAfterTimestampReached(u), (m = s(f_, r).current()) == null || m.stopAfterTimestampReached(u);
7812
7888
  }
7813
- s(Z, r).update(t), yield Promise.all([e.videoTrack ? r.setVideoTrack(e.videoTrack, f) : void 0, e.audioTrack ? r.setAudioTrack(e.audioTrack, f) : void 0]), s(r_, r).info("Return 'zap'");
7889
+ s(Z, r).update(t), yield Promise.all([e.videoTrack ? r.setVideoTrack(e.videoTrack, f) : void 0, e.audioTrack ? r.setAudioTrack(e.audioTrack, f) : void 0]), s(d_, r).info("Return 'zap'");
7814
7890
  })();
7815
7891
  }
7816
7892
  setSubtitleTrack(e) {
@@ -7819,49 +7895,49 @@ var $g = class {
7819
7895
  var t;
7820
7896
  if (!e) {
7821
7897
  var r;
7822
- yield (r = s(o_, n).current()) == null ? void 0 : r.unsubscribe();
7898
+ yield (r = s(m_, n).current()) == null ? void 0 : r.unsubscribe();
7823
7899
  return;
7824
7900
  }
7825
- let [i] = yield Promise.all([s(Z, n).current().subscribeWebVttTrack(e), (t = s(o_, n).current()) == null ? void 0 : t.unsubscribe()]);
7826
- s(o_, n).update(i);
7901
+ let [i] = yield Promise.all([s(Z, n).current().subscribeWebVttTrack(e), (t = s(m_, n).current()) == null ? void 0 : t.unsubscribe()]);
7902
+ s(m_, n).update(i);
7827
7903
  })();
7828
7904
  }
7829
7905
  setVideoTrack(e, n) {
7830
7906
  var r = this;
7831
7907
  return t(function* () {
7832
- let t = yield o(l_, r, p_).call(r, s(Z, r).current(), e, s(a_, r).current(), n);
7833
- s(a_, r).update(t);
7908
+ let t = yield o(__, r, x_).call(r, s(Z, r).current(), e, s(p_, r).current(), n);
7909
+ s(p_, r).update(t);
7834
7910
  })();
7835
7911
  }
7836
7912
  setAudioTrack(e, n) {
7837
7913
  var r = this;
7838
7914
  return t(function* () {
7839
- let t = yield o(l_, r, p_).call(r, s(Z, r).current(), e, s(i_, r).current(), n);
7840
- s(i_, r).update(t);
7915
+ let t = yield o(__, r, x_).call(r, s(Z, r).current(), e, s(f_, r).current(), n);
7916
+ s(f_, r).update(t);
7841
7917
  })();
7842
7918
  }
7843
7919
  };
7844
- function d_() {
7920
+ function y_() {
7845
7921
  var e = this;
7846
7922
  return t(function* () {
7847
7923
  let t = !1;
7848
- for (s(e_, e).closed().then(() => {
7924
+ for (s(c_, e).closed().then(() => {
7849
7925
  t = !0;
7850
7926
  }).catch(n);;) {
7851
- let n = performance.now() - s(e_, e).lastReceived();
7852
- if (n >= Yg) return t ? void 0 : /* @__PURE__ */ Error("Idle timeout");
7853
- if (yield rn(Yg - n), t) return;
7927
+ let n = performance.now() - s(c_, e).lastReceived();
7928
+ if (n >= r_) return t ? void 0 : /* @__PURE__ */ Error("Idle timeout");
7929
+ if (yield rn(r_ - n), t) return;
7854
7930
  }
7855
7931
  })();
7856
7932
  }
7857
- function f_(e) {
7933
+ function b_(e) {
7858
7934
  let t = e.current(), n = t == null ? void 0 : t.largestGroupId();
7859
7935
  return e.isClosed() || e.update(void 0), e.close(), n === void 0 ? t == null ? void 0 : t.unsubscribe() : t == null ? void 0 : t.update(n, n);
7860
7936
  }
7861
- function p_(e, n, r, i) {
7937
+ function x_(e, n, r, i) {
7862
7938
  var a = this;
7863
7939
  return t(function* () {
7864
- s(r_, a).info("Enter '#replaceTrack'", {
7940
+ s(d_, a).info("Enter '#replaceTrack'", {
7865
7941
  trackObject: n,
7866
7942
  startGroupId: i
7867
7943
  });
@@ -7869,7 +7945,7 @@ function p_(e, n, r, i) {
7869
7945
  return o;
7870
7946
  })();
7871
7947
  }
7872
- function m_() {
7948
+ function S_() {
7873
7949
  var e = this;
7874
7950
  return t(function* () {
7875
7951
  var t = !1, n = !1, r;
@@ -7880,7 +7956,7 @@ function m_() {
7880
7956
  try {
7881
7957
  for (var d = U(t.catalog()), f; c = !(f = yield d.next()).done; c = !1) {
7882
7958
  let t = f.value;
7883
- yield Promise.all([o(l_, e, g_).call(e, t, s(a_, e)), o(l_, e, g_).call(e, t, s(i_, e))]);
7959
+ yield Promise.all([o(__, e, w_).call(e, t, s(p_, e)), o(__, e, w_).call(e, t, s(f_, e))]);
7884
7960
  }
7885
7961
  } catch (e) {
7886
7962
  l = !0, u = e;
@@ -7903,17 +7979,17 @@ function m_() {
7903
7979
  }
7904
7980
  })();
7905
7981
  }
7906
- function h_() {
7982
+ function C_() {
7907
7983
  var e = this;
7908
7984
  return t(function* () {
7909
7985
  try {
7910
- return yield s(n_, e).closed(), /* @__PURE__ */ Error("Stats closed");
7986
+ return yield s(u_, e).closed(), /* @__PURE__ */ Error("Stats closed");
7911
7987
  } catch (e) {
7912
7988
  return e;
7913
7989
  }
7914
7990
  })();
7915
7991
  }
7916
- function g_(e, n) {
7992
+ function w_(e, n) {
7917
7993
  var r = this;
7918
7994
  return t(function* () {
7919
7995
  let t = n.current();
@@ -7930,11 +8006,11 @@ function g_(e, n) {
7930
8006
  }
7931
8007
  //#endregion
7932
8008
  //#region ../../libs/web-sdk/src/resolveEdgeUrl.ts
7933
- var __ = (e, t) => {
8009
+ var T_ = (e, t) => {
7934
8010
  var n, r;
7935
8011
  let i = new URL("/subscribe", e);
7936
8012
  return i.searchParams.append("channelId", t.channelId), i.searchParams.append("sessionId", t.sessionId), i.searchParams.append("clientId", t.clientId), (n = t.audio) != null && n.codec && (i.searchParams.append("audio.bitRate", Math.round(t.audio.bitRate).toString()), i.searchParams.append("audio.codec", t.audio.codec), t.audio.language && i.searchParams.append("audio.language", t.audio.language)), (r = t.video) != null && r.codec && (i.searchParams.append("video.width", t.video.width.toString()), i.searchParams.append("video.height", t.video.height.toString()), i.searchParams.append("video.bitRate", Math.round(t.video.bitRate).toString()), i.searchParams.append("video.codec", t.video.codec)), t.burstMs && i.searchParams.append("burstMs", t.burstMs.toString()), t.channelGroupId && i.searchParams.append("channelGroupId", t.channelGroupId), t.authToken && (i.searchParams.append("auth.token", t.authToken), i.searchParams.append("auth.type", "jwt")), i.toString();
7937
- }, v_ = (e) => {
8013
+ }, E_ = (e) => {
7938
8014
  try {
7939
8015
  return e ? new URL(e).origin : void 0;
7940
8016
  } catch (e) {
@@ -7943,11 +8019,11 @@ var __ = (e, t) => {
7943
8019
  };
7944
8020
  //#endregion
7945
8021
  //#region ../../libs/web-sdk/src/adapters/MoqConnectionAdapter.ts
7946
- function y_(e, t, n) {
8022
+ function D_(e, t, n) {
7947
8023
  let r = new URL("/voq/subscribe", e);
7948
8024
  return r.searchParams.set("sessionId", t.sessionId), r.searchParams.set("clientId", t.clientId), r.searchParams.set("channelId", t.channelId), n && r.searchParams.set("authToken", n), r;
7949
8025
  }
7950
- function b_(e, t) {
8026
+ function O_(e, t) {
7951
8027
  let n = [];
7952
8028
  for (let r of e == null ? [] : e) try {
7953
8029
  n.push({
@@ -7962,70 +8038,70 @@ function b_(e, t) {
7962
8038
  }
7963
8039
  return n.length > 0 ? n : void 0;
7964
8040
  }
7965
- var x_ = 1e4, Q = /* @__PURE__ */ new WeakMap(), S_ = /* @__PURE__ */ new WeakMap(), C_ = /* @__PURE__ */ new WeakMap(), w_ = /* @__PURE__ */ new WeakMap(), $ = /* @__PURE__ */ new WeakMap(), T_ = /* @__PURE__ */ new WeakMap(), E_ = /* @__PURE__ */ new WeakMap(), D_ = /* @__PURE__ */ new WeakMap(), O_ = /* @__PURE__ */ new WeakMap(), k_ = /* @__PURE__ */ new WeakMap(), A_ = /* @__PURE__ */ new WeakMap(), j_ = /* @__PURE__ */ new WeakSet(), M_ = /* @__PURE__ */ new WeakMap(), N_ = /* @__PURE__ */ new WeakMap(), P_ = /* @__PURE__ */ new WeakMap(), F_ = class r {
8041
+ var k_ = 1e4, Q = /* @__PURE__ */ new WeakMap(), A_ = /* @__PURE__ */ new WeakMap(), j_ = /* @__PURE__ */ new WeakMap(), M_ = /* @__PURE__ */ new WeakMap(), $ = /* @__PURE__ */ new WeakMap(), N_ = /* @__PURE__ */ new WeakMap(), P_ = /* @__PURE__ */ new WeakMap(), F_ = /* @__PURE__ */ new WeakMap(), I_ = /* @__PURE__ */ new WeakMap(), L_ = /* @__PURE__ */ new WeakMap(), R_ = /* @__PURE__ */ new WeakMap(), z_ = /* @__PURE__ */ new WeakSet(), B_ = /* @__PURE__ */ new WeakMap(), V_ = /* @__PURE__ */ new WeakMap(), H_ = /* @__PURE__ */ new WeakMap(), U_ = class r {
7966
8042
  get estimatedBandwidth() {
7967
- return s(O_, this);
8043
+ return s(I_, this);
7968
8044
  }
7969
8045
  unload() {
7970
- s(Q, this).off("send signal", s(N_, this)), s(Q, this).off("disconnect", this.disconnect), s(Q, this).off("text track", s(M_, this)), this.disconnect();
8046
+ s(Q, this).off("send signal", s(V_, this)), s(Q, this).off("disconnect", this.disconnect), s(Q, this).off("text track", s(B_, this)), this.disconnect();
7971
8047
  }
7972
8048
  suspend() {}
7973
8049
  unsuspend() {}
7974
8050
  getStatistics() {
7975
- let e = s(C_, this).transportType() === "webtransport" ? "moq" : "moq_ws";
8051
+ let e = s(j_, this).transportType() === "webtransport" ? "moq" : "moq_ws";
7976
8052
  return {
7977
- edgeUrl: v_(s(C_, this).url()),
8053
+ edgeUrl: E_(s(j_, this).url()),
7978
8054
  connectionProtocol: e,
7979
- transportSelectionReason: s(k_, this)
8055
+ transportSelectionReason: s(L_, this)
7980
8056
  };
7981
8057
  }
7982
8058
  constructor(t, r, c, l, u, d, f, p) {
7983
- S(this, j_), i(this, Q, void 0), i(this, S_, void 0), i(this, C_, void 0), i(this, w_, "disconnected"), i(this, $, void 0), i(this, T_, /* @__PURE__ */ new Map()), i(this, E_, void 0), i(this, D_, void 0), i(this, O_, void 0), i(this, k_, void 0), i(this, A_, /* @__PURE__ */ new Map()), i(this, M_, (e) => {
8059
+ S(this, z_), i(this, Q, void 0), i(this, A_, void 0), i(this, j_, void 0), i(this, M_, "disconnected"), i(this, $, void 0), i(this, N_, /* @__PURE__ */ new Map()), i(this, P_, void 0), i(this, F_, void 0), i(this, I_, void 0), i(this, L_, void 0), i(this, R_, /* @__PURE__ */ new Map()), i(this, B_, (e) => {
7984
8060
  if (!e) {
7985
8061
  s($, this).setSubtitleTrack(void 0).catch(n);
7986
8062
  return;
7987
8063
  }
7988
- let t = s(T_, this).get(Rm(s($, this).namespace())), r = t == null ? void 0 : t.getTextTrack(e);
8064
+ let t = s(N_, this).get(Km(s($, this).namespace())), r = t == null ? void 0 : t.getTextTrack(e);
7989
8065
  r && s($, this).setSubtitleTrack(r).catch(n);
7990
- }), i(this, N_, (e) => {
8066
+ }), i(this, V_, (e) => {
7991
8067
  switch (e.type) {
7992
8068
  case "subscribe":
7993
- if (s(P_, this)) {
7994
- s(S_, this).info("Ignoring - we are already switching");
8069
+ if (s(H_, this)) {
8070
+ s(A_, this).info("Ignoring - we are already switching");
7995
8071
  return;
7996
8072
  }
7997
- a(P_, this, !0), o(j_, this, R_).call(this, e.subscription).catch((t) => {
7998
- s(S_, this).error("error handling subscription", t), s(Q, this).emit("received signal", {
8073
+ a(H_, this, !0), o(z_, this, K_).call(this, e.subscription).catch((t) => {
8074
+ s(A_, this).error("error handling subscription", t), s(Q, this).emit("received signal", {
7999
8075
  type: "subscription changed",
8000
8076
  subscription: e.subscription,
8001
8077
  reset: !0
8002
8078
  });
8003
- }).finally(() => a(P_, this, !1));
8079
+ }).finally(() => a(H_, this, !1));
8004
8080
  break;
8005
8081
  case "telemetry":
8006
- m(new URL("/api/telemetry", s(C_, this).url().replace("wss://", "https://")), {
8082
+ m(new URL("/api/telemetry", s(j_, this).url().replace("wss://", "https://")), {
8007
8083
  body: e.body,
8008
8084
  headers: { "Content-Type": "text/plain" }
8009
8085
  }).catch(n);
8010
8086
  break;
8011
8087
  case "refresh auth":
8012
- s(C_, this).updateAuthToken(e.token);
8088
+ s(j_, this).updateAuthToken(e.token);
8013
8089
  break;
8014
8090
  }
8015
- }), i(this, P_, !1), e(this, "disconnect", (e = "Disconnect Requested") => {
8016
- s(S_, this).info("Disconnecting", e), s(C_, this).close(), s($, this).close().catch(n), a(A_, this, /* @__PURE__ */ new Map()), o(j_, this, z_).call(this, "disconnected");
8017
- }), a(Q, this, t), a(S_, this, r), a(C_, this, c), a($, this, l), a(T_, this, u), a(E_, this, d), a(D_, this, f), a(k_, this, p), s(Q, this).on("send signal", s(N_, this)), s(Q, this).on("disconnect", this.disconnect), s(Q, this).on("text track", s(M_, this)), o(j_, this, I_).call(this).catch(n), o(j_, this, B_).call(this).catch(n);
8091
+ }), i(this, H_, !1), e(this, "disconnect", (e = "Disconnect Requested") => {
8092
+ s(A_, this).info("Disconnecting", e), s(j_, this).close(), s($, this).close().catch(n), a(R_, this, /* @__PURE__ */ new Map()), o(z_, this, q_).call(this, "disconnected");
8093
+ }), a(Q, this, t), a(A_, this, r), a(j_, this, c), a($, this, l), a(N_, this, u), a(P_, this, d), a(F_, this, f), a(L_, this, p), s(Q, this).on("send signal", s(V_, this)), s(Q, this).on("disconnect", this.disconnect), s(Q, this).on("text track", s(B_, this)), o(z_, this, W_).call(this).catch(n), o(z_, this, J_).call(this).catch(n);
8018
8094
  }
8019
8095
  static start(e, n, i, a, o) {
8020
8096
  return t(function* () {
8021
8097
  var t, c, l, u;
8022
- let f = new Map(a.connectInfo.channels.map((e) => [Rm(e.catalog.namespace), new q_(new k(e.catalog))])), p = yield a.onConnectInfo(a.connectInfo), m = a.options.get("authenticationToken"), h, g, ee;
8098
+ let f = new Map(a.connectInfo.channels.map((e) => [Km(e.catalog.namespace), new tv(new k(e.catalog))])), p = yield a.onConnectInfo(a.connectInfo), m = a.options.get("authenticationToken"), h, g, ee;
8023
8099
  switch (typeof a.edgeUrl) {
8024
8100
  case "string":
8025
- h = y_(a.edgeUrl, p, m);
8101
+ h = D_(a.edgeUrl, p, m);
8026
8102
  break;
8027
8103
  default:
8028
- h = y_(a.edgeUrl.moqUrl || a.edgeUrl.moqWsUrl, p, m), g = y_(a.edgeUrl.moqWsUrl, p, m), ee = b_(a.edgeUrl.serverCertificateHashes, n);
8104
+ h = D_(a.edgeUrl.moqUrl || a.edgeUrl.moqWsUrl, p, m), g = D_(a.edgeUrl.moqWsUrl, p, m), ee = O_(a.edgeUrl.serverCertificateHashes, n);
8029
8105
  break;
8030
8106
  }
8031
8107
  let _ = (t = a.connectInfo.channels.find((e) => e.channelId === p.channelId)) == null ? void 0 : t.catalog;
@@ -8033,9 +8109,9 @@ var x_ = 1e4, Q = /* @__PURE__ */ new WeakMap(), S_ = /* @__PURE__ */ new WeakMa
8033
8109
  edgeUrl: h,
8034
8110
  edgeWsUrl: g
8035
8111
  }), d(_, "no catalog found");
8036
- let te = (c = f.get(Rm(_.namespace))) == null ? void 0 : c.getVideoTrack(p.video), v = (l = f.get(Rm(_.namespace))) == null ? void 0 : l.getAudioTrack(p.audio), ne;
8112
+ let te = (c = f.get(Km(_.namespace))) == null ? void 0 : c.getVideoTrack(p.video), v = (l = f.get(Km(_.namespace))) == null ? void 0 : l.getAudioTrack(p.audio), ne;
8037
8113
  try {
8038
- ne = yield Am({
8114
+ ne = yield Rm({
8039
8115
  url: h,
8040
8116
  wsUrl: g,
8041
8117
  serverCertificateHashes: ee,
@@ -8055,21 +8131,21 @@ var x_ = 1e4, Q = /* @__PURE__ */ new WeakMap(), S_ = /* @__PURE__ */ new WeakMa
8055
8131
  }), x;
8056
8132
  try {
8057
8133
  x = yield Promise.race([
8058
- u_.start(re.subscriber, {
8134
+ v_.start(re.subscriber, {
8059
8135
  namespace: _.namespace,
8060
8136
  catalog: _,
8061
8137
  videoTrack: te == null ? void 0 : te.track,
8062
8138
  audioTrack: v == null ? void 0 : v.track,
8063
8139
  burstMs: p.burstMs || 0
8064
8140
  }),
8065
- an(x_, /* @__PURE__ */ Error("Timeout waiting for player to start")),
8141
+ an(k_, /* @__PURE__ */ Error("Timeout waiting for player to start")),
8066
8142
  b
8067
8143
  ]);
8068
8144
  } catch (e) {
8069
8145
  throw re.close(), e;
8070
8146
  }
8071
- let ie = new q_(x.catalog());
8072
- f.set(Rm(_.namespace), ie), e.emit("received signal", {
8147
+ let ie = new tv(x.catalog());
8148
+ f.set(Km(_.namespace), ie), e.emit("received signal", {
8073
8149
  type: "client ip",
8074
8150
  ip: x.connectionInfo().ip
8075
8151
  }), x.drm().then((t) => {
@@ -8078,28 +8154,28 @@ var x_ = 1e4, Q = /* @__PURE__ */ new WeakMap(), S_ = /* @__PURE__ */ new WeakMa
8078
8154
  n.error("Error getting DRM data", e);
8079
8155
  });
8080
8156
  let S = new r(e, n, re, x, f, i, o, y);
8081
- return p.textTrack && s(M_, S).call(S, p.textTrack), S;
8157
+ return p.textTrack && s(B_, S).call(S, p.textTrack), S;
8082
8158
  })();
8083
8159
  }
8084
8160
  getState() {
8085
- return s(w_, this);
8161
+ return s(M_, this);
8086
8162
  }
8087
8163
  close() {
8088
- s(C_, this).close();
8164
+ s(j_, this).close();
8089
8165
  }
8090
8166
  closed() {
8091
- return Promise.race([s(C_, this).closed(), s($, this).closed()]);
8167
+ return Promise.race([s(j_, this).closed(), s($, this).closed()]);
8092
8168
  }
8093
8169
  };
8094
- function I_() {
8170
+ function W_() {
8095
8171
  var e = this;
8096
8172
  return t(function* () {
8097
- s(C_, e).transportType() === "websocket" && (yield rn(5e3));
8173
+ s(j_, e).transportType() === "websocket" && (yield rn(5e3));
8098
8174
  var t = !1, n = !1, r;
8099
8175
  try {
8100
8176
  for (var i = U(s($, e).stats()), o; t = !(o = yield i.next()).done; t = !1) {
8101
8177
  let { rtt: t, estimatedBandwidth: n } = o.value;
8102
- a(O_, e, n), s(D_, e).push(t), s(Q, e).emit("rtt", mt(s(D_, e).items()));
8178
+ a(I_, e, n), s(F_, e).push(t), s(Q, e).emit("rtt", mt(s(F_, e).items()));
8103
8179
  }
8104
8180
  } catch (e) {
8105
8181
  n = !0, r = e;
@@ -8112,26 +8188,26 @@ function I_() {
8112
8188
  }
8113
8189
  })();
8114
8190
  }
8115
- function L_(e) {
8191
+ function G_(e) {
8116
8192
  var n = this;
8117
8193
  return t(function* () {
8118
8194
  var t;
8119
- let r = yield s(E_, n).connect({ channelId: e });
8195
+ let r = yield s(P_, n).connect({ channelId: e });
8120
8196
  if (!c(r)) throw Error("no moq connect info found");
8121
8197
  let i = (t = r.channels.find((t) => t.channelId === e)) == null ? void 0 : t.catalog;
8122
8198
  if (!i) throw Error("no catalog found");
8123
8199
  return i;
8124
8200
  })();
8125
8201
  }
8126
- function R_(e) {
8202
+ function K_(e) {
8127
8203
  var n = this;
8128
8204
  return t(function* () {
8129
8205
  var t, r;
8130
- s(S_, n).info("handle subscription", e);
8131
- let i = s($, n), a = s(T_, n).get(e.channelId);
8132
- if (a || (a = new q_(new k(yield o(j_, n, L_).call(n, e.channelId))), s(T_, n).set(e.channelId, a)), i.namespace().join("/") !== a.namespace().join("/")) {
8206
+ s(A_, n).info("handle subscription", e);
8207
+ let i = s($, n), a = s(N_, n).get(e.channelId);
8208
+ if (a || (a = new tv(new k(yield o(z_, n, G_).call(n, e.channelId))), s(N_, n).set(e.channelId, a)), i.namespace().join("/") !== a.namespace().join("/")) {
8133
8209
  var c;
8134
- s(S_, n).info("changing channel", e.channelId);
8210
+ s(A_, n).info("changing channel", e.channelId);
8135
8211
  let t = a.getVideoTrack(e.video), r = a.getAudioTrack(e.audio);
8136
8212
  yield i.zap({
8137
8213
  namespace: a.namespace(),
@@ -8141,8 +8217,8 @@ function R_(e) {
8141
8217
  }, 500), i.drm().then((e) => {
8142
8218
  e && s(Q, n).emit("received drm data", e.value);
8143
8219
  }).catch((e) => {
8144
- s(S_, n).error("Error getting DRM data", e);
8145
- }), s(S_, n).info("switched channel", e.channelId), (c = s(T_, n).get(Rm(i.namespace()))) == null || c.updateCatalog(i.catalog()), s(Q, n).emit("received signal", {
8220
+ s(A_, n).error("Error getting DRM data", e);
8221
+ }), s(A_, n).info("switched channel", e.channelId), (c = s(N_, n).get(Km(i.namespace()))) == null || c.updateCatalog(i.catalog()), s(Q, n).emit("received signal", {
8146
8222
  type: "subscription changed",
8147
8223
  subscription: e
8148
8224
  });
@@ -8155,26 +8231,26 @@ function R_(e) {
8155
8231
  });
8156
8232
  })();
8157
8233
  }
8158
- function z_(e) {
8159
- a(w_, this, e), s(Q, this).emit("connection state", e);
8234
+ function q_(e) {
8235
+ a(M_, this, e), s(Q, this).emit("connection state", e);
8160
8236
  }
8161
- function B_() {
8237
+ function J_() {
8162
8238
  var e = this;
8163
8239
  return t(function* () {
8164
8240
  try {
8165
- o(j_, e, z_).call(e, "connecting"), s(S_, e).info("Connecting..."), o(j_, e, z_).call(e, "connected"), yield Promise.all([
8166
- o(j_, e, H_).call(e, s($, e).referenceClock(), s($, e).audio),
8167
- o(j_, e, H_).call(e, s($, e).referenceClock(), s($, e).video),
8168
- o(j_, e, V_).call(e, s($, e).subtitles)
8169
- ]), yield s($, e).closed(), s(C_, e).close(), s(S_, e).info("Session closed");
8241
+ o(z_, e, q_).call(e, "connecting"), s(A_, e).info("Connecting..."), o(z_, e, q_).call(e, "connected"), yield Promise.all([
8242
+ o(z_, e, X_).call(e, s($, e).referenceClock(), s($, e).audio),
8243
+ o(z_, e, X_).call(e, s($, e).referenceClock(), s($, e).video),
8244
+ o(z_, e, Y_).call(e, s($, e).subtitles)
8245
+ ]), yield s($, e).closed(), s(j_, e).close(), s(A_, e).info("Session closed");
8170
8246
  } catch (t) {
8171
- s(S_, e).warn("Session error", t), s(C_, e).close();
8247
+ s(A_, e).warn("Session error", t), s(j_, e).close();
8172
8248
  } finally {
8173
- o(j_, e, z_).call(e, "disconnected");
8249
+ o(z_, e, q_).call(e, "disconnected");
8174
8250
  }
8175
8251
  })();
8176
8252
  }
8177
- function V_(e) {
8253
+ function Y_(e) {
8178
8254
  var n = this;
8179
8255
  return t(function* () {
8180
8256
  var t = !1, r = !1, i;
@@ -8194,7 +8270,7 @@ function V_(e) {
8194
8270
  }
8195
8271
  })();
8196
8272
  }
8197
- function H_(e, n) {
8273
+ function X_(e, n) {
8198
8274
  var r = this;
8199
8275
  return t(function* () {
8200
8276
  let t = "", i = "", a, o = s($, r).videoTrack() === void 0;
@@ -8204,7 +8280,7 @@ function H_(e, n) {
8204
8280
  let n = f.value;
8205
8281
  {
8206
8282
  var m;
8207
- let c = Rm(n.track.namespace), l = n.track.trackObject.language, u = p((m = n.track.trackObject.codec) == null ? "" : m), d = n.track.trackObject.codec, f = u ? cn({
8283
+ let c = Km(n.track.namespace), l = n.track.trackObject.language, u = p((m = n.track.trackObject.codec) == null ? "" : m), d = n.track.trackObject.codec, f = u ? cn({
8208
8284
  codec: u,
8209
8285
  codecString: d
8210
8286
  }) : void 0, v = !!n.track.trackObject["com.vindral.drm"];
@@ -8219,11 +8295,11 @@ function H_(e, n) {
8219
8295
  drmTransition: a !== void 0 && a !== v
8220
8296
  };
8221
8297
  t = c, i = l, a = v;
8222
- let g = m.producerReferenceTime(), ee = s(A_, r).get(n.track.namespace), _ = performance.now();
8298
+ let g = m.producerReferenceTime(), ee = s(R_, r).get(n.track.namespace), _ = performance.now();
8223
8299
  if (g && (ee === void 0 || _ - ee > 1e3)) {
8224
- s(A_, r).set(n.track.namespace, _);
8300
+ s(R_, r).set(n.track.namespace, _);
8225
8301
  let t = e.wallclock() - g.getTime();
8226
- s(S_, r).debug("timing-info", {
8302
+ s(A_, r).debug("timing-info", {
8227
8303
  mediaType: m.mediaType(),
8228
8304
  referenceClock: e,
8229
8305
  delta: t,
@@ -8247,7 +8323,7 @@ function H_(e, n) {
8247
8323
  codec: u,
8248
8324
  codecString: d,
8249
8325
  switchInfo: h,
8250
- renditionId: U_(n.track.trackObject.name)
8326
+ renditionId: Z_(n.track.trackObject.name)
8251
8327
  });
8252
8328
  }
8253
8329
  }
@@ -8273,48 +8349,48 @@ function H_(e, n) {
8273
8349
  }
8274
8350
  })();
8275
8351
  }
8276
- function U_(e) {
8352
+ function Z_(e) {
8277
8353
  return e.split("").reduce((e, t) => e = t.charCodeAt(0) + (e << 6) + (e << 16) - e, 0);
8278
8354
  }
8279
- var W_ = /* @__PURE__ */ new WeakMap(), G_ = /* @__PURE__ */ new WeakMap(), K_ = /* @__PURE__ */ new WeakSet(), q_ = class {
8355
+ var Q_ = /* @__PURE__ */ new WeakMap(), $_ = /* @__PURE__ */ new WeakMap(), ev = /* @__PURE__ */ new WeakSet(), tv = class {
8280
8356
  constructor(e) {
8281
- S(this, K_), i(this, W_, void 0), i(this, G_, void 0), a(W_, this, e), a(G_, this, o(K_, this, J_).call(this));
8357
+ S(this, ev), i(this, Q_, void 0), i(this, $_, void 0), a(Q_, this, e), a($_, this, o(ev, this, nv).call(this));
8282
8358
  }
8283
8359
  catalog() {
8284
- return s(W_, this).current();
8360
+ return s(Q_, this).current();
8285
8361
  }
8286
8362
  namespace() {
8287
- return s(W_, this).current().namespace;
8363
+ return s(Q_, this).current().namespace;
8288
8364
  }
8289
8365
  updateCatalog(e) {
8290
- a(W_, this, e);
8366
+ a(Q_, this, e);
8291
8367
  }
8292
8368
  getTextTrack(e) {
8293
- return s(W_, this).current().tracks.find((t) => t.label === e);
8369
+ return s(Q_, this).current().tracks.find((t) => t.label === e);
8294
8370
  }
8295
8371
  getAudioTrack(e) {
8296
8372
  if (!e.codec) return;
8297
- let t = s(G_, this).filter((t) => !(!sn(t) || t.bitRate > e.bitRate || e.codec && t.codec !== e.codec || e.language && t.language !== e.language));
8373
+ let t = s($_, this).filter((t) => !(!sn(t) || t.bitRate > e.bitRate || e.codec && t.codec !== e.codec || e.language && t.language !== e.language));
8298
8374
  return t[t.length - 1];
8299
8375
  }
8300
8376
  getVideoTrack(e) {
8301
8377
  if (!e.codec) return;
8302
- let t = s(G_, this).filter((t) => !(!on(t) || t.bitRate > e.bitRate || e.codec && t.codec !== e.codec));
8378
+ let t = s($_, this).filter((t) => !(!on(t) || t.bitRate > e.bitRate || e.codec && t.codec !== e.codec));
8303
8379
  return t[t.length - 1];
8304
8380
  }
8305
8381
  renditions() {
8306
- return s(G_, this);
8382
+ return s($_, this);
8307
8383
  }
8308
8384
  };
8309
- function J_() {
8310
- let [e, t] = s(W_, this).value();
8385
+ function nv() {
8386
+ let [e, t] = s(Q_, this).value();
8311
8387
  return u(e);
8312
8388
  }
8313
8389
  //#endregion
8314
8390
  //#region ../../libs/web-sdk/src/transports/WebSocket.ts
8315
- var Y_ = /* @__PURE__ */ function(e) {
8391
+ var rv = /* @__PURE__ */ function(e) {
8316
8392
  return e[e.AuthenticationFailed = 4e3] = "AuthenticationFailed", e[e.AuthenticationRefreshFailed = 4001] = "AuthenticationRefreshFailed", e[e.AuthenticationExpired = 4002] = "AuthenticationExpired", e[e.ChannelNotFound = 4003] = "ChannelNotFound", e[e.Inactivity = 4010] = "Inactivity", e;
8317
- }({}), X_ = class extends x {
8393
+ }({}), iv = class extends x {
8318
8394
  constructor(r, i) {
8319
8395
  var a;
8320
8396
  super(), a = this, e(this, "options", void 0), e(this, "websocket", void 0), e(this, "logger", void 0), e(this, "reconnectState", { reconnectRetries: 0 }), e(this, "isSuspended", !1), e(this, "_connectionAttemptCount", 0), e(this, "connectStartTime", 0), e(this, "_connectTime", void 0), e(this, "connectTimeout", void 0), e(this, "shouldContinueConnecting", !1), e(this, "_isConnectInProgress", !1), e(this, "readyState", () => {
@@ -8352,19 +8428,19 @@ var Y_ = /* @__PURE__ */ function(e) {
8352
8428
  })), this.close("websocket was closed");
8353
8429
  let n;
8354
8430
  switch (e.code) {
8355
- case Y_.AuthenticationFailed:
8431
+ case rv.AuthenticationFailed:
8356
8432
  n = Hn(Vn());
8357
8433
  break;
8358
- case Y_.AuthenticationRefreshFailed:
8434
+ case rv.AuthenticationRefreshFailed:
8359
8435
  n = Hn(Vn());
8360
8436
  break;
8361
- case Y_.AuthenticationExpired:
8437
+ case rv.AuthenticationExpired:
8362
8438
  n = Un(Vn());
8363
8439
  break;
8364
- case Y_.ChannelNotFound:
8440
+ case rv.ChannelNotFound:
8365
8441
  n = Gn("internal", Vn());
8366
8442
  break;
8367
- case Y_.Inactivity:
8443
+ case rv.Inactivity:
8368
8444
  n = Wn("internal", Vn());
8369
8445
  break;
8370
8446
  default: t && (n = Jn(/* @__PURE__ */ Error("WebSocket closed before open")));
@@ -8415,10 +8491,10 @@ var Y_ = /* @__PURE__ */ function(e) {
8415
8491
  get connectTime() {
8416
8492
  return this._connectTime;
8417
8493
  }
8418
- }, Z_, Q_ = 65536 * 8, $_ = .9, ev = 40, tv = (e) => {
8419
- let t = e || ev;
8420
- return Q_ * $_ * 1e3 / t;
8421
- }, nv = class r {
8494
+ }, av, ov = 65536 * 8, sv = .9, cv = 40, lv = (e) => {
8495
+ let t = e || cv;
8496
+ return ov * sv * 1e3 / t;
8497
+ }, uv = class r {
8422
8498
  constructor(i, a, o, s) {
8423
8499
  var c = this;
8424
8500
  e(this, "emitter", void 0), e(this, "transport", void 0), e(this, "logger", void 0), e(this, "config", void 0), e(this, "rtts", void 0), e(this, "lastPingSentTime", performance.now()), e(this, "isPingInFlight", !1), e(this, "connectCount", 0), e(this, "missedPings", 0), e(this, "isContextSwitchInProgress", !1), e(this, "signalBuffer", []), e(this, "dataBuffer", []), e(this, "disconnected", new C()), e(this, "unload", () => {
@@ -8440,7 +8516,7 @@ var Y_ = /* @__PURE__ */ function(e) {
8440
8516
  }
8441
8517
  this.transport.send(JSON.stringify(e));
8442
8518
  }), e(this, "getStatistics", () => ({
8443
- edgeUrl: v_(this.config.edgeUrl),
8519
+ edgeUrl: E_(this.config.edgeUrl),
8444
8520
  connectionProtocol: "vindral_ws",
8445
8521
  transportSelectionReason: void 0
8446
8522
  })), e(this, "onMessage", (e) => {
@@ -8465,7 +8541,7 @@ var Y_ = /* @__PURE__ */ function(e) {
8465
8541
  }
8466
8542
  this.handleMessage(e);
8467
8543
  }), e(this, "resolveEdgeUrl", t(function* () {
8468
- let e = c.config.connectInfo, t = yield c.config.onConnectInfo(e), n = __(c.config.edgeUrl, {
8544
+ let e = c.config.connectInfo, t = yield c.config.onConnectInfo(e), n = T_(c.config.edgeUrl, {
8469
8545
  video: t.video,
8470
8546
  audio: t.audio,
8471
8547
  burstMs: t.burstMs,
@@ -8502,7 +8578,7 @@ var Y_ = /* @__PURE__ */ function(e) {
8502
8578
  }
8503
8579
  }
8504
8580
  }), e(this, "connectWebSocketTransport", () => {
8505
- let e = new X_({
8581
+ let e = new iv({
8506
8582
  reconnectDelay: 1e3,
8507
8583
  onMessage: this.onMessage,
8508
8584
  reconnectHandler: this.config.reconnectHandler,
@@ -8541,8 +8617,8 @@ var Y_ = /* @__PURE__ */ function(e) {
8541
8617
  return this.disconnected.promise;
8542
8618
  }
8543
8619
  };
8544
- Z_ = nv, e(nv, "PING_INTERVAL", 5e3), e(nv, "MAX_MISSED_PINGS", 4), e(nv, "TLS_ROUNDTRIPS", 3), e(nv, "start", (e, t, n, r) => new Promise((i, a) => {
8545
- let o = new Z_(e, t, n, r);
8620
+ av = uv, e(uv, "PING_INTERVAL", 5e3), e(uv, "MAX_MISSED_PINGS", 4), e(uv, "TLS_ROUNDTRIPS", 3), e(uv, "start", (e, t, n, r) => new Promise((i, a) => {
8621
+ let o = new av(e, t, n, r);
8546
8622
  o.transport.once("error", (e) => a(e)), o.transport.once("open", () => {
8547
8623
  var e;
8548
8624
  (e = n.onTransportConnected) == null || e.call(n), i(o);
@@ -8550,51 +8626,51 @@ Z_ = nv, e(nv, "PING_INTERVAL", 5e3), e(nv, "MAX_MISSED_PINGS", 4), e(nv, "TLS_R
8550
8626
  }));
8551
8627
  //#endregion
8552
8628
  //#region ../../libs/web-sdk/src/EdgeSelector.ts
8553
- var rv = (e) => {
8629
+ var dv = (e) => {
8554
8630
  var t;
8555
8631
  return typeof e == "string" ? e : `${e.moqWsUrl}|${(t = e.moqUrl) == null ? "" : t}`;
8556
- }, iv = (e) => typeof e == "string" ? e : e.moqUrl || e.moqWsUrl, av = /* @__PURE__ */ new WeakMap(), ov = /* @__PURE__ */ new WeakMap(), sv = /* @__PURE__ */ new WeakMap(), cv = /* @__PURE__ */ new WeakMap(), lv = class {
8632
+ }, fv = (e) => typeof e == "string" ? e : e.moqUrl || e.moqWsUrl, pv = /* @__PURE__ */ new WeakMap(), mv = /* @__PURE__ */ new WeakMap(), hv = /* @__PURE__ */ new WeakMap(), gv = /* @__PURE__ */ new WeakMap(), _v = class {
8557
8633
  constructor(e) {
8558
- i(this, av, void 0), i(this, ov, []), i(this, sv, /* @__PURE__ */ new Set()), i(this, cv, void 0), a(av, this, e);
8634
+ i(this, pv, void 0), i(this, mv, []), i(this, hv, /* @__PURE__ */ new Set()), i(this, gv, void 0), a(pv, this, e);
8559
8635
  }
8560
8636
  select(e) {
8561
- if (s(av, this).edgeUrl) return s(av, this).edgeUrl;
8637
+ if (s(pv, this).edgeUrl) return s(pv, this).edgeUrl;
8562
8638
  if (e.length > 0) {
8563
- a(ov, this, [...e]);
8564
- let t = new Set(s(ov, this).map((e) => rv(e)));
8565
- for (let e of s(sv, this)) t.has(e) || s(sv, this).delete(e);
8639
+ a(mv, this, [...e]);
8640
+ let t = new Set(s(mv, this).map((e) => dv(e)));
8641
+ for (let e of s(hv, this)) t.has(e) || s(hv, this).delete(e);
8566
8642
  }
8567
- if (s(ov, this).length === 0) return;
8568
- let t = s(ov, this).filter((e) => !s(sv, this).has(rv(e)));
8569
- t.length === 0 && (s(sv, this).clear(), t = s(ov, this));
8643
+ if (s(mv, this).length === 0) return;
8644
+ let t = s(mv, this).filter((e) => !s(hv, this).has(dv(e)));
8645
+ t.length === 0 && (s(hv, this).clear(), t = s(mv, this));
8570
8646
  let n = t[0];
8571
- if (n) return s(sv, this).add(rv(n)), a(cv, this, n), n;
8647
+ if (n) return s(hv, this).add(dv(n)), a(gv, this, n), n;
8572
8648
  }
8573
8649
  shiftedEdge() {
8574
- return s(cv, this);
8650
+ return s(gv, this);
8575
8651
  }
8576
8652
  hasRemainingEdges() {
8577
- return s(ov, this).some((e) => !s(sv, this).has(rv(e)));
8653
+ return s(mv, this).some((e) => !s(hv, this).has(dv(e)));
8578
8654
  }
8579
8655
  reset() {
8580
- a(cv, this, void 0), a(ov, this, []), s(sv, this).clear();
8656
+ a(gv, this, void 0), a(mv, this, []), s(hv, this).clear();
8581
8657
  }
8582
- }, uv, dv = /* @__PURE__ */ new WeakMap(), fv = /* @__PURE__ */ new WeakMap(), pv = /* @__PURE__ */ new WeakMap(), mv = /* @__PURE__ */ new WeakMap(), hv = /* @__PURE__ */ new WeakMap(), gv = /* @__PURE__ */ new WeakMap(), _v = /* @__PURE__ */ new WeakMap(), vv = /* @__PURE__ */ new WeakMap(), yv = /* @__PURE__ */ new WeakMap(), bv = /* @__PURE__ */ new WeakMap(), xv = /* @__PURE__ */ new WeakMap(), Sv = /* @__PURE__ */ new WeakMap(), Cv = /* @__PURE__ */ new WeakMap(), wv = /* @__PURE__ */ new WeakMap(), Tv = /* @__PURE__ */ new WeakMap(), Ev = /* @__PURE__ */ new WeakMap(), Dv = /* @__PURE__ */ new WeakMap(), Ov = /* @__PURE__ */ new WeakMap(), kv = /* @__PURE__ */ new WeakMap(), Av = /* @__PURE__ */ new WeakSet(), jv = /* @__PURE__ */ new WeakMap(), Mv = /* @__PURE__ */ new WeakMap(), Nv = /* @__PURE__ */ new WeakMap(), Pv = /* @__PURE__ */ new WeakMap(), Fv = /* @__PURE__ */ new WeakMap(), Iv = /* @__PURE__ */ new WeakMap(), Lv = class n {
8658
+ }, vv, yv = /* @__PURE__ */ new WeakMap(), bv = /* @__PURE__ */ new WeakMap(), xv = /* @__PURE__ */ new WeakMap(), Sv = /* @__PURE__ */ new WeakMap(), Cv = /* @__PURE__ */ new WeakMap(), wv = /* @__PURE__ */ new WeakMap(), Tv = /* @__PURE__ */ new WeakMap(), Ev = /* @__PURE__ */ new WeakMap(), Dv = /* @__PURE__ */ new WeakMap(), Ov = /* @__PURE__ */ new WeakMap(), kv = /* @__PURE__ */ new WeakMap(), Av = /* @__PURE__ */ new WeakMap(), jv = /* @__PURE__ */ new WeakMap(), Mv = /* @__PURE__ */ new WeakMap(), Nv = /* @__PURE__ */ new WeakMap(), Pv = /* @__PURE__ */ new WeakMap(), Fv = /* @__PURE__ */ new WeakMap(), Iv = /* @__PURE__ */ new WeakMap(), Lv = /* @__PURE__ */ new WeakMap(), Rv = /* @__PURE__ */ new WeakSet(), zv = /* @__PURE__ */ new WeakMap(), Bv = /* @__PURE__ */ new WeakMap(), Vv = /* @__PURE__ */ new WeakMap(), Hv = /* @__PURE__ */ new WeakMap(), Uv = /* @__PURE__ */ new WeakMap(), Wv = /* @__PURE__ */ new WeakMap(), Gv = class n {
8583
8659
  constructor(c, l, u) {
8584
8660
  var d = this;
8585
- S(this, Av), e(this, "emitter", void 0), e(this, "logger", void 0), e(this, "config", void 0), e(this, "apiClient", void 0), e(this, "connectionImpl", void 0), i(this, dv, new r(10)), i(this, fv, !0), i(this, pv, void 0), i(this, mv, 0), i(this, hv, 0), i(this, gv, 0), i(this, _v, void 0), i(this, vv, void 0), i(this, yv, void 0), i(this, bv, void 0), i(this, xv, void 0), i(this, Sv, void 0), i(this, Cv, void 0), i(this, wv, []), i(this, Tv, void 0), e(this, "unload", () => {
8661
+ S(this, Rv), e(this, "emitter", void 0), e(this, "logger", void 0), e(this, "config", void 0), e(this, "apiClient", void 0), e(this, "connectionImpl", void 0), i(this, yv, new r(10)), i(this, bv, !0), i(this, xv, void 0), i(this, Sv, 0), i(this, Cv, 0), i(this, wv, 0), i(this, Tv, void 0), i(this, Ev, void 0), i(this, Dv, void 0), i(this, Ov, void 0), i(this, kv, void 0), i(this, Av, void 0), i(this, jv, void 0), i(this, Mv, []), i(this, Nv, void 0), e(this, "unload", () => {
8586
8662
  var e;
8587
- this.logger.debug("Unloading module..."), this.disconnect("Unloading"), (e = this.connectionImpl) == null || e.unload(), a(Cv, this, void 0), this.logger.debug("Unloaded module");
8663
+ this.logger.debug("Unloading module..."), this.disconnect("Unloading"), (e = this.connectionImpl) == null || e.unload(), a(jv, this, void 0), this.logger.debug("Unloaded module");
8588
8664
  }), e(this, "suspend", () => {
8589
8665
  var e;
8590
- a(fv, this, !1), (e = this.connectionImpl) == null || e.suspend();
8666
+ a(bv, this, !1), (e = this.connectionImpl) == null || e.suspend();
8591
8667
  }), e(this, "unsuspend", () => {
8592
8668
  var e;
8593
- a(fv, this, !0), (e = this.connectionImpl) == null || e.unsuspend(), this.connect();
8669
+ a(bv, this, !0), (e = this.connectionImpl) == null || e.unsuspend(), this.connect();
8594
8670
  }), e(this, "getState", () => this.connectionImpl ? this.connectionImpl.getState() : "disconnected"), e(this, "getStatistics", () => {
8595
- let e = s(hv, this) > 0 ? s(gv, this) / s(hv, this) : 0;
8671
+ let e = s(Cv, this) > 0 ? s(wv, this) / s(Cv, this) : 0;
8596
8672
  if (!this.connectionImpl) {
8597
- let t = s(Ev, this).call(this);
8673
+ let t = s(Pv, this).call(this);
8598
8674
  return {
8599
8675
  rtt: {
8600
8676
  min: 0,
@@ -8603,35 +8679,35 @@ var rv = (e) => {
8603
8679
  last: 0
8604
8680
  },
8605
8681
  estimatedBandwidth: 0,
8606
- connectCount: s(gv, this),
8607
- connectionAttemptCount: s(hv, this),
8682
+ connectCount: s(wv, this),
8683
+ connectionAttemptCount: s(Cv, this),
8608
8684
  connectionSuccessRatio: e,
8609
- timeToConnected: s(bv, this),
8685
+ timeToConnected: s(Ov, this),
8610
8686
  edgeUrl: t == null ? void 0 : t.edgeUrl,
8611
8687
  connectionProtocol: t == null ? void 0 : t.connectionProtocol,
8612
8688
  transportSelectionReason: t == null ? void 0 : t.transportSelectionReason
8613
8689
  };
8614
8690
  }
8615
8691
  return y(y({}, this.connectionImpl.getStatistics()), {}, {
8616
- rtt: _t(s(dv, this).items()),
8692
+ rtt: _t(s(yv, this).items()),
8617
8693
  estimatedBandwidth: this.estimatedBandwidth,
8618
- connectCount: s(gv, this),
8619
- connectionAttemptCount: s(hv, this),
8694
+ connectCount: s(wv, this),
8695
+ connectionAttemptCount: s(Cv, this),
8620
8696
  connectionSuccessRatio: e,
8621
- timeToConnected: s(bv, this)
8697
+ timeToConnected: s(Ov, this)
8622
8698
  });
8623
- }), i(this, Ev, () => s(fv, this) && s(Sv, this) ? s(Sv, this) : s(xv, this)), e(this, "connect", () => {
8624
- if (a(fv, this, !0), s(pv, this)) return;
8699
+ }), i(this, Pv, () => s(bv, this) && s(Av, this) ? s(Av, this) : s(kv, this)), e(this, "connect", () => {
8700
+ if (a(bv, this, !0), s(xv, this)) return;
8625
8701
  let e = performance.now();
8626
- s(bv, this) === void 0 && a(_v, this, e), s(vv, this) === void 0 && a(vv, this, e), a(pv, this, o(Av, this, Rv).call(this));
8627
- }), i(this, Dv, () => {
8628
- s(bv, this) !== void 0 || s(_v, this) === void 0 || !s(fv, this) || (a(bv, this, performance.now() - s(_v, this)), a(_v, this, void 0));
8702
+ s(Ov, this) === void 0 && a(Tv, this, e), s(Ev, this) === void 0 && a(Ev, this, e), a(xv, this, o(Rv, this, Kv).call(this));
8703
+ }), i(this, Fv, () => {
8704
+ s(Ov, this) !== void 0 || s(Tv, this) === void 0 || !s(bv, this) || (a(Ov, this, performance.now() - s(Tv, this)), a(Tv, this, void 0));
8629
8705
  }), e(this, "disconnect", (e = "Disconnect Requested") => {
8630
8706
  var t;
8631
- a(fv, this, !1), s(Mv, this).call(this), (t = this.connectionImpl) == null || t.close(e);
8707
+ a(bv, this, !1), s(Bv, this).call(this), (t = this.connectionImpl) == null || t.close(e);
8632
8708
  }), e(this, "reconnect", (e) => {
8633
8709
  this.disconnect(e), this.connect();
8634
- }), i(this, Ov, t(function* () {
8710
+ }), i(this, Iv, t(function* () {
8635
8711
  try {
8636
8712
  return yield d.apiClient.connect(d.config.options.getOptions());
8637
8713
  } catch (e) {
@@ -8642,7 +8718,7 @@ var rv = (e) => {
8642
8718
  }
8643
8719
  throw d.emitter.emit("error", Jn(e instanceof Error ? e : void 0)), e;
8644
8720
  }
8645
- })), i(this, kv, t(function* () {
8721
+ })), i(this, Lv, t(function* () {
8646
8722
  let e = performance.now(), t = () => performance.now() - e, r = globalThis.AbortController ? new AbortController() : void 0, i = setTimeout(() => r == null ? void 0 : r.abort(), n.PING_TIMEOUT);
8647
8723
  try {
8648
8724
  return yield fetch(new URL("/api/v4/connect/ping", d.config.options.get("url")).toString(), {
@@ -8654,27 +8730,27 @@ var rv = (e) => {
8654
8730
  } finally {
8655
8731
  clearTimeout(i);
8656
8732
  }
8657
- })), i(this, jv, () => {
8658
- s(Mv, this).call(this), a(Tv, this, setTimeout(() => {
8733
+ })), i(this, zv, () => {
8734
+ s(Bv, this).call(this), a(Nv, this, setTimeout(() => {
8659
8735
  var e;
8660
- !s(Cv, this) || ((e = this.connectionImpl) == null ? void 0 : e.getState()) !== "connected" || (this.logger.debug("Connection remained stable for long enough, clearing cached fallback edges"), s(Cv, this).reset(), a(Tv, this, void 0));
8736
+ !s(jv, this) || ((e = this.connectionImpl) == null ? void 0 : e.getState()) !== "connected" || (this.logger.debug("Connection remained stable for long enough, clearing cached fallback edges"), s(jv, this).reset(), a(Nv, this, void 0));
8661
8737
  }, n.EDGE_SELECTOR_RESET_TIMEOUT));
8662
- }), i(this, Mv, () => {
8663
- s(Tv, this) !== void 0 && (clearTimeout(s(Tv, this)), a(Tv, this, void 0));
8664
- }), i(this, Nv, function() {
8738
+ }), i(this, Bv, () => {
8739
+ s(Nv, this) !== void 0 && (clearTimeout(s(Nv, this)), a(Nv, this, void 0));
8740
+ }), i(this, Vv, function() {
8665
8741
  var e = t(function* (e) {
8666
- return (yield d.config.reconnectHandler({ reconnectRetries: s(mv, d) })) ? (s(Fv, d).call(d) ? (d.logger.info("Reconnect burst detected, applying backoff before retrying"), yield rn(n.RECONNECT_BACKOFF_MS)) : d.logger.info(e === "cached_edge" ? "Retrying with next cached edge without backoff" : "Retrying without backoff"), s(fv, d)) : (a(fv, d, !1), d.emitter.emit("error", Yn()), !1);
8742
+ return (yield d.config.reconnectHandler({ reconnectRetries: s(Sv, d) })) ? (s(Uv, d).call(d) ? (d.logger.info("Reconnect burst detected, applying backoff before retrying"), yield rn(n.RECONNECT_BACKOFF_MS)) : d.logger.info(e === "cached_edge" ? "Retrying with next cached edge without backoff" : "Retrying without backoff"), s(bv, d)) : (a(bv, d, !1), d.emitter.emit("error", Yn()), !1);
8667
8743
  });
8668
8744
  return function(t) {
8669
8745
  return e.apply(this, arguments);
8670
8746
  };
8671
- }()), i(this, Pv, (e = performance.now()) => {
8672
- s(Iv, this).call(this, e), s(wv, this).push(e);
8673
- }), i(this, Fv, (e = performance.now()) => (s(Iv, this).call(this, e), s(wv, this).length >= n.RECONNECT_BACKOFF_BURST_THRESHOLD)), i(this, Iv, (e) => {
8674
- for (; s(wv, this).length > 0;) {
8675
- let t = s(wv, this)[0];
8747
+ }()), i(this, Hv, (e = performance.now()) => {
8748
+ s(Wv, this).call(this, e), s(Mv, this).push(e);
8749
+ }), i(this, Uv, (e = performance.now()) => (s(Wv, this).call(this, e), s(Mv, this).length >= n.RECONNECT_BACKOFF_BURST_THRESHOLD)), i(this, Wv, (e) => {
8750
+ for (; s(Mv, this).length > 0;) {
8751
+ let t = s(Mv, this)[0];
8676
8752
  if (t === void 0 || t > e - n.RECONNECT_BACKOFF_BURST_WINDOW_MS) return;
8677
- s(wv, this).shift();
8753
+ s(Mv, this).shift();
8678
8754
  }
8679
8755
  }), this.logger = l, this.emitter = c, this.config = u, this.apiClient = new g({
8680
8756
  publicEndpoint: this.config.options.get("url").toString(),
@@ -8682,57 +8758,57 @@ var rv = (e) => {
8682
8758
  });
8683
8759
  }
8684
8760
  get rtt() {
8685
- return s(dv, this).items().length > 0 ? mt(s(dv, this).items()) : 0;
8761
+ return s(yv, this).items().length > 0 ? mt(s(yv, this).items()) : 0;
8686
8762
  }
8687
8763
  get estimatedBandwidth() {
8688
8764
  if (this.connectionImpl && "estimatedBandwidth" in this.connectionImpl) {
8689
8765
  let e = this.connectionImpl.estimatedBandwidth;
8690
8766
  if (e && Number.isFinite(e)) return e;
8691
8767
  }
8692
- return tv(this.rtt);
8768
+ return lv(this.rtt);
8693
8769
  }
8694
8770
  get firstConnectStartTime() {
8695
- return s(vv, this);
8771
+ return s(Ev, this);
8696
8772
  }
8697
8773
  get lastConnectionTime() {
8698
- return s(yv, this);
8774
+ return s(Dv, this);
8699
8775
  }
8700
8776
  };
8701
- uv = Lv;
8702
- function Rv() {
8777
+ vv = Gv;
8778
+ function Kv() {
8703
8779
  var e = this;
8704
8780
  return t(function* () {
8705
- let t = new lv({ edgeUrl: e.config.options.get("edgeUrl") });
8706
- for (a(Cv, e, t), s(Mv, e).call(e), a(mv, e, 0), a(wv, e, []);;) {
8781
+ let t = new _v({ edgeUrl: e.config.options.get("edgeUrl") });
8782
+ for (a(jv, e, t), s(Bv, e).call(e), a(Sv, e, 0), a(Mv, e, []);;) {
8707
8783
  var n, r, i;
8708
8784
  let l = "standard";
8709
- a(mv, e, (n = s(mv, e), n++, n)), a(hv, e, (r = s(hv, e), r++, r)), s(Pv, e).call(e);
8785
+ a(Sv, e, (n = s(Sv, e), n++, n)), a(Cv, e, (r = s(Cv, e), r++, r)), s(Hv, e).call(e);
8710
8786
  let u = !1;
8711
- a(Sv, e, {});
8787
+ a(Av, e, {});
8712
8788
  try {
8713
8789
  var o;
8714
- let [n, r] = yield Promise.all([s(Ov, e).call(e), s(kv, e).call(e)]);
8715
- if (s(dv, e).clear(), r !== void 0 && s(dv, e).push(r / 2), !s(fv, e)) break;
8790
+ let [n, r] = yield Promise.all([s(Iv, e).call(e), s(Lv, e).call(e)]);
8791
+ if (s(yv, e).clear(), r !== void 0 && s(yv, e).push(r / 2), !s(bv, e)) break;
8716
8792
  let i = t.select(n.edges);
8717
8793
  if (!i) throw new j("Failed to resolve edge url", {
8718
8794
  isFatal: !0,
8719
8795
  code: "failed_to_resolve_edge_url"
8720
8796
  });
8721
- a(Sv, e, { edgeUrl: v_(iv(i)) });
8797
+ a(Av, e, { edgeUrl: E_(fv(i)) });
8722
8798
  try {
8723
- c(n) ? e.connectionImpl = yield F_.start(e.emitter, e.logger, e.apiClient, y(y({}, e.config), {}, {
8799
+ c(n) ? e.connectionImpl = yield U_.start(e.emitter, e.logger, e.apiClient, y(y({}, e.config), {}, {
8724
8800
  connectInfo: n,
8725
8801
  edgeUrl: i,
8726
- onTransportConnected: s(Dv, e)
8727
- }), s(dv, e)) : (d(typeof i == "string", "Edge URL is expected to be a string"), e.connectionImpl = yield nv.start(e.emitter, e.logger, y(y({}, e.config), {}, {
8802
+ onTransportConnected: s(Fv, e)
8803
+ }), s(yv, e)) : (d(typeof i == "string", "Edge URL is expected to be a string"), e.connectionImpl = yield uv.start(e.emitter, e.logger, y(y({}, e.config), {}, {
8728
8804
  connectInfo: n,
8729
8805
  edgeUrl: i,
8730
- onTransportConnected: s(Dv, e)
8731
- }), s(dv, e)));
8806
+ onTransportConnected: s(Fv, e)
8807
+ }), s(yv, e)));
8732
8808
  } catch (e) {
8733
8809
  throw l = "cached_edge", e;
8734
8810
  }
8735
- a(xv, e, e.connectionImpl.getStatistics()), a(Sv, e, void 0), s(fv, e) || e.connectionImpl.close("Disconnected during connect"), s(jv, e).call(e), a(gv, e, (o = s(gv, e), o++, o)), a(mv, e, 0), a(yv, e, performance.now()), s(Dv, e).call(e);
8811
+ a(kv, e, e.connectionImpl.getStatistics()), a(Av, e, void 0), s(bv, e) || e.connectionImpl.close("Disconnected during connect"), s(zv, e).call(e), a(wv, e, (o = s(wv, e), o++, o)), a(Sv, e, 0), a(Dv, e, performance.now()), s(Fv, e).call(e);
8736
8812
  let u = yield e.connectionImpl.closed();
8737
8813
  e.logger.info("Connection closed", { reason: u instanceof Error ? u.message : u }), l = "cached_edge";
8738
8814
  } catch (n) {
@@ -8740,32 +8816,32 @@ function Rv() {
8740
8816
  let r = t.shiftedEdge();
8741
8817
  r && e.emitter.emit("telemetry event", {
8742
8818
  code: "shifted_edge",
8743
- edgeUrl: iv(r)
8819
+ edgeUrl: fv(r)
8744
8820
  }), n instanceof j ? (e.emitter.emit("error", n), u = n.isFatal()) : n instanceof Error && e.emitter.emit("error", new j(n.message, {
8745
8821
  code: "start_failed",
8746
8822
  isFatal: !1
8747
8823
  }));
8748
8824
  }
8749
- if ((i = e.connectionImpl) == null || i.unload(), e.connectionImpl = void 0, s(Mv, e).call(e), u) {
8750
- a(fv, e, !1);
8825
+ if ((i = e.connectionImpl) == null || i.unload(), e.connectionImpl = void 0, s(Bv, e).call(e), u) {
8826
+ a(bv, e, !1);
8751
8827
  break;
8752
8828
  }
8753
- if (!s(fv, e) || !(yield s(Nv, e).call(e, l === "cached_edge" && t.hasRemainingEdges() ? "cached_edge" : "standard"))) break;
8829
+ if (!s(bv, e) || !(yield s(Vv, e).call(e, l === "cached_edge" && t.hasRemainingEdges() ? "cached_edge" : "standard"))) break;
8754
8830
  }
8755
- a(Sv, e, void 0), a(Cv, e, void 0), s(Mv, e).call(e), a(pv, e, void 0);
8831
+ a(Av, e, void 0), a(jv, e, void 0), s(Bv, e).call(e), a(xv, e, void 0);
8756
8832
  })();
8757
8833
  }
8758
- e(Lv, "PING_TIMEOUT", 1e3), e(Lv, "RECONNECT_BACKOFF_MS", 1e3), e(Lv, "RECONNECT_BACKOFF_BURST_WINDOW_MS", 5e3), e(Lv, "RECONNECT_BACKOFF_BURST_THRESHOLD", 3), e(Lv, "EDGE_SELECTOR_RESET_TIMEOUT", 60 * 1e3), e(Lv, "create", (e, t, n) => new uv(e, t, n));
8834
+ e(Gv, "PING_TIMEOUT", 1e3), e(Gv, "RECONNECT_BACKOFF_MS", 1e3), e(Gv, "RECONNECT_BACKOFF_BURST_WINDOW_MS", 5e3), e(Gv, "RECONNECT_BACKOFF_BURST_THRESHOLD", 3), e(Gv, "EDGE_SELECTOR_RESET_TIMEOUT", 60 * 1e3), e(Gv, "create", (e, t, n) => new vv(e, t, n));
8759
8835
  //#endregion
8760
8836
  //#region ../../libs/web-sdk/src/modules/ConstraintCapModule.ts
8761
- var zv, Bv = () => ({
8837
+ var qv, Jv = () => ({
8762
8838
  video: y(y({}, un()), {}, { bitRate: ln() }),
8763
8839
  audio: { bitRate: ln() }
8764
- }), Vv = () => ({
8840
+ }), Yv = () => ({
8765
8841
  width: window.innerWidth,
8766
8842
  height: window.innerHeight,
8767
8843
  bitRate: ln()
8768
- }), Hv = class t {
8844
+ }), Xv = class t {
8769
8845
  constructor(n, r, i, a) {
8770
8846
  e(this, "emitter", void 0), e(this, "timers", new A()), e(this, "pictureInPictureSource", void 0), e(this, "element", void 0), e(this, "currentCap", void 0), e(this, "userSpecifiedCap", void 0), e(this, "renditionLevelSource", void 0), e(this, "resizeObserver", void 0), e(this, "elementSize", void 0), e(this, "_sizeBasedResolutionCapEnabled", void 0), e(this, "unload", () => {
8771
8847
  var e;
@@ -8787,7 +8863,7 @@ var zv, Bv = () => ({
8787
8863
  this.timers.unload();
8788
8864
  }), e(this, "setUserSpecifiedCap", (e) => {
8789
8865
  var t;
8790
- let n = (t = this.getUserSpecifiedCap()) == null ? Bv() : t;
8866
+ let n = (t = this.getUserSpecifiedCap()) == null ? Jv() : t;
8791
8867
  this.userSpecifiedCap = y(y({}, n), {}, {
8792
8868
  video: y(y({}, n.video), e.video),
8793
8869
  audio: y(y({}, n.audio), e.audio)
@@ -8811,7 +8887,7 @@ var zv, Bv = () => ({
8811
8887
  });
8812
8888
  }), e(this, "evaluateConstraintCap", () => {
8813
8889
  var e, t, n, r;
8814
- let i = this.sizeBasedResolutionCapEnabled ? y(y({}, Bv()), {}, { video: Vv() }) : Bv();
8890
+ let i = this.sizeBasedResolutionCapEnabled ? y(y({}, Jv()), {}, { video: Yv() }) : Jv();
8815
8891
  if (!this.resizeObserver) {
8816
8892
  let e = this.element.getBoundingClientRect();
8817
8893
  this.elementSize = {
@@ -8848,20 +8924,20 @@ var zv, Bv = () => ({
8848
8924
  this._sizeBasedResolutionCapEnabled = e, this.evaluateConstraintCap();
8849
8925
  }
8850
8926
  };
8851
- zv = Hv, e(Hv, "CHECK_SIZE_INTERVAL", 1e3), e(Hv, "create", (e, t, n, r) => new zv(e, t, n, r));
8927
+ qv = Xv, e(Xv, "CHECK_SIZE_INTERVAL", 1e3), e(Xv, "create", (e, t, n, r) => new qv(e, t, n, r));
8852
8928
  //#endregion
8853
8929
  //#region ../../libs/web-sdk/src/renditionKey.ts
8854
- var Uv = (e, t) => `${e}\u0000${t == null ? "" : t}`, Wv = (e, t, n, r) => e === n && t === r, Gv = class {
8930
+ var Zv = (e, t) => `${e}\u0000${t == null ? "" : t}`, Qv = (e, t, n, r) => e === n && t === r, $v = class {
8855
8931
  constructor() {
8856
8932
  e(this, "lastKey", void 0), e(this, "shouldNotify", (e, t) => {
8857
- let n = Uv(e, t);
8933
+ let n = Zv(e, t);
8858
8934
  return this.lastKey === n ? !1 : (this.lastKey = n, !0);
8859
8935
  });
8860
8936
  }
8861
- }, Kv = 5, qv = 40, Jv = 1, Yv = 5, Xv = (e) => {
8937
+ }, ey = 5, ty = 40, ny = 1, ry = 5, iy = (e) => {
8862
8938
  var t, n;
8863
8939
  return ((t = e.maxCompositionOffsetMs) == null ? 0 : t) - ((n = e.minCompositionOffsetMs) == null ? 0 : n);
8864
- }, Zv = (e, t, n) => {
8940
+ }, ay = (e, t, n) => {
8865
8941
  let r = [];
8866
8942
  for (let i of e) {
8867
8943
  let e = r[r.length - 1];
@@ -8875,10 +8951,10 @@ var Uv = (e, t) => `${e}\u0000${t == null ? "" : t}`, Wv = (e, t, n, r) => e ===
8875
8951
  });
8876
8952
  }
8877
8953
  return r;
8878
- }, Qv = (e, t) => {
8954
+ }, oy = (e, t) => {
8879
8955
  let n = e[e.length - 1];
8880
8956
  n && n.end > t && n.start < t && (n.end = t);
8881
- }, $v = 100, ey = 1e3, ty = class n {
8957
+ }, sy = 100, cy = 1e3, ly = class n {
8882
8958
  constructor(t, n, r, i, a = !1, o = !1, s = !1) {
8883
8959
  e(this, "backgroundTimersEnabled", !1), e(this, "timers", this.createTimers()), e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "trackContexts", void 0), e(this, "playbackSource", void 0), e(this, "isLoaded", !1), e(this, "isSuspended", !1), e(this, "_webCodecsInUse", void 0), e(this, "_audioWebCodecsInUse", void 0), e(this, "_offscreenCanvasInUse", void 0), e(this, "currentVideoDecodeRate", 2), e(this, "decodeRateGraceIntervals", 3), e(this, "isAudioEmitRetryScheduled", !1), e(this, "videoKeyframeTimestamps", []), e(this, "load", () => {
8884
8960
  this.isLoaded = !0, this.armTimers(), this.emitter.on("init segment", this.onInitSegment), this.emitter.on("coded sample", this.decode), this.emitter.on("flush buffers", this.resetContexts);
@@ -8896,8 +8972,8 @@ var Uv = (e, t) => `${e}\u0000${t == null ? "" : t}`, Wv = (e, t, n, r) => e ===
8896
8972
  }), e(this, "unsuspend", () => {
8897
8973
  this.isSuspended = !1, this.emitDecodedFrames(), this._audioWebCodecsInUse && this.scheduleAudioEmitRetry();
8898
8974
  }), e(this, "armTimers", () => {
8899
- let e = this._audioWebCodecsInUse ? 20 : $v;
8900
- this.timers.setInterval(this.emitDecodedFrames, e), this.timers.setInterval(this.emitDecodeRate, ey);
8975
+ let e = this._audioWebCodecsInUse ? 20 : sy;
8976
+ this.timers.setInterval(this.emitDecodedFrames, e), this.timers.setInterval(this.emitDecodeRate, cy);
8901
8977
  }), e(this, "replaceTimers", () => {
8902
8978
  let e = this.isAudioEmitRetryScheduled;
8903
8979
  this.isAudioEmitRetryScheduled = !1, this.timers.unload(), this.timers = this.createTimers(), this.timers.isWorkerBackendUnavailable() && this.logger.warn("Background timer worker is unavailable (likely blocked by CSP or unsupported in this environment). Falling back to main-thread timers; hidden-tab playback may be throttled."), this.isLoaded && (this.armTimers(), e && this.scheduleAudioEmitRetry());
@@ -8966,25 +9042,25 @@ var Uv = (e, t) => `${e}\u0000${t == null ? "" : t}`, Wv = (e, t, n, r) => e ===
8966
9042
  i.stream = `${e.channelId}/${e.renditionId}`;
8967
9043
  let c = (e.timestamp + a) / e.timescale * 1e3, l = e.duration / e.timescale * 1e3;
8968
9044
  l > 0 && (i.sampleDuration = l);
8969
- let u = i.sampleDuration || qv, d = e.timestamp / e.timescale * 1e3, f = a / e.timescale * 1e3, p = Xv(i), m = (t = s[s.length - 1]) == null ? void 0 : t.end, h = Math.max(u * Yv, p + ((n = i.frontierSampleDurationMs) == null ? u : n)), g = m !== void 0 && c + h < m;
9045
+ let u = i.sampleDuration || ty, d = e.timestamp / e.timescale * 1e3, f = a / e.timescale * 1e3, p = iy(i), m = (t = s[s.length - 1]) == null ? void 0 : t.end, h = Math.max(u * ry, p + ((n = i.frontierSampleDurationMs) == null ? u : n)), g = m !== void 0 && c + h < m;
8970
9046
  i.lastDecodeTimestampMs = g ? d : Math.max((r = i.lastDecodeTimestampMs) == null ? d : r, d);
8971
- let ee = i.channelId !== void 0 && !Wv(i.channelId, i.renditionId, e.channelId, e.renditionId);
9047
+ let ee = i.channelId !== void 0 && !Qv(i.channelId, i.renditionId, e.channelId, e.renditionId);
8972
9048
  i.channelId = e.channelId, i.renditionId = e.renditionId, (g || ee) && (i.minCompositionOffsetMs = void 0, i.maxCompositionOffsetMs = void 0, i.hasAnchoredGop = !1, i.isReorderStructureStale = !0);
8973
9049
  let _ = i.hasAnchoredGop === !0;
8974
9050
  if (e.isSync && (i.hasAnchoredGop = !0), !g && i.hasAnchoredGop) {
8975
9051
  var te, v;
8976
9052
  i.minCompositionOffsetMs = Math.min((te = i.minCompositionOffsetMs) == null ? f : te, f), i.maxCompositionOffsetMs = Math.max((v = i.maxCompositionOffsetMs) == null ? f : v, f), _ && (i.isReorderStructureStale = !1);
8977
9053
  }
8978
- let ne = Xv(i) > 0;
9054
+ let ne = iy(i) > 0;
8979
9055
  if (g) i.buffer = [{
8980
9056
  start: c,
8981
9057
  end: c + u
8982
9058
  }], i.frontierSampleDurationMs = u, e.type === "video" && (this.videoKeyframeTimestamps = []);
8983
9059
  else {
8984
9060
  var re;
8985
- !ne && !i.isReorderStructureStale && Qv(s, c + u);
9061
+ !ne && !i.isReorderStructureStale && oy(s, c + u);
8986
9062
  let e = (re = s[s.length - 1]) == null ? void 0 : re.end;
8987
- (e === void 0 || c + u >= e) && (i.frontierSampleDurationMs = u), Qt(s, c, c + u, Kv);
9063
+ (e === void 0 || c + u >= e) && (i.frontierSampleDurationMs = u), Qt(s, c, c + u, ey);
8988
9064
  }
8989
9065
  if (i.playableRangesCache = void 0, e.type === "video" && e.isSync) {
8990
9066
  let e = this.videoKeyframeTimestamps[this.videoKeyframeTimestamps.length - 1];
@@ -9023,11 +9099,11 @@ var Uv = (e, t) => `${e}\u0000${t == null ? "" : t}`, Wv = (e, t, n, r) => e ===
9023
9099
  }
9024
9100
  this.currentVideoDecodeRate = this.calculateVideoDecodeRate(), this.emitter.emit("video decode rate", this.currentVideoDecodeRate);
9025
9101
  }), e(this, "playableRanges", (e) => {
9026
- let t = Xv(e);
9102
+ let t = iy(e);
9027
9103
  if (t <= 0) return e.buffer;
9028
9104
  if (e.playableRangesCache === void 0) {
9029
9105
  var n, r;
9030
- e.playableRangesCache = Zv(e.buffer, ((n = e.lastDecodeTimestampMs) == null ? Infinity : n) - Math.max(0, -((r = e.minCompositionOffsetMs) == null ? 0 : r)) - Jv, t + (e.sampleDuration || qv) + Jv);
9106
+ e.playableRangesCache = ay(e.buffer, ((n = e.lastDecodeTimestampMs) == null ? Infinity : n) - Math.max(0, -((r = e.minCompositionOffsetMs) == null ? 0 : r)) - ny, t + (e.sampleDuration || ty) + ny);
9031
9107
  }
9032
9108
  return e.playableRangesCache;
9033
9109
  }), e(this, "updateBufferState", () => {
@@ -9114,7 +9190,7 @@ var Uv = (e, t) => `${e}\u0000${t == null ? "" : t}`, Wv = (e, t, n, r) => e ===
9114
9190
  var e;
9115
9191
  if (this._offscreenCanvasInUse) return (e = this.trackContexts.get("video")) == null ? void 0 : e.decoderContext.videoTrack;
9116
9192
  }
9117
- }, ny, ry = class {
9193
+ }, uy, dy = class {
9118
9194
  constructor(t) {
9119
9195
  e(this, "emitter", void 0), e(this, "isVisibleCount", 0), e(this, "isHiddenCount", 0), e(this, "isOnlineCount", 0), e(this, "isOfflineCount", 0), e(this, "isActive", document.visibilityState === "visible"), e(this, "isBehindAnotherApp", !1), e(this, "unload", () => {
9120
9196
  this.emitter.off("fullscreen app switch", this.onFullscreenAppSwitch), window.removeEventListener("focus", this.onVisibilityChanged), document.removeEventListener("visibilitychange", this.onVisibilityChanged), window.removeEventListener("pageshow", this.onPageShow), window.removeEventListener("pagehide", this.onPageHide), window.removeEventListener("online", this.onOnline), window.removeEventListener("offline", this.onOffline);
@@ -9144,12 +9220,12 @@ var Uv = (e, t) => `${e}\u0000${t == null ? "" : t}`, Wv = (e, t, n, r) => e ===
9144
9220
  return document.visibilityState === "visible" && !this.isBehindAnotherApp;
9145
9221
  }
9146
9222
  };
9147
- ny = ry, e(ry, "create", (e) => new ny(e));
9223
+ uy = dy, e(dy, "create", (e) => new uy(e));
9148
9224
  //#endregion
9149
9225
  //#region ../../libs/web-sdk/src/modules/EventModule.ts
9150
- var iy, ay = (e) => (t, n, r) => t.timestamp <= n || t.timestampAdded <= r - e, oy = class t {
9226
+ var fy, py = (e) => (t, n, r) => t.timestamp <= n || t.timestampAdded <= r - e, my = class t {
9151
9227
  constructor(n, r, i) {
9152
- e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "waitingEvents", []), e(this, "isTriggered", ay(t.EVENT_TIMEOUT)), e(this, "timeSource", void 0), e(this, "timers", new A()), e(this, "load", () => {
9228
+ e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "waitingEvents", []), e(this, "isTriggered", py(t.EVENT_TIMEOUT)), e(this, "timeSource", void 0), e(this, "timers", new A()), e(this, "load", () => {
9153
9229
  this.timers.setInterval(this.onBufferedStateChanged, t.EVENT_CHECK_INTERVAL), this.emitter.on("add event", this.addEvent);
9154
9230
  }), e(this, "unload", () => {
9155
9231
  this.timers.unload(), this.emitter.off("add event", this.addEvent);
@@ -9176,10 +9252,10 @@ var iy, ay = (e) => (t, n, r) => t.timestamp <= n || t.timestampAdded <= r - e,
9176
9252
  }), this.logger = r, this.emitter = n, this.timeSource = i;
9177
9253
  }
9178
9254
  };
9179
- iy = oy, e(oy, "EVENT_TIMEOUT", 5e3), e(oy, "EVENT_CHECK_INTERVAL", 20), e(oy, "create", (e, t, n) => new iy(e, t, n));
9255
+ fy = my, e(my, "EVENT_TIMEOUT", 5e3), e(my, "EVENT_CHECK_INTERVAL", 20), e(my, "create", (e, t, n) => new fy(e, t, n));
9180
9256
  //#endregion
9181
9257
  //#region ../../libs/web-sdk/src/modules/IncomingDataModule.ts
9182
- var sy, cy = class t {
9258
+ var hy, gy = class t {
9183
9259
  constructor(n) {
9184
9260
  e(this, "emitter", void 0), e(this, "timers", A.create()), e(this, "bytesReceived", /* @__PURE__ */ new Map()), e(this, "timeoutInterval", void 0), e(this, "lastBytesUpdated", performance.now()), e(this, "load", () => {
9185
9261
  this.emitter.on("connection state", this.onConnectionState), this.timers.setInterval(() => this.bytesReceived.forEach((e) => e.tick()), 100);
@@ -9214,10 +9290,10 @@ var sy, cy = class t {
9214
9290
  }), this.emitter = n;
9215
9291
  }
9216
9292
  };
9217
- sy = cy, e(cy, "NO_DATA_ERROR_TIMEOUT", 20 * 1e3), e(cy, "NO_DATA_TIMEOUT", 5 * 1e3), e(cy, "UPDATE_RECEIVED_BYTES_INTERVAL", 1e3), e(cy, "create", (e) => new sy(e));
9293
+ hy = gy, e(gy, "NO_DATA_ERROR_TIMEOUT", 20 * 1e3), e(gy, "NO_DATA_TIMEOUT", 5 * 1e3), e(gy, "UPDATE_RECEIVED_BYTES_INTERVAL", 1e3), e(gy, "create", (e) => new hy(e));
9218
9294
  //#endregion
9219
9295
  //#region ../../libs/web-sdk/src/modules/JitterModule.ts
9220
- var ly = 1e3, uy = 50, dy = class t {
9296
+ var _y = 1e3, vy = 50, yy = class t {
9221
9297
  constructor(t) {
9222
9298
  e(this, "logger", void 0), e(this, "trackingState", /* @__PURE__ */ new Map()), e(this, "runningJitter", /* @__PURE__ */ new Map()), e(this, "recentJitterSamples", /* @__PURE__ */ new Map()), e(this, "load", () => {
9223
9299
  this.logger.debug("JitterModule loaded");
@@ -9238,9 +9314,9 @@ var ly = 1e3, uy = 50, dy = class t {
9238
9314
  this.trackingState.set(n, {
9239
9315
  lastArrivalTime: i,
9240
9316
  lastTimestampMs: a,
9241
- jitterSamples: new r(ly),
9242
- interArrivalTimes: new r(ly)
9243
- }), this.runningJitter.set(n, 0), this.recentJitterSamples.set(n, new r(uy));
9317
+ jitterSamples: new r(_y),
9318
+ interArrivalTimes: new r(_y)
9319
+ }), this.runningJitter.set(n, 0), this.recentJitterSamples.set(n, new r(vy));
9244
9320
  return;
9245
9321
  }
9246
9322
  let s = a - o.lastTimestampMs;
@@ -9253,7 +9329,7 @@ var ly = 1e3, uy = 50, dy = class t {
9253
9329
  let u = (t = this.runningJitter.get(n)) == null ? 0 : t, d = u + (l - u) / 16;
9254
9330
  this.runningJitter.set(n, d);
9255
9331
  let f = this.recentJitterSamples.get(n);
9256
- f || (f = new r(uy), this.recentJitterSamples.set(n, f)), f.push(l), o.lastArrivalTime = i, o.lastTimestampMs = a;
9332
+ f || (f = new r(vy), this.recentJitterSamples.set(n, f)), f.push(l), o.lastArrivalTime = i, o.lastTimestampMs = a;
9257
9333
  }
9258
9334
  getJitterForType(e) {
9259
9335
  for (let [i, a] of this.trackingState) if (i.startsWith(e)) {
@@ -9284,10 +9360,10 @@ var ly = 1e3, uy = 50, dy = class t {
9284
9360
  videoJitter: this.getJitterForType("video")
9285
9361
  };
9286
9362
  }
9287
- }, fy = () => window.AudioContext || window.webkitAudioContext, py = class r extends x {
9363
+ }, by = () => window.AudioContext || window.webkitAudioContext, xy = class r extends x {
9288
9364
  constructor() {
9289
9365
  var i;
9290
- super(), i = this, e(this, "context", new (fy())()), e(this, "timers", A.create()), e(this, "previousCurrentTime", 0), e(this, "_isStuck", !1), e(this, "mediaStreamDestination", void 0), e(this, "unload", () => (this.timers.unload(), this.context.removeEventListener("statechange", this.onStateChange), this.context.state === "closed" ? Promise.resolve() : this.context.close())), e(this, "createGain", () => this.context.createGain()), e(this, "createBuffer", (e, t, n) => this.context.createBuffer(e, t, n)), e(this, "createBufferSource", () => this.context.createBufferSource()), e(this, "getMediaStreamDestination", () => (this.mediaStreamDestination || (this.mediaStreamDestination = this.context.createMediaStreamDestination()), this.mediaStreamDestination)), e(this, "getDefaultDestination", () => this.context.destination), e(this, "createSplitter", () => this.context.createChannelSplitter(2)), e(this, "resume", t(function* () {
9366
+ super(), i = this, e(this, "context", new (by())()), e(this, "timers", A.create()), e(this, "previousCurrentTime", 0), e(this, "_isStuck", !1), e(this, "mediaStreamDestination", void 0), e(this, "unload", () => (this.timers.unload(), this.context.removeEventListener("statechange", this.onStateChange), this.context.state === "closed" ? Promise.resolve() : this.context.close())), e(this, "createGain", () => this.context.createGain()), e(this, "createBuffer", (e, t, n) => this.context.createBuffer(e, t, n)), e(this, "createBufferSource", () => this.context.createBufferSource()), e(this, "getMediaStreamDestination", () => (this.mediaStreamDestination || (this.mediaStreamDestination = this.context.createMediaStreamDestination()), this.mediaStreamDestination)), e(this, "getDefaultDestination", () => this.context.destination), e(this, "createSplitter", () => this.context.createChannelSplitter(2)), e(this, "resume", t(function* () {
9291
9367
  let e = !0, t = i.context.resume();
9292
9368
  t.then(() => {
9293
9369
  e = !1;
@@ -9322,10 +9398,10 @@ var ly = 1e3, uy = 50, dy = class t {
9322
9398
  return this.context.state;
9323
9399
  }
9324
9400
  };
9325
- e(py, "CHECK_INTERVAL", 1e3);
9401
+ e(xy, "CHECK_INTERVAL", 1e3);
9326
9402
  //#endregion
9327
9403
  //#region ../../libs/web-audio-player/src/AudioPlayer.ts
9328
- var my, hy = 150, gy = 400, _y = (e) => e === void 0 ? 5 : e <= hy ? 1 : e <= gy ? 2 : 5, vy = class extends x {
9404
+ var Sy, Cy = 150, wy = 400, Ty = (e) => e === void 0 ? 5 : e <= Cy ? 1 : e <= wy ? 2 : 5, Ey = class extends x {
9329
9405
  get isContextRunning() {
9330
9406
  var e;
9331
9407
  return ((e = this.audio) == null ? void 0 : e.state) === "running";
@@ -9372,7 +9448,7 @@ var my, hy = 150, gy = 400, _y = (e) => e === void 0 ? 5 : e <= hy ? 1 : e <= gy
9372
9448
  return this._bufferTime;
9373
9449
  }
9374
9450
  set bufferTime(e) {
9375
- this._bufferTime = e, this.audioBufferMultiplier = _y(e);
9451
+ this._bufferTime = e, this.audioBufferMultiplier = Ty(e);
9376
9452
  }
9377
9453
  get sinkPaused() {
9378
9454
  return this._sinkPaused;
@@ -9478,7 +9554,7 @@ var my, hy = 150, gy = 400, _y = (e) => e === void 0 ? 5 : e <= hy ? 1 : e <= gy
9478
9554
  this.ignoreSuspendCalls = !1, this.emit("state change", "suspended");
9479
9555
  }), e(this, "getAudioContext", () => this.audio ? this.audio : this.setupContext()), e(this, "setupContext", () => {
9480
9556
  var e, t, r;
9481
- return (e = this.audio) == null || e.unload(), this.audio = new py(), this.audio.on("state", (e) => {
9557
+ return (e = this.audio) == null || e.unload(), this.audio = new xy(), this.audio.on("state", (e) => {
9482
9558
  this.logger.info("AudioContext state change", { state: e }), e === "running" && (this._muted = this._userProvidedMuted, this.setGain(this._volume)), !this.ignoreSuspendCalls && this.emit("state change", e);
9483
9559
  }), this.audio.on("stuck", () => {
9484
9560
  if (!this.reInitWhenStuck) {
@@ -9489,7 +9565,7 @@ var my, hy = 150, gy = 400, _y = (e) => e === void 0 ? 5 : e <= hy ? 1 : e <= gy
9489
9565
  }), (t = this.gainNode) == null || t.disconnect(), this.gainNode = this.audio.createGain(), this.setGain(this._volume), this.startTime = this.audio.currentTime, (r = this.splitter) == null || r.disconnect(), this.splitter = this.audio.createSplitter(), this.audio;
9490
9566
  }), e(this, "setGain", (e) => {
9491
9567
  this.gainNode && (this.gainNode.gain.value = this._muted ? 0 : e);
9492
- }), this._muted = o, this._userProvidedMuted = o, this.logger = i, this.clockSource = a, this.reInitWhenStuck = s, this._bufferTime = c, this.audioBufferMultiplier = _y(c);
9568
+ }), this._muted = o, this._userProvidedMuted = o, this.logger = i, this.clockSource = a, this.reInitWhenStuck = s, this._bufferTime = c, this.audioBufferMultiplier = Ty(c);
9493
9569
  }
9494
9570
  useMediaStreamDestination() {
9495
9571
  var e;
@@ -9502,10 +9578,10 @@ var my, hy = 150, gy = 400, _y = (e) => e === void 0 ? 5 : e <= hy ? 1 : e <= gy
9502
9578
  return (e = this.gainNode) == null || e.connect(t), t;
9503
9579
  }
9504
9580
  };
9505
- my = vy, e(vy, "create", (e, t, n) => new my(e, t, n));
9581
+ Sy = Ey, e(Ey, "create", (e, t, n) => new Sy(e, t, n));
9506
9582
  //#endregion
9507
9583
  //#region ../../libs/web-sdk/src/players/VideoPlayer.ts
9508
- var yy, by = class {
9584
+ var Dy, Oy = class {
9509
9585
  constructor(t, n, r, i, a, o) {
9510
9586
  e(this, "staleFrameThresholdMs", 400), e(this, "pool", void 0), e(this, "logger", void 0), e(this, "videoRenderer", new Lr()), e(this, "videoFrameCanvas2DRenderer", null), e(this, "renderQueue", []), e(this, "clockSource", void 0), e(this, "isFirstFrame", !0), e(this, "usingWebCodecs", !1), e(this, "onCanvasChangeCallback", void 0), e(this, "onRendererErrorCallback", void 0), e(this, "animationFrameRequest", void 0), e(this, "firstFrameAnimationFrameRequest", void 0), e(this, "pendingFirstFrameSample", void 0), e(this, "renderedFrameCount", 0), e(this, "rendererDroppedFrameCount", 0), e(this, "renderTargetSize", void 0), e(this, "load", () => {
9511
9587
  this.videoRenderer.load(), this.subscribeToContextLost(this.videoRenderer);
@@ -9595,12 +9671,12 @@ var yy, by = class {
9595
9671
  }), this.logger = t, this.clockSource = n, this.pool = r, this.renderTargetSize = i || this.videoRenderer.canvas, this.onCanvasChangeCallback = a, this.onRendererErrorCallback = o;
9596
9672
  }
9597
9673
  };
9598
- yy = by, e(by, "create", (e, t, n, r, i, a) => new yy(e, t, n, r, i, a));
9674
+ Dy = Oy, e(Oy, "create", (e, t, n, r, i, a) => new Dy(e, t, n, r, i, a));
9599
9675
  //#endregion
9600
9676
  //#region ../../libs/web-sdk/src/TextTracks.ts
9601
- var xy = /* @__PURE__ */ new WeakMap(), Sy = class {
9677
+ var ky = /* @__PURE__ */ new WeakMap(), Ay = class {
9602
9678
  constructor() {
9603
- i(this, xy, []), a(xy, this, []);
9679
+ i(this, ky, []), a(ky, this, []);
9604
9680
  }
9605
9681
  addTextTrack(e, t, n) {
9606
9682
  let r = [], i = {
@@ -9617,43 +9693,43 @@ var xy = /* @__PURE__ */ new WeakMap(), Sy = class {
9617
9693
  t !== -1 && r.splice(t, 1);
9618
9694
  }
9619
9695
  };
9620
- return s(xy, this).push(i), i;
9696
+ return s(ky, this).push(i), i;
9621
9697
  }
9622
9698
  set language(e) {
9623
- s(xy, this).forEach((t) => {
9699
+ s(ky, this).forEach((t) => {
9624
9700
  t.language === e ? t.mode = "showing" : t.mode = "hidden";
9625
9701
  });
9626
9702
  }
9627
9703
  get language() {
9628
9704
  var e;
9629
- return (e = s(xy, this).find((e) => e.mode === "showing")) == null ? void 0 : e.language;
9705
+ return (e = s(ky, this).find((e) => e.mode === "showing")) == null ? void 0 : e.language;
9630
9706
  }
9631
9707
  get tracks() {
9632
- return s(xy, this);
9708
+ return s(ky, this);
9633
9709
  }
9634
9710
  get activeTrack() {
9635
- return s(xy, this).find((e) => e.mode === "showing");
9711
+ return s(ky, this).find((e) => e.mode === "showing");
9636
9712
  }
9637
9713
  getActiveCues(e) {
9638
- let t = s(xy, this).find((e) => e.mode === "showing");
9714
+ let t = s(ky, this).find((e) => e.mode === "showing");
9639
9715
  return t ? t.cues.filter(({ startTime: t, endTime: n }) => e >= t && e < n) : [];
9640
9716
  }
9641
- }, Cy = (e, t) => {
9717
+ }, jy = (e, t) => {
9642
9718
  let n;
9643
9719
  for (n = t; e > 1; e--) n += t;
9644
9720
  return n;
9645
- }, wy = class {
9721
+ }, My = class {
9646
9722
  constructor() {
9647
9723
  e(this, "audio", void 0), e(this, "unmute", () => this.audio.play().catch(n));
9648
9724
  let t = document.createElement("div");
9649
9725
  t.innerHTML = "<audio x-webkit-airplay='deny'></audio>";
9650
9726
  let r = t.children.item(0);
9651
- if (r instanceof HTMLAudioElement) this.audio = r, this.audio.controls = !1, this.audio.disableRemotePlayback = !0, this.audio.preload = "auto", this.audio.src = "data:audio/mpeg;base64,//uQx" + Cy(23, "A") + "WGluZwAAAA8AAAACAAACcQCA" + Cy(16, "gICA") + Cy(66, "/") + "8AAABhTEFNRTMuMTAwA8MAAAAAAAAAABQgJAUHQQAB9AAAAnGMHkkI" + Cy(320, "A") + "//sQxAADgnABGiAAQBCqgCRMAAgEAH" + Cy(15, "/") + "7+n/9FTuQsQH//////2NG0jWUGlio5gLQTOtIoeR2WX////X4s9Atb/JRVCbBUpeRUq" + Cy(18, "/") + "9RUi0f2jn/+xDECgPCjAEQAABN4AAANIAAAAQVTEFNRTMuMTAw" + Cy(97, "V") + "Q==", this.audio.loop = !1, this.audio.load();
9727
+ if (r instanceof HTMLAudioElement) this.audio = r, this.audio.controls = !1, this.audio.disableRemotePlayback = !0, this.audio.preload = "auto", this.audio.src = "data:audio/mpeg;base64,//uQx" + jy(23, "A") + "WGluZwAAAA8AAAACAAACcQCA" + jy(16, "gICA") + jy(66, "/") + "8AAABhTEFNRTMuMTAwA8MAAAAAAAAAABQgJAUHQQAB9AAAAnGMHkkI" + jy(320, "A") + "//sQxAADgnABGiAAQBCqgCRMAAgEAH" + jy(15, "/") + "7+n/9FTuQsQH//////2NG0jWUGlio5gLQTOtIoeR2WX////X4s9Atb/JRVCbBUpeRUq" + jy(18, "/") + "9RUi0f2jn/+xDECgPCjAEQAABN4AAANIAAAAQVTEFNRTMuMTAw" + jy(97, "V") + "Q==", this.audio.loop = !1, this.audio.load();
9652
9728
  else throw Error("Failed to create audio tag");
9653
9729
  }
9654
- }, Ty, Ey = class {
9730
+ }, Ny, Py = class {
9655
9731
  constructor(t, n, r, i, a, o, s, c) {
9656
- e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "audioPlayer", void 0), e(this, "videoPlayer", void 0), e(this, "pool", void 0), e(this, "unmuter", new wy()), e(this, "_isPaused", !1), e(this, "isDisconnected", !1), e(this, "timers", new A()), e(this, "isVideoRenderingEnabled", !0), e(this, "isLoaded", !1), e(this, "isSuspended", !0), e(this, "isVideoPlayerLoaded", !1), e(this, "volumeState", void 0), e(this, "textTracks", new Sy()), e(this, "playbackRate", void 0), e(this, "emitVolumeState", () => {
9732
+ e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "audioPlayer", void 0), e(this, "videoPlayer", void 0), e(this, "pool", void 0), e(this, "unmuter", new My()), e(this, "_isPaused", !1), e(this, "isDisconnected", !1), e(this, "timers", new A()), e(this, "isVideoRenderingEnabled", !0), e(this, "isLoaded", !1), e(this, "isSuspended", !0), e(this, "isVideoPlayerLoaded", !1), e(this, "volumeState", void 0), e(this, "textTracks", new Ay()), e(this, "playbackRate", void 0), e(this, "emitVolumeState", () => {
9657
9733
  let e = {
9658
9734
  volume: this.volume,
9659
9735
  isMuted: this.userMuted
@@ -9695,13 +9771,13 @@ var xy = /* @__PURE__ */ new WeakMap(), Sy = class {
9695
9771
  e instanceof Error && this.emitter.emit("error", Fn(!1, e));
9696
9772
  }
9697
9773
  this.isVideoRenderingEnabled && this.videoPlayer.onDecodedFrame(e);
9698
- }), this.logger = n, this.emitter = t, this.pool = r, this.emitter.on("target buffer time", this.onTargetBufferTime), this.audioPlayer = vy.create(this.logger.createContext("AudioPlayerModule"), i, {
9774
+ }), this.logger = n, this.emitter = t, this.pool = r, this.emitter.on("target buffer time", this.onTargetBufferTime), this.audioPlayer = Ey.create(this.logger.createContext("AudioPlayerModule"), i, {
9699
9775
  muted: a,
9700
9776
  reInitWhenStuck: !0,
9701
9777
  bufferTime: c
9702
9778
  }), o !== void 0 && (this.audioPlayer.volume = o), this.audioPlayer.on("stuck", () => {
9703
9779
  this.isDisconnected = !0;
9704
- }), this.audioPlayer.on("state change", this.emitVolumeState), this.videoPlayer = by.create(this.logger.createContext("VideoPlayerModule"), this.audioPlayer, this.pool, void 0, s);
9780
+ }), this.audioPlayer.on("state change", this.emitVolumeState), this.videoPlayer = Oy.create(this.logger.createContext("VideoPlayerModule"), this.audioPlayer, this.pool, void 0, s);
9705
9781
  }
9706
9782
  get volume() {
9707
9783
  return this.audioPlayer.volume;
@@ -9760,29 +9836,29 @@ var xy = /* @__PURE__ */ new WeakMap(), Sy = class {
9760
9836
  this._isPaused = !0, this.audioPlayer.pause(), this.emitter.emit("media element state", "paused");
9761
9837
  }
9762
9838
  };
9763
- Ty = Ey, e(Ey, "create", (e, t, n, r, i, a, o, s) => new Ty(e, t, n, r, i, a, o, s));
9839
+ Ny = Py, e(Py, "create", (e, t, n, r, i, a, o, s) => new Ny(e, t, n, r, i, a, o, s));
9764
9840
  //#endregion
9765
9841
  //#region ../../libs/web-sdk/src/modules/MediaSessionModule.ts
9766
- var Dy, Oy = [
9842
+ var Fy, Iy = [
9767
9843
  "play",
9768
9844
  "pause",
9769
9845
  "stop"
9770
- ], ky, Ay = /* @__PURE__ */ new Set(), jy = class t {
9846
+ ], Ly, Ry = /* @__PURE__ */ new Set(), zy = class t {
9771
9847
  constructor(n, r, i) {
9772
9848
  e(this, "emitter", void 0), e(this, "logger", void 0), e(this, "options", void 0), e(this, "isLoaded", !1), e(this, "playbackState", void 0), e(this, "pageMetadata", null), e(this, "load", () => {
9773
- this.isLoaded || !t.isSupported() || (this.isLoaded = !0, Ay.add(this), this.emitter.on("playback state", this.onPlaybackState), this.emitter.on("volume state", this.update));
9849
+ this.isLoaded || !t.isSupported() || (this.isLoaded = !0, Ry.add(this), this.emitter.on("playback state", this.onPlaybackState), this.emitter.on("volume state", this.update));
9774
9850
  }), e(this, "unload", () => {
9775
9851
  var e;
9776
- this.isLoaded && (this.isLoaded = !1, Ay.delete(this), this.emitter.off("playback state", this.onPlaybackState), this.emitter.off("volume state", this.update), this.handOverOwnership("on unload"), (e = this.options.decoy) == null || e.unload());
9852
+ this.isLoaded && (this.isLoaded = !1, Ry.delete(this), this.emitter.off("playback state", this.onPlaybackState), this.emitter.off("volume state", this.update), this.handOverOwnership("on unload"), (e = this.options.decoy) == null || e.unload());
9777
9853
  }), e(this, "stop", () => {
9778
9854
  var e;
9779
- this.playbackState = void 0, (e = this.options.decoy) == null || e.unload(), ky === this && this.handOverOwnership("on stop");
9855
+ this.playbackState = void 0, (e = this.options.decoy) == null || e.unload(), Ly === this && this.handOverOwnership("on stop");
9780
9856
  }), e(this, "getStatistics", () => {
9781
9857
  var e;
9782
9858
  return {
9783
9859
  mediaSessionSupported: t.isSupported(),
9784
- mediaSessionOwner: ky === this,
9785
- mediaSessionPlaybackState: ky === this ? this.isPaused ? "paused" : "playing" : "none",
9860
+ mediaSessionOwner: Ly === this,
9861
+ mediaSessionPlaybackState: Ly === this ? this.isPaused ? "paused" : "playing" : "none",
9786
9862
  decoyState: (e = this.options.decoy) == null ? void 0 : e.getStatistics().decoyState
9787
9863
  };
9788
9864
  }), e(this, "onPlaybackState", (e) => {
@@ -9791,23 +9867,23 @@ var Dy, Oy = [
9791
9867
  this.update();
9792
9868
  }), e(this, "update", () => {
9793
9869
  if (this.isLoaded) {
9794
- if (this.isEligibleToOwn && ky !== this) {
9870
+ if (this.isEligibleToOwn && Ly !== this) {
9795
9871
  this.claimOwnership();
9796
9872
  return;
9797
9873
  }
9798
9874
  this.sync();
9799
9875
  }
9800
9876
  }), e(this, "handOverOwnership", (e) => {
9801
- if (ky === this) {
9877
+ if (Ly === this) {
9802
9878
  this.logger.debug(`Handing over the media session ${e}`), this.releaseOwnership();
9803
- for (let e of Ay) if (e !== this && e.isEligibleToOwn) {
9879
+ for (let e of Ry) if (e !== this && e.isEligibleToOwn) {
9804
9880
  e.claimOwnership();
9805
9881
  return;
9806
9882
  }
9807
9883
  }
9808
9884
  }), e(this, "sync", () => {
9809
9885
  var e, t, n, r, i, a;
9810
- if (ky !== this) return;
9886
+ if (Ly !== this) return;
9811
9887
  if ((e = (t = this.options).isSuppressed) != null && e.call(t)) {
9812
9888
  var o;
9813
9889
  (o = this.options.decoy) == null || o.unload(), this.handOverOwnership("as suppressed");
@@ -9840,8 +9916,8 @@ var Dy, Oy = [
9840
9916
  (f = this.options.decoy) == null || f.play();
9841
9917
  }
9842
9918
  }), e(this, "claimOwnership", () => {
9843
- ky == null || ky.releaseOwnership(), ky = this, this.pageMetadata = navigator.mediaSession.metadata, this.applyMetadata();
9844
- for (let e of Oy) this.safely(e, () => navigator.mediaSession.setActionHandler(e, this.onAction[e]));
9919
+ Ly == null || Ly.releaseOwnership(), Ly = this, this.pageMetadata = navigator.mediaSession.metadata, this.applyMetadata();
9920
+ for (let e of Iy) this.safely(e, () => navigator.mediaSession.setActionHandler(e, this.onAction[e]));
9845
9921
  this.safely("position state", () => {
9846
9922
  var e, t;
9847
9923
  return (e = (t = navigator.mediaSession).setPositionState) == null ? void 0 : e.call(t, {
@@ -9857,9 +9933,9 @@ var Dy, Oy = [
9857
9933
  });
9858
9934
  }), e(this, "releaseOwnership", () => {
9859
9935
  var e;
9860
- if (ky === this) {
9861
- ky = void 0, (e = this.options.decoy) == null || e.pause();
9862
- for (let e of Oy) this.safely(e, () => navigator.mediaSession.setActionHandler(e, null));
9936
+ if (Ly === this) {
9937
+ Ly = void 0, (e = this.options.decoy) == null || e.pause();
9938
+ for (let e of Iy) this.safely(e, () => navigator.mediaSession.setActionHandler(e, null));
9863
9939
  this.options.metadata && this.safely("metadata restore", () => {
9864
9940
  navigator.mediaSession.metadata = this.pageMetadata;
9865
9941
  }), this.safely("release", () => {
@@ -9893,15 +9969,15 @@ var Dy, Oy = [
9893
9969
  return this.playbackState !== void 0 && !this.isPaused && !this.options.isMuted() && ((e = (t = this.options).isSuppressed) == null ? void 0 : e.call(t)) !== !0;
9894
9970
  }
9895
9971
  };
9896
- Dy = jy, e(jy, "create", (e, t, n) => new Dy(e, t, n)), e(jy, "isSupported", () => typeof navigator < "u" && "mediaSession" in navigator && typeof MediaMetadata < "u");
9972
+ Fy = zy, e(zy, "create", (e, t, n) => new Fy(e, t, n)), e(zy, "isSupported", () => typeof navigator < "u" && "mediaSession" in navigator && typeof MediaMetadata < "u");
9897
9973
  //#endregion
9898
9974
  //#region ../../libs/web-sdk/src/modules/ModernCanvasModule.ts
9899
- var My, Ny = class {
9975
+ var By, Vy = class {
9900
9976
  constructor(t, r, i, a, { muted: o, volume: s, type: c, poster: l, offscreenCanvas: u, bufferTime: d, backgroundPlaybackEnabled: f, splitAudio: p }) {
9901
9977
  if (e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "mediaElement", void 0), e(this, "sound", void 0), e(this, "wantsPlay", void 0), e(this, "audioPlayer", void 0), e(this, "videoPlayer", void 0), e(this, "pool", void 0), e(this, "isDisconnected", !0), e(this, "_userProvidedMuted", !1), e(this, "timers", new A()), e(this, "offscreenCanvas", void 0), e(this, "videoTrack", void 0), e(this, "canvasCaptureTracks", []), e(this, "backgroundPlaybackEnabled", void 0), e(this, "nativeTracksByLanguage", /* @__PURE__ */ new Map()), e(this, "nativeCuesByLanguage", /* @__PURE__ */ new Map()), e(this, "lastCanvasCueTexts", []), e(this, "isIOSNativeFullscreen", !1), e(this, "knownNativeLanguage", void 0), e(this, "renderCanvasSubtitlesInNativeFullscreen", (() => {
9902
9978
  let e = Ue().platform;
9903
9979
  return e.isIOS && e.iosVersion <= 16;
9904
- })()), e(this, "volumeState", void 0), e(this, "textTracks", new Sy()), e(this, "reset", () => {}), e(this, "load", () => {
9980
+ })()), e(this, "volumeState", void 0), e(this, "textTracks", new Ay()), e(this, "reset", () => {}), e(this, "load", () => {
9905
9981
  this.mediaElement.load(), this.sound && (this.sound.load(), document.body.appendChild(this.sound.element), this.mediaElement.element.addEventListener("pause", this.onVideoPause), this.mediaElement.element.addEventListener("play", this.onVideoPlay), window.addEventListener("focus", this.onWindowFocus)), this.emitter.on("decoded frame", this.onDecodedFrame), this.emitter.on("flush buffers", this.flushBuffers), this.emitter.on("ios-hack: reset size", this.resetCanvasSize), this.emitter.on("enter picture in picture", this.onEnterIOSHack), this.emitter.on("exit picture in picture", this.onExitIOSHack), this.element().element.textTracks.addEventListener("change", this.onNativeTextTrackChange), this.element().element.addEventListener("webkitendfullscreen", this.onExitIOSHack), this.element().element.addEventListener("webkitbeginfullscreen", this.onEnterIOSHack), this.videoPlayer.load(), this.timers.setInterval(this.syncNativeTextTracks, 100);
9906
9982
  }), e(this, "unload", () => {
9907
9983
  this.emitter.off("target buffer time", this.onTargetBufferTime), this.emitter.off("decoded frame", this.onDecodedFrame), this.emitter.off("flush buffers", this.flushBuffers), this.emitter.off("ios-hack: reset size", this.resetCanvasSize), this.emitter.off("enter picture in picture", this.onEnterIOSHack), this.emitter.off("exit picture in picture", this.onExitIOSHack), this.element().element.textTracks.removeEventListener("change", this.onNativeTextTrackChange), this.element().element.removeEventListener("webkitendfullscreen", this.onExitIOSHack), this.element().element.removeEventListener("webkitbeginfullscreen", this.onEnterIOSHack);
@@ -10054,13 +10130,13 @@ var My, Ny = class {
10054
10130
  }), this.soundElement.on("media element state", (e) => {
10055
10131
  e === "paused" && this.audioPlayer.flushBuffer(), this.audioPlayer.sinkPaused = e === "paused", this.emitPlaybackState();
10056
10132
  }), this.sound) for (let e of this.elements()) e.on("needs user input", (e) => this.emitter.emit("needs user input", e)), e.on("error", (e) => this.emitter.emit("error", e));
10057
- this.audioPlayer = vy.create(this.logger.createContext("AudioPlayerModule"), a, {
10133
+ this.audioPlayer = Ey.create(this.logger.createContext("AudioPlayerModule"), a, {
10058
10134
  muted: !1,
10059
10135
  reInitWhenStuck: !1,
10060
10136
  bufferTime: d
10061
10137
  }), this.audioPlayer.on("state change", (e) => {
10062
10138
  e === "suspended" || e === "interrupted" ? this.soundElement.muted = !0 : e === "running" && this.applyVisibilityMutePolicy(), this.updateVolumeState();
10063
- }), this.videoPlayer = by.create(this.logger.createContext("VideoPlayerModule"), this.audioPlayer, this.pool, this.mediaElement.element, () => this.reconnectCanvasStream(), this.onVideoPlayerError);
10139
+ }), this.videoPlayer = Oy.create(this.logger.createContext("VideoPlayerModule"), this.audioPlayer, this.pool, this.mediaElement.element, () => this.reconnectCanvasStream(), this.onVideoPlayerError);
10064
10140
  }
10065
10141
  get volume() {
10066
10142
  return this.soundElement.volume;
@@ -10132,10 +10208,10 @@ var My, Ny = class {
10132
10208
  return this.renderCanvasSubtitlesInNativeFullscreen && !this.offscreenCanvas;
10133
10209
  }
10134
10210
  };
10135
- My = Ny, e(Ny, "create", (e, t, n, r, i) => new My(e, t, n, r, i));
10211
+ By = Vy, e(Vy, "create", (e, t, n, r, i) => new By(e, t, n, r, i));
10136
10212
  //#endregion
10137
10213
  //#region ../../libs/web-sdk/src/modules/MseModule.ts
10138
- var Py, Fy = class {
10214
+ var Hy, Uy = class {
10139
10215
  constructor() {
10140
10216
  e(this, "initSegments", /* @__PURE__ */ new Map()), e(this, "set", (e, t, n) => {
10141
10217
  var r;
@@ -10147,7 +10223,7 @@ var Py, Fy = class {
10147
10223
  });
10148
10224
  }
10149
10225
  };
10150
- function Iy(e, { mediaSource: t, mimeType: n, codec: r }) {
10226
+ function Wy(e, { mediaSource: t, mimeType: n, codec: r }) {
10151
10227
  return y(y({}, e), {}, {
10152
10228
  state: "initialized",
10153
10229
  mimeType: n,
@@ -10159,10 +10235,10 @@ function Iy(e, { mediaSource: t, mimeType: n, codec: r }) {
10159
10235
  lastBufferCleanupTime: performance.now()
10160
10236
  });
10161
10237
  }
10162
- function Ly({ initSegments: e, pendingSamples: t }) {
10238
+ function Gy({ initSegments: e, pendingSamples: t }) {
10163
10239
  return {
10164
10240
  state: "uninitialized",
10165
- initSegments: e == null ? new Fy() : e,
10241
+ initSegments: e == null ? new Uy() : e,
10166
10242
  sequenceNumber: 0,
10167
10243
  isWorkingOnPendingSamples: !1,
10168
10244
  hasFirstSync: t.some((e) => e.isSync),
@@ -10172,7 +10248,7 @@ function Ly({ initSegments: e, pendingSamples: t }) {
10172
10248
  successfulAppendCalls: 0
10173
10249
  };
10174
10250
  }
10175
- var Ry = class {
10251
+ var Ky = class {
10176
10252
  constructor(r, i, a) {
10177
10253
  var o = this;
10178
10254
  e(this, "maxChunkSize", 20), e(this, "minConsecutiveErrorsBeforeEmit", 5), e(this, "maxSecondsInBuffer", 60), e(this, "logger", void 0), e(this, "timers", A.create()), e(this, "emitter", void 0), e(this, "mediaElement", void 0), e(this, "mediaSource", new Ws()), e(this, "trackContexts", /* @__PURE__ */ new Map()), e(this, "autoRecoverFromMediaErrors", !0), e(this, "quotaErrorCount", 0), e(this, "recoveredFromErrorCount", 0), e(this, "sourceOpenStartTime", performance.now()), e(this, "sourceOpenEndTime", performance.now()), e(this, "pendingTracksToAddSourceBuffers", void 0), e(this, "hasAddedInitialPosterFrame", !0), e(this, "videoKeyframeTimestamps", []), e(this, "isReopening", !1), e(this, "pendingMediaError", void 0), e(this, "isFlushDeferred", !1), e(this, "hasRecoveredSinceShown", !1), e(this, "playbackStallCount", 0), e(this, "hasStartedPlayback", !1), e(this, "isPlaybackStalled", !1), e(this, "load", () => {
@@ -10218,7 +10294,7 @@ var Ry = class {
10218
10294
  var n, r, i;
10219
10295
  let a = e.get(t), o = (n = a == null ? void 0 : a.pendingSamples) == null ? [] : n, s = a == null ? void 0 : a.initSegments, c = (r = a == null ? void 0 : a.pendingSamplesOffset) == null ? 0 : r;
10220
10296
  for (; c < o.length && !((i = o[c]) != null && i.isSync);) c++;
10221
- let l = Ly({
10297
+ let l = Gy({
10222
10298
  pendingSamples: o,
10223
10299
  initSegments: s
10224
10300
  });
@@ -10229,14 +10305,14 @@ var Ry = class {
10229
10305
  this.trackContexts.forEach((e, n) => {
10230
10306
  if (t.has(n)) return;
10231
10307
  e.state === "initialized" && this.mediaSource.isOpen() && this.mediaSource.removeSourceBuffer(e.sourceBuffer);
10232
- let r = Ly({
10308
+ let r = Gy({
10233
10309
  pendingSamples: [],
10234
10310
  initSegments: e.initSegments
10235
10311
  });
10236
10312
  this.trackContexts.set(n, r);
10237
10313
  });
10238
10314
  }), e(this, "isCurrentTrackContext", (e, t) => this.trackContexts.get(e) === t), e(this, "initializeSourceBuffer", (e, t) => {
10239
- let n = Iy(e, {
10315
+ let n = Wy(e, {
10240
10316
  mimeType: t.mimeType,
10241
10317
  mediaSource: this.mediaSource,
10242
10318
  codec: t.codec
@@ -10263,9 +10339,9 @@ var Ry = class {
10263
10339
  }
10264
10340
  for (let t of e) {
10265
10341
  let n = o.trackContexts.get(t.type);
10266
- if (n || (n = Ly({
10342
+ if (n || (n = Gy({
10267
10343
  pendingSamples: [],
10268
- initSegments: new Fy()
10344
+ initSegments: new Uy()
10269
10345
  }), o.trackContexts.set(t.type, n)), n.state === "initialized") {
10270
10346
  if (t.mimeType !== n.sourceBufferMimeType) try {
10271
10347
  yield n.sourceBuffer.changeType(t.mimeType), n.sourceBufferMimeType = t.mimeType;
@@ -10282,7 +10358,7 @@ var Ry = class {
10282
10358
  o.logger.warn("removeSourceBuffer failed", { removeError: t }), o.reopenMediaSource("changeType recovery failed"), o.pendingTracksToAddSourceBuffers = e;
10283
10359
  return;
10284
10360
  }
10285
- let i = Ly({
10361
+ let i = Gy({
10286
10362
  pendingSamples: n.pendingSamples,
10287
10363
  initSegments: n.initSegments
10288
10364
  });
@@ -10306,7 +10382,11 @@ var Ry = class {
10306
10382
  };
10307
10383
  }), e(this, "getNextBufferedRangeStart", (e) => {
10308
10384
  let t = this.getCommonBufferedRangesForCurrentTracks();
10309
- if (t) return zy(e, t);
10385
+ if (t) return qy(e, t);
10386
+ }), e(this, "getBufferedEndAt", (e) => {
10387
+ var t;
10388
+ let n = this.getCommonBufferedRangesForCurrentTracks();
10389
+ if (n) return (t = n.find((t) => t.start <= e && e < t.end)) == null ? void 0 : t.end;
10310
10390
  }), e(this, "getVideoKeyframeTimestamps", () => this.videoKeyframeTimestamps), e(this, "init", ({ initSegment: e, mimeType: t }) => {
10311
10391
  this.logger.debug("Added init segment", {
10312
10392
  channel: e.channelId,
@@ -10409,7 +10489,7 @@ var Ry = class {
10409
10489
  let t = (e.timestamp + ((n = e.compositionTimeOffset) == null ? 0 : n)) / e.timescale * 1e3, r = this.videoKeyframeTimestamps[this.videoKeyframeTimestamps.length - 1];
10410
10490
  r !== void 0 && t < r && (this.videoKeyframeTimestamps = []), this.videoKeyframeTimestamps.push(t), this.videoKeyframeTimestamps.length > 20 && (this.videoKeyframeTimestamps = this.videoKeyframeTimestamps.slice(-20));
10411
10491
  }
10412
- t.state !== "uninitialized" && (t.isWorkingOnPendingSamples || Wy(t, this.append, this.maxChunkSize).catch((n) => {
10492
+ t.state !== "uninitialized" && (t.isWorkingOnPendingSamples || Qy(t, this.append, this.maxChunkSize).catch((n) => {
10413
10493
  if (t.isWorkingOnPendingSamples = !1, !this.isReopening) {
10414
10494
  if (!this.isCurrentTrackContext(e.type, t)) {
10415
10495
  this.logger.debug("Suppressing append error from stale track context", { type: e.type });
@@ -10528,14 +10608,14 @@ var Ry = class {
10528
10608
  if (this.mediaSource.isClosed()) return;
10529
10609
  let e = this.getInitializedTrackBuffers();
10530
10610
  if (e.length !== 0) return this.getCommonBufferedRanges(e);
10531
- }), e(this, "getCommonBufferedRanges", (e) => e.slice(1).reduce((e, t) => Hy(e, t), e[0] ? Array.from(e[0]) : [])), e(this, "getPlaybackStateForBufferedRanges", (e, t) => $t(t, e) ? "playing" : "buffering"), this.logger = r, this.mediaElement = a, this.emitter = i;
10611
+ }), e(this, "getCommonBufferedRanges", (e) => e.slice(1).reduce((e, t) => Xy(e, t), e[0] ? Array.from(e[0]) : [])), e(this, "getPlaybackStateForBufferedRanges", (e, t) => $t(t, e) ? "playing" : "buffering"), this.logger = r, this.mediaElement = a, this.emitter = i;
10532
10612
  }
10533
10613
  };
10534
- Py = Ry, e(Ry, "create", (e, t, n) => {
10535
- let r = new Py(e, t, n);
10614
+ Hy = Ky, e(Ky, "create", (e, t, n) => {
10615
+ let r = new Hy(e, t, n);
10536
10616
  return r.setTrackContexts(), r.mediaSource.on("source ended", r.onSourceEnded), r.mediaSource.on("source open", r.onSourceOpen), n.addEventListener("error", r.onMediaElementError), n.addEventListener("waiting", r.onPlaybackStall), n.addEventListener("stalled", r.onPlaybackStall), n.addEventListener("playing", r.onPlaybackProgress), n.addEventListener("pause", r.onPlaybackPauseOrSeek), n.addEventListener("play", r.onPlay), n.addEventListener("seeking", r.onPlaybackPauseOrSeek), r.mediaSource.attach(n), r;
10537
10617
  });
10538
- var zy = (e, t) => {
10618
+ var qy = (e, t) => {
10539
10619
  for (let r = 0; r < t.length; r++) {
10540
10620
  let i = t[r];
10541
10621
  if (i) {
@@ -10546,11 +10626,11 @@ var zy = (e, t) => {
10546
10626
  }
10547
10627
  }
10548
10628
  }
10549
- }, By = (e, t) => {
10629
+ }, Jy = (e, t) => {
10550
10630
  var n;
10551
10631
  let r = e.renditionId !== t.renditionId, i = e.channelId !== t.channelId, a = ((n = e.timestamp) == null ? 0 : n) > t.timestamp, o = e.type === "video" && t.type === "video" && "levelIdc" in e && "levelIdc" in t && e.levelIdc !== t.levelIdc, s = !1;
10552
10632
  return e.type === "video" && t.type === "video" && "width" in e && "width" in t && (s = t.width !== e.width || t.height !== e.height), i || r || a || s || o;
10553
- }, Vy = 32, Hy = (e, t) => {
10633
+ }, Yy = 32, Xy = (e, t) => {
10554
10634
  let n = [], r = 0, i = 0;
10555
10635
  for (; r < e.length && i < t.length;) {
10556
10636
  let a = e[r], o = t[i];
@@ -10562,16 +10642,16 @@ var zy = (e, t) => {
10562
10642
  }), a.end <= o.end ? r++ : i++;
10563
10643
  }
10564
10644
  return n;
10565
- }, Uy = (e) => {
10645
+ }, Zy = (e) => {
10566
10646
  let t = e.pendingSamplesOffset;
10567
10647
  if (t !== 0) {
10568
10648
  if (t >= e.pendingSamples.length) {
10569
10649
  e.pendingSamples = [], e.pendingSamplesOffset = 0;
10570
10650
  return;
10571
10651
  }
10572
- t < Vy || t * 2 < e.pendingSamples.length || (e.pendingSamples = e.pendingSamples.slice(t), e.pendingSamplesOffset = 0);
10652
+ t < Yy || t * 2 < e.pendingSamples.length || (e.pendingSamples = e.pendingSamples.slice(t), e.pendingSamplesOffset = 0);
10573
10653
  }
10574
- }, Wy = function() {
10654
+ }, Qy = function() {
10575
10655
  var e = t(function* (e, t, n) {
10576
10656
  for (e.isWorkingOnPendingSamples = !0; e.pendingSamplesOffset < e.pendingSamples.length;) {
10577
10657
  let r = [], i = e.pendingSamplesOffset;
@@ -10579,7 +10659,7 @@ var zy = (e, t) => {
10579
10659
  i = t;
10580
10660
  let a = e.pendingSamples[t], o = e.pendingSamples[t + 1];
10581
10661
  if (a && (r.push(a), o)) {
10582
- if (By(a, o)) break;
10662
+ if (Jy(a, o)) break;
10583
10663
  let e = (a.timestamp + a.duration) / a.timescale;
10584
10664
  if (o.timestamp / o.timescale - e > .1) break;
10585
10665
  }
@@ -10587,14 +10667,14 @@ var zy = (e, t) => {
10587
10667
  }
10588
10668
  let a = r[0];
10589
10669
  if (!a) break;
10590
- yield t(r, e.previousSample ? By(e.previousSample, a) : !0), e.pendingSamplesOffset = i + 1, e.previousSample = r[r.length - 1], Uy(e);
10670
+ yield t(r, e.previousSample ? Jy(e.previousSample, a) : !0), e.pendingSamplesOffset = i + 1, e.previousSample = r[r.length - 1], Zy(e);
10591
10671
  }
10592
10672
  e.isWorkingOnPendingSamples = !1;
10593
10673
  });
10594
10674
  return function(t, n, r) {
10595
10675
  return e.apply(this, arguments);
10596
10676
  };
10597
- }(), Gy, Ky = class {
10677
+ }(), $y, eb = class {
10598
10678
  constructor(n, r) {
10599
10679
  var i = this;
10600
10680
  e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "element", void 0), e(this, "pictureInPictureWindow", void 0), e(this, "unload", () => {
@@ -10626,10 +10706,10 @@ var zy = (e, t) => {
10626
10706
  }()), e(this, "isWebkitPresentationModeSupported", () => !!this.element && st(this.element)), this.emitter = n, this.logger = r, this.emitter.on("add picture in picture listener", this.onEnablePictureInPicture);
10627
10707
  }
10628
10708
  };
10629
- Gy = Ky, e(Ky, "create", (e, t) => new Gy(e, t));
10709
+ $y = eb, e(eb, "create", (e, t) => new $y(e, t));
10630
10710
  //#endregion
10631
10711
  //#region ../../libs/web-sdk/src/modules/PlaybackModule.ts
10632
- var qy, Jy = class {
10712
+ var tb, nb = class {
10633
10713
  constructor(t, n, r, i) {
10634
10714
  e(this, "emitter", void 0), e(this, "logger", void 0), e(this, "clockSource", void 0), e(this, "state", "buffering"), e(this, "bufferFullness", 0), e(this, "targetBufferTime", void 0), e(this, "lastBufferStateEvent", "drained"), e(this, "firstFrameTime", void 0), e(this, "currentTimeIsInRange", !1), e(this, "needsInputForAudioCount", 0), e(this, "needsInputForVideoCount", 0), e(this, "unload", () => {
10635
10715
  this.emitter.off("buffer state", this.onBufferedStateChanged), this.emitter.off("needs user input", this.onNeedsUserInput);
@@ -10647,24 +10727,24 @@ var qy, Jy = class {
10647
10727
  }), this.emitter = t, this.logger = n, this.clockSource = r, this.targetBufferTime = i, this.emitter.on("buffer state", this.onBufferedStateChanged), this.emitter.on("needs user input", this.onNeedsUserInput), this.emitter.emit("target buffer time", i);
10648
10728
  }
10649
10729
  };
10650
- qy = Jy, e(Jy, "create", (e, t, n, r) => new qy(e, t, n, r));
10730
+ tb = nb, e(nb, "create", (e, t, n, r) => new tb(e, t, n, r));
10651
10731
  //#endregion
10652
10732
  //#region ../../libs/web-sdk/src/modules/QualityOfServiceModule.ts
10653
- var Yy, Xy = () => ({
10733
+ var rb, ib = () => ({
10654
10734
  upgradesFromLevel: [],
10655
10735
  downgradesFromLevel: [],
10656
10736
  bufferingRanges: [],
10657
10737
  activeRanges: [],
10658
10738
  decodeRate: 2 ** 53 - 1
10659
- }), Zy = () => ({
10739
+ }), ab = () => ({
10660
10740
  levels: {},
10661
10741
  levelDowngrades: [],
10662
10742
  levelUpgrades: [],
10663
10743
  bufferFullness: 0,
10664
- general: Xy()
10665
- }), Qy = class {
10744
+ general: ib()
10745
+ }), ob = class {
10666
10746
  constructor(t, n, i) {
10667
- e(this, "minBufferFullnessLengthForRegression", 6), e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "timers", A.create()), e(this, "metrics", Zy()), e(this, "bufferFullness", new r(30)), e(this, "bufferFullnessRegression", void 0), e(this, "currentLevel", void 0), e(this, "isSuspended", !1), e(this, "_fatalQosCount", 0), e(this, "targetBufferTime", 0), e(this, "renditionLevelSource", void 0), e(this, "qualityIndexOrder", []), e(this, "hasPlayedInSession", !1), e(this, "hasAsserted", !1), e(this, "load", () => {
10747
+ e(this, "minBufferFullnessLengthForRegression", 6), e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "timers", A.create()), e(this, "metrics", ab()), e(this, "bufferFullness", new r(30)), e(this, "bufferFullnessRegression", void 0), e(this, "currentLevel", void 0), e(this, "isSuspended", !1), e(this, "_fatalQosCount", 0), e(this, "targetBufferTime", 0), e(this, "renditionLevelSource", void 0), e(this, "qualityIndexOrder", []), e(this, "hasPlayedInSession", !1), e(this, "hasAsserted", !1), e(this, "load", () => {
10668
10748
  this.emitter.on("playback state", this.onPlaybackState), this.emitter.on("buffer fullness", this.onBufferFullness), this.emitter.on("rendition level changed", this.onRenditionLevelChanged), this.emitter.on("video decode rate", this.onVideoDecodeRate), this.emitter.on("target buffer time", this.onTargetBufferTime), this.emitter.on("connection state", this.onConnectionState);
10669
10749
  }), e(this, "unload", () => {
10670
10750
  this.emitter.off("playback state", this.onPlaybackState), this.emitter.off("buffer fullness", this.onBufferFullness), this.emitter.off("rendition level changed", this.onRenditionLevelChanged), this.emitter.off("video decode rate", this.onVideoDecodeRate), this.emitter.off("target buffer time", this.onTargetBufferTime), this.emitter.off("connection state", this.onConnectionState), this.suspend();
@@ -10732,14 +10812,14 @@ var Yy, Xy = () => ({
10732
10812
  let d = !1;
10733
10813
  if (e.from) {
10734
10814
  var f;
10735
- let e = (f = this.metrics.levels[l]) == null ? Xy() : f;
10815
+ let e = (f = this.metrics.levels[l]) == null ? ib() : f;
10736
10816
  l < u ? e.upgradesFromLevel.push(performance.now()) : e.downgradesFromLevel.push(performance.now()), Jt(e.activeRanges);
10737
10817
  let t = e.bufferingRanges[e.bufferingRanges.length - 1];
10738
10818
  d = !!t && !t.end, Jt(e.bufferingRanges), this.metrics.levels[l] = e;
10739
10819
  }
10740
10820
  if (e.to) {
10741
10821
  var p;
10742
- let e = (p = this.metrics.levels[u]) == null ? Xy() : p;
10822
+ let e = (p = this.metrics.levels[u]) == null ? ib() : p;
10743
10823
  Yt(e.activeRanges), d && Yt(e.bufferingRanges), this.metrics.levels[u] = e, this.currentLevel = u;
10744
10824
  }
10745
10825
  }), e(this, "onBufferFullness", (e) => {
@@ -10810,10 +10890,10 @@ var Yy, Xy = () => ({
10810
10890
  Yt(this.metrics.general.activeRanges);
10811
10891
  }
10812
10892
  };
10813
- Yy = Qy, e(Qy, "create", (e, t, n) => new Yy(e, t, n));
10893
+ rb = ob, e(ob, "create", (e, t, n) => new rb(e, t, n));
10814
10894
  //#endregion
10815
10895
  //#region ../../libs/web-sdk/src/modules/RenditionsModule.ts
10816
- var $y, eb = class {
10896
+ var sb, cb = class {
10817
10897
  constructor(t, n) {
10818
10898
  e(this, "renditions", /* @__PURE__ */ new Map()), e(this, "renditionLevels", []), e(this, "languages", []), e(this, "emitter", void 0), e(this, "subscriptionSource", void 0), e(this, "renditionLevelChangeCount", 0), e(this, "unload", () => {
10819
10899
  this.emitter.off("renditions", this.onRenditions), this.emitter.off("subscription changed", this.onSubscriptionChanged);
@@ -10888,10 +10968,10 @@ var $y, eb = class {
10888
10968
  }), e(this, "getCurrentSubscription", () => this.subscriptionSource.getCurrentSubscription()), this.subscriptionSource = n, this.emitter = t, this.emitter.on("renditions", this.onRenditions), this.emitter.on("subscription changed", this.onSubscriptionChanged);
10889
10969
  }
10890
10970
  };
10891
- $y = eb, e(eb, "create", (e, t) => new $y(e, t));
10971
+ sb = cb, e(cb, "create", (e, t) => new sb(e, t));
10892
10972
  //#endregion
10893
10973
  //#region ../../libs/web-sdk/src/modules/SubscriptionModule.ts
10894
- var tb, nb = (e) => JSON.parse(JSON.stringify(e)), rb = 1e4, ib = class {
10974
+ var lb, ub = (e) => JSON.parse(JSON.stringify(e)), db = 1e4, fb = class {
10895
10975
  constructor(t, n, r) {
10896
10976
  e(this, "logger", void 0), e(this, "timers", new A()), e(this, "emitter", void 0), e(this, "targetSubscription", void 0), e(this, "currentSubscription", void 0), e(this, "_isSwitchingSubscription", !1), e(this, "pendingSubscriptionTimeoutId", void 0), e(this, "burstMs", 0), e(this, "unload", () => {
10897
10977
  this.logger.debug("Unloading module..."), this.timers.unload(), this.emitter.off("subscription changed", this.onSubscriptionChanged), this.logger.debug("Unloaded module");
@@ -10929,23 +11009,23 @@ var tb, nb = (e) => JSON.parse(JSON.stringify(e)), rb = 1e4, ib = class {
10929
11009
  this.logger.debug("onSubscriptionChanged", {
10930
11010
  to: e,
10931
11011
  reset: t
10932
- }), t ? this.targetSubscription = nb(this.currentSubscription) : this.currentSubscription = nb(e), this._isSwitchingSubscription = this.isNewSubscription();
11012
+ }), t ? this.targetSubscription = ub(this.currentSubscription) : this.currentSubscription = ub(e), this._isSwitchingSubscription = this.isNewSubscription();
10933
11013
  }), e(this, "scheduleSubscriptionChange", () => {
10934
- this.targetSubscription = nb(this.targetSubscription), this._isSwitchingSubscription = this.isNewSubscription();
11014
+ this.targetSubscription = ub(this.targetSubscription), this._isSwitchingSubscription = this.isNewSubscription();
10935
11015
  let e = this.currentSubscription.channelId, t = this.targetSubscription.channelId, n = e !== t;
10936
11016
  this._isSwitchingSubscription && (n && this.burstMs ? this.setBurst(this.burstMs) : this.setBurst(0), this.pendingSubscriptionTimeoutId && (this.timers.clearTimeout(this.pendingSubscriptionTimeoutId), this.pendingSubscriptionTimeoutId = void 0), n && this.timers.setTimeout(() => {
10937
- this.currentSubscription.channelId === e && this.targetSubscription.channelId === t && (this.logger.warn("Channel switch timeout", t), this.targetSubscription = nb(this.currentSubscription), this.emitter.emit("channel switch timeout", t));
10938
- }, rb), this.pendingSubscriptionTimeoutId = this.timers.setTimeout(() => this.emitter.emit("send signal", {
11017
+ this.currentSubscription.channelId === e && this.targetSubscription.channelId === t && (this.logger.warn("Channel switch timeout", t), this.targetSubscription = ub(this.currentSubscription), this.emitter.emit("channel switch timeout", t));
11018
+ }, db), this.pendingSubscriptionTimeoutId = this.timers.setTimeout(() => this.emitter.emit("send signal", {
10939
11019
  type: "subscribe",
10940
11020
  subscription: this.getTargetSubscription()
10941
11021
  }), 0));
10942
- }), this.logger = t, this.targetSubscription = n, this.currentSubscription = nb(n), this.emitter = r, this.emitter.on("subscription changed", this.onSubscriptionChanged);
11022
+ }), this.logger = t, this.targetSubscription = n, this.currentSubscription = ub(n), this.emitter = r, this.emitter.on("subscription changed", this.onSubscriptionChanged);
10943
11023
  }
10944
11024
  };
10945
- tb = ib, e(ib, "create", (e, t, n) => new tb(e, n, t));
11025
+ lb = fb, e(fb, "create", (e, t, n) => new lb(e, n, t));
10946
11026
  //#endregion
10947
11027
  //#region ../../libs/web-sdk/src/BFrameTracker.ts
10948
- var ab = class t {
11028
+ var pb = class t {
10949
11029
  constructor() {
10950
11030
  e(this, "channelId", void 0), e(this, "renditionId", void 0), e(this, "anchorCts", void 0), e(this, "hasBFramesValue", !1), e(this, "isAwaitingAssessment", !1), e(this, "zeroOffsetSamples", 0), e(this, "omittedBoundaryCrossings", 0), e(this, "hasSeenKeyframe", !1), e(this, "hasObservedReordering", !1), e(this, "rememberedRenditions", new Ct(t.MAX_REMEMBERED_RENDITIONS));
10951
11031
  }
@@ -10981,7 +11061,7 @@ var ab = class t {
10981
11061
  this.channelId = void 0, this.renditionId = void 0, this.anchorCts = void 0, this.hasBFramesValue = !1, this.zeroOffsetSamples = 0, this.omittedBoundaryCrossings = 0, this.hasSeenKeyframe = !1, this.hasObservedReordering = !1, this.isAwaitingAssessment = !0;
10982
11062
  }
10983
11063
  remember(e) {
10984
- this.channelId !== void 0 && this.rememberedRenditions.set(Uv(this.channelId, this.renditionId), e);
11064
+ this.channelId !== void 0 && this.rememberedRenditions.set(Zv(this.channelId, this.renditionId), e);
10985
11065
  }
10986
11066
  latchBFrames() {
10987
11067
  this.hasBFramesValue = !0, this.hasObservedReordering = !0, this.isAwaitingAssessment = !1, this.remember(!0);
@@ -10993,18 +11073,18 @@ var ab = class t {
10993
11073
  this.hasSeenKeyframe && !this.hasObservedReordering && (this.remember(!1), this.hasBFramesValue = !1), this.hasSeenKeyframe = !0, this.omittedBoundaryCrossings = 0;
10994
11074
  }
10995
11075
  resetOnSwitch(e, t) {
10996
- if (!Wv(e, t, this.channelId, this.renditionId)) {
11076
+ if (!Qv(e, t, this.channelId, this.renditionId)) {
10997
11077
  let n = this.channelId !== void 0;
10998
11078
  this.channelId = e, this.renditionId = t, this.anchorCts = void 0, this.zeroOffsetSamples = 0, this.omittedBoundaryCrossings = 0, this.hasSeenKeyframe = !1, this.hasObservedReordering = !1;
10999
- let r = this.rememberedRenditions.get(Uv(e, t));
11079
+ let r = this.rememberedRenditions.get(Zv(e, t));
11000
11080
  this.hasBFramesValue = r == null ? !1 : r, n && (this.isAwaitingAssessment = r === void 0);
11001
11081
  }
11002
11082
  }
11003
11083
  };
11004
- e(ab, "MAX_REMEMBERED_RENDITIONS", 32);
11084
+ e(pb, "MAX_REMEMBERED_RENDITIONS", 32);
11005
11085
  //#endregion
11006
11086
  //#region ../../libs/web-sdk/src/modules/SyncModule.ts
11007
- var ob, sb = 5e3, cb = () => Ne() || Ae(), lb = (e) => e && cb() ? 100 : 0, ub = (e) => (t) => t > e, db = 100, fb = 1e3, pb = {
11087
+ var mb, hb = 5e3, gb = () => Ne() || Ae(), _b = (e) => e && gb() ? 100 : 0, vb = (e) => (t) => t > e, yb = 100, bb = 1e3, xb = 1e3, Sb = 1e3, Cb = 100, wb = 50, Tb = {
11008
11088
  seek: {
11009
11089
  toleranceMs: 200,
11010
11090
  toleranceMaxMs: 2500,
@@ -11036,7 +11116,7 @@ var ob, sb = 5e3, cb = () => Ne() || Ae(), lb = (e) => e && cb() ? 100 : 0, ub =
11036
11116
  decayCooldownMultiplier: 3,
11037
11117
  decayCheckInterval: 15e3
11038
11118
  }
11039
- }, mb = class {
11119
+ }, Eb = class {
11040
11120
  get driftSamplesToCollect() {
11041
11121
  return this._driftSamplesToCollect;
11042
11122
  }
@@ -11044,14 +11124,15 @@ var ob, sb = 5e3, cb = () => Ne() || Ae(), lb = (e) => e && cb() ? 100 : 0, ub =
11044
11124
  this._driftSamplesToCollect = e, this.driftSamples = new r(e);
11045
11125
  }
11046
11126
  constructor(t, n, i, a, o, s = !0) {
11047
- e(this, "emitter", void 0), e(this, "logger", void 0), e(this, "playbackSource", void 0), e(this, "bufferSource", void 0), e(this, "keyframeTimestamps", new r(10)), e(this, "lastSeekTime", void 0), e(this, "needsMediaSourceRecovery", !1), e(this, "lastAdjustmentTime", performance.now()), e(this, "lastDecayCheckTime", performance.now()), e(this, "syncInterval", void 0), e(this, "currentSyncIntervalMs", db), e(this, "config", void 0), e(this, "state", void 0), e(this, "allowTimeshiftOnAudio", !1), e(this, "syncInfoToleranceMaxMs", 150), e(this, "syncInfoToleranceStep", 20), e(this, "seekOvershoot", void 0), e(this, "timers", A.create()), e(this, "rtt", 0), e(this, "channelSyncInfo", /* @__PURE__ */ new Map()), e(this, "seekAdjustmentCount", 0), e(this, "timeshiftAdjustmentCount", 0), e(this, "syncInfoCorrectionCount", 0), e(this, "playbackRateAdjustmentCount", 0), e(this, "lastPlaybackRateChangeTime", 0), e(this, "seekAdjustmentTimestamps", []), e(this, "timeshiftAdjustmentTimestamps", []), e(this, "_driftSamplesToCollect", 5), e(this, "driftSamples", new r(this._driftSamplesToCollect)), e(this, "timestampOffset", void 0), e(this, "hasObservedBFrames", !1), e(this, "bFrameDetector", new ab()), e(this, "currentChannelId", void 0), e(this, "highestSeenTimestamps", /* @__PURE__ */ new Map()), e(this, "isSuspended", !1), e(this, "isSyncAdjustmentActivated", !1), e(this, "queuedTimeshift", !1), e(this, "playbackState", void 0), e(this, "hasPerformedRecoverySeekInCurrentRecoveryState", !1), e(this, "shouldSeekAfterBuffering", !1), e(this, "usesMse", void 0), e(this, "load", () => {
11048
- this.emitter.on("page active", this.onPageActive), this.emitter.on("pageshow", this.onPageShow), this.setSyncInterval(document.visibilityState === "hidden" ? fb : db);
11127
+ e(this, "emitter", void 0), e(this, "logger", void 0), e(this, "playbackSource", void 0), e(this, "bufferSource", void 0), e(this, "keyframeTimestamps", new r(10)), e(this, "lastSeekTime", void 0), e(this, "needsMediaSourceRecovery", !1), e(this, "lastAdjustmentTime", performance.now()), e(this, "lastDecayCheckTime", performance.now()), e(this, "syncInterval", void 0), e(this, "currentSyncIntervalMs", yb), e(this, "config", void 0), e(this, "state", void 0), e(this, "allowTimeshiftOnAudio", !1), e(this, "syncInfoToleranceMaxMs", 150), e(this, "syncInfoToleranceStep", 20), e(this, "seekOvershoot", void 0), e(this, "timers", A.create()), e(this, "rtt", 0), e(this, "channelSyncInfo", /* @__PURE__ */ new Map()), e(this, "seekAdjustmentCount", 0), e(this, "timeshiftAdjustmentCount", 0), e(this, "syncInfoCorrectionCount", 0), e(this, "playbackRateAdjustmentCount", 0), e(this, "lastPlaybackRateChangeTime", 0), e(this, "seekAdjustmentTimestamps", []), e(this, "timeshiftAdjustmentTimestamps", []), e(this, "_driftSamplesToCollect", 5), e(this, "driftSamples", new r(this._driftSamplesToCollect)), e(this, "timestampOffset", void 0), e(this, "hasObservedBFrames", !1), e(this, "bFrameDetector", new pb()), e(this, "currentChannelId", void 0), e(this, "highestSeenTimestamps", /* @__PURE__ */ new Map()), e(this, "isSuspended", !1), e(this, "isSyncAdjustmentActivated", !1), e(this, "queuedTimeshift", !1), e(this, "playbackState", void 0), e(this, "hasPerformedRecoverySeekInCurrentRecoveryState", !1), e(this, "shouldSeekAfterBuffering", !1), e(this, "shouldSeekWhileStuck", !1), e(this, "hasPerformedStuckSeekInCurrentStillness", !1), e(this, "positionSetBySeek", void 0), e(this, "lastPlayheadPosition", void 0), e(this, "lastPlayheadProgressAt", performance.now()), e(this, "usesMse", void 0), e(this, "load", () => {
11128
+ this.emitter.on("page active", this.onPageActive), this.emitter.on("pageshow", this.onPageShow), this.setSyncInterval(document.visibilityState === "hidden" ? bb : yb);
11049
11129
  }), e(this, "unload", () => {
11050
11130
  this.logger.debug("Unloading module..."), this.emitter.off("rtt", this.updateRtt), this.emitter.off("playback state", this.onPlaybackState), this.emitter.off("page active", this.onPageActive), this.emitter.off("pageshow", this.onPageShow), this.emitter.off("buffers flushed", this.clearBFrameLatch), this.emitter.off("recovered from media error", this.onMediaSourceRecovered), this.clearSyncInterval(), this.timers.unload(), this.logger.debug("Unloaded module");
11051
11131
  }), e(this, "suspend", () => {
11052
11132
  this.isSuspended = !0;
11053
11133
  }), e(this, "unsuspend", () => {
11054
- this.resetSyncState(), this.isSuspended = !1, this.onSync();
11134
+ let e = this.playbackState;
11135
+ this.resetSyncState(), this.playbackState = e, this.isSuspended = !1, this.onSync();
11055
11136
  }), e(this, "deactivateSyncAdjustments", () => {
11056
11137
  this.isSyncAdjustmentActivated = !1;
11057
11138
  }), e(this, "activateSyncAdjustments", () => {
@@ -11062,7 +11143,7 @@ var ob, sb = 5e3, cb = () => Ne() || Ae(), lb = (e) => e && cb() ? 100 : 0, ub =
11062
11143
  var e;
11063
11144
  return (e = this.timestampOffset) == null ? 0 : e;
11064
11145
  }), e(this, "getCurrentChannelId", () => this.currentChannelId), e(this, "resetSyncState", () => {
11065
- this.state.seekToleranceMultiplier = 1, this.state.timeshiftToleranceMultiplier = 1, this.seekAdjustmentTimestamps = [], this.timeshiftAdjustmentTimestamps = [], this.driftSamples.clear(), this.playbackState = void 0, this.hasPerformedRecoverySeekInCurrentRecoveryState = !1, this.clearRecoverySeekFlags();
11146
+ this.state.seekToleranceMultiplier = 1, this.state.timeshiftToleranceMultiplier = 1, this.seekAdjustmentTimestamps = [], this.timeshiftAdjustmentTimestamps = [], this.driftSamples.clear(), this.playbackState = void 0, this.hasPerformedRecoverySeekInCurrentRecoveryState = !1, this.hasPerformedStuckSeekInCurrentStillness = !1, this.clearRecoverySeekFlags();
11066
11147
  }), e(this, "getEffectiveSeekToleranceMs", () => this.config.timeshift.enabled ? this.config.seek.toleranceMs * 2 : this.config.seek.toleranceMs), e(this, "isTimeshiftUnsafe", () => this.usesMse && (this.hasObservedBFrames || this.bFrameDetector.isAwaitingReorderAssessment)), e(this, "clearBFrameLatch", () => {
11067
11148
  this.hasObservedBFrames = !1;
11068
11149
  }), e(this, "latchBFramesIfDetected", () => {
@@ -11086,7 +11167,7 @@ var ob, sb = 5e3, cb = () => Ne() || Ae(), lb = (e) => e && cb() ? 100 : 0, ub =
11086
11167
  }), e(this, "processSample", (e) => {
11087
11168
  var t;
11088
11169
  if (!e.channelId) throw Error("Sample must be assigned to a channel");
11089
- this.currentChannelId || (this.currentChannelId = e.channelId), this.timestampOffset || (this.timestampOffset = e.timestamp / e.timescale * 1e3 - sb);
11170
+ this.currentChannelId || (this.currentChannelId = e.channelId), this.timestampOffset || (this.timestampOffset = e.timestamp / e.timescale * 1e3 - hb);
11090
11171
  let n = e.type === "video" && e.isSync;
11091
11172
  if (this.bFrameDetector.update(e), this.latchBFramesIfDetected(), this.currentChannelId !== e.channelId) {
11092
11173
  let t = 2 ** 53 - 1;
@@ -11103,7 +11184,7 @@ var ob, sb = 5e3, cb = () => Ne() || Ae(), lb = (e) => e && cb() ? 100 : 0, ub =
11103
11184
  this.currentChannelId || (this.currentChannelId = e);
11104
11185
  let i = t.mediaType();
11105
11186
  if (!i) throw Error("Fragment must have a media type");
11106
- this.timestampOffset || (this.timestampOffset = t.baseMediaDecodeTime() / t.timescale() * 1e3 - sb);
11187
+ this.timestampOffset || (this.timestampOffset = t.baseMediaDecodeTime() / t.timescale() * 1e3 - hb);
11107
11188
  let a = i === "video" && t.startsWithKeyframe();
11108
11189
  if (i === "video" && (this.bFrameDetector.updateFromFragment({
11109
11190
  type: i,
@@ -11121,7 +11202,7 @@ var ob, sb = 5e3, cb = () => Ne() || Ae(), lb = (e) => e && cb() ? 100 : 0, ub =
11121
11202
  let o = this.timestampOffset * t.timescale() / 1e3;
11122
11203
  return t.updateBaseMediaDecodeTime(t.baseMediaDecodeTime() - o), a && this.keyframeTimestamps.push(t.baseMediaDecodeTime() / t.timescale() * 1e3), this.highestSeenTimestamps.set(i, Math.max((r = this.highestSeenTimestamps.get(i)) == null ? 0 : r, t.baseMediaDecodeTime() / t.timescale() * 1e3)), t;
11123
11204
  }), e(this, "forceSeek", () => {
11124
- this.logger.debug("Forcing seek", { amount: this.serverCurrentTime - this.playbackSource.currentTime }), this.clearRecoverySeekFlags(), this.playbackSource.currentTime = this.serverCurrentTime;
11205
+ this.logger.debug("Forcing seek", { amount: this.serverCurrentTime - this.playbackSource.currentTime }), this.clearRecoverySeekFlags(), this.playbackSource.currentTime = this.serverCurrentTime, this.positionSetBySeek = this.playbackSource.currentTime;
11125
11206
  }), e(this, "forceTimeshift", () => {
11126
11207
  this.queuedTimeshift = !0;
11127
11208
  }), e(this, "setPlaybackRateAdjustmentEnabled", (e) => {
@@ -11224,7 +11305,7 @@ var ob, sb = 5e3, cb = () => Ne() || Ae(), lb = (e) => e && cb() ? 100 : 0, ub =
11224
11305
  return;
11225
11306
  }
11226
11307
  if (n >= this.getEffectiveSeekToleranceMs() || n < this.currentTimeshiftToleranceMs()) return;
11227
- let r = performance.now() - this.config.seek.timeoutMs * this.state.timeshiftToleranceMultiplier, i = this.timeshiftAdjustmentTimestamps.filter(ub(r)).length;
11308
+ let r = performance.now() - this.config.seek.timeoutMs * this.state.timeshiftToleranceMultiplier, i = this.timeshiftAdjustmentTimestamps.filter(vb(r)).length;
11228
11309
  if (i && this.state.timeshiftToleranceMultiplier > 2) {
11229
11310
  this.logger.debug("Too many timeshifts within sliding window", {
11230
11311
  timeshiftCooldownThreshold: r,
@@ -11234,20 +11315,44 @@ var ob, sb = 5e3, cb = () => Ne() || Ae(), lb = (e) => e && cb() ? 100 : 0, ub =
11234
11315
  }
11235
11316
  this.applyTimeshift(n);
11236
11317
  }), e(this, "clearRecoverySeekFlags", () => {
11237
- this.shouldSeekAfterBuffering = !1;
11318
+ this.shouldSeekAfterBuffering = !1, this.shouldSeekWhileStuck = !1;
11238
11319
  }), e(this, "hasActiveRecoveryTrigger", () => this.playbackState === "buffering"), e(this, "hasPendingRecoverySeek", () => (this.refreshRecoverySeekState(), this.getRecoverySeekReason() !== void 0)), e(this, "refreshRecoverySeekState", () => {
11239
11320
  var e, t;
11240
- if (!this.hasActiveRecoveryTrigger() || !this.usesMse || this.hasPerformedRecoverySeekInCurrentRecoveryState) {
11321
+ if (this.observePlayheadProgress(), !this.hasActiveRecoveryTrigger() || !this.usesMse) {
11241
11322
  this.clearRecoverySeekFlags();
11242
11323
  return;
11243
11324
  }
11325
+ if (this.shouldSeekWhileStuck = !this.hasPerformedStuckSeekInCurrentStillness && this.isPlayheadStuckInBuffer(), this.hasPerformedRecoverySeekInCurrentRecoveryState) {
11326
+ this.shouldSeekAfterBuffering = !1;
11327
+ return;
11328
+ }
11244
11329
  let n = (e = (t = this.bufferSource).getNextBufferedRangeStart) == null ? void 0 : e.call(t, this.playbackSource.currentTime);
11245
11330
  return this.shouldSeekAfterBuffering = n !== void 0, n;
11331
+ }), e(this, "observePlayheadProgress", () => {
11332
+ let e = this.playbackSource.currentTime, t = e !== this.lastPlayheadPosition, n = t && (this.positionSetBySeek === void 0 || e - this.positionSetBySeek > wb);
11333
+ this.positionSetBySeek = void 0, (n || this.playbackSource.isPaused) && (this.hasPerformedStuckSeekInCurrentStillness = !1), (t || this.playbackSource.isPaused || this.isSeeking()) && (this.lastPlayheadPosition = e, this.lastPlayheadProgressAt = performance.now());
11334
+ }), e(this, "isPlayheadStuckInBuffer", () => {
11335
+ var e, t;
11336
+ if (performance.now() - this.lastPlayheadProgressAt < xb) return !1;
11337
+ let n = this.playbackSource.currentTime, r = (e = (t = this.bufferSource).getBufferedEndAt) == null ? void 0 : e.call(t, n);
11338
+ return r !== void 0 && r - n >= Sb;
11246
11339
  }), e(this, "getRecoverySeekReason", () => {
11247
11340
  if (this.needsMediaSourceRecovery) return "media source reopen";
11341
+ if (this.shouldSeekWhileStuck) return "stuck in buffer";
11248
11342
  if (this.shouldSeekAfterBuffering) return "buffering";
11249
- }), e(this, "shouldSkipNormalSeek", (e) => e < 0 && -e < this.currentAheadToleranceMs() || e > 0 && e < this.currentSeekToleranceMs() || Math.abs(e) < 1 ? !0 : !this.isAllowedToSync()), e(this, "shouldDeferRecoverySeek", (e, t) => t !== void 0 && t > e), e(this, "buildSeekPlan", (e, t) => {
11343
+ }), e(this, "shouldSkipNormalSeek", (e) => e < 0 && -e < this.currentAheadToleranceMs() || e > 0 && e < this.currentSeekToleranceMs() || Math.abs(e) < 1 ? !0 : !this.isAllowedToSync()), e(this, "shouldDeferRecoverySeek", (e, t) => t !== void 0 && t > e), e(this, "buildStuckInBufferSeekPlan", () => {
11344
+ var e, t;
11345
+ let n = this.playbackSource.currentTime, r = (e = (t = this.bufferSource).getBufferedEndAt) == null ? void 0 : e.call(t, n), i = n + Math.max(this.seekOvershoot, Cb);
11346
+ if (r === void 0 || i >= r) return;
11347
+ let a = this.findKeyframeCloseToTimestamp(i);
11348
+ return {
11349
+ closestKeyFrame: a,
11350
+ keyframeSearchTime: i,
11351
+ targetCurrentTime: a && a > i && a < r ? a : i
11352
+ };
11353
+ }), e(this, "buildSeekPlan", (e, t) => {
11250
11354
  var n, r;
11355
+ if (t === "stuck in buffer") return this.buildStuckInBufferSeekPlan();
11251
11356
  let i = this.playbackSource.currentTime + e, a = t ? (n = (r = this.bufferSource).getNextBufferedRangeStart) == null ? void 0 : n.call(r, this.playbackSource.currentTime) : void 0;
11252
11357
  if (t === "media source reopen" && a === void 0) return;
11253
11358
  let o = i + this.seekOvershoot, s = this.playbackSource.currentTime + this.seekOvershoot, c = t ? Math.max(o, s) : o;
@@ -11283,7 +11388,9 @@ var ob, sb = 5e3, cb = () => Ne() || Ae(), lb = (e) => e && cb() ? 100 : 0, ub =
11283
11388
  seekToleranceMultiplier: this.state.seekToleranceMultiplier
11284
11389
  }), this.needsMediaSourceRecovery = !1;
11285
11390
  let i = performance.now();
11286
- this.lastSeekTime = i, t && (this.hasPerformedRecoverySeekInCurrentRecoveryState = !0), this.clearRecoverySeekFlags(), this.driftSamples.clear(), this.seekAdjustmentTimestamps.push(i), this.seekAdjustmentCount++, this.playbackSource.currentTime = r.targetCurrentTime + Math.min(n, this.bufferSource.getTargetBufferTime()), this.applyBackoff();
11391
+ this.lastSeekTime = i, t && t !== "stuck in buffer" && (this.hasPerformedRecoverySeekInCurrentRecoveryState = !0), this.clearRecoverySeekFlags(), this.driftSamples.clear(), this.seekAdjustmentTimestamps.push(i), this.seekAdjustmentCount++;
11392
+ let a = t === "stuck in buffer" ? 0 : Math.min(n, this.bufferSource.getTargetBufferTime());
11393
+ this.playbackSource.currentTime = r.targetCurrentTime + a, this.positionSetBySeek = this.playbackSource.currentTime, t === "stuck in buffer" && (this.hasPerformedStuckSeekInCurrentStillness = !0, this.lastPlayheadPosition = this.playbackSource.currentTime, this.positionSetBySeek = void 0), this.applyBackoff();
11287
11394
  }), e(this, "applyTimeshift", (e) => {
11288
11395
  var t;
11289
11396
  let n = (t = e == null ? this.drift : e) == null ? 0 : t;
@@ -11312,7 +11419,7 @@ var ob, sb = 5e3, cb = () => Ne() || Ae(), lb = (e) => e && cb() ? 100 : 0, ub =
11312
11419
  if (!r && !this.isAllowedToSyncIgnoringCooldown() || r && (this.isSeeking() || !this.currentChannelId || this.isSuspended || this.playbackSource.isPaused) || (this.driftSamples.push(t), !this.isSeekCooldownExpired()) || !r && this.driftSamples.items().length < this.driftSamplesToCollect && Math.abs(t) < 2e3) return;
11313
11420
  let i = r ? t : gt(this.driftSamples.items());
11314
11421
  if (!r && this.tryPlaybackRateSync(i) || !r && this.shouldSkipNormalSeek(i)) return;
11315
- let a = performance.now() - this.config.seek.timeoutMs * this.state.seekToleranceMultiplier, o = this.seekAdjustmentTimestamps.filter(ub(a)).length, s = this.currentEmergencySeekToleranceMs(), c = i > 0 && i >= s;
11422
+ let a = performance.now() - this.config.seek.timeoutMs * this.state.seekToleranceMultiplier, o = this.seekAdjustmentTimestamps.filter(vb(a)).length, s = this.currentEmergencySeekToleranceMs(), c = i > 0 && i >= s;
11316
11423
  if (o && this.state.seekToleranceMultiplier > 2 && !r && !c) {
11317
11424
  this.logger.debug("Too many seek adjustments within sliding window", {
11318
11425
  seekCooldownThreshold: a,
@@ -11333,17 +11440,17 @@ var ob, sb = 5e3, cb = () => Ne() || Ae(), lb = (e) => e && cb() ? 100 : 0, ub =
11333
11440
  e === "playing" && (this.needsMediaSourceRecovery = !1);
11334
11441
  let t = this.playbackState === "buffering";
11335
11442
  if (this.playbackState = e, e !== "buffering") {
11336
- this.hasPerformedRecoverySeekInCurrentRecoveryState = !1, this.clearRecoverySeekFlags();
11443
+ this.hasPerformedRecoverySeekInCurrentRecoveryState = !1, this.hasPerformedStuckSeekInCurrentStillness = !1, this.clearRecoverySeekFlags();
11337
11444
  return;
11338
11445
  }
11339
- if (t || (this.hasPerformedRecoverySeekInCurrentRecoveryState = !1), this.refreshRecoverySeekState() !== void 0) {
11446
+ if (t || (this.hasPerformedRecoverySeekInCurrentRecoveryState = !1), this.refreshRecoverySeekState() !== void 0 || this.shouldSeekWhileStuck) {
11340
11447
  this.onSync();
11341
11448
  return;
11342
11449
  }
11343
11450
  }), e(this, "onPageActive", (e) => {
11344
- this.setSyncInterval(e ? db : fb), e && this.onSync();
11451
+ this.setSyncInterval(e ? yb : bb), e && this.onSync();
11345
11452
  }), e(this, "onPageShow", (e) => {
11346
- e.persisted && (this.setSyncInterval(document.visibilityState === "hidden" ? fb : db), this.onSync());
11453
+ e.persisted && (this.setSyncInterval(document.visibilityState === "hidden" ? bb : yb), this.onSync());
11347
11454
  }), e(this, "setSyncInterval", (e) => {
11348
11455
  this.syncInterval !== void 0 && this.currentSyncIntervalMs === e || (this.clearSyncInterval(), this.currentSyncIntervalMs = e, this.syncInterval = this.timers.setInterval(this.onSync, e));
11349
11456
  }), e(this, "clearSyncInterval", () => {
@@ -11354,11 +11461,11 @@ var ob, sb = 5e3, cb = () => Ne() || Ae(), lb = (e) => e && cb() ? 100 : 0, ub =
11354
11461
  let t = n >= e - this.config.seek.keyframeSearchBeforeMs, r = n <= e + this.config.seek.keyframeSearchAfterMs;
11355
11462
  if (t && r) return n;
11356
11463
  }
11357
- }), this.logger = n, this.emitter = t, this.playbackSource = i, this.bufferSource = a, this.usesMse = s, this.seekOvershoot = lb(s), this.config = {
11358
- seek: y({}, pb.seek),
11359
- timeshift: y({}, pb.timeshift),
11360
- playbackRate: y({}, pb.playbackRate),
11361
- backoff: y({}, pb.backoff)
11464
+ }), this.logger = n, this.emitter = t, this.playbackSource = i, this.bufferSource = a, this.usesMse = s, this.seekOvershoot = _b(s), this.config = {
11465
+ seek: y({}, Tb.seek),
11466
+ timeshift: y({}, Tb.timeshift),
11467
+ playbackRate: y({}, Tb.playbackRate),
11468
+ backoff: y({}, Tb.backoff)
11362
11469
  }, this.config.timeshift.enabled = o, s || (this.config.seek.toleranceMs = 50, this.config.timeshift.toleranceMs = 20, this.config.seek.aheadToleranceMs = 40), this.state = {
11363
11470
  seekToleranceMultiplier: 1,
11364
11471
  timeshiftToleranceMultiplier: 1
@@ -11420,10 +11527,10 @@ var ob, sb = 5e3, cb = () => Ne() || Ae(), lb = (e) => e && cb() ? 100 : 0, ub =
11420
11527
  return this.serverCurrentTime - this.playbackSource.currentTime;
11421
11528
  }
11422
11529
  };
11423
- ob = mb, e(mb, "create", (e, t, n, r, i, a = !0) => new ob(e, t, n, r, i, a));
11530
+ mb = Eb, e(Eb, "create", (e, t, n, r, i, a = !0) => new mb(e, t, n, r, i, a));
11424
11531
  //#endregion
11425
11532
  //#region ../../libs/web-sdk/src/modules/TelemetryModule.ts
11426
- var hb, gb = {
11533
+ var Db, Ob = {
11427
11534
  enabled: !0,
11428
11535
  interval: 3e4,
11429
11536
  includeErrors: !0,
@@ -11432,11 +11539,11 @@ var hb, gb = {
11432
11539
  maxRetries: 10,
11433
11540
  maxErrorReports: 50,
11434
11541
  maxEvents: 50
11435
- }, _b = (e, t) => y(y({}, t), {}, {
11542
+ }, kb = (e, t) => y(y({}, t), {}, {
11436
11543
  type: e,
11437
11544
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
11438
11545
  discriminator: "web"
11439
- }), vb = class {
11546
+ }), Ab = class {
11440
11547
  constructor(n, i, a, o) {
11441
11548
  var s = this;
11442
11549
  e(this, "logger", void 0), e(this, "timers", new A()), e(this, "emitter", void 0), e(this, "options", void 0), e(this, "parentContext", void 0), e(this, "unsentLines", new r(100)), e(this, "retries", 0), e(this, "errorCount", 0), e(this, "eventCount", 0), e(this, "statsCount", 0), e(this, "unload", () => {
@@ -11453,7 +11560,7 @@ var hb, gb = {
11453
11560
  initiator: "interval"
11454
11561
  }, n = {}) => {
11455
11562
  if (!this.options.includeStats) return;
11456
- let r = this.parentContext.getStatistics(), i = _b("stats", y(y(y({}, n), r), {}, {
11563
+ let r = this.parentContext.getStatistics(), i = kb("stats", y(y(y({}, n), r), {}, {
11457
11564
  isFinal: e,
11458
11565
  initiator: t,
11459
11566
  count: this.statsCount++
@@ -11461,7 +11568,7 @@ var hb, gb = {
11461
11568
  this.unsentLines.push(i);
11462
11569
  }), e(this, "addEvent", (e) => {
11463
11570
  if (!this.options.includeEvents || this.eventCount > this.options.maxEvents) return;
11464
- let t = _b("event", y(y({}, this.parentContext.getStatistics()), e));
11571
+ let t = kb("event", y(y({}, this.parentContext.getStatistics()), e));
11465
11572
  this.eventCount++, this.unsentLines.push(t);
11466
11573
  }), e(this, "getStatistics", () => ({ errorCount: this.errorCount })), e(this, "send", function() {
11467
11574
  var e = t(function* (e) {
@@ -11506,14 +11613,14 @@ var hb, gb = {
11506
11613
  let { includeErrors: t, maxErrorReports: n } = this.options;
11507
11614
  if (!(e instanceof j) || e.code() === "channel_not_live" || !t || (this.errorCount++, this.errorCount > n)) return;
11508
11615
  let r = this.parentContext.getStatistics();
11509
- this.unsentLines.push(_b("error", y(y({}, r), e.toStringifiable())));
11510
- }), this.logger = n, this.emitter = i, this.options = y(y({}, gb), a), this.parentContext = o;
11616
+ this.unsentLines.push(kb("error", y(y({}, r), e.toStringifiable())));
11617
+ }), this.logger = n, this.emitter = i, this.options = y(y({}, Ob), a), this.parentContext = o;
11511
11618
  }
11512
11619
  };
11513
- hb = vb, e(vb, "create", (e, t, n, r) => new hb(e, t, n, r));
11620
+ Db = Ab, e(Ab, "create", (e, t, n, r) => new Db(e, t, n, r));
11514
11621
  //#endregion
11515
11622
  //#region ../../libs/web-sdk/src/modules/UnpauseModule.ts
11516
- var yb, bb = class {
11623
+ var jb, Mb = class {
11517
11624
  constructor(t, n, r) {
11518
11625
  e(this, "logger", void 0), e(this, "elements", void 0), e(this, "documentState", void 0), e(this, "timers", new A()), e(this, "unload", () => {
11519
11626
  this.timers.unload();
@@ -11522,10 +11629,10 @@ var yb, bb = class {
11522
11629
  }), this.logger = t, this.elements = n, this.documentState = r, this.timers.setInterval(this.unpause, 100);
11523
11630
  }
11524
11631
  };
11525
- yb = bb, e(bb, "create", (e, t, n) => new yb(e, t, n));
11632
+ jb = Mb, e(Mb, "create", (e, t, n) => new jb(e, t, n));
11526
11633
  //#endregion
11527
11634
  //#region ../../libs/web-sdk/src/OptionsProvider.ts
11528
- var xb = [
11635
+ var Nb = [
11529
11636
  "minBufferTime",
11530
11637
  "maxBufferTime",
11531
11638
  "burstEnabled",
@@ -11534,10 +11641,10 @@ var xb = [
11534
11641
  "offscreenCanvasEnabled",
11535
11642
  "videoCodecs"
11536
11643
  ];
11537
- function Sb(e) {
11538
- return xb.includes(e);
11644
+ function Pb(e) {
11645
+ return Nb.includes(e);
11539
11646
  }
11540
- var Cb = class {
11647
+ var Fb = class {
11541
11648
  constructor(t) {
11542
11649
  e(this, "options", void 0), e(this, "overrides", /* @__PURE__ */ new Map()), this.options = t;
11543
11650
  }
@@ -11551,7 +11658,7 @@ var Cb = class {
11551
11658
  this.options[e] = t;
11552
11659
  }
11553
11660
  get(e, t) {
11554
- if (t && Sb(e)) {
11661
+ if (t && Pb(e)) {
11555
11662
  var n;
11556
11663
  let r = (n = this.overrides.get(t)) == null ? void 0 : n[e];
11557
11664
  if (r !== void 0) return r;
@@ -11562,7 +11669,7 @@ var Cb = class {
11562
11669
  var n;
11563
11670
  return (n = this.overrides.get(t)) == null ? void 0 : n[e];
11564
11671
  }
11565
- }, wb = 6, Tb = (e) => {
11672
+ }, Ib = 6, Lb = (e) => {
11566
11673
  let t = [e], n = 0, r = 0, i = !1, a = (e, t) => {
11567
11674
  var i, a;
11568
11675
  if (e.flags && Ms(e.flags)) {
@@ -11574,7 +11681,7 @@ var Cb = class {
11574
11681
  return u > 0 && (r = u), y(y({}, e), {}, { duration: u > 0 ? u : r });
11575
11682
  };
11576
11683
  return (e, n = !1) => {
11577
- if (e.flags && Ms(e.flags) && n && (i = !i), !(n && t.length < wb && i) && t.length > 0) {
11684
+ if (e.flags && Ms(e.flags) && n && (i = !i), !(n && t.length < Ib && i) && t.length > 0) {
11578
11685
  i = !1;
11579
11686
  let n = e;
11580
11687
  for (let e = t.length - 1; e > 0; e--) {
@@ -11587,13 +11694,13 @@ var Cb = class {
11587
11694
  }
11588
11695
  return t.push(e), [];
11589
11696
  };
11590
- }, Eb = ["mse", "wasm"], Db = (e) => e == null ? Eb : e, Ob = (e) => {
11697
+ }, Rb = ["mse", "wasm"], zb = (e) => e == null ? Rb : e, Bb = (e) => {
11591
11698
  if (!e) return !1;
11592
11699
  let t = e.headers && Object.keys(e.headers).length > 0, n = e.queryParams && Object.keys(e.queryParams).length > 0;
11593
11700
  return !!(t || n);
11594
- }, kb = (e, t, n) => {
11595
- if (Ob(n)) return "mse";
11596
- let r = Db(e);
11701
+ }, Vb = (e, t, n) => {
11702
+ if (Bb(n)) return "mse";
11703
+ let r = zb(e);
11597
11704
  for (let e of r) switch (e) {
11598
11705
  case "mse":
11599
11706
  if (t) return "mse";
@@ -11604,7 +11711,7 @@ var Cb = class {
11604
11711
  case "wasm": return "wasm";
11605
11712
  }
11606
11713
  return "wasm";
11607
- }, Ab = (e, t, n) => {
11714
+ }, Hb = (e, t, n) => {
11608
11715
  if (on(t)) return y(y({}, e), {}, {
11609
11716
  type: "video",
11610
11717
  codec: t.codec,
@@ -11625,12 +11732,12 @@ var Cb = class {
11625
11732
  data: e.payload,
11626
11733
  duration: 0
11627
11734
  });
11628
- }, jb = ({ average: e, last: t, max: n, min: r }) => ({
11735
+ }, Ub = ({ average: e, last: t, max: n, min: r }) => ({
11629
11736
  average: Math.round(e),
11630
11737
  last: Math.round(t),
11631
11738
  max: Math.round(n),
11632
11739
  min: Math.round(r)
11633
- }), Mb = [
11740
+ }), Wb = [
11634
11741
  "timeSpentBuffering",
11635
11742
  "timePerBufferingEvent",
11636
11743
  "drift",
@@ -11642,24 +11749,24 @@ var Cb = class {
11642
11749
  "videoKeyframeIntervalMs",
11643
11750
  "timeToConnected",
11644
11751
  "mediaSourceOpenTime"
11645
- ], Nb = [
11752
+ ], Gb = [
11646
11753
  "videoDecodeTime",
11647
11754
  "audioDecodeTime",
11648
11755
  "videoTransportTime",
11649
11756
  "rtt"
11650
- ], Pb = (e) => typeof e == "object" && !!e && "min" in e && "max" in e && "average" in e && "last" in e, Fb = (e) => {
11757
+ ], Kb = (e) => typeof e == "object" && !!e && "min" in e && "max" in e && "average" in e && "last" in e, qb = (e) => {
11651
11758
  let t = y({}, e);
11652
- for (let e of Mb) {
11759
+ for (let e of Wb) {
11653
11760
  let n = t[e];
11654
11761
  typeof n == "number" && (t[e] = Math.round(n));
11655
11762
  }
11656
- for (let e of Nb) {
11763
+ for (let e of Gb) {
11657
11764
  let n = t[e];
11658
- Pb(n) && (t[e] = jb(n));
11765
+ Kb(n) && (t[e] = Ub(n));
11659
11766
  }
11660
11767
  return t;
11661
- }, Ib = (e, t) => e && typeof e == "object" && t in e, Lb = (e) => !(typeof e != "object" || !Ib(e, "channelId") || typeof e.channelId != "string" || !Ib(e, "url") || typeof e.url != "string" || e.channelId.length === 0 || e.url.length === 0), Rb = (e) => {
11662
- if (!Lb(e)) throw new j("Invalid options", {
11768
+ }, Jb = (e, t) => e && typeof e == "object" && t in e, Yb = (e) => !(typeof e != "object" || !Jb(e, "channelId") || typeof e.channelId != "string" || !Jb(e, "url") || typeof e.url != "string" || e.channelId.length === 0 || e.url.length === 0), Xb = (e) => {
11769
+ if (!Yb(e)) throw new j("Invalid options", {
11663
11770
  isFatal: !0,
11664
11771
  code: "invalid_options"
11665
11772
  });
@@ -11668,13 +11775,13 @@ var Cb = class {
11668
11775
  let n = t;
11669
11776
  n[e] === void 0 && delete n[e];
11670
11777
  }), t;
11671
- }, zb = (e) => {
11778
+ }, Zb = (e) => {
11672
11779
  if (typeof e != "object" || !e) throw Error("not an object");
11673
11780
  if (!("video" in e)) throw Error("missing video in subscription");
11674
11781
  if (!("audio" in e)) throw Error("missing audio in subscription");
11675
11782
  if (!("channelId" in e)) throw Error("missing channelId");
11676
11783
  return !0;
11677
- }, Bb = class {
11784
+ }, Qb = class {
11678
11785
  constructor(n) {
11679
11786
  var r = this;
11680
11787
  e(this, "cache", /* @__PURE__ */ new Map()), e(this, "inFlight", /* @__PURE__ */ new Map()), e(this, "checkVideoSupport", function() {
@@ -11735,10 +11842,10 @@ var Cb = class {
11735
11842
  return this.inFlight.set(e, o), o;
11736
11843
  }), this.logger = n;
11737
11844
  }
11738
- }, Vb = 1e4, Hb = 1280 * 720, Ub = /* @__PURE__ */ new WeakMap(), Wb = /* @__PURE__ */ new WeakMap(), Gb = /* @__PURE__ */ new WeakMap(), Kb = class n extends x {
11845
+ }, $b = 1e4, ex = 1280 * 720, tx = /* @__PURE__ */ new WeakMap(), nx = /* @__PURE__ */ new WeakMap(), rx = /* @__PURE__ */ new WeakMap(), ix = class n extends x {
11739
11846
  constructor(r) {
11740
11847
  var o, c, u;
11741
- super(), o = this, e(this, "pictureInPicture", void 0), e(this, "drm", void 0), e(this, "browser", Ue()), e(this, "options", void 0), e(this, "element", void 0), e(this, "playbackSource", void 0), e(this, "emitter", new x()), e(this, "logger", void 0), e(this, "modules", void 0), e(this, "clientIp", void 0), e(this, "sessionId", void 0), e(this, "clientId", nn()), e(this, "_channels", []), e(this, "createdAt", performance.now()), e(this, "offscreenCanvasElement", void 0), e(this, "webCodecsRenditionSupport", void 0), e(this, "hasCalledConnect", !1), e(this, "hasRequestedAudioSession", !1), e(this, "isUserPaused", !1), e(this, "isMediaElementPaused", !1), e(this, "latestEmittedLanguages", []), e(this, "wakeLock", void 0), e(this, "pool", new ae(n.MAX_POOL_SIZE)), e(this, "userAgentInformation", new tn()), e(this, "encryptedMediaExtensions", void 0), i(this, Ub, 0), i(this, Wb, []), e(this, "sampleProcessingSesssions", /* @__PURE__ */ new Map()), e(this, "unbackedSamplesWarned", new Gv()), e(this, "unextractableSamplesWarned", new Gv()), e(this, "sizes", /* @__PURE__ */ new Map()), e(this, "isSuspended", !0), e(this, "inactivityDisconnectInterval", void 0), e(this, "visiblePauseTimeout", void 0), e(this, "offscreenSubtitleInterval", void 0), i(this, Gb, void 0), e(this, "attach", (e) => {
11848
+ super(), o = this, e(this, "pictureInPicture", void 0), e(this, "drm", void 0), e(this, "browser", Ue()), e(this, "options", void 0), e(this, "element", void 0), e(this, "playbackSource", void 0), e(this, "emitter", new x()), e(this, "logger", void 0), e(this, "modules", void 0), e(this, "clientIp", void 0), e(this, "sessionId", void 0), e(this, "clientId", nn()), e(this, "_channels", []), e(this, "createdAt", performance.now()), e(this, "offscreenCanvasElement", void 0), e(this, "webCodecsRenditionSupport", void 0), e(this, "hasCalledConnect", !1), e(this, "hasRequestedAudioSession", !1), e(this, "isUserPaused", !1), e(this, "isMediaElementPaused", !1), e(this, "latestEmittedLanguages", []), e(this, "wakeLock", void 0), e(this, "pool", new ae(n.MAX_POOL_SIZE)), e(this, "userAgentInformation", new tn()), e(this, "encryptedMediaExtensions", void 0), i(this, tx, 0), i(this, nx, []), e(this, "sampleProcessingSesssions", /* @__PURE__ */ new Map()), e(this, "unbackedSamplesWarned", new $v()), e(this, "unextractableSamplesWarned", new $v()), e(this, "sizes", /* @__PURE__ */ new Map()), e(this, "isSuspended", !0), e(this, "inactivityDisconnectInterval", void 0), e(this, "visiblePauseTimeout", void 0), e(this, "offscreenSubtitleInterval", void 0), i(this, rx, void 0), e(this, "attach", (e) => {
11742
11849
  var t;
11743
11850
  (t = this.wakeLock) == null || t.attach(e), e.appendChild(this.element);
11744
11851
  }), e(this, "setElement", (e) => {
@@ -11825,20 +11932,20 @@ var Cb = class {
11825
11932
  }), e(this, "updateTextTracks", (e) => {
11826
11933
  let t = e.filter((e) => e.codec === "webvtt");
11827
11934
  t.forEach((e) => {
11828
- if (!s(Wb, this).find((t) => t.language === e.language)) {
11935
+ if (!s(nx, this).find((t) => t.language === e.language)) {
11829
11936
  if (this.modules.canvasModule) {
11830
11937
  let t = this.modules.canvasModule.textTracks.addTextTrack(e.kind, e.label || e.language || "", e.language || "");
11831
- s(Wb, this).push(t);
11938
+ s(nx, this).push(t);
11832
11939
  } else if (this.mediaElement instanceof HTMLVideoElement) {
11833
11940
  let t = this.mediaElement.addTextTrack(e.kind, e.label || e.language, e.language);
11834
- s(Wb, this).push(t);
11941
+ s(nx, this).push(t);
11835
11942
  }
11836
11943
  }
11837
11944
  });
11838
- for (let e of s(Wb, this)) t.find((t) => t.language === e.language) ? e.mode === "disabled" && (e.mode = "hidden") : e.mode = "disabled";
11945
+ for (let e of s(nx, this)) t.find((t) => t.language === e.language) ? e.mode === "disabled" && (e.mode = "hidden") : e.mode = "disabled";
11839
11946
  this.emit("text tracks", this.textTracks);
11840
11947
  }), e(this, "cleanupTextTracks", (e = this.currentTime - 2e4) => {
11841
- s(Wb, this).forEach((t) => {
11948
+ s(nx, this).forEach((t) => {
11842
11949
  if (t.cues) for (let n of Array.from(t.cues)) n.endTime * 1e3 < e - 2e3 && t.removeCue(n);
11843
11950
  });
11844
11951
  }), e(this, "filterRenditions", function() {
@@ -11997,8 +12104,8 @@ var Cb = class {
11997
12104
  u = void 0, d = void 0, o.logger.warn("Failed to enable OffscreenCanvas; falling back to main thread rendering", { error: e });
11998
12105
  }
11999
12106
  else s && o.logger.warn("OffscreenCanvas requested but not supported; falling back to main thread rendering");
12000
- let f = o.capturesCanvasOnWebKit(u), p = yield ty.create(o.emitter, o.logger.createContext("DecoderModule"), o.options.get("logLevel"), n, o.playbackSource, o.pool, i, a, u, f), { videoRenderer: m } = p.getStatistics(), h = o.modules.canvasModule;
12001
- if (h instanceof Ey) if (m === "OffscreenCanvas" && d) {
12107
+ let f = o.capturesCanvasOnWebKit(u), p = yield ly.create(o.emitter, o.logger.createContext("DecoderModule"), o.options.get("logLevel"), n, o.playbackSource, o.pool, i, a, u, f), { videoRenderer: m } = p.getStatistics(), h = o.modules.canvasModule;
12108
+ if (h instanceof Py) if (m === "OffscreenCanvas" && d) {
12002
12109
  h.setVideoRenderingEnabled(!1);
12003
12110
  let e = o.element;
12004
12111
  e.parentElement ? e.parentElement.replaceChild(d, e) : o.logger.warn("OffscreenCanvas rendering is active but the current element is not attached to the DOM. Updating internal element reference only."), o.offscreenCanvasElement = d, o.setElement(d);
@@ -12010,11 +12117,11 @@ var Cb = class {
12010
12117
  t.parentElement && t.parentElement.replaceChild(e, t), o.setElement(e);
12011
12118
  }
12012
12119
  }
12013
- else h instanceof Ny && (h.setBackgroundPlaybackEnabled(o.isBackgroundPlayEnabled(o.channelId)), m === "OffscreenCanvas" && d ? (h.setOffscreenCanvas(d), o.offscreenCanvasElement = d, f && o.connectWebKitVideoOutput(p, h)) : (h.setVideoTrack(void 0), h.setOffscreenCanvas(void 0), o.offscreenCanvasElement = void 0));
12120
+ else h instanceof Vy && (h.setBackgroundPlaybackEnabled(o.isBackgroundPlayEnabled(o.channelId)), m === "OffscreenCanvas" && d ? (h.setOffscreenCanvas(d), o.offscreenCanvasElement = d, f && o.connectWebKitVideoOutput(p, h)) : (h.setVideoTrack(void 0), h.setOffscreenCanvas(void 0), o.offscreenCanvasElement = void 0));
12014
12121
  (e = o.modules.decoder) == null || e.unload(), o.modules.decoder = p, o.isHiddenWithBackgroundPlayback() && o.modules.decoder.enableBackgroundTimers(), o.modules.decoder.setVideoRenderingEnabled(o.isVideoOnScreen()), o.modules.decoder.load(), o.setupOffscreenSubtitleRouting();
12015
- })), e(this, "capturesCanvasOnWebKit", (e) => !!e && this.browser.platform.isWebKit && this.modules.canvasModule instanceof Ny), e(this, "connectWebKitVideoOutput", (e, t) => {
12122
+ })), e(this, "capturesCanvasOnWebKit", (e) => !!e && this.browser.platform.isWebKit && this.modules.canvasModule instanceof Vy), e(this, "connectWebKitVideoOutput", (e, t) => {
12016
12123
  let n = () => {
12017
- t.setVideoTrack(void 0), this.browser.platform.isIOS && e.setMaxVideoCanvasPixels(Hb);
12124
+ t.setVideoTrack(void 0), this.browser.platform.isIOS && e.setMaxVideoCanvasPixels(ex);
12018
12125
  };
12019
12126
  e.onVideoTrackLost((e) => {
12020
12127
  this.logger.warn("Worker video track lost, falling back to canvas capture", { error: e }), n();
@@ -12022,7 +12129,7 @@ var Cb = class {
12022
12129
  let r = e.videoTrack;
12023
12130
  r ? t.setVideoTrack(r) : n();
12024
12131
  }), e(this, "setupOffscreenSubtitleRouting", () => {
12025
- if (this.offscreenSubtitleInterval !== void 0 && (clearInterval(this.offscreenSubtitleInterval), this.offscreenSubtitleInterval = void 0), !this.offscreenCanvasElement || !this.modules.decoder || this.modules.canvasModule instanceof Ny) return;
12132
+ if (this.offscreenSubtitleInterval !== void 0 && (clearInterval(this.offscreenSubtitleInterval), this.offscreenSubtitleInterval = void 0), !this.offscreenCanvasElement || !this.modules.decoder || this.modules.canvasModule instanceof Vy) return;
12026
12133
  let e = this.modules.decoder, t = this.modules.canvasModule;
12027
12134
  if (!t) return;
12028
12135
  let n = !1;
@@ -12064,7 +12171,7 @@ var Cb = class {
12064
12171
  this.clearVisiblePauseDisconnect(), this.isUserPaused = !1, this.requestAudioSessionOnce(), this.hasCalledConnect ? this.unsuspend() : this.playbackState !== "playing" && (this._connect(), self.addEventListener("__vindral_register_debug__", this.registerDebugInstance), this.modules.timer.setInterval(() => this.cleanupTextTracks(), n.REMOVE_CUE_THRESHOLD)), (e = this.wakeLock) == null || e.enable(), this.playbackState === "paused" && this.playbackSource.isActivated && (this.resetModules(), this.emitter.emit("flush buffers"), this.cleanupTextTracks(2 ** 53 - 1)), this.playbackSource.play(), this.isHiddenWithBackgroundPlayback() && this.scheduleInactivityDisconnect();
12065
12172
  }), e(this, "getStatistics", () => {
12066
12173
  let e = Object.values(this.modules).reduce((e, t) => t && "getStatistics" in t ? y(y({}, e), t.getStatistics()) : e, this.getRuntimeInfo()), t = Math.round(this.timeActive > 0 ? (e.bytesReceived || 0) * 8 / (this.timeActive / 1e3) : 0), n = this.uptime / 36e5, r = Math.max(0, (e.connectCount || 0) - 1), i = n > 0 ? r / n : 0, a = this.timeActive / 6e4, o = Math.max(a, 1), s = a > 0 ? (e.seekAdjustmentCount || 0) / o : 0, c = a > 0 ? (e.timeshiftAdjustmentCount || 0) / o : 0;
12067
- return Fb(y(y({}, e), {}, {
12174
+ return qb(y(y({}, e), {}, {
12068
12175
  averageBitRate: t,
12069
12176
  reconnectsPerHour: i,
12070
12177
  seekAdjustmentsPerMinute: s,
@@ -12073,7 +12180,7 @@ var Cb = class {
12073
12180
  }), e(this, "resetModules", () => {
12074
12181
  Object.values(this.modules).forEach((e) => {
12075
12182
  e && "reset" in e && e.reset();
12076
- }), this.playbackSource instanceof oc && this.modules.adaptivity.reset(Vb), this.sampleProcessingSesssions.clear(), this.cleanupTextTracks(Infinity), this.playbackSource.currentTime = 0, this.playbackSource.isActivated = !1;
12183
+ }), this.playbackSource instanceof oc && this.modules.adaptivity.reset($b), this.sampleProcessingSesssions.clear(), this.cleanupTextTracks(Infinity), this.playbackSource.currentTime = 0, this.playbackSource.isActivated = !1;
12077
12184
  }), e(this, "disconnectForInactivePage", (e) => {
12078
12185
  if (this.clearInactivityDisconnect(), this.emitter.emit("flush buffers"), !this.isBackgroundPlayEnabled(this.channelId)) {
12079
12186
  var t;
@@ -12104,10 +12211,10 @@ var Cb = class {
12104
12211
  e && "unsuspend" in e && e.unsuspend();
12105
12212
  });
12106
12213
  }), e(this, "getRuntimeInfo", () => {
12107
- let e = this.modules.canvasModule instanceof Ny ? !0 : void 0;
12214
+ let e = this.modules.canvasModule instanceof Vy ? !0 : void 0;
12108
12215
  return y({
12109
12216
  uptime: this.uptime,
12110
- version: "4.7.0-1-gb0d0369b",
12217
+ version: "4.7.0-3-gf2e79bd5",
12111
12218
  clientId: this.clientId,
12112
12219
  sessionId: this.sessionId,
12113
12220
  channelId: this.channelId,
@@ -12152,7 +12259,7 @@ var Cb = class {
12152
12259
  if (this.browser.platform.isWebKit || !this.browser.isMobile) return !1;
12153
12260
  let t = (e = this.modules) == null ? void 0 : e.decoder;
12154
12261
  return t ? t.audioWebCodecsInUse : this.isWebCodecsAudioAvailable(this.channelId);
12155
- }), this.options = new Cb(y(y({}, er), Rb(r))), r.telemetryEnabled === void 0 && ["localhost", "127.0.0.1"].includes(location.hostname) && this.options.set("telemetryEnabled", !1);
12262
+ }), this.options = new Fb(y(y({}, er), Xb(r))), r.telemetryEnabled === void 0 && ["localhost", "127.0.0.1"].includes(location.hostname) && this.options.set("telemetryEnabled", !1);
12156
12263
  let d = {
12157
12264
  channelId: this.options.get("channelId"),
12158
12265
  audio: {
@@ -12165,14 +12272,14 @@ var Cb = class {
12165
12272
  height: this.options.get("maxSize").height
12166
12273
  }
12167
12274
  }, f = b.get();
12168
- f.setLevel(this.options.get("logLevel")), f.setDebug(!1), this.logger = f, this.webCodecsRenditionSupport = new Bb(f), r.iosMediaElementEnabled !== void 0 && this.logger.warn("Option iosMediaElementEnabled is deprecated and will be removed in a future release. Use streamToMediaElementEnabled instead.");
12275
+ f.setLevel(this.options.get("logLevel")), f.setDebug(!1), this.logger = f, this.webCodecsRenditionSupport = new Qb(f), r.iosMediaElementEnabled !== void 0 && this.logger.warn("Option iosMediaElementEnabled is deprecated and will be removed in a future release. Use streamToMediaElementEnabled instead.");
12169
12276
  let p = (c = r.streamToMediaElementEnabled) == null ? r.iosMediaElementEnabled : c;
12170
12277
  p !== void 0 && (this.options.set("streamToMediaElementEnabled", p), this.options.set("iosMediaElementEnabled", p)), r.iosBackgroundPlayEnabled !== void 0 && this.logger.warn("Option iosBackgroundPlayEnabled is deprecated and will be removed in a future release. Use backgroundPlayEnabled instead.");
12171
12278
  let m = (u = r.backgroundPlayEnabled) == null ? r.iosBackgroundPlayEnabled : u;
12172
12279
  m !== void 0 && (this.options.set("backgroundPlayEnabled", m), this.options.set("iosBackgroundPlayEnabled", m));
12173
12280
  let g = r.mseEnabled !== void 0, ee = r.decoders !== void 0;
12174
12281
  g && this.logger.warn("Option mseEnabled is deprecated and will be removed in a future release. Use decoders instead (e.g. decoders: [\"wasm\"])."), g && !ee && r.mseEnabled === !1 && this.options.set("decoders", ["wasm"]);
12175
- let _ = Ky.create(this.emitter, this.logger.createContext("PictureInPictureModule")), te = this.options.get("mediaSessionEnabled") ? jy.create(this.emitter, this.logger.createContext("MediaSessionModule"), {
12282
+ let _ = eb.create(this.emitter, this.logger.createContext("PictureInPictureModule")), te = this.options.get("mediaSessionEnabled") ? zy.create(this.emitter, this.logger.createContext("MediaSessionModule"), {
12176
12283
  metadata: this.options.get("mediaSessionMetadata"),
12177
12284
  decoy: this.willUseMediaSource() || this.usesSplitCanvasAudio() ? void 0 : Cc.create(this.logger.createContext("AudioFocusDecoy"), this.yieldToInterruption),
12178
12285
  isMuted: () => this.playbackSource.userMuted,
@@ -12183,11 +12290,11 @@ var Cb = class {
12183
12290
  holdDecoyWhilePaused: this.holdsDecoyWhilePaused(),
12184
12291
  keepDecoyWhenMuted: this.isWebKitCanvasPath(),
12185
12292
  pauseMeansMute: !this.options.get("pauseSupportEnabled")
12186
- }) : void 0, v = A.create(), re = Lv.create(this.emitter, this.logger.createContext("ConnectionModule"), {
12293
+ }) : void 0, v = A.create(), re = Gv.create(this.emitter, this.logger.createContext("ConnectionModule"), {
12187
12294
  reconnectHandler: this.options.get("reconnectHandler"),
12188
12295
  options: this.options,
12189
12296
  onConnectInfo: this.onConnectInfo
12190
- }), ie = ib.create(this.logger.createContext("SubscriptionModule"), this.emitter, d), S = eb.create(this.emitter, ie), C = Qy.create(this.emitter, this.logger.createContext("QualityOfServiceModule"), S), oe = Jy.create(this.emitter, this.logger.createContext("PlaybackModule"), this, this.options.get("minBufferTime"));
12297
+ }), ie = fb.create(this.logger.createContext("SubscriptionModule"), this.emitter, d), S = cb.create(this.emitter, ie), C = ob.create(this.emitter, this.logger.createContext("QualityOfServiceModule"), S), oe = nb.create(this.emitter, this.logger.createContext("PlaybackModule"), this, this.options.get("minBufferTime"));
12191
12298
  this.encryptedMediaExtensions = new vi(this.emitter, this.logger.createContext("EncryptedMediaExtensions"), r.drm), this.drm = {
12192
12299
  setHeaders: (e) => {
12193
12300
  this.encryptedMediaExtensions.headers = e;
@@ -12196,7 +12303,7 @@ var Cb = class {
12196
12303
  this.encryptedMediaExtensions.queryParams = e;
12197
12304
  }
12198
12305
  };
12199
- let se = ry.create(this.emitter), ce = this.options.get("poster"), le = ce === !0 ? this.getThumbnailUrl() : ce || void 0, w, ue, de;
12306
+ let se = dy.create(this.emitter), ce = this.options.get("poster"), le = ce === !0 ? this.getThumbnailUrl() : ce || void 0, w, ue, de;
12200
12307
  if (this.willUseMediaSource()) {
12201
12308
  let e = new oc({
12202
12309
  type: this.options.get("media") === "audio" ? "audio" : "video",
@@ -12206,9 +12313,9 @@ var Cb = class {
12206
12313
  logger: this.logger.createContext("MediaElement"),
12207
12314
  poster: le
12208
12315
  });
12209
- e.on("buffer state", (e) => this.onMediaElementBufferState(e, w)), e.on("needs user input", (e) => this.emitter.emit("needs user input", e)), e.on("volume state", (e) => this.emitter.emit("volume state", e)), e.on("media element state", (e) => this.onMediaElementState(e)), this.element = e.element, this.playbackSource = e, vi.isSupported() && this.encryptedMediaExtensions.attach(e.element), w = Ry.create(this.logger.createContext("MseModule"), this.emitter, this.element), this.options.get("pauseSupportEnabled") || (ue = bb.create(this.logger.createContext("UnpauseModule"), [e], se)), this.options.get("pictureInPictureEnabled") && this.emitter.emit("add picture in picture listener", { element: e.element });
12316
+ e.on("buffer state", (e) => this.onMediaElementBufferState(e, w)), e.on("needs user input", (e) => this.emitter.emit("needs user input", e)), e.on("volume state", (e) => this.emitter.emit("volume state", e)), e.on("media element state", (e) => this.onMediaElementState(e)), this.element = e.element, this.playbackSource = e, vi.isSupported() && this.encryptedMediaExtensions.attach(e.element), w = Ky.create(this.logger.createContext("MseModule"), this.emitter, this.element), this.options.get("pauseSupportEnabled") || (ue = Mb.create(this.logger.createContext("UnpauseModule"), [e], se)), this.options.get("pictureInPictureEnabled") && this.emitter.emit("add picture in picture listener", { element: e.element });
12210
12317
  } else if (this.streamsToMediaElement()) {
12211
- let e = Ny.create(this.emitter, this.logger.createContext("ModernCanvasModule"), this.pool, this, {
12318
+ let e = Vy.create(this.emitter, this.logger.createContext("ModernCanvasModule"), this.pool, this, {
12212
12319
  type: this.options.get("media") === "audio" ? "audio" : "video",
12213
12320
  muted: this.options.get("muted") || this.options.get("media") === "video",
12214
12321
  volume: this.options.get("volume"),
@@ -12220,10 +12327,10 @@ var Cb = class {
12220
12327
  });
12221
12328
  this.element = e.element().element, this.playbackSource = e, de = e;
12222
12329
  let t = this.browser.platform.isIOS && this.browser.platform.iosVersion <= 15;
12223
- this.options.get("pictureInPictureEnabled") && !t && this.emitter.emit("add picture in picture listener", { element: this.element }), this.options.get("pauseSupportEnabled") || (ue = bb.create(this.logger.createContext("UnpauseModule"), e.elements(), se));
12330
+ this.options.get("pictureInPictureEnabled") && !t && this.emitter.emit("add picture in picture listener", { element: this.element }), this.options.get("pauseSupportEnabled") || (ue = Mb.create(this.logger.createContext("UnpauseModule"), e.elements(), se));
12224
12331
  } else {
12225
12332
  let e;
12226
- e = Ey.create(this.emitter, this.logger.createContext("LegacyCanvasModule"), this.pool, this, this.options.get("muted") || this.options.get("media") === "video", this.options.get("volume"), () => {
12333
+ e = Py.create(this.emitter, this.logger.createContext("LegacyCanvasModule"), this.pool, this, this.options.get("muted") || this.options.get("media") === "video", this.options.get("volume"), () => {
12227
12334
  this.setElement(e.element());
12228
12335
  }, this.options.get("minBufferTime")), this.element = e.element(), this.playbackSource = e, de = e, this.options.get("iosWakeLockEnabled") && (this.wakeLock = new qs());
12229
12336
  }
@@ -12239,10 +12346,11 @@ var Cb = class {
12239
12346
  });
12240
12347
  let fe = this.willUseMediaSource(), pe = fe ? !this.browser.platform.isWebKit : !0, me = {
12241
12348
  getTargetBufferTime: () => oe.getTargetBufferTime(),
12242
- getNextBufferedRangeStart: w ? (e) => w.getNextBufferedRangeStart(e) : void 0
12243
- }, he = mb.create(this.emitter, this.logger.createContext("SyncModule"), this.playbackSource, me, pe, fe), ge = dy.create(this.logger.createContext("JitterModule")), _e = (this.options.get("edgeUrl") || this.options.get("url")).replace("wss://", "https://").replace("ws://", "http://").replace("//lb.", "//errors."), ve = new URL("/telemetry", _e).toString();
12349
+ getNextBufferedRangeStart: w ? (e) => w.getNextBufferedRangeStart(e) : void 0,
12350
+ getBufferedEndAt: w ? (e) => w.getBufferedEndAt(e) : void 0
12351
+ }, he = Eb.create(this.emitter, this.logger.createContext("SyncModule"), this.playbackSource, me, pe, fe), ge = yy.create(this.logger.createContext("JitterModule")), _e = (this.options.get("edgeUrl") || this.options.get("url")).replace("wss://", "https://").replace("ws://", "http://").replace("//lb.", "//errors."), ve = new URL("/telemetry", _e).toString();
12244
12352
  this.modules = {
12245
- telemetry: vb.create(this.logger.createContext("TelemetryModule"), this.emitter, {
12353
+ telemetry: Ab.create(this.logger.createContext("TelemetryModule"), this.emitter, {
12246
12354
  url: ve,
12247
12355
  enabled: this.options.get("telemetryEnabled"),
12248
12356
  includeStats: !1,
@@ -12252,10 +12360,10 @@ var Cb = class {
12252
12360
  maxBufferTime: this.options.get("maxBufferTime"),
12253
12361
  minBufferTime: this.options.get("minBufferTime")
12254
12362
  }),
12255
- incomingData: cy.create(this.emitter),
12363
+ incomingData: gy.create(this.emitter),
12256
12364
  adaptivity: _c.create(this.emitter, this.logger.createContext("AdaptivityModule"), C, { cooldownTime: Math.max(this.options.get("minBufferTime"), 2e3) }),
12257
- constraintCap: Hv.create(this.emitter, this.element, S, this.options.get("abrEnabled") ? this.options.get("sizeBasedResolutionCapEnabled") : !1),
12258
- event: oy.create(this.emitter, this.logger.createContext("EventModule"), he),
12365
+ constraintCap: Xv.create(this.emitter, this.element, S, this.options.get("abrEnabled") ? this.options.get("sizeBasedResolutionCapEnabled") : !1),
12366
+ event: my.create(this.emitter, this.logger.createContext("EventModule"), he),
12259
12367
  sync: he,
12260
12368
  jitter: ge,
12261
12369
  documentState: se,
@@ -12327,7 +12435,7 @@ var Cb = class {
12327
12435
  let r = ((t = (n = e.telemetry) == null ? void 0 : n.probability) == null ? 1 : t) >= Math.random();
12328
12436
  if (e.telemetry) {
12329
12437
  var i;
12330
- (i = this.modules.telemetry) == null || i.unload(), this.modules.telemetry = vb.create(this.logger.createContext("TelemetryModule"), this.emitter, y(y({}, e.telemetry), {}, { enabled: this.options.get("telemetryEnabled") && r }), this), this.modules.telemetry.load();
12438
+ (i = this.modules.telemetry) == null || i.unload(), this.modules.telemetry = Ab.create(this.logger.createContext("TelemetryModule"), this.emitter, y(y({}, e.telemetry), {}, { enabled: this.options.get("telemetryEnabled") && r }), this), this.modules.telemetry.load();
12331
12439
  }
12332
12440
  }), this.emitter.on("adapt level", (e) => {
12333
12441
  let t = this.modules.renditions.getRenditionLevels(), n = this.modules.renditions.getRenditionLevel(), r = t.findIndex((e) => e === n), i = t.length - 1, a = r;
@@ -12358,8 +12466,8 @@ var Cb = class {
12358
12466
  audio: y(y({}, this.targetSubscription.audio), d == null ? void 0 : d.audio)
12359
12467
  })), this.emitter.emit("adapted level");
12360
12468
  }), this.emitter.on("text track data", (e) => {
12361
- let t = s(Wb, this).find((t) => t.language === e.language), n = this.modules.sync.getTimeshiftOffset() / 1e3, r = n - s(Ub, this);
12362
- if (a(Ub, this, n), t) {
12469
+ let t = s(nx, this).find((t) => t.language === e.language), n = this.modules.sync.getTimeshiftOffset() / 1e3, r = n - s(tx, this);
12470
+ if (a(tx, this, n), t) {
12363
12471
  if (t.cues) for (let e of t.cues) e.startTime -= r, e.endTime -= r;
12364
12472
  for (let r of e.cues) {
12365
12473
  let e = new VTTCue(r.startTime - n, r.endTime - n, r.text);
@@ -12375,19 +12483,19 @@ var Cb = class {
12375
12483
  this.clientIp = t.ip;
12376
12484
  break;
12377
12485
  case "renditions":
12378
- this.updateTextTracks(t.renditions), a(Gb, this, this.filterRenditions(t.renditions).then((e) => {
12486
+ this.updateTextTracks(t.renditions), a(rx, this, this.filterRenditions(t.renditions).then((e) => {
12379
12487
  this.emitter.emit("renditions", {
12380
12488
  renditions: e,
12381
12489
  channelId: this.currentSubscription.channelId
12382
12490
  }), this.emit("rendition levels", this.modules.renditions.getRenditionLevels()), this.emitLanguagesIfChanged();
12383
12491
  }).finally(() => {
12384
- a(Gb, this, void 0);
12492
+ a(rx, this, void 0);
12385
12493
  }));
12386
12494
  break;
12387
12495
  case "subscription changed":
12388
12496
  var r;
12389
12497
  try {
12390
- zb(t.subscription);
12498
+ Zb(t.subscription);
12391
12499
  } catch (e) {
12392
12500
  this.emitter.emit("error", new j("Subscription failed validation", {
12393
12501
  source: e instanceof Error ? e : void 0,
@@ -12518,7 +12626,7 @@ var Cb = class {
12518
12626
  let E = function() {
12519
12627
  var e = t(function* (e) {
12520
12628
  let t = e.channelId;
12521
- s(Gb, o) && (yield s(Gb, o));
12629
+ s(rx, o) && (yield s(rx, o));
12522
12630
  let n = o.modules.renditions.getRendition(e.renditionId, t);
12523
12631
  if (!Ps(e.flags)) {
12524
12632
  if (Fs(e.flags)) {
@@ -12532,8 +12640,8 @@ var Cb = class {
12532
12640
  } catch (e) {
12533
12641
  o.logger.warn("failed to parse WebVTT segment, dropping it", e);
12534
12642
  }
12535
- let i = n / 1e3, c = s(Wb, o).find((t) => t.language === e.language), l = i - s(Ub, o);
12536
- if (a(Ub, o, i), c) {
12643
+ let i = n / 1e3, c = s(nx, o).find((t) => t.language === e.language), l = i - s(tx, o);
12644
+ if (a(tx, o, i), c) {
12537
12645
  if (c.cues) for (let e of c.cues) e.startTime -= l, e.endTime -= l;
12538
12646
  for (let e of r) {
12539
12647
  let t = new VTTCue(e.startTime - i, e.endTime - i, e.text);
@@ -12569,10 +12677,10 @@ var Cb = class {
12569
12677
  mimeType: s
12570
12678
  }), o.emit("initialized media");
12571
12679
  } else {
12572
- let t = Ab(e, n, o.sizes.get(e.renditionId));
12680
+ let t = Hb(e, n, o.sizes.get(e.renditionId));
12573
12681
  o.modules.jitter.recordSample(t);
12574
12682
  let i = o.sampleProcessingSesssions.get(r);
12575
- if (!i) i = Tb(o.modules.sync.processSample(t)), o.sampleProcessingSesssions.set(r, i);
12683
+ if (!i) i = Lb(o.modules.sync.processSample(t)), o.sampleProcessingSesssions.set(r, i);
12576
12684
  else {
12577
12685
  let e = o.willUseMediaSource() && o.isSwitchingRenditionLevel && t.type === "video", n = i(o.modules.sync.processSample(t), e), r = t;
12578
12686
  n.forEach((e) => {
@@ -12679,7 +12787,7 @@ var Cb = class {
12679
12787
  this.modules.subscription.setLanguage(e), this.alignSizeAndBitRate(this.targetSubscription);
12680
12788
  }
12681
12789
  set textTrack(e) {
12682
- e !== this.textTrack && (s(Wb, this).forEach((t) => {
12790
+ e !== this.textTrack && (s(nx, this).forEach((t) => {
12683
12791
  if (t.label === e) t.mode = "showing";
12684
12792
  else {
12685
12793
  if (t.mode === "showing" && t.cues) for (let e of [...t.cues]) t.removeCue(e);
@@ -12688,11 +12796,11 @@ var Cb = class {
12688
12796
  }), this.emitter.emit("text track", e));
12689
12797
  }
12690
12798
  get textTracks() {
12691
- return s(Wb, this).filter((e) => e.mode !== "disabled").map((e) => e.label);
12799
+ return s(nx, this).filter((e) => e.mode !== "disabled").map((e) => e.label);
12692
12800
  }
12693
12801
  get textTrack() {
12694
12802
  var e;
12695
- return (e = s(Wb, this).find((e) => e.mode === "showing")) == null ? void 0 : e.label;
12803
+ return (e = s(nx, this).find((e) => e.mode === "showing")) == null ? void 0 : e.label;
12696
12804
  }
12697
12805
  get channelId() {
12698
12806
  var e, t;
@@ -12830,7 +12938,7 @@ var Cb = class {
12830
12938
  return this.modules.subscription.getTargetSubscription();
12831
12939
  }
12832
12940
  resolvedDecoder(e) {
12833
- return kb(this.options.get("decoders", e), this.browser.supportsMediaSource, this.options.get("drm"));
12941
+ return Vb(this.options.get("decoders", e), this.browser.supportsMediaSource, this.options.get("drm"));
12834
12942
  }
12835
12943
  usesSplitCanvasAudio() {
12836
12944
  return !this.willUseMediaSource() && this.options.get("streamToMediaElementEnabled") && ft(this.browser) && this.options.get("media") !== "audio" && this.options.get("media") !== "video" && this.browser.platform.isIOS;
@@ -12870,6 +12978,6 @@ var Cb = class {
12870
12978
  return this.hasCalledConnect && this.isBackgroundPlayEnabled(e) && !this.isUserPaused;
12871
12979
  }
12872
12980
  };
12873
- e(Kb, "MAX_POOL_SIZE", 10), e(Kb, "REMOVE_CUE_THRESHOLD", 1e3 * 10), e(Kb, "BACKGROUND_INACTIVITY_DISCONNECT_TIMEOUT", 1e3 * 15), e(Kb, "VISIBLE_PAUSE_DISCONNECT_DELAY", 1e3);
12981
+ e(ix, "MAX_POOL_SIZE", 10), e(ix, "REMOVE_CUE_THRESHOLD", 1e3 * 10), e(ix, "BACKGROUND_INACTIVITY_DISCONNECT_TIMEOUT", 1e3 * 15), e(ix, "VISIBLE_PAUSE_DISCONNECT_DELAY", 1e3);
12874
12982
  //#endregion
12875
- export { ct as C, dt as D, st as E, Le as O, ut as S, rt as T, $e as _, gn as a, Qe as b, fn as c, vn as d, j as f, Xe as g, et as h, mn as i, Ie as k, Cn as l, Ze as m, kn as n, _n as o, Wt as p, hn as r, pn as s, Kb as t, yn as u, at as v, ot as w, nt as x, Ye as y };
12983
+ export { ct as C, dt as D, st as E, Le as O, ut as S, rt as T, $e as _, gn as a, Qe as b, fn as c, vn as d, j as f, Xe as g, et as h, mn as i, Ie as k, Cn as l, Ze as m, kn as n, _n as o, Wt as p, hn as r, pn as s, ix as t, yn as u, at as v, ot as w, nt as x, Ye as y };