@vindral/web-sdk 4.7.2-5-g4c14d0e4 → 4.7.2-6-gceea26ed

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.
@@ -10688,9 +10688,9 @@ var Kb = class {
10688
10688
  s > 0 && performance.now() - r.lastBufferCleanupTime > 1e4 && (r.lastBufferCleanupTime = performance.now(), yield r.sourceBuffer.removeBuffer(0, s + 10));
10689
10689
  try {
10690
10690
  let t = r.sequenceNumber;
10691
- if ("fragmented" in n) for (let t of Zb(e)) {
10691
+ if ("fragmented" in n) for (let t of Qb(e)) {
10692
10692
  var c;
10693
- yield r.sourceBuffer.appendBuffer(Qb(t.map((e) => e.data)), (c = t[0]) == null ? void 0 : c.initData);
10693
+ yield r.sourceBuffer.appendBuffer($b(t.map((e) => e.data)), (c = t[0]) == null ? void 0 : c.initData);
10694
10694
  }
10695
10695
  else {
10696
10696
  let n = Fs(e, t++);
@@ -10737,18 +10737,19 @@ var Kb = class {
10737
10737
  if (e.duration === 0) return;
10738
10738
  let t = this.trackContexts.get(e.type);
10739
10739
  if (!t) throw Un(e.type, e.renditionId);
10740
- if (!(!t.hasFirstSync && !e.isSync)) {
10740
+ let n = t.pendingSamples.length - t.pendingSamplesOffset;
10741
+ if (t.state === "uninitialized" && n >= Yb && (e.isSync || n >= 2 * Yb) && (t.pendingSamples = [], t.pendingSamplesOffset = 0, t.hasFirstSync = !1), !(!t.hasFirstSync && !e.isSync)) {
10741
10742
  if (this.hasAddedInitialPosterFrame && e.isSync && e.type === "video") {
10742
10743
  this.hasAddedInitialPosterFrame = !1;
10743
10744
  let n = y({}, e);
10744
10745
  "fragment" in n ? (n.fragment = n.fragment.clone(), n.fragment.updateBaseMediaDecodeTime(0), n.data = n.fragment.rawBytes()) : n.timestamp = 0, t.pendingSamples.push(n);
10745
10746
  }
10746
10747
  if (t.hasFirstSync = !0, t.pendingSamples.push(e), e.type === "video" && e.isSync) {
10747
- var n;
10748
- let t = (e.timestamp + ((n = e.compositionTimeOffset) == null ? 0 : n)) / e.timescale * 1e3, r = this.videoKeyframeTimestamps[this.videoKeyframeTimestamps.length - 1];
10749
- r !== void 0 && t < r && (this.videoKeyframeTimestamps = []), this.videoKeyframeTimestamps.push(t), this.videoKeyframeTimestamps.length > 20 && (this.videoKeyframeTimestamps = this.videoKeyframeTimestamps.slice(-20));
10748
+ var r;
10749
+ let t = (e.timestamp + ((r = e.compositionTimeOffset) == null ? 0 : r)) / e.timescale * 1e3, n = this.videoKeyframeTimestamps[this.videoKeyframeTimestamps.length - 1];
10750
+ n !== void 0 && t < n && (this.videoKeyframeTimestamps = []), this.videoKeyframeTimestamps.push(t), this.videoKeyframeTimestamps.length > 20 && (this.videoKeyframeTimestamps = this.videoKeyframeTimestamps.slice(-20));
10750
10751
  }
10751
- t.state !== "uninitialized" && (t.isWorkingOnPendingSamples || ex(t, this.append, this.maxChunkSize).catch((n) => {
10752
+ t.state !== "uninitialized" && (t.isWorkingOnPendingSamples || tx(t, this.append, this.maxChunkSize).catch((n) => {
10752
10753
  if (t.isWorkingOnPendingSamples = !1, !this.isReopening) {
10753
10754
  if (!this.isCurrentTrackContext(e.type, t)) {
10754
10755
  this.logger.debug("Suppressing append error from stale track context", { type: e.type });
@@ -10867,7 +10868,7 @@ var Kb = class {
10867
10868
  if (this.mediaSource.isClosed()) return;
10868
10869
  let e = this.getInitializedTrackBuffers();
10869
10870
  if (e.length !== 0) return this.getCommonBufferedRanges(e);
10870
- }), e(this, "getCommonBufferedRanges", (e) => e.slice(1).reduce((e, t) => Xb(e, t), e[0] ? Array.from(e[0]) : [])), e(this, "getPlaybackStateForBufferedRanges", (e, t) => rn(t, e) ? "playing" : "buffering"), this.logger = r, this.mediaElement = a, this.emitter = i;
10871
+ }), e(this, "getCommonBufferedRanges", (e) => e.slice(1).reduce((e, t) => Zb(e, t), e[0] ? Array.from(e[0]) : [])), e(this, "getPlaybackStateForBufferedRanges", (e, t) => rn(t, e) ? "playing" : "buffering"), this.logger = r, this.mediaElement = a, this.emitter = i;
10871
10872
  }
10872
10873
  };
10873
10874
  Hb = Kb, e(Kb, "create", (e, t, n) => {
@@ -10889,7 +10890,7 @@ var qb = (e, t) => {
10889
10890
  var n;
10890
10891
  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;
10891
10892
  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;
10892
- }, Yb = 32, Xb = (e, t) => {
10893
+ }, Yb = 1e3, Xb = 32, Zb = (e, t) => {
10893
10894
  let n = [], r = 0, i = 0;
10894
10895
  for (; r < e.length && i < t.length;) {
10895
10896
  let a = e[r], o = t[i];
@@ -10901,7 +10902,7 @@ var qb = (e, t) => {
10901
10902
  }), a.end <= o.end ? r++ : i++;
10902
10903
  }
10903
10904
  return n;
10904
- }, Zb = (e) => {
10905
+ }, Qb = (e) => {
10905
10906
  let t = [];
10906
10907
  for (let r of e) {
10907
10908
  var n;
@@ -10910,21 +10911,21 @@ var qb = (e, t) => {
10910
10911
  (e == null || (n = e[0]) == null ? void 0 : n.initData) === r.initData ? e.push(r) : t.push([r]);
10911
10912
  }
10912
10913
  return t;
10913
- }, Qb = (e) => {
10914
+ }, $b = (e) => {
10914
10915
  if (e.length === 1 && e[0]) return e[0];
10915
10916
  let t = new Uint8Array(e.reduce((e, t) => e + t.byteLength, 0)), n = 0;
10916
10917
  for (let r of e) t.set(r, n), n += r.byteLength;
10917
10918
  return t;
10918
- }, $b = (e) => {
10919
+ }, ex = (e) => {
10919
10920
  let t = e.pendingSamplesOffset;
10920
10921
  if (t !== 0) {
10921
10922
  if (t >= e.pendingSamples.length) {
10922
10923
  e.pendingSamples = [], e.pendingSamplesOffset = 0;
10923
10924
  return;
10924
10925
  }
10925
- t < Yb || t * 2 < e.pendingSamples.length || (e.pendingSamples = e.pendingSamples.slice(t), e.pendingSamplesOffset = 0);
10926
+ t < Xb || t * 2 < e.pendingSamples.length || (e.pendingSamples = e.pendingSamples.slice(t), e.pendingSamplesOffset = 0);
10926
10927
  }
10927
- }, ex = function() {
10928
+ }, tx = function() {
10928
10929
  var e = t(function* (e, t, n) {
10929
10930
  for (e.isWorkingOnPendingSamples = !0; e.pendingSamplesOffset < e.pendingSamples.length;) {
10930
10931
  let r = [], i = e.pendingSamplesOffset;
@@ -10940,14 +10941,14 @@ var qb = (e, t) => {
10940
10941
  }
10941
10942
  let a = r[0];
10942
10943
  if (!a) break;
10943
- yield t(r, e.previousSample ? Jb(e.previousSample, a) : !0), e.pendingSamplesOffset = i + 1, e.previousSample = r[r.length - 1], $b(e);
10944
+ yield t(r, e.previousSample ? Jb(e.previousSample, a) : !0), e.pendingSamplesOffset = i + 1, e.previousSample = r[r.length - 1], ex(e);
10944
10945
  }
10945
10946
  e.isWorkingOnPendingSamples = !1;
10946
10947
  });
10947
10948
  return function(t, n, r) {
10948
10949
  return e.apply(this, arguments);
10949
10950
  };
10950
- }(), tx, nx = class {
10951
+ }(), nx, rx = class {
10951
10952
  constructor(n, r) {
10952
10953
  var i = this;
10953
10954
  e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "element", void 0), e(this, "pictureInPictureWindow", void 0), e(this, "unload", () => {
@@ -10979,10 +10980,10 @@ var qb = (e, t) => {
10979
10980
  }()), e(this, "isWebkitPresentationModeSupported", () => !!this.element && dt(this.element)), this.emitter = n, this.logger = r, this.emitter.on("add picture in picture listener", this.onEnablePictureInPicture);
10980
10981
  }
10981
10982
  };
10982
- tx = nx, e(nx, "create", (e, t) => new tx(e, t));
10983
+ nx = rx, e(rx, "create", (e, t) => new nx(e, t));
10983
10984
  //#endregion
10984
10985
  //#region ../../libs/web-sdk/src/modules/PlaybackModule.ts
10985
- var rx, ix = class {
10986
+ var ix, ax = class {
10986
10987
  constructor(t, n, r, i) {
10987
10988
  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", () => {
10988
10989
  this.emitter.off("buffer state", this.onBufferedStateChanged), this.emitter.off("needs user input", this.onNeedsUserInput);
@@ -11000,24 +11001,24 @@ var rx, ix = class {
11000
11001
  }), 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);
11001
11002
  }
11002
11003
  };
11003
- rx = ix, e(ix, "create", (e, t, n, r) => new rx(e, t, n, r));
11004
+ ix = ax, e(ax, "create", (e, t, n, r) => new ix(e, t, n, r));
11004
11005
  //#endregion
11005
11006
  //#region ../../libs/web-sdk/src/modules/QualityOfServiceModule.ts
11006
- var ax, ox = () => ({
11007
+ var ox, sx = () => ({
11007
11008
  upgradesFromLevel: [],
11008
11009
  downgradesFromLevel: [],
11009
11010
  bufferingRanges: [],
11010
11011
  activeRanges: [],
11011
11012
  decodeRate: 2 ** 53 - 1
11012
- }), sx = () => ({
11013
+ }), cx = () => ({
11013
11014
  levels: {},
11014
11015
  levelDowngrades: [],
11015
11016
  levelUpgrades: [],
11016
11017
  bufferFullness: 0,
11017
- general: ox()
11018
- }), cx = 100, lx = 3600, ux = 1e3, dx = class {
11018
+ general: sx()
11019
+ }), lx = 100, ux = 3600, dx = 1e3, fx = class {
11019
11020
  constructor(t, n, i, a) {
11020
- e(this, "minBufferFullnessLengthForRegression", 6), e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "timers", O.create()), e(this, "metrics", sx()), e(this, "bufferFullness", new r(Infinity)), e(this, "bufferFullnessRegression", void 0), e(this, "lastDeliveryResumeTime", -Infinity), e(this, "currentLevel", void 0), e(this, "isSuspended", !1), e(this, "_fatalQosCount", 0), e(this, "renditionLevelSource", void 0), e(this, "targetBufferTimeSource", void 0), e(this, "qualityIndexOrder", []), e(this, "hasPlayedInSession", !1), e(this, "hasAsserted", !1), e(this, "load", () => {
11021
+ e(this, "minBufferFullnessLengthForRegression", 6), e(this, "logger", void 0), e(this, "emitter", void 0), e(this, "timers", O.create()), e(this, "metrics", cx()), e(this, "bufferFullness", new r(Infinity)), e(this, "bufferFullnessRegression", void 0), e(this, "lastDeliveryResumeTime", -Infinity), e(this, "currentLevel", void 0), e(this, "isSuspended", !1), e(this, "_fatalQosCount", 0), e(this, "renditionLevelSource", void 0), e(this, "targetBufferTimeSource", void 0), e(this, "qualityIndexOrder", []), e(this, "hasPlayedInSession", !1), e(this, "hasAsserted", !1), e(this, "load", () => {
11021
11022
  this.emitter.on("playback state", this.onPlaybackState), this.emitter.on("buffer fullness", this.onBufferFullness), this.emitter.on("media delivery resumed", this.onMediaDeliveryResumed), this.emitter.on("rendition level changed", this.onRenditionLevelChanged), this.emitter.on("video decode rate", this.onVideoDecodeRate), this.emitter.on("connection state", this.onConnectionState);
11022
11023
  }), e(this, "unload", () => {
11023
11024
  this.emitter.off("playback state", this.onPlaybackState), this.emitter.off("buffer fullness", this.onBufferFullness), this.emitter.off("media delivery resumed", this.onMediaDeliveryResumed), this.emitter.off("rendition level changed", this.onRenditionLevelChanged), this.emitter.off("video decode rate", this.onVideoDecodeRate), this.emitter.off("connection state", this.onConnectionState), this.suspend();
@@ -11033,7 +11034,7 @@ var ax, ox = () => ({
11033
11034
  return this.metrics.levels[a];
11034
11035
  }), e(this, "getBufferFullnessRegression", (e = !1) => {
11035
11036
  if (!e) return this.bufferFullnessRegression;
11036
- if (performance.now() - this.lastDeliveryResumeTime < ux) return;
11037
+ if (performance.now() - this.lastDeliveryResumeTime < dx) return;
11037
11038
  let t = this.bufferFullness.items().filter(({ time: e }) => e >= this.lastDeliveryResumeTime);
11038
11039
  return t.length >= this.minBufferFullnessLengthForRegression ? this.calculateLinearRegression(t) : void 0;
11039
11040
  }), e(this, "getTargetBufferTime", () => {
@@ -11093,21 +11094,21 @@ var ax, ox = () => ({
11093
11094
  let d = !1;
11094
11095
  if (e.from) {
11095
11096
  var f;
11096
- let e = (f = this.metrics.levels[l]) == null ? ox() : f;
11097
+ let e = (f = this.metrics.levels[l]) == null ? sx() : f;
11097
11098
  l < u ? e.upgradesFromLevel.push(performance.now()) : e.downgradesFromLevel.push(performance.now()), Qt(e.activeRanges);
11098
11099
  let t = e.bufferingRanges[e.bufferingRanges.length - 1];
11099
11100
  d = !!t && !t.end, Qt(e.bufferingRanges), this.metrics.levels[l] = e;
11100
11101
  }
11101
11102
  if (e.to) {
11102
11103
  var p;
11103
- let e = (p = this.metrics.levels[u]) == null ? ox() : p;
11104
+ let e = (p = this.metrics.levels[u]) == null ? sx() : p;
11104
11105
  $t(e.activeRanges), d && $t(e.bufferingRanges), this.metrics.levels[u] = e, this.currentLevel = u;
11105
11106
  }
11106
11107
  }), e(this, "onMediaDeliveryResumed", () => {
11107
11108
  this.lastDeliveryResumeTime = performance.now();
11108
11109
  }), e(this, "onBufferFullness", (e) => {
11109
11110
  if (this.metrics.bufferFullness = e, this.isSuspended) return;
11110
- let t = performance.now(), n = this.bufferFullness.peekLast(), r = (e) => Math.floor(e / cx);
11111
+ let t = performance.now(), n = this.bufferFullness.peekLast(), r = (e) => Math.floor(e / lx);
11111
11112
  if (n && r(n.time) === r(t)) n.time = t, n.value = e;
11112
11113
  else {
11113
11114
  var i, a;
@@ -11115,7 +11116,7 @@ var ax, ox = () => ({
11115
11116
  time: t,
11116
11117
  value: e
11117
11118
  });
11118
- let n = this.bufferFullness.items(), r = (i = (a = n[n.length - this.minBufferFullnessLengthForRegression]) == null ? void 0 : a.time) == null ? -Infinity : i, o = Math.min(t - lx, r);
11119
+ let n = this.bufferFullness.items(), r = (i = (a = n[n.length - this.minBufferFullnessLengthForRegression]) == null ? void 0 : a.time) == null ? -Infinity : i, o = Math.min(t - ux, r);
11119
11120
  this.bufferFullness.filterPop(({ time: e }) => e >= o);
11120
11121
  }
11121
11122
  this.bufferFullnessRegression = this.bufferFullness.items().length >= this.minBufferFullnessLengthForRegression ? this.calculateLinearRegression() : void 0;
@@ -11187,10 +11188,10 @@ var ax, ox = () => ({
11187
11188
  $t(this.metrics.general.activeRanges);
11188
11189
  }
11189
11190
  };
11190
- ax = dx, e(dx, "create", (e, t, n, r) => new ax(e, t, n, r));
11191
+ ox = fx, e(fx, "create", (e, t, n, r) => new ox(e, t, n, r));
11191
11192
  //#endregion
11192
11193
  //#region ../../libs/web-sdk/src/modules/RenditionsModule.ts
11193
- var fx, px = class {
11194
+ var px, mx = class {
11194
11195
  constructor(t, n) {
11195
11196
  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", () => {
11196
11197
  this.emitter.off("renditions", this.onRenditions), this.emitter.off("subscription changed", this.onSubscriptionChanged);
@@ -11265,10 +11266,10 @@ var fx, px = class {
11265
11266
  }), 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);
11266
11267
  }
11267
11268
  };
11268
- fx = px, e(px, "create", (e, t) => new fx(e, t));
11269
+ px = mx, e(mx, "create", (e, t) => new px(e, t));
11269
11270
  //#endregion
11270
11271
  //#region ../../libs/web-sdk/src/modules/SubscriptionModule.ts
11271
- var mx, hx = (e) => JSON.parse(JSON.stringify(e)), gx = 1e4, _x = class {
11272
+ var hx, gx = (e) => JSON.parse(JSON.stringify(e)), _x = 1e4, vx = class {
11272
11273
  constructor(t, n, r) {
11273
11274
  e(this, "logger", void 0), e(this, "timers", new O()), 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", () => {
11274
11275
  this.logger.debug("Unloading module..."), this.timers.unload(), this.emitter.off("subscription changed", this.onSubscriptionChanged), this.logger.debug("Unloaded module");
@@ -11306,23 +11307,23 @@ var mx, hx = (e) => JSON.parse(JSON.stringify(e)), gx = 1e4, _x = class {
11306
11307
  this.logger.debug("onSubscriptionChanged", {
11307
11308
  to: e,
11308
11309
  reset: t
11309
- }), t ? this.targetSubscription = hx(this.currentSubscription) : this.currentSubscription = hx(e), this._isSwitchingSubscription = this.isNewSubscription();
11310
+ }), t ? this.targetSubscription = gx(this.currentSubscription) : this.currentSubscription = gx(e), this._isSwitchingSubscription = this.isNewSubscription();
11310
11311
  }), e(this, "scheduleSubscriptionChange", () => {
11311
- this.targetSubscription = hx(this.targetSubscription), this._isSwitchingSubscription = this.isNewSubscription();
11312
+ this.targetSubscription = gx(this.targetSubscription), this._isSwitchingSubscription = this.isNewSubscription();
11312
11313
  let e = this.currentSubscription.channelId, t = this.targetSubscription.channelId, n = e !== t;
11313
11314
  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(() => {
11314
- this.currentSubscription.channelId === e && this.targetSubscription.channelId === t && (this.logger.warn("Channel switch timeout", t), this.targetSubscription = hx(this.currentSubscription), this.emitter.emit("channel switch timeout", t));
11315
- }, gx), this.pendingSubscriptionTimeoutId = this.timers.setTimeout(() => this.emitter.emit("send signal", {
11315
+ this.currentSubscription.channelId === e && this.targetSubscription.channelId === t && (this.logger.warn("Channel switch timeout", t), this.targetSubscription = gx(this.currentSubscription), this.emitter.emit("channel switch timeout", t));
11316
+ }, _x), this.pendingSubscriptionTimeoutId = this.timers.setTimeout(() => this.emitter.emit("send signal", {
11316
11317
  type: "subscribe",
11317
11318
  subscription: this.getTargetSubscription()
11318
11319
  }), 0));
11319
- }), this.logger = t, this.targetSubscription = n, this.currentSubscription = hx(n), this.emitter = r, this.emitter.on("subscription changed", this.onSubscriptionChanged);
11320
+ }), this.logger = t, this.targetSubscription = n, this.currentSubscription = gx(n), this.emitter = r, this.emitter.on("subscription changed", this.onSubscriptionChanged);
11320
11321
  }
11321
11322
  };
11322
- mx = _x, e(_x, "create", (e, t, n) => new mx(e, n, t));
11323
+ hx = vx, e(vx, "create", (e, t, n) => new hx(e, n, t));
11323
11324
  //#endregion
11324
11325
  //#region ../../libs/web-sdk/src/BFrameTracker.ts
11325
- var vx = class t {
11326
+ var yx = class t {
11326
11327
  constructor() {
11327
11328
  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 Dt(t.MAX_REMEMBERED_RENDITIONS));
11328
11329
  }
@@ -11378,10 +11379,10 @@ var vx = class t {
11378
11379
  }
11379
11380
  }
11380
11381
  };
11381
- e(vx, "MAX_REMEMBERED_RENDITIONS", 32);
11382
+ e(yx, "MAX_REMEMBERED_RENDITIONS", 32);
11382
11383
  //#endregion
11383
11384
  //#region ../../libs/web-sdk/src/modules/SyncModule.ts
11384
- var yx, bx = 5e3, xx = () => Fe() || Me(), Sx = (e) => e && xx() ? 100 : 0, Cx = (e) => (t) => t > e, wx = 100, Tx = 1e3, Ex = 1e3, Dx = 1e3, Ox = 100, kx = 50, Ax = {
11385
+ var bx, xx = 5e3, Sx = () => Fe() || Me(), Cx = (e) => e && Sx() ? 100 : 0, wx = (e) => (t) => t > e, Tx = 100, Ex = 1e3, Dx = 1e3, Ox = 1e3, kx = 100, Ax = 50, jx = {
11385
11386
  seek: {
11386
11387
  toleranceMs: 200,
11387
11388
  toleranceMaxMs: 2500,
@@ -11413,7 +11414,7 @@ var yx, bx = 5e3, xx = () => Fe() || Me(), Sx = (e) => e && xx() ? 100 : 0, Cx =
11413
11414
  decayCooldownMultiplier: 3,
11414
11415
  decayCheckInterval: 15e3
11415
11416
  }
11416
- }, jx = class {
11417
+ }, Mx = class {
11417
11418
  get driftSamplesToCollect() {
11418
11419
  return this._driftSamplesToCollect;
11419
11420
  }
@@ -11421,8 +11422,8 @@ var yx, bx = 5e3, xx = () => Fe() || Me(), Sx = (e) => e && xx() ? 100 : 0, Cx =
11421
11422
  this._driftSamplesToCollect = e, this.driftSamples = new r(e);
11422
11423
  }
11423
11424
  constructor(t, n, i, a, o, s = !0) {
11424
- 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", wx), 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", O.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 vx()), 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", () => {
11425
- this.emitter.on("page active", this.onPageActive), this.emitter.on("pageshow", this.onPageShow), this.setSyncInterval(document.visibilityState === "hidden" ? Tx : wx);
11425
+ 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", Tx), 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", O.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 yx()), 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", () => {
11426
+ this.emitter.on("page active", this.onPageActive), this.emitter.on("pageshow", this.onPageShow), this.setSyncInterval(document.visibilityState === "hidden" ? Ex : Tx);
11426
11427
  }), e(this, "unload", () => {
11427
11428
  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");
11428
11429
  }), e(this, "suspend", () => {
@@ -11464,7 +11465,7 @@ var yx, bx = 5e3, xx = () => Fe() || Me(), Sx = (e) => e && xx() ? 100 : 0, Cx =
11464
11465
  }), e(this, "processSample", (e) => {
11465
11466
  var t;
11466
11467
  if (!e.channelId) throw Error("Sample must be assigned to a channel");
11467
- this.currentChannelId || (this.currentChannelId = e.channelId), this.timestampOffset || (this.timestampOffset = e.timestamp / e.timescale * 1e3 - bx);
11468
+ this.currentChannelId || (this.currentChannelId = e.channelId), this.timestampOffset || (this.timestampOffset = e.timestamp / e.timescale * 1e3 - xx);
11468
11469
  let n = e.type === "video" && e.isSync;
11469
11470
  if (this.bFrameDetector.update(e), this.latchBFramesIfDetected(), this.currentChannelId !== e.channelId) {
11470
11471
  let t = 2 ** 53 - 1;
@@ -11481,7 +11482,7 @@ var yx, bx = 5e3, xx = () => Fe() || Me(), Sx = (e) => e && xx() ? 100 : 0, Cx =
11481
11482
  this.currentChannelId || (this.currentChannelId = e);
11482
11483
  let i = t.mediaType();
11483
11484
  if (!i) throw Error("Fragment must have a media type");
11484
- this.timestampOffset || (this.timestampOffset = t.baseMediaDecodeTime() / t.timescale() * 1e3 - bx);
11485
+ this.timestampOffset || (this.timestampOffset = t.baseMediaDecodeTime() / t.timescale() * 1e3 - xx);
11485
11486
  let a = i === "video" && t.startsWithKeyframe();
11486
11487
  if (i === "video" && (this.bFrameDetector.updateFromFragment({
11487
11488
  type: i,
@@ -11602,7 +11603,7 @@ var yx, bx = 5e3, xx = () => Fe() || Me(), Sx = (e) => e && xx() ? 100 : 0, Cx =
11602
11603
  return;
11603
11604
  }
11604
11605
  if (n >= this.getEffectiveSeekToleranceMs() || n < this.currentTimeshiftToleranceMs()) return;
11605
- let r = performance.now() - this.config.seek.timeoutMs * this.state.timeshiftToleranceMultiplier, i = this.timeshiftAdjustmentTimestamps.filter(Cx(r)).length;
11606
+ let r = performance.now() - this.config.seek.timeoutMs * this.state.timeshiftToleranceMultiplier, i = this.timeshiftAdjustmentTimestamps.filter(wx(r)).length;
11606
11607
  if (i && this.state.timeshiftToleranceMultiplier > 2) {
11607
11608
  this.logger.debug("Too many timeshifts within sliding window", {
11608
11609
  timeshiftCooldownThreshold: r,
@@ -11626,20 +11627,20 @@ var yx, bx = 5e3, xx = () => Fe() || Me(), Sx = (e) => e && xx() ? 100 : 0, Cx =
11626
11627
  let n = (e = (t = this.bufferSource).getNextBufferedRangeStart) == null ? void 0 : e.call(t, this.playbackSource.currentTime);
11627
11628
  return this.shouldSeekAfterBuffering = n !== void 0, n;
11628
11629
  }), e(this, "observePlayheadProgress", () => {
11629
- let e = this.playbackSource.currentTime, t = e !== this.lastPlayheadPosition, n = t && (this.positionSetBySeek === void 0 || e - this.positionSetBySeek > kx);
11630
+ let e = this.playbackSource.currentTime, t = e !== this.lastPlayheadPosition, n = t && (this.positionSetBySeek === void 0 || e - this.positionSetBySeek > Ax);
11630
11631
  this.positionSetBySeek = void 0, (n || this.playbackSource.isPaused) && (this.hasPerformedStuckSeekInCurrentStillness = !1), (t || this.playbackSource.isPaused || this.isSeeking()) && (this.lastPlayheadPosition = e, this.lastPlayheadProgressAt = performance.now());
11631
11632
  }), e(this, "isPlayheadStuckInBuffer", () => {
11632
11633
  var e, t;
11633
- if (performance.now() - this.lastPlayheadProgressAt < Ex) return !1;
11634
+ if (performance.now() - this.lastPlayheadProgressAt < Dx) return !1;
11634
11635
  let n = this.playbackSource.currentTime, r = (e = (t = this.bufferSource).getBufferedEndAt) == null ? void 0 : e.call(t, n);
11635
- return r !== void 0 && r - n >= Dx;
11636
+ return r !== void 0 && r - n >= Ox;
11636
11637
  }), e(this, "getRecoverySeekReason", () => {
11637
11638
  if (this.needsMediaSourceRecovery) return "media source reopen";
11638
11639
  if (this.shouldSeekWhileStuck) return "stuck in buffer";
11639
11640
  if (this.shouldSeekAfterBuffering) return "buffering";
11640
11641
  }), 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", () => {
11641
11642
  var e, t;
11642
- let n = this.playbackSource.currentTime, r = (e = (t = this.bufferSource).getBufferedEndAt) == null ? void 0 : e.call(t, n), i = n + Math.max(this.seekOvershoot, Ox);
11643
+ let n = this.playbackSource.currentTime, r = (e = (t = this.bufferSource).getBufferedEndAt) == null ? void 0 : e.call(t, n), i = n + Math.max(this.seekOvershoot, kx);
11643
11644
  if (r === void 0 || i >= r) return;
11644
11645
  let a = this.findKeyframeCloseToTimestamp(i);
11645
11646
  return {
@@ -11716,7 +11717,7 @@ var yx, bx = 5e3, xx = () => Fe() || Me(), Sx = (e) => e && xx() ? 100 : 0, Cx =
11716
11717
  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;
11717
11718
  let i = r ? t : bt(this.driftSamples.items());
11718
11719
  if (!r && this.tryPlaybackRateSync(i) || !r && this.shouldSkipNormalSeek(i)) return;
11719
- let a = performance.now() - this.config.seek.timeoutMs * this.state.seekToleranceMultiplier, o = this.seekAdjustmentTimestamps.filter(Cx(a)).length, s = this.currentEmergencySeekToleranceMs(), c = i > 0 && i >= s;
11720
+ let a = performance.now() - this.config.seek.timeoutMs * this.state.seekToleranceMultiplier, o = this.seekAdjustmentTimestamps.filter(wx(a)).length, s = this.currentEmergencySeekToleranceMs(), c = i > 0 && i >= s;
11720
11721
  if (o && this.state.seekToleranceMultiplier > 2 && !r && !c) {
11721
11722
  this.logger.debug("Too many seek adjustments within sliding window", {
11722
11723
  seekCooldownThreshold: a,
@@ -11745,9 +11746,9 @@ var yx, bx = 5e3, xx = () => Fe() || Me(), Sx = (e) => e && xx() ? 100 : 0, Cx =
11745
11746
  return;
11746
11747
  }
11747
11748
  }), e(this, "onPageActive", (e) => {
11748
- this.setSyncInterval(e ? wx : Tx), e && this.onSync();
11749
+ this.setSyncInterval(e ? Tx : Ex), e && this.onSync();
11749
11750
  }), e(this, "onPageShow", (e) => {
11750
- e.persisted && (this.setSyncInterval(document.visibilityState === "hidden" ? Tx : wx), this.onSync());
11751
+ e.persisted && (this.setSyncInterval(document.visibilityState === "hidden" ? Ex : Tx), this.onSync());
11751
11752
  }), e(this, "setSyncInterval", (e) => {
11752
11753
  this.syncInterval !== void 0 && this.currentSyncIntervalMs === e || (this.clearSyncInterval(), this.currentSyncIntervalMs = e, this.syncInterval = this.timers.setInterval(this.onSync, e));
11753
11754
  }), e(this, "clearSyncInterval", () => {
@@ -11758,11 +11759,11 @@ var yx, bx = 5e3, xx = () => Fe() || Me(), Sx = (e) => e && xx() ? 100 : 0, Cx =
11758
11759
  let t = n >= e - this.config.seek.keyframeSearchBeforeMs, r = n <= e + this.config.seek.keyframeSearchAfterMs;
11759
11760
  if (t && r) return n;
11760
11761
  }
11761
- }), this.logger = n, this.emitter = t, this.playbackSource = i, this.bufferSource = a, this.usesMse = s, this.seekOvershoot = Sx(s), this.config = {
11762
- seek: y({}, Ax.seek),
11763
- timeshift: y({}, Ax.timeshift),
11764
- playbackRate: y({}, Ax.playbackRate),
11765
- backoff: y({}, Ax.backoff)
11762
+ }), this.logger = n, this.emitter = t, this.playbackSource = i, this.bufferSource = a, this.usesMse = s, this.seekOvershoot = Cx(s), this.config = {
11763
+ seek: y({}, jx.seek),
11764
+ timeshift: y({}, jx.timeshift),
11765
+ playbackRate: y({}, jx.playbackRate),
11766
+ backoff: y({}, jx.backoff)
11766
11767
  }, this.config.timeshift.enabled = o, s || (this.config.seek.toleranceMs = 50, this.config.timeshift.toleranceMs = 20, this.config.seek.aheadToleranceMs = 40), this.state = {
11767
11768
  seekToleranceMultiplier: 1,
11768
11769
  timeshiftToleranceMultiplier: 1
@@ -11824,10 +11825,10 @@ var yx, bx = 5e3, xx = () => Fe() || Me(), Sx = (e) => e && xx() ? 100 : 0, Cx =
11824
11825
  return this.serverCurrentTime - this.playbackSource.currentTime;
11825
11826
  }
11826
11827
  };
11827
- yx = jx, e(jx, "create", (e, t, n, r, i, a = !0) => new yx(e, t, n, r, i, a));
11828
+ bx = Mx, e(Mx, "create", (e, t, n, r, i, a = !0) => new bx(e, t, n, r, i, a));
11828
11829
  //#endregion
11829
11830
  //#region ../../libs/web-sdk/src/modules/TelemetryModule.ts
11830
- var Mx, Nx = {
11831
+ var Nx, Px = {
11831
11832
  enabled: !0,
11832
11833
  interval: 3e4,
11833
11834
  includeErrors: !0,
@@ -11836,11 +11837,11 @@ var Mx, Nx = {
11836
11837
  maxRetries: 10,
11837
11838
  maxErrorReports: 50,
11838
11839
  maxEvents: 50
11839
- }, Px = (e, t) => y(y({}, t), {}, {
11840
+ }, Fx = (e, t) => y(y({}, t), {}, {
11840
11841
  type: e,
11841
11842
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
11842
11843
  discriminator: "web"
11843
- }), Fx = class {
11844
+ }), Ix = class {
11844
11845
  constructor(n, i, a, o) {
11845
11846
  var s = this;
11846
11847
  e(this, "logger", void 0), e(this, "timers", new O()), 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", () => {
@@ -11857,7 +11858,7 @@ var Mx, Nx = {
11857
11858
  initiator: "interval"
11858
11859
  }, n = {}) => {
11859
11860
  if (!this.options.includeStats) return;
11860
- let r = this.parentContext.getStatistics(), i = Px("stats", y(y(y({}, n), r), {}, {
11861
+ let r = this.parentContext.getStatistics(), i = Fx("stats", y(y(y({}, n), r), {}, {
11861
11862
  isFinal: e,
11862
11863
  initiator: t,
11863
11864
  count: this.statsCount++
@@ -11865,7 +11866,7 @@ var Mx, Nx = {
11865
11866
  this.unsentLines.push(i);
11866
11867
  }), e(this, "addEvent", (e) => {
11867
11868
  if (!this.options.includeEvents || this.eventCount > this.options.maxEvents) return;
11868
- let t = Px("event", y(y({}, this.parentContext.getStatistics()), e));
11869
+ let t = Fx("event", y(y({}, this.parentContext.getStatistics()), e));
11869
11870
  this.eventCount++, this.unsentLines.push(t);
11870
11871
  }), e(this, "getStatistics", () => ({ errorCount: this.errorCount })), e(this, "send", function() {
11871
11872
  var e = t(function* (e) {
@@ -11910,14 +11911,14 @@ var Mx, Nx = {
11910
11911
  let { includeErrors: t, maxErrorReports: n } = this.options;
11911
11912
  if (!(e instanceof k) || e.code() === "channel_not_live" || !t || (this.errorCount++, this.errorCount > n)) return;
11912
11913
  let r = this.parentContext.getStatistics();
11913
- this.unsentLines.push(Px("error", y(y({}, r), e.toStringifiable())));
11914
- }), this.logger = n, this.emitter = i, this.options = y(y({}, Nx), a), this.parentContext = o;
11914
+ this.unsentLines.push(Fx("error", y(y({}, r), e.toStringifiable())));
11915
+ }), this.logger = n, this.emitter = i, this.options = y(y({}, Px), a), this.parentContext = o;
11915
11916
  }
11916
11917
  };
11917
- Mx = Fx, e(Fx, "create", (e, t, n, r) => new Mx(e, t, n, r));
11918
+ Nx = Ix, e(Ix, "create", (e, t, n, r) => new Nx(e, t, n, r));
11918
11919
  //#endregion
11919
11920
  //#region ../../libs/web-sdk/src/modules/UnpauseModule.ts
11920
- var Ix, Lx = class {
11921
+ var Lx, Rx = class {
11921
11922
  constructor(t, n, r) {
11922
11923
  e(this, "logger", void 0), e(this, "elements", void 0), e(this, "documentState", void 0), e(this, "timers", new O()), e(this, "unload", () => {
11923
11924
  this.timers.unload();
@@ -11926,10 +11927,10 @@ var Ix, Lx = class {
11926
11927
  }), this.logger = t, this.elements = n, this.documentState = r, this.timers.setInterval(this.unpause, 100);
11927
11928
  }
11928
11929
  };
11929
- Ix = Lx, e(Lx, "create", (e, t, n) => new Ix(e, t, n));
11930
+ Lx = Rx, e(Rx, "create", (e, t, n) => new Lx(e, t, n));
11930
11931
  //#endregion
11931
11932
  //#region ../../libs/web-sdk/src/OptionsProvider.ts
11932
- var Rx = [
11933
+ var zx = [
11933
11934
  "minBufferTime",
11934
11935
  "maxBufferTime",
11935
11936
  "burstEnabled",
@@ -11938,10 +11939,10 @@ var Rx = [
11938
11939
  "offscreenCanvasEnabled",
11939
11940
  "videoCodecs"
11940
11941
  ];
11941
- function zx(e) {
11942
- return Rx.includes(e);
11942
+ function Bx(e) {
11943
+ return zx.includes(e);
11943
11944
  }
11944
- var Bx = class {
11945
+ var Vx = class {
11945
11946
  constructor(t) {
11946
11947
  e(this, "options", void 0), e(this, "overrides", /* @__PURE__ */ new Map()), this.options = t;
11947
11948
  }
@@ -11955,7 +11956,7 @@ var Bx = class {
11955
11956
  this.options[e] = t;
11956
11957
  }
11957
11958
  get(e, t) {
11958
- if (t && zx(e)) {
11959
+ if (t && Bx(e)) {
11959
11960
  var n;
11960
11961
  let r = (n = this.overrides.get(t)) == null ? void 0 : n[e];
11961
11962
  if (r !== void 0) return r;
@@ -11966,7 +11967,7 @@ var Bx = class {
11966
11967
  var n;
11967
11968
  return (n = this.overrides.get(t)) == null ? void 0 : n[e];
11968
11969
  }
11969
- }, Vx = 6, Hx = (e) => {
11970
+ }, Hx = 6, Ux = (e) => {
11970
11971
  let t = [e], n = 0, r = 0, i = !1, a = (e, t) => {
11971
11972
  var i, a;
11972
11973
  if (e.flags && Ls(e.flags)) {
@@ -11978,7 +11979,7 @@ var Bx = class {
11978
11979
  return u > 0 && (r = u), y(y({}, e), {}, { duration: u > 0 ? u : r });
11979
11980
  };
11980
11981
  return (e, n = !1) => {
11981
- if (e.flags && Ls(e.flags) && n && (i = !i), !(n && t.length < Vx && i) && t.length > 0) {
11982
+ if (e.flags && Ls(e.flags) && n && (i = !i), !(n && t.length < Hx && i) && t.length > 0) {
11982
11983
  i = !1;
11983
11984
  let n = e;
11984
11985
  for (let e = t.length - 1; e > 0; e--) {
@@ -11991,13 +11992,13 @@ var Bx = class {
11991
11992
  }
11992
11993
  return t.push(e), [];
11993
11994
  };
11994
- }, Ux = ["mse", "wasm"], Wx = (e) => e == null ? Ux : e, Gx = (e) => {
11995
+ }, Wx = ["mse", "wasm"], Gx = (e) => e == null ? Wx : e, Kx = (e) => {
11995
11996
  if (!e) return !1;
11996
11997
  let t = e.headers && Object.keys(e.headers).length > 0, n = e.queryParams && Object.keys(e.queryParams).length > 0;
11997
11998
  return !!(t || n);
11998
- }, Kx = (e, t, n) => {
11999
- if (Gx(n)) return "mse";
12000
- let r = Wx(e);
11999
+ }, qx = (e, t, n) => {
12000
+ if (Kx(n)) return "mse";
12001
+ let r = Gx(e);
12001
12002
  for (let e of r) switch (e) {
12002
12003
  case "mse":
12003
12004
  if (t) return "mse";
@@ -12008,7 +12009,7 @@ var Bx = class {
12008
12009
  case "wasm": return "wasm";
12009
12010
  }
12010
12011
  return "wasm";
12011
- }, qx = (e, t, n) => {
12012
+ }, Jx = (e, t, n) => {
12012
12013
  if (dn(t)) return y(y({}, e), {}, {
12013
12014
  type: "video",
12014
12015
  codec: t.codec,
@@ -12029,12 +12030,12 @@ var Bx = class {
12029
12030
  data: e.payload,
12030
12031
  duration: 0
12031
12032
  });
12032
- }, Jx = ({ average: e, last: t, max: n, min: r }) => ({
12033
+ }, Yx = ({ average: e, last: t, max: n, min: r }) => ({
12033
12034
  average: Math.round(e),
12034
12035
  last: Math.round(t),
12035
12036
  max: Math.round(n),
12036
12037
  min: Math.round(r)
12037
- }), Yx = [
12038
+ }), Xx = [
12038
12039
  "timeSpentBuffering",
12039
12040
  "timePerBufferingEvent",
12040
12041
  "drift",
@@ -12046,24 +12047,24 @@ var Bx = class {
12046
12047
  "videoKeyframeIntervalMs",
12047
12048
  "timeToConnected",
12048
12049
  "mediaSourceOpenTime"
12049
- ], Xx = [
12050
+ ], Zx = [
12050
12051
  "videoDecodeTime",
12051
12052
  "audioDecodeTime",
12052
12053
  "videoTransportTime",
12053
12054
  "rtt"
12054
- ], Zx = (e) => typeof e == "object" && !!e && "min" in e && "max" in e && "average" in e && "last" in e, Qx = (e) => {
12055
+ ], Qx = (e) => typeof e == "object" && !!e && "min" in e && "max" in e && "average" in e && "last" in e, $x = (e) => {
12055
12056
  let t = y({}, e);
12056
- for (let e of Yx) {
12057
+ for (let e of Xx) {
12057
12058
  let n = t[e];
12058
12059
  typeof n == "number" && (t[e] = Math.round(n));
12059
12060
  }
12060
- for (let e of Xx) {
12061
+ for (let e of Zx) {
12061
12062
  let n = t[e];
12062
- Zx(n) && (t[e] = Jx(n));
12063
+ Qx(n) && (t[e] = Yx(n));
12063
12064
  }
12064
12065
  return t;
12065
- }, $x = (e, t) => e && typeof e == "object" && t in e, eS = (e) => !(typeof e != "object" || !$x(e, "channelId") || typeof e.channelId != "string" || !$x(e, "url") || typeof e.url != "string" || e.channelId.length === 0 || e.url.length === 0), tS = (e) => {
12066
- if (!eS(e)) throw new k("Invalid options", {
12066
+ }, eS = (e, t) => e && typeof e == "object" && t in e, tS = (e) => !(typeof e != "object" || !eS(e, "channelId") || typeof e.channelId != "string" || !eS(e, "url") || typeof e.url != "string" || e.channelId.length === 0 || e.url.length === 0), nS = (e) => {
12067
+ if (!tS(e)) throw new k("Invalid options", {
12067
12068
  isFatal: !0,
12068
12069
  code: "invalid_options"
12069
12070
  });
@@ -12072,13 +12073,13 @@ var Bx = class {
12072
12073
  let n = t;
12073
12074
  n[e] === void 0 && delete n[e];
12074
12075
  }), t;
12075
- }, nS = (e) => {
12076
+ }, rS = (e) => {
12076
12077
  if (typeof e != "object" || !e) throw Error("not an object");
12077
12078
  if (!("video" in e)) throw Error("missing video in subscription");
12078
12079
  if (!("audio" in e)) throw Error("missing audio in subscription");
12079
12080
  if (!("channelId" in e)) throw Error("missing channelId");
12080
12081
  return !0;
12081
- }, rS = class {
12082
+ }, iS = class {
12082
12083
  constructor(n) {
12083
12084
  var r = this;
12084
12085
  e(this, "cache", /* @__PURE__ */ new Map()), e(this, "inFlight", /* @__PURE__ */ new Map()), e(this, "checkVideoSupport", function() {
@@ -12139,10 +12140,10 @@ var Bx = class {
12139
12140
  return this.inFlight.set(e, o), o;
12140
12141
  }), this.logger = n;
12141
12142
  }
12142
- }, iS = 1e4, aS = 1280 * 720, oS = /* @__PURE__ */ new WeakMap(), sS = /* @__PURE__ */ new WeakMap(), cS = /* @__PURE__ */ new WeakMap(), lS = class n extends ie {
12143
+ }, aS = 1e4, oS = 1280 * 720, sS = /* @__PURE__ */ new WeakMap(), cS = /* @__PURE__ */ new WeakMap(), lS = /* @__PURE__ */ new WeakMap(), uS = class n extends ie {
12143
12144
  constructor(r) {
12144
12145
  var o, c, u;
12145
- super(), o = this, e(this, "pictureInPicture", void 0), e(this, "drm", void 0), e(this, "browser", qe()), e(this, "options", void 0), e(this, "element", void 0), e(this, "playbackSource", void 0), e(this, "emitter", new ie()), e(this, "logger", void 0), e(this, "modules", void 0), e(this, "clientIp", void 0), e(this, "sessionId", void 0), e(this, "clientId", cn()), 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 oe(n.MAX_POOL_SIZE)), e(this, "userAgentInformation", new sn()), e(this, "encryptedMediaExtensions", void 0), i(this, oS, 0), i(this, sS, []), e(this, "sampleProcessingSesssions", /* @__PURE__ */ new Map()), e(this, "unbackedSamplesWarned", new eb()), e(this, "unextractableSamplesWarned", new eb()), 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, cS, void 0), e(this, "attach", (e) => {
12146
+ super(), o = this, e(this, "pictureInPicture", void 0), e(this, "drm", void 0), e(this, "browser", qe()), e(this, "options", void 0), e(this, "element", void 0), e(this, "playbackSource", void 0), e(this, "emitter", new ie()), e(this, "logger", void 0), e(this, "modules", void 0), e(this, "clientIp", void 0), e(this, "sessionId", void 0), e(this, "clientId", cn()), 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 oe(n.MAX_POOL_SIZE)), e(this, "userAgentInformation", new sn()), e(this, "encryptedMediaExtensions", void 0), i(this, sS, 0), i(this, cS, []), e(this, "sampleProcessingSesssions", /* @__PURE__ */ new Map()), e(this, "unbackedSamplesWarned", new eb()), e(this, "unextractableSamplesWarned", new eb()), 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, lS, void 0), e(this, "attach", (e) => {
12146
12147
  var t;
12147
12148
  (t = this.wakeLock) == null || t.attach(e), e.appendChild(this.element);
12148
12149
  }), e(this, "setElement", (e) => {
@@ -12229,20 +12230,20 @@ var Bx = class {
12229
12230
  }), e(this, "updateTextTracks", (e) => {
12230
12231
  let t = e.filter((e) => e.codec === "webvtt");
12231
12232
  t.forEach((e) => {
12232
- if (!s(sS, this).find((t) => t.language === e.language)) {
12233
+ if (!s(cS, this).find((t) => t.language === e.language)) {
12233
12234
  if (this.modules.canvasModule) {
12234
12235
  let t = this.modules.canvasModule.textTracks.addTextTrack(e.kind, e.label || e.language || "", e.language || "");
12235
- s(sS, this).push(t);
12236
+ s(cS, this).push(t);
12236
12237
  } else if (this.mediaElement instanceof HTMLVideoElement) {
12237
12238
  let t = this.mediaElement.addTextTrack(e.kind, e.label || e.language, e.language);
12238
- s(sS, this).push(t);
12239
+ s(cS, this).push(t);
12239
12240
  }
12240
12241
  }
12241
12242
  });
12242
- for (let e of s(sS, this)) t.find((t) => t.language === e.language) ? e.mode === "disabled" && (e.mode = "hidden") : e.mode = "disabled";
12243
+ for (let e of s(cS, this)) t.find((t) => t.language === e.language) ? e.mode === "disabled" && (e.mode = "hidden") : e.mode = "disabled";
12243
12244
  this.emit("text tracks", this.textTracks);
12244
12245
  }), e(this, "cleanupTextTracks", (e = this.currentTime - 2e4) => {
12245
- s(sS, this).forEach((t) => {
12246
+ s(cS, this).forEach((t) => {
12246
12247
  if (t.cues) for (let n of Array.from(t.cues)) n.endTime * 1e3 < e - 2e3 && t.removeCue(n);
12247
12248
  });
12248
12249
  }), e(this, "filterRenditions", function() {
@@ -12418,7 +12419,7 @@ var Bx = class {
12418
12419
  (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();
12419
12420
  })), e(this, "capturesCanvasOnWebKit", (e) => !!e && this.browser.platform.isWebKit && this.modules.canvasModule instanceof Vb), e(this, "connectWebKitVideoOutput", (e, t) => {
12420
12421
  let n = () => {
12421
- t.setVideoTrack(void 0), this.browser.platform.isIOS && e.setMaxVideoCanvasPixels(aS);
12422
+ t.setVideoTrack(void 0), this.browser.platform.isIOS && e.setMaxVideoCanvasPixels(oS);
12422
12423
  };
12423
12424
  e.onVideoTrackLost((e) => {
12424
12425
  this.logger.warn("Worker video track lost, falling back to canvas capture", { error: e }), n();
@@ -12468,7 +12469,7 @@ var Bx = class {
12468
12469
  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();
12469
12470
  }), e(this, "getStatistics", () => {
12470
12471
  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;
12471
- return Qx(y(y({}, e), {}, {
12472
+ return $x(y(y({}, e), {}, {
12472
12473
  averageBitRate: t,
12473
12474
  reconnectsPerHour: i,
12474
12475
  seekAdjustmentsPerMinute: s,
@@ -12477,7 +12478,7 @@ var Bx = class {
12477
12478
  }), e(this, "resetModules", () => {
12478
12479
  Object.values(this.modules).forEach((e) => {
12479
12480
  e && "reset" in e && e.reset();
12480
- }), this.playbackSource instanceof dc && this.modules.adaptivity.reset(iS), this.sampleProcessingSesssions.clear(), this.cleanupTextTracks(Infinity), this.playbackSource.currentTime = 0, this.playbackSource.isActivated = !1;
12481
+ }), this.playbackSource instanceof dc && this.modules.adaptivity.reset(aS), this.sampleProcessingSesssions.clear(), this.cleanupTextTracks(Infinity), this.playbackSource.currentTime = 0, this.playbackSource.isActivated = !1;
12481
12482
  }), e(this, "disconnectForInactivePage", (e) => {
12482
12483
  if (this.clearInactivityDisconnect(), this.emitter.emit("flush buffers"), !this.isBackgroundPlayEnabled(this.channelId)) {
12483
12484
  var t;
@@ -12511,7 +12512,7 @@ var Bx = class {
12511
12512
  let e = this.modules.canvasModule instanceof Vb ? !0 : void 0;
12512
12513
  return y({
12513
12514
  uptime: this.uptime,
12514
- version: "4.7.2-5-g4c14d0e4",
12515
+ version: "4.7.2-6-gceea26ed",
12515
12516
  clientId: this.clientId,
12516
12517
  sessionId: this.sessionId,
12517
12518
  channelId: this.channelId,
@@ -12556,7 +12557,7 @@ var Bx = class {
12556
12557
  if (this.browser.platform.isWebKit || !this.browser.isMobile) return !1;
12557
12558
  let t = (e = this.modules) == null ? void 0 : e.decoder;
12558
12559
  return t ? t.audioWebCodecsInUse : this.isWebCodecsAudioAvailable(this.channelId);
12559
- }), this.options = new Bx(y(y({}, ar), tS(r))), r.telemetryEnabled === void 0 && ["localhost", "127.0.0.1"].includes(location.hostname) && this.options.set("telemetryEnabled", !1);
12560
+ }), this.options = new Vx(y(y({}, ar), nS(r))), r.telemetryEnabled === void 0 && ["localhost", "127.0.0.1"].includes(location.hostname) && this.options.set("telemetryEnabled", !1);
12560
12561
  let d = {
12561
12562
  channelId: this.options.get("channelId"),
12562
12563
  audio: {
@@ -12569,14 +12570,14 @@ var Bx = class {
12569
12570
  height: this.options.get("maxSize").height
12570
12571
  }
12571
12572
  }, f = b.get();
12572
- f.setLevel(this.options.get("logLevel")), f.setDebug(!1), this.logger = f, this.webCodecsRenditionSupport = new rS(f), r.iosMediaElementEnabled !== void 0 && this.logger.warn("Option iosMediaElementEnabled is deprecated and will be removed in a future release. Use streamToMediaElementEnabled instead.");
12573
+ f.setLevel(this.options.get("logLevel")), f.setDebug(!1), this.logger = f, this.webCodecsRenditionSupport = new iS(f), r.iosMediaElementEnabled !== void 0 && this.logger.warn("Option iosMediaElementEnabled is deprecated and will be removed in a future release. Use streamToMediaElementEnabled instead.");
12573
12574
  let p = (c = r.streamToMediaElementEnabled) == null ? r.iosMediaElementEnabled : c;
12574
12575
  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.");
12575
12576
  let m = (u = r.backgroundPlayEnabled) == null ? r.iosBackgroundPlayEnabled : u;
12576
12577
  m !== void 0 && (this.options.set("backgroundPlayEnabled", m), this.options.set("iosBackgroundPlayEnabled", m));
12577
12578
  let g = r.mseEnabled !== void 0, ee = r.decoders !== void 0;
12578
12579
  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"]);
12579
- let _ = nx.create(this.emitter, this.logger.createContext("PictureInPictureModule")), te = this.options.get("mediaSessionEnabled") ? zb.create(this.emitter, this.logger.createContext("MediaSessionModule"), {
12580
+ let _ = rx.create(this.emitter, this.logger.createContext("PictureInPictureModule")), te = this.options.get("mediaSessionEnabled") ? zb.create(this.emitter, this.logger.createContext("MediaSessionModule"), {
12580
12581
  metadata: this.options.get("mediaSessionMetadata"),
12581
12582
  decoy: this.willUseMediaSource() || this.usesSplitCanvasAudio() ? void 0 : Ac.create(this.logger.createContext("AudioFocusDecoy"), this.yieldToInterruption),
12582
12583
  isMuted: () => this.playbackSource.userMuted,
@@ -12591,7 +12592,7 @@ var Bx = class {
12591
12592
  reconnectHandler: this.options.get("reconnectHandler"),
12592
12593
  options: this.options,
12593
12594
  onConnectInfo: this.onConnectInfo
12594
- }), ae = _x.create(this.logger.createContext("SubscriptionModule"), this.emitter, d), x = px.create(this.emitter, ae), S = ix.create(this.emitter, this.logger.createContext("PlaybackModule"), this, this.options.get("minBufferTime")), se = dx.create(this.emitter, this.logger.createContext("QualityOfServiceModule"), x, S);
12595
+ }), ae = vx.create(this.logger.createContext("SubscriptionModule"), this.emitter, d), x = mx.create(this.emitter, ae), S = ax.create(this.emitter, this.logger.createContext("PlaybackModule"), this, this.options.get("minBufferTime")), se = fx.create(this.emitter, this.logger.createContext("QualityOfServiceModule"), x, S);
12595
12596
  this.encryptedMediaExtensions = new Ci(this.emitter, this.logger.createContext("EncryptedMediaExtensions"), r.drm), this.drm = {
12596
12597
  setHeaders: (e) => {
12597
12598
  this.encryptedMediaExtensions.headers = e;
@@ -12610,7 +12611,7 @@ var Bx = class {
12610
12611
  logger: this.logger.createContext("MediaElement"),
12611
12612
  poster: ue
12612
12613
  });
12613
- e.on("buffer state", (e) => this.onMediaElementBufferState(e, C)), 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, Ci.isSupported() && this.encryptedMediaExtensions.attach(e.element), C = Kb.create(this.logger.createContext("MseModule"), this.emitter, this.element), this.options.get("pauseSupportEnabled") || (de = Lx.create(this.logger.createContext("UnpauseModule"), [e], ce)), this.options.get("pictureInPictureEnabled") && this.emitter.emit("add picture in picture listener", { element: e.element });
12614
+ e.on("buffer state", (e) => this.onMediaElementBufferState(e, C)), 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, Ci.isSupported() && this.encryptedMediaExtensions.attach(e.element), C = Kb.create(this.logger.createContext("MseModule"), this.emitter, this.element), this.options.get("pauseSupportEnabled") || (de = Rx.create(this.logger.createContext("UnpauseModule"), [e], ce)), this.options.get("pictureInPictureEnabled") && this.emitter.emit("add picture in picture listener", { element: e.element });
12614
12615
  } else if (this.streamsToMediaElement()) {
12615
12616
  let e = Vb.create(this.emitter, this.logger.createContext("ModernCanvasModule"), this.pool, this, {
12616
12617
  type: this.options.get("media") === "audio" ? "audio" : "video",
@@ -12624,7 +12625,7 @@ var Bx = class {
12624
12625
  });
12625
12626
  this.element = e.element().element, this.playbackSource = e, fe = e;
12626
12627
  let t = this.browser.platform.isIOS && this.browser.platform.iosVersion <= 15;
12627
- this.options.get("pictureInPictureEnabled") && !t && this.emitter.emit("add picture in picture listener", { element: this.element }), this.options.get("pauseSupportEnabled") || (de = Lx.create(this.logger.createContext("UnpauseModule"), e.elements(), ce));
12628
+ this.options.get("pictureInPictureEnabled") && !t && this.emitter.emit("add picture in picture listener", { element: this.element }), this.options.get("pauseSupportEnabled") || (de = Rx.create(this.logger.createContext("UnpauseModule"), e.elements(), ce));
12628
12629
  } else {
12629
12630
  let e;
12630
12631
  e = Pb.create(this.emitter, this.logger.createContext("LegacyCanvasModule"), this.pool, this, this.options.get("muted") || this.options.get("media") === "video", this.options.get("volume"), () => {
@@ -12645,9 +12646,9 @@ var Bx = class {
12645
12646
  getTargetBufferTime: () => S.getTargetBufferTime(),
12646
12647
  getNextBufferedRangeStart: C ? (e) => C.getNextBufferedRangeStart(e) : void 0,
12647
12648
  getBufferedEndAt: C ? (e) => C.getBufferedEndAt(e) : void 0
12648
- }, ge = jx.create(this.emitter, this.logger.createContext("SyncModule"), this.playbackSource, he, me, pe), _e = yb.create(this.logger.createContext("JitterModule")), ve = mc.create(this.emitter), ye = (this.options.get("edgeUrl") || this.options.get("url")).replace("wss://", "https://").replace("ws://", "http://").replace("//lb.", "//errors."), w = new URL("/telemetry", ye).toString();
12649
+ }, ge = Mx.create(this.emitter, this.logger.createContext("SyncModule"), this.playbackSource, he, me, pe), _e = yb.create(this.logger.createContext("JitterModule")), ve = mc.create(this.emitter), ye = (this.options.get("edgeUrl") || this.options.get("url")).replace("wss://", "https://").replace("ws://", "http://").replace("//lb.", "//errors."), w = new URL("/telemetry", ye).toString();
12649
12650
  this.modules = {
12650
- telemetry: Fx.create(this.logger.createContext("TelemetryModule"), this.emitter, {
12651
+ telemetry: Ix.create(this.logger.createContext("TelemetryModule"), this.emitter, {
12651
12652
  url: w,
12652
12653
  enabled: this.options.get("telemetryEnabled"),
12653
12654
  includeStats: !1,
@@ -12732,7 +12733,7 @@ var Bx = class {
12732
12733
  let r = ((t = (n = e.telemetry) == null ? void 0 : n.probability) == null ? 1 : t) >= Math.random();
12733
12734
  if (e.telemetry) {
12734
12735
  var i;
12735
- (i = this.modules.telemetry) == null || i.unload(), this.modules.telemetry = Fx.create(this.logger.createContext("TelemetryModule"), this.emitter, y(y({}, e.telemetry), {}, { enabled: this.options.get("telemetryEnabled") && r }), this), this.modules.telemetry.load();
12736
+ (i = this.modules.telemetry) == null || i.unload(), this.modules.telemetry = Ix.create(this.logger.createContext("TelemetryModule"), this.emitter, y(y({}, e.telemetry), {}, { enabled: this.options.get("telemetryEnabled") && r }), this), this.modules.telemetry.load();
12736
12737
  }
12737
12738
  }), this.emitter.on("adapt level", (e) => {
12738
12739
  let t = this.modules.renditions.getRenditionLevels(), n = this.modules.renditions.getRenditionLevel(), r = t.findIndex((e) => e === n), i = t.length - 1, a = r;
@@ -12763,8 +12764,8 @@ var Bx = class {
12763
12764
  audio: y(y({}, this.targetSubscription.audio), d == null ? void 0 : d.audio)
12764
12765
  })), this.emitter.emit("adapted level");
12765
12766
  }), this.emitter.on("text track data", (e) => {
12766
- let t = s(sS, this).find((t) => t.language === e.language), n = this.modules.sync.getTimeshiftOffset() / 1e3, r = n - s(oS, this);
12767
- if (a(oS, this, n), t) {
12767
+ let t = s(cS, this).find((t) => t.language === e.language), n = this.modules.sync.getTimeshiftOffset() / 1e3, r = n - s(sS, this);
12768
+ if (a(sS, this, n), t) {
12768
12769
  if (t.cues) for (let e of t.cues) e.startTime -= r, e.endTime -= r;
12769
12770
  for (let r of e.cues) {
12770
12771
  let e = new VTTCue(r.startTime - n, r.endTime - n, r.text);
@@ -12780,19 +12781,19 @@ var Bx = class {
12780
12781
  this.clientIp = t.ip;
12781
12782
  break;
12782
12783
  case "renditions":
12783
- this.updateTextTracks(t.renditions), a(cS, this, this.filterRenditions(t.renditions).then((e) => {
12784
+ this.updateTextTracks(t.renditions), a(lS, this, this.filterRenditions(t.renditions).then((e) => {
12784
12785
  this.emitter.emit("renditions", {
12785
12786
  renditions: e,
12786
12787
  channelId: this.currentSubscription.channelId
12787
12788
  }), this.emit("rendition levels", this.modules.renditions.getRenditionLevels()), this.emitLanguagesIfChanged();
12788
12789
  }).finally(() => {
12789
- a(cS, this, void 0);
12790
+ a(lS, this, void 0);
12790
12791
  }));
12791
12792
  break;
12792
12793
  case "subscription changed":
12793
12794
  var r;
12794
12795
  try {
12795
- nS(t.subscription);
12796
+ rS(t.subscription);
12796
12797
  } catch (e) {
12797
12798
  this.emitter.emit("error", new k("Subscription failed validation", {
12798
12799
  source: e instanceof Error ? e : void 0,
@@ -12923,7 +12924,7 @@ var Bx = class {
12923
12924
  let xe = function() {
12924
12925
  var e = t(function* (e) {
12925
12926
  let t = e.channelId;
12926
- s(cS, o) && (yield s(cS, o));
12927
+ s(lS, o) && (yield s(lS, o));
12927
12928
  let n = o.modules.renditions.getRendition(e.renditionId, t);
12928
12929
  if (!zs(e.flags)) {
12929
12930
  if (Bs(e.flags)) {
@@ -12937,8 +12938,8 @@ var Bx = class {
12937
12938
  } catch (e) {
12938
12939
  o.logger.warn("failed to parse WebVTT segment, dropping it", e);
12939
12940
  }
12940
- let i = n / 1e3, c = s(sS, o).find((t) => t.language === e.language), l = i - s(oS, o);
12941
- if (a(oS, o, i), c) {
12941
+ let i = n / 1e3, c = s(cS, o).find((t) => t.language === e.language), l = i - s(sS, o);
12942
+ if (a(sS, o, i), c) {
12942
12943
  if (c.cues) for (let e of c.cues) e.startTime -= l, e.endTime -= l;
12943
12944
  for (let e of r) {
12944
12945
  let t = new VTTCue(e.startTime - i, e.endTime - i, e.text);
@@ -12974,10 +12975,10 @@ var Bx = class {
12974
12975
  mimeType: s
12975
12976
  }), o.emit("initialized media");
12976
12977
  } else {
12977
- let t = qx(e, n, o.sizes.get(e.renditionId));
12978
+ let t = Jx(e, n, o.sizes.get(e.renditionId));
12978
12979
  o.modules.jitter.recordSample(t);
12979
12980
  let i = o.sampleProcessingSesssions.get(r);
12980
- if (!i) i = Hx(o.modules.sync.processSample(t)), o.sampleProcessingSesssions.set(r, i);
12981
+ if (!i) i = Ux(o.modules.sync.processSample(t)), o.sampleProcessingSesssions.set(r, i);
12981
12982
  else {
12982
12983
  let e = o.willUseMediaSource() && o.isSwitchingRenditionLevel && t.type === "video", n = i(o.modules.sync.processSample(t), e), r = t;
12983
12984
  n.forEach((e) => {
@@ -13084,7 +13085,7 @@ var Bx = class {
13084
13085
  this.modules.subscription.setLanguage(e), this.alignSizeAndBitRate(this.targetSubscription);
13085
13086
  }
13086
13087
  set textTrack(e) {
13087
- e !== this.textTrack && (s(sS, this).forEach((t) => {
13088
+ e !== this.textTrack && (s(cS, this).forEach((t) => {
13088
13089
  if (t.label === e) t.mode = "showing";
13089
13090
  else {
13090
13091
  if (t.mode === "showing" && t.cues) for (let e of [...t.cues]) t.removeCue(e);
@@ -13093,11 +13094,11 @@ var Bx = class {
13093
13094
  }), this.emitter.emit("text track", e));
13094
13095
  }
13095
13096
  get textTracks() {
13096
- return s(sS, this).filter((e) => e.mode !== "disabled").map((e) => e.label);
13097
+ return s(cS, this).filter((e) => e.mode !== "disabled").map((e) => e.label);
13097
13098
  }
13098
13099
  get textTrack() {
13099
13100
  var e;
13100
- return (e = s(sS, this).find((e) => e.mode === "showing")) == null ? void 0 : e.label;
13101
+ return (e = s(cS, this).find((e) => e.mode === "showing")) == null ? void 0 : e.label;
13101
13102
  }
13102
13103
  get channelId() {
13103
13104
  var e, t;
@@ -13235,7 +13236,7 @@ var Bx = class {
13235
13236
  return this.modules.subscription.getTargetSubscription();
13236
13237
  }
13237
13238
  resolvedDecoder(e) {
13238
- return Kx(this.options.get("decoders", e), this.browser.supportsMediaSource, this.options.get("drm"));
13239
+ return qx(this.options.get("decoders", e), this.browser.supportsMediaSource, this.options.get("drm"));
13239
13240
  }
13240
13241
  usesSplitCanvasAudio() {
13241
13242
  return !this.willUseMediaSource() && this.options.get("streamToMediaElementEnabled") && gt(this.browser) && this.options.get("media") !== "audio" && this.options.get("media") !== "video" && this.browser.platform.isIOS;
@@ -13275,6 +13276,6 @@ var Bx = class {
13275
13276
  return this.hasCalledConnect && this.isBackgroundPlayEnabled(e) && !this.isUserPaused;
13276
13277
  }
13277
13278
  };
13278
- e(lS, "MAX_POOL_SIZE", 10), e(lS, "REMOVE_CUE_THRESHOLD", 1e3 * 10), e(lS, "BACKGROUND_INACTIVITY_DISCONNECT_TIMEOUT", 1e3 * 15), e(lS, "VISIBLE_PAUSE_DISCONNECT_DELAY", 1e3);
13279
+ e(uS, "MAX_POOL_SIZE", 10), e(uS, "REMOVE_CUE_THRESHOLD", 1e3 * 10), e(uS, "BACKGROUND_INACTIVITY_DISCONNECT_TIMEOUT", 1e3 * 15), e(uS, "VISIBLE_PAUSE_DISCONNECT_DELAY", 1e3);
13279
13280
  //#endregion
13280
- export { ft as C, ht as D, dt as E, Ve as O, mt as S, st as T, rt as _, xn as a, nt as b, _n as c, Cn as d, k as f, et as g, it as h, yn as i, Be as k, On as l, tt as m, Pn as n, Sn as o, Jt as p, bn as r, vn as s, lS as t, wn as u, lt as v, ut as w, ot as x, $e as y };
13281
+ export { ft as C, ht as D, dt as E, Ve as O, mt as S, st as T, rt as _, xn as a, nt as b, _n as c, Cn as d, k as f, et as g, it as h, yn as i, Be as k, On as l, tt as m, Pn as n, Sn as o, Jt as p, bn as r, vn as s, uS as t, wn as u, lt as v, ut as w, ot as x, $e as y };