lemon-mse 0.4.0 → 0.4.1

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.
package/dist/flv.js CHANGED
@@ -1,196 +1,188 @@
1
1
  var __create = Object.create;
2
- var __getProtoOf = Object.getPrototypeOf;
3
2
  var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
5
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __toESM = (mod, isNodeMode, target) => {
7
- target = mod != null ? __create(__getProtoOf(mod)) : {};
8
- const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
9
- for (let key of __getOwnPropNames(mod))
10
- if (!__hasOwnProp.call(to, key))
11
- __defProp(to, key, {
12
- get: () => mod[key],
13
- enumerable: true
14
- });
7
+ var __commonJS = (cb, mod) => function __require() {
8
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
15
16
  return to;
16
17
  };
17
- var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
18
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
19
+ // If the importer is in node compatibility mode or this is not an ESM
20
+ // file that has been converted to a CommonJS file using a Babel-
21
+ // compatible transform (i.e. "__esModule" has not been set), then set
22
+ // "default" to the CommonJS "module.exports" for node compatibility.
23
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
24
+ mod
25
+ ));
18
26
 
19
27
  // node_modules/eventemitter3/index.js
20
- var require_eventemitter3 = __commonJS((exports, module) => {
21
- var has = Object.prototype.hasOwnProperty;
22
- var prefix = "~";
23
- function Events() {}
24
- if (Object.create) {
25
- Events.prototype = Object.create(null);
26
- if (!new Events().__proto__)
27
- prefix = false;
28
- }
29
- function EE(fn, context, once) {
30
- this.fn = fn;
31
- this.context = context;
32
- this.once = once || false;
33
- }
34
- function addListener(emitter, event, fn, context, once) {
35
- if (typeof fn !== "function") {
36
- throw new TypeError("The listener must be a function");
37
- }
38
- var listener = new EE(fn, context || emitter, once), evt = prefix ? prefix + event : event;
39
- if (!emitter._events[evt])
40
- emitter._events[evt] = listener, emitter._eventsCount++;
41
- else if (!emitter._events[evt].fn)
42
- emitter._events[evt].push(listener);
43
- else
44
- emitter._events[evt] = [emitter._events[evt], listener];
45
- return emitter;
46
- }
47
- function clearEvent(emitter, evt) {
48
- if (--emitter._eventsCount === 0)
49
- emitter._events = new Events;
50
- else
51
- delete emitter._events[evt];
52
- }
53
- function EventEmitter() {
54
- this._events = new Events;
55
- this._eventsCount = 0;
56
- }
57
- EventEmitter.prototype.eventNames = function eventNames() {
58
- var names = [], events, name;
59
- if (this._eventsCount === 0)
60
- return names;
61
- for (name in events = this._events) {
62
- if (has.call(events, name))
63
- names.push(prefix ? name.slice(1) : name);
64
- }
65
- if (Object.getOwnPropertySymbols) {
66
- return names.concat(Object.getOwnPropertySymbols(events));
28
+ var require_eventemitter3 = __commonJS({
29
+ "node_modules/eventemitter3/index.js"(exports, module) {
30
+ "use strict";
31
+ var has = Object.prototype.hasOwnProperty;
32
+ var prefix = "~";
33
+ function Events() {
34
+ }
35
+ if (Object.create) {
36
+ Events.prototype = /* @__PURE__ */ Object.create(null);
37
+ if (!new Events().__proto__) prefix = false;
38
+ }
39
+ function EE(fn, context, once) {
40
+ this.fn = fn;
41
+ this.context = context;
42
+ this.once = once || false;
43
+ }
44
+ function addListener(emitter, event, fn, context, once) {
45
+ if (typeof fn !== "function") {
46
+ throw new TypeError("The listener must be a function");
47
+ }
48
+ var listener = new EE(fn, context || emitter, once), evt = prefix ? prefix + event : event;
49
+ if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;
50
+ else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);
51
+ else emitter._events[evt] = [emitter._events[evt], listener];
52
+ return emitter;
53
+ }
54
+ function clearEvent(emitter, evt) {
55
+ if (--emitter._eventsCount === 0) emitter._events = new Events();
56
+ else delete emitter._events[evt];
57
+ }
58
+ function EventEmitter5() {
59
+ this._events = new Events();
60
+ this._eventsCount = 0;
67
61
  }
68
- return names;
69
- };
70
- EventEmitter.prototype.listeners = function listeners(event) {
71
- var evt = prefix ? prefix + event : event, handlers = this._events[evt];
72
- if (!handlers)
73
- return [];
74
- if (handlers.fn)
75
- return [handlers.fn];
76
- for (var i = 0, l = handlers.length, ee = new Array(l);i < l; i++) {
77
- ee[i] = handlers[i].fn;
78
- }
79
- return ee;
80
- };
81
- EventEmitter.prototype.listenerCount = function listenerCount(event) {
82
- var evt = prefix ? prefix + event : event, listeners = this._events[evt];
83
- if (!listeners)
84
- return 0;
85
- if (listeners.fn)
86
- return 1;
87
- return listeners.length;
88
- };
89
- EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
90
- var evt = prefix ? prefix + event : event;
91
- if (!this._events[evt])
92
- return false;
93
- var listeners = this._events[evt], len = arguments.length, args, i;
94
- if (listeners.fn) {
95
- if (listeners.once)
96
- this.removeListener(event, listeners.fn, undefined, true);
97
- switch (len) {
98
- case 1:
99
- return listeners.fn.call(listeners.context), true;
100
- case 2:
101
- return listeners.fn.call(listeners.context, a1), true;
102
- case 3:
103
- return listeners.fn.call(listeners.context, a1, a2), true;
104
- case 4:
105
- return listeners.fn.call(listeners.context, a1, a2, a3), true;
106
- case 5:
107
- return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
108
- case 6:
109
- return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
110
- }
111
- for (i = 1, args = new Array(len - 1);i < len; i++) {
112
- args[i - 1] = arguments[i];
113
- }
114
- listeners.fn.apply(listeners.context, args);
115
- } else {
116
- var length = listeners.length, j;
117
- for (i = 0;i < length; i++) {
118
- if (listeners[i].once)
119
- this.removeListener(event, listeners[i].fn, undefined, true);
62
+ EventEmitter5.prototype.eventNames = function eventNames() {
63
+ var names = [], events, name;
64
+ if (this._eventsCount === 0) return names;
65
+ for (name in events = this._events) {
66
+ if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);
67
+ }
68
+ if (Object.getOwnPropertySymbols) {
69
+ return names.concat(Object.getOwnPropertySymbols(events));
70
+ }
71
+ return names;
72
+ };
73
+ EventEmitter5.prototype.listeners = function listeners(event) {
74
+ var evt = prefix ? prefix + event : event, handlers = this._events[evt];
75
+ if (!handlers) return [];
76
+ if (handlers.fn) return [handlers.fn];
77
+ for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {
78
+ ee[i] = handlers[i].fn;
79
+ }
80
+ return ee;
81
+ };
82
+ EventEmitter5.prototype.listenerCount = function listenerCount(event) {
83
+ var evt = prefix ? prefix + event : event, listeners = this._events[evt];
84
+ if (!listeners) return 0;
85
+ if (listeners.fn) return 1;
86
+ return listeners.length;
87
+ };
88
+ EventEmitter5.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
89
+ var evt = prefix ? prefix + event : event;
90
+ if (!this._events[evt]) return false;
91
+ var listeners = this._events[evt], len = arguments.length, args, i;
92
+ if (listeners.fn) {
93
+ if (listeners.once) this.removeListener(event, listeners.fn, void 0, true);
120
94
  switch (len) {
121
95
  case 1:
122
- listeners[i].fn.call(listeners[i].context);
123
- break;
96
+ return listeners.fn.call(listeners.context), true;
124
97
  case 2:
125
- listeners[i].fn.call(listeners[i].context, a1);
126
- break;
98
+ return listeners.fn.call(listeners.context, a1), true;
127
99
  case 3:
128
- listeners[i].fn.call(listeners[i].context, a1, a2);
129
- break;
100
+ return listeners.fn.call(listeners.context, a1, a2), true;
130
101
  case 4:
131
- listeners[i].fn.call(listeners[i].context, a1, a2, a3);
132
- break;
133
- default:
134
- if (!args)
135
- for (j = 1, args = new Array(len - 1);j < len; j++) {
102
+ return listeners.fn.call(listeners.context, a1, a2, a3), true;
103
+ case 5:
104
+ return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
105
+ case 6:
106
+ return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
107
+ }
108
+ for (i = 1, args = new Array(len - 1); i < len; i++) {
109
+ args[i - 1] = arguments[i];
110
+ }
111
+ listeners.fn.apply(listeners.context, args);
112
+ } else {
113
+ var length = listeners.length, j;
114
+ for (i = 0; i < length; i++) {
115
+ if (listeners[i].once) this.removeListener(event, listeners[i].fn, void 0, true);
116
+ switch (len) {
117
+ case 1:
118
+ listeners[i].fn.call(listeners[i].context);
119
+ break;
120
+ case 2:
121
+ listeners[i].fn.call(listeners[i].context, a1);
122
+ break;
123
+ case 3:
124
+ listeners[i].fn.call(listeners[i].context, a1, a2);
125
+ break;
126
+ case 4:
127
+ listeners[i].fn.call(listeners[i].context, a1, a2, a3);
128
+ break;
129
+ default:
130
+ if (!args) for (j = 1, args = new Array(len - 1); j < len; j++) {
136
131
  args[j - 1] = arguments[j];
137
132
  }
138
- listeners[i].fn.apply(listeners[i].context, args);
133
+ listeners[i].fn.apply(listeners[i].context, args);
134
+ }
139
135
  }
140
136
  }
141
- }
142
- return true;
143
- };
144
- EventEmitter.prototype.on = function on(event, fn, context) {
145
- return addListener(this, event, fn, context, false);
146
- };
147
- EventEmitter.prototype.once = function once(event, fn, context) {
148
- return addListener(this, event, fn, context, true);
149
- };
150
- EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {
151
- var evt = prefix ? prefix + event : event;
152
- if (!this._events[evt])
153
- return this;
154
- if (!fn) {
155
- clearEvent(this, evt);
156
- return this;
157
- }
158
- var listeners = this._events[evt];
159
- if (listeners.fn) {
160
- if (listeners.fn === fn && (!once || listeners.once) && (!context || listeners.context === context)) {
137
+ return true;
138
+ };
139
+ EventEmitter5.prototype.on = function on(event, fn, context) {
140
+ return addListener(this, event, fn, context, false);
141
+ };
142
+ EventEmitter5.prototype.once = function once(event, fn, context) {
143
+ return addListener(this, event, fn, context, true);
144
+ };
145
+ EventEmitter5.prototype.removeListener = function removeListener(event, fn, context, once) {
146
+ var evt = prefix ? prefix + event : event;
147
+ if (!this._events[evt]) return this;
148
+ if (!fn) {
161
149
  clearEvent(this, evt);
150
+ return this;
162
151
  }
163
- } else {
164
- for (var i = 0, events = [], length = listeners.length;i < length; i++) {
165
- if (listeners[i].fn !== fn || once && !listeners[i].once || context && listeners[i].context !== context) {
166
- events.push(listeners[i]);
152
+ var listeners = this._events[evt];
153
+ if (listeners.fn) {
154
+ if (listeners.fn === fn && (!once || listeners.once) && (!context || listeners.context === context)) {
155
+ clearEvent(this, evt);
156
+ }
157
+ } else {
158
+ for (var i = 0, events = [], length = listeners.length; i < length; i++) {
159
+ if (listeners[i].fn !== fn || once && !listeners[i].once || context && listeners[i].context !== context) {
160
+ events.push(listeners[i]);
161
+ }
167
162
  }
163
+ if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;
164
+ else clearEvent(this, evt);
168
165
  }
169
- if (events.length)
170
- this._events[evt] = events.length === 1 ? events[0] : events;
171
- else
172
- clearEvent(this, evt);
173
- }
174
- return this;
175
- };
176
- EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {
177
- var evt;
178
- if (event) {
179
- evt = prefix ? prefix + event : event;
180
- if (this._events[evt])
181
- clearEvent(this, evt);
182
- } else {
183
- this._events = new Events;
184
- this._eventsCount = 0;
166
+ return this;
167
+ };
168
+ EventEmitter5.prototype.removeAllListeners = function removeAllListeners(event) {
169
+ var evt;
170
+ if (event) {
171
+ evt = prefix ? prefix + event : event;
172
+ if (this._events[evt]) clearEvent(this, evt);
173
+ } else {
174
+ this._events = new Events();
175
+ this._eventsCount = 0;
176
+ }
177
+ return this;
178
+ };
179
+ EventEmitter5.prototype.off = EventEmitter5.prototype.removeListener;
180
+ EventEmitter5.prototype.addListener = EventEmitter5.prototype.on;
181
+ EventEmitter5.prefixed = prefix;
182
+ EventEmitter5.EventEmitter = EventEmitter5;
183
+ if ("undefined" !== typeof module) {
184
+ module.exports = EventEmitter5;
185
185
  }
186
- return this;
187
- };
188
- EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
189
- EventEmitter.prototype.addListener = EventEmitter.prototype.on;
190
- EventEmitter.prefixed = prefix;
191
- EventEmitter.EventEmitter = EventEmitter;
192
- if (typeof module !== "undefined") {
193
- module.exports = EventEmitter;
194
186
  }
195
187
  });
196
188
 
@@ -206,8 +198,8 @@ function ownKeys(object, enumerableOnly) {
206
198
  return keys;
207
199
  }
208
200
  function _objectSpread2(target) {
209
- for (var i = 1;i < arguments.length; i++) {
210
- var source = arguments[i] != null ? arguments[i] : {};
201
+ for (var i = 1; i < arguments.length; i++) {
202
+ var source = null != arguments[i] ? arguments[i] : {};
211
203
  i % 2 ? ownKeys(Object(source), true).forEach(function(key) {
212
204
  _defineProperty(target, key, source[key]);
213
205
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
@@ -222,7 +214,7 @@ function _regeneratorRuntime() {
222
214
  };
223
215
  var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function(obj, key, desc) {
224
216
  obj[key] = desc.value;
225
- }, $Symbol = typeof Symbol == "function" ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
217
+ }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
226
218
  function define(obj, key, value) {
227
219
  return Object.defineProperty(obj, key, {
228
220
  value,
@@ -259,9 +251,12 @@ function _regeneratorRuntime() {
259
251
  }
260
252
  exports.wrap = wrap;
261
253
  var ContinueSentinel = {};
262
- function Generator() {}
263
- function GeneratorFunction() {}
264
- function GeneratorFunctionPrototype() {}
254
+ function Generator() {
255
+ }
256
+ function GeneratorFunction() {
257
+ }
258
+ function GeneratorFunctionPrototype() {
259
+ }
265
260
  var IteratorPrototype = {};
266
261
  define(IteratorPrototype, iteratorSymbol, function() {
267
262
  return this;
@@ -279,9 +274,9 @@ function _regeneratorRuntime() {
279
274
  function AsyncIterator(generator, PromiseImpl) {
280
275
  function invoke(method, arg, resolve, reject) {
281
276
  var record = tryCatch(generator[method], generator, arg);
282
- if (record.type !== "throw") {
277
+ if ("throw" !== record.type) {
283
278
  var result = record.arg, value = result.value;
284
- return value && typeof value == "object" && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function(value2) {
279
+ return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function(value2) {
285
280
  invoke("next", value2, resolve, reject);
286
281
  }, function(err) {
287
282
  invoke("throw", err, resolve, reject);
@@ -308,14 +303,14 @@ function _regeneratorRuntime() {
308
303
  function makeInvokeMethod(innerFn, self, context) {
309
304
  var state = "suspendedStart";
310
305
  return function(method, arg) {
311
- if (state === "executing")
306
+ if ("executing" === state)
312
307
  throw new Error("Generator is already running");
313
- if (state === "completed") {
314
- if (method === "throw")
308
+ if ("completed" === state) {
309
+ if ("throw" === method)
315
310
  throw arg;
316
311
  return doneResult();
317
312
  }
318
- for (context.method = method, context.arg = arg;; ) {
313
+ for (context.method = method, context.arg = arg; ; ) {
319
314
  var delegate = context.delegate;
320
315
  if (delegate) {
321
316
  var delegateResult = maybeInvokeDelegate(delegate, context);
@@ -325,17 +320,17 @@ function _regeneratorRuntime() {
325
320
  return delegateResult;
326
321
  }
327
322
  }
328
- if (context.method === "next")
323
+ if ("next" === context.method)
329
324
  context.sent = context._sent = context.arg;
330
- else if (context.method === "throw") {
331
- if (state === "suspendedStart")
325
+ else if ("throw" === context.method) {
326
+ if ("suspendedStart" === state)
332
327
  throw state = "completed", context.arg;
333
328
  context.dispatchException(context.arg);
334
329
  } else
335
- context.method === "return" && context.abrupt("return", context.arg);
330
+ "return" === context.method && context.abrupt("return", context.arg);
336
331
  state = "executing";
337
332
  var record = tryCatch(innerFn, self, context);
338
- if (record.type === "normal") {
333
+ if ("normal" === record.type) {
339
334
  if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel)
340
335
  continue;
341
336
  return {
@@ -343,19 +338,19 @@ function _regeneratorRuntime() {
343
338
  done: context.done
344
339
  };
345
340
  }
346
- record.type === "throw" && (state = "completed", context.method = "throw", context.arg = record.arg);
341
+ "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
347
342
  }
348
343
  };
349
344
  }
350
345
  function maybeInvokeDelegate(delegate, context) {
351
346
  var methodName = context.method, method = delegate.iterator[methodName];
352
- if (method === undefined)
353
- return context.delegate = null, methodName === "throw" && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), context.method === "throw") || methodName !== "return" && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
347
+ if (void 0 === method)
348
+ return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = void 0, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
354
349
  var record = tryCatch(method, delegate.iterator, context.arg);
355
- if (record.type === "throw")
350
+ if ("throw" === record.type)
356
351
  return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
357
352
  var info = record.arg;
358
- return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, context.method !== "return" && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
353
+ return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = void 0), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
359
354
  }
360
355
  function pushTryEntry(locs) {
361
356
  var entry = {
@@ -377,14 +372,14 @@ function _regeneratorRuntime() {
377
372
  var iteratorMethod = iterable[iteratorSymbol];
378
373
  if (iteratorMethod)
379
374
  return iteratorMethod.call(iterable);
380
- if (typeof iterable.next == "function")
375
+ if ("function" == typeof iterable.next)
381
376
  return iterable;
382
377
  if (!isNaN(iterable.length)) {
383
378
  var i = -1, next = function next2() {
384
- for (;++i < iterable.length; )
379
+ for (; ++i < iterable.length; )
385
380
  if (hasOwn.call(iterable, i))
386
381
  return next2.value = iterable[i], next2.done = false, next2;
387
- return next2.value = undefined, next2.done = true, next2;
382
+ return next2.value = void 0, next2.done = true, next2;
388
383
  };
389
384
  return next.next = next;
390
385
  }
@@ -395,7 +390,7 @@ function _regeneratorRuntime() {
395
390
  }
396
391
  function doneResult() {
397
392
  return {
398
- value: undefined,
393
+ value: void 0,
399
394
  done: true
400
395
  };
401
396
  }
@@ -406,8 +401,8 @@ function _regeneratorRuntime() {
406
401
  value: GeneratorFunction,
407
402
  configurable: true
408
403
  }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function(genFun) {
409
- var ctor = typeof genFun == "function" && genFun.constructor;
410
- return !!ctor && (ctor === GeneratorFunction || (ctor.displayName || ctor.name) === "GeneratorFunction");
404
+ var ctor = "function" == typeof genFun && genFun.constructor;
405
+ return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
411
406
  }, exports.mark = function(genFun) {
412
407
  return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
413
408
  }, exports.awrap = function(arg) {
@@ -417,7 +412,7 @@ function _regeneratorRuntime() {
417
412
  }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function() {
418
413
  return this;
419
414
  }), exports.AsyncIterator = AsyncIterator, exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
420
- PromiseImpl === undefined && (PromiseImpl = Promise);
415
+ void 0 === PromiseImpl && (PromiseImpl = Promise);
421
416
  var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
422
417
  return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function(result) {
423
418
  return result.done ? result.value : iter.next();
@@ -431,7 +426,7 @@ function _regeneratorRuntime() {
431
426
  for (var key in object)
432
427
  keys.push(key);
433
428
  return keys.reverse(), function next() {
434
- for (;keys.length; ) {
429
+ for (; keys.length; ) {
435
430
  var key2 = keys.pop();
436
431
  if (key2 in object)
437
432
  return next.value = key2, next.done = false, next;
@@ -441,14 +436,14 @@ function _regeneratorRuntime() {
441
436
  }, exports.values = values, Context.prototype = {
442
437
  constructor: Context,
443
438
  reset: function(skipTempReset) {
444
- if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = false, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset)
439
+ if (this.prev = 0, this.next = 0, this.sent = this._sent = void 0, this.done = false, this.delegate = null, this.method = "next", this.arg = void 0, this.tryEntries.forEach(resetTryEntry), !skipTempReset)
445
440
  for (var name in this)
446
- name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
441
+ "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = void 0);
447
442
  },
448
443
  stop: function() {
449
444
  this.done = true;
450
445
  var rootRecord = this.tryEntries[0].completion;
451
- if (rootRecord.type === "throw")
446
+ if ("throw" === rootRecord.type)
452
447
  throw rootRecord.arg;
453
448
  return this.rval;
454
449
  },
@@ -457,11 +452,11 @@ function _regeneratorRuntime() {
457
452
  throw exception;
458
453
  var context = this;
459
454
  function handle(loc, caught) {
460
- return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
455
+ return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = void 0), !!caught;
461
456
  }
462
- for (var i = this.tryEntries.length - 1;i >= 0; --i) {
457
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
463
458
  var entry = this.tryEntries[i], record = entry.completion;
464
- if (entry.tryLoc === "root")
459
+ if ("root" === entry.tryLoc)
465
460
  return handle("end");
466
461
  if (entry.tryLoc <= this.prev) {
467
462
  var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc");
@@ -483,35 +478,35 @@ function _regeneratorRuntime() {
483
478
  }
484
479
  },
485
480
  abrupt: function(type, arg) {
486
- for (var i = this.tryEntries.length - 1;i >= 0; --i) {
481
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
487
482
  var entry = this.tryEntries[i];
488
483
  if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
489
484
  var finallyEntry = entry;
490
485
  break;
491
486
  }
492
487
  }
493
- finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
488
+ finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
494
489
  var record = finallyEntry ? finallyEntry.completion : {};
495
490
  return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
496
491
  },
497
492
  complete: function(record, afterLoc) {
498
- if (record.type === "throw")
493
+ if ("throw" === record.type)
499
494
  throw record.arg;
500
- return record.type === "break" || record.type === "continue" ? this.next = record.arg : record.type === "return" ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : record.type === "normal" && afterLoc && (this.next = afterLoc), ContinueSentinel;
495
+ return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
501
496
  },
502
497
  finish: function(finallyLoc) {
503
- for (var i = this.tryEntries.length - 1;i >= 0; --i) {
498
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
504
499
  var entry = this.tryEntries[i];
505
500
  if (entry.finallyLoc === finallyLoc)
506
501
  return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
507
502
  }
508
503
  },
509
504
  catch: function(tryLoc) {
510
- for (var i = this.tryEntries.length - 1;i >= 0; --i) {
505
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
511
506
  var entry = this.tryEntries[i];
512
507
  if (entry.tryLoc === tryLoc) {
513
508
  var record = entry.completion;
514
- if (record.type === "throw") {
509
+ if ("throw" === record.type) {
515
510
  var thrown = record.arg;
516
511
  resetTryEntry(entry);
517
512
  }
@@ -525,7 +520,7 @@ function _regeneratorRuntime() {
525
520
  iterator: values(iterable),
526
521
  resultName,
527
522
  nextLoc
528
- }, this.method === "next" && (this.arg = undefined), ContinueSentinel;
523
+ }, "next" === this.method && (this.arg = void 0), ContinueSentinel;
529
524
  }
530
525
  }, exports;
531
526
  }
@@ -554,7 +549,7 @@ function _asyncToGenerator(fn) {
554
549
  function _throw(err) {
555
550
  asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
556
551
  }
557
- _next(undefined);
552
+ _next(void 0);
558
553
  });
559
554
  };
560
555
  }
@@ -564,7 +559,7 @@ function _classCallCheck(instance, Constructor) {
564
559
  }
565
560
  }
566
561
  function _defineProperties(target, props) {
567
- for (var i = 0;i < props.length; i++) {
562
+ for (var i = 0; i < props.length; i++) {
568
563
  var descriptor = props[i];
569
564
  descriptor.enumerable = descriptor.enumerable || false;
570
565
  descriptor.configurable = true;
@@ -615,13 +610,13 @@ function _inherits(subClass, superClass) {
615
610
  _setPrototypeOf(subClass, superClass);
616
611
  }
617
612
  function _getPrototypeOf(o) {
618
- _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf2(o2) {
613
+ _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf22(o2) {
619
614
  return o2.__proto__ || Object.getPrototypeOf(o2);
620
615
  };
621
616
  return _getPrototypeOf(o);
622
617
  }
623
618
  function _setPrototypeOf(o, p) {
624
- _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p2) {
619
+ _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf22(o2, p2) {
625
620
  o2.__proto__ = p2;
626
621
  return o2;
627
622
  };
@@ -635,14 +630,15 @@ function _isNativeReflectConstruct() {
635
630
  if (typeof Proxy === "function")
636
631
  return true;
637
632
  try {
638
- Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
633
+ Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
634
+ }));
639
635
  return true;
640
636
  } catch (e) {
641
637
  return false;
642
638
  }
643
639
  }
644
640
  function _assertThisInitialized(self) {
645
- if (self === undefined) {
641
+ if (self === void 0) {
646
642
  throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
647
643
  }
648
644
  return self;
@@ -650,7 +646,7 @@ function _assertThisInitialized(self) {
650
646
  function _possibleConstructorReturn(self, call) {
651
647
  if (call && (typeof call === "object" || typeof call === "function")) {
652
648
  return call;
653
- } else if (call !== undefined) {
649
+ } else if (call !== void 0) {
654
650
  throw new TypeError("Derived constructors may only return object or undefined");
655
651
  }
656
652
  return _assertThisInitialized(self);
@@ -672,7 +668,7 @@ function _toPrimitive(input, hint) {
672
668
  if (typeof input !== "object" || input === null)
673
669
  return input;
674
670
  var prim = input[Symbol.toPrimitive];
675
- if (prim !== undefined) {
671
+ if (prim !== void 0) {
676
672
  var res = prim.call(input, hint || "default");
677
673
  if (typeof res !== "object")
678
674
  return res;
@@ -697,8 +693,8 @@ function ownKeys2(object, enumerableOnly) {
697
693
  return keys;
698
694
  }
699
695
  function _objectSpread22(target) {
700
- for (var i = 1;i < arguments.length; i++) {
701
- var source = arguments[i] != null ? arguments[i] : {};
696
+ for (var i = 1; i < arguments.length; i++) {
697
+ var source = null != arguments[i] ? arguments[i] : {};
702
698
  i % 2 ? ownKeys2(Object(source), true).forEach(function(key) {
703
699
  _defineProperty2(target, key, source[key]);
704
700
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys2(Object(source)).forEach(function(key) {
@@ -713,7 +709,7 @@ function _regeneratorRuntime2() {
713
709
  };
714
710
  var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function(obj, key, desc) {
715
711
  obj[key] = desc.value;
716
- }, $Symbol = typeof Symbol == "function" ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
712
+ }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
717
713
  function define(obj, key, value) {
718
714
  return Object.defineProperty(obj, key, {
719
715
  value,
@@ -750,9 +746,12 @@ function _regeneratorRuntime2() {
750
746
  }
751
747
  exports.wrap = wrap;
752
748
  var ContinueSentinel = {};
753
- function Generator() {}
754
- function GeneratorFunction() {}
755
- function GeneratorFunctionPrototype() {}
749
+ function Generator() {
750
+ }
751
+ function GeneratorFunction() {
752
+ }
753
+ function GeneratorFunctionPrototype() {
754
+ }
756
755
  var IteratorPrototype = {};
757
756
  define(IteratorPrototype, iteratorSymbol, function() {
758
757
  return this;
@@ -770,9 +769,9 @@ function _regeneratorRuntime2() {
770
769
  function AsyncIterator(generator, PromiseImpl) {
771
770
  function invoke(method, arg, resolve, reject) {
772
771
  var record = tryCatch(generator[method], generator, arg);
773
- if (record.type !== "throw") {
772
+ if ("throw" !== record.type) {
774
773
  var result = record.arg, value = result.value;
775
- return value && typeof value == "object" && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function(value2) {
774
+ return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function(value2) {
776
775
  invoke("next", value2, resolve, reject);
777
776
  }, function(err) {
778
777
  invoke("throw", err, resolve, reject);
@@ -799,14 +798,14 @@ function _regeneratorRuntime2() {
799
798
  function makeInvokeMethod(innerFn, self, context) {
800
799
  var state = "suspendedStart";
801
800
  return function(method, arg) {
802
- if (state === "executing")
801
+ if ("executing" === state)
803
802
  throw new Error("Generator is already running");
804
- if (state === "completed") {
805
- if (method === "throw")
803
+ if ("completed" === state) {
804
+ if ("throw" === method)
806
805
  throw arg;
807
806
  return doneResult();
808
807
  }
809
- for (context.method = method, context.arg = arg;; ) {
808
+ for (context.method = method, context.arg = arg; ; ) {
810
809
  var delegate = context.delegate;
811
810
  if (delegate) {
812
811
  var delegateResult = maybeInvokeDelegate(delegate, context);
@@ -816,17 +815,17 @@ function _regeneratorRuntime2() {
816
815
  return delegateResult;
817
816
  }
818
817
  }
819
- if (context.method === "next")
818
+ if ("next" === context.method)
820
819
  context.sent = context._sent = context.arg;
821
- else if (context.method === "throw") {
822
- if (state === "suspendedStart")
820
+ else if ("throw" === context.method) {
821
+ if ("suspendedStart" === state)
823
822
  throw state = "completed", context.arg;
824
823
  context.dispatchException(context.arg);
825
824
  } else
826
- context.method === "return" && context.abrupt("return", context.arg);
825
+ "return" === context.method && context.abrupt("return", context.arg);
827
826
  state = "executing";
828
827
  var record = tryCatch(innerFn, self, context);
829
- if (record.type === "normal") {
828
+ if ("normal" === record.type) {
830
829
  if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel)
831
830
  continue;
832
831
  return {
@@ -834,19 +833,19 @@ function _regeneratorRuntime2() {
834
833
  done: context.done
835
834
  };
836
835
  }
837
- record.type === "throw" && (state = "completed", context.method = "throw", context.arg = record.arg);
836
+ "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
838
837
  }
839
838
  };
840
839
  }
841
840
  function maybeInvokeDelegate(delegate, context) {
842
841
  var methodName = context.method, method = delegate.iterator[methodName];
843
- if (method === undefined)
844
- return context.delegate = null, methodName === "throw" && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), context.method === "throw") || methodName !== "return" && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
842
+ if (void 0 === method)
843
+ return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = void 0, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
845
844
  var record = tryCatch(method, delegate.iterator, context.arg);
846
- if (record.type === "throw")
845
+ if ("throw" === record.type)
847
846
  return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
848
847
  var info = record.arg;
849
- return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, context.method !== "return" && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
848
+ return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = void 0), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
850
849
  }
851
850
  function pushTryEntry(locs) {
852
851
  var entry = {
@@ -868,14 +867,14 @@ function _regeneratorRuntime2() {
868
867
  var iteratorMethod = iterable[iteratorSymbol];
869
868
  if (iteratorMethod)
870
869
  return iteratorMethod.call(iterable);
871
- if (typeof iterable.next == "function")
870
+ if ("function" == typeof iterable.next)
872
871
  return iterable;
873
872
  if (!isNaN(iterable.length)) {
874
873
  var i = -1, next = function next2() {
875
- for (;++i < iterable.length; )
874
+ for (; ++i < iterable.length; )
876
875
  if (hasOwn.call(iterable, i))
877
876
  return next2.value = iterable[i], next2.done = false, next2;
878
- return next2.value = undefined, next2.done = true, next2;
877
+ return next2.value = void 0, next2.done = true, next2;
879
878
  };
880
879
  return next.next = next;
881
880
  }
@@ -886,7 +885,7 @@ function _regeneratorRuntime2() {
886
885
  }
887
886
  function doneResult() {
888
887
  return {
889
- value: undefined,
888
+ value: void 0,
890
889
  done: true
891
890
  };
892
891
  }
@@ -897,8 +896,8 @@ function _regeneratorRuntime2() {
897
896
  value: GeneratorFunction,
898
897
  configurable: true
899
898
  }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function(genFun) {
900
- var ctor = typeof genFun == "function" && genFun.constructor;
901
- return !!ctor && (ctor === GeneratorFunction || (ctor.displayName || ctor.name) === "GeneratorFunction");
899
+ var ctor = "function" == typeof genFun && genFun.constructor;
900
+ return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
902
901
  }, exports.mark = function(genFun) {
903
902
  return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
904
903
  }, exports.awrap = function(arg) {
@@ -908,7 +907,7 @@ function _regeneratorRuntime2() {
908
907
  }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function() {
909
908
  return this;
910
909
  }), exports.AsyncIterator = AsyncIterator, exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
911
- PromiseImpl === undefined && (PromiseImpl = Promise);
910
+ void 0 === PromiseImpl && (PromiseImpl = Promise);
912
911
  var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
913
912
  return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function(result) {
914
913
  return result.done ? result.value : iter.next();
@@ -922,7 +921,7 @@ function _regeneratorRuntime2() {
922
921
  for (var key in object)
923
922
  keys.push(key);
924
923
  return keys.reverse(), function next() {
925
- for (;keys.length; ) {
924
+ for (; keys.length; ) {
926
925
  var key2 = keys.pop();
927
926
  if (key2 in object)
928
927
  return next.value = key2, next.done = false, next;
@@ -932,14 +931,14 @@ function _regeneratorRuntime2() {
932
931
  }, exports.values = values, Context.prototype = {
933
932
  constructor: Context,
934
933
  reset: function(skipTempReset) {
935
- if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = false, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset)
934
+ if (this.prev = 0, this.next = 0, this.sent = this._sent = void 0, this.done = false, this.delegate = null, this.method = "next", this.arg = void 0, this.tryEntries.forEach(resetTryEntry), !skipTempReset)
936
935
  for (var name in this)
937
- name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
936
+ "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = void 0);
938
937
  },
939
938
  stop: function() {
940
939
  this.done = true;
941
940
  var rootRecord = this.tryEntries[0].completion;
942
- if (rootRecord.type === "throw")
941
+ if ("throw" === rootRecord.type)
943
942
  throw rootRecord.arg;
944
943
  return this.rval;
945
944
  },
@@ -948,11 +947,11 @@ function _regeneratorRuntime2() {
948
947
  throw exception;
949
948
  var context = this;
950
949
  function handle(loc, caught) {
951
- return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
950
+ return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = void 0), !!caught;
952
951
  }
953
- for (var i = this.tryEntries.length - 1;i >= 0; --i) {
952
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
954
953
  var entry = this.tryEntries[i], record = entry.completion;
955
- if (entry.tryLoc === "root")
954
+ if ("root" === entry.tryLoc)
956
955
  return handle("end");
957
956
  if (entry.tryLoc <= this.prev) {
958
957
  var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc");
@@ -974,35 +973,35 @@ function _regeneratorRuntime2() {
974
973
  }
975
974
  },
976
975
  abrupt: function(type, arg) {
977
- for (var i = this.tryEntries.length - 1;i >= 0; --i) {
976
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
978
977
  var entry = this.tryEntries[i];
979
978
  if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
980
979
  var finallyEntry = entry;
981
980
  break;
982
981
  }
983
982
  }
984
- finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
983
+ finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
985
984
  var record = finallyEntry ? finallyEntry.completion : {};
986
985
  return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
987
986
  },
988
987
  complete: function(record, afterLoc) {
989
- if (record.type === "throw")
988
+ if ("throw" === record.type)
990
989
  throw record.arg;
991
- return record.type === "break" || record.type === "continue" ? this.next = record.arg : record.type === "return" ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : record.type === "normal" && afterLoc && (this.next = afterLoc), ContinueSentinel;
990
+ return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
992
991
  },
993
992
  finish: function(finallyLoc) {
994
- for (var i = this.tryEntries.length - 1;i >= 0; --i) {
993
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
995
994
  var entry = this.tryEntries[i];
996
995
  if (entry.finallyLoc === finallyLoc)
997
996
  return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
998
997
  }
999
998
  },
1000
999
  catch: function(tryLoc) {
1001
- for (var i = this.tryEntries.length - 1;i >= 0; --i) {
1000
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
1002
1001
  var entry = this.tryEntries[i];
1003
1002
  if (entry.tryLoc === tryLoc) {
1004
1003
  var record = entry.completion;
1005
- if (record.type === "throw") {
1004
+ if ("throw" === record.type) {
1006
1005
  var thrown = record.arg;
1007
1006
  resetTryEntry(entry);
1008
1007
  }
@@ -1016,16 +1015,16 @@ function _regeneratorRuntime2() {
1016
1015
  iterator: values(iterable),
1017
1016
  resultName,
1018
1017
  nextLoc
1019
- }, this.method === "next" && (this.arg = undefined), ContinueSentinel;
1018
+ }, "next" === this.method && (this.arg = void 0), ContinueSentinel;
1020
1019
  }
1021
1020
  }, exports;
1022
1021
  }
1023
1022
  function _typeof(obj) {
1024
1023
  "@babel/helpers - typeof";
1025
- return _typeof = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(obj2) {
1024
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
1026
1025
  return typeof obj2;
1027
1026
  } : function(obj2) {
1028
- return obj2 && typeof Symbol == "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
1027
+ return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
1029
1028
  }, _typeof(obj);
1030
1029
  }
1031
1030
  function asyncGeneratorStep2(gen, resolve, reject, _next, _throw, key, arg) {
@@ -1053,7 +1052,7 @@ function _asyncToGenerator2(fn) {
1053
1052
  function _throw(err) {
1054
1053
  asyncGeneratorStep2(gen, resolve, reject, _next, _throw, "throw", err);
1055
1054
  }
1056
- _next(undefined);
1055
+ _next(void 0);
1057
1056
  });
1058
1057
  };
1059
1058
  }
@@ -1063,7 +1062,7 @@ function _classCallCheck2(instance, Constructor) {
1063
1062
  }
1064
1063
  }
1065
1064
  function _defineProperties2(target, props) {
1066
- for (var i = 0;i < props.length; i++) {
1065
+ for (var i = 0; i < props.length; i++) {
1067
1066
  var descriptor = props[i];
1068
1067
  descriptor.enumerable = descriptor.enumerable || false;
1069
1068
  descriptor.configurable = true;
@@ -1114,13 +1113,13 @@ function _inherits2(subClass, superClass) {
1114
1113
  _setPrototypeOf2(subClass, superClass);
1115
1114
  }
1116
1115
  function _getPrototypeOf2(o) {
1117
- _getPrototypeOf2 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf2(o2) {
1116
+ _getPrototypeOf2 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf22(o2) {
1118
1117
  return o2.__proto__ || Object.getPrototypeOf(o2);
1119
1118
  };
1120
1119
  return _getPrototypeOf2(o);
1121
1120
  }
1122
1121
  function _setPrototypeOf2(o, p) {
1123
- _setPrototypeOf2 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p2) {
1122
+ _setPrototypeOf2 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf22(o2, p2) {
1124
1123
  o2.__proto__ = p2;
1125
1124
  return o2;
1126
1125
  };
@@ -1134,7 +1133,8 @@ function _isNativeReflectConstruct2() {
1134
1133
  if (typeof Proxy === "function")
1135
1134
  return true;
1136
1135
  try {
1137
- Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
1136
+ Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
1137
+ }));
1138
1138
  return true;
1139
1139
  } catch (e) {
1140
1140
  return false;
@@ -1148,7 +1148,7 @@ function _construct(Parent, args, Class) {
1148
1148
  var a = [null];
1149
1149
  a.push.apply(a, args2);
1150
1150
  var Constructor = Function.bind.apply(Parent2, a);
1151
- var instance = new Constructor;
1151
+ var instance = new Constructor();
1152
1152
  if (Class2)
1153
1153
  _setPrototypeOf2(instance, Class2.prototype);
1154
1154
  return instance;
@@ -1160,7 +1160,7 @@ function _isNativeFunction(fn) {
1160
1160
  return Function.toString.call(fn).indexOf("[native code]") !== -1;
1161
1161
  }
1162
1162
  function _wrapNativeSuper(Class) {
1163
- var _cache = typeof Map === "function" ? /* @__PURE__ */ new Map : undefined;
1163
+ var _cache = typeof Map === "function" ? /* @__PURE__ */ new Map() : void 0;
1164
1164
  _wrapNativeSuper = function _wrapNativeSuper2(Class2) {
1165
1165
  if (Class2 === null || !_isNativeFunction(Class2))
1166
1166
  return Class2;
@@ -1193,7 +1193,7 @@ function _objectWithoutPropertiesLoose(source, excluded) {
1193
1193
  var target = {};
1194
1194
  var sourceKeys = Object.keys(source);
1195
1195
  var key, i;
1196
- for (i = 0;i < sourceKeys.length; i++) {
1196
+ for (i = 0; i < sourceKeys.length; i++) {
1197
1197
  key = sourceKeys[i];
1198
1198
  if (excluded.indexOf(key) >= 0)
1199
1199
  continue;
@@ -1208,7 +1208,7 @@ function _objectWithoutProperties(source, excluded) {
1208
1208
  var key, i;
1209
1209
  if (Object.getOwnPropertySymbols) {
1210
1210
  var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
1211
- for (i = 0;i < sourceSymbolKeys.length; i++) {
1211
+ for (i = 0; i < sourceSymbolKeys.length; i++) {
1212
1212
  key = sourceSymbolKeys[i];
1213
1213
  if (excluded.indexOf(key) >= 0)
1214
1214
  continue;
@@ -1220,7 +1220,7 @@ function _objectWithoutProperties(source, excluded) {
1220
1220
  return target;
1221
1221
  }
1222
1222
  function _assertThisInitialized2(self) {
1223
- if (self === undefined) {
1223
+ if (self === void 0) {
1224
1224
  throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
1225
1225
  }
1226
1226
  return self;
@@ -1228,7 +1228,7 @@ function _assertThisInitialized2(self) {
1228
1228
  function _possibleConstructorReturn2(self, call) {
1229
1229
  if (call && (typeof call === "object" || typeof call === "function")) {
1230
1230
  return call;
1231
- } else if (call !== undefined) {
1231
+ } else if (call !== void 0) {
1232
1232
  throw new TypeError("Derived constructors may only return object or undefined");
1233
1233
  }
1234
1234
  return _assertThisInitialized2(self);
@@ -1287,7 +1287,7 @@ function _unsupportedIterableToArray(o, minLen) {
1287
1287
  function _arrayLikeToArray(arr, len) {
1288
1288
  if (len == null || len > arr.length)
1289
1289
  len = arr.length;
1290
- for (var i = 0, arr2 = new Array(len);i < len; i++)
1290
+ for (var i = 0, arr2 = new Array(len); i < len; i++)
1291
1291
  arr2[i] = arr[i];
1292
1292
  return arr2;
1293
1293
  }
@@ -1298,7 +1298,8 @@ function _createForOfIteratorHelper(o, allowArrayLike) {
1298
1298
  if (it)
1299
1299
  o = it;
1300
1300
  var i = 0;
1301
- var F = function() {};
1301
+ var F = function() {
1302
+ };
1302
1303
  return {
1303
1304
  s: F,
1304
1305
  n: function() {
@@ -1317,8 +1318,7 @@ function _createForOfIteratorHelper(o, allowArrayLike) {
1317
1318
  f: F
1318
1319
  };
1319
1320
  }
1320
- throw new TypeError(`Invalid attempt to iterate non-iterable instance.
1321
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
1321
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1322
1322
  }
1323
1323
  var normalCompletion = true, didErr = false, err;
1324
1324
  return {
@@ -1349,7 +1349,7 @@ function _toPrimitive2(input, hint) {
1349
1349
  if (typeof input !== "object" || input === null)
1350
1350
  return input;
1351
1351
  var prim = input[Symbol.toPrimitive];
1352
- if (prim !== undefined) {
1352
+ if (prim !== void 0) {
1353
1353
  var res = prim.call(input, hint || "default");
1354
1354
  if (typeof res !== "object")
1355
1355
  return res;
@@ -1363,16 +1363,16 @@ function _toPropertyKey2(arg) {
1363
1363
  }
1364
1364
 
1365
1365
  // node_modules/xgplayer-streaming-shared/es/buffer.js
1366
- var Buffer = /* @__PURE__ */ function() {
1367
- function Buffer2() {
1368
- _classCallCheck2(this, Buffer2);
1366
+ var Buffer2 = /* @__PURE__ */ function() {
1367
+ function Buffer22() {
1368
+ _classCallCheck2(this, Buffer22);
1369
1369
  }
1370
- _createClass2(Buffer2, null, [{
1370
+ _createClass2(Buffer22, null, [{
1371
1371
  key: "start",
1372
1372
  value: function start(buf) {
1373
1373
  if (!buf || !buf.length)
1374
1374
  return 0;
1375
- if (buf.length === 1 && buf.end(0) - buf.start(0) < 0.000001)
1375
+ if (buf.length === 1 && buf.end(0) - buf.start(0) < 1e-6)
1376
1376
  return 0;
1377
1377
  if (buf.length === 1 && buf.start(0) < 0)
1378
1378
  return 0;
@@ -1383,7 +1383,7 @@ var Buffer = /* @__PURE__ */ function() {
1383
1383
  value: function end(buf) {
1384
1384
  if (!buf || !buf.length)
1385
1385
  return 0;
1386
- if (buf.length === 1 && buf.end(0) - buf.start(0) < 0.000001)
1386
+ if (buf.length === 1 && buf.end(0) - buf.start(0) < 1e-6)
1387
1387
  return 0;
1388
1388
  return buf.end(buf.length - 1);
1389
1389
  }
@@ -1394,7 +1394,8 @@ var Buffer = /* @__PURE__ */ function() {
1394
1394
  return;
1395
1395
  try {
1396
1396
  return b.buffered;
1397
- } catch (error) {}
1397
+ } catch (error) {
1398
+ }
1398
1399
  }
1399
1400
  }, {
1400
1401
  key: "buffers",
@@ -1402,7 +1403,7 @@ var Buffer = /* @__PURE__ */ function() {
1402
1403
  if (!buf || !buf.length)
1403
1404
  return [];
1404
1405
  var buffers2 = [];
1405
- for (var i = 0, l = buf.length;i < l; i++) {
1406
+ for (var i = 0, l = buf.length; i < l; i++) {
1406
1407
  var bufLen = buffers2.length;
1407
1408
  if (!bufLen || !maxHole) {
1408
1409
  buffers2.push([buf.start(i), buf.end(i)]);
@@ -1434,8 +1435,8 @@ var Buffer = /* @__PURE__ */ function() {
1434
1435
  }, {
1435
1436
  key: "info",
1436
1437
  value: function info(buf) {
1437
- var pos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
1438
- var maxHole = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
1438
+ var pos = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
1439
+ var maxHole = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0;
1439
1440
  if (!buf || !buf.length)
1440
1441
  return {
1441
1442
  start: 0,
@@ -1449,8 +1450,8 @@ var Buffer = /* @__PURE__ */ function() {
1449
1450
  var nextEnd = 0;
1450
1451
  var prevStart = 0;
1451
1452
  var prevEnd = 0;
1452
- var buffers = Buffer2.buffers(buf, maxHole);
1453
- for (var i = 0, l = buffers.length;i < l; i++) {
1453
+ var buffers = Buffer22.buffers(buf, maxHole);
1454
+ for (var i = 0, l = buffers.length; i < l; i++) {
1454
1455
  var item = buffers[i];
1455
1456
  if (pos + maxHole >= item[0] && pos <= item[1]) {
1456
1457
  start = item[0];
@@ -1477,16 +1478,16 @@ var Buffer = /* @__PURE__ */ function() {
1477
1478
  currentTime: pos,
1478
1479
  behind: pos - start,
1479
1480
  remaining: end ? end - pos : 0,
1480
- length: Buffer2.totalLength && Buffer2.totalLength(buffers)
1481
+ length: Buffer22.totalLength && Buffer22.totalLength(buffers)
1481
1482
  };
1482
1483
  }
1483
1484
  }, {
1484
1485
  key: "isBuffered",
1485
1486
  value: function isBuffered(media, pos) {
1486
1487
  if (media) {
1487
- var buffered = Buffer2.get(media);
1488
- if (buffered !== null && buffered !== undefined && buffered.length) {
1489
- for (var i = 0;i < buffered.length; i++) {
1488
+ var buffered = Buffer22.get(media);
1489
+ if (buffered !== null && buffered !== void 0 && buffered.length) {
1490
+ for (var i = 0; i < buffered.length; i++) {
1490
1491
  if (pos >= buffered.start(i) && pos <= buffered.end(i)) {
1491
1492
  return true;
1492
1493
  }
@@ -1496,7 +1497,7 @@ var Buffer = /* @__PURE__ */ function() {
1496
1497
  return false;
1497
1498
  }
1498
1499
  }]);
1499
- return Buffer2;
1500
+ return Buffer22;
1500
1501
  }();
1501
1502
 
1502
1503
  // node_modules/xgplayer-streaming-shared/es/env.js
@@ -1574,7 +1575,7 @@ var ERR_CODE = (_ERR_CODE = {}, _defineProperty2(_ERR_CODE, ERR.MANIFEST, {
1574
1575
  }), _defineProperty2(_ERR_CODE, ERR.DRM, {
1575
1576
  LICENSE: 7100,
1576
1577
  CUSTOM_LICENSE: 7200
1577
- }), _defineProperty2(_ERR_CODE, ERR.OTHER, 8000), _defineProperty2(_ERR_CODE, ERR.RUNTIME, {
1578
+ }), _defineProperty2(_ERR_CODE, ERR.OTHER, 8e3), _defineProperty2(_ERR_CODE, ERR.RUNTIME, {
1578
1579
  NO_CANPLAY_ERROR: 9001,
1579
1580
  BUFFERBREAK_ERROR: 9002,
1580
1581
  WAITING_TIMEOUT_ERROR: 9003
@@ -1585,7 +1586,7 @@ var StreamingError = /* @__PURE__ */ function(_Error) {
1585
1586
  function StreamingError2(type, subType, origin, payload, msg) {
1586
1587
  var _this;
1587
1588
  _classCallCheck2(this, StreamingError2);
1588
- _this = _super.call(this, msg || (origin === null || origin === undefined ? undefined : origin.message));
1589
+ _this = _super.call(this, msg || (origin === null || origin === void 0 ? void 0 : origin.message));
1589
1590
  _this.errorType = type === ERR.NETWORK_TIMEOUT ? ERR.NETWORK : type;
1590
1591
  _this.originError = origin;
1591
1592
  _this.ext = payload;
@@ -1614,10 +1615,10 @@ var StreamingError = /* @__PURE__ */ function(_Error) {
1614
1615
  key: "network",
1615
1616
  value: function network(error) {
1616
1617
  var _error$response;
1617
- return new StreamingError2(error !== null && error !== undefined && error.isTimeout ? ERR.NETWORK_TIMEOUT : ERR.NETWORK, null, error instanceof Error ? error : null, {
1618
- url: error === null || error === undefined ? undefined : error.url,
1619
- response: error === null || error === undefined ? undefined : error.response,
1620
- httpCode: error === null || error === undefined ? undefined : (_error$response = error.response) === null || _error$response === undefined ? undefined : _error$response.status
1618
+ return new StreamingError2(error !== null && error !== void 0 && error.isTimeout ? ERR.NETWORK_TIMEOUT : ERR.NETWORK, null, error instanceof Error ? error : null, {
1619
+ url: error === null || error === void 0 ? void 0 : error.url,
1620
+ response: error === null || error === void 0 ? void 0 : error.response,
1621
+ httpCode: error === null || error === void 0 ? void 0 : (_error$response = error.response) === null || _error$response === void 0 ? void 0 : _error$response.status
1621
1622
  });
1622
1623
  }
1623
1624
  }]);
@@ -1626,32 +1627,32 @@ var StreamingError = /* @__PURE__ */ function(_Error) {
1626
1627
 
1627
1628
  // node_modules/xgplayer-streaming-shared/es/logger.js
1628
1629
  var LogCacheLevel = {
1629
- DEBUG: 1,
1630
- LOG: 2,
1631
- WARN: 3,
1632
- ERROR: 4
1630
+ "DEBUG": 1,
1631
+ "LOG": 2,
1632
+ "WARN": 3,
1633
+ "ERROR": 4
1633
1634
  };
1634
1635
  var LOG_MAX_SIZE = 200 * 1024;
1635
1636
  var SIMPLE_TYPE = ["Boolean", "Number", "String", "Undefined", "Null", "Date", "Object"];
1636
1637
  var Logger = /* @__PURE__ */ function() {
1637
- function Logger2(name, config) {
1638
- _classCallCheck2(this, Logger2);
1638
+ function Logger22(name, config) {
1639
+ _classCallCheck2(this, Logger22);
1639
1640
  this.name = name || "";
1640
1641
  this._prefix = "[".concat(this.name, "]");
1641
- this.logCacheLevel = (config === null || config === undefined ? undefined : config.logCacheLevel) || 3;
1642
- this.logMaxSize = (config === null || config === undefined ? undefined : config.logMaxSize) || LOG_MAX_SIZE;
1642
+ this.logCacheLevel = (config === null || config === void 0 ? void 0 : config.logCacheLevel) || 3;
1643
+ this.logMaxSize = (config === null || config === void 0 ? void 0 : config.logMaxSize) || LOG_MAX_SIZE;
1643
1644
  this.logSize = 0;
1644
1645
  this.logTextArray = [];
1645
1646
  }
1646
- _createClass2(Logger2, [{
1647
+ _createClass2(Logger22, [{
1647
1648
  key: "debug",
1648
1649
  value: function debug() {
1649
1650
  var _console;
1650
- for (var _len = arguments.length, args = new Array(_len), _key = 0;_key < _len; _key++) {
1651
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1651
1652
  args[_key] = arguments[_key];
1652
1653
  }
1653
1654
  this.logCache.apply(this, [LogCacheLevel.DEBUG].concat(args));
1654
- if (Logger2.disabled)
1655
+ if (Logger22.disabled)
1655
1656
  return;
1656
1657
  (_console = console).debug.apply(_console, ["[".concat(nowTime(), "]"), this._prefix].concat(args));
1657
1658
  }
@@ -1659,11 +1660,11 @@ var Logger = /* @__PURE__ */ function() {
1659
1660
  key: "log",
1660
1661
  value: function log() {
1661
1662
  var _console2;
1662
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0;_key2 < _len2; _key2++) {
1663
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
1663
1664
  args[_key2] = arguments[_key2];
1664
1665
  }
1665
1666
  this.logCache.apply(this, [LogCacheLevel.LOG].concat(args));
1666
- if (Logger2.disabled)
1667
+ if (Logger22.disabled)
1667
1668
  return;
1668
1669
  (_console2 = console).log.apply(_console2, ["[".concat(nowTime(), "]"), this._prefix].concat(args));
1669
1670
  }
@@ -1671,11 +1672,11 @@ var Logger = /* @__PURE__ */ function() {
1671
1672
  key: "warn",
1672
1673
  value: function warn() {
1673
1674
  var _console3;
1674
- for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0;_key3 < _len3; _key3++) {
1675
+ for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
1675
1676
  args[_key3] = arguments[_key3];
1676
1677
  }
1677
1678
  this.logCache.apply(this, [LogCacheLevel.WARN].concat(args));
1678
- if (Logger2.disabled)
1679
+ if (Logger22.disabled)
1679
1680
  return;
1680
1681
  (_console3 = console).warn.apply(_console3, ["[".concat(nowTime(), "]"), this._prefix].concat(args));
1681
1682
  }
@@ -1683,11 +1684,11 @@ var Logger = /* @__PURE__ */ function() {
1683
1684
  key: "error",
1684
1685
  value: function error() {
1685
1686
  var _console4;
1686
- for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0;_key4 < _len4; _key4++) {
1687
+ for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
1687
1688
  args[_key4] = arguments[_key4];
1688
1689
  }
1689
1690
  this.logCache.apply(this, [LogCacheLevel.ERROR].concat(args));
1690
- if (Logger2.disabled)
1691
+ if (Logger22.disabled)
1691
1692
  return;
1692
1693
  (_console4 = console).error.apply(_console4, ["[".concat(nowTime(), "]"), this._prefix].concat(args));
1693
1694
  }
@@ -1698,7 +1699,7 @@ var Logger = /* @__PURE__ */ function() {
1698
1699
  return;
1699
1700
  var text = "";
1700
1701
  try {
1701
- for (var _len5 = arguments.length, logText = new Array(_len5 > 1 ? _len5 - 1 : 0), _key5 = 1;_key5 < _len5; _key5++) {
1702
+ for (var _len5 = arguments.length, logText = new Array(_len5 > 1 ? _len5 - 1 : 0), _key5 = 1; _key5 < _len5; _key5++) {
1702
1703
  logText[_key5 - 1] = arguments[_key5];
1703
1704
  }
1704
1705
  var finLogText = logText.map(function(item) {
@@ -1720,8 +1721,7 @@ var Logger = /* @__PURE__ */ function() {
1720
1721
  }, {
1721
1722
  key: "getLogCache",
1722
1723
  value: function getLogCache() {
1723
- var logText = this.logTextArray.join(`
1724
- `);
1724
+ var logText = this.logTextArray.join("\n");
1725
1725
  this.reset();
1726
1726
  return logText;
1727
1727
  }
@@ -1735,7 +1735,7 @@ var Logger = /* @__PURE__ */ function() {
1735
1735
  key: "table",
1736
1736
  value: function table() {
1737
1737
  var _console5;
1738
- if (Logger2.disabled)
1738
+ if (Logger22.disabled)
1739
1739
  return;
1740
1740
  console.group(this._prefix);
1741
1741
  (_console5 = console).table.apply(_console5, arguments);
@@ -1749,19 +1749,19 @@ var Logger = /* @__PURE__ */ function() {
1749
1749
  }], [{
1750
1750
  key: "enable",
1751
1751
  value: function enable() {
1752
- Logger2.disabled = false;
1752
+ Logger22.disabled = false;
1753
1753
  }
1754
1754
  }, {
1755
1755
  key: "disable",
1756
1756
  value: function disable() {
1757
- Logger2.disabled = true;
1757
+ Logger22.disabled = true;
1758
1758
  }
1759
1759
  }]);
1760
- return Logger2;
1760
+ return Logger22;
1761
1761
  }();
1762
1762
  _defineProperty2(Logger, "disabled", true);
1763
1763
  function nowTime() {
1764
- return new Date().toLocaleString();
1764
+ return (/* @__PURE__ */ new Date()).toLocaleString();
1765
1765
  }
1766
1766
  function reduceDepth(val) {
1767
1767
  if (_typeof(val) !== "object") {
@@ -1793,7 +1793,7 @@ function logable(obj, maxDepth, depth) {
1793
1793
  return objType;
1794
1794
  }
1795
1795
  if (depth > maxDepth) {
1796
- return;
1796
+ return void 0;
1797
1797
  }
1798
1798
  for (var key in obj) {
1799
1799
  if (Object.prototype.hasOwnProperty.call(obj, key)) {
@@ -1819,11 +1819,11 @@ function createPublicPromise() {
1819
1819
  promise.used = false;
1820
1820
  promise.resolve = function() {
1821
1821
  promise.used = true;
1822
- return res.apply(undefined, arguments);
1822
+ return res.apply(void 0, arguments);
1823
1823
  };
1824
1824
  promise.reject = function() {
1825
1825
  promise.used = true;
1826
- return rej.apply(undefined, arguments);
1826
+ return rej.apply(void 0, arguments);
1827
1827
  };
1828
1828
  return promise;
1829
1829
  }
@@ -1831,7 +1831,7 @@ function nowTime2() {
1831
1831
  try {
1832
1832
  return parseInt(performance.now(), 10);
1833
1833
  } catch (e) {
1834
- return new Date().getTime();
1834
+ return (/* @__PURE__ */ new Date()).getTime();
1835
1835
  }
1836
1836
  }
1837
1837
  var SafeJSON = {
@@ -1846,21 +1846,22 @@ var SafeJSON = {
1846
1846
  try {
1847
1847
  return JSON.parse(obj);
1848
1848
  } catch (e) {
1849
- return;
1849
+ return void 0;
1850
1850
  }
1851
1851
  }
1852
1852
  };
1853
1853
 
1854
1854
  // node_modules/xgplayer-streaming-shared/es/mse.js
1855
1855
  function getMediaSource() {
1856
- var preferMMS = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
1856
+ var preferMMS = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
1857
1857
  try {
1858
1858
  if (!isBrowser)
1859
1859
  return null;
1860
1860
  if (preferMMS && typeof ManagedMediaSource !== "undefined")
1861
1861
  return ManagedMediaSource;
1862
1862
  return window.MediaSource;
1863
- } catch (e) {}
1863
+ } catch (e) {
1864
+ }
1864
1865
  }
1865
1866
  function isMMS(mediaSource) {
1866
1867
  return /ManagedMediaSource/gi.test(Object.prototype.toString.call(mediaSource));
@@ -1868,7 +1869,7 @@ function isMMS(mediaSource) {
1868
1869
  function getTimeRanges(buffered) {
1869
1870
  var ranges = [];
1870
1871
  if (buffered instanceof TimeRanges) {
1871
- for (var i = 0;i < buffered.length; i++) {
1872
+ for (var i = 0; i < buffered.length; i++) {
1872
1873
  ranges.push({
1873
1874
  start: buffered.start(i),
1874
1875
  end: buffered.end(i)
@@ -1907,19 +1908,19 @@ var MSE = /* @__PURE__ */ function() {
1907
1908
  var queue = _this2._queue[type];
1908
1909
  if (queue) {
1909
1910
  var op = queue[0];
1910
- if (!((op === null || op === undefined ? undefined : op.opName) === OP_NAME.UPDATE_DURATION)) {
1911
+ if (!((op === null || op === void 0 ? void 0 : op.opName) === OP_NAME.UPDATE_DURATION)) {
1911
1912
  queue.shift();
1912
1913
  }
1913
1914
  if (op) {
1914
1915
  var _this2$_sourceBuffer$, _op$context;
1915
1916
  var costtime = nowTime2() - _this2._opst;
1916
- _this2._logger.debug("UpdateEnd(".concat(type, "/").concat(op.opName, ")"), SafeJSON.stringify(getTimeRanges((_this2$_sourceBuffer$ = _this2._sourceBuffer[type]) === null || _this2$_sourceBuffer$ === undefined ? undefined : _this2$_sourceBuffer$.buffered)), costtime, op.context);
1917
+ _this2._logger.debug("UpdateEnd(".concat(type, "/").concat(op.opName, ")"), SafeJSON.stringify(getTimeRanges((_this2$_sourceBuffer$ = _this2._sourceBuffer[type]) === null || _this2$_sourceBuffer$ === void 0 ? void 0 : _this2$_sourceBuffer$.buffered)), costtime, op.context);
1917
1918
  op.promise.resolve({
1918
1919
  name: op.opName,
1919
1920
  context: op.context,
1920
1921
  costtime
1921
1922
  });
1922
- var callback = (_op$context = op.context) === null || _op$context === undefined ? undefined : _op$context.callback;
1923
+ var callback = (_op$context = op.context) === null || _op$context === void 0 ? void 0 : _op$context.callback;
1923
1924
  if (callback && typeof callback === "function") {
1924
1925
  callback(op.context);
1925
1926
  }
@@ -1949,7 +1950,7 @@ var MSE = /* @__PURE__ */ function() {
1949
1950
  key: "isOpened",
1950
1951
  get: function get() {
1951
1952
  var _this$mediaSource;
1952
- return ((_this$mediaSource = this.mediaSource) === null || _this$mediaSource === undefined ? undefined : _this$mediaSource.readyState) === "open";
1953
+ return ((_this$mediaSource = this.mediaSource) === null || _this$mediaSource === void 0 ? void 0 : _this$mediaSource.readyState) === "open";
1953
1954
  }
1954
1955
  }, {
1955
1956
  key: "hasOpTasks",
@@ -1973,7 +1974,7 @@ var MSE = /* @__PURE__ */ function() {
1973
1974
  key: "duration",
1974
1975
  get: function get() {
1975
1976
  var _this$mediaSource2;
1976
- return ((_this$mediaSource2 = this.mediaSource) === null || _this$mediaSource2 === undefined ? undefined : _this$mediaSource2.duration) || -1;
1977
+ return ((_this$mediaSource2 = this.mediaSource) === null || _this$mediaSource2 === void 0 ? void 0 : _this$mediaSource2.duration) || -1;
1977
1978
  }
1978
1979
  }, {
1979
1980
  key: "isEnded",
@@ -2000,7 +2001,8 @@ var MSE = /* @__PURE__ */ function() {
2000
2001
  Object.keys(this._sourceBuffer).forEach(function(k) {
2001
2002
  try {
2002
2003
  bufferEnd = Math.max(_this4.bufferEnd(k) || 0, bufferEnd);
2003
- } catch (error) {}
2004
+ } catch (error) {
2005
+ }
2004
2006
  });
2005
2007
  if (duration < bufferEnd) {
2006
2008
  return Promise.resolve();
@@ -2045,7 +2047,7 @@ var MSE = /* @__PURE__ */ function() {
2045
2047
  var _this6 = this;
2046
2048
  var MediaSource2, ms, useMMS, onOpen;
2047
2049
  return _regeneratorRuntime2().wrap(function _callee$(_context) {
2048
- while (true)
2050
+ while (1)
2049
2051
  switch (_context.prev = _context.next) {
2050
2052
  case 0:
2051
2053
  if (!(this.mediaSource || this.media)) {
@@ -2063,7 +2065,7 @@ var MSE = /* @__PURE__ */ function() {
2063
2065
  throw new Error("Param media or MediaSource does not exist");
2064
2066
  case 6:
2065
2067
  this.media = media;
2066
- ms = this.mediaSource = new MediaSource2;
2068
+ ms = this.mediaSource = new MediaSource2();
2067
2069
  useMMS = isMMS(ms);
2068
2070
  this._st = nowTime2();
2069
2071
  onOpen = function onOpen2() {
@@ -2102,7 +2104,7 @@ var MSE = /* @__PURE__ */ function() {
2102
2104
  var _this7 = this;
2103
2105
  var ms, hasMetadata, mseOpen;
2104
2106
  return _regeneratorRuntime2().wrap(function _callee2$(_context2) {
2105
- while (true)
2107
+ while (1)
2106
2108
  switch (_context2.prev = _context2.next) {
2107
2109
  case 0:
2108
2110
  if (!this._openPromise.used)
@@ -2114,7 +2116,7 @@ var MSE = /* @__PURE__ */ function() {
2114
2116
  if (queue) {
2115
2117
  queue.forEach(function(x) {
2116
2118
  var _x$promise, _x$promise$resolve;
2117
- return (_x$promise = x.promise) === null || _x$promise === undefined ? undefined : (_x$promise$resolve = _x$promise.resolve) === null || _x$promise$resolve === undefined ? undefined : _x$promise$resolve.call(_x$promise);
2119
+ return (_x$promise = x.promise) === null || _x$promise === void 0 ? void 0 : (_x$promise$resolve = _x$promise.resolve) === null || _x$promise$resolve === void 0 ? void 0 : _x$promise$resolve.call(_x$promise);
2118
2120
  });
2119
2121
  }
2120
2122
  });
@@ -2123,12 +2125,14 @@ var MSE = /* @__PURE__ */ function() {
2123
2125
  if (hasMetadata && mseOpen) {
2124
2126
  try {
2125
2127
  ms.endOfStream();
2126
- } catch (error) {}
2128
+ } catch (error) {
2129
+ }
2127
2130
  }
2128
2131
  Object.keys(this._sourceBuffer).forEach(function(k) {
2129
2132
  try {
2130
2133
  ms.removeSourceBuffer(_this7._sourceBuffer[k]);
2131
- } catch (error) {}
2134
+ } catch (error) {
2135
+ }
2132
2136
  });
2133
2137
  if (isMMS(ms)) {
2134
2138
  ms.removeEventListener("startstreaming", this._onStartStreaming);
@@ -2140,7 +2144,8 @@ var MSE = /* @__PURE__ */ function() {
2140
2144
  this.media.removeAttribute("src");
2141
2145
  try {
2142
2146
  this.media.load();
2143
- } catch (error) {}
2147
+ } catch (error) {
2148
+ }
2144
2149
  this.media = null;
2145
2150
  }
2146
2151
  this.mediaSource = null;
@@ -2216,7 +2221,7 @@ var MSE = /* @__PURE__ */ function() {
2216
2221
  return;
2217
2222
  _this9._logger.debug("MSE APPEND START", context);
2218
2223
  _this9._opst = nowTime2();
2219
- (_this9$_sourceBuffer$ = _this9._sourceBuffer[type]) === null || _this9$_sourceBuffer$ === undefined || _this9$_sourceBuffer$.appendBuffer(buffer);
2224
+ (_this9$_sourceBuffer$ = _this9._sourceBuffer[type]) === null || _this9$_sourceBuffer$ === void 0 ? void 0 : _this9$_sourceBuffer$.appendBuffer(buffer);
2220
2225
  }, OP_NAME.APPEND, context);
2221
2226
  }
2222
2227
  }, {
@@ -2257,7 +2262,7 @@ var MSE = /* @__PURE__ */ function() {
2257
2262
  var p;
2258
2263
  Object.keys(this._sourceBuffer).forEach(function(k) {
2259
2264
  var sb = _this12._sourceBuffer[k];
2260
- p = _this12.remove(k, 0, Buffer.end(Buffer.get(sb)));
2265
+ p = _this12.remove(k, 0, Buffer2.end(Buffer2.get(sb)));
2261
2266
  });
2262
2267
  return p;
2263
2268
  }
@@ -2304,7 +2309,7 @@ var MSE = /* @__PURE__ */ function() {
2304
2309
  key: "setLiveSeekableRange",
2305
2310
  value: function setLiveSeekableRange(start, end) {
2306
2311
  var ms = this.mediaSource;
2307
- if (start < 0 || end < start || !(ms !== null && ms !== undefined && ms.setLiveSeekableRange) || ms.readyState !== "open")
2312
+ if (start < 0 || end < start || !(ms !== null && ms !== void 0 && ms.setLiveSeekableRange) || ms.readyState !== "open")
2308
2313
  return;
2309
2314
  ms.setLiveSeekableRange(start, end);
2310
2315
  }
@@ -2316,17 +2321,17 @@ var MSE = /* @__PURE__ */ function() {
2316
2321
  }, {
2317
2322
  key: "buffered",
2318
2323
  value: function buffered(type) {
2319
- return Buffer.get(this._sourceBuffer[type]);
2324
+ return Buffer2.get(this._sourceBuffer[type]);
2320
2325
  }
2321
2326
  }, {
2322
2327
  key: "bufferStart",
2323
2328
  value: function bufferStart(type) {
2324
- return Buffer.start(this.buffered(type));
2329
+ return Buffer2.start(this.buffered(type));
2325
2330
  }
2326
2331
  }, {
2327
2332
  key: "bufferEnd",
2328
2333
  value: function bufferEnd(type) {
2329
- return Buffer.end(this.buffered(type));
2334
+ return Buffer2.end(this.buffered(type));
2330
2335
  }
2331
2336
  }, {
2332
2337
  key: "_enqueueOp",
@@ -2368,7 +2373,7 @@ var MSE = /* @__PURE__ */ function() {
2368
2373
  var _this15 = this;
2369
2374
  var types, waiters;
2370
2375
  return _regeneratorRuntime2().wrap(function _callee3$(_context3) {
2371
- while (true)
2376
+ while (1)
2372
2377
  switch (_context3.prev = _context3.next) {
2373
2378
  case 0:
2374
2379
  if (this.mediaSource) {
@@ -2408,7 +2413,7 @@ var MSE = /* @__PURE__ */ function() {
2408
2413
  types.forEach(function(t) {
2409
2414
  var queue = _this15._queue[t];
2410
2415
  var sb = _this15._sourceBuffer[t];
2411
- queue === null || queue === undefined || queue.shift();
2416
+ queue === null || queue === void 0 ? void 0 : queue.shift();
2412
2417
  if (!sb || !sb.updating) {
2413
2418
  _this15._startQueue(t);
2414
2419
  }
@@ -2443,11 +2448,11 @@ var MSE = /* @__PURE__ */ function() {
2443
2448
  op.context.isFull = true;
2444
2449
  }
2445
2450
  this._logger.error("[MSE error], context,", op.context, " ,name,", op.opName, ",err,SourceBuffer is full");
2446
- op === null || op === undefined || (_op$promise = op.promise) === null || _op$promise === undefined || _op$promise.reject(new StreamingError(ERR.MEDIA, ERR.SUB_TYPES.MSE_FULL, error));
2451
+ op === null || op === void 0 ? void 0 : (_op$promise = op.promise) === null || _op$promise === void 0 ? void 0 : _op$promise.reject(new StreamingError(ERR.MEDIA, ERR.SUB_TYPES.MSE_FULL, error));
2447
2452
  } else {
2448
2453
  var _op$promise2;
2449
2454
  this._logger.error(error);
2450
- op === null || op === undefined || (_op$promise2 = op.promise) === null || _op$promise2 === undefined || _op$promise2.reject(error.constructor === StreamingError ? error : new StreamingError(ERR.MEDIA, ERR.SUB_TYPES.MSE_OTHER, error));
2455
+ op === null || op === void 0 ? void 0 : (_op$promise2 = op.promise) === null || _op$promise2 === void 0 ? void 0 : _op$promise2.reject(error.constructor === StreamingError ? error : new StreamingError(ERR.MEDIA, ERR.SUB_TYPES.MSE_OTHER, error));
2451
2456
  queue.shift();
2452
2457
  this._startQueue(type);
2453
2458
  }
@@ -2461,7 +2466,7 @@ var MSE = /* @__PURE__ */ function() {
2461
2466
  var _this16 = this;
2462
2467
  return this._enqueueOp(type, function() {
2463
2468
  if (timestampOffset < 0) {
2464
- timestampOffset += 0.001;
2469
+ timestampOffset += 1e-3;
2465
2470
  }
2466
2471
  _this16._sourceBuffer[type].timestampOffset = timestampOffset;
2467
2472
  _this16._onSBUpdateEnd(type);
@@ -2482,7 +2487,7 @@ var MSE = /* @__PURE__ */ function() {
2482
2487
  }], [{
2483
2488
  key: "isSupported",
2484
2489
  value: function isSupported() {
2485
- var mime = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'video/mp4; codecs="avc1.42E01E,mp4a.40.2"';
2490
+ var mime = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 'video/mp4; codecs="avc1.42E01E,mp4a.40.2"';
2486
2491
  var MediaSource2 = getMediaSource();
2487
2492
  if (!MediaSource2)
2488
2493
  return false;
@@ -2511,6 +2516,7 @@ var MSE = /* @__PURE__ */ function() {
2511
2516
  }();
2512
2517
  _defineProperty2(MSE, "VIDEO", "video");
2513
2518
  _defineProperty2(MSE, "AUDIO", "audio");
2519
+
2514
2520
  // node_modules/xgplayer-streaming-shared/es/net/types.js
2515
2521
  var LoaderType = {
2516
2522
  FETCH: "fetch",
@@ -2562,7 +2568,7 @@ function isDate(a) {
2562
2568
 
2563
2569
  // node_modules/xgplayer-streaming-shared/es/net/helper.js
2564
2570
  function getRangeValue(value) {
2565
- if (!value || value[0] === null || value[0] === undefined || value[0] === 0 && (value[1] === null || value[1] === undefined)) {
2571
+ if (!value || value[0] === null || value[0] === void 0 || value[0] === 0 && (value[1] === null || value[1] === void 0)) {
2566
2572
  return;
2567
2573
  }
2568
2574
  var ret = "bytes=" + value[0] + "-";
@@ -2581,7 +2587,7 @@ function setUrlParams(url, params) {
2581
2587
  var v;
2582
2588
  var str = Object.keys(params).map(function(k) {
2583
2589
  v = params[k];
2584
- if (v === null || v === undefined)
2590
+ if (v === null || v === void 0)
2585
2591
  return;
2586
2592
  if (Array.isArray(v)) {
2587
2593
  k = k + "[]";
@@ -2607,7 +2613,7 @@ function setUrlParams(url, params) {
2607
2613
  return url;
2608
2614
  }
2609
2615
  function createResponse(data, done, response, contentLength, age, startTime, firstByteTime, index, range, vid, priOptions) {
2610
- age = age !== null && age !== undefined ? parseFloat(age) : null;
2616
+ age = age !== null && age !== void 0 ? parseFloat(age) : null;
2611
2617
  contentLength = parseInt(contentLength || "0", 10);
2612
2618
  if (Number.isNaN(contentLength))
2613
2619
  contentLength = 0;
@@ -2630,7 +2636,7 @@ function createResponse(data, done, response, contentLength, age, startTime, fir
2630
2636
  };
2631
2637
  }
2632
2638
  function calculateSpeed(byteLen, milliSecond) {
2633
- return Math.round(byteLen * 8 * 1000 / milliSecond / 1024);
2639
+ return Math.round(byteLen * 8 * 1e3 / milliSecond / 1024);
2634
2640
  }
2635
2641
 
2636
2642
  // node_modules/xgplayer-streaming-shared/es/event.js
@@ -2671,7 +2677,7 @@ var EVENT = {
2671
2677
  };
2672
2678
 
2673
2679
  // node_modules/xgplayer-streaming-shared/es/net/fetch.js
2674
- var import_eventemitter3 = __toESM(require_eventemitter3(), 1);
2680
+ var import_eventemitter3 = __toESM(require_eventemitter3());
2675
2681
  var CACHESIZE = 2 * 1024 * 1024;
2676
2682
  var FetchLoader = /* @__PURE__ */ function(_EventEmitter) {
2677
2683
  _inherits2(FetchLoader2, _EventEmitter);
@@ -2700,12 +2706,12 @@ var FetchLoader = /* @__PURE__ */ function(_EventEmitter) {
2700
2706
  key: "load",
2701
2707
  value: function load(_ref) {
2702
2708
  var _this$_abortControlle, _this2 = this;
2703
- var { url, vid, timeout, responseType, onProgress, index, onTimeout, onCancel, range, transformResponse, request, params, logger, method, headers, body, mode, credentials, cache, redirect, referrer, referrerPolicy, onProcessMinLen, priOptions } = _ref;
2704
- this._logger = logger;
2709
+ var url = _ref.url, vid = _ref.vid, timeout = _ref.timeout, responseType = _ref.responseType, onProgress = _ref.onProgress, index = _ref.index, onTimeout = _ref.onTimeout, onCancel = _ref.onCancel, range = _ref.range, transformResponse = _ref.transformResponse, request = _ref.request, params = _ref.params, logger4 = _ref.logger, method = _ref.method, headers = _ref.headers, body = _ref.body, mode = _ref.mode, credentials = _ref.credentials, cache = _ref.cache, redirect = _ref.redirect, referrer = _ref.referrer, referrerPolicy = _ref.referrerPolicy, onProcessMinLen = _ref.onProcessMinLen, priOptions = _ref.priOptions;
2710
+ this._logger = logger4;
2705
2711
  this._aborted = false;
2706
2712
  this._onProcessMinLen = onProcessMinLen;
2707
2713
  this._onCancel = onCancel;
2708
- this._abortController = typeof AbortController !== "undefined" && new AbortController;
2714
+ this._abortController = typeof AbortController !== "undefined" && new AbortController();
2709
2715
  this._running = true;
2710
2716
  this._index = index;
2711
2717
  this._range = range || [0, 0];
@@ -2721,7 +2727,7 @@ var FetchLoader = /* @__PURE__ */ function(_EventEmitter) {
2721
2727
  redirect,
2722
2728
  referrer,
2723
2729
  referrerPolicy,
2724
- signal: (_this$_abortControlle = this._abortController) === null || _this$_abortControlle === undefined ? undefined : _this$_abortControlle.signal
2730
+ signal: (_this$_abortControlle = this._abortController) === null || _this$_abortControlle === void 0 ? void 0 : _this$_abortControlle.signal
2725
2731
  };
2726
2732
  var isTimeout = false;
2727
2733
  clearTimeout(this._timeoutTimer);
@@ -2731,7 +2737,7 @@ var FetchLoader = /* @__PURE__ */ function(_EventEmitter) {
2731
2737
  if (request) {
2732
2738
  headers = request.headers;
2733
2739
  } else {
2734
- headers = init.headers = init.headers || (Headers ? new Headers : {});
2740
+ headers = init.headers = init.headers || (Headers ? new Headers() : {});
2735
2741
  }
2736
2742
  if (Headers && headers instanceof Headers) {
2737
2743
  headers.append("Range", rangeValue);
@@ -2758,11 +2764,11 @@ var FetchLoader = /* @__PURE__ */ function(_EventEmitter) {
2758
2764
  var startTime = Date.now();
2759
2765
  this._logger.debug("[fetch load start], index,", index, ",range,", range);
2760
2766
  return new Promise(function(resolve, reject) {
2761
- fetch(request || url, request ? undefined : init).then(/* @__PURE__ */ function() {
2767
+ fetch(request || url, request ? void 0 : init).then(/* @__PURE__ */ function() {
2762
2768
  var _ref2 = _asyncToGenerator2(/* @__PURE__ */ _regeneratorRuntime2().mark(function _callee(response) {
2763
2769
  var firstByteTime, data, costTime, speed;
2764
2770
  return _regeneratorRuntime2().wrap(function _callee$(_context) {
2765
- while (true)
2771
+ while (1)
2766
2772
  switch (_context.prev = _context.next) {
2767
2773
  case 0:
2768
2774
  clearTimeout(_this2._timeoutTimer);
@@ -2851,7 +2857,7 @@ var FetchLoader = /* @__PURE__ */ function(_EventEmitter) {
2851
2857
  _this2._running = false;
2852
2858
  if (_this2._aborted && !isTimeout)
2853
2859
  return;
2854
- error = error instanceof NetError ? error : new NetError(url, init, null, (_error = error) === null || _error === undefined ? undefined : _error.message);
2860
+ error = error instanceof NetError ? error : new NetError(url, init, null, (_error = error) === null || _error === void 0 ? void 0 : _error.message);
2855
2861
  error.startTime = startTime;
2856
2862
  error.endTime = Date.now();
2857
2863
  error.isTimeout = isTimeout;
@@ -2870,7 +2876,7 @@ var FetchLoader = /* @__PURE__ */ function(_EventEmitter) {
2870
2876
  value: function() {
2871
2877
  var _cancel = _asyncToGenerator2(/* @__PURE__ */ _regeneratorRuntime2().mark(function _callee2() {
2872
2878
  return _regeneratorRuntime2().wrap(function _callee2$(_context2) {
2873
- while (true)
2879
+ while (1)
2874
2880
  switch (_context2.prev = _context2.next) {
2875
2881
  case 0:
2876
2882
  if (!this._aborted) {
@@ -2904,7 +2910,8 @@ var FetchLoader = /* @__PURE__ */ function(_EventEmitter) {
2904
2910
  if (this._abortController) {
2905
2911
  try {
2906
2912
  this._abortController.abort();
2907
- } catch (error) {}
2913
+ } catch (error) {
2914
+ }
2908
2915
  this._abortController = null;
2909
2916
  }
2910
2917
  if (this._onCancel) {
@@ -2955,7 +2962,7 @@ var FetchLoader = /* @__PURE__ */ function(_EventEmitter) {
2955
2962
  var _this3$_range;
2956
2963
  var startRange, startByte, curLen, retData, temp, costTime, speed;
2957
2964
  return _regeneratorRuntime2().wrap(function _callee3$(_context3) {
2958
- while (true)
2965
+ while (1)
2959
2966
  switch (_context3.prev = _context3.next) {
2960
2967
  case 0:
2961
2968
  startTime = Date.now();
@@ -2983,14 +2990,14 @@ var FetchLoader = /* @__PURE__ */ function(_EventEmitter) {
2983
2990
  }
2984
2991
  return _context3.abrupt("return");
2985
2992
  case 13:
2986
- startRange = ((_this3$_range = _this3._range) === null || _this3$_range === undefined ? undefined : _this3$_range.length) > 0 ? _this3._range[0] : 0;
2993
+ startRange = ((_this3$_range = _this3._range) === null || _this3$_range === void 0 ? void 0 : _this3$_range.length) > 0 ? _this3._range[0] : 0;
2987
2994
  startByte = startRange + _this3._receivedLength;
2988
2995
  if (!_this3._aborted) {
2989
2996
  _context3.next = 19;
2990
2997
  break;
2991
2998
  }
2992
2999
  _this3._running = false;
2993
- onProgress(undefined, false, {
3000
+ onProgress(void 0, false, {
2994
3001
  range: [startByte, startByte],
2995
3002
  vid: _this3._vid,
2996
3003
  index: _this3._index,
@@ -3004,28 +3011,28 @@ var FetchLoader = /* @__PURE__ */ function(_EventEmitter) {
3004
3011
  case 19:
3005
3012
  curLen = data.value ? data.value.byteLength : 0;
3006
3013
  _this3._receivedLength += curLen;
3007
- _this3._logger.debug("【fetchLoader,onProgress call】,task,", _this3._range, ", start,", startByte, ", end,", startRange + _this3._receivedLength, ", done,", data.done);
3014
+ _this3._logger.debug("\u3010fetchLoader,onProgress call\u3011,task,", _this3._range, ", start,", startByte, ", end,", startRange + _this3._receivedLength, ", done,", data.done);
3008
3015
  if (_this3._onProcessMinLen > 0) {
3009
3016
  if (_this3._writeIdx + curLen >= _this3._onProcessMinLen || data.done) {
3010
3017
  retData = new Uint8Array(_this3._writeIdx + curLen);
3011
3018
  retData.set(_this3._cache.slice(0, _this3._writeIdx), 0);
3012
3019
  curLen > 0 && retData.set(data.value, _this3._writeIdx);
3013
3020
  _this3._writeIdx = 0;
3014
- _this3._logger.debug("【fetchLoader,onProgress enough】,done,", data.done, ",len,", retData.byteLength, ", writeIdx,", _this3._writeIdx);
3021
+ _this3._logger.debug("\u3010fetchLoader,onProgress enough\u3011,done,", data.done, ",len,", retData.byteLength, ", writeIdx,", _this3._writeIdx);
3015
3022
  } else {
3016
3023
  if (curLen > 0 && _this3._writeIdx + curLen < CACHESIZE) {
3017
3024
  _this3._cache.set(data.value, _this3._writeIdx);
3018
3025
  _this3._writeIdx += curLen;
3019
- _this3._logger.debug("【fetchLoader,onProgress cache】,len,", curLen, ", writeIdx,", _this3._writeIdx);
3026
+ _this3._logger.debug("\u3010fetchLoader,onProgress cache\u3011,len,", curLen, ", writeIdx,", _this3._writeIdx);
3020
3027
  } else if (curLen > 0) {
3021
3028
  temp = new Uint8Array(_this3._writeIdx + curLen + 2048);
3022
- _this3._logger.debug("【fetchLoader,onProgress extra start】,size,", _this3._writeIdx + curLen + 2048, ", datalen,", curLen, ", writeIdx,", _this3._writeIdx);
3029
+ _this3._logger.debug("\u3010fetchLoader,onProgress extra start\u3011,size,", _this3._writeIdx + curLen + 2048, ", datalen,", curLen, ", writeIdx,", _this3._writeIdx);
3023
3030
  temp.set(_this3._cache.slice(0, _this3._writeIdx), 0);
3024
3031
  curLen > 0 && temp.set(data.value, _this3._writeIdx);
3025
3032
  _this3._writeIdx += curLen;
3026
3033
  delete _this3._cache;
3027
3034
  _this3._cache = temp;
3028
- _this3._logger.debug("【fetchLoader,onProgress extra end】,len,", curLen, ", writeIdx,", _this3._writeIdx);
3035
+ _this3._logger.debug("\u3010fetchLoader,onProgress extra end\u3011,len,", curLen, ", writeIdx,", _this3._writeIdx);
3029
3036
  }
3030
3037
  }
3031
3038
  } else {
@@ -3103,32 +3110,32 @@ function getConfig(cfg) {
3103
3110
  retryDelay: 0,
3104
3111
  timeout: 0,
3105
3112
  request: null,
3106
- onTimeout: undefined,
3107
- onProgress: undefined,
3108
- onRetryError: undefined,
3109
- transformRequest: undefined,
3110
- transformResponse: undefined,
3111
- transformError: undefined,
3113
+ onTimeout: void 0,
3114
+ onProgress: void 0,
3115
+ onRetryError: void 0,
3116
+ transformRequest: void 0,
3117
+ transformResponse: void 0,
3118
+ transformError: void 0,
3112
3119
  responseType: ResponseType.TEXT,
3113
- range: undefined,
3120
+ range: void 0,
3114
3121
  url: "",
3115
- params: undefined,
3122
+ params: void 0,
3116
3123
  method: "GET",
3117
3124
  headers: {},
3118
- body: undefined,
3119
- mode: undefined,
3120
- credentials: undefined,
3121
- cache: undefined,
3122
- redirect: undefined,
3123
- referrer: undefined,
3124
- referrerPolicy: undefined,
3125
- integrity: undefined,
3125
+ body: void 0,
3126
+ mode: void 0,
3127
+ credentials: void 0,
3128
+ cache: void 0,
3129
+ redirect: void 0,
3130
+ referrer: void 0,
3131
+ referrerPolicy: void 0,
3132
+ integrity: void 0,
3126
3133
  onProcessMinLen: 0
3127
3134
  }, cfg);
3128
3135
  }
3129
3136
 
3130
3137
  // node_modules/xgplayer-streaming-shared/es/net/xhr.js
3131
- var import_eventemitter32 = __toESM(require_eventemitter3(), 1);
3138
+ var import_eventemitter32 = __toESM(require_eventemitter3());
3132
3139
  var XhrLoader = /* @__PURE__ */ function(_EventEmitter) {
3133
3140
  _inherits2(XhrLoader2, _EventEmitter);
3134
3141
  var _super = _createSuper2(XhrLoader2);
@@ -3155,11 +3162,11 @@ var XhrLoader = /* @__PURE__ */ function(_EventEmitter) {
3155
3162
  _defineProperty2(_assertThisInitialized2(_this), "_runing", false);
3156
3163
  _defineProperty2(_assertThisInitialized2(_this), "_logger", false);
3157
3164
  _defineProperty2(_assertThisInitialized2(_this), "_vid", "");
3158
- _defineProperty2(_assertThisInitialized2(_this), "_responseType", undefined);
3159
- _defineProperty2(_assertThisInitialized2(_this), "_credentials", undefined);
3160
- _defineProperty2(_assertThisInitialized2(_this), "_method", undefined);
3161
- _defineProperty2(_assertThisInitialized2(_this), "_transformResponse", undefined);
3162
- _defineProperty2(_assertThisInitialized2(_this), "_firstRtt", undefined);
3165
+ _defineProperty2(_assertThisInitialized2(_this), "_responseType", void 0);
3166
+ _defineProperty2(_assertThisInitialized2(_this), "_credentials", void 0);
3167
+ _defineProperty2(_assertThisInitialized2(_this), "_method", void 0);
3168
+ _defineProperty2(_assertThisInitialized2(_this), "_transformResponse", void 0);
3169
+ _defineProperty2(_assertThisInitialized2(_this), "_firstRtt", void 0);
3163
3170
  _defineProperty2(_assertThisInitialized2(_this), "_onCancel", null);
3164
3171
  _defineProperty2(_assertThisInitialized2(_this), "_priOptions", null);
3165
3172
  return _this;
@@ -3186,7 +3193,7 @@ var XhrLoader = /* @__PURE__ */ function(_EventEmitter) {
3186
3193
  this._onCancel = req.onCancel;
3187
3194
  this._request = req.request;
3188
3195
  this._priOptions = req.priOptions || {};
3189
- this._logger.debug("【xhrLoader task】, range", this._range);
3196
+ this._logger.debug("\u3010xhrLoader task\u3011, range", this._range);
3190
3197
  this._url = setUrlParams(req.url, req.params);
3191
3198
  var startTime = Date.now();
3192
3199
  return new Promise(function(resolve, reject) {
@@ -3237,7 +3244,7 @@ var XhrLoader = /* @__PURE__ */ function(_EventEmitter) {
3237
3244
  var _this3 = this;
3238
3245
  try {
3239
3246
  this._startTime = Date.now();
3240
- var xhr = this._xhr = new XMLHttpRequest;
3247
+ var xhr = this._xhr = new XMLHttpRequest();
3241
3248
  xhr.open(this._method || "GET", this._url, true);
3242
3249
  xhr.responseType = this._responseType;
3243
3250
  this._timeout && (xhr.timeout = this._timeout);
@@ -3247,7 +3254,7 @@ var XhrLoader = /* @__PURE__ */ function(_EventEmitter) {
3247
3254
  xhr.onerror = function(errorEvent) {
3248
3255
  var _errorEvent$currentTa, _errorEvent$currentTa2, _errorEvent$currentTa3;
3249
3256
  _this3._running = false;
3250
- var error = new NetError(_this3._url, _this3._request, errorEvent === null || errorEvent === undefined ? undefined : (_errorEvent$currentTa = errorEvent.currentTarget) === null || _errorEvent$currentTa === undefined ? undefined : _errorEvent$currentTa.response, "xhr.onerror.status:" + (errorEvent === null || errorEvent === undefined ? undefined : (_errorEvent$currentTa2 = errorEvent.currentTarget) === null || _errorEvent$currentTa2 === undefined ? undefined : _errorEvent$currentTa2.status) + ",statusText," + (errorEvent === null || errorEvent === undefined ? undefined : (_errorEvent$currentTa3 = errorEvent.currentTarget) === null || _errorEvent$currentTa3 === undefined ? undefined : _errorEvent$currentTa3.statusText));
3257
+ var error = new NetError(_this3._url, _this3._request, errorEvent === null || errorEvent === void 0 ? void 0 : (_errorEvent$currentTa = errorEvent.currentTarget) === null || _errorEvent$currentTa === void 0 ? void 0 : _errorEvent$currentTa.response, "xhr.onerror.status:" + (errorEvent === null || errorEvent === void 0 ? void 0 : (_errorEvent$currentTa2 = errorEvent.currentTarget) === null || _errorEvent$currentTa2 === void 0 ? void 0 : _errorEvent$currentTa2.status) + ",statusText," + (errorEvent === null || errorEvent === void 0 ? void 0 : (_errorEvent$currentTa3 = errorEvent.currentTarget) === null || _errorEvent$currentTa3 === void 0 ? void 0 : _errorEvent$currentTa3.statusText));
3251
3258
  error.options = {
3252
3259
  index: _this3._index,
3253
3260
  range: _this3._range,
@@ -3328,7 +3335,7 @@ var XhrLoader = /* @__PURE__ */ function(_EventEmitter) {
3328
3335
  var data = null;
3329
3336
  var done = false;
3330
3337
  var byteStart;
3331
- var startRange = ((_this$_range = this._range) === null || _this$_range === undefined ? undefined : _this$_range.length) > 0 ? this._range[0] : 0;
3338
+ var startRange = ((_this$_range = this._range) === null || _this$_range === void 0 ? void 0 : _this$_range.length) > 0 ? this._range[0] : 0;
3332
3339
  if (this._responseType === ResponseType.ARRAY_BUFFER) {
3333
3340
  var _this$_range2;
3334
3341
  var chunk = new Uint8Array(e.target.response);
@@ -3348,7 +3355,7 @@ var XhrLoader = /* @__PURE__ */ function(_EventEmitter) {
3348
3355
  });
3349
3356
  }
3350
3357
  data = chunk;
3351
- if (((_this$_range2 = this._range) === null || _this$_range2 === undefined ? undefined : _this$_range2.length) > 1 && this._range[1] && this._receivedLength < this._range[1] - this._range[0]) {
3358
+ if (((_this$_range2 = this._range) === null || _this$_range2 === void 0 ? void 0 : _this$_range2.length) > 1 && this._range[1] && this._receivedLength < this._range[1] - this._range[0]) {
3352
3359
  done = false;
3353
3360
  } else {
3354
3361
  done = true;
@@ -3422,12 +3429,11 @@ var XhrLoader = /* @__PURE__ */ function(_EventEmitter) {
3422
3429
  }, {
3423
3430
  key: "_getHeaders",
3424
3431
  value: function _getHeaders(xhr) {
3425
- var headerLines = xhr.getAllResponseHeaders().trim().split(`\r
3426
- `);
3432
+ var headerLines = xhr.getAllResponseHeaders().trim().split("\r\n");
3427
3433
  var headers = {};
3428
3434
  var _iterator = _createForOfIteratorHelper(headerLines), _step;
3429
3435
  try {
3430
- for (_iterator.s();!(_step = _iterator.n()).done; ) {
3436
+ for (_iterator.s(); !(_step = _iterator.n()).done; ) {
3431
3437
  var header = _step.value;
3432
3438
  var parts = header.split(": ");
3433
3439
  headers[parts[0].toLowerCase()] = parts.slice(1).join(": ");
@@ -3457,7 +3463,7 @@ var Task = /* @__PURE__ */ function() {
3457
3463
  this.alive = !!config.onProgress;
3458
3464
  !config.logger && (config.logger = new Logger("Loader"));
3459
3465
  this._loaderType = type;
3460
- this._loader = type === LoaderType.FETCH && typeof fetch !== "undefined" ? new FetchLoader : new XhrLoader;
3466
+ this._loader = type === LoaderType.FETCH && typeof fetch !== "undefined" ? new FetchLoader() : new XhrLoader();
3461
3467
  this._config = config;
3462
3468
  this._retryCount = 0;
3463
3469
  this._retryTimer = null;
@@ -3474,7 +3480,7 @@ var Task = /* @__PURE__ */ function() {
3474
3480
  var _ref = _asyncToGenerator2(/* @__PURE__ */ _regeneratorRuntime2().mark(function _callee() {
3475
3481
  var response, error, isRetry;
3476
3482
  return _regeneratorRuntime2().wrap(function _callee$(_context) {
3477
- while (true)
3483
+ while (1)
3478
3484
  switch (_context.prev = _context.next) {
3479
3485
  case 0:
3480
3486
  _context.prev = 0;
@@ -3542,7 +3548,7 @@ var Task = /* @__PURE__ */ function() {
3542
3548
  value: function() {
3543
3549
  var _cancel = _asyncToGenerator2(/* @__PURE__ */ _regeneratorRuntime2().mark(function _callee2() {
3544
3550
  return _regeneratorRuntime2().wrap(function _callee2$(_context2) {
3545
- while (true)
3551
+ while (1)
3546
3552
  switch (_context2.prev = _context2.next) {
3547
3553
  case 0:
3548
3554
  clearTimeout(this._retryTimer);
@@ -3596,7 +3602,7 @@ function getVideoPlaybackQuality(video) {
3596
3602
  };
3597
3603
  }
3598
3604
  function concatUint8Array() {
3599
- for (var _len = arguments.length, arr = new Array(_len), _key = 0;_key < _len; _key++) {
3605
+ for (var _len = arguments.length, arr = new Array(_len), _key = 0; _key < _len; _key++) {
3600
3606
  arr[_key] = arguments[_key];
3601
3607
  }
3602
3608
  arr = arr.filter(Boolean);
@@ -3613,14 +3619,14 @@ function concatUint8Array() {
3613
3619
  return data;
3614
3620
  }
3615
3621
  function sleep() {
3616
- var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
3622
+ var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
3617
3623
  return new Promise(function(resolve) {
3618
3624
  return setTimeout(resolve, t);
3619
3625
  });
3620
3626
  }
3621
3627
 
3622
3628
  // node_modules/xgplayer-streaming-shared/es/net/index.js
3623
- var import_eventemitter33 = __toESM(require_eventemitter3(), 1);
3629
+ var import_eventemitter33 = __toESM(require_eventemitter3());
3624
3630
  var NetLoader = /* @__PURE__ */ function(_EventEmitter) {
3625
3631
  _inherits2(NetLoader2, _EventEmitter);
3626
3632
  var _super = _createSuper2(NetLoader2);
@@ -3633,7 +3639,7 @@ var NetLoader = /* @__PURE__ */ function(_EventEmitter) {
3633
3639
  _defineProperty2(_assertThisInitialized2(_this), "_alive", []);
3634
3640
  _defineProperty2(_assertThisInitialized2(_this), "_currentTask", null);
3635
3641
  _defineProperty2(_assertThisInitialized2(_this), "_finnalUrl", "");
3636
- _defineProperty2(_assertThisInitialized2(_this), "_config", undefined);
3642
+ _defineProperty2(_assertThisInitialized2(_this), "_config", void 0);
3637
3643
  _this._config = getConfig(cfg);
3638
3644
  if (_this._config.loaderType === LoaderType.XHR || !FetchLoader.isSupported()) {
3639
3645
  _this.type = LoaderType.XHR;
@@ -3650,7 +3656,7 @@ var NetLoader = /* @__PURE__ */ function(_EventEmitter) {
3650
3656
  key: "load",
3651
3657
  value: function load(url) {
3652
3658
  var _this2 = this;
3653
- var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
3659
+ var config = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
3654
3660
  if (typeof url === "string" || !url) {
3655
3661
  config.url = url || config.url || this._config.url;
3656
3662
  } else {
@@ -3683,7 +3689,7 @@ var NetLoader = /* @__PURE__ */ function(_EventEmitter) {
3683
3689
  var _cancel = _asyncToGenerator2(/* @__PURE__ */ _regeneratorRuntime2().mark(function _callee() {
3684
3690
  var cancels;
3685
3691
  return _regeneratorRuntime2().wrap(function _callee$(_context) {
3686
- while (true)
3692
+ while (1)
3687
3693
  switch (_context.prev = _context.next) {
3688
3694
  case 0:
3689
3695
  cancels = this._queue.map(function(t) {
@@ -3722,12 +3728,13 @@ var NetLoader = /* @__PURE__ */ function(_EventEmitter) {
3722
3728
  if (this._currentTask.alive) {
3723
3729
  this._alive.push(this._currentTask);
3724
3730
  }
3725
- var req = this._currentTask.exec().catch(function(e) {});
3731
+ var req = this._currentTask.exec().catch(function(e) {
3732
+ });
3726
3733
  if (!(req && typeof req.finally === "function"))
3727
3734
  return;
3728
3735
  req.finally(function() {
3729
3736
  var _this3$_currentTask, _this3$_alive;
3730
- if ((_this3$_currentTask = _this3._currentTask) !== null && _this3$_currentTask !== undefined && _this3$_currentTask.alive && ((_this3$_alive = _this3._alive) === null || _this3$_alive === undefined ? undefined : _this3$_alive.length) > 0) {
3737
+ if ((_this3$_currentTask = _this3._currentTask) !== null && _this3$_currentTask !== void 0 && _this3$_currentTask.alive && ((_this3$_alive = _this3._alive) === null || _this3$_alive === void 0 ? void 0 : _this3$_alive.length) > 0) {
3731
3738
  _this3._alive = _this3._alive.filter(function(task) {
3732
3739
  return task && task !== _this3._currentTask;
3733
3740
  });
@@ -3743,6 +3750,7 @@ var NetLoader = /* @__PURE__ */ function(_EventEmitter) {
3743
3750
  }]);
3744
3751
  return NetLoader2;
3745
3752
  }(import_eventemitter33.default);
3753
+
3746
3754
  // node_modules/xgplayer-streaming-shared/es/services/gap.js
3747
3755
  var GapService = /* @__PURE__ */ function() {
3748
3756
  function GapService2() {
@@ -3752,15 +3760,15 @@ var GapService = /* @__PURE__ */ function() {
3752
3760
  _createClass2(GapService2, [{
3753
3761
  key: "do",
3754
3762
  value: function _do(media) {
3755
- var maxJumpDistance = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 3;
3756
- var isLive = arguments.length > 2 ? arguments[2] : undefined;
3757
- var seekThreshold = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
3763
+ var maxJumpDistance = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 3;
3764
+ var isLive = arguments.length > 2 ? arguments[2] : void 0;
3765
+ var seekThreshold = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 1;
3758
3766
  if (!media)
3759
3767
  return;
3760
3768
  var currentTime = media.currentTime;
3761
3769
  var jumpTo = 0;
3762
3770
  if (this._prevCurrentTime === currentTime) {
3763
- var info = Buffer.info(Buffer.get(media), currentTime);
3771
+ var info = Buffer2.info(Buffer2.get(media), currentTime);
3764
3772
  if (!info.buffers.length)
3765
3773
  return;
3766
3774
  if (isLive && info.nextStart || info.nextStart && info.nextStart - currentTime < maxJumpDistance) {
@@ -3777,12 +3785,13 @@ var GapService = /* @__PURE__ */ function() {
3777
3785
  }]);
3778
3786
  return GapService2;
3779
3787
  }();
3788
+
3780
3789
  // node_modules/xgplayer-streaming-shared/es/services/sei.js
3781
3790
  var SeiService = /* @__PURE__ */ function() {
3782
3791
  function SeiService2(emitter) {
3783
3792
  var _this = this;
3784
3793
  _classCallCheck2(this, SeiService2);
3785
- _defineProperty2(this, "_seiSet", /* @__PURE__ */ new Set);
3794
+ _defineProperty2(this, "_seiSet", /* @__PURE__ */ new Set());
3786
3795
  this.emitter = emitter;
3787
3796
  emitter.on(EVENT.SEI, function(sei) {
3788
3797
  if (sei)
@@ -3793,7 +3802,7 @@ var SeiService = /* @__PURE__ */ function() {
3793
3802
  key: "throw",
3794
3803
  value: function _throw(currentTime, isLive) {
3795
3804
  var _this2 = this;
3796
- if (currentTime === null || currentTime === undefined || !this._seiSet.size)
3805
+ if (currentTime === null || currentTime === void 0 || !this._seiSet.size)
3797
3806
  return;
3798
3807
  var min = currentTime - 0.2;
3799
3808
  var max = currentTime + 0.2;
@@ -3823,11 +3832,12 @@ var SeiService = /* @__PURE__ */ function() {
3823
3832
  }]);
3824
3833
  return SeiService2;
3825
3834
  }();
3835
+
3826
3836
  // node_modules/xgplayer-streaming-shared/es/services/bandwidth.js
3827
- var SKIP_SMALL_CHUNK = 1000;
3837
+ var SKIP_SMALL_CHUNK = 1e3;
3828
3838
  var MAX_CHUNK_SAVE_SIZE = 50;
3829
3839
  var MAX_SEGMENT_SAVE_SIZE = 3;
3830
- var LONGTIME_NO_RECEIVE = 3000;
3840
+ var LONGTIME_NO_RECEIVE = 3e3;
3831
3841
  var BandwidthService = /* @__PURE__ */ function() {
3832
3842
  function BandwidthService2(opts) {
3833
3843
  _classCallCheck2(this, BandwidthService2);
@@ -3843,24 +3853,24 @@ var BandwidthService = /* @__PURE__ */ function() {
3843
3853
  value: function addRecord(totalByte, ms) {
3844
3854
  if (!totalByte || !ms)
3845
3855
  return;
3846
- this._speeds.push(8000 * totalByte / ms);
3856
+ this._speeds.push(8e3 * totalByte / ms);
3847
3857
  this._speeds = this._speeds.slice(-MAX_SEGMENT_SAVE_SIZE);
3848
3858
  }
3849
3859
  }, {
3850
3860
  key: "addChunkRecord",
3851
3861
  value: function addChunkRecord(totalByte, ms) {
3852
3862
  var _this$_opts, _this$_opts2;
3853
- if (!totalByte || !ms || totalByte < (((_this$_opts = this._opts) === null || _this$_opts === undefined ? undefined : _this$_opts.skipChunkSize) || SKIP_SMALL_CHUNK))
3863
+ if (!totalByte || !ms || totalByte < (((_this$_opts = this._opts) === null || _this$_opts === void 0 ? void 0 : _this$_opts.skipChunkSize) || SKIP_SMALL_CHUNK))
3854
3864
  return;
3855
3865
  this._totalSize += totalByte;
3856
3866
  this._totalCost += ms;
3857
- this._chunkSpeed = 8000 * totalByte / ms;
3867
+ this._chunkSpeed = 8e3 * totalByte / ms;
3858
3868
  this._chunkCache.push({
3859
3869
  size: totalByte,
3860
3870
  duration: ms,
3861
3871
  timestamp: performance.now()
3862
3872
  });
3863
- var size = ((_this$_opts2 = this._opts) === null || _this$_opts2 === undefined ? undefined : _this$_opts2.chunkCountForSpeed) || MAX_CHUNK_SAVE_SIZE;
3873
+ var size = ((_this$_opts2 = this._opts) === null || _this$_opts2 === void 0 ? void 0 : _this$_opts2.chunkCountForSpeed) || MAX_CHUNK_SAVE_SIZE;
3864
3874
  if (this._chunkCache.length > size) {
3865
3875
  this._chunkCache = this._chunkCache.slice(-size);
3866
3876
  }
@@ -3878,7 +3888,7 @@ var BandwidthService = /* @__PURE__ */ function() {
3878
3888
  }
3879
3889
  var lastSample = this._chunkCache[this._chunkCache.length - 1];
3880
3890
  var cost = performance.now() - lastSample.timestamp;
3881
- if (cost > (((_this$_opts3 = this._opts) === null || _this$_opts3 === undefined ? undefined : _this$_opts3.longtimeNoReceived) || LONGTIME_NO_RECEIVE)) {
3891
+ if (cost > (((_this$_opts3 = this._opts) === null || _this$_opts3 === void 0 ? void 0 : _this$_opts3.longtimeNoReceived) || LONGTIME_NO_RECEIVE)) {
3882
3892
  this._chunkCache.push({
3883
3893
  size: 0,
3884
3894
  duration: cost,
@@ -3891,7 +3901,7 @@ var BandwidthService = /* @__PURE__ */ function() {
3891
3901
  var totalDuration = this._chunkCache.reduce(function(a, c) {
3892
3902
  return a += c.duration;
3893
3903
  }, 0);
3894
- return 8000 * totalSize / totalDuration;
3904
+ return 8e3 * totalSize / totalDuration;
3895
3905
  }
3896
3906
  }, {
3897
3907
  key: "getLatestSpeed",
@@ -3924,8 +3934,9 @@ var BandwidthService = /* @__PURE__ */ function() {
3924
3934
  }]);
3925
3935
  return BandwidthService2;
3926
3936
  }();
3937
+
3927
3938
  // node_modules/xgplayer-streaming-shared/es/services/stats.js
3928
- var import_eventemitter34 = __toESM(require_eventemitter3(), 1);
3939
+ var import_eventemitter34 = __toESM(require_eventemitter3());
3929
3940
  var Stats = /* @__PURE__ */ function() {
3930
3941
  function Stats2(timescale) {
3931
3942
  _classCallCheck2(this, Stats2);
@@ -3972,7 +3983,7 @@ var Stats = /* @__PURE__ */ function() {
3972
3983
  value: function setFpsFromScriptData(_ref) {
3973
3984
  var _data$onMetaData;
3974
3985
  var data = _ref.data;
3975
- var fps = data === null || data === undefined ? undefined : (_data$onMetaData = data.onMetaData) === null || _data$onMetaData === undefined ? undefined : _data$onMetaData.framerate;
3986
+ var fps = data === null || data === void 0 ? void 0 : (_data$onMetaData = data.onMetaData) === null || _data$onMetaData === void 0 ? void 0 : _data$onMetaData.framerate;
3976
3987
  if (fps && fps > 0 && fps < 100) {
3977
3988
  this.fps = fps;
3978
3989
  }
@@ -4022,11 +4033,11 @@ var Stats = /* @__PURE__ */ function() {
4022
4033
  if (sample.gopId === _this._startGopId) {
4023
4034
  _this.gop++;
4024
4035
  }
4025
- _this._bitsAccumulateDuration += sample.duration / (_this._timescale / 1000);
4036
+ _this._bitsAccumulateDuration += sample.duration / (_this._timescale / 1e3);
4026
4037
  _this._bitsAccumulateSize += sample.units.reduce(function(a, c) {
4027
4038
  return a += c.length;
4028
4039
  }, 0);
4029
- if (_this._bitsAccumulateDuration >= 1000) {
4040
+ if (_this._bitsAccumulateDuration >= 1e3) {
4030
4041
  _this.bitrate = _this._bitsAccumulateSize * 8;
4031
4042
  _this._bitsAccumulateDuration = 0;
4032
4043
  _this._bitsAccumulateSize = 0;
@@ -4038,7 +4049,7 @@ var Stats = /* @__PURE__ */ function() {
4038
4049
  }();
4039
4050
  var MediaStatsService = /* @__PURE__ */ function() {
4040
4051
  function MediaStatsService2(core) {
4041
- var timescale = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1000;
4052
+ var timescale = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 1e3;
4042
4053
  _classCallCheck2(this, MediaStatsService2);
4043
4054
  _defineProperty2(this, "_core", null);
4044
4055
  _defineProperty2(this, "_samples", []);
@@ -4051,14 +4062,14 @@ var MediaStatsService = /* @__PURE__ */ function() {
4051
4062
  key: "getStats",
4052
4063
  value: function getStats() {
4053
4064
  var _this$_core, _this$_core2, _this$_core2$speedInf, _this$_core3, _this$_core3$speedInf, _this$_core4, _this$_core4$speedInf, _this$_core5, _this$_core5$speedInf, _this$_core6, _this$_core6$bufferIn;
4054
- var _ref2 = ((_this$_core = this._core) === null || _this$_core === undefined ? undefined : _this$_core.media) || {}, _ref2$currentTime = _ref2.currentTime, currentTime = _ref2$currentTime === undefined ? 0 : _ref2$currentTime, _ref2$decodeFps = _ref2.decodeFps, decodeFps = _ref2$decodeFps === undefined ? 0 : _ref2$decodeFps;
4065
+ var _ref2 = ((_this$_core = this._core) === null || _this$_core === void 0 ? void 0 : _this$_core.media) || {}, _ref2$currentTime = _ref2.currentTime, currentTime = _ref2$currentTime === void 0 ? 0 : _ref2$currentTime, _ref2$decodeFps = _ref2.decodeFps, decodeFps = _ref2$decodeFps === void 0 ? 0 : _ref2$decodeFps;
4055
4066
  return _objectSpread22(_objectSpread22({}, this._stats.getStats()), {}, {
4056
- downloadSpeed: ((_this$_core2 = this._core) === null || _this$_core2 === undefined ? undefined : (_this$_core2$speedInf = _this$_core2.speedInfo) === null || _this$_core2$speedInf === undefined ? undefined : _this$_core2$speedInf.call(_this$_core2).speed) || 0,
4057
- avgSpeed: ((_this$_core3 = this._core) === null || _this$_core3 === undefined ? undefined : (_this$_core3$speedInf = _this$_core3.speedInfo) === null || _this$_core3$speedInf === undefined ? undefined : _this$_core3$speedInf.call(_this$_core3).avgSpeed) || 0,
4058
- totalReceivedByte: ((_this$_core4 = this._core) === null || _this$_core4 === undefined ? undefined : (_this$_core4$speedInf = _this$_core4.speedInfo) === null || _this$_core4$speedInf === undefined ? undefined : _this$_core4$speedInf.call(_this$_core4).totalSize) || 0,
4059
- totalReceivedCost: ((_this$_core5 = this._core) === null || _this$_core5 === undefined ? undefined : (_this$_core5$speedInf = _this$_core5.speedInfo) === null || _this$_core5$speedInf === undefined ? undefined : _this$_core5$speedInf.call(_this$_core5).totalCost) || 0,
4067
+ downloadSpeed: ((_this$_core2 = this._core) === null || _this$_core2 === void 0 ? void 0 : (_this$_core2$speedInf = _this$_core2.speedInfo) === null || _this$_core2$speedInf === void 0 ? void 0 : _this$_core2$speedInf.call(_this$_core2).speed) || 0,
4068
+ avgSpeed: ((_this$_core3 = this._core) === null || _this$_core3 === void 0 ? void 0 : (_this$_core3$speedInf = _this$_core3.speedInfo) === null || _this$_core3$speedInf === void 0 ? void 0 : _this$_core3$speedInf.call(_this$_core3).avgSpeed) || 0,
4069
+ totalReceivedByte: ((_this$_core4 = this._core) === null || _this$_core4 === void 0 ? void 0 : (_this$_core4$speedInf = _this$_core4.speedInfo) === null || _this$_core4$speedInf === void 0 ? void 0 : _this$_core4$speedInf.call(_this$_core4).totalSize) || 0,
4070
+ totalReceivedCost: ((_this$_core5 = this._core) === null || _this$_core5 === void 0 ? void 0 : (_this$_core5$speedInf = _this$_core5.speedInfo) === null || _this$_core5$speedInf === void 0 ? void 0 : _this$_core5$speedInf.call(_this$_core5).totalCost) || 0,
4060
4071
  currentTime,
4061
- bufferEnd: ((_this$_core6 = this._core) === null || _this$_core6 === undefined ? undefined : (_this$_core6$bufferIn = _this$_core6.bufferInfo()) === null || _this$_core6$bufferIn === undefined ? undefined : _this$_core6$bufferIn.remaining) || 0,
4072
+ bufferEnd: ((_this$_core6 = this._core) === null || _this$_core6 === void 0 ? void 0 : (_this$_core6$bufferIn = _this$_core6.bufferInfo()) === null || _this$_core6$bufferIn === void 0 ? void 0 : _this$_core6$bufferIn.remaining) || 0,
4062
4073
  decodeFps
4063
4074
  });
4064
4075
  }
@@ -4093,27 +4104,28 @@ var MediaStatsService = /* @__PURE__ */ function() {
4093
4104
  }]);
4094
4105
  return MediaStatsService2;
4095
4106
  }();
4107
+
4096
4108
  // node_modules/xgplayer-flv/es/flv/index.js
4097
- var import_eventemitter35 = __toESM(require_eventemitter3(), 1);
4109
+ var import_eventemitter35 = __toESM(require_eventemitter3());
4098
4110
 
4099
4111
  // node_modules/xgplayer-transmuxer/es/_virtual/_rollupPluginBabelHelpers.js
4100
4112
  function _iterableToArrayLimit(arr, i) {
4101
- var _i = arr == null ? null : typeof Symbol != "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
4102
- if (_i != null) {
4113
+ var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
4114
+ if (null != _i) {
4103
4115
  var _s, _e, _x, _r, _arr = [], _n = true, _d = false;
4104
4116
  try {
4105
- if (_x = (_i = _i.call(arr)).next, i === 0) {
4117
+ if (_x = (_i = _i.call(arr)).next, 0 === i) {
4106
4118
  if (Object(_i) !== _i)
4107
4119
  return;
4108
4120
  _n = false;
4109
4121
  } else
4110
- for (;!(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = true)
4122
+ for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = true)
4111
4123
  ;
4112
4124
  } catch (err) {
4113
4125
  _d = true, _e = err;
4114
4126
  } finally {
4115
4127
  try {
4116
- if (!_n && _i.return != null && (_r = _i.return(), Object(_r) !== _r))
4128
+ if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r))
4117
4129
  return;
4118
4130
  } finally {
4119
4131
  if (_d)
@@ -4129,7 +4141,7 @@ function _classCallCheck3(instance, Constructor) {
4129
4141
  }
4130
4142
  }
4131
4143
  function _defineProperties3(target, props) {
4132
- for (var i = 0;i < props.length; i++) {
4144
+ for (var i = 0; i < props.length; i++) {
4133
4145
  var descriptor = props[i];
4134
4146
  descriptor.enumerable = descriptor.enumerable || false;
4135
4147
  descriptor.configurable = true;
@@ -4180,13 +4192,13 @@ function _inherits3(subClass, superClass) {
4180
4192
  _setPrototypeOf3(subClass, superClass);
4181
4193
  }
4182
4194
  function _getPrototypeOf3(o) {
4183
- _getPrototypeOf3 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf2(o2) {
4195
+ _getPrototypeOf3 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf22(o2) {
4184
4196
  return o2.__proto__ || Object.getPrototypeOf(o2);
4185
4197
  };
4186
4198
  return _getPrototypeOf3(o);
4187
4199
  }
4188
4200
  function _setPrototypeOf3(o, p) {
4189
- _setPrototypeOf3 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p2) {
4201
+ _setPrototypeOf3 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf22(o2, p2) {
4190
4202
  o2.__proto__ = p2;
4191
4203
  return o2;
4192
4204
  };
@@ -4200,14 +4212,15 @@ function _isNativeReflectConstruct3() {
4200
4212
  if (typeof Proxy === "function")
4201
4213
  return true;
4202
4214
  try {
4203
- Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
4215
+ Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
4216
+ }));
4204
4217
  return true;
4205
4218
  } catch (e) {
4206
4219
  return false;
4207
4220
  }
4208
4221
  }
4209
4222
  function _assertThisInitialized3(self) {
4210
- if (self === undefined) {
4223
+ if (self === void 0) {
4211
4224
  throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
4212
4225
  }
4213
4226
  return self;
@@ -4215,7 +4228,7 @@ function _assertThisInitialized3(self) {
4215
4228
  function _possibleConstructorReturn3(self, call) {
4216
4229
  if (call && (typeof call === "object" || typeof call === "function")) {
4217
4230
  return call;
4218
- } else if (call !== undefined) {
4231
+ } else if (call !== void 0) {
4219
4232
  throw new TypeError("Derived constructors may only return object or undefined");
4220
4233
  }
4221
4234
  return _assertThisInitialized3(self);
@@ -4267,23 +4280,21 @@ function _unsupportedIterableToArray2(o, minLen) {
4267
4280
  function _arrayLikeToArray2(arr, len) {
4268
4281
  if (len == null || len > arr.length)
4269
4282
  len = arr.length;
4270
- for (var i = 0, arr2 = new Array(len);i < len; i++)
4283
+ for (var i = 0, arr2 = new Array(len); i < len; i++)
4271
4284
  arr2[i] = arr[i];
4272
4285
  return arr2;
4273
4286
  }
4274
4287
  function _nonIterableSpread() {
4275
- throw new TypeError(`Invalid attempt to spread non-iterable instance.
4276
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
4288
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
4277
4289
  }
4278
4290
  function _nonIterableRest() {
4279
- throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4280
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
4291
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
4281
4292
  }
4282
4293
  function _toPrimitive3(input, hint) {
4283
4294
  if (typeof input !== "object" || input === null)
4284
4295
  return input;
4285
4296
  var prim = input[Symbol.toPrimitive];
4286
- if (prim !== undefined) {
4297
+ if (prim !== void 0) {
4287
4298
  var res = prim.call(input, hint || "default");
4288
4299
  if (typeof res !== "object")
4289
4300
  return res;
@@ -4331,7 +4342,7 @@ var VideoTrack = /* @__PURE__ */ function() {
4331
4342
  _defineProperty3(this, "type", TrackType.VIDEO);
4332
4343
  _defineProperty3(this, "codecType", VideoCodecType.AVC);
4333
4344
  _defineProperty3(this, "pid", -1);
4334
- _defineProperty3(this, "hvcC", undefined);
4345
+ _defineProperty3(this, "hvcC", void 0);
4335
4346
  _defineProperty3(this, "codec", "");
4336
4347
  _defineProperty3(this, "timescale", 0);
4337
4348
  _defineProperty3(this, "formatTimescale", 0);
@@ -4357,7 +4368,7 @@ var VideoTrack = /* @__PURE__ */ function() {
4357
4368
  _defineProperty3(this, "lastKeyFrameDts", 0);
4358
4369
  _defineProperty3(this, "kid", null);
4359
4370
  _defineProperty3(this, "pssh", null);
4360
- _defineProperty3(this, "ext", undefined);
4371
+ _defineProperty3(this, "ext", void 0);
4361
4372
  }
4362
4373
  _createClass3(VideoTrack2, [{
4363
4374
  key: "reset",
@@ -4445,7 +4456,7 @@ var AudioTrack = /* @__PURE__ */ function() {
4445
4456
  _defineProperty3(this, "isVideoEncryption", false);
4446
4457
  _defineProperty3(this, "isAudioEncryption", false);
4447
4458
  _defineProperty3(this, "kid", null);
4448
- _defineProperty3(this, "ext", undefined);
4459
+ _defineProperty3(this, "ext", void 0);
4449
4460
  }
4450
4461
  _createClass3(AudioTrack2, [{
4451
4462
  key: "reset",
@@ -4535,29 +4546,33 @@ var VideoSample = /* @__PURE__ */ function() {
4535
4546
  }();
4536
4547
 
4537
4548
  // node_modules/xgplayer-transmuxer/es/model/audio-sample.js
4538
- var AudioSample = /* @__PURE__ */ _createClass3(function AudioSample2(pts, data, duration, sampleOffset) {
4539
- _classCallCheck3(this, AudioSample2);
4540
- _defineProperty3(this, "duration", 1024);
4541
- _defineProperty3(this, "flag", {
4542
- dependsOn: 2,
4543
- isNonSyncSample: 0
4544
- });
4545
- _defineProperty3(this, "keyframe", true);
4546
- this.originPts = this.pts = this.dts = pts;
4547
- this.data = data;
4548
- this.size = data.byteLength;
4549
- this.sampleOffset = sampleOffset;
4550
- if (duration)
4551
- this.duration = duration;
4552
- });
4549
+ var AudioSample = /* @__PURE__ */ _createClass3(
4550
+ function AudioSample2(pts, data, duration, sampleOffset) {
4551
+ _classCallCheck3(this, AudioSample2);
4552
+ _defineProperty3(this, "duration", 1024);
4553
+ _defineProperty3(this, "flag", {
4554
+ dependsOn: 2,
4555
+ isNonSyncSample: 0
4556
+ });
4557
+ _defineProperty3(this, "keyframe", true);
4558
+ this.originPts = this.pts = this.dts = pts;
4559
+ this.data = data;
4560
+ this.size = data.byteLength;
4561
+ this.sampleOffset = sampleOffset;
4562
+ if (duration)
4563
+ this.duration = duration;
4564
+ }
4565
+ );
4553
4566
 
4554
4567
  // node_modules/xgplayer-transmuxer/es/model/metadata-track.js
4555
- var Sample = /* @__PURE__ */ _createClass3(function Sample2(data, pts) {
4556
- _classCallCheck3(this, Sample2);
4557
- _defineProperty3(this, "time", 0);
4558
- this.data = data;
4559
- this.originPts = this.pts = pts;
4560
- });
4568
+ var Sample = /* @__PURE__ */ _createClass3(
4569
+ function Sample2(data, pts) {
4570
+ _classCallCheck3(this, Sample2);
4571
+ _defineProperty3(this, "time", 0);
4572
+ this.data = data;
4573
+ this.originPts = this.pts = pts;
4574
+ }
4575
+ );
4561
4576
  var FlvScriptSample = /* @__PURE__ */ function(_Sample) {
4562
4577
  _inherits3(FlvScriptSample2, _Sample);
4563
4578
  var _super = _createSuper3(FlvScriptSample2);
@@ -4619,7 +4634,7 @@ var Logger2 = /* @__PURE__ */ function() {
4619
4634
  var _console;
4620
4635
  if (Logger22.disabled)
4621
4636
  return;
4622
- for (var _len = arguments.length, args = new Array(_len), _key = 0;_key < _len; _key++) {
4637
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
4623
4638
  args[_key] = arguments[_key];
4624
4639
  }
4625
4640
  (_console = console).warn.apply(_console, [this._prefix].concat(args));
@@ -4700,7 +4715,7 @@ var AAC = /* @__PURE__ */ function() {
4700
4715
  }
4701
4716
  return {
4702
4717
  skip,
4703
- remaining: i >= len ? undefined : data.subarray(i),
4718
+ remaining: i >= len ? void 0 : data.subarray(i),
4704
4719
  frames,
4705
4720
  samplingFrequencyIndex,
4706
4721
  sampleRate,
@@ -4736,7 +4751,7 @@ var AAC = /* @__PURE__ */ function() {
4736
4751
  }, {
4737
4752
  key: "getFrameDuration",
4738
4753
  value: function getFrameDuration(rate) {
4739
- var timescale = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 90000;
4754
+ var timescale = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 9e4;
4740
4755
  return 1024 * timescale / rate;
4741
4756
  }
4742
4757
  }, {
@@ -4821,7 +4836,7 @@ var AAC = /* @__PURE__ */ function() {
4821
4836
  }]);
4822
4837
  return AAC2;
4823
4838
  }();
4824
- _defineProperty3(AAC, "FREQ", [96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000, 7350]);
4839
+ _defineProperty3(AAC, "FREQ", [96e3, 88200, 64e3, 48e3, 44100, 32e3, 24e3, 22050, 16e3, 12e3, 11025, 8e3, 7350]);
4825
4840
 
4826
4841
  // node_modules/xgplayer-transmuxer/es/codec/opus.js
4827
4842
  var OPUS = /* @__PURE__ */ function() {
@@ -4840,7 +4855,7 @@ var OPUS = /* @__PURE__ */ function() {
4840
4855
  return;
4841
4856
  var dv = new DataView(data.buffer, data.byteOffset, data.byteLength);
4842
4857
  var magicSignature = "";
4843
- for (var i = 0;i < 8; i++) {
4858
+ for (var i = 0; i < 8; i++) {
4844
4859
  magicSignature += String.fromCodePoint(data[i]);
4845
4860
  }
4846
4861
  if (magicSignature !== "OpusHead") {
@@ -4871,11 +4886,11 @@ var OPUS = /* @__PURE__ */ function() {
4871
4886
  // node_modules/xgplayer-transmuxer/es/flv/fixer.js
4872
4887
  var LARGE_AV_FIRST_FRAME_GAP = 500;
4873
4888
  var AUDIO_GAP_OVERLAP_THRESHOLD_COUNT = 3;
4874
- var MAX_SILENT_FRAME_DURATION = 1000;
4875
- var AUDIO_EXCEPTION_LOG_EMIT_DURATION = 5000;
4876
- var MAX_VIDEO_FRAME_DURATION = 1000;
4889
+ var MAX_SILENT_FRAME_DURATION = 1e3;
4890
+ var AUDIO_EXCEPTION_LOG_EMIT_DURATION = 5e3;
4891
+ var MAX_VIDEO_FRAME_DURATION = 1e3;
4877
4892
  var MAX_DTS_DELTA_WITH_NEXT_CHUNK = 200;
4878
- var VIDEO_EXCEPTION_LOG_EMIT_DURATION = 5000;
4893
+ var VIDEO_EXCEPTION_LOG_EMIT_DURATION = 5e3;
4879
4894
  var TRACK_BROKEN_CHECK_TIME = 5;
4880
4895
  var FlvFixer = /* @__PURE__ */ function() {
4881
4896
  function FlvFixer2(videoTrack, audioTrack, metadataTrack) {
@@ -4885,8 +4900,8 @@ var FlvFixer = /* @__PURE__ */ function() {
4885
4900
  this.metadataTrack = metadataTrack;
4886
4901
  this._baseDts = -1;
4887
4902
  this._baseDtsInited = false;
4888
- this._audioNextPts = undefined;
4889
- this._videoNextDts = undefined;
4903
+ this._audioNextPts = void 0;
4904
+ this._videoNextDts = void 0;
4890
4905
  this._audioTimestampBreak = 0;
4891
4906
  this._videoTimestampBreak = 0;
4892
4907
  this._lastVideoDuration = 0;
@@ -4901,16 +4916,16 @@ var FlvFixer = /* @__PURE__ */ function() {
4901
4916
  key: "fix",
4902
4917
  value: function fix() {
4903
4918
  var _this = this;
4904
- var startTime = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
4905
- var discontinuity = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
4906
- var contiguous = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
4907
- startTime = Math.round(startTime * 1000);
4919
+ var startTime = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
4920
+ var discontinuity = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
4921
+ var contiguous = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true;
4922
+ startTime = Math.round(startTime * 1e3);
4908
4923
  var videoTrack = this.videoTrack;
4909
4924
  var audioTrack = this.audioTrack;
4910
4925
  if (discontinuity || !contiguous) {
4911
4926
  this._videoLastSample = null;
4912
- this._audioNextPts = undefined;
4913
- this._videoNextDts = undefined;
4927
+ this._audioNextPts = void 0;
4928
+ this._videoNextDts = void 0;
4914
4929
  this._audioTimestampBreak = 0;
4915
4930
  this._videoTimestampBreak = 0;
4916
4931
  this._lastAudioExceptionGapDot = -Infinity;
@@ -4950,7 +4965,7 @@ var FlvFixer = /* @__PURE__ */ function() {
4950
4965
  videoTrack.baseMediaDecodeTime = videoTrack.samples[0].dts;
4951
4966
  }
4952
4967
  if (audioTrack.samples.length) {
4953
- audioTrack.baseMediaDecodeTime = audioTrack.samples[0].pts * audioTrack.timescale / 1000;
4968
+ audioTrack.baseMediaDecodeTime = audioTrack.samples[0].pts * audioTrack.timescale / 1e3;
4954
4969
  }
4955
4970
  }
4956
4971
  }, {
@@ -4983,7 +4998,7 @@ var FlvFixer = /* @__PURE__ */ function() {
4983
4998
  this._videoLastSample = lastSample;
4984
4999
  if (!samples.length)
4985
5000
  return;
4986
- if (this._videoNextDts === undefined) {
5001
+ if (this._videoNextDts === void 0) {
4987
5002
  var samp0 = samples[0];
4988
5003
  this._videoNextDts = samp0.dts;
4989
5004
  }
@@ -4999,7 +5014,7 @@ var FlvFixer = /* @__PURE__ */ function() {
4999
5014
  type: WarningType.LARGE_VIDEO_GAP_BETWEEN_CHUNK,
5000
5015
  nextDts: this._videoNextDts,
5001
5016
  firstSampleDts: firstSample.dts,
5002
- nextSampleDts: (_samples$ = samples[1]) === null || _samples$ === undefined ? undefined : _samples$.dts,
5017
+ nextSampleDts: (_samples$ = samples[1]) === null || _samples$ === void 0 ? void 0 : _samples$.dts,
5003
5018
  sampleDuration: vDelta
5004
5019
  });
5005
5020
  }
@@ -5014,7 +5029,7 @@ var FlvFixer = /* @__PURE__ */ function() {
5014
5029
  }
5015
5030
  }
5016
5031
  }
5017
- for (var i = 0;i < len; i++) {
5032
+ for (var i = 0; i < len; i++) {
5018
5033
  var dts = samples[i].dts;
5019
5034
  var nextSample = samples[i + 1];
5020
5035
  if (i < len - 1) {
@@ -5055,7 +5070,7 @@ var FlvFixer = /* @__PURE__ */ function() {
5055
5070
  samples.forEach(function(x) {
5056
5071
  x.dts = x.pts -= _this3._baseDts;
5057
5072
  });
5058
- this._doFixAudioInternal(audioTrack, samples, 1000);
5073
+ this._doFixAudioInternal(audioTrack, samples, 1e3);
5059
5074
  }
5060
5075
  }, {
5061
5076
  key: "_calculateBaseDts",
@@ -5127,12 +5142,12 @@ var FlvFixer = /* @__PURE__ */ function() {
5127
5142
  }
5128
5143
  }
5129
5144
  var refSampleDuration = audioTrack.sampleDuration;
5130
- var sampleDurationInSampleRate = audioTrack.codecType === AudioCodecType.OPUS ? 20 : audioTrack.codecType === AudioCodecType.AAC ? 1024 : refSampleDuration * audioTrack.timescale / 1000;
5131
- if (this._audioNextPts === undefined) {
5145
+ var sampleDurationInSampleRate = audioTrack.codecType === AudioCodecType.OPUS ? 20 : audioTrack.codecType === AudioCodecType.AAC ? 1024 : refSampleDuration * audioTrack.timescale / 1e3;
5146
+ if (this._audioNextPts === void 0) {
5132
5147
  var samp0 = samples[0];
5133
5148
  this._audioNextPts = samp0.pts;
5134
5149
  }
5135
- for (var i = 0;i < samples.length; i++) {
5150
+ for (var i = 0; i < samples.length; i++) {
5136
5151
  var nextPts = this._audioNextPts;
5137
5152
  var sample = samples[i];
5138
5153
  var delta = sample.pts - nextPts;
@@ -5155,7 +5170,7 @@ var FlvFixer = /* @__PURE__ */ function() {
5155
5170
  refSampleDuration
5156
5171
  });
5157
5172
  }
5158
- for (var j = 0;j < count; j++) {
5173
+ for (var j = 0; j < count; j++) {
5159
5174
  var silentSample = new AudioSample(Math.floor(this._audioNextPts + refSampleDuration) - Math.floor(this._audioNextPts), silentFrame, sampleDurationInSampleRate);
5160
5175
  silentSample.originPts = Math.floor(this._baseDts + nextPts);
5161
5176
  samples.splice(i, 0, silentSample);
@@ -5183,7 +5198,7 @@ var FlvFixer = /* @__PURE__ */ function() {
5183
5198
  this._lastAudioExceptionLargeGapDot = sample.pts;
5184
5199
  audioTrack.warnings.push({
5185
5200
  type: WarningType.LARGE_AUDIO_GAP,
5186
- time: sample.pts / 1000,
5201
+ time: sample.pts / 1e3,
5187
5202
  pts: sample.pts,
5188
5203
  originPts: sample.originPts,
5189
5204
  nextPts,
@@ -5208,11 +5223,11 @@ var FlvFixer = /* @__PURE__ */ function() {
5208
5223
  }, {
5209
5224
  key: "_getG711Duration",
5210
5225
  value: function _getG711Duration(track) {
5211
- var { sampleSize, channelCount, sampleRate } = track;
5226
+ var sampleSize = track.sampleSize, channelCount = track.channelCount, sampleRate = track.sampleRate;
5212
5227
  var samp0 = track.samples[0];
5213
5228
  if (!samp0)
5214
5229
  return;
5215
- return samp0.data.byteLength * 2 / channelCount / (sampleSize / 8) / sampleRate * 1000;
5230
+ return samp0.data.byteLength * 2 / channelCount / (sampleSize / 8) / sampleRate * 1e3;
5216
5231
  }
5217
5232
  }, {
5218
5233
  key: "_getSilentFrame",
@@ -5227,7 +5242,7 @@ var FlvFixer = /* @__PURE__ */ function() {
5227
5242
 
5228
5243
  // node_modules/xgplayer-transmuxer/es/utils/index.js
5229
5244
  function concatUint8Array2() {
5230
- for (var _len = arguments.length, arr = new Array(_len), _key = 0;_key < _len; _key++) {
5245
+ for (var _len = arguments.length, arr = new Array(_len), _key = 0; _key < _len; _key++) {
5231
5246
  arr[_key] = arguments[_key];
5232
5247
  }
5233
5248
  arr = arr.filter(Boolean);
@@ -5243,13 +5258,13 @@ function concatUint8Array2() {
5243
5258
  }
5244
5259
  var MAX_SIZE = Math.pow(2, 32);
5245
5260
  function readBig32(data) {
5246
- var i = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
5261
+ var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
5247
5262
  return (data[i] << 24 >>> 0) + (data[i + 1] << 16) + (data[i + 2] << 8) + (data[i + 3] || 0);
5248
5263
  }
5249
5264
  function getAvcCodec(codecs) {
5250
5265
  var codec = "avc1.";
5251
5266
  var h;
5252
- for (var i = 0;i < 3; i++) {
5267
+ for (var i = 0; i < 3; i++) {
5253
5268
  h = codecs[i].toString(16);
5254
5269
  if (h.length < 2)
5255
5270
  h = "0".concat(h);
@@ -5261,7 +5276,7 @@ function parse2(a) {
5261
5276
  if (!Array.isArray(a)) {
5262
5277
  var arr = [];
5263
5278
  var value = "";
5264
- for (var i = 0;i < a.length; i++) {
5279
+ for (var i = 0; i < a.length; i++) {
5265
5280
  if (i % 2) {
5266
5281
  value = a[i - 1] + a[i];
5267
5282
  arr.push(parseInt(value, 16));
@@ -5299,7 +5314,7 @@ var NALu = /* @__PURE__ */ function() {
5299
5314
  var len = data.length;
5300
5315
  var start = 2;
5301
5316
  var end = 0;
5302
- while (data[start] !== null && data[start] !== undefined && data[start] !== 1) {
5317
+ while (data[start] !== null && data[start] !== void 0 && data[start] !== 1) {
5303
5318
  start++;
5304
5319
  }
5305
5320
  start++;
@@ -5350,7 +5365,7 @@ var NALu = /* @__PURE__ */ function() {
5350
5365
  }, {
5351
5366
  key: "parseAvcC",
5352
5367
  value: function parseAvcC(data) {
5353
- var size = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 4;
5368
+ var size = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 4;
5354
5369
  if (data.length < 4)
5355
5370
  return;
5356
5371
  var dataLen = data.length;
@@ -5391,7 +5406,7 @@ var NALu = /* @__PURE__ */ function() {
5391
5406
  }
5392
5407
  size += unit[i++];
5393
5408
  if (type === 5 && len > i + 16) {
5394
- for (var j = 0;j < 16; j++) {
5409
+ for (var j = 0; j < 16; j++) {
5395
5410
  uuid += unit[i].toString(16);
5396
5411
  i++;
5397
5412
  }
@@ -5422,7 +5437,7 @@ var NALu = /* @__PURE__ */ function() {
5422
5437
  var newLength = length - emulationPreventionBytesPositions.length;
5423
5438
  var newData = new Uint8Array(newLength);
5424
5439
  var sourceIndex = 0;
5425
- for (i = 0;i < newLength; sourceIndex++, i++) {
5440
+ for (i = 0; i < newLength; sourceIndex++, i++) {
5426
5441
  if (sourceIndex === emulationPreventionBytesPositions[0]) {
5427
5442
  sourceIndex++;
5428
5443
  emulationPreventionBytesPositions.shift();
@@ -5439,7 +5454,7 @@ var NALu = /* @__PURE__ */ function() {
5439
5454
  var ExpGolomb = /* @__PURE__ */ function() {
5440
5455
  function ExpGolomb2(data) {
5441
5456
  _classCallCheck3(this, ExpGolomb2);
5442
- _defineProperty3(this, "_bytesAvailable", undefined);
5457
+ _defineProperty3(this, "_bytesAvailable", void 0);
5443
5458
  _defineProperty3(this, "_bitsAvailable", 0);
5444
5459
  _defineProperty3(this, "_word", 0);
5445
5460
  if (!data)
@@ -5507,7 +5522,7 @@ var ExpGolomb = /* @__PURE__ */ function() {
5507
5522
  key: "skipLZ",
5508
5523
  value: function skipLZ() {
5509
5524
  var leadingZeroCount;
5510
- for (leadingZeroCount = 0;leadingZeroCount < this._bitsAvailable; ++leadingZeroCount) {
5525
+ for (leadingZeroCount = 0; leadingZeroCount < this._bitsAvailable; ++leadingZeroCount) {
5511
5526
  if ((this._word & 2147483648 >>> leadingZeroCount) !== 0) {
5512
5527
  this._word <<= leadingZeroCount;
5513
5528
  this._bitsAvailable -= leadingZeroCount;
@@ -5553,7 +5568,7 @@ var ExpGolomb = /* @__PURE__ */ function() {
5553
5568
  var lastScale = 8;
5554
5569
  var nextScale = 8;
5555
5570
  var deltaScale;
5556
- for (var j = 0;j < count; j++) {
5571
+ for (var j = 0; j < count; j++) {
5557
5572
  if (nextScale !== 0) {
5558
5573
  deltaScale = this.readEG();
5559
5574
  nextScale = (lastScale + deltaScale + 256) % 256;
@@ -5582,7 +5597,7 @@ var AVC = /* @__PURE__ */ function() {
5582
5597
  var offset = 6;
5583
5598
  var spsCount = data[5] & 31;
5584
5599
  var spsSize;
5585
- for (var i = 0;i < spsCount; i++) {
5600
+ for (var i = 0; i < spsCount; i++) {
5586
5601
  spsSize = data[offset] << 8 | data[offset + 1];
5587
5602
  offset += 2;
5588
5603
  if (!spsSize)
@@ -5597,7 +5612,7 @@ var AVC = /* @__PURE__ */ function() {
5597
5612
  var ppsCount = data[offset];
5598
5613
  offset++;
5599
5614
  var ppsSize;
5600
- for (var _i = 0;_i < ppsCount; _i++) {
5615
+ for (var _i = 0; _i < ppsCount; _i++) {
5601
5616
  ppsSize = data[offset] << 8 | data[offset + 1];
5602
5617
  offset += 2;
5603
5618
  if (!ppsSize)
@@ -5633,7 +5648,7 @@ var AVC = /* @__PURE__ */ function() {
5633
5648
  eg.skipBits(1);
5634
5649
  if (eg.readBool()) {
5635
5650
  var scalingListCount = chromaFormatIdc !== 3 ? 8 : 12;
5636
- for (var i = 0;i < scalingListCount; i++) {
5651
+ for (var i = 0; i < scalingListCount; i++) {
5637
5652
  if (eg.readBool()) {
5638
5653
  if (i < 6) {
5639
5654
  eg.skipScalingList(16);
@@ -5653,7 +5668,7 @@ var AVC = /* @__PURE__ */ function() {
5653
5668
  eg.skipUEG();
5654
5669
  eg.skipUEG();
5655
5670
  var numRefFramesInPicOrderCntCycle = eg.readUEG();
5656
- for (var _i2 = 0;_i2 < numRefFramesInPicOrderCntCycle; _i2++) {
5671
+ for (var _i2 = 0; _i2 < numRefFramesInPicOrderCntCycle; _i2++) {
5657
5672
  eg.skipUEG();
5658
5673
  }
5659
5674
  }
@@ -5785,7 +5800,7 @@ var HEVC = /* @__PURE__ */ function() {
5785
5800
  _createClass3(HEVC2, null, [{
5786
5801
  key: "parseHEVCDecoderConfigurationRecord",
5787
5802
  value: function parseHEVCDecoderConfigurationRecord(data) {
5788
- var hvcC = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
5803
+ var hvcC = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
5789
5804
  if (data.length < 23)
5790
5805
  return;
5791
5806
  hvcC = hvcC || {};
@@ -5800,11 +5815,11 @@ var HEVC = /* @__PURE__ */ function() {
5800
5815
  var nalUnitType;
5801
5816
  var numNalus;
5802
5817
  var nalSize;
5803
- for (var i = 0;i < numOfArrays; i++) {
5818
+ for (var i = 0; i < numOfArrays; i++) {
5804
5819
  nalUnitType = data[offset] & 63;
5805
5820
  numNalus = data[offset + 1] << 8 | data[offset + 2];
5806
5821
  offset += 3;
5807
- for (var j = 0;j < numNalus; j++) {
5822
+ for (var j = 0; j < numNalus; j++) {
5808
5823
  nalSize = data[offset] << 8 | data[offset + 1];
5809
5824
  offset += 2;
5810
5825
  if (!nalSize)
@@ -5859,7 +5874,7 @@ var HEVC = /* @__PURE__ */ function() {
5859
5874
  }, {
5860
5875
  key: "parseSPS",
5861
5876
  value: function parseSPS(unit) {
5862
- var hvcC = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
5877
+ var hvcC = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
5863
5878
  hvcC = hvcC || {};
5864
5879
  var eg = new ExpGolomb(unit);
5865
5880
  eg.readUByte();
@@ -5927,14 +5942,14 @@ var HEVC = /* @__PURE__ */ function() {
5927
5942
  if (maxSubLayersMinus1 > eg.bitsAvailable) {
5928
5943
  throw new Error("maxSubLayersMinus inavlid size ".concat(maxSubLayersMinus1));
5929
5944
  }
5930
- for (var j = 0;j < maxSubLayersMinus1; j++) {
5945
+ for (var j = 0; j < maxSubLayersMinus1; j++) {
5931
5946
  subLayerProfilePresentFlag[j] = eg.readBits(1);
5932
5947
  subLayerLevelPresentFlag[j] = eg.readBits(1);
5933
5948
  }
5934
5949
  if (maxSubLayersMinus1 > 0) {
5935
5950
  eg.readBits((8 - maxSubLayersMinus1) * 2);
5936
5951
  }
5937
- for (var i = 0;i < maxSubLayersMinus1; i++) {
5952
+ for (var i = 0; i < maxSubLayersMinus1; i++) {
5938
5953
  if (subLayerProfilePresentFlag[i] !== 0) {
5939
5954
  eg.readBits(2);
5940
5955
  eg.readBits(1);
@@ -6035,7 +6050,7 @@ var AMF = /* @__PURE__ */ function() {
6035
6050
  }
6036
6051
  _createClass3(AMF2, null, [{
6037
6052
  key: "parse",
6038
- value: function parse(data) {
6053
+ value: function parse3(data) {
6039
6054
  if (data.length < 3)
6040
6055
  return;
6041
6056
  var ret = {};
@@ -6114,7 +6129,7 @@ var AMF = /* @__PURE__ */ function() {
6114
6129
  }
6115
6130
  break;
6116
6131
  case 9:
6117
- value = undefined;
6132
+ value = void 0;
6118
6133
  offset = 1;
6119
6134
  isEnd = true;
6120
6135
  break;
@@ -6123,7 +6138,7 @@ var AMF = /* @__PURE__ */ function() {
6123
6138
  value = [];
6124
6139
  var strictArrayLength = view.getUint32(1);
6125
6140
  offset += 4;
6126
- for (var i = 0;i < strictArrayLength; i++) {
6141
+ for (var i = 0; i < strictArrayLength; i++) {
6127
6142
  var _AMF$_parseValue = AMF2._parseValue(new DataView(view.buffer, view.byteOffset + offset, view.byteLength - offset)), _data3 = _AMF$_parseValue.data, _size3 = _AMF$_parseValue.size;
6128
6143
  value.push(_data3);
6129
6144
  offset += _size3;
@@ -6132,7 +6147,7 @@ var AMF = /* @__PURE__ */ function() {
6132
6147
  break;
6133
6148
  case 11:
6134
6149
  {
6135
- var timestamp = view.getFloat64(offset) + view.getInt16(offset + 8) * 60000;
6150
+ var timestamp = view.getFloat64(offset) + view.getInt16(offset + 8) * 6e4;
6136
6151
  value = new Date(timestamp);
6137
6152
  offset += 10;
6138
6153
  }
@@ -6209,18 +6224,18 @@ var FlvDemuxer = /* @__PURE__ */ function() {
6209
6224
  _defineProperty3(this, "_remainingData", null);
6210
6225
  _defineProperty3(this, "_gopId", 0);
6211
6226
  _defineProperty3(this, "_needAddMetaBeforeKeyFrameNal", true);
6212
- this.videoTrack = videoTrack || new VideoTrack;
6213
- this.audioTrack = audioTrack || new AudioTrack;
6214
- this.metadataTrack = metadataTrack || new MetadataTrack;
6227
+ this.videoTrack = videoTrack || new VideoTrack();
6228
+ this.audioTrack = audioTrack || new AudioTrack();
6229
+ this.metadataTrack = metadataTrack || new MetadataTrack();
6215
6230
  this._fixer = new FlvFixer(this.videoTrack, this.audioTrack, this.metadataTrack);
6216
6231
  }
6217
6232
  _createClass3(FlvDemuxer2, [{
6218
6233
  key: "demux",
6219
6234
  value: function demux(data) {
6220
6235
  var _scriptDataObject$dat;
6221
- var discontinuity = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
6222
- var contiguous = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
6223
- var seamlessLoadingSwitching = arguments.length > 3 ? arguments[3] : undefined;
6236
+ var discontinuity = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
6237
+ var contiguous = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true;
6238
+ var seamlessLoadingSwitching = arguments.length > 3 ? arguments[3] : void 0;
6224
6239
  var audioTrack = this.audioTrack, videoTrack = this.videoTrack, metadataTrack = this.metadataTrack;
6225
6240
  if (discontinuity || !contiguous) {
6226
6241
  this._remainingData = null;
@@ -6296,8 +6311,8 @@ var FlvDemuxer = /* @__PURE__ */ function() {
6296
6311
  if (offset < dataLen) {
6297
6312
  this._remainingData = data.subarray(offset);
6298
6313
  }
6299
- audioTrack.formatTimescale = videoTrack.formatTimescale = videoTrack.timescale = metadataTrack.timescale = 1000;
6300
- audioTrack.timescale = audioTrack.codecType === AudioCodecType.OPUS ? 1000 : audioTrack.sampleRate || 0;
6314
+ audioTrack.formatTimescale = videoTrack.formatTimescale = videoTrack.timescale = metadataTrack.timescale = 1e3;
6315
+ audioTrack.timescale = audioTrack.codecType === AudioCodecType.OPUS ? 1e3 : audioTrack.sampleRate || 0;
6301
6316
  if (!audioTrack.exist() && audioTrack.hasSample()) {
6302
6317
  audioTrack.reset();
6303
6318
  }
@@ -6305,20 +6320,20 @@ var FlvDemuxer = /* @__PURE__ */ function() {
6305
6320
  videoTrack.reset();
6306
6321
  }
6307
6322
  var scriptDataObject = metadataTrack.flvScriptSamples[metadataTrack.flvScriptSamples.length - 1];
6308
- var metaData = scriptDataObject === null || scriptDataObject === undefined ? undefined : (_scriptDataObject$dat = scriptDataObject.data) === null || _scriptDataObject$dat === undefined ? undefined : _scriptDataObject$dat.onMetaData;
6323
+ var metaData = scriptDataObject === null || scriptDataObject === void 0 ? void 0 : (_scriptDataObject$dat = scriptDataObject.data) === null || _scriptDataObject$dat === void 0 ? void 0 : _scriptDataObject$dat.onMetaData;
6309
6324
  if (metaData) {
6310
- if (videoTrack !== null && videoTrack !== undefined && videoTrack.exist()) {
6325
+ if (videoTrack !== null && videoTrack !== void 0 && videoTrack.exist()) {
6311
6326
  if (metaData.hasOwnProperty("duration")) {
6312
- videoTrack.duration = metaData.duration * 1000;
6327
+ videoTrack.duration = metaData.duration * 1e3;
6313
6328
  }
6314
6329
  if (metaData.hasOwnProperty("width") && metaData.hasOwnProperty("height")) {
6315
6330
  videoTrack.width = metaData.width;
6316
6331
  videoTrack.height = metaData.height;
6317
6332
  }
6318
6333
  }
6319
- if (audioTrack !== null && audioTrack !== undefined && audioTrack.exist()) {
6334
+ if (audioTrack !== null && audioTrack !== void 0 && audioTrack.exist()) {
6320
6335
  if (metaData.hasOwnProperty("duration")) {
6321
- audioTrack.duration = metaData.duration * 1000;
6336
+ audioTrack.duration = metaData.duration * 1e3;
6322
6337
  }
6323
6338
  }
6324
6339
  }
@@ -6399,7 +6414,7 @@ var FlvDemuxer = /* @__PURE__ */ function() {
6399
6414
  break;
6400
6415
  }
6401
6416
  case 1: {
6402
- if (pts === undefined || pts === null)
6417
+ if (pts === void 0 || pts === null)
6403
6418
  return;
6404
6419
  var newSample = new AudioSample(pts, data.subarray(2), track.sampleDuration);
6405
6420
  track.samples.push(newSample);
@@ -6418,7 +6433,7 @@ var FlvDemuxer = /* @__PURE__ */ function() {
6418
6433
  return;
6419
6434
  var sample = new AudioSample(pts, audioData);
6420
6435
  track.codecType = format === 7 ? AudioCodecType.G711PCMA : AudioCodecType.G711PCMU;
6421
- track.sampleRate = 8000;
6436
+ track.sampleRate = 8e3;
6422
6437
  track.codec = track.codecType;
6423
6438
  track.samples.push(sample);
6424
6439
  }
@@ -6441,7 +6456,7 @@ var FlvDemuxer = /* @__PURE__ */ function() {
6441
6456
  logger.warn("Cannot parse AudioSpecificConfig", data);
6442
6457
  }
6443
6458
  } else if (data[1] === 1) {
6444
- if (pts === undefined || pts === null)
6459
+ if (pts === void 0 || pts === null)
6445
6460
  return;
6446
6461
  track.samples.push(new AudioSample(pts, data.subarray(2)));
6447
6462
  } else {
@@ -6470,7 +6485,7 @@ var FlvDemuxer = /* @__PURE__ */ function() {
6470
6485
  var configData = data.subarray(5);
6471
6486
  var ret = isHevc ? HEVC.parseHEVCDecoderConfigurationRecord(configData) : AVC.parseAVCDecoderConfigurationRecord(configData);
6472
6487
  if (ret) {
6473
- var { hvcC, sps, ppsArr, spsArr, vpsArr, nalUnitSize } = ret;
6488
+ var hvcC = ret.hvcC, sps = ret.sps, ppsArr = ret.ppsArr, spsArr = ret.spsArr, vpsArr = ret.vpsArr, nalUnitSize = ret.nalUnitSize;
6474
6489
  if (hvcC) {
6475
6490
  track.hvcC = track.hvcC || hvcC;
6476
6491
  }
@@ -6580,11 +6595,12 @@ var FlvDemuxer = /* @__PURE__ */ function() {
6580
6595
  }]);
6581
6596
  return FlvDemuxer2;
6582
6597
  }();
6583
- _defineProperty3(FlvDemuxer, "AUDIO_RATE", [5500, 11000, 22000, 44000]);
6598
+ _defineProperty3(FlvDemuxer, "AUDIO_RATE", [5500, 11e3, 22e3, 44e3]);
6599
+
6584
6600
  // node_modules/xgplayer-transmuxer/es/mp4/buffer.js
6585
6601
  function Concat(ResultConstructor) {
6586
6602
  var totalLength = 0;
6587
- for (var _len = arguments.length, arrays = new Array(_len > 1 ? _len - 1 : 0), _key = 1;_key < _len; _key++) {
6603
+ for (var _len = arguments.length, arrays = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
6588
6604
  arrays[_key - 1] = arguments[_key];
6589
6605
  }
6590
6606
  arrays.forEach(function(arr) {
@@ -6598,7 +6614,7 @@ function Concat(ResultConstructor) {
6598
6614
  });
6599
6615
  return result;
6600
6616
  }
6601
- var Buffer2 = /* @__PURE__ */ function() {
6617
+ var Buffer3 = /* @__PURE__ */ function() {
6602
6618
  function Buffer22() {
6603
6619
  _classCallCheck3(this, Buffer22);
6604
6620
  this.buffer = new Uint8Array(0);
@@ -6607,7 +6623,7 @@ var Buffer2 = /* @__PURE__ */ function() {
6607
6623
  key: "write",
6608
6624
  value: function write() {
6609
6625
  var self = this;
6610
- for (var _len2 = arguments.length, buffer = new Array(_len2), _key2 = 0;_key2 < _len2; _key2++) {
6626
+ for (var _len2 = arguments.length, buffer = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
6611
6627
  buffer[_key2] = arguments[_key2];
6612
6628
  }
6613
6629
  buffer.forEach(function(item) {
@@ -6641,7 +6657,7 @@ var MP4 = /* @__PURE__ */ function() {
6641
6657
  _createClass3(MP42, null, [{
6642
6658
  key: "box",
6643
6659
  value: function box(type) {
6644
- for (var _len = arguments.length, payload = new Array(_len > 1 ? _len - 1 : 0), _key = 1;_key < _len; _key++) {
6660
+ for (var _len = arguments.length, payload = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
6645
6661
  payload[_key - 1] = arguments[_key];
6646
6662
  }
6647
6663
  payload = payload.filter(Boolean);
@@ -6709,7 +6725,7 @@ var MP4 = /* @__PURE__ */ function() {
6709
6725
  }, {
6710
6726
  key: "mvhd",
6711
6727
  value: function mvhd(duration) {
6712
- var timescale = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 90000;
6728
+ var timescale = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 9e4;
6713
6729
  var mvhd2 = MP42.box(MP42.types.mvhd, new Uint8Array([
6714
6730
  0,
6715
6731
  0,
@@ -6823,8 +6839,8 @@ var MP4 = /* @__PURE__ */ function() {
6823
6839
  }, {
6824
6840
  key: "tkhd",
6825
6841
  value: function tkhd(id, duration) {
6826
- var width = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
6827
- var height = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
6842
+ var width = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0;
6843
+ var height = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 0;
6828
6844
  var tkhd2 = MP42.box(MP42.types.tkhd, new Uint8Array([
6829
6845
  0,
6830
6846
  0,
@@ -6922,7 +6938,7 @@ var MP4 = /* @__PURE__ */ function() {
6922
6938
  }, {
6923
6939
  key: "mdhd",
6924
6940
  value: function mdhd(duration) {
6925
- var timescale = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 90000;
6941
+ var timescale = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 9e4;
6926
6942
  var mdhd2 = MP42.box(MP42.types.mdhd, new Uint8Array([
6927
6943
  0,
6928
6944
  0,
@@ -7414,7 +7430,7 @@ var MP4 = /* @__PURE__ */ function() {
7414
7430
  var hvcC2 = track.hvcC;
7415
7431
  if (hvcC2 instanceof ArrayBuffer || hvcC2 instanceof Uint8Array)
7416
7432
  return hvcC2;
7417
- var { vps, sps, pps } = track;
7433
+ var vps = track.vps, sps = track.sps, pps = track.pps;
7418
7434
  var data;
7419
7435
  if (hvcC2) {
7420
7436
  var pcf = hvcC2.generalProfileCompatibilityFlags;
@@ -7620,7 +7636,7 @@ var MP4 = /* @__PURE__ */ function() {
7620
7636
  track.sampleRate & 255,
7621
7637
  0,
7622
7638
  0
7623
- ]), track.config.length ? MP42.esds(track.config) : undefined);
7639
+ ]), track.config.length ? MP42.esds(track.config) : void 0);
7624
7640
  }
7625
7641
  }, {
7626
7642
  key: "esds",
@@ -7652,7 +7668,9 @@ var MP4 = /* @__PURE__ */ function() {
7652
7668
  218,
7653
7669
  192,
7654
7670
  5
7655
- ].concat([len]).concat(config).concat([6, 1, 2])));
7671
+ ].concat([len]).concat(config).concat(
7672
+ [6, 1, 2]
7673
+ )));
7656
7674
  return esds2;
7657
7675
  }
7658
7676
  }, {
@@ -7889,7 +7907,7 @@ var MP4 = /* @__PURE__ */ function() {
7889
7907
  }, {
7890
7908
  key: "sdtp",
7891
7909
  value: function sdtp(data) {
7892
- var buffer = new Buffer2;
7910
+ var buffer = new Buffer3();
7893
7911
  data.samples.forEach(function(item) {
7894
7912
  buffer.write(new Uint8Array(data.isVideo ? [item.keyframe ? 32 : 16] : [16]));
7895
7913
  });
@@ -7898,28 +7916,28 @@ var MP4 = /* @__PURE__ */ function() {
7898
7916
  }, {
7899
7917
  key: "trun1",
7900
7918
  value: function trun1(data) {
7901
- var buffer = new Buffer2;
7902
- var sampleCount = Buffer2.writeUint32(data.samples.length);
7919
+ var buffer = new Buffer3();
7920
+ var sampleCount = Buffer3.writeUint32(data.samples.length);
7903
7921
  var offset = null;
7904
7922
  if (data.isVideo) {
7905
7923
  var sencLength = data.videoSencLength;
7906
- offset = Buffer2.writeUint32(data.samples.length * 16 + sencLength + 149);
7924
+ offset = Buffer3.writeUint32(data.samples.length * 16 + sencLength + 149);
7907
7925
  if (!data.isVideoEncryption && data.isAudioEncryption) {
7908
- offset = Buffer2.writeUint32(data.samples.length * 16 + 92);
7926
+ offset = Buffer3.writeUint32(data.samples.length * 16 + 92);
7909
7927
  }
7910
7928
  } else {
7911
7929
  var len = data.samples.length * 12 + 124;
7912
7930
  if (data.isAudioEncryption) {
7913
7931
  len = data.samples.length * 12 + 8 * data.audioSenc.length + 177;
7914
7932
  }
7915
- offset = Buffer2.writeUint32(len);
7933
+ offset = Buffer3.writeUint32(len);
7916
7934
  }
7917
7935
  data.samples.forEach(function(item) {
7918
- buffer.write(Buffer2.writeUint32(item.duration));
7919
- buffer.write(Buffer2.writeUint32(item.size));
7920
- buffer.write(Buffer2.writeUint32(item.keyframe ? 33554432 : 65536));
7936
+ buffer.write(Buffer3.writeUint32(item.duration));
7937
+ buffer.write(Buffer3.writeUint32(item.size));
7938
+ buffer.write(Buffer3.writeUint32(item.keyframe ? 33554432 : 65536));
7921
7939
  if (data.isVideo) {
7922
- buffer.write(Buffer2.writeUint32(item.cts ? item.cts : 0));
7940
+ buffer.write(Buffer3.writeUint32(item.cts ? item.cts : 0));
7923
7941
  }
7924
7942
  });
7925
7943
  return MP42.box(MP42.types.trun, this.extension(0, data.flags), sampleCount, offset, buffer.buffer);
@@ -7927,7 +7945,7 @@ var MP4 = /* @__PURE__ */ function() {
7927
7945
  }, {
7928
7946
  key: "senc",
7929
7947
  value: function senc(data) {
7930
- var buffer = new Buffer2;
7948
+ var buffer = new Buffer3();
7931
7949
  var len = data.samples.length;
7932
7950
  var ceil = data.isVideo ? 16 : 8;
7933
7951
  var flag = data.isVideo ? 2 : 0;
@@ -7940,17 +7958,17 @@ var MP4 = /* @__PURE__ */ function() {
7940
7958
  samples = data.audioSenc;
7941
7959
  }
7942
7960
  samplesLength = samplesLength || ceil * len;
7943
- buffer.write(Buffer2.writeUint32(16 + samplesLength), MP42.types.senc, this.extension(0, flag));
7944
- buffer.write(Buffer2.writeUint32(len));
7961
+ buffer.write(Buffer3.writeUint32(16 + samplesLength), MP42.types.senc, this.extension(0, flag));
7962
+ buffer.write(Buffer3.writeUint32(len));
7945
7963
  samples.forEach(function(item) {
7946
- for (var i = 0;i < item.InitializationVector.length; i++) {
7964
+ for (var i = 0; i < item.InitializationVector.length; i++) {
7947
7965
  buffer.write(new Uint8Array([item.InitializationVector[i]]));
7948
7966
  }
7949
7967
  if (item.subsamples && item.subsamples.length) {
7950
- buffer.write(Buffer2.writeUint16(item.subsamples.length));
7968
+ buffer.write(Buffer3.writeUint16(item.subsamples.length));
7951
7969
  item.subsamples.forEach(function(value) {
7952
- buffer.write(Buffer2.writeUint16(value.BytesOfClearData));
7953
- buffer.write(Buffer2.writeUint32(value.BytesOfProtectedData));
7970
+ buffer.write(Buffer3.writeUint16(value.BytesOfClearData));
7971
+ buffer.write(Buffer3.writeUint32(value.BytesOfProtectedData));
7954
7972
  });
7955
7973
  }
7956
7974
  });
@@ -8079,8 +8097,8 @@ var MP4 = /* @__PURE__ */ function() {
8079
8097
  offset >>> 8 & 255,
8080
8098
  offset & 255
8081
8099
  ], 0);
8082
- for (var i = 0;i < sampleLen; i++) {
8083
- var _samples$i = samples[i], duration = _samples$i.duration, size = _samples$i.size, _samples$i$flag = _samples$i.flag, flag = _samples$i$flag === undefined ? {} : _samples$i$flag, _samples$i$cts = _samples$i.cts, cts = _samples$i$cts === undefined ? 0 : _samples$i$cts;
8100
+ for (var i = 0; i < sampleLen; i++) {
8101
+ var _samples$i = samples[i], duration = _samples$i.duration, size = _samples$i.size, _samples$i$flag = _samples$i.flag, flag = _samples$i$flag === void 0 ? {} : _samples$i$flag, _samples$i$cts = _samples$i.cts, cts = _samples$i$cts === void 0 ? 0 : _samples$i$cts;
8084
8102
  data.set([
8085
8103
  duration >>> 24 & 255,
8086
8104
  duration >>> 16 & 255,
@@ -8090,8 +8108,8 @@ var MP4 = /* @__PURE__ */ function() {
8090
8108
  size >>> 16 & 255,
8091
8109
  size >>> 8 & 255,
8092
8110
  size & 255,
8093
- flag.isLeading << 2 | (flag.dependsOn === null || flag.dependsOn === undefined ? 1 : flag.dependsOn),
8094
- flag.isDependedOn << 6 | flag.hasRedundancy << 4 | flag.paddingValue << 1 | (flag.isNonSyncSample === null || flag.isNonSyncSample === undefined ? 1 : flag.isNonSyncSample),
8111
+ flag.isLeading << 2 | (flag.dependsOn === null || flag.dependsOn === void 0 ? 1 : flag.dependsOn),
8112
+ flag.isDependedOn << 6 | flag.hasRedundancy << 4 | flag.paddingValue << 1 | (flag.isNonSyncSample === null || flag.isNonSyncSample === void 0 ? 1 : flag.isNonSyncSample),
8095
8113
  flag.degradationPriority & 240 << 8,
8096
8114
  flag.degradationPriority & 15,
8097
8115
  cts >>> 24 & 255,
@@ -8144,7 +8162,7 @@ var MP4 = /* @__PURE__ */ function() {
8144
8162
  var data = new Uint8Array(8 * len);
8145
8163
  var offset = 0;
8146
8164
  samples.forEach(function(_ref5) {
8147
- var { value, count } = _ref5;
8165
+ var value = _ref5.value, count = _ref5.count;
8148
8166
  data.set([count >> 24, count >> 16 & 255, count >> 8 & 255, count & 255, value >> 24, value >> 16 & 255, value >> 8 & 255, value & 255], offset);
8149
8167
  offset += 8;
8150
8168
  });
@@ -8157,7 +8175,7 @@ var MP4 = /* @__PURE__ */ function() {
8157
8175
  var data = new Uint8Array(12 * len);
8158
8176
  var offset = 0;
8159
8177
  entries.forEach(function(_ref6) {
8160
- var { firstChunk, samplesPerChunk, sampleDescIndex } = _ref6;
8178
+ var firstChunk = _ref6.firstChunk, samplesPerChunk = _ref6.samplesPerChunk, sampleDescIndex = _ref6.sampleDescIndex;
8161
8179
  data.set([firstChunk >> 24, firstChunk >> 16 & 255, firstChunk >> 8 & 255, firstChunk & 255, samplesPerChunk >> 24, samplesPerChunk >> 16 & 255, samplesPerChunk >> 8 & 255, samplesPerChunk & 255, sampleDescIndex >> 24, sampleDescIndex >> 16 & 255, sampleDescIndex >> 8 & 255, sampleDescIndex & 255], offset);
8162
8180
  offset += 12;
8163
8181
  });
@@ -8206,7 +8224,7 @@ var MP4 = /* @__PURE__ */ function() {
8206
8224
  var data = new Uint8Array(8 * len);
8207
8225
  var offset = 0;
8208
8226
  samples.forEach(function(_ref7) {
8209
- var { value, count } = _ref7;
8227
+ var value = _ref7.value, count = _ref7.count;
8210
8228
  data.set([count >> 24, count >> 16 & 255, count >> 8 & 255, count & 255, value >> 24, value >> 16 & 255, value >> 8 & 255, value & 255], offset);
8211
8229
  offset += 8;
8212
8230
  });
@@ -8512,7 +8530,7 @@ var Logger3 = /* @__PURE__ */ function() {
8512
8530
  var _console;
8513
8531
  if (Logger22.disabled)
8514
8532
  return;
8515
- for (var _len = arguments.length, args = new Array(_len), _key = 0;_key < _len; _key++) {
8533
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
8516
8534
  args[_key] = arguments[_key];
8517
8535
  }
8518
8536
  (_console = console).debug.apply(_console, [this._prefix].concat(args));
@@ -8523,7 +8541,7 @@ var Logger3 = /* @__PURE__ */ function() {
8523
8541
  var _console2;
8524
8542
  if (Logger22.disabled)
8525
8543
  return;
8526
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0;_key2 < _len2; _key2++) {
8544
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
8527
8545
  args[_key2] = arguments[_key2];
8528
8546
  }
8529
8547
  (_console2 = console).log.apply(_console2, [this._prefix].concat(args));
@@ -8534,7 +8552,7 @@ var Logger3 = /* @__PURE__ */ function() {
8534
8552
  var _console3;
8535
8553
  if (Logger22.disabled)
8536
8554
  return;
8537
- for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0;_key3 < _len3; _key3++) {
8555
+ for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
8538
8556
  args[_key3] = arguments[_key3];
8539
8557
  }
8540
8558
  (_console3 = console).warn.apply(_console3, [this._prefix].concat(args));
@@ -8545,7 +8563,7 @@ var Logger3 = /* @__PURE__ */ function() {
8545
8563
  var _console4;
8546
8564
  if (Logger22.disabled)
8547
8565
  return;
8548
- for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0;_key4 < _len4; _key4++) {
8566
+ for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
8549
8567
  args[_key4] = arguments[_key4];
8550
8568
  }
8551
8569
  (_console4 = console).error.apply(_console4, [this._prefix].concat(args));
@@ -8588,8 +8606,8 @@ var FMP4Remuxer = /* @__PURE__ */ function() {
8588
8606
  _createClass3(FMP4Remuxer2, [{
8589
8607
  key: "remux",
8590
8608
  value: function remux() {
8591
- var createInit = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
8592
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
8609
+ var createInit = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
8610
+ var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
8593
8611
  var videoTrack = this.videoTrack;
8594
8612
  var audioTrack = this.audioTrack;
8595
8613
  var hasVideo = videoTrack.exist();
@@ -8659,7 +8677,7 @@ var FMP4Remuxer = /* @__PURE__ */ function() {
8659
8677
  }
8660
8678
  var mdata = new Uint8Array(mdatSize);
8661
8679
  if (isAV01) {
8662
- for (var i = 0, l = samples.length, offset = 0, sample;i < l; i++) {
8680
+ for (var i = 0, l = samples.length, offset = 0, sample; i < l; i++) {
8663
8681
  sample = samples[i];
8664
8682
  mdata.set(sample.data, offset);
8665
8683
  sample.size = sample.data.byteLength;
@@ -8680,7 +8698,7 @@ var FMP4Remuxer = /* @__PURE__ */ function() {
8680
8698
  _sample2.size = sampleSize;
8681
8699
  _offset = _offset2, _sample = _sample2;
8682
8700
  };
8683
- for (var _i = 0, _l = samples.length, _offset = 0, _sample;_i < _l; _i++) {
8701
+ for (var _i = 0, _l = samples.length, _offset = 0, _sample; _i < _l; _i++) {
8684
8702
  _loop(_offset, _sample);
8685
8703
  }
8686
8704
  }
@@ -8712,6 +8730,7 @@ var FMP4Remuxer = /* @__PURE__ */ function() {
8712
8730
  }]);
8713
8731
  return FMP4Remuxer2;
8714
8732
  }();
8733
+
8715
8734
  // node_modules/xgplayer-flv/es/flv/services/transfer-cost.js
8716
8735
  var TransferCost = /* @__PURE__ */ function() {
8717
8736
  function TransferCost2() {
@@ -8767,10 +8786,10 @@ var TRANSFER_EVENT = {
8767
8786
  var logger2 = new Logger("BufferService");
8768
8787
  var BufferService = /* @__PURE__ */ function() {
8769
8788
  function BufferService2(flv, softVideo) {
8770
- var opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
8789
+ var opts = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
8771
8790
  _classCallCheck(this, BufferService2);
8772
8791
  _defineProperty(this, "flv", null);
8773
- _defineProperty(this, "_demuxer", new FlvDemuxer);
8792
+ _defineProperty(this, "_demuxer", new FlvDemuxer());
8774
8793
  _defineProperty(this, "_remuxer", null);
8775
8794
  _defineProperty(this, "_mse", null);
8776
8795
  _defineProperty(this, "_softVideo", null);
@@ -8798,18 +8817,18 @@ var BufferService = /* @__PURE__ */ function() {
8798
8817
  key: "baseDts",
8799
8818
  get: function get() {
8800
8819
  var _this$_demuxer, _this$_demuxer$_fixer;
8801
- return (_this$_demuxer = this._demuxer) === null || _this$_demuxer === undefined ? undefined : (_this$_demuxer$_fixer = _this$_demuxer._fixer) === null || _this$_demuxer$_fixer === undefined ? undefined : _this$_demuxer$_fixer._baseDts;
8820
+ return (_this$_demuxer = this._demuxer) === null || _this$_demuxer === void 0 ? void 0 : (_this$_demuxer$_fixer = _this$_demuxer._fixer) === null || _this$_demuxer$_fixer === void 0 ? void 0 : _this$_demuxer$_fixer._baseDts;
8802
8821
  }
8803
8822
  }, {
8804
8823
  key: "blobUrl",
8805
8824
  get: function get() {
8806
8825
  var _this$_mse;
8807
- return (_this$_mse = this._mse) === null || _this$_mse === undefined ? undefined : _this$_mse.url;
8826
+ return (_this$_mse = this._mse) === null || _this$_mse === void 0 ? void 0 : _this$_mse.url;
8808
8827
  }
8809
8828
  }, {
8810
8829
  key: "isFull",
8811
8830
  value: function isFull() {
8812
- var mediaType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : MSE.VIDEO;
8831
+ var mediaType = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : MSE.VIDEO;
8813
8832
  return this._mse.isFull(mediaType);
8814
8833
  }
8815
8834
  }, {
@@ -8832,10 +8851,10 @@ var BufferService = /* @__PURE__ */ function() {
8832
8851
  var _reset = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee() {
8833
8852
  var reuseMse, _args = arguments;
8834
8853
  return _regeneratorRuntime().wrap(function _callee$(_context) {
8835
- while (true)
8854
+ while (1)
8836
8855
  switch (_context.prev = _context.next) {
8837
8856
  case 0:
8838
- reuseMse = _args.length > 0 && _args[0] !== undefined ? _args[0] : false;
8857
+ reuseMse = _args.length > 0 && _args[0] !== void 0 ? _args[0] : false;
8839
8858
  if (!(this._mse && !reuseMse)) {
8840
8859
  _context.next = 6;
8841
8860
  break;
@@ -8877,7 +8896,7 @@ var BufferService = /* @__PURE__ */ function() {
8877
8896
  value: function() {
8878
8897
  var _endOfStream = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee2() {
8879
8898
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
8880
- while (true)
8899
+ while (1)
8881
8900
  switch (_context2.prev = _context2.next) {
8882
8901
  case 0:
8883
8902
  if (!this._mse) {
@@ -8915,7 +8934,7 @@ var BufferService = /* @__PURE__ */ function() {
8915
8934
  value: function() {
8916
8935
  var _updateDuration = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee3(duration) {
8917
8936
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
8918
- while (true)
8937
+ while (1)
8919
8938
  switch (_context3.prev = _context3.next) {
8920
8939
  case 0:
8921
8940
  if (!this._mse) {
@@ -8948,7 +8967,7 @@ var BufferService = /* @__PURE__ */ function() {
8948
8967
  value: function() {
8949
8968
  var _destroy = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee4() {
8950
8969
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
8951
- while (true)
8970
+ while (1)
8952
8971
  switch (_context4.prev = _context4.next) {
8953
8972
  case 0:
8954
8973
  if (!this._mse) {
@@ -8980,7 +8999,7 @@ var BufferService = /* @__PURE__ */ function() {
8980
8999
  var _this = this;
8981
9000
  var switchingNoReset, demuxer, videoTrack, audioTrack, metadataTrack, idx, videoExist, audioExist, duration, track, videoType, audioType, mse, afterAppend, newId, remuxResult, p, ret;
8982
9001
  return _regeneratorRuntime().wrap(function _callee5$(_context5) {
8983
- while (true)
9002
+ while (1)
8984
9003
  switch (_context5.prev = _context5.next) {
8985
9004
  case 0:
8986
9005
  switchingNoReset = false;
@@ -9042,9 +9061,9 @@ var BufferService = /* @__PURE__ */ function() {
9042
9061
  break;
9043
9062
  }
9044
9063
  duration = 0;
9045
- track = videoExist ? videoTrack : audioExist ? audioTrack : undefined;
9064
+ track = videoExist ? videoTrack : audioExist ? audioTrack : void 0;
9046
9065
  if (track && track.samples.length) {
9047
- duration = (track.samples[track.samples.length - 1].originPts - track.samples[0].originPts) / track.timescale * 1000;
9066
+ duration = (track.samples[track.samples.length - 1].originPts - track.samples[0].originPts) / track.timescale * 1e3;
9048
9067
  }
9049
9068
  if (!(duration > this._opts.analyzeDuration)) {
9050
9069
  _context5.next = 40;
@@ -9073,9 +9092,9 @@ var BufferService = /* @__PURE__ */ function() {
9073
9092
  mse = this._mse;
9074
9093
  afterAppend = function afterAppend2() {
9075
9094
  var _this$flv;
9076
- if ((_this$flv = _this.flv) !== null && _this$flv !== undefined && _this$flv.emit) {
9095
+ if ((_this$flv = _this.flv) !== null && _this$flv !== void 0 && _this$flv.emit) {
9077
9096
  var _this$flv2;
9078
- (_this$flv2 = _this.flv) === null || _this$flv2 === undefined || _this$flv2.emit(EVENT.APPEND_BUFFER, {});
9097
+ (_this$flv2 = _this.flv) === null || _this$flv2 === void 0 ? void 0 : _this$flv2.emit(EVENT.APPEND_BUFFER, {});
9079
9098
  }
9080
9099
  };
9081
9100
  this.flv.emit(EVENT.DEMUXED_TRACK, {
@@ -9170,7 +9189,7 @@ var BufferService = /* @__PURE__ */ function() {
9170
9189
  var _this2 = this;
9171
9190
  var media, currentTime, removeEnd, start;
9172
9191
  return _regeneratorRuntime().wrap(function _callee6$(_context6) {
9173
- while (true)
9192
+ while (1)
9174
9193
  switch (_context6.prev = _context6.next) {
9175
9194
  case 0:
9176
9195
  media = this.flv.media;
@@ -9188,7 +9207,7 @@ var BufferService = /* @__PURE__ */ function() {
9188
9207
  }
9189
9208
  return _context6.abrupt("return");
9190
9209
  case 7:
9191
- start = Buffer.start(Buffer.get(media));
9210
+ start = Buffer2.start(Buffer2.get(media));
9192
9211
  if (!(start + 1 >= removeEnd)) {
9193
9212
  _context6.next = 10;
9194
9213
  break;
@@ -9315,17 +9334,17 @@ var BufferService = /* @__PURE__ */ function() {
9315
9334
  function getOption(opts) {
9316
9335
  var ret = _objectSpread2({
9317
9336
  retryCount: 3,
9318
- retryDelay: 1000,
9337
+ retryDelay: 1e3,
9319
9338
  disconnectRetryCount: 0,
9320
9339
  loadTimeout: 1e4,
9321
- maxReaderInterval: 5000,
9340
+ maxReaderInterval: 5e3,
9322
9341
  preloadTime: 5,
9323
9342
  defaultVodLoadSize: 1e7,
9324
9343
  isLive: false,
9325
9344
  softDecode: false,
9326
9345
  bufferBehind: 10,
9327
9346
  maxJumpDistance: 3,
9328
- analyzeDuration: 20000,
9347
+ analyzeDuration: 2e4,
9329
9348
  seamlesslyReload: false,
9330
9349
  keepStatusAfterSwitch: true,
9331
9350
  onlyVideo: false,
@@ -9334,8 +9353,8 @@ function getOption(opts) {
9334
9353
  mseLowLatency: true,
9335
9354
  durationForMSELowLatencyOff: 6,
9336
9355
  chunkCountForSpeed: 50,
9337
- skipChunkSize: 1000,
9338
- longtimeNoReceived: 3000,
9356
+ skipChunkSize: 1e3,
9357
+ longtimeNoReceived: 3e3,
9339
9358
  enableStartGapJump: true
9340
9359
  }, opts);
9341
9360
  if (ret.isLive) {
@@ -9346,7 +9365,7 @@ function getOption(opts) {
9346
9365
  if (!ret.targetLatency) {
9347
9366
  ret.targetLatency = ret.preloadTime;
9348
9367
  }
9349
- if (ret.disconnectTime === null || ret.disconnectTime === undefined) {
9368
+ if (ret.disconnectTime === null || ret.disconnectTime === void 0) {
9350
9369
  ret.disconnectTime = ret.maxLatency;
9351
9370
  }
9352
9371
  }
@@ -9410,7 +9429,7 @@ var Flv = /* @__PURE__ */ function(_EventEmitter) {
9410
9429
  var _ref2 = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee(chunk, done, _ref, response) {
9411
9430
  var startTime, endTime, st, firstByteTime, _this$_mediaLoader, headers, elapsed, _this$_bufferService, remaining, maxReaderInterval;
9412
9431
  return _regeneratorRuntime().wrap(function _callee$(_context) {
9413
- while (true)
9432
+ while (1)
9414
9433
  switch (_context.prev = _context.next) {
9415
9434
  case 0:
9416
9435
  startTime = _ref.startTime, endTime = _ref.endTime, st = _ref.st, firstByteTime = _ref.firstByteTime;
@@ -9423,7 +9442,7 @@ var Flv = /* @__PURE__ */ function(_EventEmitter) {
9423
9442
  _context.next = 6;
9424
9443
  break;
9425
9444
  }
9426
- (_this$_mediaLoader = _this._mediaLoader) === null || _this$_mediaLoader === undefined || _this$_mediaLoader.cancel();
9445
+ (_this$_mediaLoader = _this._mediaLoader) === null || _this$_mediaLoader === void 0 ? void 0 : _this$_mediaLoader.cancel();
9427
9446
  return _context.abrupt("return");
9428
9447
  case 6:
9429
9448
  headers = response.headers;
@@ -9437,7 +9456,7 @@ var Flv = /* @__PURE__ */ function(_EventEmitter) {
9437
9456
  headers
9438
9457
  });
9439
9458
  _this._transferCost.set(TRANSFER_EVENT.TTFB, elapsed);
9440
- _this._acceptRanges = !!(headers !== null && headers !== undefined && headers.get("Accept-Ranges")) || !!(headers !== null && headers !== undefined && headers.get("Content-Range"));
9459
+ _this._acceptRanges = !!(headers !== null && headers !== void 0 && headers.get("Accept-Ranges")) || !!(headers !== null && headers !== void 0 && headers.get("Content-Range"));
9441
9460
  _this._firstProgressEmit = true;
9442
9461
  case 13:
9443
9462
  if (_this._bufferService) {
@@ -9447,12 +9466,12 @@ var Flv = /* @__PURE__ */ function(_EventEmitter) {
9447
9466
  return _context.abrupt("return");
9448
9467
  case 15:
9449
9468
  clearTimeout(_this._maxChunkWaitTimer);
9450
- _this._bandwidthService.addChunkRecord(chunk === null || chunk === undefined ? undefined : chunk.byteLength, endTime - startTime);
9469
+ _this._bandwidthService.addChunkRecord(chunk === null || chunk === void 0 ? void 0 : chunk.byteLength, endTime - startTime);
9451
9470
  _context.prev = 17;
9452
9471
  _context.next = 20;
9453
9472
  return _this._bufferService.appendBuffer(chunk);
9454
9473
  case 20:
9455
- (_this$_bufferService = _this._bufferService) === null || _this$_bufferService === undefined || _this$_bufferService.evictBuffer(_this._opts.bufferBehind);
9474
+ (_this$_bufferService = _this._bufferService) === null || _this$_bufferService === void 0 ? void 0 : _this$_bufferService.evictBuffer(_this._opts.bufferBehind);
9456
9475
  _context.next = 33;
9457
9476
  break;
9458
9477
  case 23:
@@ -9545,7 +9564,7 @@ var Flv = /* @__PURE__ */ function(_EventEmitter) {
9545
9564
  if (!media)
9546
9565
  return;
9547
9566
  _this._tickTimer = setTimeout(_this._tick, _this._tickInterval);
9548
- var bufferEnd = Buffer.end(Buffer.get(media));
9567
+ var bufferEnd = Buffer2.end(Buffer2.get(media));
9549
9568
  if (bufferEnd < MAX_HOLE || !media.readyState)
9550
9569
  return;
9551
9570
  var opts = _this._opts;
@@ -9568,10 +9587,10 @@ var Flv = /* @__PURE__ */ function(_EventEmitter) {
9568
9587
  });
9569
9588
  _defineProperty(_assertThisInitialized(_this), "_onPlay", function() {
9570
9589
  var _this$media, _this$media$buffered;
9571
- var canReplay = _this._opts.softDecode || ((_this$media = _this.media) === null || _this$media === undefined ? undefined : (_this$media$buffered = _this$media.buffered) === null || _this$media$buffered === undefined ? undefined : _this$media$buffered.length);
9590
+ var canReplay = _this._opts.softDecode || ((_this$media = _this.media) === null || _this$media === void 0 ? void 0 : (_this$media$buffered = _this$media.buffered) === null || _this$media$buffered === void 0 ? void 0 : _this$media$buffered.length);
9572
9591
  if (_this.isLive) {
9573
9592
  if (!_this._loading && canReplay) {
9574
- _this.replay(undefined, true);
9593
+ _this.replay(void 0, true);
9575
9594
  }
9576
9595
  return;
9577
9596
  }
@@ -9583,13 +9602,14 @@ var Flv = /* @__PURE__ */ function(_EventEmitter) {
9583
9602
  _defineProperty(_assertThisInitialized(_this), "_onLoadeddata", function() {
9584
9603
  if (_this.isLive && !_this._opts.mseLowLatency) {
9585
9604
  if (_this.media.duration !== Infinity) {
9586
- _this._bufferService.updateDuration(Infinity).catch(function(e) {});
9605
+ _this._bufferService.updateDuration(Infinity).catch(function(e) {
9606
+ });
9587
9607
  }
9588
9608
  }
9589
9609
  });
9590
9610
  _defineProperty(_assertThisInitialized(_this), "_onSeeking", /* @__PURE__ */ _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee2() {
9591
9611
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
9592
- while (true)
9612
+ while (1)
9593
9613
  switch (_context2.prev = _context2.next) {
9594
9614
  case 0:
9595
9615
  if (!_this.isLive && _this.seekable) {
@@ -9608,7 +9628,7 @@ var Flv = /* @__PURE__ */ function(_EventEmitter) {
9608
9628
  var opts = _this._opts;
9609
9629
  var currentTime = _this.media.currentTime;
9610
9630
  if (opts.isLive && opts.maxLatency && opts.targetLatency) {
9611
- var bufferEnd = Buffer.end(Buffer.get(_this.media));
9631
+ var bufferEnd = Buffer2.end(Buffer2.get(_this.media));
9612
9632
  var latency = bufferEnd - currentTime;
9613
9633
  if (latency >= opts.maxLatency) {
9614
9634
  _this.media.currentTime = bufferEnd - opts.targetLatency;
@@ -9643,10 +9663,10 @@ var Flv = /* @__PURE__ */ function(_EventEmitter) {
9643
9663
  _defineProperty(_assertThisInitialized(_this), "_checkPreload", /* @__PURE__ */ _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee3() {
9644
9664
  var _this$bufferInfo2, _this$bufferInfo2$rem, remainingBuffer, opts, filepositions, times, currentTime, i, end, startByte;
9645
9665
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
9646
- while (true)
9666
+ while (1)
9647
9667
  switch (_context3.prev = _context3.next) {
9648
9668
  case 0:
9649
- _this$bufferInfo2 = _this.bufferInfo(), _this$bufferInfo2$rem = _this$bufferInfo2.remaining, remainingBuffer = _this$bufferInfo2$rem === undefined ? 0 : _this$bufferInfo2$rem;
9669
+ _this$bufferInfo2 = _this.bufferInfo(), _this$bufferInfo2$rem = _this$bufferInfo2.remaining, remainingBuffer = _this$bufferInfo2$rem === void 0 ? 0 : _this$bufferInfo2$rem;
9650
9670
  opts = _this._opts;
9651
9671
  filepositions = _this._keyframes.filepositions;
9652
9672
  times = _this._keyframes.times;
@@ -9667,7 +9687,7 @@ var Flv = /* @__PURE__ */ function(_EventEmitter) {
9667
9687
  return _context3.abrupt("return");
9668
9688
  case 11:
9669
9689
  startByte = filepositions[i];
9670
- if (!(startByte === null || startByte === undefined)) {
9690
+ if (!(startByte === null || startByte === void 0)) {
9671
9691
  _context3.next = 14;
9672
9692
  break;
9673
9693
  }
@@ -9687,8 +9707,8 @@ var Flv = /* @__PURE__ */ function(_EventEmitter) {
9687
9707
  })));
9688
9708
  _defineProperty(_assertThisInitialized(_this), "_onFlvScriptData", function(sample) {
9689
9709
  var _sample$data, _sample$data$onMetaDa, _sample$data2, _sample$data2$onMetaD;
9690
- var keyframes = (_sample$data = sample.data) === null || _sample$data === undefined ? undefined : (_sample$data$onMetaDa = _sample$data.onMetaData) === null || _sample$data$onMetaDa === undefined ? undefined : _sample$data$onMetaDa.keyframes;
9691
- var duration = (_sample$data2 = sample.data) === null || _sample$data2 === undefined ? undefined : (_sample$data2$onMetaD = _sample$data2.onMetaData) === null || _sample$data2$onMetaD === undefined ? undefined : _sample$data2$onMetaD.duration;
9710
+ var keyframes = (_sample$data = sample.data) === null || _sample$data === void 0 ? void 0 : (_sample$data$onMetaDa = _sample$data.onMetaData) === null || _sample$data$onMetaDa === void 0 ? void 0 : _sample$data$onMetaDa.keyframes;
9711
+ var duration = (_sample$data2 = sample.data) === null || _sample$data2 === void 0 ? void 0 : (_sample$data2$onMetaD = _sample$data2.onMetaData) === null || _sample$data2$onMetaD === void 0 ? void 0 : _sample$data2$onMetaD.duration;
9692
9712
  if (keyframes) {
9693
9713
  _this._keyframes = keyframes;
9694
9714
  }
@@ -9709,8 +9729,8 @@ var Flv = /* @__PURE__ */ function(_EventEmitter) {
9709
9729
  responseType: "arraybuffer"
9710
9730
  }));
9711
9731
  _this._disconnectRetryCount = _this._opts.disconnectRetryCount;
9712
- _this._transferCost = new TransferCost;
9713
- _this._bufferService = new BufferService(_assertThisInitialized(_this), _this._opts.softDecode ? _this.media : undefined, _this._opts);
9732
+ _this._transferCost = new TransferCost();
9733
+ _this._bufferService = new BufferService(_assertThisInitialized(_this), _this._opts.softDecode ? _this.media : void 0, _this._opts);
9714
9734
  _this._seiService = new SeiService(_assertThisInitialized(_this));
9715
9735
  _this._bandwidthService = new BandwidthService({
9716
9736
  chunkCountForSpeed: _this._opts.chunkCountForSpeed,
@@ -9719,7 +9739,7 @@ var Flv = /* @__PURE__ */ function(_EventEmitter) {
9719
9739
  });
9720
9740
  _this._stats = new MediaStatsService(_assertThisInitialized(_this));
9721
9741
  if (!_this._opts.softDecode) {
9722
- _this._gapService = new GapService;
9742
+ _this._gapService = new GapService();
9723
9743
  }
9724
9744
  _this.media.addEventListener("play", _this._onPlay);
9725
9745
  _this.media.addEventListener("loadeddata", _this._onLoadeddata);
@@ -9744,7 +9764,7 @@ var Flv = /* @__PURE__ */ function(_EventEmitter) {
9744
9764
  key: "baseDts",
9745
9765
  get: function get() {
9746
9766
  var _this$_bufferService2;
9747
- return (_this$_bufferService2 = this._bufferService) === null || _this$_bufferService2 === undefined ? undefined : _this$_bufferService2.baseDts;
9767
+ return (_this$_bufferService2 = this._bufferService) === null || _this$_bufferService2 === void 0 ? void 0 : _this$_bufferService2.baseDts;
9748
9768
  }
9749
9769
  }, {
9750
9770
  key: "seekable",
@@ -9760,7 +9780,7 @@ var Flv = /* @__PURE__ */ function(_EventEmitter) {
9760
9780
  key: "blobUrl",
9761
9781
  get: function get() {
9762
9782
  var _this$_bufferService3;
9763
- return (_this$_bufferService3 = this._bufferService) === null || _this$_bufferService3 === undefined ? undefined : _this$_bufferService3.blobUrl;
9783
+ return (_this$_bufferService3 = this._bufferService) === null || _this$_bufferService3 === void 0 ? void 0 : _this$_bufferService3.blobUrl;
9764
9784
  }
9765
9785
  }, {
9766
9786
  key: "speedInfo",
@@ -9781,8 +9801,8 @@ var Flv = /* @__PURE__ */ function(_EventEmitter) {
9781
9801
  key: "bufferInfo",
9782
9802
  value: function bufferInfo() {
9783
9803
  var _this$media2;
9784
- var maxHole = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : MAX_HOLE;
9785
- return Buffer.info(Buffer.get(this.media), (_this$media2 = this.media) === null || _this$media2 === undefined ? undefined : _this$media2.currentTime, maxHole);
9804
+ var maxHole = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : MAX_HOLE;
9805
+ return Buffer2.info(Buffer2.get(this.media), (_this$media2 = this.media) === null || _this$media2 === void 0 ? void 0 : _this$media2.currentTime, maxHole);
9786
9806
  }
9787
9807
  }, {
9788
9808
  key: "playbackQuality",
@@ -9795,10 +9815,10 @@ var Flv = /* @__PURE__ */ function(_EventEmitter) {
9795
9815
  var _load = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee4(url) {
9796
9816
  var reuseMse, _args4 = arguments;
9797
9817
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
9798
- while (true)
9818
+ while (1)
9799
9819
  switch (_context4.prev = _context4.next) {
9800
9820
  case 0:
9801
- reuseMse = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : false;
9821
+ reuseMse = _args4.length > 1 && _args4[1] !== void 0 ? _args4[1] : false;
9802
9822
  if (this._bufferService) {
9803
9823
  _context4.next = 3;
9804
9824
  break;
@@ -9829,11 +9849,11 @@ var Flv = /* @__PURE__ */ function(_EventEmitter) {
9829
9849
  var _this2 = this;
9830
9850
  var seamlesslyReload, isPlayEmit, _args5 = arguments;
9831
9851
  return _regeneratorRuntime().wrap(function _callee5$(_context5) {
9832
- while (true)
9852
+ while (1)
9833
9853
  switch (_context5.prev = _context5.next) {
9834
9854
  case 0:
9835
- seamlesslyReload = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : this._opts.seamlesslyReload;
9836
- isPlayEmit = _args5.length > 1 ? _args5[1] : undefined;
9855
+ seamlesslyReload = _args5.length > 0 && _args5[0] !== void 0 ? _args5[0] : this._opts.seamlesslyReload;
9856
+ isPlayEmit = _args5.length > 1 ? _args5[1] : void 0;
9837
9857
  if (this.media) {
9838
9858
  _context5.next = 4;
9839
9859
  break;
@@ -9859,7 +9879,8 @@ var Flv = /* @__PURE__ */ function(_EventEmitter) {
9859
9879
  _context5.next = 13;
9860
9880
  return this.load();
9861
9881
  case 13:
9862
- return _context5.abrupt("return", this.media.play(!isPlayEmit).catch(function() {}));
9882
+ return _context5.abrupt("return", this.media.play(!isPlayEmit).catch(function() {
9883
+ }));
9863
9884
  case 14:
9864
9885
  case "end":
9865
9886
  return _context5.stop();
@@ -9876,7 +9897,7 @@ var Flv = /* @__PURE__ */ function(_EventEmitter) {
9876
9897
  value: function disconnect() {
9877
9898
  var _this$_bufferService4;
9878
9899
  logger3.debug("disconnect!");
9879
- (_this$_bufferService4 = this._bufferService) === null || _this$_bufferService4 === undefined || _this$_bufferService4.resetSeamlessSwitchStats();
9900
+ (_this$_bufferService4 = this._bufferService) === null || _this$_bufferService4 === void 0 ? void 0 : _this$_bufferService4.resetSeamlessSwitchStats();
9880
9901
  return this._clear();
9881
9902
  }
9882
9903
  }, {
@@ -9885,7 +9906,7 @@ var Flv = /* @__PURE__ */ function(_EventEmitter) {
9885
9906
  var _switchURL = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee7(url, seamless) {
9886
9907
  var _this3 = this;
9887
9908
  return _regeneratorRuntime().wrap(function _callee7$(_context7) {
9888
- while (true)
9909
+ while (1)
9889
9910
  switch (_context7.prev = _context7.next) {
9890
9911
  case 0:
9891
9912
  if (this._bufferService) {
@@ -9902,7 +9923,7 @@ var Flv = /* @__PURE__ */ function(_EventEmitter) {
9902
9923
  this._bufferService.seamlessLoadingSwitch = /* @__PURE__ */ function() {
9903
9924
  var _ref5 = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee6(pts) {
9904
9925
  return _regeneratorRuntime().wrap(function _callee6$(_context6) {
9905
- while (true)
9926
+ while (1)
9906
9927
  switch (_context6.prev = _context6.next) {
9907
9928
  case 0:
9908
9929
  _context6.next = 2;
@@ -9933,7 +9954,8 @@ var Flv = /* @__PURE__ */ function(_EventEmitter) {
9933
9954
  return this.load(url);
9934
9955
  case 9:
9935
9956
  this._urlSwitching = true;
9936
- return _context7.abrupt("return", this.media.play(true).catch(function() {}));
9957
+ return _context7.abrupt("return", this.media.play(true).catch(function() {
9958
+ }));
9937
9959
  case 11:
9938
9960
  _context7.next = 13;
9939
9961
  return this._clear();
@@ -9960,7 +9982,7 @@ var Flv = /* @__PURE__ */ function(_EventEmitter) {
9960
9982
  value: function() {
9961
9983
  var _destroy = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee8() {
9962
9984
  return _regeneratorRuntime().wrap(function _callee8$(_context8) {
9963
- while (true)
9985
+ while (1)
9964
9986
  switch (_context8.prev = _context8.next) {
9965
9987
  case 0:
9966
9988
  if (this.media) {
@@ -9997,10 +10019,10 @@ var Flv = /* @__PURE__ */ function(_EventEmitter) {
9997
10019
  key: "_emitError",
9998
10020
  value: function _emitError(error) {
9999
10021
  var _this$media3;
10000
- var endOfStream = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
10022
+ var endOfStream = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
10001
10023
  logger3.table(error);
10002
10024
  logger3.error(error);
10003
- logger3.error((_this$media3 = this.media) === null || _this$media3 === undefined ? undefined : _this$media3.error);
10025
+ logger3.error((_this$media3 = this.media) === null || _this$media3 === void 0 ? void 0 : _this$media3.error);
10004
10026
  if (this._urlSwitching) {
10005
10027
  this._urlSwitching = false;
10006
10028
  this._seamlessSwitching = false;
@@ -10018,10 +10040,10 @@ var Flv = /* @__PURE__ */ function(_EventEmitter) {
10018
10040
  var _reset2 = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee9() {
10019
10041
  var reuseMse, _args9 = arguments;
10020
10042
  return _regeneratorRuntime().wrap(function _callee9$(_context9) {
10021
- while (true)
10043
+ while (1)
10022
10044
  switch (_context9.prev = _context9.next) {
10023
10045
  case 0:
10024
- reuseMse = _args9.length > 0 && _args9[0] !== undefined ? _args9[0] : false;
10046
+ reuseMse = _args9.length > 0 && _args9[0] !== void 0 ? _args9[0] : false;
10025
10047
  this._seiService.reset();
10026
10048
  this._bandwidthService.reset();
10027
10049
  this._stats.reset();
@@ -10047,7 +10069,7 @@ var Flv = /* @__PURE__ */ function(_EventEmitter) {
10047
10069
  var _loadData2 = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee10(url, range) {
10048
10070
  var finnalUrl;
10049
10071
  return _regeneratorRuntime().wrap(function _callee10$(_context10) {
10050
- while (true)
10072
+ while (1)
10051
10073
  switch (_context10.prev = _context10.next) {
10052
10074
  case 0:
10053
10075
  if (url)
@@ -10106,7 +10128,7 @@ var Flv = /* @__PURE__ */ function(_EventEmitter) {
10106
10128
  value: function() {
10107
10129
  var _clear2 = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee11() {
10108
10130
  return _regeneratorRuntime().wrap(function _callee11$(_context11) {
10109
- while (true)
10131
+ while (1)
10110
10132
  switch (_context11.prev = _context11.next) {
10111
10133
  case 0:
10112
10134
  if (!this._mediaLoader) {
@@ -10160,7 +10182,8 @@ try {
10160
10182
  } else {
10161
10183
  Flv.disableLogger();
10162
10184
  }
10163
- } catch (error) {}
10185
+ } catch (error) {
10186
+ }
10164
10187
  export {
10165
10188
  Flv
10166
10189
  };