1 | import timestring from 'timestring';
|
2 |
|
3 | function unwrapExports (x) {
|
4 | return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
5 | }
|
6 |
|
7 | function createCommonjsModule(fn, module) {
|
8 | return module = { exports: {} }, fn(module, module.exports), module.exports;
|
9 | }
|
10 |
|
11 | var _global = createCommonjsModule(function (module) {
|
12 |
|
13 | var global = module.exports = typeof window != 'undefined' && window.Math == Math
|
14 | ? window : typeof self != 'undefined' && self.Math == Math ? self
|
15 |
|
16 | : Function('return this')();
|
17 | if (typeof __g == 'number') __g = global;
|
18 | });
|
19 |
|
20 | var _global$1 = Object.freeze({
|
21 | default: _global,
|
22 | __moduleExports: _global
|
23 | });
|
24 |
|
25 | var _core = createCommonjsModule(function (module) {
|
26 | var core = module.exports = { version: '2.5.7' };
|
27 | if (typeof __e == 'number') __e = core;
|
28 | });
|
29 | var _core_1 = _core.version;
|
30 |
|
31 | var _core$1 = Object.freeze({
|
32 | default: _core,
|
33 | __moduleExports: _core,
|
34 | version: _core_1
|
35 | });
|
36 |
|
37 | var _isObject = function (it) {
|
38 | return typeof it === 'object' ? it !== null : typeof it === 'function';
|
39 | };
|
40 |
|
41 | var _isObject$1 = Object.freeze({
|
42 | default: _isObject,
|
43 | __moduleExports: _isObject
|
44 | });
|
45 |
|
46 | var isObject = ( _isObject$1 && _isObject ) || _isObject$1;
|
47 |
|
48 | var _anObject = function (it) {
|
49 | if (!isObject(it)) throw TypeError(it + ' is not an object!');
|
50 | return it;
|
51 | };
|
52 |
|
53 | var _anObject$1 = Object.freeze({
|
54 | default: _anObject,
|
55 | __moduleExports: _anObject
|
56 | });
|
57 |
|
58 | var _fails = function (exec) {
|
59 | try {
|
60 | return !!exec();
|
61 | } catch (e) {
|
62 | return true;
|
63 | }
|
64 | };
|
65 |
|
66 | var _fails$1 = Object.freeze({
|
67 | default: _fails,
|
68 | __moduleExports: _fails
|
69 | });
|
70 |
|
71 | var require$$1 = ( _fails$1 && _fails ) || _fails$1;
|
72 |
|
73 |
|
74 | var _descriptors = !require$$1(function () {
|
75 | return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
|
76 | });
|
77 |
|
78 | var _descriptors$1 = Object.freeze({
|
79 | default: _descriptors,
|
80 | __moduleExports: _descriptors
|
81 | });
|
82 |
|
83 | var global$1 = ( _global$1 && _global ) || _global$1;
|
84 |
|
85 | var document = global$1.document;
|
86 |
|
87 | var is = isObject(document) && isObject(document.createElement);
|
88 | var _domCreate = function (it) {
|
89 | return is ? document.createElement(it) : {};
|
90 | };
|
91 |
|
92 | var _domCreate$1 = Object.freeze({
|
93 | default: _domCreate,
|
94 | __moduleExports: _domCreate
|
95 | });
|
96 |
|
97 | var DESCRIPTORS = ( _descriptors$1 && _descriptors ) || _descriptors$1;
|
98 |
|
99 | var require$$2 = ( _domCreate$1 && _domCreate ) || _domCreate$1;
|
100 |
|
101 | var _ie8DomDefine = !DESCRIPTORS && !require$$1(function () {
|
102 | return Object.defineProperty(require$$2('div'), 'a', { get: function () { return 7; } }).a != 7;
|
103 | });
|
104 |
|
105 | var _ie8DomDefine$1 = Object.freeze({
|
106 | default: _ie8DomDefine,
|
107 | __moduleExports: _ie8DomDefine
|
108 | });
|
109 |
|
110 |
|
111 |
|
112 |
|
113 |
|
114 | var _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 |
|
123 | var _toPrimitive$1 = Object.freeze({
|
124 | default: _toPrimitive,
|
125 | __moduleExports: _toPrimitive
|
126 | });
|
127 |
|
128 | var anObject = ( _anObject$1 && _anObject ) || _anObject$1;
|
129 |
|
130 | var IE8_DOM_DEFINE = ( _ie8DomDefine$1 && _ie8DomDefine ) || _ie8DomDefine$1;
|
131 |
|
132 | var toPrimitive = ( _toPrimitive$1 && _toPrimitive ) || _toPrimitive$1;
|
133 |
|
134 | var dP = Object.defineProperty;
|
135 |
|
136 | var 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) { }
|
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 |
|
148 | var _objectDp = {
|
149 | f: f
|
150 | };
|
151 |
|
152 | var _objectDp$1 = Object.freeze({
|
153 | default: _objectDp,
|
154 | __moduleExports: _objectDp,
|
155 | f: f
|
156 | });
|
157 |
|
158 | var _propertyDesc = function (bitmap, value) {
|
159 | return {
|
160 | enumerable: !(bitmap & 1),
|
161 | configurable: !(bitmap & 2),
|
162 | writable: !(bitmap & 4),
|
163 | value: value
|
164 | };
|
165 | };
|
166 |
|
167 | var _propertyDesc$1 = Object.freeze({
|
168 | default: _propertyDesc,
|
169 | __moduleExports: _propertyDesc
|
170 | });
|
171 |
|
172 | var dP$1 = ( _objectDp$1 && _objectDp ) || _objectDp$1;
|
173 |
|
174 | var descriptor = ( _propertyDesc$1 && _propertyDesc ) || _propertyDesc$1;
|
175 |
|
176 | var _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 |
|
183 | var _hide$1 = Object.freeze({
|
184 | default: _hide,
|
185 | __moduleExports: _hide
|
186 | });
|
187 |
|
188 | var hasOwnProperty = {}.hasOwnProperty;
|
189 | var _has = function (it, key) {
|
190 | return hasOwnProperty.call(it, key);
|
191 | };
|
192 |
|
193 | var _has$1 = Object.freeze({
|
194 | default: _has,
|
195 | __moduleExports: _has
|
196 | });
|
197 |
|
198 | var id = 0;
|
199 | var px = Math.random();
|
200 | var _uid = function (key) {
|
201 | return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
|
202 | };
|
203 |
|
204 | var _uid$1 = Object.freeze({
|
205 | default: _uid,
|
206 | __moduleExports: _uid
|
207 | });
|
208 |
|
209 | var require$$0 = ( _hide$1 && _hide ) || _hide$1;
|
210 |
|
211 | var has = ( _has$1 && _has ) || _has$1;
|
212 |
|
213 | var uid = ( _uid$1 && _uid ) || _uid$1;
|
214 |
|
215 | var require$$1$1 = ( _core$1 && _core ) || _core$1;
|
216 |
|
217 | var _redefine = createCommonjsModule(function (module) {
|
218 | var SRC = uid('src');
|
219 | var TO_STRING = 'toString';
|
220 | var $toString = Function[TO_STRING];
|
221 | var TPL = ('' + $toString).split(TO_STRING);
|
222 |
|
223 | require$$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 |
|
243 | })(Function.prototype, TO_STRING, function toString() {
|
244 | return typeof this == 'function' && this[SRC] || $toString.call(this);
|
245 | });
|
246 | });
|
247 |
|
248 | var _redefine$1 = Object.freeze({
|
249 | default: _redefine,
|
250 | __moduleExports: _redefine
|
251 | });
|
252 |
|
253 | var _aFunction = function (it) {
|
254 | if (typeof it != 'function') throw TypeError(it + ' is not a function!');
|
255 | return it;
|
256 | };
|
257 |
|
258 | var _aFunction$1 = Object.freeze({
|
259 | default: _aFunction,
|
260 | __moduleExports: _aFunction
|
261 | });
|
262 |
|
263 | var aFunction = ( _aFunction$1 && _aFunction ) || _aFunction$1;
|
264 |
|
265 |
|
266 |
|
267 | var _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 |
|
286 | var _ctx$1 = Object.freeze({
|
287 | default: _ctx,
|
288 | __moduleExports: _ctx
|
289 | });
|
290 |
|
291 | var redefine = ( _redefine$1 && _redefine ) || _redefine$1;
|
292 |
|
293 | var require$$0$1 = ( _ctx$1 && _ctx ) || _ctx$1;
|
294 |
|
295 | var PROTOTYPE = 'prototype';
|
296 |
|
297 | var $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 |
|
310 | own = !IS_FORCED && target && target[key] !== undefined;
|
311 |
|
312 | out = (own ? target : source)[key];
|
313 |
|
314 | exp = IS_BIND && own ? require$$0$1(out, global$1) : IS_PROTO && typeof out == 'function' ? require$$0$1(Function.call, out) : out;
|
315 |
|
316 | if (target) redefine(target, key, out, type & $export.U);
|
317 |
|
318 | if (exports[key] != out) require$$0(exports, key, exp);
|
319 | if (IS_PROTO && expProto[key] != out) expProto[key] = out;
|
320 | }
|
321 | };
|
322 | global$1.core = require$$1$1;
|
323 |
|
324 | $export.F = 1;
|
325 | $export.G = 2;
|
326 | $export.S = 4;
|
327 | $export.P = 8;
|
328 | $export.B = 16;
|
329 | $export.W = 32;
|
330 | $export.U = 64;
|
331 | $export.R = 128;
|
332 | var _export = $export;
|
333 |
|
334 | var _export$1 = Object.freeze({
|
335 | default: _export,
|
336 | __moduleExports: _export
|
337 | });
|
338 |
|
339 |
|
340 | var _defined = function (it) {
|
341 | if (it == undefined) throw TypeError("Can't call method on " + it);
|
342 | return it;
|
343 | };
|
344 |
|
345 | var _defined$1 = Object.freeze({
|
346 | default: _defined,
|
347 | __moduleExports: _defined
|
348 | });
|
349 |
|
350 | var defined = ( _defined$1 && _defined ) || _defined$1;
|
351 |
|
352 |
|
353 |
|
354 | var _toObject = function (it) {
|
355 | return Object(defined(it));
|
356 | };
|
357 |
|
358 | var _toObject$1 = Object.freeze({
|
359 | default: _toObject,
|
360 | __moduleExports: _toObject
|
361 | });
|
362 |
|
363 | var $export$1 = ( _export$1 && _export ) || _export$1;
|
364 |
|
365 | var 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 |
|
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 |
|
379 | var toString = {}.toString;
|
380 |
|
381 | var _cof = function (it) {
|
382 | return toString.call(it).slice(8, -1);
|
383 | };
|
384 |
|
385 | var _cof$1 = Object.freeze({
|
386 | default: _cof,
|
387 | __moduleExports: _cof
|
388 | });
|
389 |
|
390 | var cof = ( _cof$1 && _cof ) || _cof$1;
|
391 |
|
392 |
|
393 |
|
394 |
|
395 | var _iobject = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
|
396 | return cof(it) == 'String' ? it.split('') : Object(it);
|
397 | };
|
398 |
|
399 | var _iobject$1 = Object.freeze({
|
400 | default: _iobject,
|
401 | __moduleExports: _iobject
|
402 | });
|
403 |
|
404 | var IObject = ( _iobject$1 && _iobject ) || _iobject$1;
|
405 |
|
406 |
|
407 |
|
408 |
|
409 | var _toIobject = function (it) {
|
410 | return IObject(defined(it));
|
411 | };
|
412 |
|
413 | var _toIobject$1 = Object.freeze({
|
414 | default: _toIobject,
|
415 | __moduleExports: _toIobject
|
416 | });
|
417 |
|
418 |
|
419 | var ceil = Math.ceil;
|
420 | var floor = Math.floor;
|
421 | var _toInteger = function (it) {
|
422 | return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
|
423 | };
|
424 |
|
425 | var _toInteger$1 = Object.freeze({
|
426 | default: _toInteger,
|
427 | __moduleExports: _toInteger
|
428 | });
|
429 |
|
430 | var toInteger = ( _toInteger$1 && _toInteger ) || _toInteger$1;
|
431 |
|
432 |
|
433 |
|
434 | var min = Math.min;
|
435 | var _toLength = function (it) {
|
436 | return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0;
|
437 | };
|
438 |
|
439 | var _toLength$1 = Object.freeze({
|
440 | default: _toLength,
|
441 | __moduleExports: _toLength
|
442 | });
|
443 |
|
444 | var max = Math.max;
|
445 | var min$1 = Math.min;
|
446 | var _toAbsoluteIndex = function (index, length) {
|
447 | index = toInteger(index);
|
448 | return index < 0 ? max(index + length, 0) : min$1(index, length);
|
449 | };
|
450 |
|
451 | var _toAbsoluteIndex$1 = Object.freeze({
|
452 | default: _toAbsoluteIndex,
|
453 | __moduleExports: _toAbsoluteIndex
|
454 | });
|
455 |
|
456 | var toIObject = ( _toIobject$1 && _toIobject ) || _toIobject$1;
|
457 |
|
458 | var toLength = ( _toLength$1 && _toLength ) || _toLength$1;
|
459 |
|
460 | var toAbsoluteIndex = ( _toAbsoluteIndex$1 && _toAbsoluteIndex ) || _toAbsoluteIndex$1;
|
461 |
|
462 |
|
463 |
|
464 |
|
465 |
|
466 |
|
467 | var _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 |
|
474 |
|
475 | if (IS_INCLUDES && el != el) while (length > index) {
|
476 | value = O[index++];
|
477 |
|
478 | if (value != value) return true;
|
479 |
|
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 |
|
486 | var _arrayIncludes$1 = Object.freeze({
|
487 | default: _arrayIncludes,
|
488 | __moduleExports: _arrayIncludes
|
489 | });
|
490 |
|
491 | var _library = false;
|
492 |
|
493 | var _library$1 = Object.freeze({
|
494 | default: _library,
|
495 | __moduleExports: _library
|
496 | });
|
497 |
|
498 | var LIBRARY = ( _library$1 && _library ) || _library$1;
|
499 |
|
500 | var _shared = createCommonjsModule(function (module) {
|
501 | var SHARED = '__core-js_shared__';
|
502 | var 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 |
|
513 | var _shared$1 = Object.freeze({
|
514 | default: _shared,
|
515 | __moduleExports: _shared
|
516 | });
|
517 |
|
518 | var require$$0$2 = ( _shared$1 && _shared ) || _shared$1;
|
519 |
|
520 | var shared = require$$0$2('keys');
|
521 |
|
522 | var _sharedKey = function (key) {
|
523 | return shared[key] || (shared[key] = uid(key));
|
524 | };
|
525 |
|
526 | var _sharedKey$1 = Object.freeze({
|
527 | default: _sharedKey,
|
528 | __moduleExports: _sharedKey
|
529 | });
|
530 |
|
531 | var require$$0$3 = ( _arrayIncludes$1 && _arrayIncludes ) || _arrayIncludes$1;
|
532 |
|
533 | var require$$0$4 = ( _sharedKey$1 && _sharedKey ) || _sharedKey$1;
|
534 |
|
535 | var arrayIndexOf = require$$0$3(false);
|
536 | var IE_PROTO = require$$0$4('IE_PROTO');
|
537 |
|
538 | var _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 |
|
545 | while (names.length > i) if (has(O, key = names[i++])) {
|
546 | ~arrayIndexOf(result, key) || result.push(key);
|
547 | }
|
548 | return result;
|
549 | };
|
550 |
|
551 | var _objectKeysInternal$1 = Object.freeze({
|
552 | default: _objectKeysInternal,
|
553 | __moduleExports: _objectKeysInternal
|
554 | });
|
555 |
|
556 |
|
557 | var _enumBugKeys = (
|
558 | 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
|
559 | ).split(',');
|
560 |
|
561 | var _enumBugKeys$1 = Object.freeze({
|
562 | default: _enumBugKeys,
|
563 | __moduleExports: _enumBugKeys
|
564 | });
|
565 |
|
566 | var $keys = ( _objectKeysInternal$1 && _objectKeysInternal ) || _objectKeysInternal$1;
|
567 |
|
568 | var require$$0$5 = ( _enumBugKeys$1 && _enumBugKeys ) || _enumBugKeys$1;
|
569 |
|
570 |
|
571 |
|
572 |
|
573 |
|
574 | var _objectKeys = Object.keys || function keys(O) {
|
575 | return $keys(O, require$$0$5);
|
576 | };
|
577 |
|
578 | var _objectKeys$1 = Object.freeze({
|
579 | default: _objectKeys,
|
580 | __moduleExports: _objectKeys
|
581 | });
|
582 |
|
583 | var f$1 = Object.getOwnPropertySymbols;
|
584 |
|
585 | var _objectGops = {
|
586 | f: f$1
|
587 | };
|
588 |
|
589 | var _objectGops$1 = Object.freeze({
|
590 | default: _objectGops,
|
591 | __moduleExports: _objectGops,
|
592 | f: f$1
|
593 | });
|
594 |
|
595 | var f$2 = {}.propertyIsEnumerable;
|
596 |
|
597 | var _objectPie = {
|
598 | f: f$2
|
599 | };
|
600 |
|
601 | var _objectPie$1 = Object.freeze({
|
602 | default: _objectPie,
|
603 | __moduleExports: _objectPie,
|
604 | f: f$2
|
605 | });
|
606 |
|
607 | var getKeys = ( _objectKeys$1 && _objectKeys ) || _objectKeys$1;
|
608 |
|
609 | var gOPS = ( _objectGops$1 && _objectGops ) || _objectGops$1;
|
610 |
|
611 | var pIE = ( _objectPie$1 && _objectPie ) || _objectPie$1;
|
612 |
|
613 |
|
614 |
|
615 |
|
616 |
|
617 |
|
618 |
|
619 | var $assign = Object.assign;
|
620 |
|
621 |
|
622 | var _objectAssign = !$assign || require$$1(function () {
|
623 | var A = {};
|
624 | var B = {};
|
625 |
|
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) {
|
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 |
|
647 | var _objectAssign$1 = Object.freeze({
|
648 | default: _objectAssign,
|
649 | __moduleExports: _objectAssign
|
650 | });
|
651 |
|
652 | var require$$0$6 = ( _objectAssign$1 && _objectAssign ) || _objectAssign$1;
|
653 |
|
654 |
|
655 |
|
656 |
|
657 | $export$1($export$1.S + $export$1.F, 'Object', { assign: require$$0$6 });
|
658 |
|
659 | function 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 |
|
675 | function _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 |
|
695 | function _classCallCheck(instance, Constructor) {
|
696 | if (!(instance instanceof Constructor)) {
|
697 | throw new TypeError("Cannot call a class as a function");
|
698 | }
|
699 | }
|
700 |
|
701 | function _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 |
|
711 | function _createClass(Constructor, protoProps, staticProps) {
|
712 | if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
713 | if (staticProps) _defineProperties(Constructor, staticProps);
|
714 | return Constructor;
|
715 | }
|
716 |
|
717 | function _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 |
|
732 | function _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 |
|
747 | function _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 |
|
754 | function _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 |
|
763 | function 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 |
|
776 | function _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 |
|
793 | function _isNativeFunction(fn) {
|
794 | return Function.toString.call(fn).indexOf("[native code]") !== -1;
|
795 | }
|
796 |
|
797 | function _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 |
|
831 | function _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 |
|
839 | function _possibleConstructorReturn(self, call) {
|
840 | if (call && (typeof call === "object" || typeof call === "function")) {
|
841 | return call;
|
842 | }
|
843 |
|
844 | return _assertThisInitialized(self);
|
845 | }
|
846 |
|
847 | function _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 |
|
856 | function _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 |
|
877 | function _toConsumableArray(arr) {
|
878 | return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();
|
879 | }
|
880 |
|
881 | function _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 |
|
889 | function _iterableToArray(iter) {
|
890 | if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
|
891 | }
|
892 |
|
893 | function _nonIterableSpread() {
|
894 | throw new TypeError("Invalid attempt to spread non-iterable instance");
|
895 | }
|
896 |
|
897 | var _wks = createCommonjsModule(function (module) {
|
898 | var store = require$$0$2('wks');
|
899 |
|
900 | var Symbol = global$1.Symbol;
|
901 | var USE_SYMBOL = typeof Symbol == 'function';
|
902 |
|
903 | var $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 |
|
911 | var _wks$1 = Object.freeze({
|
912 | default: _wks,
|
913 | __moduleExports: _wks
|
914 | });
|
915 |
|
916 | var require$$0$7 = ( _wks$1 && _wks ) || _wks$1;
|
917 |
|
918 | var f$3 = require$$0$7;
|
919 |
|
920 | var _wksExt = {
|
921 | f: f$3
|
922 | };
|
923 |
|
924 | var _wksExt$1 = Object.freeze({
|
925 | default: _wksExt,
|
926 | __moduleExports: _wksExt,
|
927 | f: f$3
|
928 | });
|
929 |
|
930 | var wksExt = ( _wksExt$1 && _wksExt ) || _wksExt$1;
|
931 |
|
932 | var defineProperty = dP$1.f;
|
933 | var _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 |
|
938 | var _wksDefine$1 = Object.freeze({
|
939 | default: _wksDefine,
|
940 | __moduleExports: _wksDefine
|
941 | });
|
942 |
|
943 | var wksDefine = ( _wksDefine$1 && _wksDefine ) || _wksDefine$1;
|
944 |
|
945 | wksDefine('asyncIterator');
|
946 |
|
947 | var _meta = createCommonjsModule(function (module) {
|
948 | var META = uid('meta');
|
949 |
|
950 |
|
951 | var setDesc = dP$1.f;
|
952 | var id = 0;
|
953 | var isExtensible = Object.isExtensible || function () {
|
954 | return true;
|
955 | };
|
956 | var FREEZE = !require$$1(function () {
|
957 | return isExtensible(Object.preventExtensions({}));
|
958 | });
|
959 | var setMeta = function (it) {
|
960 | setDesc(it, META, { value: {
|
961 | i: 'O' + ++id,
|
962 | w: {}
|
963 | } });
|
964 | };
|
965 | var fastKey = function (it, create) {
|
966 |
|
967 | if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
|
968 | if (!has(it, META)) {
|
969 |
|
970 | if (!isExtensible(it)) return 'F';
|
971 |
|
972 | if (!create) return 'E';
|
973 |
|
974 | setMeta(it);
|
975 |
|
976 | } return it[META].i;
|
977 | };
|
978 | var getWeak = function (it, create) {
|
979 | if (!has(it, META)) {
|
980 |
|
981 | if (!isExtensible(it)) return true;
|
982 |
|
983 | if (!create) return false;
|
984 |
|
985 | setMeta(it);
|
986 |
|
987 | } return it[META].w;
|
988 | };
|
989 |
|
990 | var onFreeze = function (it) {
|
991 | if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);
|
992 | return it;
|
993 | };
|
994 | var meta = module.exports = {
|
995 | KEY: META,
|
996 | NEED: false,
|
997 | fastKey: fastKey,
|
998 | getWeak: getWeak,
|
999 | onFreeze: onFreeze
|
1000 | };
|
1001 | });
|
1002 | var _meta_1 = _meta.KEY;
|
1003 | var _meta_2 = _meta.NEED;
|
1004 | var _meta_3 = _meta.fastKey;
|
1005 | var _meta_4 = _meta.getWeak;
|
1006 | var _meta_5 = _meta.onFreeze;
|
1007 |
|
1008 | var _meta$1 = 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 |
|
1018 | var def = dP$1.f;
|
1019 |
|
1020 | var TAG = require$$0$7('toStringTag');
|
1021 |
|
1022 | var _setToStringTag = function (it, tag, stat) {
|
1023 | if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });
|
1024 | };
|
1025 |
|
1026 | var _setToStringTag$1 = Object.freeze({
|
1027 | default: _setToStringTag,
|
1028 | __moduleExports: _setToStringTag
|
1029 | });
|
1030 |
|
1031 |
|
1032 |
|
1033 |
|
1034 |
|
1035 | var _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 |
|
1047 | var _enumKeys$1 = Object.freeze({
|
1048 | default: _enumKeys,
|
1049 | __moduleExports: _enumKeys
|
1050 | });
|
1051 |
|
1052 |
|
1053 |
|
1054 | var _isArray = Array.isArray || function isArray(arg) {
|
1055 | return cof(arg) == 'Array';
|
1056 | };
|
1057 |
|
1058 | var _isArray$1 = Object.freeze({
|
1059 | default: _isArray,
|
1060 | __moduleExports: _isArray
|
1061 | });
|
1062 |
|
1063 | var _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 |
|
1073 | var _objectDps$1 = Object.freeze({
|
1074 | default: _objectDps,
|
1075 | __moduleExports: _objectDps
|
1076 | });
|
1077 |
|
1078 | var document$1 = global$1.document;
|
1079 | var _html = document$1 && document$1.documentElement;
|
1080 |
|
1081 | var _html$1 = Object.freeze({
|
1082 | default: _html,
|
1083 | __moduleExports: _html
|
1084 | });
|
1085 |
|
1086 | var dPs = ( _objectDps$1 && _objectDps ) || _objectDps$1;
|
1087 |
|
1088 | var require$$2$1 = ( _html$1 && _html ) || _html$1;
|
1089 |
|
1090 |
|
1091 |
|
1092 |
|
1093 |
|
1094 | var IE_PROTO$1 = require$$0$4('IE_PROTO');
|
1095 | var Empty = function () { };
|
1096 | var PROTOTYPE$1 = 'prototype';
|
1097 |
|
1098 |
|
1099 | var createDict = function () {
|
1100 |
|
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:';
|
1109 |
|
1110 |
|
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 |
|
1120 | var _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 |
|
1127 | result[IE_PROTO$1] = O;
|
1128 | } else result = createDict();
|
1129 | return Properties === undefined ? result : dPs(result, Properties);
|
1130 | };
|
1131 |
|
1132 | var _objectCreate$1 = Object.freeze({
|
1133 | default: _objectCreate,
|
1134 | __moduleExports: _objectCreate
|
1135 | });
|
1136 |
|
1137 |
|
1138 |
|
1139 | var hiddenKeys = require$$0$5.concat('length', 'prototype');
|
1140 |
|
1141 | var f$4 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
|
1142 | return $keys(O, hiddenKeys);
|
1143 | };
|
1144 |
|
1145 | var _objectGopn = {
|
1146 | f: f$4
|
1147 | };
|
1148 |
|
1149 | var _objectGopn$1 = Object.freeze({
|
1150 | default: _objectGopn,
|
1151 | __moduleExports: _objectGopn,
|
1152 | f: f$4
|
1153 | });
|
1154 |
|
1155 | var require$$0$8 = ( _objectGopn$1 && _objectGopn ) || _objectGopn$1;
|
1156 |
|
1157 |
|
1158 |
|
1159 | var gOPN = require$$0$8.f;
|
1160 | var toString$1 = {}.toString;
|
1161 |
|
1162 | var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
|
1163 | ? Object.getOwnPropertyNames(window) : [];
|
1164 |
|
1165 | var getWindowNames = function (it) {
|
1166 | try {
|
1167 | return gOPN(it);
|
1168 | } catch (e) {
|
1169 | return windowNames.slice();
|
1170 | }
|
1171 | };
|
1172 |
|
1173 | var f$5 = function getOwnPropertyNames(it) {
|
1174 | return windowNames && toString$1.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));
|
1175 | };
|
1176 |
|
1177 | var _objectGopnExt = {
|
1178 | f: f$5
|
1179 | };
|
1180 |
|
1181 | var _objectGopnExt$1 = Object.freeze({
|
1182 | default: _objectGopnExt,
|
1183 | __moduleExports: _objectGopnExt,
|
1184 | f: f$5
|
1185 | });
|
1186 |
|
1187 | var gOPD = Object.getOwnPropertyDescriptor;
|
1188 |
|
1189 | var 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) { }
|
1195 | if (has(O, P)) return descriptor(!pIE.f.call(O, P), O[P]);
|
1196 | };
|
1197 |
|
1198 | var _objectGopd = {
|
1199 | f: f$6
|
1200 | };
|
1201 |
|
1202 | var _objectGopd$1 = Object.freeze({
|
1203 | default: _objectGopd,
|
1204 | __moduleExports: _objectGopd,
|
1205 | f: f$6
|
1206 | });
|
1207 |
|
1208 | var meta = ( _meta$1 && _meta ) || _meta$1;
|
1209 |
|
1210 | var setToStringTag = ( _setToStringTag$1 && _setToStringTag ) || _setToStringTag$1;
|
1211 |
|
1212 | var enumKeys = ( _enumKeys$1 && _enumKeys ) || _enumKeys$1;
|
1213 |
|
1214 | var isArray = ( _isArray$1 && _isArray ) || _isArray$1;
|
1215 |
|
1216 | var create = ( _objectCreate$1 && _objectCreate ) || _objectCreate$1;
|
1217 |
|
1218 | var gOPNExt = ( _objectGopnExt$1 && _objectGopnExt ) || _objectGopnExt$1;
|
1219 |
|
1220 | var require$$1$2 = ( _objectGopd$1 && _objectGopd ) || _objectGopd$1;
|
1221 |
|
1222 |
|
1223 |
|
1224 |
|
1225 |
|
1226 |
|
1227 |
|
1228 | var META = meta.KEY;
|
1229 |
|
1230 |
|
1231 |
|
1232 |
|
1233 |
|
1234 |
|
1235 |
|
1236 |
|
1237 |
|
1238 |
|
1239 |
|
1240 |
|
1241 |
|
1242 |
|
1243 |
|
1244 |
|
1245 |
|
1246 |
|
1247 |
|
1248 | var gOPD$1 = require$$1$2.f;
|
1249 | var dP$2 = dP$1.f;
|
1250 | var gOPN$1 = gOPNExt.f;
|
1251 | var $Symbol = global$1.Symbol;
|
1252 | var $JSON = global$1.JSON;
|
1253 | var _stringify = $JSON && $JSON.stringify;
|
1254 | var PROTOTYPE$2 = 'prototype';
|
1255 | var HIDDEN = require$$0$7('_hidden');
|
1256 | var TO_PRIMITIVE = require$$0$7('toPrimitive');
|
1257 | var isEnum = {}.propertyIsEnumerable;
|
1258 | var SymbolRegistry = require$$0$2('symbol-registry');
|
1259 | var AllSymbols = require$$0$2('symbols');
|
1260 | var OPSymbols = require$$0$2('op-symbols');
|
1261 | var ObjectProto = Object[PROTOTYPE$2];
|
1262 | var USE_NATIVE = typeof $Symbol == 'function';
|
1263 | var QObject = global$1.QObject;
|
1264 |
|
1265 | var setter = !QObject || !QObject[PROTOTYPE$2] || !QObject[PROTOTYPE$2].findChild;
|
1266 |
|
1267 |
|
1268 | var 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 |
|
1279 | var wrap = function (tag) {
|
1280 | var sym = AllSymbols[tag] = create($Symbol[PROTOTYPE$2]);
|
1281 | sym._k = tag;
|
1282 | return sym;
|
1283 | };
|
1284 |
|
1285 | var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {
|
1286 | return typeof it == 'symbol';
|
1287 | } : function (it) {
|
1288 | return it instanceof $Symbol;
|
1289 | };
|
1290 |
|
1291 | var $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 | };
|
1306 | var $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 | };
|
1315 | var $create = function create$$1(it, P) {
|
1316 | return P === undefined ? create(it) : $defineProperties(create(it), P);
|
1317 | };
|
1318 | var $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 | };
|
1323 | var $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 | };
|
1331 | var $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 | };
|
1340 | var $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 |
|
1352 | if (!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 |
|
1385 | for (var es6Symbols = (
|
1386 |
|
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 |
|
1390 | for (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 |
|
1394 | 'for': function (key) {
|
1395 | return has(SymbolRegistry, key += '')
|
1396 | ? SymbolRegistry[key]
|
1397 | : SymbolRegistry[key] = $Symbol(key);
|
1398 | },
|
1399 |
|
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 |
|
1410 | create: $create,
|
1411 |
|
1412 | defineProperty: $defineProperty,
|
1413 |
|
1414 | defineProperties: $defineProperties,
|
1415 |
|
1416 | getOwnPropertyDescriptor: $getOwnPropertyDescriptor,
|
1417 |
|
1418 | getOwnPropertyNames: $getOwnPropertyNames,
|
1419 |
|
1420 | getOwnPropertySymbols: $getOwnPropertySymbols
|
1421 | });
|
1422 |
|
1423 |
|
1424 | $JSON && $export$1($export$1.S + $export$1.F * (!USE_NATIVE || require$$1(function () {
|
1425 | var S = $Symbol();
|
1426 |
|
1427 |
|
1428 |
|
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;
|
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 |
|
1448 | $Symbol[PROTOTYPE$2][TO_PRIMITIVE] || require$$0($Symbol[PROTOTYPE$2], TO_PRIMITIVE, $Symbol[PROTOTYPE$2].valueOf);
|
1449 |
|
1450 | setToStringTag($Symbol, 'Symbol');
|
1451 |
|
1452 | setToStringTag(Math, 'Math', true);
|
1453 |
|
1454 | setToStringTag(global$1.JSON, 'JSON', true);
|
1455 |
|
1456 |
|
1457 | var UNSCOPABLES = require$$0$7('unscopables');
|
1458 | var ArrayProto = Array.prototype;
|
1459 | if (ArrayProto[UNSCOPABLES] == undefined) require$$0(ArrayProto, UNSCOPABLES, {});
|
1460 | var _addToUnscopables = function (key) {
|
1461 | ArrayProto[UNSCOPABLES][key] = true;
|
1462 | };
|
1463 |
|
1464 | var _addToUnscopables$1 = Object.freeze({
|
1465 | default: _addToUnscopables,
|
1466 | __moduleExports: _addToUnscopables
|
1467 | });
|
1468 |
|
1469 | var _iterStep = function (done, value) {
|
1470 | return { value: value, done: !!done };
|
1471 | };
|
1472 |
|
1473 | var _iterStep$1 = Object.freeze({
|
1474 | default: _iterStep,
|
1475 | __moduleExports: _iterStep
|
1476 | });
|
1477 |
|
1478 | var _iterators = {};
|
1479 |
|
1480 | var _iterators$1 = Object.freeze({
|
1481 | default: _iterators,
|
1482 | __moduleExports: _iterators
|
1483 | });
|
1484 |
|
1485 | var IteratorPrototype = {};
|
1486 |
|
1487 |
|
1488 | require$$0(IteratorPrototype, require$$0$7('iterator'), function () { return this; });
|
1489 |
|
1490 | var _iterCreate = function (Constructor, NAME, next) {
|
1491 | Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });
|
1492 | setToStringTag(Constructor, NAME + ' Iterator');
|
1493 | };
|
1494 |
|
1495 | var _iterCreate$1 = Object.freeze({
|
1496 | default: _iterCreate,
|
1497 | __moduleExports: _iterCreate
|
1498 | });
|
1499 |
|
1500 |
|
1501 |
|
1502 |
|
1503 | var IE_PROTO$2 = require$$0$4('IE_PROTO');
|
1504 | var ObjectProto$1 = Object.prototype;
|
1505 |
|
1506 | var _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 |
|
1514 | var _objectGpo$1 = Object.freeze({
|
1515 | default: _objectGpo,
|
1516 | __moduleExports: _objectGpo
|
1517 | });
|
1518 |
|
1519 | var Iterators = ( _iterators$1 && _iterators ) || _iterators$1;
|
1520 |
|
1521 | var $iterCreate = ( _iterCreate$1 && _iterCreate ) || _iterCreate$1;
|
1522 |
|
1523 | var getPrototypeOf = ( _objectGpo$1 && _objectGpo ) || _objectGpo$1;
|
1524 |
|
1525 | var ITERATOR = require$$0$7('iterator');
|
1526 | var BUGGY = !([].keys && 'next' in [].keys());
|
1527 | var FF_ITERATOR = '@@iterator';
|
1528 | var KEYS = 'keys';
|
1529 | var VALUES = 'values';
|
1530 |
|
1531 | var returnThis = function () { return this; };
|
1532 |
|
1533 | var _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 |
|
1552 | if ($anyNative) {
|
1553 | IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));
|
1554 | if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {
|
1555 |
|
1556 | setToStringTag(IteratorPrototype, TAG, true);
|
1557 |
|
1558 | if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') require$$0(IteratorPrototype, ITERATOR, returnThis);
|
1559 | }
|
1560 | }
|
1561 |
|
1562 | if (DEF_VALUES && $native && $native.name !== VALUES) {
|
1563 | VALUES_BUG = true;
|
1564 | $default = function values() { return $native.call(this); };
|
1565 | }
|
1566 |
|
1567 | if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {
|
1568 | require$$0(proto, ITERATOR, $default);
|
1569 | }
|
1570 |
|
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 |
|
1586 | var _iterDefine$1 = Object.freeze({
|
1587 | default: _iterDefine,
|
1588 | __moduleExports: _iterDefine
|
1589 | });
|
1590 |
|
1591 | var require$$1$3 = ( _addToUnscopables$1 && _addToUnscopables ) || _addToUnscopables$1;
|
1592 |
|
1593 | var step = ( _iterStep$1 && _iterStep ) || _iterStep$1;
|
1594 |
|
1595 | var $iterDefine = ( _iterDefine$1 && _iterDefine ) || _iterDefine$1;
|
1596 |
|
1597 |
|
1598 |
|
1599 |
|
1600 |
|
1601 | var es6_array_iterator = $iterDefine(Array, 'Array', function (iterated, kind) {
|
1602 | this._t = toIObject(iterated);
|
1603 | this._i = 0;
|
1604 | this._k = kind;
|
1605 |
|
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 |
|
1620 | Iterators.Arguments = Iterators.Array;
|
1621 |
|
1622 | require$$1$3('keys');
|
1623 | require$$1$3('values');
|
1624 | require$$1$3('entries');
|
1625 |
|
1626 | var es6_array_iterator$1 = Object.freeze({
|
1627 | default: es6_array_iterator,
|
1628 | __moduleExports: es6_array_iterator
|
1629 | });
|
1630 |
|
1631 | var $iterators = ( es6_array_iterator$1 && es6_array_iterator ) || es6_array_iterator$1;
|
1632 |
|
1633 | var ITERATOR$1 = require$$0$7('iterator');
|
1634 | var TO_STRING_TAG = require$$0$7('toStringTag');
|
1635 | var ArrayValues = Iterators.Array;
|
1636 |
|
1637 | var DOMIterables = {
|
1638 | CSSRuleList: true,
|
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,
|
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,
|
1666 | TextTrackCueList: false,
|
1667 | TextTrackList: false,
|
1668 | TouchList: false
|
1669 | };
|
1670 |
|
1671 | for (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 |
|
1686 |
|
1687 |
|
1688 | $export$1($export$1.S, 'Array', { isArray: isArray });
|
1689 |
|
1690 | var SPECIES = require$$0$7('species');
|
1691 |
|
1692 | var _arraySpeciesConstructor = function (original) {
|
1693 | var C;
|
1694 | if (isArray(original)) {
|
1695 | C = original.constructor;
|
1696 |
|
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 |
|
1705 | var _arraySpeciesConstructor$1 = Object.freeze({
|
1706 | default: _arraySpeciesConstructor,
|
1707 | __moduleExports: _arraySpeciesConstructor
|
1708 | });
|
1709 |
|
1710 | var speciesConstructor = ( _arraySpeciesConstructor$1 && _arraySpeciesConstructor ) || _arraySpeciesConstructor$1;
|
1711 |
|
1712 |
|
1713 |
|
1714 |
|
1715 | var _arraySpeciesCreate = function (original, length) {
|
1716 | return new (speciesConstructor(original))(length);
|
1717 | };
|
1718 |
|
1719 | var _arraySpeciesCreate$1 = Object.freeze({
|
1720 | default: _arraySpeciesCreate,
|
1721 | __moduleExports: _arraySpeciesCreate
|
1722 | });
|
1723 |
|
1724 | var asc = ( _arraySpeciesCreate$1 && _arraySpeciesCreate ) || _arraySpeciesCreate$1;
|
1725 |
|
1726 |
|
1727 |
|
1728 |
|
1729 |
|
1730 |
|
1731 |
|
1732 |
|
1733 |
|
1734 |
|
1735 |
|
1736 |
|
1737 |
|
1738 | var _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;
|
1759 | else if (res) switch (TYPE) {
|
1760 | case 3: return true;
|
1761 | case 5: return val;
|
1762 | case 6: return index;
|
1763 | case 2: result.push(val);
|
1764 | } else if (IS_EVERY) return false;
|
1765 | }
|
1766 | }
|
1767 | return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;
|
1768 | };
|
1769 | };
|
1770 |
|
1771 | var _arrayMethods$1 = Object.freeze({
|
1772 | default: _arrayMethods,
|
1773 | __moduleExports: _arrayMethods
|
1774 | });
|
1775 |
|
1776 | var _strictMethod = function (method, arg) {
|
1777 | return !!method && require$$1(function () {
|
1778 |
|
1779 | arg ? method.call(null, function () { }, 1) : method.call(null);
|
1780 | });
|
1781 | };
|
1782 |
|
1783 | var _strictMethod$1 = Object.freeze({
|
1784 | default: _strictMethod,
|
1785 | __moduleExports: _strictMethod
|
1786 | });
|
1787 |
|
1788 | var require$$0$9 = ( _arrayMethods$1 && _arrayMethods ) || _arrayMethods$1;
|
1789 |
|
1790 | var require$$1$4 = ( _strictMethod$1 && _strictMethod ) || _strictMethod$1;
|
1791 |
|
1792 | var $forEach = require$$0$9(0);
|
1793 | var STRICT = require$$1$4([].forEach, true);
|
1794 |
|
1795 | $export$1($export$1.P + $export$1.F * !STRICT, 'Array', {
|
1796 |
|
1797 | forEach: function forEach(callbackfn /* , thisArg */) {
|
1798 | return $forEach(this, callbackfn, arguments[1]);
|
1799 | }
|
1800 | });
|
1801 |
|
1802 | var runtime = createCommonjsModule(function (module) {
|
1803 |
|
1804 |
|
1805 |
|
1806 |
|
1807 |
|
1808 |
|
1809 |
|
1810 | !(function(global) {
|
1811 |
|
1812 | var Op = Object.prototype;
|
1813 | var hasOwn = Op.hasOwnProperty;
|
1814 | var undefined;
|
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 |
|
1823 |
|
1824 | module.exports = runtime;
|
1825 | }
|
1826 |
|
1827 |
|
1828 | return;
|
1829 | }
|
1830 |
|
1831 |
|
1832 |
|
1833 | runtime = global.regeneratorRuntime = module.exports;
|
1834 |
|
1835 | function wrap(innerFn, outerFn, self, tryLocsList) {
|
1836 |
|
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 |
|
1842 |
|
1843 | generator._invoke = makeInvokeMethod(innerFn, self, context);
|
1844 |
|
1845 | return generator;
|
1846 | }
|
1847 | runtime.wrap = wrap;
|
1848 |
|
1849 |
|
1850 |
|
1851 |
|
1852 |
|
1853 |
|
1854 |
|
1855 |
|
1856 |
|
1857 |
|
1858 |
|
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 |
|
1873 |
|
1874 | var ContinueSentinel = {};
|
1875 |
|
1876 |
|
1877 |
|
1878 |
|
1879 |
|
1880 | function Generator() {}
|
1881 | function GeneratorFunction() {}
|
1882 | function GeneratorFunctionPrototype() {}
|
1883 |
|
1884 |
|
1885 |
|
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 |
|
1897 |
|
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 |
|
1909 |
|
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 |
|
1923 |
|
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 |
|
1942 |
|
1943 |
|
1944 |
|
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 |
|
1969 |
|
1970 |
|
1971 |
|
1972 |
|
1973 |
|
1974 |
|
1975 |
|
1976 |
|
1977 |
|
1978 |
|
1979 |
|
1980 |
|
1981 |
|
1982 |
|
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 |
|
2000 |
|
2001 |
|
2002 |
|
2003 |
|
2004 |
|
2005 |
|
2006 |
|
2007 |
|
2008 |
|
2009 |
|
2010 |
|
2011 | previousPromise ? previousPromise.then(
|
2012 | callInvokeWithMethodAndArg,
|
2013 |
|
2014 |
|
2015 | callInvokeWithMethodAndArg
|
2016 | ) : callInvokeWithMethodAndArg();
|
2017 | }
|
2018 |
|
2019 |
|
2020 |
|
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 |
|
2031 |
|
2032 |
|
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
|
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 |
|
2059 |
|
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 |
|
2078 |
|
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 |
|
2098 |
|
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 |
|
2115 |
|
2116 | context.method = "throw";
|
2117 | context.arg = record.arg;
|
2118 | }
|
2119 | }
|
2120 | };
|
2121 | }
|
2122 |
|
2123 |
|
2124 |
|
2125 |
|
2126 |
|
2127 | function maybeInvokeDelegate(delegate, context) {
|
2128 | var method = delegate.iterator[context.method];
|
2129 | if (method === undefined) {
|
2130 |
|
2131 |
|
2132 | context.delegate = null;
|
2133 |
|
2134 | if (context.method === "throw") {
|
2135 | if (delegate.iterator.return) {
|
2136 |
|
2137 |
|
2138 | context.method = "return";
|
2139 | context.arg = undefined;
|
2140 | maybeInvokeDelegate(delegate, context);
|
2141 |
|
2142 | if (context.method === "throw") {
|
2143 |
|
2144 |
|
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 |
|
2177 |
|
2178 | context[delegate.resultName] = info.value;
|
2179 |
|
2180 |
|
2181 | context.next = delegate.nextLoc;
|
2182 |
|
2183 |
|
2184 |
|
2185 |
|
2186 |
|
2187 |
|
2188 |
|
2189 | if (context.method !== "return") {
|
2190 | context.method = "next";
|
2191 | context.arg = undefined;
|
2192 | }
|
2193 |
|
2194 | } else {
|
2195 |
|
2196 | return info;
|
2197 | }
|
2198 |
|
2199 |
|
2200 |
|
2201 | context.delegate = null;
|
2202 | return ContinueSentinel;
|
2203 | }
|
2204 |
|
2205 |
|
2206 |
|
2207 | defineIteratorMethods(Gp);
|
2208 |
|
2209 | Gp[toStringTagSymbol] = "Generator";
|
2210 |
|
2211 |
|
2212 |
|
2213 |
|
2214 |
|
2215 |
|
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 |
|
2248 |
|
2249 |
|
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 |
|
2263 |
|
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 |
|
2275 |
|
2276 |
|
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 |
|
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 |
|
2329 |
|
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 |
|
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 |
|
2376 |
|
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 |
|
2390 |
|
2391 |
|
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 |
|
2440 |
|
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 |
|
2501 |
|
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 |
|
2514 |
|
2515 | this.arg = undefined;
|
2516 | }
|
2517 |
|
2518 | return ContinueSentinel;
|
2519 | }
|
2520 | };
|
2521 | })(
|
2522 |
|
2523 |
|
2524 |
|
2525 | (function() { return this })() || Function("return this")()
|
2526 | );
|
2527 | });
|
2528 |
|
2529 |
|
2530 |
|
2531 | var _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 |
|
2545 | var _stringAt$1 = Object.freeze({
|
2546 | default: _stringAt,
|
2547 | __moduleExports: _stringAt
|
2548 | });
|
2549 |
|
2550 | var require$$0$a = ( _stringAt$1 && _stringAt ) || _stringAt$1;
|
2551 |
|
2552 | var $at = require$$0$a(true);
|
2553 |
|
2554 |
|
2555 | $iterDefine(String, 'String', function (iterated) {
|
2556 | this._t = String(iterated);
|
2557 | this._i = 0;
|
2558 |
|
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 |
|
2569 | var _redefineAll = function (target, src, safe) {
|
2570 | for (var key in src) redefine(target, key, src[key], safe);
|
2571 | return target;
|
2572 | };
|
2573 |
|
2574 | var _redefineAll$1 = Object.freeze({
|
2575 | default: _redefineAll,
|
2576 | __moduleExports: _redefineAll
|
2577 | });
|
2578 |
|
2579 | var _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 |
|
2585 | var _anInstance$1 = Object.freeze({
|
2586 | default: _anInstance,
|
2587 | __moduleExports: _anInstance
|
2588 | });
|
2589 |
|
2590 |
|
2591 |
|
2592 | var _iterCall = function (iterator, fn, value, entries) {
|
2593 | try {
|
2594 | return entries ? fn(anObject(value)[0], value[1]) : fn(value);
|
2595 |
|
2596 | } catch (e) {
|
2597 | var ret = iterator['return'];
|
2598 | if (ret !== undefined) anObject(ret.call(iterator));
|
2599 | throw e;
|
2600 | }
|
2601 | };
|
2602 |
|
2603 | var _iterCall$1 = Object.freeze({
|
2604 | default: _iterCall,
|
2605 | __moduleExports: _iterCall
|
2606 | });
|
2607 |
|
2608 |
|
2609 |
|
2610 | var ITERATOR$2 = require$$0$7('iterator');
|
2611 | var ArrayProto$1 = Array.prototype;
|
2612 |
|
2613 | var _isArrayIter = function (it) {
|
2614 | return it !== undefined && (Iterators.Array === it || ArrayProto$1[ITERATOR$2] === it);
|
2615 | };
|
2616 |
|
2617 | var _isArrayIter$1 = Object.freeze({
|
2618 | default: _isArrayIter,
|
2619 | __moduleExports: _isArrayIter
|
2620 | });
|
2621 |
|
2622 |
|
2623 |
|
2624 | var TAG$1 = require$$0$7('toStringTag');
|
2625 |
|
2626 | var ARG = cof(function () { return arguments; }()) == 'Arguments';
|
2627 |
|
2628 |
|
2629 | var tryGet = function (it, key) {
|
2630 | try {
|
2631 | return it[key];
|
2632 | } catch (e) { }
|
2633 | };
|
2634 |
|
2635 | var _classof = function (it) {
|
2636 | var O, T, B;
|
2637 | return it === undefined ? 'Undefined' : it === null ? 'Null'
|
2638 |
|
2639 | : typeof (T = tryGet(O = Object(it), TAG$1)) == 'string' ? T
|
2640 |
|
2641 | : ARG ? cof(O)
|
2642 |
|
2643 | : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
|
2644 | };
|
2645 |
|
2646 | var _classof$1 = Object.freeze({
|
2647 | default: _classof,
|
2648 | __moduleExports: _classof
|
2649 | });
|
2650 |
|
2651 | var classof = ( _classof$1 && _classof ) || _classof$1;
|
2652 |
|
2653 | var ITERATOR$3 = require$$0$7('iterator');
|
2654 |
|
2655 | var 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 |
|
2661 | var core_getIteratorMethod$1 = Object.freeze({
|
2662 | default: core_getIteratorMethod,
|
2663 | __moduleExports: core_getIteratorMethod
|
2664 | });
|
2665 |
|
2666 | var call = ( _iterCall$1 && _iterCall ) || _iterCall$1;
|
2667 |
|
2668 | var isArrayIter = ( _isArrayIter$1 && _isArrayIter ) || _isArrayIter$1;
|
2669 |
|
2670 | var getIterFn = ( core_getIteratorMethod$1 && core_getIteratorMethod ) || core_getIteratorMethod$1;
|
2671 |
|
2672 | var _forOf = createCommonjsModule(function (module) {
|
2673 | var BREAK = {};
|
2674 | var RETURN = {};
|
2675 | var 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 |
|
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 | };
|
2690 | exports.BREAK = BREAK;
|
2691 | exports.RETURN = RETURN;
|
2692 | });
|
2693 |
|
2694 | var _forOf$1 = Object.freeze({
|
2695 | default: _forOf,
|
2696 | __moduleExports: _forOf
|
2697 | });
|
2698 |
|
2699 | var SPECIES$1 = require$$0$7('species');
|
2700 |
|
2701 | var _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 |
|
2709 | var _setSpecies$1 = Object.freeze({
|
2710 | default: _setSpecies,
|
2711 | __moduleExports: _setSpecies
|
2712 | });
|
2713 |
|
2714 | var _validateCollection = function (it, TYPE) {
|
2715 | if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!');
|
2716 | return it;
|
2717 | };
|
2718 |
|
2719 | var _validateCollection$1 = Object.freeze({
|
2720 | default: _validateCollection,
|
2721 | __moduleExports: _validateCollection
|
2722 | });
|
2723 |
|
2724 | var redefineAll = ( _redefineAll$1 && _redefineAll ) || _redefineAll$1;
|
2725 |
|
2726 | var anInstance = ( _anInstance$1 && _anInstance ) || _anInstance$1;
|
2727 |
|
2728 | var forOf = ( _forOf$1 && _forOf ) || _forOf$1;
|
2729 |
|
2730 | var setSpecies = ( _setSpecies$1 && _setSpecies ) || _setSpecies$1;
|
2731 |
|
2732 | var validate = ( _validateCollection$1 && _validateCollection ) || _validateCollection$1;
|
2733 |
|
2734 | var dP$3 = dP$1.f;
|
2735 |
|
2736 |
|
2737 |
|
2738 |
|
2739 |
|
2740 |
|
2741 |
|
2742 |
|
2743 |
|
2744 | var fastKey = meta.fastKey;
|
2745 |
|
2746 | var SIZE = DESCRIPTORS ? '_s' : 'size';
|
2747 |
|
2748 | var getEntry = function (that, key) {
|
2749 |
|
2750 | var index = fastKey(key);
|
2751 | var entry;
|
2752 | if (index !== 'F') return that._i[index];
|
2753 |
|
2754 | for (entry = that._f; entry; entry = entry.n) {
|
2755 | if (entry.k == key) return entry;
|
2756 | }
|
2757 | };
|
2758 |
|
2759 | var _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;
|
2764 | that._i = create(null);
|
2765 | that._f = undefined;
|
2766 | that._l = undefined;
|
2767 | that[SIZE] = 0;
|
2768 | if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);
|
2769 | });
|
2770 | redefineAll(C.prototype, {
|
2771 |
|
2772 |
|
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 |
|
2783 |
|
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 |
|
2800 |
|
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 |
|
2808 | while (entry && entry.r) entry = entry.p;
|
2809 | }
|
2810 | },
|
2811 |
|
2812 |
|
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 |
|
2828 | if (entry) {
|
2829 | entry.v = value;
|
2830 |
|
2831 | } else {
|
2832 | that._l = entry = {
|
2833 | i: index = fastKey(key, true),
|
2834 | k: key,
|
2835 | v: value,
|
2836 | p: prev = that._l,
|
2837 | n: undefined,
|
2838 | r: false
|
2839 | };
|
2840 | if (!that._f) that._f = entry;
|
2841 | if (prev) prev.n = entry;
|
2842 | that[SIZE]++;
|
2843 |
|
2844 | if (index !== 'F') that._i[index] = entry;
|
2845 | } return that;
|
2846 | },
|
2847 | getEntry: getEntry,
|
2848 | setStrong: function (C, NAME, IS_MAP) {
|
2849 |
|
2850 |
|
2851 | $iterDefine(C, NAME, function (iterated, kind) {
|
2852 | this._t = validate(iterated, NAME);
|
2853 | this._k = kind;
|
2854 | this._l = undefined;
|
2855 | }, function () {
|
2856 | var that = this;
|
2857 | var kind = that._k;
|
2858 | var entry = that._l;
|
2859 |
|
2860 | while (entry && entry.r) entry = entry.p;
|
2861 |
|
2862 | if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) {
|
2863 |
|
2864 | that._t = undefined;
|
2865 | return step(1);
|
2866 | }
|
2867 |
|
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 |
|
2874 | setSpecies(NAME);
|
2875 | }
|
2876 | };
|
2877 | var _collectionStrong_1 = _collectionStrong.getConstructor;
|
2878 | var _collectionStrong_2 = _collectionStrong.def;
|
2879 | var _collectionStrong_3 = _collectionStrong.getEntry;
|
2880 | var _collectionStrong_4 = _collectionStrong.setStrong;
|
2881 |
|
2882 | var _collectionStrong$1 = 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 |
|
2891 | var ITERATOR$4 = require$$0$7('iterator');
|
2892 | var SAFE_CLOSING = false;
|
2893 |
|
2894 | try {
|
2895 | var riter = [7][ITERATOR$4]();
|
2896 | riter['return'] = function () { SAFE_CLOSING = true; };
|
2897 | } catch (e) { }
|
2898 |
|
2899 | var _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) { }
|
2909 | return safe;
|
2910 | };
|
2911 |
|
2912 | var _iterDetect$1 = Object.freeze({
|
2913 | default: _iterDetect,
|
2914 | __moduleExports: _iterDetect
|
2915 | });
|
2916 |
|
2917 |
|
2918 |
|
2919 |
|
2920 |
|
2921 | var check = function (O, proto) {
|
2922 | anObject(O);
|
2923 | if (!isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!");
|
2924 | };
|
2925 | var _setProto = {
|
2926 | set: Object.setPrototypeOf || ('__proto__' in {} ?
|
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 | };
|
2942 | var _setProto_1 = _setProto.set;
|
2943 | var _setProto_2 = _setProto.check;
|
2944 |
|
2945 | var _setProto$1 = Object.freeze({
|
2946 | default: _setProto,
|
2947 | __moduleExports: _setProto,
|
2948 | set: _setProto_1,
|
2949 | check: _setProto_2
|
2950 | });
|
2951 |
|
2952 | var require$$0$b = ( _setProto$1 && _setProto ) || _setProto$1;
|
2953 |
|
2954 | var setPrototypeOf = require$$0$b.set;
|
2955 | var _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 |
|
2963 | var _inheritIfRequired$1 = Object.freeze({
|
2964 | default: _inheritIfRequired,
|
2965 | __moduleExports: _inheritIfRequired
|
2966 | });
|
2967 |
|
2968 | var $iterDetect = ( _iterDetect$1 && _iterDetect ) || _iterDetect$1;
|
2969 |
|
2970 | var inheritIfRequired = ( _inheritIfRequired$1 && _inheritIfRequired ) || _inheritIfRequired$1;
|
2971 |
|
2972 | var _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 |
|
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 |
|
3001 | var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance;
|
3002 |
|
3003 | var THROWS_ON_PRIMITIVES = require$$1(function () { instance.has(1); });
|
3004 |
|
3005 | var ACCEPT_ITERABLES = $iterDetect(function (iter) { new C(iter); });
|
3006 |
|
3007 | var BUGGY_ZERO = !IS_WEAK && require$$1(function () {
|
3008 |
|
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 |
|
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 |
|
3044 | var _collection$1 = Object.freeze({
|
3045 | default: _collection,
|
3046 | __moduleExports: _collection
|
3047 | });
|
3048 |
|
3049 | var strong = ( _collectionStrong$1 && _collectionStrong ) || _collectionStrong$1;
|
3050 |
|
3051 | var require$$0$c = ( _collection$1 && _collection ) || _collection$1;
|
3052 |
|
3053 | var SET = 'Set';
|
3054 |
|
3055 |
|
3056 | var es6_set = require$$0$c(SET, function (get) {
|
3057 | return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };
|
3058 | }, {
|
3059 |
|
3060 | add: function add(value) {
|
3061 | return strong.def(validate(this, SET), value = value === 0 ? 0 : value, value);
|
3062 | }
|
3063 | }, strong);
|
3064 |
|
3065 | var $some = require$$0$9(3);
|
3066 |
|
3067 | $export$1($export$1.P + $export$1.F * !require$$1$4([].some, true), 'Array', {
|
3068 |
|
3069 | some: function some(callbackfn /* , thisArg */) {
|
3070 | return $some(this, callbackfn, arguments[1]);
|
3071 | }
|
3072 | });
|
3073 |
|
3074 | var $sort = [].sort;
|
3075 | var test = [1, 2, 3];
|
3076 |
|
3077 | $export$1($export$1.P + $export$1.F * (require$$1(function () {
|
3078 |
|
3079 | test.sort(undefined);
|
3080 | }) || !require$$1(function () {
|
3081 |
|
3082 | test.sort(null);
|
3083 |
|
3084 | }) || !require$$1$4($sort)), 'Array', {
|
3085 |
|
3086 | sort: function sort(comparefn) {
|
3087 | return comparefn === undefined
|
3088 | ? $sort.call(toObject(this))
|
3089 | : $sort.call(toObject(this), aFunction(comparefn));
|
3090 | }
|
3091 | });
|
3092 |
|
3093 | var $filter = require$$0$9(2);
|
3094 |
|
3095 | $export$1($export$1.P + $export$1.F * !require$$1$4([].filter, true), 'Array', {
|
3096 |
|
3097 | filter: function filter(callbackfn /* , thisArg */) {
|
3098 | return $filter(this, callbackfn, arguments[1]);
|
3099 | }
|
3100 | });
|
3101 |
|
3102 | var $indexOf = require$$0$3(false);
|
3103 | var $native = [].indexOf;
|
3104 | var 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 |
|
3108 | indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
|
3109 | return NEGATIVE_ZERO
|
3110 |
|
3111 | ? $native.apply(this, arguments) || 0
|
3112 | : $indexOf(this, searchElement, arguments[1]);
|
3113 | }
|
3114 | });
|
3115 |
|
3116 |
|
3117 |
|
3118 | var $find = require$$0$9(5);
|
3119 | var KEY = 'find';
|
3120 | var forced = true;
|
3121 |
|
3122 | if (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 | });
|
3128 | require$$1$3(KEY);
|
3129 |
|
3130 | var dP$4 = dP$1.f;
|
3131 | var FProto = Function.prototype;
|
3132 | var nameRE = /^\s*function ([^ (]*)/;
|
3133 | var NAME$1 = 'name';
|
3134 |
|
3135 |
|
3136 | NAME$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 |
|
3147 | var $map = require$$0$9(1);
|
3148 |
|
3149 | $export$1($export$1.P + $export$1.F * !require$$1$4([].map, true), 'Array', {
|
3150 |
|
3151 | map: function map(callbackfn /* , thisArg */) {
|
3152 | return $map(this, callbackfn, arguments[1]);
|
3153 | }
|
3154 | });
|
3155 |
|
3156 | var GanttInvalidOp =
|
3157 |
|
3158 | function (_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 |
|
3172 |
|
3173 |
|
3174 |
|
3175 |
|
3176 | var has$1 = Object.prototype.hasOwnProperty;
|
3177 |
|
3178 |
|
3179 |
|
3180 |
|
3181 |
|
3182 |
|
3183 |
|
3184 | var toString$2 = Object.prototype.toString;
|
3185 |
|
3186 |
|
3187 |
|
3188 |
|
3189 |
|
3190 |
|
3191 |
|
3192 |
|
3193 | function isEmpty(val) {
|
3194 |
|
3195 | if (val == null) return true
|
3196 |
|
3197 |
|
3198 | if ('boolean' == typeof val) return false
|
3199 |
|
3200 |
|
3201 | if ('number' == typeof val) return val === 0
|
3202 |
|
3203 |
|
3204 | if ('string' == typeof val) return val.length === 0
|
3205 |
|
3206 |
|
3207 | if ('function' == typeof val) return val.length === 0
|
3208 |
|
3209 |
|
3210 | if (Array.isArray(val)) return val.length === 0
|
3211 |
|
3212 |
|
3213 | if (val instanceof Error) return val.message === ''
|
3214 |
|
3215 |
|
3216 | if (val.toString == toString$2) {
|
3217 | switch (val.toString()) {
|
3218 |
|
3219 |
|
3220 | case '[object File]':
|
3221 | case '[object Map]':
|
3222 | case '[object Set]': {
|
3223 | return val.size === 0
|
3224 | }
|
3225 |
|
3226 |
|
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 |
|
3238 | return false
|
3239 | }
|
3240 |
|
3241 |
|
3242 |
|
3243 |
|
3244 |
|
3245 |
|
3246 |
|
3247 | var lib = isEmpty;
|
3248 |
|
3249 |
|
3250 |
|
3251 |
|
3252 |
|
3253 | function 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 |
|
3271 | var arrayStartsWith_1 = createCommonjsModule(function (module, exports) {
|
3272 |
|
3273 | Object.defineProperty(exports, "__esModule", {
|
3274 | value: true
|
3275 | });
|
3276 | function 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 |
|
3286 | exports.default = arrayStartsWith;
|
3287 | });
|
3288 |
|
3289 | var arrayStartsWith = unwrapExports(arrayStartsWith_1);
|
3290 |
|
3291 | var arrayStartsWith$1 = Object.freeze({
|
3292 | default: arrayStartsWith,
|
3293 | __moduleExports: arrayStartsWith_1
|
3294 | });
|
3295 |
|
3296 | var _arrayStartsWith = ( arrayStartsWith$1 && arrayStartsWith ) || arrayStartsWith$1;
|
3297 |
|
3298 | var build = createCommonjsModule(function (module, exports) {
|
3299 |
|
3300 | Object.defineProperty(exports, "__esModule", {
|
3301 | value: true
|
3302 | });
|
3303 |
|
3304 |
|
3305 |
|
3306 | var _arrayStartsWith2 = _interopRequireDefault(_arrayStartsWith);
|
3307 |
|
3308 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
3309 |
|
3310 | exports.default = _arrayStartsWith2.default;
|
3311 | });
|
3312 |
|
3313 | var arrayStartsWith$2 = unwrapExports(build);
|
3314 |
|
3315 | function 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 |
|
3326 | var Task =
|
3327 |
|
3328 | function () {
|
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);
|
3410 |
|
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)
|
3515 |
|
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 |
|
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 |
|
3651 |
|
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 |
|
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 |
|
4131 | Task.OP_START = 'start';
|
4132 | Task.OP_FINISH = 'finish';
|
4133 |
|
4134 | function _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 |
|
4185 | var Project =
|
4186 |
|
4187 | function (_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 |
|
4230 | function project(name) {
|
4231 | return new Project(name);
|
4232 | }
|
4233 |
|
4234 | export { project, Project, Task };
|