@eluvio/elv-player-js 2.1.26 → 2.1.29

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.
@@ -1,4 +1,4 @@
1
- var pt = Object.create, Ue = Object.defineProperty, ft = Object.getOwnPropertyDescriptor, vt = Object.getOwnPropertyNames, mt = Object.getPrototypeOf, yt = Object.prototype.hasOwnProperty, Fe = function(a, e) {
1
+ var ht = Object.create, Ue = Object.defineProperty, ft = Object.getOwnPropertyDescriptor, vt = Object.getOwnPropertyNames, mt = Object.getPrototypeOf, yt = Object.prototype.hasOwnProperty, Fe = function(a, e) {
2
2
  return function() {
3
3
  return a && (e = a(a = 0)), e;
4
4
  };
@@ -7,13 +7,13 @@ var pt = Object.create, Ue = Object.defineProperty, ft = Object.getOwnPropertyDe
7
7
  return e || a((e = { exports: {} }).exports, e), e.exports;
8
8
  };
9
9
  }, gt = function(a, e, t, r) {
10
- if (e && typeof e == "object" || typeof e == "function") for (var i = vt(e), n = 0, o = i.length, u; n < o; n++) u = i[n], !yt.call(a, u) && u !== t && Ue(a, u, { get: (function(d) {
10
+ if (e && typeof e == "object" || typeof e == "function") for (var i = vt(e), n = 0, s = i.length, u; n < s; n++) u = i[n], !yt.call(a, u) && u !== t && Ue(a, u, { get: (function(d) {
11
11
  return e[d];
12
12
  }).bind(null, u), enumerable: !(r = ft(e, u)) || r.enumerable });
13
13
  return a;
14
- }, C = function(a, e, t) {
15
- return t = a != null ? pt(mt(a)) : {}, gt(!a || !a.__esModule ? Ue(t, "default", { value: a, enumerable: !0 }) : t, a);
16
- }, U = N(function(a, e) {
14
+ }, j = function(a, e, t) {
15
+ return t = a != null ? ht(mt(a)) : {}, gt(!a || !a.__esModule ? Ue(t, "default", { value: a, enumerable: !0 }) : t, a);
16
+ }, G = N(function(a, e) {
17
17
  var t;
18
18
  typeof window < "u" ? t = window : typeof global < "u" ? t = global : typeof self < "u" ? t = self : t = {}, e.exports = t;
19
19
  });
@@ -23,19 +23,19 @@ function Z(a, e) {
23
23
  var $ = Fe(function() {
24
24
  $();
25
25
  });
26
- function We(a) {
26
+ function Ge(a) {
27
27
  "@swc/helpers - typeof";
28
28
  return a && typeof Symbol < "u" && a.constructor === Symbol ? "symbol" : typeof a;
29
29
  }
30
30
  var Qe = Fe(function() {
31
- }), Ge = N(function(a, e) {
31
+ }), We = N(function(a, e) {
32
32
  var t = Array.prototype.slice;
33
33
  e.exports = r;
34
34
  function r(i, n) {
35
35
  for (("length" in i) || (i = [i]), i = t.call(i); i.length; ) {
36
- var o = i.shift(), u = n(o);
36
+ var s = i.shift(), u = n(s);
37
37
  if (u) return u;
38
- o.childNodes && o.childNodes.length && (i = t.call(o.childNodes).concat(i));
38
+ s.childNodes && s.childNodes.length && (i = t.call(s.childNodes).concat(i));
39
39
  }
40
40
  }
41
41
  }), bt = N(function(a, e) {
@@ -56,7 +56,7 @@ var Qe = Fe(function() {
56
56
  t.prototype.type = "DOMTextNode", t.prototype.nodeType = 3, t.prototype.nodeName = "#text", t.prototype.toString = function() {
57
57
  return this.data;
58
58
  }, t.prototype.replaceData = function(r, i, n) {
59
- var o = this.data, u = o.substring(0, r), d = o.substring(r + i, o.length);
59
+ var s = this.data, u = s.substring(0, r), d = s.substring(r + i, s.length);
60
60
  this.data = u + n + d, this.length = this.data.length;
61
61
  };
62
62
  }), Ve = N(function(a, e) {
@@ -64,8 +64,8 @@ var Qe = Fe(function() {
64
64
  function t(r) {
65
65
  var i = this, n = r.type;
66
66
  r.target || (r.target = i), i.listeners || (i.listeners = {});
67
- var o = i.listeners[n];
68
- if (o) return o.forEach(function(u) {
67
+ var s = i.listeners[n];
68
+ if (s) return s.forEach(function(u) {
69
69
  r.currentTarget = i, typeof u == "function" ? u(r) : u.handleEvent(r);
70
70
  });
71
71
  i.parentNode && i.parentNode.dispatchEvent(r);
@@ -81,137 +81,137 @@ var Qe = Fe(function() {
81
81
  function t(r, i) {
82
82
  var n = this;
83
83
  if (n.listeners && n.listeners[r]) {
84
- var o = n.listeners[r], u = o.indexOf(i);
85
- u !== -1 && o.splice(u, 1);
84
+ var s = n.listeners[r], u = s.indexOf(i);
85
+ u !== -1 && s.splice(u, 1);
86
86
  }
87
87
  }
88
88
  }), Tt = N(function(a, e) {
89
89
  Qe(), e.exports = r;
90
90
  var t = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "menuitem", "meta", "param", "source", "track", "wbr"];
91
- function r(l) {
92
- switch (l.nodeType) {
91
+ function r(c) {
92
+ switch (c.nodeType) {
93
93
  case 3:
94
- return v(l.data);
94
+ return m(c.data);
95
95
  case 8:
96
- return "<!--" + l.data + "-->";
96
+ return "<!--" + c.data + "-->";
97
97
  default:
98
- return i(l);
98
+ return i(c);
99
99
  }
100
100
  }
101
- function i(l) {
102
- var s = [], _ = l.tagName;
103
- return l.namespaceURI === "http://www.w3.org/1999/xhtml" && (_ = _.toLowerCase()), s.push("<" + _ + c(l) + u(l)), t.indexOf(_) > -1 ? s.push(" />") : (s.push(">"), l.childNodes.length ? s.push.apply(s, l.childNodes.map(r)) : l.textContent || l.innerText ? s.push(v(l.textContent || l.innerText)) : l.innerHTML && s.push(l.innerHTML), s.push("</" + _ + ">")), s.join("");
101
+ function i(c) {
102
+ var o = [], p = c.tagName;
103
+ return c.namespaceURI === "http://www.w3.org/1999/xhtml" && (p = p.toLowerCase()), o.push("<" + p + l(c) + u(c)), t.indexOf(p) > -1 ? o.push(" />") : (o.push(">"), c.childNodes.length ? o.push.apply(o, c.childNodes.map(r)) : c.textContent || c.innerText ? o.push(m(c.textContent || c.innerText)) : c.innerHTML && o.push(c.innerHTML), o.push("</" + p + ">")), o.join("");
104
104
  }
105
- function n(l, s) {
106
- var _ = We(l[s]);
107
- return s === "style" && Object.keys(l.style).length > 0 ? !0 : l.hasOwnProperty(s) && (_ === "string" || _ === "boolean" || _ === "number") && s !== "nodeName" && s !== "className" && s !== "tagName" && s !== "textContent" && s !== "innerText" && s !== "namespaceURI" && s !== "innerHTML";
105
+ function n(c, o) {
106
+ var p = Ge(c[o]);
107
+ return o === "style" && Object.keys(c.style).length > 0 ? !0 : c.hasOwnProperty(o) && (p === "string" || p === "boolean" || p === "number") && o !== "nodeName" && o !== "className" && o !== "tagName" && o !== "textContent" && o !== "innerText" && o !== "namespaceURI" && o !== "innerHTML";
108
108
  }
109
- function o(l) {
110
- if (typeof l == "string") return l;
111
- var s = "";
112
- return Object.keys(l).forEach(function(_) {
113
- var y = l[_];
114
- _ = _.replace(/[A-Z]/g, function(f) {
109
+ function s(c) {
110
+ if (typeof c == "string") return c;
111
+ var o = "";
112
+ return Object.keys(c).forEach(function(p) {
113
+ var y = c[p];
114
+ p = p.replace(/[A-Z]/g, function(f) {
115
115
  return "-" + f.toLowerCase();
116
- }), s += _ + ":" + y + ";";
117
- }), s;
118
- }
119
- function u(l) {
120
- var s = l.dataset, _ = [];
121
- for (var y in s) _.push({ name: "data-" + y, value: s[y] });
122
- return _.length ? d(_) : "";
123
- }
124
- function d(l) {
125
- var s = [];
126
- return l.forEach(function(_) {
127
- var y = _.name, f = _.value;
128
- y === "style" && (f = o(f)), s.push(y + '="' + b(f) + '"');
129
- }), s.length ? " " + s.join(" ") : "";
130
- }
131
- function c(l) {
132
- var s = [];
133
- for (var _ in l) n(l, _) && s.push({ name: _, value: l[_] });
134
- for (var y in l._attributes) for (var f in l._attributes[y]) {
135
- var g = l._attributes[y][f], p = (g.prefix ? g.prefix + ":" : "") + f;
136
- s.push({ name: p, value: g.value });
116
+ }), o += p + ":" + y + ";";
117
+ }), o;
118
+ }
119
+ function u(c) {
120
+ var o = c.dataset, p = [];
121
+ for (var y in o) p.push({ name: "data-" + y, value: o[y] });
122
+ return p.length ? d(p) : "";
123
+ }
124
+ function d(c) {
125
+ var o = [];
126
+ return c.forEach(function(p) {
127
+ var y = p.name, f = p.value;
128
+ y === "style" && (f = s(f)), o.push(y + '="' + b(f) + '"');
129
+ }), o.length ? " " + o.join(" ") : "";
130
+ }
131
+ function l(c) {
132
+ var o = [];
133
+ for (var p in c) n(c, p) && o.push({ name: p, value: c[p] });
134
+ for (var y in c._attributes) for (var f in c._attributes[y]) {
135
+ var g = c._attributes[y][f], _ = (g.prefix ? g.prefix + ":" : "") + f;
136
+ o.push({ name: _, value: g.value });
137
137
  }
138
- return l.className && s.push({ name: "class", value: l.className }), s.length ? d(s) : "";
138
+ return c.className && o.push({ name: "class", value: c.className }), o.length ? d(o) : "";
139
139
  }
140
- function v(l) {
141
- var s = "";
142
- return typeof l == "string" ? s = l : l && (s = l.toString()), s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
140
+ function m(c) {
141
+ var o = "";
142
+ return typeof c == "string" ? o = c : c && (o = c.toString()), o.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
143
143
  }
144
- function b(l) {
145
- return v(l).replace(/"/g, "&quot;");
144
+ function b(c) {
145
+ return m(c).replace(/"/g, "&quot;");
146
146
  }
147
147
  }), Ke = N(function(a, e) {
148
148
  $();
149
- var t = Ge(), r = Ve(), i = Je(), n = ze(), o = Tt(), u = "http://www.w3.org/1999/xhtml";
149
+ var t = We(), r = Ve(), i = Je(), n = ze(), s = Tt(), u = "http://www.w3.org/1999/xhtml";
150
150
  e.exports = d;
151
- function d(c, v, b) {
152
- if (!Z(this, d)) return new d(c);
153
- var l = b === void 0 ? u : b || null;
154
- this.tagName = l === u ? String(c).toUpperCase() : c, this.nodeName = this.tagName, this.className = "", this.dataset = {}, this.childNodes = [], this.parentNode = null, this.style = {}, this.ownerDocument = v || null, this.namespaceURI = l, this._attributes = {}, this.tagName === "INPUT" && (this.type = "text");
155
- }
156
- d.prototype.type = "DOMElement", d.prototype.nodeType = 1, d.prototype.appendChild = function(c) {
157
- return c.parentNode && c.parentNode.removeChild(c), this.childNodes.push(c), c.parentNode = this, c;
158
- }, d.prototype.replaceChild = function(c, v) {
159
- c.parentNode && c.parentNode.removeChild(c);
160
- var b = this.childNodes.indexOf(v);
161
- return v.parentNode = null, this.childNodes[b] = c, c.parentNode = this, v;
162
- }, d.prototype.removeChild = function(c) {
163
- var v = this.childNodes.indexOf(c);
164
- return this.childNodes.splice(v, 1), c.parentNode = null, c;
165
- }, d.prototype.insertBefore = function(c, v) {
166
- c.parentNode && c.parentNode.removeChild(c);
167
- var b = v == null ? -1 : this.childNodes.indexOf(v);
168
- return b > -1 ? this.childNodes.splice(b, 0, c) : this.childNodes.push(c), c.parentNode = this, c;
169
- }, d.prototype.setAttributeNS = function(c, v, b) {
170
- var l = null, s = v, _ = v.indexOf(":");
171
- if (_ > -1 && (l = v.substr(0, _), s = v.substr(_ + 1)), this.tagName === "INPUT" && v === "type") this.type = b;
151
+ function d(l, m, b) {
152
+ if (!Z(this, d)) return new d(l);
153
+ var c = b === void 0 ? u : b || null;
154
+ this.tagName = c === u ? String(l).toUpperCase() : l, this.nodeName = this.tagName, this.className = "", this.dataset = {}, this.childNodes = [], this.parentNode = null, this.style = {}, this.ownerDocument = m || null, this.namespaceURI = c, this._attributes = {}, this.tagName === "INPUT" && (this.type = "text");
155
+ }
156
+ d.prototype.type = "DOMElement", d.prototype.nodeType = 1, d.prototype.appendChild = function(l) {
157
+ return l.parentNode && l.parentNode.removeChild(l), this.childNodes.push(l), l.parentNode = this, l;
158
+ }, d.prototype.replaceChild = function(l, m) {
159
+ l.parentNode && l.parentNode.removeChild(l);
160
+ var b = this.childNodes.indexOf(m);
161
+ return m.parentNode = null, this.childNodes[b] = l, l.parentNode = this, m;
162
+ }, d.prototype.removeChild = function(l) {
163
+ var m = this.childNodes.indexOf(l);
164
+ return this.childNodes.splice(m, 1), l.parentNode = null, l;
165
+ }, d.prototype.insertBefore = function(l, m) {
166
+ l.parentNode && l.parentNode.removeChild(l);
167
+ var b = m == null ? -1 : this.childNodes.indexOf(m);
168
+ return b > -1 ? this.childNodes.splice(b, 0, l) : this.childNodes.push(l), l.parentNode = this, l;
169
+ }, d.prototype.setAttributeNS = function(l, m, b) {
170
+ var c = null, o = m, p = m.indexOf(":");
171
+ if (p > -1 && (c = m.substr(0, p), o = m.substr(p + 1)), this.tagName === "INPUT" && m === "type") this.type = b;
172
172
  else {
173
- var y = this._attributes[c] || (this._attributes[c] = {});
174
- y[s] = { value: b, prefix: l };
173
+ var y = this._attributes[l] || (this._attributes[l] = {});
174
+ y[o] = { value: b, prefix: c };
175
175
  }
176
- }, d.prototype.getAttributeNS = function(c, v) {
177
- var b = this._attributes[c], l = b && b[v] && b[v].value;
178
- return this.tagName === "INPUT" && v === "type" ? this.type : typeof l != "string" ? null : l;
179
- }, d.prototype.removeAttributeNS = function(c, v) {
180
- var b = this._attributes[c];
181
- b && delete b[v];
182
- }, d.prototype.hasAttributeNS = function(c, v) {
183
- var b = this._attributes[c];
184
- return !!b && v in b;
185
- }, d.prototype.setAttribute = function(c, v) {
186
- return this.setAttributeNS(null, c, v);
187
- }, d.prototype.getAttribute = function(c) {
188
- return this.getAttributeNS(null, c);
189
- }, d.prototype.removeAttribute = function(c) {
190
- return this.removeAttributeNS(null, c);
191
- }, d.prototype.hasAttribute = function(c) {
192
- return this.hasAttributeNS(null, c);
176
+ }, d.prototype.getAttributeNS = function(l, m) {
177
+ var b = this._attributes[l], c = b && b[m] && b[m].value;
178
+ return this.tagName === "INPUT" && m === "type" ? this.type : typeof c != "string" ? null : c;
179
+ }, d.prototype.removeAttributeNS = function(l, m) {
180
+ var b = this._attributes[l];
181
+ b && delete b[m];
182
+ }, d.prototype.hasAttributeNS = function(l, m) {
183
+ var b = this._attributes[l];
184
+ return !!b && m in b;
185
+ }, d.prototype.setAttribute = function(l, m) {
186
+ return this.setAttributeNS(null, l, m);
187
+ }, d.prototype.getAttribute = function(l) {
188
+ return this.getAttributeNS(null, l);
189
+ }, d.prototype.removeAttribute = function(l) {
190
+ return this.removeAttributeNS(null, l);
191
+ }, d.prototype.hasAttribute = function(l) {
192
+ return this.hasAttributeNS(null, l);
193
193
  }, d.prototype.removeEventListener = n, d.prototype.addEventListener = i, d.prototype.dispatchEvent = r, d.prototype.focus = function() {
194
194
  }, d.prototype.toString = function() {
195
- return o(this);
196
- }, d.prototype.getElementsByClassName = function(c) {
197
- var v = c.split(" "), b = [];
198
- return t(this, function(l) {
199
- if (l.nodeType === 1) {
200
- var s = l.className || "", _ = s.split(" ");
201
- v.every(function(y) {
202
- return _.indexOf(y) !== -1;
203
- }) && b.push(l);
195
+ return s(this);
196
+ }, d.prototype.getElementsByClassName = function(l) {
197
+ var m = l.split(" "), b = [];
198
+ return t(this, function(c) {
199
+ if (c.nodeType === 1) {
200
+ var o = c.className || "", p = o.split(" ");
201
+ m.every(function(y) {
202
+ return p.indexOf(y) !== -1;
203
+ }) && b.push(c);
204
204
  }
205
205
  }), b;
206
- }, d.prototype.getElementsByTagName = function(c) {
207
- c = c.toLowerCase();
208
- var v = [];
206
+ }, d.prototype.getElementsByTagName = function(l) {
207
+ l = l.toLowerCase();
208
+ var m = [];
209
209
  return t(this.childNodes, function(b) {
210
- b.nodeType === 1 && (c === "*" || b.tagName.toLowerCase() === c) && v.push(b);
211
- }), v;
212
- }, d.prototype.contains = function(c) {
213
- return t(this, function(v) {
214
- return c === v;
210
+ b.nodeType === 1 && (l === "*" || b.tagName.toLowerCase() === l) && m.push(b);
211
+ }), m;
212
+ }, d.prototype.contains = function(l) {
213
+ return t(this, function(m) {
214
+ return l === m;
215
215
  }) || !1;
216
216
  };
217
217
  }), kt = N(function(a, e) {
@@ -237,33 +237,33 @@ var Qe = Fe(function() {
237
237
  };
238
238
  }), xt = N(function(a, e) {
239
239
  $();
240
- var t = Ge(), r = bt(), i = wt(), n = Ke(), o = kt(), u = Et(), d = Ve(), c = Je(), v = ze();
240
+ var t = We(), r = bt(), i = wt(), n = Ke(), s = kt(), u = Et(), d = Ve(), l = Je(), m = ze();
241
241
  e.exports = b;
242
242
  function b() {
243
243
  if (!Z(this, b)) return new b();
244
244
  this.head = this.createElement("head"), this.body = this.createElement("body"), this.documentElement = this.createElement("html"), this.documentElement.appendChild(this.head), this.documentElement.appendChild(this.body), this.childNodes = [this.documentElement], this.nodeType = 9;
245
245
  }
246
- var l = b.prototype;
247
- l.createTextNode = function(s) {
248
- return new i(s, this);
249
- }, l.createElementNS = function(s, _) {
250
- var y = s === null ? null : String(s);
251
- return new n(_, this, y);
252
- }, l.createElement = function(s) {
253
- return new n(s, this);
254
- }, l.createDocumentFragment = function() {
255
- return new o(this);
256
- }, l.createEvent = function(s) {
257
- return new u(s);
258
- }, l.createComment = function(s) {
259
- return new r(s, this);
260
- }, l.getElementById = function(s) {
261
- s = String(s);
262
- var _ = t(this.childNodes, function(y) {
263
- if (String(y.id) === s) return y;
246
+ var c = b.prototype;
247
+ c.createTextNode = function(o) {
248
+ return new i(o, this);
249
+ }, c.createElementNS = function(o, p) {
250
+ var y = o === null ? null : String(o);
251
+ return new n(p, this, y);
252
+ }, c.createElement = function(o) {
253
+ return new n(o, this);
254
+ }, c.createDocumentFragment = function() {
255
+ return new s(this);
256
+ }, c.createEvent = function(o) {
257
+ return new u(o);
258
+ }, c.createComment = function(o) {
259
+ return new r(o, this);
260
+ }, c.getElementById = function(o) {
261
+ o = String(o);
262
+ var p = t(this.childNodes, function(y) {
263
+ if (String(y.id) === o) return y;
264
264
  });
265
- return _ || null;
266
- }, l.getElementsByClassName = n.prototype.getElementsByClassName, l.getElementsByTagName = n.prototype.getElementsByTagName, l.contains = n.prototype.contains, l.removeEventListener = v, l.addEventListener = c, l.dispatchEvent = d;
265
+ return p || null;
266
+ }, c.getElementsByClassName = n.prototype.getElementsByClassName, c.getElementsByTagName = n.prototype.getElementsByTagName, c.contains = n.prototype.contains, c.removeEventListener = m, c.addEventListener = l, c.dispatchEvent = d;
267
267
  }), Dt = N(function(a, e) {
268
268
  var t = xt();
269
269
  e.exports = new t();
@@ -271,15 +271,15 @@ var Qe = Fe(function() {
271
271
  var t = typeof global < "u" ? global : typeof window < "u" ? window : {}, r = Dt(), i;
272
272
  typeof document < "u" ? i = document : (i = t["__GLOBAL_DOCUMENT_CACHE@4"], i || (i = t["__GLOBAL_DOCUMENT_CACHE@4"] = r)), e.exports = i;
273
273
  });
274
- function qt(a) {
274
+ function Rt(a) {
275
275
  if (Array.isArray(a)) return a;
276
276
  }
277
- function Rt(a, e) {
277
+ function qt(a, e) {
278
278
  var t = a == null ? null : typeof Symbol < "u" && a[Symbol.iterator] || a["@@iterator"];
279
279
  if (t != null) {
280
- var r = [], i = !0, n = !1, o, u;
280
+ var r = [], i = !0, n = !1, s, u;
281
281
  try {
282
- for (t = t.call(a); !(i = (o = t.next()).done) && (r.push(o.value), !(e && r.length === e)); i = !0) ;
282
+ for (t = t.call(a); !(i = (s = t.next()).done) && (r.push(s.value), !(e && r.length === e)); i = !0) ;
283
283
  } catch (d) {
284
284
  n = !0, u = d;
285
285
  } finally {
@@ -292,33 +292,33 @@ function Rt(a, e) {
292
292
  return r;
293
293
  }
294
294
  }
295
- function St() {
295
+ function At() {
296
296
  throw new TypeError(`Invalid attempt to destructure non-iterable instance.
297
297
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
298
298
  }
299
- function De(a, e) {
299
+ function Re(a, e) {
300
300
  (e == null || e > a.length) && (e = a.length);
301
301
  for (var t = 0, r = new Array(e); t < e; t++) r[t] = a[t];
302
302
  return r;
303
303
  }
304
304
  function Xe(a, e) {
305
305
  if (a) {
306
- if (typeof a == "string") return De(a, e);
306
+ if (typeof a == "string") return Re(a, e);
307
307
  var t = Object.prototype.toString.call(a).slice(8, -1);
308
308
  if (t === "Object" && a.constructor && (t = a.constructor.name), t === "Map" || t === "Set") return Array.from(t);
309
- if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)) return De(a, e);
309
+ if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)) return Re(a, e);
310
310
  }
311
311
  }
312
312
  function Q(a, e) {
313
- return qt(a) || Rt(a, e) || Xe(a, e) || St();
313
+ return Rt(a) || qt(a, e) || Xe(a, e) || At();
314
314
  }
315
- var se = C(U()), Le = C(U()), Ot = C(U()), At = { now: function() {
316
- var a = Ot.default.performance, e = a && a.timing, t = e && e.navigationStart, r = typeof t == "number" && typeof a.now == "function" ? t + a.now() : Date.now();
315
+ var oe = j(G()), Ie = j(G()), St = j(G()), Ot = { now: function() {
316
+ var a = St.default.performance, e = a && a.timing, t = e && e.navigationStart, r = typeof t == "number" && typeof a.now == "function" ? t + a.now() : Date.now();
317
317
  return Math.round(r);
318
- } }, P = At, de = function() {
318
+ } }, I = Ot, de = function() {
319
319
  var a, e, t;
320
- if (typeof ((a = Le.default.crypto) === null || a === void 0 ? void 0 : a.getRandomValues) == "function") {
321
- t = new Uint8Array(32), Le.default.crypto.getRandomValues(t);
320
+ if (typeof ((a = Ie.default.crypto) === null || a === void 0 ? void 0 : a.getRandomValues) == "function") {
321
+ t = new Uint8Array(32), Ie.default.crypto.getRandomValues(t);
322
322
  for (var r = 0; r < 32; r++) t[r] = t[r] % 16;
323
323
  } else {
324
324
  t = [];
@@ -326,10 +326,10 @@ var se = C(U()), Le = C(U()), Ot = C(U()), At = { now: function() {
326
326
  }
327
327
  var n = 0;
328
328
  e = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(d) {
329
- var c = d === "x" ? t[n] : t[n] & 3 | 8;
330
- return n++, c.toString(16);
329
+ var l = d === "x" ? t[n] : t[n] & 3 | 8;
330
+ return n++, l.toString(16);
331
331
  });
332
- var o = P.now(), u = o?.toString(16).substring(3);
332
+ var s = I.now(), u = s?.toString(16).substring(3);
333
333
  return u ? e.substring(0, 28) + u : e;
334
334
  }, Ze = function() {
335
335
  return ("000000" + (Math.random() * Math.pow(36, 6) << 0).toString(36)).slice(-6);
@@ -341,14 +341,14 @@ var se = C(U()), Le = C(U()), Ot = C(U()), At = { now: function() {
341
341
  } catch {
342
342
  }
343
343
  return e && !e.muxId && (e.muxId = a), e?.muxId || a;
344
- }, he = function(a) {
344
+ }, _e = function(a) {
345
345
  var e;
346
346
  a && typeof a.nodeName < "u" ? (e = a, a = H(e)) : e = document.querySelector(a);
347
347
  var t = e && e.nodeName ? e.nodeName.toLowerCase() : "";
348
348
  return [e, a, t];
349
349
  };
350
350
  function Pt(a) {
351
- if (Array.isArray(a)) return De(a);
351
+ if (Array.isArray(a)) return Re(a);
352
352
  }
353
353
  function Lt(a) {
354
354
  if (typeof Symbol < "u" && a[Symbol.iterator] != null || a["@@iterator"] != null) return Array.from(a);
@@ -357,32 +357,32 @@ function It() {
357
357
  throw new TypeError(`Invalid attempt to spread non-iterable instance.
358
358
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
359
359
  }
360
- function M(a) {
360
+ function B(a) {
361
361
  return Pt(a) || Lt(a) || Xe(a) || It();
362
362
  }
363
363
  var Y = { TRACE: 0, DEBUG: 1, INFO: 2, WARN: 3, ERROR: 4 }, Nt = function(a) {
364
- var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 3, t, r, i, n, o, u = [console, a], d = (t = console.trace).bind.apply(t, M(u)), c = (r = console.info).bind.apply(r, M(u)), v = (i = console.debug).bind.apply(i, M(u)), b = (n = console.warn).bind.apply(n, M(u)), l = (o = console.error).bind.apply(o, M(u)), s = e;
364
+ var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 3, t, r, i, n, s, u = [console, a], d = (t = console.trace).bind.apply(t, B(u)), l = (r = console.info).bind.apply(r, B(u)), m = (i = console.debug).bind.apply(i, B(u)), b = (n = console.warn).bind.apply(n, B(u)), c = (s = console.error).bind.apply(s, B(u)), o = e;
365
365
  return { trace: function() {
366
- for (var _ = arguments.length, y = new Array(_), f = 0; f < _; f++) y[f] = arguments[f];
367
- if (!(s > Y.TRACE)) return d.apply(void 0, M(y));
366
+ for (var p = arguments.length, y = new Array(p), f = 0; f < p; f++) y[f] = arguments[f];
367
+ if (!(o > Y.TRACE)) return d.apply(void 0, B(y));
368
368
  }, debug: function() {
369
- for (var _ = arguments.length, y = new Array(_), f = 0; f < _; f++) y[f] = arguments[f];
370
- if (!(s > Y.DEBUG)) return v.apply(void 0, M(y));
369
+ for (var p = arguments.length, y = new Array(p), f = 0; f < p; f++) y[f] = arguments[f];
370
+ if (!(o > Y.DEBUG)) return m.apply(void 0, B(y));
371
371
  }, info: function() {
372
- for (var _ = arguments.length, y = new Array(_), f = 0; f < _; f++) y[f] = arguments[f];
373
- if (!(s > Y.INFO)) return c.apply(void 0, M(y));
372
+ for (var p = arguments.length, y = new Array(p), f = 0; f < p; f++) y[f] = arguments[f];
373
+ if (!(o > Y.INFO)) return l.apply(void 0, B(y));
374
374
  }, warn: function() {
375
- for (var _ = arguments.length, y = new Array(_), f = 0; f < _; f++) y[f] = arguments[f];
376
- if (!(s > Y.WARN)) return b.apply(void 0, M(y));
375
+ for (var p = arguments.length, y = new Array(p), f = 0; f < p; f++) y[f] = arguments[f];
376
+ if (!(o > Y.WARN)) return b.apply(void 0, B(y));
377
377
  }, error: function() {
378
- for (var _ = arguments.length, y = new Array(_), f = 0; f < _; f++) y[f] = arguments[f];
379
- if (!(s > Y.ERROR)) return l.apply(void 0, M(y));
378
+ for (var p = arguments.length, y = new Array(p), f = 0; f < p; f++) y[f] = arguments[f];
379
+ if (!(o > Y.ERROR)) return c.apply(void 0, B(y));
380
380
  }, get level() {
381
- return s;
382
- }, set level(_) {
383
- _ !== this.level && (s = _ ?? e);
381
+ return o;
382
+ }, set level(p) {
383
+ p !== this.level && (o = p ?? e);
384
384
  } };
385
- }, q = Nt("[mux]"), we = C(U());
385
+ }, q = Nt("[mux]"), we = j(G());
386
386
  function qe() {
387
387
  var a = we.default.doNotTrack || we.default.navigator && we.default.navigator.doNotTrack;
388
388
  return a === "1";
@@ -392,7 +392,7 @@ function T(a) {
392
392
  return a;
393
393
  }
394
394
  $();
395
- function I(a, e) {
395
+ function P(a, e) {
396
396
  if (!Z(a, e)) throw new TypeError("Cannot call a class as a function");
397
397
  }
398
398
  function Ct(a, e) {
@@ -401,10 +401,10 @@ function Ct(a, e) {
401
401
  r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(a, r.key, r);
402
402
  }
403
403
  }
404
- function W(a, e, t) {
404
+ function U(a, e, t) {
405
405
  return e && Ct(a.prototype, e), a;
406
406
  }
407
- function m(a, e, t) {
407
+ function v(a, e, t) {
408
408
  return e in a ? Object.defineProperty(a, e, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : a[e] = t, a;
409
409
  }
410
410
  function te(a) {
@@ -416,33 +416,33 @@ function jt(a, e) {
416
416
  for (; !Object.prototype.hasOwnProperty.call(a, e) && (a = te(a), a !== null); ) ;
417
417
  return a;
418
418
  }
419
- function _e(a, e, t) {
420
- return typeof Reflect < "u" && Reflect.get ? _e = Reflect.get : _e = function(r, i, n) {
421
- var o = jt(r, i);
422
- if (o) {
423
- var u = Object.getOwnPropertyDescriptor(o, i);
419
+ function pe(a, e, t) {
420
+ return typeof Reflect < "u" && Reflect.get ? pe = Reflect.get : pe = function(r, i, n) {
421
+ var s = jt(r, i);
422
+ if (s) {
423
+ var u = Object.getOwnPropertyDescriptor(s, i);
424
424
  return u.get ? u.get.call(n || r) : u.value;
425
425
  }
426
- }, _e(a, e, t || a);
426
+ }, pe(a, e, t || a);
427
427
  }
428
- function Re(a, e) {
429
- return Re = Object.setPrototypeOf || function(t, r) {
428
+ function Ae(a, e) {
429
+ return Ae = Object.setPrototypeOf || function(t, r) {
430
430
  return t.__proto__ = r, t;
431
- }, Re(a, e);
431
+ }, Ae(a, e);
432
432
  }
433
433
  function Ht(a, e) {
434
434
  if (typeof e != "function" && e !== null) throw new TypeError("Super expression must either be null or a function");
435
- a.prototype = Object.create(e && e.prototype, { constructor: { value: a, writable: !0, configurable: !0 } }), e && Re(a, e);
435
+ a.prototype = Object.create(e && e.prototype, { constructor: { value: a, writable: !0, configurable: !0 } }), e && Ae(a, e);
436
436
  }
437
- function Mt(a, e) {
437
+ function Bt(a, e) {
438
438
  if (a == null) return {};
439
439
  var t = {}, r = Object.keys(a), i, n;
440
440
  for (n = 0; n < r.length; n++) i = r[n], !(e.indexOf(i) >= 0) && (t[i] = a[i]);
441
441
  return t;
442
442
  }
443
- function Bt(a, e) {
443
+ function Mt(a, e) {
444
444
  if (a == null) return {};
445
- var t = Mt(a, e), r, i;
445
+ var t = Bt(a, e), r, i;
446
446
  if (Object.getOwnPropertySymbols) {
447
447
  var n = Object.getOwnPropertySymbols(a);
448
448
  for (i = 0; i < n.length; i++) r = n[i], !(e.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(a, r) && (t[r] = a[r]);
@@ -461,9 +461,9 @@ function Ut() {
461
461
  }
462
462
  Qe();
463
463
  function Ft(a, e) {
464
- return e && (We(e) === "object" || typeof e == "function") ? e : T(a);
464
+ return e && (Ge(e) === "object" || typeof e == "function") ? e : T(a);
465
465
  }
466
- function Wt(a) {
466
+ function Gt(a) {
467
467
  var e = Ut();
468
468
  return function() {
469
469
  var t = te(a), r;
@@ -474,13 +474,13 @@ function Wt(a) {
474
474
  return Ft(this, r);
475
475
  };
476
476
  }
477
- var B = function(a) {
477
+ var M = function(a) {
478
478
  return le(a)[0];
479
479
  }, le = function(a) {
480
480
  if (typeof a != "string" || a === "") return ["localhost"];
481
481
  var e = /^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/, t = a.match(e) || [], r = t[4], i;
482
482
  return r && (i = (r.match(/[^\.]+\.[^\.]+$/) || [])[0]), [r, i];
483
- }, Te = C(U()), Qt = { exists: function() {
483
+ }, Te = j(G()), Qt = { exists: function() {
484
484
  var a = Te.default.performance, e = a && a.timing;
485
485
  return e !== void 0;
486
486
  }, domContentLoadedEventEnd: function() {
@@ -489,8 +489,8 @@ var B = function(a) {
489
489
  }, navigationStart: function() {
490
490
  var a = Te.default.performance, e = a && a.timing;
491
491
  return e && e.navigationStart;
492
- } }, pe = Qt;
493
- function A(a, e, t) {
492
+ } }, he = Qt;
493
+ function L(a, e, t) {
494
494
  t = t === void 0 ? 1 : t, a[e] = a[e] || 0, a[e] += t;
495
495
  }
496
496
  function fe(a) {
@@ -499,12 +499,12 @@ function fe(a) {
499
499
  typeof Object.getOwnPropertySymbols == "function" && (r = r.concat(Object.getOwnPropertySymbols(t).filter(function(i) {
500
500
  return Object.getOwnPropertyDescriptor(t, i).enumerable;
501
501
  }))), r.forEach(function(i) {
502
- m(a, i, t[i]);
502
+ v(a, i, t[i]);
503
503
  });
504
504
  }
505
505
  return a;
506
506
  }
507
- function Gt(a, e) {
507
+ function Wt(a, e) {
508
508
  var t = Object.keys(a);
509
509
  if (Object.getOwnPropertySymbols) {
510
510
  var r = Object.getOwnPropertySymbols(a);
@@ -513,12 +513,12 @@ function Gt(a, e) {
513
513
  return t;
514
514
  }
515
515
  function Oe(a, e) {
516
- return e = e ?? {}, Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(e)) : Gt(Object(e)).forEach(function(t) {
516
+ return e = e ?? {}, Object.getOwnPropertyDescriptors ? Object.defineProperties(a, Object.getOwnPropertyDescriptors(e)) : Wt(Object(e)).forEach(function(t) {
517
517
  Object.defineProperty(a, t, Object.getOwnPropertyDescriptor(e, t));
518
518
  }), a;
519
519
  }
520
520
  var Vt = ["x-cdn", "content-type"], $e = ["x-request-id", "cf-ray", "x-amz-cf-id", "x-akamai-request-id"], Jt = Vt.concat($e);
521
- function Ae(a) {
521
+ function Pe(a) {
522
522
  a = a || "";
523
523
  var e = {}, t = a.trim().split(/[\r\n]+/);
524
524
  return t.forEach(function(r) {
@@ -548,58 +548,58 @@ var zt = function(a) {
548
548
  return e;
549
549
  }, et = zt, ce = function(a) {
550
550
  if (!a) return {};
551
- var e = pe.navigationStart(), t = a.loading, r = t ? t.start : a.trequest, i = t ? t.first : a.tfirst, n = t ? t.end : a.tload;
551
+ var e = he.navigationStart(), t = a.loading, r = t ? t.start : a.trequest, i = t ? t.first : a.tfirst, n = t ? t.end : a.tload;
552
552
  return { bytesLoaded: a.total, requestStart: Math.round(e + r), responseStart: Math.round(e + i), responseEnd: Math.round(e + n) };
553
553
  }, ne = function(a) {
554
- if (!(!a || typeof a.getAllResponseHeaders != "function")) return Ae(a.getAllResponseHeaders());
554
+ if (!(!a || typeof a.getAllResponseHeaders != "function")) return Pe(a.getAllResponseHeaders());
555
555
  }, Kt = function(a, e, t) {
556
- var r = arguments.length > 4 ? arguments[4] : void 0, i = a.log, n = a.utils.secondsToMs, o = function(f) {
557
- var g = parseInt(r.version), p;
558
- return g === 1 && f.programDateTime !== null && (p = f.programDateTime), g === 0 && f.pdt !== null && (p = f.pdt), p;
556
+ var r = arguments.length > 4 ? arguments[4] : void 0, i = a.log, n = a.utils.secondsToMs, s = function(f) {
557
+ var g = parseInt(r.version), _;
558
+ return g === 1 && f.programDateTime !== null && (_ = f.programDateTime), g === 0 && f.pdt !== null && (_ = f.pdt), _;
559
559
  };
560
- if (!pe.exists()) {
560
+ if (!he.exists()) {
561
561
  i.warn("performance timing not supported. Not tracking HLS.js.");
562
562
  return;
563
563
  }
564
564
  var u = function(f, g) {
565
565
  return a.emit(e, f, g);
566
566
  }, d = function(f, g) {
567
- var p = g.levels, h = g.audioTracks, w = g.url, k = g.stats, E = g.networkDetails, D = g.sessionData, S = {}, L = {};
568
- p.forEach(function(j, z) {
569
- S[z] = { width: j.width, height: j.height, bitrate: j.bitrate, attrs: j.attrs };
570
- }), h.forEach(function(j, z) {
571
- L[z] = { name: j.name, language: j.lang, bitrate: j.bitrate };
567
+ var _ = g.levels, h = g.audioTracks, w = g.url, k = g.stats, E = g.networkDetails, R = g.sessionData, A = {}, S = {};
568
+ _.forEach(function(C, z) {
569
+ A[z] = { width: C.width, height: C.height, bitrate: C.bitrate, attrs: C.attrs };
570
+ }), h.forEach(function(C, z) {
571
+ S[z] = { name: C.name, language: C.lang, bitrate: C.bitrate };
572
572
  });
573
- var R = ce(k), x = R.bytesLoaded, V = R.requestStart, ae = R.responseStart, re = R.responseEnd;
574
- u("requestcompleted", Oe(fe({}, et(D)), { request_event_type: f, request_bytes_loaded: x, request_start: V, request_response_start: ae, request_response_end: re, request_type: "manifest", request_hostname: B(w), request_response_headers: ne(E), request_rendition_lists: { media: S, audio: L, video: {} } }));
573
+ var D = ce(k), x = D.bytesLoaded, V = D.requestStart, ae = D.responseStart, ie = D.responseEnd;
574
+ u("requestcompleted", Oe(fe({}, et(R)), { request_event_type: f, request_bytes_loaded: x, request_start: V, request_response_start: ae, request_response_end: ie, request_type: "manifest", request_hostname: M(w), request_response_headers: ne(E), request_rendition_lists: { media: A, audio: S, video: {} } }));
575
575
  };
576
576
  t.on(r.Events.MANIFEST_LOADED, d);
577
- var c = function(f, g) {
578
- var p = g.details, h = g.level, w = g.networkDetails, k = g.stats, E = ce(k), D = E.bytesLoaded, S = E.requestStart, L = E.responseStart, R = E.responseEnd, x = p.fragments[p.fragments.length - 1], V = o(x) + n(x.duration);
579
- u("requestcompleted", { request_event_type: f, request_bytes_loaded: D, request_start: S, request_response_start: L, request_response_end: R, request_current_level: h, request_type: "manifest", request_hostname: B(p.url), request_response_headers: ne(w), video_holdback: p.holdBack && n(p.holdBack), video_part_holdback: p.partHoldBack && n(p.partHoldBack), video_part_target_duration: p.partTarget && n(p.partTarget), video_target_duration: p.targetduration && n(p.targetduration), video_source_is_live: p.live, player_manifest_newest_program_time: isNaN(V) ? void 0 : V });
577
+ var l = function(f, g) {
578
+ var _ = g.details, h = g.level, w = g.networkDetails, k = g.stats, E = ce(k), R = E.bytesLoaded, A = E.requestStart, S = E.responseStart, D = E.responseEnd, x = _.fragments[_.fragments.length - 1], V = s(x) + n(x.duration);
579
+ u("requestcompleted", { request_event_type: f, request_bytes_loaded: R, request_start: A, request_response_start: S, request_response_end: D, request_current_level: h, request_type: "manifest", request_hostname: M(_.url), request_response_headers: ne(w), video_holdback: _.holdBack && n(_.holdBack), video_part_holdback: _.partHoldBack && n(_.partHoldBack), video_part_target_duration: _.partTarget && n(_.partTarget), video_target_duration: _.targetduration && n(_.targetduration), video_source_is_live: _.live, player_manifest_newest_program_time: isNaN(V) ? void 0 : V });
580
580
  };
581
- t.on(r.Events.LEVEL_LOADED, c);
582
- var v = function(f, g) {
583
- var p = g.details, h = g.networkDetails, w = g.stats, k = ce(w), E = k.bytesLoaded, D = k.requestStart, S = k.responseStart, L = k.responseEnd;
584
- u("requestcompleted", { request_event_type: f, request_bytes_loaded: E, request_start: D, request_response_start: S, request_response_end: L, request_type: "manifest", request_hostname: B(p.url), request_response_headers: ne(h) });
581
+ t.on(r.Events.LEVEL_LOADED, l);
582
+ var m = function(f, g) {
583
+ var _ = g.details, h = g.networkDetails, w = g.stats, k = ce(w), E = k.bytesLoaded, R = k.requestStart, A = k.responseStart, S = k.responseEnd;
584
+ u("requestcompleted", { request_event_type: f, request_bytes_loaded: E, request_start: R, request_response_start: A, request_response_end: S, request_type: "manifest", request_hostname: M(_.url), request_response_headers: ne(h) });
585
585
  };
586
- t.on(r.Events.AUDIO_TRACK_LOADED, v);
586
+ t.on(r.Events.AUDIO_TRACK_LOADED, m);
587
587
  var b = function(f, g) {
588
- var p = g.stats, h = g.networkDetails, w = g.frag;
589
- p = p || w.stats;
590
- var k = ce(p), E = k.bytesLoaded, D = k.requestStart, S = k.responseStart, L = k.responseEnd, R = h ? ne(h) : void 0, x = { request_event_type: f, request_bytes_loaded: E, request_start: D, request_response_start: S, request_response_end: L, request_hostname: h ? B(h.responseURL) : void 0, request_id: R ? ve(R) : void 0, request_response_headers: R, request_media_duration: w.duration, request_url: h?.responseURL };
588
+ var _ = g.stats, h = g.networkDetails, w = g.frag;
589
+ _ = _ || w.stats;
590
+ var k = ce(_), E = k.bytesLoaded, R = k.requestStart, A = k.responseStart, S = k.responseEnd, D = h ? ne(h) : void 0, x = { request_event_type: f, request_bytes_loaded: E, request_start: R, request_response_start: A, request_response_end: S, request_hostname: h ? M(h.responseURL) : void 0, request_id: D ? ve(D) : void 0, request_response_headers: D, request_media_duration: w.duration, request_url: h?.responseURL };
591
591
  w.type === "main" ? (x.request_type = "media", x.request_current_level = w.level, x.request_video_width = (t.levels[w.level] || {}).width, x.request_video_height = (t.levels[w.level] || {}).height, x.request_labeled_bitrate = (t.levels[w.level] || {}).bitrate) : x.request_type = w.type, u("requestcompleted", x);
592
592
  };
593
593
  t.on(r.Events.FRAG_LOADED, b);
594
- var l = function(f, g) {
595
- var p = g.frag, h = p.start, w = o(p), k = { currentFragmentPDT: w, currentFragmentStart: n(h) };
594
+ var c = function(f, g) {
595
+ var _ = g.frag, h = _.start, w = s(_), k = { currentFragmentPDT: w, currentFragmentStart: n(h) };
596
596
  u("fragmentchange", k);
597
597
  };
598
- t.on(r.Events.FRAG_CHANGED, l);
599
- var s = function(f, g) {
600
- var p = g.type, h = g.details, w = g.response, k = g.fatal, E = g.frag, D = g.networkDetails, S = E?.url || g.url || "", L = D ? ne(D) : void 0;
601
- if ((h === r.ErrorDetails.MANIFEST_LOAD_ERROR || h === r.ErrorDetails.MANIFEST_LOAD_TIMEOUT || h === r.ErrorDetails.FRAG_LOAD_ERROR || h === r.ErrorDetails.FRAG_LOAD_TIMEOUT || h === r.ErrorDetails.LEVEL_LOAD_ERROR || h === r.ErrorDetails.LEVEL_LOAD_TIMEOUT || h === r.ErrorDetails.AUDIO_TRACK_LOAD_ERROR || h === r.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT || h === r.ErrorDetails.SUBTITLE_LOAD_ERROR || h === r.ErrorDetails.SUBTITLE_LOAD_TIMEOUT || h === r.ErrorDetails.KEY_LOAD_ERROR || h === r.ErrorDetails.KEY_LOAD_TIMEOUT) && u("requestfailed", { request_error: h, request_url: S, request_hostname: B(S), request_id: L ? ve(L) : void 0, request_type: h === r.ErrorDetails.FRAG_LOAD_ERROR || h === r.ErrorDetails.FRAG_LOAD_TIMEOUT ? "media" : h === r.ErrorDetails.AUDIO_TRACK_LOAD_ERROR || h === r.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT ? "audio" : h === r.ErrorDetails.SUBTITLE_LOAD_ERROR || h === r.ErrorDetails.SUBTITLE_LOAD_TIMEOUT ? "subtitle" : h === r.ErrorDetails.KEY_LOAD_ERROR || h === r.ErrorDetails.KEY_LOAD_TIMEOUT ? "encryption" : "manifest", request_error_code: w?.code, request_error_text: w?.text }), k) {
602
- var R, x = "".concat(S ? "url: ".concat(S, `
598
+ t.on(r.Events.FRAG_CHANGED, c);
599
+ var o = function(f, g) {
600
+ var _ = g.type, h = g.details, w = g.response, k = g.fatal, E = g.frag, R = g.networkDetails, A = E?.url || g.url || "", S = R ? ne(R) : void 0;
601
+ if ((h === r.ErrorDetails.MANIFEST_LOAD_ERROR || h === r.ErrorDetails.MANIFEST_LOAD_TIMEOUT || h === r.ErrorDetails.FRAG_LOAD_ERROR || h === r.ErrorDetails.FRAG_LOAD_TIMEOUT || h === r.ErrorDetails.LEVEL_LOAD_ERROR || h === r.ErrorDetails.LEVEL_LOAD_TIMEOUT || h === r.ErrorDetails.AUDIO_TRACK_LOAD_ERROR || h === r.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT || h === r.ErrorDetails.SUBTITLE_LOAD_ERROR || h === r.ErrorDetails.SUBTITLE_LOAD_TIMEOUT || h === r.ErrorDetails.KEY_LOAD_ERROR || h === r.ErrorDetails.KEY_LOAD_TIMEOUT) && u("requestfailed", { request_error: h, request_url: A, request_hostname: M(A), request_id: S ? ve(S) : void 0, request_type: h === r.ErrorDetails.FRAG_LOAD_ERROR || h === r.ErrorDetails.FRAG_LOAD_TIMEOUT ? "media" : h === r.ErrorDetails.AUDIO_TRACK_LOAD_ERROR || h === r.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT ? "audio" : h === r.ErrorDetails.SUBTITLE_LOAD_ERROR || h === r.ErrorDetails.SUBTITLE_LOAD_TIMEOUT ? "subtitle" : h === r.ErrorDetails.KEY_LOAD_ERROR || h === r.ErrorDetails.KEY_LOAD_TIMEOUT ? "encryption" : "manifest", request_error_code: w?.code, request_error_text: w?.text }), k) {
602
+ var D, x = "".concat(A ? "url: ".concat(A, `
603
603
  `) : "") + "".concat(w && (w.code || w.text) ? "response: ".concat(w.code, ", ").concat(w.text, `
604
604
  `) : "") + "".concat(g.reason ? "failure reason: ".concat(g.reason, `
605
605
  `) : "") + "".concat(g.level ? "level: ".concat(g.level, `
@@ -607,38 +607,42 @@ var zt = function(a) {
607
607
  `) : "") + "".concat(g.buffer ? "buffer length: ".concat(g.buffer, `
608
608
  `) : "") + "".concat(g.error ? "error: ".concat(g.error, `
609
609
  `) : "") + "".concat(g.event ? "event: ".concat(g.event, `
610
- `) : "") + "".concat(g.err ? "error message: ".concat((R = g.err) === null || R === void 0 ? void 0 : R.message, `
610
+ `) : "") + "".concat(g.err ? "error message: ".concat((D = g.err) === null || D === void 0 ? void 0 : D.message, `
611
611
  `) : "");
612
- u("error", { player_error_code: p, player_error_message: h, player_error_context: x });
612
+ u("error", { player_error_code: _, player_error_message: h, player_error_context: x });
613
613
  }
614
614
  };
615
- t.on(r.Events.ERROR, s);
616
- var _ = function(f, g) {
617
- var p = g.frag, h = p && p._url || "";
618
- u("requestcanceled", { request_event_type: f, request_url: h, request_type: "media", request_hostname: B(h) });
615
+ t.on(r.Events.ERROR, o);
616
+ var p = function(f, g) {
617
+ var _ = g.frag, h = _ && _._url || "";
618
+ u("requestcanceled", { request_event_type: f, request_url: h, request_type: "media", request_hostname: M(h) });
619
619
  };
620
- t.on(r.Events.FRAG_LOAD_EMERGENCY_ABORTED, _);
620
+ t.on(r.Events.FRAG_LOAD_EMERGENCY_ABORTED, p);
621
621
  var y = function(f, g) {
622
- var p = g.level, h = t.levels[p];
622
+ var _ = g.level, h = t.levels[_];
623
623
  if (h && h.attrs && h.attrs.BANDWIDTH) {
624
624
  var w = h.attrs.BANDWIDTH, k, E = parseFloat(h.attrs["FRAME-RATE"]);
625
625
  isNaN(E) || (k = E), w ? u("renditionchange", { video_source_fps: k, video_source_bitrate: w, video_source_width: h.width, video_source_height: h.height, video_source_rendition_name: h.name, video_source_codec: h?.videoCodec }) : i.warn("missing BANDWIDTH from HLS manifest parsed by HLS.js");
626
626
  }
627
627
  };
628
628
  t.on(r.Events.LEVEL_SWITCHED, y), t._stopMuxMonitor = function() {
629
- t.off(r.Events.MANIFEST_LOADED, d), t.off(r.Events.LEVEL_LOADED, c), t.off(r.Events.AUDIO_TRACK_LOADED, v), t.off(r.Events.FRAG_LOADED, b), t.off(r.Events.FRAG_CHANGED, l), t.off(r.Events.ERROR, s), t.off(r.Events.FRAG_LOAD_EMERGENCY_ABORTED, _), t.off(r.Events.LEVEL_SWITCHED, y), t.off(r.Events.DESTROYING, t._stopMuxMonitor), delete t._stopMuxMonitor;
629
+ t.off(r.Events.MANIFEST_LOADED, d), t.off(r.Events.LEVEL_LOADED, l), t.off(r.Events.AUDIO_TRACK_LOADED, m), t.off(r.Events.FRAG_LOADED, b), t.off(r.Events.FRAG_CHANGED, c), t.off(r.Events.ERROR, o), t.off(r.Events.FRAG_LOAD_EMERGENCY_ABORTED, p), t.off(r.Events.LEVEL_SWITCHED, y), t.off(r.Events.DESTROYING, t._stopMuxMonitor), delete t._stopMuxMonitor;
630
630
  }, t.on(r.Events.DESTROYING, t._stopMuxMonitor);
631
631
  }, Yt = function(a) {
632
632
  a && typeof a._stopMuxMonitor == "function" && a._stopMuxMonitor();
633
- }, Ie = function(a, e) {
633
+ }, Ne = function(a, e) {
634
634
  if (!a || !a.requestEndDate) return {};
635
- var t = B(a.url), r = a.url, i = a.bytesLoaded, n = new Date(a.requestStartDate).getTime(), o = new Date(a.firstByteDate).getTime(), u = new Date(a.requestEndDate).getTime(), d = isNaN(a.duration) ? 0 : a.duration, c = typeof e.getMetricsFor == "function" ? e.getMetricsFor(a.mediaType).HttpList : e.getDashMetrics().getHttpRequests(a.mediaType), v;
636
- c.length > 0 && (v = Ae(c[c.length - 1]._responseHeaders || ""));
637
- var b = v ? ve(v) : void 0;
638
- return { requestStart: n, requestResponseStart: o, requestResponseEnd: u, requestBytesLoaded: i, requestResponseHeaders: v, requestMediaDuration: d, requestHostname: t, requestUrl: r, requestId: b };
635
+ var t = M(a.url), r = a.url, i = a.bytesLoaded, n = new Date(a.requestStartDate).getTime(), s = new Date(a.firstByteDate).getTime(), u = new Date(a.requestEndDate).getTime(), d = isNaN(a.duration) ? 0 : a.duration, l = typeof e.getMetricsFor == "function" ? e.getMetricsFor(a.mediaType).HttpList : e.getDashMetrics().getHttpRequests(a.mediaType), m;
636
+ l.length > 0 && (m = Pe(l[l.length - 1]._responseHeaders || ""));
637
+ var b = m ? ve(m) : void 0;
638
+ return { requestStart: n, requestResponseStart: s, requestResponseEnd: u, requestBytesLoaded: i, requestResponseHeaders: m, requestMediaDuration: d, requestHostname: t, requestUrl: r, requestId: b };
639
639
  }, Xt = function(a, e) {
640
- var t = e.getQualityFor(a), r = e.getCurrentTrackFor(a).bitrateList;
641
- return r ? { currentLevel: t, renditionWidth: r[t].width || null, renditionHeight: r[t].height || null, renditionBitrate: r[t].bandwidth } : {};
640
+ if (typeof e.getCurrentRepresentationForType == "function") {
641
+ var t = e.getCurrentRepresentationForType(a);
642
+ return t ? { currentLevel: t.absoluteIndex, renditionWidth: t.width || null, renditionHeight: t.height || null, renditionBitrate: t.bandwidth } : {};
643
+ }
644
+ var r = e.getQualityFor(a), i = e.getCurrentTrackFor(a).bitrateList;
645
+ return i ? { currentLevel: r, renditionWidth: i[r].width || null, renditionHeight: i[r].height || null, renditionBitrate: i[r].bandwidth } : {};
642
646
  }, Zt = function(a) {
643
647
  var e;
644
648
  return (e = a.match(/.*codecs\*?="(.*)"/)) === null || e === void 0 ? void 0 : e[1];
@@ -657,93 +661,106 @@ var zt = function(a) {
657
661
  r.warn("Invalid dash.js player reference. Monitoring blocked.");
658
662
  return;
659
663
  }
660
- var i = $t(t), n = function(p, h) {
661
- return a.emit(e, p, h);
662
- }, o = function(p) {
663
- var h = p.type, w = p.data, k = (w || {}).url;
664
- n("requestcompleted", { request_event_type: h, request_start: 0, request_response_start: 0, request_response_end: 0, request_bytes_loaded: -1, request_type: "manifest", request_hostname: B(k), request_url: k });
664
+ var i = $t(t), n = function(_, h) {
665
+ return a.emit(e, _, h);
666
+ }, s = function(_) {
667
+ var h = _.type, w = _.data, k = (w || {}).url;
668
+ n("requestcompleted", { request_event_type: h, request_start: 0, request_response_start: 0, request_response_end: 0, request_bytes_loaded: -1, request_type: "manifest", request_hostname: M(k), request_url: k });
665
669
  };
666
- t.on("manifestLoaded", o);
667
- var u = {}, d = function(p) {
668
- if (typeof p.getRequests != "function") return null;
669
- var h = p.getRequests({ state: "executed" });
670
+ t.on("manifestLoaded", s);
671
+ var u = {}, d = function(_) {
672
+ if (typeof _.getRequests != "function") return null;
673
+ var h = _.getRequests({ state: "executed" });
670
674
  return h.length === 0 ? null : h[h.length - 1];
671
- }, c = function(p) {
672
- var h = p.type, w = p.fragmentModel, k = p.chunk, E = d(w);
673
- v({ type: h, request: E, chunk: k });
674
- }, v = function(p) {
675
- var h = p.type, w = p.chunk, k = p.request, E = (w || {}).mediaInfo, D = E || {}, S = D.type, L = D.bitrateList;
676
- L = L || [];
677
- var R = {};
678
- L.forEach(function(ie, F) {
679
- R[F] = {}, R[F].width = ie.width, R[F].height = ie.height, R[F].bitrate = ie.bandwidth, R[F].attrs = {};
680
- }), S === "video" ? u.video = R : S === "audio" ? u.audio = R : u.media = R;
681
- var x = Ie(k, t), V = x.requestStart, ae = x.requestResponseStart, re = x.requestResponseEnd, j = x.requestResponseHeaders, z = x.requestMediaDuration, ye = x.requestHostname, ge = x.requestUrl, be = x.requestId;
682
- n("requestcompleted", { request_event_type: h, request_start: V, request_response_start: ae, request_response_end: re, request_bytes_loaded: -1, request_type: S + "_init", request_response_headers: j, request_hostname: ye, request_id: be, request_url: ge, request_media_duration: z, request_rendition_lists: u });
675
+ }, l = function(_) {
676
+ var h = _.type, w = _.fragmentModel, k = _.chunk, E = d(w);
677
+ m({ type: h, request: E, chunk: k });
678
+ }, m = function(_) {
679
+ var h = _.type, w = _.chunk, k = _.request, E = (w || {}).mediaInfo, R = E || {}, A = R.type, S = R.bitrateList;
680
+ S = S || [];
681
+ var D = {};
682
+ S.forEach(function(re, F) {
683
+ D[F] = {}, D[F].width = re.width, D[F].height = re.height, D[F].bitrate = re.bandwidth, D[F].attrs = {};
684
+ }), A === "video" ? u.video = D : A === "audio" ? u.audio = D : u.media = D;
685
+ var x = Ne(k, t), V = x.requestStart, ae = x.requestResponseStart, ie = x.requestResponseEnd, C = x.requestResponseHeaders, z = x.requestMediaDuration, ye = x.requestHostname, ge = x.requestUrl, be = x.requestId;
686
+ n("requestcompleted", { request_event_type: h, request_start: V, request_response_start: ae, request_response_end: ie, request_bytes_loaded: -1, request_type: A + "_init", request_response_headers: C, request_hostname: ye, request_id: be, request_url: ge, request_media_duration: z, request_rendition_lists: u });
683
687
  };
684
- i >= 4 ? t.on("initFragmentLoaded", v) : t.on("initFragmentLoaded", c);
685
- var b = function(p) {
686
- var h = p.type, w = p.fragmentModel, k = p.chunk, E = d(w);
687
- l({ type: h, request: E, chunk: k });
688
- }, l = function(p) {
689
- var h = p.type, w = p.chunk, k = p.request, E = w || {}, D = E.mediaInfo, S = E.start, L = D || {}, R = L.type, x = Ie(k, t), V = x.requestStart, ae = x.requestResponseStart, re = x.requestResponseEnd, j = x.requestBytesLoaded, z = x.requestResponseHeaders, ye = x.requestMediaDuration, ge = x.requestHostname, be = x.requestUrl, ie = x.requestId, F = Xt(R, t), lt = F.currentLevel, ct = F.renditionWidth, _t = F.renditionHeight, ht = F.renditionBitrate;
690
- n("requestcompleted", { request_event_type: h, request_start: V, request_response_start: ae, request_response_end: re, request_bytes_loaded: j, request_type: R, request_response_headers: z, request_hostname: ge, request_id: ie, request_url: be, request_media_start_time: S, request_media_duration: ye, request_current_level: lt, request_labeled_bitrate: ht, request_video_width: ct, request_video_height: _t });
688
+ i >= 4 ? t.on("initFragmentLoaded", m) : t.on("initFragmentLoaded", l);
689
+ var b = function(_) {
690
+ var h = _.type, w = _.fragmentModel, k = _.chunk, E = d(w);
691
+ c({ type: h, request: E, chunk: k });
692
+ }, c = function(_) {
693
+ var h = _.type, w = _.chunk, k = _.request, E = w || {}, R = E.mediaInfo, A = E.start, S = R || {}, D = S.type, x = Ne(k, t), V = x.requestStart, ae = x.requestResponseStart, ie = x.requestResponseEnd, C = x.requestBytesLoaded, z = x.requestResponseHeaders, ye = x.requestMediaDuration, ge = x.requestHostname, be = x.requestUrl, re = x.requestId, F = Xt(D, t), lt = F.currentLevel, ct = F.renditionWidth, pt = F.renditionHeight, _t = F.renditionBitrate;
694
+ n("requestcompleted", { request_event_type: h, request_start: V, request_response_start: ae, request_response_end: ie, request_bytes_loaded: C, request_type: D, request_response_headers: z, request_hostname: ge, request_id: re, request_url: be, request_media_start_time: A, request_media_duration: ye, request_current_level: lt, request_labeled_bitrate: _t, request_video_width: ct, request_video_height: pt });
691
695
  };
692
- i >= 4 ? t.on("mediaFragmentLoaded", l) : t.on("mediaFragmentLoaded", b);
693
- var s = { video: void 0, audio: void 0, totalBitrate: void 0 }, _ = function() {
694
- if (s.video && typeof s.video.bitrate == "number") {
695
- if (!(s.video.width && s.video.height)) {
696
+ i >= 4 ? t.on("mediaFragmentLoaded", c) : t.on("mediaFragmentLoaded", b);
697
+ var o = { video: void 0, audio: void 0, totalBitrate: void 0 }, p = function() {
698
+ if (o.video && typeof o.video.bitrate == "number") {
699
+ if (!(o.video.width && o.video.height)) {
696
700
  r.warn("have bitrate info for video but missing width/height");
697
701
  return;
698
702
  }
699
- var p = s.video.bitrate;
700
- if (s.audio && typeof s.audio.bitrate == "number" && (p += s.audio.bitrate), p !== s.totalBitrate) return s.totalBitrate = p, { video_source_bitrate: p, video_source_height: s.video.height, video_source_width: s.video.width, video_source_codec: Zt(s.video.codec) };
703
+ var _ = o.video.bitrate;
704
+ if (o.audio && typeof o.audio.bitrate == "number" && (_ += o.audio.bitrate), _ !== o.totalBitrate) return o.totalBitrate = _, { video_source_bitrate: _, video_source_height: o.video.height, video_source_width: o.video.width, video_source_codec: Zt(o.video.codec) };
701
705
  }
702
- }, y = function(p, h, w) {
703
- if (typeof p.newQuality != "number") {
704
- r.warn("missing evt.newQuality in qualityChangeRendered event", p);
705
- return;
706
- }
707
- var k = p.mediaType;
706
+ }, y = function(_, h, w) {
707
+ var k = _.mediaType;
708
708
  if (k === "audio" || k === "video") {
709
- var E = t.getBitrateInfoListFor(k).find(function(S) {
710
- var L = S.qualityIndex;
711
- return L === p.newQuality;
712
- });
709
+ var E;
710
+ if (typeof t.getRepresentationsByType == "function") if (_.newRepresentation) E = { bitrate: _.newRepresentation.bandwidth, width: _.newRepresentation.width, height: _.newRepresentation.height, qualityIndex: _.newRepresentation.absoluteIndex };
711
+ else {
712
+ var R = t.getRepresentationsByType(k);
713
+ if (R && typeof _.newQuality == "number") {
714
+ var A = R.find(function(D) {
715
+ return D.absoluteIndex === _.newQuality || D.index === _.newQuality;
716
+ });
717
+ A && (E = { bitrate: A.bandwidth, width: A.width, height: A.height, qualityIndex: _.newQuality });
718
+ }
719
+ }
720
+ else {
721
+ if (typeof _.newQuality != "number") {
722
+ r.warn("missing evt.newQuality in qualityChangeRendered event", _);
723
+ return;
724
+ }
725
+ E = t.getBitrateInfoListFor(k).find(function(D) {
726
+ var x = D.qualityIndex;
727
+ return x === _.newQuality;
728
+ });
729
+ }
713
730
  if (!(E && typeof E.bitrate == "number")) {
714
731
  r.warn("missing bitrate info for ".concat(k));
715
732
  return;
716
733
  }
717
- s[k] = Oe(fe({}, E), { codec: t.getCurrentTrackFor(k).codec });
718
- var D = _();
719
- D && n("renditionchange", D);
734
+ o[k] = Oe(fe({}, E), { codec: t.getCurrentTrackFor(k).codec });
735
+ var S = p();
736
+ S && n("renditionchange", S);
720
737
  }
721
738
  };
722
739
  t.on("qualityChangeRendered", y);
723
- var f = function(p) {
724
- var h = p.request, w = p.mediaType;
725
- h = h || {}, n("requestcanceled", { request_event_type: h.type + "_" + h.action, request_url: h.url, request_type: w, request_hostname: B(h.url) });
740
+ var f = function(_) {
741
+ var h = _.request, w = _.mediaType;
742
+ h = h || {}, n("requestcanceled", { request_event_type: h.type + "_" + h.action, request_url: h.url, request_type: w, request_hostname: M(h.url) });
726
743
  };
727
744
  t.on("fragmentLoadingAbandoned", f);
728
- var g = function(p) {
729
- var h = p.error, w, k, E = (h == null || (w = h.data) === null || w === void 0 ? void 0 : w.request) || {}, D = (h == null || (k = h.data) === null || k === void 0 ? void 0 : k.response) || {};
730
- h?.code === 27 && n("requestfailed", { request_error: E.type + "_" + E.action, request_url: E.url, request_hostname: B(E.url), request_type: E.mediaType, request_error_code: D.status, request_error_text: D.statusText });
731
- var S = "".concat(E != null && E.url ? "url: ".concat(E.url, `
732
- `) : "") + "".concat(D != null && D.status || D != null && D.statusText ? "response: ".concat(D?.status, ", ").concat(D?.statusText, `
745
+ var g = function(_) {
746
+ var h = _.error, w, k, E = (h == null || (w = h.data) === null || w === void 0 ? void 0 : w.request) || {}, R = (h == null || (k = h.data) === null || k === void 0 ? void 0 : k.response) || {};
747
+ h?.code === 27 && n("requestfailed", { request_error: E.type + "_" + E.action, request_url: E.url, request_hostname: M(E.url), request_type: E.mediaType, request_error_code: R.status, request_error_text: R.statusText });
748
+ var A = "".concat(E != null && E.url ? "url: ".concat(E.url, `
749
+ `) : "") + "".concat(R != null && R.status || R != null && R.statusText ? "response: ".concat(R?.status, ", ").concat(R?.statusText, `
733
750
  `) : "");
734
- n("error", { player_error_code: h?.code, player_error_message: h?.message, player_error_context: S });
751
+ n("error", { player_error_code: h?.code, player_error_message: h?.message, player_error_context: A });
735
752
  };
736
753
  t.on("error", g), t._stopMuxMonitor = function() {
737
- t.off("manifestLoaded", o), t.off("initFragmentLoaded", v), t.off("mediaFragmentLoaded", l), t.off("qualityChangeRendered", y), t.off("error", g), t.off("fragmentLoadingAbandoned", f), delete t._stopMuxMonitor;
754
+ t.off("manifestLoaded", s), t.off("initFragmentLoaded", m), t.off("mediaFragmentLoaded", c), t.off("qualityChangeRendered", y), t.off("error", g), t.off("fragmentLoadingAbandoned", f), delete t._stopMuxMonitor;
738
755
  };
739
756
  }, ta = function(a) {
740
757
  a && typeof a._stopMuxMonitor == "function" && a._stopMuxMonitor();
741
- }, Ne = 0, aa = (function() {
758
+ }, Ce = 0, aa = (function() {
742
759
  function a() {
743
- I(this, a), m(this, "_listeners", void 0);
760
+ P(this, a), v(this, "_listeners", void 0);
744
761
  }
745
- return W(a, [{ key: "on", value: function(e, t, r) {
746
- return t._eventEmitterGuid = t._eventEmitterGuid || ++Ne, this._listeners = this._listeners || {}, this._listeners[e] = this._listeners[e] || [], r && (t = t.bind(r)), this._listeners[e].push(t), t;
762
+ return U(a, [{ key: "on", value: function(e, t, r) {
763
+ return t._eventEmitterGuid = t._eventEmitterGuid || ++Ce, this._listeners = this._listeners || {}, this._listeners[e] = this._listeners[e] || [], r && (t = t.bind(r)), this._listeners[e].push(t), t;
747
764
  } }, { key: "off", value: function(e, t) {
748
765
  var r = this._listeners && this._listeners[e];
749
766
  r && r.forEach(function(i, n) {
@@ -751,7 +768,7 @@ var zt = function(a) {
751
768
  });
752
769
  } }, { key: "one", value: function(e, t, r) {
753
770
  var i = this;
754
- t._eventEmitterGuid = t._eventEmitterGuid || ++Ne;
771
+ t._eventEmitterGuid = t._eventEmitterGuid || ++Ce;
755
772
  var n = function() {
756
773
  i.off(e, n), t.apply(r || this, arguments);
757
774
  };
@@ -760,18 +777,18 @@ var zt = function(a) {
760
777
  var r = this;
761
778
  if (this._listeners) {
762
779
  t = t || {};
763
- var i = this._listeners["before" + e] || [], n = this._listeners["before*"] || [], o = this._listeners[e] || [], u = this._listeners["after" + e] || [], d = function(c, v) {
764
- c = c.slice(), c.forEach(function(b) {
765
- b.call(r, { type: e }, v);
780
+ var i = this._listeners["before" + e] || [], n = this._listeners["before*"] || [], s = this._listeners[e] || [], u = this._listeners["after" + e] || [], d = function(l, m) {
781
+ l = l.slice(), l.forEach(function(b) {
782
+ b.call(r, { type: e }, m);
766
783
  });
767
784
  };
768
- d(i, t), d(n, t), d(o, t), d(u, t);
785
+ d(i, t), d(n, t), d(s, t), d(u, t);
769
786
  }
770
787
  } }]), a;
771
- })(), ra = aa, ke = C(U()), ia = (function() {
788
+ })(), ia = aa, ke = j(G()), ra = (function() {
772
789
  function a(e) {
773
790
  var t = this;
774
- I(this, a), m(this, "_playbackHeartbeatInterval", void 0), m(this, "_playheadShouldBeProgressing", void 0), m(this, "pm", void 0), this.pm = e, this._playbackHeartbeatInterval = null, this._playheadShouldBeProgressing = !1, e.on("playing", function() {
791
+ P(this, a), v(this, "_playbackHeartbeatInterval", void 0), v(this, "_playheadShouldBeProgressing", void 0), v(this, "pm", void 0), this.pm = e, this._playbackHeartbeatInterval = null, this._playheadShouldBeProgressing = !1, e.on("playing", function() {
775
792
  t._playheadShouldBeProgressing = !0;
776
793
  }), e.on("play", this._startPlaybackHeartbeatInterval.bind(this)), e.on("playing", this._startPlaybackHeartbeatInterval.bind(this)), e.on("adbreakstart", this._startPlaybackHeartbeatInterval.bind(this)), e.on("adplay", this._startPlaybackHeartbeatInterval.bind(this)), e.on("adplaying", this._startPlaybackHeartbeatInterval.bind(this)), e.on("devicewake", this._startPlaybackHeartbeatInterval.bind(this)), e.on("viewstart", this._startPlaybackHeartbeatInterval.bind(this)), e.on("rebufferstart", this._startPlaybackHeartbeatInterval.bind(this)), e.on("pause", this._stopPlaybackHeartbeatInterval.bind(this)), e.on("ended", this._stopPlaybackHeartbeatInterval.bind(this)), e.on("viewend", this._stopPlaybackHeartbeatInterval.bind(this)), e.on("error", this._stopPlaybackHeartbeatInterval.bind(this)), e.on("aderror", this._stopPlaybackHeartbeatInterval.bind(this)), e.on("adpause", this._stopPlaybackHeartbeatInterval.bind(this)), e.on("adended", this._stopPlaybackHeartbeatInterval.bind(this)), e.on("adbreakend", this._stopPlaybackHeartbeatInterval.bind(this)), e.on("seeked", function() {
777
794
  e.data.player_is_paused ? t._stopPlaybackHeartbeatInterval() : t._startPlaybackHeartbeatInterval();
@@ -781,7 +798,7 @@ var zt = function(a) {
781
798
  t._playbackHeartbeatInterval !== null && (ke.default.clearInterval(t._playbackHeartbeatInterval), e.emit("playbackheartbeatend", { viewer_time: i.viewer_time }), t._playbackHeartbeatInterval = null);
782
799
  });
783
800
  }
784
- return W(a, [{ key: "_startPlaybackHeartbeatInterval", value: function() {
801
+ return U(a, [{ key: "_startPlaybackHeartbeatInterval", value: function() {
785
802
  var e = this;
786
803
  this._playbackHeartbeatInterval === null && (this.pm.emit("playbackheartbeat"), this._playbackHeartbeatInterval = ke.default.setInterval(function() {
787
804
  e.pm.emit("playbackheartbeat");
@@ -789,39 +806,45 @@ var zt = function(a) {
789
806
  } }, { key: "_stopPlaybackHeartbeatInterval", value: function() {
790
807
  this._playheadShouldBeProgressing = !1, this._playbackHeartbeatInterval !== null && (ke.default.clearInterval(this._playbackHeartbeatInterval), this.pm.emit("playbackheartbeatend"), this._playbackHeartbeatInterval = null);
791
808
  } }]), a;
792
- })(), na = ia, oa = function a(e) {
809
+ })(), na = ra, sa = function a(e) {
793
810
  var t = this;
794
- I(this, a), m(this, "viewErrored", void 0), e.on("viewinit", function() {
811
+ P(this, a), v(this, "viewErrored", void 0), e.on("viewinit", function() {
795
812
  t.viewErrored = !1;
796
813
  }), e.on("error", function(r, i) {
797
814
  try {
798
815
  var n = e.errorTranslator({ player_error_code: i.player_error_code, player_error_message: i.player_error_message, player_error_context: i.player_error_context, player_error_severity: i.player_error_severity, player_error_business_exception: i.player_error_business_exception });
799
816
  n && (e.data.player_error_code = n.player_error_code || i.player_error_code, e.data.player_error_message = n.player_error_message || i.player_error_message, e.data.player_error_context = n.player_error_context || i.player_error_context, e.data.player_error_severity = n.player_error_severity || i.player_error_severity, e.data.player_error_business_exception = n.player_error_business_exception || i.player_error_business_exception, t.viewErrored = !0);
800
- } catch (o) {
801
- e.mux.log.warn("Exception in error translator callback.", o), t.viewErrored = !0;
817
+ } catch (s) {
818
+ e.mux.log.warn("Exception in error translator callback.", s), t.viewErrored = !0;
802
819
  }
803
820
  }), e.on("aftererror", function() {
804
- var r, i, n, o, u;
805
- (r = e.data) === null || r === void 0 || delete r.player_error_code, (i = e.data) === null || i === void 0 || delete i.player_error_message, (n = e.data) === null || n === void 0 || delete n.player_error_context, (o = e.data) === null || o === void 0 || delete o.player_error_severity, (u = e.data) === null || u === void 0 || delete u.player_error_business_exception;
821
+ var r, i, n, s, u;
822
+ (r = e.data) === null || r === void 0 || delete r.player_error_code, (i = e.data) === null || i === void 0 || delete i.player_error_message, (n = e.data) === null || n === void 0 || delete n.player_error_context, (s = e.data) === null || s === void 0 || delete s.player_error_severity, (u = e.data) === null || u === void 0 || delete u.player_error_business_exception;
806
823
  });
807
- }, sa = oa, ua = (function() {
824
+ }, oa = sa, ua = (function() {
808
825
  function a(e) {
809
- I(this, a), m(this, "_watchTimeTrackerLastCheckedTime", void 0), m(this, "pm", void 0), this.pm = e, this._watchTimeTrackerLastCheckedTime = null, e.on("playbackheartbeat", this._updateWatchTime.bind(this)), e.on("playbackheartbeatend", this._clearWatchTimeState.bind(this));
826
+ P(this, a), v(this, "_watchTimeTrackerLastCheckedTime", void 0), v(this, "pm", void 0), this.pm = e, this._watchTimeTrackerLastCheckedTime = null, e.on("playbackheartbeat", this._updateWatchTime.bind(this)), e.on("playbackheartbeatend", this._clearWatchTimeState.bind(this));
810
827
  }
811
- return W(a, [{ key: "_updateWatchTime", value: function(e, t) {
828
+ return U(a, [{ key: "_updateWatchTime", value: function(e, t) {
812
829
  var r = t.viewer_time;
813
- this._watchTimeTrackerLastCheckedTime === null && (this._watchTimeTrackerLastCheckedTime = r), A(this.pm.data, "view_watch_time", r - this._watchTimeTrackerLastCheckedTime), this._watchTimeTrackerLastCheckedTime = r;
830
+ this._watchTimeTrackerLastCheckedTime === null && (this._watchTimeTrackerLastCheckedTime = r), L(this.pm.data, "view_watch_time", r - this._watchTimeTrackerLastCheckedTime), this._watchTimeTrackerLastCheckedTime = r;
814
831
  } }, { key: "_clearWatchTimeState", value: function(e, t) {
815
832
  this._updateWatchTime(e, t), this._watchTimeTrackerLastCheckedTime = null;
816
833
  } }]), a;
817
834
  })(), da = ua, la = (function() {
818
835
  function a(e) {
819
836
  var t = this;
820
- I(this, a), m(this, "_playbackTimeTrackerLastPlayheadPosition", void 0), m(this, "_lastTime", void 0), m(this, "_isAdPlaying", void 0), m(this, "_callbackUpdatePlaybackTime", void 0), m(this, "pm", void 0), this.pm = e, this._playbackTimeTrackerLastPlayheadPosition = -1, this._lastTime = P.now(), this._isAdPlaying = !1, this._callbackUpdatePlaybackTime = null;
837
+ P(this, a), v(this, "_playbackTimeTrackerLastPlayheadPosition", void 0), v(this, "_lastTime", void 0), v(this, "_isAdPlaying", void 0), v(this, "_callbackUpdatePlaybackTime", void 0), v(this, "pm", void 0), this.pm = e, this._playbackTimeTrackerLastPlayheadPosition = -1, this._lastTime = I.now(), this._isAdPlaying = !1, this._callbackUpdatePlaybackTime = null, e.on("viewinit", function() {
838
+ t.pm.data.view_playing_time_ms_cumulative = 0;
839
+ });
821
840
  var r = this._startPlaybackTimeTracking.bind(this);
822
- e.on("playing", r), e.on("adplaying", r), e.on("seeked", r);
823
- var i = this._stopPlaybackTimeTracking.bind(this);
824
- e.on("playbackheartbeatend", i), e.on("seeking", i), e.on("adplaying", function() {
841
+ e.on("playing", r), e.on("adplaying", r);
842
+ var i = function() {
843
+ t.pm.data.player_is_paused || r();
844
+ };
845
+ e.on("seeked", i), e.on("rebufferend", i);
846
+ var n = this._stopPlaybackTimeTracking.bind(this);
847
+ e.on("playbackheartbeatend", n), e.on("seeking", n), e.on("rebufferstart", n), e.on("adplaying", function() {
825
848
  t._isAdPlaying = !0;
826
849
  }), e.on("adended", function() {
827
850
  t._isAdPlaying = !1;
@@ -834,26 +857,26 @@ var zt = function(a) {
834
857
  }), e.on("adplay", function() {
835
858
  t._isAdPlaying = !1;
836
859
  }), e.on("viewinit", function() {
837
- t._playbackTimeTrackerLastPlayheadPosition = -1, t._lastTime = P.now(), t._isAdPlaying = !1, t._callbackUpdatePlaybackTime = null;
860
+ t._playbackTimeTrackerLastPlayheadPosition = -1, t._lastTime = I.now(), t._isAdPlaying = !1, t._callbackUpdatePlaybackTime = null;
838
861
  });
839
862
  }
840
- return W(a, [{ key: "_startPlaybackTimeTracking", value: function() {
841
- this._callbackUpdatePlaybackTime === null && (this._callbackUpdatePlaybackTime = this._updatePlaybackTime.bind(this), this._playbackTimeTrackerLastPlayheadPosition = this.pm.data.player_playhead_time, this.pm.on("playbackheartbeat", this._callbackUpdatePlaybackTime));
863
+ return U(a, [{ key: "_startPlaybackTimeTracking", value: function() {
864
+ this._callbackUpdatePlaybackTime === null && (this._callbackUpdatePlaybackTime = this._updatePlaybackTime.bind(this), this._playbackTimeTrackerLastPlayheadPosition = this.pm.data.player_playhead_time, this._lastTime = I.now(), this.pm.on("playbackheartbeat", this._callbackUpdatePlaybackTime));
842
865
  } }, { key: "_stopPlaybackTimeTracking", value: function() {
843
866
  this._callbackUpdatePlaybackTime && (this._updatePlaybackTime(), this.pm.off("playbackheartbeat", this._callbackUpdatePlaybackTime), this._callbackUpdatePlaybackTime = null, this._playbackTimeTrackerLastPlayheadPosition = -1);
844
867
  } }, { key: "_updatePlaybackTime", value: function() {
845
- var e = this.pm.data.player_playhead_time, t = P.now(), r = -1;
846
- this._playbackTimeTrackerLastPlayheadPosition >= 0 && e > this._playbackTimeTrackerLastPlayheadPosition ? r = e - this._playbackTimeTrackerLastPlayheadPosition : this._isAdPlaying && (r = t - this._lastTime), r > 0 && r <= 1e3 && A(this.pm.data, "view_content_playback_time", r), this._playbackTimeTrackerLastPlayheadPosition = e, this._lastTime = t;
868
+ var e = this.pm.data.player_playhead_time || 0, t = I.now(), r = t - this._lastTime, i = -1;
869
+ this._playbackTimeTrackerLastPlayheadPosition >= 0 && e > this._playbackTimeTrackerLastPlayheadPosition ? i = e - this._playbackTimeTrackerLastPlayheadPosition : this._isAdPlaying && (i = r), i > 0 && i <= 1e3 && L(this.pm.data, "view_content_playback_time", i), this._callbackUpdatePlaybackTime !== null && r > 0 && r <= 1e3 && (this._isAdPlaying && L(this.pm.data, "ad_playing_time_ms_cumulative", r), L(this.pm.data, "view_playing_time_ms_cumulative", r)), this._playbackTimeTrackerLastPlayheadPosition = e, this._lastTime = t;
847
870
  } }]), a;
848
- })(), ca = la, _a = (function() {
871
+ })(), ca = la, pa = (function() {
849
872
  function a(e) {
850
- I(this, a), m(this, "pm", void 0), this.pm = e;
873
+ P(this, a), v(this, "pm", void 0), this.pm = e;
851
874
  var t = this._updatePlayheadTime.bind(this);
852
875
  e.on("playbackheartbeat", t), e.on("playbackheartbeatend", t), e.on("timeupdate", t), e.on("destroy", function() {
853
876
  e.off("timeupdate", t);
854
877
  });
855
878
  }
856
- return W(a, [{ key: "_updateMaxPlayheadPosition", value: function() {
879
+ return U(a, [{ key: "_updateMaxPlayheadPosition", value: function() {
857
880
  this.pm.data.view_max_playhead_position = typeof this.pm.data.view_max_playhead_position > "u" ? this.pm.data.player_playhead_time : Math.max(this.pm.data.view_max_playhead_position, this.pm.data.player_playhead_time);
858
881
  } }, { key: "_updatePlayheadTime", value: function(e, t) {
859
882
  var r = this, i = function() {
@@ -865,33 +888,33 @@ var zt = function(a) {
865
888
  typeof n < "u" && (this.pm.data.player_playhead_time = n, i(), this._updateMaxPlayheadPosition());
866
889
  }
867
890
  } }]), a;
868
- })(), ha = _a, Ce = 300 * 1e3, pa = function a(e) {
869
- if (I(this, a), !e.disableRebufferTracking) {
870
- var t, r = function(n, o) {
871
- i(o), t = void 0;
891
+ })(), _a = pa, je = 300 * 1e3, ha = function a(e) {
892
+ if (P(this, a), !e.disableRebufferTracking) {
893
+ var t, r = function(n, s) {
894
+ i(s), t = void 0;
872
895
  }, i = function(n) {
873
896
  if (t) {
874
- var o = n.viewer_time - t;
875
- A(e.data, "view_rebuffer_duration", o), t = n.viewer_time, e.data.view_rebuffer_duration > Ce && (e.emit("viewend"), e.send("viewend"), e.mux.log.warn("Ending view after rebuffering for longer than ".concat(Ce, "ms, future events will be ignored unless a programchange or videochange occurs.")));
897
+ var s = n.viewer_time - t;
898
+ L(e.data, "view_rebuffer_duration", s), t = n.viewer_time, e.data.view_rebuffer_duration > je && (e.emit("viewend"), e.send("viewend"), e.mux.log.warn("Ending view after rebuffering for longer than ".concat(je, "ms, future events will be ignored unless a programchange or videochange occurs.")));
876
899
  }
877
900
  e.data.view_watch_time >= 0 && e.data.view_rebuffer_count > 0 && (e.data.view_rebuffer_frequency = e.data.view_rebuffer_count / e.data.view_watch_time, e.data.view_rebuffer_percentage = e.data.view_rebuffer_duration / e.data.view_watch_time);
878
901
  };
879
- e.on("playbackheartbeat", function(n, o) {
880
- return i(o);
881
- }), e.on("rebufferstart", function(n, o) {
882
- t || (A(e.data, "view_rebuffer_count", 1), t = o.viewer_time, e.one("rebufferend", r));
902
+ e.on("playbackheartbeat", function(n, s) {
903
+ return i(s);
904
+ }), e.on("rebufferstart", function(n, s) {
905
+ t || (L(e.data, "view_rebuffer_count", 1), t = s.viewer_time, e.one("rebufferend", r));
883
906
  }), e.on("viewinit", function() {
884
907
  t = void 0, e.off("rebufferend", r);
885
908
  });
886
909
  }
887
- }, fa = pa, va = (function() {
910
+ }, fa = ha, va = (function() {
888
911
  function a(e) {
889
912
  var t = this;
890
- I(this, a), m(this, "_lastCheckedTime", void 0), m(this, "_lastPlayheadTime", void 0), m(this, "_lastPlayheadTimeUpdatedTime", void 0), m(this, "_rebuffering", void 0), m(this, "pm", void 0), this.pm = e, !(e.disableRebufferTracking || e.disablePlayheadRebufferTracking) && (this._lastCheckedTime = null, this._lastPlayheadTime = null, this._lastPlayheadTimeUpdatedTime = null, e.on("playbackheartbeat", this._checkIfRebuffering.bind(this)), e.on("playbackheartbeatend", this._cleanupRebufferTracker.bind(this)), e.on("seeking", function() {
891
- t._cleanupRebufferTracker(null, { viewer_time: P.now() });
913
+ P(this, a), v(this, "_lastCheckedTime", void 0), v(this, "_lastPlayheadTime", void 0), v(this, "_lastPlayheadTimeUpdatedTime", void 0), v(this, "_rebuffering", void 0), v(this, "pm", void 0), this.pm = e, !(e.disableRebufferTracking || e.disablePlayheadRebufferTracking) && (this._lastCheckedTime = null, this._lastPlayheadTime = null, this._lastPlayheadTimeUpdatedTime = null, e.on("playbackheartbeat", this._checkIfRebuffering.bind(this)), e.on("playbackheartbeatend", this._cleanupRebufferTracker.bind(this)), e.on("seeking", function() {
914
+ t._cleanupRebufferTracker(null, { viewer_time: I.now() });
892
915
  }));
893
916
  }
894
- return W(a, [{ key: "_checkIfRebuffering", value: function(e, t) {
917
+ return U(a, [{ key: "_checkIfRebuffering", value: function(e, t) {
895
918
  if (this.pm.seekingTracker.isSeeking || this.pm.adTracker.isAdBreak || !this.pm.playbackHeartbeat._playheadShouldBeProgressing) {
896
919
  this._cleanupRebufferTracker(e, t);
897
920
  return;
@@ -923,12 +946,12 @@ var zt = function(a) {
923
946
  })(), ma = va, ya = (function() {
924
947
  function a(e) {
925
948
  var t = this;
926
- I(this, a), m(this, "pm", void 0), this.pm = e, e.on("viewinit", function() {
949
+ P(this, a), v(this, "pm", void 0), this.pm = e, e.on("viewinit", function() {
927
950
  var r = e.data, i = r.view_id;
928
951
  if (!r.view_program_changed) {
929
- var n = function(o, u) {
952
+ var n = function(s, u) {
930
953
  var d = u.viewer_time;
931
- (o.type === "playing" && typeof e.data.view_time_to_first_frame > "u" || o.type === "adplaying" && (typeof e.data.view_time_to_first_frame > "u" || t._inPrerollPosition())) && t.calculateTimeToFirstFrame(d || P.now(), i);
954
+ (s.type === "playing" && typeof e.data.view_time_to_first_frame > "u" || s.type === "adplaying" && (typeof e.data.view_time_to_first_frame > "u" || t._inPrerollPosition())) && t.calculateTimeToFirstFrame(d || I.now(), i);
932
955
  };
933
956
  e.one("playing", n), e.one("adplaying", n), e.one("viewend", function() {
934
957
  e.off("playing", n), e.off("adplaying", n);
@@ -936,27 +959,27 @@ var zt = function(a) {
936
959
  }
937
960
  });
938
961
  }
939
- return W(a, [{ key: "_inPrerollPosition", value: function() {
962
+ return U(a, [{ key: "_inPrerollPosition", value: function() {
940
963
  return typeof this.pm.data.view_content_playback_time > "u" || this.pm.data.view_content_playback_time <= 1e3;
941
964
  } }, { key: "calculateTimeToFirstFrame", value: function(e, t) {
942
965
  t === this.pm.data.view_id && (this.pm.watchTimeTracker._updateWatchTime(null, { viewer_time: e }), this.pm.data.view_time_to_first_frame = this.pm.data.view_watch_time, (this.pm.data.player_autoplay_on || this.pm.data.video_is_autoplay) && this.pm.pageLoadInitTime && (this.pm.data.view_aggregate_startup_time = this.pm.data.view_start + this.pm.data.view_watch_time - this.pm.pageLoadInitTime));
943
966
  } }]), a;
944
967
  })(), ga = ya, ba = function a(e) {
945
968
  var t = this;
946
- I(this, a), m(this, "_lastPlayerHeight", void 0), m(this, "_lastPlayerWidth", void 0), m(this, "_lastPlayheadPosition", void 0), m(this, "_lastSourceHeight", void 0), m(this, "_lastSourceWidth", void 0), e.on("viewinit", function() {
969
+ P(this, a), v(this, "_lastPlayerHeight", void 0), v(this, "_lastPlayerWidth", void 0), v(this, "_lastPlayheadPosition", void 0), v(this, "_lastSourceHeight", void 0), v(this, "_lastSourceWidth", void 0), e.on("viewinit", function() {
947
970
  t._lastPlayheadPosition = -1;
948
971
  });
949
- var r = ["pause", "rebufferstart", "seeking", "error", "adbreakstart", "hb", "renditionchange", "orientationchange", "viewend"], i = ["playing", "hb", "renditionchange", "orientationchange"];
972
+ var r = ["pause", "rebufferstart", "seeking", "error", "adbreakstart", "hb", "renditionchange", "orientationchange", "viewend", "playbackmodechange"], i = ["playing", "hb", "renditionchange", "orientationchange", "playbackmodechange"];
950
973
  r.forEach(function(n) {
951
974
  e.on(n, function() {
952
975
  if (t._lastPlayheadPosition >= 0 && e.data.player_playhead_time >= 0 && t._lastPlayerWidth >= 0 && t._lastSourceWidth > 0 && t._lastPlayerHeight >= 0 && t._lastSourceHeight > 0) {
953
- var o = e.data.player_playhead_time - t._lastPlayheadPosition;
954
- if (o < 0) {
976
+ var s = e.data.player_playhead_time - t._lastPlayheadPosition;
977
+ if (s < 0) {
955
978
  t._lastPlayheadPosition = -1;
956
979
  return;
957
980
  }
958
- var u = Math.min(t._lastPlayerWidth / t._lastSourceWidth, t._lastPlayerHeight / t._lastSourceHeight), d = Math.max(0, u - 1), c = Math.max(0, 1 - u);
959
- e.data.view_max_upscale_percentage = Math.max(e.data.view_max_upscale_percentage || 0, d), e.data.view_max_downscale_percentage = Math.max(e.data.view_max_downscale_percentage || 0, c), A(e.data, "view_total_content_playback_time", o), A(e.data, "view_total_upscaling", d * o), A(e.data, "view_total_downscaling", c * o);
981
+ var u = Math.min(t._lastPlayerWidth / t._lastSourceWidth, t._lastPlayerHeight / t._lastSourceHeight), d = Math.max(0, u - 1), l = Math.max(0, 1 - u);
982
+ e.data.view_max_upscale_percentage = Math.max(e.data.view_max_upscale_percentage || 0, d), e.data.view_max_downscale_percentage = Math.max(e.data.view_max_downscale_percentage || 0, l), L(e.data, "view_total_content_playback_time", s), L(e.data, "view_total_upscaling", d * s), L(e.data, "view_total_downscaling", l * s);
960
983
  }
961
984
  t._lastPlayheadPosition = -1;
962
985
  });
@@ -967,30 +990,30 @@ var zt = function(a) {
967
990
  });
968
991
  }, wa = ba, Ta = 2e3, ka = function a(e) {
969
992
  var t = this;
970
- I(this, a), m(this, "isSeeking", void 0), this.isSeeking = !1;
993
+ P(this, a), v(this, "isSeeking", void 0), this.isSeeking = !1;
971
994
  var r = -1, i = function() {
972
- var n = P.now(), o = (e.data.viewer_time || n) - (r || n);
973
- A(e.data, "view_seek_duration", o), e.data.view_max_seek_time = Math.max(e.data.view_max_seek_time || 0, o), t.isSeeking = !1, r = -1;
995
+ var n = I.now(), s = (e.data.viewer_time || n) - (r || n);
996
+ L(e.data, "view_seek_duration", s), e.data.view_max_seek_time = Math.max(e.data.view_max_seek_time || 0, s), t.isSeeking = !1, r = -1;
974
997
  };
975
- e.on("seeking", function(n, o) {
976
- if (Object.assign(e.data, o), t.isSeeking && o.viewer_time - r <= Ta) {
977
- r = o.viewer_time;
998
+ e.on("seeking", function(n, s) {
999
+ if (Object.assign(e.data, s), t.isSeeking && s.viewer_time - r <= Ta) {
1000
+ r = s.viewer_time;
978
1001
  return;
979
1002
  }
980
- t.isSeeking && i(), t.isSeeking = !0, r = o.viewer_time, A(e.data, "view_seek_count", 1), e.send("seeking");
1003
+ t.isSeeking && i(), t.isSeeking = !0, r = s.viewer_time, L(e.data, "view_seek_count", 1), e.send("seeking");
981
1004
  }), e.on("seeked", function() {
982
1005
  i();
983
1006
  }), e.on("viewend", function() {
984
1007
  t.isSeeking && (i(), e.send("seeked")), t.isSeeking = !1, r = -1;
985
1008
  });
986
- }, Ea = ka, je = function(a, e) {
1009
+ }, Ea = ka, He = function(a, e) {
987
1010
  a.push(e), a.sort(function(t, r) {
988
1011
  return t.viewer_time - r.viewer_time;
989
1012
  });
990
1013
  }, xa = ["adbreakstart", "adrequest", "adresponse", "adplay", "adplaying", "adpause", "adended", "adbreakend", "aderror", "adclicked", "adskipped"], Da = (function() {
991
1014
  function a(e) {
992
1015
  var t = this;
993
- I(this, a), m(this, "_adHasPlayed", void 0), m(this, "_adRequests", void 0), m(this, "_adResponses", void 0), m(this, "_currentAdRequestNumber", void 0), m(this, "_currentAdResponseNumber", void 0), m(this, "_prerollPlayTime", void 0), m(this, "_wouldBeNewAdPlay", void 0), m(this, "isAdBreak", void 0), m(this, "pm", void 0), this.pm = e, e.on("viewinit", function() {
1016
+ P(this, a), v(this, "_adHasPlayed", void 0), v(this, "_adRequests", void 0), v(this, "_adResponses", void 0), v(this, "_currentAdRequestNumber", void 0), v(this, "_currentAdResponseNumber", void 0), v(this, "_prerollPlayTime", void 0), v(this, "_wouldBeNewAdPlay", void 0), v(this, "isAdBreak", void 0), v(this, "pm", void 0), this.pm = e, e.on("viewinit", function() {
994
1017
  t.isAdBreak = !1, t._currentAdRequestNumber = 0, t._currentAdResponseNumber = 0, t._adRequests = [], t._adResponses = [], t._adHasPlayed = !1, t._wouldBeNewAdPlay = !0, t._prerollPlayTime = void 0;
995
1018
  }), xa.forEach(function(i) {
996
1019
  return e.on(i, t._updateAdData.bind(t));
@@ -1001,26 +1024,26 @@ var zt = function(a) {
1001
1024
  e.on("adbreakstart", function() {
1002
1025
  t.isAdBreak = !0;
1003
1026
  }), e.on("play", r), e.on("playing", r), e.on("viewend", r), e.on("adrequest", function(i, n) {
1004
- n = Object.assign({ ad_request_id: "generatedAdRequestId" + t._currentAdRequestNumber++ }, n), je(t._adRequests, n), A(e.data, "view_ad_request_count"), t.inPrerollPosition() && (e.data.view_preroll_requested = !0, t._adHasPlayed || A(e.data, "view_preroll_request_count"));
1027
+ n = Object.assign({ ad_request_id: "generatedAdRequestId" + t._currentAdRequestNumber++ }, n), He(t._adRequests, n), L(e.data, "view_ad_request_count"), t.inPrerollPosition() && (e.data.view_preroll_requested = !0, t._adHasPlayed || L(e.data, "view_preroll_request_count"));
1005
1028
  }), e.on("adresponse", function(i, n) {
1006
- n = Object.assign({ ad_request_id: "generatedAdRequestId" + t._currentAdResponseNumber++ }, n), je(t._adResponses, n);
1007
- var o = t.findAdRequest(n.ad_request_id);
1008
- o && A(e.data, "view_ad_request_time", Math.max(0, n.viewer_time - o.viewer_time));
1029
+ n = Object.assign({ ad_request_id: "generatedAdRequestId" + t._currentAdResponseNumber++ }, n), He(t._adResponses, n);
1030
+ var s = t.findAdRequest(n.ad_request_id);
1031
+ s && L(e.data, "view_ad_request_time", Math.max(0, n.viewer_time - s.viewer_time));
1009
1032
  }), e.on("adplay", function(i, n) {
1010
- t._adHasPlayed = !0, t._wouldBeNewAdPlay && (t._wouldBeNewAdPlay = !1, A(e.data, "view_ad_played_count")), t.inPrerollPosition() && !e.data.view_preroll_played && (e.data.view_preroll_played = !0, t._adRequests.length > 0 && (e.data.view_preroll_request_time = Math.max(0, n.viewer_time - t._adRequests[0].viewer_time)), e.data.view_start && (e.data.view_startup_preroll_request_time = Math.max(0, n.viewer_time - e.data.view_start)), t._prerollPlayTime = n.viewer_time);
1033
+ t._adHasPlayed = !0, t._wouldBeNewAdPlay && (t._wouldBeNewAdPlay = !1, L(e.data, "view_ad_played_count")), t.inPrerollPosition() && !e.data.view_preroll_played && (e.data.view_preroll_played = !0, t._adRequests.length > 0 && (e.data.view_preroll_request_time = Math.max(0, n.viewer_time - t._adRequests[0].viewer_time)), e.data.view_start && (e.data.view_startup_preroll_request_time = Math.max(0, n.viewer_time - e.data.view_start)), t._prerollPlayTime = n.viewer_time);
1011
1034
  }), e.on("adplaying", function(i, n) {
1012
1035
  t.inPrerollPosition() && typeof e.data.view_preroll_load_time > "u" && typeof t._prerollPlayTime < "u" && (e.data.view_preroll_load_time = n.viewer_time - t._prerollPlayTime, e.data.view_startup_preroll_load_time = n.viewer_time - t._prerollPlayTime);
1013
1036
  }), e.on("adclicked", function(i, n) {
1014
- t._wouldBeNewAdPlay || A(e.data, "view_ad_clicked_count");
1037
+ t._wouldBeNewAdPlay || L(e.data, "view_ad_clicked_count");
1015
1038
  }), e.on("adskipped", function(i, n) {
1016
- t._wouldBeNewAdPlay || A(e.data, "view_ad_skipped_count");
1039
+ t._wouldBeNewAdPlay || L(e.data, "view_ad_skipped_count");
1017
1040
  }), e.on("adended", function() {
1018
1041
  t._wouldBeNewAdPlay = !0;
1019
1042
  }), e.on("aderror", function() {
1020
1043
  t._wouldBeNewAdPlay = !0;
1021
1044
  });
1022
1045
  }
1023
- return W(a, [{ key: "inPrerollPosition", value: function() {
1046
+ return U(a, [{ key: "inPrerollPosition", value: function() {
1024
1047
  return typeof this.pm.data.view_content_playback_time > "u" || this.pm.data.view_content_playback_time <= 1e3;
1025
1048
  } }, { key: "findAdRequest", value: function(e) {
1026
1049
  for (var t = 0; t < this._adRequests.length; t++) if (this._adRequests[t].ad_request_id === e) return this._adRequests[t];
@@ -1031,46 +1054,26 @@ var zt = function(a) {
1031
1054
  this.pm.data.view_preroll_ad_tag_domain = n, this.pm.data.view_preroll_ad_tag_hostname = i;
1032
1055
  }
1033
1056
  if (!this.pm.data.view_preroll_ad_asset_hostname && t.ad_asset_url) {
1034
- var o = Q(le(t.ad_asset_url), 2), u = o[0], d = o[1];
1057
+ var s = Q(le(t.ad_asset_url), 2), u = s[0], d = s[1];
1035
1058
  this.pm.data.view_preroll_ad_asset_domain = d, this.pm.data.view_preroll_ad_asset_hostname = u;
1036
1059
  }
1060
+ this.pm.data.ad_type = "preroll";
1037
1061
  }
1038
- this.pm.data.ad_asset_url = t?.ad_asset_url, this.pm.data.ad_tag_url = t?.ad_tag_url, this.pm.data.ad_creative_id = t?.ad_creative_id, this.pm.data.ad_id = t?.ad_id, this.pm.data.ad_universal_id = t?.ad_universal_id;
1062
+ this.pm.data.ad_asset_url = t?.ad_asset_url, this.pm.data.ad_tag_url = t?.ad_tag_url, this.pm.data.ad_creative_id = t?.ad_creative_id, this.pm.data.ad_id = t?.ad_id, this.pm.data.ad_universal_id = t?.ad_universal_id, t != null && t.ad_type && (this.pm.data.ad_type = t?.ad_type);
1039
1063
  } }]), a;
1040
- })(), qa = Da, He = C(U()), Ra = function a(e) {
1041
- I(this, a);
1042
- var t, r, i = function() {
1043
- e.disableRebufferTracking || (A(e.data, "view_waiting_rebuffer_count", 1), t = P.now(), r = He.default.setInterval(function() {
1044
- if (t) {
1045
- var c = P.now();
1046
- A(e.data, "view_waiting_rebuffer_duration", c - t), t = c;
1047
- }
1048
- }, 250));
1049
- }, n = function() {
1050
- e.disableRebufferTracking || t && (A(e.data, "view_waiting_rebuffer_duration", P.now() - t), t = !1, He.default.clearInterval(r));
1051
- }, o = !1, u = function() {
1052
- o = !0;
1053
- }, d = function() {
1054
- o = !1, n();
1055
- };
1056
- e.on("waiting", function() {
1057
- o && i();
1058
- }), e.on("playing", function() {
1059
- n(), u();
1060
- }), e.on("pause", d), e.on("seeking", d);
1061
- }, Sa = Ra, Oa = function a(e) {
1064
+ })(), Ra = Da, qa = function a(e) {
1062
1065
  var t = this;
1063
- I(this, a), m(this, "lastWallClockTime", void 0);
1066
+ P(this, a), v(this, "lastWallClockTime", void 0);
1064
1067
  var r = function() {
1065
- t.lastWallClockTime = P.now(), e.on("before*", i);
1068
+ t.lastWallClockTime = I.now(), e.on("before*", i);
1066
1069
  }, i = function(n) {
1067
- var o = P.now(), u = t.lastWallClockTime;
1068
- t.lastWallClockTime = o, o - u > 3e4 && (e.emit("devicesleep", { viewer_time: u }), Object.assign(e.data, { viewer_time: u }), e.send("devicesleep"), e.emit("devicewake", { viewer_time: o }), Object.assign(e.data, { viewer_time: o }), e.send("devicewake"));
1070
+ var s = I.now(), u = t.lastWallClockTime;
1071
+ t.lastWallClockTime = s, s - u > 3e4 && (e.emit("devicesleep", { viewer_time: u }), Object.assign(e.data, { viewer_time: u }), e.send("devicesleep"), e.emit("devicewake", { viewer_time: s }), Object.assign(e.data, { viewer_time: s }), e.send("devicewake"));
1069
1072
  };
1070
1073
  e.one("playbackheartbeat", r), e.on("playbackheartbeatend", function() {
1071
1074
  e.off("before*", i), e.one("playbackheartbeat", r);
1072
1075
  });
1073
- }, Aa = Oa, Ee = C(U()), tt = (function(a) {
1076
+ }, Aa = qa, Ee = j(G()), tt = (function(a) {
1074
1077
  return a();
1075
1078
  })(function() {
1076
1079
  var a = function() {
@@ -1081,35 +1084,35 @@ var zt = function(a) {
1081
1084
  return r;
1082
1085
  };
1083
1086
  function e(t) {
1084
- function r(i, n, o) {
1087
+ function r(i, n, s) {
1085
1088
  var u;
1086
1089
  if (typeof document < "u") {
1087
1090
  if (arguments.length > 1) {
1088
- if (o = a({ path: "/" }, r.defaults, o), typeof o.expires == "number") {
1091
+ if (s = a({ path: "/" }, r.defaults, s), typeof s.expires == "number") {
1089
1092
  var d = /* @__PURE__ */ new Date();
1090
- d.setMilliseconds(d.getMilliseconds() + o.expires * 864e5), o.expires = d;
1093
+ d.setMilliseconds(d.getMilliseconds() + s.expires * 864e5), s.expires = d;
1091
1094
  }
1092
1095
  try {
1093
1096
  u = JSON.stringify(n), /^[\{\[]/.test(u) && (n = u);
1094
1097
  } catch {
1095
1098
  }
1096
- return t.write ? n = t.write(n, i) : n = encodeURIComponent(String(n)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent), i = encodeURIComponent(String(i)), i = i.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent), i = i.replace(/[\(\)]/g, escape), document.cookie = [i, "=", n, o.expires ? "; expires=" + o.expires.toUTCString() : "", o.path ? "; path=" + o.path : "", o.domain ? "; domain=" + o.domain : "", o.secure ? "; secure" : ""].join("");
1099
+ return t.write ? n = t.write(n, i) : n = encodeURIComponent(String(n)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent), i = encodeURIComponent(String(i)), i = i.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent), i = i.replace(/[\(\)]/g, escape), document.cookie = [i, "=", n, s.expires ? "; expires=" + s.expires.toUTCString() : "", s.path ? "; path=" + s.path : "", s.domain ? "; domain=" + s.domain : "", s.secure ? "; secure" : ""].join("");
1097
1100
  }
1098
1101
  i || (u = {});
1099
- for (var c = document.cookie ? document.cookie.split("; ") : [], v = /(%[0-9A-Z]{2})+/g, b = 0; b < c.length; b++) {
1100
- var l = c[b].split("="), s = l.slice(1).join("=");
1101
- s.charAt(0) === '"' && (s = s.slice(1, -1));
1102
+ for (var l = document.cookie ? document.cookie.split("; ") : [], m = /(%[0-9A-Z]{2})+/g, b = 0; b < l.length; b++) {
1103
+ var c = l[b].split("="), o = c.slice(1).join("=");
1104
+ o.charAt(0) === '"' && (o = o.slice(1, -1));
1102
1105
  try {
1103
- var _ = l[0].replace(v, decodeURIComponent);
1104
- if (s = t.read ? t.read(s, _) : t(s, _) || s.replace(v, decodeURIComponent), this.json) try {
1105
- s = JSON.parse(s);
1106
+ var p = c[0].replace(m, decodeURIComponent);
1107
+ if (o = t.read ? t.read(o, p) : t(o, p) || o.replace(m, decodeURIComponent), this.json) try {
1108
+ o = JSON.parse(o);
1106
1109
  } catch {
1107
1110
  }
1108
- if (i === _) {
1109
- u = s;
1111
+ if (i === p) {
1112
+ u = o;
1110
1113
  break;
1111
1114
  }
1112
- i || (u[_] = s);
1115
+ i || (u[p] = o);
1113
1116
  } catch {
1114
1117
  }
1115
1118
  }
@@ -1126,46 +1129,46 @@ var zt = function(a) {
1126
1129
  }
1127
1130
  return e(function() {
1128
1131
  });
1129
- }), at = "muxData", Pa = function(a) {
1132
+ }), at = "muxData", Sa = function(a) {
1130
1133
  return Object.entries(a).map(function(e) {
1131
1134
  var t = Q(e, 2), r = t[0], i = t[1];
1132
1135
  return "".concat(r, "=").concat(i);
1133
1136
  }).join("&");
1134
- }, La = function(a) {
1137
+ }, Oa = function(a) {
1135
1138
  return a.split("&").reduce(function(e, t) {
1136
- var r = Q(t.split("="), 2), i = r[0], n = r[1], o = +n, u = n && o == n ? o : n;
1139
+ var r = Q(t.split("="), 2), i = r[0], n = r[1], s = +n, u = n && s == n ? s : n;
1137
1140
  return e[i] = u, e;
1138
1141
  }, {});
1139
- }, rt = function() {
1142
+ }, it = function() {
1140
1143
  var a;
1141
1144
  try {
1142
- a = La(tt.get(at) || "");
1145
+ a = Oa(tt.get(at) || "");
1143
1146
  } catch {
1144
1147
  a = {};
1145
1148
  }
1146
1149
  return a;
1147
- }, it = function(a) {
1150
+ }, rt = function(a) {
1148
1151
  try {
1149
- tt.set(at, Pa(a), { expires: 365 });
1152
+ tt.set(at, Sa(a), { expires: 365 });
1150
1153
  } catch {
1151
1154
  }
1152
- }, Ia = function() {
1153
- var a = rt();
1154
- return a.mux_viewer_id = a.mux_viewer_id || de(), a.msn = a.msn || Math.random(), it(a), { mux_viewer_id: a.mux_viewer_id, mux_sample_number: a.msn };
1155
- }, Na = function() {
1156
- var a = rt(), e = P.now();
1157
- return a.session_start && (a.sst = a.session_start, delete a.session_start), a.session_id && (a.sid = a.session_id, delete a.session_id), a.session_expires && (a.sex = a.session_expires, delete a.session_expires), (!a.sex || a.sex < e) && (a.sid = de(), a.sst = e), a.sex = e + 1500 * 1e3, it(a), { session_id: a.sid, session_start: a.sst, session_expires: a.sex };
1155
+ }, Pa = function() {
1156
+ var a = it();
1157
+ return a.mux_viewer_id = a.mux_viewer_id || de(), a.msn = a.msn || Math.random(), rt(a), { mux_viewer_id: a.mux_viewer_id, mux_sample_number: a.msn };
1158
+ }, La = function() {
1159
+ var a = it(), e = I.now();
1160
+ return a.session_start && (a.sst = a.session_start, delete a.session_start), a.session_id && (a.sid = a.session_id, delete a.session_id), a.session_expires && (a.sex = a.session_expires, delete a.session_expires), (!a.sex || a.sex < e) && (a.sid = de(), a.sst = e), a.sex = e + 1500 * 1e3, rt(a), { session_id: a.sid, session_start: a.sst, session_expires: a.sex };
1158
1161
  };
1159
- function Ca(a, e) {
1162
+ function Ia(a, e) {
1160
1163
  var t = e.beaconCollectionDomain, r = e.beaconDomain;
1161
1164
  if (t) return "https://" + t;
1162
1165
  a = a || "inferred";
1163
1166
  var i = r || "litix.io";
1164
1167
  return a.match(/^[a-z0-9]+$/) ? "https://" + a + "." + i : "https://img.litix.io/a.gif";
1165
1168
  }
1166
- var ja = C(U()), nt = function() {
1169
+ var Na = j(G()), nt = function() {
1167
1170
  var a;
1168
- switch (ot()) {
1171
+ switch (st()) {
1169
1172
  case "cellular":
1170
1173
  a = "cellular";
1171
1174
  break;
@@ -1181,13 +1184,13 @@ var ja = C(U()), nt = function() {
1181
1184
  a = "other";
1182
1185
  }
1183
1186
  return a;
1184
- }, ot = function() {
1185
- var a = ja.default.navigator, e = a && (a.connection || a.mozConnection || a.webkitConnection);
1187
+ }, st = function() {
1188
+ var a = Na.default.navigator, e = a && (a.connection || a.mozConnection || a.webkitConnection);
1186
1189
  return e && e.type;
1187
1190
  };
1188
- nt.getConnectionFromAPI = ot;
1189
- var Ha = nt, Ma = { a: "env", b: "beacon", c: "custom", d: "ad", e: "event", f: "experiment", i: "internal", m: "mux", n: "response", p: "player", q: "request", r: "retry", s: "session", t: "timestamp", u: "viewer", v: "video", w: "page", x: "view", y: "sub" }, Ba = st(Ma), Ua = { ad: "ad", af: "affiliate", ag: "aggregate", ap: "api", al: "application", ao: "audio", ar: "architecture", as: "asset", au: "autoplay", av: "average", bi: "bitrate", bn: "brand", br: "break", bw: "browser", by: "bytes", bz: "business", ca: "cached", cb: "cancel", cc: "codec", cd: "code", cg: "category", ch: "changed", ci: "client", ck: "clicked", cl: "canceled", cm: "cmcd", cn: "config", co: "count", ce: "counter", cp: "complete", cq: "creator", cr: "creative", cs: "captions", ct: "content", cu: "current", cx: "connection", cz: "context", dg: "downscaling", dm: "domain", dn: "cdn", do: "downscale", dr: "drm", dp: "dropped", du: "duration", dv: "device", dy: "dynamic", eb: "enabled", ec: "encoding", ed: "edge", en: "end", eg: "engine", em: "embed", er: "error", ep: "experiments", es: "errorcode", et: "errortext", ee: "event", ev: "events", ex: "expires", ez: "exception", fa: "failed", fi: "first", fm: "family", ft: "format", fp: "fps", fq: "frequency", fr: "frame", fs: "fullscreen", ha: "has", hb: "holdback", he: "headers", ho: "host", hn: "hostname", ht: "height", id: "id", ii: "init", in: "instance", ip: "ip", is: "is", ke: "key", la: "language", lb: "labeled", le: "level", li: "live", ld: "loaded", lo: "load", ls: "lists", lt: "latency", ma: "max", md: "media", me: "message", mf: "manifest", mi: "mime", ml: "midroll", mm: "min", mn: "manufacturer", mo: "model", mx: "mux", ne: "newest", nm: "name", no: "number", on: "on", or: "origin", os: "os", pa: "paused", pb: "playback", pd: "producer", pe: "percentage", pf: "played", pg: "program", ph: "playhead", pi: "plugin", pl: "preroll", pn: "playing", po: "poster", pp: "pip", pr: "preload", ps: "position", pt: "part", pv: "previous", py: "property", px: "pop", pz: "plan", ra: "rate", rd: "requested", re: "rebuffer", rf: "rendition", rg: "range", rm: "remote", ro: "ratio", rp: "response", rq: "request", rs: "requests", sa: "sample", sd: "skipped", se: "session", sh: "shift", sk: "seek", sm: "stream", so: "source", sq: "sequence", sr: "series", ss: "status", st: "start", su: "startup", sv: "server", sw: "software", sy: "severity", ta: "tag", tc: "tech", te: "text", tg: "target", th: "throughput", ti: "time", tl: "total", to: "to", tt: "title", ty: "type", ug: "upscaling", un: "universal", up: "upscale", ur: "url", us: "user", va: "variant", vd: "viewed", vi: "video", ve: "version", vw: "view", vr: "viewer", wd: "width", wa: "watch", wt: "waiting" }, Me = st(Ua);
1190
- function st(a) {
1191
+ nt.getConnectionFromAPI = st;
1192
+ var Ca = nt, ja = { a: "env", b: "beacon", c: "custom", d: "ad", e: "event", f: "experiment", i: "internal", m: "mux", n: "response", p: "player", q: "request", r: "retry", s: "session", t: "timestamp", u: "viewer", v: "video", w: "page", x: "view", y: "sub" }, Ha = ot(ja), Ba = { ad: "ad", af: "affiliate", ag: "aggregate", ap: "api", al: "application", ao: "audio", ar: "architecture", as: "asset", au: "autoplay", av: "average", bi: "bitrate", bn: "brand", br: "break", bw: "browser", by: "bytes", bz: "business", ca: "cached", cb: "cancel", cc: "codec", cd: "code", cg: "category", ch: "changed", ci: "client", ck: "clicked", cl: "canceled", cm: "cmcd", cn: "config", co: "count", ce: "counter", cp: "complete", cq: "creator", cr: "creative", cs: "captions", ct: "content", cu: "current", cv: "cumulative", cx: "connection", cz: "context", da: "data", dg: "downscaling", dm: "domain", dn: "cdn", do: "downscale", dr: "drm", dp: "dropped", du: "duration", dv: "device", dy: "dynamic", eb: "enabled", ec: "encoding", ed: "edge", en: "end", eg: "engine", em: "embed", er: "error", ep: "experiments", es: "errorcode", et: "errortext", ee: "event", ev: "events", ex: "expires", ez: "exception", fa: "failed", fi: "first", fm: "family", ft: "format", fp: "fps", fq: "frequency", fr: "frame", fs: "fullscreen", ha: "has", hb: "holdback", he: "headers", ho: "host", hn: "hostname", ht: "height", id: "id", ii: "init", in: "instance", ip: "ip", is: "is", ke: "key", la: "language", lb: "labeled", le: "level", li: "live", ld: "loaded", lo: "load", ls: "lists", lt: "latency", ma: "max", md: "media", me: "message", mf: "manifest", mi: "mime", ml: "midroll", mm: "min", mn: "manufacturer", mo: "model", mp: "mode", ms: "ms", mx: "mux", ne: "newest", nm: "name", no: "number", on: "on", or: "origin", os: "os", pa: "paused", pb: "playback", pd: "producer", pe: "percentage", pf: "played", pg: "program", ph: "playhead", pi: "plugin", pl: "preroll", pn: "playing", po: "poster", pp: "pip", pr: "preload", ps: "position", pt: "part", pv: "previous", py: "property", px: "pop", pz: "plan", ra: "rate", rd: "requested", re: "rebuffer", rf: "rendition", rg: "range", rm: "remote", ro: "ratio", rp: "response", rq: "request", rs: "requests", sa: "sample", sd: "skipped", se: "session", sh: "shift", sk: "seek", sm: "stream", so: "source", sq: "sequence", sr: "series", ss: "status", st: "start", su: "startup", sv: "server", sw: "software", sy: "severity", ta: "tag", tc: "tech", te: "text", tg: "target", th: "throughput", ti: "time", tl: "total", to: "to", tt: "title", ty: "type", ug: "upscaling", un: "universal", up: "upscale", ur: "url", us: "user", va: "variant", vd: "viewed", vi: "video", ve: "version", vw: "view", vr: "viewer", wd: "width", wa: "watch", wt: "waiting" }, Be = ot(Ba);
1193
+ function ot(a) {
1191
1194
  var e = {};
1192
1195
  for (var t in a) a.hasOwnProperty(t) && (e[a[t]] = t);
1193
1196
  return e;
@@ -1197,22 +1200,22 @@ function Se(a) {
1197
1200
  return Object.keys(a).forEach(function(r) {
1198
1201
  var i = !1;
1199
1202
  if (a.hasOwnProperty(r) && a[r] !== void 0) {
1200
- var n = r.split("_"), o = n[0], u = Ba[o];
1201
- u || (q.info("Data key word `" + n[0] + "` not expected in " + r), u = o + "_"), n.splice(1).forEach(function(d) {
1202
- d === "url" && (i = !0), Me[d] ? u += Me[d] : Number.isInteger(Number(d)) ? u += d : (q.info("Data key word `" + d + "` not expected in " + r), u += "_" + d + "_");
1203
+ var n = r.split("_"), s = n[0], u = Ha[s];
1204
+ u || (q.info("Data key word `" + n[0] + "` not expected in " + r), u = s + "_"), n.splice(1).forEach(function(d) {
1205
+ d === "url" && (i = !0), Be[d] ? u += Be[d] : Number.isInteger(Number(d)) ? u += d : (q.info("Data key word `" + d + "` not expected in " + r), u += "_" + d + "_");
1203
1206
  }), i ? t[u] = a[r] : e[u] = a[r];
1204
1207
  }
1205
1208
  }), Object.assign(e, t);
1206
1209
  }
1207
- var X = C(U()), Fa = C(Ye()), Wa = { maxBeaconSize: 300, maxQueueLength: 3600, baseTimeBetweenBeacons: 1e4, maxPayloadKBSize: 500 }, Qa = 56 * 1024, Ga = ["hb", "requestcompleted", "requestfailed", "requestcanceled"], Va = "https://img.litix.io", G = function(a) {
1210
+ var X = j(G()), Ma = j(Ye()), Ua = { maxBeaconSize: 300, maxQueueLength: 3600, baseTimeBetweenBeacons: 1e4, maxPayloadKBSize: 500 }, Fa = 56 * 1024, Ga = ["hb", "requestcompleted", "requestfailed", "requestcanceled"], Qa = "https://img.litix.io", W = function(a) {
1208
1211
  var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1209
- this._beaconUrl = a || Va, this._eventQueue = [], this._postInFlight = !1, this._resendAfterPost = !1, this._failureCount = 0, this._sendTimeout = !1, this._options = Object.assign({}, Wa, e);
1212
+ this._beaconUrl = a || Qa, this._eventQueue = [], this._postInFlight = !1, this._resendAfterPost = !1, this._failureCount = 0, this._sendTimeout = !1, this._options = Object.assign({}, Ua, e);
1210
1213
  };
1211
- G.prototype.queueEvent = function(a, e) {
1214
+ W.prototype.queueEvent = function(a, e) {
1212
1215
  var t = Object.assign({}, e);
1213
1216
  return this._eventQueue.length <= this._options.maxQueueLength || a === "eventrateexceeded" ? (this._eventQueue.push(t), this._sendTimeout || this._startBeaconSending(), this._eventQueue.length <= this._options.maxQueueLength) : !1;
1214
1217
  };
1215
- G.prototype.flushEvents = function() {
1218
+ W.prototype.flushEvents = function() {
1216
1219
  var a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1;
1217
1220
  if (a && this._eventQueue.length === 1) {
1218
1221
  this._eventQueue.pop();
@@ -1220,18 +1223,18 @@ G.prototype.flushEvents = function() {
1220
1223
  }
1221
1224
  this._eventQueue.length && this._sendBeaconQueue(), this._startBeaconSending();
1222
1225
  };
1223
- G.prototype.destroy = function() {
1226
+ W.prototype.destroy = function() {
1224
1227
  var a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1;
1225
1228
  this.destroyed = !0, a ? this._clearBeaconQueue() : this.flushEvents(), X.default.clearTimeout(this._sendTimeout);
1226
1229
  };
1227
- G.prototype._clearBeaconQueue = function() {
1230
+ W.prototype._clearBeaconQueue = function() {
1228
1231
  var a = this._eventQueue.length > this._options.maxBeaconSize ? this._eventQueue.length - this._options.maxBeaconSize : 0, e = this._eventQueue.slice(a);
1229
1232
  a > 0 && Object.assign(e[e.length - 1], Se({ mux_view_message: "event queue truncated" }));
1230
1233
  var t = this._createPayload(e);
1231
1234
  ut(this._beaconUrl, t, !0, function() {
1232
1235
  });
1233
1236
  };
1234
- G.prototype._sendBeaconQueue = function() {
1237
+ W.prototype._sendBeaconQueue = function() {
1235
1238
  var a = this;
1236
1239
  if (this._postInFlight) {
1237
1240
  this._resendAfterPost = !0;
@@ -1239,41 +1242,41 @@ G.prototype._sendBeaconQueue = function() {
1239
1242
  }
1240
1243
  var e = this._eventQueue.slice(0, this._options.maxBeaconSize);
1241
1244
  this._eventQueue = this._eventQueue.slice(this._options.maxBeaconSize), this._postInFlight = !0;
1242
- var t = this._createPayload(e), r = P.now();
1245
+ var t = this._createPayload(e), r = I.now();
1243
1246
  ut(this._beaconUrl, t, !1, function(i, n) {
1244
- n ? (a._eventQueue = e.concat(a._eventQueue), a._failureCount += 1, q.info("Error sending beacon: " + n)) : a._failureCount = 0, a._roundTripTime = P.now() - r, a._postInFlight = !1, a._resendAfterPost && (a._resendAfterPost = !1, a._eventQueue.length > 0 && a._sendBeaconQueue());
1247
+ n ? (a._eventQueue = e.concat(a._eventQueue), a._failureCount += 1, q.info("Error sending beacon: " + n)) : a._failureCount = 0, a._roundTripTime = I.now() - r, a._postInFlight = !1, a._resendAfterPost && (a._resendAfterPost = !1, a._eventQueue.length > 0 && a._sendBeaconQueue());
1245
1248
  });
1246
1249
  };
1247
- G.prototype._getNextBeaconTime = function() {
1250
+ W.prototype._getNextBeaconTime = function() {
1248
1251
  if (!this._failureCount) return this._options.baseTimeBetweenBeacons;
1249
1252
  var a = Math.pow(2, this._failureCount - 1);
1250
1253
  return a = a * Math.random(), (1 + a) * this._options.baseTimeBetweenBeacons;
1251
1254
  };
1252
- G.prototype._startBeaconSending = function() {
1255
+ W.prototype._startBeaconSending = function() {
1253
1256
  var a = this;
1254
1257
  X.default.clearTimeout(this._sendTimeout), !this.destroyed && (this._sendTimeout = X.default.setTimeout(function() {
1255
1258
  a._eventQueue.length && a._sendBeaconQueue(), a._startBeaconSending();
1256
1259
  }, this._getNextBeaconTime()));
1257
1260
  };
1258
- G.prototype._createPayload = function(a) {
1259
- var e = this, t = { transmission_timestamp: Math.round(P.now()) };
1261
+ W.prototype._createPayload = function(a) {
1262
+ var e = this, t = { transmission_timestamp: Math.round(I.now()) };
1260
1263
  this._roundTripTime && (t.rtt_ms = Math.round(this._roundTripTime));
1261
- var r, i, n, o = function() {
1264
+ var r, i, n, s = function() {
1262
1265
  r = JSON.stringify({ metadata: t, events: i || a }), n = r.length / 1024;
1263
1266
  }, u = function() {
1264
1267
  return n <= e._options.maxPayloadKBSize;
1265
1268
  };
1266
- return o(), u() || (q.info("Payload size is too big (" + n + " kb). Removing unnecessary events."), i = a.filter(function(d) {
1269
+ return s(), u() || (q.info("Payload size is too big (" + n + " kb). Removing unnecessary events."), i = a.filter(function(d) {
1267
1270
  return Ga.indexOf(d.e) === -1;
1268
- }), o()), u() || (q.info("Payload size still too big (" + n + " kb). Cropping fields.."), i.forEach(function(d) {
1269
- for (var c in d) {
1270
- var v = d[c], b = 50 * 1024;
1271
- typeof v == "string" && v.length > b && (d[c] = v.substring(0, b));
1271
+ }), s()), u() || (q.info("Payload size still too big (" + n + " kb). Cropping fields.."), i.forEach(function(d) {
1272
+ for (var l in d) {
1273
+ var m = d[l], b = 50 * 1024;
1274
+ typeof m == "string" && m.length > b && (d[l] = m.substring(0, b));
1272
1275
  }
1273
- }), o()), r;
1276
+ }), s()), r;
1274
1277
  };
1275
- var Ja = typeof Fa.default.exitPictureInPicture == "function" ? function(a) {
1276
- return a.length <= Qa;
1278
+ var Wa = typeof Ma.default.exitPictureInPicture == "function" ? function(a) {
1279
+ return a.length <= Fa;
1277
1280
  } : function(a) {
1278
1281
  return !1;
1279
1282
  }, ut = function(a, e, t, r) {
@@ -1282,7 +1285,7 @@ var Ja = typeof Fa.default.exitPictureInPicture == "function" ? function(a) {
1282
1285
  return;
1283
1286
  }
1284
1287
  if (X.default.fetch) {
1285
- X.default.fetch(a, { method: "POST", body: e, headers: { "Content-Type": "text/plain" }, keepalive: Ja(e) }).then(function(n) {
1288
+ X.default.fetch(a, { method: "POST", body: e, headers: { "Content-Type": "text/plain" }, keepalive: Wa(e) }).then(function(n) {
1286
1289
  return r(null, n.ok ? null : "Error");
1287
1290
  }).catch(function(n) {
1288
1291
  return r(null, n);
@@ -1297,188 +1300,241 @@ var Ja = typeof Fa.default.exitPictureInPicture == "function" ? function(a) {
1297
1300
  return;
1298
1301
  }
1299
1302
  r();
1300
- }, za = G, Ka = ["env_key", "view_id", "view_sequence_number", "player_sequence_number", "beacon_domain", "player_playhead_time", "viewer_time", "mux_api_version", "event", "video_id", "player_instance_id", "player_error_code", "player_error_message", "player_error_context", "player_error_severity", "player_error_business_exception"], Ya = ["adplay", "adplaying", "adpause", "adfirstquartile", "admidpoint", "adthirdquartile", "adended", "adresponse", "adrequest"], Xa = ["ad_id", "ad_creative_id", "ad_universal_id"], Za = ["viewstart", "error", "ended", "viewend"], $a = 600 * 1e3, er = (function() {
1303
+ }, Va = W, Ja = ["env_key", "view_id", "view_sequence_number", "player_sequence_number", "beacon_domain", "player_playhead_time", "viewer_time", "mux_api_version", "event", "video_id", "player_instance_id", "player_error_code", "player_error_message", "player_error_context", "player_error_severity", "player_error_business_exception", "view_playing_time_ms_cumulative", "ad_playing_time_ms_cumulative"], za = ["adplay", "adplaying", "adpause", "adfirstquartile", "admidpoint", "adthirdquartile", "adended", "adresponse", "adrequest"], Ka = ["ad_id", "ad_creative_id", "ad_universal_id"], Ya = ["viewstart", "error", "ended", "viewend"], Xa = 600 * 1e3, Za = (function() {
1301
1304
  function a(e, t) {
1302
1305
  var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
1303
- I(this, a);
1304
- var i, n, o, u, d, c, v, b, l, s, _, y;
1305
- m(this, "mux", void 0), m(this, "envKey", void 0), m(this, "options", void 0), m(this, "eventQueue", void 0), m(this, "sampleRate", void 0), m(this, "disableCookies", void 0), m(this, "respectDoNotTrack", void 0), m(this, "previousBeaconData", void 0), m(this, "lastEventTime", void 0), m(this, "rateLimited", void 0), m(this, "pageLevelData", void 0), m(this, "viewerData", void 0), this.mux = e, this.envKey = t, this.options = r, this.previousBeaconData = null, this.lastEventTime = 0, this.rateLimited = !1, this.eventQueue = new za(Ca(this.envKey, this.options));
1306
+ P(this, a);
1307
+ var i, n, s, u, d, l, m, b, c, o, p, y;
1308
+ v(this, "mux", void 0), v(this, "envKey", void 0), v(this, "options", void 0), v(this, "eventQueue", void 0), v(this, "sampleRate", void 0), v(this, "disableCookies", void 0), v(this, "respectDoNotTrack", void 0), v(this, "previousBeaconData", void 0), v(this, "lastEventTime", void 0), v(this, "rateLimited", void 0), v(this, "pageLevelData", void 0), v(this, "viewerData", void 0), this.mux = e, this.envKey = t, this.options = r, this.previousBeaconData = null, this.lastEventTime = 0, this.rateLimited = !1, this.eventQueue = new Va(Ia(this.envKey, this.options));
1306
1309
  var f;
1307
1310
  this.sampleRate = (f = this.options.sampleRate) !== null && f !== void 0 ? f : 1;
1308
1311
  var g;
1309
1312
  this.disableCookies = (g = this.options.disableCookies) !== null && g !== void 0 ? g : !1;
1310
- var p;
1311
- this.respectDoNotTrack = (p = this.options.respectDoNotTrack) !== null && p !== void 0 ? p : !1, this.previousBeaconData = null, this.lastEventTime = 0, this.rateLimited = !1, this.pageLevelData = { mux_api_version: this.mux.API_VERSION, mux_embed: this.mux.NAME, mux_embed_version: this.mux.VERSION, viewer_application_name: (i = this.options.platform) === null || i === void 0 ? void 0 : i.name, viewer_application_version: (n = this.options.platform) === null || n === void 0 ? void 0 : n.version, viewer_application_engine: (o = this.options.platform) === null || o === void 0 ? void 0 : o.layout, viewer_device_name: (u = this.options.platform) === null || u === void 0 ? void 0 : u.product, viewer_device_category: "", viewer_device_manufacturer: (d = this.options.platform) === null || d === void 0 ? void 0 : d.manufacturer, viewer_os_family: (v = this.options.platform) === null || v === void 0 || (c = v.os) === null || c === void 0 ? void 0 : c.family, viewer_os_architecture: (l = this.options.platform) === null || l === void 0 || (b = l.os) === null || b === void 0 ? void 0 : b.architecture, viewer_os_version: (_ = this.options.platform) === null || _ === void 0 || (s = _.os) === null || s === void 0 ? void 0 : s.version, viewer_connection_type: Ha(), page_url: Ee.default === null || Ee.default === void 0 || (y = Ee.default.location) === null || y === void 0 ? void 0 : y.href }, this.viewerData = this.disableCookies ? {} : Ia();
1313
+ var _;
1314
+ this.respectDoNotTrack = (_ = this.options.respectDoNotTrack) !== null && _ !== void 0 ? _ : !1, this.previousBeaconData = null, this.lastEventTime = 0, this.rateLimited = !1, this.pageLevelData = { mux_api_version: this.mux.API_VERSION, mux_embed: this.mux.NAME, mux_embed_version: this.mux.VERSION, viewer_application_name: (i = this.options.platform) === null || i === void 0 ? void 0 : i.name, viewer_application_version: (n = this.options.platform) === null || n === void 0 ? void 0 : n.version, viewer_application_engine: (s = this.options.platform) === null || s === void 0 ? void 0 : s.layout, viewer_device_name: (u = this.options.platform) === null || u === void 0 ? void 0 : u.product, viewer_device_category: "", viewer_device_manufacturer: (d = this.options.platform) === null || d === void 0 ? void 0 : d.manufacturer, viewer_os_family: (m = this.options.platform) === null || m === void 0 || (l = m.os) === null || l === void 0 ? void 0 : l.family, viewer_os_architecture: (c = this.options.platform) === null || c === void 0 || (b = c.os) === null || b === void 0 ? void 0 : b.architecture, viewer_os_version: (p = this.options.platform) === null || p === void 0 || (o = p.os) === null || o === void 0 ? void 0 : o.version, viewer_connection_type: Ca(), page_url: Ee.default === null || Ee.default === void 0 || (y = Ee.default.location) === null || y === void 0 ? void 0 : y.href }, this.viewerData = this.disableCookies ? {} : Pa();
1312
1315
  }
1313
- return W(a, [{ key: "send", value: function(e, t) {
1316
+ return U(a, [{ key: "send", value: function(e, t) {
1314
1317
  if (!(!e || !(t != null && t.view_id))) {
1315
1318
  if (this.respectDoNotTrack && qe()) return q.info("Not sending `" + e + "` because Do Not Track is enabled");
1316
1319
  if (!t || typeof t != "object") return q.error("A data object was expected in send() but was not provided");
1317
- var r = this.disableCookies ? {} : Na(), i = Oe(fe({}, this.pageLevelData, t, r, this.viewerData), { event: e, env_key: this.envKey });
1320
+ var r = this.disableCookies ? {} : La(), i = Oe(fe({}, this.pageLevelData, t, r, this.viewerData), { event: e, env_key: this.envKey });
1318
1321
  i.user_id && (i.viewer_user_id = i.user_id, delete i.user_id);
1319
- var n, o = ((n = i.mux_sample_number) !== null && n !== void 0 ? n : 0) >= this.sampleRate, u = this._deduplicateBeaconData(e, i), d = Se(u);
1320
- if (this.lastEventTime = this.mux.utils.now(), o) return q.info("Not sending event due to sample rate restriction", e, i, d);
1321
- if (this.envKey || q.info("Missing environment key (envKey) - beacons will be dropped if the video source is not a valid mux video URL", e, i, d), !this.rateLimited) {
1322
- if (q.info("Sending event", e, i, d), this.rateLimited = !this.eventQueue.queueEvent(e, d), this.mux.WINDOW_UNLOADING && e === "viewend") this.eventQueue.destroy(!0);
1323
- else if (this.mux.WINDOW_HIDDEN && e === "hb" ? this.eventQueue.flushEvents(!0) : Za.indexOf(e) >= 0 && this.eventQueue.flushEvents(), this.rateLimited) return i.event = "eventrateexceeded", d = Se(i), this.eventQueue.queueEvent(i.event, d), q.error("Beaconing disabled due to rate limit.");
1322
+ var n, s = ((n = i.mux_sample_number) !== null && n !== void 0 ? n : 0) >= this.sampleRate, u = this._deduplicateBeaconData(e, i), d = Se(u);
1323
+ if (this.lastEventTime = this.mux.utils.now(), s) return q.info("Not sending event due to sample rate restriction", e, i, d);
1324
+ if (this.envKey || q.info("Missing environment key (envKey) - beacons will be dropped if the video source is not a valid mux video URL", e, i, d), !this.rateLimited) if (q.info("Sending event", e, i, d), this.rateLimited = !this.eventQueue.queueEvent(e, d), this.mux.WINDOW_UNLOADING && e === "viewend") this.eventQueue.destroy(!0);
1325
+ else {
1326
+ if (this.mux.WINDOW_HIDDEN && e === "hb") this.eventQueue.flushEvents(!0);
1327
+ else if (Ya.indexOf(e) >= 0) {
1328
+ if (e === "error" && t.player_error_severity === "warning") return;
1329
+ this.eventQueue.flushEvents();
1330
+ }
1331
+ if (this.rateLimited) return i.event = "eventrateexceeded", d = Se(i), this.eventQueue.queueEvent(i.event, d), q.error("Beaconing disabled due to rate limit.");
1324
1332
  }
1325
1333
  }
1326
1334
  } }, { key: "destroy", value: function() {
1327
1335
  this.eventQueue.destroy(!1);
1328
1336
  } }, { key: "_deduplicateBeaconData", value: function(e, t) {
1329
1337
  var r = this, i = {}, n = t.view_id;
1330
- if (n === "-1" || e === "viewstart" || e === "viewend" || !this.previousBeaconData || this.mux.utils.now() - this.lastEventTime >= $a) i = fe({}, t), n && (this.previousBeaconData = i), n && e === "viewend" && (this.previousBeaconData = null);
1338
+ if (n === "-1" || e === "viewstart" || e === "viewend" || !this.previousBeaconData || this.mux.utils.now() - this.lastEventTime >= Xa) i = fe({}, t), n && (this.previousBeaconData = i), n && e === "viewend" && (this.previousBeaconData = null);
1331
1339
  else {
1332
- var o = e.indexOf("request") === 0;
1340
+ var s = e.indexOf("request") === 0;
1333
1341
  Object.entries(t).forEach(function(u) {
1334
- var d = Q(u, 2), c = d[0], v = d[1];
1335
- r.previousBeaconData && (v !== r.previousBeaconData[c] || Ka.indexOf(c) > -1 || r.objectHasChanged(o, c, v, r.previousBeaconData[c]) || r.eventRequiresKey(e, c)) && (i[c] = v, r.previousBeaconData[c] = v);
1342
+ var d = Q(u, 2), l = d[0], m = d[1];
1343
+ r.previousBeaconData && (m !== r.previousBeaconData[l] || Ja.indexOf(l) > -1 || r.objectHasChanged(s, l, m, r.previousBeaconData[l]) || r.eventRequiresKey(e, l)) && (i[l] = m, r.previousBeaconData[l] = m);
1336
1344
  });
1337
1345
  }
1338
1346
  return i;
1339
1347
  } }, { key: "objectHasChanged", value: function(e, t, r, i) {
1340
1348
  return !e || t.indexOf("request_") !== 0 ? !1 : t === "request_response_headers" || typeof r != "object" || typeof i != "object" ? !0 : Object.keys(r || {}).length !== Object.keys(i || {}).length;
1341
1349
  } }, { key: "eventRequiresKey", value: function(e, t) {
1342
- return !!(e === "renditionchange" && t.indexOf("video_source_") === 0 || Xa.includes(t) && Ya.includes(e));
1350
+ return !!(e === "renditionchange" && t.indexOf("video_source_") === 0 || Ka.includes(t) && za.includes(e) || e === "playbackmodechange" && t.indexOf("player_playback_mode") === 0);
1343
1351
  } }]), a;
1344
- })(), tr = function a(e) {
1345
- I(this, a);
1346
- var t = 0, r = 0, i = 0, n = 0, o = 0, u = 0, d = 0, c = function(l, s) {
1347
- var _ = s.request_start, y = s.request_response_start, f = s.request_response_end, g = s.request_bytes_loaded;
1352
+ })(), $a = function a(e) {
1353
+ P(this, a);
1354
+ var t = 0, r = 0, i = 0, n = 0, s = 0, u = 0, d = 0, l = function(c, o) {
1355
+ var p = o.request_start, y = o.request_response_start, f = o.request_response_end, g = o.request_bytes_loaded;
1348
1356
  n++;
1349
- var p, h;
1350
- if (y ? (p = y - (_ ?? 0), h = (f ?? 0) - y) : h = (f ?? 0) - (_ ?? 0), h > 0 && g && g > 0) {
1357
+ var _, h;
1358
+ if (y ? (_ = y - (p ?? 0), h = (f ?? 0) - y) : h = (f ?? 0) - (p ?? 0), h > 0 && g && g > 0) {
1351
1359
  var w = g / h * 8e3;
1352
- o++, r += g, i += h, e.data.view_min_request_throughput = Math.min(e.data.view_min_request_throughput || 1 / 0, w), e.data.view_average_request_throughput = r / i * 8e3, e.data.view_request_count = n, p > 0 && (t += p, e.data.view_max_request_latency = Math.max(e.data.view_max_request_latency || 0, p), e.data.view_average_request_latency = t / o);
1360
+ s++, r += g, i += h, e.data.view_min_request_throughput = Math.min(e.data.view_min_request_throughput || 1 / 0, w), e.data.view_average_request_throughput = r / i * 8e3, e.data.view_request_count = n, _ > 0 && (t += _, e.data.view_max_request_latency = Math.max(e.data.view_max_request_latency || 0, _), e.data.view_average_request_latency = t / s);
1353
1361
  }
1354
- }, v = function(l, s) {
1362
+ }, m = function(c, o) {
1355
1363
  n++, u++, e.data.view_request_count = n, e.data.view_request_failed_count = u;
1356
- }, b = function(l, s) {
1364
+ }, b = function(c, o) {
1357
1365
  n++, d++, e.data.view_request_count = n, e.data.view_request_canceled_count = d;
1358
1366
  };
1359
- e.on("requestcompleted", c), e.on("requestfailed", v), e.on("requestcanceled", b);
1360
- }, ar = tr, rr = 3600 * 1e3, ir = function a(e) {
1367
+ e.on("requestcompleted", l), e.on("requestfailed", m), e.on("requestcanceled", b);
1368
+ }, ei = $a, ti = 3600 * 1e3, ai = function a(e) {
1361
1369
  var t = this;
1362
- I(this, a), m(this, "_lastEventTime", void 0), e.on("before*", function(r, i) {
1363
- var n = i.viewer_time, o = P.now(), u = t._lastEventTime;
1364
- if (t._lastEventTime = o, u && o - u > rr) {
1365
- var d = Object.keys(e.data).reduce(function(v, b) {
1366
- return b.indexOf("video_") === 0 ? Object.assign(v, m({}, b, e.data[b])) : v;
1370
+ P(this, a), v(this, "_lastEventTime", void 0), e.on("before*", function(r, i) {
1371
+ var n = i.viewer_time, s = I.now(), u = t._lastEventTime;
1372
+ if (t._lastEventTime = s, u && s - u > ti) {
1373
+ var d = Object.keys(e.data).reduce(function(m, b) {
1374
+ return b.indexOf("video_") === 0 ? Object.assign(m, v({}, b, e.data[b])) : m;
1367
1375
  }, {});
1368
1376
  e.mux.log.info("Received event after at least an hour inactivity, creating a new view");
1369
- var c = e.playbackHeartbeat._playheadShouldBeProgressing;
1370
- e._resetView(Object.assign({ viewer_time: n }, d)), e.playbackHeartbeat._playheadShouldBeProgressing = c, e.playbackHeartbeat._playheadShouldBeProgressing && r.type !== "play" && r.type !== "adbreakstart" && (e.emit("play", { viewer_time: n }), r.type !== "playing" && e.emit("playing", { viewer_time: n }));
1377
+ var l = e.playbackHeartbeat._playheadShouldBeProgressing;
1378
+ e._resetView(Object.assign({ viewer_time: n }, d)), e.playbackHeartbeat._playheadShouldBeProgressing = l, e.playbackHeartbeat._playheadShouldBeProgressing && r.type !== "play" && r.type !== "adbreakstart" && (e.emit("play", { viewer_time: n }), r.type !== "playing" && e.emit("playing", { viewer_time: n }));
1371
1379
  }
1372
1380
  });
1373
- }, nr = ir, or = function a(e) {
1374
- I(this, a);
1381
+ }, ii = ai, ri = function a(e) {
1382
+ P(this, a);
1375
1383
  var t = function(u) {
1376
- var d = sr(u), c = ur(u);
1377
- if (d != null && !Be(d, n) && o <= c) {
1378
- n = d, o = c;
1379
- var v = { video_cdn: d };
1380
- e.emit("cdnchange", v);
1384
+ var d = ni(u), l = si(u);
1385
+ if (d != null && !Me(d, n) && s <= l) {
1386
+ n = d, s = l;
1387
+ var m = { video_cdn: d };
1388
+ e.emit("cdnchange", m);
1381
1389
  }
1382
- }, r = null, i = null, n = null, o = 0;
1390
+ }, r = null, i = null, n = null, s = 0;
1383
1391
  e.on("viewinit", function() {
1384
- r = null, i = null, n = null, o = 0;
1392
+ r = null, i = null, n = null, s = 0;
1385
1393
  }), e.on("beforecdnchange", function(u, d) {
1386
- var c = d?.video_cdn;
1387
- c && (typeof d.video_previous_cdn > "u" || d.video_previous_cdn === null) && (Be(c, i) ? d.video_previous_cdn = r ?? void 0 : (d.video_previous_cdn = i ?? void 0, r = i, i = c));
1394
+ var l = d?.video_cdn;
1395
+ l && (typeof d.video_previous_cdn > "u" || d.video_previous_cdn === null) && (Me(l, i) ? d.video_previous_cdn = r ?? void 0 : (d.video_previous_cdn = i ?? void 0, r = i, i = l));
1388
1396
  }), e.on("requestcompleted", function(u, d) {
1389
1397
  t(d);
1390
1398
  });
1391
1399
  };
1392
- function Be(a, e) {
1400
+ function Me(a, e) {
1393
1401
  return a?.toLowerCase() === e?.toLowerCase();
1394
1402
  }
1395
- function sr(a) {
1403
+ function ni(a) {
1396
1404
  var e;
1397
1405
  return a != null && a.request_type && (a.request_type === "media" || a.request_type === "video") && !((e = a.request_response_headers) === null || e === void 0) && e["x-cdn"] ? a.request_response_headers["x-cdn"] : a != null && a.video_cdn ? a.video_cdn : null;
1398
1406
  }
1399
- function ur(a) {
1407
+ function si(a) {
1400
1408
  return a != null && a.request_start ? a.request_start : a != null && a.viewer_time ? a.viewer_time : Date.now();
1401
1409
  }
1402
- var dr = or, lr = ["viewstart", "ended", "loadstart", "pause", "play", "playing", "ratechange", "waiting", "adplay", "adpause", "adended", "aderror", "adplaying", "adrequest", "adresponse", "adbreakstart", "adbreakend", "adfirstquartile", "admidpoint", "adthirdquartile", "rebufferstart", "rebufferend", "seeked", "error", "hb", "requestcompleted", "requestfailed", "requestcanceled", "renditionchange", "cdnchange"], cr = /* @__PURE__ */ new Set(["requestcompleted", "requestfailed", "requestcanceled"]), _r = (function(a) {
1410
+ var oi = ri, ui = function(a) {
1411
+ try {
1412
+ return JSON.parse(a), !0;
1413
+ } catch {
1414
+ return !1;
1415
+ }
1416
+ }, di = function a(e) {
1417
+ var t = this;
1418
+ P(this, a), v(this, "_emittingAutomaticEvent", !1), v(this, "_hasInitialized", !1), v(this, "_currentMode", "standard"), e.on("viewstart", function() {
1419
+ t._hasInitialized || (t._hasInitialized = !0, t._currentMode = e.data.player_playback_mode || "standard", t._emittingAutomaticEvent = !0, e.emit("playbackmodechange", { player_playback_mode: t._currentMode, player_playback_mode_data: "{}" }), t._emittingAutomaticEvent = !1);
1420
+ }), e.on("viewend", function() {
1421
+ t._hasInitialized = !1;
1422
+ }), e.on("playbackmodechange", function(r, i) {
1423
+ t._emittingAutomaticEvent || (i.player_playback_mode_data ? ui(i.player_playback_mode_data) || (e.mux.log.warn("Invalid JSON string for player_playback_mode_data"), i.player_playback_mode_data = "{}") : i.player_playback_mode_data = "{}", e.data.player_playback_mode_data = i.player_playback_mode_data, e.data.player_playback_mode = i.player_playback_mode, t._currentMode = i.player_playback_mode);
1424
+ });
1425
+ }, li = di, ci = (function() {
1426
+ function a(e) {
1427
+ P(this, a), v(this, "pm", void 0), v(this, "_currentRangeStart", void 0), v(this, "_lastPlayheadTime", void 0), this.pm = e, this._currentRangeStart = null, this._lastPlayheadTime = null, e.on("playbackheartbeat", this._updatePlaybackRange.bind(this)), e.on("playbackheartbeatend", this._endPlaybackRange.bind(this));
1428
+ }
1429
+ return U(a, [{ key: "_updateLastRangeEnd", value: function() {
1430
+ var e = this.pm.data.video_playback_ranges;
1431
+ if (e && e.length > 0) {
1432
+ var t = this.pm.data.player_playhead_time || 0;
1433
+ e[e.length - 1][1] = t;
1434
+ }
1435
+ } }, { key: "_updatePlaybackRange", value: function() {
1436
+ var e, t = this.pm.data.player_playhead_time || 0;
1437
+ if (!(!this.pm.disableAdPlaybackRangeFiltering && !((e = this.pm.adTracker) === null || e === void 0) && e.isAdBreak && this._lastPlayheadTime !== null && t < this._lastPlayheadTime)) {
1438
+ if (this._lastPlayheadTime !== null && this._currentRangeStart !== null) {
1439
+ var r = Math.abs(t - this._lastPlayheadTime);
1440
+ if (r > 1e3) {
1441
+ var i = this.pm.data.video_playback_ranges;
1442
+ i && i.length > 0 && (i[i.length - 1][1] = this._lastPlayheadTime), this._currentRangeStart = null;
1443
+ }
1444
+ }
1445
+ if (this._currentRangeStart === null) {
1446
+ var n = this.pm.data.video_playback_ranges || [];
1447
+ n.length > 0 && n[n.length - 1][1] === t ? this._currentRangeStart = n[n.length - 1][0] : (this._currentRangeStart = t, n.push([t, t])), this.pm.data.video_playback_ranges = n;
1448
+ } else this._updateLastRangeEnd();
1449
+ this._lastPlayheadTime = t;
1450
+ }
1451
+ } }, { key: "_endPlaybackRange", value: function() {
1452
+ this._currentRangeStart !== null && (this._updateLastRangeEnd(), this._currentRangeStart = null, this._lastPlayheadTime = null);
1453
+ } }]), a;
1454
+ })(), pi = ci, _i = ["viewstart", "ended", "loadstart", "pause", "play", "playing", "ratechange", "waiting", "adplay", "adpause", "adended", "aderror", "adplaying", "adrequest", "adresponse", "adbreakstart", "adbreakend", "adfirstquartile", "admidpoint", "adthirdquartile", "rebufferstart", "rebufferend", "seeked", "error", "hb", "requestcompleted", "requestfailed", "requestcanceled", "renditionchange", "cdnchange", "playbackmodechange"], hi = /* @__PURE__ */ new Set(["requestcompleted", "requestfailed", "requestcanceled"]), fi = (function(a) {
1403
1455
  Ht(t, a);
1404
- var e = Wt(t);
1456
+ var e = Gt(t);
1405
1457
  function t(r, i, n) {
1406
- I(this, t);
1407
- var o;
1408
- o = e.call(this), m(T(o), "pageLoadEndTime", void 0), m(T(o), "pageLoadInitTime", void 0), m(T(o), "_destroyed", void 0), m(T(o), "_heartBeatTimeout", void 0), m(T(o), "adTracker", void 0), m(T(o), "dashjs", void 0), m(T(o), "data", void 0), m(T(o), "disablePlayheadRebufferTracking", void 0), m(T(o), "disableRebufferTracking", void 0), m(T(o), "errorTracker", void 0), m(T(o), "errorTranslator", void 0), m(T(o), "emitTranslator", void 0), m(T(o), "getAdData", void 0), m(T(o), "getPlayheadTime", void 0), m(T(o), "getStateData", void 0), m(T(o), "stateDataTranslator", void 0), m(T(o), "hlsjs", void 0), m(T(o), "id", void 0), m(T(o), "longResumeTracker", void 0), m(T(o), "minimumRebufferDuration", void 0), m(T(o), "mux", void 0), m(T(o), "playbackEventDispatcher", void 0), m(T(o), "playbackHeartbeat", void 0), m(T(o), "playbackHeartbeatTime", void 0), m(T(o), "playheadTime", void 0), m(T(o), "seekingTracker", void 0), m(T(o), "sustainedRebufferThreshold", void 0), m(T(o), "watchTimeTracker", void 0), m(T(o), "currentFragmentPDT", void 0), m(T(o), "currentFragmentStart", void 0), o.pageLoadInitTime = pe.navigationStart(), o.pageLoadEndTime = pe.domContentLoadedEventEnd();
1409
- var u = { debug: !1, minimumRebufferDuration: 250, sustainedRebufferThreshold: 1e3, playbackHeartbeatTime: 25, beaconDomain: "litix.io", sampleRate: 1, disableCookies: !1, respectDoNotTrack: !1, disableRebufferTracking: !1, disablePlayheadRebufferTracking: !1, errorTranslator: function(l) {
1410
- return l;
1458
+ P(this, t);
1459
+ var s;
1460
+ s = e.call(this), v(T(s), "pageLoadEndTime", void 0), v(T(s), "pageLoadInitTime", void 0), v(T(s), "_destroyed", void 0), v(T(s), "_heartBeatTimeout", void 0), v(T(s), "adTracker", void 0), v(T(s), "dashjs", void 0), v(T(s), "data", void 0), v(T(s), "disablePlayheadRebufferTracking", void 0), v(T(s), "disableRebufferTracking", void 0), v(T(s), "disableAdPlaybackRangeFiltering", void 0), v(T(s), "errorTracker", void 0), v(T(s), "errorTranslator", void 0), v(T(s), "emitTranslator", void 0), v(T(s), "getAdData", void 0), v(T(s), "getPlayheadTime", void 0), v(T(s), "getStateData", void 0), v(T(s), "stateDataTranslator", void 0), v(T(s), "hlsjs", void 0), v(T(s), "id", void 0), v(T(s), "longResumeTracker", void 0), v(T(s), "minimumRebufferDuration", void 0), v(T(s), "mux", void 0), v(T(s), "playbackEventDispatcher", void 0), v(T(s), "playbackHeartbeat", void 0), v(T(s), "playbackHeartbeatTime", void 0), v(T(s), "playheadTime", void 0), v(T(s), "seekingTracker", void 0), v(T(s), "sustainedRebufferThreshold", void 0), v(T(s), "watchTimeTracker", void 0), v(T(s), "currentFragmentPDT", void 0), v(T(s), "currentFragmentStart", void 0), s.pageLoadInitTime = he.navigationStart(), s.pageLoadEndTime = he.domContentLoadedEventEnd();
1461
+ var u = { debug: !1, minimumRebufferDuration: 250, sustainedRebufferThreshold: 1e3, playbackHeartbeatTime: 25, beaconDomain: "litix.io", sampleRate: 1, disableCookies: !1, respectDoNotTrack: !1, disableRebufferTracking: !1, disablePlayheadRebufferTracking: !1, disableAdPlaybackRangeFiltering: !1, errorTranslator: function(c) {
1462
+ return c;
1411
1463
  }, emitTranslator: function() {
1412
- for (var l = arguments.length, s = new Array(l), _ = 0; _ < l; _++) s[_] = arguments[_];
1413
- return s;
1414
- }, stateDataTranslator: function(l) {
1415
- return l;
1464
+ for (var c = arguments.length, o = new Array(c), p = 0; p < c; p++) o[p] = arguments[p];
1465
+ return o;
1466
+ }, stateDataTranslator: function(c) {
1467
+ return c;
1416
1468
  } };
1417
- o.mux = r, o.id = i, n != null && n.beaconDomain && o.mux.log.warn("The `beaconDomain` setting has been deprecated in favor of `beaconCollectionDomain`. Please change your integration to use `beaconCollectionDomain` instead of `beaconDomain`."), n = Object.assign(u, n), n.data = n.data || {}, n.data.property_key && (n.data.env_key = n.data.property_key, delete n.data.property_key), q.level = n.debug ? Y.DEBUG : Y.WARN, o.getPlayheadTime = n.getPlayheadTime, o.getStateData = n.getStateData || function() {
1469
+ s.mux = r, s.id = i, n != null && n.beaconDomain && s.mux.log.warn("The `beaconDomain` setting has been deprecated in favor of `beaconCollectionDomain`. Please change your integration to use `beaconCollectionDomain` instead of `beaconDomain`."), n = Object.assign(u, n), n.data = n.data || {}, n.data.property_key && (n.data.env_key = n.data.property_key, delete n.data.property_key), q.level = n.debug ? Y.DEBUG : Y.WARN, s.getPlayheadTime = n.getPlayheadTime, s.getStateData = n.getStateData || function() {
1418
1470
  return {};
1419
- }, o.getAdData = n.getAdData || function() {
1420
- }, o.minimumRebufferDuration = n.minimumRebufferDuration, o.sustainedRebufferThreshold = n.sustainedRebufferThreshold, o.playbackHeartbeatTime = n.playbackHeartbeatTime, o.disableRebufferTracking = n.disableRebufferTracking, o.disableRebufferTracking && o.mux.log.warn("Disabling rebuffer tracking. This should only be used in specific circumstances as a last resort when your player is known to unreliably track rebuffering."), o.disablePlayheadRebufferTracking = n.disablePlayheadRebufferTracking, o.errorTranslator = n.errorTranslator, o.emitTranslator = n.emitTranslator, o.stateDataTranslator = n.stateDataTranslator, o.playbackEventDispatcher = new er(r, n.data.env_key, n), o.data = { player_instance_id: de(), mux_sample_rate: n.sampleRate, beacon_domain: n.beaconCollectionDomain || n.beaconDomain }, o.data.view_sequence_number = 1, o.data.player_sequence_number = 1;
1471
+ }, s.getAdData = n.getAdData || function() {
1472
+ }, s.minimumRebufferDuration = n.minimumRebufferDuration, s.sustainedRebufferThreshold = n.sustainedRebufferThreshold, s.playbackHeartbeatTime = n.playbackHeartbeatTime, s.disableRebufferTracking = n.disableRebufferTracking, s.disableRebufferTracking && s.mux.log.warn("Disabling rebuffer tracking. This should only be used in specific circumstances as a last resort when your player is known to unreliably track rebuffering."), s.disablePlayheadRebufferTracking = n.disablePlayheadRebufferTracking, s.disableAdPlaybackRangeFiltering = n.disableAdPlaybackRangeFiltering, s.errorTranslator = n.errorTranslator, s.emitTranslator = n.emitTranslator, s.stateDataTranslator = n.stateDataTranslator, s.playbackEventDispatcher = new Za(r, n.data.env_key, n), s.data = { player_instance_id: de(), mux_sample_rate: n.sampleRate, beacon_domain: n.beaconCollectionDomain || n.beaconDomain }, s.data.view_sequence_number = 1, s.data.player_sequence_number = 1;
1421
1473
  var d = (function() {
1422
- typeof this.data.view_start > "u" && (this.data.view_start = this.mux.utils.now(), this.emit("viewstart"));
1423
- }).bind(T(o));
1424
- if (o.on("viewinit", function(l, s) {
1425
- this._resetVideoData(), this._resetViewData(), this._resetErrorData(), this._updateStateData(), Object.assign(this.data, s), this._initializeViewData(), this.one("play", d), this.one("adbreakstart", d);
1426
- }), o.on("videochange", function(l, s) {
1427
- this._resetView(s);
1428
- }), o.on("programchange", function(l, s) {
1429
- this.data.player_is_paused && this.mux.log.warn("The `programchange` event is intended to be used when the content changes mid playback without the video source changing, however the video is not currently playing. If the video source is changing please use the videochange event otherwise you will lose startup time information."), this._resetView(Object.assign(s, { view_program_changed: !0 })), d(), this.emit("play"), this.emit("playing");
1430
- }), o.on("fragmentchange", function(l, s) {
1431
- this.currentFragmentPDT = s.currentFragmentPDT, this.currentFragmentStart = s.currentFragmentStart;
1432
- }), o.on("destroy", o.destroy), typeof window < "u" && typeof window.addEventListener == "function" && typeof window.removeEventListener == "function") {
1433
- var c = function() {
1434
- var l = typeof o.data.view_start < "u";
1435
- o.mux.WINDOW_HIDDEN = document.visibilityState === "hidden", l && o.mux.WINDOW_HIDDEN && (o.data.player_is_paused || o.emit("hb"));
1474
+ typeof this.data.view_start > "u" && (this.data.view_start = this.mux.utils.now(), this.emit("viewstart"), this.emit("renditionchange"));
1475
+ }).bind(T(s));
1476
+ if (s.on("viewinit", function(c, o) {
1477
+ this._resetVideoData(), this._resetViewData(), this._resetErrorData(), this._updateStateData(), Object.assign(this.data, o), this._initializeViewData(), this.one("play", d), this.one("adbreakstart", d);
1478
+ }), s.on("videochange", function(c, o) {
1479
+ this._resetView(o);
1480
+ }), s.on("programchange", function(c, o) {
1481
+ this.data.player_is_paused && this.mux.log.warn("The `programchange` event is intended to be used when the content changes mid playback without the video source changing, however the video is not currently playing. If the video source is changing please use the videochange event otherwise you will lose startup time information."), this._resetView(Object.assign(o, { view_program_changed: !0 })), d(), this.emit("play"), this.emit("playing");
1482
+ }), s.on("fragmentchange", function(c, o) {
1483
+ this.currentFragmentPDT = o.currentFragmentPDT, this.currentFragmentStart = o.currentFragmentStart;
1484
+ }), s.on("destroy", s.destroy), typeof window < "u" && typeof window.addEventListener == "function" && typeof window.removeEventListener == "function") {
1485
+ var l = function() {
1486
+ var c = typeof s.data.view_start < "u";
1487
+ s.mux.WINDOW_HIDDEN = document.visibilityState === "hidden", c && s.mux.WINDOW_HIDDEN && (s.data.player_is_paused || s.emit("hb"));
1436
1488
  };
1437
- window.addEventListener("visibilitychange", c, !1);
1438
- var v = function(l) {
1439
- l.persisted || o.destroy();
1489
+ window.addEventListener("visibilitychange", l, !1);
1490
+ var m = function(c) {
1491
+ c.persisted || s.destroy();
1440
1492
  };
1441
- window.addEventListener("pagehide", v, !1), o.on("destroy", function() {
1442
- window.removeEventListener("visibilitychange", c), window.removeEventListener("pagehide", v);
1493
+ window.addEventListener("pagehide", m, !1), s.on("destroy", function() {
1494
+ window.removeEventListener("visibilitychange", l), window.removeEventListener("pagehide", m);
1443
1495
  });
1444
1496
  }
1445
- o.on("playerready", function(l, s) {
1446
- Object.assign(this.data, s);
1447
- }), lr.forEach(function(l) {
1448
- o.on(l, function(s, _) {
1449
- l.indexOf("ad") !== 0 && this._updateStateData(), Object.assign(this.data, _), this._sanitizeData();
1450
- }), o.on("after" + l, function() {
1451
- (l !== "error" || this.errorTracker.viewErrored) && this.send(l);
1497
+ s.on("playerready", function(c, o) {
1498
+ Object.assign(this.data, o);
1499
+ }), _i.forEach(function(c) {
1500
+ s.on(c, function(o, p) {
1501
+ c.indexOf("ad") !== 0 && this._updateStateData(), Object.assign(this.data, p), this._sanitizeData();
1502
+ }), s.on("after" + c, function() {
1503
+ (c !== "error" || this.errorTracker.viewErrored) && this.send(c);
1452
1504
  });
1453
- }), o.on("viewend", function(l, s) {
1454
- Object.assign(o.data, s);
1505
+ }), s.on("viewend", function(c, o) {
1506
+ Object.assign(s.data, o);
1455
1507
  });
1456
- var b = function(l) {
1457
- var s = this.mux.utils.now();
1458
- this.data.player_init_time && (this.data.player_startup_time = s - this.data.player_init_time), this.pageLoadInitTime = this.data.page_load_init_time || this.pageLoadInitTime, this.pageLoadEndTime = this.data.page_load_end_time || this.pageLoadEndTime, !this.mux.PLAYER_TRACKED && this.pageLoadInitTime && (this.mux.PLAYER_TRACKED = !0, (this.data.player_init_time || this.pageLoadEndTime) && (this.data.page_load_time = Math.min(this.data.player_init_time || 1 / 0, this.pageLoadEndTime || 1 / 0) - this.pageLoadInitTime)), this.send("playerready"), delete this.data.player_startup_time, delete this.data.page_load_time;
1508
+ var b = function(c) {
1509
+ var o = this.mux.utils.now();
1510
+ this.data.player_init_time && (this.data.player_startup_time = o - this.data.player_init_time), this.pageLoadInitTime = this.data.page_load_init_time || this.pageLoadInitTime, this.pageLoadEndTime = this.data.page_load_end_time || this.pageLoadEndTime, !this.mux.PLAYER_TRACKED && this.pageLoadInitTime && (this.mux.PLAYER_TRACKED = !0, (this.data.player_init_time || this.pageLoadEndTime) && (this.data.page_load_time = Math.min(this.data.player_init_time || 1 / 0, this.pageLoadEndTime || 1 / 0) - this.pageLoadInitTime)), this.send("playerready"), delete this.data.player_startup_time, delete this.data.page_load_time;
1459
1511
  };
1460
- return o.one("playerready", b), o.longResumeTracker = new nr(T(o)), o.errorTracker = new sa(T(o)), new Aa(T(o)), o.seekingTracker = new Ea(T(o)), o.playheadTime = new ha(T(o)), o.playbackHeartbeat = new na(T(o)), new wa(T(o)), o.watchTimeTracker = new da(T(o)), new ca(T(o)), o.adTracker = new qa(T(o)), new ma(T(o)), new fa(T(o)), new ga(T(o)), new Sa(T(o)), new ar(T(o)), new dr(T(o)), n.hlsjs && o.addHLSJS(n), n.dashjs && o.addDashJS(n), o.emit("viewinit", n.data), o;
1512
+ return s.one("playerready", b), s.longResumeTracker = new ii(T(s)), s.errorTracker = new oa(T(s)), new Aa(T(s)), s.seekingTracker = new Ea(T(s)), s.playheadTime = new _a(T(s)), s.playbackHeartbeat = new na(T(s)), new wa(T(s)), s.watchTimeTracker = new da(T(s)), new ca(T(s)), new pi(T(s)), s.adTracker = new Ra(T(s)), new ma(T(s)), new fa(T(s)), new ga(T(s)), new ei(T(s)), new oi(T(s)), new li(T(s)), n.hlsjs && s.addHLSJS(n), n.dashjs && s.addDashJS(n), s.emit("viewinit", n.data), s;
1461
1513
  }
1462
- return W(t, [{ key: "emit", value: function(r, i) {
1463
- var n, o = Object.assign({ viewer_time: this.mux.utils.now() }, i), u = [r, o];
1514
+ return U(t, [{ key: "emit", value: function(r, i) {
1515
+ var n, s = Object.assign({ viewer_time: this.mux.utils.now() }, i), u = [r, s];
1464
1516
  if (this.emitTranslator) try {
1465
- u = this.emitTranslator(r, o);
1517
+ u = this.emitTranslator(r, s);
1466
1518
  } catch (d) {
1467
1519
  this.mux.log.warn("Exception in emit translator callback.", d);
1468
1520
  }
1469
- u != null && u.length && (n = _e(te(t.prototype), "emit", this)).call.apply(n, [this].concat(M(u)));
1521
+ u != null && u.length && (n = pe(te(t.prototype), "emit", this)).call.apply(n, [this].concat(B(u)));
1470
1522
  } }, { key: "destroy", value: function() {
1471
1523
  this._destroyed || (this._destroyed = !0, typeof this.data.view_start < "u" && (this.emit("viewend"), this.send("viewend")), this.playbackEventDispatcher.destroy(), this.removeHLSJS(), this.removeDashJS(), window.clearTimeout(this._heartBeatTimeout));
1472
1524
  } }, { key: "send", value: function(r) {
1473
1525
  if (this.data.view_id) {
1474
1526
  var i = Object.assign({}, this.data), n = ["player_program_time", "player_manifest_newest_program_time", "player_live_edge_program_time", "player_program_time", "video_holdback", "video_part_holdback", "video_target_duration", "video_part_target_duration"];
1475
- if (i.video_source_is_live === void 0 && (i.player_source_duration === 1 / 0 || i.video_source_duration === 1 / 0 ? i.video_source_is_live = !0 : (i.player_source_duration > 0 || i.video_source_duration > 0) && (i.video_source_is_live = !1)), i.video_source_is_live || n.forEach(function(c) {
1476
- i[c] = void 0;
1527
+ if (i.video_source_is_live === void 0 && (i.player_source_duration === 1 / 0 || i.video_source_duration === 1 / 0 ? i.video_source_is_live = !0 : (i.player_source_duration > 0 || i.video_source_duration > 0) && (i.video_source_is_live = !1)), i.video_source_is_live || n.forEach(function(l) {
1528
+ i[l] = void 0;
1477
1529
  }), i.video_source_url = i.video_source_url || i.player_source_url, i.video_source_url) {
1478
- var o = Q(le(i.video_source_url), 2), u = o[0], d = o[1];
1530
+ var s = Q(le(i.video_source_url), 2), u = s[0], d = s[1];
1479
1531
  i.video_source_domain = d, i.video_source_hostname = u;
1480
1532
  }
1481
- delete i.ad_request_id, this.playbackEventDispatcher.send(r, i), this.data.view_sequence_number++, this.data.player_sequence_number++, cr.has(r) || this._restartHeartBeat(), r === "viewend" && delete this.data.view_id;
1533
+ delete i.ad_request_id, i.video_playback_ranges && (i.video_playback_range = JSON.stringify(i.video_playback_ranges.filter(function(l) {
1534
+ return l[0] !== l[1];
1535
+ }).map(function(l) {
1536
+ return "".concat(l[0], ":").concat(l[1]);
1537
+ })), delete i.video_playback_ranges), this.playbackEventDispatcher.send(r, i), this.data.view_sequence_number++, this.data.player_sequence_number++, hi.has(r) || this._restartHeartBeat(), r === "viewend" && delete this.data.view_id;
1482
1538
  }
1483
1539
  } }, { key: "_resetView", value: function(r) {
1484
1540
  this.emit("viewend"), this.send("viewend"), this.emit("viewinit", r);
@@ -1486,26 +1542,26 @@ var dr = or, lr = ["viewstart", "ended", "loadstart", "pause", "play", "playing"
1486
1542
  var r, i = this.getStateData();
1487
1543
  if (typeof this.stateDataTranslator == "function") try {
1488
1544
  i = this.stateDataTranslator(i);
1489
- } catch (o) {
1490
- this.mux.log.warn("Exception in stateDataTranslator translator callback.", o);
1545
+ } catch (s) {
1546
+ this.mux.log.warn("Exception in stateDataTranslator translator callback.", s);
1491
1547
  }
1492
1548
  if (!((r = this.data) === null || r === void 0) && r.video_cdn && i != null && i.video_cdn) {
1493
1549
  i.video_cdn;
1494
- var n = Bt(i, ["video_cdn"]);
1550
+ var n = Mt(i, ["video_cdn"]);
1495
1551
  i = n;
1496
1552
  }
1497
1553
  Object.assign(this.data, i), this.playheadTime._updatePlayheadTime(), this._sanitizeData();
1498
1554
  } }, { key: "_sanitizeData", value: function() {
1499
1555
  var r = this, i = ["player_width", "player_height", "video_source_width", "video_source_height", "player_playhead_time", "video_source_bitrate"];
1500
- i.forEach(function(o) {
1501
- var u = parseInt(r.data[o], 10);
1502
- r.data[o] = isNaN(u) ? void 0 : u;
1556
+ i.forEach(function(s) {
1557
+ var u = parseInt(r.data[s], 10);
1558
+ r.data[s] = isNaN(u) ? void 0 : u;
1503
1559
  });
1504
1560
  var n = ["player_source_url", "video_source_url"];
1505
- n.forEach(function(o) {
1506
- if (r.data[o]) {
1507
- var u = r.data[o].toLowerCase();
1508
- (u.indexOf("data:") === 0 || u.indexOf("blob:") === 0) && (r.data[o] = "MSE style URL");
1561
+ n.forEach(function(s) {
1562
+ if (r.data[s]) {
1563
+ var u = r.data[s].toLowerCase();
1564
+ (u.indexOf("data:") === 0 || u.indexOf("blob:") === 0) && (r.data[s] = "MSE style URL");
1509
1565
  }
1510
1566
  });
1511
1567
  } }, { key: "_resetVideoData", value: function() {
@@ -1522,7 +1578,7 @@ var dr = or, lr = ["viewstart", "ended", "loadstart", "pause", "play", "playing"
1522
1578
  delete this.data.player_error_code, delete this.data.player_error_message, delete this.data.player_error_context, delete this.data.player_error_severity, delete this.data.player_error_business_exception;
1523
1579
  } }, { key: "_initializeViewData", value: function() {
1524
1580
  var r = this, i = this.data.view_id = de(), n = function() {
1525
- i === r.data.view_id && A(r.data, "player_view_count", 1);
1581
+ i === r.data.view_id && L(r.data, "player_view_count", 1);
1526
1582
  };
1527
1583
  this.data.player_is_paused ? this.one("play", n) : n();
1528
1584
  } }, { key: "_restartHeartBeat", value: function() {
@@ -1555,21 +1611,21 @@ var dr = or, lr = ["viewstart", "ended", "loadstart", "pause", "play", "playing"
1555
1611
  } }, { key: "removeDashJS", value: function() {
1556
1612
  this.dashjs && (ta(this.dashjs), this.dashjs = void 0);
1557
1613
  } }]), t;
1558
- })(ra), hr = _r, oe = C(Ye());
1559
- function pr() {
1560
- return oe.default && !!(oe.default.fullscreenElement || oe.default.webkitFullscreenElement || oe.default.mozFullScreenElement || oe.default.msFullscreenElement);
1614
+ })(ia), vi = fi, se = j(Ye());
1615
+ function xe() {
1616
+ return se.default && !!(se.default.fullscreenElement || se.default.webkitFullscreenElement || se.default.mozFullScreenElement || se.default.msFullscreenElement);
1561
1617
  }
1562
- var fr = ["loadstart", "pause", "play", "playing", "seeking", "seeked", "timeupdate", "ratechange", "stalled", "waiting", "error", "ended"], vr = { 1: "MEDIA_ERR_ABORTED", 2: "MEDIA_ERR_NETWORK", 3: "MEDIA_ERR_DECODE", 4: "MEDIA_ERR_SRC_NOT_SUPPORTED" };
1563
- function mr(a, e, t) {
1564
- var r = Q(he(e), 3), i = r[0], n = r[1], o = r[2], u = a.log, d = a.utils.getComputedStyle, c = a.utils.secondsToMs, v = { automaticErrorTracking: !0 };
1618
+ var mi = ["loadstart", "pause", "play", "playing", "seeking", "seeked", "timeupdate", "ratechange", "stalled", "waiting", "error", "ended"], yi = { 1: "MEDIA_ERR_ABORTED", 2: "MEDIA_ERR_NETWORK", 3: "MEDIA_ERR_DECODE", 4: "MEDIA_ERR_SRC_NOT_SUPPORTED" };
1619
+ function gi(a, e, t) {
1620
+ var r = Q(_e(e), 3), i = r[0], n = r[1], s = r[2], u = a.log, d = a.utils.getComputedStyle, l = a.utils.secondsToMs, m = { automaticErrorTracking: !0 };
1565
1621
  if (i) {
1566
- if (o !== "video" && o !== "audio") return u.error("The element of `" + n + "` was not a media element.");
1622
+ if (s !== "video" && s !== "audio") return u.error("The element of `" + n + "` was not a media element.");
1567
1623
  } else return u.error("No element was found with the `" + n + "` query selector.");
1568
1624
  i.mux && (i.mux.destroy(), delete i.mux, u.warn("Already monitoring this video element, replacing existing event listeners"));
1569
1625
  var b = { getPlayheadTime: function() {
1570
- return c(i.currentTime);
1626
+ return l(i.currentTime);
1571
1627
  }, getStateData: function() {
1572
- var s, _, y, f = ((s = (_ = this).getPlayheadTime) === null || s === void 0 ? void 0 : s.call(_)) || c(i.currentTime), g = this.hlsjs && this.hlsjs.url, p = this.dashjs && typeof this.dashjs.getSource == "function" && this.dashjs.getSource(), h = { player_is_paused: i.paused, player_width: parseInt(d(i, "width")), player_height: parseInt(d(i, "height")), player_autoplay_on: i.autoplay, player_preload_on: i.preload, player_language_code: i.lang, player_is_fullscreen: pr(), video_poster_url: i.poster, video_source_url: g || p || i.currentSrc, video_source_duration: c(i.duration), video_source_height: i.videoHeight, video_source_width: i.videoWidth, view_dropped_frame_count: i == null || (y = i.getVideoPlaybackQuality) === null || y === void 0 ? void 0 : y.call(i).droppedVideoFrames };
1628
+ var o, p, y, f = ((o = (p = this).getPlayheadTime) === null || o === void 0 ? void 0 : o.call(p)) || l(i.currentTime), g = this.hlsjs && this.hlsjs.url, _ = this.dashjs && typeof this.dashjs.getSource == "function" && this.dashjs.getSource(), h = { player_is_paused: i.paused, player_width: parseInt(d(i, "width")), player_height: parseInt(d(i, "height")), player_autoplay_on: i.autoplay, player_preload_on: i.preload, player_language_code: i.lang, player_is_fullscreen: xe(), video_poster_url: i.poster, video_source_url: g || _ || i.currentSrc, video_source_duration: l(i.duration), video_source_height: i.videoHeight, video_source_width: i.videoWidth, view_dropped_frame_count: i == null || (y = i.getVideoPlaybackQuality) === null || y === void 0 ? void 0 : y.call(i).droppedVideoFrames };
1573
1629
  if (i.getStartDate && f > 0) {
1574
1630
  var w = i.getStartDate();
1575
1631
  if (w && typeof w.getTime == "function" && w.getTime()) {
@@ -1582,52 +1638,64 @@ function mr(a, e, t) {
1582
1638
  }
1583
1639
  return h;
1584
1640
  } };
1585
- t = Object.assign(v, t, b), t.data = Object.assign({ player_software: "HTML5 Video Element", player_mux_plugin_name: "VideoElementMonitor", player_mux_plugin_version: a.VERSION }, t.data), i.mux = i.mux || {}, i.mux.deleted = !1, i.mux.emit = function(s, _) {
1586
- a.emit(n, s, _);
1587
- }, i.mux.updateData = function(s) {
1588
- i.mux.emit("hb", s);
1641
+ t = Object.assign(m, t, b), t.data = Object.assign({ player_software: "HTML5 Video Element", player_mux_plugin_name: "VideoElementMonitor", player_mux_plugin_version: a.VERSION }, t.data), i.mux = i.mux || {}, i.mux.deleted = !1, i.mux.emit = function(o, p) {
1642
+ a.emit(n, o, p);
1643
+ }, i.mux.updateData = function(o) {
1644
+ i.mux.emit("hb", o);
1589
1645
  };
1590
- var l = function() {
1646
+ var c = function() {
1591
1647
  u.error("The monitor for this video element has already been destroyed.");
1592
1648
  };
1593
1649
  i.mux.destroy = function() {
1594
- Object.keys(i.mux.listeners).forEach(function(s) {
1595
- i.removeEventListener(s, i.mux.listeners[s], !1);
1596
- }), delete i.mux.listeners, i.mux.destroy = l, i.mux.swapElement = l, i.mux.emit = l, i.mux.addHLSJS = l, i.mux.addDashJS = l, i.mux.removeHLSJS = l, i.mux.removeDashJS = l, i.mux.updateData = l, i.mux.setEmitTranslator = l, i.mux.setStateDataTranslator = l, i.mux.setGetPlayheadTime = l, i.mux.deleted = !0, a.emit(n, "destroy");
1597
- }, i.mux.swapElement = function(s) {
1598
- var _ = Q(he(s), 3), y = _[0], f = _[1], g = _[2];
1650
+ Object.keys(i.mux.listeners).forEach(function(o) {
1651
+ i.removeEventListener(o, i.mux.listeners[o], !1);
1652
+ }), delete i.mux.listeners, i.mux.fullscreenChangeListener && (document.removeEventListener("fullscreenchange", i.mux.fullscreenChangeListener, !1), delete i.mux.fullscreenChangeListener), i.mux.destroy = c, i.mux.swapElement = c, i.mux.emit = c, i.mux.addHLSJS = c, i.mux.addDashJS = c, i.mux.removeHLSJS = c, i.mux.removeDashJS = c, i.mux.updateData = c, i.mux.setEmitTranslator = c, i.mux.setStateDataTranslator = c, i.mux.setGetPlayheadTime = c, i.mux.deleted = !0, a.emit(n, "destroy");
1653
+ }, i.mux.swapElement = function(o) {
1654
+ var p = Q(_e(o), 3), y = p[0], f = p[1], g = p[2];
1599
1655
  if (y) {
1600
1656
  if (g !== "video" && g !== "audio") return a.log.error("The element of `" + f + "` was not a media element.");
1601
1657
  } else return a.log.error("No element was found with the `" + f + "` query selector.");
1602
- y.muxId = i.muxId, delete i.muxId, y.mux = y.mux || {}, y.mux.listeners = Object.assign({}, i.mux.listeners), delete i.mux.listeners, Object.keys(y.mux.listeners).forEach(function(p) {
1603
- i.removeEventListener(p, y.mux.listeners[p], !1), y.addEventListener(p, y.mux.listeners[p], !1);
1604
- }), y.mux.swapElement = i.mux.swapElement, y.mux.destroy = i.mux.destroy, delete i.mux, i = y;
1605
- }, i.mux.addHLSJS = function(s) {
1606
- a.addHLSJS(n, s);
1607
- }, i.mux.addDashJS = function(s) {
1608
- a.addDashJS(n, s);
1658
+ y.muxId = i.muxId, delete i.muxId, y.mux = y.mux || {}, y.mux.listeners = Object.assign({}, i.mux.listeners), delete i.mux.listeners, Object.keys(y.mux.listeners).forEach(function(_) {
1659
+ i.removeEventListener(_, y.mux.listeners[_], !1), y.addEventListener(_, y.mux.listeners[_], !1);
1660
+ }), y.mux.fullscreenChangeListener = i.mux.fullscreenChangeListener, delete i.mux.fullscreenChangeListener, y.mux.swapElement = i.mux.swapElement, y.mux.destroy = i.mux.destroy, delete i.mux, i = y;
1661
+ }, i.mux.addHLSJS = function(o) {
1662
+ a.addHLSJS(n, o);
1663
+ }, i.mux.addDashJS = function(o) {
1664
+ a.addDashJS(n, o);
1609
1665
  }, i.mux.removeHLSJS = function() {
1610
1666
  a.removeHLSJS(n);
1611
1667
  }, i.mux.removeDashJS = function() {
1612
1668
  a.removeDashJS(n);
1613
- }, i.mux.setEmitTranslator = function(s) {
1614
- a.setEmitTranslator(n, s);
1615
- }, i.mux.setStateDataTranslator = function(s) {
1616
- a.setStateDataTranslator(n, s);
1617
- }, i.mux.setGetPlayheadTime = function(s) {
1618
- s || (s = t.getPlayheadTime), a.setGetPlayheadTime(n, s);
1619
- }, a.init(n, t), a.emit(n, "playerready"), i.paused || (a.emit(n, "play"), i.readyState > 2 && a.emit(n, "playing")), i.mux.listeners = {}, fr.forEach(function(s) {
1620
- s === "error" && !t.automaticErrorTracking || (i.mux.listeners[s] = function() {
1621
- var _ = {};
1622
- if (s === "error") {
1669
+ }, i.mux.setEmitTranslator = function(o) {
1670
+ a.setEmitTranslator(n, o);
1671
+ }, i.mux.setStateDataTranslator = function(o) {
1672
+ a.setStateDataTranslator(n, o);
1673
+ }, i.mux.setGetPlayheadTime = function(o) {
1674
+ o || (o = t.getPlayheadTime), a.setGetPlayheadTime(n, o);
1675
+ }, a.init(n, t), a.emit(n, "playerready"), i.paused || (a.emit(n, "play"), i.readyState > 2 && a.emit(n, "playing")), i.mux.listeners = {}, mi.forEach(function(o) {
1676
+ o === "error" && !t.automaticErrorTracking || (i.mux.listeners[o] = function() {
1677
+ var p = {};
1678
+ if (o === "error") {
1623
1679
  if (!i.error || i.error.code === 1) return;
1624
- _.player_error_code = i.error.code, _.player_error_message = vr[i.error.code] || i.error.message;
1680
+ p.player_error_code = i.error.code, p.player_error_message = yi[i.error.code] || i.error.message;
1625
1681
  }
1626
- a.emit(n, s, _);
1627
- }, i.addEventListener(s, i.mux.listeners[s], !1));
1628
- });
1682
+ a.emit(n, o, p);
1683
+ }, i.addEventListener(o, i.mux.listeners[o], !1));
1684
+ }), i.mux.listeners.enterpictureinpicture = function() {
1685
+ a.emit(n, "playbackmodechange", { player_playback_mode: "pip", player_playback_mode_data: "{}" });
1686
+ }, i.mux.listeners.leavepictureinpicture = function() {
1687
+ var o = xe() ? "fullscreen" : "standard";
1688
+ a.emit(n, "playbackmodechange", { player_playback_mode: o, player_playback_mode_data: "{}" });
1689
+ }, i.addEventListener("enterpictureinpicture", i.mux.listeners.enterpictureinpicture, !1), i.addEventListener("leavepictureinpicture", i.mux.listeners.leavepictureinpicture, !1), i.mux.fullscreenChangeListener = function() {
1690
+ var o = xe(), p = document.fullscreenElement;
1691
+ if (o && (p === i || p != null && p.contains(i))) a.emit(n, "playbackmodechange", { player_playback_mode: "fullscreen", player_playback_mode_data: "{}" });
1692
+ else if (!o) {
1693
+ var y = document.pictureInPictureElement === i, f = y ? "pip" : "standard";
1694
+ a.emit(n, "playbackmodechange", { player_playback_mode: f, player_playback_mode_data: "{}" });
1695
+ }
1696
+ }, document.addEventListener("fullscreenchange", i.mux.fullscreenChangeListener, !1);
1629
1697
  }
1630
- function yr(a, e, t, r) {
1698
+ function bi(a, e, t, r) {
1631
1699
  var i = r;
1632
1700
  if (a && typeof a[e] == "function") try {
1633
1701
  i = a[e].apply(a, t);
@@ -1636,14 +1704,14 @@ function yr(a, e, t, r) {
1636
1704
  }
1637
1705
  return i;
1638
1706
  }
1639
- var ue = C(U()), ee;
1707
+ var ue = j(G()), ee;
1640
1708
  ue.default && ue.default.WeakMap && (ee = /* @__PURE__ */ new WeakMap());
1641
- function gr(a, e) {
1709
+ function wi(a, e) {
1642
1710
  if (!a || !e || !ue.default || typeof ue.default.getComputedStyle != "function") return "";
1643
1711
  var t;
1644
1712
  return ee && ee.has(a) && (t = ee.get(a)), t || (t = ue.default.getComputedStyle(a, null), ee && ee.set(a, t)), t.getPropertyValue(e);
1645
1713
  }
1646
- function br(a) {
1714
+ function Ti(a) {
1647
1715
  return Math.floor(a * 1e3);
1648
1716
  }
1649
1717
  var K = { TARGET_DURATION: "#EXT-X-TARGETDURATION", PART_INF: "#EXT-X-PART-INF", SERVER_CONTROL: "#EXT-X-SERVER-CONTROL", INF: "#EXTINF", PROGRAM_DATE_TIME: "#EXT-X-PROGRAM-DATE-TIME", VERSION: "#EXT-X-VERSION", SESSION_DATA: "#EXT-X-SESSION-DATA" }, me = function(a) {
@@ -1656,7 +1724,7 @@ me.prototype.process = function(a) {
1656
1724
  `)) this.processLine(this.buffer.substring(0, e)), this.buffer = this.buffer.substring(e + 1);
1657
1725
  };
1658
1726
  me.prototype.processLine = function(a) {
1659
- var e = a.indexOf(":"), t = Er(a, e), r = t[0], i = t.length === 2 ? Pe(t[1]) : void 0;
1727
+ var e = a.indexOf(":"), t = Di(a, e), r = t[0], i = t.length === 2 ? Le(t[1]) : void 0;
1660
1728
  if (r[0] !== "#") this.currentUri.uri = r, this.manifest.segments.push(this.currentUri), this.manifest.targetDuration && !("duration" in this.currentUri) && (this.currentUri.duration = this.manifest.targetDuration), this.currentUri = {};
1661
1729
  else switch (r) {
1662
1730
  case K.TARGET_DURATION: {
@@ -1665,11 +1733,11 @@ me.prototype.processLine = function(a) {
1665
1733
  break;
1666
1734
  }
1667
1735
  case K.PART_INF: {
1668
- xe(this.manifest, t), this.manifest.partInf.partTarget && (this.manifest.partTargetDuration = this.manifest.partInf.partTarget), this.setHoldBack();
1736
+ De(this.manifest, t), this.manifest.partInf.partTarget && (this.manifest.partTargetDuration = this.manifest.partInf.partTarget), this.setHoldBack();
1669
1737
  break;
1670
1738
  }
1671
1739
  case K.SERVER_CONTROL: {
1672
- xe(this.manifest, t), this.setHoldBack();
1740
+ De(this.manifest, t), this.setHoldBack();
1673
1741
  break;
1674
1742
  }
1675
1743
  case K.INF: {
@@ -1677,16 +1745,16 @@ me.prototype.processLine = function(a) {
1677
1745
  break;
1678
1746
  }
1679
1747
  case K.PROGRAM_DATE_TIME: {
1680
- var n = i, o = new Date(n);
1681
- this.manifest.dateTimeString || (this.manifest.dateTimeString = n, this.manifest.dateTimeObject = o), this.currentUri.dateTimeString = n, this.currentUri.dateTimeObject = o;
1748
+ var n = i, s = new Date(n);
1749
+ this.manifest.dateTimeString || (this.manifest.dateTimeString = n, this.manifest.dateTimeObject = s), this.currentUri.dateTimeString = n, this.currentUri.dateTimeObject = s;
1682
1750
  break;
1683
1751
  }
1684
1752
  case K.VERSION: {
1685
- xe(this.manifest, t);
1753
+ De(this.manifest, t);
1686
1754
  break;
1687
1755
  }
1688
1756
  case K.SESSION_DATA: {
1689
- var u = xr(t[1]), d = et(u);
1757
+ var u = Ri(t[1]), d = et(u);
1690
1758
  Object.assign(this.manifest.sessionData, d);
1691
1759
  }
1692
1760
  }
@@ -1694,57 +1762,57 @@ me.prototype.processLine = function(a) {
1694
1762
  me.prototype.setHoldBack = function() {
1695
1763
  var a = this.manifest, e = a.serverControl, t = a.targetDuration, r = a.partTargetDuration;
1696
1764
  if (e) {
1697
- var i = "holdBack", n = "partHoldBack", o = t && t * 3, u = r && r * 2;
1698
- t && !e.hasOwnProperty(i) && (e[i] = o), o && e[i] < o && (e[i] = o), r && !e.hasOwnProperty(n) && (e[n] = r * 3), r && e[n] < u && (e[n] = u);
1765
+ var i = "holdBack", n = "partHoldBack", s = t && t * 3, u = r && r * 2;
1766
+ t && !e.hasOwnProperty(i) && (e[i] = s), s && e[i] < s && (e[i] = s), r && !e.hasOwnProperty(n) && (e[n] = r * 3), r && e[n] < u && (e[n] = u);
1699
1767
  }
1700
1768
  };
1701
- var xe = function(a, e) {
1769
+ var De = function(a, e) {
1702
1770
  var t = dt(e[0].replace("#EXT-X-", "")), r;
1703
- kr(e[1]) ? (r = {}, r = Object.assign(Tr(e[1]), r)) : r = Pe(e[1]), a[t] = r;
1771
+ xi(e[1]) ? (r = {}, r = Object.assign(Ei(e[1]), r)) : r = Le(e[1]), a[t] = r;
1704
1772
  }, dt = function(a) {
1705
1773
  return a.toLowerCase().replace(/-(\w)/g, function(e) {
1706
1774
  return e[1].toUpperCase();
1707
1775
  });
1708
- }, Pe = function(a) {
1776
+ }, Le = function(a) {
1709
1777
  if (a.toLowerCase() === "yes" || a.toLowerCase() === "no") return a.toLowerCase() === "yes";
1710
1778
  var e = a.indexOf(":") !== -1 ? a : parseFloat(a);
1711
1779
  return isNaN(e) ? a : e;
1712
- }, wr = function(a) {
1780
+ }, ki = function(a) {
1713
1781
  var e = {}, t = a.split("=");
1714
1782
  if (t.length > 1) {
1715
1783
  var r = dt(t[0]);
1716
- e[r] = Pe(t[1]);
1784
+ e[r] = Le(t[1]);
1717
1785
  }
1718
1786
  return e;
1719
- }, Tr = function(a) {
1787
+ }, Ei = function(a) {
1720
1788
  for (var e = a.split(","), t = {}, r = 0; e.length > r; r++) {
1721
- var i = e[r], n = wr(i);
1789
+ var i = e[r], n = ki(i);
1722
1790
  t = Object.assign(n, t);
1723
1791
  }
1724
1792
  return t;
1725
- }, kr = function(a) {
1793
+ }, xi = function(a) {
1726
1794
  return a.indexOf("=") > -1;
1727
- }, Er = function(a, e) {
1795
+ }, Di = function(a, e) {
1728
1796
  return e === -1 ? [a] : [a.substring(0, e), a.substring(e + 1)];
1729
- }, xr = function(a) {
1797
+ }, Ri = function(a) {
1730
1798
  var e = {};
1731
1799
  if (a) {
1732
1800
  var t = a.search(","), r = a.slice(0, t), i = a.slice(t + 1), n = [r, i];
1733
- return n.forEach(function(o, u) {
1734
- for (var d = o.replace(/['"]+/g, "").split("="), c = 0; c < d.length; c++) d[c] === "DATA-ID" && (e["DATA-ID"] = d[1 - c]), d[c] === "VALUE" && (e.VALUE = d[1 - c]);
1801
+ return n.forEach(function(s, u) {
1802
+ for (var d = s.replace(/['"]+/g, "").split("="), l = 0; l < d.length; l++) d[l] === "DATA-ID" && (e["DATA-ID"] = d[1 - l]), d[l] === "VALUE" && (e.VALUE = d[1 - l]);
1735
1803
  }), { data: e };
1736
1804
  }
1737
- }, Dr = me, qr = { safeCall: yr, safeIncrement: A, getComputedStyle: gr, secondsToMs: br, assign: Object.assign, headersStringToObject: Ae, cdnHeadersToRequestId: ve, extractHostnameAndDomain: le, extractHostname: B, manifestParser: Dr, generateShortID: Ze, generateUUID: de, now: P.now, findMediaElement: he }, Rr = qr, Sr = { PLAYER_READY: "playerready", VIEW_INIT: "viewinit", VIDEO_CHANGE: "videochange", PLAY: "play", PAUSE: "pause", PLAYING: "playing", TIME_UPDATE: "timeupdate", SEEKING: "seeking", SEEKED: "seeked", REBUFFER_START: "rebufferstart", REBUFFER_END: "rebufferend", ERROR: "error", ENDED: "ended", RENDITION_CHANGE: "renditionchange", ORIENTATION_CHANGE: "orientationchange", AD_REQUEST: "adrequest", AD_RESPONSE: "adresponse", AD_BREAK_START: "adbreakstart", AD_PLAY: "adplay", AD_PLAYING: "adplaying", AD_PAUSE: "adpause", AD_FIRST_QUARTILE: "adfirstquartile", AD_MID_POINT: "admidpoint", AD_THIRD_QUARTILE: "adthirdquartile", AD_ENDED: "adended", AD_BREAK_END: "adbreakend", AD_ERROR: "aderror", REQUEST_COMPLETED: "requestcompleted", REQUEST_FAILED: "requestfailed", REQUEST_CANCELLED: "requestcanceled", HEARTBEAT: "hb", DESTROY: "destroy" }, Or = Sr, Ar = "mux-embed", Pr = "5.11.0", Lr = "2.1", O = {}, J = function(a) {
1805
+ }, qi = me, Ai = { safeCall: bi, safeIncrement: L, getComputedStyle: wi, secondsToMs: Ti, assign: Object.assign, headersStringToObject: Pe, cdnHeadersToRequestId: ve, extractHostnameAndDomain: le, extractHostname: M, manifestParser: qi, generateShortID: Ze, generateUUID: de, now: I.now, findMediaElement: _e }, Si = Ai, Oi = { PLAYER_READY: "playerready", VIEW_INIT: "viewinit", VIDEO_CHANGE: "videochange", PLAY: "play", PAUSE: "pause", PLAYING: "playing", TIME_UPDATE: "timeupdate", SEEKING: "seeking", SEEKED: "seeked", REBUFFER_START: "rebufferstart", REBUFFER_END: "rebufferend", ERROR: "error", ENDED: "ended", RENDITION_CHANGE: "renditionchange", ORIENTATION_CHANGE: "orientationchange", PLAYBACK_MODE_CHANGE: "playbackmodechange", AD_REQUEST: "adrequest", AD_RESPONSE: "adresponse", AD_BREAK_START: "adbreakstart", AD_PLAY: "adplay", AD_PLAYING: "adplaying", AD_PAUSE: "adpause", AD_FIRST_QUARTILE: "adfirstquartile", AD_MID_POINT: "admidpoint", AD_THIRD_QUARTILE: "adthirdquartile", AD_ENDED: "adended", AD_BREAK_END: "adbreakend", AD_ERROR: "aderror", REQUEST_COMPLETED: "requestcompleted", REQUEST_FAILED: "requestfailed", REQUEST_CANCELLED: "requestcanceled", HEARTBEAT: "hb", DESTROY: "destroy" }, Pi = Oi, Li = "mux-embed", Ii = "5.17.10", Ni = "2.1", O = {}, J = function(a) {
1738
1806
  var e = arguments;
1739
- typeof a == "string" ? J.hasOwnProperty(a) ? se.default.setTimeout(function() {
1807
+ typeof a == "string" ? J.hasOwnProperty(a) ? oe.default.setTimeout(function() {
1740
1808
  e = Array.prototype.splice.call(e, 1), J[a].apply(null, e);
1741
- }, 0) : q.warn("`" + a + "` is an unknown task") : typeof a == "function" ? se.default.setTimeout(function() {
1809
+ }, 0) : q.warn("`" + a + "` is an unknown task") : typeof a == "function" ? oe.default.setTimeout(function() {
1742
1810
  a(J);
1743
1811
  }, 0) : q.warn("`" + a + "` is invalid.");
1744
- }, Ir = { loaded: P.now(), NAME: Ar, VERSION: Pr, API_VERSION: Lr, PLAYER_TRACKED: !1, monitor: function(a, e) {
1745
- return mr(J, a, e);
1812
+ }, Ci = { loaded: I.now(), NAME: Li, VERSION: Ii, API_VERSION: Ni, PLAYER_TRACKED: !1, monitor: function(a, e) {
1813
+ return gi(J, a, e);
1746
1814
  }, destroyMonitor: function(a) {
1747
- var e = Q(he(a), 1), t = e[0];
1815
+ var e = Q(_e(a), 1), t = e[0];
1748
1816
  t && t.mux && typeof t.mux.destroy == "function" ? t.mux.destroy() : q.error("A video element monitor for `" + a + "` has not been initialized via `mux.monitor`.");
1749
1817
  }, addHLSJS: function(a, e) {
1750
1818
  var t = H(a);
@@ -1761,7 +1829,7 @@ var xe = function(a, e) {
1761
1829
  }, init: function(a, e) {
1762
1830
  qe() && e && e.respectDoNotTrack && q.info("The browser's Do Not Track flag is enabled - Mux beaconing is disabled.");
1763
1831
  var t = H(a);
1764
- O[t] = new hr(J, t, e);
1832
+ O[t] = new vi(J, t, e);
1765
1833
  }, emit: function(a, e, t) {
1766
1834
  var r = H(a);
1767
1835
  O[r] ? (O[r].emit(e, t), e === "destroy" && delete O[r]) : q.error("A monitor for `" + r + "` has not been initialized.");
@@ -1777,12 +1845,12 @@ var xe = function(a, e) {
1777
1845
  }, setGetPlayheadTime: function(a, e) {
1778
1846
  var t = H(a);
1779
1847
  O[t] ? O[t].getPlayheadTime = e : q.error("A monitor for `" + t + "` has not been initialized.");
1780
- }, checkDoNotTrack: qe, log: q, utils: Rr, events: Or, WINDOW_HIDDEN: !1, WINDOW_UNLOADING: !1 };
1781
- Object.assign(J, Ir);
1782
- typeof se.default < "u" && typeof se.default.addEventListener == "function" && se.default.addEventListener("pagehide", function(a) {
1848
+ }, checkDoNotTrack: qe, log: q, utils: Si, events: Pi, WINDOW_HIDDEN: !1, WINDOW_UNLOADING: !1 };
1849
+ Object.assign(J, Ci);
1850
+ typeof oe.default < "u" && typeof oe.default.addEventListener == "function" && oe.default.addEventListener("pagehide", function(a) {
1783
1851
  a.persisted || (J.WINDOW_UNLOADING = !0);
1784
1852
  }, !1);
1785
- var Nr = J;
1853
+ var ji = J;
1786
1854
  /*!
1787
1855
  * JavaScript Cookie v2.1.3
1788
1856
  * https://github.com/js-cookie/js-cookie
@@ -1790,7 +1858,7 @@ var Nr = J;
1790
1858
  * Copyright 2006, 2015 Klaus Hartl & Fagner Brack
1791
1859
  * Released under the MIT license
1792
1860
  */
1793
- const Cr = async ({
1861
+ const Hi = async ({
1794
1862
  appName: a = "elv-player-js",
1795
1863
  elvPlayer: e,
1796
1864
  playoutUrl: t,
@@ -1798,7 +1866,7 @@ const Cr = async ({
1798
1866
  disableCookies: i
1799
1867
  }) => {
1800
1868
  t = new URL(t);
1801
- const n = await e.__Client(), o = (await n.NetworkInfo()).name === "main" ? "aq4mdjn7qo5sbkf89pkvfv93j" : "2i5480sms8vdgj0sv9bv6lpk5", u = t.pathname.split("/").find((f) => f.startsWith("hq__")), d = n.utils.DecodeVersionHash(u).objectId, c = (t.toString().match(/\/rep\/playout|channel\/([^/]+)/) || [])[1] || "default", v = t.searchParams.get("sid");
1869
+ const n = await e.__Client(), s = (await n.NetworkInfo()).name === "main" ? "aq4mdjn7qo5sbkf89pkvfv93j" : "2i5480sms8vdgj0sv9bv6lpk5", u = t.pathname.split("/").find((f) => f.startsWith("hq__")), d = n.utils.DecodeVersionHash(u).objectId, l = (t.toString().match(/\/rep\/playout|channel\/([^/]+)/) || [])[1] || "default", m = t.searchParams.get("sid");
1802
1870
  let b = u;
1803
1871
  try {
1804
1872
  const f = await n.ContentObjectMetadata({
@@ -1814,24 +1882,24 @@ const Cr = async ({
1814
1882
  b = (f.asset_metadata || {}).display_title || (f.asset_metadata || {}).title || f.name || u;
1815
1883
  } catch {
1816
1884
  }
1817
- let l;
1885
+ let c;
1818
1886
  try {
1819
- l = await n.ContentObjectTenantId({ versionHash: u });
1887
+ c = await n.ContentObjectTenantId({ versionHash: u });
1820
1888
  } catch {
1821
1889
  }
1822
- let s = await n.CurrentAccountAddress();
1890
+ let o = await n.CurrentAccountAddress();
1823
1891
  if (r || n.staticToken)
1824
1892
  try {
1825
1893
  const { payload: f } = n.utils.DecodeSignedToken(r);
1826
- s = f.adr || s;
1894
+ o = f.adr || o;
1827
1895
  } catch {
1828
1896
  }
1829
- let _ = n.utils.FormatAddress(s);
1897
+ let p = n.utils.FormatAddress(o);
1830
1898
  if (typeof crypto < "u")
1831
1899
  try {
1832
1900
  const f = new TextEncoder();
1833
- _ = Buffer.from(
1834
- await crypto.subtle.digest("SHA-256", f.encode(s))
1901
+ p = Buffer.from(
1902
+ await crypto.subtle.digest("SHA-256", f.encode(o))
1835
1903
  ).toString("hex");
1836
1904
  } catch {
1837
1905
  }
@@ -1839,26 +1907,26 @@ const Cr = async ({
1839
1907
  debug: !1,
1840
1908
  disableCookies: i,
1841
1909
  data: {
1842
- env_key: o,
1910
+ env_key: s,
1843
1911
  video_id: d,
1844
1912
  video_variant_id: u,
1845
- video_variant_name: c,
1913
+ video_variant_name: l,
1846
1914
  video_title: b,
1847
1915
  video_cdn: t.hostname,
1848
- viewer_user_id: _,
1849
- sub_property_id: l,
1916
+ viewer_user_id: p,
1917
+ sub_property_id: c,
1850
1918
  player_name: a,
1851
1919
  //player_version: version,
1852
1920
  player_init_time: e.initTime
1853
1921
  }
1854
1922
  };
1855
- v && (y.data.view_session_id = v), e.player && (e.HLS ? (y.hlsjs = e.player, y.Hls = e.HLS) : e.Dash && (y.dashjs = e.player));
1923
+ m && (y.data.view_session_id = m), e.player && (e.HLS ? (y.hlsjs = e.player, y.Hls = e.HLS) : e.Dash && (y.dashjs = e.dashPlayer));
1856
1924
  try {
1857
- Nr.monitor(e.video, y), e.Log("elv-player-js: Mux monitoring initialized"), e.Log(JSON.stringify({ ...y, hlsjs: {} }));
1925
+ ji.monitor(e.video, y), e.Log("elv-player-js: Mux monitoring initialized"), e.Log(JSON.stringify({ ...y, hlsjs: {} }));
1858
1926
  } catch (f) {
1859
1927
  e.Log("elv-player-js: Failed to initialize mux monitoring:", !0), e.Log(JSON.stringify(y, null, 2), !0), e.Log(f, !0);
1860
1928
  }
1861
1929
  };
1862
1930
  export {
1863
- Cr as InitializeMuxMonitoring
1931
+ Hi as InitializeMuxMonitoring
1864
1932
  };