@bitmovin/api-sdk 1.217.0 → 1.218.0

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.
@@ -11,1205 +11,6 @@
11
11
  return /******/ (() => { // webpackBootstrap
12
12
  /******/ var __webpack_modules__ = ({
13
13
 
14
- /***/ "../node_modules/es6-promise/dist/es6-promise.js":
15
- /*!*******************************************************!*\
16
- !*** ../node_modules/es6-promise/dist/es6-promise.js ***!
17
- \*******************************************************/
18
- /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
19
-
20
- /*!
21
- * @overview es6-promise - a tiny implementation of Promises/A+.
22
- * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
23
- * @license Licensed under MIT license
24
- * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
25
- * @version v4.2.8+1e68dce6
26
- */
27
-
28
- (function (global, factory) {
29
- true ? module.exports = factory() :
30
- 0;
31
- }(this, (function () { 'use strict';
32
-
33
- function objectOrFunction(x) {
34
- var type = typeof x;
35
- return x !== null && (type === 'object' || type === 'function');
36
- }
37
-
38
- function isFunction(x) {
39
- return typeof x === 'function';
40
- }
41
-
42
-
43
-
44
- var _isArray = void 0;
45
- if (Array.isArray) {
46
- _isArray = Array.isArray;
47
- } else {
48
- _isArray = function (x) {
49
- return Object.prototype.toString.call(x) === '[object Array]';
50
- };
51
- }
52
-
53
- var isArray = _isArray;
54
-
55
- var len = 0;
56
- var vertxNext = void 0;
57
- var customSchedulerFn = void 0;
58
-
59
- var asap = function asap(callback, arg) {
60
- queue[len] = callback;
61
- queue[len + 1] = arg;
62
- len += 2;
63
- if (len === 2) {
64
- // If len is 2, that means that we need to schedule an async flush.
65
- // If additional callbacks are queued before the queue is flushed, they
66
- // will be processed by this flush that we are scheduling.
67
- if (customSchedulerFn) {
68
- customSchedulerFn(flush);
69
- } else {
70
- scheduleFlush();
71
- }
72
- }
73
- };
74
-
75
- function setScheduler(scheduleFn) {
76
- customSchedulerFn = scheduleFn;
77
- }
78
-
79
- function setAsap(asapFn) {
80
- asap = asapFn;
81
- }
82
-
83
- var browserWindow = typeof window !== 'undefined' ? window : undefined;
84
- var browserGlobal = browserWindow || {};
85
- var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;
86
- var isNode = typeof self === 'undefined' && typeof process !== 'undefined' && {}.toString.call(process) === '[object process]';
87
-
88
- // test for web worker but not in IE10
89
- var isWorker = typeof Uint8ClampedArray !== 'undefined' && typeof importScripts !== 'undefined' && typeof MessageChannel !== 'undefined';
90
-
91
- // node
92
- function useNextTick() {
93
- // node version 0.10.x displays a deprecation warning when nextTick is used recursively
94
- // see https://github.com/cujojs/when/issues/410 for details
95
- return function () {
96
- return process.nextTick(flush);
97
- };
98
- }
99
-
100
- // vertx
101
- function useVertxTimer() {
102
- if (typeof vertxNext !== 'undefined') {
103
- return function () {
104
- vertxNext(flush);
105
- };
106
- }
107
-
108
- return useSetTimeout();
109
- }
110
-
111
- function useMutationObserver() {
112
- var iterations = 0;
113
- var observer = new BrowserMutationObserver(flush);
114
- var node = document.createTextNode('');
115
- observer.observe(node, { characterData: true });
116
-
117
- return function () {
118
- node.data = iterations = ++iterations % 2;
119
- };
120
- }
121
-
122
- // web worker
123
- function useMessageChannel() {
124
- var channel = new MessageChannel();
125
- channel.port1.onmessage = flush;
126
- return function () {
127
- return channel.port2.postMessage(0);
128
- };
129
- }
130
-
131
- function useSetTimeout() {
132
- // Store setTimeout reference so es6-promise will be unaffected by
133
- // other code modifying setTimeout (like sinon.useFakeTimers())
134
- var globalSetTimeout = setTimeout;
135
- return function () {
136
- return globalSetTimeout(flush, 1);
137
- };
138
- }
139
-
140
- var queue = new Array(1000);
141
- function flush() {
142
- for (var i = 0; i < len; i += 2) {
143
- var callback = queue[i];
144
- var arg = queue[i + 1];
145
-
146
- callback(arg);
147
-
148
- queue[i] = undefined;
149
- queue[i + 1] = undefined;
150
- }
151
-
152
- len = 0;
153
- }
154
-
155
- function attemptVertx() {
156
- try {
157
- var vertx = Function('return this')().require('vertx');
158
- vertxNext = vertx.runOnLoop || vertx.runOnContext;
159
- return useVertxTimer();
160
- } catch (e) {
161
- return useSetTimeout();
162
- }
163
- }
164
-
165
- var scheduleFlush = void 0;
166
- // Decide what async method to use to triggering processing of queued callbacks:
167
- if (isNode) {
168
- scheduleFlush = useNextTick();
169
- } else if (BrowserMutationObserver) {
170
- scheduleFlush = useMutationObserver();
171
- } else if (isWorker) {
172
- scheduleFlush = useMessageChannel();
173
- } else if (browserWindow === undefined && "function" === 'function') {
174
- scheduleFlush = attemptVertx();
175
- } else {
176
- scheduleFlush = useSetTimeout();
177
- }
178
-
179
- function then(onFulfillment, onRejection) {
180
- var parent = this;
181
-
182
- var child = new this.constructor(noop);
183
-
184
- if (child[PROMISE_ID] === undefined) {
185
- makePromise(child);
186
- }
187
-
188
- var _state = parent._state;
189
-
190
-
191
- if (_state) {
192
- var callback = arguments[_state - 1];
193
- asap(function () {
194
- return invokeCallback(_state, child, callback, parent._result);
195
- });
196
- } else {
197
- subscribe(parent, child, onFulfillment, onRejection);
198
- }
199
-
200
- return child;
201
- }
202
-
203
- /**
204
- `Promise.resolve` returns a promise that will become resolved with the
205
- passed `value`. It is shorthand for the following:
206
-
207
- ```javascript
208
- let promise = new Promise(function(resolve, reject){
209
- resolve(1);
210
- });
211
-
212
- promise.then(function(value){
213
- // value === 1
214
- });
215
- ```
216
-
217
- Instead of writing the above, your code now simply becomes the following:
218
-
219
- ```javascript
220
- let promise = Promise.resolve(1);
221
-
222
- promise.then(function(value){
223
- // value === 1
224
- });
225
- ```
226
-
227
- @method resolve
228
- @static
229
- @param {Any} value value that the returned promise will be resolved with
230
- Useful for tooling.
231
- @return {Promise} a promise that will become fulfilled with the given
232
- `value`
233
- */
234
- function resolve$1(object) {
235
- /*jshint validthis:true */
236
- var Constructor = this;
237
-
238
- if (object && typeof object === 'object' && object.constructor === Constructor) {
239
- return object;
240
- }
241
-
242
- var promise = new Constructor(noop);
243
- resolve(promise, object);
244
- return promise;
245
- }
246
-
247
- var PROMISE_ID = Math.random().toString(36).substring(2);
248
-
249
- function noop() {}
250
-
251
- var PENDING = void 0;
252
- var FULFILLED = 1;
253
- var REJECTED = 2;
254
-
255
- function selfFulfillment() {
256
- return new TypeError("You cannot resolve a promise with itself");
257
- }
258
-
259
- function cannotReturnOwn() {
260
- return new TypeError('A promises callback cannot return that same promise.');
261
- }
262
-
263
- function tryThen(then$$1, value, fulfillmentHandler, rejectionHandler) {
264
- try {
265
- then$$1.call(value, fulfillmentHandler, rejectionHandler);
266
- } catch (e) {
267
- return e;
268
- }
269
- }
270
-
271
- function handleForeignThenable(promise, thenable, then$$1) {
272
- asap(function (promise) {
273
- var sealed = false;
274
- var error = tryThen(then$$1, thenable, function (value) {
275
- if (sealed) {
276
- return;
277
- }
278
- sealed = true;
279
- if (thenable !== value) {
280
- resolve(promise, value);
281
- } else {
282
- fulfill(promise, value);
283
- }
284
- }, function (reason) {
285
- if (sealed) {
286
- return;
287
- }
288
- sealed = true;
289
-
290
- reject(promise, reason);
291
- }, 'Settle: ' + (promise._label || ' unknown promise'));
292
-
293
- if (!sealed && error) {
294
- sealed = true;
295
- reject(promise, error);
296
- }
297
- }, promise);
298
- }
299
-
300
- function handleOwnThenable(promise, thenable) {
301
- if (thenable._state === FULFILLED) {
302
- fulfill(promise, thenable._result);
303
- } else if (thenable._state === REJECTED) {
304
- reject(promise, thenable._result);
305
- } else {
306
- subscribe(thenable, undefined, function (value) {
307
- return resolve(promise, value);
308
- }, function (reason) {
309
- return reject(promise, reason);
310
- });
311
- }
312
- }
313
-
314
- function handleMaybeThenable(promise, maybeThenable, then$$1) {
315
- if (maybeThenable.constructor === promise.constructor && then$$1 === then && maybeThenable.constructor.resolve === resolve$1) {
316
- handleOwnThenable(promise, maybeThenable);
317
- } else {
318
- if (then$$1 === undefined) {
319
- fulfill(promise, maybeThenable);
320
- } else if (isFunction(then$$1)) {
321
- handleForeignThenable(promise, maybeThenable, then$$1);
322
- } else {
323
- fulfill(promise, maybeThenable);
324
- }
325
- }
326
- }
327
-
328
- function resolve(promise, value) {
329
- if (promise === value) {
330
- reject(promise, selfFulfillment());
331
- } else if (objectOrFunction(value)) {
332
- var then$$1 = void 0;
333
- try {
334
- then$$1 = value.then;
335
- } catch (error) {
336
- reject(promise, error);
337
- return;
338
- }
339
- handleMaybeThenable(promise, value, then$$1);
340
- } else {
341
- fulfill(promise, value);
342
- }
343
- }
344
-
345
- function publishRejection(promise) {
346
- if (promise._onerror) {
347
- promise._onerror(promise._result);
348
- }
349
-
350
- publish(promise);
351
- }
352
-
353
- function fulfill(promise, value) {
354
- if (promise._state !== PENDING) {
355
- return;
356
- }
357
-
358
- promise._result = value;
359
- promise._state = FULFILLED;
360
-
361
- if (promise._subscribers.length !== 0) {
362
- asap(publish, promise);
363
- }
364
- }
365
-
366
- function reject(promise, reason) {
367
- if (promise._state !== PENDING) {
368
- return;
369
- }
370
- promise._state = REJECTED;
371
- promise._result = reason;
372
-
373
- asap(publishRejection, promise);
374
- }
375
-
376
- function subscribe(parent, child, onFulfillment, onRejection) {
377
- var _subscribers = parent._subscribers;
378
- var length = _subscribers.length;
379
-
380
-
381
- parent._onerror = null;
382
-
383
- _subscribers[length] = child;
384
- _subscribers[length + FULFILLED] = onFulfillment;
385
- _subscribers[length + REJECTED] = onRejection;
386
-
387
- if (length === 0 && parent._state) {
388
- asap(publish, parent);
389
- }
390
- }
391
-
392
- function publish(promise) {
393
- var subscribers = promise._subscribers;
394
- var settled = promise._state;
395
-
396
- if (subscribers.length === 0) {
397
- return;
398
- }
399
-
400
- var child = void 0,
401
- callback = void 0,
402
- detail = promise._result;
403
-
404
- for (var i = 0; i < subscribers.length; i += 3) {
405
- child = subscribers[i];
406
- callback = subscribers[i + settled];
407
-
408
- if (child) {
409
- invokeCallback(settled, child, callback, detail);
410
- } else {
411
- callback(detail);
412
- }
413
- }
414
-
415
- promise._subscribers.length = 0;
416
- }
417
-
418
- function invokeCallback(settled, promise, callback, detail) {
419
- var hasCallback = isFunction(callback),
420
- value = void 0,
421
- error = void 0,
422
- succeeded = true;
423
-
424
- if (hasCallback) {
425
- try {
426
- value = callback(detail);
427
- } catch (e) {
428
- succeeded = false;
429
- error = e;
430
- }
431
-
432
- if (promise === value) {
433
- reject(promise, cannotReturnOwn());
434
- return;
435
- }
436
- } else {
437
- value = detail;
438
- }
439
-
440
- if (promise._state !== PENDING) {
441
- // noop
442
- } else if (hasCallback && succeeded) {
443
- resolve(promise, value);
444
- } else if (succeeded === false) {
445
- reject(promise, error);
446
- } else if (settled === FULFILLED) {
447
- fulfill(promise, value);
448
- } else if (settled === REJECTED) {
449
- reject(promise, value);
450
- }
451
- }
452
-
453
- function initializePromise(promise, resolver) {
454
- try {
455
- resolver(function resolvePromise(value) {
456
- resolve(promise, value);
457
- }, function rejectPromise(reason) {
458
- reject(promise, reason);
459
- });
460
- } catch (e) {
461
- reject(promise, e);
462
- }
463
- }
464
-
465
- var id = 0;
466
- function nextId() {
467
- return id++;
468
- }
469
-
470
- function makePromise(promise) {
471
- promise[PROMISE_ID] = id++;
472
- promise._state = undefined;
473
- promise._result = undefined;
474
- promise._subscribers = [];
475
- }
476
-
477
- function validationError() {
478
- return new Error('Array Methods must be provided an Array');
479
- }
480
-
481
- var Enumerator = function () {
482
- function Enumerator(Constructor, input) {
483
- this._instanceConstructor = Constructor;
484
- this.promise = new Constructor(noop);
485
-
486
- if (!this.promise[PROMISE_ID]) {
487
- makePromise(this.promise);
488
- }
489
-
490
- if (isArray(input)) {
491
- this.length = input.length;
492
- this._remaining = input.length;
493
-
494
- this._result = new Array(this.length);
495
-
496
- if (this.length === 0) {
497
- fulfill(this.promise, this._result);
498
- } else {
499
- this.length = this.length || 0;
500
- this._enumerate(input);
501
- if (this._remaining === 0) {
502
- fulfill(this.promise, this._result);
503
- }
504
- }
505
- } else {
506
- reject(this.promise, validationError());
507
- }
508
- }
509
-
510
- Enumerator.prototype._enumerate = function _enumerate(input) {
511
- for (var i = 0; this._state === PENDING && i < input.length; i++) {
512
- this._eachEntry(input[i], i);
513
- }
514
- };
515
-
516
- Enumerator.prototype._eachEntry = function _eachEntry(entry, i) {
517
- var c = this._instanceConstructor;
518
- var resolve$$1 = c.resolve;
519
-
520
-
521
- if (resolve$$1 === resolve$1) {
522
- var _then = void 0;
523
- var error = void 0;
524
- var didError = false;
525
- try {
526
- _then = entry.then;
527
- } catch (e) {
528
- didError = true;
529
- error = e;
530
- }
531
-
532
- if (_then === then && entry._state !== PENDING) {
533
- this._settledAt(entry._state, i, entry._result);
534
- } else if (typeof _then !== 'function') {
535
- this._remaining--;
536
- this._result[i] = entry;
537
- } else if (c === Promise$1) {
538
- var promise = new c(noop);
539
- if (didError) {
540
- reject(promise, error);
541
- } else {
542
- handleMaybeThenable(promise, entry, _then);
543
- }
544
- this._willSettleAt(promise, i);
545
- } else {
546
- this._willSettleAt(new c(function (resolve$$1) {
547
- return resolve$$1(entry);
548
- }), i);
549
- }
550
- } else {
551
- this._willSettleAt(resolve$$1(entry), i);
552
- }
553
- };
554
-
555
- Enumerator.prototype._settledAt = function _settledAt(state, i, value) {
556
- var promise = this.promise;
557
-
558
-
559
- if (promise._state === PENDING) {
560
- this._remaining--;
561
-
562
- if (state === REJECTED) {
563
- reject(promise, value);
564
- } else {
565
- this._result[i] = value;
566
- }
567
- }
568
-
569
- if (this._remaining === 0) {
570
- fulfill(promise, this._result);
571
- }
572
- };
573
-
574
- Enumerator.prototype._willSettleAt = function _willSettleAt(promise, i) {
575
- var enumerator = this;
576
-
577
- subscribe(promise, undefined, function (value) {
578
- return enumerator._settledAt(FULFILLED, i, value);
579
- }, function (reason) {
580
- return enumerator._settledAt(REJECTED, i, reason);
581
- });
582
- };
583
-
584
- return Enumerator;
585
- }();
586
-
587
- /**
588
- `Promise.all` accepts an array of promises, and returns a new promise which
589
- is fulfilled with an array of fulfillment values for the passed promises, or
590
- rejected with the reason of the first passed promise to be rejected. It casts all
591
- elements of the passed iterable to promises as it runs this algorithm.
592
-
593
- Example:
594
-
595
- ```javascript
596
- let promise1 = resolve(1);
597
- let promise2 = resolve(2);
598
- let promise3 = resolve(3);
599
- let promises = [ promise1, promise2, promise3 ];
600
-
601
- Promise.all(promises).then(function(array){
602
- // The array here would be [ 1, 2, 3 ];
603
- });
604
- ```
605
-
606
- If any of the `promises` given to `all` are rejected, the first promise
607
- that is rejected will be given as an argument to the returned promises's
608
- rejection handler. For example:
609
-
610
- Example:
611
-
612
- ```javascript
613
- let promise1 = resolve(1);
614
- let promise2 = reject(new Error("2"));
615
- let promise3 = reject(new Error("3"));
616
- let promises = [ promise1, promise2, promise3 ];
617
-
618
- Promise.all(promises).then(function(array){
619
- // Code here never runs because there are rejected promises!
620
- }, function(error) {
621
- // error.message === "2"
622
- });
623
- ```
624
-
625
- @method all
626
- @static
627
- @param {Array} entries array of promises
628
- @param {String} label optional string for labeling the promise.
629
- Useful for tooling.
630
- @return {Promise} promise that is fulfilled when all `promises` have been
631
- fulfilled, or rejected if any of them become rejected.
632
- @static
633
- */
634
- function all(entries) {
635
- return new Enumerator(this, entries).promise;
636
- }
637
-
638
- /**
639
- `Promise.race` returns a new promise which is settled in the same way as the
640
- first passed promise to settle.
641
-
642
- Example:
643
-
644
- ```javascript
645
- let promise1 = new Promise(function(resolve, reject){
646
- setTimeout(function(){
647
- resolve('promise 1');
648
- }, 200);
649
- });
650
-
651
- let promise2 = new Promise(function(resolve, reject){
652
- setTimeout(function(){
653
- resolve('promise 2');
654
- }, 100);
655
- });
656
-
657
- Promise.race([promise1, promise2]).then(function(result){
658
- // result === 'promise 2' because it was resolved before promise1
659
- // was resolved.
660
- });
661
- ```
662
-
663
- `Promise.race` is deterministic in that only the state of the first
664
- settled promise matters. For example, even if other promises given to the
665
- `promises` array argument are resolved, but the first settled promise has
666
- become rejected before the other promises became fulfilled, the returned
667
- promise will become rejected:
668
-
669
- ```javascript
670
- let promise1 = new Promise(function(resolve, reject){
671
- setTimeout(function(){
672
- resolve('promise 1');
673
- }, 200);
674
- });
675
-
676
- let promise2 = new Promise(function(resolve, reject){
677
- setTimeout(function(){
678
- reject(new Error('promise 2'));
679
- }, 100);
680
- });
681
-
682
- Promise.race([promise1, promise2]).then(function(result){
683
- // Code here never runs
684
- }, function(reason){
685
- // reason.message === 'promise 2' because promise 2 became rejected before
686
- // promise 1 became fulfilled
687
- });
688
- ```
689
-
690
- An example real-world use case is implementing timeouts:
691
-
692
- ```javascript
693
- Promise.race([ajax('foo.json'), timeout(5000)])
694
- ```
695
-
696
- @method race
697
- @static
698
- @param {Array} promises array of promises to observe
699
- Useful for tooling.
700
- @return {Promise} a promise which settles in the same way as the first passed
701
- promise to settle.
702
- */
703
- function race(entries) {
704
- /*jshint validthis:true */
705
- var Constructor = this;
706
-
707
- if (!isArray(entries)) {
708
- return new Constructor(function (_, reject) {
709
- return reject(new TypeError('You must pass an array to race.'));
710
- });
711
- } else {
712
- return new Constructor(function (resolve, reject) {
713
- var length = entries.length;
714
- for (var i = 0; i < length; i++) {
715
- Constructor.resolve(entries[i]).then(resolve, reject);
716
- }
717
- });
718
- }
719
- }
720
-
721
- /**
722
- `Promise.reject` returns a promise rejected with the passed `reason`.
723
- It is shorthand for the following:
724
-
725
- ```javascript
726
- let promise = new Promise(function(resolve, reject){
727
- reject(new Error('WHOOPS'));
728
- });
729
-
730
- promise.then(function(value){
731
- // Code here doesn't run because the promise is rejected!
732
- }, function(reason){
733
- // reason.message === 'WHOOPS'
734
- });
735
- ```
736
-
737
- Instead of writing the above, your code now simply becomes the following:
738
-
739
- ```javascript
740
- let promise = Promise.reject(new Error('WHOOPS'));
741
-
742
- promise.then(function(value){
743
- // Code here doesn't run because the promise is rejected!
744
- }, function(reason){
745
- // reason.message === 'WHOOPS'
746
- });
747
- ```
748
-
749
- @method reject
750
- @static
751
- @param {Any} reason value that the returned promise will be rejected with.
752
- Useful for tooling.
753
- @return {Promise} a promise rejected with the given `reason`.
754
- */
755
- function reject$1(reason) {
756
- /*jshint validthis:true */
757
- var Constructor = this;
758
- var promise = new Constructor(noop);
759
- reject(promise, reason);
760
- return promise;
761
- }
762
-
763
- function needsResolver() {
764
- throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');
765
- }
766
-
767
- function needsNew() {
768
- throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");
769
- }
770
-
771
- /**
772
- Promise objects represent the eventual result of an asynchronous operation. The
773
- primary way of interacting with a promise is through its `then` method, which
774
- registers callbacks to receive either a promise's eventual value or the reason
775
- why the promise cannot be fulfilled.
776
-
777
- Terminology
778
- -----------
779
-
780
- - `promise` is an object or function with a `then` method whose behavior conforms to this specification.
781
- - `thenable` is an object or function that defines a `then` method.
782
- - `value` is any legal JavaScript value (including undefined, a thenable, or a promise).
783
- - `exception` is a value that is thrown using the throw statement.
784
- - `reason` is a value that indicates why a promise was rejected.
785
- - `settled` the final resting state of a promise, fulfilled or rejected.
786
-
787
- A promise can be in one of three states: pending, fulfilled, or rejected.
788
-
789
- Promises that are fulfilled have a fulfillment value and are in the fulfilled
790
- state. Promises that are rejected have a rejection reason and are in the
791
- rejected state. A fulfillment value is never a thenable.
792
-
793
- Promises can also be said to *resolve* a value. If this value is also a
794
- promise, then the original promise's settled state will match the value's
795
- settled state. So a promise that *resolves* a promise that rejects will
796
- itself reject, and a promise that *resolves* a promise that fulfills will
797
- itself fulfill.
798
-
799
-
800
- Basic Usage:
801
- ------------
802
-
803
- ```js
804
- let promise = new Promise(function(resolve, reject) {
805
- // on success
806
- resolve(value);
807
-
808
- // on failure
809
- reject(reason);
810
- });
811
-
812
- promise.then(function(value) {
813
- // on fulfillment
814
- }, function(reason) {
815
- // on rejection
816
- });
817
- ```
818
-
819
- Advanced Usage:
820
- ---------------
821
-
822
- Promises shine when abstracting away asynchronous interactions such as
823
- `XMLHttpRequest`s.
824
-
825
- ```js
826
- function getJSON(url) {
827
- return new Promise(function(resolve, reject){
828
- let xhr = new XMLHttpRequest();
829
-
830
- xhr.open('GET', url);
831
- xhr.onreadystatechange = handler;
832
- xhr.responseType = 'json';
833
- xhr.setRequestHeader('Accept', 'application/json');
834
- xhr.send();
835
-
836
- function handler() {
837
- if (this.readyState === this.DONE) {
838
- if (this.status === 200) {
839
- resolve(this.response);
840
- } else {
841
- reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']'));
842
- }
843
- }
844
- };
845
- });
846
- }
847
-
848
- getJSON('/posts.json').then(function(json) {
849
- // on fulfillment
850
- }, function(reason) {
851
- // on rejection
852
- });
853
- ```
854
-
855
- Unlike callbacks, promises are great composable primitives.
856
-
857
- ```js
858
- Promise.all([
859
- getJSON('/posts'),
860
- getJSON('/comments')
861
- ]).then(function(values){
862
- values[0] // => postsJSON
863
- values[1] // => commentsJSON
864
-
865
- return values;
866
- });
867
- ```
868
-
869
- @class Promise
870
- @param {Function} resolver
871
- Useful for tooling.
872
- @constructor
873
- */
874
-
875
- var Promise$1 = function () {
876
- function Promise(resolver) {
877
- this[PROMISE_ID] = nextId();
878
- this._result = this._state = undefined;
879
- this._subscribers = [];
880
-
881
- if (noop !== resolver) {
882
- typeof resolver !== 'function' && needsResolver();
883
- this instanceof Promise ? initializePromise(this, resolver) : needsNew();
884
- }
885
- }
886
-
887
- /**
888
- The primary way of interacting with a promise is through its `then` method,
889
- which registers callbacks to receive either a promise's eventual value or the
890
- reason why the promise cannot be fulfilled.
891
- ```js
892
- findUser().then(function(user){
893
- // user is available
894
- }, function(reason){
895
- // user is unavailable, and you are given the reason why
896
- });
897
- ```
898
- Chaining
899
- --------
900
- The return value of `then` is itself a promise. This second, 'downstream'
901
- promise is resolved with the return value of the first promise's fulfillment
902
- or rejection handler, or rejected if the handler throws an exception.
903
- ```js
904
- findUser().then(function (user) {
905
- return user.name;
906
- }, function (reason) {
907
- return 'default name';
908
- }).then(function (userName) {
909
- // If `findUser` fulfilled, `userName` will be the user's name, otherwise it
910
- // will be `'default name'`
911
- });
912
- findUser().then(function (user) {
913
- throw new Error('Found user, but still unhappy');
914
- }, function (reason) {
915
- throw new Error('`findUser` rejected and we're unhappy');
916
- }).then(function (value) {
917
- // never reached
918
- }, function (reason) {
919
- // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'.
920
- // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'.
921
- });
922
- ```
923
- If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream.
924
- ```js
925
- findUser().then(function (user) {
926
- throw new PedagogicalException('Upstream error');
927
- }).then(function (value) {
928
- // never reached
929
- }).then(function (value) {
930
- // never reached
931
- }, function (reason) {
932
- // The `PedgagocialException` is propagated all the way down to here
933
- });
934
- ```
935
- Assimilation
936
- ------------
937
- Sometimes the value you want to propagate to a downstream promise can only be
938
- retrieved asynchronously. This can be achieved by returning a promise in the
939
- fulfillment or rejection handler. The downstream promise will then be pending
940
- until the returned promise is settled. This is called *assimilation*.
941
- ```js
942
- findUser().then(function (user) {
943
- return findCommentsByAuthor(user);
944
- }).then(function (comments) {
945
- // The user's comments are now available
946
- });
947
- ```
948
- If the assimliated promise rejects, then the downstream promise will also reject.
949
- ```js
950
- findUser().then(function (user) {
951
- return findCommentsByAuthor(user);
952
- }).then(function (comments) {
953
- // If `findCommentsByAuthor` fulfills, we'll have the value here
954
- }, function (reason) {
955
- // If `findCommentsByAuthor` rejects, we'll have the reason here
956
- });
957
- ```
958
- Simple Example
959
- --------------
960
- Synchronous Example
961
- ```javascript
962
- let result;
963
- try {
964
- result = findResult();
965
- // success
966
- } catch(reason) {
967
- // failure
968
- }
969
- ```
970
- Errback Example
971
- ```js
972
- findResult(function(result, err){
973
- if (err) {
974
- // failure
975
- } else {
976
- // success
977
- }
978
- });
979
- ```
980
- Promise Example;
981
- ```javascript
982
- findResult().then(function(result){
983
- // success
984
- }, function(reason){
985
- // failure
986
- });
987
- ```
988
- Advanced Example
989
- --------------
990
- Synchronous Example
991
- ```javascript
992
- let author, books;
993
- try {
994
- author = findAuthor();
995
- books = findBooksByAuthor(author);
996
- // success
997
- } catch(reason) {
998
- // failure
999
- }
1000
- ```
1001
- Errback Example
1002
- ```js
1003
- function foundBooks(books) {
1004
- }
1005
- function failure(reason) {
1006
- }
1007
- findAuthor(function(author, err){
1008
- if (err) {
1009
- failure(err);
1010
- // failure
1011
- } else {
1012
- try {
1013
- findBoooksByAuthor(author, function(books, err) {
1014
- if (err) {
1015
- failure(err);
1016
- } else {
1017
- try {
1018
- foundBooks(books);
1019
- } catch(reason) {
1020
- failure(reason);
1021
- }
1022
- }
1023
- });
1024
- } catch(error) {
1025
- failure(err);
1026
- }
1027
- // success
1028
- }
1029
- });
1030
- ```
1031
- Promise Example;
1032
- ```javascript
1033
- findAuthor().
1034
- then(findBooksByAuthor).
1035
- then(function(books){
1036
- // found books
1037
- }).catch(function(reason){
1038
- // something went wrong
1039
- });
1040
- ```
1041
- @method then
1042
- @param {Function} onFulfilled
1043
- @param {Function} onRejected
1044
- Useful for tooling.
1045
- @return {Promise}
1046
- */
1047
-
1048
- /**
1049
- `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same
1050
- as the catch block of a try/catch statement.
1051
- ```js
1052
- function findAuthor(){
1053
- throw new Error('couldn't find that author');
1054
- }
1055
- // synchronous
1056
- try {
1057
- findAuthor();
1058
- } catch(reason) {
1059
- // something went wrong
1060
- }
1061
- // async with promises
1062
- findAuthor().catch(function(reason){
1063
- // something went wrong
1064
- });
1065
- ```
1066
- @method catch
1067
- @param {Function} onRejection
1068
- Useful for tooling.
1069
- @return {Promise}
1070
- */
1071
-
1072
-
1073
- Promise.prototype.catch = function _catch(onRejection) {
1074
- return this.then(null, onRejection);
1075
- };
1076
-
1077
- /**
1078
- `finally` will be invoked regardless of the promise's fate just as native
1079
- try/catch/finally behaves
1080
-
1081
- Synchronous example:
1082
-
1083
- ```js
1084
- findAuthor() {
1085
- if (Math.random() > 0.5) {
1086
- throw new Error();
1087
- }
1088
- return new Author();
1089
- }
1090
-
1091
- try {
1092
- return findAuthor(); // succeed or fail
1093
- } catch(error) {
1094
- return findOtherAuther();
1095
- } finally {
1096
- // always runs
1097
- // doesn't affect the return value
1098
- }
1099
- ```
1100
-
1101
- Asynchronous example:
1102
-
1103
- ```js
1104
- findAuthor().catch(function(reason){
1105
- return findOtherAuther();
1106
- }).finally(function(){
1107
- // author was either found, or not
1108
- });
1109
- ```
1110
-
1111
- @method finally
1112
- @param {Function} callback
1113
- @return {Promise}
1114
- */
1115
-
1116
-
1117
- Promise.prototype.finally = function _finally(callback) {
1118
- var promise = this;
1119
- var constructor = promise.constructor;
1120
-
1121
- if (isFunction(callback)) {
1122
- return promise.then(function (value) {
1123
- return constructor.resolve(callback()).then(function () {
1124
- return value;
1125
- });
1126
- }, function (reason) {
1127
- return constructor.resolve(callback()).then(function () {
1128
- throw reason;
1129
- });
1130
- });
1131
- }
1132
-
1133
- return promise.then(callback, callback);
1134
- };
1135
-
1136
- return Promise;
1137
- }();
1138
-
1139
- Promise$1.prototype.then = then;
1140
- Promise$1.all = all;
1141
- Promise$1.race = race;
1142
- Promise$1.resolve = resolve$1;
1143
- Promise$1.reject = reject$1;
1144
- Promise$1._setScheduler = setScheduler;
1145
- Promise$1._setAsap = setAsap;
1146
- Promise$1._asap = asap;
1147
-
1148
- /*global self*/
1149
- function polyfill() {
1150
- var local = void 0;
1151
-
1152
- if (typeof __webpack_require__.g !== 'undefined') {
1153
- local = __webpack_require__.g;
1154
- } else if (typeof self !== 'undefined') {
1155
- local = self;
1156
- } else {
1157
- try {
1158
- local = Function('return this')();
1159
- } catch (e) {
1160
- throw new Error('polyfill failed because global object is unavailable in this environment');
1161
- }
1162
- }
1163
-
1164
- var P = local.Promise;
1165
-
1166
- if (P) {
1167
- var promiseToString = null;
1168
- try {
1169
- promiseToString = Object.prototype.toString.call(P.resolve());
1170
- } catch (e) {
1171
- // silently ignored
1172
- }
1173
-
1174
- if (promiseToString === '[object Promise]' && !P.cast) {
1175
- return;
1176
- }
1177
- }
1178
-
1179
- local.Promise = Promise$1;
1180
- }
1181
-
1182
- // Strange compat..
1183
- Promise$1.polyfill = polyfill;
1184
- Promise$1.Promise = Promise$1;
1185
-
1186
- return Promise$1;
1187
-
1188
- })));
1189
-
1190
-
1191
-
1192
- //# sourceMappingURL=es6-promise.map
1193
-
1194
-
1195
- /***/ }),
1196
-
1197
- /***/ "../node_modules/isomorphic-fetch/fetch-npm-browserify.js":
1198
- /*!****************************************************************!*\
1199
- !*** ../node_modules/isomorphic-fetch/fetch-npm-browserify.js ***!
1200
- \****************************************************************/
1201
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
1202
-
1203
- // the whatwg-fetch polyfill installs the fetch() function
1204
- // on the global object (window or self)
1205
- //
1206
- // Return that as the export for use in Webpack, Browserify etc.
1207
- __webpack_require__(/*! whatwg-fetch */ "../node_modules/whatwg-fetch/fetch.js");
1208
- module.exports = self.fetch.bind(self);
1209
-
1210
-
1211
- /***/ }),
1212
-
1213
14
  /***/ "./BitmovinApi.ts":
1214
15
  /*!************************!*\
1215
16
  !*** ./BitmovinApi.ts ***!
@@ -5842,13 +4643,10 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
5842
4643
  Object.defineProperty(exports, "__esModule", ({ value: true }));
5843
4644
  exports.RestClient = void 0;
5844
4645
  exports.copyAndPrepareBody = copyAndPrepareBody;
5845
- var e6p = __webpack_require__(/*! es6-promise */ "../node_modules/es6-promise/dist/es6-promise.js");
5846
4646
  var urljoin = __webpack_require__(/*! url-join */ "../node_modules/url-join/lib/url-join.js");
5847
- var isomorphicFetch = __webpack_require__(/*! isomorphic-fetch */ "../node_modules/isomorphic-fetch/fetch-npm-browserify.js");
5848
4647
  var BaseAPI_1 = __webpack_require__(/*! ./BaseAPI */ "./common/BaseAPI.ts");
5849
4648
  var NullLogger_1 = __webpack_require__(/*! ./NullLogger */ "./common/NullLogger.ts");
5850
4649
  var BitmovinErrorBuilder_1 = __webpack_require__(/*! ./BitmovinErrorBuilder */ "./common/BitmovinErrorBuilder.ts");
5851
- e6p.polyfill();
5852
4650
  var BASE_URL = 'https://api.bitmovin.com/v1';
5853
4651
  function prepareUrlParameterValue(parameterValue) {
5854
4652
  if (parameterValue instanceof Date) {
@@ -5944,7 +4742,7 @@ var RestClient = /** @class */ (function () {
5944
4742
  this.apiKey = configuration.apiKey;
5945
4743
  this.tenantOrgId = configuration.tenantOrgId;
5946
4744
  this.baseUrl = configuration.baseUrl || BASE_URL;
5947
- this.fetch = configuration.fetch || isomorphicFetch;
4745
+ this.fetch = configuration.fetch || fetch;
5948
4746
  this.logger = configuration.logger || new NullLogger_1.default();
5949
4747
  this.headers = configuration.headers;
5950
4748
  this.httpHandler = this.buildHttpHandler();
@@ -6029,7 +4827,7 @@ var HeaderHandler = /** @class */ (function (_super) {
6029
4827
  var headers = {
6030
4828
  'X-Api-Key': apiKey,
6031
4829
  'X-Api-Client': 'bitmovin-api-sdk-javascript',
6032
- 'X-Api-Client-Version': '1.217.0',
4830
+ 'X-Api-Client-Version': '1.218.0',
6033
4831
  'Content-Type': 'application/json'
6034
4832
  };
6035
4833
  if (tenantOrgId) {
@@ -65572,6 +64370,30 @@ exports.DashFmp4Representation = DashFmp4Representation;
65572
64370
  exports["default"] = DashFmp4Representation;
65573
64371
 
65574
64372
 
64373
+ /***/ }),
64374
+
64375
+ /***/ "./models/DashISO8601TimestampFormat.ts":
64376
+ /*!**********************************************!*\
64377
+ !*** ./models/DashISO8601TimestampFormat.ts ***!
64378
+ \**********************************************/
64379
+ /***/ ((__unused_webpack_module, exports) => {
64380
+
64381
+ "use strict";
64382
+
64383
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
64384
+ exports.DashISO8601TimestampFormat = void 0;
64385
+ /**
64386
+ * @export
64387
+ * @enum {string}
64388
+ */
64389
+ var DashISO8601TimestampFormat;
64390
+ (function (DashISO8601TimestampFormat) {
64391
+ DashISO8601TimestampFormat["LONG"] = "LONG";
64392
+ DashISO8601TimestampFormat["SHORT"] = "SHORT";
64393
+ })(DashISO8601TimestampFormat || (exports.DashISO8601TimestampFormat = DashISO8601TimestampFormat = {}));
64394
+ exports["default"] = DashISO8601TimestampFormat;
64395
+
64396
+
65575
64397
  /***/ }),
65576
64398
 
65577
64399
  /***/ "./models/DashImscRepresentation.ts":
@@ -65675,6 +64497,7 @@ var DashManifest = /** @class */ (function (_super) {
65675
64497
  _this.namespaces = (0, Mapper_1.mapArray)(obj.namespaces, XmlNamespace_1.default);
65676
64498
  _this.utcTimings = (0, Mapper_1.mapArray)(obj.utcTimings, UtcTiming_1.default);
65677
64499
  _this.dashEditionCompatibility = (0, Mapper_1.map)(obj.dashEditionCompatibility);
64500
+ _this.iso8601TimestampFormat = (0, Mapper_1.map)(obj.iso8601TimestampFormat);
65678
64501
  return _this;
65679
64502
  }
65680
64503
  return DashManifest;
@@ -79301,6 +78124,63 @@ var ProfileH265;
79301
78124
  exports["default"] = ProfileH265;
79302
78125
 
79303
78126
 
78127
+ /***/ }),
78128
+
78129
+ /***/ "./models/ProgramDateTimePlacement.ts":
78130
+ /*!********************************************!*\
78131
+ !*** ./models/ProgramDateTimePlacement.ts ***!
78132
+ \********************************************/
78133
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
78134
+
78135
+ "use strict";
78136
+
78137
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
78138
+ exports.ProgramDateTimePlacement = void 0;
78139
+ var Mapper_1 = __webpack_require__(/*! ../common/Mapper */ "./common/Mapper.ts");
78140
+ /**
78141
+ * @export
78142
+ * @class ProgramDateTimePlacement
78143
+ */
78144
+ var ProgramDateTimePlacement = /** @class */ (function () {
78145
+ function ProgramDateTimePlacement(obj) {
78146
+ if (!obj) {
78147
+ return;
78148
+ }
78149
+ this.programDateTimePlacementMode = (0, Mapper_1.map)(obj.programDateTimePlacementMode);
78150
+ this.interval = (0, Mapper_1.map)(obj.interval);
78151
+ }
78152
+ return ProgramDateTimePlacement;
78153
+ }());
78154
+ exports.ProgramDateTimePlacement = ProgramDateTimePlacement;
78155
+ exports["default"] = ProgramDateTimePlacement;
78156
+
78157
+
78158
+ /***/ }),
78159
+
78160
+ /***/ "./models/ProgramDateTimePlacementMode.ts":
78161
+ /*!************************************************!*\
78162
+ !*** ./models/ProgramDateTimePlacementMode.ts ***!
78163
+ \************************************************/
78164
+ /***/ ((__unused_webpack_module, exports) => {
78165
+
78166
+ "use strict";
78167
+
78168
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
78169
+ exports.ProgramDateTimePlacementMode = void 0;
78170
+ /**
78171
+ * Placement mode of the ProgramDateTime tag.
78172
+ * @export
78173
+ * @enum {string}
78174
+ */
78175
+ var ProgramDateTimePlacementMode;
78176
+ (function (ProgramDateTimePlacementMode) {
78177
+ ProgramDateTimePlacementMode["ONCE_PER_PLAYLIST"] = "ONCE_PER_PLAYLIST";
78178
+ ProgramDateTimePlacementMode["SEGMENTS_INTERVAL"] = "SEGMENTS_INTERVAL";
78179
+ ProgramDateTimePlacementMode["SECONDS_INTERVAL"] = "SECONDS_INTERVAL";
78180
+ })(ProgramDateTimePlacementMode || (exports.ProgramDateTimePlacementMode = ProgramDateTimePlacementMode = {}));
78181
+ exports["default"] = ProgramDateTimePlacementMode;
78182
+
78183
+
79304
78184
  /***/ }),
79305
78185
 
79306
78186
  /***/ "./models/ProgramDateTimeSettings.ts":
@@ -79314,6 +78194,7 @@ exports["default"] = ProfileH265;
79314
78194
  Object.defineProperty(exports, "__esModule", ({ value: true }));
79315
78195
  exports.ProgramDateTimeSettings = void 0;
79316
78196
  var Mapper_1 = __webpack_require__(/*! ../common/Mapper */ "./common/Mapper.ts");
78197
+ var ProgramDateTimePlacement_1 = __webpack_require__(/*! ./ProgramDateTimePlacement */ "./models/ProgramDateTimePlacement.ts");
79317
78198
  /**
79318
78199
  * @export
79319
78200
  * @class ProgramDateTimeSettings
@@ -79324,6 +78205,7 @@ var ProgramDateTimeSettings = /** @class */ (function () {
79324
78205
  return;
79325
78206
  }
79326
78207
  this.programDateTimeSource = (0, Mapper_1.map)(obj.programDateTimeSource);
78208
+ this.programDateTimePlacement = (0, Mapper_1.map)(obj.programDateTimePlacement, ProgramDateTimePlacement_1.default);
79327
78209
  }
79328
78210
  return ProgramDateTimeSettings;
79329
78211
  }());
@@ -89762,6 +88644,7 @@ __exportStar(__webpack_require__(/*! ./DashCmafRepresentation */ "./models/DashC
89762
88644
  __exportStar(__webpack_require__(/*! ./DashEditionCompatibility */ "./models/DashEditionCompatibility.ts"), exports);
89763
88645
  __exportStar(__webpack_require__(/*! ./DashFmp4DrmRepresentation */ "./models/DashFmp4DrmRepresentation.ts"), exports);
89764
88646
  __exportStar(__webpack_require__(/*! ./DashFmp4Representation */ "./models/DashFmp4Representation.ts"), exports);
88647
+ __exportStar(__webpack_require__(/*! ./DashISO8601TimestampFormat */ "./models/DashISO8601TimestampFormat.ts"), exports);
89765
88648
  __exportStar(__webpack_require__(/*! ./DashImscRepresentation */ "./models/DashImscRepresentation.ts"), exports);
89766
88649
  __exportStar(__webpack_require__(/*! ./DashManifest */ "./models/DashManifest.ts"), exports);
89767
88650
  __exportStar(__webpack_require__(/*! ./DashManifestDefault */ "./models/DashManifestDefault.ts"), exports);
@@ -90116,6 +88999,8 @@ __exportStar(__webpack_require__(/*! ./PrimeTimeDrm */ "./models/PrimeTimeDrm.ts
90116
88999
  __exportStar(__webpack_require__(/*! ./ProfileH262 */ "./models/ProfileH262.ts"), exports);
90117
89000
  __exportStar(__webpack_require__(/*! ./ProfileH264 */ "./models/ProfileH264.ts"), exports);
90118
89001
  __exportStar(__webpack_require__(/*! ./ProfileH265 */ "./models/ProfileH265.ts"), exports);
89002
+ __exportStar(__webpack_require__(/*! ./ProgramDateTimePlacement */ "./models/ProgramDateTimePlacement.ts"), exports);
89003
+ __exportStar(__webpack_require__(/*! ./ProgramDateTimePlacementMode */ "./models/ProgramDateTimePlacementMode.ts"), exports);
90119
89004
  __exportStar(__webpack_require__(/*! ./ProgramDateTimeSettings */ "./models/ProgramDateTimeSettings.ts"), exports);
90120
89005
  __exportStar(__webpack_require__(/*! ./ProgramDateTimeSource */ "./models/ProgramDateTimeSource.ts"), exports);
90121
89006
  __exportStar(__webpack_require__(/*! ./ProgressiveMovMuxing */ "./models/ProgressiveMovMuxing.ts"), exports);
@@ -95173,667 +94058,6 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (nam
95173
94058
  });
95174
94059
 
95175
94060
 
95176
- /***/ }),
95177
-
95178
- /***/ "../node_modules/whatwg-fetch/fetch.js":
95179
- /*!*********************************************!*\
95180
- !*** ../node_modules/whatwg-fetch/fetch.js ***!
95181
- \*********************************************/
95182
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
95183
-
95184
- "use strict";
95185
- __webpack_require__.r(__webpack_exports__);
95186
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
95187
- /* harmony export */ DOMException: () => (/* binding */ DOMException),
95188
- /* harmony export */ Headers: () => (/* binding */ Headers),
95189
- /* harmony export */ Request: () => (/* binding */ Request),
95190
- /* harmony export */ Response: () => (/* binding */ Response),
95191
- /* harmony export */ fetch: () => (/* binding */ fetch)
95192
- /* harmony export */ });
95193
- /* eslint-disable no-prototype-builtins */
95194
- var g =
95195
- (typeof globalThis !== 'undefined' && globalThis) ||
95196
- (typeof self !== 'undefined' && self) ||
95197
- // eslint-disable-next-line no-undef
95198
- (typeof __webpack_require__.g !== 'undefined' && __webpack_require__.g) ||
95199
- {}
95200
-
95201
- var support = {
95202
- searchParams: 'URLSearchParams' in g,
95203
- iterable: 'Symbol' in g && 'iterator' in Symbol,
95204
- blob:
95205
- 'FileReader' in g &&
95206
- 'Blob' in g &&
95207
- (function() {
95208
- try {
95209
- new Blob()
95210
- return true
95211
- } catch (e) {
95212
- return false
95213
- }
95214
- })(),
95215
- formData: 'FormData' in g,
95216
- arrayBuffer: 'ArrayBuffer' in g
95217
- }
95218
-
95219
- function isDataView(obj) {
95220
- return obj && DataView.prototype.isPrototypeOf(obj)
95221
- }
95222
-
95223
- if (support.arrayBuffer) {
95224
- var viewClasses = [
95225
- '[object Int8Array]',
95226
- '[object Uint8Array]',
95227
- '[object Uint8ClampedArray]',
95228
- '[object Int16Array]',
95229
- '[object Uint16Array]',
95230
- '[object Int32Array]',
95231
- '[object Uint32Array]',
95232
- '[object Float32Array]',
95233
- '[object Float64Array]'
95234
- ]
95235
-
95236
- var isArrayBufferView =
95237
- ArrayBuffer.isView ||
95238
- function(obj) {
95239
- return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1
95240
- }
95241
- }
95242
-
95243
- function normalizeName(name) {
95244
- if (typeof name !== 'string') {
95245
- name = String(name)
95246
- }
95247
- if (/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(name) || name === '') {
95248
- throw new TypeError('Invalid character in header field name: "' + name + '"')
95249
- }
95250
- return name.toLowerCase()
95251
- }
95252
-
95253
- function normalizeValue(value) {
95254
- if (typeof value !== 'string') {
95255
- value = String(value)
95256
- }
95257
- return value
95258
- }
95259
-
95260
- // Build a destructive iterator for the value list
95261
- function iteratorFor(items) {
95262
- var iterator = {
95263
- next: function() {
95264
- var value = items.shift()
95265
- return {done: value === undefined, value: value}
95266
- }
95267
- }
95268
-
95269
- if (support.iterable) {
95270
- iterator[Symbol.iterator] = function() {
95271
- return iterator
95272
- }
95273
- }
95274
-
95275
- return iterator
95276
- }
95277
-
95278
- function Headers(headers) {
95279
- this.map = {}
95280
-
95281
- if (headers instanceof Headers) {
95282
- headers.forEach(function(value, name) {
95283
- this.append(name, value)
95284
- }, this)
95285
- } else if (Array.isArray(headers)) {
95286
- headers.forEach(function(header) {
95287
- if (header.length != 2) {
95288
- throw new TypeError('Headers constructor: expected name/value pair to be length 2, found' + header.length)
95289
- }
95290
- this.append(header[0], header[1])
95291
- }, this)
95292
- } else if (headers) {
95293
- Object.getOwnPropertyNames(headers).forEach(function(name) {
95294
- this.append(name, headers[name])
95295
- }, this)
95296
- }
95297
- }
95298
-
95299
- Headers.prototype.append = function(name, value) {
95300
- name = normalizeName(name)
95301
- value = normalizeValue(value)
95302
- var oldValue = this.map[name]
95303
- this.map[name] = oldValue ? oldValue + ', ' + value : value
95304
- }
95305
-
95306
- Headers.prototype['delete'] = function(name) {
95307
- delete this.map[normalizeName(name)]
95308
- }
95309
-
95310
- Headers.prototype.get = function(name) {
95311
- name = normalizeName(name)
95312
- return this.has(name) ? this.map[name] : null
95313
- }
95314
-
95315
- Headers.prototype.has = function(name) {
95316
- return this.map.hasOwnProperty(normalizeName(name))
95317
- }
95318
-
95319
- Headers.prototype.set = function(name, value) {
95320
- this.map[normalizeName(name)] = normalizeValue(value)
95321
- }
95322
-
95323
- Headers.prototype.forEach = function(callback, thisArg) {
95324
- for (var name in this.map) {
95325
- if (this.map.hasOwnProperty(name)) {
95326
- callback.call(thisArg, this.map[name], name, this)
95327
- }
95328
- }
95329
- }
95330
-
95331
- Headers.prototype.keys = function() {
95332
- var items = []
95333
- this.forEach(function(value, name) {
95334
- items.push(name)
95335
- })
95336
- return iteratorFor(items)
95337
- }
95338
-
95339
- Headers.prototype.values = function() {
95340
- var items = []
95341
- this.forEach(function(value) {
95342
- items.push(value)
95343
- })
95344
- return iteratorFor(items)
95345
- }
95346
-
95347
- Headers.prototype.entries = function() {
95348
- var items = []
95349
- this.forEach(function(value, name) {
95350
- items.push([name, value])
95351
- })
95352
- return iteratorFor(items)
95353
- }
95354
-
95355
- if (support.iterable) {
95356
- Headers.prototype[Symbol.iterator] = Headers.prototype.entries
95357
- }
95358
-
95359
- function consumed(body) {
95360
- if (body._noBody) return
95361
- if (body.bodyUsed) {
95362
- return Promise.reject(new TypeError('Already read'))
95363
- }
95364
- body.bodyUsed = true
95365
- }
95366
-
95367
- function fileReaderReady(reader) {
95368
- return new Promise(function(resolve, reject) {
95369
- reader.onload = function() {
95370
- resolve(reader.result)
95371
- }
95372
- reader.onerror = function() {
95373
- reject(reader.error)
95374
- }
95375
- })
95376
- }
95377
-
95378
- function readBlobAsArrayBuffer(blob) {
95379
- var reader = new FileReader()
95380
- var promise = fileReaderReady(reader)
95381
- reader.readAsArrayBuffer(blob)
95382
- return promise
95383
- }
95384
-
95385
- function readBlobAsText(blob) {
95386
- var reader = new FileReader()
95387
- var promise = fileReaderReady(reader)
95388
- var match = /charset=([A-Za-z0-9_-]+)/.exec(blob.type)
95389
- var encoding = match ? match[1] : 'utf-8'
95390
- reader.readAsText(blob, encoding)
95391
- return promise
95392
- }
95393
-
95394
- function readArrayBufferAsText(buf) {
95395
- var view = new Uint8Array(buf)
95396
- var chars = new Array(view.length)
95397
-
95398
- for (var i = 0; i < view.length; i++) {
95399
- chars[i] = String.fromCharCode(view[i])
95400
- }
95401
- return chars.join('')
95402
- }
95403
-
95404
- function bufferClone(buf) {
95405
- if (buf.slice) {
95406
- return buf.slice(0)
95407
- } else {
95408
- var view = new Uint8Array(buf.byteLength)
95409
- view.set(new Uint8Array(buf))
95410
- return view.buffer
95411
- }
95412
- }
95413
-
95414
- function Body() {
95415
- this.bodyUsed = false
95416
-
95417
- this._initBody = function(body) {
95418
- /*
95419
- fetch-mock wraps the Response object in an ES6 Proxy to
95420
- provide useful test harness features such as flush. However, on
95421
- ES5 browsers without fetch or Proxy support pollyfills must be used;
95422
- the proxy-pollyfill is unable to proxy an attribute unless it exists
95423
- on the object before the Proxy is created. This change ensures
95424
- Response.bodyUsed exists on the instance, while maintaining the
95425
- semantic of setting Request.bodyUsed in the constructor before
95426
- _initBody is called.
95427
- */
95428
- // eslint-disable-next-line no-self-assign
95429
- this.bodyUsed = this.bodyUsed
95430
- this._bodyInit = body
95431
- if (!body) {
95432
- this._noBody = true;
95433
- this._bodyText = ''
95434
- } else if (typeof body === 'string') {
95435
- this._bodyText = body
95436
- } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {
95437
- this._bodyBlob = body
95438
- } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {
95439
- this._bodyFormData = body
95440
- } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
95441
- this._bodyText = body.toString()
95442
- } else if (support.arrayBuffer && support.blob && isDataView(body)) {
95443
- this._bodyArrayBuffer = bufferClone(body.buffer)
95444
- // IE 10-11 can't handle a DataView body.
95445
- this._bodyInit = new Blob([this._bodyArrayBuffer])
95446
- } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {
95447
- this._bodyArrayBuffer = bufferClone(body)
95448
- } else {
95449
- this._bodyText = body = Object.prototype.toString.call(body)
95450
- }
95451
-
95452
- if (!this.headers.get('content-type')) {
95453
- if (typeof body === 'string') {
95454
- this.headers.set('content-type', 'text/plain;charset=UTF-8')
95455
- } else if (this._bodyBlob && this._bodyBlob.type) {
95456
- this.headers.set('content-type', this._bodyBlob.type)
95457
- } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
95458
- this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8')
95459
- }
95460
- }
95461
- }
95462
-
95463
- if (support.blob) {
95464
- this.blob = function() {
95465
- var rejected = consumed(this)
95466
- if (rejected) {
95467
- return rejected
95468
- }
95469
-
95470
- if (this._bodyBlob) {
95471
- return Promise.resolve(this._bodyBlob)
95472
- } else if (this._bodyArrayBuffer) {
95473
- return Promise.resolve(new Blob([this._bodyArrayBuffer]))
95474
- } else if (this._bodyFormData) {
95475
- throw new Error('could not read FormData body as blob')
95476
- } else {
95477
- return Promise.resolve(new Blob([this._bodyText]))
95478
- }
95479
- }
95480
- }
95481
-
95482
- this.arrayBuffer = function() {
95483
- if (this._bodyArrayBuffer) {
95484
- var isConsumed = consumed(this)
95485
- if (isConsumed) {
95486
- return isConsumed
95487
- } else if (ArrayBuffer.isView(this._bodyArrayBuffer)) {
95488
- return Promise.resolve(
95489
- this._bodyArrayBuffer.buffer.slice(
95490
- this._bodyArrayBuffer.byteOffset,
95491
- this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength
95492
- )
95493
- )
95494
- } else {
95495
- return Promise.resolve(this._bodyArrayBuffer)
95496
- }
95497
- } else if (support.blob) {
95498
- return this.blob().then(readBlobAsArrayBuffer)
95499
- } else {
95500
- throw new Error('could not read as ArrayBuffer')
95501
- }
95502
- }
95503
-
95504
- this.text = function() {
95505
- var rejected = consumed(this)
95506
- if (rejected) {
95507
- return rejected
95508
- }
95509
-
95510
- if (this._bodyBlob) {
95511
- return readBlobAsText(this._bodyBlob)
95512
- } else if (this._bodyArrayBuffer) {
95513
- return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))
95514
- } else if (this._bodyFormData) {
95515
- throw new Error('could not read FormData body as text')
95516
- } else {
95517
- return Promise.resolve(this._bodyText)
95518
- }
95519
- }
95520
-
95521
- if (support.formData) {
95522
- this.formData = function() {
95523
- return this.text().then(decode)
95524
- }
95525
- }
95526
-
95527
- this.json = function() {
95528
- return this.text().then(JSON.parse)
95529
- }
95530
-
95531
- return this
95532
- }
95533
-
95534
- // HTTP methods whose capitalization should be normalized
95535
- var methods = ['CONNECT', 'DELETE', 'GET', 'HEAD', 'OPTIONS', 'PATCH', 'POST', 'PUT', 'TRACE']
95536
-
95537
- function normalizeMethod(method) {
95538
- var upcased = method.toUpperCase()
95539
- return methods.indexOf(upcased) > -1 ? upcased : method
95540
- }
95541
-
95542
- function Request(input, options) {
95543
- if (!(this instanceof Request)) {
95544
- throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.')
95545
- }
95546
-
95547
- options = options || {}
95548
- var body = options.body
95549
-
95550
- if (input instanceof Request) {
95551
- if (input.bodyUsed) {
95552
- throw new TypeError('Already read')
95553
- }
95554
- this.url = input.url
95555
- this.credentials = input.credentials
95556
- if (!options.headers) {
95557
- this.headers = new Headers(input.headers)
95558
- }
95559
- this.method = input.method
95560
- this.mode = input.mode
95561
- this.signal = input.signal
95562
- if (!body && input._bodyInit != null) {
95563
- body = input._bodyInit
95564
- input.bodyUsed = true
95565
- }
95566
- } else {
95567
- this.url = String(input)
95568
- }
95569
-
95570
- this.credentials = options.credentials || this.credentials || 'same-origin'
95571
- if (options.headers || !this.headers) {
95572
- this.headers = new Headers(options.headers)
95573
- }
95574
- this.method = normalizeMethod(options.method || this.method || 'GET')
95575
- this.mode = options.mode || this.mode || null
95576
- this.signal = options.signal || this.signal || (function () {
95577
- if ('AbortController' in g) {
95578
- var ctrl = new AbortController();
95579
- return ctrl.signal;
95580
- }
95581
- }());
95582
- this.referrer = null
95583
-
95584
- if ((this.method === 'GET' || this.method === 'HEAD') && body) {
95585
- throw new TypeError('Body not allowed for GET or HEAD requests')
95586
- }
95587
- this._initBody(body)
95588
-
95589
- if (this.method === 'GET' || this.method === 'HEAD') {
95590
- if (options.cache === 'no-store' || options.cache === 'no-cache') {
95591
- // Search for a '_' parameter in the query string
95592
- var reParamSearch = /([?&])_=[^&]*/
95593
- if (reParamSearch.test(this.url)) {
95594
- // If it already exists then set the value with the current time
95595
- this.url = this.url.replace(reParamSearch, '$1_=' + new Date().getTime())
95596
- } else {
95597
- // Otherwise add a new '_' parameter to the end with the current time
95598
- var reQueryString = /\?/
95599
- this.url += (reQueryString.test(this.url) ? '&' : '?') + '_=' + new Date().getTime()
95600
- }
95601
- }
95602
- }
95603
- }
95604
-
95605
- Request.prototype.clone = function() {
95606
- return new Request(this, {body: this._bodyInit})
95607
- }
95608
-
95609
- function decode(body) {
95610
- var form = new FormData()
95611
- body
95612
- .trim()
95613
- .split('&')
95614
- .forEach(function(bytes) {
95615
- if (bytes) {
95616
- var split = bytes.split('=')
95617
- var name = split.shift().replace(/\+/g, ' ')
95618
- var value = split.join('=').replace(/\+/g, ' ')
95619
- form.append(decodeURIComponent(name), decodeURIComponent(value))
95620
- }
95621
- })
95622
- return form
95623
- }
95624
-
95625
- function parseHeaders(rawHeaders) {
95626
- var headers = new Headers()
95627
- // Replace instances of \r\n and \n followed by at least one space or horizontal tab with a space
95628
- // https://tools.ietf.org/html/rfc7230#section-3.2
95629
- var preProcessedHeaders = rawHeaders.replace(/\r?\n[\t ]+/g, ' ')
95630
- // Avoiding split via regex to work around a common IE11 bug with the core-js 3.6.0 regex polyfill
95631
- // https://github.com/github/fetch/issues/748
95632
- // https://github.com/zloirock/core-js/issues/751
95633
- preProcessedHeaders
95634
- .split('\r')
95635
- .map(function(header) {
95636
- return header.indexOf('\n') === 0 ? header.substr(1, header.length) : header
95637
- })
95638
- .forEach(function(line) {
95639
- var parts = line.split(':')
95640
- var key = parts.shift().trim()
95641
- if (key) {
95642
- var value = parts.join(':').trim()
95643
- try {
95644
- headers.append(key, value)
95645
- } catch (error) {
95646
- console.warn('Response ' + error.message)
95647
- }
95648
- }
95649
- })
95650
- return headers
95651
- }
95652
-
95653
- Body.call(Request.prototype)
95654
-
95655
- function Response(bodyInit, options) {
95656
- if (!(this instanceof Response)) {
95657
- throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.')
95658
- }
95659
- if (!options) {
95660
- options = {}
95661
- }
95662
-
95663
- this.type = 'default'
95664
- this.status = options.status === undefined ? 200 : options.status
95665
- if (this.status < 200 || this.status > 599) {
95666
- throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].")
95667
- }
95668
- this.ok = this.status >= 200 && this.status < 300
95669
- this.statusText = options.statusText === undefined ? '' : '' + options.statusText
95670
- this.headers = new Headers(options.headers)
95671
- this.url = options.url || ''
95672
- this._initBody(bodyInit)
95673
- }
95674
-
95675
- Body.call(Response.prototype)
95676
-
95677
- Response.prototype.clone = function() {
95678
- return new Response(this._bodyInit, {
95679
- status: this.status,
95680
- statusText: this.statusText,
95681
- headers: new Headers(this.headers),
95682
- url: this.url
95683
- })
95684
- }
95685
-
95686
- Response.error = function() {
95687
- var response = new Response(null, {status: 200, statusText: ''})
95688
- response.ok = false
95689
- response.status = 0
95690
- response.type = 'error'
95691
- return response
95692
- }
95693
-
95694
- var redirectStatuses = [301, 302, 303, 307, 308]
95695
-
95696
- Response.redirect = function(url, status) {
95697
- if (redirectStatuses.indexOf(status) === -1) {
95698
- throw new RangeError('Invalid status code')
95699
- }
95700
-
95701
- return new Response(null, {status: status, headers: {location: url}})
95702
- }
95703
-
95704
- var DOMException = g.DOMException
95705
- try {
95706
- new DOMException()
95707
- } catch (err) {
95708
- DOMException = function(message, name) {
95709
- this.message = message
95710
- this.name = name
95711
- var error = Error(message)
95712
- this.stack = error.stack
95713
- }
95714
- DOMException.prototype = Object.create(Error.prototype)
95715
- DOMException.prototype.constructor = DOMException
95716
- }
95717
-
95718
- function fetch(input, init) {
95719
- return new Promise(function(resolve, reject) {
95720
- var request = new Request(input, init)
95721
-
95722
- if (request.signal && request.signal.aborted) {
95723
- return reject(new DOMException('Aborted', 'AbortError'))
95724
- }
95725
-
95726
- var xhr = new XMLHttpRequest()
95727
-
95728
- function abortXhr() {
95729
- xhr.abort()
95730
- }
95731
-
95732
- xhr.onload = function() {
95733
- var options = {
95734
- statusText: xhr.statusText,
95735
- headers: parseHeaders(xhr.getAllResponseHeaders() || '')
95736
- }
95737
- // This check if specifically for when a user fetches a file locally from the file system
95738
- // Only if the status is out of a normal range
95739
- if (request.url.indexOf('file://') === 0 && (xhr.status < 200 || xhr.status > 599)) {
95740
- options.status = 200;
95741
- } else {
95742
- options.status = xhr.status;
95743
- }
95744
- options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL')
95745
- var body = 'response' in xhr ? xhr.response : xhr.responseText
95746
- setTimeout(function() {
95747
- resolve(new Response(body, options))
95748
- }, 0)
95749
- }
95750
-
95751
- xhr.onerror = function() {
95752
- setTimeout(function() {
95753
- reject(new TypeError('Network request failed'))
95754
- }, 0)
95755
- }
95756
-
95757
- xhr.ontimeout = function() {
95758
- setTimeout(function() {
95759
- reject(new TypeError('Network request timed out'))
95760
- }, 0)
95761
- }
95762
-
95763
- xhr.onabort = function() {
95764
- setTimeout(function() {
95765
- reject(new DOMException('Aborted', 'AbortError'))
95766
- }, 0)
95767
- }
95768
-
95769
- function fixUrl(url) {
95770
- try {
95771
- return url === '' && g.location.href ? g.location.href : url
95772
- } catch (e) {
95773
- return url
95774
- }
95775
- }
95776
-
95777
- xhr.open(request.method, fixUrl(request.url), true)
95778
-
95779
- if (request.credentials === 'include') {
95780
- xhr.withCredentials = true
95781
- } else if (request.credentials === 'omit') {
95782
- xhr.withCredentials = false
95783
- }
95784
-
95785
- if ('responseType' in xhr) {
95786
- if (support.blob) {
95787
- xhr.responseType = 'blob'
95788
- } else if (
95789
- support.arrayBuffer
95790
- ) {
95791
- xhr.responseType = 'arraybuffer'
95792
- }
95793
- }
95794
-
95795
- if (init && typeof init.headers === 'object' && !(init.headers instanceof Headers || (g.Headers && init.headers instanceof g.Headers))) {
95796
- var names = [];
95797
- Object.getOwnPropertyNames(init.headers).forEach(function(name) {
95798
- names.push(normalizeName(name))
95799
- xhr.setRequestHeader(name, normalizeValue(init.headers[name]))
95800
- })
95801
- request.headers.forEach(function(value, name) {
95802
- if (names.indexOf(name) === -1) {
95803
- xhr.setRequestHeader(name, value)
95804
- }
95805
- })
95806
- } else {
95807
- request.headers.forEach(function(value, name) {
95808
- xhr.setRequestHeader(name, value)
95809
- })
95810
- }
95811
-
95812
- if (request.signal) {
95813
- request.signal.addEventListener('abort', abortXhr)
95814
-
95815
- xhr.onreadystatechange = function() {
95816
- // DONE (success or failure)
95817
- if (xhr.readyState === 4) {
95818
- request.signal.removeEventListener('abort', abortXhr)
95819
- }
95820
- }
95821
- }
95822
-
95823
- xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)
95824
- })
95825
- }
95826
-
95827
- fetch.polyfill = true
95828
-
95829
- if (!g.fetch) {
95830
- g.fetch = fetch
95831
- g.Headers = Headers
95832
- g.Request = Request
95833
- g.Response = Response
95834
- }
95835
-
95836
-
95837
94061
  /***/ })
95838
94062
 
95839
94063
  /******/ });
@@ -95863,47 +94087,6 @@ if (!g.fetch) {
95863
94087
  /******/ }
95864
94088
  /******/
95865
94089
  /************************************************************************/
95866
- /******/ /* webpack/runtime/define property getters */
95867
- /******/ (() => {
95868
- /******/ // define getter functions for harmony exports
95869
- /******/ __webpack_require__.d = (exports, definition) => {
95870
- /******/ for(var key in definition) {
95871
- /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
95872
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
95873
- /******/ }
95874
- /******/ }
95875
- /******/ };
95876
- /******/ })();
95877
- /******/
95878
- /******/ /* webpack/runtime/global */
95879
- /******/ (() => {
95880
- /******/ __webpack_require__.g = (function() {
95881
- /******/ if (typeof globalThis === 'object') return globalThis;
95882
- /******/ try {
95883
- /******/ return this || new Function('return this')();
95884
- /******/ } catch (e) {
95885
- /******/ if (typeof window === 'object') return window;
95886
- /******/ }
95887
- /******/ })();
95888
- /******/ })();
95889
- /******/
95890
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
95891
- /******/ (() => {
95892
- /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
95893
- /******/ })();
95894
- /******/
95895
- /******/ /* webpack/runtime/make namespace object */
95896
- /******/ (() => {
95897
- /******/ // define __esModule on exports
95898
- /******/ __webpack_require__.r = (exports) => {
95899
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
95900
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
95901
- /******/ }
95902
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
95903
- /******/ };
95904
- /******/ })();
95905
- /******/
95906
- /************************************************************************/
95907
94090
  /******/
95908
94091
  /******/ // startup
95909
94092
  /******/ // Load entry module and return exports