UNPKG

121 kBJavaScriptView Raw
1import timestring from 'timestring';
2
3function unwrapExports (x) {
4 return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
5}
6
7function createCommonjsModule(fn, module) {
8 return module = { exports: {} }, fn(module, module.exports), module.exports;
9}
10
11var _global = createCommonjsModule(function (module) {
12// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
13var global = module.exports = typeof window != 'undefined' && window.Math == Math
14 ? window : typeof self != 'undefined' && self.Math == Math ? self
15 // eslint-disable-next-line no-new-func
16 : Function('return this')();
17if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef
18});
19
20var _global$1 = /*#__PURE__*/Object.freeze({
21 default: _global,
22 __moduleExports: _global
23});
24
25var _core = createCommonjsModule(function (module) {
26var core = module.exports = { version: '2.5.7' };
27if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
28});
29var _core_1 = _core.version;
30
31var _core$1 = /*#__PURE__*/Object.freeze({
32 default: _core,
33 __moduleExports: _core,
34 version: _core_1
35});
36
37var _isObject = function (it) {
38 return typeof it === 'object' ? it !== null : typeof it === 'function';
39};
40
41var _isObject$1 = /*#__PURE__*/Object.freeze({
42 default: _isObject,
43 __moduleExports: _isObject
44});
45
46var isObject = ( _isObject$1 && _isObject ) || _isObject$1;
47
48var _anObject = function (it) {
49 if (!isObject(it)) throw TypeError(it + ' is not an object!');
50 return it;
51};
52
53var _anObject$1 = /*#__PURE__*/Object.freeze({
54 default: _anObject,
55 __moduleExports: _anObject
56});
57
58var _fails = function (exec) {
59 try {
60 return !!exec();
61 } catch (e) {
62 return true;
63 }
64};
65
66var _fails$1 = /*#__PURE__*/Object.freeze({
67 default: _fails,
68 __moduleExports: _fails
69});
70
71var require$$1 = ( _fails$1 && _fails ) || _fails$1;
72
73// Thank's IE8 for his funny defineProperty
74var _descriptors = !require$$1(function () {
75 return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
76});
77
78var _descriptors$1 = /*#__PURE__*/Object.freeze({
79 default: _descriptors,
80 __moduleExports: _descriptors
81});
82
83var global$1 = ( _global$1 && _global ) || _global$1;
84
85var document = global$1.document;
86// typeof document.createElement is 'object' in old IE
87var is = isObject(document) && isObject(document.createElement);
88var _domCreate = function (it) {
89 return is ? document.createElement(it) : {};
90};
91
92var _domCreate$1 = /*#__PURE__*/Object.freeze({
93 default: _domCreate,
94 __moduleExports: _domCreate
95});
96
97var DESCRIPTORS = ( _descriptors$1 && _descriptors ) || _descriptors$1;
98
99var require$$2 = ( _domCreate$1 && _domCreate ) || _domCreate$1;
100
101var _ie8DomDefine = !DESCRIPTORS && !require$$1(function () {
102 return Object.defineProperty(require$$2('div'), 'a', { get: function () { return 7; } }).a != 7;
103});
104
105var _ie8DomDefine$1 = /*#__PURE__*/Object.freeze({
106 default: _ie8DomDefine,
107 __moduleExports: _ie8DomDefine
108});
109
110// 7.1.1 ToPrimitive(input [, PreferredType])
111
112// instead of the ES6 spec version, we didn't implement @@toPrimitive case
113// and the second argument - flag - preferred type is a string
114var _toPrimitive = function (it, S) {
115 if (!isObject(it)) return it;
116 var fn, val;
117 if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
118 if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;
119 if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
120 throw TypeError("Can't convert object to primitive value");
121};
122
123var _toPrimitive$1 = /*#__PURE__*/Object.freeze({
124 default: _toPrimitive,
125 __moduleExports: _toPrimitive
126});
127
128var anObject = ( _anObject$1 && _anObject ) || _anObject$1;
129
130var IE8_DOM_DEFINE = ( _ie8DomDefine$1 && _ie8DomDefine ) || _ie8DomDefine$1;
131
132var toPrimitive = ( _toPrimitive$1 && _toPrimitive ) || _toPrimitive$1;
133
134var dP = Object.defineProperty;
135
136var f = DESCRIPTORS ? Object.defineProperty : function defineProperty(O, P, Attributes) {
137 anObject(O);
138 P = toPrimitive(P, true);
139 anObject(Attributes);
140 if (IE8_DOM_DEFINE) try {
141 return dP(O, P, Attributes);
142 } catch (e) { /* empty */ }
143 if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
144 if ('value' in Attributes) O[P] = Attributes.value;
145 return O;
146};
147
148var _objectDp = {
149 f: f
150};
151
152var _objectDp$1 = /*#__PURE__*/Object.freeze({
153 default: _objectDp,
154 __moduleExports: _objectDp,
155 f: f
156});
157
158var _propertyDesc = function (bitmap, value) {
159 return {
160 enumerable: !(bitmap & 1),
161 configurable: !(bitmap & 2),
162 writable: !(bitmap & 4),
163 value: value
164 };
165};
166
167var _propertyDesc$1 = /*#__PURE__*/Object.freeze({
168 default: _propertyDesc,
169 __moduleExports: _propertyDesc
170});
171
172var dP$1 = ( _objectDp$1 && _objectDp ) || _objectDp$1;
173
174var descriptor = ( _propertyDesc$1 && _propertyDesc ) || _propertyDesc$1;
175
176var _hide = DESCRIPTORS ? function (object, key, value) {
177 return dP$1.f(object, key, descriptor(1, value));
178} : function (object, key, value) {
179 object[key] = value;
180 return object;
181};
182
183var _hide$1 = /*#__PURE__*/Object.freeze({
184 default: _hide,
185 __moduleExports: _hide
186});
187
188var hasOwnProperty = {}.hasOwnProperty;
189var _has = function (it, key) {
190 return hasOwnProperty.call(it, key);
191};
192
193var _has$1 = /*#__PURE__*/Object.freeze({
194 default: _has,
195 __moduleExports: _has
196});
197
198var id = 0;
199var px = Math.random();
200var _uid = function (key) {
201 return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
202};
203
204var _uid$1 = /*#__PURE__*/Object.freeze({
205 default: _uid,
206 __moduleExports: _uid
207});
208
209var require$$0 = ( _hide$1 && _hide ) || _hide$1;
210
211var has = ( _has$1 && _has ) || _has$1;
212
213var uid = ( _uid$1 && _uid ) || _uid$1;
214
215var require$$1$1 = ( _core$1 && _core ) || _core$1;
216
217var _redefine = createCommonjsModule(function (module) {
218var SRC = uid('src');
219var TO_STRING = 'toString';
220var $toString = Function[TO_STRING];
221var TPL = ('' + $toString).split(TO_STRING);
222
223require$$1$1.inspectSource = function (it) {
224 return $toString.call(it);
225};
226
227(module.exports = function (O, key, val, safe) {
228 var isFunction = typeof val == 'function';
229 if (isFunction) has(val, 'name') || require$$0(val, 'name', key);
230 if (O[key] === val) return;
231 if (isFunction) has(val, SRC) || require$$0(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));
232 if (O === global$1) {
233 O[key] = val;
234 } else if (!safe) {
235 delete O[key];
236 require$$0(O, key, val);
237 } else if (O[key]) {
238 O[key] = val;
239 } else {
240 require$$0(O, key, val);
241 }
242// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
243})(Function.prototype, TO_STRING, function toString() {
244 return typeof this == 'function' && this[SRC] || $toString.call(this);
245});
246});
247
248var _redefine$1 = /*#__PURE__*/Object.freeze({
249 default: _redefine,
250 __moduleExports: _redefine
251});
252
253var _aFunction = function (it) {
254 if (typeof it != 'function') throw TypeError(it + ' is not a function!');
255 return it;
256};
257
258var _aFunction$1 = /*#__PURE__*/Object.freeze({
259 default: _aFunction,
260 __moduleExports: _aFunction
261});
262
263var aFunction = ( _aFunction$1 && _aFunction ) || _aFunction$1;
264
265// optional / simple context binding
266
267var _ctx = function (fn, that, length) {
268 aFunction(fn);
269 if (that === undefined) return fn;
270 switch (length) {
271 case 1: return function (a) {
272 return fn.call(that, a);
273 };
274 case 2: return function (a, b) {
275 return fn.call(that, a, b);
276 };
277 case 3: return function (a, b, c) {
278 return fn.call(that, a, b, c);
279 };
280 }
281 return function (/* ...args */) {
282 return fn.apply(that, arguments);
283 };
284};
285
286var _ctx$1 = /*#__PURE__*/Object.freeze({
287 default: _ctx,
288 __moduleExports: _ctx
289});
290
291var redefine = ( _redefine$1 && _redefine ) || _redefine$1;
292
293var require$$0$1 = ( _ctx$1 && _ctx ) || _ctx$1;
294
295var PROTOTYPE = 'prototype';
296
297var $export = function (type, name, source) {
298 var IS_FORCED = type & $export.F;
299 var IS_GLOBAL = type & $export.G;
300 var IS_STATIC = type & $export.S;
301 var IS_PROTO = type & $export.P;
302 var IS_BIND = type & $export.B;
303 var target = IS_GLOBAL ? global$1 : IS_STATIC ? global$1[name] || (global$1[name] = {}) : (global$1[name] || {})[PROTOTYPE];
304 var exports = IS_GLOBAL ? require$$1$1 : require$$1$1[name] || (require$$1$1[name] = {});
305 var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {});
306 var key, own, out, exp;
307 if (IS_GLOBAL) source = name;
308 for (key in source) {
309 // contains in native
310 own = !IS_FORCED && target && target[key] !== undefined;
311 // export native or passed
312 out = (own ? target : source)[key];
313 // bind timers to global for call from export context
314 exp = IS_BIND && own ? require$$0$1(out, global$1) : IS_PROTO && typeof out == 'function' ? require$$0$1(Function.call, out) : out;
315 // extend global
316 if (target) redefine(target, key, out, type & $export.U);
317 // export
318 if (exports[key] != out) require$$0(exports, key, exp);
319 if (IS_PROTO && expProto[key] != out) expProto[key] = out;
320 }
321};
322global$1.core = require$$1$1;
323// type bitmap
324$export.F = 1; // forced
325$export.G = 2; // global
326$export.S = 4; // static
327$export.P = 8; // proto
328$export.B = 16; // bind
329$export.W = 32; // wrap
330$export.U = 64; // safe
331$export.R = 128; // real proto method for `library`
332var _export = $export;
333
334var _export$1 = /*#__PURE__*/Object.freeze({
335 default: _export,
336 __moduleExports: _export
337});
338
339// 7.2.1 RequireObjectCoercible(argument)
340var _defined = function (it) {
341 if (it == undefined) throw TypeError("Can't call method on " + it);
342 return it;
343};
344
345var _defined$1 = /*#__PURE__*/Object.freeze({
346 default: _defined,
347 __moduleExports: _defined
348});
349
350var defined = ( _defined$1 && _defined ) || _defined$1;
351
352// 7.1.13 ToObject(argument)
353
354var _toObject = function (it) {
355 return Object(defined(it));
356};
357
358var _toObject$1 = /*#__PURE__*/Object.freeze({
359 default: _toObject,
360 __moduleExports: _toObject
361});
362
363var $export$1 = ( _export$1 && _export ) || _export$1;
364
365var toObject = ( _toObject$1 && _toObject ) || _toObject$1;
366
367$export$1($export$1.P + $export$1.F * require$$1(function () {
368 return new Date(NaN).toJSON() !== null
369 || Date.prototype.toJSON.call({ toISOString: function () { return 1; } }) !== 1;
370}), 'Date', {
371 // eslint-disable-next-line no-unused-vars
372 toJSON: function toJSON(key) {
373 var O = toObject(this);
374 var pv = toPrimitive(O);
375 return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString();
376 }
377});
378
379var toString = {}.toString;
380
381var _cof = function (it) {
382 return toString.call(it).slice(8, -1);
383};
384
385var _cof$1 = /*#__PURE__*/Object.freeze({
386 default: _cof,
387 __moduleExports: _cof
388});
389
390var cof = ( _cof$1 && _cof ) || _cof$1;
391
392// fallback for non-array-like ES3 and non-enumerable old V8 strings
393
394// eslint-disable-next-line no-prototype-builtins
395var _iobject = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
396 return cof(it) == 'String' ? it.split('') : Object(it);
397};
398
399var _iobject$1 = /*#__PURE__*/Object.freeze({
400 default: _iobject,
401 __moduleExports: _iobject
402});
403
404var IObject = ( _iobject$1 && _iobject ) || _iobject$1;
405
406// to indexed object, toObject with fallback for non-array-like ES3 strings
407
408
409var _toIobject = function (it) {
410 return IObject(defined(it));
411};
412
413var _toIobject$1 = /*#__PURE__*/Object.freeze({
414 default: _toIobject,
415 __moduleExports: _toIobject
416});
417
418// 7.1.4 ToInteger
419var ceil = Math.ceil;
420var floor = Math.floor;
421var _toInteger = function (it) {
422 return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
423};
424
425var _toInteger$1 = /*#__PURE__*/Object.freeze({
426 default: _toInteger,
427 __moduleExports: _toInteger
428});
429
430var toInteger = ( _toInteger$1 && _toInteger ) || _toInteger$1;
431
432// 7.1.15 ToLength
433
434var min = Math.min;
435var _toLength = function (it) {
436 return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
437};
438
439var _toLength$1 = /*#__PURE__*/Object.freeze({
440 default: _toLength,
441 __moduleExports: _toLength
442});
443
444var max = Math.max;
445var min$1 = Math.min;
446var _toAbsoluteIndex = function (index, length) {
447 index = toInteger(index);
448 return index < 0 ? max(index + length, 0) : min$1(index, length);
449};
450
451var _toAbsoluteIndex$1 = /*#__PURE__*/Object.freeze({
452 default: _toAbsoluteIndex,
453 __moduleExports: _toAbsoluteIndex
454});
455
456var toIObject = ( _toIobject$1 && _toIobject ) || _toIobject$1;
457
458var toLength = ( _toLength$1 && _toLength ) || _toLength$1;
459
460var toAbsoluteIndex = ( _toAbsoluteIndex$1 && _toAbsoluteIndex ) || _toAbsoluteIndex$1;
461
462// false -> Array#indexOf
463// true -> Array#includes
464
465
466
467var _arrayIncludes = function (IS_INCLUDES) {
468 return function ($this, el, fromIndex) {
469 var O = toIObject($this);
470 var length = toLength(O.length);
471 var index = toAbsoluteIndex(fromIndex, length);
472 var value;
473 // Array#includes uses SameValueZero equality algorithm
474 // eslint-disable-next-line no-self-compare
475 if (IS_INCLUDES && el != el) while (length > index) {
476 value = O[index++];
477 // eslint-disable-next-line no-self-compare
478 if (value != value) return true;
479 // Array#indexOf ignores holes, Array#includes - not
480 } else for (;length > index; index++) if (IS_INCLUDES || index in O) {
481 if (O[index] === el) return IS_INCLUDES || index || 0;
482 } return !IS_INCLUDES && -1;
483 };
484};
485
486var _arrayIncludes$1 = /*#__PURE__*/Object.freeze({
487 default: _arrayIncludes,
488 __moduleExports: _arrayIncludes
489});
490
491var _library = false;
492
493var _library$1 = /*#__PURE__*/Object.freeze({
494 default: _library,
495 __moduleExports: _library
496});
497
498var LIBRARY = ( _library$1 && _library ) || _library$1;
499
500var _shared = createCommonjsModule(function (module) {
501var SHARED = '__core-js_shared__';
502var store = global$1[SHARED] || (global$1[SHARED] = {});
503
504(module.exports = function (key, value) {
505 return store[key] || (store[key] = value !== undefined ? value : {});
506})('versions', []).push({
507 version: require$$1$1.version,
508 mode: LIBRARY ? 'pure' : 'global',
509 copyright: '© 2018 Denis Pushkarev (zloirock.ru)'
510});
511});
512
513var _shared$1 = /*#__PURE__*/Object.freeze({
514 default: _shared,
515 __moduleExports: _shared
516});
517
518var require$$0$2 = ( _shared$1 && _shared ) || _shared$1;
519
520var shared = require$$0$2('keys');
521
522var _sharedKey = function (key) {
523 return shared[key] || (shared[key] = uid(key));
524};
525
526var _sharedKey$1 = /*#__PURE__*/Object.freeze({
527 default: _sharedKey,
528 __moduleExports: _sharedKey
529});
530
531var require$$0$3 = ( _arrayIncludes$1 && _arrayIncludes ) || _arrayIncludes$1;
532
533var require$$0$4 = ( _sharedKey$1 && _sharedKey ) || _sharedKey$1;
534
535var arrayIndexOf = require$$0$3(false);
536var IE_PROTO = require$$0$4('IE_PROTO');
537
538var _objectKeysInternal = function (object, names) {
539 var O = toIObject(object);
540 var i = 0;
541 var result = [];
542 var key;
543 for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);
544 // Don't enum bug & hidden keys
545 while (names.length > i) if (has(O, key = names[i++])) {
546 ~arrayIndexOf(result, key) || result.push(key);
547 }
548 return result;
549};
550
551var _objectKeysInternal$1 = /*#__PURE__*/Object.freeze({
552 default: _objectKeysInternal,
553 __moduleExports: _objectKeysInternal
554});
555
556// IE 8- don't enum bug keys
557var _enumBugKeys = (
558 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
559).split(',');
560
561var _enumBugKeys$1 = /*#__PURE__*/Object.freeze({
562 default: _enumBugKeys,
563 __moduleExports: _enumBugKeys
564});
565
566var $keys = ( _objectKeysInternal$1 && _objectKeysInternal ) || _objectKeysInternal$1;
567
568var require$$0$5 = ( _enumBugKeys$1 && _enumBugKeys ) || _enumBugKeys$1;
569
570// 19.1.2.14 / 15.2.3.14 Object.keys(O)
571
572
573
574var _objectKeys = Object.keys || function keys(O) {
575 return $keys(O, require$$0$5);
576};
577
578var _objectKeys$1 = /*#__PURE__*/Object.freeze({
579 default: _objectKeys,
580 __moduleExports: _objectKeys
581});
582
583var f$1 = Object.getOwnPropertySymbols;
584
585var _objectGops = {
586 f: f$1
587};
588
589var _objectGops$1 = /*#__PURE__*/Object.freeze({
590 default: _objectGops,
591 __moduleExports: _objectGops,
592 f: f$1
593});
594
595var f$2 = {}.propertyIsEnumerable;
596
597var _objectPie = {
598 f: f$2
599};
600
601var _objectPie$1 = /*#__PURE__*/Object.freeze({
602 default: _objectPie,
603 __moduleExports: _objectPie,
604 f: f$2
605});
606
607var getKeys = ( _objectKeys$1 && _objectKeys ) || _objectKeys$1;
608
609var gOPS = ( _objectGops$1 && _objectGops ) || _objectGops$1;
610
611var pIE = ( _objectPie$1 && _objectPie ) || _objectPie$1;
612
613// 19.1.2.1 Object.assign(target, source, ...)
614
615
616
617
618
619var $assign = Object.assign;
620
621// should work with symbols and should have deterministic property order (V8 bug)
622var _objectAssign = !$assign || require$$1(function () {
623 var A = {};
624 var B = {};
625 // eslint-disable-next-line no-undef
626 var S = Symbol();
627 var K = 'abcdefghijklmnopqrst';
628 A[S] = 7;
629 K.split('').forEach(function (k) { B[k] = k; });
630 return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;
631}) ? function assign(target, source) { // eslint-disable-line no-unused-vars
632 var T = toObject(target);
633 var aLen = arguments.length;
634 var index = 1;
635 var getSymbols = gOPS.f;
636 var isEnum = pIE.f;
637 while (aLen > index) {
638 var S = IObject(arguments[index++]);
639 var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);
640 var length = keys.length;
641 var j = 0;
642 var key;
643 while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key];
644 } return T;
645} : $assign;
646
647var _objectAssign$1 = /*#__PURE__*/Object.freeze({
648 default: _objectAssign,
649 __moduleExports: _objectAssign
650});
651
652var require$$0$6 = ( _objectAssign$1 && _objectAssign ) || _objectAssign$1;
653
654// 19.1.3.1 Object.assign(target, source)
655
656
657$export$1($export$1.S + $export$1.F, 'Object', { assign: require$$0$6 });
658
659function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
660 try {
661 var info = gen[key](arg);
662 var value = info.value;
663 } catch (error) {
664 reject(error);
665 return;
666 }
667
668 if (info.done) {
669 resolve(value);
670 } else {
671 Promise.resolve(value).then(_next, _throw);
672 }
673}
674
675function _asyncToGenerator(fn) {
676 return function () {
677 var self = this,
678 args = arguments;
679 return new Promise(function (resolve, reject) {
680 var gen = fn.apply(self, args);
681
682 function _next(value) {
683 asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
684 }
685
686 function _throw(err) {
687 asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
688 }
689
690 _next(undefined);
691 });
692 };
693}
694
695function _classCallCheck(instance, Constructor) {
696 if (!(instance instanceof Constructor)) {
697 throw new TypeError("Cannot call a class as a function");
698 }
699}
700
701function _defineProperties(target, props) {
702 for (var i = 0; i < props.length; i++) {
703 var descriptor = props[i];
704 descriptor.enumerable = descriptor.enumerable || false;
705 descriptor.configurable = true;
706 if ("value" in descriptor) descriptor.writable = true;
707 Object.defineProperty(target, descriptor.key, descriptor);
708 }
709}
710
711function _createClass(Constructor, protoProps, staticProps) {
712 if (protoProps) _defineProperties(Constructor.prototype, protoProps);
713 if (staticProps) _defineProperties(Constructor, staticProps);
714 return Constructor;
715}
716
717function _defineProperty(obj, key, value) {
718 if (key in obj) {
719 Object.defineProperty(obj, key, {
720 value: value,
721 enumerable: true,
722 configurable: true,
723 writable: true
724 });
725 } else {
726 obj[key] = value;
727 }
728
729 return obj;
730}
731
732function _inherits(subClass, superClass) {
733 if (typeof superClass !== "function" && superClass !== null) {
734 throw new TypeError("Super expression must either be null or a function");
735 }
736
737 subClass.prototype = Object.create(superClass && superClass.prototype, {
738 constructor: {
739 value: subClass,
740 writable: true,
741 configurable: true
742 }
743 });
744 if (superClass) _setPrototypeOf(subClass, superClass);
745}
746
747function _getPrototypeOf(o) {
748 _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
749 return o.__proto__ || Object.getPrototypeOf(o);
750 };
751 return _getPrototypeOf(o);
752}
753
754function _setPrototypeOf(o, p) {
755 _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
756 o.__proto__ = p;
757 return o;
758 };
759
760 return _setPrototypeOf(o, p);
761}
762
763function isNativeReflectConstruct() {
764 if (typeof Reflect === "undefined" || !Reflect.construct) return false;
765 if (Reflect.construct.sham) return false;
766 if (typeof Proxy === "function") return true;
767
768 try {
769 Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));
770 return true;
771 } catch (e) {
772 return false;
773 }
774}
775
776function _construct(Parent, args, Class) {
777 if (isNativeReflectConstruct()) {
778 _construct = Reflect.construct;
779 } else {
780 _construct = function _construct(Parent, args, Class) {
781 var a = [null];
782 a.push.apply(a, args);
783 var Constructor = Function.bind.apply(Parent, a);
784 var instance = new Constructor();
785 if (Class) _setPrototypeOf(instance, Class.prototype);
786 return instance;
787 };
788 }
789
790 return _construct.apply(null, arguments);
791}
792
793function _isNativeFunction(fn) {
794 return Function.toString.call(fn).indexOf("[native code]") !== -1;
795}
796
797function _wrapNativeSuper(Class) {
798 var _cache = typeof Map === "function" ? new Map() : undefined;
799
800 _wrapNativeSuper = function _wrapNativeSuper(Class) {
801 if (Class === null || !_isNativeFunction(Class)) return Class;
802
803 if (typeof Class !== "function") {
804 throw new TypeError("Super expression must either be null or a function");
805 }
806
807 if (typeof _cache !== "undefined") {
808 if (_cache.has(Class)) return _cache.get(Class);
809
810 _cache.set(Class, Wrapper);
811 }
812
813 function Wrapper() {
814 return _construct(Class, arguments, _getPrototypeOf(this).constructor);
815 }
816
817 Wrapper.prototype = Object.create(Class.prototype, {
818 constructor: {
819 value: Wrapper,
820 enumerable: false,
821 writable: true,
822 configurable: true
823 }
824 });
825 return _setPrototypeOf(Wrapper, Class);
826 };
827
828 return _wrapNativeSuper(Class);
829}
830
831function _assertThisInitialized(self) {
832 if (self === void 0) {
833 throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
834 }
835
836 return self;
837}
838
839function _possibleConstructorReturn(self, call) {
840 if (call && (typeof call === "object" || typeof call === "function")) {
841 return call;
842 }
843
844 return _assertThisInitialized(self);
845}
846
847function _superPropBase(object, property) {
848 while (!Object.prototype.hasOwnProperty.call(object, property)) {
849 object = _getPrototypeOf(object);
850 if (object === null) break;
851 }
852
853 return object;
854}
855
856function _get(target, property, receiver) {
857 if (typeof Reflect !== "undefined" && Reflect.get) {
858 _get = Reflect.get;
859 } else {
860 _get = function _get(target, property, receiver) {
861 var base = _superPropBase(target, property);
862
863 if (!base) return;
864 var desc = Object.getOwnPropertyDescriptor(base, property);
865
866 if (desc.get) {
867 return desc.get.call(receiver);
868 }
869
870 return desc.value;
871 };
872 }
873
874 return _get(target, property, receiver || target);
875}
876
877function _toConsumableArray(arr) {
878 return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();
879}
880
881function _arrayWithoutHoles(arr) {
882 if (Array.isArray(arr)) {
883 for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
884
885 return arr2;
886 }
887}
888
889function _iterableToArray(iter) {
890 if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
891}
892
893function _nonIterableSpread() {
894 throw new TypeError("Invalid attempt to spread non-iterable instance");
895}
896
897var _wks = createCommonjsModule(function (module) {
898var store = require$$0$2('wks');
899
900var Symbol = global$1.Symbol;
901var USE_SYMBOL = typeof Symbol == 'function';
902
903var $exports = module.exports = function (name) {
904 return store[name] || (store[name] =
905 USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));
906};
907
908$exports.store = store;
909});
910
911var _wks$1 = /*#__PURE__*/Object.freeze({
912 default: _wks,
913 __moduleExports: _wks
914});
915
916var require$$0$7 = ( _wks$1 && _wks ) || _wks$1;
917
918var f$3 = require$$0$7;
919
920var _wksExt = {
921 f: f$3
922};
923
924var _wksExt$1 = /*#__PURE__*/Object.freeze({
925 default: _wksExt,
926 __moduleExports: _wksExt,
927 f: f$3
928});
929
930var wksExt = ( _wksExt$1 && _wksExt ) || _wksExt$1;
931
932var defineProperty = dP$1.f;
933var _wksDefine = function (name) {
934 var $Symbol = require$$1$1.Symbol || (require$$1$1.Symbol = LIBRARY ? {} : global$1.Symbol || {});
935 if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) });
936};
937
938var _wksDefine$1 = /*#__PURE__*/Object.freeze({
939 default: _wksDefine,
940 __moduleExports: _wksDefine
941});
942
943var wksDefine = ( _wksDefine$1 && _wksDefine ) || _wksDefine$1;
944
945wksDefine('asyncIterator');
946
947var _meta = createCommonjsModule(function (module) {
948var META = uid('meta');
949
950
951var setDesc = dP$1.f;
952var id = 0;
953var isExtensible = Object.isExtensible || function () {
954 return true;
955};
956var FREEZE = !require$$1(function () {
957 return isExtensible(Object.preventExtensions({}));
958});
959var setMeta = function (it) {
960 setDesc(it, META, { value: {
961 i: 'O' + ++id, // object ID
962 w: {} // weak collections IDs
963 } });
964};
965var fastKey = function (it, create) {
966 // return primitive with prefix
967 if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
968 if (!has(it, META)) {
969 // can't set metadata to uncaught frozen object
970 if (!isExtensible(it)) return 'F';
971 // not necessary to add metadata
972 if (!create) return 'E';
973 // add missing metadata
974 setMeta(it);
975 // return object ID
976 } return it[META].i;
977};
978var getWeak = function (it, create) {
979 if (!has(it, META)) {
980 // can't set metadata to uncaught frozen object
981 if (!isExtensible(it)) return true;
982 // not necessary to add metadata
983 if (!create) return false;
984 // add missing metadata
985 setMeta(it);
986 // return hash weak collections IDs
987 } return it[META].w;
988};
989// add metadata on freeze-family methods calling
990var onFreeze = function (it) {
991 if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);
992 return it;
993};
994var meta = module.exports = {
995 KEY: META,
996 NEED: false,
997 fastKey: fastKey,
998 getWeak: getWeak,
999 onFreeze: onFreeze
1000};
1001});
1002var _meta_1 = _meta.KEY;
1003var _meta_2 = _meta.NEED;
1004var _meta_3 = _meta.fastKey;
1005var _meta_4 = _meta.getWeak;
1006var _meta_5 = _meta.onFreeze;
1007
1008var _meta$1 = /*#__PURE__*/Object.freeze({
1009 default: _meta,
1010 __moduleExports: _meta,
1011 KEY: _meta_1,
1012 NEED: _meta_2,
1013 fastKey: _meta_3,
1014 getWeak: _meta_4,
1015 onFreeze: _meta_5
1016});
1017
1018var def = dP$1.f;
1019
1020var TAG = require$$0$7('toStringTag');
1021
1022var _setToStringTag = function (it, tag, stat) {
1023 if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });
1024};
1025
1026var _setToStringTag$1 = /*#__PURE__*/Object.freeze({
1027 default: _setToStringTag,
1028 __moduleExports: _setToStringTag
1029});
1030
1031// all enumerable object keys, includes symbols
1032
1033
1034
1035var _enumKeys = function (it) {
1036 var result = getKeys(it);
1037 var getSymbols = gOPS.f;
1038 if (getSymbols) {
1039 var symbols = getSymbols(it);
1040 var isEnum = pIE.f;
1041 var i = 0;
1042 var key;
1043 while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);
1044 } return result;
1045};
1046
1047var _enumKeys$1 = /*#__PURE__*/Object.freeze({
1048 default: _enumKeys,
1049 __moduleExports: _enumKeys
1050});
1051
1052// 7.2.2 IsArray(argument)
1053
1054var _isArray = Array.isArray || function isArray(arg) {
1055 return cof(arg) == 'Array';
1056};
1057
1058var _isArray$1 = /*#__PURE__*/Object.freeze({
1059 default: _isArray,
1060 __moduleExports: _isArray
1061});
1062
1063var _objectDps = DESCRIPTORS ? Object.defineProperties : function defineProperties(O, Properties) {
1064 anObject(O);
1065 var keys = getKeys(Properties);
1066 var length = keys.length;
1067 var i = 0;
1068 var P;
1069 while (length > i) dP$1.f(O, P = keys[i++], Properties[P]);
1070 return O;
1071};
1072
1073var _objectDps$1 = /*#__PURE__*/Object.freeze({
1074 default: _objectDps,
1075 __moduleExports: _objectDps
1076});
1077
1078var document$1 = global$1.document;
1079var _html = document$1 && document$1.documentElement;
1080
1081var _html$1 = /*#__PURE__*/Object.freeze({
1082 default: _html,
1083 __moduleExports: _html
1084});
1085
1086var dPs = ( _objectDps$1 && _objectDps ) || _objectDps$1;
1087
1088var require$$2$1 = ( _html$1 && _html ) || _html$1;
1089
1090// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
1091
1092
1093
1094var IE_PROTO$1 = require$$0$4('IE_PROTO');
1095var Empty = function () { /* empty */ };
1096var PROTOTYPE$1 = 'prototype';
1097
1098// Create object with fake `null` prototype: use iframe Object with cleared prototype
1099var createDict = function () {
1100 // Thrash, waste and sodomy: IE GC bug
1101 var iframe = require$$2('iframe');
1102 var i = require$$0$5.length;
1103 var lt = '<';
1104 var gt = '>';
1105 var iframeDocument;
1106 iframe.style.display = 'none';
1107 require$$2$1.appendChild(iframe);
1108 iframe.src = 'javascript:'; // eslint-disable-line no-script-url
1109 // createDict = iframe.contentWindow.Object;
1110 // html.removeChild(iframe);
1111 iframeDocument = iframe.contentWindow.document;
1112 iframeDocument.open();
1113 iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
1114 iframeDocument.close();
1115 createDict = iframeDocument.F;
1116 while (i--) delete createDict[PROTOTYPE$1][require$$0$5[i]];
1117 return createDict();
1118};
1119
1120var _objectCreate = Object.create || function create(O, Properties) {
1121 var result;
1122 if (O !== null) {
1123 Empty[PROTOTYPE$1] = anObject(O);
1124 result = new Empty();
1125 Empty[PROTOTYPE$1] = null;
1126 // add "__proto__" for Object.getPrototypeOf polyfill
1127 result[IE_PROTO$1] = O;
1128 } else result = createDict();
1129 return Properties === undefined ? result : dPs(result, Properties);
1130};
1131
1132var _objectCreate$1 = /*#__PURE__*/Object.freeze({
1133 default: _objectCreate,
1134 __moduleExports: _objectCreate
1135});
1136
1137// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)
1138
1139var hiddenKeys = require$$0$5.concat('length', 'prototype');
1140
1141var f$4 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
1142 return $keys(O, hiddenKeys);
1143};
1144
1145var _objectGopn = {
1146 f: f$4
1147};
1148
1149var _objectGopn$1 = /*#__PURE__*/Object.freeze({
1150 default: _objectGopn,
1151 __moduleExports: _objectGopn,
1152 f: f$4
1153});
1154
1155var require$$0$8 = ( _objectGopn$1 && _objectGopn ) || _objectGopn$1;
1156
1157// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
1158
1159var gOPN = require$$0$8.f;
1160var toString$1 = {}.toString;
1161
1162var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
1163 ? Object.getOwnPropertyNames(window) : [];
1164
1165var getWindowNames = function (it) {
1166 try {
1167 return gOPN(it);
1168 } catch (e) {
1169 return windowNames.slice();
1170 }
1171};
1172
1173var f$5 = function getOwnPropertyNames(it) {
1174 return windowNames && toString$1.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));
1175};
1176
1177var _objectGopnExt = {
1178 f: f$5
1179};
1180
1181var _objectGopnExt$1 = /*#__PURE__*/Object.freeze({
1182 default: _objectGopnExt,
1183 __moduleExports: _objectGopnExt,
1184 f: f$5
1185});
1186
1187var gOPD = Object.getOwnPropertyDescriptor;
1188
1189var f$6 = DESCRIPTORS ? gOPD : function getOwnPropertyDescriptor(O, P) {
1190 O = toIObject(O);
1191 P = toPrimitive(P, true);
1192 if (IE8_DOM_DEFINE) try {
1193 return gOPD(O, P);
1194 } catch (e) { /* empty */ }
1195 if (has(O, P)) return descriptor(!pIE.f.call(O, P), O[P]);
1196};
1197
1198var _objectGopd = {
1199 f: f$6
1200};
1201
1202var _objectGopd$1 = /*#__PURE__*/Object.freeze({
1203 default: _objectGopd,
1204 __moduleExports: _objectGopd,
1205 f: f$6
1206});
1207
1208var meta = ( _meta$1 && _meta ) || _meta$1;
1209
1210var setToStringTag = ( _setToStringTag$1 && _setToStringTag ) || _setToStringTag$1;
1211
1212var enumKeys = ( _enumKeys$1 && _enumKeys ) || _enumKeys$1;
1213
1214var isArray = ( _isArray$1 && _isArray ) || _isArray$1;
1215
1216var create = ( _objectCreate$1 && _objectCreate ) || _objectCreate$1;
1217
1218var gOPNExt = ( _objectGopnExt$1 && _objectGopnExt ) || _objectGopnExt$1;
1219
1220var require$$1$2 = ( _objectGopd$1 && _objectGopd ) || _objectGopd$1;
1221
1222// ECMAScript 6 symbols shim
1223
1224
1225
1226
1227
1228var META = meta.KEY;
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248var gOPD$1 = require$$1$2.f;
1249var dP$2 = dP$1.f;
1250var gOPN$1 = gOPNExt.f;
1251var $Symbol = global$1.Symbol;
1252var $JSON = global$1.JSON;
1253var _stringify = $JSON && $JSON.stringify;
1254var PROTOTYPE$2 = 'prototype';
1255var HIDDEN = require$$0$7('_hidden');
1256var TO_PRIMITIVE = require$$0$7('toPrimitive');
1257var isEnum = {}.propertyIsEnumerable;
1258var SymbolRegistry = require$$0$2('symbol-registry');
1259var AllSymbols = require$$0$2('symbols');
1260var OPSymbols = require$$0$2('op-symbols');
1261var ObjectProto = Object[PROTOTYPE$2];
1262var USE_NATIVE = typeof $Symbol == 'function';
1263var QObject = global$1.QObject;
1264// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
1265var setter = !QObject || !QObject[PROTOTYPE$2] || !QObject[PROTOTYPE$2].findChild;
1266
1267// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
1268var setSymbolDesc = DESCRIPTORS && require$$1(function () {
1269 return create(dP$2({}, 'a', {
1270 get: function () { return dP$2(this, 'a', { value: 7 }).a; }
1271 })).a != 7;
1272}) ? function (it, key, D) {
1273 var protoDesc = gOPD$1(ObjectProto, key);
1274 if (protoDesc) delete ObjectProto[key];
1275 dP$2(it, key, D);
1276 if (protoDesc && it !== ObjectProto) dP$2(ObjectProto, key, protoDesc);
1277} : dP$2;
1278
1279var wrap = function (tag) {
1280 var sym = AllSymbols[tag] = create($Symbol[PROTOTYPE$2]);
1281 sym._k = tag;
1282 return sym;
1283};
1284
1285var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {
1286 return typeof it == 'symbol';
1287} : function (it) {
1288 return it instanceof $Symbol;
1289};
1290
1291var $defineProperty = function defineProperty(it, key, D) {
1292 if (it === ObjectProto) $defineProperty(OPSymbols, key, D);
1293 anObject(it);
1294 key = toPrimitive(key, true);
1295 anObject(D);
1296 if (has(AllSymbols, key)) {
1297 if (!D.enumerable) {
1298 if (!has(it, HIDDEN)) dP$2(it, HIDDEN, descriptor(1, {}));
1299 it[HIDDEN][key] = true;
1300 } else {
1301 if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;
1302 D = create(D, { enumerable: descriptor(0, false) });
1303 } return setSymbolDesc(it, key, D);
1304 } return dP$2(it, key, D);
1305};
1306var $defineProperties = function defineProperties(it, P) {
1307 anObject(it);
1308 var keys = enumKeys(P = toIObject(P));
1309 var i = 0;
1310 var l = keys.length;
1311 var key;
1312 while (l > i) $defineProperty(it, key = keys[i++], P[key]);
1313 return it;
1314};
1315var $create = function create$$1(it, P) {
1316 return P === undefined ? create(it) : $defineProperties(create(it), P);
1317};
1318var $propertyIsEnumerable = function propertyIsEnumerable(key) {
1319 var E = isEnum.call(this, key = toPrimitive(key, true));
1320 if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false;
1321 return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;
1322};
1323var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {
1324 it = toIObject(it);
1325 key = toPrimitive(key, true);
1326 if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return;
1327 var D = gOPD$1(it, key);
1328 if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;
1329 return D;
1330};
1331var $getOwnPropertyNames = function getOwnPropertyNames(it) {
1332 var names = gOPN$1(toIObject(it));
1333 var result = [];
1334 var i = 0;
1335 var key;
1336 while (names.length > i) {
1337 if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);
1338 } return result;
1339};
1340var $getOwnPropertySymbols = function getOwnPropertySymbols(it) {
1341 var IS_OP = it === ObjectProto;
1342 var names = gOPN$1(IS_OP ? OPSymbols : toIObject(it));
1343 var result = [];
1344 var i = 0;
1345 var key;
1346 while (names.length > i) {
1347 if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]);
1348 } return result;
1349};
1350
1351// 19.4.1.1 Symbol([description])
1352if (!USE_NATIVE) {
1353 $Symbol = function Symbol() {
1354 if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');
1355 var tag = uid(arguments.length > 0 ? arguments[0] : undefined);
1356 var $set = function (value) {
1357 if (this === ObjectProto) $set.call(OPSymbols, value);
1358 if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
1359 setSymbolDesc(this, tag, descriptor(1, value));
1360 };
1361 if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });
1362 return wrap(tag);
1363 };
1364 redefine($Symbol[PROTOTYPE$2], 'toString', function toString() {
1365 return this._k;
1366 });
1367
1368 require$$1$2.f = $getOwnPropertyDescriptor;
1369 dP$1.f = $defineProperty;
1370 require$$0$8.f = gOPNExt.f = $getOwnPropertyNames;
1371 pIE.f = $propertyIsEnumerable;
1372 gOPS.f = $getOwnPropertySymbols;
1373
1374 if (DESCRIPTORS && !LIBRARY) {
1375 redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);
1376 }
1377
1378 wksExt.f = function (name) {
1379 return wrap(require$$0$7(name));
1380 };
1381}
1382
1383$export$1($export$1.G + $export$1.W + $export$1.F * !USE_NATIVE, { Symbol: $Symbol });
1384
1385for (var es6Symbols = (
1386 // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14
1387 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'
1388).split(','), j = 0; es6Symbols.length > j;)require$$0$7(es6Symbols[j++]);
1389
1390for (var wellKnownSymbols = getKeys(require$$0$7.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]);
1391
1392$export$1($export$1.S + $export$1.F * !USE_NATIVE, 'Symbol', {
1393 // 19.4.2.1 Symbol.for(key)
1394 'for': function (key) {
1395 return has(SymbolRegistry, key += '')
1396 ? SymbolRegistry[key]
1397 : SymbolRegistry[key] = $Symbol(key);
1398 },
1399 // 19.4.2.5 Symbol.keyFor(sym)
1400 keyFor: function keyFor(sym) {
1401 if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');
1402 for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;
1403 },
1404 useSetter: function () { setter = true; },
1405 useSimple: function () { setter = false; }
1406});
1407
1408$export$1($export$1.S + $export$1.F * !USE_NATIVE, 'Object', {
1409 // 19.1.2.2 Object.create(O [, Properties])
1410 create: $create,
1411 // 19.1.2.4 Object.defineProperty(O, P, Attributes)
1412 defineProperty: $defineProperty,
1413 // 19.1.2.3 Object.defineProperties(O, Properties)
1414 defineProperties: $defineProperties,
1415 // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
1416 getOwnPropertyDescriptor: $getOwnPropertyDescriptor,
1417 // 19.1.2.7 Object.getOwnPropertyNames(O)
1418 getOwnPropertyNames: $getOwnPropertyNames,
1419 // 19.1.2.8 Object.getOwnPropertySymbols(O)
1420 getOwnPropertySymbols: $getOwnPropertySymbols
1421});
1422
1423// 24.3.2 JSON.stringify(value [, replacer [, space]])
1424$JSON && $export$1($export$1.S + $export$1.F * (!USE_NATIVE || require$$1(function () {
1425 var S = $Symbol();
1426 // MS Edge converts symbol values to JSON as {}
1427 // WebKit converts symbol values to JSON as null
1428 // V8 throws on boxed symbols
1429 return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';
1430})), 'JSON', {
1431 stringify: function stringify(it) {
1432 var args = [it];
1433 var i = 1;
1434 var replacer, $replacer;
1435 while (arguments.length > i) args.push(arguments[i++]);
1436 $replacer = replacer = args[1];
1437 if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
1438 if (!isArray(replacer)) replacer = function (key, value) {
1439 if (typeof $replacer == 'function') value = $replacer.call(this, key, value);
1440 if (!isSymbol(value)) return value;
1441 };
1442 args[1] = replacer;
1443 return _stringify.apply($JSON, args);
1444 }
1445});
1446
1447// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)
1448$Symbol[PROTOTYPE$2][TO_PRIMITIVE] || require$$0($Symbol[PROTOTYPE$2], TO_PRIMITIVE, $Symbol[PROTOTYPE$2].valueOf);
1449// 19.4.3.5 Symbol.prototype[@@toStringTag]
1450setToStringTag($Symbol, 'Symbol');
1451// 20.2.1.9 Math[@@toStringTag]
1452setToStringTag(Math, 'Math', true);
1453// 24.3.3 JSON[@@toStringTag]
1454setToStringTag(global$1.JSON, 'JSON', true);
1455
1456// 22.1.3.31 Array.prototype[@@unscopables]
1457var UNSCOPABLES = require$$0$7('unscopables');
1458var ArrayProto = Array.prototype;
1459if (ArrayProto[UNSCOPABLES] == undefined) require$$0(ArrayProto, UNSCOPABLES, {});
1460var _addToUnscopables = function (key) {
1461 ArrayProto[UNSCOPABLES][key] = true;
1462};
1463
1464var _addToUnscopables$1 = /*#__PURE__*/Object.freeze({
1465 default: _addToUnscopables,
1466 __moduleExports: _addToUnscopables
1467});
1468
1469var _iterStep = function (done, value) {
1470 return { value: value, done: !!done };
1471};
1472
1473var _iterStep$1 = /*#__PURE__*/Object.freeze({
1474 default: _iterStep,
1475 __moduleExports: _iterStep
1476});
1477
1478var _iterators = {};
1479
1480var _iterators$1 = /*#__PURE__*/Object.freeze({
1481 default: _iterators,
1482 __moduleExports: _iterators
1483});
1484
1485var IteratorPrototype = {};
1486
1487// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
1488require$$0(IteratorPrototype, require$$0$7('iterator'), function () { return this; });
1489
1490var _iterCreate = function (Constructor, NAME, next) {
1491 Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });
1492 setToStringTag(Constructor, NAME + ' Iterator');
1493};
1494
1495var _iterCreate$1 = /*#__PURE__*/Object.freeze({
1496 default: _iterCreate,
1497 __moduleExports: _iterCreate
1498});
1499
1500// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
1501
1502
1503var IE_PROTO$2 = require$$0$4('IE_PROTO');
1504var ObjectProto$1 = Object.prototype;
1505
1506var _objectGpo = Object.getPrototypeOf || function (O) {
1507 O = toObject(O);
1508 if (has(O, IE_PROTO$2)) return O[IE_PROTO$2];
1509 if (typeof O.constructor == 'function' && O instanceof O.constructor) {
1510 return O.constructor.prototype;
1511 } return O instanceof Object ? ObjectProto$1 : null;
1512};
1513
1514var _objectGpo$1 = /*#__PURE__*/Object.freeze({
1515 default: _objectGpo,
1516 __moduleExports: _objectGpo
1517});
1518
1519var Iterators = ( _iterators$1 && _iterators ) || _iterators$1;
1520
1521var $iterCreate = ( _iterCreate$1 && _iterCreate ) || _iterCreate$1;
1522
1523var getPrototypeOf = ( _objectGpo$1 && _objectGpo ) || _objectGpo$1;
1524
1525var ITERATOR = require$$0$7('iterator');
1526var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`
1527var FF_ITERATOR = '@@iterator';
1528var KEYS = 'keys';
1529var VALUES = 'values';
1530
1531var returnThis = function () { return this; };
1532
1533var _iterDefine = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {
1534 $iterCreate(Constructor, NAME, next);
1535 var getMethod = function (kind) {
1536 if (!BUGGY && kind in proto) return proto[kind];
1537 switch (kind) {
1538 case KEYS: return function keys() { return new Constructor(this, kind); };
1539 case VALUES: return function values() { return new Constructor(this, kind); };
1540 } return function entries() { return new Constructor(this, kind); };
1541 };
1542 var TAG = NAME + ' Iterator';
1543 var DEF_VALUES = DEFAULT == VALUES;
1544 var VALUES_BUG = false;
1545 var proto = Base.prototype;
1546 var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];
1547 var $default = $native || getMethod(DEFAULT);
1548 var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;
1549 var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;
1550 var methods, key, IteratorPrototype;
1551 // Fix native
1552 if ($anyNative) {
1553 IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));
1554 if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {
1555 // Set @@toStringTag to native iterators
1556 setToStringTag(IteratorPrototype, TAG, true);
1557 // fix for some old engines
1558 if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') require$$0(IteratorPrototype, ITERATOR, returnThis);
1559 }
1560 }
1561 // fix Array#{values, @@iterator}.name in V8 / FF
1562 if (DEF_VALUES && $native && $native.name !== VALUES) {
1563 VALUES_BUG = true;
1564 $default = function values() { return $native.call(this); };
1565 }
1566 // Define iterator
1567 if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {
1568 require$$0(proto, ITERATOR, $default);
1569 }
1570 // Plug for library
1571 Iterators[NAME] = $default;
1572 Iterators[TAG] = returnThis;
1573 if (DEFAULT) {
1574 methods = {
1575 values: DEF_VALUES ? $default : getMethod(VALUES),
1576 keys: IS_SET ? $default : getMethod(KEYS),
1577 entries: $entries
1578 };
1579 if (FORCED) for (key in methods) {
1580 if (!(key in proto)) redefine(proto, key, methods[key]);
1581 } else $export$1($export$1.P + $export$1.F * (BUGGY || VALUES_BUG), NAME, methods);
1582 }
1583 return methods;
1584};
1585
1586var _iterDefine$1 = /*#__PURE__*/Object.freeze({
1587 default: _iterDefine,
1588 __moduleExports: _iterDefine
1589});
1590
1591var require$$1$3 = ( _addToUnscopables$1 && _addToUnscopables ) || _addToUnscopables$1;
1592
1593var step = ( _iterStep$1 && _iterStep ) || _iterStep$1;
1594
1595var $iterDefine = ( _iterDefine$1 && _iterDefine ) || _iterDefine$1;
1596
1597// 22.1.3.4 Array.prototype.entries()
1598// 22.1.3.13 Array.prototype.keys()
1599// 22.1.3.29 Array.prototype.values()
1600// 22.1.3.30 Array.prototype[@@iterator]()
1601var es6_array_iterator = $iterDefine(Array, 'Array', function (iterated, kind) {
1602 this._t = toIObject(iterated); // target
1603 this._i = 0; // next index
1604 this._k = kind; // kind
1605// 22.1.5.2.1 %ArrayIteratorPrototype%.next()
1606}, function () {
1607 var O = this._t;
1608 var kind = this._k;
1609 var index = this._i++;
1610 if (!O || index >= O.length) {
1611 this._t = undefined;
1612 return step(1);
1613 }
1614 if (kind == 'keys') return step(0, index);
1615 if (kind == 'values') return step(0, O[index]);
1616 return step(0, [index, O[index]]);
1617}, 'values');
1618
1619// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)
1620Iterators.Arguments = Iterators.Array;
1621
1622require$$1$3('keys');
1623require$$1$3('values');
1624require$$1$3('entries');
1625
1626var es6_array_iterator$1 = /*#__PURE__*/Object.freeze({
1627 default: es6_array_iterator,
1628 __moduleExports: es6_array_iterator
1629});
1630
1631var $iterators = ( es6_array_iterator$1 && es6_array_iterator ) || es6_array_iterator$1;
1632
1633var ITERATOR$1 = require$$0$7('iterator');
1634var TO_STRING_TAG = require$$0$7('toStringTag');
1635var ArrayValues = Iterators.Array;
1636
1637var DOMIterables = {
1638 CSSRuleList: true, // TODO: Not spec compliant, should be false.
1639 CSSStyleDeclaration: false,
1640 CSSValueList: false,
1641 ClientRectList: false,
1642 DOMRectList: false,
1643 DOMStringList: false,
1644 DOMTokenList: true,
1645 DataTransferItemList: false,
1646 FileList: false,
1647 HTMLAllCollection: false,
1648 HTMLCollection: false,
1649 HTMLFormElement: false,
1650 HTMLSelectElement: false,
1651 MediaList: true, // TODO: Not spec compliant, should be false.
1652 MimeTypeArray: false,
1653 NamedNodeMap: false,
1654 NodeList: true,
1655 PaintRequestList: false,
1656 Plugin: false,
1657 PluginArray: false,
1658 SVGLengthList: false,
1659 SVGNumberList: false,
1660 SVGPathSegList: false,
1661 SVGPointList: false,
1662 SVGStringList: false,
1663 SVGTransformList: false,
1664 SourceBufferList: false,
1665 StyleSheetList: true, // TODO: Not spec compliant, should be false.
1666 TextTrackCueList: false,
1667 TextTrackList: false,
1668 TouchList: false
1669};
1670
1671for (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++) {
1672 var NAME = collections[i];
1673 var explicit = DOMIterables[NAME];
1674 var Collection = global$1[NAME];
1675 var proto = Collection && Collection.prototype;
1676 var key;
1677 if (proto) {
1678 if (!proto[ITERATOR$1]) require$$0(proto, ITERATOR$1, ArrayValues);
1679 if (!proto[TO_STRING_TAG]) require$$0(proto, TO_STRING_TAG, NAME);
1680 Iterators[NAME] = ArrayValues;
1681 if (explicit) for (key in $iterators) if (!proto[key]) redefine(proto, key, $iterators[key], true);
1682 }
1683}
1684
1685// 22.1.2.2 / 15.4.3.2 Array.isArray(arg)
1686
1687
1688$export$1($export$1.S, 'Array', { isArray: isArray });
1689
1690var SPECIES = require$$0$7('species');
1691
1692var _arraySpeciesConstructor = function (original) {
1693 var C;
1694 if (isArray(original)) {
1695 C = original.constructor;
1696 // cross-realm fallback
1697 if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
1698 if (isObject(C)) {
1699 C = C[SPECIES];
1700 if (C === null) C = undefined;
1701 }
1702 } return C === undefined ? Array : C;
1703};
1704
1705var _arraySpeciesConstructor$1 = /*#__PURE__*/Object.freeze({
1706 default: _arraySpeciesConstructor,
1707 __moduleExports: _arraySpeciesConstructor
1708});
1709
1710var speciesConstructor = ( _arraySpeciesConstructor$1 && _arraySpeciesConstructor ) || _arraySpeciesConstructor$1;
1711
1712// 9.4.2.3 ArraySpeciesCreate(originalArray, length)
1713
1714
1715var _arraySpeciesCreate = function (original, length) {
1716 return new (speciesConstructor(original))(length);
1717};
1718
1719var _arraySpeciesCreate$1 = /*#__PURE__*/Object.freeze({
1720 default: _arraySpeciesCreate,
1721 __moduleExports: _arraySpeciesCreate
1722});
1723
1724var asc = ( _arraySpeciesCreate$1 && _arraySpeciesCreate ) || _arraySpeciesCreate$1;
1725
1726// 0 -> Array#forEach
1727// 1 -> Array#map
1728// 2 -> Array#filter
1729// 3 -> Array#some
1730// 4 -> Array#every
1731// 5 -> Array#find
1732// 6 -> Array#findIndex
1733
1734
1735
1736
1737
1738var _arrayMethods = function (TYPE, $create) {
1739 var IS_MAP = TYPE == 1;
1740 var IS_FILTER = TYPE == 2;
1741 var IS_SOME = TYPE == 3;
1742 var IS_EVERY = TYPE == 4;
1743 var IS_FIND_INDEX = TYPE == 6;
1744 var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
1745 var create = $create || asc;
1746 return function ($this, callbackfn, that) {
1747 var O = toObject($this);
1748 var self = IObject(O);
1749 var f = require$$0$1(callbackfn, that, 3);
1750 var length = toLength(self.length);
1751 var index = 0;
1752 var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;
1753 var val, res;
1754 for (;length > index; index++) if (NO_HOLES || index in self) {
1755 val = self[index];
1756 res = f(val, index, O);
1757 if (TYPE) {
1758 if (IS_MAP) result[index] = res; // map
1759 else if (res) switch (TYPE) {
1760 case 3: return true; // some
1761 case 5: return val; // find
1762 case 6: return index; // findIndex
1763 case 2: result.push(val); // filter
1764 } else if (IS_EVERY) return false; // every
1765 }
1766 }
1767 return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;
1768 };
1769};
1770
1771var _arrayMethods$1 = /*#__PURE__*/Object.freeze({
1772 default: _arrayMethods,
1773 __moduleExports: _arrayMethods
1774});
1775
1776var _strictMethod = function (method, arg) {
1777 return !!method && require$$1(function () {
1778 // eslint-disable-next-line no-useless-call
1779 arg ? method.call(null, function () { /* empty */ }, 1) : method.call(null);
1780 });
1781};
1782
1783var _strictMethod$1 = /*#__PURE__*/Object.freeze({
1784 default: _strictMethod,
1785 __moduleExports: _strictMethod
1786});
1787
1788var require$$0$9 = ( _arrayMethods$1 && _arrayMethods ) || _arrayMethods$1;
1789
1790var require$$1$4 = ( _strictMethod$1 && _strictMethod ) || _strictMethod$1;
1791
1792var $forEach = require$$0$9(0);
1793var STRICT = require$$1$4([].forEach, true);
1794
1795$export$1($export$1.P + $export$1.F * !STRICT, 'Array', {
1796 // 22.1.3.10 / 15.4.4.18 Array.prototype.forEach(callbackfn [, thisArg])
1797 forEach: function forEach(callbackfn /* , thisArg */) {
1798 return $forEach(this, callbackfn, arguments[1]);
1799 }
1800});
1801
1802var runtime = createCommonjsModule(function (module) {
1803/**
1804 * Copyright (c) 2014-present, Facebook, Inc.
1805 *
1806 * This source code is licensed under the MIT license found in the
1807 * LICENSE file in the root directory of this source tree.
1808 */
1809
1810!(function(global) {
1811
1812 var Op = Object.prototype;
1813 var hasOwn = Op.hasOwnProperty;
1814 var undefined; // More compressible than void 0.
1815 var $Symbol = typeof Symbol === "function" ? Symbol : {};
1816 var iteratorSymbol = $Symbol.iterator || "@@iterator";
1817 var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
1818 var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
1819 var runtime = global.regeneratorRuntime;
1820 if (runtime) {
1821 {
1822 // If regeneratorRuntime is defined globally and we're in a module,
1823 // make the exports object identical to regeneratorRuntime.
1824 module.exports = runtime;
1825 }
1826 // Don't bother evaluating the rest of this file if the runtime was
1827 // already defined globally.
1828 return;
1829 }
1830
1831 // Define the runtime globally (as expected by generated code) as either
1832 // module.exports (if we're in a module) or a new, empty object.
1833 runtime = global.regeneratorRuntime = module.exports;
1834
1835 function wrap(innerFn, outerFn, self, tryLocsList) {
1836 // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
1837 var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
1838 var generator = Object.create(protoGenerator.prototype);
1839 var context = new Context(tryLocsList || []);
1840
1841 // The ._invoke method unifies the implementations of the .next,
1842 // .throw, and .return methods.
1843 generator._invoke = makeInvokeMethod(innerFn, self, context);
1844
1845 return generator;
1846 }
1847 runtime.wrap = wrap;
1848
1849 // Try/catch helper to minimize deoptimizations. Returns a completion
1850 // record like context.tryEntries[i].completion. This interface could
1851 // have been (and was previously) designed to take a closure to be
1852 // invoked without arguments, but in all the cases we care about we
1853 // already have an existing method we want to call, so there's no need
1854 // to create a new function object. We can even get away with assuming
1855 // the method takes exactly one argument, since that happens to be true
1856 // in every case, so we don't have to touch the arguments object. The
1857 // only additional allocation required is the completion record, which
1858 // has a stable shape and so hopefully should be cheap to allocate.
1859 function tryCatch(fn, obj, arg) {
1860 try {
1861 return { type: "normal", arg: fn.call(obj, arg) };
1862 } catch (err) {
1863 return { type: "throw", arg: err };
1864 }
1865 }
1866
1867 var GenStateSuspendedStart = "suspendedStart";
1868 var GenStateSuspendedYield = "suspendedYield";
1869 var GenStateExecuting = "executing";
1870 var GenStateCompleted = "completed";
1871
1872 // Returning this object from the innerFn has the same effect as
1873 // breaking out of the dispatch switch statement.
1874 var ContinueSentinel = {};
1875
1876 // Dummy constructor functions that we use as the .constructor and
1877 // .constructor.prototype properties for functions that return Generator
1878 // objects. For full spec compliance, you may wish to configure your
1879 // minifier not to mangle the names of these two functions.
1880 function Generator() {}
1881 function GeneratorFunction() {}
1882 function GeneratorFunctionPrototype() {}
1883
1884 // This is a polyfill for %IteratorPrototype% for environments that
1885 // don't natively support it.
1886 var IteratorPrototype = {};
1887 IteratorPrototype[iteratorSymbol] = function () {
1888 return this;
1889 };
1890
1891 var getProto = Object.getPrototypeOf;
1892 var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
1893 if (NativeIteratorPrototype &&
1894 NativeIteratorPrototype !== Op &&
1895 hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
1896 // This environment has a native %IteratorPrototype%; use it instead
1897 // of the polyfill.
1898 IteratorPrototype = NativeIteratorPrototype;
1899 }
1900
1901 var Gp = GeneratorFunctionPrototype.prototype =
1902 Generator.prototype = Object.create(IteratorPrototype);
1903 GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
1904 GeneratorFunctionPrototype.constructor = GeneratorFunction;
1905 GeneratorFunctionPrototype[toStringTagSymbol] =
1906 GeneratorFunction.displayName = "GeneratorFunction";
1907
1908 // Helper for defining the .next, .throw, and .return methods of the
1909 // Iterator interface in terms of a single ._invoke method.
1910 function defineIteratorMethods(prototype) {
1911 ["next", "throw", "return"].forEach(function(method) {
1912 prototype[method] = function(arg) {
1913 return this._invoke(method, arg);
1914 };
1915 });
1916 }
1917
1918 runtime.isGeneratorFunction = function(genFun) {
1919 var ctor = typeof genFun === "function" && genFun.constructor;
1920 return ctor
1921 ? ctor === GeneratorFunction ||
1922 // For the native GeneratorFunction constructor, the best we can
1923 // do is to check its .name property.
1924 (ctor.displayName || ctor.name) === "GeneratorFunction"
1925 : false;
1926 };
1927
1928 runtime.mark = function(genFun) {
1929 if (Object.setPrototypeOf) {
1930 Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
1931 } else {
1932 genFun.__proto__ = GeneratorFunctionPrototype;
1933 if (!(toStringTagSymbol in genFun)) {
1934 genFun[toStringTagSymbol] = "GeneratorFunction";
1935 }
1936 }
1937 genFun.prototype = Object.create(Gp);
1938 return genFun;
1939 };
1940
1941 // Within the body of any async function, `await x` is transformed to
1942 // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
1943 // `hasOwn.call(value, "__await")` to determine if the yielded value is
1944 // meant to be awaited.
1945 runtime.awrap = function(arg) {
1946 return { __await: arg };
1947 };
1948
1949 function AsyncIterator(generator) {
1950 function invoke(method, arg, resolve, reject) {
1951 var record = tryCatch(generator[method], generator, arg);
1952 if (record.type === "throw") {
1953 reject(record.arg);
1954 } else {
1955 var result = record.arg;
1956 var value = result.value;
1957 if (value &&
1958 typeof value === "object" &&
1959 hasOwn.call(value, "__await")) {
1960 return Promise.resolve(value.__await).then(function(value) {
1961 invoke("next", value, resolve, reject);
1962 }, function(err) {
1963 invoke("throw", err, resolve, reject);
1964 });
1965 }
1966
1967 return Promise.resolve(value).then(function(unwrapped) {
1968 // When a yielded Promise is resolved, its final value becomes
1969 // the .value of the Promise<{value,done}> result for the
1970 // current iteration. If the Promise is rejected, however, the
1971 // result for this iteration will be rejected with the same
1972 // reason. Note that rejections of yielded Promises are not
1973 // thrown back into the generator function, as is the case
1974 // when an awaited Promise is rejected. This difference in
1975 // behavior between yield and await is important, because it
1976 // allows the consumer to decide what to do with the yielded
1977 // rejection (swallow it and continue, manually .throw it back
1978 // into the generator, abandon iteration, whatever). With
1979 // await, by contrast, there is no opportunity to examine the
1980 // rejection reason outside the generator function, so the
1981 // only option is to throw it from the await expression, and
1982 // let the generator function handle the exception.
1983 result.value = unwrapped;
1984 resolve(result);
1985 }, reject);
1986 }
1987 }
1988
1989 var previousPromise;
1990
1991 function enqueue(method, arg) {
1992 function callInvokeWithMethodAndArg() {
1993 return new Promise(function(resolve, reject) {
1994 invoke(method, arg, resolve, reject);
1995 });
1996 }
1997
1998 return previousPromise =
1999 // If enqueue has been called before, then we want to wait until
2000 // all previous Promises have been resolved before calling invoke,
2001 // so that results are always delivered in the correct order. If
2002 // enqueue has not been called before, then it is important to
2003 // call invoke immediately, without waiting on a callback to fire,
2004 // so that the async generator function has the opportunity to do
2005 // any necessary setup in a predictable way. This predictability
2006 // is why the Promise constructor synchronously invokes its
2007 // executor callback, and why async functions synchronously
2008 // execute code before the first await. Since we implement simple
2009 // async functions in terms of async generators, it is especially
2010 // important to get this right, even though it requires care.
2011 previousPromise ? previousPromise.then(
2012 callInvokeWithMethodAndArg,
2013 // Avoid propagating failures to Promises returned by later
2014 // invocations of the iterator.
2015 callInvokeWithMethodAndArg
2016 ) : callInvokeWithMethodAndArg();
2017 }
2018
2019 // Define the unified helper method that is used to implement .next,
2020 // .throw, and .return (see defineIteratorMethods).
2021 this._invoke = enqueue;
2022 }
2023
2024 defineIteratorMethods(AsyncIterator.prototype);
2025 AsyncIterator.prototype[asyncIteratorSymbol] = function () {
2026 return this;
2027 };
2028 runtime.AsyncIterator = AsyncIterator;
2029
2030 // Note that simple async functions are implemented on top of
2031 // AsyncIterator objects; they just return a Promise for the value of
2032 // the final result produced by the iterator.
2033 runtime.async = function(innerFn, outerFn, self, tryLocsList) {
2034 var iter = new AsyncIterator(
2035 wrap(innerFn, outerFn, self, tryLocsList)
2036 );
2037
2038 return runtime.isGeneratorFunction(outerFn)
2039 ? iter // If outerFn is a generator, return the full iterator.
2040 : iter.next().then(function(result) {
2041 return result.done ? result.value : iter.next();
2042 });
2043 };
2044
2045 function makeInvokeMethod(innerFn, self, context) {
2046 var state = GenStateSuspendedStart;
2047
2048 return function invoke(method, arg) {
2049 if (state === GenStateExecuting) {
2050 throw new Error("Generator is already running");
2051 }
2052
2053 if (state === GenStateCompleted) {
2054 if (method === "throw") {
2055 throw arg;
2056 }
2057
2058 // Be forgiving, per 25.3.3.3.3 of the spec:
2059 // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
2060 return doneResult();
2061 }
2062
2063 context.method = method;
2064 context.arg = arg;
2065
2066 while (true) {
2067 var delegate = context.delegate;
2068 if (delegate) {
2069 var delegateResult = maybeInvokeDelegate(delegate, context);
2070 if (delegateResult) {
2071 if (delegateResult === ContinueSentinel) continue;
2072 return delegateResult;
2073 }
2074 }
2075
2076 if (context.method === "next") {
2077 // Setting context._sent for legacy support of Babel's
2078 // function.sent implementation.
2079 context.sent = context._sent = context.arg;
2080
2081 } else if (context.method === "throw") {
2082 if (state === GenStateSuspendedStart) {
2083 state = GenStateCompleted;
2084 throw context.arg;
2085 }
2086
2087 context.dispatchException(context.arg);
2088
2089 } else if (context.method === "return") {
2090 context.abrupt("return", context.arg);
2091 }
2092
2093 state = GenStateExecuting;
2094
2095 var record = tryCatch(innerFn, self, context);
2096 if (record.type === "normal") {
2097 // If an exception is thrown from innerFn, we leave state ===
2098 // GenStateExecuting and loop back for another invocation.
2099 state = context.done
2100 ? GenStateCompleted
2101 : GenStateSuspendedYield;
2102
2103 if (record.arg === ContinueSentinel) {
2104 continue;
2105 }
2106
2107 return {
2108 value: record.arg,
2109 done: context.done
2110 };
2111
2112 } else if (record.type === "throw") {
2113 state = GenStateCompleted;
2114 // Dispatch the exception by looping back around to the
2115 // context.dispatchException(context.arg) call above.
2116 context.method = "throw";
2117 context.arg = record.arg;
2118 }
2119 }
2120 };
2121 }
2122
2123 // Call delegate.iterator[context.method](context.arg) and handle the
2124 // result, either by returning a { value, done } result from the
2125 // delegate iterator, or by modifying context.method and context.arg,
2126 // setting context.delegate to null, and returning the ContinueSentinel.
2127 function maybeInvokeDelegate(delegate, context) {
2128 var method = delegate.iterator[context.method];
2129 if (method === undefined) {
2130 // A .throw or .return when the delegate iterator has no .throw
2131 // method always terminates the yield* loop.
2132 context.delegate = null;
2133
2134 if (context.method === "throw") {
2135 if (delegate.iterator.return) {
2136 // If the delegate iterator has a return method, give it a
2137 // chance to clean up.
2138 context.method = "return";
2139 context.arg = undefined;
2140 maybeInvokeDelegate(delegate, context);
2141
2142 if (context.method === "throw") {
2143 // If maybeInvokeDelegate(context) changed context.method from
2144 // "return" to "throw", let that override the TypeError below.
2145 return ContinueSentinel;
2146 }
2147 }
2148
2149 context.method = "throw";
2150 context.arg = new TypeError(
2151 "The iterator does not provide a 'throw' method");
2152 }
2153
2154 return ContinueSentinel;
2155 }
2156
2157 var record = tryCatch(method, delegate.iterator, context.arg);
2158
2159 if (record.type === "throw") {
2160 context.method = "throw";
2161 context.arg = record.arg;
2162 context.delegate = null;
2163 return ContinueSentinel;
2164 }
2165
2166 var info = record.arg;
2167
2168 if (! info) {
2169 context.method = "throw";
2170 context.arg = new TypeError("iterator result is not an object");
2171 context.delegate = null;
2172 return ContinueSentinel;
2173 }
2174
2175 if (info.done) {
2176 // Assign the result of the finished delegate to the temporary
2177 // variable specified by delegate.resultName (see delegateYield).
2178 context[delegate.resultName] = info.value;
2179
2180 // Resume execution at the desired location (see delegateYield).
2181 context.next = delegate.nextLoc;
2182
2183 // If context.method was "throw" but the delegate handled the
2184 // exception, let the outer generator proceed normally. If
2185 // context.method was "next", forget context.arg since it has been
2186 // "consumed" by the delegate iterator. If context.method was
2187 // "return", allow the original .return call to continue in the
2188 // outer generator.
2189 if (context.method !== "return") {
2190 context.method = "next";
2191 context.arg = undefined;
2192 }
2193
2194 } else {
2195 // Re-yield the result returned by the delegate method.
2196 return info;
2197 }
2198
2199 // The delegate iterator is finished, so forget it and continue with
2200 // the outer generator.
2201 context.delegate = null;
2202 return ContinueSentinel;
2203 }
2204
2205 // Define Generator.prototype.{next,throw,return} in terms of the
2206 // unified ._invoke helper method.
2207 defineIteratorMethods(Gp);
2208
2209 Gp[toStringTagSymbol] = "Generator";
2210
2211 // A Generator should always return itself as the iterator object when the
2212 // @@iterator function is called on it. Some browsers' implementations of the
2213 // iterator prototype chain incorrectly implement this, causing the Generator
2214 // object to not be returned from this call. This ensures that doesn't happen.
2215 // See https://github.com/facebook/regenerator/issues/274 for more details.
2216 Gp[iteratorSymbol] = function() {
2217 return this;
2218 };
2219
2220 Gp.toString = function() {
2221 return "[object Generator]";
2222 };
2223
2224 function pushTryEntry(locs) {
2225 var entry = { tryLoc: locs[0] };
2226
2227 if (1 in locs) {
2228 entry.catchLoc = locs[1];
2229 }
2230
2231 if (2 in locs) {
2232 entry.finallyLoc = locs[2];
2233 entry.afterLoc = locs[3];
2234 }
2235
2236 this.tryEntries.push(entry);
2237 }
2238
2239 function resetTryEntry(entry) {
2240 var record = entry.completion || {};
2241 record.type = "normal";
2242 delete record.arg;
2243 entry.completion = record;
2244 }
2245
2246 function Context(tryLocsList) {
2247 // The root entry object (effectively a try statement without a catch
2248 // or a finally block) gives us a place to store values thrown from
2249 // locations where there is no enclosing try statement.
2250 this.tryEntries = [{ tryLoc: "root" }];
2251 tryLocsList.forEach(pushTryEntry, this);
2252 this.reset(true);
2253 }
2254
2255 runtime.keys = function(object) {
2256 var keys = [];
2257 for (var key in object) {
2258 keys.push(key);
2259 }
2260 keys.reverse();
2261
2262 // Rather than returning an object with a next method, we keep
2263 // things simple and return the next function itself.
2264 return function next() {
2265 while (keys.length) {
2266 var key = keys.pop();
2267 if (key in object) {
2268 next.value = key;
2269 next.done = false;
2270 return next;
2271 }
2272 }
2273
2274 // To avoid creating an additional object, we just hang the .value
2275 // and .done properties off the next function object itself. This
2276 // also ensures that the minifier will not anonymize the function.
2277 next.done = true;
2278 return next;
2279 };
2280 };
2281
2282 function values(iterable) {
2283 if (iterable) {
2284 var iteratorMethod = iterable[iteratorSymbol];
2285 if (iteratorMethod) {
2286 return iteratorMethod.call(iterable);
2287 }
2288
2289 if (typeof iterable.next === "function") {
2290 return iterable;
2291 }
2292
2293 if (!isNaN(iterable.length)) {
2294 var i = -1, next = function next() {
2295 while (++i < iterable.length) {
2296 if (hasOwn.call(iterable, i)) {
2297 next.value = iterable[i];
2298 next.done = false;
2299 return next;
2300 }
2301 }
2302
2303 next.value = undefined;
2304 next.done = true;
2305
2306 return next;
2307 };
2308
2309 return next.next = next;
2310 }
2311 }
2312
2313 // Return an iterator with no values.
2314 return { next: doneResult };
2315 }
2316 runtime.values = values;
2317
2318 function doneResult() {
2319 return { value: undefined, done: true };
2320 }
2321
2322 Context.prototype = {
2323 constructor: Context,
2324
2325 reset: function(skipTempReset) {
2326 this.prev = 0;
2327 this.next = 0;
2328 // Resetting context._sent for legacy support of Babel's
2329 // function.sent implementation.
2330 this.sent = this._sent = undefined;
2331 this.done = false;
2332 this.delegate = null;
2333
2334 this.method = "next";
2335 this.arg = undefined;
2336
2337 this.tryEntries.forEach(resetTryEntry);
2338
2339 if (!skipTempReset) {
2340 for (var name in this) {
2341 // Not sure about the optimal order of these conditions:
2342 if (name.charAt(0) === "t" &&
2343 hasOwn.call(this, name) &&
2344 !isNaN(+name.slice(1))) {
2345 this[name] = undefined;
2346 }
2347 }
2348 }
2349 },
2350
2351 stop: function() {
2352 this.done = true;
2353
2354 var rootEntry = this.tryEntries[0];
2355 var rootRecord = rootEntry.completion;
2356 if (rootRecord.type === "throw") {
2357 throw rootRecord.arg;
2358 }
2359
2360 return this.rval;
2361 },
2362
2363 dispatchException: function(exception) {
2364 if (this.done) {
2365 throw exception;
2366 }
2367
2368 var context = this;
2369 function handle(loc, caught) {
2370 record.type = "throw";
2371 record.arg = exception;
2372 context.next = loc;
2373
2374 if (caught) {
2375 // If the dispatched exception was caught by a catch block,
2376 // then let that catch block handle the exception normally.
2377 context.method = "next";
2378 context.arg = undefined;
2379 }
2380
2381 return !! caught;
2382 }
2383
2384 for (var i = this.tryEntries.length - 1; i >= 0; --i) {
2385 var entry = this.tryEntries[i];
2386 var record = entry.completion;
2387
2388 if (entry.tryLoc === "root") {
2389 // Exception thrown outside of any try block that could handle
2390 // it, so set the completion value of the entire function to
2391 // throw the exception.
2392 return handle("end");
2393 }
2394
2395 if (entry.tryLoc <= this.prev) {
2396 var hasCatch = hasOwn.call(entry, "catchLoc");
2397 var hasFinally = hasOwn.call(entry, "finallyLoc");
2398
2399 if (hasCatch && hasFinally) {
2400 if (this.prev < entry.catchLoc) {
2401 return handle(entry.catchLoc, true);
2402 } else if (this.prev < entry.finallyLoc) {
2403 return handle(entry.finallyLoc);
2404 }
2405
2406 } else if (hasCatch) {
2407 if (this.prev < entry.catchLoc) {
2408 return handle(entry.catchLoc, true);
2409 }
2410
2411 } else if (hasFinally) {
2412 if (this.prev < entry.finallyLoc) {
2413 return handle(entry.finallyLoc);
2414 }
2415
2416 } else {
2417 throw new Error("try statement without catch or finally");
2418 }
2419 }
2420 }
2421 },
2422
2423 abrupt: function(type, arg) {
2424 for (var i = this.tryEntries.length - 1; i >= 0; --i) {
2425 var entry = this.tryEntries[i];
2426 if (entry.tryLoc <= this.prev &&
2427 hasOwn.call(entry, "finallyLoc") &&
2428 this.prev < entry.finallyLoc) {
2429 var finallyEntry = entry;
2430 break;
2431 }
2432 }
2433
2434 if (finallyEntry &&
2435 (type === "break" ||
2436 type === "continue") &&
2437 finallyEntry.tryLoc <= arg &&
2438 arg <= finallyEntry.finallyLoc) {
2439 // Ignore the finally entry if control is not jumping to a
2440 // location outside the try/catch block.
2441 finallyEntry = null;
2442 }
2443
2444 var record = finallyEntry ? finallyEntry.completion : {};
2445 record.type = type;
2446 record.arg = arg;
2447
2448 if (finallyEntry) {
2449 this.method = "next";
2450 this.next = finallyEntry.finallyLoc;
2451 return ContinueSentinel;
2452 }
2453
2454 return this.complete(record);
2455 },
2456
2457 complete: function(record, afterLoc) {
2458 if (record.type === "throw") {
2459 throw record.arg;
2460 }
2461
2462 if (record.type === "break" ||
2463 record.type === "continue") {
2464 this.next = record.arg;
2465 } else if (record.type === "return") {
2466 this.rval = this.arg = record.arg;
2467 this.method = "return";
2468 this.next = "end";
2469 } else if (record.type === "normal" && afterLoc) {
2470 this.next = afterLoc;
2471 }
2472
2473 return ContinueSentinel;
2474 },
2475
2476 finish: function(finallyLoc) {
2477 for (var i = this.tryEntries.length - 1; i >= 0; --i) {
2478 var entry = this.tryEntries[i];
2479 if (entry.finallyLoc === finallyLoc) {
2480 this.complete(entry.completion, entry.afterLoc);
2481 resetTryEntry(entry);
2482 return ContinueSentinel;
2483 }
2484 }
2485 },
2486
2487 "catch": function(tryLoc) {
2488 for (var i = this.tryEntries.length - 1; i >= 0; --i) {
2489 var entry = this.tryEntries[i];
2490 if (entry.tryLoc === tryLoc) {
2491 var record = entry.completion;
2492 if (record.type === "throw") {
2493 var thrown = record.arg;
2494 resetTryEntry(entry);
2495 }
2496 return thrown;
2497 }
2498 }
2499
2500 // The context.catch method must only be called with a location
2501 // argument that corresponds to a known catch block.
2502 throw new Error("illegal catch attempt");
2503 },
2504
2505 delegateYield: function(iterable, resultName, nextLoc) {
2506 this.delegate = {
2507 iterator: values(iterable),
2508 resultName: resultName,
2509 nextLoc: nextLoc
2510 };
2511
2512 if (this.method === "next") {
2513 // Deliberately forget the last sent value so that we don't
2514 // accidentally pass it on to the delegate.
2515 this.arg = undefined;
2516 }
2517
2518 return ContinueSentinel;
2519 }
2520 };
2521})(
2522 // In sloppy mode, unbound `this` refers to the global object, fallback to
2523 // Function constructor if we're in global strict mode. That is sadly a form
2524 // of indirect eval which violates Content Security Policy.
2525 (function() { return this })() || Function("return this")()
2526);
2527});
2528
2529// true -> String#at
2530// false -> String#codePointAt
2531var _stringAt = function (TO_STRING) {
2532 return function (that, pos) {
2533 var s = String(defined(that));
2534 var i = toInteger(pos);
2535 var l = s.length;
2536 var a, b;
2537 if (i < 0 || i >= l) return TO_STRING ? '' : undefined;
2538 a = s.charCodeAt(i);
2539 return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
2540 ? TO_STRING ? s.charAt(i) : a
2541 : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
2542 };
2543};
2544
2545var _stringAt$1 = /*#__PURE__*/Object.freeze({
2546 default: _stringAt,
2547 __moduleExports: _stringAt
2548});
2549
2550var require$$0$a = ( _stringAt$1 && _stringAt ) || _stringAt$1;
2551
2552var $at = require$$0$a(true);
2553
2554// 21.1.3.27 String.prototype[@@iterator]()
2555$iterDefine(String, 'String', function (iterated) {
2556 this._t = String(iterated); // target
2557 this._i = 0; // next index
2558// 21.1.5.2.1 %StringIteratorPrototype%.next()
2559}, function () {
2560 var O = this._t;
2561 var index = this._i;
2562 var point;
2563 if (index >= O.length) return { value: undefined, done: true };
2564 point = $at(O, index);
2565 this._i += point.length;
2566 return { value: point, done: false };
2567});
2568
2569var _redefineAll = function (target, src, safe) {
2570 for (var key in src) redefine(target, key, src[key], safe);
2571 return target;
2572};
2573
2574var _redefineAll$1 = /*#__PURE__*/Object.freeze({
2575 default: _redefineAll,
2576 __moduleExports: _redefineAll
2577});
2578
2579var _anInstance = function (it, Constructor, name, forbiddenField) {
2580 if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) {
2581 throw TypeError(name + ': incorrect invocation!');
2582 } return it;
2583};
2584
2585var _anInstance$1 = /*#__PURE__*/Object.freeze({
2586 default: _anInstance,
2587 __moduleExports: _anInstance
2588});
2589
2590// call something on iterator step with safe closing on error
2591
2592var _iterCall = function (iterator, fn, value, entries) {
2593 try {
2594 return entries ? fn(anObject(value)[0], value[1]) : fn(value);
2595 // 7.4.6 IteratorClose(iterator, completion)
2596 } catch (e) {
2597 var ret = iterator['return'];
2598 if (ret !== undefined) anObject(ret.call(iterator));
2599 throw e;
2600 }
2601};
2602
2603var _iterCall$1 = /*#__PURE__*/Object.freeze({
2604 default: _iterCall,
2605 __moduleExports: _iterCall
2606});
2607
2608// check on default Array iterator
2609
2610var ITERATOR$2 = require$$0$7('iterator');
2611var ArrayProto$1 = Array.prototype;
2612
2613var _isArrayIter = function (it) {
2614 return it !== undefined && (Iterators.Array === it || ArrayProto$1[ITERATOR$2] === it);
2615};
2616
2617var _isArrayIter$1 = /*#__PURE__*/Object.freeze({
2618 default: _isArrayIter,
2619 __moduleExports: _isArrayIter
2620});
2621
2622// getting tag from 19.1.3.6 Object.prototype.toString()
2623
2624var TAG$1 = require$$0$7('toStringTag');
2625// ES3 wrong here
2626var ARG = cof(function () { return arguments; }()) == 'Arguments';
2627
2628// fallback for IE11 Script Access Denied error
2629var tryGet = function (it, key) {
2630 try {
2631 return it[key];
2632 } catch (e) { /* empty */ }
2633};
2634
2635var _classof = function (it) {
2636 var O, T, B;
2637 return it === undefined ? 'Undefined' : it === null ? 'Null'
2638 // @@toStringTag case
2639 : typeof (T = tryGet(O = Object(it), TAG$1)) == 'string' ? T
2640 // builtinTag case
2641 : ARG ? cof(O)
2642 // ES3 arguments fallback
2643 : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
2644};
2645
2646var _classof$1 = /*#__PURE__*/Object.freeze({
2647 default: _classof,
2648 __moduleExports: _classof
2649});
2650
2651var classof = ( _classof$1 && _classof ) || _classof$1;
2652
2653var ITERATOR$3 = require$$0$7('iterator');
2654
2655var core_getIteratorMethod = require$$1$1.getIteratorMethod = function (it) {
2656 if (it != undefined) return it[ITERATOR$3]
2657 || it['@@iterator']
2658 || Iterators[classof(it)];
2659};
2660
2661var core_getIteratorMethod$1 = /*#__PURE__*/Object.freeze({
2662 default: core_getIteratorMethod,
2663 __moduleExports: core_getIteratorMethod
2664});
2665
2666var call = ( _iterCall$1 && _iterCall ) || _iterCall$1;
2667
2668var isArrayIter = ( _isArrayIter$1 && _isArrayIter ) || _isArrayIter$1;
2669
2670var getIterFn = ( core_getIteratorMethod$1 && core_getIteratorMethod ) || core_getIteratorMethod$1;
2671
2672var _forOf = createCommonjsModule(function (module) {
2673var BREAK = {};
2674var RETURN = {};
2675var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {
2676 var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable);
2677 var f = require$$0$1(fn, that, entries ? 2 : 1);
2678 var index = 0;
2679 var length, step, iterator, result;
2680 if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');
2681 // fast case for arrays with default iterator
2682 if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) {
2683 result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);
2684 if (result === BREAK || result === RETURN) return result;
2685 } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) {
2686 result = call(iterator, f, step.value, entries);
2687 if (result === BREAK || result === RETURN) return result;
2688 }
2689};
2690exports.BREAK = BREAK;
2691exports.RETURN = RETURN;
2692});
2693
2694var _forOf$1 = /*#__PURE__*/Object.freeze({
2695 default: _forOf,
2696 __moduleExports: _forOf
2697});
2698
2699var SPECIES$1 = require$$0$7('species');
2700
2701var _setSpecies = function (KEY) {
2702 var C = global$1[KEY];
2703 if (DESCRIPTORS && C && !C[SPECIES$1]) dP$1.f(C, SPECIES$1, {
2704 configurable: true,
2705 get: function () { return this; }
2706 });
2707};
2708
2709var _setSpecies$1 = /*#__PURE__*/Object.freeze({
2710 default: _setSpecies,
2711 __moduleExports: _setSpecies
2712});
2713
2714var _validateCollection = function (it, TYPE) {
2715 if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!');
2716 return it;
2717};
2718
2719var _validateCollection$1 = /*#__PURE__*/Object.freeze({
2720 default: _validateCollection,
2721 __moduleExports: _validateCollection
2722});
2723
2724var redefineAll = ( _redefineAll$1 && _redefineAll ) || _redefineAll$1;
2725
2726var anInstance = ( _anInstance$1 && _anInstance ) || _anInstance$1;
2727
2728var forOf = ( _forOf$1 && _forOf ) || _forOf$1;
2729
2730var setSpecies = ( _setSpecies$1 && _setSpecies ) || _setSpecies$1;
2731
2732var validate = ( _validateCollection$1 && _validateCollection ) || _validateCollection$1;
2733
2734var dP$3 = dP$1.f;
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744var fastKey = meta.fastKey;
2745
2746var SIZE = DESCRIPTORS ? '_s' : 'size';
2747
2748var getEntry = function (that, key) {
2749 // fast case
2750 var index = fastKey(key);
2751 var entry;
2752 if (index !== 'F') return that._i[index];
2753 // frozen object case
2754 for (entry = that._f; entry; entry = entry.n) {
2755 if (entry.k == key) return entry;
2756 }
2757};
2758
2759var _collectionStrong = {
2760 getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {
2761 var C = wrapper(function (that, iterable) {
2762 anInstance(that, C, NAME, '_i');
2763 that._t = NAME; // collection type
2764 that._i = create(null); // index
2765 that._f = undefined; // first entry
2766 that._l = undefined; // last entry
2767 that[SIZE] = 0; // size
2768 if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);
2769 });
2770 redefineAll(C.prototype, {
2771 // 23.1.3.1 Map.prototype.clear()
2772 // 23.2.3.2 Set.prototype.clear()
2773 clear: function clear() {
2774 for (var that = validate(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) {
2775 entry.r = true;
2776 if (entry.p) entry.p = entry.p.n = undefined;
2777 delete data[entry.i];
2778 }
2779 that._f = that._l = undefined;
2780 that[SIZE] = 0;
2781 },
2782 // 23.1.3.3 Map.prototype.delete(key)
2783 // 23.2.3.4 Set.prototype.delete(value)
2784 'delete': function (key) {
2785 var that = validate(this, NAME);
2786 var entry = getEntry(that, key);
2787 if (entry) {
2788 var next = entry.n;
2789 var prev = entry.p;
2790 delete that._i[entry.i];
2791 entry.r = true;
2792 if (prev) prev.n = next;
2793 if (next) next.p = prev;
2794 if (that._f == entry) that._f = next;
2795 if (that._l == entry) that._l = prev;
2796 that[SIZE]--;
2797 } return !!entry;
2798 },
2799 // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)
2800 // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)
2801 forEach: function forEach(callbackfn /* , that = undefined */) {
2802 validate(this, NAME);
2803 var f = require$$0$1(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);
2804 var entry;
2805 while (entry = entry ? entry.n : this._f) {
2806 f(entry.v, entry.k, this);
2807 // revert to the last existing entry
2808 while (entry && entry.r) entry = entry.p;
2809 }
2810 },
2811 // 23.1.3.7 Map.prototype.has(key)
2812 // 23.2.3.7 Set.prototype.has(value)
2813 has: function has(key) {
2814 return !!getEntry(validate(this, NAME), key);
2815 }
2816 });
2817 if (DESCRIPTORS) dP$3(C.prototype, 'size', {
2818 get: function () {
2819 return validate(this, NAME)[SIZE];
2820 }
2821 });
2822 return C;
2823 },
2824 def: function (that, key, value) {
2825 var entry = getEntry(that, key);
2826 var prev, index;
2827 // change existing entry
2828 if (entry) {
2829 entry.v = value;
2830 // create new entry
2831 } else {
2832 that._l = entry = {
2833 i: index = fastKey(key, true), // <- index
2834 k: key, // <- key
2835 v: value, // <- value
2836 p: prev = that._l, // <- previous entry
2837 n: undefined, // <- next entry
2838 r: false // <- removed
2839 };
2840 if (!that._f) that._f = entry;
2841 if (prev) prev.n = entry;
2842 that[SIZE]++;
2843 // add to index
2844 if (index !== 'F') that._i[index] = entry;
2845 } return that;
2846 },
2847 getEntry: getEntry,
2848 setStrong: function (C, NAME, IS_MAP) {
2849 // add .keys, .values, .entries, [@@iterator]
2850 // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11
2851 $iterDefine(C, NAME, function (iterated, kind) {
2852 this._t = validate(iterated, NAME); // target
2853 this._k = kind; // kind
2854 this._l = undefined; // previous
2855 }, function () {
2856 var that = this;
2857 var kind = that._k;
2858 var entry = that._l;
2859 // revert to the last existing entry
2860 while (entry && entry.r) entry = entry.p;
2861 // get next entry
2862 if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) {
2863 // or finish the iteration
2864 that._t = undefined;
2865 return step(1);
2866 }
2867 // return step by kind
2868 if (kind == 'keys') return step(0, entry.k);
2869 if (kind == 'values') return step(0, entry.v);
2870 return step(0, [entry.k, entry.v]);
2871 }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);
2872
2873 // add [@@species], 23.1.2.2, 23.2.2.2
2874 setSpecies(NAME);
2875 }
2876};
2877var _collectionStrong_1 = _collectionStrong.getConstructor;
2878var _collectionStrong_2 = _collectionStrong.def;
2879var _collectionStrong_3 = _collectionStrong.getEntry;
2880var _collectionStrong_4 = _collectionStrong.setStrong;
2881
2882var _collectionStrong$1 = /*#__PURE__*/Object.freeze({
2883 default: _collectionStrong,
2884 __moduleExports: _collectionStrong,
2885 getConstructor: _collectionStrong_1,
2886 def: _collectionStrong_2,
2887 getEntry: _collectionStrong_3,
2888 setStrong: _collectionStrong_4
2889});
2890
2891var ITERATOR$4 = require$$0$7('iterator');
2892var SAFE_CLOSING = false;
2893
2894try {
2895 var riter = [7][ITERATOR$4]();
2896 riter['return'] = function () { SAFE_CLOSING = true; };
2897} catch (e) { /* empty */ }
2898
2899var _iterDetect = function (exec, skipClosing) {
2900 if (!skipClosing && !SAFE_CLOSING) return false;
2901 var safe = false;
2902 try {
2903 var arr = [7];
2904 var iter = arr[ITERATOR$4]();
2905 iter.next = function () { return { done: safe = true }; };
2906 arr[ITERATOR$4] = function () { return iter; };
2907 exec(arr);
2908 } catch (e) { /* empty */ }
2909 return safe;
2910};
2911
2912var _iterDetect$1 = /*#__PURE__*/Object.freeze({
2913 default: _iterDetect,
2914 __moduleExports: _iterDetect
2915});
2916
2917// Works with __proto__ only. Old v8 can't work with null proto objects.
2918/* eslint-disable no-proto */
2919
2920
2921var check = function (O, proto) {
2922 anObject(O);
2923 if (!isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!");
2924};
2925var _setProto = {
2926 set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line
2927 function (test, buggy, set) {
2928 try {
2929 set = require$$0$1(Function.call, require$$1$2.f(Object.prototype, '__proto__').set, 2);
2930 set(test, []);
2931 buggy = !(test instanceof Array);
2932 } catch (e) { buggy = true; }
2933 return function setPrototypeOf(O, proto) {
2934 check(O, proto);
2935 if (buggy) O.__proto__ = proto;
2936 else set(O, proto);
2937 return O;
2938 };
2939 }({}, false) : undefined),
2940 check: check
2941};
2942var _setProto_1 = _setProto.set;
2943var _setProto_2 = _setProto.check;
2944
2945var _setProto$1 = /*#__PURE__*/Object.freeze({
2946 default: _setProto,
2947 __moduleExports: _setProto,
2948 set: _setProto_1,
2949 check: _setProto_2
2950});
2951
2952var require$$0$b = ( _setProto$1 && _setProto ) || _setProto$1;
2953
2954var setPrototypeOf = require$$0$b.set;
2955var _inheritIfRequired = function (that, target, C) {
2956 var S = target.constructor;
2957 var P;
2958 if (S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf) {
2959 setPrototypeOf(that, P);
2960 } return that;
2961};
2962
2963var _inheritIfRequired$1 = /*#__PURE__*/Object.freeze({
2964 default: _inheritIfRequired,
2965 __moduleExports: _inheritIfRequired
2966});
2967
2968var $iterDetect = ( _iterDetect$1 && _iterDetect ) || _iterDetect$1;
2969
2970var inheritIfRequired = ( _inheritIfRequired$1 && _inheritIfRequired ) || _inheritIfRequired$1;
2971
2972var _collection = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) {
2973 var Base = global$1[NAME];
2974 var C = Base;
2975 var ADDER = IS_MAP ? 'set' : 'add';
2976 var proto = C && C.prototype;
2977 var O = {};
2978 var fixMethod = function (KEY) {
2979 var fn = proto[KEY];
2980 redefine(proto, KEY,
2981 KEY == 'delete' ? function (a) {
2982 return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);
2983 } : KEY == 'has' ? function has(a) {
2984 return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);
2985 } : KEY == 'get' ? function get(a) {
2986 return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a);
2987 } : KEY == 'add' ? function add(a) { fn.call(this, a === 0 ? 0 : a); return this; }
2988 : function set(a, b) { fn.call(this, a === 0 ? 0 : a, b); return this; }
2989 );
2990 };
2991 if (typeof C != 'function' || !(IS_WEAK || proto.forEach && !require$$1(function () {
2992 new C().entries().next();
2993 }))) {
2994 // create collection constructor
2995 C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER);
2996 redefineAll(C.prototype, methods);
2997 meta.NEED = true;
2998 } else {
2999 var instance = new C();
3000 // early implementations not supports chaining
3001 var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance;
3002 // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false
3003 var THROWS_ON_PRIMITIVES = require$$1(function () { instance.has(1); });
3004 // most early implementations doesn't supports iterables, most modern - not close it correctly
3005 var ACCEPT_ITERABLES = $iterDetect(function (iter) { new C(iter); }); // eslint-disable-line no-new
3006 // for early implementations -0 and +0 not the same
3007 var BUGGY_ZERO = !IS_WEAK && require$$1(function () {
3008 // V8 ~ Chromium 42- fails only with 5+ elements
3009 var $instance = new C();
3010 var index = 5;
3011 while (index--) $instance[ADDER](index, index);
3012 return !$instance.has(-0);
3013 });
3014 if (!ACCEPT_ITERABLES) {
3015 C = wrapper(function (target, iterable) {
3016 anInstance(target, C, NAME);
3017 var that = inheritIfRequired(new Base(), target, C);
3018 if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);
3019 return that;
3020 });
3021 C.prototype = proto;
3022 proto.constructor = C;
3023 }
3024 if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) {
3025 fixMethod('delete');
3026 fixMethod('has');
3027 IS_MAP && fixMethod('get');
3028 }
3029 if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER);
3030 // weak collections should not contains .clear method
3031 if (IS_WEAK && proto.clear) delete proto.clear;
3032 }
3033
3034 setToStringTag(C, NAME);
3035
3036 O[NAME] = C;
3037 $export$1($export$1.G + $export$1.W + $export$1.F * (C != Base), O);
3038
3039 if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP);
3040
3041 return C;
3042};
3043
3044var _collection$1 = /*#__PURE__*/Object.freeze({
3045 default: _collection,
3046 __moduleExports: _collection
3047});
3048
3049var strong = ( _collectionStrong$1 && _collectionStrong ) || _collectionStrong$1;
3050
3051var require$$0$c = ( _collection$1 && _collection ) || _collection$1;
3052
3053var SET = 'Set';
3054
3055// 23.2 Set Objects
3056var es6_set = require$$0$c(SET, function (get) {
3057 return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };
3058}, {
3059 // 23.2.3.1 Set.prototype.add(value)
3060 add: function add(value) {
3061 return strong.def(validate(this, SET), value = value === 0 ? 0 : value, value);
3062 }
3063}, strong);
3064
3065var $some = require$$0$9(3);
3066
3067$export$1($export$1.P + $export$1.F * !require$$1$4([].some, true), 'Array', {
3068 // 22.1.3.23 / 15.4.4.17 Array.prototype.some(callbackfn [, thisArg])
3069 some: function some(callbackfn /* , thisArg */) {
3070 return $some(this, callbackfn, arguments[1]);
3071 }
3072});
3073
3074var $sort = [].sort;
3075var test = [1, 2, 3];
3076
3077$export$1($export$1.P + $export$1.F * (require$$1(function () {
3078 // IE8-
3079 test.sort(undefined);
3080}) || !require$$1(function () {
3081 // V8 bug
3082 test.sort(null);
3083 // Old WebKit
3084}) || !require$$1$4($sort)), 'Array', {
3085 // 22.1.3.25 Array.prototype.sort(comparefn)
3086 sort: function sort(comparefn) {
3087 return comparefn === undefined
3088 ? $sort.call(toObject(this))
3089 : $sort.call(toObject(this), aFunction(comparefn));
3090 }
3091});
3092
3093var $filter = require$$0$9(2);
3094
3095$export$1($export$1.P + $export$1.F * !require$$1$4([].filter, true), 'Array', {
3096 // 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg])
3097 filter: function filter(callbackfn /* , thisArg */) {
3098 return $filter(this, callbackfn, arguments[1]);
3099 }
3100});
3101
3102var $indexOf = require$$0$3(false);
3103var $native = [].indexOf;
3104var NEGATIVE_ZERO = !!$native && 1 / [1].indexOf(1, -0) < 0;
3105
3106$export$1($export$1.P + $export$1.F * (NEGATIVE_ZERO || !require$$1$4($native)), 'Array', {
3107 // 22.1.3.11 / 15.4.4.14 Array.prototype.indexOf(searchElement [, fromIndex])
3108 indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
3109 return NEGATIVE_ZERO
3110 // convert -0 to +0
3111 ? $native.apply(this, arguments) || 0
3112 : $indexOf(this, searchElement, arguments[1]);
3113 }
3114});
3115
3116// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined)
3117
3118var $find = require$$0$9(5);
3119var KEY = 'find';
3120var forced = true;
3121// Shouldn't skip holes
3122if (KEY in []) Array(1)[KEY](function () { forced = false; });
3123$export$1($export$1.P + $export$1.F * forced, 'Array', {
3124 find: function find(callbackfn /* , that = undefined */) {
3125 return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
3126 }
3127});
3128require$$1$3(KEY);
3129
3130var dP$4 = dP$1.f;
3131var FProto = Function.prototype;
3132var nameRE = /^\s*function ([^ (]*)/;
3133var NAME$1 = 'name';
3134
3135// 19.2.4.2 name
3136NAME$1 in FProto || DESCRIPTORS && dP$4(FProto, NAME$1, {
3137 configurable: true,
3138 get: function () {
3139 try {
3140 return ('' + this).match(nameRE)[1];
3141 } catch (e) {
3142 return '';
3143 }
3144 }
3145});
3146
3147var $map = require$$0$9(1);
3148
3149$export$1($export$1.P + $export$1.F * !require$$1$4([].map, true), 'Array', {
3150 // 22.1.3.15 / 15.4.4.19 Array.prototype.map(callbackfn [, thisArg])
3151 map: function map(callbackfn /* , thisArg */) {
3152 return $map(this, callbackfn, arguments[1]);
3153 }
3154});
3155
3156var GanttInvalidOp =
3157/*#__PURE__*/
3158function (_Error) {
3159 _inherits(GanttInvalidOp, _Error);
3160
3161 function GanttInvalidOp(op) {
3162 _classCallCheck(this, GanttInvalidOp);
3163
3164 return _possibleConstructorReturn(this, _getPrototypeOf(GanttInvalidOp).call(this, 'invalid operaion: ' + op));
3165 }
3166
3167 return GanttInvalidOp;
3168}(_wrapNativeSuper(Error));
3169
3170/**
3171 * Has own property.
3172 *
3173 * @type {Function}
3174 */
3175
3176var has$1 = Object.prototype.hasOwnProperty;
3177
3178/**
3179 * To string.
3180 *
3181 * @type {Function}
3182 */
3183
3184var toString$2 = Object.prototype.toString;
3185
3186/**
3187 * Test whether a value is "empty".
3188 *
3189 * @param {Mixed} val
3190 * @return {Boolean}
3191 */
3192
3193function isEmpty(val) {
3194 // Null and Undefined...
3195 if (val == null) return true
3196
3197 // Booleans...
3198 if ('boolean' == typeof val) return false
3199
3200 // Numbers...
3201 if ('number' == typeof val) return val === 0
3202
3203 // Strings...
3204 if ('string' == typeof val) return val.length === 0
3205
3206 // Functions...
3207 if ('function' == typeof val) return val.length === 0
3208
3209 // Arrays...
3210 if (Array.isArray(val)) return val.length === 0
3211
3212 // Errors...
3213 if (val instanceof Error) return val.message === ''
3214
3215 // Objects...
3216 if (val.toString == toString$2) {
3217 switch (val.toString()) {
3218
3219 // Maps, Sets, Files and Errors...
3220 case '[object File]':
3221 case '[object Map]':
3222 case '[object Set]': {
3223 return val.size === 0
3224 }
3225
3226 // Plain objects...
3227 case '[object Object]': {
3228 for (var key in val) {
3229 if (has$1.call(val, key)) return false
3230 }
3231
3232 return true
3233 }
3234 }
3235 }
3236
3237 // Anything else...
3238 return false
3239}
3240
3241/**
3242 * Export `isEmpty`.
3243 *
3244 * @type {Function}
3245 */
3246
3247var lib = isEmpty;
3248
3249/*!
3250 * is-var-name | ISC (c) Shinnosuke Watanabe
3251 * https://github.com/shinnn/is-var-name
3252*/
3253function isVarName(str) {
3254 if (typeof str !== 'string') {
3255 return false;
3256 }
3257
3258 if (str.trim() !== str) {
3259 return false;
3260 }
3261
3262 try {
3263 new Function(str, 'var ' + str);
3264 } catch (e) {
3265 return false;
3266 }
3267
3268 return true;
3269}
3270
3271var arrayStartsWith_1 = createCommonjsModule(function (module, exports) {
3272
3273Object.defineProperty(exports, "__esModule", {
3274 value: true
3275});
3276function arrayStartsWith(base, start) {
3277 for (let i = 0; i < start.length; i++) {
3278 if (base[i] !== start[i]) {
3279 return false;
3280 }
3281 }
3282
3283 return true;
3284}
3285
3286exports.default = arrayStartsWith;
3287});
3288
3289var arrayStartsWith = unwrapExports(arrayStartsWith_1);
3290
3291var arrayStartsWith$1 = /*#__PURE__*/Object.freeze({
3292 default: arrayStartsWith,
3293 __moduleExports: arrayStartsWith_1
3294});
3295
3296var _arrayStartsWith = ( arrayStartsWith$1 && arrayStartsWith ) || arrayStartsWith$1;
3297
3298var build = createCommonjsModule(function (module, exports) {
3299
3300Object.defineProperty(exports, "__esModule", {
3301 value: true
3302});
3303
3304
3305
3306var _arrayStartsWith2 = _interopRequireDefault(_arrayStartsWith);
3307
3308function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3309
3310exports.default = _arrayStartsWith2.default;
3311});
3312
3313var arrayStartsWith$2 = unwrapExports(build);
3314
3315function taskError(taskName, tpl) {
3316 if (taskName instanceof Task) {
3317 taskName = taskName.canonicalName;
3318 }
3319
3320 taskName = '[' + [].concat(taskName).map(function (it) {
3321 return "'".concat(it, "'");
3322 }).join(', ') + ']';
3323 return new Error(tpl(taskName));
3324}
3325
3326var Task =
3327/*#__PURE__*/
3328function () {
3329 function Task(name, parent) {
3330 _classCallCheck(this, Task);
3331
3332 name && this.name(name);
3333 this._parent = parent;
3334 this._onStartCbs = [];
3335 this._onFinishCbs = [];
3336 this._subTasks = [];
3337 this._dependsUpon = [];
3338 this._level = parent ? parent.level + 1 : 0;
3339 this._base = 0;
3340 this.$ = this.find;
3341 this.duration = this.expectedTimeSpan;
3342 }
3343
3344 _createClass(Task, [{
3345 key: "base",
3346 value: function base(arg) {
3347 if (arg === void 0) {
3348 return this._base;
3349 }
3350
3351 this._base = new Date(arg).getTime();
3352 return this;
3353 }
3354 }, {
3355 key: "name",
3356 value: function name(arg) {
3357 if (arg === void 0) {
3358 return this._name;
3359 }
3360
3361 if (!isVarName(arg)) {
3362 throw new Error('invalid task name ' + arg + ', should use a valid javascript identifier name');
3363 }
3364
3365 this._name = arg;
3366 return this;
3367 }
3368 }, {
3369 key: "bundle",
3370 value: function bundle(arg) {
3371 if (arg === void 0) {
3372 return this._bundle;
3373 }
3374
3375 this._bundle = arg;
3376 return this;
3377 }
3378 }, {
3379 key: "label",
3380 value: function label(labelArg) {
3381 if (labelArg === void 0) {
3382 return this._label || this._name;
3383 }
3384
3385 this._label = labelArg;
3386 return this;
3387 }
3388 }, {
3389 key: "addSubTask",
3390 value: function addSubTask(arg) {
3391 var task;
3392
3393 if (arg instanceof Task) {
3394 task = arg;
3395 } else {
3396 if (typeof arg === 'function') {
3397 task = new Task('', this);
3398 } else if (typeof arg === 'string') {
3399 task = new Task(arg, this);
3400 } else {
3401 throw new Error('task must be a function or string');
3402 }
3403 }
3404
3405 if (this._subTasks.hasOwnProperty(task.name())) {
3406 throw new Error('task ' + task.name() + ' already exists');
3407 }
3408
3409 this._subTasks.push(task); // add at first, then apply function, otherwise sub task can't depends upon
3410 // some tasks
3411
3412
3413 if (typeof arg === 'function') {
3414 arg(task);
3415 }
3416
3417 return this;
3418 }
3419 }, {
3420 key: "find",
3421 value: function find(taskName, updateFunc) {
3422 return this._findIter(taskName, updateFunc, this);
3423 }
3424 }, {
3425 key: "_findIter",
3426 value: function _findIter(taskName, updateFunc, root) {
3427 var taskNames = [].concat(taskName);
3428
3429 if (taskNames.length === 0) {
3430 if (typeof updateFunc === 'function') {
3431 updateFunc.apply(root, [this]);
3432 }
3433
3434 return this;
3435 }
3436
3437 var idx = this._subTasks.map(function (it) {
3438 return it._name;
3439 }).indexOf(taskNames[0]);
3440
3441 if (idx === -1) {
3442 return null;
3443 }
3444
3445 return this._subTasks[idx].find(taskNames.slice(1), updateFunc, root);
3446 }
3447 }, {
3448 key: "moveSubTask",
3449 value: function moveSubTask(taskName, before) {
3450 var subTaskNames = this._subTasks.map(function (it) {
3451 return it.name();
3452 });
3453
3454 var fromIdx = subTaskNames.indexOf(taskName);
3455
3456 if (fromIdx === -1) {
3457 throw taskError(taskName, function (n) {
3458 return "no such task: ".concat(n);
3459 });
3460 }
3461
3462 var toIdx = before ? subTaskNames.indexOf(before) : subTaskNames.length - 1;
3463
3464 if (toIdx === -1) {
3465 throw taskError(taskName, function (n) {
3466 return "no such task: ".concat(n);
3467 });
3468 }
3469
3470 var subTask = this._subTasks.splice(fromIdx, 1)[0];
3471
3472 this._subTasks.splice(toIdx, 0, subTask);
3473
3474 return this;
3475 }
3476 }, {
3477 key: "removeSubTask",
3478 value: function removeSubTask(taskName) {
3479 var subTasks = this._subTasks.filter(function (it) {
3480 return it.name() !== taskName;
3481 });
3482
3483 if (subTasks.length === this._subTasks.length) {
3484 throw new Error('no such task: ' + taskName);
3485 }
3486
3487 this._subTasks = subTasks;
3488 return this;
3489 }
3490 }, {
3491 key: "isMyAncestor",
3492 value: function isMyAncestor(task) {
3493 if (task instanceof Task) {
3494 task = task.canonicalName;
3495 }
3496
3497 var myCanonicalName = this.canonicalName;
3498
3499 for (var i = 0; i < task.length; ++i) {
3500 if (task[i] !== myCanonicalName[i]) {
3501 return false;
3502 }
3503 }
3504
3505 return true;
3506 }
3507 }, {
3508 key: "getDependsUpon",
3509 value: function getDependsUpon() {
3510 if (!this._parent) {
3511 return [];
3512 }
3513
3514 var dependsUpon = this._parent.getDependsUpon().concat(this._dependsUpon) // see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort
3515 // array of array could be sorted
3516 .map(function (it) {
3517 return it.canonicalName;
3518 }).sort();
3519
3520 if (!dependsUpon.length) {
3521 return [];
3522 }
3523
3524 var pivot = dependsUpon[0];
3525 var ret = [pivot];
3526 var i = 0;
3527
3528 while (i < dependsUpon.length) {
3529 if (!arrayStartsWith$2(dependsUpon[i], pivot)) {
3530 pivot = dependsUpon[i];
3531 ret.push(pivot);
3532 }
3533
3534 ++i;
3535 }
3536
3537 var root = this.root;
3538 return ret.map(function (it) {
3539 return root.$(it);
3540 });
3541 }
3542 }, {
3543 key: "doesDependUpon",
3544 value: function doesDependUpon(task) {
3545 if (task instanceof Task) {
3546 task = task.canonicalName;
3547 }
3548
3549 return this.getDependsUpon().some(function (it) {
3550 return arrayStartsWith$2(task, it.canonicalName);
3551 });
3552 }
3553 /**
3554 * 设定依赖关系,并可能根据依赖关系调整expectedToStartAt
3555 * */
3556
3557 }, {
3558 key: "dependsUpon",
3559 value: function dependsUpon() {
3560 for (var _len = arguments.length, canonicalNames = new Array(_len), _key = 0; _key < _len; _key++) {
3561 canonicalNames[_key] = arguments[_key];
3562 }
3563
3564 if (canonicalNames.length === 0) {
3565 return this.getDependsUpon();
3566 }
3567
3568 canonicalNames = canonicalNames.map(function (it) {
3569 return it instanceof Task ? it.canonicalName : it;
3570 });
3571 var dependsUpon = [];
3572 var root = this.root;
3573 var _iteratorNormalCompletion = true;
3574 var _didIteratorError = false;
3575 var _iteratorError = undefined;
3576
3577 try {
3578 for (var _iterator = canonicalNames[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
3579 var n = _step.value;
3580 var task = root.$(n);
3581
3582 if (!task) {
3583 throw taskError(n, function (n) {
3584 return "no such task: ".concat(n);
3585 });
3586 }
3587
3588 if (this === task) {
3589 throw taskError(n, function (n) {
3590 return "can not depends upon self: ".concat(n);
3591 });
3592 }
3593
3594 if (this.isMyAncestor(task)) {
3595 throw taskError(n, function (n) {
3596 return "can not depends upon ancestor: ".concat(n);
3597 });
3598 }
3599
3600 if (this.doesDependUpon(task)) {
3601 throw taskError(n, function (n) {
3602 return "already depends upon task ".concat(n);
3603 });
3604 }
3605
3606 if (task.doesDependUpon(this)) {
3607 throw taskError(n, function (n) {
3608 return "depends upon a task ".concat(n, " which depends on myself (cylic dependent)");
3609 });
3610 }
3611
3612 dependsUpon.push(task);
3613 }
3614 } catch (err) {
3615 _didIteratorError = true;
3616 _iteratorError = err;
3617 } finally {
3618 try {
3619 if (!_iteratorNormalCompletion && _iterator.return != null) {
3620 _iterator.return();
3621 }
3622 } finally {
3623 if (_didIteratorError) {
3624 throw _iteratorError;
3625 }
3626 }
3627 }
3628
3629 this._dependsUpon = this._dependsUpon.concat(dependsUpon);
3630 return this;
3631 }
3632 }, {
3633 key: "removeDependsUpon",
3634 value: function removeDependsUpon() {
3635 for (var _len2 = arguments.length, canonicalNames = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
3636 canonicalNames[_key2] = arguments[_key2];
3637 }
3638
3639 canonicalNames = new Set(canonicalNames.map(function (it) {
3640 return it instanceof Task ? it.canonicalName : it;
3641 }).map(function (it) {
3642 return it.join('.');
3643 }));
3644 this._dependsUpon = this._dependsUpon.filter(function (it) {
3645 return !canonicalNames.has(it.canonicalName.join('.'));
3646 });
3647 return this;
3648 }
3649 /**
3650 * when this task is expected to start at.
3651 * it will equal to startAt when it is started
3652 * */
3653
3654 }, {
3655 key: "start",
3656 value: function start(args) {
3657 return this.startAt(new Date(), args);
3658 }
3659 }, {
3660 key: "startAt",
3661 value: function startAt(t) {
3662 if (this.isLeaf) {
3663 if (t === void 0) {
3664 return this._startAt;
3665 }
3666
3667 if (!(typeof t === 'string' || typeof t === 'number' || t instanceof Date)) {
3668 throw Error(t + ' should be string or number');
3669 }
3670
3671 this._startAt = new Date(t).getTime();
3672 } else {
3673 if (t === void 0) {
3674 var startedTasks = this._subTasks.filter(function (it) {
3675 return it.startAt() !== void 0;
3676 });
3677
3678 if (!startedTasks.length) {
3679 return;
3680 }
3681
3682 return Math.min.apply(null, startedTasks.map(function (it) {
3683 return it.startAt();
3684 }));
3685 }
3686
3687 throw Error('non-leaf task can not set start at');
3688 }
3689
3690 return this;
3691 }
3692 }, {
3693 key: "startArg",
3694 value: function startArg(arg) {
3695 if (arg === void 0) {
3696 return this._startArg;
3697 }
3698
3699 this._startArg = typeof arg === 'string' ? timestring(arg, 'ms') : arg;
3700 return this;
3701 }
3702 }, {
3703 key: "expectedTimeSpan",
3704 value: function expectedTimeSpan(arg) {
3705 if (this.isLeaf) {
3706 if (arg === void 0) {
3707 if (this.finishAt()) {
3708 if (this.startAt()) {
3709 return this.finishAt() - this.startAt();
3710 }
3711
3712 return 0;
3713 }
3714
3715 return this._expectedTimeSpan || 0;
3716 }
3717
3718 this._expectedTimeSpan = typeof arg === 'string' ? timestring(arg, 'ms') : arg;
3719 } else {
3720 if (arg === void 0) {
3721 return this.expectedToFinishAt - this.expectedToStartAt;
3722 }
3723
3724 throw new Error('non-leaf task can not set expected time span');
3725 }
3726
3727 return this;
3728 }
3729 }, {
3730 key: "finish",
3731 value: function finish(args) {
3732 return this.finishAt(new Date(), args);
3733 }
3734 }, {
3735 key: "finishAt",
3736 value: function finishAt(t) {
3737 if (this.isLeaf) {
3738 if (t === void 0) {
3739 return this._finishAt;
3740 }
3741
3742 if (!(typeof t === 'string' || typeof t === 'number' || t instanceof Date)) {
3743 throw Error(t + ' should be string or number');
3744 }
3745
3746 this._finishAt = new Date(t).getTime();
3747 } else {
3748 if (t === void 0) {
3749 var finishedTasks = this._subTasks.filter(function (it) {
3750 return it.finishAt() !== void 0;
3751 });
3752
3753 if (!finishedTasks.length) {
3754 return;
3755 }
3756
3757 return Math.max.apply(null, finishedTasks.map(function (it) {
3758 return it.finishAt();
3759 }));
3760 }
3761
3762 throw Error('non-leaf task can not set finish at');
3763 }
3764
3765 return this;
3766 }
3767 }, {
3768 key: "description",
3769 value: function description(arg) {
3770 if (arg === void 0) {
3771 return this._description;
3772 }
3773
3774 this._description = arg;
3775 return this;
3776 }
3777 }, {
3778 key: "finishArg",
3779 value: function finishArg(arg) {
3780 if (arg === void 0) {
3781 return this._finishArg;
3782 }
3783
3784 this._finishArg = arg;
3785 return this;
3786 }
3787 }, {
3788 key: "opsFilter",
3789 value: function opsFilter(arg) {
3790 this._opsFilter = arg;
3791 return this;
3792 }
3793 }, {
3794 key: "perform",
3795 value: function () {
3796 var _perform = _asyncToGenerator(
3797 /*#__PURE__*/
3798 regeneratorRuntime.mark(function _callee(action, arg) {
3799 var _Task$OP_START$Task$O;
3800
3801 var _iteratorNormalCompletion2, _didIteratorError2, _iteratorError2, _iterator2, _step2, cb, _iteratorNormalCompletion3, _didIteratorError3, _iteratorError3, _iterator3, _step3, _cb;
3802
3803 return regeneratorRuntime.wrap(function _callee$(_context) {
3804 while (1) {
3805 switch (_context.prev = _context.next) {
3806 case 0:
3807 if (this.isLeaf) {
3808 _context.next = 2;
3809 break;
3810 }
3811
3812 throw new Error('you can\'t perform operation upon non-leaf task');
3813
3814 case 2:
3815 if (!(this.ops.indexOf(action) === -1)) {
3816 _context.next = 4;
3817 break;
3818 }
3819
3820 throw new GanttInvalidOp(action);
3821
3822 case 4:
3823 action = (_Task$OP_START$Task$O = {}, _defineProperty(_Task$OP_START$Task$O, Task.OP_START, 'start'), _defineProperty(_Task$OP_START$Task$O, Task.OP_FINISH, 'finish'), _Task$OP_START$Task$O)[action];
3824 this[action](arg);
3825
3826 if (!(action === 'start')) {
3827 _context.next = 35;
3828 break;
3829 }
3830
3831 _iteratorNormalCompletion2 = true;
3832 _didIteratorError2 = false;
3833 _iteratorError2 = undefined;
3834 _context.prev = 10;
3835 _iterator2 = this._onStartCbs[Symbol.iterator]();
3836
3837 case 12:
3838 if (_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done) {
3839 _context.next = 19;
3840 break;
3841 }
3842
3843 cb = _step2.value;
3844 _context.next = 16;
3845 return cb.call(this);
3846
3847 case 16:
3848 _iteratorNormalCompletion2 = true;
3849 _context.next = 12;
3850 break;
3851
3852 case 19:
3853 _context.next = 25;
3854 break;
3855
3856 case 21:
3857 _context.prev = 21;
3858 _context.t0 = _context["catch"](10);
3859 _didIteratorError2 = true;
3860 _iteratorError2 = _context.t0;
3861
3862 case 25:
3863 _context.prev = 25;
3864 _context.prev = 26;
3865
3866 if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
3867 _iterator2.return();
3868 }
3869
3870 case 28:
3871 _context.prev = 28;
3872
3873 if (!_didIteratorError2) {
3874 _context.next = 31;
3875 break;
3876 }
3877
3878 throw _iteratorError2;
3879
3880 case 31:
3881 return _context.finish(28);
3882
3883 case 32:
3884 return _context.finish(25);
3885
3886 case 33:
3887 _context.next = 62;
3888 break;
3889
3890 case 35:
3891 if (!(action === 'finish')) {
3892 _context.next = 62;
3893 break;
3894 }
3895
3896 _iteratorNormalCompletion3 = true;
3897 _didIteratorError3 = false;
3898 _iteratorError3 = undefined;
3899 _context.prev = 39;
3900 _iterator3 = this._onFinishCbs[Symbol.iterator]();
3901
3902 case 41:
3903 if (_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done) {
3904 _context.next = 48;
3905 break;
3906 }
3907
3908 _cb = _step3.value;
3909 _context.next = 45;
3910 return _cb.call(this);
3911
3912 case 45:
3913 _iteratorNormalCompletion3 = true;
3914 _context.next = 41;
3915 break;
3916
3917 case 48:
3918 _context.next = 54;
3919 break;
3920
3921 case 50:
3922 _context.prev = 50;
3923 _context.t1 = _context["catch"](39);
3924 _didIteratorError3 = true;
3925 _iteratorError3 = _context.t1;
3926
3927 case 54:
3928 _context.prev = 54;
3929 _context.prev = 55;
3930
3931 if (!_iteratorNormalCompletion3 && _iterator3.return != null) {
3932 _iterator3.return();
3933 }
3934
3935 case 57:
3936 _context.prev = 57;
3937
3938 if (!_didIteratorError3) {
3939 _context.next = 60;
3940 break;
3941 }
3942
3943 throw _iteratorError3;
3944
3945 case 60:
3946 return _context.finish(57);
3947
3948 case 61:
3949 return _context.finish(54);
3950
3951 case 62:
3952 case "end":
3953 return _context.stop();
3954 }
3955 }
3956 }, _callee, this, [[10, 21, 25, 33], [26,, 28, 32], [39, 50, 54, 62], [55,, 57, 61]]);
3957 }));
3958
3959 return function perform(_x, _x2) {
3960 return _perform.apply(this, arguments);
3961 };
3962 }()
3963 }, {
3964 key: "onStart",
3965 value: function onStart(arg) {
3966 this._onStartCbs.push(arg);
3967
3968 return this;
3969 }
3970 }, {
3971 key: "onFinish",
3972 value: function onFinish(arg) {
3973 this._onFinishCbs.push(arg);
3974
3975 return this;
3976 }
3977 }, {
3978 key: "toJSON",
3979 value: function toJSON() {
3980 return {
3981 name: this.name(),
3982 bundle: this.bundle(),
3983 parent: (this._parent || {}).canonicalName,
3984 depth: this.depth,
3985 isLeaf: this.isLeaf,
3986 canonicalName: this.canonicalName,
3987 label: this.label(),
3988 subTasks: this.subTasks.map(function (it) {
3989 return it.toJSON();
3990 }),
3991 dependsUpon: this.getDependsUpon().map(function (it) {
3992 return it.canonicalName;
3993 }),
3994 expectedToStartAt: this.expectedToStartAt,
3995 startAt: this.startAt(),
3996 startArg: this.startArg(),
3997 expectedTimeSpan: this.expectedTimeSpan(),
3998 duration: this.expectedTimeSpan(),
3999 finishAt: this.finishAt(),
4000 finishArg: this.finishArg(),
4001 expectedToFinishAt: this.expectedToFinishAt,
4002 description: this.description(),
4003 ops: this.ops,
4004 nextOp: this.nextOp,
4005 level: this.level
4006 };
4007 }
4008 }, {
4009 key: "fromJSON",
4010 value: function fromJSON(arg) {
4011 var _this = this;
4012
4013 var _arr = ['name', 'label', 'startAt', 'startArg', 'expectedTimeSpan', 'finishAt', 'finishArg', 'description', 'bundle'];
4014
4015 for (var _i = 0; _i < _arr.length; _i++) {
4016 var k = _arr[_i];
4017 arg[k] !== void 0 && this[k](arg[k]);
4018 }
4019
4020 arg.subTasks && arg.subTasks.length && arg.subTasks.forEach(function (it) {
4021 return _this.addSubTask(function (task) {
4022 return task.fromJSON(it);
4023 });
4024 });
4025 arg.dependsUpon && arg.dependsUpon.length && this.dependsUpon.apply(this, _toConsumableArray(arg.dependsUpon));
4026 return this;
4027 }
4028 }, {
4029 key: "level",
4030 get: function get() {
4031 return this._level;
4032 }
4033 }, {
4034 key: "isLeaf",
4035 get: function get() {
4036 return lib(this._subTasks);
4037 }
4038 }, {
4039 key: "root",
4040 get: function get() {
4041 return this._parent ? this._parent.root : this;
4042 }
4043 }, {
4044 key: "canonicalName",
4045 get: function get() {
4046 return (this._parent ? this._parent.canonicalName : []).concat(this._name);
4047 }
4048 }, {
4049 key: "subTasks",
4050 get: function get() {
4051 return this._subTasks;
4052 }
4053 }, {
4054 key: "expectedToStartAt",
4055 get: function get() {
4056 if (this.isLeaf) {
4057 var startAt = this.startAt();
4058
4059 if (startAt) {
4060 return startAt;
4061 }
4062
4063 var dependsUpon = this.getDependsUpon();
4064
4065 if (lib(dependsUpon)) {
4066 return this.root.base();
4067 }
4068
4069 return Math.max.apply(Math, _toConsumableArray(this.getDependsUpon().map(function (it) {
4070 return it.expectedToFinishAt;
4071 })));
4072 }
4073
4074 return Math.max.apply(Math, _toConsumableArray(this.subTasks.map(function (it) {
4075 return it.expectedToStartAt;
4076 })));
4077 }
4078 }, {
4079 key: "expectedToFinishAt",
4080 get: function get() {
4081 if (this.isLeaf) {
4082 return this._finishAt || (this.startAt() || this.expectedToStartAt) + this._expectedTimeSpan;
4083 }
4084
4085 return Math.max.apply(null, this._subTasks.map(function (it) {
4086 return it.expectedToFinishAt;
4087 }));
4088 }
4089 }, {
4090 key: "ops",
4091 get: function get() {
4092 if (!this.isLeaf || !this.getDependsUpon().every(function (it) {
4093 return it._finishAt;
4094 }) || this._finishAt) {
4095 return [];
4096 }
4097
4098 var ret = [Task.OP_START, Task.OP_FINISH];
4099
4100 if (this._startAt) {
4101 ret = ret.slice(1);
4102 }
4103
4104 if (this._opsFilter) {
4105 ret = this._opsFilter(ret);
4106 }
4107
4108 return ret;
4109 }
4110 }, {
4111 key: "depth",
4112 get: function get() {
4113 if (this.isLeaf) {
4114 return 1;
4115 }
4116
4117 return Math.max.apply(Math, _toConsumableArray(this._subTasks.map(function (it) {
4118 return it.depth;
4119 }))) + 1;
4120 }
4121 }, {
4122 key: "nextOp",
4123 get: function get() {
4124 return (this.ops || [])[0];
4125 }
4126 }]);
4127
4128 return Task;
4129}();
4130
4131Task.OP_START = 'start';
4132Task.OP_FINISH = 'finish';
4133
4134function _clearTask(json, fields) {
4135 var _iteratorNormalCompletion = true;
4136 var _didIteratorError = false;
4137 var _iteratorError = undefined;
4138
4139 try {
4140 for (var _iterator = fields[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
4141 var it = _step.value;
4142 delete json[it];
4143 }
4144 } catch (err) {
4145 _didIteratorError = true;
4146 _iteratorError = err;
4147 } finally {
4148 try {
4149 if (!_iteratorNormalCompletion && _iterator.return != null) {
4150 _iterator.return();
4151 }
4152 } finally {
4153 if (_didIteratorError) {
4154 throw _iteratorError;
4155 }
4156 }
4157 }
4158
4159 var _iteratorNormalCompletion2 = true;
4160 var _didIteratorError2 = false;
4161 var _iteratorError2 = undefined;
4162
4163 try {
4164 for (var _iterator2 = json.subTasks[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
4165 var t = _step2.value;
4166
4167 _clearTask(t, fields);
4168 }
4169 } catch (err) {
4170 _didIteratorError2 = true;
4171 _iteratorError2 = err;
4172 } finally {
4173 try {
4174 if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
4175 _iterator2.return();
4176 }
4177 } finally {
4178 if (_didIteratorError2) {
4179 throw _iteratorError2;
4180 }
4181 }
4182 }
4183}
4184
4185var Project =
4186/*#__PURE__*/
4187function (_Task) {
4188 _inherits(Project, _Task);
4189
4190 function Project() {
4191 _classCallCheck(this, Project);
4192
4193 return _possibleConstructorReturn(this, _getPrototypeOf(Project).apply(this, arguments));
4194 }
4195
4196 _createClass(Project, [{
4197 key: "toJSON",
4198 value: function toJSON() {
4199 return Object.assign(_get(_getPrototypeOf(Project.prototype), "toJSON", this).call(this), {
4200 base: this.base()
4201 });
4202 }
4203 }, {
4204 key: "fromJSON",
4205 value: function fromJSON(arg) {
4206 _get(_getPrototypeOf(Project.prototype), "fromJSON", this).call(this, arg);
4207
4208 this.base(arg.base);
4209 return this;
4210 }
4211 }, {
4212 key: "canonicalName",
4213 get: function get$$1() {
4214 return [];
4215 }
4216 }, {
4217 key: "baseline",
4218 get: function get$$1() {
4219 var json = this.toJSON();
4220
4221 _clearTask(json, ['startAt', 'startArg', 'finishAt', 'finishArg']);
4222
4223 return new Project().fromJSON(json);
4224 }
4225 }]);
4226
4227 return Project;
4228}(Task);
4229
4230function project(name) {
4231 return new Project(name);
4232}
4233
4234export { project, Project, Task };